[CS] Codestyle changes done in staging.

This commit is contained in:
Thomas Hunziker 2014-12-04 20:43:05 +01:00
parent e2c472aca8
commit dbf29cdc71
28 changed files with 76 additions and 116 deletions

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* Weblinks Weblink Controller
*
* @package Joomla.Administrator
* @subpackage com_weblinks
* @since 1.5
* @since 1.5
*/
class WeblinksController extends JControllerLegacy
{

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* Weblink controller class.
*
* @package Joomla.Administrator
* @subpackage com_weblinks
* @since 1.6
* @since 1.6
*/
class WeblinksControllerWeblink extends JControllerForm
{

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* Weblinks list controller class.
*
* @package Joomla.Administrator
* @subpackage com_weblinks
* @since 1.6
* @since 1.6
*/
class WeblinksControllerWeblinks extends JControllerAdmin
{

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* Weblinks helper.
*
* @package Joomla.Administrator
* @subpackage com_weblinks
* @since 1.6
* @since 1.6
*/
class WeblinksHelper extends JHelperContent
{

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* Weblinks model.
*
* @package Joomla.Administrator
* @subpackage com_weblinks
* @since 1.5
* @since 1.5
*/
class WeblinksModelWeblink extends JModelAdmin
{

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* Methods supporting a list of weblink records.
*
* @package Joomla.Administrator
* @subpackage com_weblinks
* @since 1.6
* @since 1.6
*/
class WeblinksModelWeblinks extends JModelList
{

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* Weblink Table class
*
* @package Joomla.Administrator
* @subpackage com_weblinks
* @since 1.5
* @since 1.5
*/
class WeblinksTableWeblink extends JTable
{

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* View to edit a weblink.
*
* @package Joomla.Administrator
* @subpackage com_weblinks
* @since 1.5
* @since 1.5
*/
class WeblinksViewWeblink extends JViewLegacy
{

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* View class for a list of weblinks.
*
* @package Joomla.Administrator
* @subpackage com_weblinks
* @since 1.5
* @since 1.5
*/
class WeblinksViewWeblinks extends JViewLegacy
{

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* Weblinks Component Controller
*
* @package Joomla.Site
* @subpackage com_weblinks
* @since 1.5
* @since 1.5
*/
class WeblinksController extends JControllerLegacy
{

View File

@ -10,9 +10,9 @@
defined('_JEXEC') or die;
/**
* @package Joomla.Site
* @subpackage com_weblinks
* @since 1.5
* Weblinks class.
*
* @since 1.5
*/
class WeblinksControllerWeblink extends JControllerForm
{
@ -42,7 +42,6 @@ class WeblinksControllerWeblink extends JControllerForm
*/
public function add()
{
if (!parent::add())
{
// Redirect to the return page.
@ -53,8 +52,10 @@ class WeblinksControllerWeblink extends JControllerForm
/**
* Method override to check if you can add a new record.
*
* @param array $data An array of input data.
* @param array $data An array of input data.
*
* @return boolean
*
* @since 1.6
*/
protected function allowAdd($data = array())
@ -66,7 +67,7 @@ class WeblinksControllerWeblink extends JControllerForm
if ($categoryId)
{
// If the category has been passed in the URL check it.
$allow = $user->authorise('core.create', $this->option.'.category.'.$categoryId);
$allow = $user->authorise('core.create', $this->option . '.category.' . $categoryId);
}
if ($allow === null)
@ -83,15 +84,16 @@ class WeblinksControllerWeblink extends JControllerForm
/**
* Method to check if you can add a new record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$categoryId = 0;
if ($recordId)
@ -102,7 +104,7 @@ class WeblinksControllerWeblink extends JControllerForm
if ($categoryId)
{
// The category has been set. Check the category permissions.
return JFactory::getUser()->authorise('core.edit', $this->option.'.category.'.$categoryId);
return JFactory::getUser()->authorise('core.edit', $this->option . '.category.' . $categoryId);
}
else
{
@ -114,9 +116,10 @@ class WeblinksControllerWeblink extends JControllerForm
/**
* Method to cancel an edit.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $key The name of the primary key of the URL variable.
*
* @return Boolean True if access level checks pass, false otherwise.
* @return boolean True if access level checks pass, false otherwise.
*
* @since 1.6
*/
public function cancel($key = 'w_id')
@ -130,10 +133,11 @@ class WeblinksControllerWeblink extends JControllerForm
/**
* Method to edit an existing record.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
*
* @return Boolean True if access level check and checkout passes, false otherwise.
* @return boolean True if access level check and checkout passes, false otherwise.
*
* @since 1.6
*/
public function edit($key = null, $urlVar = 'w_id')
@ -146,11 +150,12 @@ class WeblinksControllerWeblink 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.
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return object The model.
*
* @since 1.5
*/
public function getModel($name = 'form', $prefix = '', $config = array('ignore_request' => true))
@ -163,10 +168,11 @@ class WeblinksControllerWeblink extends JControllerForm
/**
* Gets the URL arguments to append to an item redirect.
*
* @param integer $recordId The primary key id for the item.
* @param string $urlVar The name of the URL variable for the id.
* @param integer $recordId The primary key id for the item.
* @param string $urlVar The name of the URL variable for the id.
*
* @return string The arguments to append to the redirect URL.
* @return string The arguments to append to the redirect URL.
*
* @since 1.6
*/
protected function getRedirectToItemAppend($recordId = null, $urlVar = null)
@ -177,12 +183,12 @@ class WeblinksControllerWeblink extends JControllerForm
if ($itemId)
{
$append .= '&Itemid='.$itemId;
$append .= '&Itemid=' . $itemId;
}
if ($return)
{
$append .= '&return='.base64_encode($return);
$append .= '&return=' . base64_encode($return);
}
return $append;
@ -193,7 +199,8 @@ class WeblinksControllerWeblink extends JControllerForm
*
* If a "return" variable has been passed in the request
*
* @return string The return URL.
* @return string The return URL.
*
* @since 1.6
*/
protected function getReturnPage()
@ -227,10 +234,11 @@ class WeblinksControllerWeblink extends JControllerForm
/**
* Method to save a record.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
*
* @return Boolean True if successful, false otherwise.
* @return boolean True if successful, false otherwise.
*
* @since 1.6
*/
public function save($key = null, $urlVar = 'w_id')
@ -250,6 +258,7 @@ class WeblinksControllerWeblink extends JControllerForm
* Go to a weblink
*
* @return void
*
* @since 1.6
*/
public function go()
@ -299,7 +308,7 @@ class WeblinksControllerWeblink extends JControllerForm
}
// Redirect to the URL
// TODO: Probably should check for a valid http link
// @todo: Probably should check for a valid http link
if ($link->url)
{
$modelLink->hit($id);

View File

@ -15,9 +15,7 @@ JLoader::register('CategoryHelperAssociation', JPATH_ADMINISTRATOR . '/component
/**
* Weblinks Component Association Helper
*
* @package Joomla.Site
* @subpackage com_weblinks
* @since 3.0
* @since 3.0
*/
abstract class WeblinksHelperAssociation extends CategoryHelperAssociation
{

View File

@ -10,12 +10,9 @@
defined('_JEXEC') or die;
/**
* Weblinks Component Category Tree
* Weblinks Component Category Tree.
*
* @static
* @package Joomla.Site
* @subpackage com_weblinks
* @since 1.6
* @since 1.6
*/
class WeblinksCategories extends JCategories
{

View File

@ -10,12 +10,9 @@
defined('_JEXEC') or die;
/**
* Weblink Component HTML Helper
* Weblink Component HTML Helper.
*
* @static
* @package Joomla.Site
* @subpackage com_weblinks
* @since 1.5
* @since 1.5
*/
class JHtmlIcon
{

View File

@ -10,12 +10,9 @@
defined('_JEXEC') or die;
/**
* Weblinks Component Route Helper
* Weblinks Component Route Helper.
*
* @static
* @package Joomla.Site
* @subpackage com_weblinks
* @since 1.5
* @since 1.5
*/
abstract class WeblinksHelperRoute
{

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* This models supports retrieving lists of article categories.
*
* @package Joomla.Site
* @subpackage com_weblinks
* @since 1.6
* @since 1.6
*/
class WeblinksModelCategories extends JModelList
{
@ -94,18 +92,23 @@ class WeblinksModelCategories extends JModelList
$menu = $app->getMenu();
$active = $menu->getActive();
$params = new JRegistry;
if ($active)
{
$params->loadString($active->params);
}
$options = array();
$options['countItems'] = $params->get('show_cat_num_links', 1) || !$params->get('show_empty_categories_cat', 0);
$categories = JCategories::getInstance('Weblinks', $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;
}
}

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* Weblinks Component Weblink Model
*
* @package Joomla.Site
* @subpackage com_weblinks
* @since 1.5
* @since 1.5
*/
class WeblinksModelCategory extends JModelList
{

View File

@ -14,9 +14,7 @@ require_once JPATH_COMPONENT_ADMINISTRATOR.'/models/weblink.php';
/**
* Weblinks model.
*
* @package Joomla.Site
* @subpackage com_weblinks
* @since 1.6
* @since 1.6
*/
class WeblinksModelForm extends WeblinksModelWeblink
{

View File

@ -14,9 +14,7 @@ JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables');
/**
* Weblinks Component Model for a Weblink record
*
* @package Joomla.Site
* @subpackage com_weblinks
* @since 1.5
* @since 1.5
*/
class WeblinksModelWeblink extends JModelItem
{

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* Routing class from com_weblinks
*
* @package Joomla.Site
* @subpackage com_weblinks
* @since 3.3
* @since 3.3
*/
class WeblinksRouter extends JComponentRouterBase
{
@ -236,7 +234,7 @@ class WeblinksRouter extends JComponentRouterBase
->select($db->quoteName('id'))
->from('#__weblinks')
->where($db->quoteName('catid') . ' = ' . (int) $vars['catid'])
->where($db->quoteName('alias') . ' = ' . $db->quote($db->quote(str_replace(':', '-', $segment))));
->where($db->quoteName('alias') . ' = ' . $db->quote(str_replace(':', '-', $segment)));
$db->setQuery($query);
$id = $db->loadResult();
}

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* Content categories view.
*
* @package Joomla.Site
* @subpackage com_weblinks
* @since 1.5
* @since 1.5
*/
class WeblinksViewCategories extends JViewCategories
{

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* HTML View class for the WebLinks component
*
* @package Joomla.Site
* @subpackage com_weblinks
* @since 1.0
* @since 1.0
*/
class WeblinksViewCategory extends JViewCategoryfeed
{

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* HTML View class for the WebLinks component
*
* @package Joomla.Site
* @subpackage com_weblinks
* @since 1.5
* @since 1.5
*/
class WeblinksViewCategory extends JViewCategory
{

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* HTML Article View class for the Weblinks component
*
* @package Joomla.Site
* @subpackage com_weblinks
* @since 1.5
* @since 1.5
*/
class WeblinksViewForm extends JViewLegacy
{
@ -48,6 +46,7 @@ class WeblinksViewForm extends JViewLegacy
if ($authorised !== true)
{
JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
return false;
}
@ -131,7 +130,7 @@ class WeblinksViewForm extends JViewLegacy
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots'))
if ($this->params->get('robots'))
{
$this->document->setMetadata('robots', $this->params->get('robots'));
}

View File

@ -12,9 +12,7 @@ defined('_JEXEC') or die;
/**
* HTML View class for the WebLinks component
*
* @package Joomla.Site
* @subpackage com_weblinks
* @since 1.5
* @since 1.5
*/
class WeblinksViewWeblink extends JViewLegacy
{

View File

@ -9,7 +9,7 @@
defined('_JEXEC') or die;
require_once JPATH_COMPONENT.'/helpers/route.php';
require_once JPATH_COMPONENT . '/helpers/route.php';
$controller = JControllerLegacy::getInstance('Weblinks');
$controller->execute(JFactory::getApplication()->input->get('task'));

View File

@ -15,9 +15,7 @@ require_once JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapt
/**
* Smart Search adapter for Joomla Web Links.
*
* @package Joomla.Plugin
* @subpackage Finder.Weblinks
* @since 2.5
* @since 2.5
*/
class PlgFinderWeblinks extends FinderIndexerAdapter
{

View File

@ -14,9 +14,7 @@ require_once JPATH_SITE . '/components/com_weblinks/helpers/route.php';
/**
* Weblinks search plugin.
*
* @package Joomla.Plugin
* @subpackage Search.weblinks
* @since 1.6
* @since 1.6
*/
class PlgSearchWeblinks extends JPlugin
{