30
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-06-03 06:50:49 +00:00

[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 * Weblinks Weblink Controller
* *
* @package Joomla.Administrator * @since 1.5
* @subpackage com_weblinks
* @since 1.5
*/ */
class WeblinksController extends JControllerLegacy class WeblinksController extends JControllerLegacy
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,7 +9,7 @@
defined('_JEXEC') or die; defined('_JEXEC') or die;
require_once JPATH_COMPONENT.'/helpers/route.php'; require_once JPATH_COMPONENT . '/helpers/route.php';
$controller = JControllerLegacy::getInstance('Weblinks'); $controller = JControllerLegacy::getInstance('Weblinks');
$controller->execute(JFactory::getApplication()->input->get('task')); $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. * Smart Search adapter for Joomla Web Links.
* *
* @package Joomla.Plugin * @since 2.5
* @subpackage Finder.Weblinks
* @since 2.5
*/ */
class PlgFinderWeblinks extends FinderIndexerAdapter class PlgFinderWeblinks extends FinderIndexerAdapter
{ {

View File

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