Esempio n. 1
0
 /**
  * Load the data grid which contains the events.
  */
 private function loadDataGridTemplates()
 {
     // no hooks so dont bother
     if (!isset($this->information['templates'])) {
         return;
     }
     // build data for display in datagrid
     $templates = array();
     foreach ($this->information['templates'] as $template) {
         // set template name & path
         $record['name'] = $template['label'];
         $record['path'] = $template['path'];
         // set positions
         $record['positions'] = array();
         foreach ($template['positions'] as $position) {
             $record['positions'][] = $position['name'];
         }
         $record['positions'] = implode(', ', $record['positions']);
         // add template to list
         $templates[] = $record;
     }
     // create data grid
     $this->dataGridTemplates = new BackendDataGridArray($templates);
     // add label for path
     $this->dataGridTemplates->setHeaderLabels(array('path' => BL::msg('PathToTemplate')));
     // no paging
     $this->dataGridTemplates->setPaging(false);
 }
Esempio n. 2
0
 /**
  * Load the data grid with groups.
  *
  * @return	void
  */
 private function loadGroups()
 {
     // create the data grid
     $this->dgGroups = new BackendDataGridDB(BackendProfilesModel::QRY_DATAGRID_BROWSE_PROFILE_GROUPS, array($this->profile['id']));
     // sorting columns
     $this->dgGroups->setSortingColumns(array('group_name'), 'group_name');
     // disable paging
     $this->dgGroups->setPaging(false);
     // set column URLs
     $this->dgGroups->setColumnURL('group_name', BackendModel::createURLForAction('edit_profile_group') . '&id=[id]&profile_id=' . $this->id);
     // set column function
     $this->dgGroups->setColumnFunction(array('BackendDataGridFunctions', 'getLongDate'), array('[expires_on]'), 'expires_on', true);
     // edit column
     $this->dgGroups->addColumn('edit', null, BL::getLabel('Edit'), BackendModel::createURLForAction('edit_profile_group') . '&id=[id]&profile_id=' . $this->id, BL::getLabel('Edit'));
 }
Esempio n. 3
0
 /**
  * Load the datagrid with drafts
  *
  * @return	void
  */
 private function loadDrafts()
 {
     // create datagrid
     $this->dgDrafts = new BackendDataGridDB(BackendPagesModel::QRY_DATAGRID_BROWSE_SPECIFIC_DRAFTS, array($this->record['id'], 'draft', BL::getWorkingLanguage()));
     // hide columns
     $this->dgDrafts->setColumnsHidden(array('id', 'revision_id'));
     // disable paging
     $this->dgDrafts->setPaging(false);
     // set headers
     $this->dgDrafts->setHeaderLabels(array('user_id' => ucfirst(BL::lbl('By')), 'edited_on' => ucfirst(BL::lbl('LastEditedOn'))));
     // set colum URLs
     $this->dgDrafts->setColumnURL('title', BackendModel::createURLForAction('edit') . '&id=[id]&draft=[revision_id]');
     // set column-functions
     $this->dgDrafts->setColumnFunction(array('BackendDataGridFunctions', 'getUser'), array('[user_id]'), 'user_id');
     $this->dgDrafts->setColumnFunction(array('BackendDataGridFunctions', 'getTimeAgo'), array('[edited_on]'), 'edited_on');
     // add use column
     $this->dgDrafts->addColumn('use_draft', null, ucfirst(BL::lbl('UseThisDraft')), BackendModel::createURLForAction('edit') . '&id=[id]&draft=[revision_id]', BL::lbl('UseThisDraft'));
     // our JS needs to know an id, so we can highlight it
     $this->dgDrafts->setRowAttributes(array('id' => 'row-[revision_id]'));
 }