Example #1
0
 public function publish()
 {
     parent::publish();
     $extra_id = JFactory::getApplication()->input->get('extra_id', 0, 'int');
     $extra_id_url = !empty($extra_id) ? '&extra_id=' . $extra_id : '';
     $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $extra_id_url, false));
 }
Example #2
0
 public function delete()
 {
     // Get items to remove from the request and reverse the order to delete child albums first
     $cid = JFactory::getApplication()->input->get('cid', array(), 'array');
     JFactory::getApplication()->input->set('cid', array_reverse($cid));
     parent::delete();
 }
Example #3
0
 public function __construct($config = array())
 {
     parent::__construct($config);
     global $ext_name, $ext_name_com;
     $this->ext_name = $ext_name;
     $this->ext_name_com = JFactory::getApplication()->input->get('extension', $ext_name_com, 'string');
 }
 /**
  * Overrides method to first lookup into potential extension for the view.
  * @since	1.5
  */
 protected function createView($name, $prefix = '', $type = '', $config = array())
 {
     $extensions = JoomleagueHelper::getExtensions(JRequest::getInt('p'));
     foreach ($extensions as $e => $extension) {
         $result = null;
         // Clean the view name
         $viewName = preg_replace('/[^A-Z0-9_]/i', '', $name);
         $classPrefix = preg_replace('/[^A-Z0-9_]/i', '', $prefix);
         $viewType = preg_replace('/[^A-Z0-9_]/i', '', $type);
         // Build the view class name
         $viewClassExtension = $classPrefix . $viewName . ucfirst($extension);
         if (!class_exists($viewClassExtension)) {
             jimport('joomla.filesystem.path');
             $path = JPath::find($this->paths['view'], $this->createFileName('view', array('name' => $viewName, 'type' => $viewType)));
             if ($path) {
                 require_once $path;
                 if (class_exists($viewClassExtension)) {
                     $result = new $viewClassExtension($config);
                     return $result;
                 }
             }
         } else {
             $result = new $viewClassExtension($config);
             return $result;
         }
     }
     // Still here ? Then the extension doesn't override this, use regular view
     return parent::createView($name, $prefix, $type, $config);
 }
Example #5
0
 public function delete()
 {
     parent::delete();
     $this->input = $this->input->post->get('trieda_id', 0, 'int');
     $this->setRedirect(JRoute::_('index.php?option=com_absolventi&view=ziacilist&trieda_id=' . $this->input, false));
     $this->redirect;
 }
Example #6
0
 public function publish()
 {
     parent::publish();
     if (!file_exists(JPATH_ADMINISTRATOR . '/components/com_jhackguard/data/.rules_need_update')) {
         file_put_contents(JPATH_ADMINISTRATOR . '/components/com_jhackguard/data/.rules_need_update', "1");
     }
 }
Example #7
0
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->registerTask('view_torrents', 'changeTypeYes');
     $this->registerTask('no_view_torrents', 'changeTypeNo');
     $this->registerTask('edit_torrents', 'changeTypeYes');
     $this->registerTask('no_edit_torrents', 'changeTypeNo');
     $this->registerTask('delete_torrents', 'changeTypeYes');
     $this->registerTask('no_delete_torrents', 'changeTypeNo');
     $this->registerTask('upload_torrents', 'changeTypeYes');
     $this->registerTask('no_upload_torrents', 'changeTypeNo');
     $this->registerTask('download_torrents', 'changeTypeYes');
     $this->registerTask('no_download_torrents', 'changeTypeNo');
     $this->registerTask('can_leech', 'changeTypeYes');
     $this->registerTask('no_can_leech', 'changeTypeNo');
     $this->registerTask('view_comments', 'changeTypeYes');
     $this->registerTask('no_view_comments', 'changeTypeNo');
     $this->registerTask('write_comments', 'changeTypeYes');
     $this->registerTask('no_write_comments', 'changeTypeNo');
     $this->registerTask('edit_comments', 'changeTypeYes');
     $this->registerTask('no_edit_comments', 'changeTypeNo');
     $this->registerTask('delete_comments', 'changeTypeYes');
     $this->registerTask('no_delete_comments', 'changeTypeNo');
     $this->registerTask('autopublish_comments', 'changeTypeYes');
     $this->registerTask('no_autopublish_comments', 'changeTypeNo');
     $this->registerTask('state', 'changeTypeYes');
     $this->registerTask('no_state', 'changeTypeNo');
 }
Example #8
0
 public function delete()
 {
     /*
      * получаем имя файла из записи по ID
      * удаляем файл
      * выполняем родительский метод
      */
     $cid = JFactory::getApplication()->input->get('cid', array(), 'array');
     if (is_array($cid) && count($cid) > 0) {
         $arFilesToDelete = array();
         foreach ($cid as $id) {
             $db = JFactory::getDBO();
             $q = "SELECT `id`, `filename` FROM #__downfiles WHERE id = {$id}";
             $res = $db->setQuery($q);
             $data_row = $res->loadAssoc();
             $arFilesToDelete[] = $data_row["filename"];
         }
         jimport('joomla.filesystem.file');
         foreach ($arFilesToDelete as $fname) {
             JFile::delete(JPATH_ROOT . '/' . $fname);
         }
     } else {
         JLog::add(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), JLog::WARNING, 'jerror');
     }
     parent::delete();
 }
