Пример #1
0
 /**
  * Method to auto-populate the model state.
  *
  * Note. Calling getState in this method will result in recursion.
  *
  * @param   string  $ordering   An optional ordering field.
  * @param   string  $direction  An optional direction (asc|desc).
  *
  * @since	1.6
  *
  * @return  null
  */
 protected function populateState($ordering = null, $direction = null)
 {
     // Initialise variables.
     $app = JFactory::getApplication('administrator');
     // Load the parameters.
     $params = JComponentHelper::getParams('com_fabrik');
     $this->setState('params', $params);
     $published = $app->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
     $this->setState('filter.published', $published);
     $search = $app->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
     $this->setState('filter.search', $search);
     // Load the form state
     $form = $app->getUserStateFromRequest($this->context . '.filter.form', 'filter_form', '');
     $this->setState('filter.form', $form);
     // Load the group state
     $group = $app->getUserStateFromRequest($this->context . '.filter.group', 'filter_group', '');
     $this->setState('filter.group', $group);
     // Load the show in list state
     $showinlist = $app->getUserStateFromRequest($this->context . '.filter.showinlist', 'filter_showinlist', '');
     $this->setState('filter.showinlist', $showinlist);
     // Load the plug-in state
     $plugin = $app->getUserStateFromRequest($this->context . '.filter.plugin', 'filter_plugin', '');
     $this->setState('filter.plugin', $plugin);
     // List state information.
     parent::populateState($ordering, $direction);
 }
Пример #2
0
 /**
  * Method to auto-populate the model state.
  * Note. Calling getState in this method will result in recursion.
  *
  * @param   string  $ordering   An optional ordering field.
  * @param   string  $direction  An optional direction (asc|desc).
  *
  * @return  void
  */
 protected function populateState($ordering = null, $direction = null)
 {
     // Initialise variables.
     $app = JFactory::getApplication('administrator');
     // Load the parameters.
     $params = JComponentHelper::getParams('com_fabrik');
     $this->setState('params', $params);
     $published = $app->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
     $this->setState('filter.published', $published);
     $search = $app->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
     $this->setState('filter.search', $search);
     // Load the form state
     $package = $app->getUserStateFromRequest($this->context . '.filter.form', 'filter_form', '');
     $this->setState('filter.form', $package);
     // List state information.
     parent::populateState('name', 'asc');
 }
Пример #3
0
 /**
  * Method to get an array of data items.
  *
  * @return  mixed  An array of data items on success, false on failure.
  */
 public function getItems()
 {
     $items = parent::getItems();
     foreach ($items as &$i) {
         $n = $i->component_name . '_' . $i->version;
         $file = JPATH_ROOT . '/tmp/' . $i->component_name . '/pkg_' . $n . '.zip';
         $url = COM_FABRIK_LIVESITE . 'tmp/' . $i->component_name . '/pkg_' . $n . '.zip';
         if (JFile::exists($file)) {
             $i->file = '<a href="' . $url . '"><span class="icon-download"></span> pkg_' . $n . '.zip</a>';
         } else {
             $i->file = JText::_('COM_FABRIK_EXPORT_PACKAGE_TO_CREATE_ZIP');
         }
     }
     return $items;
 }