forked from joomla/joomla-cms
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request joomla#42 from Buddhima/gsoc_com_services
GSOC Project: com_services or front end website administration
- Loading branch information
Showing
196 changed files
with
5,285 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<access component="com_config"> | ||
<section name="component"> | ||
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" /> | ||
</section> | ||
</access> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<extension type="component" version="3.1" method="upgrade"> | ||
<extension type="component" version="3.0" method="upgrade"> | ||
<name>com_config</name> | ||
<author>Joomla! Project</author> | ||
<creationDate>April 2006</creationDate> | ||
<creationDate>June 2013</creationDate> | ||
<copyright>(C) 2005 - 2013 Open Source Matters. All rights reserved. </copyright> | ||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license> | ||
<authorEmail>[email protected]</authorEmail> | ||
<authorUrl>www.joomla.org</authorUrl> | ||
<version>3.0.0</version> | ||
<version>3.1.0</version> | ||
<description>COM_CONFIG_XML_DESCRIPTION</description> | ||
<administration> | ||
<files folder="admin"> | ||
<filename>config.php</filename> | ||
<filename>controller.php</filename> | ||
<filename>access.xml</filename> | ||
<filename>index.html</filename> | ||
<folder>controllers</folder> | ||
<folder>models</folder> | ||
<folder>views</folder> | ||
<folder>controller</folder> | ||
<folder>model</folder> | ||
<folder>view</folder> | ||
</files> | ||
<languages folder="admin"> | ||
<language tag="en-GB">language/en-GB.com_config.ini</language> | ||
<language tag="en-GB">language/en-GB.com_config.sys.ini</language> | ||
<language tag="en-GB">language/en-GB.com_config.ini | ||
</language> | ||
</languages> | ||
</administration> | ||
</extension> |
50 changes: 50 additions & 0 deletions
50
administrator/components/com_config/controller/application/cancel.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage com_config | ||
* | ||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die('Restricted access'); | ||
|
||
/** | ||
* Cancel Controller for global configuration | ||
* | ||
* @package Joomla.Administrator | ||
* @subpackage com_config | ||
* @since 3.2 | ||
*/ | ||
class ConfigControllerApplicationCancel extends JControllerBase | ||
{ | ||
|
||
/** | ||
* Method to cancel global configuration. | ||
* | ||
* @return bool True on success. | ||
* | ||
* @since 3.2 | ||
*/ | ||
public function execute() | ||
{ | ||
// 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); | ||
|
||
$app->redirect(JRoute::_('index.php', false)); | ||
|
||
return true; | ||
} | ||
} |
84 changes: 84 additions & 0 deletions
84
administrator/components/com_config/controller/application/display.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage com_config | ||
* | ||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die('Restricted access'); | ||
|
||
/** | ||
* Display Controller for global configuration | ||
* | ||
* @package Joomla.Administrator | ||
* @subpackage com_config | ||
* @since 3.2 | ||
*/ | ||
class ConfigControllerApplicationDisplay extends JControllerBase | ||
{ | ||
/** | ||
* Method to display global configuration. | ||
* | ||
* @return bool True on success, false on failure. | ||
* | ||
* @since 3.2 | ||
*/ | ||
public function execute() | ||
{ | ||
|
||
// Get the application | ||
$app = $this->getApplication(); | ||
|
||
// Get the document object. | ||
$document = JFactory::getDocument(); | ||
|
||
$viewName = $app->input->getWord('view', 'application'); | ||
$viewFormat = $document->getType(); | ||
$layoutName = $app->input->getWord('layout', 'default'); | ||
|
||
$app->input->set('view', $viewName); | ||
|
||
// Register the layout paths for the view | ||
$paths = new SplPriorityQueue; | ||
$paths->insert(JPATH_COMPONENT . '/view/' . 'application' . '/tmpl', 'normal'); | ||
|
||
$viewClass = 'ConfigView' . ucfirst($viewName) . ucfirst($viewFormat); | ||
$modelClass = 'ConfigModel' . ucfirst($viewName); | ||
|
||
if ($view = new $viewClass) | ||
{ | ||
|
||
if ($viewName != 'close') | ||
{ | ||
$model = new $modelClass; | ||
|
||
// Access check. | ||
if (!JFactory::getUser()->authorise('core.admin', $model->getState('component.option'))) | ||
{ | ||
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); | ||
} | ||
|
||
// Set model | ||
$view->setModel($model, true); | ||
} | ||
|
||
$view->setLayout($layoutName); | ||
|
||
// Push document object into the view. | ||
$view->document = $document; | ||
|
||
// Reply for service requests | ||
if ($viewFormat == 'json') | ||
{ | ||
return $view->render(); | ||
} | ||
|
||
// Render view. | ||
echo $view->render(); | ||
} | ||
return true; | ||
} | ||
|
||
} |
52 changes: 52 additions & 0 deletions
52
administrator/components/com_config/controller/application/refreshhelp.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage com_config | ||
* | ||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die('Restricted access'); | ||
|
||
/** | ||
* Refresh Help Controller for global configuration | ||
* | ||
* @package Joomla.Administrator | ||
* @subpackage com_config | ||
* @since 3.2 | ||
*/ | ||
class ConfigControllerApplicationRefreshhelp extends JControllerBase | ||
{ | ||
|
||
/** | ||
* Method to refresh help in global configuration. | ||
* | ||
* @return bool True on success. | ||
* | ||
* @since 3.2 | ||
*/ | ||
public function execute() | ||
{ | ||
jimport('joomla.filesystem.file'); | ||
|
||
// Set FTP credentials, if given | ||
JClientHelper::setCredentialsFromRequest('ftp'); | ||
|
||
// Get application instance | ||
$app = JFactory::getApplication(); | ||
|
||
if (($data = file_get_contents('http://help.joomla.org/helpsites.xml')) === false) | ||
{ | ||
$app->redirect(JRoute::_('index.php?option=com_config', false), JText::_('COM_CONFIG_ERROR_HELPREFRESH_FETCH'), 'error'); | ||
} | ||
elseif (!JFile::write(JPATH_BASE . '/help/helpsites.xml', $data)) | ||
{ | ||
$app->redirect(JRoute::_('index.php?option=com_config', false), JText::_('COM_CONFIG_ERROR_HELPREFRESH_ERROR_STORE'), 'error'); | ||
} | ||
else | ||
{ | ||
$app->redirect(JRoute::_('index.php?option=com_config', false), JText::_('COM_CONFIG_HELPREFRESH_SUCCESS')); | ||
} | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
administrator/components/com_config/controller/application/removeroot.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage com_config | ||
* | ||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
defined('_JEXEC') or die('Restricted access'); | ||
|
||
/** | ||
* Remove Root Controller for global configuration | ||
* | ||
* @package Joomla.Administrator | ||
* @subpackage com_config | ||
* @since 3.2 | ||
*/ | ||
class ConfigControllerApplicationRemoveroot extends JControllerBase | ||
{ | ||
|
||
/** | ||
* Method to remove root in global configuration. | ||
* | ||
* @return bool True on success. | ||
* | ||
* @since 3.2 | ||
*/ | ||
public function execute() | ||
{ | ||
// 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 = new ConfigModelsApplication; | ||
|
||
// 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. | ||
JFactory::getApplication()->redirect(JRoute::_('index.php', false), JText::sprintf('JERROR_SAVE_FAILED', $model->getError()), 'error'); | ||
|
||
return false; | ||
} | ||
|
||
// Set the success message. | ||
$message = JText::_('COM_CONFIG_SAVE_SUCCESS'); | ||
|
||
// Set the redirect based on the task. | ||
JFactory::getApplication()->redirect(JRoute::_('index.php', false), $message); | ||
|
||
return true; | ||
} | ||
} |
Oops, something went wrong.