You've already forked joomla_test
first commit
This commit is contained in:
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
139
administrator/components/com_admin/models/forms/profile.xml
Normal file
139
administrator/components/com_admin/models/forms/profile.xml
Normal file
@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<form>
|
||||
<fieldset name="user_details">
|
||||
<field name="name" type="text"
|
||||
class="inputbox"
|
||||
description="COM_ADMIN_USER_FIELD_NAME_DESC"
|
||||
label="COM_ADMIN_USER_HEADING_NAME"
|
||||
required="true"
|
||||
size="30"
|
||||
/>
|
||||
|
||||
<field name="username" type="text"
|
||||
class="inputbox"
|
||||
description="COM_ADMIN_USER_FIELD_USERNAME_DESC"
|
||||
label="COM_ADMIN_USER_FIELD_USERNAME_LABEL"
|
||||
required="true"
|
||||
size="30"
|
||||
/>
|
||||
|
||||
<field name="password2" type="password"
|
||||
autocomplete="off"
|
||||
class="validate-password"
|
||||
description="COM_ADMIN_USER_FIELD_PASSWORD_DESC"
|
||||
field="password1"
|
||||
filter="raw"
|
||||
label="JGLOBAL_PASSWORD"
|
||||
message="COM_ADMIN_USER_FIELD_PASSWORD1_MESSAGE"
|
||||
size="30"
|
||||
validate="equals"
|
||||
/>
|
||||
|
||||
<field name="password1" type="password"
|
||||
autocomplete="off"
|
||||
class="validate-password"
|
||||
description="COM_ADMIN_USER_FIELD_PASSWORD2_DESC"
|
||||
filter="raw"
|
||||
label="COM_ADMIN_USER_FIELD_PASSWORD2_LABEL"
|
||||
size="30"
|
||||
validate="password"
|
||||
/>
|
||||
|
||||
<field name="email" type="email"
|
||||
class="inputbox"
|
||||
description="COM_ADMIN_USER_FIELD_EMAIL_DESC"
|
||||
label="JGLOBAL_EMAIL"
|
||||
required="true"
|
||||
size="30"
|
||||
validate="email"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="registerDate"
|
||||
type="calendar"
|
||||
class="readonly"
|
||||
label="COM_ADMIN_USER_FIELD_REGISTERDATE_LABEL"
|
||||
description="COM_ADMIN_USER_FIELD_REGISTERDATE_DESC"
|
||||
readonly="true"
|
||||
format="%Y-%m-%d %H:%M:%S"
|
||||
size="22"
|
||||
filter="user_utc"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="lastvisitDate"
|
||||
type="calendar"
|
||||
class="readonly"
|
||||
label="COM_ADMIN_USER_FIELD_LASTVISIT_LABEL"
|
||||
description="COM_ADMIN_USER_FIELD_LASTVISIT_DESC"
|
||||
readonly="true"
|
||||
format="%Y-%m-%d %H:%M:%S"
|
||||
size="22"
|
||||
filter="user_utc"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="id"
|
||||
type="text"
|
||||
class="readonly"
|
||||
label="JGLOBAL_FIELD_ID_LABEL"
|
||||
description ="JGLOBAL_FIELD_ID_DESC"
|
||||
default="0"
|
||||
readonly="true"
|
||||
filter="unset"
|
||||
/>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<fields name="params">
|
||||
|
||||
<!-- Basic user account settings. -->
|
||||
<fieldset name="settings" label="COM_ADMIN_USER_SETTINGS_FIELDSET_LABEL">
|
||||
|
||||
<field name="admin_style" type="templatestyle"
|
||||
client="administrator"
|
||||
description="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_DESC"
|
||||
label="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_LABEL"
|
||||
>
|
||||
<option value="">JOPTION_USE_DEFAULT</option>
|
||||
</field>
|
||||
|
||||
<field name="admin_language" type="language"
|
||||
client="administrator"
|
||||
description="COM_ADMIN_USER_FIELD_BACKEND_LANGUAGE_DESC"
|
||||
label="COM_ADMIN_USER_FIELD_BACKEND_LANGUAGE_LABEL"
|
||||
>
|
||||
<option value="">JOPTION_USE_DEFAULT</option>
|
||||
</field>
|
||||
|
||||
<field name="language" type="language"
|
||||
client="site"
|
||||
description="COM_ADMIN_USER_FIELD_FRONTEND_LANGUAGE_DESC"
|
||||
label="COM_ADMIN_USER_FIELD_FRONTEND_LANGUAGE_LABEL"
|
||||
>
|
||||
<option value="">JOPTION_USE_DEFAULT</option>
|
||||
</field>
|
||||
|
||||
<field name="editor" type="plugins" folder="editors"
|
||||
description="COM_ADMIN_USER_FIELD_EDITOR_DESC"
|
||||
label="COM_ADMIN_USER_FIELD_EDITOR_LABEL"
|
||||
>
|
||||
<option value="">JOPTION_USE_DEFAULT</option>
|
||||
</field>
|
||||
|
||||
<field name="helpsite" type="helpsite"
|
||||
label="COM_ADMIN_USER_FIELD_HELPSITE_LABEL"
|
||||
description="COM_ADMIN_USER_FIELD_HELPSITE_DESC"
|
||||
>
|
||||
<option value="">JOPTION_USE_DEFAULT</option>
|
||||
</field>
|
||||
|
||||
<field name="timezone" type="timezone"
|
||||
label="COM_ADMIN_USER_FIELD_TIMEZONE_LABEL"
|
||||
description="COM_ADMIN_USER_FIELD_TIMEZONE_DESC"
|
||||
>
|
||||
<option value="">JOPTION_USE_DEFAULT</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</form>
|
186
administrator/components/com_admin/models/help.php
Normal file
186
administrator/components/com_admin/models/help.php
Normal file
@ -0,0 +1,186 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_admin
|
||||
*
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* Admin Component Help Model
|
||||
*
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_admin
|
||||
* @since 1.6
|
||||
*/
|
||||
class AdminModelHelp extends JModelLegacy
|
||||
{
|
||||
/**
|
||||
* The search string
|
||||
* @var string
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $help_search = null;
|
||||
|
||||
/**
|
||||
* The page to be viewed
|
||||
* @var string
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $page = null;
|
||||
|
||||
/**
|
||||
* The iso language tag
|
||||
* @var string
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $lang_tag = null;
|
||||
|
||||
/**
|
||||
* Table of contents
|
||||
*
|
||||
* @var array
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $toc = null;
|
||||
|
||||
/**
|
||||
* URL for the latest version check
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $latest_version_check = null;
|
||||
|
||||
/**
|
||||
* Method to get the help search string
|
||||
*
|
||||
* @return string Help search string
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function &getHelpSearch()
|
||||
{
|
||||
if (is_null($this->help_search))
|
||||
{
|
||||
$this->help_search = JFactory::getApplication()->input->getString('helpsearch');
|
||||
}
|
||||
return $this->help_search;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the page
|
||||
*
|
||||
* @return string The page
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function &getPage()
|
||||
{
|
||||
if (is_null($this->page))
|
||||
{
|
||||
$page = JFactory::getApplication()->input->get('page', 'JHELP_START_HERE');
|
||||
$this->page = JHelp::createUrl($page);
|
||||
}
|
||||
return $this->page;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the lang tag
|
||||
*
|
||||
* @return string lang iso tag
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getLangTag()
|
||||
{
|
||||
if (is_null($this->lang_tag))
|
||||
{
|
||||
$lang = JFactory::getLanguage();
|
||||
$this->lang_tag = $lang->getTag();
|
||||
|
||||
if (!is_dir(JPATH_BASE . '/help/' . $this->lang_tag))
|
||||
{
|
||||
// Use english as fallback
|
||||
$this->lang_tag = 'en-GB';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $this->lang_tag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the toc
|
||||
*
|
||||
* @return array Table of contents
|
||||
*/
|
||||
public function &getToc()
|
||||
{
|
||||
if (is_null($this->toc))
|
||||
{
|
||||
// Get vars
|
||||
$lang_tag = $this->getLangTag();
|
||||
$help_search = $this->getHelpSearch();
|
||||
|
||||
// Get Help files
|
||||
jimport('joomla.filesystem.folder');
|
||||
$files = JFolder::files(JPATH_BASE . '/help/' . $lang_tag, '\.xml$|\.html$');
|
||||
$this->toc = array();
|
||||
foreach ($files as $file)
|
||||
{
|
||||
$buffer = file_get_contents(JPATH_BASE . '/help/' . $lang_tag . '/' . $file);
|
||||
if (preg_match('#<title>(.*?)</title>#', $buffer, $m))
|
||||
{
|
||||
$title = trim($m[1]);
|
||||
if ($title)
|
||||
{
|
||||
// Translate the page title
|
||||
$title = JText::_($title);
|
||||
// strip the extension
|
||||
$file = preg_replace('#\.xml$|\.html$#', '', $file);
|
||||
if ($help_search)
|
||||
{
|
||||
if (JString::strpos(JString::strtolower(strip_tags($buffer)), JString::strtolower($help_search)) !== false)
|
||||
{
|
||||
// Add an item in the Table of Contents
|
||||
$this->toc[$file] = $title;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Add an item in the Table of Contents
|
||||
$this->toc[$file] = $title;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Sort the Table of Contents
|
||||
asort($this->toc);
|
||||
}
|
||||
|
||||
return $this->toc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the latest version check
|
||||
*
|
||||
* @return string Latest Version Check URL
|
||||
*/
|
||||
public function &getLatestVersionCheck()
|
||||
{
|
||||
if (!$this->latest_version_check)
|
||||
{
|
||||
$override = 'http://help.joomla.org/proxy/index.php?option=com_help&keyref=Help{major}{minor}:Joomla_Version_{major}_{minor}_{maintenance}';
|
||||
$this->latest_version_check = JHelp::createUrl('JVERSION', false, $override);
|
||||
}
|
||||
|
||||
return $this->latest_version_check;
|
||||
}
|
||||
}
|
1
administrator/components/com_admin/models/index.html
Normal file
1
administrator/components/com_admin/models/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
130
administrator/components/com_admin/models/profile.php
Normal file
130
administrator/components/com_admin/models/profile.php
Normal file
@ -0,0 +1,130 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_admin
|
||||
*
|
||||
* @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;
|
||||
|
||||
require_once JPATH_ADMINISTRATOR.'/components/com_users/models/user.php';
|
||||
|
||||
/**
|
||||
* User model.
|
||||
*
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_admin
|
||||
* @since 1.6
|
||||
*/
|
||||
class AdminModelProfile extends UsersModelUser
|
||||
{
|
||||
/**
|
||||
* Method to get the record form.
|
||||
*
|
||||
* @param array $data An optional array of data for the form to interogate.
|
||||
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
|
||||
*
|
||||
* @return JForm A JForm object on success, false on failure
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getForm($data = array(), $loadData = true)
|
||||
{
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_admin.profile', 'profile', array('control' => 'jform', 'load_data' => $loadData));
|
||||
if (empty($form))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!JComponentHelper::getParams('com_users')->get('change_login_name'))
|
||||
{
|
||||
$form->setFieldAttribute('username', 'required', 'false');
|
||||
$form->setFieldAttribute('username', 'readonly', 'true');
|
||||
$form->setFieldAttribute('username', 'description', 'COM_ADMIN_USER_FIELD_NOCHANGE_USERNAME_DESC');
|
||||
}
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the data that should be injected in the form.
|
||||
*
|
||||
* @return mixed The data for the form.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function loadFormData()
|
||||
{
|
||||
// Check the session for previously entered form data.
|
||||
$data = JFactory::getApplication()->getUserState('com_users.edit.user.data', array());
|
||||
|
||||
if (empty($data))
|
||||
{
|
||||
$data = $this->getItem();
|
||||
}
|
||||
|
||||
// Load the users plugins.
|
||||
JPluginHelper::importPlugin('user');
|
||||
|
||||
$this->preprocessData('com_admin.profile', $data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get a single record.
|
||||
*
|
||||
* @return mixed Object on success, false on failure.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getItem($pk = null)
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
|
||||
return parent::getItem($user->get('id'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save the form data.
|
||||
*
|
||||
* @param array $data The form data.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function save($data)
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
|
||||
unset($data['id']);
|
||||
unset($data['groups']);
|
||||
unset($data['sendEmail']);
|
||||
unset($data['block']);
|
||||
|
||||
// Bind the data.
|
||||
if (!$user->bind($data))
|
||||
{
|
||||
$this->setError($user->getError());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$user->groups = null;
|
||||
|
||||
// Store the data.
|
||||
if (!$user->save())
|
||||
{
|
||||
$this->setError($user->getError());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->setState('user.id', $user->id);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
315
administrator/components/com_admin/models/sysinfo.php
Normal file
315
administrator/components/com_admin/models/sysinfo.php
Normal file
@ -0,0 +1,315 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_admin
|
||||
*
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* Model for the display of system information.
|
||||
*
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_admin
|
||||
* @since 1.6
|
||||
*/
|
||||
class AdminModelSysInfo extends JModelLegacy
|
||||
{
|
||||
/**
|
||||
* @var array Some PHP settings
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $php_settings = null;
|
||||
|
||||
/**
|
||||
* @var array Config values
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $config = null;
|
||||
|
||||
/**
|
||||
* @var array Some system values
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $info = null;
|
||||
|
||||
/**
|
||||
* @var string PHP info
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $php_info = null;
|
||||
|
||||
/**
|
||||
* Information about writable state of directories
|
||||
*
|
||||
* @var array
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $directories = null;
|
||||
|
||||
/**
|
||||
* The current editor.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $editor = null;
|
||||
|
||||
/**
|
||||
* Method to get the ChangeLog
|
||||
*
|
||||
* @return array some php settings
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function &getPhpSettings()
|
||||
{
|
||||
if (is_null($this->php_settings))
|
||||
{
|
||||
$this->php_settings = array();
|
||||
$this->php_settings['safe_mode'] = ini_get('safe_mode') == '1';
|
||||
$this->php_settings['display_errors'] = ini_get('display_errors') == '1';
|
||||
$this->php_settings['short_open_tag'] = ini_get('short_open_tag') == '1';
|
||||
$this->php_settings['file_uploads'] = ini_get('file_uploads') == '1';
|
||||
$this->php_settings['magic_quotes_gpc'] = ini_get('magic_quotes_gpc') == '1';
|
||||
$this->php_settings['register_globals'] = ini_get('register_globals') == '1';
|
||||
$this->php_settings['output_buffering'] = (bool) ini_get('output_buffering');
|
||||
$this->php_settings['open_basedir'] = ini_get('open_basedir');
|
||||
$this->php_settings['session.save_path'] = ini_get('session.save_path');
|
||||
$this->php_settings['session.auto_start'] = ini_get('session.auto_start');
|
||||
$this->php_settings['disable_functions'] = ini_get('disable_functions');
|
||||
$this->php_settings['xml'] = extension_loaded('xml');
|
||||
$this->php_settings['zlib'] = extension_loaded('zlib');
|
||||
$this->php_settings['zip'] = function_exists('zip_open') && function_exists('zip_read');
|
||||
$this->php_settings['mbstring'] = extension_loaded('mbstring');
|
||||
$this->php_settings['iconv'] = function_exists('iconv');
|
||||
}
|
||||
|
||||
return $this->php_settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the config
|
||||
*
|
||||
* @return array config values
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function &getConfig()
|
||||
{
|
||||
if (is_null($this->config))
|
||||
{
|
||||
$registry = new JRegistry(new JConfig);
|
||||
$this->config = $registry->toArray();
|
||||
$hidden = array('host', 'user', 'password', 'ftp_user', 'ftp_pass', 'smtpuser', 'smtppass');
|
||||
foreach ($hidden as $key)
|
||||
{
|
||||
$this->config[$key] = 'xxxxxx';
|
||||
}
|
||||
}
|
||||
|
||||
return $this->config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the system information
|
||||
*
|
||||
* @return array system information values
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function &getInfo()
|
||||
{
|
||||
if (is_null($this->info))
|
||||
{
|
||||
$this->info = array();
|
||||
$version = new JVersion;
|
||||
$platform = new JPlatform;
|
||||
$db = JFactory::getDbo();
|
||||
if (isset($_SERVER['SERVER_SOFTWARE']))
|
||||
{
|
||||
$sf = $_SERVER['SERVER_SOFTWARE'];
|
||||
}
|
||||
else {
|
||||
$sf = getenv('SERVER_SOFTWARE');
|
||||
}
|
||||
$this->info['php'] = php_uname();
|
||||
$this->info['dbversion'] = $db->getVersion();
|
||||
$this->info['dbcollation'] = $db->getCollation();
|
||||
$this->info['phpversion'] = phpversion();
|
||||
$this->info['server'] = $sf;
|
||||
$this->info['sapi_name'] = php_sapi_name();
|
||||
$this->info['version'] = $version->getLongVersion();
|
||||
$this->info['platform'] = $platform->getLongVersion();
|
||||
$this->info['useragent'] = $_SERVER['HTTP_USER_AGENT'];
|
||||
}
|
||||
return $this->info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the PHP info
|
||||
*
|
||||
* @return string PHP info
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function &getPHPInfo()
|
||||
{
|
||||
if (is_null($this->php_info))
|
||||
{
|
||||
ob_start();
|
||||
date_default_timezone_set('UTC');
|
||||
phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES);
|
||||
$phpinfo = ob_get_contents();
|
||||
ob_end_clean();
|
||||
preg_match_all('#<body[^>]*>(.*)</body>#siU', $phpinfo, $output);
|
||||
$output = preg_replace('#<table[^>]*>#', '<table class="table table-striped adminlist">', $output[1][0]);
|
||||
$output = preg_replace('#(\w),(\w)#', '\1, \2', $output);
|
||||
$output = preg_replace('#<hr />#', '', $output);
|
||||
$output = str_replace('<div class="center">', '', $output);
|
||||
$output = preg_replace('#<tr class="h">(.*)<\/tr>#', '<thead><tr class="h">$1</tr></thead><tbody>', $output);
|
||||
$output = str_replace('</table>', '</tbody></table>', $output);
|
||||
$output = str_replace('</div>', '', $output);
|
||||
$this->php_info = $output;
|
||||
}
|
||||
|
||||
return $this->php_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the directory states
|
||||
*
|
||||
* @return array States of directories
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getDirectory()
|
||||
{
|
||||
if (is_null($this->directories))
|
||||
{
|
||||
$this->directories = array();
|
||||
|
||||
$registry = JFactory::getConfig();
|
||||
$cparams = JComponentHelper::getParams('com_media');
|
||||
|
||||
$this->_addDirectory('administrator/components', JPATH_ADMINISTRATOR . '/components');
|
||||
$this->_addDirectory('administrator/language', JPATH_ADMINISTRATOR . '/language');
|
||||
|
||||
// List all admin languages
|
||||
$admin_langs = new DirectoryIterator(JPATH_ADMINISTRATOR . '/language');
|
||||
foreach ($admin_langs as $folder)
|
||||
{
|
||||
if (!$folder->isDir() || $folder->isDot())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->_addDirectory('administrator/language/' . $folder->getFilename(), JPATH_ADMINISTRATOR . '/language/' . $folder->getFilename());
|
||||
}
|
||||
|
||||
// List all manifests folders
|
||||
$manifests = new DirectoryIterator(JPATH_ADMINISTRATOR . '/manifests');
|
||||
foreach ($manifests as $folder)
|
||||
{
|
||||
if (!$folder->isDir() || $folder->isDot())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->_addDirectory('administrator/manifests/' . $folder->getFilename(), JPATH_ADMINISTRATOR . '/manifests/' . $folder->getFilename());
|
||||
}
|
||||
|
||||
$this->_addDirectory('administrator/modules', JPATH_ADMINISTRATOR . '/modules');
|
||||
$this->_addDirectory('administrator/templates', JPATH_THEMES);
|
||||
|
||||
$this->_addDirectory('components', JPATH_SITE . '/components');
|
||||
|
||||
$this->_addDirectory($cparams->get('image_path'), JPATH_SITE . '/' . $cparams->get('image_path'));
|
||||
|
||||
// List all images folders
|
||||
$image_folders = new DirectoryIterator(JPATH_SITE . '/' . $cparams->get('image_path'));
|
||||
foreach ($image_folders as $folder)
|
||||
{
|
||||
if (!$folder->isDir() || $folder->isDot())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->_addDirectory('images/' . $folder->getFilename(), JPATH_SITE . '/' . $cparams->get('image_path') . '/' . $folder->getFilename());
|
||||
}
|
||||
|
||||
$this->_addDirectory('language', JPATH_SITE . '/language');
|
||||
|
||||
// List all site languages
|
||||
$site_langs = new DirectoryIterator(JPATH_SITE . '/language');
|
||||
foreach ($site_langs as $folder)
|
||||
{
|
||||
if (!$folder->isDir() || $folder->isDot())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->_addDirectory('language/' . $folder->getFilename(), JPATH_SITE . '/language/' . $folder->getFilename());
|
||||
}
|
||||
|
||||
$this->_addDirectory('libraries', JPATH_LIBRARIES);
|
||||
|
||||
$this->_addDirectory('media', JPATH_SITE . '/media');
|
||||
$this->_addDirectory('modules', JPATH_SITE . '/modules');
|
||||
$this->_addDirectory('plugins', JPATH_PLUGINS);
|
||||
|
||||
$plugin_groups = new DirectoryIterator(JPATH_SITE . '/plugins');
|
||||
foreach ($plugin_groups as $folder)
|
||||
{
|
||||
if (!$folder->isDir() || $folder->isDot())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->_addDirectory('plugins/' . $folder->getFilename(), JPATH_PLUGINS . '/' . $folder->getFilename());
|
||||
}
|
||||
|
||||
$this->_addDirectory('templates', JPATH_SITE . '/templates');
|
||||
$this->_addDirectory('configuration.php', JPATH_CONFIGURATION . '/configuration.php');
|
||||
$this->_addDirectory('cache', JPATH_SITE . '/cache', 'COM_ADMIN_CACHE_DIRECTORY');
|
||||
$this->_addDirectory('administrator/cache', JPATH_CACHE, 'COM_ADMIN_CACHE_DIRECTORY');
|
||||
|
||||
$this->_addDirectory($registry->get('log_path', JPATH_ROOT . '/log'), $registry->get('log_path', JPATH_ROOT . '/log'), 'COM_ADMIN_LOG_DIRECTORY');
|
||||
$this->_addDirectory($registry->get('tmp_path', JPATH_ROOT . '/tmp'), $registry->get('tmp_path', JPATH_ROOT . '/tmp'), 'COM_ADMIN_TEMP_DIRECTORY');
|
||||
}
|
||||
return $this->directories;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to add a directory
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
private function _addDirectory($name, $path, $message = '')
|
||||
{
|
||||
$this->directories[$name] = array('writable' => is_writable($path), 'message' => $message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the editor
|
||||
*
|
||||
* @return string The default editor
|
||||
*
|
||||
* @note: has to be removed (it is present in the config...)
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function &getEditor()
|
||||
{
|
||||
if (is_null($this->editor))
|
||||
{
|
||||
$config = JFactory::getConfig();
|
||||
$this->editor = $config->get('editor');
|
||||
}
|
||||
return $this->editor;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user