AAAA.htaccess000066600000000177151371735740006370 0ustar00 Order allow,deny Deny from all index.html000066600000000037151371735740006562 0ustar00 application/.htaccess000066600000000177151371735750010674 0ustar00 Order allow,deny Deny from all application/default_navigation.php000066600000001707151371735750013452 0ustar00 application/index.html000066600000000037151371735750011066 0ustar00 views/index.html000066600000000037151372050040007677 0ustar00 views/component/view.html.php000066600000001742151372050040012336 0ustar00get('Form'); $component = $this->get('Component'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } // Bind the form to the data. if ($form && $component->params) { $form->bind($component->params); } $this->assignRef('form', $form); $this->assignRef('component', $component); $this->document->setTitle(JText::_('JGLOBAL_EDIT_PREFERENCES')); parent::display($tpl); JRequest::setVar('hidemainmenu', true); } } views/component/tmpl/.htaccess000066600000000177151372050040012463 0ustar00 Order allow,deny Deny from all views/component/tmpl/index.html000066600000000037151372050040012655 0ustar00 views/component/tmpl/default.php000066600000005172151372050040013022 0ustar00getTemplate(); // Load the tooltip behavior. JHtml::_('behavior.tooltip'); JHtml::_('behavior.formvalidation'); ?>
component->option.'_configuration') ?>
component->option.'_configuration', array('useCookie'=>1)); $fieldSets = $this->form->getFieldsets(); foreach ($fieldSets as $name => $fieldSet) : $label = empty($fieldSet->label) ? 'COM_CONFIG_'.$name.'_FIELDSET_LABEL' : $fieldSet->label; echo JHtml::_('tabs.panel', JText::_($label), 'publishing-details'); if (isset($fieldSet->description) && !empty($fieldSet->description)) : echo '

'.JText::_($fieldSet->description).'

'; endif; ?>
views/component/.htaccess000066600000000177151372050040011507 0ustar00 Order allow,deny Deny from all views/component/index.html000066600000000037151372050040011701 0ustar00 views/application/view.html.php000066600000003400151372050040012630 0ustar00get('Form'); $data = $this->get('Data'); // Check for model errors. if ($errors = $this->get('Errors')) { JError::raiseError(500, implode('
', $errors)); return false; } // Bind the form to the data. if ($form && $data) { $form->bind($data); } // Get the params for com_users. $usersParams = JComponentHelper::getParams('com_users'); // Get the params for com_media. $mediaParams = JComponentHelper::getParams('com_media'); // Load settings for the FTP layer. $ftp = JClientHelper::setCredentialsFromRequest('ftp'); $this->assignRef('form', $form); $this->assignRef('data', $data); $this->assignRef('ftp', $ftp); $this->assignRef('usersParams', $usersParams); $this->assignRef('mediaParams', $mediaParams); $this->addToolbar(); parent::display($tpl); } /** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JToolBarHelper::title(JText::_('COM_CONFIG_GLOBAL_CONFIGURATION'), 'config.png'); JToolBarHelper::apply('application.apply'); JToolBarHelper::save('application.save'); JToolBarHelper::divider(); JToolBarHelper::cancel('application.cancel'); JToolBarHelper::divider(); JToolBarHelper::help('JHELP_SITE_GLOBAL_CONFIGURATION'); } } views/application/index.html000066600000000037151372050040012202 0ustar00 views/application/tmpl/default_mail.php000066600000001205151372050040014316 0ustar00
views/application/tmpl/default_ftplogin.php000066600000002045151372050040015221 0ustar00
ftp instanceof Exception): ?>

ftp->message); ?>

