29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-30 00:53:41 +00:00

Merge remote-tracking branch 'upstream/4.0-dev' into dev

# Conflicts:
#	media/system/webcomponents/js/joomla-field-media-es5.min.js
#	media/system/webcomponents/js/joomla-field-media.min.js
#	media/system/webcomponents/js/joomla-field-send-test-mail-es5.min.js
#	media/system/webcomponents/js/joomla-field-send-test-mail.min.js
#	media/system/webcomponents/js/joomla-field-switcher-es5.min.js
#	media/system/webcomponents/js/joomla-field-switcher.min.js
#	media/system/webcomponents/js/joomla-field-user-es5.min.js
#	media/system/webcomponents/js/joomla-field-user.min.js
This commit is contained in:
David Neukirchen 2018-04-13 15:09:48 +02:00
commit 8dbd1062c9
No known key found for this signature in database
GPG Key ID: 95599020BAC38F20
158 changed files with 2988 additions and 2011 deletions

View File

@ -53,11 +53,7 @@ pipeline:
system-tests:
image: joomlaprojects/docker-systemtests:latest
commands:
- apache2ctl -D FOREGROUND &
- google-chrome --version
- chmod 755 libraries/vendor/joomla-projects/selenium-server-standalone/bin/webdrivers/chrome/linux/chromedriver
- mv libraries/vendor/joomla/test-system/src/acceptance.suite.dist.yml libraries/vendor/joomla/test-system/src/acceptance.suite.yml
- libraries/vendor/bin/robo run:tests
- bash libraries/vendor/joomla/test-system/src/drone-run.sh "$(pwd)"
services:
mysql:
@ -66,6 +62,7 @@ services:
MYSQL_USER: joomla_ut
MYSQL_PASSWORD: joomla_ut
MYSQL_ROOT_PASSWORD: joomla_ut
MYSQL_DATABASE: test_joomla
memcached:
image: memcached:alpine
@ -74,4 +71,4 @@ services:
image: redis:alpine
postgres:
image: postgres
image: postgres

View File

