Source for file refreshhelp.php

Documentation is available at refreshhelp.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_config
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * Refresh Help Controller for global configuration
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_config
  17.  * @since       3.2
  18. */
  19. {
  20.     /**
  21.      * Application object - Redeclared for proper typehinting
  22.      *
  23.      * @var    JApplicationCms 
  24.      * @since  3.2
  25.      */
  26.     protected $app;
  27.  
  28.     /**
  29.      * Method to refresh help in global configuration.
  30.      *
  31.      * @return  boolean  True on success.
  32.      *
  33.      * @since   3.2
  34.      */
  35.     public function execute()
  36.     {
  37.         jimport('joomla.filesystem.file');
  38.  
  39.         // Set FTP credentials, if given
  40.         JClientHelper::setCredentialsFromRequest('ftp');
  41.  
  42.         if (($data file_get_contents('http://help.joomla.org/helpsites.xml')) === false)
  43.         {
  44.             $this->app->enqueueMessage(JText::_('COM_CONFIG_ERROR_HELPREFRESH_FETCH')'error');
  45.             $this->app->redirect(JRoute::_('index.php?option=com_config'false));
  46.         }
  47.         elseif (!JFile::write(JPATH_BASE '/help/helpsites.xml'$data))
  48.         {
  49.             $this->app->enqueueMessage(JText::_('COM_CONFIG_ERROR_HELPREFRESH_ERROR_STORE')'error');
  50.             $this->app->redirect(JRoute::_('index.php?option=com_config'false));
  51.         }
  52.         else
  53.         {
  54.             $this->app->enqueueMessage(JText::_('COM_CONFIG_HELPREFRESH_SUCCESS')'error');
  55.             $this->app->redirect(JRoute::_('index.php?option=com_config'false));
  56.         }
  57.     }
  58. }

Documentation generated on Tue, 19 Nov 2013 15:11:39 +0100 by phpDocumentor 1.4.3