Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion administrator/components/com_categories/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@

$task = $input->get('task');

$controller = JControllerLegacy::getInstance('Categories');
$controller = JControllerLegacy::getInstance('Categories');
$controller->execute($input->get('task'));
$controller->redirect();
14 changes: 7 additions & 7 deletions administrator/components/com_categories/categories.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.1" method="upgrade">
<name>com_categories</name>
<author>Joomla! Project</author>
<author>Joomla! Project</author>
<creationDate>December 2007</creationDate>
<copyright>(C) 2005 - 2013 Open Source Matters. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<authorEmail>[email protected]</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>3.0.0</version>
<description>COM_CATEGORIES_XML_DESCRIPTION</description>
<copyright>(C) 2005 - 2013 Open Source Matters. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<authorEmail>[email protected]</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>3.0.0</version>
<description>COM_CATEGORIES_XML_DESCRIPTION</description>
<administration>
<files folder="admin">
<filename>categories.php</filename>
Expand Down
18 changes: 10 additions & 8 deletions administrator/components/com_categories/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@
class CategoriesController extends JControllerLegacy
{
/**
* @var string The extension for which the categories apply.
* @since 1.6
* @var string The extension for which the categories apply.
* @since 1.6
*/
protected $extension;

/**
* 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
*/
Expand All @@ -45,10 +46,11 @@ public function __construct($config = array())
/**
* 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.
*
* @return JController This object to support chaining.
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
Expand All @@ -68,7 +70,7 @@ public function display($cachable = false, $urlparams = false)
// Somehow the person just went to the form - we don't allow that.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_categories&view=categories&extension='.$this->extension, false));
$this->setRedirect(JRoute::_('index.php?option=com_categories&view=categories&extension=' . $this->extension, false));

return false;
}
Expand All @@ -87,7 +89,7 @@ public function display($cachable = false, $urlparams = false)
$view->document = $document;

// Load the submenu.
require_once JPATH_COMPONENT.'/helpers/categories.php';
require_once JPATH_COMPONENT . '/helpers/categories.php';

CategoriesHelper::addSubmenu($model->getState('filter.extension'));
$view->display();
Expand Down
21 changes: 12 additions & 9 deletions administrator/components/com_categories/controllers/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ class CategoriesControllerCategories extends JControllerAdmin
/**
* Proxy for getModel
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
*
* @return object The model.
*
* @since 1.6
*/
public function getModel($name = 'Category', $prefix = 'CategoriesModel', $config = array('ignore_request' => true))
Expand All @@ -36,7 +37,8 @@ public function getModel($name = 'Category', $prefix = 'CategoriesModel', $confi
/**
* Rebuild the nested set tree.
*
* @return bool False on failure or error, true on success.
* @return bool False on failure or error, true on success.
*
* @since 1.6
*/
public function rebuild()
Expand Down Expand Up @@ -66,6 +68,7 @@ public function rebuild()
* Save the manual order inputs from the categories list page.
*
* @return void
*
* @since 1.6
*/
public function saveorder()
Expand All @@ -84,24 +87,24 @@ public function saveorder()
else
{
// Nothing to reorder
$this->setRedirect(JRoute::_('index.php?option='.$this->option.'&view='.$this->view_list, false));
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false));
return true;
}
}