@ -252,14 +252,17 @@ class RoboFile extends \Robo\Tasks
$suites = [
'acceptance/install/',
'acceptance/administrator/components/com_users',
'acceptance/administrator/components/com_content',
'acceptance/administrator/components/com_media',
'acceptance/administrator/components/com_menu',
'acceptance/administrator/components/com_users',
];
foreach ($suites as $suite) {
$this->taskCodecept($pathToCodeception)
->arg('--fail-fast')
->arg('--steps')
->arg('--debug')
->env($opts['env'])
->arg($this->testsPath . $suite)
->run()

View File

@ -622,10 +622,11 @@ class SysInfoModel extends BaseDatabaseModel
}
else
{
$this->addDirectory('cache', JPATH_SITE . '/cache', 'COM_ADMIN_CACHE_DIRECTORY');
$this->addDirectory('administrator/cache', JPATH_CACHE, 'COM_ADMIN_CACHE_DIRECTORY');
}
$this->addDirectory('media/cache', JPATH_ROOT . '/media/cache', 'COM_ADMIN_MEDIA_CACHE_DIRECTORY');
if ($public)
{
$this->addDirectory(

View File

@ -115,20 +115,19 @@ class DisplayController extends BaseController
$app = $this->app;
$model = $this->getModel('cache');
$allCleared = true;
$clients = array(1, 0);
foreach ($clients as $client)
$mCache = $model->getCache();
foreach ($mCache->getAll() as $cache)
{
$mCache = $model->getCache($client);
$clientStr = \JText::_($client ? 'JADMINISTRATOR' : 'JSITE') .' > ';
foreach ($mCache->getAll() as $cache)
if ($mCache->clean($cache->group) === false)
{
if ($mCache->clean($cache->group) === false)
{
$app->enqueueMessage(\JText::sprintf('COM_CACHE_EXPIRED_ITEMS_DELETE_ERROR', $clientStr . $cache->group), 'error');
$allCleared = false;
}
$app->enqueueMessage(
\JText::sprintf(
'COM_CACHE_EXPIRED_ITEMS_DELETE_ERROR', \JText::_('JADMINISTRATOR') . ' > ' . $cache->group
), 'error'
);
$allCleared = false;
}
}

View File

@ -57,7 +57,6 @@ class CacheModel extends ListModel
'group',
'count',
'size',
'cliend_id',
);
}
@ -81,11 +80,6 @@ class CacheModel extends ListModel
// Load the filter state.
$this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string'));
// Special case for client id.
$clientId = (int) $this->getUserStateFromRequest($this->context . '.client_id', 'client_id', 0, 'int');
$clientId = (!in_array($clientId, array (0, 1))) ? 0 : $clientId;
$this->setState('client_id', $clientId);
parent::populateState($ordering, $direction);
}
@ -105,7 +99,6 @@ class CacheModel extends ListModel
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':' . $this->getState('client_id');
$id .= ':' . $this->getState('filter.search');
return parent::getStoreId($id);
@ -181,20 +174,15 @@ class CacheModel extends ListModel
*
* @return \JCacheController
*/
public function getCache($clientId = null)
public function getCache()
{
$conf = \JFactory::getConfig();
if (is_null($clientId))
{
$clientId = $this->getState('client_id');
}
$options = array(
'defaultgroup' => '',
'storage' => $conf->get('cache_handler', ''),
'caching' => true,
'cachebase' => (int) $clientId === 1 ? JPATH_ADMINISTRATOR . '/cache' : $conf->get('cache_path', JPATH_SITE . '/cache')
'cachebase' => $conf->get('cache_path', JPATH_CACHE)
);
return \JCache::getInstance('', $options);

View File

@ -62,17 +62,6 @@ class HtmlView extends BaseHtmlView
*/
protected function addToolbar()
{
$state = $this->get('State');
if ($state->get('client_id') == 1)
{
\JToolbarHelper::title(\JText::_('COM_CACHE_CLEAR_CACHE_ADMIN_TITLE'), 'lightning clear');
}
else
{
\JToolbarHelper::title(\JText::_('COM_CACHE_CLEAR_CACHE_SITE_TITLE'), 'lightning clear');
}
\JToolbarHelper::custom('delete', 'delete.png', 'delete_f2.png', 'JTOOLBAR_DELETE', true);
\JToolbarHelper::custom('deleteAll', 'delete.png', 'delete_f2.png', 'JTOOLBAR_DELETE_ALL', false);
\JToolbarHelper::divider();

View File

@ -1,14 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<field
name="client_id"
type="list"
onchange="jQuery('#filter_search, select[id^=filter_], #list_fullordering').val('');this.form.submit();"
filtermode="selector"
>
<option value="0">JSITE</option>
<option value="1">JADMINISTRATOR</option>
</field>
<fields name="filter">
<field
name="search"

View File

@ -118,7 +118,8 @@ class ApplicationModel extends FormModel
try
{
\JDatabaseDriver::getInstance($options)->getVersion();
$revisedDbo = \JDatabaseDriver::getInstance($options);
$revisedDbo->getVersion();
}
catch (\Exception $e)
{
@ -265,6 +266,43 @@ class ApplicationModel extends FormModel
$this->_db->execute();
}
// Purge the database session table if we are disabling session metadata
if ($prev['session_metadata'] == 1 && $data['session_metadata'] == 0)
{
try
{
// If we are are using the session handler, purge the extra columns, otherwise truncate the whole session table
if ($data['session_handler'] === 'database')
{
$revisedDbo->setQuery(
$revisedDbo->getQuery(true)
->update('#__session')
->set(
[
$revisedDbo->quoteName('client_id') . ' = 0',
$revisedDbo->quoteName('guest') . ' = NULL',
$revisedDbo->quoteName('userid') . ' = NULL',
$revisedDbo->quoteName('username') . ' = NULL',
]
)
)->execute();
}
else
{
$revisedDbo->truncateTable('#__session');
}
}
catch (RuntimeException $e)
{
/*
* The database API logs errors on failures so we don't need to add any error handling mechanisms here.
* Also, this data won't be added or checked anymore once the configuration is saved, so it'll purge itself
* through normal garbage collection anyway or if not using the database handler someone can purge the
* table on their own. Either way, carry on Soldier!
*/
}
}
// Set the shared session configuration
if (isset($data['shared_session']))
{
@ -324,7 +362,7 @@ class ApplicationModel extends FormModel
}
else
{
$path = JPATH_SITE . '/cache';
$path = JPATH_CACHE;
}
// Give a warning if the cache-folder can not be opened
@ -333,12 +371,12 @@ class ApplicationModel extends FormModel
$error = true;
// If a custom path is in use, try using the system default instead of disabling cache
if ($path !== JPATH_SITE . '/cache' && @opendir(JPATH_SITE . '/cache') != false)
if ($path !== JPATH_CACHE && @opendir(JPATH_CACHE) != false)
{
try
{
\JLog::add(
\JText::sprintf('COM_CONFIG_ERROR_CUSTOM_CACHE_PATH_NOTWRITABLE_USING_DEFAULT', $path, JPATH_SITE . '/cache'),
\JText::sprintf('COM_CONFIG_ERROR_CUSTOM_CACHE_PATH_NOTWRITABLE_USING_DEFAULT', $path, JPATH_CACHE),
\JLog::WARNING,
'jerror'
);
@ -346,12 +384,12 @@ class ApplicationModel extends FormModel
catch (\RuntimeException $logException)
{
$app->enqueueMessage(
\JText::sprintf('COM_CONFIG_ERROR_CUSTOM_CACHE_PATH_NOTWRITABLE_USING_DEFAULT', $path, JPATH_SITE . '/cache'),
\JText::sprintf('COM_CONFIG_ERROR_CUSTOM_CACHE_PATH_NOTWRITABLE_USING_DEFAULT', $path, JPATH_CACHE),
'warning'
);
}
$path = JPATH_SITE . '/cache';
$path = JPATH_CACHE;
$error = false;
$data['cache_path'] = '';

View File

@ -820,18 +820,6 @@
name="session"
label="CONFIG_SESSION_SETTINGS_LABEL">
<field
name="shared_session"
type="radio"
class="switcher"
default="0"
label="COM_CONFIG_FIELD_SHARED_SESSION_LABEL"
description="COM_CONFIG_FIELD_SHARED_SESSION_DESC"
filter="boolean">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="session_handler"
type="sessionhandler"
@ -849,29 +837,6 @@
filter="path"
showon="session_handler:filesystem" />
<field
name="session_memcache_server_host"
type="text"
label="COM_CONFIG_FIELD_MEMCACHE_HOST_LABEL"
default="localhost"
filter="string"
showon="session_handler:memcache"
size="25"
/>
<field
name="session_memcache_server_port"
type="number"
label="COM_CONFIG_FIELD_MEMCACHE_PORT_LABEL"
showon="session_handler:memcache"
min="1"
max="65535"
default="11211"
validate="number"
filter="integer"
size="5"
/>
<field
name="session_memcached_server_host"
type="text"
@ -980,6 +945,18 @@
<option value="1">JYES</option>
</field>
<field
name="session_metadata"
type="radio"
class="switcher"
default="1"
label="COM_CONFIG_FIELD_SESSION_METADATA_LABEL"
description="COM_CONFIG_FIELD_SESSION_METADATA_DESC"
filter="boolean">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
</fieldset>
<fieldset

View File

@ -65,12 +65,11 @@ class ContactTable extends Table
$date = \JFactory::getDate()->toSql();
$userId = \JFactory::getUser()->id;
$this->modified = $date;
if ($this->id)
{
// Existing item
$this->modified_by = $userId;
$this->modified = $date;
}
else
{
@ -243,6 +242,11 @@ class ContactTable extends Table
$this->metadata = '{}';
}
if (empty($this->modified))
{
$this->modified = $this->getDbo()->getNullDate();
}
return true;
}

View File

@ -108,6 +108,11 @@ class FilterTable extends Table
$this->params = (string) $params;
}
if (empty($this->modified))
{
$this->modified = $nullDate;
}
return true;
}
@ -220,12 +225,11 @@ class FilterTable extends Table
$date = \JFactory::getDate()->toSql();
$userId = \JFactory::getUser()->id;
$this->modified = $date;
if ($this->filter_id)
{
// Existing item
$this->modified_by = $userId;
$this->modified = $date;
}
else
{

View File

@ -71,6 +71,7 @@ class ManageModel extends InstallerModel
$this->setState('filter.status', $this->getUserStateFromRequest($this->context . '.filter.status', 'filter_status', '', 'string'));
$this->setState('filter.type', $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type', '', 'string'));
$this->setState('filter.folder', $this->getUserStateFromRequest($this->context . '.filter.folder', 'filter_folder', '', 'string'));
$this->setState('filter.core', $this->getUserStateFromRequest($this->context . '.filter.core', 'filter_core', '', 'string'));
$this->setState('message', $app->getUserState('com_installer.message'));
$this->setState('extension_message', $app->getUserState('com_installer.extension_message'));
@ -301,14 +302,15 @@ class ManageModel extends InstallerModel
$type = $this->getState('filter.type');
$clientId = $this->getState('filter.client_id');
$folder = $this->getState('filter.folder');
$core = $this->getState('filter.core');
if ($status != '')
if ($status !== '')
{
if ($status == '2')
if ($status === '2')
{
$query->where('protected = 1');
}
elseif ($status == '3')
elseif ($status === '3')
{
$query->where('protected = 0');
}
@ -324,16 +326,39 @@ class ManageModel extends InstallerModel
$query->where('type = ' . $this->_db->quote($type));
}
if ($clientId != '')
if ($clientId !== '')
{
$query->where('client_id = ' . (int) $clientId);
}
if ($folder != '')
if ($folder !== '')
{
$query->where('folder = ' . $this->_db->quote($folder == '*' ? '' : $folder));
}
if ($core !== '')
{
$coreExtensions = \JExtensionHelper::getCoreExtensions();
$elements = array();
foreach ($coreExtensions as $extension)
{
$elements[] = $this->getDbo()->quote($extension[1]);
}
if ($elements)
{
if ($core === '1')
{
$query->where($this->getDbo()->quoteName('element') . ' IN (' . implode(',', $elements) . ')');
}
elseif ($core === '0')
{
$query->where($this->getDbo()->quoteName('element') . ' NOT IN (' . implode(',', $elements) . ')');
}
}
}
// Process search filter (extension id).
$search = $this->getState('filter.search');

View File

@ -6,17 +6,6 @@
description="COM_INSTALLER_PREFERENCES_DESCRIPTION"
>
<field
name="show_jed_info"
type="radio"
class="switcher"
label="COM_INSTALLER_SHOW_JED_INFORMATION_LABEL"
default="1"
>
<option value="0">COM_INSTALLER_SHOW_JED_INFORMATION_HIDE_MESSAGE</option>
<option value="1">COM_INSTALLER_SHOW_JED_INFORMATION_SHOW_MESSAGE</option>
</field>
<field
name="cachetimeout"
type="integer"

View File

@ -40,6 +40,16 @@
>
<option value="">COM_INSTALLER_VALUE_FOLDER_SELECT</option>
</field>
<field
name="core"
type="list"
onchange="this.form.submit();"
>
<option value="">COM_INSTALLER_VALUE_CORE_SELECT</option>
<option value="1">COM_INSTALLER_VALUE_CORE_YES</option>
<option value="0">COM_INSTALLER_VALUE_CORE_NO</option>
</field>
</fields>
<fields name="list">

View File

@ -7,7 +7,6 @@
<div class="media-main">
<media-toolbar></media-toolbar>
<media-browser></media-browser>
<media-infobar v-if="!this.isModal"></media-infobar>
</div>
</div>
<media-upload></media-upload>
@ -26,16 +25,13 @@
data() {
return {
// The full height of the app in px
fullHeight: '',
fullHeight: ''
};
},
computed: {
disks() {
return this.$store.state.disks;
},
isModal() {
return Joomla.getOptions('com_media', {}).isModal;
}
},
methods: {
/* Set the full height on the app container */

View File

@ -1,33 +1,36 @@
<template>
<div class="media-browser"
@dragenter="onDragEnter"
@drop="onDrop"
@dragover="onDragOver"
@dragleave="onDragLeave"
:style="mediaBrowserStyles"
ref="browserItems">
<div class="media-dragoutline">
<span class="fa fa-cloud-upload upload-icon" aria-hidden="true"></span>
<p>Drop file(s) to Upload</p>
</div>
<div v-if="listView === 'table'" class="media-browser-table">
<div class="media-browser-table-head">
<ul>
<li class="type"></li>
<li class="name">{{ translate('COM_MEDIA_MEDIA_NAME') }}</li>
<li class="size">{{ translate('COM_MEDIA_MEDIA_SIZE') }}</li>
<li class="dimension">{{ translate('COM_MEDIA_MEDIA_DIMENSION') }}</li>
<li class="created">{{ translate('COM_MEDIA_MEDIA_CREATED_AT') }}</li>
<li class="modified">{{ translate('COM_MEDIA_MEDIA_MODIFIED_AT') }}</li>
</ul>
<div>
<div class="media-browser"
@dragenter="onDragEnter"
@drop="onDrop"
@dragover="onDragOver"
@dragleave="onDragLeave"
:style="mediaBrowserStyles"
ref="browserItems">
<div class="media-dragoutline">
<span class="fa fa-cloud-upload upload-icon" aria-hidden="true"></span>
<p>Drop file(s) to Upload</p>
</div>
<media-browser-item v-for="item in items" :key="item.path" :item="item"></media-browser-item>
</div>
<div class="media-browser-grid" v-else-if="listView === 'grid'">
<div class="media-browser-items" :class="mediaBrowserGridItemsClass">
<div v-if="listView === 'table'" class="media-browser-table">
<div class="media-browser-table-head">
<ul>
<li class="type"></li>
<li class="name">{{ translate('COM_MEDIA_MEDIA_NAME') }}</li>
<li class="size">{{ translate('COM_MEDIA_MEDIA_SIZE') }}</li>
<li class="dimension">{{ translate('COM_MEDIA_MEDIA_DIMENSION') }}</li>
<li class="created">{{ translate('COM_MEDIA_MEDIA_CREATED_AT') }}</li>
<li class="modified">{{ translate('COM_MEDIA_MEDIA_MODIFIED_AT') }}</li>
</ul>
</div>
<media-browser-item v-for="item in items" :key="item.path" :item="item"></media-browser-item>
</div>
<div class="media-browser-grid" v-else-if="listView === 'grid'">
<div class="media-browser-items" :class="mediaBrowserGridItemsClass">
<media-browser-item v-for="item in items" :key="item.path" :item="item"></media-browser-item>
</div>
</div>
</div>
<media-infobar v-if="!this.isModal" ref="infobar"></media-infobar>
</div>
</template>
@ -64,13 +67,18 @@
return {
['media-browser-items-' + this.$store.state.gridSize]: true,
}
},
isModal() {
return Joomla.getOptions('com_media', {}).isModal;
}
},
methods: {
/* Unselect all browser items */
unselectAllBrowserItems(event) {
const eventOutside = (this.$refs.browserItems && !this.$refs.browserItems.contains(event.target)) || event.target === this.$refs.browserItems;
if (eventOutside) {
const notClickedBrowserItems = (this.$refs.browserItems && !this.$refs.browserItems.contains(event.target)) || event.target === this.$refs.browserItems;
const notClickedInfobar = this.$refs.infobar !== undefined && !this.$refs.infobar.$el.contains(event.target);
const clickedOutside = notClickedBrowserItems && notClickedInfobar;
if (clickedOutside) {
this.$store.commit(types.UNSELECT_ALL_BROWSER_ITEMS);
}
},

View File

@ -7,14 +7,15 @@
float: none;
width: 25%;
padding: $gutter-width;
overflow: hidden;
overflow-y: scroll;
background-color: $info-bg;
border-left: 1px solid $border-color;
h2 {
padding: 0 $gutter-width;
padding: 10px ($gutter-width + 30px) 10px $gutter-width;
margin: (-$gutter-width) (-$gutter-width) $gutter-width;
font-weight: normal;
line-height: $info-title-height;
word-wrap: break-word;
background-color: $info-title-bg;
border-bottom: 1px solid #eee;
}

View File

@ -62,7 +62,7 @@ $table-item-bg-hover: rgba(0, 0, 0, .03);
// Media Info bar
$info-bg: #fafafa;
$info-title-bg: #f6f6f6;
$info-title-height: 3.6rem;
$info-title-height: 2rem;
$info-dt-width: 33.33333%;
$info-dd-width: 66.66667%;
$info-close-color: #ccc;

View File

@ -27,14 +27,20 @@ JHtml::_('stylesheet', 'media/com_media/css/mediamanager.css');
*/
$form = $this->form;
$tmpl = JFactory::getApplication()->input->getCmd('tmpl', '');
$tmpl = JFactory::getApplication()->input->getCmd('tmpl');
// Load the toolbar when we are in an iframe
if ($tmpl == 'component')
{
echo JToolbar::getInstance('toolbar')->render();
}
// Populate the media config
$config = [
'apiBaseUrl' => JUri::root() . 'administrator/index.php?option=com_media&format=json',
'csrfToken' => JSession::getFormToken(),
'uploadPath' => $this->file->path,
'editViewUrl' => JUri::root() . 'administrator/index.php?option=com_media&view=file' . $tmpl,
'editViewUrl' => JUri::root() . 'administrator/index.php?option=com_media&view=file' . (!empty($tmpl) ? ('&tmpl=' . $tmpl) : ''),
'allowedUploadExtensions' => $params->get('upload_extensions', ''),
'maxUploadSizeMb' => $params->get('upload_maxsize', 10),
'contents' => base64_encode(file_get_contents($this->file->localpath)),

View File

@ -39,7 +39,7 @@ $config = array(
'filePath' => $params->get('file_path', 'images'),
'fileBaseUrl' => JUri::root() . $params->get('file_path', 'images'),
'fileBaseRelativeUrl' => $params->get('file_path', 'images'),
'editViewUrl' => JUri::root() . 'administrator/index.php?option=com_media&view=file' . $tmpl,
'editViewUrl' => JUri::root() . 'administrator/index.php?option=com_media&view=file' . (!empty($tmpl) ? ('&tmpl=' . $tmpl) : ''),
'allowedUploadExtensions' => $params->get('upload_extensions', ''),
'maxUploadSizeMb' => $params->get('upload_maxsize', 10),
'providers' => (array) $this->providers,

View File

@ -14,6 +14,7 @@ JText::script('COM_MEDIA_ACTION_EDIT', true);
JText::script('COM_MEDIA_ACTION_PREVIEW', true);
JText::script('COM_MEDIA_CREATE_NEW_FOLDER', true);
JText::script('COM_MEDIA_CREATE_NEW_FOLDER_SUCCESS', true);
JText::script('COM_MEDIA_CREATE_NEW_FOLDER_ERROR', true);
JText::script('COM_MEDIA_DECREASE_GRID', true);
JText::script('COM_MEDIA_DELETE_ERROR', true);
JText::script('COM_MEDIA_DELETE_SUCCESS', true);

View File

@ -15,7 +15,6 @@ JHtml::_('behavior.formvalidator');
JHtml::_('behavior.combobox');
JHtml::_('behavior.keepalive');
JHtml::_('behavior.tabstate');
JHtml::_('formbehavior.chosen', '#jform_position', null, array('disable_search_threshold' => 0 ));
JHtml::_('formbehavior.chosen', '.multipleCategories', null, array('placeholder_text_multiple' => JText::_('JOPTION_SELECT_CATEGORY')));
JHtml::_('formbehavior.chosen', '.multipleTags', null, array('placeholder_text_multiple' => JText::_('JOPTION_SELECT_TAG')));

View File

@ -17,8 +17,6 @@ $state = 1;
$selectedPosition = $this->item->position;
$positions = JHtml::_('modules.positions', $clientId, $state, $selectedPosition);
JHtml::_('formbehavior.chosen', '.chzn-custom-value');
// Add custom position to options
$customGroupText = JText::_('COM_MODULES_CUSTOM_POSITION');
@ -26,10 +24,6 @@ $customGroupText = JText::_('COM_MODULES_CUSTOM_POSITION');
$attr = array(
'id' => 'jform_position',
'list.select' => $this->item->position,
'list.attr' => 'class="chzn-custom-value" '
. 'data-custom_group_text="' . $customGroupText . '" '
. 'data-no_results_text="' . JText::_('COM_MODULES_ADD_CUSTOM_POSITION') . '" '
. 'data-placeholder="' . JText::_('COM_MODULES_TYPE_OR_SELECT_POSITION') . '" '
);
echo JHtml::_('select.groupedlist', $positions, 'jform[position]', $attr);

View File

@ -121,6 +121,11 @@ class NewsfeedTable extends Table
$this->metadesc = StringHelper::str_ireplace($bad_characters, '', $this->metadesc);
}
if (empty($this->modified))
{
$this->modified = $this->getDbo()->getNullDate();
}
return true;
}
@ -138,12 +143,11 @@ class NewsfeedTable extends Table
$date = \JFactory::getDate();
$user = \JFactory::getUser();
$this->modified = $date->toSql();
if ($this->id)
{
// Existing item
$this->modified_by = $user->get('id');
$this->modified = $date->toSql();
}
else
{

View File

@ -113,6 +113,11 @@ class LinkTable extends Table
return false;
}
if (empty($this->modified_date))
{
$this->modified_date = $this->getDbo()->getNullDate();
}
return true;
}
@ -129,12 +134,11 @@ class LinkTable extends Table
{
$date = \JFactory::getDate()->toSql();
$this->modified_date = $date;
if (!$this->id)
{
// New record.
$this->created_date = $date;
$this->modified_date = $date;
}
return parent::store($updateNulls);

View File

@ -48,16 +48,19 @@ class NoteTable extends Table
$date = \JFactory::getDate()->toSql();
$userId = \JFactory::getUser()->get('id');
$this->modified_time = $date;
$this->modified_user_id = $userId;
if (!((int) $this->review_time))
{
// Null date.
$this->review_time = \JFactory::getDbo()->getNullDate();
}
if (empty($this->id))
if ($this->id)
{
// Existing item
$this->modified_time = $date;
$this->modified_user_id = $userId;
}
else
{
// New record.
$this->created_time = $date;
@ -158,4 +161,30 @@ class NoteTable extends Table
return true;
}
/**
* Method to perform sanity checks on the Table instance properties to ensure they are safe to store in the database.
*
* @return boolean True if the instance is sane and able to be stored in the database.
*
* @since __DEPLOY_VERSION__
*/
public function check()
{
try
{
parent::check();
}
catch (\Exception $e)
{
$this->setError($e->getMessage());
return false;
}
if (empty($this->modified_time))
{
$this->modified_time = $this->getDbo()->getNullDate();
}
}
}

View File

@ -21,5 +21,5 @@ define('JPATH_LIBRARIES', JPATH_ROOT . DIRECTORY_SEPARATOR . 'libraries');
define('JPATH_PLUGINS', JPATH_ROOT . DIRECTORY_SEPARATOR . 'plugins');
define('JPATH_INSTALLATION', JPATH_ROOT . DIRECTORY_SEPARATOR . 'installation');
define('JPATH_THEMES', JPATH_BASE . DIRECTORY_SEPARATOR . 'templates');
define('JPATH_CACHE', JPATH_BASE . DIRECTORY_SEPARATOR . 'cache');
define('JPATH_CACHE', JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'cache');
define('JPATH_MANIFESTS', JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'manifests');

View File

@ -59,10 +59,6 @@ COM_ADMIN_HELP_COMPONENTS_REDIRECT_MANAGER_EDIT="Redirect: Links - New/Edit"
COM_ADMIN_HELP_COMPONENTS_SEARCH="Search"
COM_ADMIN_HELP_COMPONENTS_TAGS_MANAGER="Tags"
COM_ADMIN_HELP_COMPONENTS_TAGS_MANAGER_EDIT="Tags: New/Edit"
COM_ADMIN_HELP_COMPONENTS_WEBLINKS_CATEGORIES="Web Links: Categories"
COM_ADMIN_HELP_COMPONENTS_WEBLINKS_CATEGORIES_EDIT="Web Links: Categories - New/Edit"
COM_ADMIN_HELP_COMPONENTS_WEBLINKS_LINKS="Web Links"
COM_ADMIN_HELP_COMPONENTS_WEBLINKS_LINKS_EDIT="Web Links: New/Edit"
COM_ADMIN_HELP_CONTENT_ARTICLE_MANAGER="Articles"
COM_ADMIN_HELP_CONTENT_ARTICLE_MANAGER_EDIT="Articles: New/Edit"
COM_ADMIN_HELP_CONTENT_FEATURED_ARTICLES="Articles: Featured "
@ -119,6 +115,7 @@ COM_ADMIN_MAGIC_QUOTES="Magic Quotes"
COM_ADMIN_MAX_INPUT_VARS="Maximum Input Variables"
COM_ADMIN_MBSTRING_ENABLED="Multibyte String (mbstring) Enabled"
COM_ADMIN_MCRYPT_ENABLED="Mcrypt Enabled"
COM_ADMIN_MEDIA_CACHE_DIRECTORY="Cached Media Directory"
COM_ADMIN_NA="n/a"
COM_ADMIN_OPEN_BASEDIR="Open basedir"
COM_ADMIN_OUTPUT_BUFFERING="Output Buffering"

View File

@ -4,8 +4,6 @@
; Note : All ini files need to be saved as UTF-8
COM_CACHE="Cache"
COM_CACHE_CLEAR_CACHE_ADMIN_TITLE="Maintenance: Clear Cache (Administrator)"
COM_CACHE_CLEAR_CACHE_SITE_TITLE="Maintenance: Clear Cache (Site)"
COM_CACHE_PURGE_EXPIRED_CACHE="Maintenance: Clear Expired Cache"
COM_CACHE_CONFIGURATION="Cache: Options"
COM_CACHE_ERROR_CACHE_CONNECTION_FAILED="Could not connect to the cache store to fetch the cache data."

View File

@ -108,6 +108,8 @@ COM_CONFIG_FIELD_SERVER_TIMEZONE_LABEL="Server Time Zone"
COM_CONFIG_FIELD_FILESYSTEM_PATH_DESC="The filesystem path where session data will be stored.<br>If empty, the system's temporary directory will be used."
COM_CONFIG_FIELD_FILESYSTEM_PATH_LABEL="Session Save Path"
COM_CONFIG_FIELD_SESSION_HANDLER_LABEL="Session Handler"
COM_CONFIG_FIELD_SESSION_METADATA_DESC="If enabled, additional metadata about a user's session (including their username, user ID, and which application they are logged into) will be logged to the session database table.<br>If disabled, features dependent on this data will be unavailable."
COM_CONFIG_FIELD_SESSION_METADATA_LABEL="Track Session Metadata"
COM_CONFIG_FIELD_SESSION_TIME_LABEL="Session Lifetime (minutes)"
COM_CONFIG_FIELD_SHARED_SESSION_DESC="When enabled, a user's session is shared between the frontend and administrator sections of the site. Note that changing this value will invalidate all existing sessions on the site. This is not available when the \"Force HTTPS\" option is set to \"Administrator Only\"."
COM_CONFIG_FIELD_SHARED_SESSION_LABEL="Shared Sessions"

View File

@ -26,8 +26,6 @@ COM_FINDER_CONFIG_SHOW_AUTOSUGGEST_LABEL="Search Suggestions"
COM_FINDER_CONFIG_SHOW_DATE_FILTERS_LABEL="Date Filters"
COM_FINDER_CONFIG_SHOW_DESCRIPTION_LABEL="Result Description"
COM_FINDER_CONFIG_SHOW_EXPLAINED_QUERY_LABEL="Query Explanation"
COM_FINDER_CONFIG_SHOW_FEED_LABEL="Show Feed"
COM_FINDER_CONFIG_SHOW_FEED_TEXT_LABEL="Show Feed Text"
COM_FINDER_CONFIG_SHOW_SUGGESTED_QUERY_LABEL="Did You Mean"
COM_FINDER_CONFIG_SHOW_URL_LABEL="Result URL"
COM_FINDER_CONFIG_SORT_DIRECTION_LABEL="Sort Direction"

View File

@ -190,10 +190,6 @@ COM_INSTALLER_PACKAGE_FILE="Package File"
COM_INSTALLER_PREFERENCES_DESCRIPTION="Fine tune how extensions installation and updates work."
COM_INSTALLER_PREFERENCES_LABEL="Preferences"
COM_INSTALLER_REINSTALL_BUTTON="Reinstall"
COM_INSTALLER_SHOW_JED_INFORMATION_HIDE_MESSAGE="Hide message"
COM_INSTALLER_SHOW_JED_INFORMATION_LABEL="Joomla! Extensions Directory"
COM_INSTALLER_SHOW_JED_INFORMATION_SHOW_MESSAGE="Show message"
COM_INSTALLER_SHOW_JED_INFORMATION_TOOLTIP="Opens Installer Options for setting to hide this Joomla! Extensions Directory&trade; message."
COM_INSTALLER_SUBMENU_DATABASE="Database"
COM_INSTALLER_SUBMENU_DISCOVER="Discover"
COM_INSTALLER_SUBMENU_INSTALL="Install"
@ -251,6 +247,9 @@ COM_INSTALLER_UPLOAD_AND_INSTALL="Upload &amp; Install"
COM_INSTALLER_UPLOAD_INSTALL_JOOMLA_EXTENSION="Upload & Install Joomla Extension"
COM_INSTALLER_UPLOAD_PACKAGE_FILE="Upload Package File"
COM_INSTALLER_VALUE_CLIENT_SELECT="- Select Location -"
COM_INSTALLER_VALUE_CORE_NO="Show non-core extensions"
COM_INSTALLER_VALUE_CORE_SELECT="- Select Core -"
COM_INSTALLER_VALUE_CORE_YES="Show core extensions"
COM_INSTALLER_VALUE_FOLDER_NONAPPLICABLE="N/A"
COM_INSTALLER_VALUE_FOLDER_SELECT="- Select Folder -"
COM_INSTALLER_VALUE_STATE_SELECT="- Select Status -"

View File

@ -11,6 +11,7 @@ COM_MEDIA_ACTION_PREVIEW="Preview item"
COM_MEDIA_CONFIGURATION="Media: Options"
COM_MEDIA_CREATE_NEW_FOLDER="Create New Folder"
COM_MEDIA_CREATE_NEW_FOLDER_SUCCESS="Folder created."
COM_MEDIA_CREATE_NEW_FOLDER_ERROR="Error creating folder."
COM_MEDIA_DECREASE_GRID="Decrease grid size"
COM_MEDIA_DELETE_ERROR="Error deleting the item."
COM_MEDIA_DELETE_SUCCESS="Item deleted."

View File

@ -1,127 +0,0 @@
; Joomla! Project
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8
COM_WEBLINKS="Web Links"
COM_WEBLINKS_ACCESS_HEADING="Access"
COM_WEBLINKS_BATCH_OPTIONS="Batch process the selected links"
COM_WEBLINKS_BATCH_TIP="If a category is selected for move/copy, any actions selected will be applied to the copied or moved links. Otherwise, all actions are applied to the selected links."
COM_WEBLINKS_CATEGORIES_DESC="These settings apply for Web Links Categories Options unless they are changed for a specific menu item."
COM_WEBLINKS_CATEGORY_DESC="These settings apply for Web Links Category Options unless they are changed for a specific menu item."
COM_WEBLINKS_COMPONENT_DESC="These settings apply for Web Links unless they are changed for a specific menu item or web link."
COM_WEBLINKS_COMPONENT_LABEL="Web Link"
COM_WEBLINKS_CONFIG_INTEGRATION_SETTINGS_DESC="These settings determine how the Web Links Component will integrate with other extensions."
COM_WEBLINKS_CONFIGURATION="Web Links Manager Options"
COM_WEBLINKS_EDIT_WEBLINK="Edit Web Link"
COM_WEBLINKS_ERR_TABLES_NAME="There is already a Web Link with that name in this category. Please try again."
COM_WEBLINKS_ERR_TABLES_PROVIDE_URL="Please provide a valid URL"
COM_WEBLINKS_ERR_TABLES_TITLE="Your web link must contain a title."
COM_WEBLINKS_ERROR_UNIQUE_ALIAS="Another web link from this category has the same alias (remember it may be a trashed item)."
COM_WEBLINKS_FIELD_ALIAS_DESC="The alias is for internal use only. Leave this blank and Joomla will fill in a default value from the title. It has to be unique for each web link in the same category."
COM_WEBLINKS_FIELD_CATEGORY_DESC="Choose a category for this Web link."
COM_WEBLINKS_FIELD_CATEGORYCHOOSE_DESC="Please choose a Web Links category to display."
COM_WEBLINKS_FIELD_CAPTCHA_DESC="Select the captcha plugin that will be used in the web link submit form. You may need to enter required information for your captcha plugin in the Plugin Manager.<br>If 'Use Default' is selected, make sure a captcha plugin is selected in Global Configuration."
COM_WEBLINKS_FIELD_CAPTCHA_LABEL="Allow Captcha on Web Link"
COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC="Show or hide the number of Web Links in each Category."
COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_LABEL="# Web Links"
COM_WEBLINKS_FIELD_CONFIG_COUNTCLICKS_DESC="If set to yes, the number of times the link has been clicked will be recorded."
COM_WEBLINKS_FIELD_CONFIG_COUNTCLICKS_LABEL="Count Clicks"
COM_WEBLINKS_FIELD_CONFIG_DESCRIPTION_DESC="Show or hide the description below."
COM_WEBLINKS_FIELD_CONFIG_HITS_DESC="Show or hide hits."
COM_WEBLINKS_FIELD_CONFIG_ICON_DESC="If Icon is chosen above, select an icon to display with the Web Links. If none is selected, the default icon will be used."
COM_WEBLINKS_FIELD_CONFIG_ICON_LABEL="Select Icon"
COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_DESC="Show or hide the links description."
COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_LABEL="Links Description"
COM_WEBLINKS_FIELD_CONFIG_OTHERCATS_DESC="Show or hide other categories."
COM_WEBLINKS_FIELD_CONFIG_OTHERCATS_LABEL="Other Categories"
COM_WEBLINKS_FIELD_CONFIG_SHOWREPORT_DESC="Show or hide the Report Bad Link option."
COM_WEBLINKS_FIELD_CONFIG_SHOWREPORT_LABEL="Reports"
COM_WEBLINKS_FIELD_COUNTCLICKS_DESC="If set to yes, the number of times the link has been clicked will be recorded."
COM_WEBLINKS_FIELD_COUNTCLICKS_LABEL="Count Clicks"
COM_WEBLINKS_FIELD_DESCRIPTION_DESC="Enter a description for the web link."
COM_WEBLINKS_FIELD_DISPLAY_NUM_DESC="Default number of Web links to list on a page."
COM_WEBLINKS_FIELD_DISPLAY_NUM_LABEL="# of Web links to List"
COM_WEBLINKS_FIELD_FIRST_DESC="The image to be displayed."
COM_WEBLINKS_FIELD_FIRST_LABEL="First Image"
COM_WEBLINKS_FIELD_HEIGHT_DESC="Height of the target popup or modal window. Defaults to 600x500 if one field is left empty."
COM_WEBLINKS_FIELD_HEIGHT_LABEL="Height"
COM_WEBLINKS_FIELD_ICON_DESC="Displays a text, an icon or nothing with the Web links. Default is 'Icon'."
COM_WEBLINKS_FIELD_ICON_LABEL="Text/Icon/Web Link Only"
COM_WEBLINKS_FIELD_ICON_OPTION_ICON="Icon"
COM_WEBLINKS_FIELD_ICON_OPTION_TEXT="Text"
COM_WEBLINKS_FIELD_ICON_OPTION_WEBLINK="Web Link Only"
COM_WEBLINKS_FIELD_IMAGE_ALT_DESC="Alternative text used for visitors without access to images. Replaced with caption text if it is present."
COM_WEBLINKS_FIELD_IMAGE_ALT_LABEL="Alt Text"
COM_WEBLINKS_FIELD_IMAGE_CAPTION_DESC="Caption attached to the image."
COM_WEBLINKS_FIELD_IMAGE_CAPTION_LABEL="Caption"
COM_WEBLINKS_FIELD_LANGUAGE_DESC="Assign a language to this web link."
COM_WEBLINKS_FIELD_MODIFIED_DESC="The date and time the link was last modified."
COM_WEBLINKS_FIELD_SECOND_DESC="The second image to be displayed."
COM_WEBLINKS_FIELD_SECOND_LABEL="Second Image"
COM_WEBLINKS_FIELD_SELECT_CATEGORY_DESC="Select a web links category to display."
COM_WEBLINKS_FIELD_SELECT_CATEGORY_LABEL="Select a Category"
COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_DESC="Show the tags for a category."
COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_LABEL="Show Tags"
COM_WEBLINKS_FIELD_SHOW_TAGS_DESC="Show the tags for a web link."
COM_WEBLINKS_FIELD_SHOW_TAGS_LABEL="Show Tags"
COM_WEBLINKS_FIELD_STATE_DESC="Set publication status."
COM_WEBLINKS_FIELD_TARGET_DESC="Target browser window when the link is selected."
COM_WEBLINKS_FIELD_TARGET_LABEL="Target"
COM_WEBLINKS_FIELD_TITLE_DESC="Web Link must have a title."
COM_WEBLINKS_FIELD_URL_DESC="You must enter a URL. IDN (International) Links are converted to punycode when they are saved."
COM_WEBLINKS_FIELD_URL_LABEL="URL"
COM_WEBLINKS_FIELD_VALUE_REPORTED="Reported"
COM_WEBLINKS_FIELD_VERSION_DESC="A count of the number of times this web link has been revised."
COM_WEBLINKS_FIELD_VERSION_LABEL="Revision"
COM_WEBLINKS_FIELD_WIDTH_DESC="Width of the target popup or modal window. Defaults to 600x500 if one field is left empty."
COM_WEBLINKS_FIELD_WIDTH_LABEL="Width"
COM_WEBLINKS_FIELDSET_IMAGES="Images"
COM_WEBLINKS_FIELDSET_OPTIONS="Options"
COM_WEBLINKS_FILTER_CATEGORY="Filter Category"
COM_WEBLINKS_FILTER_SEARCH_DESC="Search in web link title and alias. Prefix with ID: to search for a web link ID."
COM_WEBLINKS_FILTER_SEARCH_LABEL="Search Web Links"
COM_WEBLINKS_FILTER_STATE="Filter State"
COM_WEBLINKS_FLOAT_DESC="Controls placement of the image."
COM_WEBLINKS_FLOAT_LABEL="Image Float"
COM_WEBLINKS_HITS_DESC="Number of hits for this web link."
COM_WEBLINKS_LEFT="Left"
COM_WEBLINKS_LIST_LAYOUT_DESC="These settings apply for Web Links List Layout Options unless they are changed for a specific menu item."
COM_WEBLINKS_MANAGER_WEBLINK="Web Links"
COM_WEBLINKS_MANAGER_WEBLINKS="Web Links"
COM_WEBLINKS_MANAGER_WEBLINK_EDIT="Web Link: Edit"
COM_WEBLINKS_MANAGER_WEBLINK_NEW="Web Link: New"
COM_WEBLINKS_N_ITEMS_ARCHIVED="%d web links archived."
COM_WEBLINKS_N_ITEMS_ARCHIVED_1="%d web link archived."
COM_WEBLINKS_N_ITEMS_CHECKED_IN_0="No web link checked in."
COM_WEBLINKS_N_ITEMS_CHECKED_IN_1="%d web link checked in."
COM_WEBLINKS_N_ITEMS_CHECKED_IN_MORE="%d web links checked in."
COM_WEBLINKS_N_ITEMS_DELETED="%d web links deleted."
COM_WEBLINKS_N_ITEMS_DELETED_1="%d web link deleted."
COM_WEBLINKS_N_ITEMS_PUBLISHED="%d web links published."
COM_WEBLINKS_N_ITEMS_PUBLISHED_1="%d web link published."
COM_WEBLINKS_N_ITEMS_TRASHED="%d web links trashed."
COM_WEBLINKS_N_ITEMS_TRASHED_1="%d web link trashed."
COM_WEBLINKS_N_ITEMS_UNPUBLISHED="%d web links unpublished."
COM_WEBLINKS_N_ITEMS_UNPUBLISHED_1="%d web link unpublished."
COM_WEBLINKS_NEW_WEBLINK="New Web Link"
COM_WEBLINKS_NONE="None"
COM_WEBLINKS_OPTION_FILTER_ACCESS="- Filter Access -"
COM_WEBLINKS_OPTION_FILTER_CATEGORY="- Filter Category -"
COM_WEBLINKS_OPTION_FILTER_PUBLISHED="- Filter State -"
COM_WEBLINKS_OPTIONS="Options"
COM_WEBLINKS_ORDER_HEADING="Order"
COM_WEBLINKS_RIGHT="Right"
COM_WEBLINKS_SAVE_SUCCESS="Web link saved"
COM_WEBLINKS_SEARCH_IN_TITLE="Search in title"
COM_WEBLINKS_SHOW_EMPTY_CATEGORIES_DESC="If Show, empty categories will display. A category is only empty if it has no Web links or subcategories."
COM_WEBLINKS_SUBMENU_CATEGORIES="Categories"
COM_WEBLINKS_SUBMENU_WEBLINKS="Web Links"
COM_WEBLINKS_XML_DESCRIPTION="Component for web links management"
JGLOBAL_NO_ITEM_SELECTED="No web links selected"
JGLOBAL_NEWITEMSLAST_DESC="New Web links default to the last position. Ordering can be changed after this Web link is saved."
JLIB_APPLICATION_ERROR_BATCH_CANNOT_CREATE="You are not allowed to create new web links in this category."
JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT="You are not allowed to edit one or more of these web links."
JLIB_RULES_SETTING_NOTES="Changes apply to this component only.<br><em><strong>Inherited</strong></em> - a Global Configuration setting or higher level setting is applied.<br><em><strong>Denied</strong></em> always wins - whatever is set at the Global or higher level and applies to all child elements.<br><em><strong>Allowed</strong></em> will enable the action for this component unless it is overruled by a Global Configuration setting."

View File

@ -1,25 +0,0 @@
; Joomla! Project
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8
COM_WEBLINKS="Web Links"
COM_WEBLINKS_CATEGORIES="Categories"
COM_WEBLINKS_CATEGORIES_VIEW_DEFAULT_DESC="Show all the web link categories within a category."
COM_WEBLINKS_CATEGORIES_VIEW_DEFAULT_OPTION="Default"
COM_WEBLINKS_CATEGORIES_VIEW_DEFAULT_TITLE="List All Web Link Categories"
COM_WEBLINKS_CATEGORY_ADD_TITLE="Category Manager: Add A New Web Links Category"
COM_WEBLINKS_CATEGORY_EDIT_TITLE="Category Manager: Edit A Web Links Category"
COM_WEBLINKS_CATEGORY_VIEW_DEFAULT_DESC="Displays a list of Web Links for a category."
COM_WEBLINKS_CATEGORY_VIEW_DEFAULT_OPTION="Default"
COM_WEBLINKS_CATEGORY_VIEW_DEFAULT_TITLE="List Web Links in a Category"
COM_WEBLINKS_CONTENT_TYPE_WEBLINK="Web Link"
COM_WEBLINKS_CONTENT_TYPE_CATEGORY="Web Links Category"
COM_WEBLINKS_FORM_VIEW_DEFAULT_DESC="Display a form to submit a web link in the Frontend."
COM_WEBLINKS_FORM_VIEW_DEFAULT_OPTION="Default"
COM_WEBLINKS_FORM_VIEW_DEFAULT_TITLE="Submit a Web Link"
COM_WEBLINKS_LINKS="Links"
COM_WEBLINKS_TAGS_WEBLINK="Web Link"
COM_WEBLINKS_TAGS_CATEGORY="Web Link Category"
COM_WEBLINKS_XML_DESCRIPTION="Component for web links management."

View File

@ -671,7 +671,6 @@ JHELP_COMPONENTS_COM_SEARCH_OPTIONS="Components_Search_Manager_Options"
JHELP_COMPONENTS_COM_TAGS_OPTIONS="Components_Tags_Manager_Options"
JHELP_COMPONENTS_COM_TEMPLATES_OPTIONS="Components_Template_Manager_Options"
JHELP_COMPONENTS_COM_USERS_OPTIONS="Components_Users_Configuration"
JHELP_COMPONENTS_COM_WEBLINKS_OPTIONS="Components_Web_Links_Manager_Options"
JHELP_COMPONENTS_CONTACT_CATEGORIES="Components_Contacts_Categories"
JHELP_COMPONENTS_CONTACT_CATEGORY_ADD="Components_Contacts_Categories_Edit"
JHELP_COMPONENTS_CONTACT_CATEGORY_EDIT="Components_Contacts_Categories_Edit"
@ -711,11 +710,6 @@ JHELP_COMPONENTS_TAGS_MANAGER_EDIT="Components_Tags_Manager_Edit"
JHELP_COMPONENTS_USERS_CATEGORIES="Users_User_Note_Categories"
JHELP_COMPONENTS_USERS_CATEGORY_ADD="Users_User_Note_Category_Edit"
JHELP_COMPONENTS_USERS_CATEGORY_EDIT="Users_User_Note_Category_Edit"
JHELP_COMPONENTS_WEBLINKS_CATEGORIES="Components_Weblinks_Categories"
JHELP_COMPONENTS_WEBLINKS_CATEGORY_ADD="Components_Weblinks_Categories_Edit"
JHELP_COMPONENTS_WEBLINKS_CATEGORY_EDIT="Components_Weblinks_Categories_Edit"
JHELP_COMPONENTS_WEBLINKS_LINKS_EDIT="Components_Weblinks_Links_Edit"
JHELP_COMPONENTS_WEBLINKS_LINKS="Components_Weblinks_Links"
JHELP_CONTENT_ARTICLE_MANAGER="Content_Article_Manager"
JHELP_CONTENT_ARTICLE_MANAGER_EDIT="Content_Article_Manager_Edit"
JHELP_CONTENT_FEATURED_ARTICLES="Content_Featured_Articles"
@ -773,7 +767,6 @@ JHELP_EXTENSIONS_MODULE_MANAGER_STATISTICS="Extensions_Module_Manager_Statistics
JHELP_EXTENSIONS_MODULE_MANAGER_SYNDICATION_FEEDS="Extensions_Module_Manager_Syndication_Feeds"
JHELP_EXTENSIONS_MODULE_MANAGER_TAGS_POPULAR="Extensions_Module_Manager_Tags_Popular"
JHELP_EXTENSIONS_MODULE_MANAGER_TAGS_SIMILAR="Extensions_Module_Manager_Tags_Similar"
JHELP_EXTENSIONS_MODULE_MANAGER_WEBLINKS="Extensions_Module_Manager_Weblinks"
JHELP_EXTENSIONS_MODULE_MANAGER_WHO_ONLINE="Extensions_Module_Manager_Who_Online"
JHELP_EXTENSIONS_MODULE_MANAGER_WRAPPER="Extensions_Module_Manager_Wrapper"
JHELP_EXTENSIONS_PLUGIN_MANAGER="Extensions_Plugin_Manager"
@ -818,9 +811,6 @@ JHELP_MENUS_MENU_ITEM_USER_PROFILE="Menus_Menu_Item_User_Profile"
JHELP_MENUS_MENU_ITEM_USER_PROFILE_EDIT="Menus_Menu_Item_User_Profile_Edit"
JHELP_MENUS_MENU_ITEM_USER_REGISTRATION="Menus_Menu_Item_User_Registration"
JHELP_MENUS_MENU_ITEM_USER_REMINDER="Menus_Menu_Item_User_Reminder"
JHELP_MENUS_MENU_ITEM_WEBLINK_CATEGORIES="Menus_Menu_Item_Weblink_Categories"
JHELP_MENUS_MENU_ITEM_WEBLINK_CATEGORY="Menus_Menu_Item_Weblink_Category"
JHELP_MENUS_MENU_ITEM_WEBLINK_SUBMIT="Menus_Menu_Item_Weblink_Submit"
JHELP_MENUS_MENU_ITEM_WRAPPER="Menus_Menu_Item_Wrapper"
JHELP_MENUS_MENU_MANAGER="Menus_Menu_Manager"
JHELP_MENUS_MENU_MANAGER_EDIT="Menus_Menu_Manager_Edit"

View File

@ -9,6 +9,7 @@ MOD_LOGGED_FIELD_COUNT_LABEL="Users to Display"
MOD_LOGGED_LAST_ACTIVITY="Last Activity"
MOD_LOGGED_LOGOUT="Logout"
MOD_LOGGED_NAME="Name"
MOD_LOGGED_NO_SESSION_METADATA="Session metadata is disabled, cannot display the list of logged-in users."
MOD_LOGGED_TITLE="Last Logged-in Users"
MOD_LOGGED_TITLE_1="Last Logged-in User"
MOD_LOGGED_TITLE_MORE="Last %s Logged-in Users"

View File

@ -1,10 +0,0 @@
; Joomla! Project
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8
PLG_FINDER_WEBLINKS="Smart Search - Web Links"
PLG_FINDER_WEBLINKS_XML_DESCRIPTION="This plugin indexes Joomla! Web Links."
PLG_FINDER_QUERY_FILTER_BRANCH_P_WEB_LINK="Web links"
PLG_FINDER_QUERY_FILTER_BRANCH_S_WEB_LINK="Web link"

View File

@ -1,9 +0,0 @@
; Joomla! Project
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8
PLG_FINDER_STATISTICS_WEB_LINK="Web Link"
PLG_FINDER_WEBLINKS="Smart Search - Web Links"
PLG_FINDER_WEBLINKS_ERROR_ACTIVATING_PLUGIN="Could not automatically activate the &quot;Smart Search - Web Links&quot; plugin."
PLG_FINDER_WEBLINKS_XML_DESCRIPTION="This plugin indexes Joomla! Web Links."

View File

@ -1,10 +0,0 @@
; Joomla! Project
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8
PLG_SEARCH_WEBLINKS="Search - Web Links"
PLG_SEARCH_WEBLINKS_FIELD_SEARCHLIMIT_DESC="Number of search items to return."
PLG_SEARCH_WEBLINKS_FIELD_SEARCHLIMIT_LABEL="Search Limit"
PLG_SEARCH_WEBLINKS_WEBLINKS="Web Links"
PLG_SEARCH_WEBLINKS_XML_DESCRIPTION="Enables searching of Web Links Component."

View File

@ -1,7 +0,0 @@
; Joomla! Project
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8
PLG_SEARCH_WEBLINKS="Search - Web Links"
PLG_SEARCH_WEBLINKS_XML_DESCRIPTION="Enables searching of Web Links Component."

View File

@ -9,14 +9,23 @@
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Helper\ModuleHelper;
use Joomla\Module\Logged\Administrator\Helper\LoggedHelper;
$users = LoggedHelper::getList($params);
if ($params->get('automatic_title', 0))
{
$module->title = LoggedHelper::getTitle($params);
}
require ModuleHelper::getLayoutPath('mod_logged', $params->get('layout', 'default'));
// Check if session metadata tracking is enabled
if (Factory::getConfig()->get('session_metadata', true))
{
$users = LoggedHelper::getList($params);
require ModuleHelper::getLayoutPath('mod_logged', $params->get('layout', 'default'));
}
else
{
require ModuleHelper::getLayoutPath('mod_logged', 'disabled');
}

View File

@ -0,0 +1,15 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage mod_logged
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<p class="card-text">
<?php echo JText::_('MOD_LOGGED_NO_SESSION_METADATA'); ?>
</p>

View File

@ -42,7 +42,7 @@ compileCejs = (options) => {
b.add(rootPath + '/build/webcomponents/js/' + element + '/' + element + '.js');
c.add(rootPath + '/build/webcomponents/js/' + element + '/' + element + '.js');
b.transform(babelify, { presets: ["babel-preset-es2015"] }).bundle().pipe(bundleFs);
c.transform(babelify, { presets: ["babel-preset-es2015", "minify"] }).bundle().pipe(bundleFsMin);
c.transform(babelify, { presets: ["babel-preset-es2015", "babel-preset-minify"] }).bundle().pipe(bundleFsMin);
});
}

View File

@ -23,6 +23,21 @@
use Joomla\CMS\Version;
const PHP_TAB = "\t";
function usage($command)
{
echo PHP_EOL;
echo 'Usage: php ' . $command . ' [options]' . PHP_EOL;
echo PHP_TAB . '[options]:'.PHP_EOL;
echo PHP_TAB . PHP_TAB . '--remote <remote>:' . PHP_TAB . 'The git remote reference to build from (ex: `tags/3.8.6`, `4.0-dev`), defaults to the most recent tag for the repository' . PHP_EOL;
echo PHP_TAB . PHP_TAB . '--exclude-zip:' . PHP_TAB . PHP_TAB . 'Exclude the generation of .zip packages' . PHP_EOL;
echo PHP_TAB . PHP_TAB . '--exclude-gzip:' . PHP_TAB . PHP_TAB . 'Exclude the generation of .tar.gz packages' . PHP_EOL;
echo PHP_TAB . PHP_TAB . '--exclude-bzip2:' . PHP_TAB . 'Exclude the generation of .tar.bz2 packages' . PHP_EOL;
echo PHP_TAB . PHP_TAB . '--help:' . PHP_TAB . PHP_TAB . PHP_TAB . 'Show this help output' . PHP_EOL;
echo PHP_EOL;
}
if (version_compare(PHP_VERSION, '5.4', '<'))
{
echo "The build script requires PHP 5.4.\n";
@ -30,6 +45,8 @@ if (version_compare(PHP_VERSION, '5.4', '<'))
exit(1);
}
$time = time();
// Set path to git binary (e.g., /usr/local/git/bin/git or /usr/bin/git)
ob_start();
passthru('which git', $systemGit);
@ -38,24 +55,39 @@ $systemGit = trim(ob_get_clean());
// Make sure file and folder permissions are set correctly
umask(022);
// Import the version class to set the version information
define('JPATH_PLATFORM', 1);
require_once dirname(__DIR__) . '/libraries/src/Version.php';
// Set version information for the build
$version = Version::MAJOR_VERSION . '.' . Version::MINOR_VERSION;
$release = Version::PATCH_VERSION;
$fullVersion = (new Version)->getShortVersion();
// Shortcut the paths to the repository root and build folder
$repo = dirname(__DIR__);
$here = __DIR__;
// Set paths for the build packages
$tmp = $here . '/tmp';
$fullpath = $tmp . '/' . $fullVersion;
$fullpath = $tmp . '/' . $time;
echo "Start build for version $fullVersion.\n";
// Parse input options
$options = getopt('', ['help', 'remote::', 'exclude-zip', 'exclude-gzip', 'exclude-bzip2']);
$remote = isset($options['remote']) ? $options['remote'] : false;
$excludeZip = isset($options['exclude-zip']);
$excludeGzip = isset($options['exclude-gzip']);
$excludeBzip2 = isset($options['exclude-bzip2']);
$showHelp = isset($options['help']);
if ($showHelp)
{
usage($argv[0]);
die;
}
// If not given a remote, assume we are looking for the latest local tag
if (!$remote)
{
chdir($repo);
$tagVersion = system($systemGit . ' describe --tags `' . $systemGit . ' rev-list --tags --max-count=1`', $tagVersion);
$remote = 'tags/' . $tagVersion;
chdir($here);
}
echo "Start build for remote $remote.\n";
echo "Delete old release folder.\n";
system('rm -rf ' . $tmp);
mkdir($tmp);
@ -63,14 +95,23 @@ mkdir($fullpath);
echo "Copy the files from the git repository.\n";
chdir($repo);
system($systemGit . ' archive ' . $fullVersion . ' | tar -x -C ' . $fullpath);
system($systemGit . ' archive ' . $remote . ' | tar -x -C ' . $fullpath);
// Import the version class to set the version information
define('JPATH_PLATFORM', 1);
require_once $fullpath . '/libraries/src/Version.php';
// Set version information for the build
$version = Version::MAJOR_VERSION . '.' . Version::MINOR_VERSION;
$release = Version::PATCH_VERSION;
$fullVersion = (new Version)->getShortVersion();
chdir($tmp);
system('mkdir diffdocs');
system('mkdir diffconvert');
system('mkdir packages' . $version);
echo "Create list of changed files from git repository.\n";
echo "Create list of changed files from git repository for version $fullVersion.\n";
/*
* Here we force add every top-level directory and file in our diff archive, even if they haven't changed.
@ -151,6 +192,7 @@ $doNotPackage = array(
* These paths are from the repository root without the leading slash
*/
$doNotPatch = array(
'administrator/cache',
'administrator/logs',
'installation',
'images',
@ -164,9 +206,9 @@ for ($num = $release - 1; $num >= 0; $num--)
{
echo "Create version $num update packages.\n";
// Here we get a list of all files that have changed between the two tags ($previousTag and $fullVersion) and save in diffdocs
// Here we get a list of all files that have changed between the two references ($previousTag and $remote) and save in diffdocs
$previousTag = $version . '.' . $num;
$command = $systemGit . ' diff tags/' . $previousTag . ' tags/' . $fullVersion . ' --name-status > diffdocs/' . $version . '.' . $num;
$command = $systemGit . ' diff tags/' . $previousTag . ' ' . $remote . ' --name-status > diffdocs/' . $version . '.' . $num;
system($command);
@ -236,13 +278,24 @@ for ($num = $release - 1; $num >= 0; $num--)
}
$fromName = $num == 0 ? 'x' : $num;
// Create the diff archive packages using the file name list.
system('tar --create --bzip2 --no-recursion --directory ' . $fullVersion . ' --file packages' . $version . '/Joomla_' . $version . '.' . $fromName . '_to_' . $fullVersion . '-' . $packageStability . '-Patch_Package.tar.bz2 --files-from diffconvert/' . $version . '.' . $num . '> /dev/null');
system('tar --create --gzip --no-recursion --directory ' . $fullVersion . ' --file packages' . $version . '/Joomla_' . $version . '.' . $fromName . '_to_' . $fullVersion . '-' . $packageStability . '-Patch_Package.tar.gz --files-from diffconvert/' . $version . '.' . $num . '> /dev/null');
chdir($fullVersion);
system('zip ../packages' . $version . '/Joomla_' . $version . '.' . $fromName . '_to_' . $fullVersion . '-' . $packageStability . '-Patch_Package.zip -@ < ../diffconvert/' . $version . '.' . $num . '> /dev/null');
chdir('..');
// Create the diff archive packages using the file name list.
if (!$excludeBzip2)
{
system('tar --create --bzip2 --no-recursion --directory ' . $time . ' --file packages' . $version . '/Joomla_' . $version . '.' . $fromName . '_to_' . $fullVersion . '-' . $packageStability . '-Patch_Package.tar.bz2 --files-from diffconvert/' . $version . '.' . $num . '> /dev/null');
}
if (!$excludeGzip)
{
system('tar --create --gzip --no-recursion --directory ' . $time . ' --file packages' . $version . '/Joomla_' . $version . '.' . $fromName . '_to_' . $fullVersion . '-' . $packageStability . '-Patch_Package.tar.gz --files-from diffconvert/' . $version . '.' . $num . '> /dev/null');
}
if (!$excludeZip)
{
chdir($time);
system('zip ../packages' . $version . '/Joomla_' . $version . '.' . $fromName . '_to_' . $fullVersion . '-' . $packageStability . '-Patch_Package.zip -@ < ../diffconvert/' . $version . '.' . $num . '> /dev/null');
chdir('..');
}
}
// Delete the files and folders we exclude from the packages (tests, docs, build, etc.).
@ -250,20 +303,29 @@ echo "Delete folders not included in packages.\n";
foreach ($doNotPackage as $removeFile)
{
system('rm -rf ' . $fullVersion . '/' . $removeFile);
system('rm -rf ' . $time . '/' . $removeFile);
}
// Recreate empty directories before creating new archives.
system('mkdir packages_full' . $fullVersion);
echo "Build full package files.\n";
chdir($fullVersion);
chdir($time);
// Create full archive packages.
system('tar --create --bzip2 --file ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Full_Package.tar.bz2 * > /dev/null');
if (!$excludeBzip2)
{
system('tar --create --bzip2 --file ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Full_Package.tar.bz2 * > /dev/null');
}
system('tar --create --gzip --file ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Full_Package.tar.gz * > /dev/null');
if (!$excludeGzip)
{
system('tar --create --gzip --file ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Full_Package.tar.gz * > /dev/null');
}
system('zip -r ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Full_Package.zip * > /dev/null');
if (!$excludeZip)
{
system('zip -r ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Full_Package.zip * > /dev/null');
}
// Create full update file without the default logs directory, installation folder, or sample images.
echo "Build full update package.\n";
@ -275,10 +337,19 @@ system('rm -r images/sampledata');
system('rm images/joomla_black.png');
system('rm images/powered_by.png');
system('tar --create --bzip2 --file ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Update_Package.tar.bz2 * > /dev/null');
if (!$excludeBzip2)
{
system('tar --create --bzip2 --file ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Update_Package.tar.bz2 * > /dev/null');
}
system('tar --create --gzip --file ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Update_Package.tar.gz * > /dev/null');
if (!$excludeGzip)
{
system('tar --create --gzip --file ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Update_Package.tar.gz * > /dev/null');
}
system('zip -r ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Update_Package.zip * > /dev/null');
if (!$excludeZip)
{
system('zip -r ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Update_Package.zip * > /dev/null');
}
echo "Build of version $fullVersion complete!\n";

View File

@ -0,0 +1,147 @@
customElements.define('joomla-editor-codemirror', class extends HTMLElement {
static get observedAttributes() {
return ['options'];
}
get options() { return JSON.parse(this.getAttribute('options')); }
set options(value) { this.setAttribute('options', value); }
attributeChangedCallback(attr, oldValue, newValue) {
switch (attr) {
case 'options':
if (oldValue && newValue !== oldValue) {
this.refresh(this.element);
}
break;
}
}
constructor() {
super();
this.instance = '';
this.cm = '';
this.file = document.currentScript;
this.element = this.querySelector('textarea');
this.host = window.location.origin;
// Append the editor script
if (!document.head.querySelector('#cm-editor')) {
const cmPath = this.getAttribute('editor');
const script1 = document.createElement('script');
script1.src = `${this.host}/${cmPath}`;
script1.id = 'cm-editor';
script1.setAttribute('async', false);
document.head.insertBefore(script1, this.file);
}
this.toggleFullScreen = this.toggleFullScreen.bind(this);
this.closeFullScreen = this.closeFullScreen.bind(this);
}
connectedCallback() {
const buttons = [].slice.call(this.querySelectorAll('.editor-xtd-buttons .xtd-button'));
this.checkElement('CodeMirror')
.then(() => {
// Append the addons script
if (!document.head.querySelector('#cm-addons')) {
const addonsPath = this.getAttribute('addons');
const script2 = document.createElement('script');
script2.src = `${this.host}/${addonsPath}`;
script2.id = 'cm-addons';
script2.setAttribute('async', false);
document.head.insertBefore(script2, this.file)
}
this.checkElement('CodeMirror', 'findModeByName')
.then(() => {
window.CodeMirror.keyMap.default["Ctrl-Q"] = this.toggleFullScreen;
window.CodeMirror.keyMap.default[this.getAttribute('fs-combo')] = this.toggleFullScreen;
window.CodeMirror.keyMap.default["Esc"] = this.closeFullScreen;
// For mode autoloading.
window.CodeMirror.modeURL = this.getAttribute('mod-path');
// Fire this function any time an editor is created.
window.CodeMirror.defineInitHook((editor) => {
// Try to set up the mode
const mode = window.CodeMirror.findModeByName(editor.options.mode || '');
if (mode) {
window.CodeMirror.autoLoadMode(editor, mode.mode);
editor.setOption('mode', mode.mime);
} else {
window.CodeMirror.autoLoadMode(editor, editor.options.mode);
}
// Handle gutter clicks (place or remove a marker).
editor.on("gutterClick", function (ed, n, gutter) {
if (gutter !== "CodeMirror-markergutter") {
return;
}
const info = ed.lineInfo(n);
const hasMarker = !!info.gutterMarkers && !!info.gutterMarkers["CodeMirror-markergutter"];
ed.setGutterMarker(n, "CodeMirror-markergutter", hasMarker ? null : this.makeMarker());
});
// Some browsers do something weird with the fieldset which doesn't work well with CodeMirror. Fix it.
if (this.parentNode.tagName.toLowerCase() === 'fieldset') {
this.parentNode.style.minWidth = 0;
}
});
/** Register Editor */
this.instance = window.CodeMirror.fromTextArea(this.element, this.options);
Joomla.editors.instances[this.element.id] = this.instance;
});
});
}
disconnectedCallback() {
// Remove from the Joomla API
delete Joomla.editors.instances[this.element.id];
}
refresh(element) {
this.instance = window.CodeMirror.fromTextArea(element, this.options);
}
rafAsync() {
return new Promise(resolve => {
requestAnimationFrame(resolve);
});
}
async checkElement(string1, string2) {
if (string2) {
while (typeof window[string1][string2] !== 'function') {
await this.rafAsync()
}
} else {
while (typeof window[string1] !== 'function') {
await this.rafAsync()
}
}
return true;
}
toggleFullScreen() {
this.instance.setOption("fullScreen", !this.instance.getOption("fullScreen"));
}
closeFullScreen() {
this.instance.getOption("fullScreen") && this.instance.setOption("fullScreen", false);
}
makeMarker() {
const marker = document.createElement("div");
marker.className = "CodeMirror-markergutter-mark";
return marker;
}
});

View File

@ -0,0 +1,33 @@
customElements.define('joomla-editor-none', class extends HTMLElement {
connectedCallback() {
this.insertAtCursor = this.insertAtCursor.bind(this);
const that = this;
/** Register Editor */
Joomla.editors.instances[that.childNodes[0].id] = {
'id': that.childNodes[0].id,
'element': that,
'getValue': () => { return that.childNodes[0].value; },
'setValue': (text) => { return that.childNodes[0].value = text; },
'replaceSelection': (text) => { return that.insertAtCursor(text); },
'onSave': () => {}
};
}
disconnectedCallback() {
/** Remove from the Joomla API */
delete Joomla.editors.instances[this.childNodes[0].id];
}
insertAtCursor(myValue) {
if (this.childNodes[0].selectionStart || this.childNodes[0].selectionStart === 0) {
const startPos = this.childNodes[0].selectionStart;
const endPos = this.childNodes[0].selectionEnd;
this.childNodes[0].value = this.childNodes[0].value.substring(0, startPos)
+ myValue
+ this.childNodes[0].value.substring(endPos, this.childNodes[0].value.length);
} else {
this.childNodes[0].value += myValue;
}
}
});

View File

@ -0,0 +1,132 @@
/**
* @package Joomla.JavaScript
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
;customElements.define('joomla-field-module-order', class extends HTMLElement {
constructor() {
super();
this.linkedFieldSelector = '';
this.linkedFieldElement = '';
this.originalPosition = '';
this.writeDynaList.bind(this);
this.getNewOrder.bind(this);
}
connectedCallback() {
this.linkedFieldSelector = this.getAttribute('data-linked-field') || 'jform_position';
if (!this.linkedFieldSelector) {
throw new Error('No linked field defined!')
}
this.linkedFieldElement = document.getElementById(this.linkedFieldSelector);
if (!this.linkedFieldElement) {
throw new Error('No linked field defined!')
}
const that = this;
this.originalPosition = this.linkedFieldElement.value;
/** Initialize the field **/
this.getNewOrder(this.originalPosition);
/** Watch for changes on the linked field **/
this.linkedFieldElement.addEventListener('change', () => {
that.originalPosition = that.linkedFieldElement.value;
that.getNewOrder(that.linkedFieldElement.value);
});
}
writeDynaList (selectProperties, source, originalPositionName, originalPositionValue) {
let i = 0;
const selectNode = document.createElement('select');
if (this.hasOwnProperty('disabled')) {
selectNode.setAttribute('disabled', '');
}
if (this.getAttribute('onchange')) {
selectNode.setAttribute('onchange', this.getAttribute('onchange'));
}
if (this.getAttribute('size')) {
selectNode.setAttribute('size', this.getAttribute('size'));
}
selectNode.classList.add(selectProperties.itemClass);
selectNode.setAttribute('name', selectProperties.name);
selectNode.id = selectProperties.id;
for (let x in source) {
if (!source.hasOwnProperty(x)) {
continue;
}
const node = document.createElement('option');
const item = source[x];
node.value = item[1];
node.innerHTML = item[2];
if ((originalPositionName && originalPositionValue === item[1]) || (!originalPositionName && i === 0)) {
node.setAttribute('selected', 'selected');
}
selectNode.appendChild(node);
i++;
}
this.innerHTML = '';
this.appendChild(selectNode);
}
getNewOrder (originalPosition) {
const url = this.getAttribute('data-url');
const clientId = this.getAttribute('data-client-id');
const originalOrder = this.getAttribute('data-ordering');
const name = this.getAttribute('data-name');
const attr = this.getAttribute('data-client-attr') ? this.getAttribute('data-client-attr') : 'custom-select';
const id = this.getAttribute('id') + '_1';
const orders = [];
const that = this;
Joomla.request({
url: `${url}client_id=${clientId}&position=${originalPosition}`,
method: 'GET',
perform: true,
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
onSuccess: function(response, xhr) {
if (response) {
response = JSON.parse(response);
/** Check if everything is OK **/
if (response.data.length > 0) {
for (let i = 0; i < response.data.length; ++i) {
orders[i] = response.data[i].split(',');
}
that.writeDynaList({
name: name,
id: id,
itemClass: attr
},
orders,
that.originalPosition,
originalOrder,
);
}
}
/** Render messages, if any. There are only message in case of errors. **/
if (typeof response.messages == 'object' && response.messages !== null)
{
Joomla.renderMessages(response.messages);
}
}
}
);
}
});

