Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
15 changes: 8 additions & 7 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.
*
* @see JController
* @since 1.6
*/
Expand All @@ -45,10 +46,10 @@ 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 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()}.
*
* @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 +69,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 +88,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
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ 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
Expand All @@ -36,7 +36,7 @@ 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 @@ -84,24 +84,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 @@ -119,9 +119,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,6 +170,7 @@ protected function getRedirectToListAppend()

return $append;
}

/**
* Function that allows child controller access to model data after the data has been saved.
*
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
10 changes: 5 additions & 5 deletions administrator/components/com_categories/helpers/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,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,8 +76,8 @@ 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
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 All @@ -80,5 +81,4 @@ public static function association($catid, $extension = 'com_content')

return $html;
}

}
9 changes: 5 additions & 4 deletions administrator/components/com_categories/models/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class CategoriesModelCategories extends JModelList
* Constructor.
*
* @param array An optional associative array of configuration settings.
*
* @see JController
* @since 1.6
*/
Expand Down Expand Up @@ -106,7 +107,7 @@ 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
Expand Down Expand Up @@ -139,9 +140,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
26 changes: 13 additions & 13 deletions administrator/components/com_categories/models/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CategoriesModelCategory 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.
*
Expand All @@ -50,7 +50,7 @@ protected function canDelete($record)
/**
* Method to test whether a record can have its state changed.
*
* @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.
*
Expand Down Expand Up @@ -133,7 +133,7 @@ protected function populateState()
*
* @param integer $pk An optional id of the object to get, otherwise the id from the model state is used.
*
* @return mixed Category data object on success, false on failure.
* @return mixed Category data object on success, false on failure.
*
* @since 1.6
*/
Expand Down Expand Up @@ -209,7 +209,7 @@ public function getItem($pk = null)
* @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 mixed A JForm object on success, false on failure
* @return mixed A JForm object on success, false on failure
*
* @since 1.6
*/
Expand Down Expand Up @@ -263,7 +263,7 @@ public function getForm($data = array(), $loadData = true)
*
* @param JCategoryTable $table Current table instance
*
* @return array An array of conditions to add to add to ordering queries.
* @return array An array of conditions to add to add to ordering queries.
*
* @since 1.6
*/
Expand Down Expand Up @@ -297,9 +297,9 @@ protected function loadFormData()
/**
* Method to preprocess the form.
*
* @param JForm $form A JForm object.
* @param mixed $data The data expected for the form.
* @param string $group The name of the plugin group to import.
* @param JForm $form A JForm object.
* @param mixed $data The data expected for the form.
* @param string $group The name of the plugin group to import.
*
* @return void
*
Expand Down Expand Up @@ -411,7 +411,7 @@ protected function preprocessForm(JForm $form, $data, $group = 'content')
/**
* Method to save the form data.
*
* @param array $data The form data.
* @param array $data The form data.
*
* @return boolean True on success.
*
Expand Down Expand Up @@ -582,8 +582,8 @@ public function save($data)
/**
* Method to change the published state of one or more records.
*
* @param array &$pks A list of the primary keys to change.
* @param integer $value The value of the published state.
* @param array &$pks A list of the primary keys to change.
* @param integer $value The value of the published state.
*
* @return boolean True on success.
*
Expand Down Expand Up @@ -707,7 +707,7 @@ protected function batchTag($value, $pks, $contexts)
* @param array $pks An array of row IDs.
* @param array $contexts An array of item contexts.
*
* @return mixed An array of new IDs on success, boolean false on failure.
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 1.6
*/
Expand Down Expand Up @@ -1058,7 +1058,7 @@ protected function cleanCache($group = null, $client_id = 0)
* @param string $alias The alias.
* @param string $title The title.
*
* @return array Contains the modified title and alias.
* @return array Contains the modified title and alias.
*
* @since 1.7
*/
Expand Down
Loading