mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2024-12-28 10:40:47 +00:00
Fix CS for com_weblinks frontend helpers and global controler file (#230)
* Update route.php * Update icon.php * Update controller.php * Update route.php
This commit is contained in:
parent
1fd0653eb6
commit
276c32922e
@ -29,8 +29,8 @@ class WeblinksController extends JControllerLegacy
|
|||||||
*/
|
*/
|
||||||
public function display($cacheable = false, $urlparams = false)
|
public function display($cacheable = false, $urlparams = false)
|
||||||
{
|
{
|
||||||
$cacheable = true; // Huh? Why not just put that in the constructor?
|
// Huh? Why not just put that in the constructor?
|
||||||
$user = JFactory::getUser();
|
$cacheable = true;
|
||||||
|
|
||||||
// Set the default view name and format from the Request.
|
// Set the default view name and format from the Request.
|
||||||
// Note we are using w_id to avoid collisions with the router and the return page.
|
// Note we are using w_id to avoid collisions with the router and the return page.
|
||||||
|
@ -21,15 +21,17 @@ abstract class WeblinksHelperRoute
|
|||||||
protected static $lang_lookup = array();
|
protected static $lang_lookup = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param integer The route of the weblink
|
* Get the route of the weblink
|
||||||
|
*
|
||||||
|
* @param integer $id Web link ID
|
||||||
|
* @param integer $catid Category ID
|
||||||
|
* @param string $language Language
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function getWeblinkRoute($id, $catid, $language = 0)
|
public static function getWeblinkRoute($id, $catid, $language = 0)
|
||||||
{
|
{
|
||||||
$needles = array(
|
$needles = array('weblink' => array((int) $id));
|
||||||
'weblink' => array((int) $id)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Create the link
|
// Create the link
|
||||||
$link = 'index.php?option=com_weblinks&view=weblink&id=' . $id;
|
$link = 'index.php?option=com_weblinks&view=weblink&id=' . $id;
|
||||||
@ -67,6 +69,8 @@ abstract class WeblinksHelperRoute
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Ge the form route
|
||||||
|
*
|
||||||
* @param integer $id The id of the weblink.
|
* @param integer $id The id of the weblink.
|
||||||
* @param string $return The return page variable.
|
* @param string $return The return page variable.
|
||||||
*
|
*
|
||||||
@ -93,6 +97,8 @@ abstract class WeblinksHelperRoute
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Get the Category Route
|
||||||
|
*
|
||||||
* @param JCategoryNode|string|integer $catid JCategoryNode object or category ID
|
* @param JCategoryNode|string|integer $catid JCategoryNode object or category ID
|
||||||
* @param integer $language Language code
|
* @param integer $language Language code
|
||||||
*
|
*
|
||||||
@ -147,6 +153,8 @@ abstract class WeblinksHelperRoute
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Do a language lookup
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected static function buildLanguageLookup()
|
protected static function buildLanguageLookup()
|
||||||
@ -169,6 +177,13 @@ abstract class WeblinksHelperRoute
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find items per given $needles
|
||||||
|
*
|
||||||
|
* @params array $needles
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
protected static function _findItem($needles = null)
|
protected static function _findItem($needles = null)
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
@ -208,7 +223,7 @@ abstract class WeblinksHelperRoute
|
|||||||
|
|
||||||
if (isset($item->query['id']))
|
if (isset($item->query['id']))
|
||||||
{
|
{
|
||||||
// here it will become a bit tricky
|
// Here it will become a bit tricky
|
||||||
// language != * can override existing entries
|
// language != * can override existing entries
|
||||||
// language == * cannot override existing entries
|
// language == * cannot override existing entries
|
||||||
if (!isset(self::$lookup[$language][$view][$item->query['id']]) || $item->language != '*')
|
if (!isset(self::$lookup[$language][$view][$item->query['id']]) || $item->language != '*')
|
||||||
|
Loading…
Reference in New Issue
Block a user