PageRenderTime 46ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/contentmanager/code/trunk/administrator/components/com_contentmanager/controllers/config.php

https://bitbucket.org/eddieajau/the-art-of-joomla-archive
PHP | 45 lines | 22 code | 4 blank | 19 comment | 1 complexity | 76fde0872de30ada1b416ba6c8aa175d MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: config.php 39 2009-05-21 07:32:36Z eddieajau $
  4. * @copyright Copyright (C) 2009 New Life in IT Pty Ltd. All rights reserved.
  5. * @license GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
  6. * @link http://www.theartofjoomla.com
  7. */
  8. // no direct access
  9. defined('_JEXEC') or die;
  10. /**
  11. * Configuration controller class for com_contentmanager.
  12. *
  13. * @package TAOJ.ContentManager
  14. * @subpackage com_contentmanager
  15. */
  16. class ContentManagerControllerConfig extends JController
  17. {
  18. /**
  19. * Method to save the configuration.
  20. *
  21. * @return bool True on success, false on failure.
  22. */
  23. public function save()
  24. {
  25. // Check for request forgeries
  26. JRequest::checkToken('request') or jexit(JText::_('ContMan_Invalid_Token'));
  27. $model = &$this->getModel('Config');
  28. $model->setState('request', JRequest::get('post'));
  29. if ($model->save())
  30. {
  31. $this->setRedirect('index.php?option=com_contentmanager&view=config&layout=close&tmpl=component');
  32. return true;
  33. }
  34. else
  35. {
  36. $message = JText::sprintf('ContMan_Config_Save_Failed', $model->getError());
  37. $this->setRedirect('index.php?option=com_contentmanager&view=config&tmpl=component', $message, 'notice');
  38. return false;
  39. }
  40. }
  41. }