Esempio n. 1
0
 public function editorsAction()
 {
     $result = array('success' => false);
     $siteId = -1;
     $from = null;
     $to = null;
     if ($this->getCommonParams($siteId, $from, $to)) {
         $page = (int) $this->params()->fromQuery('page', 1);
         $perPage = (int) $this->params()->fromQuery('perPage', 10);
         $orderBy = $this->params()->fromQuery('orderBy');
         if (!$orderBy || $orderBy !== 'Revisions' && !DbViewRevisions::hasField($orderBy)) {
             $orderBy = 'Revisions';
             $order = Order::DESCENDING;
         } else {
             if ($this->params()->fromQuery('ascending', true)) {
                 $order = Order::ASCENDING;
             } else {
                 $order = Order::DESCENDING;
             }
         }
         $editors = $this->getEditorsPaginator($siteId, $from, $to, $orderBy, $order, $page, $perPage);
         $table = PaginatedTableFactory::createEditorsTable($editors);
         $renderer = $this->getServiceLocator()->get('ViewHelperManager')->get('partial');
         $table->getColumns()->setOrder($orderBy, $order === Order::ASCENDING);
         if ($renderer) {
             $result['success'] = true;
             $result['content'] = $renderer('partial/tables/table.phtml', array('table' => $table, 'data' => array('total' => $this->services->getRevisionService()->countSiteRevisions($siteId, $from, $to))));
         }
     }
     return new JsonModel($result);
 }
Esempio n. 2
0
 public function authorListAction()
 {
     $result = array('success' => false);
     $siteId = (int) $this->params()->fromQuery('siteId', $this->services->getUtilityService()->getSiteId());
     $page = (int) $this->params()->fromQuery('page', 1);
     $perPage = (int) $this->params()->fromQuery('perPage', 10);
     $orderBy = $this->params()->fromQuery('orderBy', AuthorSummaryConsts::PAGES);
     $order = $this->params()->fromQuery('ascending', false);
     if ($order) {
         $order = Order::ASCENDING;
     } else {
         $order = Order::DESCENDING;
     }
     $table = $this->getAuthorsTable($siteId, $orderBy, $order, $page, $perPage);
     $renderer = $this->getServiceLocator()->get('ViewHelperManager')->get('partial');
     if ($renderer) {
         $result['success'] = true;
         $result['content'] = $renderer('partial/tables/table.phtml', array('table' => $table));
     }
     return new JsonModel($result);
 }
Esempio n. 3
0
 public function generateConstsAction()
 {
     $this->services->getUtilityService()->generateDbConstants();
     return $this->redirect()->toRoute('home');
 }