@@ -54,7 +85,7 @@
id . '&tmpl=component&view=module&layout=modal'; ?>
-
+
escape($module->title), $this->escape($module->access_title), $this->escape($module->position)); ?>
|
@@ -86,3 +117,5 @@
+
+ $link, 'title' => JText::_('COM_MENUS_EDIT_MODULE_SETTINGS'),'height' => '800px', 'width' => '800px'), ''); ?>
diff --git a/administrator/components/com_menus/views/item/view.html.php b/administrator/components/com_menus/views/item/view.html.php
index 2c7b8d4d5ee8e..7c5b294d9e416 100644
--- a/administrator/components/com_menus/views/item/view.html.php
+++ b/administrator/components/com_menus/views/item/view.html.php
@@ -12,9 +12,7 @@
/**
* The HTML Menus Menu Item View.
*
- * @package Joomla.Administrator
- * @subpackage com_menus
- * @since 1.6
+ * @since 1.6
*/
class MenusViewItem extends JViewLegacy
{
diff --git a/administrator/components/com_menus/views/items/view.html.php b/administrator/components/com_menus/views/items/view.html.php
index ee665deeceae5..b0c31c0b56726 100644
--- a/administrator/components/com_menus/views/items/view.html.php
+++ b/administrator/components/com_menus/views/items/view.html.php
@@ -12,9 +12,7 @@
/**
* The HTML Menus Menu Items View.
*
- * @package Joomla.Administrator
- * @subpackage com_menus
- * @since 1.6
+ * @since 1.6
*/
class MenusViewItems extends JViewLegacy
{
diff --git a/administrator/components/com_menus/views/menu/view.html.php b/administrator/components/com_menus/views/menu/view.html.php
index 5f2cbf4bad242..9787fe181b21f 100644
--- a/administrator/components/com_menus/views/menu/view.html.php
+++ b/administrator/components/com_menus/views/menu/view.html.php
@@ -12,9 +12,7 @@
/**
* The HTML Menus Menu Item View.
*
- * @package Joomla.Administrator
- * @subpackage com_menus
- * @since 1.6
+ * @since 1.6
*/
class MenusViewMenu extends JViewLegacy
{
diff --git a/administrator/components/com_menus/views/menus/tmpl/default.php b/administrator/components/com_menus/views/menus/tmpl/default.php
index ca6bb0f09c2ad..c29491dc84f34 100644
--- a/administrator/components/com_menus/views/menus/tmpl/default.php
+++ b/administrator/components/com_menus/views/menus/tmpl/default.php
@@ -12,11 +12,51 @@
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
+// Include jQuery
+JHtml::_('behavior.core');
+JHtml::_('bootstrap.modal');
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.multiselect');
-JHtml::_('behavior.modal');
JHtml::_('formbehavior.chosen', 'select');
+$script = array();
+$script[] = "jQuery(document).ready(function() {";
+$script[] = ' function jSelectPosition_' . $this->id . '(name) {';
+$script[] = ' document.getElementById("' . $this->id . '").value = name;';
+$script[] = ' jQuery("#menusModuleModal").modal("hide");';
+$script[] = ' };';
+$script[] = ' jQuery("#moduleModal").on("hidden", function () {';
+$script[] = ' setTimeout(function(){';
+$script[] = ' window.parent.location.reload();';
+$script[] = ' },1000);';
+$script[] = ' });';
+$script[] = "});";
+
+// Add normalized style.
+$style = 'div#moduleModal.modal.hide {display: block;}
+@media only screen and (min-width : 768px) {
+ #moduleModal {
+ width: 80% !important;
+ margin-left:-40% !important;
+ height:auto;
+ }
+ .modal-body {
+ max-height: 1000px;
+ }
+ #moduleModal #moduleModal-container .modal-body iframe {
+ margin:0;
+ padding:0;
+ display:block;
+ width:100%;
+ height:800px !important;
+ border:none;
+ }
+ }';
+
+// Add the script to the document head.
+JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
+JFactory::getDocument()->addStyleDeclaration($style);
+
$uri = JUri::getInstance();
$return = base64_encode($uri);
$user = JFactory::getUser();
@@ -136,8 +176,10 @@
modules[$item->menutype] as &$module) : ?>
-
+ id.'&return='.$return.'&tmpl=component&layout=modal'); ?>
+
escape($module->title), $this->escape($module->access_title), $this->escape($module->position)); ?>
+
escape($module->title), $this->escape($module->access_title), $this->escape($module->position)); ?>
@@ -158,6 +200,8 @@
+ $link, 'title' => JText::_('COM_MENUS_EDIT_MODULE_SETTINGS'),'height' => '800px', 'width' => '800px'), ''); ?>
+
diff --git a/administrator/components/com_menus/views/menus/view.html.php b/administrator/components/com_menus/views/menus/view.html.php
index 3b89d1cb457a5..51180be0c8452 100644
--- a/administrator/components/com_menus/views/menus/view.html.php
+++ b/administrator/components/com_menus/views/menus/view.html.php
@@ -12,9 +12,7 @@
/**
* The HTML Menus Menu Menus View.
*
- * @package Joomla.Administrator
- * @subpackage com_menus
- * @since 1.6
+ * @since 1.6
*/
class MenusViewMenus extends JViewLegacy
{
diff --git a/administrator/components/com_menus/views/menutypes/view.html.php b/administrator/components/com_menus/views/menutypes/view.html.php
index 8376f4d4f7eec..67cebd9197d9a 100644
--- a/administrator/components/com_menus/views/menutypes/view.html.php
+++ b/administrator/components/com_menus/views/menutypes/view.html.php
@@ -12,9 +12,7 @@
/**
* The HTML Menus Menu Item TYpes View.
*
- * @package Joomla.Administrator
- * @subpackage com_menus
- * @since 1.6
+ * @since 1.6
*/
class MenusViewMenutypes extends JViewLegacy
{
diff --git a/administrator/components/com_messages/controller.php b/administrator/components/com_messages/controller.php
index 7b0e3aa2a3f3c..64937e2f098ce 100644
--- a/administrator/components/com_messages/controller.php
+++ b/administrator/components/com_messages/controller.php
@@ -12,9 +12,7 @@
/**
* Messages master display controller.
*
- * @package Joomla.Administrator
- * @subpackage com_messages
- * @since 1.6
+ * @since 1.6
*/
class MessagesController extends JControllerLegacy
{
diff --git a/administrator/components/com_messages/controllers/config.php b/administrator/components/com_messages/controllers/config.php
index 59deec7272495..e7f7f04ca2721 100644
--- a/administrator/components/com_messages/controllers/config.php
+++ b/administrator/components/com_messages/controllers/config.php
@@ -12,9 +12,7 @@
/**
* Messages Component Message Model
*
- * @package Joomla.Administrator
- * @subpackage com_messages
- * @since 1.6
+ * @since 1.6
*/
class MessagesControllerConfig extends JControllerLegacy
{
diff --git a/administrator/components/com_messages/controllers/message.php b/administrator/components/com_messages/controllers/message.php
index 8c0dc090a1bd2..3b1624977f04a 100644
--- a/administrator/components/com_messages/controllers/message.php
+++ b/administrator/components/com_messages/controllers/message.php
@@ -12,9 +12,7 @@
/**
* Messages Component Message Model
*
- * @package Joomla.Administrator
- * @subpackage com_messages
- * @since 1.6
+ * @since 1.6
*/
class MessagesControllerMessage extends JControllerForm
{
diff --git a/administrator/components/com_messages/controllers/messages.php b/administrator/components/com_messages/controllers/messages.php
index faeada02c3745..5c1fd89fb81e7 100644
--- a/administrator/components/com_messages/controllers/messages.php
+++ b/administrator/components/com_messages/controllers/messages.php
@@ -12,9 +12,7 @@
/**
* Messages list controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_messages
- * @since 1.6
+ * @since 1.6
*/
class MessagesControllerMessages extends JControllerAdmin
{
diff --git a/administrator/components/com_messages/helpers/html/messages.php b/administrator/components/com_messages/helpers/html/messages.php
index 2e78db3514f40..8163af454b28e 100644
--- a/administrator/components/com_messages/helpers/html/messages.php
+++ b/administrator/components/com_messages/helpers/html/messages.php
@@ -10,9 +10,9 @@
defined('_JEXEC') or die;
/**
- * @package Joomla.Administrator
- * @subpackage com_messages
- * @since 1.6
+ * JHtml administrator messages class.
+ *
+ * @since 1.6
*/
class JHtmlMessages
{
diff --git a/administrator/components/com_messages/helpers/messages.php b/administrator/components/com_messages/helpers/messages.php
index f8689c8b9a3f9..9708ead5b6a5f 100644
--- a/administrator/components/com_messages/helpers/messages.php
+++ b/administrator/components/com_messages/helpers/messages.php
@@ -10,9 +10,9 @@
defined('_JEXEC') or die;
/**
- * @package Joomla.Administrator
- * @subpackage com_messages
- * @since 1.6
+ * Messages helper class.
+ *
+ * @since 1.6
*/
class MessagesHelper
{
diff --git a/administrator/components/com_messages/models/config.php b/administrator/components/com_messages/models/config.php
index b6e2ed1cab906..e38a189e20148 100644
--- a/administrator/components/com_messages/models/config.php
+++ b/administrator/components/com_messages/models/config.php
@@ -12,9 +12,7 @@
/**
* Message configuration model.
*
- * @package Joomla.Administrator
- * @subpackage com_messages
- * @since 1.6
+ * @since 1.6
*/
class MessagesModelConfig extends JModelForm
{
diff --git a/administrator/components/com_messages/models/fields/usermessages.php b/administrator/components/com_messages/models/fields/usermessages.php
index aaf82db7e4a38..612cd92bb8347 100644
--- a/administrator/components/com_messages/models/fields/usermessages.php
+++ b/administrator/components/com_messages/models/fields/usermessages.php
@@ -14,9 +14,7 @@
/**
* Supports an modal select of user that have access to com_messages
*
- * @package Joomla.Administrator
- * @subpackage com_messages
- * @since 1.6
+ * @since 1.6
*/
class JFormFieldUserMessages extends JFormFieldUser
{
diff --git a/administrator/components/com_messages/models/message.php b/administrator/components/com_messages/models/message.php
index 039eb1e52f577..6e12257076fe2 100644
--- a/administrator/components/com_messages/models/message.php
+++ b/administrator/components/com_messages/models/message.php
@@ -12,9 +12,7 @@
/**
* Private Message model.
*
- * @package Joomla.Administrator
- * @subpackage com_messages
- * @since 1.6
+ * @since 1.6
*/
class MessagesModelMessage extends JModelAdmin
{
diff --git a/administrator/components/com_messages/models/messages.php b/administrator/components/com_messages/models/messages.php
index 02580e15f175a..044860dae24fa 100644
--- a/administrator/components/com_messages/models/messages.php
+++ b/administrator/components/com_messages/models/messages.php
@@ -12,9 +12,7 @@
/**
* Messages Component Messages Model
*
- * @package Joomla.Administrator
- * @subpackage com_messages
- * @since 1.6
+ * @since 1.6
*/
class MessagesModelMessages extends JModelList
{
diff --git a/administrator/components/com_messages/tables/message.php b/administrator/components/com_messages/tables/message.php
index 14b54f57e465c..e657b64c80582 100644
--- a/administrator/components/com_messages/tables/message.php
+++ b/administrator/components/com_messages/tables/message.php
@@ -12,9 +12,7 @@
/**
* Message Table class
*
- * @package Joomla.Administrator
- * @subpackage com_messages
- * @since 1.5
+ * @since 1.5
*/
class MessagesTableMessage extends JTable
{
diff --git a/administrator/components/com_messages/views/config/view.html.php b/administrator/components/com_messages/views/config/view.html.php
index e94a1b65404b6..e872ae46087b6 100644
--- a/administrator/components/com_messages/views/config/view.html.php
+++ b/administrator/components/com_messages/views/config/view.html.php
@@ -12,9 +12,7 @@
/**
* View to edit messages user configuration.
*
- * @package Joomla.Administrator
- * @subpackage com_messages
- * @since 1.6
+ * @since 1.6
*/
class MessagesViewConfig extends JViewLegacy
{
diff --git a/administrator/components/com_messages/views/message/view.html.php b/administrator/components/com_messages/views/message/view.html.php
index 5b537d0d13fd7..6ad6d12a7da33 100644
--- a/administrator/components/com_messages/views/message/view.html.php
+++ b/administrator/components/com_messages/views/message/view.html.php
@@ -12,9 +12,7 @@
/**
* HTML View class for the Messages component
*
- * @package Joomla.Administrator
- * @subpackage com_messages
- * @since 1.6
+ * @since 1.6
*/
class MessagesViewMessage extends JViewLegacy
{
diff --git a/administrator/components/com_messages/views/messages/view.html.php b/administrator/components/com_messages/views/messages/view.html.php
index 2f01331926b78..ec6ed8d7d4f69 100644
--- a/administrator/components/com_messages/views/messages/view.html.php
+++ b/administrator/components/com_messages/views/messages/view.html.php
@@ -13,9 +13,7 @@
/**
* View class for a list of messages.
*
- * @package Joomla.Administrator
- * @subpackage com_messages
- * @since 1.6
+ * @since 1.6
*/
class MessagesViewMessages extends JViewLegacy
{
diff --git a/administrator/components/com_modules/controller.php b/administrator/components/com_modules/controller.php
index 5412d518919d2..0861f618c3574 100644
--- a/administrator/components/com_modules/controller.php
+++ b/administrator/components/com_modules/controller.php
@@ -12,25 +12,23 @@
/**
* Modules manager master display controller.
*
- * @package Joomla.Administrator
- * @subpackage com_modules
- * @since 1.6
+ * @since 1.6
*/
class ModulesController extends JControllerLegacy
{
/**
* Method to display a view.
*
- * @param boolean $cachable If true, the view output will be cached
- * @param array|boolean $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}
- .
+ * @param boolean $cachable If true, the view output will be cached
+ * @param array|boolean $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 JController This object to support chaining.
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
- require_once JPATH_COMPONENT.'/helpers/modules.php';
+ require_once JPATH_COMPONENT . '/helpers/modules.php';
// Load the submenu.
ModulesHelper::addSubmenu($this->input->get('view', 'modules'));
diff --git a/administrator/components/com_modules/controllers/module.php b/administrator/components/com_modules/controllers/module.php
index b24a821ce4fa0..33efd5d105a6e 100644
--- a/administrator/components/com_modules/controllers/module.php
+++ b/administrator/components/com_modules/controllers/module.php
@@ -12,9 +12,7 @@
/**
* Module controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_modules
- * @since 1.6
+ * @since 1.6
*/
class ModulesControllerModule extends JControllerForm
{
@@ -31,6 +29,7 @@ public function add()
// Get the result of the parent method. If an error, just return it.
$result = parent::add();
+
if ($result instanceof Exception)
{
return $result;
@@ -38,9 +37,13 @@ public function add()
// Look for the Extension ID.
$extensionId = $app->input->get('eid', 0, 'int');
+
if (empty($extensionId))
{
- $this->setRedirect(JRoute::_('index.php?option='.$this->option.'&view='.$this->view_item.'&layout=edit', false));
+ $redirectUrl = 'index.php?option=' . $this->option . '&view=' . $this->view_item . '&layout=edit';
+
+ $this->setRedirect(JRoute::_($redirectUrl, false));
+
return JError::raiseWarning(500, JText::_('COM_MODULES_ERROR_INVALID_EXTENSION'));
}
@@ -85,7 +88,7 @@ public function cancel($key = null)
*/
protected function allowSave($data, $key = 'id')
{
- // use custom position if selected
+ // Use custom position if selected
if (isset($data['custom_position']))
{
if (empty($data['position']))
@@ -143,7 +146,9 @@ public function batch($model = null)
$model = $this->getModel('Module', '', array());
// Preset the redirect
- $this->setRedirect(JRoute::_('index.php?option=com_modules&view=modules'.$this->getRedirectToListAppend(), false));
+ $redirectUrl = 'index.php?option=com_modules&view=modules' . $this->getRedirectToListAppend();
+
+ $this->setRedirect(JRoute::_($redirectUrl, false));
return parent::batch($model);
}
diff --git a/administrator/components/com_modules/controllers/modules.php b/administrator/components/com_modules/controllers/modules.php
index cf55d57c8025d..2a472eb3495cc 100644
--- a/administrator/components/com_modules/controllers/modules.php
+++ b/administrator/components/com_modules/controllers/modules.php
@@ -12,14 +12,15 @@
/**
* Modules list controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_modules
- * @since 1.6
+ * @since 1.6
*/
class ModulesControllerModules extends JControllerAdmin
{
/**
* Method to clone an existing module.
+ *
+ * @return void
+ *
* @since 1.6
*/
public function duplicate()
@@ -30,15 +31,18 @@ public function duplicate()
$pks = $this->input->post->get('cid', array(), 'array');
JArrayHelper::toInteger($pks);
- try {
+ try
+ {
if (empty($pks))
{
throw new Exception(JText::_('COM_MODULES_ERROR_NO_MODULES_SELECTED'));
}
+
$model = $this->getModel();
$model->duplicate($pks);
$this->setMessage(JText::plural('COM_MODULES_N_MODULES_DUPLICATED', count($pks)));
- } catch (Exception $e)
+ }
+ catch (Exception $e)
{
JError::raiseWarning(500, $e->getMessage());
}
@@ -60,6 +64,7 @@ public function duplicate()
public function getModel($name = 'Module', $prefix = 'ModulesModel', $config = array('ignore_request' => true))
{
$model = parent::getModel($name, $prefix, $config);
+
return $model;
}
}
diff --git a/administrator/components/com_modules/helpers/html/modules.php b/administrator/components/com_modules/helpers/html/modules.php
index a165608fb2b49..e710628a30eff 100644
--- a/administrator/components/com_modules/helpers/html/modules.php
+++ b/administrator/components/com_modules/helpers/html/modules.php
@@ -9,10 +9,10 @@
defined('_JEXEC') or die;
-/**
- * @package Joomla.Administrator
- * @subpackage com_modules
- * @since 1.6
+/**
+ * JHtml module helper class.
+ *
+ * @since 1.6
*/
abstract class JHtmlModules
{
@@ -146,19 +146,24 @@ public static function positions($clientId, $state = 1, $selectedPosition = '')
// Add positions from templates
$isTemplatePosition = false;
+
foreach ($templates as $template)
{
$options = array();
$positions = TemplatesHelper::getPositions($clientId, $template);
- if (is_array($positions)) foreach ($positions as $position)
- {
- $text = ModulesHelper::getTranslatedModulePosition($clientId, $template, $position) . ' [' . $position . ']';
- $options[] = ModulesHelper::createOption($position, $text);
- if (!$isTemplatePosition && $selectedPosition === $position)
+ if (is_array($positions))
+ {
+ foreach ($positions as $position)
{
- $isTemplatePosition = true;
+ $text = ModulesHelper::getTranslatedModulePosition($clientId, $template, $position) . ' [' . $position . ']';
+ $options[] = ModulesHelper::createOption($position, $text);
+
+ if (!$isTemplatePosition && $selectedPosition === $position)
+ {
+ $isTemplatePosition = true;
+ }
}
}
@@ -175,6 +180,11 @@ public static function positions($clientId, $state = 1, $selectedPosition = '')
return $templateGroups;
}
+ /**
+ * Get a select with the batch action options
+ *
+ * @return void
+ */
public static function batchOptions()
{
// Create the copy/move options.
diff --git a/administrator/components/com_modules/helpers/modules.php b/administrator/components/com_modules/helpers/modules.php
index 6c4047f1293e8..83b1038c4eba5 100644
--- a/administrator/components/com_modules/helpers/modules.php
+++ b/administrator/components/com_modules/helpers/modules.php
@@ -12,9 +12,7 @@
/**
* Modules component helper.
*
- * @package Joomla.Administrator
- * @subpackage com_modules
- * @since 1.6
+ * @since 1.6
*/
abstract class ModulesHelper
{
@@ -22,6 +20,8 @@ abstract class ModulesHelper
* Configure the Linkbar.
*
* @param string $vName The name of the active view.
+ *
+ * @return void
*/
public static function addSubmenu($vName)
{
@@ -31,7 +31,7 @@ public static function addSubmenu($vName)
/**
* Gets a list of the actions that can be performed.
*
- * @param integer The module ID.
+ * @param integer $moduleId The module ID.
*
* @return JObject
*
@@ -67,6 +67,7 @@ public static function getStateOptions()
$options[] = JHtml::_('select.option', '1', JText::_('JPUBLISHED'));
$options[] = JHtml::_('select.option', '0', JText::_('JUNPUBLISHED'));
$options[] = JHtml::_('select.option', '-2', JText::_('JTRASHED'));
+
return $options;
}
@@ -81,13 +82,15 @@ public static function getClientOptions()
$options = array();
$options[] = JHtml::_('select.option', '0', JText::_('JSITE'));
$options[] = JHtml::_('select.option', '1', JText::_('JADMINISTRATOR'));
+
return $options;
}
/**
* Get a list of modules positions
*
- * @param integer $clientId Client ID
+ * @param integer $clientId Client ID
+ * @param boolean $editPositions Allow to edit the positions
*
* @return array A list of positions
*/
@@ -110,23 +113,25 @@ public static function getPositions($clientId, $editPositions = false)
catch (RuntimeException $e)
{
JError::raiseWarning(500, $e->getMessage());
+
return;
}
// Build the list
$options = array();
+
foreach ($positions as $position)
{
if (!$position && !$editPositions)
{
$options[] = JHtml::_('select.option', 'none', ':: ' . JText::_('JNONE') . ' ::');
-
}
else
{
$options[] = JHtml::_('select.option', $position, $position);
}
}
+
return $options;
}
@@ -151,6 +156,7 @@ public static function getTemplates($clientId = 0, $state = '', $template = '')
->from('#__extensions')
->where('client_id = ' . (int) $clientId)
->where('type = ' . $db->quote('template'));
+
if ($state != '')
{
$query->where('enabled = ' . $db->quote($state));
@@ -164,6 +170,7 @@ public static function getTemplates($clientId = 0, $state = '', $template = '')
// Set the query and load the templates.
$db->setQuery($query);
$templates = $db->loadObjectList('element');
+
return $templates;
}
@@ -199,7 +206,9 @@ public static function getModules($clientId)
|| $lang->load("$extension.sys", $source, null, false, true);
$modules[$i]->text = JText::_($module->text);
}
+
JArrayHelper::sortObjects($modules, 'text', 1, true, true);
+
return $modules;
}
@@ -228,8 +237,9 @@ public static function getAssignmentOptions($clientId)
/**
* Return a translated module position name
*
- * @param string $template Template name
- * @param string $position Position name
+ * @param integer $clientId Application client id 0: site | 1: admin
+ * @param string $template Template name
+ * @param string $position Position name
*
* @return string Return a translated position name
*
@@ -241,10 +251,10 @@ public static function getTranslatedModulePosition($clientId, $template, $positi
$lang = JFactory::getLanguage();
$path = $clientId ? JPATH_ADMINISTRATOR : JPATH_SITE;
- $lang->load('tpl_'.$template.'.sys', $path, null, false, false)
- || $lang->load('tpl_'.$template.'.sys', $path.'/templates/'.$template, null, false, false)
- || $lang->load('tpl_'.$template.'.sys', $path, $lang->getDefault(), false, false)
- || $lang->load('tpl_'.$template.'.sys', $path.'/templates/'.$template, $lang->getDefault(), false, false);
+ $lang->load('tpl_' . $template . '.sys', $path, null, false, false)
+ || $lang->load('tpl_' . $template . '.sys', $path . '/templates/' . $template, null, false, false)
+ || $lang->load('tpl_' . $template . '.sys', $path, $lang->getDefault(), false, false)
+ || $lang->load('tpl_' . $template . '.sys', $path . '/templates/' . $template, $lang->getDefault(), false, false);
$langKey = strtoupper('TPL_' . $template . '_POSITION_' . $position);
$text = JText::_($langKey);
diff --git a/administrator/components/com_modules/helpers/xml.php b/administrator/components/com_modules/helpers/xml.php
index a955fb3435d89..9df1cba180a11 100644
--- a/administrator/components/com_modules/helpers/xml.php
+++ b/administrator/components/com_modules/helpers/xml.php
@@ -14,15 +14,20 @@
/**
* Helper for parse XML module files
*
- * @package Joomla.Administrator
- * @subpackage com_modules
* @since 1.5
* @deprecated 3.2 Do not use.
*/
class ModulesHelperXML
{
/**
+ * Parse the module XML file
+ *
+ * @param array &$rows XML rows
+ *
+ * @return void
+ *
* @since 1.5
+ *
* @deprecated 3.2 Do not use.
*/
public function parseXMLModuleFile(&$rows)
diff --git a/administrator/components/com_modules/models/module.php b/administrator/components/com_modules/models/module.php
index d014d0e8ccd3b..88f370ae45c59 100644
--- a/administrator/components/com_modules/models/module.php
+++ b/administrator/components/com_modules/models/module.php
@@ -12,9 +12,7 @@
/**
* Module model.
*
- * @package Joomla.Administrator
- * @subpackage com_modules
- * @since 1.6
+ * @since 1.6
*/
class ModulesModelModule extends JModelAdmin
{
@@ -93,6 +91,7 @@ public function batch($commands, $pks, $contexts)
if (empty($pks))
{
$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
+
return false;
}
@@ -107,6 +106,7 @@ public function batch($commands, $pks, $contexts)
if ($cmd == 'c')
{
$result = $this->batchCopy($commands['position_id'], $pks, $contexts);
+
if (is_array($result))
{
$pks = $result;
@@ -120,6 +120,7 @@ public function batch($commands, $pks, $contexts)
{
return false;
}
+
$done = true;
}
}
@@ -147,6 +148,7 @@ public function batch($commands, $pks, $contexts)
if (!$done)
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+
return false;
}
@@ -195,6 +197,7 @@ protected function batchCopy($value, $pks, $contexts)
{
$position = $value;
}
+
$table->position = $position;
// Alter the title if necessary
@@ -210,6 +213,7 @@ protected function batchCopy($value, $pks, $contexts)
if (!$table->store())
{
$this->setError($table->getError());
+
return false;
}
@@ -243,6 +247,7 @@ protected function batchCopy($value, $pks, $contexts)
else
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_CREATE'));
+
return false;
}
}
@@ -290,6 +295,7 @@ protected function batchMove($value, $pks, $contexts)
{
$position = $value;
}
+
$table->position = $position;
// Alter the title if necessary
@@ -302,12 +308,14 @@ protected function batchMove($value, $pks, $contexts)
if (!$table->store())
{
$this->setError($table->getError());
+
return false;
}
}
else
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+
return false;
}
}
@@ -321,9 +329,10 @@ protected function batchMove($value, $pks, $contexts)
/**
* Method to test whether a record can have its state edited.
*
- * @param object $record A record object.
+ * @param object $record A record object.
*
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
+ *
* @since 3.2
*/
protected function canEditState($record)
@@ -364,9 +373,10 @@ public function delete(&$pks)
if ($table->load($pk))
{
// Access checks.
- if (!$user->authorise('core.delete', 'com_modules.module.'.(int) $pk) || $table->published != -2)
+ if (!$user->authorise('core.delete', 'com_modules.module.' . (int) $pk) || $table->published != -2)
{
JError::raiseWarning(403, JText::_('JERROR_CORE_DELETE_NOT_PERMITTED'));
+
return;
}
@@ -432,6 +442,7 @@ public function duplicate(&$pks)
// Alter the title.
$m = null;
+
if (preg_match('#\((\d+)\)$#', $table->title, $m))
{
$table->title = preg_replace('#\(\d+\)$#', '(' . ($m[1] + 1) . ')', $table->title);
@@ -508,6 +519,7 @@ protected function generateNewTitle($category_id, $title, $position)
{
// Alter the title & alias
$table = $this->getTable();
+
while ($table->load(array('position' => $position, 'title' => $title)))
{
$title = JString::increment($title);
@@ -561,6 +573,7 @@ public function getForm($data = array(), $loadData = true)
// Get the form.
$form = $this->loadForm('com_modules.module', 'module', array('control' => 'jform', 'load_data' => $loadData));
+
if (empty($form))
{
return false;
@@ -570,11 +583,12 @@ public function getForm($data = array(), $loadData = true)
$user = JFactory::getUser();
- // Check for existing module
- // Modify the form based on Edit State access controls.
- if ($id != 0 && (!$user->authorise('core.edit.state', 'com_modules.module.'.(int) $id))
- || ($id == 0 && !$user->authorise('core.edit.state', 'com_modules'))
- )
+ /**
+ * Check for existing module
+ * Modify the form based on Edit State access controls.
+ */
+ if ($id != 0 && (!$user->authorise('core.edit.state', 'com_modules.module.' . (int) $id))
+ || ($id == 0 && !$user->authorise('core.edit.state', 'com_modules')) )
{
// Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
@@ -613,6 +627,7 @@ protected function loadFormData()
// This allows us to inject parameter settings into a new module.
$params = $app->getUserState('com_modules.add.module.params');
+
if (is_array($params))
{
$data->set('params', $params);
@@ -848,6 +863,7 @@ protected function preprocessForm(JForm $form, $data, $group = 'content')
// Get the help data from the XML file if present.
$help = $xml->xpath('/extension/help');
+
if (!empty($help))
{
$helpKey = trim((string) $help[0]['key']);
@@ -856,7 +872,6 @@ protected function preprocessForm(JForm $form, $data, $group = 'content')
$this->helpKey = $helpKey ? $helpKey : $this->helpKey;
$this->helpURL = $helpURL ? $helpURL : $this->helpURL;
}
-
}
// Load the default advanced params
@@ -916,7 +931,7 @@ public function save($data)
if ($input->get('task') == 'save2copy')
{
$orig_data = $input->post->get('jform', array(), 'array');
- $orig_table = clone($this->getTable());
+ $orig_table = clone $this->getTable();
$orig_table->load((int) $orig_data['id']);
if ($data['title'] == $orig_table->title)
diff --git a/administrator/components/com_modules/models/modules.php b/administrator/components/com_modules/models/modules.php
index 843166a76b51c..85551357ef63b 100644
--- a/administrator/components/com_modules/models/modules.php
+++ b/administrator/components/com_modules/models/modules.php
@@ -12,16 +12,15 @@
/**
* Modules Component Module Model
*
- * @package Joomla.Administrator
- * @subpackage com_modules
- * @since 1.5
+ * @since 1.5
*/
class ModulesModelModules extends JModelList
{
/**
* Constructor.
*
- * @param array An optional associative array of configuration settings.
+ * @param array $config An optional associative array of configuration settings.
+ *
* @see JController
* @since 1.6
*/
@@ -56,6 +55,11 @@ public function __construct($config = array())
*
* Note. Calling getState in this method will result in recursion.
*
+ * @param string $ordering An optional ordering field.
+ * @param string $direction An optional direction (asc|desc).
+ *
+ * @return void
+ *
* @since 1.6
*/
protected function populateState($ordering = null, $direction = null)
@@ -80,11 +84,13 @@ protected function populateState($ordering = null, $direction = null)
$clientId = $this->getUserStateFromRequest($this->context . '.filter.client_id', 'filter_client_id', 0, 'int', false);
$previousId = $app->getUserState($this->context . '.filter.client_id_previous', null);
+
if ($previousId != $clientId || $previousId === null)
{
$this->getUserStateFromRequest($this->context . '.filter.client_id_previous', 'filter_client_id_previous', 0, 'int', true);
$app->setUserState($this->context . '.filter.client_id_previous', $clientId);
}
+
$this->setState('filter.client_id', $clientId);
$language = $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '');
@@ -105,7 +111,7 @@ protected function populateState($ordering = null, $direction = null)
* different modules that might need different sets of data or different
* ordering requirements.
*
- * @param string A prefix for the store id.
+ * @param string $id A prefix for the store id.
*
* @return string A store id.
*/
@@ -126,14 +132,16 @@ protected function getStoreId($id = '')
/**
* Returns an object list
*
- * @param string The query
- * @param int Offset
- * @param int The number of records
+ * @param string $query The query
+ * @param int $limitstart Offset
+ * @param int $limit The number of records
+ *
* @return array
*/
protected function _getList($query, $limitstart = 0, $limit = 0)
{
$ordering = $this->getState('list.ordering', 'ordering');
+
if (in_array($ordering, array('pages', 'name')))
{
$this->_db->setQuery($query);
@@ -142,11 +150,13 @@ protected function _getList($query, $limitstart = 0, $limit = 0)
JArrayHelper::sortObjects($result, $ordering, $this->getState('list.direction') == 'desc' ? -1 : 1, true, true);
$total = count($result);
$this->cache[$this->getStoreId('getTotal')] = $total;
+
if ($total < $limitstart)
{
$limitstart = 0;
$this->setState('list.start', 0);
}
+
return array_slice($result, $limitstart, $limit ? $limit : null);
}
else
@@ -156,17 +166,22 @@ protected function _getList($query, $limitstart = 0, $limit = 0)
$query->order('a.position ASC');
$ordering = 'a.ordering';
}
+
if ($ordering == 'language_title')
{
$ordering = 'l.title';
}
+
$query->order($this->_db->quoteName($ordering) . ' ' . $this->getState('list.direction'));
+
if ($ordering == 'position')
{
$query->order('a.ordering ASC');
}
+
$result = parent::_getList($query, $limitstart, $limit);
$this->translate($result);
+
return $result;
}
}
@@ -174,7 +189,8 @@ protected function _getList($query, $limitstart = 0, $limit = 0)
/**
* Translate a list of objects
*
- * @param array The array of objects
+ * @param array &$items The array of objects
+ *
* @return array The array of translated objects
*/
protected function translate(&$items)
@@ -189,6 +205,7 @@ protected function translate(&$items)
$lang->load("$extension.sys", constant('JPATH_' . strtoupper($client)), null, false, true)
|| $lang->load("$extension.sys", $source, null, false, true);
$item->name = JText::_($item->name);
+
if (is_null($item->pages))
{
$item->pages = JText::_('JNONE');
@@ -262,6 +279,7 @@ protected function getListQuery()
// Filter by published state
$state = $this->getState('filter.state');
+
if (is_numeric($state))
{
$query->where('a.published = ' . (int) $state);
@@ -273,6 +291,7 @@ protected function getListQuery()
// Filter by position
$position = $this->getState('filter.position');
+
if ($position && $position != 'none')
{
$query->where('a.position = ' . $db->quote($position));
@@ -285,6 +304,7 @@ protected function getListQuery()
// Filter by module
$module = $this->getState('filter.module');
+
if ($module)
{
$query->where('a.module = ' . $db->quote($module));
@@ -292,6 +312,7 @@ protected function getListQuery()
// Filter by client.
$clientId = $this->getState('filter.client_id');
+
if (is_numeric($clientId))
{
$query->where('a.client_id = ' . (int) $clientId . ' AND e.client_id =' . (int) $clientId);
@@ -299,6 +320,7 @@ protected function getListQuery()
// Filter by search in title
$search = $this->getState('filter.search');
+
if (!empty($search))
{
if (stripos($search, 'id:') === 0)
@@ -318,7 +340,6 @@ protected function getListQuery()
$query->where('a.language = ' . $db->quote($language));
}
- //echo nl2br(str_replace('#__','jos_',$query));
return $query;
}
}
diff --git a/administrator/components/com_modules/models/positions.php b/administrator/components/com_modules/models/positions.php
index dcc85d7ff8aa7..ca7fcab7aef45 100644
--- a/administrator/components/com_modules/models/positions.php
+++ b/administrator/components/com_modules/models/positions.php
@@ -12,16 +12,14 @@
/**
* Modules Component Positions Model
*
- * @package Joomla.Administrator
- * @subpackage com_modules
- * @since 1.6
+ * @since 1.6
*/
class ModulesModelPositions extends JModelList
{
/**
* Constructor.
*
- * @param array An optional associative array of configuration settings.
+ * @param array $config An optional associative array of configuration settings.
*
* @see JController
* @since 1.6
@@ -44,6 +42,11 @@ public function __construct($config = array())
*
* Note. Calling getState in this method will result in recursion.
*
+ * @param string $ordering An optional ordering field.
+ * @param string $direction An optional direction (asc|desc).
+ *
+ * @return void
+ *
* @since 1.6
*/
protected function populateState($ordering = null, $direction = null)
@@ -104,6 +107,7 @@ public function getItems()
->select('DISTINCT(position) as value')
->from('#__modules')
->where($this->_db->quoteName('client_id') . ' = ' . (int) $clientId);
+
if ($search)
{
$search = $this->_db->quote('%' . str_replace(' ', '%', $this->_db->escape(trim($search), true) . '%'));
@@ -141,10 +145,12 @@ public function getItems()
if (file_exists($path))
{
$xml = simplexml_load_file($path);
+
if (isset($xml->positions[0]))
{
$lang->load('tpl_' . $template->element . '.sys', $client->path, null, false, true)
|| $lang->load('tpl_' . $template->element . '.sys', $client->path . '/templates/' . $template->element, null, false, true);
+
foreach ($xml->positions[0] as $position)
{
$value = (string) $position['value'];
@@ -161,6 +167,7 @@ public function getItems()
$label = $altlabel;
}
}
+
if ($type == 'user' || ($state != '' && $state != $template->enabled))
{
unset($positions[$value]);
@@ -171,12 +178,14 @@ public function getItems()
{
$positions[$value] = array();
}
+
$positions[$value][$template->name] = $label;
}
}
}
}
}
+
$this->total = count($positions);
if ($limitstart >= $this->total)
@@ -207,6 +216,7 @@ public function getItems()
arsort($positions);
}
}
+
$this->items = array_slice($positions, $limitstart, $limit ? $limit : null);
}
diff --git a/administrator/components/com_modules/models/select.php b/administrator/components/com_modules/models/select.php
index 00977bab34ecc..8afe3203bff7f 100644
--- a/administrator/components/com_modules/models/select.php
+++ b/administrator/components/com_modules/models/select.php
@@ -12,9 +12,7 @@
/**
* Module model.
*
- * @package Joomla.Administrator
- * @subpackage com_modules
- * @since 1.6
+ * @since 1.6
*/
class ModulesModelSelect extends JModelList
{
@@ -23,6 +21,11 @@ class ModulesModelSelect extends JModelList
*
* Note. Calling getState in this method will result in recursion.
*
+ * @param string $ordering An optional ordering field.
+ * @param string $direction An optional direction (asc|desc).
+ *
+ * @return void
+ *
* @since 1.6
*/
protected function populateState($ordering = null, $direction = null)
@@ -51,7 +54,7 @@ protected function populateState($ordering = null, $direction = null)
* different modules that might need different sets of data or different
* ordering requirements.
*
- * @param string A prefix for the store id.
+ * @param string $id A prefix for the store id.
*
* @return string A store id.
*/
@@ -96,7 +99,6 @@ protected function getListQuery()
// Add the list ordering clause.
$query->order($db->escape($this->getState('list.ordering', 'a.ordering')) . ' ' . $db->escape($this->getState('list.direction', 'ASC')));
- //echo nl2br(str_replace('#__','jos_',$query));
return $query;
}
@@ -118,6 +120,7 @@ public function getItems()
foreach ($items as &$item)
{
$path = JPath::clean($client->path . '/modules/' . $item->module . '/' . $item->module . '.xml');
+
if (file_exists($path))
{
$item->xml = simplexml_load_file($path);
@@ -142,6 +145,7 @@ public function getItems()
$item->desc = JText::_('COM_MODULES_NODESCRIPTION');
}
}
+
$items = JArrayHelper::sortObjects($items, 'name', 1, true, true);
// TODO: Use the cached XML from the extensions table?
diff --git a/administrator/components/com_modules/views/module/tmpl/edit.php b/administrator/components/com_modules/views/module/tmpl/edit.php
index 2448a207ce81a..5e62bf0f5ee00 100644
--- a/administrator/components/com_modules/views/module/tmpl/edit.php
+++ b/administrator/components/com_modules/views/module/tmpl/edit.php
@@ -11,6 +11,7 @@
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
+JHtml::_('behavior.core');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.combobox');
JHtml::_('formbehavior.chosen', 'select');
@@ -35,9 +36,9 @@
$script .= $this->form->getField($hasContentFieldName)->save();
}
$script .= " Joomla.submitform(task, document.getElementById('module-form'));
- if (self != top)
+ if (self.location != top.location)
{
- window.top.setTimeout('window.parent.SqueezeBox.close()', 1000);
+ window.parent.jQuery('#moduleModal').modal('hide');
}
}
};";
diff --git a/administrator/components/com_modules/views/module/tmpl/modal.php b/administrator/components/com_modules/views/module/tmpl/modal.php
index 2f9936c78b19a..56444b3b5cc17 100644
--- a/administrator/components/com_modules/views/module/tmpl/modal.php
+++ b/administrator/components/com_modules/views/module/tmpl/modal.php
@@ -15,7 +15,7 @@
-
diff --git a/administrator/components/com_modules/views/module/view.html.php b/administrator/components/com_modules/views/module/view.html.php
index 2f5bffda919b0..e8b2fa6bfe325 100644
--- a/administrator/components/com_modules/views/module/view.html.php
+++ b/administrator/components/com_modules/views/module/view.html.php
@@ -12,9 +12,7 @@
/**
* View to edit a module.
*
- * @package Joomla.Administrator
- * @subpackage com_modules
- * @since 1.6
+ * @since 1.6
*/
class ModulesViewModule extends JViewLegacy
{
@@ -26,6 +24,10 @@ class ModulesViewModule extends JViewLegacy
/**
* Display the view
+ *
+ * @param string $tpl The name of the template file to parse; automatically searches through the template paths.
+ *
+ * @return void
*/
public function display($tpl = null)
{
@@ -38,6 +40,7 @@ public function display($tpl = null)
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
+
return false;
}
@@ -48,6 +51,8 @@ public function display($tpl = null)
/**
* Add the page title and toolbar.
*
+ * @return void
+ *
* @since 1.6
*/
protected function addToolbar()
@@ -101,6 +106,7 @@ protected function addToolbar()
$lang = JFactory::getLanguage();
$help = $this->get('Help');
+
if ($lang->hasKey($help->url))
{
$debug = $lang->setDebug(false);
@@ -111,6 +117,7 @@ protected function addToolbar()
{
$url = null;
}
+
JToolbarHelper::help($help->key, false, $url);
}
}
diff --git a/administrator/components/com_modules/views/modules/view.html.php b/administrator/components/com_modules/views/modules/view.html.php
index c4144516e3cc4..c3de464cf55c1 100644
--- a/administrator/components/com_modules/views/modules/view.html.php
+++ b/administrator/components/com_modules/views/modules/view.html.php
@@ -12,9 +12,7 @@
/**
* View class for a list of modules.
*
- * @package Joomla.Administrator
- * @subpackage com_modules
- * @since 1.6
+ * @since 1.6
*/
class ModulesViewModules extends JViewLegacy
{
@@ -26,6 +24,10 @@ class ModulesViewModules extends JViewLegacy
/**
* Display the view
+ *
+ * @param string $tpl The name of the template file to parse; automatically searches through the template paths.
+ *
+ * @return void
*/
public function display($tpl = null)
{
@@ -37,11 +39,13 @@ public function display($tpl = null)
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
+
return false;
}
// Check if there are no matching items
- if (!count($this->items)){
+ if (!count($this->items))
+ {
JFactory::getApplication()->enqueueMessage(
JText::_('COM_MODULES_MSG_MANAGE_NO_MODULES'),
'warning'
@@ -49,6 +53,7 @@ public function display($tpl = null)
}
$this->addToolbar();
+
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
parent::display($tpl);
@@ -57,6 +62,8 @@ public function display($tpl = null)
/**
* Add the page title and toolbar.
*
+ * @return void
+ *
* @since 1.6
*/
protected function addToolbar()
@@ -98,13 +105,15 @@ protected function addToolbar()
if ($state->get('filter.state') == -2 && $canDo->get('core.delete'))
{
JToolbarHelper::deleteList('', 'modules.delete', 'JTOOLBAR_EMPTY_TRASH');
- } elseif ($canDo->get('core.edit.state'))
+ }
+ elseif ($canDo->get('core.edit.state'))
{
JToolbarHelper::trash('modules.trash');
}
// Add a batch button
- if ($user->authorise('core.create', 'com_modules') && $user->authorise('core.edit', 'com_modules') && $user->authorise('core.edit.state', 'com_modules'))
+ if ($user->authorise('core.create', 'com_modules') && $user->authorise('core.edit', 'com_modules')
+ && $user->authorise('core.edit.state', 'com_modules'))
{
JHtml::_('bootstrap.modal', 'collapseModal');
$title = JText::_('JTOOLBAR_BATCH');
@@ -120,6 +129,7 @@ protected function addToolbar()
{
JToolbarHelper::preferences('com_modules');
}
+
JToolbarHelper::help('JHELP_EXTENSIONS_MODULE_MANAGER');
JHtmlSidebar::addEntry(
@@ -153,7 +163,10 @@ protected function addToolbar()
JHtmlSidebar::addFilter(
JText::_('COM_MODULES_OPTION_SELECT_POSITION'),
'filter_position',
- JHtml::_('select.options', ModulesHelper::getPositions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.position'))
+ JHtml::_(
+ 'select.options',
+ ModulesHelper::getPositions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.position')
+ )
);
JHtmlSidebar::addFilter(
diff --git a/administrator/components/com_modules/views/positions/view.html.php b/administrator/components/com_modules/views/positions/view.html.php
index 1d4ee3a9adcb8..7860c50ac5681 100644
--- a/administrator/components/com_modules/views/positions/view.html.php
+++ b/administrator/components/com_modules/views/positions/view.html.php
@@ -10,8 +10,8 @@
defined('_JEXEC') or die;
/**
- * @package Joomla.Administrator
- * @subpackage com_modules
+ * View Module positions class.
+ *
* @since 1.6
*/
class ModulesViewPositions extends JViewLegacy
@@ -24,6 +24,10 @@ class ModulesViewPositions extends JViewLegacy
/**
* Display the view
+ *
+ * @param string $tpl The name of the template file to parse; automatically searches through the template paths.
+ *
+ * @return void
*/
public function display($tpl = null)
{
@@ -35,6 +39,7 @@ public function display($tpl = null)
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
+
return false;
}
diff --git a/administrator/components/com_modules/views/preview/view.html.php b/administrator/components/com_modules/views/preview/view.html.php
index 7b2e7800e2956..9f77cb0f21e64 100644
--- a/administrator/components/com_modules/views/preview/view.html.php
+++ b/administrator/components/com_modules/views/preview/view.html.php
@@ -12,12 +12,17 @@
/**
* HTML View class for the Modules component
*
- * @package Joomla.Administrator
- * @subpackage com_modules
- * @since 1.6
+ * @since 1.6
*/
class ModulesViewPreview extends JViewLegacy
{
+ /**
+ * Display the view
+ *
+ * @param string $tpl The name of the template file to parse; automatically searches through the template paths.
+ *
+ * @return void
+ */
public function display($tpl = null)
{
$editor = JFactory::getConfig()->get('editor');
diff --git a/administrator/components/com_modules/views/select/view.html.php b/administrator/components/com_modules/views/select/view.html.php
index 6caf98af2f847..fe9af3d331dfb 100644
--- a/administrator/components/com_modules/views/select/view.html.php
+++ b/administrator/components/com_modules/views/select/view.html.php
@@ -12,9 +12,7 @@
/**
* HTML View class for the Modules component
*
- * @package Joomla.Administrator
- * @subpackage com_modules
- * @since 1.6
+ * @since 1.6
*/
class ModulesViewSelect extends JViewLegacy
{
@@ -24,6 +22,10 @@ class ModulesViewSelect extends JViewLegacy
/**
* Display the view
+ *
+ * @param string $tpl The name of the template file to parse; automatically searches through the template paths.
+ *
+ * @return void
*/
public function display($tpl = null)
{
@@ -34,6 +36,7 @@ public function display($tpl = null)
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
+
return false;
}
@@ -47,7 +50,9 @@ public function display($tpl = null)
/**
* Add the page title and toolbar.
*
- * @since 3.0
+ * @return void
+ *
+ * @since 1.6
*/
protected function addToolbar()
{
diff --git a/administrator/components/com_newsfeeds/controller.php b/administrator/components/com_newsfeeds/controller.php
index 88a73e0ab0903..274120e37a556 100644
--- a/administrator/components/com_newsfeeds/controller.php
+++ b/administrator/components/com_newsfeeds/controller.php
@@ -12,9 +12,7 @@
/**
* Newsfeeds master display controller.
*
- * @package Joomla.Administrator
- * @subpackage com_newsfeeds
- * @since 1.6
+ * @since 1.6
*/
class NewsfeedsController extends JControllerLegacy
{
diff --git a/administrator/components/com_newsfeeds/controllers/newsfeed.php b/administrator/components/com_newsfeeds/controllers/newsfeed.php
index e48fb1a3319a2..38fa483390330 100644
--- a/administrator/components/com_newsfeeds/controllers/newsfeed.php
+++ b/administrator/components/com_newsfeeds/controllers/newsfeed.php
@@ -12,9 +12,7 @@
/**
* Newsfeed controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_newsfeeds
- * @since 1.6
+ * @since 1.6
*/
class NewsfeedsControllerNewsfeed extends JControllerForm
{
diff --git a/administrator/components/com_newsfeeds/controllers/newsfeeds.php b/administrator/components/com_newsfeeds/controllers/newsfeeds.php
index 74ed4b41311a3..de74cdbd588b5 100644
--- a/administrator/components/com_newsfeeds/controllers/newsfeeds.php
+++ b/administrator/components/com_newsfeeds/controllers/newsfeeds.php
@@ -12,9 +12,7 @@
/**
* Newsfeeds list controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_newsfeeds
- * @since 1.6
+ * @since 1.6
*/
class NewsfeedsControllerNewsfeeds extends JControllerAdmin
{
diff --git a/administrator/components/com_newsfeeds/helpers/html/newsfeed.php b/administrator/components/com_newsfeeds/helpers/html/newsfeed.php
index 67c8827da62f2..e762e58f170b5 100644
--- a/administrator/components/com_newsfeeds/helpers/html/newsfeed.php
+++ b/administrator/components/com_newsfeeds/helpers/html/newsfeed.php
@@ -12,12 +12,9 @@
JLoader::register('NewsfeedsHelper', JPATH_ADMINISTRATOR . '/components/com_newsfeeds/helpers/newsfeeds.php');
/**
- * Utility class for creating HTML Grids
- *
- * @static
- * @package Joomla.Administrator
- * @subpackage com_newsfeeds
- * @since 1.5
+ * Utility class for creating HTML Grids.
+ *
+ * @since 1.5
*/
class JHtmlNewsfeed
{
diff --git a/administrator/components/com_newsfeeds/helpers/newsfeeds.php b/administrator/components/com_newsfeeds/helpers/newsfeeds.php
index 630dc08801355..ffc5587c281fc 100644
--- a/administrator/components/com_newsfeeds/helpers/newsfeeds.php
+++ b/administrator/components/com_newsfeeds/helpers/newsfeeds.php
@@ -12,9 +12,7 @@
/**
* Newsfeeds component helper.
*
- * @package Joomla.Administrator
- * @subpackage com_newsfeeds
- * @since 1.6
+ * @since 1.6
*/
class NewsfeedsHelper extends JHelperContent
{
diff --git a/administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php b/administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php
index 5db009b0b8f81..6a54cfcab59b9 100644
--- a/administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php
+++ b/administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php
@@ -12,9 +12,7 @@
/**
* Supports a modal newsfeeds picker.
*
- * @package Joomla.Administrator
- * @subpackage com_newsfeeds
- * @since 1.6
+ * @since 1.6
*/
class JFormFieldModal_Newsfeed extends JFormField
{
diff --git a/administrator/components/com_newsfeeds/models/fields/newsfeeds.php b/administrator/components/com_newsfeeds/models/fields/newsfeeds.php
index ec42832d3ff06..6b365af70404b 100644
--- a/administrator/components/com_newsfeeds/models/fields/newsfeeds.php
+++ b/administrator/components/com_newsfeeds/models/fields/newsfeeds.php
@@ -14,9 +14,7 @@
/**
* Form Field class for the Joomla Framework.
*
- * @package Joomla.Administrator
- * @subpackage com_newsfeeds
- * @since 1.6
+ * @since 1.6
*/
class JFormFieldNewsfeeds extends JFormFieldList
{
diff --git a/administrator/components/com_newsfeeds/models/newsfeed.php b/administrator/components/com_newsfeeds/models/newsfeed.php
index 306c9970d4a04..0fc55ceb604d8 100644
--- a/administrator/components/com_newsfeeds/models/newsfeed.php
+++ b/administrator/components/com_newsfeeds/models/newsfeed.php
@@ -14,9 +14,7 @@
/**
* Newsfeed model.
*
- * @package Joomla.Administrator
- * @subpackage com_newsfeeds
- * @since 1.6
+ * @since 1.6
*/
class NewsfeedsModelNewsfeed extends JModelAdmin
{
diff --git a/administrator/components/com_newsfeeds/models/newsfeeds.php b/administrator/components/com_newsfeeds/models/newsfeeds.php
index cc0e3127f5215..af81266420605 100644
--- a/administrator/components/com_newsfeeds/models/newsfeeds.php
+++ b/administrator/components/com_newsfeeds/models/newsfeeds.php
@@ -12,9 +12,7 @@
/**
* Methods supporting a list of newsfeed records.
*
- * @package Joomla.Administrator
- * @subpackage com_newsfeeds
- * @since 1.6
+ * @since 1.6
*/
class NewsfeedsModelNewsfeeds extends JModelList
{
diff --git a/administrator/components/com_newsfeeds/tables/newsfeed.php b/administrator/components/com_newsfeeds/tables/newsfeed.php
index bede2c2139501..7c8cbe68c8691 100644
--- a/administrator/components/com_newsfeeds/tables/newsfeed.php
+++ b/administrator/components/com_newsfeeds/tables/newsfeed.php
@@ -10,8 +10,7 @@
defined('_JEXEC') or die;
/**
- * @package Joomla.Administrator
- * @subpackage com_newsfeeds
+ * Newsfeed Table class.
*/
class NewsfeedsTableNewsfeed extends JTable
{
diff --git a/administrator/components/com_newsfeeds/views/newsfeed/view.html.php b/administrator/components/com_newsfeeds/views/newsfeed/view.html.php
index e256c5715cf85..861c9dd4cac91 100644
--- a/administrator/components/com_newsfeeds/views/newsfeed/view.html.php
+++ b/administrator/components/com_newsfeeds/views/newsfeed/view.html.php
@@ -12,9 +12,7 @@
/**
* View to edit a newsfeed.
*
- * @package Joomla.Administrator
- * @subpackage com_newsfeeds
- * @since 1.6
+ * @since 1.6
*/
class NewsfeedsViewNewsfeed extends JViewLegacy
{
diff --git a/administrator/components/com_newsfeeds/views/newsfeeds/view.html.php b/administrator/components/com_newsfeeds/views/newsfeeds/view.html.php
index 5e5e03a3210c8..821414b1d5755 100644
--- a/administrator/components/com_newsfeeds/views/newsfeeds/view.html.php
+++ b/administrator/components/com_newsfeeds/views/newsfeeds/view.html.php
@@ -12,9 +12,7 @@
/**
* View class for a list of newsfeeds.
*
- * @package Joomla.Administrator
- * @subpackage com_newsfeeds
- * @since 1.6
+ * @since 1.6
*/
class NewsfeedsViewNewsfeeds extends JViewLegacy
{
diff --git a/administrator/components/com_plugins/controller.php b/administrator/components/com_plugins/controller.php
index 3ac7acbcc94d1..a851a26c25791 100644
--- a/administrator/components/com_plugins/controller.php
+++ b/administrator/components/com_plugins/controller.php
@@ -12,24 +12,23 @@
/**
* Plugins master display controller.
*
- * @package Joomla.Administrator
- * @subpackage com_plugins
- * @since 1.5
+ * @since 1.5
*/
class PluginsController extends JControllerLegacy
{
/**
* Method to display a view.
*
- * @param boolean If true, the view output will be cached
- * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
+ * @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.
+ *
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
- require_once JPATH_COMPONENT.'/helpers/plugins.php';
+ require_once JPATH_COMPONENT . '/helpers/plugins.php';
// Load the submenu.
PluginsHelper::addSubmenu($this->input->get('view', 'plugins'));
diff --git a/administrator/components/com_plugins/controllers/plugin.php b/administrator/components/com_plugins/controllers/plugin.php
index 31370540b8898..f35dedd20d648 100644
--- a/administrator/components/com_plugins/controllers/plugin.php
+++ b/administrator/components/com_plugins/controllers/plugin.php
@@ -12,9 +12,7 @@
/**
* Plugin controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_plugins
- * @since 1.6
+ * @since 1.6
*/
class PluginsControllerPlugin extends JControllerForm
{
diff --git a/administrator/components/com_plugins/controllers/plugins.php b/administrator/components/com_plugins/controllers/plugins.php
index f5e148ed4d79c..1ec95f0cfc7f9 100644
--- a/administrator/components/com_plugins/controllers/plugins.php
+++ b/administrator/components/com_plugins/controllers/plugins.php
@@ -12,9 +12,7 @@
/**
* Plugins list controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_plugins
- * @since 1.6
+ * @since 1.6
*/
class PluginsControllerPlugins extends JControllerAdmin
{
@@ -32,6 +30,7 @@ class PluginsControllerPlugins extends JControllerAdmin
public function getModel($name = 'Plugin', $prefix = 'PluginsModel', $config = array('ignore_request' => true))
{
$model = parent::getModel($name, $prefix, $config);
+
return $model;
}
}
diff --git a/administrator/components/com_plugins/helpers/plugins.php b/administrator/components/com_plugins/helpers/plugins.php
index 12b7532ab67a7..db515e61e525f 100644
--- a/administrator/components/com_plugins/helpers/plugins.php
+++ b/administrator/components/com_plugins/helpers/plugins.php
@@ -12,9 +12,7 @@
/**
* Plugins component helper.
*
- * @package Joomla.Administrator
- * @subpackage com_plugins
- * @since 1.6
+ * @since 1.6
*/
class PluginsHelper
{
@@ -23,7 +21,9 @@ class PluginsHelper
/**
* Configure the Linkbar.
*
- * @param string The name of the active view.
+ * @param string $vName The name of the active view.
+ *
+ * @return void
*/
public static function addSubmenu($vName)
{
@@ -39,10 +39,10 @@ public static function addSubmenu($vName)
*/
public static function getActions()
{
- // Log usage of deprecated function
+ // Log usage of deprecated function.
JLog::add(__METHOD__ . '() is deprecated, use JHelperContent::getActions() with new arguments order instead.', JLog::WARNING, 'deprecated');
- // Get list of actions
+ // Get list of actions.
$result = JHelperContent::getActions('com_plugins');
return $result;
@@ -91,12 +91,21 @@ public static function folderOptions()
return $options;
}
+ /**
+ * Parse the template file.
+ *
+ * @param string $templateBaseDir Base path to the template directory.
+ * @param string $templateDir Template directory.
+ *
+ * @return JObject
+ */
public function parseXMLTemplateFile($templateBaseDir, $templateDir)
{
$data = new JObject;
- // Check of the xml file exists
+ // Check of the xml file exists.
$filePath = JPath::clean($templateBaseDir . '/templates/' . $templateDir . '/templateDetails.xml');
+
if (is_file($filePath))
{
$xml = JInstaller::parseXMLInstallFile($filePath);
diff --git a/administrator/components/com_plugins/models/fields/pluginordering.php b/administrator/components/com_plugins/models/fields/pluginordering.php
index ab02d2572fca2..979a641be9c00 100644
--- a/administrator/components/com_plugins/models/fields/pluginordering.php
+++ b/administrator/components/com_plugins/models/fields/pluginordering.php
@@ -12,11 +12,9 @@
JFormHelper::loadFieldClass('ordering');
/**
- * Supports an HTML select list of plugins
+ * Supports an HTML select list of plugins.
*
- * @package Joomla.Administrator
- * @subpackage com_plugins
- * @since 1.6
+ * @since 1.6
*/
class JFormFieldPluginordering extends JFormFieldOrdering
{
@@ -31,7 +29,7 @@ class JFormFieldPluginordering extends JFormFieldOrdering
/**
* Builds the query for the ordering list.
*
- * @return JDatabaseQuery The query for the ordering form field
+ * @return JDatabaseQuery The query for the ordering form field.
*/
protected function getQuery()
{
@@ -40,7 +38,15 @@ protected function getQuery()
// Build the query for the ordering list.
$query = $db->getQuery(true)
- ->select(array($db->quoteName('ordering', 'value'), $db->quoteName('name', 'text'), $db->quoteName('type'), $db->quote('folder'), $db->quote('extension_id')))
+ ->select(
+ array(
+ $db->quoteName('ordering', 'value'),
+ $db->quoteName('name', 'text'),
+ $db->quoteName('type'),
+ $db->quote('folder'),
+ $db->quote('extension_id')
+ )
+ )
->from($db->quoteName('#__extensions'))
->where('(type =' . $db->quote('plugin') . 'AND folder=' . $db->quote($folder) . ')')
->order('ordering');
@@ -51,7 +57,7 @@ protected function getQuery()
/**
* Retrieves the current Item's Id.
*
- * @return integer The current item ID
+ * @return integer The current item ID.
*/
protected function getItemId()
{
diff --git a/administrator/components/com_plugins/models/plugin.php b/administrator/components/com_plugins/models/plugin.php
index 3a4f8513649c4..75866a30283e0 100644
--- a/administrator/components/com_plugins/models/plugin.php
+++ b/administrator/components/com_plugins/models/plugin.php
@@ -12,9 +12,7 @@
/**
* Plugin model.
*
- * @package Joomla.Administrator
- * @subpackage com_plugins
- * @since 1.6
+ * @since 1.6
*/
class PluginsModelPlugin extends JModelAdmin
{
@@ -53,8 +51,9 @@ class PluginsModelPlugin extends JModelAdmin
*
* @param array $data Data for the form.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
- *
- * @return JForm A JForm object on success, false on failure
+ *
+ * @return JForm A JForm object on success, false on failure.
+ *
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
@@ -104,6 +103,7 @@ public function getForm($data = array(), $loadData = true)
* Method to get the data that should be injected in the form.
*
* @return mixed The data for the form.
+ *
* @since 1.6
*/
protected function loadFormData()
@@ -124,7 +124,7 @@ protected function loadFormData()
/**
* Method to get a single record.
*
- * @param integer The id of the primary key.
+ * @param integer $pk The id of the primary key.
*
* @return mixed Object on success, false on failure.
*/
@@ -146,6 +146,7 @@ public function getItem($pk = null)
if ($return === false && $table->getError())
{
$this->setError($table->getError());
+
return $false;
}
@@ -175,13 +176,14 @@ public function getItem($pk = null)
}
/**
- * Returns a reference to the a Table object, always creating it.
+ * Returns a reference to the Table object, always creating it.
+ *
+ * @param string $type The table type to instantiate.
+ * @param string $prefix A prefix for the table class name. Optional.
+ * @param array $config Configuration array for model. Optional.
*
- * @param type The table type to instantiate
- * @param string A prefix for the table class name. Optional.
- * @param array Configuration array for model. Optional.
* @return JTable A database object
- */
+ */
public function getTable($type = 'Extension', $prefix = 'JTable', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
@@ -193,6 +195,7 @@ public function getTable($type = 'Extension', $prefix = 'JTable', $config = arra
* Note. Calling getState in this method will result in recursion.
*
* @return void
+ *
* @since 1.6
*/
protected function populateState()
@@ -208,9 +211,14 @@ protected function populateState()
}
/**
- * @param object A form object.
- * @param mixed The data expected for the form.
+ * Preprocess the form.
+ *
+ * @param JForm $form A form object.
+ * @param mixed $data The data expected for the form.
+ * @param string $group Cache group name.
+ *
* @return mixed True if successful.
+ *
* @throws Exception if there is an error in the form event.
* @since 1.6
*/
@@ -245,6 +253,7 @@ protected function preprocessForm(JForm $form, $data, $group = 'content')
}
$formFile = JPath::clean(JPATH_PLUGINS . '/' . $folder . '/' . $element . '/' . $element . '.xml');
+
if (!file_exists($formFile))
{
throw new Exception(JText::sprintf('COM_PLUGINS_ERROR_FILE_NOT_FOUND', $element . '.xml'));
@@ -271,6 +280,7 @@ protected function preprocessForm(JForm $form, $data, $group = 'content')
// Get the help data from the XML file if present.
$help = $xml->xpath('/extension/help');
+
if (!empty($help))
{
$helpKey = trim((string) $help[0]['key']);
@@ -287,8 +297,10 @@ protected function preprocessForm(JForm $form, $data, $group = 'content')
/**
* A protected method to get a set of ordering conditions.
*
- * @param object A record object.
+ * @param object $table A record object.
+ *
* @return array An array of conditions to add to add to ordering queries.
+ *
* @since 1.6
*/
protected function getReorderConditions($table)
@@ -296,14 +308,17 @@ protected function getReorderConditions($table)
$condition = array();
$condition[] = 'type = ' . $this->_db->quote($table->type);
$condition[] = 'folder = ' . $this->_db->quote($table->folder);
+
return $condition;
}
/**
* Override method to save the form data.
*
- * @param array The form data.
+ * @param array $data The form data.
+ *
* @return boolean True on success.
+ *
* @since 1.6
*/
public function save($data)
@@ -311,7 +326,7 @@ public function save($data)
// Load the extension plugin group.
JPluginHelper::importPlugin('extension');
- // Setup type
+ // Setup type.
$data['type'] = 'plugin';
return parent::save($data);
@@ -321,6 +336,7 @@ public function save($data)
* Get the necessary data to load an item help screen.
*
* @return object An object with key, url, and local properties for loading the item help screen.
+ *
* @since 1.6
*/
public function getHelp()
@@ -329,7 +345,12 @@ public function getHelp()
}
/**
- * Custom clean cache method, plugins are cached in 2 places for different clients
+ * Custom clean cache method, plugins are cached in 2 places for different clients.
+ *
+ * @param string $group Cache group name.
+ * @param integer $client_id Application client id.
+ *
+ * @return void
*
* @since 1.6
*/
diff --git a/administrator/components/com_plugins/models/plugins.php b/administrator/components/com_plugins/models/plugins.php
index 98ddf9617d43d..f9703aead81c2 100644
--- a/administrator/components/com_plugins/models/plugins.php
+++ b/administrator/components/com_plugins/models/plugins.php
@@ -12,16 +12,15 @@
/**
* Methods supporting a list of plugin records.
*
- * @package Joomla.Administrator
- * @subpackage com_plugins
- * @since 1.6
+ * @since 1.6
*/
class PluginsModelPlugins extends JModelList
{
/**
* Constructor.
*
- * @param array An optional associative array of configuration settings.
+ * @param array $config An optional associative array of configuration settings.
+ *
* @see JController
* @since 1.6
*/
@@ -92,7 +91,7 @@ protected function populateState($ordering = null, $direction = null)
* different modules that might need different sets of data or different
* ordering requirements.
*
- * @param string A prefix for the store id.
+ * @param string $id A prefix for the store id.
*
* @return string A store id.
*/
@@ -109,25 +108,29 @@ protected function getStoreId($id = '')
}
/**
- * Returns an object list
+ * Returns an object list.
+ *
+ * @param JDatabaseQuery $query A database query object.
+ * @param integer $limitstart Offset.
+ * @param integer $limit The number of records.
*
- * @param string The query
- * @param int Offset
- * @param int The number of records
* @return array
*/
protected function _getList($query, $limitstart = 0, $limit = 0)
{
$search = $this->getState('filter.search');
$ordering = $this->getState('list.ordering', 'ordering');
+
if ($ordering == 'name' || (!empty($search) && stripos($search, 'id:') !== 0))
{
$this->_db->setQuery($query);
$result = $this->_db->loadObjectList();
$this->translate($result);
+
if (!empty($search))
{
$search = str_replace(' ', '.*', preg_quote(trim($search), '/'));
+
foreach ($result as $i => $item)
{
if (!preg_match("/$search/i", $item->name))
@@ -142,11 +145,13 @@ protected function _getList($query, $limitstart = 0, $limit = 0)
$total = count($result);
$this->cache[$this->getStoreId('getTotal')] = $total;
+
if ($total < $limitstart)
{
$limitstart = 0;
$this->setState('list.start', 0);
}
+
return array_slice($result, $limitstart, $limit ? $limit : null);
}
else
@@ -156,23 +161,27 @@ protected function _getList($query, $limitstart = 0, $limit = 0)
$query->order('a.folder ASC');
$ordering = 'a.ordering';
}
+
$query->order($this->_db->quoteName($ordering) . ' ' . $this->getState('list.direction'));
if ($ordering == 'folder')
{
$query->order('a.ordering ASC');
}
+
$result = parent::_getList($query, $limitstart, $limit);
$this->translate($result);
+
return $result;
}
}
/**
- * Translate a list of objects
+ * Translate a list of objects.
*
- * @param array The array of objects
- * @return array The array of translated objects
+ * @param array &$items The array of objects.
+ *
+ * @return array The array of translated objects.
*/
protected function translate(&$items)
{
@@ -224,8 +233,9 @@ protected function getListQuery()
$query->where('a.access = ' . (int) $access);
}
- // Filter by published state
+ // Filter by published state.
$published = $this->getState('filter.enabled');
+
if (is_numeric($published))
{
$query->where('a.enabled = ' . (int) $published);
@@ -235,7 +245,7 @@ protected function getListQuery()
$query->where('(a.enabled IN (0, 1))');
}
- // Filter by state
+ // Filter by state.
$query->where('a.state >= 0');
// Filter by folder.
@@ -244,8 +254,9 @@ protected function getListQuery()
$query->where('a.folder = ' . $db->quote($folder));
}
- // Filter by search in name or id
+ // Filter by search in name or id.
$search = $this->getState('filter.search');
+
if (!empty($search))
{
if (stripos($search, 'id:') === 0)
diff --git a/administrator/components/com_plugins/views/plugin/view.html.php b/administrator/components/com_plugins/views/plugin/view.html.php
index f5aa4765d5da4..73b766c11b124 100644
--- a/administrator/components/com_plugins/views/plugin/view.html.php
+++ b/administrator/components/com_plugins/views/plugin/view.html.php
@@ -12,9 +12,7 @@
/**
* View to edit a plugin.
*
- * @package Joomla.Administrator
- * @subpackage com_plugins
- * @since 1.5
+ * @since 1.5
*/
class PluginsViewPlugin extends JViewLegacy
{
@@ -25,7 +23,11 @@ class PluginsViewPlugin extends JViewLegacy
protected $state;
/**
- * Display the view
+ * Display the view.
+ *
+ * @param string $tpl The name of the template file to parse; automatically searches through the template paths.
+ *
+ * @return mixed A string if successful, otherwise a Error object.
*/
public function display($tpl = null)
{
@@ -37,6 +39,7 @@ public function display($tpl = null)
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
+
return false;
}
@@ -47,6 +50,8 @@ public function display($tpl = null)
/**
* Add the page title and toolbar.
*
+ * @return void
+ *
* @since 1.6
*/
protected function addToolbar()
@@ -63,13 +68,15 @@ protected function addToolbar()
JToolbarHelper::apply('plugin.apply');
JToolbarHelper::save('plugin.save');
}
+
JToolbarHelper::cancel('plugin.cancel', 'JTOOLBAR_CLOSE');
JToolbarHelper::divider();
- // Get the help information for the plugin item.
+ // Get the help information for the plugin item.
$lang = JFactory::getLanguage();
$help = $this->get('Help');
+
if ($lang->hasKey($help->url))
{
$debug = $lang->setDebug(false);
@@ -80,6 +87,7 @@ protected function addToolbar()
{
$url = null;
}
+
JToolbarHelper::help($help->key, false, $url);
}
}
diff --git a/administrator/components/com_plugins/views/plugins/view.html.php b/administrator/components/com_plugins/views/plugins/view.html.php
index 6c3aedaefd6e8..5f5cbb4b6287d 100644
--- a/administrator/components/com_plugins/views/plugins/view.html.php
+++ b/administrator/components/com_plugins/views/plugins/view.html.php
@@ -12,9 +12,7 @@
/**
* View class for a list of plugins.
*
- * @package Joomla.Administrator
- * @subpackage com_plugins
- * @since 1.5
+ * @since 1.5
*/
class PluginsViewPlugins extends JViewLegacy
{
@@ -25,7 +23,11 @@ class PluginsViewPlugins extends JViewLegacy
protected $state;
/**
- * Display the view
+ * Display the view.
+ *
+ * @param string $tpl The name of the template file to parse; automatically searches through the template paths.
+ *
+ * @return mixed A string if successful, otherwise a Error object.
*/
public function display($tpl = null)
{
@@ -37,10 +39,11 @@ public function display($tpl = null)
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
+
return false;
}
- // Check if there are no matching items
+ // Check if there are no matching items.
if (!count($this->items))
{
JFactory::getApplication()->enqueueMessage(
@@ -56,6 +59,8 @@ public function display($tpl = null)
/**
* Add the page title and toolbar.
*
+ * @return void
+ *
* @since 1.6
*/
protected function addToolbar()
@@ -86,31 +91,30 @@ protected function addToolbar()
JHtmlSidebar::setAction('index.php?option=com_plugins&view=plugins');
JHtmlSidebar::addFilter(
- JText::_('JOPTION_SELECT_PUBLISHED'),
- 'filter_enabled',
- JHtml::_('select.options', PluginsHelper::publishedOptions(), 'value', 'text', $this->state->get('filter.enabled'), true)
+ JText::_('JOPTION_SELECT_PUBLISHED'),
+ 'filter_enabled',
+ JHtml::_('select.options', PluginsHelper::publishedOptions(), 'value', 'text', $this->state->get('filter.enabled'), true)
);
JHtmlSidebar::addFilter(
- JText::_('COM_PLUGINS_OPTION_FOLDER'),
- 'filter_folder',
- JHtml::_('select.options', PluginsHelper::folderOptions(), 'value', 'text', $this->state->get('filter.folder'))
+ JText::_('COM_PLUGINS_OPTION_FOLDER'),
+ 'filter_folder',
+ JHtml::_('select.options', PluginsHelper::folderOptions(), 'value', 'text', $this->state->get('filter.folder'))
);
JHtmlSidebar::addFilter(
- JText::_('JOPTION_SELECT_ACCESS'),
- 'filter_access',
- JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
+ JText::_('JOPTION_SELECT_ACCESS'),
+ 'filter_access',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
);
$this->sidebar = JHtmlSidebar::render();
-
}
/**
- * Returns an array of fields the table can be sorted by
+ * Returns an array of fields the table can be sorted by.
*
- * @return array Array containing the field name to sort by as the key and display text as value
+ * @return array Array containing the field name to sort by as the key and display text as value.
*
* @since 3.0
*/
diff --git a/administrator/components/com_postinstall/controllers/message.php b/administrator/components/com_postinstall/controllers/message.php
index c09e2949eefe0..9a2e7f80b5f7b 100644
--- a/administrator/components/com_postinstall/controllers/message.php
+++ b/administrator/components/com_postinstall/controllers/message.php
@@ -9,10 +9,15 @@
defined('_JEXEC') or die;
+/**
+ * Postinstall message controller.
+ *
+ * @since 3.2
+ */
class PostinstallControllerMessage extends FOFController
{
/**
- * Resets all post-installation messages of the specified extension
+ * Resets all post-installation messages of the specified extension.
*
* @return void
*
@@ -30,7 +35,7 @@ public function reset()
}
/**
- * Executes the action associated with an item
+ * Executes the action associated with an item.
*
* @return void
*
@@ -38,7 +43,7 @@ public function reset()
*/
public function action()
{
- // CSRF prevention
+ // CSRF prevention.
if ($this->csrfProtection)
{
$this->_csrfProtection();
diff --git a/administrator/components/com_postinstall/models/messages.php b/administrator/components/com_postinstall/models/messages.php
index 8eec4eaa73b17..19fe6b3bc6519 100644
--- a/administrator/components/com_postinstall/models/messages.php
+++ b/administrator/components/com_postinstall/models/messages.php
@@ -12,9 +12,7 @@
/**
* Model class to manage postinstall messages
*
- * @package Joomla.Administrator
- * @subpackage com_postinstall
- * @since 3.2
+ * @since 3.2
*/
class PostinstallModelMessages extends FOFModel
{
@@ -117,7 +115,7 @@ public function resetMessages($eid)
* Do note that this a core method of the RAD Layer which operates directly
* on the list it's being fed. A little touch of modern magic.
*
- * @param array $resultArray A list of items to process
+ * @param array &$resultArray A list of items to process
*
* @return void
*
@@ -130,7 +128,7 @@ protected function onProcessList(&$resultArray)
foreach ($resultArray as $key => $item)
{
- // Filter out messages based on dynamically loaded programmatic conditions
+ // Filter out messages based on dynamically loaded programmatic conditions.
if (!empty($item->condition_file) && !empty($item->condition_method))
{
jimport('joomla.filesystem.file');
@@ -150,7 +148,7 @@ protected function onProcessList(&$resultArray)
}
}
- // Load the necessary language files
+ // Load the necessary language files.
if (!empty($item->language_extension))
{
$hash = $item->language_client_id . '-' . $item->language_extension;
diff --git a/administrator/components/com_postinstall/postinstall.php b/administrator/components/com_postinstall/postinstall.php
index e8450c4535942..2d938f8c5d7ec 100644
--- a/administrator/components/com_postinstall/postinstall.php
+++ b/administrator/components/com_postinstall/postinstall.php
@@ -9,11 +9,11 @@
defined('_JEXEC') or die;
-// Load the RAD layer
+// Load the RAD layer.
if (!defined('FOF_INCLUDED'))
{
require_once JPATH_LIBRARIES . '/fof/include.php';
}
-// Dispatch the component
-FOFDispatcher::getTmpInstance('com_postinstall')->dispatch();
\ No newline at end of file
+// Dispatch the component.
+FOFDispatcher::getTmpInstance('com_postinstall')->dispatch();
diff --git a/administrator/components/com_postinstall/toolbar.php b/administrator/components/com_postinstall/toolbar.php
index 52018617d25e1..15f956ec2f62e 100644
--- a/administrator/components/com_postinstall/toolbar.php
+++ b/administrator/components/com_postinstall/toolbar.php
@@ -12,9 +12,7 @@
/**
* The Toolbar class renders the component title area and the toolbar.
*
- * @package Joomla.Administrator
- * @subpackage com_postinstall
- * @since 3.2
+ * @since 3.2
*/
class PostinstallToolbar extends FOFToolbar
{
diff --git a/administrator/components/com_postinstall/views/messages/view.html.php b/administrator/components/com_postinstall/views/messages/view.html.php
index bebcf08eaa36e..9f5e7dc2010ec 100644
--- a/administrator/components/com_postinstall/views/messages/view.html.php
+++ b/administrator/components/com_postinstall/views/messages/view.html.php
@@ -12,9 +12,7 @@
/**
* Model class to display postinstall messages
*
- * @package Joomla.Administrator
- * @subpackage com_postinstall
- * @since 3.2
+ * @since 3.2
*/
class PostinstallViewMessages extends FOFViewHtml
{
diff --git a/administrator/components/com_redirect/controller.php b/administrator/components/com_redirect/controller.php
index b4739532896dc..9d6474c0397dc 100644
--- a/administrator/components/com_redirect/controller.php
+++ b/administrator/components/com_redirect/controller.php
@@ -12,9 +12,7 @@
/**
* Redirect master display controller.
*
- * @package Joomla.Administrator
- * @subpackage com_redirect
- * @since 1.6
+ * @since 1.6
*/
class RedirectController extends JControllerLegacy
{
@@ -27,15 +25,16 @@ class RedirectController extends JControllerLegacy
/**
* Method to display a view.
*
- * @param boolean If true, the view output will be cached
- * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
+ * @param boolean $cachable If true, the view output will be cached.
+ * @param mixed $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.
+ *
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
- require_once JPATH_COMPONENT.'/helpers/redirect.php';
+ require_once JPATH_COMPONENT . '/helpers/redirect.php';
// Load the submenu.
RedirectHelper::addSubmenu($this->input->get('view', 'links'));
diff --git a/administrator/components/com_redirect/controllers/link.php b/administrator/components/com_redirect/controllers/link.php
index c89ebfc50a133..7855ab348ca93 100644
--- a/administrator/components/com_redirect/controllers/link.php
+++ b/administrator/components/com_redirect/controllers/link.php
@@ -12,9 +12,7 @@
/**
* Redirect link controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_redirect
- * @since 1.6
+ * @since 1.6
*/
class RedirectControllerLink extends JControllerForm
{
diff --git a/administrator/components/com_redirect/controllers/links.php b/administrator/components/com_redirect/controllers/links.php
index a2c707610e788..d22aa7f53e73d 100644
--- a/administrator/components/com_redirect/controllers/links.php
+++ b/administrator/components/com_redirect/controllers/links.php
@@ -12,14 +12,15 @@
/**
* Redirect link list controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_redirect
- * @since 1.6
+ * @since 1.6
*/
class RedirectControllerLinks extends JControllerAdmin
{
/**
* Method to update a record.
+ *
+ * @return void.
+ *
* @since 1.6
*/
public function activate()
@@ -47,7 +48,8 @@ public function activate()
{
JError::raiseWarning(500, $model->getError());
}
- else {
+ else
+ {
$this->setMessage(JText::plural('COM_REDIRECT_N_LINKS_UPDATED', count($ids)));
}
}
@@ -57,6 +59,13 @@ public function activate()
/**
* Proxy for getModel.
+ *
+ * @param string $name The name of the model.
+ * @param string $prefix The prefix of the model.
+ * @param array $config An array of settings.
+ *
+ * @return JModel instance
+ *
* @since 1.6
*/
public function getModel($name = 'Link', $prefix = 'RedirectModel', $config = array('ignore_request' => true))
diff --git a/administrator/components/com_redirect/helpers/html/redirect.php b/administrator/components/com_redirect/helpers/html/redirect.php
index 9201418b726ac..254d167dc08fc 100644
--- a/administrator/components/com_redirect/helpers/html/redirect.php
+++ b/administrator/components/com_redirect/helpers/html/redirect.php
@@ -10,23 +10,33 @@
defined('_JEXEC') or die;
/**
- * Utility class for creating HTML Grids
+ * Utility class for creating HTML Grids.
*
- * @static
- * @package Joomla.Administrator
- * @subpackage com_redirect
- * @since 1.6
+ * @since 1.6
*/
class JHtmlRedirect
{
/**
- * @param int $value The state value.
- * @param int $i
- * @param string An optional prefix for the task.
- * @param boolean An optional setting for access control on the action.
+ * Display the published or unpublished state of an item.
+ *
+ * @param int $value The state value.
+ * @param int $i The ID of the item.
+ * @param boolean $canChange An optional prefix for the task.
+ *
+ * @return string
+ *
+ * @since 1.6
+ *
+ * @throws InvalidArgumentException
*/
- public static function published($value = 0, $i, $canChange = true)
+ public static function published($value = 0, $i = null, $canChange = true)
{
+ // Note: $i is required but has to be an optional argument in the function call due to argument order
+ if (null === $i)
+ {
+ throw new InvalidArgumentException('$i is a required argument in JHtmlRedirect::published');
+ }
+
// Array of image, task, title, action
$states = array(
1 => array('tick.png', 'links.unpublish', 'JENABLED', 'COM_REDIRECT_DISABLE_LINK'),
@@ -35,11 +45,11 @@ public static function published($value = 0, $i, $canChange = true)
-2 => array('trash.png', 'links.publish', 'JTRASHED', 'COM_REDIRECT_ENABLE_LINK'),
);
$state = JArrayHelper::getValue($states, (int) $value, $states[0]);
- $html = JHtml::_('image', 'admin/'.$state[0], JText::_($state[2]), null, true);
+ $html = JHtml::_('image', 'admin/' . $state[0], JText::_($state[2]), null, true);
+
if ($canChange)
{
- $html = ''
- . $html.'';
+ $html = '' . $html . '';
}
return $html;
diff --git a/administrator/components/com_redirect/helpers/redirect.php b/administrator/components/com_redirect/helpers/redirect.php
index 156917a8ea3cc..7814e5f93fcb8 100644
--- a/administrator/components/com_redirect/helpers/redirect.php
+++ b/administrator/components/com_redirect/helpers/redirect.php
@@ -12,9 +12,7 @@
/**
* Redirect component helper.
*
- * @package Joomla.Administrator
- * @subpackage com_redirect
- * @since 1.6
+ * @since 1.6
*/
class RedirectHelper
{
@@ -23,7 +21,11 @@ class RedirectHelper
/**
* Configure the Linkbar.
*
- * @param string The name of the active view.
+ * @param string $vName The name of the active view.
+ *
+ * @return void.
+ *
+ * @since 1.6
*/
public static function addSubmenu($vName)
{
diff --git a/administrator/components/com_redirect/models/link.php b/administrator/components/com_redirect/models/link.php
index 2184c1c77de5b..92ad5353fd7a3 100644
--- a/administrator/components/com_redirect/models/link.php
+++ b/administrator/components/com_redirect/models/link.php
@@ -12,9 +12,7 @@
/**
* Redirect link model.
*
- * @package Joomla.Administrator
- * @subpackage com_redirect
- * @since 1.6
+ * @since 1.6
*/
class RedirectModelLink extends JModelAdmin
{
@@ -27,28 +25,31 @@ class RedirectModelLink extends JModelAdmin
/**
* Method to test whether a record can be deleted.
*
- * @param object $record A record object.
+ * @param object $record A record object.
*
* @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
+ *
* @since 1.6
*/
protected function canDelete($record)
{
-
if ($record->published != -2)
{
return false;
}
+
$user = JFactory::getUser();
+
return $user->authorise('core.delete', 'com_redirect');
}
/**
* Method to test whether a record can have its state edited.
*
- * @param object $record A record object.
+ * @param object $record A record object.
*
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
+ *
* @since 1.6
*/
protected function canEditState($record)
@@ -62,10 +63,12 @@ protected function canEditState($record)
/**
* Returns a reference to the a Table object, always creating it.
*
- * @param type The table type to instantiate
- * @param string A prefix for the table class name. Optional.
- * @param array Configuration array for model. Optional.
+ * @param string $type The table type to instantiate
+ * @param string $prefix A prefix for the table class name. Optional.
+ * @param array $config Configuration array for model. Optional.
+ *
* @return JTable A database object
+ *
* @since 1.6
*/
public function getTable($type = 'Link', $prefix = 'RedirectTable', $config = array())
@@ -76,15 +79,18 @@ public function getTable($type = 'Link', $prefix = 'RedirectTable', $config = ar
/**
* Method to get the record form.
*
- * @param array $data Data for the form.
- * @param boolean $loadData True if the form is to load its own data (default case), false if not.
- * @return JForm A JForm object on success, false on failure
+ * @param array $data Data for the form.
+ * @param boolean $loadData True if the form is to load its own data (default case), false if not.
+ *
+ * @return JForm A JForm object on success, false on failure
+ *
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{
// Get the form.
$form = $this->loadForm('com_redirect.link', 'link', array('control' => 'jform', 'load_data' => $loadData));
+
if (empty($form))
{
return false;
@@ -108,6 +114,7 @@ public function getForm($data = array(), $loadData = true)
* Method to get the data that should be injected in the form.
*
* @return mixed The data for the form.
+ *
* @since 1.6
*/
protected function loadFormData()
@@ -128,10 +135,12 @@ protected function loadFormData()
/**
* Method to activate links.
*
- * @param array An array of link ids.
- * @param string The new URL to set for the redirect.
- * @param string A comment for the redirect links.
+ * @param array &$pks An array of link ids.
+ * @param string $url The new URL to set for the redirect.
+ * @param string $comment A comment for the redirect links.
+ *
* @return boolean Returns true on success, false on failure.
+ *
* @since 1.6
*/
public function activate(&$pks, $url, $comment = null)
@@ -151,6 +160,7 @@ public function activate(&$pks, $url, $comment = null)
{
$pks = array();
$this->setError(JText::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED'));
+
return false;
}
@@ -160,7 +170,7 @@ public function activate(&$pks, $url, $comment = null)
$query = $db->getQuery(true)
->update($db->quoteName('#__redirect_links'))
->set($db->quoteName('new_url') . ' = ' . $db->quote($url))
- ->set($db->quoteName('published') . ' = ' . $db->quote(1))
+ ->set($db->quoteName('published') . ' = ' . (int) 1)
->set($db->quoteName('comment') . ' = ' . $db->quote($comment))
->where($db->quoteName('id') . ' IN (' . implode(',', $pks) . ')');
$db->setQuery($query);
@@ -172,9 +182,11 @@ public function activate(&$pks, $url, $comment = null)
catch (RuntimeException $e)
{
$this->setError($e->getMessage());
+
return false;
}
}
+
return true;
}
}
diff --git a/administrator/components/com_redirect/models/links.php b/administrator/components/com_redirect/models/links.php
index e11f663366940..394daee7f5770 100644
--- a/administrator/components/com_redirect/models/links.php
+++ b/administrator/components/com_redirect/models/links.php
@@ -12,17 +12,15 @@
/**
* Methods supporting a list of redirect links.
*
- * @package Joomla.Administrator
- * @subpackage com_redirect
- * @since 1.6
+ * @since 1.6
*/
class RedirectModelLinks extends JModelList
{
/**
* Constructor.
*
- * @param array An optional associative array of configuration settings.
- * @see JController
+ * @param array $config An optional associative array of configuration settings.
+ *
* @since 1.6
*/
public function __construct($config = array())
@@ -79,9 +77,10 @@ protected function populateState($ordering = null, $direction = null)
* different modules that might need different sets of data or different
* ordering requirements.
*
- * @param string A prefix for the store id.
+ * @param string $id A prefix for the store id.
+ *
+ * @return string A store id.
*
- * @return string A store id.
* @since 1.6
*/
protected function getStoreId($id = '')
@@ -97,6 +96,7 @@ protected function getStoreId($id = '')
* Build an SQL query to load the list data.
*
* @return JDatabaseQuery
+ *
* @since 1.6
*/
protected function getListQuery()
@@ -116,6 +116,7 @@ protected function getListQuery()
// Filter by published state
$state = $this->getState('filter.state');
+
if (is_numeric($state))
{
$query->where('a.published = ' . (int) $state);
@@ -127,6 +128,7 @@ protected function getListQuery()
// Filter the items over the search string if set.
$search = $this->getState('filter.search');
+
if (!empty($search))
{
if (stripos($search, 'id:') === 0)
@@ -148,7 +150,6 @@ protected function getListQuery()
// Add the list ordering clause.
$query->order($db->escape($this->getState('list.ordering', 'a.old_url')) . ' ' . $db->escape($this->getState('list.direction', 'ASC')));
- //echo nl2br(str_replace('#__','jos_',$query));
return $query;
}
}
diff --git a/administrator/components/com_redirect/tables/link.php b/administrator/components/com_redirect/tables/link.php
index 49bb2a20d4362..33810643468ed 100644
--- a/administrator/components/com_redirect/tables/link.php
+++ b/administrator/components/com_redirect/tables/link.php
@@ -12,21 +12,18 @@
/**
* Link Table for Redirect.
*
- * @package Joomla.Administrator
- * @subpackage com_redirect
- * @since 1.6
+ * @since 1.6
*/
class RedirectTableLink extends JTable
{
/**
* Constructor
*
- * @param object Database object
+ * @param JDatabaseDriver $db Database object.
*
- * @return void
* @since 1.6
*/
- public function __construct(&$db)
+ public function __construct($db)
{
parent::__construct('#__redirect_links', 'id', $db);
}
@@ -35,6 +32,7 @@ public function __construct(&$db)
* Overloaded check function
*
* @return boolean
+ *
* @since 1.6
*/
public function check()
@@ -46,6 +44,7 @@ public function check()
if (empty($this->old_url))
{
$this->setError(JText::_('COM_REDIRECT_ERROR_SOURCE_URL_REQUIRED'));
+
return false;
}
@@ -53,6 +52,7 @@ public function check()
if (empty($this->new_url))
{
$this->setError(JText::_('COM_REDIRECT_ERROR_DESTINATION_URL_REQUIRED'));
+
return false;
}
@@ -60,6 +60,7 @@ public function check()
if ($this->old_url == $this->new_url)
{
$this->setError(JText::_('COM_REDIRECT_ERROR_DUPLICATE_URLS'));
+
return false;
}
@@ -77,6 +78,7 @@ public function check()
if ($xid && $xid != (int) $this->id)
{
$this->setError(JText::_('COM_REDIRECT_ERROR_DUPLICATE_OLD_URL'));
+
return false;
}
@@ -86,10 +88,10 @@ public function check()
/**
* Overriden store method to set dates.
*
- * @param boolean True to update fields even if they are null.
+ * @param boolean $updateNulls True to update fields even if they are null.
*
* @return boolean True on success.
- * @see JTable::store
+ *
* @since 1.6
*/
public function store($updateNulls = false)
diff --git a/administrator/components/com_redirect/views/link/view.html.php b/administrator/components/com_redirect/views/link/view.html.php
index af73e4a9a111b..b34b15adf8df0 100644
--- a/administrator/components/com_redirect/views/link/view.html.php
+++ b/administrator/components/com_redirect/views/link/view.html.php
@@ -12,9 +12,7 @@
/**
* View to edit a redirect link.
*
- * @package Joomla.Administrator
- * @subpackage com_redirect
- * @since 1.6
+ * @since 1.6
*/
class RedirectViewLink extends JViewLegacy
{
@@ -25,7 +23,11 @@ class RedirectViewLink extends JViewLegacy
protected $state;
/**
- * Display the view
+ * Display the view.
+ *
+ * @param string $tpl The name of the template file to parse; automatically searches through the template paths.
+ *
+ * @return mixed False if unsuccessful, otherwise void.
*
* @since 1.6
*/
@@ -39,6 +41,7 @@ public function display($tpl = null)
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
+
return false;
}
@@ -49,6 +52,8 @@ public function display($tpl = null)
/**
* Add the page title and toolbar.
*
+ * @return void.
+ *
* @since 1.6
*/
protected function addToolbar()
@@ -66,10 +71,11 @@ protected function addToolbar()
JToolbarHelper::save('link.save');
}
- // This component does not support Save as Copy due to uniqueness checks.
- // While it can be done, it causes too much confusion if the user does
- // not change the Old URL.
-
+ /**
+ * This component does not support Save as Copy due to uniqueness checks.
+ * While it can be done, it causes too much confusion if the user does
+ * not change the Old URL.
+ */
if ($canDo->get('core.edit') && $canDo->get('core.create'))
{
JToolbarHelper::save2new('link.save2new');
diff --git a/administrator/components/com_redirect/views/links/view.html.php b/administrator/components/com_redirect/views/links/view.html.php
index df2de3454d08a..c346c08c26a6c 100644
--- a/administrator/components/com_redirect/views/links/view.html.php
+++ b/administrator/components/com_redirect/views/links/view.html.php
@@ -12,9 +12,7 @@
/**
* View class for a list of redirection links.
*
- * @package Joomla.Administrator
- * @subpackage com_redirect
- * @since 1.6
+ * @since 1.6
*/
class RedirectViewLinks extends JViewLegacy
{
@@ -27,7 +25,11 @@ class RedirectViewLinks extends JViewLegacy
protected $state;
/**
- * Display the view
+ * Display the view.
+ *
+ * @param string $tpl The name of the template file to parse; automatically searches through the template paths.
+ *
+ * @return mixed False if unsuccessful, otherwise void.
*
* @since 1.6
*/
@@ -42,6 +44,7 @@ public function display($tpl = null)
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
+
return false;
}
@@ -53,6 +56,8 @@ public function display($tpl = null)
/**
* Add the page title and toolbar.
*
+ * @return void.
+ *
* @since 1.6
*/
protected function addToolbar()
@@ -61,24 +66,30 @@ protected function addToolbar()
$canDo = JHelperContent::getActions('com_redirect');
JToolbarHelper::title(JText::_('COM_REDIRECT_MANAGER_LINKS'), 'refresh redirect');
+
if ($canDo->get('core.create'))
{
JToolbarHelper::addNew('link.add');
}
+
if ($canDo->get('core.edit'))
{
JToolbarHelper::editList('link.edit');
}
+
if ($canDo->get('core.edit.state'))
{
- if ($state->get('filter.state') != 2){
+ if ($state->get('filter.state') != 2)
+ {
JToolbarHelper::divider();
JToolbarHelper::publish('links.publish', 'JTOOLBAR_ENABLE', true);
JToolbarHelper::unpublish('links.unpublish', 'JTOOLBAR_DISABLE', true);
}
+
if ($state->get('filter.state') != -1 )
{
JToolbarHelper::divider();
+
if ($state->get('filter.state') != 2)
{
JToolbarHelper::archiveList('links.archive');
@@ -89,20 +100,24 @@ protected function addToolbar()
}
}
}
+
if ($state->get('filter.state') == -2 && $canDo->get('core.delete'))
{
JToolbarHelper::deleteList('', 'links.delete', 'JTOOLBAR_EMPTY_TRASH');
JToolbarHelper::divider();
- } elseif ($canDo->get('core.edit.state'))
+ }
+ elseif ($canDo->get('core.edit.state'))
{
JToolbarHelper::trash('links.trash');
JToolbarHelper::divider();
}
+
if ($canDo->get('core.admin'))
{
JToolbarHelper::preferences('com_redirect');
JToolbarHelper::divider();
}
+
JToolbarHelper::help('JHELP_COMPONENTS_REDIRECT_MANAGER');
JHtmlSidebar::setAction('index.php?option=com_redirect&view=links');
diff --git a/administrator/components/com_search/controller.php b/administrator/components/com_search/controller.php
index d1b9d8fd00c30..c2ca2d2a96bd7 100644
--- a/administrator/components/com_search/controller.php
+++ b/administrator/components/com_search/controller.php
@@ -12,9 +12,7 @@
/**
* Search master display controller.
*
- * @package Joomla.Administrator
- * @subpackage com_search
- * @since 1.6
+ * @since 1.6
*/
class SearchController extends JControllerLegacy
{
@@ -27,15 +25,16 @@ class SearchController extends JControllerLegacy
/**
* Method to display a view.
*
- * @param boolean If true, the view output will be cached
- * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
+ * @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.
+ *
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
- require_once JPATH_COMPONENT.'/helpers/search.php';
+ require_once JPATH_COMPONENT . '/helpers/search.php';
// Load the submenu.
SearchHelper::addSubmenu($this->input->get('view', 'searches'));
diff --git a/administrator/components/com_search/controllers/searches.php b/administrator/components/com_search/controllers/searches.php
index 82cfe356c06e0..ab9d755dab097 100644
--- a/administrator/components/com_search/controllers/searches.php
+++ b/administrator/components/com_search/controllers/searches.php
@@ -12,9 +12,7 @@
/**
* Methods supporting a list of search terms.
*
- * @package Joomla.Administrator
- * @subpackage com_search
- * @since 1.6
+ * @since 1.6
*/
class SearchControllerSearches extends JControllerLegacy
{
diff --git a/administrator/components/com_search/helpers/search.php b/administrator/components/com_search/helpers/search.php
index 7bf046e972b26..353c08f1efcee 100644
--- a/administrator/components/com_search/helpers/search.php
+++ b/administrator/components/com_search/helpers/search.php
@@ -12,16 +12,17 @@
/**
* Search component helper.
*
- * @package Joomla.Administrator
- * @subpackage com_search
- * @since 1.5
+ * @since 1.5
*/
class SearchHelper
{
/**
* Configure the Linkbar.
*
- * @param string The name of the active view.
+ * @param string $vName The name of the active view.
+ *
+ * @return void
+ *
* @since 1.6
*/
public static function addSubmenu($vName)
@@ -34,19 +35,27 @@ public static function addSubmenu($vName)
*
* @return JObject
*
- * @deprecated 3.2 Use JHelperContent::getActions() instead
+ * @deprecated 3.2 Use JHelperContent::getActions() instead.
*/
public static function getActions()
{
- // Log usage of deprecated function
+ // Log usage of deprecated function.
JLog::add(__METHOD__ . '() is deprecated, use JHelperContent::getActions() with new arguments order instead.', JLog::WARNING, 'deprecated');
- // Get list of actions
+ // Get list of actions.
$result = JHelperContent::getActions('com_search');
return $result;
}
+ /**
+ * Sanitise search word.
+ *
+ * @param string &$searchword Search word to be sanitised.
+ * @param string $searchphrase Either 'all', 'any' or 'exact'.
+ *
+ * @return boolean True if search word needs to be sanitised.
+ */
public static function santiseSearchWord(&$searchword, $searchphrase)
{
$ignored = false;
@@ -55,7 +64,7 @@ public static function santiseSearchWord(&$searchword, $searchphrase)
$tag = $lang->getTag();
$search_ignore = $lang->getIgnoredSearchWords();
- // Deprecated in 1.6 use $lang->getIgnoredSearchWords instead
+ // Deprecated in 1.6 use $lang->getIgnoredSearchWords instead.
$ignoreFile = $lang->getLanguagePath() . '/' . $tag . '/' . $tag . '.ignore.php';
if (file_exists($ignoreFile))
@@ -63,16 +72,16 @@ public static function santiseSearchWord(&$searchword, $searchphrase)
include $ignoreFile;
}
- // Check for words to ignore
+ // Check for words to ignore.
$aterms = explode(' ', JString::strtolower($searchword));
- // First case is single ignored word
+ // First case is single ignored word.
if (count($aterms) == 1 && in_array(JString::strtolower($searchword), $search_ignore))
{
$ignored = true;
}
- // Filter out search terms that are too small
+ // Filter out search terms that are too small.
$lower_limit = $lang->getLowerLimitSearchWord();
foreach ($aterms as $aterm)
@@ -83,7 +92,7 @@ public static function santiseSearchWord(&$searchword, $searchphrase)
}
}
- // Next is to remove ignored words from type 'all' or 'any' (not exact) searches with multiple words
+ // Next is to remove ignored words from type 'all' or 'any' (not exact) searches with multiple words.
if (count($aterms) > 1 && $searchphrase != 'exact')
{
$pruned = array_diff($aterms, $search_ignore);
@@ -94,6 +103,12 @@ public static function santiseSearchWord(&$searchword, $searchphrase)
}
/**
+ * Does search word need to be limited?
+ *
+ * @param string &$searchword Search word to be checked.
+ *
+ * @return boolean True if search word should be limited; false otherwise.
+ *
* @since 1.5
*/
public static function limitSearchWord(&$searchword)
@@ -102,7 +117,7 @@ public static function limitSearchWord(&$searchword)
$lang = JFactory::getLanguage();
- // Limit searchword to a maximum of characters
+ // Limit searchword to a maximum of characters.
$upper_limit = $lang->getUpperLimitSearchWord();
if (JString::strlen($searchword) > $upper_limit)
@@ -111,7 +126,7 @@ public static function limitSearchWord(&$searchword)
$restriction = true;
}
- // Searchword must contain a minimum of characters
+ // Searchword must contain a minimum of characters.
if ($searchword && JString::strlen($searchword) < $lang->getLowerLimitSearchWord())
{
$searchword = '';
@@ -122,14 +137,14 @@ public static function limitSearchWord(&$searchword)
}
/**
- * Logs a search term
+ * Logs a search term.
*
- * @param string $search_term The term being searched
+ * @param string $search_term The term being searched.
*
* @return void
*
* @since 1.5
- * @deprecated 4.0 Use JSearchHelper::logSearch() instead
+ * @deprecated 4.0 Use JSearchHelper::logSearch() instead.
*/
public static function logSearch($search_term)
{
@@ -139,10 +154,10 @@ public static function logSearch($search_term)
}
/**
- * Prepares results from search for display
+ * Prepares results from search for display.
*
- * @param string $text The source string
- * @param string $searchword The searchword to select around
+ * @param string $text The source string.
+ * @param string $searchword The searchword to select around.
*
* @return string
*
@@ -150,26 +165,26 @@ public static function logSearch($search_term)
*/
public static function prepareSearchContent($text, $searchword)
{
- // Strips tags won't remove the actual jscript
+ // Strips tags won't remove the actual jscript.
$text = preg_replace("''si", "", $text);
$text = preg_replace('/{.+?}/', '', $text);
// $text = preg_replace('/]*>([^<]+)<\/a>/is','\2', $text);
- // Replace line breaking tags with whitespace
+ // Replace line breaking tags with whitespace.
$text = preg_replace("'<(br[^/>]*?/|hr[^/>]*?/|/(div|h[1-6]|li|p|td))>'si", ' ', $text);
return self::_smartSubstr(strip_tags($text), $searchword);
}
/**
- * Checks an object for search terms (after stripping fields of HTML)
+ * Checks an object for search terms (after stripping fields of HTML).
*
- * @param object $object The object to check
- * @param string $searchTerm Search words to check for
- * @param array $fields List of object variables to check against
+ * @param object $object The object to check.
+ * @param string $searchTerm Search words to check for.
+ * @param array $fields List of object variables to check against.
*
- * @return boolean True if searchTerm is in object, false otherwise
+ * @return boolean True if searchTerm is in object, false otherwise.
*/
public static function checkNoHtml($object, $searchTerm, $fields)
{
@@ -215,9 +230,9 @@ public static function checkNoHtml($object, $searchTerm, $fields)
}
/**
- * Transliterates given text to ASCII
+ * Transliterates given text to ASCII.
*
- * @param string $str String to remove accents from
+ * @param string $str String to remove accents from.
*
* @return string
*
@@ -227,15 +242,15 @@ public static function remove_accents($str)
{
$str = JLanguageTransliterate::utf8_latin_to_ascii($str);
- //TODO: remove other prefixes as well?
+ // @TODO: remove other prefixes as well?
return preg_replace("/[\"'^]([a-z])/ui", '\1', $str);
}
/**
- * returns substring of characters around a searchword
+ * Returns substring of characters around a searchword.
*
- * @param string $text The source string
- * @param integer $searchword Number of chars to return
+ * @param string $text The source string.
+ * @param integer $searchword Number of chars to return.
*
* @return string
*
diff --git a/administrator/components/com_search/helpers/site.php b/administrator/components/com_search/helpers/site.php
index 71c51e43006f8..3dd280cd2ad75 100644
--- a/administrator/components/com_search/helpers/site.php
+++ b/administrator/components/com_search/helpers/site.php
@@ -12,25 +12,28 @@
/**
* Mock JSite class used to fool the frontend search plugins because they route the results.
*
- * @package Joomla.Administrator
- * @subpackage com_search
- * @since 1.5
+ * @since 1.5
*/
class JSite extends JObject
{
/**
- * False method to fool the frontend search plugins
+ * False method to fool the frontend search plugins.
+ *
+ * @return JSite
*
* @since 1.5
*/
public function getMenu()
{
$result = new JSite;
+
return $result;
}
/**
- * False method to fool the frontend search plugins
+ * False method to fool the frontend search plugins.
+ *
+ * @return array
*
* @since 1.5
*/
diff --git a/administrator/components/com_search/models/searches.php b/administrator/components/com_search/models/searches.php
index b0441cac8a521..69a10b0f6c109 100644
--- a/administrator/components/com_search/models/searches.php
+++ b/administrator/components/com_search/models/searches.php
@@ -12,16 +12,15 @@
/**
* Methods supporting a list of search terms.
*
- * @package Joomla.Administrator
- * @subpackage com_search
- * @since 1.6
+ * @since 1.6
*/
class SearchModelSearches extends JModelList
{
/**
* Constructor.
*
- * @param array An optional associative array of configuration settings.
+ * @param array $config An optional associative array of configuration settings.
+ *
* @see JController
* @since 1.6
*/
@@ -74,9 +73,10 @@ protected function populateState($ordering = null, $direction = null)
* different modules that might need different sets of data or different
* ordering requirements.
*
- * @param string $id A prefix for the store id.
+ * @param string $id A prefix for the store id.
*
* @return string A store id.
+ *
* @since 1.6
*/
protected function getStoreId($id = '')
@@ -92,6 +92,7 @@ protected function getStoreId($id = '')
* Build an SQL query to load the list data.
*
* @return JDatabaseQuery
+ *
* @since 1.6
*/
protected function getListQuery()
@@ -117,6 +118,7 @@ protected function getListQuery()
// Filter by search in title
$search = $this->getState('filter.search');
+
if (!empty($search))
{
$search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%'));
@@ -126,7 +128,6 @@ protected function getListQuery()
// Add the list ordering clause.
$query->order($db->escape($this->getState('list.ordering', 'a.hits')) . ' ' . $db->escape($this->getState('list.direction', 'ASC')));
- //echo nl2br(str_replace('#__','jos_',$query));
return $query;
}
@@ -134,6 +135,7 @@ protected function getListQuery()
* Override the parnet getItems to inject optional data.
*
* @return mixed An array of objects on success, false on failure.
+ *
* @since 1.6
*/
public function getItems()
@@ -157,6 +159,7 @@ public function getItems()
{
$results = $app->triggerEvent('onContentSearch', array($item->search_term));
$item->returns = 0;
+
foreach ($results as $result)
{
$item->returns += count($result);
@@ -171,6 +174,7 @@ public function getItems()
* Method to reset the seach log table.
*
* @return boolean
+ *
* @since 1.6
*/
public function reset()
@@ -187,6 +191,7 @@ public function reset()
catch (RuntimeException $e)
{
$this->setError($e->getMessage());
+
return false;
}
diff --git a/administrator/components/com_search/views/searches/view.html.php b/administrator/components/com_search/views/searches/view.html.php
index 55343b49c05ae..c66b0ab80192a 100644
--- a/administrator/components/com_search/views/searches/view.html.php
+++ b/administrator/components/com_search/views/searches/view.html.php
@@ -12,9 +12,7 @@
/**
* View class for a list of search terms.
*
- * @package Joomla.Administrator
- * @subpackage com_search
- * @since 1.5
+ * @since 1.5
*/
class SearchViewSearches extends JViewLegacy
{
@@ -27,7 +25,11 @@ class SearchViewSearches extends JViewLegacy
protected $state;
/**
- * Display the view
+ * Display the view.
+ *
+ * @param string $tpl The name of the template file to parse; automatically searches through the template paths.
+ *
+ * @return mixed A string if successful, otherwise a Error object.
*/
public function display($tpl = null)
{
@@ -41,6 +43,7 @@ public function display($tpl = null)
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
+
return false;
}
@@ -51,6 +54,8 @@ public function display($tpl = null)
/**
* Add the page title and toolbar.
*
+ * @return void
+ *
* @since 1.6
*/
protected function addToolbar()
@@ -63,11 +68,14 @@ protected function addToolbar()
{
JToolbarHelper::custom('searches.reset', 'refresh.png', 'refresh_f2.png', 'JSEARCH_RESET', false);
}
+
JToolbarHelper::divider();
+
if ($canDo->get('core.admin'))
{
JToolbarHelper::preferences('com_search');
}
+
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_COMPONENTS_SEARCH');
}
diff --git a/administrator/components/com_tags/controller.php b/administrator/components/com_tags/controller.php
index 9b6f4bca3bb7a..545528f7e176c 100644
--- a/administrator/components/com_tags/controller.php
+++ b/administrator/components/com_tags/controller.php
@@ -12,9 +12,7 @@
/**
* Tags view class for the Tags package.
*
- * @package Joomla.Administrator
- * @subpackage com_tags
- * @since 3.1
+ * @since 3.1
*/
class TagsController extends JControllerLegacy
{
diff --git a/administrator/components/com_tags/controllers/tag.php b/administrator/components/com_tags/controllers/tag.php
index e5ba38534e3f7..b46e44586ddc4 100644
--- a/administrator/components/com_tags/controllers/tag.php
+++ b/administrator/components/com_tags/controllers/tag.php
@@ -12,9 +12,7 @@
/**
* The Tag Controller
*
- * @package Joomla.Administrator
- * @subpackage com_tags
- * @since 3.1
+ * @since 3.1
*/
class TagsControllerTag extends JControllerForm
{
diff --git a/administrator/components/com_tags/controllers/tags.php b/administrator/components/com_tags/controllers/tags.php
index 08a6b620eab4a..af330874e73b4 100644
--- a/administrator/components/com_tags/controllers/tags.php
+++ b/administrator/components/com_tags/controllers/tags.php
@@ -12,9 +12,7 @@
/**
* The Tags List Controller
*
- * @package Joomla.Administrator
- * @subpackage com_tags
- * @since 3.1
+ * @since 3.1
*/
class TagsControllerTags extends JControllerAdmin
{
diff --git a/administrator/components/com_tags/helpers/tags.php b/administrator/components/com_tags/helpers/tags.php
index d34ae4e7e5f2c..009df8bd83a04 100644
--- a/administrator/components/com_tags/helpers/tags.php
+++ b/administrator/components/com_tags/helpers/tags.php
@@ -12,9 +12,7 @@
/**
* Tags helper.
*
- * @package Joomla.Administrator
- * @subpackage com_tags
- * @since 3.1
+ * @since 3.1
*/
class TagsHelper extends JHelperContent
{
diff --git a/administrator/components/com_tags/models/tag.php b/administrator/components/com_tags/models/tag.php
index 7f402f923f8a9..88e9ed2309819 100644
--- a/administrator/components/com_tags/models/tag.php
+++ b/administrator/components/com_tags/models/tag.php
@@ -12,9 +12,7 @@
/**
* Tags Component Tag Model
*
- * @package Joomla.Administrator
- * @subpackage com_tags
- * @since 3.1
+ * @since 3.1
*/
class TagsModelTag extends JModelAdmin
{
diff --git a/administrator/components/com_tags/models/tags.php b/administrator/components/com_tags/models/tags.php
index 898ba21664579..64ad947a1bd93 100644
--- a/administrator/components/com_tags/models/tags.php
+++ b/administrator/components/com_tags/models/tags.php
@@ -12,9 +12,7 @@
/**
* Tags Component Tags Model
*
- * @package Joomla.Administrator
- * @subpackage com_tags
- * @since 3.1
+ * @since 3.1
*/
class TagsModelTags extends JModelList
{
diff --git a/administrator/components/com_tags/tables/tag.php b/administrator/components/com_tags/tables/tag.php
index de5d6d7587d36..171284ad7b3a9 100644
--- a/administrator/components/com_tags/tables/tag.php
+++ b/administrator/components/com_tags/tables/tag.php
@@ -12,9 +12,7 @@
/**
* Tags table
*
- * @package Joomla.Administrator
- * @subpackage com_tags
- * @since 3.1
+ * @since 3.1
*/
class TagsTableTag extends JTableNested
{
diff --git a/administrator/components/com_tags/views/tag/view.html.php b/administrator/components/com_tags/views/tag/view.html.php
index bf2f56805d7af..73abc9c3096d9 100644
--- a/administrator/components/com_tags/views/tag/view.html.php
+++ b/administrator/components/com_tags/views/tag/view.html.php
@@ -12,9 +12,7 @@
/**
* HTML View class for the Tags component
*
- * @package Joomla.Administrator
- * @subpackage com_tags
- * @since 3.1
+ * @since 3.1
*/
class TagsViewTag extends JViewLegacy
{
diff --git a/administrator/components/com_tags/views/tags/view.html.php b/administrator/components/com_tags/views/tags/view.html.php
index a1f959f24dc23..b964ce38c25fc 100644
--- a/administrator/components/com_tags/views/tags/view.html.php
+++ b/administrator/components/com_tags/views/tags/view.html.php
@@ -12,9 +12,7 @@
/**
* Tags view class for the Tags package.
*
- * @package Joomla.Administrator
- * @subpackage com_tags
- * @since 3.1
+ * @since 3.1
*/
class TagsViewTags extends JViewLegacy
{
diff --git a/administrator/components/com_templates/controller.php b/administrator/components/com_templates/controller.php
index bf77577b77ac3..f268b803210df 100644
--- a/administrator/components/com_templates/controller.php
+++ b/administrator/components/com_templates/controller.php
@@ -12,9 +12,7 @@
/**
* Templates manager master display controller.
*
- * @package Joomla.Administrator
- * @subpackage com_templates
- * @since 1.6
+ * @since 1.6
*/
class TemplatesController extends JControllerLegacy
{
diff --git a/administrator/components/com_templates/controllers/style.php b/administrator/components/com_templates/controllers/style.php
index 2188a9d5b5312..f61ad30a7f4ac 100644
--- a/administrator/components/com_templates/controllers/style.php
+++ b/administrator/components/com_templates/controllers/style.php
@@ -12,9 +12,7 @@
/**
* Template style controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_templates
- * @since 1.6
+ * @since 1.6
*/
class TemplatesControllerStyle extends JControllerForm
{
diff --git a/administrator/components/com_templates/controllers/styles.php b/administrator/components/com_templates/controllers/styles.php
index 57ac317cfa31c..16f735c48eb5e 100644
--- a/administrator/components/com_templates/controllers/styles.php
+++ b/administrator/components/com_templates/controllers/styles.php
@@ -12,9 +12,7 @@
/**
* Template styles list controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_templates
- * @since 1.6
+ * @since 1.6
*/
class TemplatesControllerStyles extends JControllerAdmin
{
diff --git a/administrator/components/com_templates/controllers/template.php b/administrator/components/com_templates/controllers/template.php
index d276f59584f14..d40542be11599 100644
--- a/administrator/components/com_templates/controllers/template.php
+++ b/administrator/components/com_templates/controllers/template.php
@@ -14,9 +14,7 @@
/**
* Template style controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_templates
- * @since 1.6
+ * @since 1.6
*/
class TemplatesControllerTemplate extends JControllerLegacy
{
diff --git a/administrator/components/com_templates/helpers/html/templates.php b/administrator/components/com_templates/helpers/html/templates.php
index ee6bd5007a940..07399e9831f3a 100644
--- a/administrator/components/com_templates/helpers/html/templates.php
+++ b/administrator/components/com_templates/helpers/html/templates.php
@@ -10,8 +10,7 @@
defined('_JEXEC') or die;
/**
- * @package Joomla.Administrator
- * @subpackage com_templates
+ * JHtml helper class.
*/
class JHtmlTemplates
{
diff --git a/administrator/components/com_templates/helpers/template.php b/administrator/components/com_templates/helpers/template.php
index f4c9330f39231..37411e19aabe1 100644
--- a/administrator/components/com_templates/helpers/template.php
+++ b/administrator/components/com_templates/helpers/template.php
@@ -12,9 +12,7 @@
/**
* Template Helper class.
*
- * @package Joomla.Administrator
- * @subpackage com_templates
- * @since 3.2
+ * @since 3.2
*/
abstract class TemplateHelper
{
diff --git a/administrator/components/com_templates/helpers/templates.php b/administrator/components/com_templates/helpers/templates.php
index 17e37231fe407..892f021a5d4d2 100644
--- a/administrator/components/com_templates/helpers/templates.php
+++ b/administrator/components/com_templates/helpers/templates.php
@@ -12,9 +12,7 @@
/**
* Templates component helper.
*
- * @package Joomla.Administrator
- * @subpackage com_templates
- * @since 1.6
+ * @since 1.6
*/
class TemplatesHelper
{
diff --git a/administrator/components/com_templates/models/style.php b/administrator/components/com_templates/models/style.php
index 17c549923246c..fa352b17fcf4b 100644
--- a/administrator/components/com_templates/models/style.php
+++ b/administrator/components/com_templates/models/style.php
@@ -12,9 +12,7 @@
/**
* Template style model.
*
- * @package Joomla.Administrator
- * @subpackage com_templates
- * @since 1.6
+ * @since 1.6
*/
class TemplatesModelStyle extends JModelAdmin
{
diff --git a/administrator/components/com_templates/models/styles.php b/administrator/components/com_templates/models/styles.php
index e5c3e7438c893..bb0fef0ef56ed 100644
--- a/administrator/components/com_templates/models/styles.php
+++ b/administrator/components/com_templates/models/styles.php
@@ -12,9 +12,7 @@
/**
* Methods supporting a list of template style records.
*
- * @package Joomla.Administrator
- * @subpackage com_templates
- * @since 1.6
+ * @since 1.6
*/
class TemplatesModelStyles extends JModelList
{
diff --git a/administrator/components/com_templates/models/template.php b/administrator/components/com_templates/models/template.php
index 7506868645a7c..ad13ae1ea75dc 100644
--- a/administrator/components/com_templates/models/template.php
+++ b/administrator/components/com_templates/models/template.php
@@ -12,9 +12,7 @@
/**
* Template model class.
*
- * @package Joomla.Administrator
- * @subpackage com_templates
- * @since 1.6
+ * @since 1.6
*/
class TemplatesModelTemplate extends JModelForm
{
diff --git a/administrator/components/com_templates/models/templates.php b/administrator/components/com_templates/models/templates.php
index 810e320381fae..7cf979370455a 100644
--- a/administrator/components/com_templates/models/templates.php
+++ b/administrator/components/com_templates/models/templates.php
@@ -12,9 +12,7 @@
/**
* Methods supporting a list of template extension records.
*
- * @package Joomla.Administrator
- * @subpackage com_templates
- * @since 1.6
+ * @since 1.6
*/
class TemplatesModelTemplates extends JModelList
{
diff --git a/administrator/components/com_templates/tables/style.php b/administrator/components/com_templates/tables/style.php
index c890ad6c894ac..a3d63f1798042 100644
--- a/administrator/components/com_templates/tables/style.php
+++ b/administrator/components/com_templates/tables/style.php
@@ -12,9 +12,7 @@
/**
* Template style table class.
*
- * @package Joomla.Administrator
- * @subpackage com_templates
- * @since 1.6
+ * @since 1.6
*/
class TemplatesTableStyle extends JTable
{
diff --git a/administrator/components/com_templates/views/style/view.html.php b/administrator/components/com_templates/views/style/view.html.php
index 2e33b29549ef1..2c8307152cd1e 100644
--- a/administrator/components/com_templates/views/style/view.html.php
+++ b/administrator/components/com_templates/views/style/view.html.php
@@ -12,9 +12,7 @@
/**
* View to edit a template style.
*
- * @package Joomla.Administrator
- * @subpackage com_templates
- * @since 1.6
+ * @since 1.6
*/
class TemplatesViewStyle extends JViewLegacy
{
diff --git a/administrator/components/com_templates/views/style/view.json.php b/administrator/components/com_templates/views/style/view.json.php
index 01f7fdc7a80d2..5e41fa94ef2ad 100644
--- a/administrator/components/com_templates/views/style/view.json.php
+++ b/administrator/components/com_templates/views/style/view.json.php
@@ -12,9 +12,7 @@
/**
* View to edit a template style.
*
- * @package Joomla.Administrator
- * @subpackage com_templates
- * @since 1.6
+ * @since 1.6
*/
class TemplatesViewStyle extends JViewLegacy
{
diff --git a/administrator/components/com_templates/views/styles/view.html.php b/administrator/components/com_templates/views/styles/view.html.php
index 981f6b134b77d..3d6886b7ad005 100644
--- a/administrator/components/com_templates/views/styles/view.html.php
+++ b/administrator/components/com_templates/views/styles/view.html.php
@@ -12,9 +12,7 @@
/**
* View class for a list of template styles.
*
- * @package Joomla.Administrator
- * @subpackage com_templates
- * @since 1.6
+ * @since 1.6
*/
class TemplatesViewStyles extends JViewLegacy
{
diff --git a/administrator/components/com_templates/views/template/view.html.php b/administrator/components/com_templates/views/template/view.html.php
index 1fe1bd316bc96..a90ee5b35ad9c 100644
--- a/administrator/components/com_templates/views/template/view.html.php
+++ b/administrator/components/com_templates/views/template/view.html.php
@@ -12,9 +12,7 @@
/**
* View to edit a template style.
*
-* @package Joomla.Administrator
-* @subpackage com_templates
-* @since 1.6
+* @since 1.6
*/
class TemplatesViewTemplate extends JViewLegacy
{
diff --git a/administrator/components/com_templates/views/templates/view.html.php b/administrator/components/com_templates/views/templates/view.html.php
index 993ba9a35bd13..d78f1435a9cb8 100644
--- a/administrator/components/com_templates/views/templates/view.html.php
+++ b/administrator/components/com_templates/views/templates/view.html.php
@@ -12,9 +12,7 @@
/**
* View class for a list of template styles.
*
- * @package Joomla.Administrator
- * @subpackage com_templates
- * @since 1.6
+ * @since 1.6
*/
class TemplatesViewTemplates extends JViewLegacy
{
diff --git a/administrator/components/com_users/controller.php b/administrator/components/com_users/controller.php
index 64f51358b84b0..4c2d8087a8be4 100644
--- a/administrator/components/com_users/controller.php
+++ b/administrator/components/com_users/controller.php
@@ -12,9 +12,7 @@
/**
* Users master display controller.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersController extends JControllerLegacy
{
diff --git a/administrator/components/com_users/controllers/group.php b/administrator/components/com_users/controllers/group.php
index 8864468faa267..a06437195d132 100644
--- a/administrator/components/com_users/controllers/group.php
+++ b/administrator/components/com_users/controllers/group.php
@@ -12,9 +12,7 @@
/**
* User view level controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersControllerGroup extends JControllerForm
{
diff --git a/administrator/components/com_users/controllers/groups.php b/administrator/components/com_users/controllers/groups.php
index 4609c9d37f76e..e8b301f738661 100644
--- a/administrator/components/com_users/controllers/groups.php
+++ b/administrator/components/com_users/controllers/groups.php
@@ -12,9 +12,7 @@
/**
* User groups list controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersControllerGroups extends JControllerAdmin
{
diff --git a/administrator/components/com_users/controllers/level.php b/administrator/components/com_users/controllers/level.php
index 754a234fcaf40..3ec864ce0a82b 100644
--- a/administrator/components/com_users/controllers/level.php
+++ b/administrator/components/com_users/controllers/level.php
@@ -12,9 +12,7 @@
/**
* User view level controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersControllerLevel extends JControllerForm
{
diff --git a/administrator/components/com_users/controllers/levels.php b/administrator/components/com_users/controllers/levels.php
index 616349c85df9b..eb6786713bf58 100644
--- a/administrator/components/com_users/controllers/levels.php
+++ b/administrator/components/com_users/controllers/levels.php
@@ -12,9 +12,7 @@
/**
* User view levels list controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersControllerLevels extends JControllerAdmin
{
diff --git a/administrator/components/com_users/controllers/mail.php b/administrator/components/com_users/controllers/mail.php
index 5a4eb08e5882c..80d5caeb6a721 100644
--- a/administrator/components/com_users/controllers/mail.php
+++ b/administrator/components/com_users/controllers/mail.php
@@ -12,9 +12,7 @@
/**
* Users mail controller.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersControllerMail extends JControllerLegacy
{
diff --git a/administrator/components/com_users/controllers/note.php b/administrator/components/com_users/controllers/note.php
index 7336dc8b05f14..c3a863f1c45a9 100644
--- a/administrator/components/com_users/controllers/note.php
+++ b/administrator/components/com_users/controllers/note.php
@@ -12,9 +12,7 @@
/**
* User note controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 2.5
+ * @since 2.5
*/
class UsersControllerNote extends JControllerForm
{
diff --git a/administrator/components/com_users/controllers/notes.php b/administrator/components/com_users/controllers/notes.php
index 1fdb2debf24e5..3daaedb758b4b 100644
--- a/administrator/components/com_users/controllers/notes.php
+++ b/administrator/components/com_users/controllers/notes.php
@@ -12,9 +12,7 @@
/**
* User notes controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 2.5
+ * @since 2.5
*/
class UsersControllerNotes extends JControllerAdmin
{
diff --git a/administrator/components/com_users/controllers/user.php b/administrator/components/com_users/controllers/user.php
index df13d7739fbd6..1de29f2175318 100644
--- a/administrator/components/com_users/controllers/user.php
+++ b/administrator/components/com_users/controllers/user.php
@@ -12,9 +12,7 @@
/**
* User controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersControllerUser extends JControllerForm
{
diff --git a/administrator/components/com_users/controllers/users.php b/administrator/components/com_users/controllers/users.php
index bc0ebaf5d5868..d1761f1d5377c 100644
--- a/administrator/components/com_users/controllers/users.php
+++ b/administrator/components/com_users/controllers/users.php
@@ -12,9 +12,7 @@
/**
* Users list controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersControllerUsers extends JControllerAdmin
{
diff --git a/administrator/components/com_users/helpers/debug.php b/administrator/components/com_users/helpers/debug.php
index b4af3b400ffcb..89e94bde5f810 100644
--- a/administrator/components/com_users/helpers/debug.php
+++ b/administrator/components/com_users/helpers/debug.php
@@ -12,9 +12,7 @@
/**
* Users component debugging helper.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersHelperDebug
{
diff --git a/administrator/components/com_users/helpers/html/users.php b/administrator/components/com_users/helpers/html/users.php
index 3e7793383e176..a658d81e32b8e 100644
--- a/administrator/components/com_users/helpers/html/users.php
+++ b/administrator/components/com_users/helpers/html/users.php
@@ -12,9 +12,7 @@
/**
* Extended Utility class for the Users component.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 2.5
+ * @since 2.5
*/
class JHtmlUsers
{
diff --git a/administrator/components/com_users/helpers/users.php b/administrator/components/com_users/helpers/users.php
index dc764ddde8c2c..e037057bfde10 100644
--- a/administrator/components/com_users/helpers/users.php
+++ b/administrator/components/com_users/helpers/users.php
@@ -12,9 +12,7 @@
/**
* Users component helper.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersHelper
{
diff --git a/administrator/components/com_users/models/debuggroup.php b/administrator/components/com_users/models/debuggroup.php
index aaaedfc0159a2..dc0ded7a2d05d 100644
--- a/administrator/components/com_users/models/debuggroup.php
+++ b/administrator/components/com_users/models/debuggroup.php
@@ -14,9 +14,7 @@
/**
* Methods supporting a list of user records.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersModelDebuggroup extends JModelList
{
diff --git a/administrator/components/com_users/models/debuguser.php b/administrator/components/com_users/models/debuguser.php
index a73245751df02..491395a79757d 100644
--- a/administrator/components/com_users/models/debuguser.php
+++ b/administrator/components/com_users/models/debuguser.php
@@ -14,9 +14,7 @@
/**
* Methods supporting a list of user records.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersModelDebugUser extends JModelList
{
diff --git a/administrator/components/com_users/models/fields/groupparent.php b/administrator/components/com_users/models/fields/groupparent.php
index 25247c75f44b9..4db6ae086d028 100644
--- a/administrator/components/com_users/models/fields/groupparent.php
+++ b/administrator/components/com_users/models/fields/groupparent.php
@@ -14,9 +14,7 @@
/**
* Form Field class for the Joomla Framework.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class JFormFieldGroupParent extends JFormFieldList
{
diff --git a/administrator/components/com_users/models/group.php b/administrator/components/com_users/models/group.php
index 82a5dec07eb0f..53844144f824a 100644
--- a/administrator/components/com_users/models/group.php
+++ b/administrator/components/com_users/models/group.php
@@ -12,9 +12,7 @@
/**
* User group model.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersModelGroup extends JModelAdmin
{
diff --git a/administrator/components/com_users/models/groups.php b/administrator/components/com_users/models/groups.php
index ef623ef878be6..17ffd78729a2b 100644
--- a/administrator/components/com_users/models/groups.php
+++ b/administrator/components/com_users/models/groups.php
@@ -12,9 +12,7 @@
/**
* Methods supporting a list of user group records.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersModelGroups extends JModelList
{
diff --git a/administrator/components/com_users/models/level.php b/administrator/components/com_users/models/level.php
index 313e827edca61..ac9c00d796808 100644
--- a/administrator/components/com_users/models/level.php
+++ b/administrator/components/com_users/models/level.php
@@ -12,9 +12,7 @@
/**
* User view level model.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersModelLevel extends JModelAdmin
{
diff --git a/administrator/components/com_users/models/levels.php b/administrator/components/com_users/models/levels.php
index d43e56d12e3d4..a6af463daceb2 100644
--- a/administrator/components/com_users/models/levels.php
+++ b/administrator/components/com_users/models/levels.php
@@ -12,9 +12,7 @@
/**
* Methods supporting a list of user access level records.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersModelLevels extends JModelList
{
diff --git a/administrator/components/com_users/models/mail.php b/administrator/components/com_users/models/mail.php
index 98179b3ad1952..976a92f5012fd 100644
--- a/administrator/components/com_users/models/mail.php
+++ b/administrator/components/com_users/models/mail.php
@@ -12,9 +12,7 @@
/**
* Users mail model.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersModelMail extends JModelAdmin
{
diff --git a/administrator/components/com_users/models/note.php b/administrator/components/com_users/models/note.php
index 84fdecdb381a1..c347c1030ae0e 100644
--- a/administrator/components/com_users/models/note.php
+++ b/administrator/components/com_users/models/note.php
@@ -12,9 +12,7 @@
/**
* User note model.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 2.5
+ * @since 2.5
*/
class UsersModelNote extends JModelAdmin
{
diff --git a/administrator/components/com_users/models/notes.php b/administrator/components/com_users/models/notes.php
index ffbc35e81c126..75d1fdfbad34c 100644
--- a/administrator/components/com_users/models/notes.php
+++ b/administrator/components/com_users/models/notes.php
@@ -12,9 +12,7 @@
/**
* User notes model class.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 2.5
+ * @since 2.5
*/
class UsersModelNotes extends JModelList
{
diff --git a/administrator/components/com_users/models/user.php b/administrator/components/com_users/models/user.php
index 6a3e6a0652b41..fc8bf17cd73fe 100644
--- a/administrator/components/com_users/models/user.php
+++ b/administrator/components/com_users/models/user.php
@@ -12,9 +12,7 @@
/**
* User model.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersModelUser extends JModelAdmin
{
diff --git a/administrator/components/com_users/models/users.php b/administrator/components/com_users/models/users.php
index dd6d47f97e9da..48454af40949a 100644
--- a/administrator/components/com_users/models/users.php
+++ b/administrator/components/com_users/models/users.php
@@ -12,9 +12,7 @@
/**
* Methods supporting a list of user records.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersModelUsers extends JModelList
{
diff --git a/administrator/components/com_users/tables/note.php b/administrator/components/com_users/tables/note.php
index 3095706c62def..57da10c7dbe18 100644
--- a/administrator/components/com_users/tables/note.php
+++ b/administrator/components/com_users/tables/note.php
@@ -12,9 +12,7 @@
/**
* User notes table class
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 2.5
+ * @since 2.5
*/
class UsersTableNote extends JTable
{
diff --git a/administrator/components/com_users/views/debuggroup/view.html.php b/administrator/components/com_users/views/debuggroup/view.html.php
index 80cef640a0f07..45ed07e1d35e0 100644
--- a/administrator/components/com_users/views/debuggroup/view.html.php
+++ b/administrator/components/com_users/views/debuggroup/view.html.php
@@ -12,9 +12,7 @@
/**
* View class for a list of users.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersViewDebuggroup extends JViewLegacy
{
diff --git a/administrator/components/com_users/views/debuguser/view.html.php b/administrator/components/com_users/views/debuguser/view.html.php
index 23722f83a73e4..8edc606a9e692 100644
--- a/administrator/components/com_users/views/debuguser/view.html.php
+++ b/administrator/components/com_users/views/debuguser/view.html.php
@@ -12,9 +12,7 @@
/**
* View class for a list of users.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersViewDebuguser extends JViewLegacy
{
diff --git a/administrator/components/com_users/views/group/view.html.php b/administrator/components/com_users/views/group/view.html.php
index 7ce89f5d34a3b..39c520ea052aa 100644
--- a/administrator/components/com_users/views/group/view.html.php
+++ b/administrator/components/com_users/views/group/view.html.php
@@ -12,9 +12,7 @@
/**
* View to edit a user group.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersViewGroup extends JViewLegacy
{
diff --git a/administrator/components/com_users/views/groups/view.html.php b/administrator/components/com_users/views/groups/view.html.php
index 306663ad2e701..2b5a88b0a1c72 100644
--- a/administrator/components/com_users/views/groups/view.html.php
+++ b/administrator/components/com_users/views/groups/view.html.php
@@ -12,9 +12,7 @@
/**
* View class for a list of user groups.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersViewGroups extends JViewLegacy
{
diff --git a/administrator/components/com_users/views/level/view.html.php b/administrator/components/com_users/views/level/view.html.php
index f310b397824d0..f0045ae07ede8 100644
--- a/administrator/components/com_users/views/level/view.html.php
+++ b/administrator/components/com_users/views/level/view.html.php
@@ -12,9 +12,7 @@
/**
* View to edit a user view level.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersViewLevel extends JViewLegacy
{
diff --git a/administrator/components/com_users/views/levels/view.html.php b/administrator/components/com_users/views/levels/view.html.php
index 7526f5208e097..71c36bbe5d616 100644
--- a/administrator/components/com_users/views/levels/view.html.php
+++ b/administrator/components/com_users/views/levels/view.html.php
@@ -12,9 +12,7 @@
/**
* The HTML Users access levels view.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersViewLevels extends JViewLegacy
{
diff --git a/administrator/components/com_users/views/mail/view.html.php b/administrator/components/com_users/views/mail/view.html.php
index 4c8787cdeb850..827dbc0ac52ff 100644
--- a/administrator/components/com_users/views/mail/view.html.php
+++ b/administrator/components/com_users/views/mail/view.html.php
@@ -12,9 +12,7 @@
/**
* Users mail view.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersViewMail extends JViewLegacy
{
diff --git a/administrator/components/com_users/views/note/view.html.php b/administrator/components/com_users/views/note/view.html.php
index 7b63fe6954ae0..54526f958df54 100644
--- a/administrator/components/com_users/views/note/view.html.php
+++ b/administrator/components/com_users/views/note/view.html.php
@@ -12,9 +12,7 @@
/**
* User note edit view
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 2.5
+ * @since 2.5
*/
class UsersViewNote extends JViewLegacy
{
diff --git a/administrator/components/com_users/views/notes/view.html.php b/administrator/components/com_users/views/notes/view.html.php
index 7b4458df1c78d..6283ac34d6970 100644
--- a/administrator/components/com_users/views/notes/view.html.php
+++ b/administrator/components/com_users/views/notes/view.html.php
@@ -12,9 +12,7 @@
/**
* User notes list view
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 2.5
+ * @since 2.5
*/
class UsersViewNotes extends JViewLegacy
{
diff --git a/administrator/components/com_users/views/user/view.html.php b/administrator/components/com_users/views/user/view.html.php
index f1a70db0d728c..64b831f461a05 100644
--- a/administrator/components/com_users/views/user/view.html.php
+++ b/administrator/components/com_users/views/user/view.html.php
@@ -10,11 +10,9 @@
defined('_JEXEC') or die;
/**
- * User view
- *
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.5
+ * User view class.
+ *
+ * @since 1.5
*/
class UsersViewUser extends JViewLegacy
{
diff --git a/administrator/components/com_users/views/users/view.html.php b/administrator/components/com_users/views/users/view.html.php
index 11c18894e31e2..698238218e611 100644
--- a/administrator/components/com_users/views/users/view.html.php
+++ b/administrator/components/com_users/views/users/view.html.php
@@ -12,9 +12,7 @@
/**
* View class for a list of users.
*
- * @package Joomla.Administrator
- * @subpackage com_users
- * @since 1.6
+ * @since 1.6
*/
class UsersViewUsers extends JViewLegacy
{
diff --git a/administrator/components/com_weblinks/controller.php b/administrator/components/com_weblinks/controller.php
index 02d89150af83c..c2205955aff5e 100644
--- a/administrator/components/com_weblinks/controller.php
+++ b/administrator/components/com_weblinks/controller.php
@@ -12,9 +12,7 @@
/**
* Weblinks Weblink Controller
*
- * @package Joomla.Administrator
- * @subpackage com_weblinks
- * @since 1.5
+ * @since 1.5
*/
class WeblinksController extends JControllerLegacy
{
diff --git a/administrator/components/com_weblinks/controllers/weblink.php b/administrator/components/com_weblinks/controllers/weblink.php
index 2361894cae9f5..7c2540e2284b8 100644
--- a/administrator/components/com_weblinks/controllers/weblink.php
+++ b/administrator/components/com_weblinks/controllers/weblink.php
@@ -12,9 +12,7 @@
/**
* Weblink controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_weblinks
- * @since 1.6
+ * @since 1.6
*/
class WeblinksControllerWeblink extends JControllerForm
{
diff --git a/administrator/components/com_weblinks/controllers/weblinks.php b/administrator/components/com_weblinks/controllers/weblinks.php
index f78b72b2d779b..f41136b1c76e8 100644
--- a/administrator/components/com_weblinks/controllers/weblinks.php
+++ b/administrator/components/com_weblinks/controllers/weblinks.php
@@ -12,9 +12,7 @@
/**
* Weblinks list controller class.
*
- * @package Joomla.Administrator
- * @subpackage com_weblinks
- * @since 1.6
+ * @since 1.6
*/
class WeblinksControllerWeblinks extends JControllerAdmin
{
diff --git a/administrator/components/com_weblinks/helpers/weblinks.php b/administrator/components/com_weblinks/helpers/weblinks.php
index 550a87c95bda8..cc765b4ded6bf 100644
--- a/administrator/components/com_weblinks/helpers/weblinks.php
+++ b/administrator/components/com_weblinks/helpers/weblinks.php
@@ -12,9 +12,7 @@
/**
* Weblinks helper.
*
- * @package Joomla.Administrator
- * @subpackage com_weblinks
- * @since 1.6
+ * @since 1.6
*/
class WeblinksHelper extends JHelperContent
{
diff --git a/administrator/components/com_weblinks/models/weblink.php b/administrator/components/com_weblinks/models/weblink.php
index 5742581e5db70..1aea25f7fdd72 100644
--- a/administrator/components/com_weblinks/models/weblink.php
+++ b/administrator/components/com_weblinks/models/weblink.php
@@ -12,9 +12,7 @@
/**
* Weblinks model.
*
- * @package Joomla.Administrator
- * @subpackage com_weblinks
- * @since 1.5
+ * @since 1.5
*/
class WeblinksModelWeblink extends JModelAdmin
{
diff --git a/administrator/components/com_weblinks/models/weblinks.php b/administrator/components/com_weblinks/models/weblinks.php
index 580a360361763..8cfe9dbca1504 100644
--- a/administrator/components/com_weblinks/models/weblinks.php
+++ b/administrator/components/com_weblinks/models/weblinks.php
@@ -12,9 +12,7 @@
/**
* Methods supporting a list of weblink records.
*
- * @package Joomla.Administrator
- * @subpackage com_weblinks
- * @since 1.6
+ * @since 1.6
*/
class WeblinksModelWeblinks extends JModelList
{
diff --git a/administrator/components/com_weblinks/tables/weblink.php b/administrator/components/com_weblinks/tables/weblink.php
index e04fbacdd2216..10d0b47bd2beb 100644
--- a/administrator/components/com_weblinks/tables/weblink.php
+++ b/administrator/components/com_weblinks/tables/weblink.php
@@ -12,9 +12,7 @@
/**
* Weblink Table class
*
- * @package Joomla.Administrator
- * @subpackage com_weblinks
- * @since 1.5
+ * @since 1.5
*/
class WeblinksTableWeblink extends JTable
{
diff --git a/administrator/components/com_weblinks/views/weblink/view.html.php b/administrator/components/com_weblinks/views/weblink/view.html.php
index 152243d4c5d70..526176d6afe4e 100644
--- a/administrator/components/com_weblinks/views/weblink/view.html.php
+++ b/administrator/components/com_weblinks/views/weblink/view.html.php
@@ -12,9 +12,7 @@
/**
* View to edit a weblink.
*
- * @package Joomla.Administrator
- * @subpackage com_weblinks
- * @since 1.5
+ * @since 1.5
*/
class WeblinksViewWeblink extends JViewLegacy
{
diff --git a/administrator/components/com_weblinks/views/weblinks/view.html.php b/administrator/components/com_weblinks/views/weblinks/view.html.php
index 45abc8633999c..5fc0890ddd351 100644
--- a/administrator/components/com_weblinks/views/weblinks/view.html.php
+++ b/administrator/components/com_weblinks/views/weblinks/view.html.php
@@ -12,9 +12,7 @@
/**
* View class for a list of weblinks.
*
- * @package Joomla.Administrator
- * @subpackage com_weblinks
- * @since 1.5
+ * @since 1.5
*/
class WeblinksViewWeblinks extends JViewLegacy
{
diff --git a/administrator/modules/mod_quickicon/helper.php b/administrator/modules/mod_quickicon/helper.php
index c4aa9933f17f8..822391aa89bf7 100644
--- a/administrator/modules/mod_quickicon/helper.php
+++ b/administrator/modules/mod_quickicon/helper.php
@@ -192,6 +192,7 @@ public static function groupButtons($buttons)
{
$groupedButtons[$button['group']][] = $button;
}
+
return $groupedButtons;
}
diff --git a/administrator/templates/isis/css/template.css b/administrator/templates/isis/css/template.css
index ceb73a908c3b8..5659379d0dd85 100644
--- a/administrator/templates/isis/css/template.css
+++ b/administrator/templates/isis/css/template.css
@@ -7196,6 +7196,7 @@ body .navbar-fixed-top {
color: #0C192E;
text-shadow: 0 1px 0 #FFF;
margin-bottom: 10px;
+ min-height:43px;
}
.subhead-collapse.collapse {
height: auto;
diff --git a/administrator/templates/isis/less/template.less b/administrator/templates/isis/less/template.less
index 90fb829eff2d2..2d0bdb4a2e3fd 100644
--- a/administrator/templates/isis/less/template.less
+++ b/administrator/templates/isis/less/template.less
@@ -302,14 +302,11 @@ body .navbar-fixed-top{
background: -ms-linear-gradient(top, #ffffff 0%,#ededed 100%); /* IE10+ */
background: linear-gradient(top, #ffffff 0%,#ededed 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
-
border-bottom: 1px solid #D3D3D3;
-
color: #0C192E;
text-shadow: 0 1px 0 #FFF;
-
margin-bottom: 10px;
-
+ min-height:43px;
}
.subhead-collapse.collapse {
height: auto;
diff --git a/bin/keychain.php b/bin/keychain.php
index 5a8348e41665f..e0f862f04094d 100644
--- a/bin/keychain.php
+++ b/bin/keychain.php
@@ -94,6 +94,7 @@ public function execute( )
{
$this->saveKeychain();
}
+
exit(0);
}
@@ -203,6 +204,7 @@ protected function create()
$this->out('error: entry already exists. To change this entry, use "change"');
exit(1);
}
+
$this->change();
}
@@ -220,6 +222,7 @@ protected function change()
$this->out("usage: {$this->input->executable} [options] change entry_name entry_value");
exit(1);
}
+
$this->updated = true;
$this->keychain->setValue($this->input->args[1], $this->input->args[2]);
}
@@ -298,6 +301,7 @@ protected function listEntries()
{
$line .= ': ' . $this->dumpVar($value);
}
+
$this->out($line);
}
}
diff --git a/build/phpcs/Joomla/Sniffs/Commenting/ClassCommentSniff.php b/build/phpcs/Joomla/Sniffs/Commenting/ClassCommentSniff.php
index bcd0eeef04c9b..4346f0e3aa8d7 100644
--- a/build/phpcs/Joomla/Sniffs/Commenting/ClassCommentSniff.php
+++ b/build/phpcs/Joomla/Sniffs/Commenting/ClassCommentSniff.php
@@ -70,7 +70,7 @@ class Joomla_Sniffs_Commenting_ClassCommentSniff extends Joomla_Sniffs_Commentin
'order_text' => 'must follow @version (if used)',
),
'package' => array(
- 'required' => true,
+ 'required' => false,
'allow_multiple' => false,
'order_text' => 'must follow @category (if used)',
),
diff --git a/components/com_banners/models/banners.php b/components/com_banners/models/banners.php
index 82fcccccba69d..5a32d79329369 100644
--- a/components/com_banners/models/banners.php
+++ b/components/com_banners/models/banners.php
@@ -146,7 +146,14 @@ protected function getListQuery()
foreach ($keywords as $keyword)
{
$keyword = trim($keyword);
- $condition1 = "a.own_prefix=1 AND a.metakey_prefix=SUBSTRING(" . $db->quote($keyword) . ",1,LENGTH( a.metakey_prefix)) OR a.own_prefix=0 AND cl.own_prefix=1 AND cl.metakey_prefix=SUBSTRING(" . $db->quote($keyword) . ",1,LENGTH(cl.metakey_prefix)) OR a.own_prefix=0 AND cl.own_prefix=0 AND " . ($prefix == substr($keyword, 0, strlen($prefix)) ? '1' : '0');
+ $condition1 = "a.own_prefix=1 "
+ . " AND a.metakey_prefix=SUBSTRING(" . $db->quote($keyword) . ",1,LENGTH( a.metakey_prefix)) "
+ . " OR a.own_prefix=0 "
+ . " AND cl.own_prefix=1 "
+ . " AND cl.metakey_prefix=SUBSTRING(" . $db->quote($keyword) . ",1,LENGTH(cl.metakey_prefix)) "
+ . " OR a.own_prefix=0 "
+ . " AND cl.own_prefix=0 "
+ . " AND " . ($prefix == substr($keyword, 0, strlen($prefix)) ? '1' : '0');
$condition2 = "a.metakey REGEXP '[[:<:]]" . $db->escape($keyword) . "[[:>:]]'";
diff --git a/components/com_banners/router.php b/components/com_banners/router.php
index 2a9e578278396..3079b74661436 100644
--- a/components/com_banners/router.php
+++ b/components/com_banners/router.php
@@ -117,7 +117,7 @@ public function parse(&$segments)
* @since 3.3
* @deprecated 4.0 Use Class based routers instead
*/
-function BannersBuildRoute(&$query)
+function bannersBuildRoute(&$query)
{
$router = new BannersRouter;
@@ -137,7 +137,7 @@ function BannersBuildRoute(&$query)
* @since 3.3
* @deprecated 4.0 Use Class based routers instead
*/
-function BannersParseRoute($segments)
+function bannersParseRoute($segments)
{
$router = new BannersRouter;
diff --git a/components/com_config/controller/cmsbase.php b/components/com_config/controller/cmsbase.php
index 60acd49d77585..7a361d152c45a 100644
--- a/components/com_config/controller/cmsbase.php
+++ b/components/com_config/controller/cmsbase.php
@@ -15,7 +15,7 @@
* @package Joomla.Site
* @subpackage com_config
* @since 3.2
-*/
+ */
class ConfigControllerCmsbase extends JControllerBase
{
/**
diff --git a/components/com_config/controller/config/display.php b/components/com_config/controller/config/display.php
index 4d43c5ab696a6..fc98d19d60ad0 100644
--- a/components/com_config/controller/config/display.php
+++ b/components/com_config/controller/config/display.php
@@ -15,7 +15,7 @@
* @package Joomla.Site
* @subpackage com_config
* @since 3.2
-*/
+ */
class ConfigControllerConfigDisplay extends ConfigControllerDisplay
{
/**
diff --git a/components/com_config/controller/config/save.php b/components/com_config/controller/config/save.php
index d79c8952ed869..b80f87b45247b 100644
--- a/components/com_config/controller/config/save.php
+++ b/components/com_config/controller/config/save.php
@@ -14,7 +14,7 @@
* @package Joomla.Site
* @subpackage com_config
* @since 3.2
-*/
+ */
class ConfigControllerConfigSave extends JControllerBase
{
/**
diff --git a/components/com_config/controller/display.php b/components/com_config/controller/display.php
index 604e766ab7e4a..6c7d3497f0b0d 100644
--- a/components/com_config/controller/display.php
+++ b/components/com_config/controller/display.php
@@ -15,7 +15,7 @@
* @package Joomla.Site
* @subpackage com_config
* @since 3.2
-*/
+ */
class ConfigControllerDisplay extends JControllerBase
{
/**
diff --git a/components/com_config/controller/helper.php b/components/com_config/controller/helper.php
index 09eb972dfe02a..a323582d7c0eb 100644
--- a/components/com_config/controller/helper.php
+++ b/components/com_config/controller/helper.php
@@ -15,7 +15,7 @@
* @package Joomla.Site
* @subpackage com_config
* @since 3.2
-*/
+ */
class ConfigControllerHelper
{
/**
diff --git a/components/com_config/controller/templates/display.php b/components/com_config/controller/templates/display.php
index ee13ab38a8da2..bb65d8ce4a1be 100644
--- a/components/com_config/controller/templates/display.php
+++ b/components/com_config/controller/templates/display.php
@@ -15,7 +15,7 @@
* @package Joomla.Site
* @subpackage com_config
* @since 3.2
-*/
+ */
class ConfigControllerTemplatesDisplay extends ConfigControllerDisplay
{
/**
diff --git a/components/com_config/controller/templates/save.php b/components/com_config/controller/templates/save.php
index 14608a6d370f1..43517a9da2767 100644
--- a/components/com_config/controller/templates/save.php
+++ b/components/com_config/controller/templates/save.php
@@ -14,7 +14,7 @@
* @package Joomla.Site
* @subpackage com_config
* @since 3.2
-*/
+ */
class ConfigControllerTemplatesSave extends JControllerBase
{
/**
diff --git a/components/com_config/model/form.php b/components/com_config/model/form.php
index d1403466a4186..fc4280185b82a 100644
--- a/components/com_config/model/form.php
+++ b/components/com_config/model/form.php
@@ -188,7 +188,6 @@ protected function loadForm($name, $source = null, $options = array(), $clear =
// Load the data into the form after the plugins have operated.
$form->bind($data);
-
}
catch (Exception $e)
{
diff --git a/components/com_config/view/cms/html.php b/components/com_config/view/cms/html.php
index ce7b9bf7e3c39..0ea7fe2a8e543 100644
--- a/components/com_config/view/cms/html.php
+++ b/components/com_config/view/cms/html.php
@@ -102,12 +102,6 @@ public function loadTemplate($tpl = null)
$lang->load('tpl_' . $template, JPATH_BASE, null, false, true)
|| $lang->load('tpl_' . $template, JPATH_THEMES . "/$template", null, false, true);
- // Change the template folder if alternative layout is in different template
- /* if (isset($layoutTemplate) && $layoutTemplate != '_' && $layoutTemplate != $template)
- {
- $this->_path['template'] = str_replace($template, $layoutTemplate, $this->_path['template']);
- } */
-
// Prevents adding path twise
if (empty($this->_path['template']))
{
diff --git a/components/com_contact/controller.php b/components/com_contact/controller.php
index 35ad619b893f6..da5593245ef63 100644
--- a/components/com_contact/controller.php
+++ b/components/com_contact/controller.php
@@ -21,13 +21,14 @@ class ContactController extends JControllerLegacy
/**
* Method to display a view.
*
- * @param boolean If true, the view output will be cached
- * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
+ * @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 JControllerLegacy This object to support chaining.
*
- * @return JController This object to support chaining.
* @since 1.5
*/
- public function display($cachable = false, $urlparams = false)
+ public function display($cachable = false, $urlparams = array())
{
$cachable = true;
@@ -35,8 +36,10 @@ public function display($cachable = false, $urlparams = false)
$vName = $this->input->get('view', 'categories');
$this->input->set('view', $vName);
- $safeurlparams = array('catid' => 'INT', 'id' => 'INT', 'cid' => 'ARRAY', 'year' => 'INT', 'month' => 'INT', 'limit' => 'UINT', 'limitstart' => 'UINT',
- 'showall' => 'INT', 'return' => 'BASE64', 'filter' => 'STRING', 'filter_order' => 'CMD', 'filter_order_Dir' => 'CMD', 'filter-search' => 'STRING', 'print' => 'BOOLEAN', 'lang' => 'CMD');
+ $safeurlparams = array('catid' => 'INT', 'id' => 'INT', 'cid' => 'ARRAY', 'year' => 'INT', 'month' => 'INT',
+ 'limit' => 'UINT', 'limitstart' => 'UINT', 'showall' => 'INT', 'return' => 'BASE64', 'filter' => 'STRING',
+ 'filter_order' => 'CMD', 'filter_order_Dir' => 'CMD', 'filter-search' => 'STRING', 'print' => 'BOOLEAN',
+ 'lang' => 'CMD');
parent::display($cachable, $safeurlparams);
diff --git a/components/com_contact/controllers/contact.php b/components/com_contact/controllers/contact.php
index 61d81bd14fd41..057a24dde777d 100644
--- a/components/com_contact/controllers/contact.php
+++ b/components/com_contact/controllers/contact.php
@@ -10,16 +10,37 @@
defined('_JEXEC') or die;
/**
+ * Controller for single contact view
+ *
* @package Joomla.Site
* @subpackage com_contact
+ * @since 1.5.19
*/
class ContactControllerContact extends JControllerForm
{
+ /**
+ * Method to get a model object, loading it if required.
+ *
+ * @param string $name The model name. Optional.
+ * @param string $prefix The class prefix. Optional.
+ * @param array $config Configuration array for model. Optional.
+ *
+ * @return JModelLegacy The model.
+ *
+ * @since 1.6.4
+ */
public function getModel($name = '', $prefix = '', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, array('ignore_request' => false));
}
+ /**
+ * Method to submit the contact form and send an email.
+ *
+ * @return boolean True on success sending the email. False on failure.
+ *
+ * @since 1.5.19
+ */
public function submit()
{
// Check for request forgeries.
@@ -145,6 +166,17 @@ public function submit()
return true;
}
+ /**
+ * Method to get a model object, loading it if required.
+ *
+ * @param array $data The data to send in the email.
+ * @param stdClass $contact The user information to send the email to
+ * @param boolean $copy_email_activated True to send a copy of the email to the user.
+ *
+ * @return boolean True on success sending the email, false on failure.
+ *
+ * @since 1.6.4
+ */
private function _sendEmail($data, $contact, $copy_email_activated)
{
$app = JFactory::getApplication();
diff --git a/components/com_contact/helpers/category.php b/components/com_contact/helpers/category.php
index e814bcabe846a..3757f8b525e16 100644
--- a/components/com_contact/helpers/category.php
+++ b/components/com_contact/helpers/category.php
@@ -18,6 +18,13 @@
*/
class ContactCategories extends JCategories
{
+ /**
+ * Class constructor
+ *
+ * @param array $options Array of options
+ *
+ * @since 1.6
+ */
public function __construct($options = array())
{
$options['table'] = '#__contact_details';
diff --git a/components/com_contact/helpers/icon.php b/components/com_contact/helpers/icon.php
index b9ad28cfb0902..8be3e25f8ee10 100644
--- a/components/com_contact/helpers/icon.php
+++ b/components/com_contact/helpers/icon.php
@@ -60,7 +60,7 @@ public static function print_popup($article, $params, $attribs = array())
}
else
{
- $text = JText::_('JGLOBAL_ICON_SEP') . ' ' . JText::_('JGLOBAL_PRINT') .' ' . JText::_('JGLOBAL_ICON_SEP');
+ $text = JText::_('JGLOBAL_ICON_SEP') . ' ' . JText::_('JGLOBAL_PRINT') . ' ' . JText::_('JGLOBAL_ICON_SEP');
}
$attribs['title'] = JText::_('JGLOBAL_PRINT');
diff --git a/components/com_contact/helpers/route.php b/components/com_contact/helpers/route.php
index 1023c46357380..b6be28e517484 100644
--- a/components/com_contact/helpers/route.php
+++ b/components/com_contact/helpers/route.php
@@ -24,7 +24,15 @@ abstract class ContactHelperRoute
protected static $lang_lookup = array();
/**
- * @param integer The route of the contact
+ * Get the URL route for a contact from a contact ID, contact category ID and language
+ *
+ * @param integer $id The id of the contact
+ * @param integer $catid The id of the contact's category
+ * @param mixed $language The id of the language being used.
+ *
+ * @return string The link to the contact
+ *
+ * @since 1.5
*/
public static function getContactRoute($id, $catid, $language = 0)
{
@@ -66,6 +74,16 @@ public static function getContactRoute($id, $catid, $language = 0)
return $link;
}
+ /**
+ * Get the URL route for a contact category from a contact category ID and language
+ *
+ * @param mixed $catid The id of the contact's category either an integer id or a instance of JCategoryNode
+ * @param mixed $language The id of the language being used.
+ *
+ * @return string The link to the contact
+ *
+ * @since 1.5
+ */
public static function getCategoryRoute($catid, $language = 0)
{
if ($catid instanceof JCategoryNode)
diff --git a/components/com_contact/models/categories.php b/components/com_contact/models/categories.php
index c894e48bb91dd..5de82c2ece9b3 100644
--- a/components/com_contact/models/categories.php
+++ b/components/com_contact/models/categories.php
@@ -41,6 +41,11 @@ class ContactModelCategories extends JModelList
*
* Note. Calling getState in this method will result in recursion.
*
+ * @param string $ordering An optional ordering field.
+ * @param string $direction An optional direction (asc|desc).
+ *
+ * @return void
+ *
* @since 1.6
*/
protected function populateState($ordering = null, $direction = null)
@@ -66,25 +71,25 @@ protected function populateState($ordering = null, $direction = null)
* different modules that might need different sets of data or different
* ordering requirements.
*
- * @param string $id A prefix for the store id.
+ * @param string $id A prefix for the store id.
*
* @return string A store id.
*/
protected function getStoreId($id = '')
{
// Compile the store id.
- $id .= ':'.$this->getState('filter.extension');
- $id .= ':'.$this->getState('filter.published');
- $id .= ':'.$this->getState('filter.access');
- $id .= ':'.$this->getState('filter.parentId');
+ $id .= ':' . $this->getState('filter.extension');
+ $id .= ':' . $this->getState('filter.published');
+ $id .= ':' . $this->getState('filter.access');
+ $id .= ':' . $this->getState('filter.parentId');
return parent::getStoreId($id);
}
/**
- * redefine the function an add some properties to make the styling more easy
+ * Redefine the function an add some properties to make the styling more easy
*
- * @return mixed An array of data items on success, false on failure.
+ * @return mixed An array of data items on success, false on failure.
*/
public function getItems()
{
@@ -94,18 +99,23 @@ public function getItems()
$menu = $app->getMenu();
$active = $menu->getActive();
$params = new JRegistry;
+
if ($active)
{
$params->loadString($active->params);
}
+
$options = array();
$options['countItems'] = $params->get('show_cat_items_cat', 1) || !$params->get('show_empty_categories_cat', 0);
$categories = JCategories::getInstance('Contact', $options);
$this->_parent = $categories->get($this->getState('filter.parentId', 'root'));
+
if (is_object($this->_parent))
{
$this->_items = $this->_parent->getChildren();
- } else {
+ }
+ else
+ {
$this->_items = false;
}
}
@@ -113,12 +123,20 @@ public function getItems()
return $this->_items;
}
+ /**
+ * Gets the id of the parent category for the selected list of categories
+ *
+ * @return integer The id of the parent category
+ *
+ * @since 1.6.0
+ */
public function getParent()
{
if (!is_object($this->_parent))
{
$this->getItems();
}
+
return $this->_parent;
}
}
diff --git a/components/com_contact/models/category.php b/components/com_contact/models/category.php
index eeead1ec3ae32..7ec77e29b141e 100644
--- a/components/com_contact/models/category.php
+++ b/components/com_contact/models/category.php
@@ -10,6 +10,8 @@
defined('_JEXEC') or die;
/**
+ * Single item model for a contact
+ *
* @package Joomla.Site
* @subpackage com_contact
* @since 1.5
@@ -40,18 +42,18 @@ class ContactModelCategory extends JModelList
protected $_category = null;
/**
- * The list of other newfeed categories.
+ * The list of other contact categories.
*
* @access protected
- * @var array
+ * @var array
*/
protected $_categories = null;
/**
* Constructor.
*
- * @param array An optional associative array of configuration settings.
- * @see JController
+ * @param array $config An optional associative array of configuration settings.
+
* @since 1.6
*/
public function __construct($config = array())
@@ -98,7 +100,6 @@ public function getItems()
}
$this->tags = new JHelperTags;
$this->tags->getItemTags('com_contact.contact', $item->id);
-
}
return $items;
@@ -120,7 +121,7 @@ protected function getListQuery()
$query = $db->getQuery(true);
// Select required fields from the categories.
- //sqlsrv changes
+ // Changes for sqlsrv
$case_when = ' CASE WHEN ';
$case_when .= $query->charLength('a.alias', '!=', '0');
$case_when .= ' THEN ';
@@ -218,6 +219,7 @@ protected function populateState($ordering = null, $direction = null)
// List state information
$format = $app->input->getWord('format');
+
if ($format == 'feed')
{
$limit = $app->get('feed_limit');
@@ -226,6 +228,7 @@ protected function populateState($ordering = null, $direction = null)
{
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->get('list_limit'), 'uint');
}
+
$this->setState('list.limit', $limit);
$limitstart = $app->input->get('limitstart', 0, 'uint');
@@ -236,10 +239,12 @@ protected function populateState($ordering = null, $direction = null)
// Get list ordering default from the parameters
$menuParams = new JRegistry;
+
if ($menu = $app->getMenu()->getActive())
{
$menuParams->loadString($menu->params);
}
+
$mergedParams = clone $params;
$mergedParams->merge($menuParams);
@@ -251,24 +256,28 @@ protected function populateState($ordering = null, $direction = null)
$this->setState('list.ordering', $orderCol);
$listOrder = $app->input->get('filter_order_Dir', 'ASC');
+
if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', '')))
{
$listOrder = 'ASC';
}
+
$this->setState('list.direction', $listOrder);
$id = $app->input->get('id', 0, 'int');
$this->setState('category.id', $id);
$user = JFactory::getUser();
+
if ((!$user->authorise('core.edit.state', 'com_contact')) && (!$user->authorise('core.edit', 'com_contact')))
{
- // limit to published for people who can't edit or edit.state.
+ // Limit to published for people who can't edit or edit.state.
$this->setState('filter.published', 1);
// Filter by start and end dates.
$this->setState('filter.publish_date', true);
}
+
$this->setState('filter.language', JLanguageMultilang::isEnabled());
// Load the parameters.
@@ -278,9 +287,8 @@ protected function populateState($ordering = null, $direction = null)
/**
* Method to get category data for the current category
*
- * @param integer An optional ID
+ * @return object The category object
*
- * @return object
* @since 1.5
*/
public function getCategory()
@@ -305,10 +313,12 @@ public function getCategory()
{
$this->_children = $this->_item->getChildren();
$this->_parent = false;
+
if ($this->_item->getParent())
{
$this->_parent = $this->_item->getParent();
}
+
$this->_rightsibling = $this->_item->getSibling();
$this->_leftsibling = $this->_item->getSibling(false);
}
@@ -325,8 +335,6 @@ public function getCategory()
/**
* Get the parent category.
*
- * @param integer An optional category id. If not supplied, the model state 'category.id' will be used.
- *
* @return mixed An array of categories or false if an error occurs.
*/
public function getParent()
@@ -335,6 +343,7 @@ public function getParent()
{
$this->getCategory();
}
+
return $this->_parent;
}
@@ -343,37 +352,43 @@ public function getParent()
*
* @return mixed An array of categories or false if an error occurs.
*/
- function &getLeftSibling()
+ public function &getLeftSibling()
{
if (!is_object($this->_item))
{
$this->getCategory();
}
+
return $this->_leftsibling;
}
- function &getRightSibling()
+ /**
+ * Get the sibling (adjacent) categories.
+ *
+ * @return mixed An array of categories or false if an error occurs.
+ */
+ public function &getRightSibling()
{
if (!is_object($this->_item))
{
$this->getCategory();
}
+
return $this->_rightsibling;
}
/**
* Get the child categories.
*
- * @param integer An optional category id. If not supplied, the model state 'category.id' will be used.
- *
* @return mixed An array of categories or false if an error occurs.
*/
- function &getChildren()
+ public function &getChildren()
{
if (!is_object($this->_item))
{
$this->getCategory();
}
+
return $this->_children;
}
diff --git a/components/com_contact/models/contact.php b/components/com_contact/models/contact.php
index 07b7ac1b37f35..8c25d67a41059 100644
--- a/components/com_contact/models/contact.php
+++ b/components/com_contact/models/contact.php
@@ -17,10 +17,17 @@
class ContactModelContact extends JModelForm
{
/**
+ * The name of the view for a single item
+ *
* @since 1.6
*/
protected $view_item = 'contact';
+ /**
+ * A loaded item
+ *
+ * @since 1.6
+ */
protected $_item = null;
/**
@@ -35,6 +42,8 @@ class ContactModelContact extends JModelForm
*
* Note. Calling getState in this method will result in recursion.
*
+ * @return void
+ *
* @since 1.6
*/
protected function populateState()
@@ -64,8 +73,9 @@ protected function populateState()
*
* @param array $data An optional array of data for the form to interrogate.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
- *
+ *
* @return JForm A JForm object on success, false on failure
+ *
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
@@ -90,6 +100,13 @@ public function getForm($data = array(), $loadData = true)
return $form;
}
+ /**
+ * Method to get the data that should be injected in the form.
+ *
+ * @return array The default data is an empty array.
+ *
+ * @since 1.6.2
+ */
protected function loadFormData()
{
$data = (array) JFactory::getApplication()->getUserState('com_contact.contact.data', array());
@@ -104,7 +121,9 @@ protected function loadFormData()
*
* @param integer $pk Id for the contact
*
- * @return mixed Object or null
+ * @return mixed Object or null
+ *
+ * @since 1.6.0
*/
public function &getItem($pk = null)
{
@@ -122,7 +141,7 @@ public function &getItem($pk = null)
$db = $this->getDbo();
$query = $db->getQuery(true);
- // Sqlsrv changes
+ // Changes for sqlsrv
$case_when = ' CASE WHEN ';
$case_when .= $query->charLength('a.alias', '!=', '0');
$case_when .= ' THEN ';
@@ -167,7 +186,6 @@ public function &getItem($pk = null)
}
$db->setQuery($query);
-
$data = $db->loadObject();
if (empty($data))
@@ -237,6 +255,15 @@ public function &getItem($pk = null)
return $this->_item[$pk];
}
+ /**
+ * Gets the query to load a contact item
+ *
+ * @param integer $pk The item to be loaded
+ *
+ * @return mixed The contact object on success, false on failure
+ *
+ * @throws Exception On database failure
+ */
protected function getContactQuery($pk = null)
{
// @todo Cache on the fingerprint of the arguments
@@ -308,6 +335,7 @@ protected function getContactQuery($pk = null)
catch (Exception $e)
{
$this->setError($e);
+
return false;
}
@@ -316,7 +344,7 @@ protected function getContactQuery($pk = null)
$user = JFactory::getUser();
$groups = implode(',', $user->getAuthorisedViewLevels());
- //get the content by the linked user
+ // Get the content by the linked user
$query = $db->getQuery(true)
->select('a.id')
->select('a.title')
@@ -338,29 +366,35 @@ protected function getContactQuery($pk = null)
$c_id = $query->castAsChar('c.id');
$case_when1 .= $query->concatenate(array($c_id, 'c.alias'), ':');
$case_when1 .= ' ELSE ';
- $case_when1 .= $c_id.' END as catslug';
+ $case_when1 .= $c_id . ' END as catslug';
$query->select($case_when1 . ',' . $case_when)
->from('#__content as a')
->join('LEFT', '#__categories as c on a.catid=c.id')
->where('a.created_by = ' . (int) $result->user_id)
->where('a.access IN (' . $groups . ')')
->order('a.state DESC, a.created DESC');
- // filter per language if plugin published
+
+ // Filter per language if plugin published
if (JLanguageMultilang::isEnabled())
{
- $query->where(('a.created_by = ' . (int) $result->user_id) . ' AND ' . ('a.language=' . $db->quote(JFactory::getLanguage()->getTag()) . ' OR a.language=' . $db->quote('*')));
+ $query->where(
+ ('a.created_by = ' . (int) $result->user_id) . ' AND ' .
+ ('a.language=' . $db->quote(JFactory::getLanguage()->getTag()) . ' OR a.language=' . $db->quote('*'))
+ );
}
+
if (is_numeric($published))
{
$query->where('a.state IN (1,2)')
->where('(a.publish_up = ' . $nullDate . ' OR a.publish_up <= ' . $nowDate . ')')
->where('(a.publish_down = ' . $nullDate . ' OR a.publish_down >= ' . $nowDate . ')');
}
+
$db->setQuery($query, 0, 10);
$articles = $db->loadObjectList();
$result->articles = $articles;
- //get the profile information for the linked user
+ // Get the profile information for the linked user
require_once JPATH_ADMINISTRATOR . '/components/com_users/models/user.php';
$userModel = JModelLegacy::getInstance('User', 'UsersModel', array('ignore_request' => true));
$data = $userModel->getItem((int) $result->user_id);
@@ -385,6 +419,8 @@ protected function getContactQuery($pk = null)
return $result;
}
}
+
+ return false;
}
/**
diff --git a/components/com_contact/models/featured.php b/components/com_contact/models/featured.php
index 2cd80061d950c..5b77f0f14108d 100644
--- a/components/com_contact/models/featured.php
+++ b/components/com_contact/models/featured.php
@@ -12,45 +12,78 @@
/**
* @package Joomla.Site
* @subpackage com_contact
+ * @since 1.6.0
*/
class ContactModelFeatured extends JModelList
{
/**
* Category items data
*
- * @var array
+ * @var array
+ * @since 1.6.0-beta1
+ * @deprecated 4.0 Variable not used since 1.6.0-beta8
*/
protected $_item = null;
+ /**
+ * Who knows what this was for? It has never been used
+ *
+ * @var array
+ * @since 1.6.0-beta1
+ * @deprecated 4.0 Variable not used ever
+ */
protected $_articles = null;
+ /**
+ * Get the siblings of the category
+ *
+ * @var array
+ * @since 1.6.0-beta1
+ * @deprecated 4.0 Variable not used since 1.6.0-beta8
+ */
protected $_siblings = null;
+ /**
+ * Get the children of the category
+ *
+ * @var array
+ * @since 1.6.0-beta1
+ * @deprecated 4.0 Variable not used since 1.6.0-beta8
+ */
protected $_children = null;
+ /**
+ * Get the parent of the category
+ *
+ * @var array
+ * @since 1.6.0-beta1
+ * @deprecated 4.0 Variable not used since 1.6.0-beta8
+ */
protected $_parent = null;
/**
* The category that applies.
*
- * @access protected
- * @var object
+ * @access protected
+ * @var object
+ * @deprecated 4.0 Variable not used ever
*/
protected $_category = null;
/**
- * The list of other cotnact categories.
+ * The list of other contact categories.
*
* @access protected
- * @var array
+ * @var array
+ * @deprecated 4.0 Variable not used ever
*/
protected $_categories = null;
/**
* Constructor.
*
- * @param array An optional associative array of configuration settings.
- * @see JController
+ * @param array $config An optional associative array of configuration settings.
+ *
* @since 1.6
*/
public function __construct($config = array())
@@ -100,6 +133,7 @@ public function getItems()
* Method to build an SQL query to load the list data.
*
* @return string An SQL query
+ *
* @since 1.6
*/
protected function getListQuery()
@@ -118,20 +152,24 @@ protected function getListQuery()
->where('a.featured=1')
->join('INNER', '#__categories AS c ON c.id = a.catid')
->where('c.access IN (' . $groups . ')');
+
// Filter by category.
if ($categoryId = $this->getState('category.id'))
{
$query->where('a.catid = ' . (int) $categoryId);
}
- //sqlsrv change... aliased c.published to cat_published
+
+ // Change for sqlsrv... aliased c.published to cat_published
// Join to check for category published state in parent categories up the tree
$query->select('c.published as cat_published, CASE WHEN badcats.id is null THEN c.published ELSE 0 END AS parents_published');
$subquery = 'SELECT cat.id as id FROM #__categories AS cat JOIN #__categories AS parent ';
$subquery .= 'ON cat.lft BETWEEN parent.lft AND parent.rgt ';
$subquery .= 'WHERE parent.extension = ' . $db->quote('com_contact');
+
// Find any up-path categories that are not published
// If all categories are published, badcats.id will be null, and we just use the contact state
$subquery .= ' AND parent.published != 1 GROUP BY cat.id ';
+
// Select state to unpublished if up-path category is unpublished
$publishedWhere = 'CASE WHEN badcats.id is null THEN a.published ELSE 0 END';
$query->join('LEFT OUTER', '(' . $subquery . ') AS badcats ON badcats.id = c.id');
@@ -168,6 +206,11 @@ protected function getListQuery()
*
* Note. Calling getState in this method will result in recursion.
*
+ * @param string $ordering An optional ordering field.
+ * @param string $direction An optional direction (asc|desc).
+ *
+ * @return void
+ *
* @since 1.6
*/
protected function populateState($ordering = null, $direction = null)
diff --git a/components/com_contact/router.php b/components/com_contact/router.php
index b385ae41d6a84..604757723741a 100644
--- a/components/com_contact/router.php
+++ b/components/com_contact/router.php
@@ -259,6 +259,10 @@ public function parse(&$segments)
* These functions are proxys for the new router interface
* for old SEF extensions.
*
+ * @param array &$query An array of URL arguments
+ *
+ * @return array The URL arguments to use to assemble the subsequent URL.
+ *
* @deprecated 4.0 Use Class based routers instead
*/
function ContactBuildRoute(&$query)
@@ -268,6 +272,18 @@ function ContactBuildRoute(&$query)
return $router->build($query);
}
+/**
+ * Contact router functions
+ *
+ * These functions are proxys for the new router interface
+ * for old SEF extensions.
+ *
+ * @param array &$segments The segments of the URL to parse.
+ *
+ * @return array The URL attributes to be used by the application.
+ *
+ * @deprecated 4.0 Use Class based routers instead
+ */
function ContactParseRoute($segments)
{
$router = new ContactRouter;
diff --git a/components/com_contact/views/category/tmpl/default_items.php b/components/com_contact/views/category/tmpl/default_items.php
index bc63470005291..6a5f47c2de056 100644
--- a/components/com_contact/views/category/tmpl/default_items.php
+++ b/components/com_contact/views/category/tmpl/default_items.php
@@ -23,7 +23,7 @@
|