public function display($tpl = null) { $this->app = JFactory::getApplication(); $this->option = JRequest::getVar('option'); $canDo = JHelperContent::getActions($this->option); $this->clearName = substr($this->option, 4); $this->view = str_replace(ucfirst($this->clearName) . 'View', '', get_class()); $this->edit_view = strtolower(substr($this->view, 0, strlen($this->view) - 1)); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); ComponentHelper::addSubmenu($this->clearName); if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } foreach ($this->items as &$item) { $item->order_up = true; $item->order_dn = true; } $this->addToolbar(); if (!$canDo->get('core.show.giftcards') && !$canDo->get('core.show.groups')) { $this->app->redirect(JRoute::_('index.php?option=' . $this->option . '&view=searchs', false)); } $this->sidebar = JHtmlSidebar::render(); return parent::display($tpl); }
/** * Retrieves the instance of ComponentHelper for this project */ public static function getComponentHelper(Project $project) { if ($project === null) { return null; } $ph = $project->getReference(self::COMPONENT_HELPER_REFERENCE); if ($ph !== null) { return $ph; } $ph = new ComponentHelper(); $ph->setProject($project); $project->addReference(self::COMPONENT_HELPER_REFERENCE, $ph); return $ph; }
public function display($tpl = null) { $this->option = JRequest::getVar('option'); $this->clearName = substr($this->option, 4); $this->view = str_replace(ucfirst($this->clearName) . 'View', '', get_class()); $this->edit_view = strtolower(substr($this->view, 0, strlen($this->view) - 1)); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); ComponentHelper::addSubmenu($this->clearName); if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } foreach ($this->items as &$item) { $item->order_up = true; $item->order_dn = true; } $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); return parent::display($tpl); }
/** * Create a datatype instance and return reference to it * See createTask() for explanation how this works * * @param string Type name * @returns object A datatype object * @throws BuildException * Exception */ function createDataType($typeName) { return ComponentHelper::getComponentHelper($this)->createDataType($typeName); }
public function doAddTask($task, $classname, $classpath) { $ph = ComponentHelper::getComponentHelper($this->project); $ph->addTaskDefinition($task, $classname, $classpath); }
function include_component($component_name, $action = '', $data = array()) { $object = ComponentHelper::factory($component_name); $object->execute($data); }