Example #9
0
 function __construct()
 {
     parent::__construct();
     $this->registerTask("edit", "editAuthor");
     $this->registerTask("apply", "save");
     $this->_model = $this->getModel('Customer');
 }
Example #10
0
	/**
	 * Proxy for getModel.
	 */
	public function getModel($name = 'Cssmanager', $prefix = 'JEMModel', $config = array())
	{
		$model = parent::getModel($name, $prefix, array(
				'ignore_request' => true
		));
		return $model;
	}
Example #11
0
 /**
  * Proxy for getModel.
  * @since	2.5
  */
 public function getModel($name = 'TSJs', $prefix = 'TSJModel', $config = array('ignore_request' => true))
 {
     //JFactory::getApplication()->enqueueMessage('Debug: TSJControllerTSJs::getModel');
     $model = parent::getModel($name, $prefix, $config);
     //JFactory::getApplication()->enqueueMessage('Debug: TSJControllerTSJs::getModel model='.$model);
     return $model;
 }
Example #12
0
 function __construct()
 {
     parent::__construct();
     $this->registerDefaultTask('get_survey_list');
     $this->registerTask('surveys.publish', 'publish_list');
     $this->registerTask('surveys.unpublish', 'unpublish_list');
     $this->registerTask('publish_item', 'publish_item');
     $this->registerTask('unpublish_item', 'unpublish_item');
     $this->registerTask('surveys.delete', 'delete_surveys');
     $this->registerTask('set_private', 'set_private_survey');
     $this->registerTask('unset_private', 'unset_private_survey');
     $this->registerTask('set_anonymous', 'set_anonymous_survey');
     $this->registerTask('unset_anonymous', 'unset_anonymous_survey');
     $this->registerTask('set_publicperms', 'set_public_permissions');
     $this->registerTask('unset_publicperms', 'unset_public_permissions');
     $this->registerTask('refresh', 'refresh_counters');
     $this->registerTask('responses', 'get_responses');
     $this->registerTask('responses.delete', 'delete_responses');
     $this->registerTask('copy', 'copy_surveys');
     $this->registerTask('add', 'add_survey');
     $this->registerTask('edit', 'edit_survey');
     $lang = JFactory::getLanguage();
     $lang->load(S_APP_NAME, JPATH_ROOT);
     JLoader::import('joomla.application.component.model');
     JLoader::import('survey', JPATH_ROOT . DS . 'components' . DS . S_APP_NAME . DS . 'models');
 }
Example #13
0
 public function getModel($name = 'Profiles', $prefix = 'GAnalyticsModel')
 {
     if (JRequest::getVar('task', '') == 'delete' || JRequest::getVar('task', '') == 'profiles.delete') {
         $name = 'Profile';
     }
     $model = parent::getModel($name, $prefix, array('ignore_request' => true));
     return $model;
 }
Example #14
0
 /**
  * Removes an item.
  *
  * Overrides JControllerAdmin::delete to check the core.admin permission.
  *
  * @return  void
  *
  * @since   2.0
  */
 public function delete()
 {
     if (!JFactory::getUser()->authorise('core.admin', $this->option)) {
         JError::raiseError(500, JText::_('JERROR_ALERTNOAUTHOR'));
         jexit();
     }
     return parent::delete();
 }
Example #15
0
 public function getModel($name = '', $prefix = '', $config = array('ignore_request' => true))
 {
     $option = JRequest::getVar('option');
     $clearName = substr($option, 4);
     $prefix = ucfirst($clearName) . 'Model';
     $name = str_replace('s', '', str_replace(ucfirst($clearName) . 'Controller', '', get_class()));
     return parent::getModel($name, $prefix, $config);
 }
 /**
  * Method to publish a list of items
  *
  * @return  void
  */
 public function publish()
 {
     parent::publish();
     $project = JRequest::getUInt('filter_project');
     $topic = JRequest::getUInt('filter_topic');
     $link = 'index.php?option=' . $this->option . '&view=' . $this->view_list . '&filter_project=' . $project . '&filter_topic=' . $topic;
     $this->setRedirect(JRoute::_($link, false));
 }
Example #17
0
 public function __construct($config = array())
 {
     parent::__construct($config);
     $lang = JFactory::getLanguage();
     $lang->load(S_APP_NAME, JPATH_ROOT);
     JLoader::import('joomla.application.component.model');
     JLoader::import('survey', JPATH_ROOT . '/components/' . S_APP_NAME . '/models');
 }
Example #18
0
File: terms.php Project: JozefAB/qk
 /**
  * Save the manual order inputs from the terms list page.
  *
  * @return	void
  * @since	1.6
  */
 public function saveorder()
 {
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     // Get the arrays from the Request
     $order = JFactory::getApplication()->input->get('order', array(), 'array');
     $cids = JFactory::getApplication()->input->get('cid', array(), 'array');
     parent::saveorder();
 }
