@@ -93,8 +95,6 @@
-
-
form->getInput('extension'); ?>
diff --git a/administrator/components/com_categories/views/category/tmpl/edit_associations.php b/administrator/components/com_categories/views/category/tmpl/edit_associations.php
index b8751b02e7143..ecb71eb489e61 100644
--- a/administrator/components/com_categories/views/category/tmpl/edit_associations.php
+++ b/administrator/components/com_categories/views/category/tmpl/edit_associations.php
@@ -9,4 +9,11 @@
defined('_JEXEC') or die;
-echo JLayoutHelper::render('joomla.edit.associations', $this);
+if ($this->item->id != 0 && $this->item->language != '*')
+{
+ echo JLayoutHelper::render('joomla.edit.associations', $this);
+}
+else
+{
+ echo '
' . JText::_('JGLOBAL_ASSOC_NOT_POSSIBLE') . '
';
+}
diff --git a/administrator/components/com_categories/views/category/view.html.php b/administrator/components/com_categories/views/category/view.html.php
index 37fe2c8fb2910..4439dae47bd27 100644
--- a/administrator/components/com_categories/views/category/view.html.php
+++ b/administrator/components/com_categories/views/category/view.html.php
@@ -129,7 +129,7 @@ protected function addToolbar()
|| $lang->load($component, JPATH_ADMINISTRATOR . '/components/' . $component, null, false, true);
// Load the category helper.
- require_once JPATH_COMPONENT . '/helpers/categories.php';
+ JLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/categories.php');
// Get the results for each action.
$canDo = $this->canDo;
@@ -166,33 +166,34 @@ protected function addToolbar()
JToolbarHelper::apply('category.apply');
JToolbarHelper::save('category.save');
JToolbarHelper::save2new('category.save2new');
+ JToolbarHelper::cancel('category.cancel');
}
// If not checked out, can save the item.
- elseif (!$checkedOut && ($canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_user_id == $userId)))
+ else
{
- JToolbarHelper::apply('category.apply');
- JToolbarHelper::save('category.save');
+ // Since it's an existing record, check the edit permission, or fall back to edit own if the owner.
+ $itemEditable = $canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_user_id == $userId);
- if ($canDo->get('core.create'))
+ // Can't save the record if it's checked out and editable
+ if (!$checkedOut && $itemEditable)
{
- JToolbarHelper::save2new('category.save2new');
+ JToolbarHelper::apply('category.apply');
+ JToolbarHelper::save('category.save');
+
+ if ($canDo->get('core.create'))
+ {
+ JToolbarHelper::save2new('category.save2new');
+ }
}
- }
- // If an existing item, can save to a copy.
- if (!$isNew && $canDo->get('core.create'))
- {
- JToolbarHelper::save2copy('category.save2copy');
- }
+ // If an existing item, can save to a copy.
+ if ($canDo->get('core.create'))
+ {
+ JToolbarHelper::save2copy('category.save2copy');
+ }
- if (empty($this->item->id))
- {
- JToolbarHelper::cancel('category.cancel');
- }
- else
- {
- if ($componentParams->get('save_history', 0) && $user->authorise('core.edit'))
+ if ($componentParams->get('save_history', 0) && $itemEditable)
{
$typeAlias = $extension . '.category';
JToolbarHelper::versions($typeAlias, $this->item->id);
diff --git a/administrator/components/com_config/model/application.php b/administrator/components/com_config/model/application.php
index 17b404118f761..5f6649b1d6278 100644
--- a/administrator/components/com_config/model/application.php
+++ b/administrator/components/com_config/model/application.php
@@ -127,7 +127,16 @@ public function save($data)
$host = JUri::getInstance()->getHost();
$options = new \Joomla\Registry\Registry;
$options->set('userAgent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0');
- $options->set('transport.curl', array(CURLOPT_SSL_VERIFYPEER => false));
+
+ // Do not check for valid server certificate here, leave this to the user, moreover disable using a proxy if any is configured.
+ $options->set('transport.curl',
+ array(
+ CURLOPT_SSL_VERIFYPEER => false,
+ CURLOPT_SSL_VERIFYHOST => false,
+ CURLOPT_PROXY => null,
+ CURLOPT_PROXYUSERPWD => null,
+ )
+ );
$response = JHttpFactory::getHttp($options)->get('https://' . $host . JUri::root(true) . '/', array('Host' => $host), 10);
// If available in HTTPS check also the status code.
@@ -778,7 +787,7 @@ public function sendTestMail()
}
else
{
- $app->enqueueMessage(JText::sprintf('COM_CONFIG_SENDMAIL_SUCCESS', $app->get('mailfrom'), $methodName), 'success');
+ $app->enqueueMessage(JText::sprintf('COM_CONFIG_SENDMAIL_SUCCESS', $app->get('mailfrom'), $methodName), 'message');
}
return true;
diff --git a/administrator/components/com_config/model/component.php b/administrator/components/com_config/model/component.php
index 19c9e4511fd01..9afb0219ae6be 100644
--- a/administrator/components/com_config/model/component.php
+++ b/administrator/components/com_config/model/component.php
@@ -178,7 +178,7 @@ public function save($data)
throw new RuntimeException($table->getError());
}
- $result = $dispatcher->trigger('onExtensionBeforeSave', array($context, &$table, false));
+ $result = $dispatcher->trigger('onExtensionBeforeSave', array($context, $table, false));
// Store the data.
if (in_array(false, $result, true) || !$table->store())
@@ -187,7 +187,7 @@ public function save($data)
}
// Trigger the after save event.
- $dispatcher->trigger('onExtensionAfterSave', array($context, &$table, false));
+ $dispatcher->trigger('onExtensionAfterSave', array($context, $table, false));
// Clean the component cache.
$this->cleanCache('_system', 0);
diff --git a/administrator/components/com_contact/config.xml b/administrator/components/com_contact/config.xml
index d435a2c90c479..3a85d293e1b48 100644
--- a/administrator/components/com_contact/config.xml
+++ b/administrator/components/com_contact/config.xml
@@ -23,12 +23,13 @@
label="COM_CONTACT_FIELD_CONTACT_SHOW_CATEGORY_LABEL"
description="COM_CONTACT_FIELD_CONTACT_SHOW_CATEGORY_DESC"
default="hide"
+ class="chzn-color"
>
JHIDE
COM_CONTACT_FIELD_VALUE_NO_LINK
COM_CONTACT_FIELD_VALUE_WITH_LINK
-
+
JYES
JNO
-
+
@@ -405,7 +406,7 @@
type="media"
label="COM_CONTACT_FIELD_ICONS_ADDRESS_LABEL"
description="COM_CONTACT_FIELD_ICONS_ADDRESS_DESC"
- hide_none="1"
+ hide_none="1"
showon="contact_icons:0"
/>
@@ -414,7 +415,7 @@
type="media"
label="COM_CONTACT_FIELD_ICONS_EMAIL_LABEL"
description="COM_CONTACT_FIELD_ICONS_EMAIL_DESC"
- hide_none="1"
+ hide_none="1"
showon="contact_icons:0"
/>
@@ -422,7 +423,7 @@
name="icon_telephone"
type="media"
label="COM_CONTACT_FIELD_ICONS_TELEPHONE_LABEL"
- description="COM_CONTACT_FIELD_ICONS_TELEPHONE_DESC"
+ description="COM_CONTACT_FIELD_ICONS_TELEPHONE_DESC"
hide_none="1"
showon="contact_icons:0"
/>
@@ -430,8 +431,8 @@
@@ -440,8 +441,8 @@
name="icon_fax"
type="media"
label="COM_CONTACT_FIELD_ICONS_FAX_LABEL"
- description="COM_CONTACT_FIELD_ICONS_FAX_DESC"
- hide_none="1"
+ description="COM_CONTACT_FIELD_ICONS_FAX_DESC"
+ hide_none="1"
showon="contact_icons:0"
/>
@@ -449,7 +450,7 @@
name="icon_misc"
type="media"
label="COM_CONTACT_FIELD_ICONS_MISC_LABEL"
- description="COM_CONTACT_FIELD_ICONS_MISC_DESC"
+ description="COM_CONTACT_FIELD_ICONS_MISC_DESC"
hide_none="1"
showon="contact_icons:0"
/>
@@ -620,7 +621,7 @@
JSHOW
JHIDE
-
+
JSHOW
- JHIDE
+ JHIDE
diff --git a/administrator/components/com_contact/controller.php b/administrator/components/com_contact/controller.php
index 5d8ca9f15c08d..f95496c9033fb 100644
--- a/administrator/components/com_contact/controller.php
+++ b/administrator/components/com_contact/controller.php
@@ -36,7 +36,7 @@ class ContactController extends JControllerLegacy
*/
public function display($cachable = false, $urlparams = array())
{
- require_once JPATH_COMPONENT . '/helpers/contact.php';
+ JLoader::register('ContactHelper', JPATH_ADMINISTRATOR . '/components/com_contact/helpers/contact.php');
$view = $this->input->get('view', 'contacts');
$layout = $this->input->get('layout', 'default');
diff --git a/administrator/components/com_contact/models/forms/contact.xml b/administrator/components/com_contact/models/forms/contact.xml
index 99de8f4a92511..f21b7307d01d0 100644
--- a/administrator/components/com_contact/models/forms/contact.xml
+++ b/administrator/components/com_contact/models/forms/contact.xml
@@ -138,6 +138,7 @@
name="modified_by"
type="user"
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
+ description="COM_CONTACT_FIELD_MODIFIED_BY_DESC"
class="readonly"
readonly="true"
filter="unset"
@@ -431,6 +432,7 @@
type="list"
label="JGLOBAL_SHOW_CATEGORY_LABEL"
description="COM_CONTACT_FIELD_SHOW_CATEGORY_DESC"
+ class="chzn-color"
>
JGLOBAL_USE_GLOBAL
JHIDE
diff --git a/administrator/components/com_contact/models/forms/filter_contacts.xml b/administrator/components/com_contact/models/forms/filter_contacts.xml
index 7e9433bbb54e7..60c8ad7d62d73 100755
--- a/administrator/components/com_contact/models/forms/filter_contacts.xml
+++ b/administrator/components/com_contact/models/forms/filter_contacts.xml
@@ -95,14 +95,14 @@
JGRID_HEADING_ORDERING_DESC
JSTATUS_ASC
JSTATUS_DESC
+
JFEATURED_ASC
+
JFEATURED_DESC
JGLOBAL_TITLE_ASC
JGLOBAL_TITLE_DESC
JCATEGORY_ASC
JCATEGORY_DESC
COM_CONTACT_FIELD_LINKED_USER_LABEL_ASC
COM_CONTACT_FIELD_LINKED_USER_LABEL_DESC
-
JFEATURED_ASC
-
JFEATURED_DESC
JGRID_HEADING_ACCESS_ASC
JGRID_HEADING_ACCESS_DESC
get('layout') == 'modal' ? true : false;
-$layout = $isModal ? 'modal' : 'edit';
-$tmpl = $isModal ? '&tmpl=component' : '';
+$layout = $isModal ? 'modal' : 'edit';
+$tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=component' : '';
?>
+
+
@@ -104,8 +106,6 @@
-
-
loadTemplate('associations'); ?>
diff --git a/administrator/components/com_contact/views/contact/tmpl/edit_associations.php b/administrator/components/com_contact/views/contact/tmpl/edit_associations.php
index a01793eee3932..70d2b1db61b28 100644
--- a/administrator/components/com_contact/views/contact/tmpl/edit_associations.php
+++ b/administrator/components/com_contact/views/contact/tmpl/edit_associations.php
@@ -9,4 +9,11 @@
defined('_JEXEC') or die;
-echo JLayoutHelper::render('joomla.edit.associations', $this);
+if ($this->item->id != 0 && $this->item->language != '*')
+{
+ echo JLayoutHelper::render('joomla.edit.associations', $this);
+}
+else
+{
+ echo '
' . JText::_('JGLOBAL_ASSOC_NOT_POSSIBLE') . '
';
+}
diff --git a/administrator/components/com_contact/views/contact/view.html.php b/administrator/components/com_contact/views/contact/view.html.php
index b251da600ba6d..9d8500a1f09cf 100644
--- a/administrator/components/com_contact/views/contact/view.html.php
+++ b/administrator/components/com_contact/views/contact/view.html.php
@@ -106,20 +106,19 @@ protected function addToolbar()
}
else
{
- // Can't save the record if it's checked out.
- if (!$checkedOut)
+ // Since it's an existing record, check the edit permission, or fall back to edit own if the owner.
+ $itemEditable = $canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_by == $userId);
+
+ // Can't save the record if it's checked out and editable
+ if (!$checkedOut && $itemEditable)
{
- // Since it's an existing record, check the edit permission, or fall back to edit own if the owner.
- if ($canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_by == $userId))
+ JToolbarHelper::apply('contact.apply');
+ JToolbarHelper::save('contact.save');
+
+ // We can save this record, but check the create permission to see if we can return to make a new one.
+ if ($canDo->get('core.create'))
{
- JToolbarHelper::apply('contact.apply');
- JToolbarHelper::save('contact.save');
-
- // We can save this record, but check the create permission to see if we can return to make a new one.
- if ($canDo->get('core.create'))
- {
- JToolbarHelper::save2new('contact.save2new');
- }
+ JToolbarHelper::save2new('contact.save2new');
}
}
@@ -129,7 +128,7 @@ protected function addToolbar()
JToolbarHelper::save2copy('contact.save2copy');
}
- if ($this->state->params->get('save_history', 0) && $user->authorise('core.edit'))
+ if ($this->state->params->get('save_history', 0) && $itemEditable)
{
JToolbarHelper::versions('com_contact.contact', $this->item->id);
}
diff --git a/administrator/components/com_contact/views/contacts/tmpl/default.php b/administrator/components/com_contact/views/contacts/tmpl/default.php
index ba70da05ed717..ffd0c975e2cfb 100644
--- a/administrator/components/com_contact/views/contacts/tmpl/default.php
+++ b/administrator/components/com_contact/views/contacts/tmpl/default.php
@@ -62,9 +62,6 @@
-
-
-
@@ -127,6 +124,7 @@
published, $i, 'contacts.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?>
+ featured, $i, $canChange); ?>
email; ?>
-
- featured, $i, $canChange); ?>
-
access_level; ?>
diff --git a/administrator/components/com_contact/views/contacts/tmpl/modal.php b/administrator/components/com_contact/views/contacts/tmpl/modal.php
index 6279cb306c7b5..e9a81385e2d3d 100644
--- a/administrator/components/com_contact/views/contacts/tmpl/modal.php
+++ b/administrator/components/com_contact/views/contacts/tmpl/modal.php
@@ -9,7 +9,7 @@
defined('_JEXEC') or die;
-require_once JPATH_ROOT . '/components/com_contact/helpers/route.php';
+JLoader::register('ContactHelperRoute', JPATH_ROOT . '/components/com_contact/helpers/route.php');
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
diff --git a/administrator/components/com_contact/views/contacts/view.html.php b/administrator/components/com_contact/views/contacts/view.html.php
index c3d325e0af937..feef9cabef453 100644
--- a/administrator/components/com_contact/views/contacts/view.html.php
+++ b/administrator/components/com_contact/views/contacts/view.html.php
@@ -149,6 +149,8 @@ protected function addToolbar()
{
JToolbarHelper::publish('contacts.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('contacts.unpublish', 'JTOOLBAR_UNPUBLISH', true);
+ JToolbarHelper::custom('contacts.featured', 'featured.png', 'featured_f2.png', 'JFEATURE', true);
+ JToolbarHelper::custom('contacts.unfeatured', 'unfeatured.png', 'featured_f2.png', 'JUNFEATURE', true);
JToolbarHelper::archiveList('contacts.archive');
JToolbarHelper::checkin('contacts.checkin');
}
diff --git a/administrator/components/com_content/config.xml b/administrator/components/com_content/config.xml
index 808879caa56e1..239eb82e921f7 100644
--- a/administrator/components/com_content/config.xml
+++ b/administrator/components/com_content/config.xml
@@ -265,8 +265,7 @@
class="btn-group btn-group-yesno"
label="JGLOBAL_SHOW_PRINT_ICON_LABEL"
description="JGLOBAL_SHOW_PRINT_ICON_DESC"
- default="1"
- showon="show_icons:1">
+ default="1">
JSHOW
JHIDE
@@ -277,8 +276,7 @@
class="btn-group btn-group-yesno"
label="JGLOBAL_SHOW_EMAIL_ICON_LABEL"
description="JGLOBAL_SHOW_EMAIL_ICON_DESC"
- default="1"
- showon="show_icons:1">
+ default="1">
JSHOW
JHIDE
@@ -696,9 +694,6 @@
type="spacer"
hr="true"
/>
-
true))
{
- $model = parent::getModel($name, $prefix, $config);
-
- return $model;
+ return parent::getModel($name, $prefix, $config);
}
/**
diff --git a/administrator/components/com_content/controllers/featured.php b/administrator/components/com_content/controllers/featured.php
index 089df321927db..458026fdcbc7b 100644
--- a/administrator/components/com_content/controllers/featured.php
+++ b/administrator/components/com_content/controllers/featured.php
@@ -9,7 +9,7 @@
defined('_JEXEC') or die;
-require_once __DIR__ . '/articles.php';
+JLoader::register('ContentControllerArticles', __DIR__ . '/articles.php');
/**
* Featured content controller class.
@@ -90,8 +90,6 @@ public function publish()
*/
public function getModel($name = 'Feature', $prefix = 'ContentModel', $config = array('ignore_request' => true))
{
- $model = parent::getModel($name, $prefix, $config);
-
- return $model;
+ return parent::getModel($name, $prefix, $config);
}
}
diff --git a/administrator/components/com_content/models/feature.php b/administrator/components/com_content/models/feature.php
index f3730034575d5..7a12a1f876284 100644
--- a/administrator/components/com_content/models/feature.php
+++ b/administrator/components/com_content/models/feature.php
@@ -9,7 +9,7 @@
defined('_JEXEC') or die;
-require_once __DIR__ . '/article.php';
+JLoader::register('ContentModelArticle', __DIR__ . '/article.php');
/**
* Feature model.
diff --git a/administrator/components/com_content/models/featured.php b/administrator/components/com_content/models/featured.php
index 1292491004258..f5d2ef8faeb59 100644
--- a/administrator/components/com_content/models/featured.php
+++ b/administrator/components/com_content/models/featured.php
@@ -9,7 +9,7 @@
defined('_JEXEC') or die;
-require_once __DIR__ . '/articles.php';
+JLoader::register('ContentModelArticles', __DIR__ . '/articles.php');
/**
* About Page Model
diff --git a/administrator/components/com_content/models/forms/filter_articles.xml b/administrator/components/com_content/models/forms/filter_articles.xml
index 8cd89df9d0ee3..51e0dca100994 100644
--- a/administrator/components/com_content/models/forms/filter_articles.xml
+++ b/administrator/components/com_content/models/forms/filter_articles.xml
@@ -94,26 +94,26 @@
JGRID_HEADING_ORDERING_DESC
JSTATUS_ASC
JSTATUS_DESC
+ JFEATURED_ASC
+ JFEATURED_DESC
JGLOBAL_TITLE_ASC
JGLOBAL_TITLE_DESC
JCATEGORY_ASC
JCATEGORY_DESC
- JASSOCIATIONS_ASC
- JASSOCIATIONS_DESC
JGRID_HEADING_ACCESS_ASC
JGRID_HEADING_ACCESS_DESC
+ JASSOCIATIONS_ASC
+ JASSOCIATIONS_DESC
JAUTHOR_ASC
JAUTHOR_DESC
JGRID_HEADING_LANGUAGE_ASC
JGRID_HEADING_LANGUAGE_DESC
JDATE_ASC
JDATE_DESC
- JGRID_HEADING_ID_ASC
- JGRID_HEADING_ID_DESC
- JFEATURED_ASC
- JFEATURED_DESC
JGLOBAL_HITS_ASC
JGLOBAL_HITS_DESC
+ JGRID_HEADING_ID_ASC
+ JGRID_HEADING_ID_DESC
get('layout') == 'modal' ? true : false;
-$layout = $isModal ? 'modal' : 'edit';
-$tmpl = $isModal ? '&tmpl=component' : '';
+$layout = $isModal ? 'modal' : 'edit';
+$tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=component' : '';
?>
-
- show_publishing_options == 1) : ?>
-
-
-
-
-
show_urls_images_backend == 1) : ?>
@@ -137,6 +123,24 @@
+ show_options = $params->show_article_options; ?>
+
+
+
+ show_publishing_options == 1) : ?>
+
+
+
+
+
+
loadTemplate('associations'); ?>
@@ -145,9 +149,6 @@
loadTemplate('associations'); ?>
- show_options = $params->show_article_options; ?>
-
-
canDo->get('core.admin')) : ?>
form->renderFieldset('editorConfig'); ?>
diff --git a/administrator/components/com_content/views/article/tmpl/edit_associations.php b/administrator/components/com_content/views/article/tmpl/edit_associations.php
index e65a294fdea1c..5da88c15516b0 100644
--- a/administrator/components/com_content/views/article/tmpl/edit_associations.php
+++ b/administrator/components/com_content/views/article/tmpl/edit_associations.php
@@ -9,4 +9,11 @@
defined('_JEXEC') or die;
-echo JLayoutHelper::render('joomla.edit.associations', $this);
+if ($this->item->id != 0 && $this->item->language != '*')
+{
+ echo JLayoutHelper::render('joomla.edit.associations', $this);
+}
+else
+{
+ echo '
' . JText::_('JGLOBAL_ASSOC_NOT_POSSIBLE') . '
';
+}
diff --git a/administrator/components/com_content/views/article/view.html.php b/administrator/components/com_content/views/article/view.html.php
index 9f58183127379..64983e04babfa 100644
--- a/administrator/components/com_content/views/article/view.html.php
+++ b/administrator/components/com_content/views/article/view.html.php
@@ -101,20 +101,19 @@ protected function addToolbar()
}
else
{
- // Can't save the record if it's checked out.
- if (!$checkedOut)
+ // Since it's an existing record, check the edit permission, or fall back to edit own if the owner.
+ $itemEditable = $canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_by == $userId);
+
+ // Can't save the record if it's checked out and editable
+ if (!$checkedOut && $itemEditable)
{
- // Since it's an existing record, check the edit permission, or fall back to edit own if the owner.
- if ($canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_by == $userId))
+ JToolbarHelper::apply('article.apply');
+ JToolbarHelper::save('article.save');
+
+ // We can save this record, but check the create permission to see if we can return to make a new one.
+ if ($canDo->get('core.create'))
{
- JToolbarHelper::apply('article.apply');
- JToolbarHelper::save('article.save');
-
- // We can save this record, but check the create permission to see if we can return to make a new one.
- if ($canDo->get('core.create'))
- {
- JToolbarHelper::save2new('article.save2new');
- }
+ JToolbarHelper::save2new('article.save2new');
}
}
@@ -124,7 +123,7 @@ protected function addToolbar()
JToolbarHelper::save2copy('article.save2copy');
}
- if ($this->state->params->get('save_history', 0) && $canDo->get('core.edit'))
+ if ($this->state->params->get('save_history', 0) && $itemEditable)
{
JToolbarHelper::versions('com_content.article', $this->item->id);
}
diff --git a/administrator/components/com_content/views/articles/tmpl/modal.php b/administrator/components/com_content/views/articles/tmpl/modal.php
index 9365c667e98e6..e203021e641e0 100644
--- a/administrator/components/com_content/views/articles/tmpl/modal.php
+++ b/administrator/components/com_content/views/articles/tmpl/modal.php
@@ -16,7 +16,7 @@
JSession::checkToken('get') or die(JText::_('JINVALID_TOKEN'));
}
-require_once JPATH_ROOT . '/components/com_content/helpers/route.php';
+JLoader::register('ContentHelperRoute', JPATH_ROOT . '/components/com_content/helpers/route.php');
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
diff --git a/administrator/components/com_content/views/featured/tmpl/default.php b/administrator/components/com_content/views/featured/tmpl/default.php
index cbc40e0bb0eef..161469ce2be31 100644
--- a/administrator/components/com_content/views/featured/tmpl/default.php
+++ b/administrator/components/com_content/views/featured/tmpl/default.php
@@ -149,7 +149,7 @@
language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
-
+
escape($item->title); ?>
escape($item->title); ?>
@@ -174,7 +174,7 @@
- language == '*'):?>
+ language == '*') : ?>
language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
diff --git a/administrator/components/com_contenthistory/models/compare.php b/administrator/components/com_contenthistory/models/compare.php
index f1847762ae03c..bd6f0ed0e17ea 100644
--- a/administrator/components/com_contenthistory/models/compare.php
+++ b/administrator/components/com_contenthistory/models/compare.php
@@ -52,8 +52,14 @@ public function getItems()
return false;
}
+ $user = JFactory::getUser();
+
// Access check
- if (!JFactory::getUser()->authorise('core.edit', $contentTypeTable->type_alias . '.' . (int) $table1->ucm_item_id))
+ if ($user->authorise('core.edit', $contentTypeTable->type_alias . '.' . (int) $table1->ucm_item_id) || $this->canEdit($table1))
+ {
+ $return = true;
+ }
+ else
{
$this->setError(JText::_('JERROR_ALERTNOAUTHOR'));
@@ -61,18 +67,64 @@ public function getItems()
}
// All's well, process the records
- foreach (array($table1, $table2) as $table)
+ if ($return == true)
{
- $object = new stdClass;
- $object->data = ContenthistoryHelper::prepareData($table);
- $object->version_note = $table->version_note;
- $object->save_date = $table->save_date;
- $result[] = $object;
- }
+ foreach (array($table1, $table2) as $table)
+ {
+ $object = new stdClass;
+ $object->data = ContenthistoryHelper::prepareData($table);
+ $object->version_note = $table->version_note;
+ $object->save_date = $table->save_date;
+ $result[] = $object;
+ }
- return $result;
+ return $result;
+ }
}
return false;
}
+
+ /**
+ * Method to test whether a record is editable
+ *
+ * @param JTableContenthistory $record A JTable object.
+ *
+ * @return boolean True if allowed to edit the record. Defaults to the permission set in the component.
+ *
+ * @since 3.6
+ */
+ protected function canEdit($record)
+ {
+ $result = false;
+
+ if (!empty($record->ucm_type_id))
+ {
+ // Check that the type id matches the type alias
+ $typeAlias = JFactory::getApplication()->input->get('type_alias');
+
+ /** @var JTableContenttype $contentTypeTable */
+ $contentTypeTable = JTable::getInstance('Contenttype', 'JTable');
+
+ if ($contentTypeTable->getTypeId($typeAlias) == $record->ucm_type_id)
+ {
+ /**
+ * Make sure user has edit privileges for this content item. Note that we use edit permissions
+ * for the content item, not delete permissions for the content history row.
+ */
+ $user = JFactory::getUser();
+ $result = $user->authorise('core.edit', $typeAlias . '.' . (int) $record->ucm_item_id);
+ }
+
+ // Finally try session (this catches edit.own case too)
+ if (!$result)
+ {
+ $contentTypeTable->load($record->ucm_type_id);
+ $typeEditables = (array) JFactory::getApplication()->getUserState(str_replace('.', '.edit.', $contentTypeTable->type_alias) . '.id');
+ $result = in_array((int) $record->ucm_item_id, $typeEditables);
+ }
+ }
+
+ return $result;
+ }
}
diff --git a/administrator/components/com_contenthistory/models/history.php b/administrator/components/com_contenthistory/models/history.php
index d91429362a167..1f7ee16081917 100644
--- a/administrator/components/com_contenthistory/models/history.php
+++ b/administrator/components/com_contenthistory/models/history.php
@@ -40,12 +40,11 @@ public function __construct($config = array())
}
/**
- * Method to test whether a history record can be deleted. Note that we check whether we have edit permissions
- * for the content item row.
+ * Method to test whether a record is editable
*
* @param JTableContenthistory $record A JTable object.
*
- * @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
+ * @return boolean True if allowed to edit the record. Defaults to the permission set in the component.
*
* @since 3.2
*/
@@ -70,11 +69,34 @@ protected function canEdit($record)
$user = JFactory::getUser();
$result = $user->authorise('core.edit', $typeAlias . '.' . (int) $record->ucm_item_id);
}
+
+ // Finally try session (this catches edit.own case too)
+ if (!$result)
+ {
+ $contentTypeTable->load($record->ucm_type_id);
+ $typeEditables = (array) JFactory::getApplication()->getUserState(str_replace('.', '.edit.', $contentTypeTable->type_alias) . '.id');
+ $result = in_array((int) $record->ucm_item_id, $typeEditables);
+ }
}
return $result;
}
+ /**
+ * Method to test whether a history record can be deleted. Note that we check whether we have edit permissions
+ * for the content item row.
+ *
+ * @param JTableContenthistory $record A JTable object.
+ *
+ * @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
+ *
+ * @since 3.6
+ */
+ protected function canDelete($record)
+ {
+ return canEdit($record);
+ }
+
/**
* Method to delete one or more records from content history table.
*
@@ -147,6 +169,7 @@ public function delete(&$pks)
public function getItems()
{
$items = parent::getItems();
+ $user = JFactory::getUser();
if ($items === false)
{
@@ -171,15 +194,16 @@ public function getItems()
}
// Access check
- if (!JFactory::getUser()->authorise('core.edit', $contentTypeTable->type_alias . '.' . (int) $items[0]->ucm_item_id))
+ if ($user->authorise('core.edit', $contentTypeTable->type_alias . '.' . (int) $items[0]->ucm_item_id) || $this->canEdit($items[0]))
+ {
+ return $items;
+ }
+ else
{
$this->setError(JText::_('JERROR_ALERTNOAUTHOR'));
return false;
}
-
- // All good, return the items array
- return $items;
}
/**
diff --git a/administrator/components/com_contenthistory/models/preview.php b/administrator/components/com_contenthistory/models/preview.php
index c93e16bbfd205..386354c8fe46c 100644
--- a/administrator/components/com_contenthistory/models/preview.php
+++ b/administrator/components/com_contenthistory/models/preview.php
@@ -46,8 +46,14 @@ public function getItem()
return false;
}
+ $user = JFactory::getUser();
+
// Access check
- if (!JFactory::getUser()->authorise('core.edit', $contentTypeTable->type_alias . '.' . (int) $table->ucm_item_id))
+ if ($user->authorise('core.edit', $contentTypeTable->type_alias . '.' . (int) $table->ucm_item_id) || $this->canEdit($table))
+ {
+ $return = true;
+ }
+ else
{
$this->setError(JText::_('JERROR_ALERTNOAUTHOR'));
@@ -55,10 +61,56 @@ public function getItem()
}
// Good to go, finish processing the data
- $result = new stdClass;
- $result->save_date = $table->save_date;
- $result->version_note = $table->version_note;
- $result->data = ContenthistoryHelper::prepareData($table);
+ if ($return == true)
+ {
+ $result = new stdClass;
+ $result->save_date = $table->save_date;
+ $result->version_note = $table->version_note;
+ $result->data = ContenthistoryHelper::prepareData($table);
+
+ return $result;
+ }
+ }
+
+ /**
+ * Method to test whether a record is editable
+ *
+ * @param JTableContenthistory $record A JTable object.
+ *
+ * @return boolean True if allowed to edit the record. Defaults to the permission set in the component.
+ *
+ * @since 3.6
+ */
+ protected function canEdit($record)
+ {
+ $result = false;
+
+ if (!empty($record->ucm_type_id))
+ {
+ // Check that the type id matches the type alias
+ $typeAlias = JFactory::getApplication()->input->get('type_alias');
+
+ /** @var JTableContenttype $contentTypeTable */
+ $contentTypeTable = JTable::getInstance('Contenttype', 'JTable');
+
+ if ($contentTypeTable->getTypeId($typeAlias) == $record->ucm_type_id)
+ {
+ /**
+ * Make sure user has edit privileges for this content item. Note that we use edit permissions
+ * for the content item, not delete permissions for the content history row.
+ */
+ $user = JFactory::getUser();
+ $result = $user->authorise('core.edit', $typeAlias . '.' . (int) $record->ucm_item_id);
+ }
+
+ // Finally try session (this catches edit.own case too)
+ if (!$result)
+ {
+ $contentTypeTable->load($record->ucm_type_id);
+ $typeEditables = (array) JFactory::getApplication()->getUserState(str_replace('.', '.edit.', $contentTypeTable->type_alias) . '.id');
+ $result = in_array((int) $record->ucm_item_id, $typeEditables);
+ }
+ }
return $result;
}
diff --git a/administrator/components/com_cpanel/views/cpanel/view.html.php b/administrator/components/com_cpanel/views/cpanel/view.html.php
index 189ec63c6d47a..27d8b2399c58d 100644
--- a/administrator/components/com_cpanel/views/cpanel/view.html.php
+++ b/administrator/components/com_cpanel/views/cpanel/view.html.php
@@ -47,12 +47,6 @@ public function display($tpl = null)
// Display the cpanel modules
$this->modules = JModuleHelper::getModules('cpanel');
- // Load the RAD layer and count the number of post-installation messages
- if (!defined('FOF_INCLUDED'))
- {
- require_once JPATH_LIBRARIES . '/fof/include.php';
- }
-
try
{
$messages_model = FOFModel::getTmpInstance('Messages', 'PostinstallModel')->eid(700);
diff --git a/administrator/components/com_finder/controller.php b/administrator/components/com_finder/controller.php
index 502775321d565..51b897015dbfc 100644
--- a/administrator/components/com_finder/controller.php
+++ b/administrator/components/com_finder/controller.php
@@ -17,7 +17,9 @@
class FinderController extends JControllerLegacy
{
/**
- * @var string The default view.
+ * The default view.
+ *
+ * @var string
* @since 2.5
*/
protected $default_view = 'index';
@@ -28,13 +30,13 @@ class FinderController extends JControllerLegacy
* @param boolean $cachable If true, the view output will be cached
* @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
- * @return JController A JController object to support chaining.
+ * @return FinderController A JControllerLegacy object to support chaining.
*
* @since 2.5
*/
public function display($cachable = false, $urlparams = array())
{
- include_once JPATH_COMPONENT . '/helpers/finder.php';
+ JLoader::register('FinderHelper', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/finder.php');
$view = $this->input->get('view', 'index', 'word');
$layout = $this->input->get('layout', 'index', 'word');
@@ -51,8 +53,6 @@ public function display($cachable = false, $urlparams = array())
return false;
}
- parent::display();
-
- return $this;
+ return parent::display();
}
}
diff --git a/administrator/components/com_finder/controllers/filter.php b/administrator/components/com_finder/controllers/filter.php
index 4432466220ca8..67f370547afb1 100644
--- a/administrator/components/com_finder/controllers/filter.php
+++ b/administrator/components/com_finder/controllers/filter.php
@@ -35,7 +35,6 @@ public function save($key = null, $urlVar = null)
$app = JFactory::getApplication();
$input = $app->input;
- $lang = JFactory::getLanguage();
$model = $this->getModel();
$table = $model->getTable();
$data = $input->post->get('jform', array(), 'array');
@@ -186,7 +185,7 @@ public function save($key = null, $urlVar = null)
$this->setMessage(
JText::_(
- ($lang->hasKey($this->text_prefix . ($recordId == 0 && $app->isSite() ? '_SUBMIT' : '') . '_SAVE_SUCCESS')
+ (JFactory::getLanguage()->hasKey($this->text_prefix . ($recordId == 0 && $app->isSite() ? '_SUBMIT' : '') . '_SAVE_SUCCESS')
? $this->text_prefix : 'JLIB_APPLICATION') . ($recordId == 0 && $app->isSite() ? '_SUBMIT' : '') . '_SAVE_SUCCESS'
)
);
diff --git a/administrator/components/com_finder/controllers/filters.php b/administrator/components/com_finder/controllers/filters.php
index 0d68b8e06efc8..b5e7d24e0f259 100644
--- a/administrator/components/com_finder/controllers/filters.php
+++ b/administrator/components/com_finder/controllers/filters.php
@@ -23,14 +23,12 @@ class FinderControllerFilters extends JControllerAdmin
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for model. Optional.
*
- * @return object The model.
+ * @return JModelLegacy The model.
*
* @since 2.5
*/
public function getModel($name = 'Filter', $prefix = 'FinderModel', $config = array('ignore_request' => true))
{
- $model = parent::getModel($name, $prefix, $config);
-
- return $model;
+ return parent::getModel($name, $prefix, $config);
}
}
diff --git a/administrator/components/com_finder/controllers/index.php b/administrator/components/com_finder/controllers/index.php
index 411bc7115460f..a21f31575969b 100644
--- a/administrator/components/com_finder/controllers/index.php
+++ b/administrator/components/com_finder/controllers/index.php
@@ -23,15 +23,13 @@ class FinderControllerIndex extends JControllerAdmin
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for model. Optional.
*
- * @return object The model.
+ * @return JModelLegacy The model.
*
* @since 2.5
*/
public function getModel($name = 'Index', $prefix = 'FinderModel', $config = array('ignore_request' => true))
{
- $model = parent::getModel($name, $prefix, $config);
-
- return $model;
+ return parent::getModel($name, $prefix, $config);
}
/**
diff --git a/administrator/components/com_finder/controllers/indexer.json.php b/administrator/components/com_finder/controllers/indexer.json.php
index 31e8215a632b5..c233fcc35dccd 100644
--- a/administrator/components/com_finder/controllers/indexer.json.php
+++ b/administrator/components/com_finder/controllers/indexer.json.php
@@ -10,7 +10,7 @@
defined('_JEXEC') or die;
// Register dependent classes.
-JLoader::register('FinderIndexer', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/indexer/indexer.php');
+JLoader::register('FinderIndexer', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/indexer.php');
/**
* Indexer controller class for Finder.
@@ -28,27 +28,24 @@ class FinderControllerIndexer extends JControllerLegacy
*/
public function start()
{
- static $log;
-
$params = JComponentHelper::getParams('com_finder');
if ($params->get('enable_logging', '0'))
{
- if ($log == null)
- {
- $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
- $options['text_file'] = 'indexer.php';
- $log = JLog::addLogger($options);
- }
+ $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
+ $options['text_file'] = 'indexer.php';
+ JLog::addLogger($options);
}
// Log the start
JLog::add('Starting the indexer', JLog::INFO);
// We don't want this form to be cached.
- header('Pragma: no-cache');
- header('Cache-Control: no-cache');
- header('Expires: -1');
+ $app = JFactory::getApplication();
+ $app->setHeader('Expires', 'Mon, 1 Jan 2001 00:00:00 GMT', true);
+ $app->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT', true);
+ $app->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false);
+ $app->setHeader('Pragma', 'no-cache');
// Check for a valid token. If invalid, send a 403 with the error message.
JSession::checkToken('request') or $this->sendResponse(new Exception(JText::_('JINVALID_TOKEN'), 403));
@@ -95,27 +92,24 @@ public function start()
*/
public function batch()
{
- static $log;
-
$params = JComponentHelper::getParams('com_finder');
if ($params->get('enable_logging', '0'))
{
- if ($log == null)
- {
- $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
- $options['text_file'] = 'indexer.php';
- $log = JLog::addLogger($options);
- }
+ $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
+ $options['text_file'] = 'indexer.php';
+ JLog::addLogger($options);
}
// Log the start
JLog::add('Starting the indexer batch process', JLog::INFO);
// We don't want this form to be cached.
- header('Pragma: no-cache');
- header('Cache-Control: no-cache');
- header('Expires: -1');
+ $app = JFactory::getApplication();
+ $app->setHeader('Expires', 'Mon, 1 Jan 2001 00:00:00 GMT', true);
+ $app->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT', true);
+ $app->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false);
+ $app->setHeader('Pragma', 'no-cache');
// Check for a valid token. If invalid, send a 403 with the error message.
JSession::checkToken('request') or $this->sendResponse(new Exception(JText::_('JINVALID_TOKEN'), 403));
@@ -216,9 +210,11 @@ public function batch()
public function optimize()
{
// We don't want this form to be cached.
- header('Pragma: no-cache');
- header('Cache-Control: no-cache');
- header('Expires: -1');
+ $app = JFactory::getApplication();
+ $app->setHeader('Expires', 'Mon, 1 Jan 2001 00:00:00 GMT', true);
+ $app->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT', true);
+ $app->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false);
+ $app->setHeader('Pragma', 'no-cache');
// Check for a valid token. If invalid, send a 403 with the error message.
JSession::checkToken('request') or $this->sendResponse(new Exception(JText::_('JINVALID_TOKEN'), 403));
@@ -262,27 +258,24 @@ public function optimize()
*/
public static function sendResponse($data = null)
{
- static $log;
+ // This method always sends a JSON response
+ $app = JFactory::getApplication();
+ $app->mimeType = 'application/json';
$params = JComponentHelper::getParams('com_finder');
if ($params->get('enable_logging', '0'))
{
- if ($log == null)
- {
- $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
- $options['text_file'] = 'indexer.php';
- $log = JLog::addLogger($options);
- }
+ $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
+ $options['text_file'] = 'indexer.php';
+ JLog::addLogger($options);
}
// Send the assigned error code if we are catching an exception.
if ($data instanceof Exception)
{
- $app = JFactory::getApplication();
JLog::add($data->getMessage(), JLog::ERROR);
$app->setHeader('status', $data->getCode());
- $app->sendHeaders();
}
// Create the response object.
@@ -292,10 +285,12 @@ public static function sendResponse($data = null)
$response->buffer = JDEBUG ? ob_get_contents() : ob_end_clean();
// Send the JSON response.
+ $app->setHeader('Content-Type', $app->mimeType . '; charset=' . $app->charSet);
+ $app->sendHeaders();
echo json_encode($response);
// Close the application.
- JFactory::getApplication()->close();
+ $app->close();
}
}
@@ -315,18 +310,13 @@ class FinderIndexerResponse
*/
public function __construct($state)
{
- static $log;
-
$params = JComponentHelper::getParams('com_finder');
if ($params->get('enable_logging', '0'))
{
- if ($log == null)
- {
- $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
- $options['text_file'] = 'indexer.php';
- $log = JLog::addLogger($options);
- }
+ $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
+ $options['text_file'] = 'indexer.php';
+ JLog::addLogger($options);
}
// The old token is invalid so send a new one.
diff --git a/administrator/components/com_finder/controllers/maps.php b/administrator/components/com_finder/controllers/maps.php
index 6e0cb859e60c5..aed0950692548 100644
--- a/administrator/components/com_finder/controllers/maps.php
+++ b/administrator/components/com_finder/controllers/maps.php
@@ -23,14 +23,12 @@ class FinderControllerMaps extends JControllerAdmin
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for model. Optional.
*
- * @return object The model.
+ * @return JModelLegacy The model.
*
* @since 1.6
*/
public function getModel($name = 'Maps', $prefix = 'FinderModel', $config = array('ignore_request' => true))
{
- $model = parent::getModel($name, $prefix, $config);
-
- return $model;
+ return parent::getModel($name, $prefix, $config);
}
}
diff --git a/administrator/components/com_finder/helpers/finder.php b/administrator/components/com_finder/helpers/finder.php
index a847ef4f128ad..9a0f44d727ad3 100644
--- a/administrator/components/com_finder/helpers/finder.php
+++ b/administrator/components/com_finder/helpers/finder.php
@@ -17,8 +17,10 @@
class FinderHelper
{
/**
- * @var string The extension name.
- * @since 2.5
+ * The extension name.
+ *
+ * @var string
+ * @since 2.5
*/
public static $extension = 'com_finder';
@@ -93,8 +95,6 @@ public static function getActions()
JLog::add(__METHOD__ . '() is deprecated, use JHelperContent::getActions() with new arguments order instead.', JLog::WARNING, 'deprecated');
// Get list of actions
- $result = JHelperContent::getActions('com_finder');
-
- return $result;
+ return JHelperContent::getActions('com_finder');
}
}
diff --git a/administrator/components/com_finder/helpers/html/finder.php b/administrator/components/com_finder/helpers/html/finder.php
index 00731fff5da1a..0e5e8993b3ec3 100644
--- a/administrator/components/com_finder/helpers/html/finder.php
+++ b/administrator/components/com_finder/helpers/html/finder.php
@@ -29,8 +29,6 @@ abstract class JHtmlFinder
*/
public static function typeslist()
{
- $lang = JFactory::getLanguage();
-
// Load the finder types.
$db = JFactory::getDbo();
$query = $db->getQuery(true)
@@ -46,18 +44,18 @@ public static function typeslist()
}
catch (RuntimeException $e)
{
- return;
+ return array();
}
// Compile the options.
$options = array();
+ $lang = JFactory::getLanguage();
+
foreach ($rows as $row)
{
- $key = $lang->hasKey(FinderHelperLanguage::branchPlural($row->text))
- ? FinderHelperLanguage::branchPlural($row->text) : $row->text;
- $string = JText::sprintf('COM_FINDER_ITEM_X_ONLY', JText::_($key));
- $options[] = JHtml::_('select.option', $row->value, $string);
+ $key = $lang->hasKey(FinderHelperLanguage::branchPlural($row->text)) ? FinderHelperLanguage::branchPlural($row->text) : $row->text;
+ $options[] = JHtml::_('select.option', $row->value, JText::sprintf('COM_FINDER_ITEM_X_ONLY', JText::_($key)));
}
return $options;
@@ -72,8 +70,6 @@ public static function typeslist()
*/
public static function mapslist()
{
- $lang = JFactory::getLanguage();
-
// Load the finder types.
$db = JFactory::getDbo();
$query = $db->getQuery(true)
@@ -93,6 +89,8 @@ public static function mapslist()
}
// Translate.
+ $lang = JFactory::getLanguage();
+
foreach ($branches as $branch)
{
$key = FinderHelperLanguage::branchPlural($branch->text);
@@ -124,10 +122,9 @@ public static function mapslist()
*/
public static function statelist()
{
- $options = array();
- $options[] = JHtml::_('select.option', '1', JText::sprintf('COM_FINDER_ITEM_X_ONLY', JText::_('JPUBLISHED')));
- $options[] = JHtml::_('select.option', '0', JText::sprintf('COM_FINDER_ITEM_X_ONLY', JText::_('JUNPUBLISHED')));
-
- return $options;
+ return array(
+ JHtml::_('select.option', '1', JText::sprintf('COM_FINDER_ITEM_X_ONLY', JText::_('JPUBLISHED'))),
+ JHtml::_('select.option', '0', JText::sprintf('COM_FINDER_ITEM_X_ONLY', JText::_('JUNPUBLISHED')))
+ );
}
}
diff --git a/administrator/components/com_finder/helpers/indexer/adapter.php b/administrator/components/com_finder/helpers/indexer/adapter.php
index c822d30343ada..6314ebece649c 100644
--- a/administrator/components/com_finder/helpers/indexer/adapter.php
+++ b/administrator/components/com_finder/helpers/indexer/adapter.php
@@ -163,7 +163,7 @@ public function __construct(&$subject, $config)
* @return boolean True on success.
*
* @since 2.5
- * @throws Exception on error.
+ * @throws Exception on error.
*/
public function onStartIndex()
{
@@ -271,7 +271,7 @@ public function onBuildIndex()
* @return boolean True on success.
*
* @since 2.5
- * @throws Exception on database error.
+ * @throws Exception on database error.
*/
protected function change($id, $property, $value)
{
@@ -527,9 +527,8 @@ protected function getContentCount()
// Get the total number of content items to index.
$this->db->setQuery($query);
- $return = (int) $this->db->loadResult();
- return $return;
+ return (int) $this->db->loadResult();
}
/**
@@ -624,9 +623,7 @@ protected function getItems($offset, $limit, $query = null)
protected function getListQuery($query = null)
{
// Check if we can use the supplied SQL query.
- $query = $query instanceof JDatabaseQuery ? $query : $this->db->getQuery(true);
-
- return $query;
+ return $query instanceof JDatabaseQuery ? $query : $this->db->getQuery(true);
}
/**
@@ -646,9 +643,8 @@ protected function getPluginType($id)
->from($this->db->quoteName('#__extensions'))
->where($this->db->quoteName('extension_id') . ' = ' . (int) $id);
$this->db->setQuery($query);
- $type = $this->db->loadResult();
- return $type;
+ return $this->db->loadResult();
}
/**
@@ -729,9 +725,8 @@ protected function getTypeId()
->from($this->db->quoteName('#__finder_types'))
->where($this->db->quoteName('title') . ' = ' . $this->db->quote($this->type_title));
$this->db->setQuery($query);
- $result = (int) $this->db->loadResult();
- return $result;
+ return (int) $this->db->loadResult();
}
/**
diff --git a/administrator/components/com_finder/helpers/indexer/helper.php b/administrator/components/com_finder/helpers/indexer/helper.php
index d340bc88fe5c6..0a1574f8838bd 100644
--- a/administrator/components/com_finder/helpers/indexer/helper.php
+++ b/administrator/components/com_finder/helpers/indexer/helper.php
@@ -74,7 +74,7 @@ public static function tokenize($input, $lang, $phrase = false)
$quotes = html_entity_decode('‘’'', ENT_QUOTES, 'UTF-8');
// Get the simple language key.
- $lang = self::getPrimaryLanguage($lang);
+ $lang = static::getPrimaryLanguage($lang);
/*
* Parsing the string input into terms is a multi-step process.
@@ -224,14 +224,12 @@ public static function stem($token, $lang)
}
// Stem the token if we have a valid stemmer to use.
- if (self::$stemmer instanceof FinderIndexerStemmer)
+ if (static::$stemmer instanceof FinderIndexerStemmer)
{
- return self::$stemmer->stem($token, $lang);
- }
- else
- {
- return $token;
+ return static::$stemmer->stem($token, $lang);
}
+
+ return $token;
}
/**
@@ -303,14 +301,7 @@ public static function isCommon($token, $lang)
}
// Check if the token is in the common array.
- if (in_array($token, $data[$lang]))
- {
- return true;
- }
- else
- {
- return false;
- }
+ return in_array($token, $data[$lang]);
}
/**
@@ -335,9 +326,8 @@ public static function getCommonWords($lang)
// Load all of the common terms for the language.
$db->setQuery($query);
- $results = $db->loadColumn();
- return $results;
+ return $db->loadColumn();
}
/**
diff --git a/administrator/components/com_finder/helpers/indexer/indexer.php b/administrator/components/com_finder/helpers/indexer/indexer.php
index 4da8fbc310635..0bfa0daed411b 100644
--- a/administrator/components/com_finder/helpers/indexer/indexer.php
+++ b/administrator/components/com_finder/helpers/indexer/indexer.php
@@ -75,7 +75,7 @@ abstract class FinderIndexer
/**
* The indexer state object.
*
- * @var object
+ * @var JObject
* @since 2.5
*/
public static $state;
@@ -83,7 +83,7 @@ abstract class FinderIndexer
/**
* The indexer profiler object.
*
- * @var object
+ * @var JProfiler
* @since 2.5
*/
public static $profiler;
@@ -121,11 +121,9 @@ public static function getInstance()
return new $class;
}
- else
- {
- // Throw invalid format exception.
- throw new RuntimeException(JText::sprintf('COM_FINDER_INDEXER_INVALID_DRIVER', $format));
- }
+
+ // Throw invalid format exception.
+ throw new RuntimeException(JText::sprintf('COM_FINDER_INDEXER_INVALID_DRIVER', $format));
}
/**
@@ -138,9 +136,9 @@ public static function getInstance()
public static function getState()
{
// First, try to load from the internal state.
- if (!empty(self::$state))
+ if (!empty(static::$state))
{
- return self::$state;
+ return static::$state;
}
// If we couldn't load from the internal state, try the session.
@@ -177,7 +175,7 @@ public static function getState()
// Setup the profiler if debugging is enabled.
if (JFactory::getApplication()->get('debug'))
{
- self::$profiler = JProfiler::getInstance('FinderIndexer');
+ static::$profiler = JProfiler::getInstance('FinderIndexer');
}
// Setup the stemmer.
@@ -187,9 +185,9 @@ public static function getState()
}
// Set the state.
- self::$state = $data;
+ static::$state = $data;
- return self::$state;
+ return static::$state;
}
/**
@@ -210,11 +208,10 @@ public static function setState($data)
}
// Set the new internal state.
- self::$state = $data;
+ static::$state = $data;
// Set the new session state.
- $session = JFactory::getSession();
- $session->set('_finder.state', $data);
+ JFactory::getSession()->set('_finder.state', $data);
return true;
}
@@ -232,8 +229,7 @@ public static function resetState()
self::$state = null;
// Reset the session state to null.
- $session = JFactory::getSession();
- $session->set('_finder.state', null);
+ JFactory::getSession()->set('_finder.state', null);
}
/**
@@ -284,13 +280,14 @@ abstract public function optimize();
protected static function getSignature($item)
{
// Get the indexer state.
- $state = self::getState();
+ $state = static::getState();
// Get the relevant configuration variables.
- $config = array();
- $config[] = $state->weights;
- $config[] = $state->options->get('stem', 1);
- $config[] = $state->options->get('stemmer', 'porter_en');
+ $config = array(
+ $state->weights,
+ $state->options->get('stem', 1),
+ $state->options->get('stemmer', 'porter_en')
+ );
return md5(serialize(array($item, $config)));
}
@@ -298,10 +295,8 @@ protected static function getSignature($item)
/**
* Method to parse input, tokenize it, and then add it to the database.
*
- * @param mixed $input String or resource to use as input. A resource
- * input will automatically be chunked to conserve
- * memory. Strings will be chunked if longer than
- * 2K in size.
+ * @param mixed $input String or resource to use as input. A resource input will automatically be chunked to conserve
+ * memory. Strings will be chunked if longer than 2K in size.
* @param integer $context The context of the input. See context constants.
* @param string $lang The language of the input.
* @param string $format The format of the input.
@@ -373,7 +368,7 @@ protected function tokenizeToDb($input, $context, $lang, $format)
$count += $this->addTokensToDb($tokens, $context);
// Check if we're approaching the memory limit of the token table.
- if ($count > self::$state->options->get('memory_table_limit', 30000))
+ if ($count > static::$state->options->get('memory_table_limit', 30000))
{
$this->toggleTables(false);
}
@@ -428,7 +423,7 @@ protected function tokenizeToDb($input, $context, $lang, $format)
$count += $this->addTokensToDb($tokens, $context);
// Check if we're approaching the memory limit of the token table.
- if ($count > self::$state->options->get('memory_table_limit', 30000))
+ if ($count > static::$state->options->get('memory_table_limit', 30000))
{
$this->toggleTables(false);
}
diff --git a/administrator/components/com_finder/helpers/indexer/parser.php b/administrator/components/com_finder/helpers/indexer/parser.php
index d52023af23315..ff538ce0139a1 100644
--- a/administrator/components/com_finder/helpers/indexer/parser.php
+++ b/administrator/components/com_finder/helpers/indexer/parser.php
@@ -48,18 +48,16 @@ public static function getInstance($format)
$class = 'FinderIndexerParser' . ucfirst($format);
// Check if a parser exists for the format.
- if (file_exists($path))
- {
- // Instantiate the parser.
- include_once $path;
- $instances[$format] = new $class;
- }
- else
+ if (!file_exists($path))
{
// Throw invalid format exception.
throw new Exception(JText::sprintf('COM_FINDER_INDEXER_INVALID_PARSER', $format));
}
+ // Instantiate the parser.
+ include_once $path;
+ $instances[$format] = new $class;
+
return $instances[$format];
}
diff --git a/administrator/components/com_finder/helpers/indexer/parser/html.php b/administrator/components/com_finder/helpers/indexer/parser/html.php
index 44dc4db3d4df3..16bbe283a7e3d 100644
--- a/administrator/components/com_finder/helpers/indexer/parser/html.php
+++ b/administrator/components/com_finder/helpers/indexer/parser/html.php
@@ -80,9 +80,7 @@ public function parse($input)
protected function process($input)
{
// Replace any amount of white space with a single space.
- $input = preg_replace('#\s+#u', ' ', $input);
-
- return $input;
+ return preg_replace('#\s+#u', ' ', $input);
}
/**
@@ -102,7 +100,6 @@ protected function process($input)
private function removeBlocks($input, $startTag, $endTag)
{
$return = '';
- $blocks = array();
$offset = 0;
$startTagLength = strlen($startTag);
$endTagLength = strlen($endTag);
diff --git a/administrator/components/com_finder/helpers/indexer/query.php b/administrator/components/com_finder/helpers/indexer/query.php
index 2e530888a8c86..76d0b3e30b8f0 100644
--- a/administrator/components/com_finder/helpers/indexer/query.php
+++ b/administrator/components/com_finder/helpers/indexer/query.php
@@ -290,8 +290,7 @@ public function toUri($base = null)
}
// Get the filters in the request.
- $input = JFactory::getApplication()->input;
- $t = $input->request->get('t', array(), 'array');
+ $t = JFactory::getApplication()->input->request->get('t', array(), 'array');
// Add the dynamic taxonomy filters if present.
if (!empty($this->filters))
@@ -380,9 +379,8 @@ public function getExcludedTermIds()
// Sanitize the terms.
$results = array_unique($results);
- $results = ArrayHelper::toInteger($results);
- return $results;
+ return ArrayHelper::toInteger($results);
}
/**
@@ -487,8 +485,7 @@ protected function processStaticTaxonomy($filterId)
$db = JFactory::getDbo();
// Initialize user variables
- $user = JFactory::getUser();
- $groups = implode(',', $user->getAuthorisedViewLevels());
+ $groups = implode(',', JFactory::getUser()->getAuthorisedViewLevels());
// Load the predefined filter.
$query = $db->getQuery(true)
@@ -581,8 +578,7 @@ protected function processStaticTaxonomy($filterId)
protected function processDynamicTaxonomy($filters)
{
// Initialize user variables
- $user = JFactory::getUser();
- $groups = implode(',', $user->getAuthorisedViewLevels());
+ $groups = implode(',', JFactory::getUser()->getAuthorisedViewLevels());
// Remove duplicates and sanitize.
$filters = array_unique($filters);
@@ -683,8 +679,7 @@ protected function processDates($date1, $date2, $when1, $when2)
// The value of 'today' is a special case that we need to handle.
if ($date1 === JString::strtolower(JText::_('COM_FINDER_QUERY_FILTER_TODAY')))
{
- $today = JFactory::getDate('now', $offset);
- $date1 = $today->format('%Y-%m-%d');
+ $date1 = JFactory::getDate('now', $offset)->format('%Y-%m-%d');
}
// Try to parse the date string.
@@ -701,8 +696,7 @@ protected function processDates($date1, $date2, $when1, $when2)
// The value of 'today' is a special case that we need to handle.
if ($date2 === JString::strtolower(JText::_('COM_FINDER_QUERY_FILTER_TODAY')))
{
- $today = JFactory::getDate('now', $offset);
- $date2 = $today->format('%Y-%m-%d');
+ $date2 = JFactory::getDate('now', $offset)->format('%Y-%m-%d');
}
// Try to parse the date string.
@@ -809,8 +803,7 @@ protected function processString($input, $lang, $mode)
// The value of 'today' is a special case that we need to handle.
if ($value === JString::strtolower(JText::_('COM_FINDER_QUERY_FILTER_TODAY')))
{
- $today = JFactory::getDate('now', $offset);
- $value = $today->format('%Y-%m-%d');
+ $value = JFactory::getDate('now', $offset)->format('%Y-%m-%d');
}
// Try to parse the date string.
diff --git a/administrator/components/com_finder/helpers/indexer/result.php b/administrator/components/com_finder/helpers/indexer/result.php
index ef7ad089c8488..78bcb6addde6d 100644
--- a/administrator/components/com_finder/helpers/indexer/result.php
+++ b/administrator/components/com_finder/helpers/indexer/result.php
@@ -207,12 +207,11 @@ public function __construct()
*/
public function __set($name, $value)
{
- $this->elements[$name] = $value;
+ $this->setElement($name, $value);
}
/**
- * The magic get method is used to retrieve additional element values
- * from the elements array.
+ * The magic get method is used to retrieve additional element values from the elements array.
*
* @param string $name The name of the element.
*
@@ -222,20 +221,11 @@ public function __set($name, $value)
*/
public function __get($name)
{
- // Get the element value if set.
- if (array_key_exists($name, $this->elements))
- {
- return $this->elements[$name];
- }
- else
- {
- return null;
- }
+ return $this->getElement($name);
}
/**
- * The magic isset method is used to check the state of additional element
- * values in the elements array.
+ * The magic isset method is used to check the state of additional element values in the elements array.
*
* @param string $name The name of the element.
*
@@ -249,8 +239,7 @@ public function __isset($name)
}
/**
- * The magic unset method is used to unset additional element values in the
- * elements array.
+ * The magic unset method is used to unset additional element values in the elements array.
*
* @param string $name The name of the element.
*
@@ -279,10 +268,8 @@ public function getElement($name)
{
return $this->elements[$name];
}
- else
- {
- return null;
- }
+
+ return null;
}
/**
diff --git a/administrator/components/com_finder/helpers/indexer/stemmer.php b/administrator/components/com_finder/helpers/indexer/stemmer.php
index 1629c2bc4ff90..c5e0582bfd322 100644
--- a/administrator/components/com_finder/helpers/indexer/stemmer.php
+++ b/administrator/components/com_finder/helpers/indexer/stemmer.php
@@ -56,18 +56,16 @@ public static function getInstance($adapter)
$class = 'FinderIndexerStemmer' . ucfirst($adapter);
// Check if a stemmer exists for the adapter.
- if (file_exists($path))
- {
- // Instantiate the stemmer.
- include_once $path;
- $instances[$adapter] = new $class;
- }
- else
+ if (!file_exists($path))
{
// Throw invalid adapter exception.
throw new Exception(JText::sprintf('COM_FINDER_INDEXER_INVALID_STEMMER', $adapter));
}
+ // Instantiate the stemmer.
+ include_once $path;
+ $instances[$adapter] = new $class;
+
return $instances[$adapter];
}
diff --git a/administrator/components/com_finder/helpers/indexer/stemmer/fr.php b/administrator/components/com_finder/helpers/indexer/stemmer/fr.php
index 1ce973c626a5d..7f40a5ed832ef 100644
--- a/administrator/components/com_finder/helpers/indexer/stemmer/fr.php
+++ b/administrator/components/com_finder/helpers/indexer/stemmer/fr.php
@@ -27,7 +27,7 @@ class FinderIndexerStemmerFr extends FinderIndexerStemmer
* @var array
* @since 3.0
*/
- private static $_stemRules = null;
+ private static $stemRules = null;
/**
* Method to stem a token and return the root.
@@ -57,7 +57,7 @@ public function stem($token, $lang)
if (!isset($this->cache[$lang][$token]))
{
// Stem the token.
- $result = static::_getStem($token);
+ $result = self::getStem($token);
// Add the token to the cache.
$this->cache[$lang][$token] = $result;
@@ -75,9 +75,9 @@ public function stem($token, $lang)
*/
protected static function getStemRules()
{
- if (static::$_stemRules)
+ if (self::$stemRules)
{
- return static::$_stemRules;
+ return self::$stemRules;
}
$vars = array();
@@ -134,9 +134,9 @@ protected static function getStemRules()
'eya2i.', 'ya1i.', 'yo1i.', 'esu1.', 'ugi1.', 'tt1.', 'end0.'
);
- static::$_stemRules = $vars;
+ self::$stemRules = $vars;
- return static::$_stemRules;
+ return self::$stemRules;
}
/**
@@ -151,7 +151,7 @@ protected static function getStemRules()
*
* @since 3.0
*/
- private static function _getFirstRule($reversed_input, $rule_number)
+ private static function getFirstRule($reversed_input, $rule_number)
{
$vars = static::getStemRules();
@@ -181,7 +181,7 @@ private static function _getFirstRule($reversed_input, $rule_number)
*
* @since 3.0
*/
- private static function _check($reversed_stem)
+ private static function check($reversed_stem)
{
$vars = static::getStemRules();
@@ -212,7 +212,7 @@ private static function _check($reversed_stem)
*
* @since 3.0
*/
- private static function _getStem($input)
+ private static function getStem($input)
{
$vars = static::getStemRules();
@@ -223,7 +223,7 @@ private static function _getStem($input)
// This loop goes through the rules' array until it finds an ending one (ending by '.') or the last one ('end0.')
while (true)
{
- $rule_number = static::_getFirstRule($reversed_input, $rule_number);
+ $rule_number = self::getFirstRule($reversed_input, $rule_number);
if ($rule_number == -1)
{
@@ -238,7 +238,7 @@ private static function _getStem($input)
{
$reversed_stem = utf8_decode($matches[4]) . substr($reversed_input, $matches[3], strlen($reversed_input) - $matches[3]);
- if (self::_check($reversed_stem))
+ if (self::check($reversed_stem))
{
$reversed_input = $reversed_stem;
diff --git a/administrator/components/com_finder/helpers/indexer/stemmer/porter_en.php b/administrator/components/com_finder/helpers/indexer/stemmer/porter_en.php
index 3963243854ba6..340a82d1e3f07 100644
--- a/administrator/components/com_finder/helpers/indexer/stemmer/porter_en.php
+++ b/administrator/components/com_finder/helpers/indexer/stemmer/porter_en.php
@@ -27,7 +27,7 @@ class FinderIndexerStemmerPorter_En extends FinderIndexerStemmer
* @var string
* @since 2.5
*/
- private static $_regex_consonant = '(?:[bcdfghjklmnpqrstvwxz]|(?<=[aeiou])y|^y)';
+ private static $regex_consonant = '(?:[bcdfghjklmnpqrstvwxz]|(?<=[aeiou])y|^y)';
/**
* Regex for matching a vowel
@@ -35,7 +35,7 @@ class FinderIndexerStemmerPorter_En extends FinderIndexerStemmer
* @var string
* @since 2.5
*/
- private static $_regex_vowel = '(?:[aeiou]|(?cache[$lang][$token] = $result;
@@ -89,37 +89,37 @@ public function stem($token, $lang)
*
* @since 2.5
*/
- private static function _step1ab($word)
+ private static function step1ab($word)
{
// Part a
if (substr($word, -1) == 's')
{
- self::_replace($word, 'sses', 'ss')
- or self::_replace($word, 'ies', 'i')
- or self::_replace($word, 'ss', 'ss')
- or self::_replace($word, 's', '');
+ self::replace($word, 'sses', 'ss')
+ or self::replace($word, 'ies', 'i')
+ or self::replace($word, 'ss', 'ss')
+ or self::replace($word, 's', '');
}
// Part b
- if (substr($word, -2, 1) != 'e' or !self::_replace($word, 'eed', 'ee', 0))
+ if (substr($word, -2, 1) != 'e' or !self::replace($word, 'eed', 'ee', 0))
{
// First rule
- $v = self::$_regex_vowel;
+ $v = self::$regex_vowel;
// Words ending with ing and ed
// Note use of && and OR, for precedence reasons
- if (preg_match("#$v+#", substr($word, 0, -3)) && self::_replace($word, 'ing', '')
- or preg_match("#$v+#", substr($word, 0, -2)) && self::_replace($word, 'ed', ''))
+ if (preg_match("#$v+#", substr($word, 0, -3)) && self::replace($word, 'ing', '')
+ or preg_match("#$v+#", substr($word, 0, -2)) && self::replace($word, 'ed', ''))
{
// If one of above two test successful
- if (!self::_replace($word, 'at', 'ate') and !self::_replace($word, 'bl', 'ble') and !self::_replace($word, 'iz', 'ize'))
+ if (!self::replace($word, 'at', 'ate') and !self::replace($word, 'bl', 'ble') and !self::replace($word, 'iz', 'ize'))
{
// Double consonant ending
- if (self::_doubleConsonant($word) and substr($word, -2) != 'll' and substr($word, -2) != 'ss' and substr($word, -2) != 'zz')
+ if (self::doubleConsonant($word) and substr($word, -2) != 'll' and substr($word, -2) != 'ss' and substr($word, -2) != 'zz')
{
$word = substr($word, 0, -1);
}
- elseif (self::_m($word) == 1 and self::_cvc($word))
+ elseif (self::m($word) == 1 and self::cvc($word))
{
$word .= 'e';
}
@@ -139,13 +139,13 @@ private static function _step1ab($word)
*
* @since 2.5
*/
- private static function _step1c($word)
+ private static function step1c($word)
{
- $v = self::$_regex_vowel;
+ $v = self::$regex_vowel;
if (substr($word, -1) == 'y' && preg_match("#$v+#", substr($word, 0, -1)))
{
- self::_replace($word, 'y', 'i');
+ self::replace($word, 'y', 'i');
}
return $word;
@@ -160,46 +160,46 @@ private static function _step1c($word)
*
* @since 2.5
*/
- private static function _step2($word)
+ private static function step2($word)
{
switch (substr($word, -2, 1))
{
case 'a':
- self::_replace($word, 'ational', 'ate', 0)
- or self::_replace($word, 'tional', 'tion', 0);
+ self::replace($word, 'ational', 'ate', 0)
+ or self::replace($word, 'tional', 'tion', 0);
break;
case 'c':
- self::_replace($word, 'enci', 'ence', 0)
- or self::_replace($word, 'anci', 'ance', 0);
+ self::replace($word, 'enci', 'ence', 0)
+ or self::replace($word, 'anci', 'ance', 0);
break;
case 'e':
- self::_replace($word, 'izer', 'ize', 0);
+ self::replace($word, 'izer', 'ize', 0);
break;
case 'g':
- self::_replace($word, 'logi', 'log', 0);
+ self::replace($word, 'logi', 'log', 0);
break;
case 'l':
- self::_replace($word, 'entli', 'ent', 0)
- or self::_replace($word, 'ousli', 'ous', 0)
- or self::_replace($word, 'alli', 'al', 0)
- or self::_replace($word, 'bli', 'ble', 0)
- or self::_replace($word, 'eli', 'e', 0);
+ self::replace($word, 'entli', 'ent', 0)
+ or self::replace($word, 'ousli', 'ous', 0)
+ or self::replace($word, 'alli', 'al', 0)
+ or self::replace($word, 'bli', 'ble', 0)
+ or self::replace($word, 'eli', 'e', 0);
break;
case 'o':
- self::_replace($word, 'ization', 'ize', 0)
- or self::_replace($word, 'ation', 'ate', 0)
- or self::_replace($word, 'ator', 'ate', 0);
+ self::replace($word, 'ization', 'ize', 0)
+ or self::replace($word, 'ation', 'ate', 0)
+ or self::replace($word, 'ator', 'ate', 0);
break;
case 's':
- self::_replace($word, 'iveness', 'ive', 0)
- or self::_replace($word, 'fulness', 'ful', 0)
- or self::_replace($word, 'ousness', 'ous', 0)
- or self::_replace($word, 'alism', 'al', 0);
+ self::replace($word, 'iveness', 'ive', 0)
+ or self::replace($word, 'fulness', 'ful', 0)
+ or self::replace($word, 'ousness', 'ous', 0)
+ or self::replace($word, 'alism', 'al', 0);
break;
case 't':
- self::_replace($word, 'biliti', 'ble', 0)
- or self::_replace($word, 'aliti', 'al', 0)
- or self::_replace($word, 'iviti', 'ive', 0);
+ self::replace($word, 'biliti', 'ble', 0)
+ or self::replace($word, 'aliti', 'al', 0)
+ or self::replace($word, 'iviti', 'ive', 0);
break;
}
@@ -215,28 +215,28 @@ private static function _step2($word)
*
* @since 2.5
*/
- private static function _step3($word)
+ private static function step3($word)
{
switch (substr($word, -2, 1))
{
case 'a':
- self::_replace($word, 'ical', 'ic', 0);
+ self::replace($word, 'ical', 'ic', 0);
break;
case 's':
- self::_replace($word, 'ness', '', 0);
+ self::replace($word, 'ness', '', 0);
break;
case 't':
- self::_replace($word, 'icate', 'ic', 0)
- or self::_replace($word, 'iciti', 'ic', 0);
+ self::replace($word, 'icate', 'ic', 0)
+ or self::replace($word, 'iciti', 'ic', 0);
break;
case 'u':
- self::_replace($word, 'ful', '', 0);
+ self::replace($word, 'ful', '', 0);
break;
case 'v':
- self::_replace($word, 'ative', '', 0);
+ self::replace($word, 'ative', '', 0);
break;
case 'z':
- self::_replace($word, 'alize', 'al', 0);
+ self::replace($word, 'alize', 'al', 0);
break;
}
@@ -252,58 +252,58 @@ private static function _step3($word)
*
* @since 2.5
*/
- private static function _step4($word)
+ private static function step4($word)
{
switch (substr($word, -2, 1))
{
case 'a':
- self::_replace($word, 'al', '', 1);
+ self::replace($word, 'al', '', 1);
break;
case 'c':
- self::_replace($word, 'ance', '', 1)
- or self::_replace($word, 'ence', '', 1);
+ self::replace($word, 'ance', '', 1)
+ or self::replace($word, 'ence', '', 1);
break;
case 'e':
- self::_replace($word, 'er', '', 1);
+ self::replace($word, 'er', '', 1);
break;
case 'i':
- self::_replace($word, 'ic', '', 1);
+ self::replace($word, 'ic', '', 1);
break;
case 'l':
- self::_replace($word, 'able', '', 1)
- or self::_replace($word, 'ible', '', 1);
+ self::replace($word, 'able', '', 1)
+ or self::replace($word, 'ible', '', 1);
break;
case 'n':
- self::_replace($word, 'ant', '', 1)
- or self::_replace($word, 'ement', '', 1)
- or self::_replace($word, 'ment', '', 1)
- or self::_replace($word, 'ent', '', 1);
+ self::replace($word, 'ant', '', 1)
+ or self::replace($word, 'ement', '', 1)
+ or self::replace($word, 'ment', '', 1)
+ or self::replace($word, 'ent', '', 1);
break;
case 'o':
if (substr($word, -4) == 'tion' or substr($word, -4) == 'sion')
{
- self::_replace($word, 'ion', '', 1);
+ self::replace($word, 'ion', '', 1);
}
else
{
- self::_replace($word, 'ou', '', 1);
+ self::replace($word, 'ou', '', 1);
}
break;
case 's':
- self::_replace($word, 'ism', '', 1);
+ self::replace($word, 'ism', '', 1);
break;
case 't':
- self::_replace($word, 'ate', '', 1)
- or self::_replace($word, 'iti', '', 1);
+ self::replace($word, 'ate', '', 1)
+ or self::replace($word, 'iti', '', 1);
break;
case 'u':
- self::_replace($word, 'ous', '', 1);
+ self::replace($word, 'ous', '', 1);
break;
case 'v':
- self::_replace($word, 'ive', '', 1);
+ self::replace($word, 'ive', '', 1);
break;
case 'z':
- self::_replace($word, 'ize', '', 1);
+ self::replace($word, 'ize', '', 1);
break;
}
@@ -319,26 +319,26 @@ private static function _step4($word)
*
* @since 2.5
*/
- private static function _step5($word)
+ private static function step5($word)
{
// Part a
if (substr($word, -1) == 'e')
{
- if (self::_m(substr($word, 0, -1)) > 1)
+ if (self::m(substr($word, 0, -1)) > 1)
{
- self::_replace($word, 'e', '');
+ self::replace($word, 'e', '');
}
- elseif (self::_m(substr($word, 0, -1)) == 1)
+ elseif (self::m(substr($word, 0, -1)) == 1)
{
- if (!self::_cvc(substr($word, 0, -1)))
+ if (!self::cvc(substr($word, 0, -1)))
{
- self::_replace($word, 'e', '');
+ self::replace($word, 'e', '');
}
}
}
// Part b
- if (self::_m($word) > 1 and self::_doubleConsonant($word) and substr($word, -1) == 'l')
+ if (self::m($word) > 1 and self::doubleConsonant($word) and substr($word, -1) == 'l')
{
$word = substr($word, 0, -1);
}
@@ -361,7 +361,7 @@ private static function _step5($word)
*
* @since 2.5
*/
- private static function _replace(&$str, $check, $repl, $m = null)
+ private static function replace(&$str, $check, $repl, $m = null)
{
$len = 0 - strlen($check);
@@ -369,7 +369,7 @@ private static function _replace(&$str, $check, $repl, $m = null)
{
$substr = substr($str, 0, $len);
- if (is_null($m) or self::_m($substr) > $m)
+ if (is_null($m) or self::m($substr) > $m)
{
$str = $substr . $repl;
}
@@ -396,10 +396,10 @@ private static function _replace(&$str, $check, $repl, $m = null)
*
* @since 2.5
*/
- private static function _m($str)
+ private static function m($str)
{
- $c = self::$_regex_consonant;
- $v = self::$_regex_vowel;
+ $c = self::$regex_consonant;
+ $v = self::$regex_vowel;
$str = preg_replace("#^$c+#", '', $str);
$str = preg_replace("#$v+$#", '', $str);
@@ -419,9 +419,9 @@ private static function _m($str)
*
* @since 2.5
*/
- private static function _doubleConsonant($str)
+ private static function doubleConsonant($str)
{
- $c = self::$_regex_consonant;
+ $c = self::$regex_consonant;
return preg_match("#$c{2}$#", $str, $matches) and $matches[0]{0} == $matches[0]{1};
}
@@ -435,10 +435,10 @@ private static function _doubleConsonant($str)
*
* @since 2.5
*/
- private static function _cvc($str)
+ private static function cvc($str)
{
- $c = self::$_regex_consonant;
- $v = self::$_regex_vowel;
+ $c = self::$regex_consonant;
+ $v = self::$regex_vowel;
return preg_match("#($c$v$c)$#", $str, $matches) and strlen($matches[1]) == 3 and $matches[1]{2} != 'w' and $matches[1]{2} != 'x'
and $matches[1]{2} != 'y';
diff --git a/administrator/components/com_finder/helpers/indexer/taxonomy.php b/administrator/components/com_finder/helpers/indexer/taxonomy.php
index 447829d49f518..9a9c9a831a87e 100644
--- a/administrator/components/com_finder/helpers/indexer/taxonomy.php
+++ b/administrator/components/com_finder/helpers/indexer/taxonomy.php
@@ -47,9 +47,9 @@ class FinderIndexerTaxonomy
public static function addBranch($title, $state = 1, $access = 1)
{
// Check to see if the branch is in the cache.
- if (isset(self::$branches[$title]))
+ if (isset(static::$branches[$title]))
{
- return self::$branches[$title]->id;
+ return static::$branches[$title]->id;
}
// Check to see if the branch is in the table.
@@ -68,9 +68,9 @@ public static function addBranch($title, $state = 1, $access = 1)
if (!empty($result) && $result->state == $state && $result->access == $access)
{
// The data matches, add the item to the cache.
- self::$branches[$title] = $result;
+ static::$branches[$title] = $result;
- return self::$branches[$title]->id;
+ return static::$branches[$title]->id;
}
/*
@@ -100,12 +100,12 @@ public static function addBranch($title, $state = 1, $access = 1)
}
// Store the branch.
- self::storeNode($branch);
+ static::storeNode($branch);
// Add the branch to the cache.
- self::$branches[$title] = $branch;
+ static::$branches[$title] = $branch;
- return self::$branches[$title]->id;
+ return static::$branches[$title]->id;
}
/**
@@ -124,13 +124,13 @@ public static function addBranch($title, $state = 1, $access = 1)
public static function addNode($branch, $title, $state = 1, $access = 1)
{
// Check to see if the node is in the cache.
- if (isset(self::$nodes[$branch][$title]))
+ if (isset(static::$nodes[$branch][$title]))
{
- return self::$nodes[$branch][$title]->id;
+ return static::$nodes[$branch][$title]->id;
}
// Get the branch id, insert it if it does not exist.
- $branchId = self::addBranch($branch);
+ $branchId = static::addBranch($branch);
// Check to see if the node is in the table.
$db = JFactory::getDbo();
@@ -148,9 +148,9 @@ public static function addNode($branch, $title, $state = 1, $access = 1)
if (!empty($result) && $result->state == $state && $result->access == $access)
{
// The data matches, add the item to the cache.
- self::$nodes[$branch][$title] = $result;
+ static::$nodes[$branch][$title] = $result;
- return self::$nodes[$branch][$title]->id;
+ return static::$nodes[$branch][$title]->id;
}
/*
@@ -180,12 +180,12 @@ public static function addNode($branch, $title, $state = 1, $access = 1)
}
// Store the node.
- self::storeNode($node);
+ static::storeNode($node);
// Add the node to the cache.
- self::$nodes[$branch][$title] = $node;
+ static::$nodes[$branch][$title] = $node;
- return self::$nodes[$branch][$title]->id;
+ return static::$nodes[$branch][$title]->id;
}
/**
@@ -242,8 +242,7 @@ public static function getBranchTitles()
$db = JFactory::getDbo();
// Set user variables
- $user = JFactory::getUser();
- $groups = implode(',', $user->getAuthorisedViewLevels());
+ $groups = implode(',', JFactory::getUser()->getAuthorisedViewLevels());
// Create a query to get the taxonomy branch titles.
$query = $db->getQuery(true)
@@ -255,9 +254,8 @@ public static function getBranchTitles()
// Get the branch titles.
$db->setQuery($query);
- $results = $db->loadColumn();
- return $results;
+ return $db->loadColumn();
}
/**
@@ -276,8 +274,7 @@ public static function getNodeByTitle($branch, $title)
$db = JFactory::getDbo();
// Set user variables
- $user = JFactory::getUser();
- $groups = implode(',', $user->getAuthorisedViewLevels());
+ $groups = implode(',', JFactory::getUser()->getAuthorisedViewLevels());
// Create a query to get the node.
$query = $db->getQuery(true)
@@ -293,9 +290,8 @@ public static function getNodeByTitle($branch, $title)
// Get the node.
$db->setQuery($query, 0, 1);
- $result = $db->loadObject();
- return $result;
+ return $db->loadObject();
}
/**
diff --git a/administrator/components/com_finder/helpers/language.php b/administrator/components/com_finder/helpers/language.php
index b738729acc102..a7bf2103fbdd1 100644
--- a/administrator/components/com_finder/helpers/language.php
+++ b/administrator/components/com_finder/helpers/language.php
@@ -33,10 +33,8 @@ public static function branchPlural($branchName)
{
return 'PLG_FINDER_QUERY_FILTER_BRANCH_P_' . $return;
}
- else
- {
- return $branchName;
- }
+
+ return $branchName;
}
/**
@@ -93,8 +91,7 @@ public static function branchLanguageTitle($branchName)
*/
public static function loadComponentLanguage()
{
- $lang = JFactory::getLanguage();
- $lang->load('com_finder', JPATH_SITE);
+ JFactory::getLanguage()->load('com_finder', JPATH_SITE);
}
/**
diff --git a/administrator/components/com_finder/models/fields/directories.php b/administrator/components/com_finder/models/fields/directories.php
index 2ccb80d9d952f..a65657b02d3f9 100644
--- a/administrator/components/com_finder/models/fields/directories.php
+++ b/administrator/components/com_finder/models/fields/directories.php
@@ -12,7 +12,7 @@
JFormHelper::loadFieldClass('list');
// Load the base adapter.
-require_once JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php';
+JLoader::register('FinderIndexerAdapter', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php');
/**
* Renders a list of directories.
diff --git a/administrator/components/com_finder/models/filter.php b/administrator/components/com_finder/models/filter.php
index db7ff44ffd79b..9322e019a6ff2 100644
--- a/administrator/components/com_finder/models/filter.php
+++ b/administrator/components/com_finder/models/filter.php
@@ -50,7 +50,7 @@ protected function cleanCache($group = 'com_finder', $client_id = 1)
/**
* Method to get the filter data.
*
- * @return mixed The filter data.
+ * @return FinderTableFilter|boolean The filter data or false on a failure.
*
* @since 2.5
*/
@@ -99,7 +99,7 @@ public function getFilter()
* @param array $data Data for the form. [optional]
* @param boolean $loadData True if the form is to load its own data (default case), false if not. [optional]
*
- * @return mixed A JForm object on success, false on failure
+ * @return JForm|boolean A JForm object on success, false on failure
*
* @since 2.5
*/
diff --git a/administrator/components/com_finder/models/filters.php b/administrator/components/com_finder/models/filters.php
index 0a0dd21cab37a..ab1ee4c7d0229 100644
--- a/administrator/components/com_finder/models/filters.php
+++ b/administrator/components/com_finder/models/filters.php
@@ -22,7 +22,7 @@ class FinderModelFilters extends JModelList
* @param array $config An associative array of configuration settings. [optional]
*
* @since 2.5
- * @see JController
+ * @see JControllerLegacy
*/
public function __construct($config = array())
{
diff --git a/administrator/components/com_finder/models/index.php b/administrator/components/com_finder/models/index.php
index 2690f8376cbf2..152ae7e1524ee 100644
--- a/administrator/components/com_finder/models/index.php
+++ b/administrator/components/com_finder/models/index.php
@@ -38,7 +38,7 @@ class FinderModelIndex extends JModelList
* @param array $config An associative array of configuration settings. [optional]
*
* @since 2.5
- * @see JController
+ * @see JControllerLegacy
*/
public function __construct($config = array())
{
@@ -69,9 +69,7 @@ public function __construct($config = array())
*/
protected function canDelete($record)
{
- $user = JFactory::getUser();
-
- return $user->authorise('core.delete', $this->option);
+ return JFactory::getUser()->authorise('core.delete', $this->option);
}
/**
@@ -85,9 +83,7 @@ protected function canDelete($record)
*/
protected function canEditState($record)
{
- $user = JFactory::getUser();
-
- return $user->authorise('core.edit.state', $this->option);
+ return JFactory::getUser()->authorise('core.edit.state', $this->option);
}
/**
@@ -246,7 +242,7 @@ protected function getListQuery()
/**
* Method to get the state of the Smart Search plug-ins.
*
- * @return array Array of relevant plug-ins and whether they are enabled or not.
+ * @return array Array of relevant plug-ins and whether they are enabled or not.
*
* @since 2.5
*/
@@ -260,10 +256,8 @@ public function getPluginState()
->where($db->quoteName('folder') . ' IN (' . $db->quote('system') . ',' . $db->quote('content') . ')')
->where($db->quoteName('element') . ' = ' . $db->quote('finder'));
$db->setQuery($query);
- $db->execute();
- $plugins = $db->loadObjectList('name');
- return $plugins;
+ return $db->loadObjectList('name');
}
/**
diff --git a/administrator/components/com_finder/models/maps.php b/administrator/components/com_finder/models/maps.php
index c60e7383a4945..bd194b823cb06 100644
--- a/administrator/components/com_finder/models/maps.php
+++ b/administrator/components/com_finder/models/maps.php
@@ -22,7 +22,7 @@ class FinderModelMaps extends JModelList
* @param array $config An associative array of configuration settings. [optional]
*
* @since 2.5
- * @see JController
+ * @see JControllerLegacy
*/
public function __construct($config = array())
{
@@ -51,9 +51,7 @@ public function __construct($config = array())
*/
protected function canDelete($record)
{
- $user = JFactory::getUser();
-
- return $user->authorise('core.delete', $this->option);
+ return JFactory::getUser()->authorise('core.delete', $this->option);
}
/**
@@ -67,9 +65,7 @@ protected function canDelete($record)
*/
protected function canEditState($record)
{
- $user = JFactory::getUser();
-
- return $user->authorise('core.edit.state', $this->option);
+ return JFactory::getUser()->authorise('core.edit.state', $this->option);
}
/**
diff --git a/administrator/components/com_finder/models/statistics.php b/administrator/components/com_finder/models/statistics.php
index 045081d6579ae..6ef5f71df0342 100644
--- a/administrator/components/com_finder/models/statistics.php
+++ b/administrator/components/com_finder/models/statistics.php
@@ -19,7 +19,7 @@ class FinderModelStatistics extends JModelLegacy
/**
* Method to get the component statistics
*
- * @return object The component statistics
+ * @return JObject The component statistics
*
* @since 2.5
*/
@@ -60,7 +60,7 @@ public function getData()
->from($db->quoteName('#__finder_links') . ' AS a')
->join('INNER', $db->quoteName('#__finder_types') . ' AS t ON t.id = a.type_id')
->group('a.type_id, t.title')
- ->order($db->quoteName('type_title'), 'ASC');
+ ->order($db->quoteName('type_title') . ' ASC');
$db->setQuery($query);
$data->type_list = $db->loadObjectList();
diff --git a/administrator/components/com_finder/tables/filter.php b/administrator/components/com_finder/tables/filter.php
index 9b1ed5606faa7..cd8498f6a8370 100644
--- a/administrator/components/com_finder/tables/filter.php
+++ b/administrator/components/com_finder/tables/filter.php
@@ -204,15 +204,15 @@ public function publish($pks = null, $state = 1, $userId = 0)
*/
public function store($updateNulls = false)
{
- $date = JFactory::getDate();
- $user = JFactory::getUser();
+ $date = JFactory::getDate()->toSql();
+ $userId = JFactory::getUser()->id;
- $this->modified = $date->toSql();
+ $this->modified = $date;
if ($this->filter_id)
{
// Existing item
- $this->modified_by = $user->get('id');
+ $this->modified_by = $userId;
}
else
{
@@ -220,12 +220,12 @@ public function store($updateNulls = false)
// so we don't touch it if it is set.
if (!(int) $this->created)
{
- $this->created = $date->toSql();
+ $this->created = $date;
}
if (empty($this->created_by))
{
- $this->created_by = $user->get('id');
+ $this->created_by = $userId;
}
}
diff --git a/administrator/components/com_finder/views/filter/view.html.php b/administrator/components/com_finder/views/filter/view.html.php
index 2bd7166cc32c2..9e860095282ff 100644
--- a/administrator/components/com_finder/views/filter/view.html.php
+++ b/administrator/components/com_finder/views/filter/view.html.php
@@ -16,6 +16,34 @@
*/
class FinderViewFilter extends JViewLegacy
{
+ /**
+ * The filter object
+ *
+ * @var FinderTableFilter
+ */
+ protected $filter;
+
+ /**
+ * The JForm object
+ *
+ * @var JForm
+ */
+ protected $form;
+
+ /**
+ * The active item
+ *
+ * @var object
+ */
+ protected $item;
+
+ /**
+ * The model state
+ *
+ * @var object
+ */
+ protected $state;
+
/**
* Method to display the view.
*
@@ -48,7 +76,7 @@ public function display($tpl = null)
// Configure the toolbar.
$this->addToolbar();
- parent::display($tpl);
+ return parent::display($tpl);
}
/**
@@ -62,10 +90,8 @@ protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
- $user = JFactory::getUser();
- $userId = $user->get('id');
$isNew = ($this->item->filter_id == 0);
- $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
+ $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == JFactory::getUser()->id);
$canDo = JHelperContent::getActions('com_finder');
// Configure the toolbar.
diff --git a/administrator/components/com_finder/views/filters/view.html.php b/administrator/components/com_finder/views/filters/view.html.php
index c08a3269cf08d..1132f206a5f6c 100644
--- a/administrator/components/com_finder/views/filters/view.html.php
+++ b/administrator/components/com_finder/views/filters/view.html.php
@@ -16,6 +16,41 @@
*/
class FinderViewFilters extends JViewLegacy
{
+ /**
+ * An array of items
+ *
+ * @var array
+ */
+ protected $items;
+
+ /**
+ * The pagination object
+ *
+ * @var JPagination
+ */
+ protected $pagination;
+
+ /**
+ * The HTML markup for the sidebar
+ *
+ * @var string
+ */
+ protected $sidebar;
+
+ /**
+ * The model state
+ *
+ * @var object
+ */
+ protected $state;
+
+ /**
+ * The total number of items
+ *
+ * @var object
+ */
+ protected $total;
+
/**
* Method to display the view.
*
@@ -50,7 +85,8 @@ public function display($tpl = null)
// Configure the toolbar.
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render();
- parent::display($tpl);
+
+ return parent::display($tpl);
}
/**
diff --git a/administrator/components/com_finder/views/index/view.html.php b/administrator/components/com_finder/views/index/view.html.php
index 416da70630477..1e17aae42fa45 100644
--- a/administrator/components/com_finder/views/index/view.html.php
+++ b/administrator/components/com_finder/views/index/view.html.php
@@ -18,6 +18,48 @@
*/
class FinderViewIndex extends JViewLegacy
{
+ /**
+ * An array of items
+ *
+ * @var array
+ */
+ protected $items;
+
+ /**
+ * The pagination object
+ *
+ * @var JPagination
+ */
+ protected $pagination;
+
+ /**
+ * The state of core Smart Search plugins
+ *
+ * @var array
+ */
+ protected $pluginState;
+
+ /**
+ * The HTML markup for the sidebar
+ *
+ * @var string
+ */
+ protected $sidebar;
+
+ /**
+ * The model state
+ *
+ * @var object
+ */
+ protected $state;
+
+ /**
+ * The total number of items
+ *
+ * @var object
+ */
+ protected $total;
+
/**
* Method to display the view.
*
@@ -71,7 +113,8 @@ public function display($tpl = null)
// Configure the toolbar.
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render();
- parent::display($tpl);
+
+ return parent::display($tpl);
}
/**
diff --git a/administrator/components/com_finder/views/maps/view.html.php b/administrator/components/com_finder/views/maps/view.html.php
index f14f475eca76d..e3bf2fe3e7a50 100644
--- a/administrator/components/com_finder/views/maps/view.html.php
+++ b/administrator/components/com_finder/views/maps/view.html.php
@@ -18,6 +18,41 @@
*/
class FinderViewMaps extends JViewLegacy
{
+ /**
+ * An array of items
+ *
+ * @var array
+ */
+ protected $items;
+
+ /**
+ * The pagination object
+ *
+ * @var JPagination
+ */
+ protected $pagination;
+
+ /**
+ * The HTML markup for the sidebar
+ *
+ * @var string
+ */
+ protected $sidebar;
+
+ /**
+ * The model state
+ *
+ * @var object
+ */
+ protected $state;
+
+ /**
+ * The total number of items
+ *
+ * @var object
+ */
+ protected $total;
+
/**
* Method to display the view.
*
@@ -55,7 +90,8 @@ public function display($tpl = null)
// Prepare the view.
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render();
- parent::display($tpl);
+
+ return parent::display($tpl);
}
/**
@@ -70,7 +106,6 @@ protected function addToolbar()
$canDo = JHelperContent::getActions('com_finder');
JToolbarHelper::title(JText::_('COM_FINDER_MAPS_TOOLBAR_TITLE'), 'zoom-in finder');
- $toolbar = JToolbar::getInstance('toolbar');
if ($canDo->get('core.edit.state'))
{
@@ -85,7 +120,14 @@ protected function addToolbar()
}
JToolbarHelper::divider();
- $toolbar->appendButton('Popup', 'bars', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 350);
+ JToolbar::getInstance('toolbar')->appendButton(
+ 'Popup',
+ 'bars',
+ 'COM_FINDER_STATISTICS',
+ 'index.php?option=com_finder&view=statistics&tmpl=component',
+ 550,
+ 350
+ );
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_CONTENT_MAPS');
diff --git a/administrator/components/com_finder/views/statistics/view.html.php b/administrator/components/com_finder/views/statistics/view.html.php
index 46271af2585fc..6f72e5d0aa81d 100644
--- a/administrator/components/com_finder/views/statistics/view.html.php
+++ b/administrator/components/com_finder/views/statistics/view.html.php
@@ -16,6 +16,13 @@
*/
class FinderViewStatistics extends JViewLegacy
{
+ /**
+ * The index statistics
+ *
+ * @var JObject
+ */
+ protected $data;
+
/**
* Method to display the view.
*
@@ -38,6 +45,6 @@ public function display($tpl = null)
return false;
}
- parent::display($tpl);
+ return parent::display($tpl);
}
}
diff --git a/administrator/components/com_installer/controller.php b/administrator/components/com_installer/controller.php
index 6d4e23659050d..e7484b522e8fd 100644
--- a/administrator/components/com_installer/controller.php
+++ b/administrator/components/com_installer/controller.php
@@ -28,7 +28,7 @@ class InstallerController extends JControllerLegacy
*/
public function display($cachable = false, $urlparams = false)
{
- require_once JPATH_ADMINISTRATOR . '/components/com_installer/helpers/installer.php';
+ JLoader::register('InstallerHelper', JPATH_ADMINISTRATOR . '/components/com_installer/helpers/installer.php');
// Get the document object.
$document = JFactory::getDocument();
diff --git a/administrator/components/com_installer/models/database.php b/administrator/components/com_installer/models/database.php
index 808991ea4615e..b4dc2e3ec3a88 100644
--- a/administrator/components/com_installer/models/database.php
+++ b/administrator/components/com_installer/models/database.php
@@ -167,7 +167,11 @@ public function fixSchemaVersion($changeSet)
->values('700, ' . $db->quote($schema));
$db->setQuery($query);
- if (!$db->execute())
+ try
+ {
+ $db->execute();
+ }
+ catch (JDatabaseExceptionExecuting $e)
{
return false;
}
diff --git a/administrator/components/com_installer/models/discover.php b/administrator/components/com_installer/models/discover.php
index 2b02c55e4925b..5dda01ec9f0a1 100644
--- a/administrator/components/com_installer/models/discover.php
+++ b/administrator/components/com_installer/models/discover.php
@@ -9,7 +9,7 @@
defined('_JEXEC') or die;
-require_once __DIR__ . '/extension.php';
+JLoader::register('InstallerModel', __DIR__ . '/extension.php');
/**
* Installer Discover Model
@@ -237,7 +237,11 @@ public function purge()
->where($db->quoteName('state') . ' = -1');
$db->setQuery($query);
- if (!$db->execute())
+ try
+ {
+ $db->execute();
+ }
+ catch (JDatabaseExceptionExecuting $e)
{
$this->_message = JText::_('COM_INSTALLER_MSG_DISCOVER_FAILEDTOPURGEEXTENSIONS');
diff --git a/administrator/components/com_installer/models/fields/extensionstatus.php b/administrator/components/com_installer/models/fields/extensionstatus.php
index f9965d5eb5a5b..1a6ef20416835 100644
--- a/administrator/components/com_installer/models/fields/extensionstatus.php
+++ b/administrator/components/com_installer/models/fields/extensionstatus.php
@@ -11,7 +11,7 @@
JFormHelper::loadFieldClass('list');
-require_once __DIR__ . '/../../helpers/installer.php';
+JLoader::register('InstallerHelper', JPATH_ADMINISTRATOR . '/components/com_installer/helpers/installer.php');
/**
* Status Field class for the Joomla Framework.
diff --git a/administrator/components/com_installer/models/fields/folder.php b/administrator/components/com_installer/models/fields/folder.php
index c73d8007c5493..08dbfd35fd24a 100644
--- a/administrator/components/com_installer/models/fields/folder.php
+++ b/administrator/components/com_installer/models/fields/folder.php
@@ -11,7 +11,7 @@
JFormHelper::loadFieldClass('list');
-require_once __DIR__ . '/../../helpers/installer.php';
+JLoader::register('InstallerHelper', JPATH_ADMINISTRATOR . '/components/com_installer/helpers/installer.php');
/**
* Folder Field class for the Joomla Framework.
diff --git a/administrator/components/com_installer/models/fields/location.php b/administrator/components/com_installer/models/fields/location.php
index cf440c2a1cdea..a73177b668000 100644
--- a/administrator/components/com_installer/models/fields/location.php
+++ b/administrator/components/com_installer/models/fields/location.php
@@ -11,7 +11,7 @@
JFormHelper::loadFieldClass('list');
-require_once __DIR__ . '/../../helpers/installer.php';
+JLoader::register('InstallerHelper', JPATH_ADMINISTRATOR . '/components/com_installer/helpers/installer.php');
/**
* Location Field class for the Joomla Framework.
diff --git a/administrator/components/com_installer/models/fields/type.php b/administrator/components/com_installer/models/fields/type.php
index bb2e72b2d65dc..e3f01db143824 100644
--- a/administrator/components/com_installer/models/fields/type.php
+++ b/administrator/components/com_installer/models/fields/type.php
@@ -11,7 +11,7 @@
JFormHelper::loadFieldClass('list');
-require_once __DIR__ . '/../../helpers/installer.php';
+JLoader::register('InstallerHelper', JPATH_ADMINISTRATOR . '/components/com_installer/helpers/installer.php');
/**
* Type Field class for the Joomla Framework.
diff --git a/administrator/components/com_installer/models/manage.php b/administrator/components/com_installer/models/manage.php
index cdd9b0486bf5f..b4490328e0760 100644
--- a/administrator/components/com_installer/models/manage.php
+++ b/administrator/components/com_installer/models/manage.php
@@ -9,7 +9,7 @@
defined('_JEXEC') or die;
-require_once __DIR__ . '/extension.php';
+JLoader::register('InstallerModel', __DIR__ . '/extension.php');
/**
* Installer Manage Model
diff --git a/administrator/components/com_installer/models/update.php b/administrator/components/com_installer/models/update.php
index f75fe9c3868ac..6da398fb846bd 100644
--- a/administrator/components/com_installer/models/update.php
+++ b/administrator/components/com_installer/models/update.php
@@ -277,7 +277,11 @@ public function purge()
// This may or may not mean depending on your database
$db->setQuery('TRUNCATE TABLE #__updates');
- if (!$db->execute())
+ try
+ {
+ $db->execute();
+ }
+ catch (JDatabaseExceptionExecuting $e)
{
$this->_message = JText::_('JLIB_INSTALLER_FAILED_TO_PURGE_UPDATES');
@@ -311,7 +315,11 @@ public function enableSites()
->where($db->quoteName('enabled') . ' = 0');
$db->setQuery($query);
- if (!$db->execute())
+ try
+ {
+ $db->execute();
+ }
+ catch (JDatabaseExceptionExecuting $e)
{
$this->_message .= JText::_('COM_INSTALLER_FAILED_TO_ENABLE_UPDATES');
diff --git a/administrator/components/com_installer/models/updatesites.php b/administrator/components/com_installer/models/updatesites.php
index d806da9bcf8fe..9532dbb683880 100644
--- a/administrator/components/com_installer/models/updatesites.php
+++ b/administrator/components/com_installer/models/updatesites.php
@@ -9,14 +9,12 @@
defined('_JEXEC') or die;
-require_once __DIR__ . '/extension.php';
+JLoader::register('InstallerModel', __DIR__ . '/extension.php');
/**
* Installer Update Sites Model
*
- * @package Joomla.Administrator
- * @subpackage com_installer
- * @since 3.4
+ * @since 3.4
*/
class InstallerModelUpdatesites extends InstallerModel
{
@@ -86,9 +84,7 @@ protected function populateState($ordering = 'name', $direction = 'asc')
*/
public function publish(&$eid = array(), $value = 1)
{
- $user = JFactory::getUser();
-
- if (!$user->authorise('core.edit.state', 'com_installer'))
+ if (!JFactory::getUser()->authorise('core.edit.state', 'com_installer'))
{
throw new Exception(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'), 403);
}
@@ -133,9 +129,7 @@ public function publish(&$eid = array(), $value = 1)
*/
public function delete($ids = array())
{
- $user = JFactory::getUser();
-
- if (!$user->authorise('core.delete', 'com_installer'))
+ if (!JFactory::getUser()->authorise('core.delete', 'com_installer'))
{
throw new Exception(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'), 403);
}
@@ -160,7 +154,7 @@ public function delete($ids = array())
$updateSitesNames = $db->loadObjectList('update_site_id');
// Gets Joomla core update sites Ids.
- $joomlaUpdateSitesIds = $this->getJoomlaUpdateSitesIds();
+ $joomlaUpdateSitesIds = $this->getJoomlaUpdateSitesIds(0);
// Enable the update site in the table and store it in the database
foreach ($ids as $i => $id)
@@ -218,9 +212,7 @@ public function delete($ids = array())
*/
public function rebuild()
{
- $user = JFactory::getUser();
-
- if (!$user->authorise('core.admin', 'com_installer'))
+ if (!JFactory::getUser()->authorise('core.admin', 'com_installer'))
{
throw new Exception(JText::_('COM_INSTALLER_MSG_UPDATESITES_REBUILD_NOT_PERMITTED'), 403);
}
@@ -228,6 +220,25 @@ public function rebuild()
$db = JFactory::getDbo();
$app = JFactory::getApplication();
+ // Check if Joomla Extension plugin is enabled.
+ if (!JPluginHelper::isEnabled('extension', 'joomla'))
+ {
+ $query = $db->getQuery(true)
+ ->select($db->quoteName('extension_id'))
+ ->from($db->quoteName('#__extensions'))
+ ->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
+ ->where($db->quoteName('element') . ' = ' . $db->quote('joomla'))
+ ->where($db->quoteName('folder') . ' = ' . $db->quote('extension'));
+ $db->setQuery($query);
+
+ $pluginId = (int) $db->loadResult();
+
+ $link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . $pluginId);
+ $app->enqueueMessage(JText::sprintf('COM_INSTALLER_MSG_UPDATESITES_REBUILD_EXTENSION_PLUGIN_NOT_ENABLED', $link), 'error');
+
+ return;
+ }
+
$clients = array(JPATH_SITE, JPATH_ADMINISTRATOR);
$extensionGroupFolders = array('components', 'modules', 'plugins', 'templates', 'language', 'manifests');
@@ -262,29 +273,32 @@ public function rebuild()
}
// Gets Joomla core update sites Ids.
- $joomlaUpdateSitesIds = implode(', ', $this->getJoomlaUpdateSitesIds());
+ $joomlaUpdateSitesIds = implode(', ', $this->getJoomlaUpdateSitesIds(0));
// Delete from all tables (except joomla core update sites).
$query = $db->getQuery(true)
- ->delete($db->qn('#__update_sites'))
- ->where($db->qn('update_site_id') . ' NOT IN (' . $joomlaUpdateSitesIds . ')');
+ ->delete($db->quoteName('#__update_sites'))
+ ->where($db->quoteName('update_site_id') . ' NOT IN (' . $joomlaUpdateSitesIds . ')');
$db->setQuery($query);
$db->execute();
$query = $db->getQuery(true)
- ->delete($db->qn('#__update_sites_extensions'))
- ->where($db->qn('update_site_id') . ' NOT IN (' . $joomlaUpdateSitesIds . ')');
+ ->delete($db->quoteName('#__update_sites_extensions'))
+ ->where($db->quoteName('update_site_id') . ' NOT IN (' . $joomlaUpdateSitesIds . ')');
$db->setQuery($query);
$db->execute();
$query = $db->getQuery(true)
- ->delete($db->qn('#__updates'))
- ->where($db->qn('update_site_id') . ' NOT IN (' . $joomlaUpdateSitesIds . ')');
+ ->delete($db->quoteName('#__updates'))
+ ->where($db->quoteName('update_site_id') . ' NOT IN (' . $joomlaUpdateSitesIds . ')');
$db->setQuery($query);
$db->execute();
$count = 0;
+ // Gets Joomla core extension Ids.
+ $joomlaCoreExtensionIds = implode(', ', $this->getJoomlaUpdateSitesIds(1));
+
// Search for updateservers in manifest files inside the folders to search.
foreach ($pathsToSearch as $extensionFolderPath)
{
@@ -310,13 +324,16 @@ public function rebuild()
if (!is_null($manifest))
{
+ // Search if the extension exists in the extensions table. Excluding joomla core extensions (id < 10000) and discovered extensions.
$query = $db->getQuery(true)
- ->select($db->qn('extension_id'))
- ->from($db->qn('#__extensions'))
- ->where($db->qn('name') . ' = ' . $db->q($manifest->name))
- ->where($db->qn('type') . ' = ' . $db->q($manifest['type']))
- ->where($db->qn('state') . ' != -1');
+ ->select($db->quoteName('extension_id'))
+ ->from($db->quoteName('#__extensions'))
+ ->where($db->quoteName('name') . ' = ' . $db->quote($manifest->name))
+ ->where($db->quoteName('type') . ' = ' . $db->quote($manifest['type']))
+ ->where($db->quoteName('extension_id') . ' NOT IN (' . $joomlaCoreExtensionIds . ')')
+ ->where($db->quoteName('state') . ' != -1');
$db->setQuery($query);
+
$eid = (int) $db->loadResult();
if ($eid && $manifest->updateservers)
@@ -351,22 +368,31 @@ public function rebuild()
/**
* Fetch the Joomla update sites ids.
*
+ * @param integer $column Column to return. 0 for update site ids, 1 for extension ids.
+ *
* @return array Array with joomla core update site ids.
*
- * @since 3.6
+ * @since 3.6.0
*/
- protected function getJoomlaUpdateSitesIds()
+ protected function getJoomlaUpdateSitesIds($column = 0)
{
$db = JFactory::getDbo();
- // Fetch the Joomla core Joomla update sites ids.
- $query = $db->getQuery(true);
- $query->select($db->qn('update_site_id'))
- ->from($db->qn('#__update_sites'))
- ->where($db->qn('location') . ' LIKE \'%update.joomla.org%\'');
+ // Fetch the Joomla core update sites ids and their extension ids. We search for all except the core joomla extension with update sites.
+ $query = $db->getQuery(true)
+ ->select($db->quoteName(array('use.update_site_id', 'e.extension_id')))
+ ->from($db->quoteName('#__update_sites_extensions', 'use'))
+ ->join('LEFT', $db->quoteName('#__update_sites', 'us') . ' ON ' . $db->qn('us.update_site_id') . ' = ' . $db->qn('use.update_site_id'))
+ ->join('LEFT', $db->quoteName('#__extensions', 'e') . ' ON ' . $db->qn('e.extension_id') . ' = ' . $db->qn('use.extension_id'))
+ ->where('('
+ . '(' . $db->qn('e.type') . ' = ' . $db->quote('file') . ' AND ' . $db->qn('e.element') . ' = ' . $db->quote('joomla') . ')'
+ . ' OR (' . $db->qn('e.type') . ' = ' . $db->quote('package') . ' AND ' . $db->qn('e.element') . ' = ' . $db->quote('pkg_en-GB') . ')'
+ . ' OR (' . $db->qn('e.type') . ' = ' . $db->quote('component') . ' AND ' . $db->qn('e.element') . ' = ' . $db->quote('com_joomlaupdate') . ')'
+ . ')');
+
$db->setQuery($query);
- return $db->loadColumn();
+ return $db->loadColumn($column);
}
/**
diff --git a/administrator/components/com_installer/views/database/view.html.php b/administrator/components/com_installer/views/database/view.html.php
index 733134cfdf632..935b82ca0496a 100644
--- a/administrator/components/com_installer/views/database/view.html.php
+++ b/administrator/components/com_installer/views/database/view.html.php
@@ -9,7 +9,7 @@
defined('_JEXEC') or die;
-include_once __DIR__ . '/../default/view.php';
+JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php');
/**
* Extension Manager Manage View
@@ -60,14 +60,13 @@ public function display($tpl = null)
$this->errorCount++;
}
- // Check error count
if ($this->errorCount === 0)
{
$app->enqueueMessage(JText::_('COM_INSTALLER_MSG_DATABASE_OK'), 'notice');
}
else
{
- $app->enqueueMessage(JText::_('COM_INSTALLER_MSG_DATABASE_ERRORS'), 'error');
+ $app->enqueueMessage(JText::_('COM_INSTALLER_MSG_DATABASE_ERRORS'), 'warning');
}
parent::display($tpl);
diff --git a/administrator/components/com_installer/views/discover/view.html.php b/administrator/components/com_installer/views/discover/view.html.php
index 4600284f17159..c7b312583a29f 100644
--- a/administrator/components/com_installer/views/discover/view.html.php
+++ b/administrator/components/com_installer/views/discover/view.html.php
@@ -9,7 +9,7 @@
defined('_JEXEC') or die;
-include_once __DIR__ . '/../default/view.php';
+JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php');
/**
* Extension Manager Discover View
diff --git a/administrator/components/com_installer/views/install/tmpl/default.php b/administrator/components/com_installer/views/install/tmpl/default.php
index 2fbb105acf47e..31dd50f68985f 100644
--- a/administrator/components/com_installer/views/install/tmpl/default.php
+++ b/administrator/components/com_installer/views/install/tmpl/default.php
@@ -104,8 +104,8 @@
diff --git a/administrator/components/com_installer/views/install/view.html.php b/administrator/components/com_installer/views/install/view.html.php
index c61c838919232..1ede88a5fc87d 100644
--- a/administrator/components/com_installer/views/install/view.html.php
+++ b/administrator/components/com_installer/views/install/view.html.php
@@ -9,7 +9,7 @@
defined('_JEXEC') or die;
-include_once __DIR__ . '/../default/view.php';
+JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php');
/**
* Extension Manager Install View
diff --git a/administrator/components/com_installer/views/languages/view.html.php b/administrator/components/com_installer/views/languages/view.html.php
index 0ffb1b9e836c8..59cb4b5113543 100644
--- a/administrator/components/com_installer/views/languages/view.html.php
+++ b/administrator/components/com_installer/views/languages/view.html.php
@@ -9,7 +9,7 @@
defined('_JEXEC') or die;
-include_once __DIR__ . '/../default/view.php';
+JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php');
/**
* Language installer view
diff --git a/administrator/components/com_installer/views/manage/view.html.php b/administrator/components/com_installer/views/manage/view.html.php
index 95807df3a5a30..7bfa0b6bfd55e 100644
--- a/administrator/components/com_installer/views/manage/view.html.php
+++ b/administrator/components/com_installer/views/manage/view.html.php
@@ -9,7 +9,7 @@
defined('_JEXEC') or die;
-include_once __DIR__ . '/../default/view.php';
+JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php');
/**
* Extension Manager Manage View
diff --git a/administrator/components/com_installer/views/update/view.html.php b/administrator/components/com_installer/views/update/view.html.php
index 325e3a5a91b8a..00559a1a7c76b 100644
--- a/administrator/components/com_installer/views/update/view.html.php
+++ b/administrator/components/com_installer/views/update/view.html.php
@@ -9,7 +9,7 @@
defined('_JEXEC') or die;
-include_once __DIR__ . '/../default/view.php';
+JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php');
/**
* Extension Manager Update View
diff --git a/administrator/components/com_installer/views/updatesites/view.html.php b/administrator/components/com_installer/views/updatesites/view.html.php
index 66087e240c031..5b377d4d9af7d 100644
--- a/administrator/components/com_installer/views/updatesites/view.html.php
+++ b/administrator/components/com_installer/views/updatesites/view.html.php
@@ -9,7 +9,7 @@
defined('_JEXEC') or die;
-include_once __DIR__ . '/../default/view.php';
+JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php');
/**
* Extension Manager Update Sites View
diff --git a/administrator/components/com_installer/views/warnings/view.html.php b/administrator/components/com_installer/views/warnings/view.html.php
index 5cee0fc778fa7..b8370dbb11845 100644
--- a/administrator/components/com_installer/views/warnings/view.html.php
+++ b/administrator/components/com_installer/views/warnings/view.html.php
@@ -9,7 +9,7 @@
defined('_JEXEC') or die;
-include_once __DIR__ . '/../default/view.php';
+JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php');
/**
* Extension Manager Templates View
diff --git a/administrator/components/com_joomlaupdate/controller.php b/administrator/components/com_joomlaupdate/controller.php
index 1040f51a948f9..b9831e34d0bd6 100644
--- a/administrator/components/com_joomlaupdate/controller.php
+++ b/administrator/components/com_joomlaupdate/controller.php
@@ -47,10 +47,7 @@ public function display($cachable = false, $urlparams = false)
$model = $this->getModel('default');
// Push the Installer Warnings model into the view, if we can load it
- if (!class_exists('InstallerModelWarnings'))
- {
- @include_once JPATH_ADMINISTRATOR . '/components/com_installer/models/warnings.php';
- }
+ static::addModelPath(JPATH_ADMINISTRATOR . '/components/com_installer/models', 'InstallerModel');
$warningsModel = $this->getModel('warnings', 'InstallerModel');
diff --git a/administrator/components/com_joomlaupdate/restore.php b/administrator/components/com_joomlaupdate/restore.php
index 71b248d3658a2..1b5256508c05f 100644
--- a/administrator/components/com_joomlaupdate/restore.php
+++ b/administrator/components/com_joomlaupdate/restore.php
@@ -2056,14 +2056,14 @@ protected abstract function readArchiveHeader();
/**
* Concrete classes must use this method to read the file header
- * @return bool True if reading the file was successful, false if an error occured or we reached end of archive
+ * @return bool True if reading the file was successful, false if an error occurred or we reached end of archive
*/
protected abstract function readFileHeader();
/**
* Concrete classes must use this method to process file data. It must set $runState to AK_STATE_DATAREAD when
* it's finished processing the file data.
- * @return bool True if processing the file data was successful, false if an error occured
+ * @return bool True if processing the file data was successful, false if an error occurred
*/
protected abstract function processFileData();
@@ -4323,7 +4323,7 @@ protected function readArchiveHeader()
/**
* Concrete classes must use this method to read the file header
- * @return bool True if reading the file was successful, false if an error occured or we reached end of archive
+ * @return bool True if reading the file was successful, false if an error occurred or we reached end of archive
*/
protected function readFileHeader()
{
@@ -4576,7 +4576,7 @@ protected function readFileHeader()
/**
* Concrete classes must use this method to process file data. It must set $runState to AK_STATE_DATAREAD when
* it's finished processing the file data.
- * @return bool True if processing the file data was successful, false if an error occured
+ * @return bool True if processing the file data was successful, false if an error occurred
*/
protected function processFileData()
{
@@ -4632,7 +4632,7 @@ private function processTypeFileUncompressed()
// Can we write to the file?
if( ($outfp === false) && (!$ignore) ) {
- // An error occured
+ // An error occurred
debugMsg('Could not write to output file');
$this->setError( AKText::sprintf('COULDNT_WRITE_FILE', $this->fileHeader->realFile) );
return false;
@@ -4714,7 +4714,7 @@ private function processTypeFileCompressedSimple()
// Can we write to the file?
$ignore = AKFactory::get('kickstart.setup.ignoreerrors', false) || $this->isIgnoredDirectory($this->fileHeader->file);
if( ($outfp === false) && (!$ignore) ) {
- // An error occured
+ // An error occurred
debugMsg('Could not write to output file');
$this->setError( AKText::sprintf('COULDNT_WRITE_FILE', $this->fileHeader->realFile) );
return false;
@@ -4964,7 +4964,7 @@ protected function readArchiveHeader()
/**
* Concrete classes must use this method to read the file header
- * @return bool True if reading the file was successful, false if an error occured or we reached end of archive
+ * @return bool True if reading the file was successful, false if an error occurred or we reached end of archive
*/
protected function readFileHeader()
{
@@ -5260,7 +5260,7 @@ protected function readArchiveHeader()
/**
* Concrete classes must use this method to read the file header
- * @return bool True if reading the file was successful, false if an error occured or we reached end of archive
+ * @return bool True if reading the file was successful, false if an error occurred or we reached end of archive
*/
protected function readFileHeader()
{
@@ -5485,7 +5485,7 @@ protected function readFileHeader()
/**
* Concrete classes must use this method to process file data. It must set $runState to AK_STATE_DATAREAD when
* it's finished processing the file data.
- * @return bool True if processing the file data was successful, false if an error occured
+ * @return bool True if processing the file data was successful, false if an error occurred
*/
protected function processFileData()
{
@@ -5537,7 +5537,7 @@ private function processTypeFileUncompressed()
// Can we write to the file?
if( ($outfp === false) && (!$ignore) ) {
- // An error occured
+ // An error occurred
$this->setError( AKText::sprintf('COULDNT_WRITE_FILE', $this->fileHeader->realFile) );
return false;
}
@@ -5580,7 +5580,7 @@ private function processTypeFileCompressedSimple()
// Can we write to the file?
$ignore = AKFactory::get('kickstart.setup.ignoreerrors', false) || $this->isIgnoredDirectory($this->fileHeader->file);
if( ($outfp === false) && (!$ignore) ) {
- // An error occured
+ // An error occurred
$this->setError( AKText::sprintf('COULDNT_WRITE_FILE', $this->fileHeader->realFile) );
return false;
}
@@ -6208,7 +6208,7 @@ class AKText extends AKAbstractObject
'BTN_SITEFE' => 'Visit your site\'s front-end',
'BTN_SITEBE' => 'Visit your site\'s back-end',
'WARNINGS' => 'Extraction Warnings',
- 'ERROR_OCCURED' => 'An error occured',
+ 'ERROR_OCCURED' => 'An error occurred',
'STEALTH_MODE' => 'Stealth mode',
'STEALTH_URL' => 'HTML file to show to web visitors',
'ERR_NOT_A_JPS_FILE' => 'The file is not a JPA archive',
diff --git a/administrator/components/com_joomlaupdate/views/upload/tmpl/captive.php b/administrator/components/com_joomlaupdate/views/upload/tmpl/captive.php
index 0ae0824514e74..2c32d13755848 100644
--- a/administrator/components/com_joomlaupdate/views/upload/tmpl/captive.php
+++ b/administrator/components/com_joomlaupdate/views/upload/tmpl/captive.php
@@ -12,7 +12,7 @@
JHtml::_('behavior.keepalive');
JHtml::_('bootstrap.tooltip');
-require_once JPATH_ADMINISTRATOR . '/modules/mod_login/helper.php';
+JLoader::register('ModLoginHelper', JPATH_ADMINISTRATOR . '/modules/mod_login/helper.php');
$twofactormethods = ModLoginHelper::getTwoFactorMethods();
diff --git a/administrator/components/com_languages/controller.php b/administrator/components/com_languages/controller.php
index 564ba304a1ee6..f22c151d76a8b 100644
--- a/administrator/components/com_languages/controller.php
+++ b/administrator/components/com_languages/controller.php
@@ -28,13 +28,13 @@ class LanguagesController extends JControllerLegacy
* @param boolean $cachable If true, the view output will be cached.
* @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
- * @return JController This object to support chaining.
+ * @return LanguagesController This object to support chaining.
*
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
- require_once JPATH_COMPONENT . '/helpers/languages.php';
+ JLoader::register('LanguagesHelper', JPATH_ADMINISTRATOR . '/components/com_languages/helpers/languages.php');
$view = $this->input->get('view', 'languages');
$layout = $this->input->get('layout', 'default');
@@ -51,8 +51,6 @@ public function display($cachable = false, $urlparams = false)
return false;
}
- parent::display();
-
- return $this;
+ return parent::display();
}
}
diff --git a/administrator/components/com_languages/controllers/languages.php b/administrator/components/com_languages/controllers/languages.php
index 8b15403e17212..fb440e4535ae3 100644
--- a/administrator/components/com_languages/controllers/languages.php
+++ b/administrator/components/com_languages/controllers/languages.php
@@ -29,9 +29,7 @@ class LanguagesControllerLanguages extends JControllerAdmin
*/
public function getModel($name = 'Language', $prefix = 'LanguagesModel', $config = array('ignore_request' => true))
{
- $model = parent::getModel($name, $prefix, $config);
-
- return $model;
+ return parent::getModel($name, $prefix, $config);
}
/**
diff --git a/administrator/components/com_languages/controllers/override.php b/administrator/components/com_languages/controllers/override.php
index 0c6c67f02c36e..950284e448c84 100644
--- a/administrator/components/com_languages/controllers/override.php
+++ b/administrator/components/com_languages/controllers/override.php
@@ -94,7 +94,7 @@ public function save($key = null, $urlVar = null)
}
// Require helper for filter functions called by JForm.
- require_once JPATH_COMPONENT . '/helpers/languages.php';
+ JLoader::register('LanguagesHelper', JPATH_ADMINISTRATOR . '/components/com_languages/helpers/languages.php');
// Test whether the data is valid.
$validData = $model->validate($form, $data);
diff --git a/administrator/components/com_languages/models/override.php b/administrator/components/com_languages/models/override.php
index bf3f5825e8706..4801d05690569 100644
--- a/administrator/components/com_languages/models/override.php
+++ b/administrator/components/com_languages/models/override.php
@@ -89,7 +89,7 @@ protected function loadFormData()
*/
public function getItem($pk = null)
{
- require_once JPATH_COMPONENT . '/helpers/languages.php';
+ JLoader::register('LanguagesHelper', JPATH_ADMINISTRATOR . '/components/com_languages/helpers/languages.php');
$input = JFactory::getApplication()->input;
$pk = (!empty($pk)) ? $pk : $input->get('id');
@@ -122,10 +122,11 @@ public function getItem($pk = null)
*/
public function save($data, $opposite_client = false)
{
- $app = JFactory::getApplication();
- require_once JPATH_COMPONENT . '/helpers/languages.php';
+ JLoader::register('LanguagesHelper', JPATH_ADMINISTRATOR . '/components/com_languages/helpers/languages.php');
jimport('joomla.filesystem.file');
+ $app = JFactory::getApplication();
+
$client = $app->getUserState('com_languages.overrides.filter.client', 0);
$language = $app->getUserState('com_languages.overrides.filter.language', 'en-GB');
diff --git a/administrator/components/com_languages/models/overrides.php b/administrator/components/com_languages/models/overrides.php
index bf762651686b7..5b4ebc2b9a8db 100644
--- a/administrator/components/com_languages/models/overrides.php
+++ b/administrator/components/com_languages/models/overrides.php
@@ -232,7 +232,7 @@ public function getLanguages()
*
* @param array $cids Array of keys to delete.
*
- * @return integer Number of successfully deleted overrides, boolean false if an error occured.
+ * @return integer Number of successfully deleted overrides, boolean false if an error occurred.
*
* @since 2.5
*/
@@ -247,7 +247,7 @@ public function delete($cids)
}
jimport('joomla.filesystem.file');
- require_once JPATH_COMPONENT . '/helpers/languages.php';
+ JLoader::register('LanguagesHelper', JPATH_ADMINISTRATOR . '/components/com_languages/helpers/languages.php');
$filterclient = JFactory::getApplication()->getUserState('com_languages.overrides.filter.client');
$client = $filterclient == 0 ? 'SITE' : 'ADMINISTRATOR';
diff --git a/administrator/components/com_languages/models/strings.php b/administrator/components/com_languages/models/strings.php
index fbe38bba778b5..42395b2344ce6 100644
--- a/administrator/components/com_languages/models/strings.php
+++ b/administrator/components/com_languages/models/strings.php
@@ -25,7 +25,7 @@ class LanguagesModelStrings extends JModelLegacy
*/
public function refresh()
{
- require_once JPATH_COMPONENT . '/helpers/languages.php';
+ JLoader::register('LanguagesHelper', JPATH_ADMINISTRATOR . '/components/com_languages/helpers/languages.php');
$app = JFactory::getApplication();
diff --git a/administrator/components/com_languages/views/language/view.html.php b/administrator/components/com_languages/views/language/view.html.php
index 6aa594d2a3884..07471d5876922 100644
--- a/administrator/components/com_languages/views/language/view.html.php
+++ b/administrator/components/com_languages/views/language/view.html.php
@@ -57,7 +57,7 @@ public function display($tpl = null)
*/
protected function addToolbar()
{
- require_once JPATH_COMPONENT . '/helpers/languages.php';
+ JLoader::register('LanguagesHelper', JPATH_ADMINISTRATOR . '/components/com_languages/helpers/languages.php');
JFactory::getApplication()->input->set('hidemainmenu', 1);
$isNew = empty($this->item->lang_id);
diff --git a/administrator/components/com_languages/views/multilangstatus/view.html.php b/administrator/components/com_languages/views/multilangstatus/view.html.php
index 7062e2131b144..1e33e60e97425 100644
--- a/administrator/components/com_languages/views/multilangstatus/view.html.php
+++ b/administrator/components/com_languages/views/multilangstatus/view.html.php
@@ -25,7 +25,7 @@ class LanguagesViewMultilangstatus extends JViewLegacy
*/
public function display($tpl = null)
{
- require_once JPATH_COMPONENT . '/helpers/multilangstatus.php';
+ JLoader::register('MultilangstatusHelper', JPATH_ADMINISTRATOR . '/components/com_languages/helpers/multilangstatus.php');
$this->homes = MultilangstatusHelper::getHomes();
$this->language_filter = JLanguageMultilang::isEnabled();
diff --git a/administrator/components/com_media/media.php b/administrator/components/com_media/media.php
index 10177130b20a8..2071beeb163ee 100644
--- a/administrator/components/com_media/media.php
+++ b/administrator/components/com_media/media.php
@@ -26,7 +26,7 @@
$params = JComponentHelper::getParams('com_media');
// Load the helper class
-require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/media.php';
+JLoader::register('MediaHelper', JPATH_ADMINISTRATOR . '/components/com_media/helpers/media.php');
// Set the path definitions
$popup_upload = $input->get('pop_up', null);
diff --git a/administrator/components/com_media/views/images/tmpl/default.php b/administrator/components/com_media/views/images/tmpl/default.php
index eef3d264c12db..7bf956c0bf84f 100644
--- a/administrator/components/com_media/views/images/tmpl/default.php
+++ b/administrator/components/com_media/views/images/tmpl/default.php
@@ -55,8 +55,8 @@
-
-
+
@@ -150,7 +150,7 @@
diff --git a/administrator/components/com_media/views/media/tmpl/default.php b/administrator/components/com_media/views/media/tmpl/default.php
index bcf405961f0ab..08478c97c1694 100644
--- a/administrator/components/com_media/views/media/tmpl/default.php
+++ b/administrator/components/com_media/views/media/tmpl/default.php
@@ -87,7 +87,7 @@
- escape($item->menutype); ?>
+ escape($item->menutype_title); ?>
type == 'component') : ?>
diff --git a/administrator/components/com_menus/views/items/view.html.php b/administrator/components/com_menus/views/items/view.html.php
index 065d587cd9550..e4c2012869f0f 100644
--- a/administrator/components/com_menus/views/items/view.html.php
+++ b/administrator/components/com_menus/views/items/view.html.php
@@ -184,8 +184,8 @@ public function display($tpl = null)
$titleParts[] = $vars['view'];
}
- $value = implode(' » ', $titleParts);
}
+ $value = implode(' » ', $titleParts);
}
else
{
diff --git a/administrator/components/com_menus/views/menu/tmpl/edit.php b/administrator/components/com_menus/views/menu/tmpl/edit.php
index 8c2993f3a1da9..a3ab116365b24 100644
--- a/administrator/components/com_menus/views/menu/tmpl/edit.php
+++ b/administrator/components/com_menus/views/menu/tmpl/edit.php
@@ -30,19 +30,13 @@
");
?>