View File

@ -245,12 +245,14 @@
this.panel = document.createElement('div');
this.panel.classList.add('simplecolors-panel');
this.panel.setAttribute('aria-labelledby', uniqueId);
this.hide = this.hide.bind(this);
this.colorSelect = this.colorSelect.bind(this);
this.buttons.forEach((el) => {
if (el.classList.contains('btn-close')) {
el.addEventListener('click', this.hide.bind(this));
el.addEventListener('click', this.hide);
} else {
el.addEventListener('click', this.colorSelect.bind(this));
el.addEventListener('click', this.colorSelect);
}
this.panel.insertAdjacentElement('beforeend', el);
@ -260,7 +262,7 @@
this.focusableElements = [].slice.call(this.panel.querySelectorAll(this.focusableSelectors.join()));
this.keys = this.keys .bind(this);
this.keys = this.keys.bind(this);
this.hide = this.hide.bind(this);
this.mousedown = this.mousedown.bind(this);
}
@ -314,7 +316,7 @@
bgcolor = 'transparent';
clss = 'nocolor';
} else {
color = e.target.style.backgroundColor;
color = this.rgb2hex(e.target.style.backgroundColor);
bgcolor = color;
}
@ -391,6 +393,19 @@
return this.textColor + ' ' + value.replace('#', '').split('').join(', ')
}
/**
* Converts a RGB color to its hexadecimal value.
* See http://stackoverflow.com/questions/1740700/get-hex-value-rather-than-rgb-value-using-$
*/
rgb2hex(rgb) {
const hex = (x) => {
return ("0" + parseInt(x, 10).toString(16)).slice(-2);
};
const matches = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
return '#' + hex(matches[1]) + hex(matches[2]) + hex(matches[3]);
}
}
customElements.define('joomla-field-simple-color', JoomlaFieldSimpleColor);

