/** * Method to render the view. * * @return string The rendered view. * * @throws RuntimeException */ public function render() { $this->item = $this->model->getStatus(); if ($this->getLayout() == null) { $this->setLayout('default'); } $this->form = $this->model->getForm(); $this->addToolbar(); return parent::render(); }
/** * Method to render the view. * * @return string The rendered view. * * @since 12.1 * @throws RuntimeException */ public function render() { $this->prefix = 'status'; $status = $this->model->getAllStatus(); $this->items = $status; $user = JFactory::getUser(); $this->canEditProjects = $user->authorise('project.edit', 'com_monitor'); $this->canEditStatus = $user->authorise('status.edit', 'com_monitor'); $this->setLayout('default'); $this->addToolbar(); return parent::render(); }
/** * Execute the controller. * * @return boolean True if controller finished execution, false if the controller did not * finish execution. A controller might return false if some precondition for * the controller to run has not been satisfied. * * @since 12.1 * @throws LogicException * @throws RuntimeException */ public function execute() { if (!JFactory::getUser()->authorise('status.delete', 'com_monitor')) { throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $app = JFactory::getApplication(); $model = new MonitorModelStatus($app); $model->delete($app->input->get('cid', array(), 'array')); $app->enqueueMessage(JText::_('COM_MONITOR_STATUS_DELETED')); $app->redirect(JRoute::_('index.php?option=com_monitor&view=status', false)); return true; }
/** * Execute the controller. * * @return boolean True if controller finished execution, false if the controller did not * finish execution. A controller might return false if some precondition for * the controller to run has not been satisfied. * * @since 12.1 * @throws LogicException * @throws RuntimeException */ public function execute() { if (!JFactory::getUser()->authorise('status.edit', 'com_monitor')) { throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $app = JFactory::getApplication(); $model = new MonitorModelStatus($app); $cid = $this->input->get('cid', array(), 'array'); $id = $cid ? $cid[0] : $this->input->getInt('id'); $model->order($id, false); $app->enqueueMessage(JText::_('JLIB_APPLICATION_SUCCESS_ITEM_REORDERED')); $app->redirect(JRoute::_('index.php?option=com_monitor&view=status', false)); return true; }
/** * Execute the controller. * * @return boolean True if controller finished execution, false if the controller did not * finish execution. A controller might return false if some precondition for * the controller to run has not been satisfied. * * @since 12.1 * @throws LogicException * @throws RuntimeException */ public function execute() { if (!JFactory::getUser()->authorise('status.edit', 'com_monitor')) { throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $app = JFactory::getApplication(); $model = new MonitorModelStatus($app); $cid = $this->input->get('cid', array(), 'array'); $id = $cid ? $cid[0] : $this->input->getInt('id'); $model->setDefault($id); $app->enqueueMessage(JText::_('COM_MONITOR_STATUS_NEW_DEFAULT')); $app->redirect(JRoute::_('index.php?option=com_monitor&view=status', false)); return true; }
/** * Execute the controller. * * @return boolean True if controller finished execution, false if the controller did not * finish execution. A controller might return false if some precondition for * the controller to run has not been satisfied. * * @since 12.1 * @throws LogicException * @throws RuntimeException */ public function execute() { if (!JFactory::getUser()->authorise('status.edit', 'com_monitor')) { throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $model = new MonitorModelStatus(); $cid = $this->input->get('cid', array(), 'array'); $id = $cid ? $cid[0] : $this->input->getInt('id'); $model->setStatusId($id); $model->loadForm(); $view = new MonitorViewStatusHtml($model); $view->setLayout('edit'); echo $view->render(); return true; }
/** * Execute the controller. * * @return boolean True if controller finished execution, false if the controller did not * finish execution. A controller might return false if some precondition for * the controller to run has not been satisfied. * * @since 12.1 * @throws LogicException * @throws RuntimeException */ public function execute() { if (!JFactory::getUser()->authorise('status.edit', 'com_monitor')) { throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $app = JFactory::getApplication(); $model = new MonitorModelStatus($app); if ($model->save($app->input) === false) { $app->redirect(JRoute::_('index.php?option=com_monitor&task=status.edit&id=' . $app->input->getInt('id'), false)); } else { $app->enqueueMessage(JText::_('COM_MONITOR_STATUS_SAVED')); $app->redirect(JRoute::_('index.php?option=com_monitor&view=status', false)); } return true; }