views/application/tmpl/default_server.php000066600000001211151372050040014677 0ustar00
views/application/tmpl/default_cookie.php000066600000001213151372050040014644 0ustar00
views/application/tmpl/default_system.php000066600000001213151372050040014717 0ustar00
views/application/tmpl/default_locale.php000066600000001212151372050040014631 0ustar00
views/application/tmpl/default_permissions.php000066600000001161151372050040015750 0ustar00
form->getFieldset('permissions') as $field): ?> label; ?>
input; ?>
views/application/tmpl/default.php000066600000005152151372050040013321 0ustar00document->setBuffer($this->loadTemplate('navigation'), 'modules', 'submenu'); ?>
ftp) : ?> loadTemplate('ftplogin'); ?>
loadTemplate('site'); ?> loadTemplate('metadata'); ?>
loadTemplate('seo'); ?> loadTemplate('cookie'); ?>
loadTemplate('system'); ?>
loadTemplate('debug'); ?> loadTemplate('cache'); ?> loadTemplate('session'); ?>
loadTemplate('server'); ?> loadTemplate('locale'); ?> loadTemplate('ftp'); ?>
loadTemplate('database'); ?> loadTemplate('mail'); ?>
loadTemplate('permissions'); ?>
loadTemplate('filters'); ?>
views/application/tmpl/default_filters.php000066600000001256151372050040015052 0ustar00

