Author: jablko
Date: Mon Oct 25 17:32:08 2010
New Revision: 8495

Log:
Replace "static" action with "index" action

Replaced:
   trunk/apps/qubit/modules/staticpage/actions/indexAction.class.php
      - copied unchanged from r8490, 
trunk/apps/qubit/modules/staticpage/actions/staticAction.class.php
   trunk/apps/qubit/modules/staticpage/templates/indexSuccess.php
      - copied unchanged from r8490, 
trunk/apps/qubit/modules/staticpage/templates/staticSuccess.php
Deleted:
   trunk/apps/qubit/modules/staticpage/actions/staticAction.class.php
   trunk/apps/qubit/modules/staticpage/templates/staticSuccess.php

Copied: trunk/apps/qubit/modules/staticpage/actions/indexAction.class.php (from 
r8490, trunk/apps/qubit/modules/staticpage/actions/staticAction.class.php)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/apps/qubit/modules/staticpage/actions/indexAction.class.php   Mon Oct 
25 17:32:08 2010        (r8495, copy of r8490, 
trunk/apps/qubit/modules/staticpage/actions/staticAction.class.php)
@@ -0,0 +1,34 @@
+<?php
+
+/*
+ * This file is part of Qubit Toolkit.
+ *
+ * Qubit Toolkit is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Qubit Toolkit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Qubit Toolkit.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+class StaticPageStaticAction extends sfAction
+{
+  public function execute($request)
+  {
+    $criteria = new Criteria;
+    $criteria->add(QubitStaticPage::PERMALINK, $request->permalink);
+
+    $this->staticPage = QubitStaticPage::getOne($criteria);
+
+    if (!$this->staticPage instanceof QubitStaticPage)
+    {
+      $this->forward404();
+    }
+  }
+}

Copied: trunk/apps/qubit/modules/staticpage/templates/indexSuccess.php (from 
r8490, trunk/apps/qubit/modules/staticpage/templates/staticSuccess.php)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/apps/qubit/modules/staticpage/templates/indexSuccess.php      Mon Oct 
25 17:32:08 2010        (r8495, copy of r8490, 
trunk/apps/qubit/modules/staticpage/templates/staticSuccess.php)
@@ -0,0 +1,23 @@
+<div class="page">
+
+  <h1><?php echo render_title($staticPage->getTitle(array('cultureFallback' => 
true))) ?></h1>
+
+  <div>
+    <?php echo render_value($staticPage->getContent(array('cultureFallback' => 
true))) ?>
+  </div>
+
+  <?php if (SecurityCheck::HasPermission($sf_user, array('module' => 
'staticpage', 'action' => 'update'))): ?>
+    <div class="actions section">
+
+      <h2 class="element-invisible"><?php echo __('Actions') ?></h2>
+
+      <div class="content">
+        <ul class="links">
+          <li><?php echo link_to(__('Edit'), array($staticPage, 'module' => 
'staticpage', 'action' => 'edit'), array('title' => __('Edit this page'))) 
?></li>
+        </ul>
+      </div>
+
+    </div>
+  <?php endif; ?>
+
+</div>

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to