Exemplo n.º 1
0
 /**
  * 
  * @param type $params
  */
 public static function saveSettings($params)
 {
     $oPlugin = JchPlatformPlugin::getPlugin();
     $oPlugin->params = $params->toArray();
     $oData = new JRegistry($oPlugin);
     $aData = $oData->toArray();
     $oController = new JControllerLegacy();
     $oController->addModelPath(JPATH_ADMINISTRATOR . '/components/com_plugins/models', 'PluginsModel');
     $oPluginModel = $oController->getModel('Plugin', 'PluginsModel');
     if ($oPluginModel->save($aData) === FALSE) {
         JchOptimizeLogger::log(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $oPluginModel->getError()), $params);
     }
 }
Exemplo n.º 2
0
 /**
  * Method to display a view.
  *
  * @param	boolean			If true, the view output will be cached
  * @param	array			An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return	JController		This object to support chaining.
  * @since	1.5
  */
 public function display($cachable = false, $urlparams = false)
 {
     $cachable = true;
     $safeurlparams = array('catid' => 'INT', 'id' => 'INT', 'cid' => 'ARRAY', 'year' => 'INT', 'month' => 'INT', 'limit' => 'UINT', 'limitstart' => 'UINT', 'showall' => 'INT', 'return' => 'BASE64', 'filter' => 'STRING', 'filter_order' => 'CMD', 'filter_order_Dir' => 'CMD', 'filter-search' => 'STRING', 'print' => 'BOOLEAN', 'lang' => 'CMD');
     parent::display($cachable, $safeurlparams);
     return $this;
 }
Exemplo n.º 3
0
 public function display($cachable = false, $urlparams = false)
 {
     JRequest::setVar('view', JRequest::getCmd('view', 'Orphans'));
     if (isset($_POST['_orphanaction']) && $_POST['_orphanaction'] == "zipIt") {
         $file = tempnam("tmp", "zip");
         $zip = new ZipArchive();
         $zip->open($file, ZipArchive::OVERWRITE);
         foreach ($_POST['tozip'] as $_file) {
             $zip->addFile(JPATH_ROOT . "/" . $_file, $_file);
         }
         $zip->close();
         header('Content-Type: application/zip');
         header('Content-Length: ' . filesize($file));
         header('Content-Disposition: attachment; filename="orphans.zip"');
         readfile($file);
         unlink($file);
         die;
     } else {
         if (isset($_POST['_orphanaction']) && $_POST['_orphanaction'] == "delete" && isset($_POST['_confirmAction'])) {
             foreach ($_POST['tozip'] as $_file) {
                 unlink(JPATH_ROOT . "/" . $_file);
             }
         }
     }
     // call parent behavior
     parent::display($cachable);
 }
Exemplo n.º 4
0
 public function display($cachable = false, $urlparams = array())
 {
     $viewName = $this->input->getCmd('view', 'dashboard');
     $this->input->set("view", $viewName);
     parent::display();
     return $this;
 }
Exemplo n.º 5
0
 function display($cachable = false, $urlparams = false)
 {
     switch (JRequest::getVar('task')) {
         case 'login':
             $this->LoginJUser();
             break;
         case 'create':
             $this->create_user();
             break;
         case 'create_proceed':
             $this->create_proceed();
             break;
         case 'logout':
             $this->logout();
             break;
         case 'switch':
             $this->distroy_fb_session();
             break;
         default:
             break;
     }
     switch (JRequest::getVar('view')) {
         default:
             JRequest::setVar('view', 'fbconnct');
     }
     parent::display();
 }
Exemplo n.º 6
0
 function __construct($config = array())
 {
     parent::__construct($config);
     $this->registerTask('add', 'edit');
     checkAccessController("orders");
     addSubmenu("orders");
 }
Exemplo n.º 7
0
 public function __construct()
 {
     parent::__construct();
     $this->useSSL = VmConfig::get('useSSL', 0);
     $this->useXHTML = false;
     VmConfig::loadJLang('com_virtuemart_shoppers', TRUE);
 }