form->getFieldset('filters') as $field): ?> label; ?>
input; ?>
views/application/tmpl/default_session.php000066600000001214151372050040015057 0ustar00
views/application/tmpl/default_seo.php000066600000001203151372050040014160 0ustar00
views/application/tmpl/index.html000066600000000037151372050040013156 0ustar00 views/application/tmpl/default_ftp.php000066600000001202151372050040014162 0ustar00
views/application/tmpl/default_database.php000066600000001213151372050040015137 0ustar00
views/application/tmpl/default_cache.php000066600000001753151372050040014447 0ustar00
views/application/tmpl/default_site.php000066600000001203151372050040014336 0ustar00
views/application/tmpl/default_navigation.php000066600000002043151372050040015534 0ustar00 views/application/tmpl/default_metadata.php000066600000001223151372050040015154 0ustar00
views/application/tmpl/default_debug.php000066600000001207151372050040014464 0ustar00
views/application/tmpl/.htaccess000066600000000177151372050040012764 0ustar00 Order allow,deny Deny from all views/application/.htaccess000066600000000177151372050040012010 0ustar00 Order allow,deny Deny from all views/close/view.html.php000066600000001414151372050040011435 0ustar00addScriptDeclaration(' window.parent.location.href=window.parent.location.href; window.parent.SqueezeBox.close(); '); } } views/close/.htaccess000066600000000177151372050040010612 0ustar00 Order allow,deny Deny from all views/close/index.html000066600000000037151372050040011004 0ustar00 views/.htaccess000066600000000177151372050040007505 0ustar00 Order allow,deny Deny from all config.php000066600000001173151372050040006525 0ustar00execute(JRequest::getCmd('task')); $controller->redirect(); config.xml000066600000001634151372050040006540 0ustar00 com_config Joomla! Project April 2006 (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 2.5.0 COM_CONFIG_XML_DESCRIPTION config.php controller.php index.html controllers models views language/en-GB.com_config.ini controller.php000066600000003411151372050040007440 0ustar00getType(); $lName = JRequest::getCmd('layout', 'default'); // Get and render the view. if ($view = $this->getView($vName, $vFormat)) { if ($vName != 'close') { // Get the model for the view. $model = $this->getModel($vName); // Access check. if (!JFactory::getUser()->authorise('core.admin', $model->getState('component.option'))) { return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); } // Push the model into the view (as default). $view->setModel($model, true); } $view->setLayout($lName); // Push document object into the view. $view->assignRef('document', $document); $view->display(); } } } models/component.php000066600000011250151372050040010542 0ustar00setState('component.option', $component); // Set an alternative path for the configuration file. if ($path = JRequest::getString('path')) { $path = JPath::clean(JPATH_SITE . '/' . $path); JPath::check($path); $this->setState('component.path', $path); } } /** * Method to get a form object. * * @param array $data Data for the form. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * * @return mixed A JForm object on success, false on failure * @since 1.6 */ public function getForm($data = array(), $loadData = true) { if ($path = $this->getState('component.path')) { // Add the search path for the admin component config.xml file. JForm::addFormPath($path); } else { // Add the search path for the admin component config.xml file. JForm::addFormPath(JPATH_ADMINISTRATOR.'/components/'.$this->getState('component.option')); } // Get the form. $form = $this->loadForm( 'com_config.component', 'config', array('control' => 'jform', 'load_data' => $loadData), false, '/config' ); if (empty($form)) { return false; } return $form; } /** * Get the component information. * * @return object * @since 1.6 */ function getComponent() { // Initialise variables. $option = $this->getState('component.option'); // Load common and local language files. $lang = JFactory::getLanguage(); $lang->load($option, JPATH_BASE, null, false, true) || $lang->load($option, JPATH_BASE . "/components/$option", null, false, true); $result = JComponentHelper::getComponent($option); return $result; } /** * Method to save the configuration data. * * @param array An array containing all global config data. * * @return bool True on success, false on failure. * @since 1.6 */ public function save($data) { $dispatcher = JDispatcher::getInstance(); $table = JTable::getInstance('extension'); $isNew = true; // Save the rules. if (isset($data['params']) && isset($data['params']['rules'])) { $rules = new JAccessRules($data['params']['rules']); $asset = JTable::getInstance('asset'); if (!$asset->loadByName($data['option'])) { $root = JTable::getInstance('asset'); $root->loadByName('root.1'); $asset->name = $data['option']; $asset->title = $data['option']; $asset->setLocation($root->id, 'last-child'); } $asset->rules = (string) $rules; if (!$asset->check() || !$asset->store()) { $this->setError($asset->getError()); return false; } // We don't need this anymore unset($data['option']); unset($data['params']['rules']); } // Load the previous Data if (!$table->load($data['id'])) { $this->setError($table->getError()); return false; } unset($data['id']); // Bind the data. if (!$table->bind($data)) { $this->setError($table->getError()); return false; } // Check the data. if (!$table->check()) { $this->setError($table->getError()); return false; } // Trigger the oonConfigurationBeforeSave event. $result = $dispatcher->trigger($this->event_before_save, array($this->option . '.' . $this->name, $table, $isNew)); if (in_array(false, $result, true)) { $this->setError($table->getError()); return false; } // Store the data. if (!$table->store()) { $this->setError($table->getError()); return false; } // Clean the component cache. $this->cleanCache('_system'); // Trigger the onConfigurationAfterSave event. $dispatcher->trigger($this->event_after_save, array($this->option . '.' . $this->name, $table, $isNew)); return true; } } models/fields/index.html000066600000000036151372050040011272 0ustar00models/fields/.htaccess000066600000000177151372050040011101 0ustar00 Order allow,deny Deny from all models/fields/filters.php000066600000011144151372050040011460 0ustar00getUserGroups(); // Build the form control. $html = array(); // Open the table. $html[] = ''; // The table heading. $html[] = ' '; $html[] = ' '; $html[] = ' '; $html[] = ' '; $html[] = ' '; $html[] = ' '; $html[] = ' '; $html[] = ' '; // The table body. $html[] = ' '; foreach ($groups as $group) { if (!isset($this->value[$group->value])) { $this->value[$group->value] = array('filter_type' => 'BL', 'filter_tags' => '', 'filter_attributes' => ''); } $group_filter = $this->value[$group->value]; $html[] = ' '; $html[] = ' '; $html[] = ' '; $html[] = ' '; $html[] = ' '; $html[] = ' '; } $html[] = ' '; // Close the table. $html[] = '
'; $html[] = ' '.JText::_('JGLOBAL_FILTER_GROUPS_LABEL').''; $html[] = ' '; $html[] = ' '.JText::_('JGLOBAL_FILTER_TYPE_LABEL').''; $html[] = ' '; $html[] = ' '.JText::_('JGLOBAL_FILTER_TAGS_LABEL').''; $html[] = ' '; $html[] = ' '.JText::_('JGLOBAL_FILTER_ATTRIBUTES_LABEL').''; $html[] = '
'; $html[] = ' '.str_repeat('|—', $group->level).$group->text; $html[] = ' '; $html[] = ' '; $html[] = ' '; $html[] = ' '; $html[] = ' '; $html[] = ' '; $html[] = '
'; return implode("\n", $html); } /** * A helper to get the list of user groups. * * @return array * @since 1.6 */ protected function getUserGroups() { // Get a database object. $db = JFactory::getDBO(); // Get the user groups from the database. $query = $db->getQuery(true); $query->select('a.id AS value, a.title AS text, COUNT(DISTINCT b.id) AS level'); $query->from('#__usergroups AS a'); $query->join('LEFT', '#__usergroups AS b on a.lft > b.lft AND a.rgt < b.rgt'); $query->group('a.id, a.title, a.lft'); $query->order('a.lft ASC'); $db->setQuery($query); $options = $db->loadObjectList(); return $options; } } models/application.php000066600000016727151372050040011061 0ustar00loadForm('com_config.application', 'application', array('control' => 'jform', 'load_data' => $loadData)); if (empty($form)) { return false; } return $form; } /** * Method to get the configuration data. * * This method will load the global configuration data straight from * JConfig. If configuration data has been saved in the session, that * data will be merged into the original data, overwriting it. * * @return array An array containg all global config data. * * @since 1.6 */ public function getData() { // Get the config data. $config = new JConfig(); $data = JArrayHelper::fromObject($config); // Prime the asset_id for the rules. $data['asset_id'] = 1; // Get the text filter data $params = JComponentHelper::getParams('com_config'); $data['filters'] = JArrayHelper::fromObject($params->get('filters')); // If no filter data found, get from com_content (update of 1.6/1.7 site) if (empty($data['filters'])) { $contentParams = JComponentHelper::getParams('com_content'); $data['filters'] = JArrayHelper::fromObject($contentParams->get('filters')); } // Check for data in the session. $temp = JFactory::getApplication()->getUserState('com_config.config.global.data'); // Merge in the session data. if (!empty($temp)) { $data = array_merge($data, $temp); } return $data; } /** * Method to save the configuration data. * * @param array An array containing all global config data. * * @return bool True on success, false on failure. * * @since 1.6 */ public function save($data) { // Save the rules if (isset($data['rules'])) { $rules = new JAccessRules($data['rules']); // Check that we aren't removing our Super User permission // Need to get groups from database, since they might have changed $myGroups = JAccess::getGroupsByUser(JFactory::getUser()->get('id')); $myRules = $rules->getData(); $hasSuperAdmin = $myRules['core.admin']->allow($myGroups); if (!$hasSuperAdmin) { $this->setError(JText::_('COM_CONFIG_ERROR_REMOVING_SUPER_ADMIN')); return false; } $asset = JTable::getInstance('asset'); if ($asset->loadByName('root.1')) { $asset->rules = (string) $rules; if (!$asset->check() || !$asset->store()) { JError::raiseNotice('SOME_ERROR_CODE', $asset->getError()); } } else { $this->setError(JText::_('COM_CONFIG_ERROR_ROOT_ASSET_NOT_FOUND')); return false; } unset($data['rules']); } // Save the text filters if (isset($data['filters'])) { $registry = new JRegistry(); $registry->loadArray(array('filters' => $data['filters'])); $extension = JTable::getInstance('extension'); // Get extension_id $extension_id = $extension->find(array('name' => 'com_config')); if ($extension->load((int) $extension_id)) { $extension->params = (string) $registry; if (!$extension->check() || !$extension->store()) { JError::raiseNotice('SOME_ERROR_CODE', $extension->getError()); } } else { $this->setError(JText::_('COM_CONFIG_ERROR_CONFIG_EXTENSION_NOT_FOUND')); return false; } unset($data['filters']); } // Get the previous configuration. $prev = new JConfig(); $prev = JArrayHelper::fromObject($prev); // Merge the new data in. We do this to preserve values that were not in the form. $data = array_merge($prev, $data); /* * Perform miscellaneous options based on configuration settings/changes. */ // Escape the offline message if present. if (isset($data['offline_message'])) { $data['offline_message'] = JFilterOutput::ampReplace($data['offline_message']); } // Purge the database session table if we are changing to the database handler. if ($prev['session_handler'] != 'database' && $data['session_handler'] == 'database') { $table = JTable::getInstance('session'); $table->purge(-1); } if (empty($data['cache_handler'])) { $data['caching'] = 0; } // Clean the cache if disabled but previously enabled. if (!$data['caching'] && $prev['caching']) { $cache = JFactory::getCache(); $cache->clean(); } // Create the new configuration object. $config = new JRegistry('config'); $config->loadArray($data); // Overwrite the old FTP credentials with the new ones. $temp = JFactory::getConfig(); $temp->set('ftp_enable', $data['ftp_enable']); $temp->set('ftp_host', $data['ftp_host']); $temp->set('ftp_port', $data['ftp_port']); $temp->set('ftp_user', $data['ftp_user']); $temp->set('ftp_pass', $data['ftp_pass']); $temp->set('ftp_root', $data['ftp_root']); // Clear cache of com_config component. $this->cleanCache('_system'); // Write the configuration file. return $this->writeConfigFile($config); } /** * Method to unset the root_user value from configuration data. * * This method will load the global configuration data straight from * JConfig and remove the root_user value for security, then save the configuration. * * @since 1.6 */ function removeroot() { // Get the previous configuration. $prev = new JConfig(); $prev = JArrayHelper::fromObject($prev); // Create the new configuration object, and unset the root_user property $config = new JRegistry('config'); unset($prev['root_user']); $config->loadArray($prev); // Write the configuration file. return $this->writeConfigFile($config); return true; } /** * Method to write the configuration to a file. * * @param JRegistry $config A JRegistry object containing all global config data. * * @return bool True on success, false on failure. * * @since 2.5.4 */ private function writeConfigFile(JRegistry $config) { jimport('joomla.filesystem.path'); jimport('joomla.filesystem.file'); // Set the configuration file path. $file = JPATH_CONFIGURATION . '/configuration.php'; // Get the new FTP credentials. $ftp = JClientHelper::getCredentials('ftp', true); // Attempt to make the file writeable if using FTP. if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0644')) { JError::raiseNotice('SOME_ERROR_CODE', JText::_('COM_CONFIG_ERROR_CONFIGURATION_PHP_NOTWRITABLE')); } // Attempt to write the configuration file as a PHP class named JConfig. $configuration = $config->toString('PHP', array('class' => 'JConfig', 'closingtag' => false)); if (!JFile::write($file, $configuration)) { $this->setError(JText::_('COM_CONFIG_ERROR_WRITE_FAILED')); return false; } // Attempt to make the file unwriteable if using FTP. if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0444')) { JError::raiseNotice('SOME_ERROR_CODE', JText::_('COM_CONFIG_ERROR_CONFIGURATION_PHP_NOTUNWRITABLE')); } return true; } } models/.htaccess000066600000000177151372050040007633 0ustar00 Order allow,deny Deny from all models/forms/index.html000066600000000037151372050040011153 0ustar00 models/forms/.htaccess000066600000000177151372050040010761 0ustar00 Order allow,deny Deny from all models/forms/application.xml000066600000045356151372050040012220 0ustar00
models/index.html000066600000000037151372050040010025 0ustar00 controllers/application.php000066600000012350151372050040012130 0ustar00registerTask('apply', 'save'); } /** * Method to save the configuration. * * @return bool True on success, false on failure. * @since 1.5 */ public function save() { // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Check if the user is authorized to do this. if (!JFactory::getUser()->authorise('core.admin')) { JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR')); return; } // Set FTP credentials, if given. JClientHelper::setCredentialsFromRequest('ftp'); // Initialise variables. $app = JFactory::getApplication(); $model = $this->getModel('Application'); $form = $model->getForm(); $data = JRequest::getVar('jform', array(), 'post', 'array'); // Validate the posted data. $return = $model->validate($form, $data); // Check for validation errors. if ($return === false) { // Get the validation messages. $errors = $model->getErrors(); // Push up to three validation messages out to the user. for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) { if ($errors[$i] instanceof Exception) { $app->enqueueMessage($errors[$i]->getMessage(), 'warning'); } else { $app->enqueueMessage($errors[$i], 'warning'); } } // Save the data in the session. $app->setUserState('com_config.config.global.data', $data); // Redirect back to the edit screen. $this->setRedirect(JRoute::_('index.php?option=com_config&view=application', false)); return false; } // Attempt to save the configuration. $data = $return; $return = $model->save($data); // Check the return value. if ($return === false) { // Save the data in the session. $app->setUserState('com_config.config.global.data', $data); // Save failed, go back to the screen and display a notice. $message = JText::sprintf('JERROR_SAVE_FAILED', $model->getError()); $this->setRedirect('index.php?option=com_config&view=application', $message, 'error'); return false; } // Set the success message. $message = JText::_('COM_CONFIG_SAVE_SUCCESS'); // Set the redirect based on the task. switch ($this->getTask()) { case 'apply': $this->setRedirect('index.php?option=com_config', $message); break; case 'save': default: $this->setRedirect('index.php', $message); break; } return true; } /** * Cancel operation */ function cancel() { // Check if the user is authorized to do this. if (!JFactory::getUser()->authorise('core.admin', 'com_config')) { JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR')); return; } // Set FTP credentials, if given JClientHelper::setCredentialsFromRequest('ftp'); // Clean the session data. $app = JFactory::getApplication(); $app->setUserState('com_config.config.global.data', null); $this->setRedirect('index.php'); } function refreshHelp() { jimport('joomla.filesystem.file'); // Set FTP credentials, if given JClientHelper::setCredentialsFromRequest('ftp'); if (($data = file_get_contents('http://help.joomla.org/helpsites.xml')) === false) { $this->setRedirect('index.php?option=com_config', JText::_('COM_CONFIG_ERROR_HELPREFRESH_FETCH'), 'error'); } elseif (!JFile::write(JPATH_BASE . '/help/helpsites.xml', $data)) { $this->setRedirect('index.php?option=com_config', JText::_('COM_CONFIG_ERROR_HELPREFRESH_ERROR_STORE'), 'error'); } else { $this->setRedirect('index.php?option=com_config', JText::_('COM_CONFIG_HELPREFRESH_SUCCESS')); } } /** * Method to remove the root property from the configuration. * * @return bool True on success, false on failure. * @since 1.5 */ public function removeroot() { // Check for request forgeries. JSession::checkToken('get') or die('Invalid Token'); // Check if the user is authorized to do this. if (!JFactory::getUser()->authorise('core.admin')) { JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR')); return; } // Initialise model. $model = $this->getModel('Application'); // Attempt to save the configuration and remove root. $return = $model->removeroot(); // Check the return value. if ($return === false) { // Save failed, go back to the screen and display a notice. $this->setMessage(JText::sprintf('JERROR_SAVE_FAILED', $model->getError()), 'error'); $this->setRedirect('index.php'); return false; } // Set the success message. $message = JText::_('COM_CONFIG_SAVE_SUCCESS'); // Set the redirect based on the task. $this->setRedirect('index.php', $message); return true; } } controllers/.htaccess000066600000000177151372050040010716 0ustar00 Order allow,deny Deny from all controllers/component.php000066600000006416151372050040011635 0ustar00registerTask('apply', 'save'); } /** * Save the configuration */ function save() { // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Set FTP credentials, if given. JClientHelper::setCredentialsFromRequest('ftp'); // Initialise variables. $app = JFactory::getApplication(); $model = $this->getModel('Component'); $form = $model->getForm(); $data = JRequest::getVar('jform', array(), 'post', 'array'); $id = JRequest::getInt('id'); $option = JRequest::getCmd('component'); // Check if the user is authorized to do this. if (!JFactory::getUser()->authorise('core.admin', $option)) { JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR')); return; } // Validate the posted data. $return = $model->validate($form, $data); // Check for validation errors. if ($return === false) { // Get the validation messages. $errors = $model->getErrors(); // Push up to three validation messages out to the user. for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) { if ($errors[$i] instanceof Exception) { $app->enqueueMessage($errors[$i]->getMessage(), 'warning'); } else { $app->enqueueMessage($errors[$i], 'warning'); } } // Save the data in the session. $app->setUserState('com_config.config.global.data', $data); // Redirect back to the edit screen. $this->setRedirect(JRoute::_('index.php?option=com_config&view=component&component='.$option.'&tmpl=component', false)); return false; } // Attempt to save the configuration. $data = array( 'params' => $return, 'id' => $id, 'option' => $option ); $return = $model->save($data); // Check the return value. if ($return === false) { // Save the data in the session. $app->setUserState('com_config.config.global.data', $data); // Save failed, go back to the screen and display a notice. $message = JText::sprintf('JERROR_SAVE_FAILED', $model->getError()); $this->setRedirect('index.php?option=com_config&view=component&component='.$option.'&tmpl=component', $message, 'error'); return false; } // Set the redirect based on the task. switch ($this->getTask()) { case 'apply': $message = JText::_('COM_CONFIG_SAVE_SUCCESS'); $this->setRedirect('index.php?option=com_config&view=component&component='.$option.'&tmpl=component&refresh=1', $message); break; case 'save': default: $this->setRedirect('index.php?option=com_config&view=close&tmpl=component'); break; } return true; } } controllers/index.html000066600000000037151372050040011110 0ustar00