function __construct($config = array()) { // Set a base path for use by the controller if (array_key_exists('base_path', $config)) { $this->_basePath = $config['base_path']; } else { $this->_basePath = JPATH_COMPONENT_ADMINISTRATOR; } parent::__construct($config); $this->registerTask('add', 'edit'); $this->registerTask('new', 'edit'); $this->registerTask('apply', 'save'); $this->registerTask('savenew', 'save'); $this->registerTask('remove', 'delete'); $this->registerTask('publish', 'enable'); $this->registerTask('unpublish', 'enable'); $this->registerTask('disable', 'enable'); $this->registerTask('saveorder', 'ordering'); $this->registerTask('prev', 'jump'); $this->registerTask('next', 'jump'); $this->registerTask('saveprev', 'save'); $this->registerTask('savenext', 'save'); $this->registerTask('page_tooltip_enable', 'pagetooltip_switch'); $this->registerTask('page_tooltip_disable', 'pagetooltip_switch'); $this->registerTask('save_as', 'save'); $this->registerTask('published.enable', 'boolean'); $this->registerTask('published.disable', 'boolean'); }
/** * constructor */ function __construct($config = array()) { parent::__construct($config); $this->set('suffix', 'dashboard'); // Set a base path for use by the controller if (array_key_exists('base_path', $config)) { $this->_basePath = $config['base_path']; } else { $this->_basePath = JPATH_COMPONENT; } // Register Extra tasks $this->registerTask('list', 'display'); $this->registerTask('close', 'cancel'); }
/** * Displays item * @return void */ function view() { $model = $this->getModel($this->get('suffix')); $model->getId(); $row = $model->getItem(); if (empty($row->published)) { $table = $model->getTable(); $table->load($row->id); $table->published = 1; if ($table->save()) { $redirect = "index.php?option=com_sample&view=" . $this->get('suffix') . "&task=view&id=" . $model->getId(); $redirect = JRoute::_($redirect, false); $this->setRedirect($redirect); return; } } parent::view(); }
/** * constructor */ function __construct() { parent::__construct(); $this->set('suffix', 'dashboard'); }
/** * constructor */ function __construct() { parent::__construct(); $this->set('suffix', 'config'); }