Author: david
Date: Thu Dec  3 18:32:34 2009
New Revision: 4081

Log:
Add ISDF list action and template.

Added:
   trunk/apps/qubit/modules/function/actions/listAction.class.php   (contents, 
props changed)
   trunk/apps/qubit/modules/function/templates/listSuccess.php   (contents, 
props changed)

Added: trunk/apps/qubit/modules/function/actions/listAction.class.php
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/apps/qubit/modules/function/actions/listAction.class.php      Thu Dec 
 3 18:32:34 2009        (r4081)
@@ -0,0 +1,43 @@
+<?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/>.
+ */
+
+/**
+ * Show paginated list of functions.
+ *
+ * @package    qubit
+ * @subpackage function
+ * @author     David Juhasz <[email protected]>
+ * @version    svn:$Id$
+ */
+class FunctionListAction extends sfAction
+{
+  public function execute($request)
+  {
+    $criteria = new Criteria;
+    $criteria->addJoin(QubitObject::ID, QubitFunction::ID, 
Criteria::INNER_JOIN);
+    $criteria->addDescendingOrderByColumn(QubitObject::UPDATED_AT);
+
+    // Page results
+    $this->page = $this->getRequestParameter('page', 1);
+    $this->pager = new QubitPager('QubitFunction');
+    $this->pager->setCriteria($criteria);
+    $this->pager->setPage($this->page);
+    $this->pager->init();
+  }
+}
\ No newline at end of file

Added: trunk/apps/qubit/modules/function/templates/listSuccess.php
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/apps/qubit/modules/function/templates/listSuccess.php Thu Dec  3 
18:32:34 2009        (r4081)
@@ -0,0 +1,34 @@
+<div class="pageTitle"><?php echo __('list functions') ?></div>
+
+<table class="list">
+<thead>
+  <tr>
+    <th>
+      <?php echo __('name') ?>
+      <?php if (QubitAcl::check(new QubitFunction, 
QubitAclAction::CREATE_ID)): ?>
+        <span class="th-link"><?php echo link_to(__('add new'), array('module' 
=> 'function', 'action' => 'create')) ?></span>
+      <?php endif; ?>
+    </th>
+    <th><?php echo __('updated') ?></th>
+  </tr>
+</thead>
+
+<tbody>
+<?php foreach ($pager->getResults() as $func): ?>
+  <tr>
+    <td>
+    <?php if (QubitAcl::check($func, QubitAclAction::UPDATE_ID)): ?>
+      <?php echo 
link_to(render_title($func->getAuthorizedFormOfName(array('cultureFallback' => 
true))), array('module' => 'function', 'action' => 'show', 'id' => $func->id)) 
?>
+    <?php else: ?>
+      <?php echo 
link_to(render_title($func->getAuthorizedFormOfName(array('cultureFallback' => 
true))), array('module' => 'function', 'action' => 'show', 'id' => $func->id)) 
?>
+    <?php endif; ?>
+    </td>
+    <td>
+      <?php echo $func->updatedAt ?>
+    </td>
+  </tr>
+<?php endforeach; ?>
+</tbody>
+</table>
+
+<?php echo include_partial('default/pager', array('pager' => $pager)) ?>
\ No newline at end of file

--

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