Ejemplo n.º 1
0
 /**
  * Load the datagrid
  */
 private function loadDataGrid()
 {
     // init var
     $items = array();
     // get modules
     $modules = BackendModel::getModules();
     // loop modules
     foreach ($modules as $module) {
         // build class name
         $className = 'Backend\\Modules\\' . $module . '\\Engine\\Model';
         if ($module == 'Core') {
             $className = 'Backend\\Core\\Engine\\Model';
         }
         // check if the getByTag-method is available
         if (is_callable(array($className, 'getByTag'))) {
             // make the call and get the item
             $moduleItems = (array) call_user_func(array($className, 'getByTag'), $this->id);
             // loop items
             foreach ($moduleItems as $row) {
                 // check if needed fields are available
                 if (isset($row['url'], $row['name'], $row['module'])) {
                     // add
                     $items[] = array('module' => \SpoonFilter::ucfirst(BL::lbl(\SpoonFilter::toCamelCase($row['module']))), 'name' => $row['name'], 'url' => $row['url']);
                 }
             }
         }
     }
     // create datagrid
     $this->dgUsage = new BackendDataGridArray($items);
     $this->dgUsage->setPaging(false);
     $this->dgUsage->setColumnsHidden(array('url'));
     $this->dgUsage->setHeaderLabels(array('name' => \SpoonFilter::ucfirst(BL::lbl('Title')), 'url' => ''));
     $this->dgUsage->setColumnURL('name', '[url]', \SpoonFilter::ucfirst(BL::lbl('Edit')));
     $this->dgUsage->addColumn('edit', null, \SpoonFilter::ucfirst(BL::lbl('Edit')), '[url]', BL::lbl('Edit'));
 }
Ejemplo n.º 2
0
 /**
  * Load the data grid for installed modules.
  */
 private function loadDataGridInstalled()
 {
     // create datagrid
     $this->dataGridInstalledModules = new BackendDataGridArray($this->installedModules);
     $this->dataGridInstalledModules->setSortingColumns(array('name'));
     $this->dataGridInstalledModules->setColumnsHidden(array('installed', 'raw_name', 'cronjobs_active'));
     // check if this action is allowed
     if (BackendAuthentication::isAllowedAction('DetailModule')) {
         $this->dataGridInstalledModules->setColumnURL('name', BackendModel::createURLForAction('DetailModule') . '&module=[raw_name]');
         $this->dataGridInstalledModules->addColumn('details', null, BL::lbl('Details'), BackendModel::createURLForAction('DetailModule') . '&module=[raw_name]', BL::lbl('Details'));
     }
     // add the greyed out option to modules that have warnings
     $this->dataGridInstalledModules->addColumn('hidden');
     $this->dataGridInstalledModules->setColumnFunction(array(new BackendExtensionsModel(), 'hasModuleWarnings'), array('[raw_name]'), array('hidden'));
 }
Ejemplo n.º 3
0
 /**
  * Load the data grid which contains the cronjobs.
  */
 private function loadDataGridCronjobs()
 {
     // no cronjobs = don't bother
     if (!isset($this->information['cronjobs'])) {
         return;
     }
     // create data grid
     $this->dataGridCronjobs = new BackendDataGridArray($this->information['cronjobs']);
     // hide columns
     $this->dataGridCronjobs->setColumnsHidden(array('minute', 'hour', 'day-of-month', 'month', 'day-of-week', 'action', 'description', 'active'));
     // add cronjob data column
     $this->dataGridCronjobs->addColumn('cronjob', BL::getLabel('Cronjob'), '[description]<br /><strong>[minute] [hour] [day-of-month] [month] [day-of-week]</strong> php ' . PATH_WWW . '/backend/cronjob module=<strong>' . $this->currentModule . '</strong> action=<strong>[action]</strong>', null, null, null, 0);
     // no paging
     $this->dataGridCronjobs->setPaging(false);
 }