diff --git a/administrator/components/com_categories/helpers/html/categoriesadministrator.php b/administrator/components/com_categories/helpers/html/categoriesadministrator.php index 8683b4dffbc40..e9fcf06f520e4 100644 --- a/administrator/components/com_categories/helpers/html/categoriesadministrator.php +++ b/administrator/components/com_categories/helpers/html/categoriesadministrator.php @@ -84,6 +84,8 @@ public static function association($catid, $extension = 'com_content') 'hasTooltip label label-association label-' . $item->lang_sef ); } + + unset($item); } $html = JLayoutHelper::render('joomla.content.associations', $items); diff --git a/administrator/components/com_categories/views/categories/view.html.php b/administrator/components/com_categories/views/categories/view.html.php index e094fb1b82c3b..a17b517af198c 100644 --- a/administrator/components/com_categories/views/categories/view.html.php +++ b/administrator/components/com_categories/views/categories/view.html.php @@ -54,18 +54,20 @@ public function display($tpl = null) $this->ordering[$item->parent_id][] = $item->id; } + unset($item); + // Levels filter. - $options = array(); - $options[] = JHtml::_('select.option', '1', JText::_('J1')); - $options[] = JHtml::_('select.option', '2', JText::_('J2')); - $options[] = JHtml::_('select.option', '3', JText::_('J3')); - $options[] = JHtml::_('select.option', '4', JText::_('J4')); - $options[] = JHtml::_('select.option', '5', JText::_('J5')); - $options[] = JHtml::_('select.option', '6', JText::_('J6')); - $options[] = JHtml::_('select.option', '7', JText::_('J7')); - $options[] = JHtml::_('select.option', '8', JText::_('J8')); - $options[] = JHtml::_('select.option', '9', JText::_('J9')); - $options[] = JHtml::_('select.option', '10', JText::_('J10')); + $options = array(); + $options[] = JHtml::_('select.option', '1', JText::_('J1')); + $options[] = JHtml::_('select.option', '2', JText::_('J2')); + $options[] = JHtml::_('select.option', '3', JText::_('J3')); + $options[] = JHtml::_('select.option', '4', JText::_('J4')); + $options[] = JHtml::_('select.option', '5', JText::_('J5')); + $options[] = JHtml::_('select.option', '6', JText::_('J6')); + $options[] = JHtml::_('select.option', '7', JText::_('J7')); + $options[] = JHtml::_('select.option', '8', JText::_('J8')); + $options[] = JHtml::_('select.option', '9', JText::_('J9')); + $options[] = JHtml::_('select.option', '10', JText::_('J10')); $this->f_levels = $options; diff --git a/administrator/components/com_contact/helpers/html/contact.php b/administrator/components/com_contact/helpers/html/contact.php index 971a5372d9cb9..0ea23c8f83632 100644 --- a/administrator/components/com_contact/helpers/html/contact.php +++ b/administrator/components/com_contact/helpers/html/contact.php @@ -14,9 +14,7 @@ /** * Contact HTML helper class. * - * @package Joomla.Administrator - * @subpackage com_contact - * @since 1.6 + * @since 1.6 */ abstract class JHtmlContact { @@ -92,6 +90,8 @@ public static function association($contactid) 'hasTooltip label label-association label-' . $item->lang_sef ); } + + unset($item); } $html = JLayoutHelper::render('joomla.content.associations', $items); diff --git a/administrator/components/com_contact/views/contacts/view.html.php b/administrator/components/com_contact/views/contacts/view.html.php index 9d5d5f826d65d..8147086ae7ebc 100644 --- a/administrator/components/com_contact/views/contacts/view.html.php +++ b/administrator/components/com_contact/views/contacts/view.html.php @@ -31,9 +31,9 @@ class ContactViewContacts extends JViewLegacy */ public function display($tpl = null) { - $this->items = $this->get('Items'); - $this->pagination = $this->get('Pagination'); - $this->state = $this->get('State'); + $this->items = $this->get('Items'); + $this->pagination = $this->get('Pagination'); + $this->state = $this->get('State'); ContactHelper::addSubmenu('contacts'); @@ -53,6 +53,8 @@ public function display($tpl = null) $item->order_dn = true; } + unset($item); + $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); parent::display($tpl); diff --git a/administrator/components/com_content/helpers/html/contentadministrator.php b/administrator/components/com_content/helpers/html/contentadministrator.php index d0a892d2b809d..0287abb103517 100644 --- a/administrator/components/com_content/helpers/html/contentadministrator.php +++ b/administrator/components/com_content/helpers/html/contentadministrator.php @@ -66,7 +66,7 @@ public static function association($articleid) foreach ($items as &$item) { $text = strtoupper($item->lang_sef); - $url = JRoute::_('index.php?option=com_content&task=article.edit&id=' . (int) $item->id); + $url = JRoute::_('index.php?option=com_content&task=article.edit&id=' . (int) $item->id); $tooltipParts = array( JHtml::_('image', 'mod_languages/' . $item->image . '.gif', $item->language_title, @@ -78,6 +78,8 @@ public static function association($articleid) ); $item->link = JHtml::_('tooltip', implode(' ', $tooltipParts), null, null, $text, $url, null, 'hasTooltip label label-association label-' . $item->lang_sef); } + + unset($item); } $html = JLayoutHelper::render('joomla.content.associations', $items); diff --git a/administrator/components/com_installer/models/extension.php b/administrator/components/com_installer/models/extension.php index 6464be0fc9af7..6c331fd67d689 100644 --- a/administrator/components/com_installer/models/extension.php +++ b/administrator/components/com_installer/models/extension.php @@ -52,12 +52,12 @@ public function __construct($config = array()) */ protected function _getList($query, $limitstart = 0, $limit = 0) { - $ordering = $this->getState('list.ordering'); - $search = $this->getState('filter.search'); + $ordering = $this->getState('list.ordering'); + $search = $this->getState('filter.search'); // Replace slashes so preg_match will work - $search = str_replace('/', ' ', $search); - $db = $this->getDbo(); + $search = str_replace('/', ' ', $search); + $db = $this->getDbo(); if ($ordering == 'name' || (!empty($search) && stripos($search, 'id:') !== 0)) { @@ -133,14 +133,14 @@ protected function translate(&$items) } $item->author_info = @$item->authorEmail . '
' . @$item->authorUrl; - $item->client = $item->client_id ? JText::_('JADMINISTRATOR') : JText::_('JSITE'); - $path = $item->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE; + $item->client = $item->client_id ? JText::_('JADMINISTRATOR') : JText::_('JSITE'); + $path = $item->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE; switch ($item->type) { case 'component': $extension = $item->element; - $source = JPATH_ADMINISTRATOR . '/components/' . $extension; + $source = JPATH_ADMINISTRATOR . '/components/' . $extension; $lang->load("$extension.sys", JPATH_ADMINISTRATOR, null, false, true) || $lang->load("$extension.sys", $source, null, false, true); break; @@ -154,7 +154,7 @@ protected function translate(&$items) break; case 'module': $extension = $item->element; - $source = $path . '/modules/' . $extension; + $source = $path . '/modules/' . $extension; $lang->load("$extension.sys", $path, null, false, true) || $lang->load("$extension.sys", $source, null, false, true); break; @@ -164,13 +164,13 @@ protected function translate(&$items) break; case 'plugin': $extension = 'plg_' . $item->folder . '_' . $item->element; - $source = JPATH_PLUGINS . '/' . $item->folder . '/' . $item->element; + $source = JPATH_PLUGINS . '/' . $item->folder . '/' . $item->element; $lang->load("$extension.sys", JPATH_ADMINISTRATOR, null, false, true) || $lang->load("$extension.sys", $source, null, false, true); break; case 'template': $extension = 'tpl_' . $item->element; - $source = $path . '/templates/' . $item->element; + $source = $path . '/templates/' . $item->element; $lang->load("$extension.sys", $path, null, false, true) || $lang->load("$extension.sys", $source, null, false, true); break; @@ -188,5 +188,7 @@ protected function translate(&$items) $item->description = JText::_($item->description); } } + + unset($item); } } diff --git a/administrator/components/com_media/controllers/file.php b/administrator/components/com_media/controllers/file.php index a01ac9f35dfda..11e55e81912c9 100644 --- a/administrator/components/com_media/controllers/file.php +++ b/administrator/components/com_media/controllers/file.php @@ -117,10 +117,12 @@ public function upload() } } + unset($file); + // Set FTP credentials, if given JClientHelper::setCredentialsFromRequest('ftp'); JPluginHelper::importPlugin('content'); - $dispatcher = JEventDispatcher::getInstance(); + $dispatcher = JEventDispatcher::getInstance(); foreach ($files as &$file) { @@ -161,6 +163,8 @@ public function upload() } } + unset($file); + return true; } diff --git a/administrator/components/com_menus/helpers/html/menus.php b/administrator/components/com_menus/helpers/html/menus.php index 378f6ac17cf1d..cb62b5409e937 100644 --- a/administrator/components/com_menus/helpers/html/menus.php +++ b/administrator/components/com_menus/helpers/html/menus.php @@ -78,6 +78,8 @@ public static function association($itemid) $class = 'hasTooltip label label-association label-' . $item->lang_sef; $item->link = JHtml::_('tooltip', implode(' ', $tooltipParts), null, null, $text, $url, null, $class); } + + unset($item); } $html = JLayoutHelper::render('joomla.content.associations', $items); diff --git a/administrator/components/com_menus/helpers/menus.php b/administrator/components/com_menus/helpers/menus.php index 2d63d0acebee3..9353a9cb3f6a7 100644 --- a/administrator/components/com_menus/helpers/menus.php +++ b/administrator/components/com_menus/helpers/menus.php @@ -233,9 +233,11 @@ public static function getMenuLinks($menuType = null, $parentId = 0, $mode = 0, foreach ($menuTypes as &$type) { $rlu[$type->menutype] = & $type; - $type->links = array(); + $type->links = array(); } + unset($type); + // Loop through the list of menu links. foreach ($links as &$link) { @@ -248,6 +250,8 @@ public static function getMenuLinks($menuType = null, $parentId = 0, $mode = 0, } } + unset($link); + return $menuTypes; } else diff --git a/administrator/components/com_menus/models/item.php b/administrator/components/com_menus/models/item.php index 2333e595d1d3e..9508333b06d10 100644 --- a/administrator/components/com_menus/models/item.php +++ b/administrator/components/com_menus/models/item.php @@ -30,25 +30,25 @@ class MenusModelItem extends JModelAdmin public $typeAlias = 'com_menus.item'; /** - * @var string The prefix to use with controller messages. + * @var string The prefix to use with controller messages. * @since 1.6 */ protected $text_prefix = 'COM_MENUS_ITEM'; /** - * @var string The help screen key for the menu item. + * @var string The help screen key for the menu item. * @since 1.6 */ protected $helpKey = 'JHELP_MENUS_MENU_ITEM_MANAGER_EDIT'; /** - * @var string The help screen base URL for the menu item. + * @var string The help screen base URL for the menu item. * @since 1.6 */ protected $helpURL; /** - * @var boolean True to use local lookup for the help screen. + * @var boolean True to use local lookup for the help screen. * @since 1.6 */ protected $helpLocal = false; @@ -1150,6 +1150,8 @@ public function rebuild() unset($registry); } + unset($item); + // Clean the cache $this->cleanCache(); diff --git a/administrator/components/com_menus/models/menu.php b/administrator/components/com_menus/models/menu.php index 94668afce587f..6b4a6b02ad625 100644 --- a/administrator/components/com_menus/models/menu.php +++ b/administrator/components/com_menus/models/menu.php @@ -115,7 +115,7 @@ protected function populateState() public function &getItem($itemId = null) { $itemId = (!empty($itemId)) ? $itemId : (int) $this->getState('menu.id'); - $false = false; + $false = false; // Get a menu item row instance. $table = $this->getTable(); @@ -132,7 +132,7 @@ public function &getItem($itemId = null) } $properties = $table->getProperties(1); - $value = JArrayHelper::toObject($properties, 'JObject'); + $value = JArrayHelper::toObject($properties, 'JObject'); return $value; } @@ -334,6 +334,8 @@ public function &getModules() $result[$menuType][] = & $module; } + unset($module); + return $result; } diff --git a/administrator/components/com_menus/views/menus/tmpl/default.php b/administrator/components/com_menus/views/menus/tmpl/default.php index 464c5fe4ad811..da199e8aac0da 100644 --- a/administrator/components/com_menus/views/menus/tmpl/default.php +++ b/administrator/components/com_menus/views/menus/tmpl/default.php @@ -17,12 +17,12 @@ JHtml::_('behavior.modal'); JHtml::_('formbehavior.chosen', 'select'); -$uri = JUri::getInstance(); -$return = base64_encode($uri); -$user = JFactory::getUser(); -$userId = $user->get('id'); +$uri = JUri::getInstance(); +$return = base64_encode($uri); +$user = JFactory::getUser(); +$userId = $user->get('id'); $listOrder = $this->escape($this->state->get('list.ordering')); -$listDirn = $this->escape($this->state->get('list.direction')); +$listDirn = $this->escape($this->state->get('list.direction')); $modMenuId = (int) $this->get('ModMenuId'); JFactory::getDocument()->addScriptDeclaration(" @@ -149,6 +149,7 @@ + diff --git a/administrator/components/com_modules/models/module.php b/administrator/components/com_modules/models/module.php index 5b36121767716..dd9ec51fde02c 100644 --- a/administrator/components/com_modules/models/module.php +++ b/administrator/components/com_modules/models/module.php @@ -1013,6 +1013,8 @@ public function save($data) $tuples[] = '(' . (int) $table->id . ',' . (int) $pk * $sign . ')'; } + unset($pk); + $this->_db->setQuery( 'INSERT INTO #__modules_menu (moduleid, menuid) VALUES ' . implode(',', $tuples) diff --git a/administrator/components/com_modules/models/select.php b/administrator/components/com_modules/models/select.php index 8afe3203bff7f..26dd3d02ae7f9 100644 --- a/administrator/components/com_modules/models/select.php +++ b/administrator/components/com_modules/models/select.php @@ -146,6 +146,8 @@ public function getItems() } } + unset($item); + $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_assignment.php b/administrator/components/com_modules/views/module/tmpl/edit_assignment.php index 847b45fe335d8..ec9bc52879780 100644 --- a/administrator/components/com_modules/views/module/tmpl/edit_assignment.php +++ b/administrator/components/com_modules/views/module/tmpl/edit_assignment.php @@ -121,6 +121,7 @@ function menuHide(val) +