View File

@ -208,20 +208,20 @@ abstract class CmsModel extends BaseDatabaseModel
/**
* Clean the cache
*
* @param string $group The cache group
* @param integer $client_id The ID of the client
* @param string $group The cache group
*
* @return void
*
* @since 3.2
*/
protected function cleanCache($group = null, $client_id = 0)
protected function cleanCache($group = null)
{
$conf = \JFactory::getConfig();
$options = array(
$options = [
'defaultgroup' => $group ?: ($this->option ?? \JFactory::getApplication()->input->get('option')),
'cachebase' => $client_id ? JPATH_ADMINISTRATOR . '/cache' : $conf->get('cache_path', JPATH_SITE . '/cache'));
'cachebase' => $conf->get('cache_path', JPATH_CACHE),
];
$cache = \JCache::getInstance('callback', $options);
$cache->clean();

View File

@ -75,6 +75,11 @@ class HtmlView extends BaseHtmlView
*/
public function display($tpl = null)
{
if ($this->getLayout() == 'pagebreak')
{
return parent::display($tpl);
}
$app = \JFactory::getApplication();
$user = \JFactory::getUser();

500
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -20,5 +20,5 @@ define('JPATH_LIBRARIES', JPATH_ROOT . DIRECTORY_SEPARATOR . 'libraries');
define('JPATH_PLUGINS', JPATH_ROOT . DIRECTORY_SEPARATOR . 'plugins');
define('JPATH_INSTALLATION', JPATH_ROOT . DIRECTORY_SEPARATOR . 'installation');
define('JPATH_THEMES', JPATH_BASE . DIRECTORY_SEPARATOR . 'templates');
define('JPATH_CACHE', JPATH_BASE . DIRECTORY_SEPARATOR . 'cache');
define('JPATH_CACHE', JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'cache');
define('JPATH_MANIFESTS', JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'manifests');

View File

@ -22,5 +22,5 @@ define('JPATH_LIBRARIES', JPATH_ROOT . DIRECTORY_SEPARATOR . 'libraries');
define('JPATH_PLUGINS', JPATH_ROOT . DIRECTORY_SEPARATOR . 'plugins');
define('JPATH_INSTALLATION', JPATH_ROOT . DIRECTORY_SEPARATOR . 'installation');
define('JPATH_THEMES', JPATH_BASE);
define('JPATH_CACHE', JPATH_BASE . DIRECTORY_SEPARATOR . 'cache');
define('JPATH_CACHE', JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'cache');
define('JPATH_MANIFESTS', JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'manifests');

View File

@ -29,16 +29,16 @@ INSTL_PRECHECK_ACTUAL="Actual"
; Database view
INSTL_DATABASE="Database Configuration"
INSTL_DATABASE_ERROR_POSTGRESQL_QUERY="PostgreSQL database query failed."
INSTL_DATABASE_HOST_DESC="Specify the Host Name, usually \"localhost\" or a name provided by your host."
INSTL_DATABASE_HOST_DESC="Enter the Host Name, usually \"localhost\" or a name provided by your host."
INSTL_DATABASE_HOST_LABEL="Host Name"
INSTL_DATABASE_HOST_IS_NOT_LOCALHOST_CREATE_FILE="We were not able to create the file. Please manually create a file named &quot;%1$s&quot; and upload it to the &quot;%2$s&quot; folder of your Joomla site."
INSTL_DATABASE_HOST_IS_NOT_LOCALHOST_DELETE_FILE="In order to confirm that you are the owner of this website please delete the file named &quot;%1$s&quot; we have created in the &quot;%2$s&quot; folder of your Joomla site."
INSTL_DATABASE_HOST_IS_NOT_LOCALHOST_GENERAL_MESSAGE="You are trying to use a database host which is not on your local server. For security reasons, you need to verify the ownership of your web hosting account. <a href="_QQ_"%s"_QQ_">Please read the documentation</a> for more information."
INSTL_DATABASE_NAME_DESC="Specify the database table name. Use table prefix to distinct Joomla sites."
INSTL_DATABASE_NAME_DESC="Enter the database name."
INSTL_DATABASE_NAME_LABEL="Database Name"
INSTL_DATABASE_NO_SCHEMA="No database schema exists for this database type."
INSTL_DATABASE_PASSWORD_DESC="Either a password you created or a password provided by your host."
INSTL_DATABASE_PREFIX_DESC="Specify a table prefix or use the randomly generated one."
INSTL_DATABASE_PREFIX_DESC="Enter a table prefix or use the randomly generated one."
INSTL_DATABASE_TYPE_DESC="Select the database type."
INSTL_DATABASE_USER_DESC="Either a username you created or a username provided by your host."
INSTL_INSTALL_JOOMLA="Install Joomla"

View File

@ -495,7 +495,7 @@ INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `elem
(7, 0, 'com_checkin', 'component', 'com_checkin', '', 1, 1, 1, 1, '', '', 0, '0000-00-00 00:00:00', 0, 0, 'Joomla\\Component\\Checkin'),
(8, 0, 'com_contact', 'component', 'com_contact', '', 1, 1, 1, 0, '', '{"contact_layout":"_:default","show_contact_category":"hide","save_history":"1","history_limit":10,"show_contact_list":"0","presentation_style":"sliders","show_tags":"1","show_info":"1","show_name":"1","show_position":"1","show_email":"0","show_street_address":"1","show_suburb":"1","show_state":"1","show_postcode":"1","show_country":"1","show_telephone":"1","show_mobile":"1","show_fax":"1","show_webpage":"1","show_image":"1","show_misc":"1","image":"","allow_vcard":"0","show_articles":"0","articles_display_num":"10","show_profile":"0","show_user_custom_fields":["-1"],"show_links":"0","linka_name":"","linkb_name":"","linkc_name":"","linkd_name":"","linke_name":"","contact_icons":"0","icon_address":"","icon_email":"","icon_telephone":"","icon_mobile":"","icon_fax":"","icon_misc":"","category_layout":"_:default","show_category_title":"1","show_description":"1","show_description_image":"0","maxLevel":"-1","show_subcat_desc":"1","show_empty_categories":"0","show_cat_items":"1","show_cat_tags":"1","show_base_description":"1","maxLevelcat":"-1","show_subcat_desc_cat":"1","show_empty_categories_cat":"0","show_cat_items_cat":"1","filter_field":"0","show_pagination_limit":"0","show_headings":"1","show_image_heading":"0","show_position_headings":"1","show_email_headings":"0","show_telephone_headings":"1","show_mobile_headings":"0","show_fax_headings":"0","show_suburb_headings":"1","show_state_headings":"1","show_country_headings":"1","show_pagination":"2","show_pagination_results":"1","initial_sort":"ordering","captcha":"","show_email_form":"1","show_email_copy":"0","banned_email":"","banned_subject":"","banned_text":"","validate_session":"1","custom_reply":"0","redirect":"","show_feed_link":"1","sef_advanced":0,"sef_ids":0,"custom_fields_enable":"1"}', 0, '0000-00-00 00:00:00', 0, 0, 'Joomla\\Component\\Contact'),
(9, 0, 'com_cpanel', 'component', 'com_cpanel', '', 1, 1, 1, 1, '', '', 0, '0000-00-00 00:00:00', 0, 0, 'Joomla\\Component\\Cpanel'),
(10, 0, 'com_installer', 'component', 'com_installer', '', 1, 1, 1, 1, '', '{"show_jed_info":"1","cachetimeout":"6","minimum_stability":"4"}', 0, '0000-00-00 00:00:00', 0, 0, 'Joomla\\Component\\Installer'),
(10, 0, 'com_installer', 'component', 'com_installer', '', 1, 1, 1, 1, '', '{"cachetimeout":"6","minimum_stability":"4"}', 0, '0000-00-00 00:00:00', 0, 0, 'Joomla\\Component\\Installer'),
(11, 0, 'com_languages', 'component', 'com_languages', '', 1, 1, 1, 1, '', '{"administrator":"en-GB","site":"en-GB"}', 0, '0000-00-00 00:00:00', 0, 0, 'Joomla\\Component\\Languages'),
(12, 0, 'com_login', 'component', 'com_login', '', 1, 1, 1, 1, '', '', 0, '0000-00-00 00:00:00', 0, 0, 'Joomla\\Component\\Login'),
(13, 0, 'com_media', 'component', 'com_media', '', 1, 1, 0, 1, '', '{"upload_extensions":"bmp,csv,doc,gif,ico,jpg,jpeg,odg,odp,ods,odt,pdf,png,ppt,txt,xcf,xls,BMP,CSV,DOC,GIF,ICO,JPG,JPEG,ODG,ODP,ODS,ODT,PDF,PNG,PPT,TXT,XCF,XLS","upload_maxsize":"10","file_path":"images","image_path":"images","restrict_uploads":"1","allowed_media_usergroup":"3","check_mime":"1","image_extensions":"bmp,gif,jpg,png","ignore_extensions":"","upload_mime":"image\\/jpeg,image\\/gif,image\\/png,image\\/bmp,application\\/msword,application\\/excel,application\\/pdf,application\\/powerpoint,text\\/plain,application\\/x-zip","upload_mime_illegal":"text\\/html"}', 0, '0000-00-00 00:00:00', 0, 0, 'Joomla\\Component\\Media'),

View File

@ -442,7 +442,7 @@ CREATE TABLE IF NOT EXISTS "#__contentitem_tag_map" (
"tag_id" integer NOT NULL,
"tag_date" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL,
"type_id" integer NOT NULL,
CONSTRAINT "#__uc_ItemnameTagid" UNIQUE ("type_id", "content_item_id", "tag_id")
CONSTRAINT "#__uc_itemnametagid" UNIQUE ("type_id", "content_item_id", "tag_id")
);
CREATE INDEX "#__contentitem_tag_map_idx_tag_type" ON "#__contentitem_tag_map" ("tag_id", "type_id");
CREATE INDEX "#__contentitem_tag_map_idx_date_id" ON "#__contentitem_tag_map" ("tag_date", "tag_id");
@ -505,7 +505,7 @@ INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "elem
(7, 0, 'com_checkin', 'component', 'com_checkin', '', 1, 1, 1, 1, '', '', 0, '1970-01-01 00:00:00', 0, 0, ''),
(8, 0, 'com_contact', 'component', 'com_contact', '', 1, 1, 1, 0, '', '{"contact_layout":"_:default","show_contact_category":"hide","save_history":"1","history_limit":10,"show_contact_list":"0","presentation_style":"sliders","show_tags":"1","show_info":"1","show_name":"1","show_position":"1","show_email":"0","show_street_address":"1","show_suburb":"1","show_state":"1","show_postcode":"1","show_country":"1","show_telephone":"1","show_mobile":"1","show_fax":"1","show_webpage":"1","show_image":"1","show_misc":"1","image":"","allow_vcard":"0","show_articles":"0","articles_display_num":"10","show_profile":"0","show_user_custom_fields":["-1"],"show_links":"0","linka_name":"","linkb_name":"","linkc_name":"","linkd_name":"","linke_name":"","contact_icons":"0","icon_address":"","icon_email":"","icon_telephone":"","icon_mobile":"","icon_fax":"","icon_misc":"","category_layout":"_:default","show_category_title":"1","show_description":"1","show_description_image":"0","maxLevel":"-1","show_subcat_desc":"1","show_empty_categories":"0","show_cat_items":"1","show_cat_tags":"1","show_base_description":"1","maxLevelcat":"-1","show_subcat_desc_cat":"1","show_empty_categories_cat":"0","show_cat_items_cat":"1","filter_field":"0","show_pagination_limit":"0","show_headings":"1","show_image_heading":"0","show_position_headings":"1","show_email_headings":"0","show_telephone_headings":"1","show_mobile_headings":"0","show_fax_headings":"0","show_suburb_headings":"1","show_state_headings":"1","show_country_headings":"1","show_pagination":"2","show_pagination_results":"1","initial_sort":"ordering","captcha":"","show_email_form":"1","show_email_copy":"0","banned_email":"","banned_subject":"","banned_text":"","validate_session":"1","custom_reply":"0","redirect":"","show_feed_link":"1","sef_advanced":0,"sef_ids":0,"custom_fields_enable":"1"}', 0, '1970-01-01 00:00:00', 0, 0, ''),
(9, 0, 'com_cpanel', 'component', 'com_cpanel', '', 1, 1, 1, 1, '', '', 0, '1970-01-01 00:00:00', 0, 0, ''),
(10, 0, 'com_installer', 'component', 'com_installer', '', 1, 1, 1, 1, '', '{"show_jed_info":"1","cachetimeout":"6","minimum_stability":"4"}', 0, '1970-01-01 00:00:00', 0, 0, ''),
(10, 0, 'com_installer', 'component', 'com_installer', '', 1, 1, 1, 1, '', '{"cachetimeout":"6","minimum_stability":"4"}', 0, '1970-01-01 00:00:00', 0, 0, ''),
(11, 0, 'com_languages', 'component', 'com_languages', '', 1, 1, 1, 1, '', '{"administrator":"en-GB","site":"en-GB"}', 0, '1970-01-01 00:00:00', 0, 0, ''),
(12, 0, 'com_login', 'component', 'com_login', '', 1, 1, 1, 1, '', '', 0, '1970-01-01 00:00:00', 0, 0, ''),
(13, 0, 'com_media', 'component', 'com_media', '', 1, 1, 0, 1, '', '{"upload_extensions":"bmp,csv,doc,gif,ico,jpg,jpeg,odg,odp,ods,odt,pdf,png,ppt,txt,xcf,xls,BMP,CSV,DOC,GIF,ICO,JPG,JPEG,ODG,ODP,ODS,ODT,PDF,PNG,PPT,TXT,XCF,XLS","upload_maxsize":"10","file_path":"images","image_path":"images","restrict_uploads":"1","allowed_media_usergroup":"3","check_mime":"1","image_extensions":"bmp,gif,jpg,png","ignore_extensions":"","upload_mime":"image\\/jpeg,image\\/gif,image\\/png,image\\/bmp,application\\/msword,application\\/excel,application\\/pdf,application\\/powerpoint,text\\/plain,application\\/x-zip","upload_mime_illegal":"text\\/html"}', 0, '1970-01-01 00:00:00', 0, 0, ''),
@ -652,8 +652,8 @@ INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "elem
(483, 0, 'plg_media-action_crop', 'plugin', 'crop', 'media-action', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0, ''),
(484, 0, 'plg_media-action_resize', 'plugin', 'resize', 'media-action', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0, ''),
(485, 0, 'plg_media-action_rotate', 'plugin', 'rotate', 'media-action', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0, ''),
(486, 0, 'plg_installer_webinstaller', 'plugin', 'webinstaller', 'installer', 0, 1, 1, 0, '', '{"tab_position":"1"}', 0, '0000-00-00 00:00:00', 0, 0, ''),
(487, 0, 'plg_system_httpheaders', 'plugin', 'httpheaders', 'system', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0, ''),
(486, 0, 'plg_installer_webinstaller', 'plugin', 'webinstaller', 'installer', 0, 1, 1, 0, '', '{"tab_position":"1"}', 0, '1970-01-01 00:00:00', 0, 0, ''),
(487, 0, 'plg_system_httpheaders', 'plugin', 'httpheaders', 'system', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0, ''),
(600, 802, 'English (en-GB)', 'language', 'en-GB', '', 0, 1, 1, 1, '', '', 0, '1970-01-01 00:00:00', 0, 0, ''),
(601, 802, 'English (en-GB)', 'language', 'en-GB', '', 1, 1, 1, 1, '', '', 0, '1970-01-01 00:00:00', 0, 0, ''),
(700, 0, 'files_joomla', 'file', 'joomla', '', 0, 1, 1, 1, '', '', 0, '1970-01-01 00:00:00', 0, 0, ''),

View File

@ -190,6 +190,7 @@ class ConfigurationModel extends BaseInstallationModel
$registry->set('lifetime', 15);
$registry->set('session_handler', 'database');
$registry->set('shared_session', false);
$registry->set('session_metadata', true);
// Generate the configuration class string buffer.
$buffer = $registry->toString('PHP', array('class' => 'JConfig', 'closingtag' => false));

View File

@ -1,39 +0,0 @@
; Joomla! Project
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8
COM_WEBLINKS_CAPTCHA_LABEL="Captcha"
COM_WEBLINKS_CAPTCHA_DESC="Please complete the security check."
COM_WEBLINKS_CONTENT_TYPE_WEBLINK="Web Link"
COM_WEBLINKS_CONTENT_TYPE_CATEGORY="Web Links Category"
COM_WEBLINKS_DEFAULT_PAGE_TITLE="Web Links"
COM_WEBLINKS_EDIT="Edit Web link"
COM_WEBLINKS_ERR_TABLES_NAME="There is already a Web Link with that name in this category. Please try again."
COM_WEBLINKS_ERR_TABLES_PROVIDE_URL="Please provide a valid URL"
COM_WEBLINKS_ERR_TABLES_TITLE="Your Web Link must contain a title."
COM_WEBLINKS_ERROR_CATEGORY_NOT_FOUND="Web Link category not found."
COM_WEBLINKS_ERROR_UNIQUE_ALIAS="Another Web Link from this category has the same alias (remember it may be a trashed item)."
COM_WEBLINKS_ERROR_WEBLINK_NOT_FOUND="Web Link not found."
COM_WEBLINKS_ERROR_WEBLINK_URL_INVALID="Invalid Web link URL."
COM_WEBLINKS_FIELD_ALIAS_DESC="The alias is for internal use only. Leave this blank and Joomla will fill in a default value from the title. It has to be unique for each web link in the same category."
COM_WEBLINKS_FIELD_CATEGORY_DESC="You must select a Category."
COM_WEBLINKS_FIELD_DESCRIPTION_DESC="Enter a description for your Web link."
COM_WEBLINKS_FILTER_LABEL="Filter Field"
COM_WEBLINKS_FILTER_SEARCH_DESC="Web Links filter search"
COM_WEBLINKS_FIELD_TITLE_DESC="Your Web Link must have a Title."
COM_WEBLINKS_FIELD_URL_DESC="You must enter a URL."
COM_WEBLINKS_FIELD_URL_LABEL="URL"
COM_WEBLINKS_FORM_CREATE_WEBLINK="Submit a Web Link"
COM_WEBLINKS_GRID_TITLE="Title"
COM_WEBLINKS_LINK="Web Link"
COM_WEBLINKS_NAME="Name"
COM_WEBLINKS_NO_WEBLINKS="There are no Web Links in this category."
COM_WEBLINKS_NUM="# of links:"
COM_WEBLINKS_NUM_ITEMS="Links in categories"
COM_WEBLINKS_FORM_EDIT_WEBLINK="Edit a Web Link"
COM_WEBLINKS_FORM_SUBMIT_WEBLINK="Submit a Web Link"
COM_WEBLINKS_SAVE_SUCCESS="Web link saved."
COM_WEBLINKS_SUBMIT_SAVE_SUCCESS="Web Link submitted."
COM_WEBLINKS_WEB_LINKS="Web Links"
JGLOBAL_NEWITEMSLAST_DESC="New Web Links default to the last position. Ordering can be changed after this Web Link has been saved."

View File

@ -1,41 +0,0 @@
; Joomla! Project
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8
MOD_WEBLINKS="Web Links"
MOD_WEBLINKS_FIELD_CATEGORY_DESC="Choose the Web Links category to display."
MOD_WEBLINKS_FIELD_GROUPBY_DESC="If set to yes, web links will be grouped by subcategories."
MOD_WEBLINKS_FIELD_GROUPBY_LABEL="Group By Subcategories"
MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_DESC="If set to yes, will show groups titles (valid only if grouping)."
MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_LABEL="Show Group Title"
MOD_WEBLINKS_FIELD_GROUPBYORDERING_DESC="Ordering for the subcategories (valid only if grouping)."
MOD_WEBLINKS_FIELD_GROUPBYORDERING_LABEL="Group Ordering"
MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_DESC="Direction for the subcategories (valid only if grouping)."
MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_LABEL="Group Ordering Direction"
MOD_WEBLINKS_FIELD_COLUMNS_DESC="When grouping by subcategories, split into # columns."
MOD_WEBLINKS_FIELD_COLUMNS_LABEL="Columns"
MOD_WEBLINKS_FIELD_COUNT_DESC="Number of Web Links to display."
MOD_WEBLINKS_FIELD_COUNT_LABEL="Count"
MOD_WEBLINKS_FIELD_COUNTCLICKS_DESC="If set to yes, the number of times the link has been clicked will be recorded."
MOD_WEBLINKS_FIELD_COUNTCLICKS_LABEL="Count Clicks"
MOD_WEBLINKS_FIELD_DESCRIPTION_DESC="Display Web Link description."
MOD_WEBLINKS_FIELD_DESCRIPTION_LABEL="Description"
MOD_WEBLINKS_FIELD_FOLLOW_DESC="Robots index - allow to follow or not."
MOD_WEBLINKS_FIELD_FOLLOW_LABEL="Follow/No Follow"
MOD_WEBLINKS_FIELD_HITS_DESC="Show hits."
MOD_WEBLINKS_FIELD_HITS_LABEL="Hits"
MOD_WEBLINKS_FIELD_ORDERDIRECTION_DESC="Set the ordering direction."
MOD_WEBLINKS_FIELD_ORDERDIRECTION_LABEL="Direction"
MOD_WEBLINKS_FIELD_ORDERING_DESC="Ordering for the Web Links."
MOD_WEBLINKS_FIELD_ORDERING_LABEL="Ordering"
MOD_WEBLINKS_FIELD_TARGET_DESC="Target browser window when the link is selected."
MOD_WEBLINKS_FIELD_TARGET_LABEL="Target Window"
MOD_WEBLINKS_FIELD_VALUE_ASCENDING="Ascending"
MOD_WEBLINKS_FIELD_VALUE_DESCENDING="Descending"
MOD_WEBLINKS_FIELD_VALUE_FOLLOW="Follow"
MOD_WEBLINKS_FIELD_VALUE_HITS="Hits"
MOD_WEBLINKS_FIELD_VALUE_NOFOLLOW="No follow"
MOD_WEBLINKS_FIELD_VALUE_ORDER="Order"
MOD_WEBLINKS_HITS="Hits"
MOD_WEBLINKS_XML_DESCRIPTION="This modules displays web links from a category defined in the Web Links component."

View File

@ -1,9 +0,0 @@
; Joomla! Project
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8
MOD_WEBLINKS="Web Links"
MOD_WEBLINKS_XML_DESCRIPTION="This modules displays Web Links from a category defined in the Web Links component."
MOD_WEBLINKS_LAYOUT_DEFAULT="Default"

View File

@ -15,6 +15,7 @@ MOD_WHOSONLINE_GUESTS_0="no guests"
MOD_WHOSONLINE_MEMBERS="%s&#160;members"
MOD_WHOSONLINE_MEMBERS_1="one member"
MOD_WHOSONLINE_MEMBERS_0="no members"
MOD_WHOSONLINE_NO_SESSION_METADATA="Unable to display online user data at this time."
MOD_WHOSONLINE_SAME_GROUP_MESSAGE="List of Users who belong to your user groups or your user groups' child groups"
MOD_WHOSONLINE_SHOWMODE_LABEL="Display"
MOD_WHOSONLINE_XML_DESCRIPTION="The Who's Online Module displays the number of Anonymous Users (e.g. Guests) and Registered Users (ones logged-in) that are currently accessing the website."

View File

@ -13,14 +13,13 @@ use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
$buttons = $displayData;
?>
<div id="editor-xtd-buttons" role="toolbar" aria-label="<?php echo Text::_('JTOOLBAR'); ?>">
<div class="editor-xtd-buttons" role="toolbar" aria-label="<?php echo Text::_('JTOOLBAR'); ?>">
<?php if ($buttons) : ?>
<?php foreach ($buttons as $button) : ?>
<?php echo $this->sublayout('button', $button); ?>
<?php endforeach; ?>
<?php foreach ($buttons as $button) : ?>
<?php echo LayoutHelper::render('joomla.editors.buttons.modal', $button); ?>
<?php echo $this->sublayout('modal', $button); ?>
<?php endforeach; ?>
<?php endif; ?>
</div>

View File

@ -22,7 +22,7 @@ if ($button->get('name')) :
$onclick = ($button->get('onclick')) ? ' onclick="' . $button->get('onclick') . '"' : '';
$title = ($button->get('title')) ? $button->get('title') : $button->get('text');
?>
<a href="<?php echo $href; ?>" role="button" class="btn btn-secondary <?php echo $class; ?>" <?php echo $button->get('modal') ? 'data-toggle="modal"' : '' ?> title="<?php echo $title; ?>" <?php echo $onclick; ?>>
<a href="<?php echo $href; ?>" role="button" class="xtd-button btn btn-secondary <?php echo $class; ?>" <?php echo $button->get('modal') ? 'data-toggle="modal"' : '' ?> title="<?php echo $title; ?>" <?php echo $onclick; ?>>
<span class="icon-<?php echo $button->get('name'); ?>" aria-hidden="true"></span>
<?php echo $button->get('text'); ?>
</a>

View File

@ -36,7 +36,7 @@ if (is_array($button->get('options')) && isset($options['confirmText']) && isset
. $options['confirmText'] . '</a>';
}
if (null !== $button->get('text'))
if (null !== $button->get('id'))
{
$id = str_replace(' ', '', $button->get('id'));
}
@ -53,7 +53,7 @@ echo HTMLHelper::_(
'title' => $title,
'height' => array_key_exists('height', $options) ? $options['height'] : '400px',
'width' => array_key_exists('width', $options) ? $options['width'] : '800px',
'bodyHeight' => array_key_exists('wibodyHeightdth', $options) ? $options['bodyHeight'] : '70',
'bodyHeight' => array_key_exists('bodyHeight', $options) ? $options['bodyHeight'] : '70',
'modalWidth' => array_key_exists('modalWidth', $options) ? $options['modalWidth'] : '80',
'footer' => $confirm . '<button class="btn btn-secondary" data-dismiss="modal" aria-hidden="true">'
. Text::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</button>'

View File

@ -47,26 +47,35 @@ extract($displayData);
* @var string $accept File types that are accepted.
*/
$attr = '';
// Initialize some field attributes.
$attr .= !empty($class) ? ' class="module-ajax-ordering ' . $class . '"' : 'class="module-ajax-ordering"';
$attr .= $disabled ? ' disabled' : '';
$attr .= !empty($size) ? ' size="' . $size . '"' : '';
$attributes['id'] = 'id="' . $id . '"';
$attributes['data-url'] = 'data-url="index.php?option=com_modules&task=module.orderPosition&' . $token . '"';
$attributes['data-element'] = 'data-element="parent_' . $id . '"';
$attributes['data-ordering'] = 'data-ordering="' . $ordering . '"';
$attributes['data-position-element'] = 'data-position-element="' . $element . '"';
$attributes['data-client-id'] = 'data-client-id="' . $clientId . '"';
$attributes['data-name'] = 'data-name="' . $name . '"';
// Initialize JavaScript field attributes.
$attr .= !empty($onchange) ? ' onchange="' . $onchange . '"' : '';
if ($disabled)
{
$attributes['disabled'] = 'disabled';
}
HTMLHelper::_('script', 'system/fields/moduleorder.min.js', array('version' => 'auto', 'relative' => true));
if ($class)
{
$attributes['class'] = 'class="' . $class . '"';
}
if ($size)
{
$attributes['size'] = 'size="' . $size . '"';
}
if ($onchange)
{
$attributes['onchange'] = 'onchange="' . $onchange . '"';
}
HTMLHelper::_('webcomponent', 'system/webcomponents/joomla-field-module-order.min.js', ['version' => 'auto', 'relative' => true]);
?>
<div
id="parent_<?php echo $id; ?>"
<?php echo $attr; ?>
data-url="<?php echo 'index.php?option=com_modules&task=module.orderPosition&' . $token; ?>"
data-element="<?php echo 'parent_' . $id; ?>"
data-ordering="<?php echo $ordering; ?>"
data-position-element="<?php echo $element; ?>"
data-client-id="<?php echo $clientId; ?>"
data-name="<?php echo $name; ?>"
data-attr="<?php echo $attr; ?>">
</div>
<joomla-field-module-order <?php echo implode($attributes, ' '); ?>></joomla-field-module-order>

View File

@ -119,8 +119,10 @@ $ajaxUri = Route::_('index.php?option=com_config&task=application.store&format=j
<?php foreach ($actions as $action) : ?>
<tr>
<td headers="actions-th<?php echo $group->value; ?>">
<label for="<?php echo $id; ?>_<?php echo $action->name; ?>_<?php echo $group->value; ?>" class="hasTooltip" >
<?php echo Text::_($action->title); ?>
<?php $description = (!empty($action->description)) ? ' class="hasTooltip" title="'
. \JHtml::_('tooltipText', $action->title, $action->description) . '"' : ''; ?>
<label for="<?php echo $id; ?>_<?php echo $action->name; ?>_<?php echo $group->value; ?>"<?php echo $description; ?>>
<?php echo Text::_($action->title); ?>
</label>
</td>

View File

@ -512,3 +512,15 @@ JLoader::registerAlias(
'\\Joomla\\CMS\\Application\\CLI\\Output\\Processor\\ProcessorInterface',
'5.0'
);
JLoader::registerAlias('JFile', '\\Joomla\\CMS\\Filesystem\\File', '5.0');
JLoader::registerAlias('JFolder', '\\Joomla\\CMS\\Filesystem\\Folder', '5.0');
JLoader::registerAlias('JFilesystemHelper', '\\Joomla\\CMS\\Filesystem\\FilesystemHelper', '5.0');
JLoader::registerAlias('JFilesystemPatcher', '\\Joomla\\CMS\\Filesystem\\Patcher', '5.0');
JLoader::registerAlias('JPath', '\\Joomla\\CMS\\Filesystem\\Path', '5.0');
JLoader::registerAlias('JStream', '\\Joomla\\CMS\\Filesystem\\Stream', '5.0');
JLoader::registerAlias('JStreamString', '\\Joomla\\CMS\\Filesystem\\Streams\\StreamString', '5.0');
JLoader::registerAlias('JStringController', '\\Joomla\\CMS\\Filesystem\\Support\\StringController', '5.0');
JLoader::registerAlias('JFilesystemWrapperFile', '\\Joomla\\CMS\\Filesystem\\Wrapper\\FileWrapper', '5.0');
JLoader::registerAlias('JFilesystemWrapperFolder', '\\Joomla\\CMS\\Filesystem\\Wrapper\\FolderWrapper', '5.0');
JLoader::registerAlias('JFilesystemWrapperPath', '\\Joomla\\CMS\\Filesystem\\Wrapper\\PathWrapper', '5.0');

View File

@ -256,7 +256,7 @@ abstract class JHtmlBootstrap
$opt['title'] = isset($params['title']) ? $params['title'] : null;
$opt['trigger'] = isset($params['trigger']) ? $params['trigger'] : 'hover focus';
$opt['constraints'] = isset($params['constraints']) ? $params['constraints'] : ['to' => 'scrollParent', 'attachment' => 'together', 'pin' => true];
$opt['offset'] = isset($params['offset']) ? $params['offset'] : '0 0';
$opt['offset'] = isset($params['offset']) ? $params['offset'] : '0,0';
$opt = (object) array_filter((array) $opt);
@ -311,7 +311,7 @@ abstract class JHtmlBootstrap
* html boolean Insert HTML into the popover. If false, jQuery's text method will be used to insert
* content into the dom.
* placement string|function how to position the popover - top | bottom | left | right
* selector string If a selector is provided, popover objects will be
* selector string If a selector is provided, popover objects will be
* delegated to the specified targets.
* template string Base HTML to use when creating the popover.
* title string|function default title value if `title` tag isn't present

View File

@ -171,7 +171,7 @@ class JNamespacePsr4Map
$query->select($db->quoteName(array('extension_id', 'element', 'namespace')))
->from($db->quoteName('#__extensions'))
->where($db->quoteName('namespace') . ' IS NOT NULL AND ' . $db->quoteName('namespace') . ' != ""');
->where($db->quoteName('namespace') . ' IS NOT NULL AND ' . $db->quoteName('namespace') . ' != ' . $db->quote(""));
$db->setQuery($query);

View File

@ -167,43 +167,46 @@ abstract class CMSApplication extends WebApplication implements ContainerAwareIn
$session = $event->getSession();
// TODO: At some point we need to get away from having session data always in the db.
$db = \JFactory::getDbo();
$time = time();
// Get the session handler from the configuration.
$handler = $this->get('session_handler', 'none');
// Purge expired session data if not using the database handler; the handler will run garbage collection as a native part of PHP's API
if ($handler != 'database' && $time % 2)
// If tracking of optional session metadata is enabled, run the following operations (defaults to true for B/C since forever)
if ($this->get('session_metadata', true))
{
// The modulus introduces a little entropy, making the flushing less accurate but fires the query less than half the time.
try
{
$db->setQuery(
$db->getQuery(true)
->delete($db->quoteName('#__session'))
->where($db->quoteName('time') . ' < ' . $db->quote((int) ($time - $session->getExpire())))
)->execute();
}
catch (\RuntimeException $e)
{
/*
* The database API logs errors on failures so we don't need to add any error handling mechanisms here.
* Since garbage collection does not result in a fatal error when run in the session API, we don't allow it here either.
*/
}
}
$db = \JFactory::getDbo();
$time = time();
/*
* Check for extra session metadata when:
*
* 1) The database handler is in use and the session is new
* 2) The database handler is not in use and the time is an even numbered second or the session is new
*/
if (($handler != 'database' && ($time % 2 || $session->isNew())) || ($handler == 'database' && $session->isNew()))
{
$this->checkSession();
// Get the session handler from the configuration.
$handler = $this->get('session_handler', 'none');
// Purge expired session data if not using the database handler; the handler will run garbage collection as a native part of PHP's API
if ($handler !== 'database' && $time % 2)
{
// The modulus introduces a little entropy, making the flushing less accurate but fires the query less than half the time.
try
{
$db->setQuery(
$db->getQuery(true)
->delete($db->quoteName('#__session'))
->where($db->quoteName('time') . ' < ' . $db->quote((int) ($time - $session->getExpire())))
)->execute();
}
catch (\RuntimeException $e)
{
/*
* The database API logs errors on failures so we don't need to add any error handling mechanisms here.
* Since garbage collection does not result in a fatal error when run in the session API, we don't allow it here either.
*/
}
}
/*
* Check for extra session metadata when:
*
* 1) The database handler is in use and the session is new
* 2) The database handler is not in use and the time is an even numbered second or the session is new
*/
if (($handler !== 'database' && ($time % 2 || $session->isNew())) || ($handler === 'database' && $session->isNew()))
{
$this->checkSession();
}
}
}
@ -224,6 +227,13 @@ abstract class CMSApplication extends WebApplication implements ContainerAwareIn
$session = \JFactory::getSession();
$user = \JFactory::getUser();
// If $user is still null at this point, we've hit an interesting chicken or egg problem getting the user loaded into the application
if (!$user)
{
$user = $session->get('user');
$this->loadIdentity($user);
}
$query = $db->getQuery(true)
->select($db->quoteName('session_id'))
->from($db->quoteName('#__session'))
@ -266,7 +276,6 @@ abstract class CMSApplication extends WebApplication implements ContainerAwareIn
$values[] = (int) $this->getClientId();
}
// If the insert failed, exit the application.
try
{
$db->setQuery(
@ -278,7 +287,12 @@ abstract class CMSApplication extends WebApplication implements ContainerAwareIn
}
catch (\RuntimeException $e)
{
throw new \RuntimeException(\JText::_('JERROR_SESSION_STARTUP'), $e->getCode(), $e);
/*
* The database API logs errors on failures so we don't need to add any error handling mechanisms here.
* As this query only deals with session metadata, if the session handler is using the database then the handler will
* try again to insert/update the important parts of the data otherwise in a worst case scenario the user's session does
* not persist beyond this request. When non-database session handlers are in use, this really doesn't matter.
*/
}
}
}
@ -334,6 +348,7 @@ abstract class CMSApplication extends WebApplication implements ContainerAwareIn
[
'subject' => $this,
'eventClass' => BeforeExecuteEvent::class,
'container' => $this->getContainer()
]
)
);

View File

@ -283,6 +283,18 @@ abstract class CliApplication extends AbstractApplication implements DispatcherA
return $this->container->get(SessionInterface::class);
}
/**
* Retrieve the application configuration object.
*
* @return Registry
*
* @since __DEPLOY_VERSION__
*/
public function getConfig()
{
return $this->config;
}
/**
* Flag if the application instance is a CLI or web based application.
*

View File

@ -12,7 +12,7 @@ defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Console;
use Joomla\CMS\Extension\ExtensionManagerTrait;
use Joomla\CMS\Input\Cli;
use Joomla\Input\Cli;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\Console\Application;
use Joomla\DI\Container;
@ -132,6 +132,7 @@ class ConsoleApplication extends Application implements DispatcherAwareInterface
* @return void
*
* @since 4.0.0
* @throws \Throwable
*/
public function execute()
{
@ -165,7 +166,7 @@ class ConsoleApplication extends Application implements DispatcherAwareInterface
/**
* Get the commands which should be registered by default to the application.
*
* @return CommandInterface[]
* @return \Joomla\Console\CommandInterface[]
*
* @since 4.0.0
*/
@ -181,6 +182,18 @@ class ConsoleApplication extends Application implements DispatcherAwareInterface
);
}
/**
* Retrieve the application configuration object.
*
* @return Registry
*
* @since __DEPLOY_VERSION__
*/
public function getConfig()
{
return $this->config;
}
/**
* Get the system message queue.
*

View File

@ -12,9 +12,7 @@ defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Access\Access;
use Joomla\CMS\Component\Exception\MissingComponentException;
use Joomla\CMS\MVC\Factory\MVCFactoryFactory;
use Joomla\Registry\Registry;
use Joomla\CMS\Dispatcher\DispatcherInterface;
/**
* Component helper class

View File

@ -13,12 +13,9 @@ defined('_JEXEC') or die;
use Joomla\CMS\Access\Exception\NotAllowed;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Form\FormFactoryAwareInterface;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\MVC\Factory\MVCFactoryFactoryInterface;
use Joomla\Input\Input;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormFactoryInterface;
/**
* Base class for a Joomla Dispatcher

View File

@ -0,0 +1,60 @@
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\CMS\Event;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Extension\ComponentInterface;
use Joomla\DI\Container;
defined('JPATH_PLATFORM') or die;
/**
* Event class for representing the extensions's `onBeforeExtensionBoot` event
*
* @since __DEPLOY_VERSION__
*/
class AfterExtensionBootEvent extends AbstractImmutableEvent
{
/**
* Get the event's extension type. Can be:
* - component
*
* @return string
*
* @since __DEPLOY_VERSION__
*/
public function getExtensionType(): string
{
return $this->getArgument('type');
}
/**
* Get the event's extension name.
*
* @return string
*
* @since __DEPLOY_VERSION__
*/
public function getExtensionName(): string
{
return $this->getArgument('extensionName');
}
/**
* Get the event's container object
*
* @return Container
*
* @since __DEPLOY_VERSION__
*/
public function getContainer(): Container
{
return $this->getArgument('container');
}
}

View File

@ -9,6 +9,7 @@
namespace Joomla\CMS\Event;
use Joomla\Application\AbstractApplication;
use Joomla\DI\Container;
defined('JPATH_PLATFORM') or die;
@ -30,4 +31,16 @@ class BeforeExecuteEvent extends AbstractImmutableEvent
{
return $this->getArgument('subject');
}
/**
* Get the event's container object
*
* @return Container
*
* @since __DEPLOY_VERSION__
*/
public function getContainer(): Container
{
return $this->getArgument('container');
}
}

View File

@ -0,0 +1,59 @@
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\CMS\Event;
use Joomla\CMS\Application\CMSApplication;
use Joomla\DI\Container;
defined('JPATH_PLATFORM') or die;
/**
* Event class for representing the extensions's `onBeforeExtensionBoot` event
*
* @since __DEPLOY_VERSION__
*/
class BeforeExtensionBootEvent extends AbstractImmutableEvent
{
/**
* Get the event's extension type. Can be:
* - component
*
* @return string
*
* @since __DEPLOY_VERSION__
*/
public function getExtensionType(): string
{
return $this->getArgument('type');
}
/**
* Get the event's extension name.
*
* @return string
*
* @since __DEPLOY_VERSION__
*/
public function getExtensionName(): string
{
return $this->getArgument('extensionName');
}
/**
* Get the event's container object
*
* @return Container
*
* @since __DEPLOY_VERSION__
*/
public function getContainer(): Container
{
return $this->getArgument('container');
}
}

View File

@ -126,7 +126,6 @@ class ExtensionHelper
// Core plugin extensions - authentication
array('plugin', 'cookie', 'authentication', 0),
array('plugin', 'gmail', 'authentication', 0),
array('plugin', 'joomla', 'authentication', 0),
array('plugin', 'ldap', 'authentication', 0),
@ -199,6 +198,7 @@ class ExtensionHelper
array('plugin', 'folderinstaller', 'installer', 0),
array('plugin', 'packageinstaller', 'installer', 0),
array('plugin', 'urlinstaller', 'installer', 0),
array('plugin', 'webinstaller', 'installer', 0),
// Core plugin extensions - media-action
array('plugin', 'crop', 'media-action', 0),
@ -225,6 +225,7 @@ class ExtensionHelper
array('plugin', 'debug', 'system', 0),
array('plugin', 'fields', 'system', 0),
array('plugin', 'highlight', 'system', 0),
array('plugin', 'httpheaders', 'system', 0),
array('plugin', 'languagecode', 'system', 0),
array('plugin', 'languagefilter', 'system', 0),
array('plugin', 'log', 'system', 0),

View File

@ -10,9 +10,11 @@ namespace Joomla\CMS\Extension;
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Event\AbstractEvent;
use Joomla\DI\Container;
use Joomla\DI\Exception\ContainerNotFoundException;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
/**
* Trait for classes which can load extensions
@ -26,7 +28,7 @@ trait ExtensionManagerTrait
*
* @var array
*/
private $extensions = ['component' => []];
private $extensions = [ComponentInterface::class => []];
/**
* Boots the component with the given name.
@ -45,7 +47,7 @@ trait ExtensionManagerTrait
// Path to to look for services
$path = JPATH_ADMINISTRATOR . '/components/com_' . $component;
return $this->loadExtension('component', $component, $path);
return $this->loadExtension(ComponentInterface::class, $component, $path);
}
/**
@ -70,6 +72,19 @@ trait ExtensionManagerTrait
// The container to get the services from
$container = $this->getContainer()->createChild();
$container->get(DispatcherInterface::class)->dispatch(
'onBeforeExtensionBoot',
AbstractEvent::create(
'onBeforeExtensionBoot',
[
'subject' => $this,
'type' => $type,
'extensionName' => $extensionName,
'container' => $container
]
)
);
// The path of the loader file
$path = $extensionPath . '/services/provider.php';
@ -86,11 +101,24 @@ trait ExtensionManagerTrait
}
// Fallback to legacy
if (!$container->has($type) && $type == 'component')
if (!$container->has($type) && $type == ComponentInterface::class)
{
$container->set($type, new LegacyComponent('com_' . $extensionName));
}
$container->get(DispatcherInterface::class)->dispatch(
'onAfterExtensionBoot',
AbstractEvent::create(
'onAfterExtensionBoot',
[
'subject' => $this,
'type' => $type,
'extensionName' => $extensionName,
'container' => $container
]
)
);
// Cache the extension
$this->extensions[$type][$extensionName] = $container->get($type);

View File

@ -13,6 +13,7 @@ defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Association\AssociationExtensionInterface;
use Joomla\CMS\Categories\Categories;
use Joomla\CMS\Dispatcher\DispatcherFactoryInterface;
use Joomla\CMS\Extension\ComponentInterface;
use Joomla\CMS\MVC\Factory\MVCFactoryFactoryInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
@ -36,7 +37,7 @@ class Component implements ServiceProviderInterface
public function register(Container $container)
{
$container->set(
'component',
ComponentInterface::class,
function (Container $container)
{
$component = new \Joomla\CMS\Extension\Component;

View File

@ -1,20 +1,30 @@
<?php
/**
* @package Joomla.Platform
* @subpackage FileSystem
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Filesystem;
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\Filesystem\Wrapper\PathWrapper;
use Joomla\CMS\Filesystem\Wrapper\FolderWrapper;
use Joomla\CMS\Client\ClientHelper;
use Joomla\CMS\Client\FtpClient;
/**
* A File handling class
*
* @since 11.1
*/
class JFile
class File
{
/**
* Gets the extension of a file name
@ -84,7 +94,7 @@ class JFile
*/
public static function copy($src, $dest, $path = null, $use_streams = false)
{
$pathObject = new JFilesystemWrapperPath;
$pathObject = new PathWrapper;
// Prepend a base path if it exists
if ($path)
@ -96,18 +106,18 @@ class JFile
// Check src path
if (!is_readable($src))
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_JFILE_FIND_COPY', $src), JLog::WARNING, 'jerror');
Log::add(Text::sprintf('JLIB_FILESYSTEM_ERROR_JFILE_FIND_COPY', $src), Log::WARNING, 'jerror');
return false;
}
if ($use_streams)
{
$stream = JFactory::getStream();
$stream = Factory::getStream();
if (!$stream->copy($src, $dest))
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_JFILE_STREAMS', $src, $dest, $stream->getError()), JLog::WARNING, 'jerror');
Log::add(Text::sprintf('JLIB_FILESYSTEM_ERROR_JFILE_STREAMS', $src, $dest, $stream->getError()), Log::WARNING, 'jerror');
return false;
}
@ -116,17 +126,17 @@ class JFile
}
else
{
$FTPOptions = JClientHelper::getCredentials('ftp');
$FTPOptions = ClientHelper::getCredentials('ftp');
if ($FTPOptions['enabled'] == 1)
{
// Connect the FTP client
$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
$ftp = FtpClient::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
// If the parent folder doesn't exist we must create it
if (!file_exists(dirname($dest)))
{
$folderObject = new JFilesystemWrapperFolder;
$folderObject = new FolderWrapper;
$folderObject->create(dirname($dest));
}
@ -145,7 +155,7 @@ class JFile
{
if (!@ copy($src, $dest))
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_COPY_FAILED_ERR01', $src, $dest), JLog::WARNING, 'jerror');
Log::add(Text::sprintf('JLIB_FILESYSTEM_ERROR_COPY_FAILED_ERR01', $src, $dest), Log::WARNING, 'jerror');
return false;
}
@ -168,8 +178,8 @@ class JFile
*/
public static function delete($file)
{
$FTPOptions = JClientHelper::getCredentials('ftp');
$pathObject = new JFilesystemWrapperPath;
$FTPOptions = ClientHelper::getCredentials('ftp');
$pathObject = new PathWrapper;
if (is_array($file))
{
@ -184,7 +194,7 @@ class JFile
if ($FTPOptions['enabled'] == 1)
{
// Connect the FTP client
$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
$ftp = FtpClient::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
}
foreach ($files as $file)
@ -220,7 +230,7 @@ class JFile
else
{
$filename = basename($file);
JLog::add(JText::sprintf('JLIB_FILESYSTEM_DELETE_FAILED', $filename), JLog::WARNING, 'jerror');
Log::add(Text::sprintf('JLIB_FILESYSTEM_DELETE_FAILED', $filename), Log::WARNING, 'jerror');
return false;
}
@ -243,7 +253,7 @@ class JFile
*/
public static function move($src, $dest, $path = '', $use_streams = false)
{
$pathObject = new JFilesystemWrapperPath;
$pathObject = new PathWrapper;
if ($path)
{
@ -254,18 +264,18 @@ class JFile
// Check src path
if (!is_readable($src))
{
JLog::add(JText::_('JLIB_FILESYSTEM_CANNOT_FIND_SOURCE_FILE'), JLog::WARNING, 'jerror');
Log::add(Text::_('JLIB_FILESYSTEM_CANNOT_FIND_SOURCE_FILE'), Log::WARNING, 'jerror');
return false;
}
if ($use_streams)
{
$stream = JFactory::getStream();
$stream = Factory::getStream();
if (!$stream->move($src, $dest))
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_JFILE_MOVE_STREAMS', $stream->getError()), JLog::WARNING, 'jerror');
Log::add(Text::sprintf('JLIB_FILESYSTEM_ERROR_JFILE_MOVE_STREAMS', $stream->getError()), Log::WARNING, 'jerror');
return false;
}
@ -274,12 +284,12 @@ class JFile
}
else
{
$FTPOptions = JClientHelper::getCredentials('ftp');
$FTPOptions = ClientHelper::getCredentials('ftp');
if ($FTPOptions['enabled'] == 1)
{
// Connect the FTP client
$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
$ftp = FtpClient::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
// Translate path for the FTP account
$src = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $src), '/');
@ -288,7 +298,7 @@ class JFile
// Use FTP rename to simulate move
if (!$ftp->rename($src, $dest))
{
JLog::add(JText::_('JLIB_FILESYSTEM_ERROR_RENAME_FILE'), JLog::WARNING, 'jerror');
Log::add(Text::_('JLIB_FILESYSTEM_ERROR_RENAME_FILE'), Log::WARNING, 'jerror');
return false;
}
@ -297,7 +307,7 @@ class JFile
{
if (!@ rename($src, $dest))
{
JLog::add(JText::_('JLIB_FILESYSTEM_ERROR_RENAME_FILE'), JLog::WARNING, 'jerror');
Log::add(Text::_('JLIB_FILESYSTEM_ERROR_RENAME_FILE'), Log::WARNING, 'jerror');
return false;
}
@ -323,7 +333,7 @@ class JFile
*/
public static function read($filename, $incpath = false, $amount = 0, $chunksize = 8192, $offset = 0)
{
JLog::add(__METHOD__ . ' is deprecated. Use native file_get_contents() syntax.', JLog::WARNING, 'deprecated');
Log::add(__METHOD__ . ' is deprecated. Use native file_get_contents() syntax.', Log::WARNING, 'deprecated');
$data = null;
@ -334,7 +344,7 @@ class JFile
if (false === $fh = fopen($filename, 'rb', $incpath))
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_READ_UNABLE_TO_OPEN_FILE', $filename), JLog::WARNING, 'jerror');
Log::add(Text::sprintf('JLIB_FILESYSTEM_ERROR_READ_UNABLE_TO_OPEN_FILE', $filename), Log::WARNING, 'jerror');
return false;
}
@ -396,7 +406,7 @@ class JFile
// If the destination directory doesn't exist we need to create it
if (!file_exists(dirname($file)))
{
$folderObject = new JFilesystemWrapperFolder;
$folderObject = new FolderWrapper;
if ($folderObject->create(dirname($file)) == false)
{
@ -406,14 +416,14 @@ class JFile
if ($use_streams)
{
$stream = JFactory::getStream();
$stream = Factory::getStream();
// Beef up the chunk size to a meg
$stream->set('chunksize', (1024 * 1024));
if (!$stream->writeFile($file, $buffer))
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_WRITE_STREAMS', $file, $stream->getError()), JLog::WARNING, 'jerror');
Log::add(Text::sprintf('JLIB_FILESYSTEM_ERROR_WRITE_STREAMS', $file, $stream->getError()), Log::WARNING, 'jerror');
return false;
}
@ -422,13 +432,13 @@ class JFile
}
else
{
$FTPOptions = JClientHelper::getCredentials('ftp');
$pathObject = new JFilesystemWrapperPath;
$FTPOptions = ClientHelper::getCredentials('ftp');
$pathObject = new PathWrapper;
if ($FTPOptions['enabled'] == 1)
{
// Connect the FTP client
$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
$ftp = FtpClient::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
// Translate path for the FTP account and use FTP write buffer to file
$file = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $file), '/');
@ -467,7 +477,7 @@ class JFile
if ($use_streams)
{
$stream = JFactory::getStream();
$stream = Factory::getStream();
// Beef up the chunk size to a meg
$stream->set('chunksize', (1024 * 1024));
@ -477,27 +487,27 @@ class JFile
return true;
}
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_WRITE_STREAMS', $file, $stream->getError()), JLog::WARNING, 'jerror');
Log::add(Text::sprintf('JLIB_FILESYSTEM_ERROR_WRITE_STREAMS', $file, $stream->getError()), Log::WARNING, 'jerror');
return false;
}
else
{
// Initialise variables.
$FTPOptions = JClientHelper::getCredentials('ftp');
$FTPOptions = ClientHelper::getCredentials('ftp');
if ($FTPOptions['enabled'] == 1)
{
// Connect the FTP client
$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
$ftp = FtpClient::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
// Translate path for the FTP account and use FTP write buffer to file
$file = JPath::clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $file), '/');
$file = Path::clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $file), '/');
$ret = $ftp->append($file, $buffer);
}
else
{
$file = JPath::clean($file);
$file = Path::clean($file);
$ret = is_int(file_put_contents($file, $buffer, FILE_APPEND));
}
@ -534,14 +544,14 @@ class JFile
if (!$isSafe)
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_WARNFS_ERR03', $dest), JLog::WARNING, 'jerror');
Log::add(Text::sprintf('JLIB_FILESYSTEM_ERROR_WARNFS_ERR03', $dest), Log::WARNING, 'jerror');
return false;
}
}
// Ensure that the path is valid and clean
$pathObject = new JFilesystemWrapperPath;
$pathObject = new PathWrapper;
$dest = $pathObject->clean($dest);
// Create the destination directory if it does not exist
@ -549,17 +559,17 @@ class JFile
if (!file_exists($baseDir))
{
$folderObject = new JFilesystemWrapperFolder;
$folderObject = new FolderWrapper;
$folderObject->create($baseDir);
}
if ($use_streams)
{
$stream = JFactory::getStream();
$stream = Factory::getStream();
if (!$stream->upload($src, $dest))
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_UPLOAD', $stream->getError()), JLog::WARNING, 'jerror');
Log::add(Text::sprintf('JLIB_FILESYSTEM_ERROR_UPLOAD', $stream->getError()), Log::WARNING, 'jerror');
return false;
}
@ -568,13 +578,13 @@ class JFile
}
else
{
$FTPOptions = JClientHelper::getCredentials('ftp');
$FTPOptions = ClientHelper::getCredentials('ftp');
$ret = false;
if ($FTPOptions['enabled'] == 1)
{
// Connect the FTP client
$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
$ftp = FtpClient::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
// Translate path for the FTP account
$dest = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $dest), '/');
@ -587,7 +597,7 @@ class JFile
}
else
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_WARNFS_ERR04', $src, $dest), JLog::WARNING, 'jerror');
Log::add(Text::sprintf('JLIB_FILESYSTEM_ERROR_WARNFS_ERR04', $src, $dest), Log::WARNING, 'jerror');
}
}
else
@ -601,12 +611,12 @@ class JFile
}
else
{
JLog::add(JText::_('JLIB_FILESYSTEM_ERROR_WARNFS_ERR01'), JLog::WARNING, 'jerror');
Log::add(Text::_('JLIB_FILESYSTEM_ERROR_WARNFS_ERR01'), Log::WARNING, 'jerror');
}
}
else
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_WARNFS_ERR04', $src, $dest), JLog::WARNING, 'jerror');
Log::add(Text::sprintf('JLIB_FILESYSTEM_ERROR_WARNFS_ERR04', $src, $dest), Log::WARNING, 'jerror');
}
}
@ -625,7 +635,7 @@ class JFile
*/
public static function exists($file)
{
$pathObject = new JFilesystemWrapperPath;
$pathObject = new PathWrapper;
return is_file($pathObject->clean($file));
}
@ -642,7 +652,7 @@ class JFile
*/
public static function getName($file)
{
JLog::add(__METHOD__ . ' is deprecated. Use native basename() syntax.', JLog::WARNING, 'deprecated');
Log::add(__METHOD__ . ' is deprecated. Use native basename() syntax.', Log::WARNING, 'deprecated');
// Convert back slashes to forward slashes
$file = str_replace('\\', '/', $file);

View File

@ -1,12 +1,13 @@
<?php
/**
* @package Joomla.Platform
* @subpackage FileSystem
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Filesystem;
defined('JPATH_PLATFORM') or die;
/**
@ -16,7 +17,7 @@ defined('JPATH_PLATFORM') or die;
*
* @since 11.1
*/
class JFilesystemHelper
class FilesystemHelper
{
/**
* Remote file size function for streams that don't support it
@ -262,7 +263,7 @@ class JFilesystemHelper
if (!$streams)
{
$files = new DirectoryIterator(__DIR__ . '/streams');
$files = new \DirectoryIterator(__DIR__ . '/Streams');
/* @type $file DirectoryIterator */
foreach ($files as $file)
@ -273,7 +274,7 @@ class JFilesystemHelper
continue;
}
$streams[] = $file->getBasename('.php');
$streams[] = str_replace('stream', '', strtolower($file->getBasename('.php')));
}
}

View File

@ -1,20 +1,29 @@
<?php
/**
* @package Joomla.Platform
* @subpackage FileSystem
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Filesystem;
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Filesystem\Wrapper\PathWrapper;
use Joomla\CMS\Filesystem\Wrapper\FileWrapper;
use Joomla\CMS\Client\ClientHelper;
use Joomla\CMS\Client\FtpClient;
use Joomla\CMS\Language\Text;
/**
* A Folder handling class
*
* @since 11.1
*/
abstract class JFolder
abstract class Folder
{
/**
* Copy a folder.
@ -28,14 +37,14 @@ abstract class JFolder
* @return boolean True on success.
*
* @since 11.1
* @throws RuntimeException
* @throws \RuntimeException
*/
public static function copy($src, $dest, $path = '', $force = false, $use_streams = false)
{
@set_time_limit(ini_get('max_execution_time'));
$FTPOptions = JClientHelper::getCredentials('ftp');
$pathObject = new JFilesystemWrapperPath;
$FTPOptions = ClientHelper::getCredentials('ftp');
$pathObject = new PathWrapper;
if ($path)
{
@ -49,29 +58,29 @@ abstract class JFolder
if (!self::exists($src))
{
throw new RuntimeException('Source folder not found', -1);
throw new \RuntimeException('Source folder not found', -1);
}
if (self::exists($dest) && !$force)
{
throw new RuntimeException('Destination folder already exists', -1);
throw new \RuntimeException('Destination folder already exists', -1);
}
// Make sure the destination exists
if (!self::create($dest))
{
throw new RuntimeException('Cannot create destination folder', -1);
throw new \RuntimeException('Cannot create destination folder', -1);
}
// If we're using ftp and don't have streams enabled
if ($FTPOptions['enabled'] == 1 && !$use_streams)
{
// Connect the FTP client
$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
$ftp = FtpClient::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
if (!($dh = @opendir($src)))
{
throw new RuntimeException('Cannot open source folder', -1);
throw new \RuntimeException('Cannot open source folder', -1);
}
// Walk through the directory copying files and recursing into folders.
while (($file = readdir($dh)) !== false)
@ -99,7 +108,7 @@ abstract class JFolder
if (!$ftp->store($sfid, $dfid))
{
throw new RuntimeException('Copy file failed', -1);
throw new \RuntimeException('Copy file failed', -1);
}
break;
}
@ -109,7 +118,7 @@ abstract class JFolder
{
if (!($dh = @opendir($src)))
{
throw new RuntimeException('Cannot open source folder', -1);
throw new \RuntimeException('Cannot open source folder', -1);
}
// Walk through the directory copying files and recursing into folders.
while (($file = readdir($dh)) !== false)
@ -134,18 +143,18 @@ abstract class JFolder
case 'file':
if ($use_streams)
{
$stream = JFactory::getStream();
$stream = Factory::getStream();
if (!$stream->copy($sfid, $dfid))
{
throw new RuntimeException('Cannot copy file: ' . $stream->getError(), -1);
throw new \RuntimeException('Cannot copy file: ' . $stream->getError(), -1);
}
}
else
{
if (!@copy($sfid, $dfid))
{
throw new RuntimeException('Copy file failed', -1);
throw new \RuntimeException('Copy file failed', -1);
}
}
break;
@ -168,11 +177,11 @@ abstract class JFolder
*/
public static function create($path = '', $mode = 0755)
{
$FTPOptions = JClientHelper::getCredentials('ftp');
$FTPOptions = ClientHelper::getCredentials('ftp');
static $nested = 0;
// Check to make sure the path valid and clean
$pathObject = new JFilesystemWrapperPath;
$pathObject = new PathWrapper;
$path = $pathObject->clean($path);
// Check if parent dir exists
@ -185,7 +194,7 @@ abstract class JFolder
if (($nested > 20) || ($parent == $path))
{
JLog::add(__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_FOLDER_LOOP'), JLog::WARNING, 'jerror');
Log::add(__METHOD__ . ': ' . Text::_('JLIB_FILESYSTEM_ERROR_FOLDER_LOOP'), Log::WARNING, 'jerror');
$nested--;
return false;
@ -214,7 +223,7 @@ abstract class JFolder
if ($FTPOptions['enabled'] == 1)
{
// Connect the FTP client
$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
$ftp = FtpClient::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
// Translate path to FTP path
$path = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $path), '/');
@ -257,7 +266,7 @@ abstract class JFolder
if ($inBaseDir == false)
{
// Return false for JFolder::create because the path to be created is not in open_basedir
JLog::add(__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_FOLDER_PATH'), JLog::WARNING, 'jerror');
Log::add(__METHOD__ . ': ' . Text::_('JLIB_FILESYSTEM_ERROR_FOLDER_PATH'), Log::WARNING, 'jerror');
return false;
}
@ -270,8 +279,8 @@ abstract class JFolder
if (!$ret = @mkdir($path, $mode))
{
@umask($origmask);
JLog::add(
__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_COULD_NOT_CREATE_DIRECTORY') . 'Path: ' . $path, JLog::WARNING, 'jerror'
Log::add(
__METHOD__ . ': ' . Text::_('JLIB_FILESYSTEM_ERROR_COULD_NOT_CREATE_DIRECTORY') . 'Path: ' . $path, Log::WARNING, 'jerror'
);
return false;
@ -296,18 +305,18 @@ abstract class JFolder
public static function delete($path)
{
@set_time_limit(ini_get('max_execution_time'));
$pathObject = new JFilesystemWrapperPath;
$pathObject = new PathWrapper;
// Sanity check
if (!$path)
{
// Bad programmer! Bad Bad programmer!
JLog::add(__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_DELETE_BASE_DIRECTORY'), JLog::WARNING, 'jerror');
Log::add(__METHOD__ . ': ' . Text::_('JLIB_FILESYSTEM_ERROR_DELETE_BASE_DIRECTORY'), Log::WARNING, 'jerror');
return false;
}
$FTPOptions = JClientHelper::getCredentials('ftp');
$FTPOptions = ClientHelper::getCredentials('ftp');
// Check to make sure the path valid and clean
$path = $pathObject->clean($path);
@ -315,7 +324,7 @@ abstract class JFolder
// Is this really a folder?
if (!is_dir($path))
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER', $path), JLog::WARNING, 'jerror');
Log::add(Text::sprintf('JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER', $path), Log::WARNING, 'jerror');
return false;
}
@ -325,7 +334,7 @@ abstract class JFolder
if (!empty($files))
{
$file = new JFilesystemWrapperFile;
$file = new FileWrapper;
if ($file->delete($files) !== true)
{
@ -342,7 +351,7 @@ abstract class JFolder
if (is_link($folder))
{
// Don't descend into linked directories, just delete the link.
$file = new JFilesystemWrapperFile;
$file = new FileWrapper;
if ($file->delete($folder) !== true)
{
@ -360,7 +369,7 @@ abstract class JFolder
if ($FTPOptions['enabled'] == 1)
{
// Connect the FTP client
$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
$ftp = FtpClient::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
}
// In case of restricted permissions we zap it one way or the other
@ -379,7 +388,7 @@ abstract class JFolder
}
else
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_FOLDER_DELETE', $path), JLog::WARNING, 'jerror');
Log::add(Text::sprintf('JLIB_FILESYSTEM_ERROR_FOLDER_DELETE', $path), Log::WARNING, 'jerror');
$ret = false;
}
@ -400,8 +409,8 @@ abstract class JFolder
*/
public static function move($src, $dest, $path = '', $use_streams = false)
{
$FTPOptions = JClientHelper::getCredentials('ftp');
$pathObject = new JFilesystemWrapperPath;
$FTPOptions = ClientHelper::getCredentials('ftp');
$pathObject = new PathWrapper;
if ($path)
{
@ -411,21 +420,21 @@ abstract class JFolder
if (!self::exists($src))
{
return JText::_('JLIB_FILESYSTEM_ERROR_FIND_SOURCE_FOLDER');
return Text::_('JLIB_FILESYSTEM_ERROR_FIND_SOURCE_FOLDER');
}
if (self::exists($dest))
{
return JText::_('JLIB_FILESYSTEM_ERROR_FOLDER_EXISTS');
return Text::_('JLIB_FILESYSTEM_ERROR_FOLDER_EXISTS');
}
if ($use_streams)
{
$stream = JFactory::getStream();
$stream = Factory::getStream();
if (!$stream->move($src, $dest))
{
return JText::sprintf('JLIB_FILESYSTEM_ERROR_FOLDER_RENAME', $stream->getError());
return Text::sprintf('JLIB_FILESYSTEM_ERROR_FOLDER_RENAME', $stream->getError());
}
$ret = true;
@ -435,7 +444,7 @@ abstract class JFolder
if ($FTPOptions['enabled'] == 1)
{
// Connect the FTP client
$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
$ftp = FtpClient::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
// Translate path for the FTP account
$src = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $src), '/');
@ -444,7 +453,7 @@ abstract class JFolder
// Use FTP rename to simulate move
if (!$ftp->rename($src, $dest))
{
return JText::_('JLIB_FILESYSTEM_ERROR_RENAME_FILE');
return Text::_('JLIB_FILESYSTEM_ERROR_RENAME_FILE');
}
$ret = true;
@ -453,7 +462,7 @@ abstract class JFolder
{
if (!@rename($src, $dest))
{
return JText::_('JLIB_FILESYSTEM_ERROR_RENAME_FILE');
return Text::_('JLIB_FILESYSTEM_ERROR_RENAME_FILE');
}
$ret = true;
@ -474,7 +483,7 @@ abstract class JFolder
*/
public static function exists($path)
{
$pathObject = new JFilesystemWrapperPath;
$pathObject = new PathWrapper;
return is_dir($pathObject->clean($path));
}
@ -498,13 +507,13 @@ abstract class JFolder
$excludefilter = array('^\..*', '.*~'), $naturalSort = false)
{
// Check to make sure the path valid and clean
$pathObject = new JFilesystemWrapperPath;
$pathObject = new PathWrapper;
$path = $pathObject->clean($path);
// Is the path a folder?
if (!is_dir($path))
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER_FILES', $path), JLog::WARNING, 'jerror');
Log::add(Text::sprintf('JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER_FILES', $path), Log::WARNING, 'jerror');
return false;
}
@ -553,13 +562,13 @@ abstract class JFolder
$excludefilter = array('^\..*'))
{
// Check to make sure the path valid and clean
$pathObject = new JFilesystemWrapperPath;
$pathObject = new PathWrapper;
$path = $pathObject->clean($path);
// Is the path a folder?
if (!is_dir($path))
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER_FOLDER', $path), JLog::WARNING, 'jerror');
Log::add(Text::sprintf('JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER_FOLDER', $path), Log::WARNING, 'jerror');
return false;
}
@ -682,7 +691,7 @@ abstract class JFolder
if ($level < $maxLevel)
{
$folders = self::folders($path, $filter);
$pathObject = new JFilesystemWrapperPath;
$pathObject = new PathWrapper;
// First path, index foldernames
foreach ($folders as $name)

View File

@ -1,16 +1,17 @@
<?php
/**
* @package Joomla.Platform
* @subpackage FileSystem
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Filesystem;
defined('JPATH_PLATFORM') or die;
jimport('joomla.filesystem.file');
use Joomla\CMS\Log\Log;
use Joomla\CMS\Language\Text;
/**
* A Unified Diff Format Patcher class
@ -18,7 +19,7 @@ jimport('joomla.filesystem.file');
* @link http://sourceforge.net/projects/phppatcher/ This has been derived from the PhpPatcher version 0.1.1 written by Giuseppe Mazzotta
* @since 12.1
*/
class JFilesystemPatcher
class Patcher
{
/**
* Regular expression for searching source files
@ -73,7 +74,7 @@ class JFilesystemPatcher
/**
* Constructor
*
* The constructor is protected to force the use of JFilesystemPatcher::getInstance()
* The constructor is protected to force the use of FilesystemPatcher::getInstance()
*
* @since 12.1
*/
@ -84,7 +85,7 @@ class JFilesystemPatcher
/**
* Method to get a patcher
*
* @return JFilesystemPatcher an instance of the patcher
* @return FilesystemPatcher an instance of the patcher
*
* @since 12.1
*/
@ -101,7 +102,7 @@ class JFilesystemPatcher
/**
* Reset the pacher
*
* @return JFilesystemPatcher This object for chaining
* @return FilesystemPatcher This object for chaining
*
* @since 12.1
*/
@ -121,7 +122,7 @@ class JFilesystemPatcher
* @return integer The number of files patched
*
* @since 12.1
* @throws RuntimeException
* @throws \RuntimeException
*/
public function apply()
{
@ -156,7 +157,7 @@ class JFilesystemPatcher
// If no modifications were found, throw an exception
if (!$done)
{
throw new RuntimeException('Invalid Diff');
throw new \RuntimeException('Invalid Diff');
}
}
}
@ -169,7 +170,7 @@ class JFilesystemPatcher
{
$buffer = implode("\n", $content);
if (JFile::write($file, $buffer))
if (File::write($file, $buffer))
{
if (isset($this->sources[$file]))
{
@ -183,7 +184,7 @@ class JFilesystemPatcher
// Remove each removed file
foreach ($this->removals as $file)
{
if (JFile::delete($file))
if (File::delete($file))
{
if (isset($this->sources[$file]))
{
@ -213,7 +214,7 @@ class JFilesystemPatcher
* @param string $root The files root path
* @param string $strip The number of '/' to strip
*
* @return JFilesystemPatcher $this for chaining
* @return FilesystemPatcher $this for chaining
*
* @since 12.1
*/
@ -229,7 +230,7 @@ class JFilesystemPatcher
* @param string $root The files root path
* @param string $strip The number of '/' to strip
*
* @return JFilesystemPatcher $this for chaining
* @return FilesystemPatcher $this for chaining
*
* @since 12.1
*/
@ -270,7 +271,7 @@ class JFilesystemPatcher
* @return boolean TRUE in case of success, FALSE in case of failure
*
* @since 12.1
* @throws RuntimeException
* @throws \RuntimeException
*/
protected static function findHeader(&$lines, &$src, &$dst)
{
@ -297,13 +298,13 @@ class JFilesystemPatcher
if ($line === false)
{
throw new RuntimeException('Unexpected EOF');
throw new \RuntimeException('Unexpected EOF');
}
// Search the destination file
if (!preg_match(self::DST_FILE, $line, $m))
{
throw new RuntimeException('Invalid Diff file');
throw new \RuntimeException('Invalid Diff file');
}
// Set the destination file
@ -312,7 +313,7 @@ class JFilesystemPatcher
// Advance to the next line
if (next($lines) === false)
{
throw new RuntimeException('Unexpected EOF');
throw new \RuntimeException('Unexpected EOF');
}
return true;
@ -332,7 +333,7 @@ class JFilesystemPatcher
* @return boolean TRUE in case of success, false in case of failure
*
* @since 12.1
* @throws RuntimeException
* @throws \RuntimeException
*/
protected static function findHunk(&$lines, &$src_line, &$src_size, &$dst_line, &$dst_size)
{
@ -358,7 +359,7 @@ class JFilesystemPatcher
if (next($lines) === false)
{
throw new RuntimeException('Unexpected EOF');
throw new \RuntimeException('Unexpected EOF');
}
return true;
@ -381,7 +382,7 @@ class JFilesystemPatcher
* @return void
*
* @since 12.1
* @throws RuntimeException
* @throws \RuntimeException
*/
protected function applyHunk(&$lines, $src, $dst, $src_line, $src_size, $dst_line, $dst_size)
{
@ -410,7 +411,7 @@ class JFilesystemPatcher
{
if ($src_left == 0)
{
throw new RuntimeException(JText::sprintf('JLIB_FILESYSTEM_PATCHER_UNEXPECTED_REMOVE_LINE', key($lines)));
throw new \RuntimeException(Text::sprintf('JLIB_FILESYSTEM_PATCHER_UNEXPECTED_REMOVE_LINE', key($lines)));
}
$source[] = substr($line, 1);
@ -420,7 +421,7 @@ class JFilesystemPatcher
{
if ($dst_left == 0)
{
throw new RuntimeException(JText::sprintf('JLIB_FILESYSTEM_PATCHER_UNEXPECTED_ADD_LINE', key($lines)));
throw new \RuntimeException(Text::sprintf('JLIB_FILESYSTEM_PATCHER_UNEXPECTED_ADD_LINE', key($lines)));
}
$destin[] = substr($line, 1);
@ -444,7 +445,7 @@ class JFilesystemPatcher
if (!isset($src_lines))
{
throw new RuntimeException(JText::sprintf('JLIB_FILESYSTEM_PATCHER_UNEXISING_SOURCE', $src));
throw new \RuntimeException(Text::sprintf('JLIB_FILESYSTEM_PATCHER_UNEXISING_SOURCE', $src));
}
}
@ -459,7 +460,7 @@ class JFilesystemPatcher
{
if ($src_lines[$l] != $source[$l - $src_line])
{
throw new RuntimeException(JText::sprintf('JLIB_FILESYSTEM_PATCHER_FAILED_VERIFY', $src, $l));
throw new \RuntimeException(Text::sprintf('JLIB_FILESYSTEM_PATCHER_FAILED_VERIFY', $src, $l));
}
}
@ -484,7 +485,7 @@ class JFilesystemPatcher
}
while ($line !== false);
throw new RuntimeException('Unexpected EOF');
throw new \RuntimeException('Unexpected EOF');
}
/**

View File

@ -1,18 +1,23 @@
<?php
/**
* @package Joomla.Platform
* @subpackage FileSystem
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Filesystem;
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Filesystem\Wrapper\PathWrapper;
use Joomla\CMS\Filesystem\Wrapper\FileWrapper;
use Joomla\CMS\Crypt\Crypt;
if (!defined('JPATH_ROOT'))
{
// Define a string constant for the root directory of the file system in native format
$pathHelper = new JFilesystemWrapperPath;
$pathHelper = new PathWrapper;
define('JPATH_ROOT', $pathHelper->clean(JPATH_SITE));
}
@ -21,7 +26,7 @@ if (!defined('JPATH_ROOT'))
*
* @since 11.1
*/
class JPath
class Path
{
/**
* Checks if a path's permissions can be changed.
@ -167,7 +172,7 @@ class JPath
if (strpos($path, '..') !== false)
{
// Don't translate
throw new Exception(
throw new \Exception(
sprintf(
'%s() - Use of relative paths not permitted',
__METHOD__
@ -180,7 +185,7 @@ class JPath
if ((JPATH_ROOT != '') && strpos($path, self::clean(JPATH_ROOT)) !== 0)
{
throw new Exception(
throw new \Exception(
sprintf(
'%1$s() - Snooping out of bounds @ %2$s',
__METHOD__,
@ -208,7 +213,7 @@ class JPath
{
if (!is_string($path) && !empty($path))
{
throw new UnexpectedValueException(
throw new \UnexpectedValueException(
sprintf(
'%s() - $path is not a string',
__METHOD__
@ -248,9 +253,7 @@ class JPath
*/
public static function isOwner($path)
{
jimport('joomla.filesystem.file');
$tmp = md5(JCrypt::genRandomBytes());
$tmp = md5(Crypt::genRandomBytes());
$ssp = ini_get('session.save_path');
$jtp = JPATH_SITE . '/tmp';
@ -269,7 +272,7 @@ class JPath
if ($dir)
{
$fileObject = new JFilesystemWrapperFile;
$fileObject = new FileWrapper;
$test = $dir . '/' . $tmp;
// Create the test file
@ -301,7 +304,7 @@ class JPath
public static function find($paths, $file)
{
// Force to array
if (!is_array($paths) && !($paths instanceof Iterator))
if (!is_array($paths) && !($paths instanceof \Iterator))
{
settype($paths, 'array');
}

View File

@ -1,19 +1,24 @@
<?php
/**
* @package Joomla.Platform
* @subpackage FileSystem
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Filesystem;
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Object\CMSObject;
use Joomla\Filesystem\FilesystemHelper;
use Joomla\Language\Text;
/**
* Joomla! Stream Interface
*
* The Joomla! stream interface is designed to handle files as streams
* where as the legacy JFile static class treated files in a rather
* where as the legacy File static class treated files in a rather
* atomic manner.
*
* @note This class adheres to the stream wrapper operations:
@ -24,7 +29,7 @@ defined('JPATH_PLATFORM') or die;
* @link https://secure.php.net/manual/en/transports.php Socket Transports (used by some options, particularly HTTP proxy)
* @since 11.1
*/
class JStream extends JObject
class Stream extends CMSObject
{
/**
* File Mode
@ -187,7 +192,7 @@ class JStream extends JObject
if (!$filename)
{
$this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILENAME'));
$this->setError(Text::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILENAME'));
return false;
}
@ -201,7 +206,7 @@ class JStream extends JObject
if (isset($url['scheme']))
{
// If we're dealing with a Joomla! stream, load it
if (JFilesystemHelper::isJoomlaStream($url['scheme']))
if (FilesystemHelper::isJoomlaStream($url['scheme']))
{
require_once __DIR__ . '/streams/' . $url['scheme'] . '.php';
}
@ -211,7 +216,7 @@ class JStream extends JObject
}
elseif ($detectprocessingmode)
{
$ext = strtolower(JFile::getExt($this->filename));
$ext = strtolower(File::getExt($this->filename));
switch ($ext)
{
@ -303,7 +308,7 @@ class JStream extends JObject
{
if (!$this->fh)
{
$this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
$this->setError(Text::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
return true;
}
@ -366,7 +371,7 @@ class JStream extends JObject
{
if (!$this->fh)
{
$this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
$this->setError(Text::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
return false;
}
@ -412,7 +417,7 @@ class JStream extends JObject
{
if (!$this->filename)
{
$this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
$this->setError(Text::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
return false;
}
@ -436,7 +441,7 @@ class JStream extends JObject
$tmp_error = $php_errormsg;
}
$res = JFilesystemHelper::remotefsize($this->filename);
$res = FilesystemHelper::remotefsize($this->filename);
if (!$res)
{
@ -448,7 +453,7 @@ class JStream extends JObject
else
{
// Error but nothing from php? How strange! Create our own
$this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_SIZE'));
$this->setError(Text::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_SIZE'));
}
}
else
@ -483,7 +488,7 @@ class JStream extends JObject
{
if (!$this->fh)
{
$this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
$this->setError(Text::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
return false;
}
@ -556,7 +561,7 @@ class JStream extends JObject
if (!$this->fh)
{
$this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
$this->setError(Text::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
return false;
}
@ -643,7 +648,7 @@ class JStream extends JObject
{
if (!$this->fh)
{
$this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
$this->setError(Text::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
return false;
}
@ -696,7 +701,7 @@ class JStream extends JObject
{
if (!$this->fh)
{
$this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
$this->setError(Text::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
return false;
}
@ -756,7 +761,7 @@ class JStream extends JObject
{
if (!$this->fh)
{
$this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
$this->setError(Text::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
return false;
}
@ -800,7 +805,7 @@ class JStream extends JObject
{
// Wrote nothing?
$remaining = 0;
$this->setError(JText::_('JLIB_FILESYSTEM_ERROR_NO_DATA_WRITTEN'));
$this->setError(Text::_('JLIB_FILESYSTEM_ERROR_NO_DATA_WRITTEN'));
}
else
{
@ -834,7 +839,7 @@ class JStream extends JObject
{
if (!isset($this->filename) || !$this->filename)
{
$this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILENAME'));
$this->setError(Text::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILENAME'));
return false;
}
@ -861,7 +866,7 @@ class JStream extends JObject
{
case 'ftp':
case 'ftps':
$res = JFilesystemHelper::ftpChmod($filename, $mode);
$res = FilesystemHelper::ftpChmod($filename, $mode);
break;
default:
@ -898,7 +903,7 @@ class JStream extends JObject
{
if (!$this->fh)
{
$this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
$this->setError(Text::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
return false;
}
@ -1334,7 +1339,7 @@ class JStream extends JObject
}
else
{
$this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_NOT_UPLOADED_FILE'));
$this->setError(Text::_('JLIB_FILESYSTEM_ERROR_STREAMS_NOT_UPLOADED_FILE'));
return false;
}
@ -1385,7 +1390,7 @@ class JStream extends JObject
// Check if it's a write mode then add the appropriate prefix
// Get rid of JPATH_ROOT (legacy compat) along the way
if (in_array($tmode, JFilesystemHelper::getWriteModes()))
if (in_array($tmode, FilesystemHelper::getWriteModes()))
{
if (!$relative && $this->writeprefix)
{

View File

@ -1,15 +1,16 @@
<?php
/**
* @package Joomla.Platform
* @subpackage FileSystem
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Filesystem\Streams;
defined('JPATH_PLATFORM') or die;
jimport('joomla.filesystem.support.stringcontroller');
use Joomla\CMS\Filesystem\Support\Stringcontroller;
/**
* String Stream Wrapper
@ -19,7 +20,7 @@ jimport('joomla.filesystem.support.stringcontroller');
*
* @since 11.1
*/
class JStreamString
class StreamString
{
/**
* The current string
@ -101,7 +102,7 @@ class JStreamString
*/
public function stream_open($path, $mode, $options, &$opened_path)
{
$this->currentString = &JStringController::getRef(str_replace('string://', '', $path));
$this->currentString = &StringController::getRef(str_replace('string://', '', $path));
if ($this->currentString)
{
@ -144,7 +145,7 @@ class JStreamString
public function url_stat($path, $flags = 0)
{
$now = time();
$string = &JStringController::getRef(str_replace('string://', '', $path));
$string = &StringController::getRef(str_replace('string://', '', $path));
$stat = array(
'dev' => 0,
'ino' => 0,
@ -289,4 +290,4 @@ class JStreamString
}
}
stream_wrapper_register('string', 'JStreamString') or die('JStreamString Wrapper Registration Failed');
stream_wrapper_register('string', '\\Joomla\\CMS\\Filesystem\\Streams\\StreamString') or die('StreamString Wrapper Registration Failed');

View File

@ -1,12 +1,13 @@
<?php
/**
* @package Joomla.Platform
* @subpackage FileSystem
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Filesystem\Support;
defined('JPATH_PLATFORM') or die;
/**
@ -14,7 +15,7 @@ defined('JPATH_PLATFORM') or die;
*
* @since 11.1
*/
class JStringController
class StringController
{
/**
* Defines a variable as an array

View File

@ -1,24 +1,25 @@
<?php
/**
* @package Joomla.Platform
* @subpackage Filesystem
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Filesystem\Wrapper;
defined('JPATH_PLATFORM') or die;
jimport('joomla.filesystem.file');
use Joomla\Filesystem\File;
/**
* Wrapper class for JFile
* Wrapper class for File
*
* @package Joomla.Platform
* @subpackage Filesystem
* @since 3.4
*/
class JFilesystemWrapperFile
class FileWrapper
{
/**
* Helper wrapper method for getExt
@ -27,12 +28,12 @@ class JFilesystemWrapperFile
*
* @return string The file extension.
*
* @see JFile::getExt()
* @see File::getExt()
* @since 3.4
*/
public function getExt($file)
{
return JFile::getExt($file);
return File::getExt($file);
}
/**
@ -42,12 +43,12 @@ class JFilesystemWrapperFile
*
* @return string The file name without the extension.
*
* @see JFile::stripExt()
* @see File::stripExt()
* @since 3.4
*/
public function stripExt($file)
{
return JFile::stripExt($file);
return File::stripExt($file);
}
/**
@ -57,12 +58,12 @@ class JFilesystemWrapperFile
*
* @return string The sanitised string.
*
* @see JFile::makeSafe()
* @see File::makeSafe()
* @since 3.4
*/
public function makeSafe($file)
{
return JFile::makeSafe($file);
return File::makeSafe($file);
}
/**
@ -75,12 +76,12 @@ class JFilesystemWrapperFile
*
* @return boolean True on success.
*
* @see JFile::copy()
* @see File::copy()
* @since 3.4
*/
public function copy($src, $dest, $path = null, $use_streams = false)
{
return JFile::copy($src, $dest, $path, $use_streams);
return File::copy($src, $dest, $path, $use_streams);
}
/**
@ -90,12 +91,12 @@ class JFilesystemWrapperFile
*
* @return boolean True on success.
*
* @see JFile::delete()
* @see File::delete()
* @since 3.4
*/
public function delete($file)
{
return JFile::delete($file);
return File::delete($file);
}
/**
@ -108,12 +109,12 @@ class JFilesystemWrapperFile
*
* @return boolean True on success.
*
* @see JFile::move()
* @see File::move()
* @since 3.4
*/
public function move($src, $dest, $path = '', $use_streams = false)
{
return JFile::move($src, $dest, $path, $use_streams);
return File::move($src, $dest, $path, $use_streams);
}
/**
@ -127,12 +128,12 @@ class JFilesystemWrapperFile
*
* @return mixed Returns file contents or boolean False if failed.
*
* @see JFile::read()
* @see File::read()
* @since 3.4
*/
public function read($filename, $incpath = false, $amount = 0, $chunksize = 8192, $offset = 0)
{
return JFile::read($filename, $incpath, $amount, $chunksize, $offset);
return File::read($filename, $incpath, $amount, $chunksize, $offset);
}
/**
@ -144,12 +145,12 @@ class JFilesystemWrapperFile
*
* @return boolean True on success.
*
* @see JFile::write()
* @see File::write()
* @since 3.4
*/
public function write($file, &$buffer, $use_streams = false)
{
return JFile::write($file, $buffer, $use_streams);
return File::write($file, $buffer, $use_streams);
}
/**
@ -161,12 +162,12 @@ class JFilesystemWrapperFile
*
* @return boolean True on success.
*
* @see JFile::upload()
* @see File::upload()
* @since 3.4
*/
public function upload($src, $dest, $use_streams = false)
{
return JFile::upload($src, $dest, $use_streams);
return File::upload($src, $dest, $use_streams);
}
/**
@ -176,12 +177,12 @@ class JFilesystemWrapperFile
*
* @return boolean True if path is a file.
*
* @see JFile::exists()
* @see File::exists()
* @since 3.4
*/
public function exists($file)
{
return JFile::exists($file);
return File::exists($file);
}
/**
@ -191,11 +192,11 @@ class JFilesystemWrapperFile
*
* @return string filename.
*
* @see JFile::getName()
* @see File::getName()
* @since 3.4
*/
public function getName($file)
{
return JFile::getName($file);
return File::getName($file);
}
}

View File

@ -1,24 +1,25 @@
<?php
/**
* @package Joomla.Platform
* @subpackage Filesystem
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Filesystem\Wrapper;
defined('JPATH_PLATFORM') or die;
jimport('joomla.filesystem.folder');
use Joomla\CMS\Filesystem\Folder;
/**
* Wrapper class for JFilesystemFolder
* Wrapper class for Folder
*
* @package Joomla.Platform
* @subpackage Filesystem
* @since 3.4
*/
class JFilesystemWrapperFolder
class FolderWrapper
{
/**
* Helper wrapper method for copy
@ -31,13 +32,13 @@ class JFilesystemWrapperFolder
*
* @return boolean True on success.
*
* @see JFolder::copy()
* @see Folder::copy()
* @since 3.4
* @throws RuntimeException
*/
public function copy($src, $dest, $path = '', $force = false, $use_streams = false)
{
return JFolder::copy($src, $dest, $path, $force, $use_streams);
return Folder::copy($src, $dest, $path, $force, $use_streams);
}
/**
@ -48,12 +49,12 @@ class JFilesystemWrapperFolder
*
* @return boolean True if successful.
*
* @see JFolder::create()
* @see Folder::create()
* @since 3.4
*/
public function create($path = '', $mode = 493)
{
return JFolder::create($path, $mode);
return Folder::create($path, $mode);
}
/**
@ -63,13 +64,13 @@ class JFilesystemWrapperFolder
*
* @return boolean True on success.
*
* @see JFolder::delete()
* @see Folder::delete()
* @since 3.4
* @throws UnexpectedValueException
*/
public function delete($path)
{
return JFolder::delete($path);
return Folder::delete($path);
}
/**
@ -82,12 +83,12 @@ class JFilesystemWrapperFolder
*
* @return mixed Error message on false or boolean true on success.
*
* @see JFolder::move()
* @see Folder::move()
* @since 3.4
*/
public function move($src, $dest, $path = '', $use_streams = false)
{
return JFolder::move($src, $dest, $path, $use_streams);
return Folder::move($src, $dest, $path, $use_streams);
}
/**
@ -97,12 +98,12 @@ class JFilesystemWrapperFolder
*
* @return boolean True if path is a folder.
*
* @see JFolder::exists()
* @see Folder::exists()
* @since 3.4
*/
public function exists($path)
{
return JFolder::exists($path);
return Folder::exists($path);
}
/**
@ -118,13 +119,13 @@ class JFilesystemWrapperFolder
*
* @return array Files in the given folder.
*
* @see JFolder::files()
* @see Folder::files()
* @since 3.4
*/
public function files($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'),
$excludefilter = array('^\..*', '.*~'), $naturalSort = false)
{
return JFolder::files($path, $filter, $recurse, $full, $exclude, $excludefilter, $naturalSort);
return Folder::files($path, $filter, $recurse, $full, $exclude, $excludefilter, $naturalSort);
}
/**
@ -139,13 +140,13 @@ class JFilesystemWrapperFolder
*
* @return array Folders in the given folder.
*
* @see JFolder::folders()
* @see Folder::folders()
* @since 3.4
*/
public function folders($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'),
$excludefilter = array('^\..*'))
{
return JFolder::folders($path, $filter, $recurse, $full, $exclude, $excludefilter);
return Folder::folders($path, $filter, $recurse, $full, $exclude, $excludefilter);
}
/**
@ -159,12 +160,12 @@ class JFilesystemWrapperFolder
*
* @return array Folders in the given folder.
*
* @see JFolder::listFolderTree()
* @see Folder::listFolderTree()
* @since 3.4
*/
public function listFolderTree($path, $filter, $maxLevel = 3, $level = 0, $parent = 0)
{
return JFolder::listFolderTree($path, $filter, $maxLevel, $level, $parent);
return Folder::listFolderTree($path, $filter, $maxLevel, $level, $parent);
}
/**
@ -174,11 +175,11 @@ class JFilesystemWrapperFolder
*
* @return string The sanitised string
*
* @see JFolder::makeSafe()
* @see Folder::makeSafe()
* @since 3.4
*/
public function makeSafe($path)
{
return JFolder::makeSafe($path);
return Folder::makeSafe($path);
}
}

View File

@ -1,24 +1,25 @@
<?php
/**
* @package Joomla.Platform
* @subpackage Filesystem
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Filesystem\Wrapper;
defined('JPATH_PLATFORM') or die;
jimport('joomla.filesystem.path');
use Joomla\CMS\Filesystem\Path;
/**
* Wrapper class for JPath
* Wrapper class for Path
*
* @package Joomla.Platform
* @subpackage Filesystem
* @since 3.4
*/
class JFilesystemWrapperPath
class PathWrapper
{
/**
* Helper wrapper method for canChmod
@ -27,12 +28,12 @@ class JFilesystemWrapperPath
*
* @return boolean True if path can have mode changed.
*
* @see JPath::canChmod()
* @see Path::canChmod()
* @since 3.4
*/
public function canChmod($path)
{
return JPath::canChmod($path);
return Path::canChmod($path);
}
/**
@ -44,12 +45,12 @@ class JFilesystemWrapperPath
*
* @return boolean True if successful [one fail means the whole operation failed].
*
* @see JPath::setPermissions()
* @see Path::setPermissions()
* @since 3.4
*/
public function setPermissions($path, $filemode = '0644', $foldermode = '0755')
{
return JPath::setPermissions($path, $filemode, $foldermode);
return Path::setPermissions($path, $filemode, $foldermode);
}
/**
@ -59,12 +60,12 @@ class JFilesystemWrapperPath
*
* @return string Filesystem permissions.
*
* @see JPath::getPermissions()
* @see Path::getPermissions()
* @since 3.4
*/
public function getPermissions($path)
{
return JPath::getPermissions($path);
return Path::getPermissions($path);
}
/**
@ -74,13 +75,13 @@ class JFilesystemWrapperPath
*
* @return string A cleaned version of the path or exit on error.
*
* @see JPath::check()
* @see Path::check()
* @since 3.4
* @throws Exception
*/
public function check($path)
{
return JPath::check($path);
return Path::check($path);
}
/**
@ -91,13 +92,13 @@ class JFilesystemWrapperPath
*
* @return string The cleaned path.
*
* @see JPath::clean()
* @see Path::clean()
* @since 3.4
* @throws UnexpectedValueException
*/
public function clean($path, $ds = DIRECTORY_SEPARATOR)
{
return JPath::clean($path, $ds);
return Path::clean($path, $ds);
}
/**
@ -107,12 +108,12 @@ class JFilesystemWrapperPath
*
* @return boolean True if the php script owns the path passed.
*
* @see JPath::isOwner()
* @see Path::isOwner()
* @since 3.4
*/
public function isOwner($path)
{
return JPath::isOwner($path);
return Path::isOwner($path);
}
/**
@ -123,11 +124,11 @@ class JFilesystemWrapperPath
*
* @return mixed The full path and file name for the target file, or boolean false if the file is not found in any of the paths.
*
* @see JPath::find()
* @see Path::find()
* @since 3.4
*/
public function find($paths, $file)
{
return JPath::find($paths, $file);
return Path::find($paths, $file);
}
}

View File

@ -39,7 +39,7 @@ class RulesField extends FormField
* @var string
* @since __DEPLOY_VERSION__
*/
protected $layout = 'joomla.form.field.rules.tabs';
protected $layout = 'joomla.form.field.rules';
/**
* The section.

View File

@ -619,22 +619,21 @@ abstract class BaseDatabaseModel extends CMSObject
/**
* Clean the cache
*
* @param string $group The cache group
* @param integer $client_id The ID of the client
* @param string $group The cache group
*
* @return void
*
* @since 3.0
*/
protected function cleanCache($group = null, $client_id = 0)
protected function cleanCache($group = null)
{
$conf = \JFactory::getConfig();
$options = array(
'defaultgroup' => $group ?: (isset($this->option) ? $this->option : \JFactory::getApplication()->input->get('option')),
'cachebase' => $client_id ? JPATH_ADMINISTRATOR . '/cache' : $conf->get('cache_path', JPATH_SITE . '/cache'),
'result' => true,
);
$options = [
'defaultgroup' => $group ?: ($this->option ?? \JFactory::getApplication()->input->get('option')),
'cachebase' => $conf->get('cache_path', JPATH_CACHE),
'result' => true,
];
try
{

View File

@ -124,7 +124,7 @@ class Session implements ServiceProviderInterface
$memcached = new Memcached($config->get('session_memcached_server_id', 'joomla_cms'));
$memcached->addServer($host, $port);
$handler = new Handler\MemcachedHandler($memcached, array('ttl' => $lifetime));
$handler = new Handler\MemcachedHandler($memcached, ['ttl' => $lifetime]);
ini_set('session.save_path', "$host:$port");
ini_set('session.save_handler', 'memcached');
@ -170,7 +170,7 @@ class Session implements ServiceProviderInterface
$redis->select($db);
}
$handler = new Handler\RedisHandler($redis, array('ttl' => $lifetime));
$handler = new Handler\RedisHandler($redis, ['ttl' => $lifetime]);
break;

View File

@ -168,6 +168,11 @@ class Category extends Nested
$this->alias = \JFactory::getDate()->format('Y-m-d-H-i-s');
}
if (empty($this->modified_time))
{
$this->modified_time = $this->getDbo()->getNullDate();
}
return true;
}
@ -221,12 +226,11 @@ class Category extends Nested
$date = \JFactory::getDate();
$user = \JFactory::getUser();
$this->modified_time = $date->toSql();
if ($this->id)
{
// Existing category
$this->modified_user_id = $user->get('id');
$this->modified_time = $date->toSql();
}
else
{

View File

@ -260,6 +260,12 @@ class Content extends Table
$this->publish_down = $temp;
}
// Set modified to null date if not set
if (!$this->modified)
{
$this->modified = $this->_db->getNullDate();
}
// Clean up keywords -- eliminate extra spaces between phrases
// and cr (\r) and lf (\n) characters from string
if (!empty($this->metakey))
@ -330,12 +336,11 @@ class Content extends Table
$date = \JFactory::getDate();
$user = \JFactory::getUser();
$this->modified = $date->toSql();
if ($this->id)
{
// Existing item
$this->modified_by = $user->get('id');
$this->modified = $date->toSql();
}
else
{

View File

@ -1455,16 +1455,23 @@ abstract class Table extends \JObject implements \JTableInterface, DispatcherAwa
return false;
}
$db = \JFactory::getDbo();
$query = $db->getQuery(true)
->select('COUNT(userid)')
->from($db->quoteName('#__session'))
->where($db->quoteName('userid') . ' = ' . (int) $against);
$db->setQuery($query);
$checkedOut = (boolean) $db->loadResult();
// This last check can only be relied on if tracking session metadata
if (\JFactory::getConfig()->get('session_metadata', true))
{
$db = \JFactory::getDbo();
$query = $db->getQuery(true)
->select('COUNT(userid)')
->from($db->quoteName('#__session'))
->where($db->quoteName('userid') . ' = ' . (int) $against);
$db->setQuery($query);
$checkedOut = (boolean) $db->loadResult();
// If a session exists for the user then it is checked out.
return $checkedOut;
// If a session exists for the user then it is checked out.
return $checkedOut;
}
// Assume if we got here that there is a value in the checked out column but it doesn't match the given user
return true;
}
/**

View File

@ -509,6 +509,7 @@ class User extends \JObject
public function setLastVisit($timestamp = null)
{
// Create the user table object
/** @var \Joomla\CMS\Table\User $table */
$table = $this->getTable();
$table->load($this->id);
@ -555,7 +556,7 @@ class User extends \JObject
* @param string $type The user table name to be used
* @param string $prefix The user table prefix to be used
*
* @return object The user table object
* @return Table The user table object
*
* @note At 4.0 this method will no longer be static
* @since 11.1

Some files were not shown because too many files have changed in this diff Show More