Exemplo n.º 8
0
 function display($cachable = false, $urlparams = array())
 {
     // set default view if not set
     JRequest::setVar("view", JFactory::getApplication()->input->get("view", "Dashboard"));
     // call parent behavior
     parent::display($cachable, $urlparams);
 }
Exemplo n.º 9
0
 /**
  * Method to display a view.
  *
  * @param   boolean  $cachable   If true, the view output will be cached
  * @param   array    $urlparams  An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return	JController  A JController object to support chaining.
  *
  * @since	2.0
  */
 public function display($cachable = false, $urlparams = false)
 {
     // Get the document object.
     $document = JFactory::getDocument();
     // Get the input class
     $input = JFactory::getApplication()->input;
     // Set the default view name and format from the Request.
     $vName = $input->get('view', 'default', 'cmd');
     $vFormat = $document->getType();
     $lName = $input->get('layout', 'default', 'cmd');
     $id = $input->get('id', null, 'cmd');
     if ($vName == 'default') {
         $input->set('view', 'settings');
         $input->set('layout', 'base');
         $lName = $input->get('layout', 'default', 'cmd');
         $vName = 'settings';
     }
     // Check for edit form.
     if ($vName == 'item' && $lName == 'edit' && !$this->checkEditId('com_shconfig.edit.item', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_shconfig&view=items', false));
         return false;
     }
     // Add the submenu
     ShconfigHelper::addSubmenu($vName, $lName);
     parent::display($cachable, $urlparams);
     return $this;
 }
 function __construct()
 {
     parent::__construct();
     $this->_db = JFactory::getDBO();
     $doc = JFactory::getDocument();
     $doc->addScript(JURI::root(true) . '/components/com_rsform/assets/js/script.js');
 }
Exemplo n.º 11
0
 /**
  * display task
  *
  * @return void
  */
 function display($cachable = false, $urlparams = false)
 {
     // set default view if not set
     $view = $this->input->getCmd('view', '###SITE_DEFAULT_VIEW###');
     $isEdit = $this->checkEditView($view);
     $layout = $this->input->get('layout', null, 'WORD');
     $id = $this->input->getInt('id');
     $cachable = true;
     // Check for edit form.
     if ($isEdit) {
         if ($layout == 'edit' && !$this->checkEditId('com_componentbuilder.edit.' . $view, $id)) {
             // Somehow the person just went to the form - we don't allow that.
             $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
             $this->setMessage($this->getError(), 'error');
             // check if item was opend from other then its own list view
             $ref = $this->input->getCmd('ref', 0);
             $refid = $this->input->getInt('refid', 0);
             // set redirect
             if ($refid > 0 && ComponentbuilderHelper::checkString($ref)) {
                 // redirect to item of ref
                 $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=' . (string) $ref . '&layout=edit&id=' . (int) $refid, false));
             } elseif (ComponentbuilderHelper::checkString($ref)) {
                 // redirect to ref
                 $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=' . (string) $ref, false));
             } else {
                 // normal redirect back to the list default site view
                 $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=###SITE_DEFAULT_VIEW###', false));
             }
             return false;
         }
     }
     return parent::display($cachable, $urlparams);
 }
 public function display($cachable = false, $urlparams = false)
 {
     require_once JPATH_COMPONENT . '/helpers/djmediatools.php';
     DJMediatoolsHelper::addSubmenu($view = JRequest::getCmd('view', 'cpanel'));
     parent::display();
     return $this;
 }
Exemplo n.º 13
0
 /**
  * Method to display a view.
  *
  * @param   boolean  $cachable   If true, the view output will be cached.
  * @param   boolean  $urlparams  An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return  JController  This object to support chaining.
  *
  * @since   1.5
  */
 public function display($cachable = false, $urlparams = false)
 {
     $cachable = true;
     /**
      * Set the default view name and format from the Request.
      * Note we are using a_id to avoid collisions with the router and the return page.
      * Frontend is a bit messier than the backend.
      */
     $id = $this->input->getInt('a_id');
     $vName = $this->input->getCmd('view', 'categories');
     $this->input->set('view', $vName);
     $user = JFactory::getUser();
     if ($user->get('id') || $this->input->getMethod() == 'POST' && ($vName == 'category' && $this->input->get('layout') != 'blog' || $vName == 'archive')) {
         $cachable = false;
     }
     $safeurlparams = array('catid' => 'INT', 'id' => 'INT', 'cid' => 'ARRAY', 'year' => 'INT', 'month' => 'INT', 'limit' => 'UINT', 'limitstart' => 'UINT', 'showall' => 'INT', 'return' => 'BASE64', 'filter' => 'STRING', 'filter_order' => 'CMD', 'filter_order_Dir' => 'CMD', 'filter-search' => 'STRING', 'print' => 'BOOLEAN', 'lang' => 'CMD', 'Itemid' => 'INT');
     // Check for edit form.
     if ($vName == 'form' && !$this->checkEditId('com_content.edit.article', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         return JError::raiseError(403, JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
     }
     if ($vName == 'article' && $cachable) {
         // Get/Create the model
         if ($model = $this->getModel($vName)) {
             $model->hit();
         }
     }
     parent::display($cachable, $safeurlparams);
     return $this;
 }
Exemplo n.º 14
0
    /**
     * objektum generálás
     */
    function __construct()
    {
        parent::__construct();
        // ============================== FIGYELEM Ha több szüro mezo van akkor át kell írni! ===================
        $this->state = JSON_decode('{
		"orderCol":"1", 
		"orderDir":"asc",
		"filterStr":"",
		"limitstart":0,
		"limit":10,
		"id":""
		}
		');
        $this->message = JSON_decode('{
		"txt":"",
		"class":"msg"
		}
	    ');
        if (file_exists(JPATH_COMPONENT . '/helpers/mvceditor.php')) {
            include_once JPATH_COMPONENT . '/helpers/mvceditor.php';
            $this->helper = new mvceditorHelper();
        }
        if (file_exists(JPATH_COMPONENT . '/helpers/components.php')) {
            include_once JPATH_COMPONENT . '/helpers/components.php';
            $this->componentHelper = new componentsHelper();
        }
    }
Exemplo n.º 15
0
 function edit()
 {
     JRequest::setVar('layout', 'form');
     JRequest::setVar('view', 'countries');
     JRequest::setVar('hidemainmenu', 1);
     parent::display();
 }
Exemplo n.º 16
0
 public function save()
 {
     $task = JRequest::getVar('task', null, 'POST');
     $view = JRequest::getVar('view', '');
     $model = $this->getModel('tudien', 'DmttcnModel');
     if ($model->storeData()) {
         $msg = 'Xử lý thành công!';
     } else {
         $msg = 'Xử lý lỗi.';
     }
     if ($task == 'savenew') {
         $link = 'index.php?option=com_dmttcn&controller=' . $view . '&task=edit';
         $this->setRedirect($link, $msg);
     } else {
         if ($task == 'save') {
             $link = 'index.php?option=com_dmttcn&controller=' . $view;
             $this->setRedirect($link, $msg);
         } else {
             $post = JRequest::get('post');
             JRequest::setVar('post', $post);
             JRequest::setVar('view', $view);
             JRequest::setVar('layout', 'edit');
             parent::display();
         }
     }
 }
Exemplo n.º 17
0
 /**
  * Typical view method for MVC based architecture
  *
  * This function is provide as a default implementation, in most cases
  * you will need to override it in your own controllers.
  *
  * @param   boolean  $cachable   If true, the view output will be cached
  * @param   array    $urlparams  An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return  JControllerLegacy  A JControllerLegacy object to support chaining.
  */
 public function display($cachable = false, $urlparams = array())
 {
     $input = JFactory::getApplication()->input;
     $input->set('view', $input->get('view', 'dashboard'));
     $input->set('task', $input->get('task', 'display'));
     return parent::display($cachable, $urlparams);
 }
 public function display($cachable = false, $urlparams = false)
 {
     // Load the submenu.
     $this->addSubmenu($this->input->getWord('option', 'com_checkin'));
     parent::display();
     return $this;
 }
Exemplo n.º 19
0
 function add()
 {
     $swt = JRequest::getVar('swt', '');
     JRequest::setVar('view', 'swtturnierinfo');
     JRequest::setVar('swt', $swt);
     parent::display();
 }
Exemplo n.º 20
0
 function modal()
 {
     JRequest::setVar('layout', 'modal');
     JRequest::setVar('view', 'events');
     JRequest::setVar('hidemainmenu', 1);
     parent::display();
 }
Exemplo n.º 21
0
 /**
  * Constructor.
  *
  * @param   array  $config  An optional associative array of configuration settings.
  *
  * @see     JControllerLegacy
  * @since   12.2
  * @throws  Exception
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     // Define standard task mappings.
     // Value = 0
     $this->registerTask('unpublish', 'publish');
     // Value = 2
     $this->registerTask('archive', 'publish');
     // Value = -2
     $this->registerTask('trash', 'publish');
     // Value = -3
     $this->registerTask('report', 'publish');
     $this->registerTask('orderup', 'reorder');
     $this->registerTask('orderdown', 'reorder');
     // Guess the option as com_NameOfController.
     if (empty($this->option)) {
         $this->option = 'com_' . strtolower($this->getName());
     }
     // Guess the JText message prefix. Defaults to the option.
     if (empty($this->text_prefix)) {
         $this->text_prefix = strtoupper($this->option);
     }
     // Guess the list view as the suffix, eg: OptionControllerSuffix.
     if (empty($this->view_list)) {
         $r = null;
         if (!preg_match('/(.*)Controller(.*)/i', get_class($this), $r)) {
             throw new Exception(JText::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500);
         }
         $this->view_list = strtolower($r[2]);
     }
 }
Exemplo n.º 22
0
 /**
  * {@inheritdoc}
  *
  * @param   boolean $cachable  If Joomla should cache the response
  * @param   array   $urlParams URL parameters
  *
  * @return JController
  */
 public function display($cachable = false, $urlParams = array())
 {
     $input = $this->input;
     $view = $input->getCmd('view', 'dashboard');
     $app = JFactory::getApplication();
     if (NenoSettings::get('installation_completed') != 1 && $view != 'installation' && $view != 'debug' && $app->isAdmin()) {
         if ($view != 'dashboard') {
             $app->enqueueMessage(JText::_('COM_NENO_INSTALLATION_ERROR'), 'error');
         }
         $app->redirect('index.php?option=com_neno&view=installation');
     }
     $input->set('view', $view);
     // Ensure that a working language is set for some views
     $viewsThatRequireWorkingLanguage = array('groupselements', 'editor', 'strings');
     $showLanguagesDropDown = false;
     if (in_array($view, $viewsThatRequireWorkingLanguage)) {
         // Get working language
         $workingLanguage = NenoHelper::getWorkingLanguage();
         $languages = JFactory::getLanguage()->getKnownLanguages();
         $showLanguagesDropDown = true;
         if (empty($workingLanguage) || !in_array($workingLanguage, array_keys($languages))) {
             $url = JRoute::_('index.php?option=com_neno&view=setworkinglang&next=' . $view, false);
             $this->setRedirect($url);
             $this->redirect();
         }
     }
     NenoHelperBackend::setAdminTitle($showLanguagesDropDown);
     parent::display($cachable, $urlParams);
     return $this;
 }
Exemplo n.º 23
0
 function __construct()
 {
     parent::__construct();
     $this->registerDefaultTask('get_tags_listing');
     $this->registerTask('get_tag', 'get_tag_details');
     $this->registerTask('save_tag', 'save_tag_details');
 }
Exemplo n.º 24
0
 /**
  * display the edit form
  * @return void
  */
 function edit()
 {
     JRequest::setVar('view', 'wall_detail');
     JRequest::setVar('layout', 'form');
     JRequest::setVar('hidemainmenu', 1);
     parent::display();
 }
 public function display($cachable = false, $url_params = false)
 {
     $user =& JFactory::getUser();
     $view = JRequest::getVar("view");
     if ($view == 'advancedopenportal') {
         JRequest::setVar("view", "listcases");
         $view = "listcases";
     }
     if (SugarCasesConnection::isValidPortalUser($user) && !SugarCasesConnection::isUserBlocked($user)) {
         parent::display($cachable, $url_params);
     } else {
         if (!$user->id) {
             $msg = JText::_('COM_ADVANCEDOPENPORTAL_LOGIN_REQUIRED');
         } elseif (SugarCasesConnection::isUserBlocked($user)) {
             $msg = JText::_('COM_ADVANCEDOPENPORTAL_PORTAL_USER_BLOCKED');
         } else {
             $msg = JText::_('COM_ADVANCEDOPENPORTAL_NO_PORTAL_ACCOUNT');
         }
         if ($view != 'listcases') {
             JFactory::getApplication()->redirect(JURI::base(), $msg, 'error');
         } else {
             JFactory::getApplication()->enqueueMessage($msg, 'error');
             parent::display($cachable, $url_params);
         }
     }
 }
Exemplo n.º 26
0
 /**
  * display task
  *
  * @return void
  */
 function display($cachable = false, $urlparams = array())
 {
     // set default view if not set
     JRequest::setVar('view', JRequest::getCmd('view', 'websockets'));
     // call parent behavior
     parent::display($cachable, $urlparams);
 }
Exemplo n.º 27
0
 /**
  * display task
  *
  * @param bool  $cachable
  * @param array $urlparams
  *
  * @throws Exception
  * @return void
  */
 function display($cachable = false, $urlparams = [])
 {
     // set default view if not set
     $input = JFactory::getApplication()->input;
     // call parent behavior
     parent::display($cachable);
 }
 function showExtras()
 {
     //$log = Logger::getInstance(JPATH_COMPONENT."/logs/site-log-".date("d-m-Y").'.log',1);
     //$log->LogDebug("showExtras");
     //add room if does not exist
     $reservedItems = JRequest::getVar("reservedItems");
     $hotelId = JRequest::getVar("hotelId");
     UserDataService::updateRooms($hotelId, $reservedItems);
     $userData = UserDataService::getUserData();
     $userData->hotelId = $hotelId;
     $appSetting = JHotelUtil::getApplicationSettings();
     if (!isset($userData->currency)) {
         $hotel = HotelService::getHotel($hotelId);
         UserDataService::setCurrency($hotel->hotel_currency, $hotel->currency_symbol);
     }
     //dump($userData->reservedItems);
     //dump($userData->hotelId);
     //$log->LogDebug(serialize($userData->reservedItems));
     $model = $this->getModel("ExtraOptions");
     $extraOptions = $model->getExtraOptions();
     if (count($extraOptions) > 0 && PROFESSIONAL_VERSION == 1 && $appSetting->is_enable_extra_options) {
         //dump("show extra view");
         JRequest::setVar("view", "extraoptions");
         parent::display();
     } else {
         if (count($userData->reservedItems) < $userData->rooms) {
             $this->setRedirect(JRoute::_('index.php?option=com_jhotelreservation&task=hotel.showHotel&hotel_id=' . $userData->hotelId . "&reservedItems=" . $reservedItems, false));
         } else {
             $this->setRedirect(JRoute::_('index.php?option=com_jhotelreservation&view=guestDetails&reservedItems=' . $reservedItems, false));
         }
     }
     //exit;
     //$log->LogDebug(serialize($userData->reservedItems));
     //$log->LogDebug("End showExtras");
 }
Exemplo n.º 29
0
 /**
  * Constructor
  */
 function __construct($config = array())
 {
     parent::__construct($config);
     // Register Extra tasks
     $this->registerTask('add', 'edit');
     $this->registerTask('apply', 'save');
 }
Exemplo n.º 30
0
 function __construct()
 {
     parent::__construct();
     $view = $this->input->get('view', 'uploadform');
     $layout = $this->input->get('layout', '');
     $this->setRedirect(JRoute::_('index.php?option=com_fileuploadform' . (!empty($view) ? '&view=' . $view : '') . (!empty($layout) ? '&layout=' . $layout : ''), false));
 }