@@ -56,7 +58,7 @@
foreach ($this->modules as $module)
{
// Get module parameters
- $params = new JRegistry;
+ $params = new Registry;
$params->loadString($module->params);
$bootstrapSize = $params->get('bootstrap_size');
if (!$bootstrapSize)
diff --git a/administrator/components/com_finder/helpers/indexer/helper.php b/administrator/components/com_finder/helpers/indexer/helper.php
index 86d29243fcba3..7f73d8c168e4a 100644
--- a/administrator/components/com_finder/helpers/indexer/helper.php
+++ b/administrator/components/com_finder/helpers/indexer/helper.php
@@ -9,6 +9,8 @@
defined('_JEXEC') or die;
+use Joomla\Registry\Registry;
+
JLoader::register('FinderIndexerParser', __DIR__ . '/parser.php');
JLoader::register('FinderIndexerStemmer', __DIR__ . '/stemmer.php');
JLoader::register('FinderIndexerToken', __DIR__ . '/token.php');
@@ -462,8 +464,8 @@ public static function getContentExtras(FinderIndexerResult &$item)
/**
* Method to process content text using the onContentPrepare event trigger.
*
- * @param string $text The content to process.
- * @param JRegistry $params The parameters object. [optional]
+ * @param string $text The content to process.
+ * @param Registry $params The parameters object. [optional]
*
* @return string The processed content.
*
@@ -484,9 +486,9 @@ public static function prepareContent($text, $params = null)
}
// Instantiate the parameter object if necessary.
- if (!($params instanceof JRegistry))
+ if (!($params instanceof Registry))
{
- $registry = new JRegistry;
+ $registry = new Registry;
$registry->loadString($params);
$params = $registry;
}
diff --git a/administrator/components/com_finder/helpers/indexer/indexer.php b/administrator/components/com_finder/helpers/indexer/indexer.php
index 95fe02c48e3b6..ad402e1cee20f 100644
--- a/administrator/components/com_finder/helpers/indexer/indexer.php
+++ b/administrator/components/com_finder/helpers/indexer/indexer.php
@@ -103,7 +103,7 @@ public static function getInstance()
// Setup the adapter for the indexer.
$format = JFactory::getDbo()->name;
- if ($format == 'mysqli')
+ if ($format == 'mysqli' || $format == 'pdomysql')
{
$format = 'mysql';
}
diff --git a/administrator/components/com_finder/helpers/indexer/query.php b/administrator/components/com_finder/helpers/indexer/query.php
index 9cff3cee507e5..fabdaefa16550 100644
--- a/administrator/components/com_finder/helpers/indexer/query.php
+++ b/administrator/components/com_finder/helpers/indexer/query.php
@@ -9,6 +9,8 @@
defined('_JEXEC') or die;
+use Joomla\Registry\Registry;
+
JLoader::register('FinderIndexerHelper', __DIR__ . '/helper.php');
JLoader::register('FinderIndexerTaxonomy', __DIR__ . '/taxonomy.php');
JLoader::register('FinderHelperRoute', JPATH_SITE . '/components/com_finder/helpers/route.php');
@@ -183,7 +185,7 @@ public function __construct($options)
$this->mode = 'AND';
// Initialize the temporary date storage.
- $this->dates = new JRegistry;
+ $this->dates = new Registry;
// Populate the temporary date storage.
if (isset($options['date1']) && !empty($options['date1']))
@@ -504,7 +506,7 @@ protected function processStaticTaxonomy($filterId)
$this->filter = (int) $filterId;
// Get a parameter object for the filter date options.
- $registry = new JRegistry;
+ $registry = new Registry;
$registry->loadString($return->params);
$params = $registry;
diff --git a/administrator/components/com_finder/tables/filter.php b/administrator/components/com_finder/tables/filter.php
index b644d9f60d075..50c8712e6561b 100644
--- a/administrator/components/com_finder/tables/filter.php
+++ b/administrator/components/com_finder/tables/filter.php
@@ -9,6 +9,8 @@
defined('_JEXEC') or die;
+use Joomla\Registry\Registry;
+
/**
* Filter table class for the Finder package.
*
@@ -47,7 +49,7 @@ public function bind($array, $ignore = '')
{
if (isset($array['params']) && is_array($array['params']))
{
- $registry = new JRegistry;
+ $registry = new Registry;
$registry->loadArray($array['params']);
$array['params'] = (string) $registry;
}
@@ -198,10 +200,11 @@ public function store($updateNulls = false)
$date = JFactory::getDate();
$user = JFactory::getUser();
+ $this->modified = $date->toSql();
+
if ($this->filter_id)
{
// Existing item
- $this->modified = $date->toSql();
$this->modified_by = $user->get('id');
}
else
diff --git a/administrator/components/com_finder/views/index/tmpl/default.php b/administrator/components/com_finder/views/index/tmpl/default.php
index 94a3f89bff598..b12a1ab127d13 100644
--- a/administrator/components/com_finder/views/index/tmpl/default.php
+++ b/administrator/components/com_finder/views/index/tmpl/default.php
@@ -127,19 +127,21 @@
published, $i, 'index.', $canChange, 'cb'); ?>
-
- escape($item->title); ?>
-
-
- url) > 80)
- {
- echo substr($item->url, 0, 70) . '...';
- } else {
- echo $item->url;
- }
- ?>
-
+
|
publish_start_date) or intval($item->publish_end_date) or intval($item->start_date) or intval($item->end_date)) : ?>
diff --git a/administrator/components/com_installer/controllers/update.php b/administrator/components/com_installer/controllers/update.php
index 37b2aaae7d3e4..94cdef43e966f 100644
--- a/administrator/components/com_installer/controllers/update.php
+++ b/administrator/components/com_installer/controllers/update.php
@@ -94,7 +94,11 @@ public function purge()
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$model = $this->getModel('update');
$model->purge();
- $model->enableSites();
+
+ // We no longer need to enable update sites in Joomla! 3.4 as we now allow the users to manage update sites
+ // themselves.
+ // $model->enableSites();
+
$this->setRedirect(JRoute::_('index.php?option=com_installer&view=update', false), $model->_message);
}
diff --git a/administrator/components/com_installer/controllers/updatesites.php b/administrator/components/com_installer/controllers/updatesites.php
new file mode 100644
index 0000000000000..ab9fce36cb232
--- /dev/null
+++ b/administrator/components/com_installer/controllers/updatesites.php
@@ -0,0 +1,76 @@
+registerTask('unpublish', 'publish');
+ $this->registerTask('publish', 'publish');
+ }
+
+ /**
+ * Enable/Disable an extension (if supported).
+ *
+ * @return void
+ *
+ * @since 3.4
+ *
+ * @throws Exception on error
+ */
+ public function publish()
+ {
+ // Check for request forgeries.
+ JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
+
+ $ids = $this->input->get('cid', array(), 'array');
+ $values = array('publish' => 1, 'unpublish' => 0);
+ $task = $this->getTask();
+ $value = JArrayHelper::getValue($values, $task, 0, 'int');
+
+ if (empty($ids))
+ {
+ throw new Exception(JText::_('COM_INSTALLER_ERROR_NO_UPDATESITES_SELECTED'), 500);
+ }
+
+ // Get the model.
+ $model = $this->getModel('Updatesites');
+
+ // Change the state of the records.
+ if (!$model->publish($ids, $value))
+ {
+ throw new Exception(implode(' ', $model->getErrors()), 500);
+ }
+
+ $ntext = ($value == 0) ? 'COM_INSTALLER_N_EXTENSIONS_UNPUBLISHED' : 'COM_INSTALLER_N_EXTENSIONS_PUBLISHED';
+
+ $this->setMessage(JText::plural($ntext, count($ids)));
+
+ $this->setRedirect(JRoute::_('index.php?option=com_installer&view=updatesites', false));
+ }
+}
diff --git a/administrator/components/com_installer/helpers/installer.php b/administrator/components/com_installer/helpers/installer.php
index 2a30c544f05b4..fa1dffaf5a5fc 100644
--- a/administrator/components/com_installer/helpers/installer.php
+++ b/administrator/components/com_installer/helpers/installer.php
@@ -62,6 +62,11 @@ public static function addSubmenu($vName = 'install')
'index.php?option=com_installer&view=languages',
$vName == 'languages'
);
+ JHtmlSidebar::addEntry(
+ JText::_('COM_INSTALLER_SUBMENU_UPDATESITES'),
+ 'index.php?option=com_installer&view=updatesites',
+ $vName == 'updatesites'
+ );
}
/**
diff --git a/administrator/components/com_installer/models/database.php b/administrator/components/com_installer/models/database.php
index 3a19f8a90deec..9f3fb77dd1766 100644
--- a/administrator/components/com_installer/models/database.php
+++ b/administrator/components/com_installer/models/database.php
@@ -9,6 +9,8 @@
defined('_JEXEC') or die;
+use Joomla\Registry\Registry;
+
JLoader::register('InstallerModel', __DIR__ . '/extension.php');
JLoader::register('JoomlaInstallerScript', JPATH_ADMINISTRATOR . '/components/com_admin/script.php');
@@ -170,7 +172,7 @@ public function getUpdateVersion()
{
$table = JTable::getInstance('Extension');
$table->load('700');
- $cache = new JRegistry($table->manifest_cache);
+ $cache = new Registry($table->manifest_cache);
return $cache->get('version');
}
@@ -183,7 +185,7 @@ public function fixUpdateVersion()
{
$table = JTable::getInstance('Extension');
$table->load('700');
- $cache = new JRegistry($table->manifest_cache);
+ $cache = new Registry($table->manifest_cache);
$updateVersion = $cache->get('version');
$cmsVersion = new JVersion;
if ($updateVersion == $cmsVersion->getShortVersion())
@@ -236,7 +238,7 @@ public function fixDefaultTextFilters()
$contentParams = JComponentHelper::getParams('com_content');
if ($contentParams->get('filters'))
{
- $newParams = new JRegistry;
+ $newParams = new Registry;
$newParams->set('filters', $contentParams->get('filters'));
$table->params = (string) $newParams;
$table->store();
diff --git a/administrator/components/com_installer/models/extension.php b/administrator/components/com_installer/models/extension.php
index 6beb8c75144de..41915638d3d0a 100644
--- a/administrator/components/com_installer/models/extension.php
+++ b/administrator/components/com_installer/models/extension.php
@@ -106,7 +106,7 @@ protected function _getList($query, $limitstart = 0, $limit = 0)
*
* @return array The array of translated objects
*/
- private function translate(&$items)
+ protected function translate(&$items)
{
$lang = JFactory::getLanguage();
foreach ($items as &$item)
diff --git a/administrator/components/com_installer/models/update.php b/administrator/components/com_installer/models/update.php
index c3fe804ead712..d5a841797dbc9 100644
--- a/administrator/components/com_installer/models/update.php
+++ b/administrator/components/com_installer/models/update.php
@@ -178,12 +178,12 @@ public function purge()
->set($db->quoteName('last_check_timestamp') . ' = ' . $db->quote(0));
$db->setQuery($query);
$db->execute();
- $this->_message = JText::_('COM_INSTALLER_PURGED_UPDATES');
+ $this->_message = JText::_('JLIB_INSTALLER_PURGED_UPDATES');
return true;
}
else
{
- $this->_message = JText::_('COM_INSTALLER_FAILED_TO_PURGE_UPDATES');
+ $this->_message = JText::_('JLIB_INSTALLER_FAILED_TO_PURGE_UPDATES');
return false;
}
}
diff --git a/administrator/components/com_installer/models/updatesites.php b/administrator/components/com_installer/models/updatesites.php
new file mode 100644
index 0000000000000..553afd793f1b2
--- /dev/null
+++ b/administrator/components/com_installer/models/updatesites.php
@@ -0,0 +1,251 @@
+getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
+ $this->setState('filter.search', $search);
+
+ $clientId = $this->getUserStateFromRequest($this->context . '.filter.client_id', 'filter_client_id', '');
+ $this->setState('filter.client_id', $clientId);
+
+ $status = $this->getUserStateFromRequest($this->context . '.filter.enabled', 'filter_enabled', '');
+ $this->setState('filter.enabled', $status);
+
+ $categoryId = $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type', '');
+ $this->setState('filter.type', $categoryId);
+
+ $group = $this->getUserStateFromRequest($this->context . '.filter.group', 'filter_group', '');
+ $this->setState('filter.group', $group);
+
+ parent::populateState('name', 'asc');
+ }
+
+ /**
+ * Enable/Disable an extension.
+ *
+ * @param array &$eid Extension ids to un/publish
+ * @param int $value Publish value
+ *
+ * @return boolean True on success
+ *
+ * @since 3.4
+ *
+ * @throws Exception on ACL error
+ */
+ public function publish(&$eid = array(), $value = 1)
+ {
+ $user = JFactory::getUser();
+
+ if (!$user->authorise('core.edit.state', 'com_installer'))
+ {
+ throw new Exception(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'), 403);
+ }
+
+ $result = true;
+
+ /*
+ * Ensure eid is an array of extension ids
+ */
+ if (!is_array($eid))
+ {
+ $eid = array($eid);
+ }
+
+ // Get a table object for the extension type
+ $table = JTable::getInstance('Updatesite');
+
+ // Enable the update site in the table and store it in the database
+ foreach ($eid as $i => $id)
+ {
+ $table->load($id);
+ $table->enabled = $value;
+
+ if (!$table->store())
+ {
+ $this->setError($table->getError());
+ $result = false;
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Method to get the database query
+ *
+ * @return JDatabaseQuery The database query
+ *
+ * @since 3.4
+ */
+ protected function getListQuery()
+ {
+ $enabled = $this->getState('filter.enabled');
+ $type = $this->getState('filter.type');
+ $client = $this->getState('filter.client_id');
+ $group = $this->getState('filter.group');
+
+ $query = JFactory::getDbo()->getQuery(true)
+ ->select(
+ array(
+ 's.update_site_id',
+ 's.name as update_site_name',
+ 's.type as update_site_type',
+ 's.location',
+ 's.enabled',
+ 'e.extension_id',
+ 'e.name',
+ 'e.type',
+ 'e.element',
+ 'e.folder',
+ 'e.client_id',
+ 'e.state',
+ 'e.manifest_cache',
+ )
+ )
+ ->from('#__update_sites AS s')
+ ->innerJoin('#__update_sites_extensions AS se on(se.update_site_id = s.update_site_id)')
+ ->innerJoin('#__extensions AS e ON(e.extension_id = se.extension_id)')
+ ->where('state=0');
+
+ if ($enabled != '')
+ {
+ $query->where('s.enabled=' . (int) $enabled);
+ }
+
+ if ($type)
+ {
+ $query->where('e.type=' . $this->_db->quote($type));
+ }
+
+ if ($client != '')
+ {
+ $query->where('client_id=' . (int) $client);
+ }
+
+ if ($group != '' && in_array($type, array('plugin', 'library', '')))
+ {
+ $query->where('folder=' . $this->_db->quote($group == '*' ? '' : $group));
+ }
+
+ // Filter by search in id
+ $search = $this->getState('filter.search');
+
+ if (!empty($search) && stripos($search, 'id:') === 0)
+ {
+ $query->where('s.update_site_id = ' . (int) substr($search, 3));
+ }
+
+ return $query;
+ }
+
+ /**
+ * Returns an object list
+ *
+ * @param string $query The query
+ * @param int $limitstart Offset
+ * @param int $limit The number of records
+ *
+ * @return array
+ */
+ protected function _getList($query, $limitstart = 0, $limit = 0)
+ {
+ $ordering = $this->getState('list.ordering');
+ $search = $this->getState('filter.search');
+
+ // Replace slashes so preg_match will work
+ $search = str_replace('/', ' ', $search);
+ $db = $this->getDbo();
+
+ if ($ordering == 'name' || (!empty($search) && stripos($search, 'id:') !== 0))
+ {
+ $db->setQuery($query);
+ $result = $db->loadObjectList();
+ $this->translate($result);
+
+ if (!empty($search) && (stripos($search, 'id:') !== 0))
+ {
+ foreach ($result as $i => $item)
+ {
+ if (!preg_match("/$search/i", $item->name) && !preg_match("/$search/i", $item->update_site_name))
+ {
+ unset($result[$i]);
+ }
+ }
+ }
+
+ JArrayHelper::sortObjects($result, $this->getState('list.ordering'), $this->getState('list.direction') == 'desc' ? -1 : 1, true, true);
+
+ $total = count($result);
+ $this->cache[$this->getStoreId('getTotal')] = $total;
+
+ if ($total < $limitstart)
+ {
+ $limitstart = 0;
+ $this->setState('list.start', 0);
+ }
+
+ return array_slice($result, $limitstart, $limit ? $limit : null);
+ }
+
+ $query->order($db->quoteName($ordering) . ' ' . $this->getState('list.direction'));
+ $result = parent::_getList($query, $limitstart, $limit);
+ $this->translate($result);
+
+ return $result;
+ }
+}
diff --git a/administrator/components/com_installer/views/discover/tmpl/default.php b/administrator/components/com_installer/views/discover/tmpl/default.php
index 564964c05cb1d..2c676426a678a 100644
--- a/administrator/components/com_installer/views/discover/tmpl/default.php
+++ b/administrator/components/com_installer/views/discover/tmpl/default.php
@@ -19,91 +19,95 @@
|
- name; ?>
+
|
version; ?>
diff --git a/administrator/components/com_installer/views/manage/tmpl/default.php b/administrator/components/com_installer/views/manage/tmpl/default.php
index ed1a75490225f..df32d8a8e6f37 100644
--- a/administrator/components/com_installer/views/manage/tmpl/default.php
+++ b/administrator/components/com_installer/views/manage/tmpl/default.php
@@ -68,19 +68,19 @@
|
|
-
+ |
|
-
+ |
|
-
+ |
|
-
+ |
|
-
+ |
|
@@ -99,9 +99,11 @@
extension_id); ?>
-
- name; ?>
-
+
|
client; ?>
@@ -116,21 +118,21 @@
|
type); ?>
|
-
+ |
version != '' ? $item->version : ' '; ?>
|
-
+ |
creationDate != '' ? $item->creationDate : ' '; ?>
|
-
+ |
author != '' ? $item->author : ' '; ?>
|
-
+ |
folder != '' ? $item->folder : JText::_('COM_INSTALLER_TYPE_NONAPPLICABLE'); ?>
|
-
+ |
extension_id ?>
|
diff --git a/administrator/components/com_installer/views/update/tmpl/default.php b/administrator/components/com_installer/views/update/tmpl/default.php
index cc73878fe64ba..9aa145e7fae11 100644
--- a/administrator/components/com_installer/views/update/tmpl/default.php
+++ b/administrator/components/com_installer/views/update/tmpl/default.php
@@ -93,9 +93,11 @@
update_id); ?>
-
- escape($item->name); ?>
-
+
|
extension_id ? JText::_('COM_INSTALLER_MSG_UPDATE_UPDATE') : JText::_('COM_INSTALLER_NEW_INSTALL') ?>
diff --git a/administrator/components/com_installer/views/update/view.html.php b/administrator/components/com_installer/views/update/view.html.php
index 120618af6a1e6..8ff79988e6dbd 100644
--- a/administrator/components/com_installer/views/update/view.html.php
+++ b/administrator/components/com_installer/views/update/view.html.php
@@ -80,6 +80,7 @@ protected function addToolbar()
{
JToolbarHelper::custom('update.update', 'upload', 'upload', 'COM_INSTALLER_TOOLBAR_UPDATE', true, false);
JToolbarHelper::custom('update.find', 'refresh', 'refresh', 'COM_INSTALLER_TOOLBAR_FIND_UPDATES', false, false);
+ JToolbarHelper::custom('update.purge', 'purge', 'purge', 'COM_INSTALLER_TOOLBAR_PURGE', false, false);
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_UPDATE');
diff --git a/media/editors/codemirror/css/index.html b/administrator/components/com_installer/views/updatesites/index.html
similarity index 100%
rename from media/editors/codemirror/css/index.html
rename to administrator/components/com_installer/views/updatesites/index.html
diff --git a/administrator/components/com_installer/views/updatesites/tmpl/default.php b/administrator/components/com_installer/views/updatesites/tmpl/default.php
new file mode 100644
index 0000000000000..220fcd274277e
--- /dev/null
+++ b/administrator/components/com_installer/views/updatesites/tmpl/default.php
@@ -0,0 +1,129 @@
+escape($this->state->get('list.ordering'));
+$listDirn = $this->escape($this->state->get('list.direction'));
+?>
+ |