Example #19
0
 function __construct()
 {
     parent::__construct();
     $this->registerTask("apply", "save");
     $this->registerTask("save", "save");
     $this->_model = $this->getModel("Config");
     $this->app = JFactory::getApplication();
 }
Example #20
0
 /**
  * Proxy for getModel.
  * @since	1.6
  */
 public function getModel($name = 'Registration', $prefix = 'OSBITModel', $config = array())
 {
     if (!isset($config)) {
         $config = array();
     }
     $config['ignore_request'] = false;
     $model = parent::getModel($name, $prefix, $config);
     return $model;
 }
Example #21
0
 /**
  * Proxy for getModel.
  *
  * @param   string  $name    Model name
  * @param   string  $prefix  Prefix
  * @param   array   $config  configuration array
  *
  * @return  the model
  */
 public function getModel($name = null, $prefix = 'BabioonAdModel', $config = array('ignore_request' => true))
 {
     if (is_null($name)) {
         $name = BabioonAdHelper::toSingular($this->view_list);
     }
     // Note: Name in singular
     $model = parent::getModel($name, $prefix, $config);
     return $model;
 }
Example #22
0
 /**
  * Override the execute method to clear the plugin cache for non-display tasks.
  *
  * @param	string		The task to perform.
  * @return	mixed|false	The value returned by the called method, false in error case.
  * @since	1.6
  */
 public function execute($task)
 {
     parent::execute($task);
     // Clear the component's cache
     if ($task != 'display') {
         $cache = JFactory::getCache('com_plugins');
         $cache->clean();
     }
 }
Example #23
0
 /**
  * Method to get a model object, loading it if required.
  *
  * @param   string  $name    The model name. Optional.
  * @param   string  $prefix  The class prefix. Optional.
  * @param   array   $config  Configuration array for model. Optional.
  *
  * @return  object  The model.
  *
  * @since   12.2
  */
 public function getModel($name = "", $prefix = "JDeveloperModel", $config = array())
 {
     if (empty($name)) {
         $name = $this->model_item;
     }
     $config['ignore_request'] = true;
     $model = parent::getModel($name, $prefix, $config);
     return $model;
 }
 function __construct($config = array())
 {
     parent::__construct($config);
     $input = JFactory::getApplication()->input;
     $method = $input->get('task');
     if ($method) {
         $this->{$method}();
     }
 }
Example #25
0
 /**
  * Constructor.
  *
  * @param	array $config An optional associative array of configuration settings.
  * @see		JController
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->registerTask('unpublish', 'publish');
     $this->registerTask('archive', 'publish');
     $this->registerTask('trash', 'publish');
     $this->registerTask('orderup', 'reorder');
     $this->registerTask('orderdown', 'reorder');
     $this->setURL('index.php?option=com_solidres');
 }
 public function getModel($name = null, $prefix = null)
 {
     if ($prefix === null) {
         $prefix = "JoomlahaxeModel";
     }
     if ($name === null) {
         $name = "Joomlahaxes";
     }
     $model = parent::getModel($name, $prefix, array('ignore_request' => true));
     return $model;
 }
Example #27
0
 public function publish()
 {
     parent::publish();
     if (!$this->getError()) {
         $app = JFactory::getApplication();
         $link = 'index.php?option=' . $this->option . '&view=' . $this->view_list . '&filter_project=' . (int) $app->input->get('filter_project') . '&filter_album=' . (int) $app->input->get('filter_album') . '&id=' . (int) $app->input->get('id') . '&revision=' . (int) $app->input->get('revision');
         $this->setRedirect(JRoute::_($link, false));
         return true;
     }
     return false;
 }
Example #28
0
 public function display($cachable = false, $urlparams = false)
 {
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     // Set the model
     $model = $this->getModel('printfoods', '', array());
     $cid = JRequest::getVar('cid', '', 'post', 'ARRAY');
     $cid_url = http_build_query(array('cid' => $cid));
     // Preset the redirect
     $this->setRedirect(JRoute::_('index.php?option=com_sibdiet&view=printfoods&tmpl=component&print=1&' . $cid_url, false));
     return parent::display();
 }
 function saveorder()
 {
     $cid = JRequest::getVar('cid', array(), '', 'array');
     JArrayHelper::toInteger($cid);
     for ($i = 0; $i < count($cid); $i++) {
         if (!igGeneralHelper::authorise('core.edit.state', $cid[$i])) {
             return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
         }
     }
     parent::saveorder();
 }
Example #30
0
 /**
  * Custom Constructor
  */
 function __construct($default = array())
 {
     $user = JFactory::getUser();
     if (!JEVHelper::isAdminUser()) {
         JFactory::getApplication()->redirect("index.php?option=" . JEV_COM_COMPONENT . "&task=cpanel.cpanel", "Not Authorised - must be admin");
         return;
     }
     $default['default_task'] = 'edit';
     parent::__construct($default);
     $this->registerTask('apply', 'save');
 }