/**
* Deletes and returns correctly.
*
* @return void
*
* @since 3.1.2
*/
* @return void
*
* @since 3.1.2
*/
public function delete()
{
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

// Get items to remove from the request.
$cid = $this->input->get('cid', array(), 'array');
$cid = $this->input->get('cid', array(), 'array');
$extension = $this->input->getCmd('extension', null);

if (!is_array($cid) || count($cid) < 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class CategoriesControllerCategory extends JControllerForm
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
*
* @since 1.6
* @see JController
*/
Expand Down Expand Up @@ -119,9 +118,9 @@ protected function allowEdit($data = array(), $key = 'parent_id')
/**
* Method to run batch operations.
*
* @param object $model The model.
* @param object $model The model.
*
* @return boolean True if successful, false otherwise and internal error is set.
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 1.6
*/
Expand Down Expand Up @@ -170,13 +169,15 @@ protected function getRedirectToListAppend()

return $append;
}

/**
* Function that allows child controller access to model data after the data has been saved.
*
* @param JModelLegacy $model The data model object.
* @param array $validData The validated data.
*
* @return void
*
* @since 3.1
*/
protected function postSaveHook(JModelLegacy $model, $validData = array())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ abstract class CategoryHelperAssociation
* @param integer $id Id of the item
* @param string $extension Name of the component
*
* @return array Array of associations for the component categories
* @return array Array of associations for the component categories
*
* @since 3.0
*/
Expand All @@ -52,7 +52,7 @@ public static function getCategoryAssociations($id = 0, $extension = 'com_conten
}
else
{
$return[$tag] = 'index.php?option='.$extension.'&view=category&id='.$item;
$return[$tag] = 'index.php?option=' . $extension . '&view=category&id=' . $item;
}
}
}
Expand Down
14 changes: 8 additions & 6 deletions administrator/components/com_categories/helpers/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ class CategoriesHelper
/**
* Configure the Submenu links.
*
* @param string The extension being used for the categories.
* @param string $extension The extension being used for the categories.
*
* @return void
*
* @since 1.6
*/
public static function addSubmenu($extension)
Expand Down Expand Up @@ -63,9 +64,9 @@ public static function addSubmenu($extension)
// loading language file from the administrator/language directory then
// loading language file from the administrator/components/*extension*/language directory
$lang->load($component, JPATH_BASE, null, false, false)
|| $lang->load($component, JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component), null, false, false)
|| $lang->load($component, JPATH_BASE, $lang->getDefault(), false, false)
|| $lang->load($component, JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component), $lang->getDefault(), false, false);
|| $lang->load($component, JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component), null, false, false)
|| $lang->load($component, JPATH_BASE, $lang->getDefault(), false, false)
|| $lang->load($component, JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component), $lang->getDefault(), false, false);

call_user_func(array($cName, 'addSubmenu'), 'categories' . (isset($section) ? '.' . $section : ''));
}
Expand All @@ -76,10 +77,11 @@ public static function addSubmenu($extension)
/**
* Gets a list of the actions that can be performed.
*
* @param string $extension The extension.
* @param integer $categoryId The category ID.
* @param string $extension The extension.
* @param integer $categoryId The category ID.
*
* @return JObject
*
* @since 1.6
*/
public static function getActions($extension, $categoryId = 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ abstract class JHtmlCategoriesAdministrator
/**
* Render the list of associated items
*
* @param integer $catid Category identifier to search its associations
* @param integer $catid Category identifier to search its associations
* @param string $extension Category Extension
*
* @return string The language HTML
* @return string The language HTML
*/
public static function association($catid, $extension = 'com_content')
{
Expand Down Expand Up @@ -63,10 +63,11 @@ public static function association($catid, $extension = 'com_content')
$text = strtoupper($item->lang_sef);
$url = JRoute::_('index.php?option=com_categories&task=category.edit&id=' . (int) $item->id . '&extension=' . $extension);
$tooltipParts = array(
JHtml::_('image', 'mod_languages/' . $item->image . '.gif',
$item->language_title,
array('title' => $item->language_title),
true
JHtml::_(
'image', 'mod_languages/' . $item->image . '.gif',
$item->language_title,
array('title' => $item->language_title),
true
),
$item->title
);
Expand Down
17 changes: 10 additions & 7 deletions administrator/components/com_categories/models/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class CategoriesModelCategories 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
*/
Expand Down Expand Up @@ -55,10 +56,11 @@ public function __construct($config = array())
*
* Note. Calling getState in this method will result in recursion.
*
* @param string An optional ordering field.
* @param string An optional direction (asc|desc).
* @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)
Expand Down Expand Up @@ -114,9 +116,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 = '')
Expand Down Expand Up @@ -147,9 +150,9 @@ protected function getListQuery()
$this->getState(
'list.select',
'a.id, a.title, a.alias, a.note, a.published, a.access' .
', a.checked_out, a.checked_out_time, a.created_user_id' .
', a.path, a.parent_id, a.level, a.lft, a.rgt' .
', a.language'
', a.checked_out, a.checked_out_time, a.created_user_id' .
', a.path, a.parent_id, a.level, a.lft, a.rgt' .
', a.language'
)
);
$query->from('#__categories AS a');
Expand Down
Loading