mirror of
https://github.com/e107inc/e107.git
synced 2025-07-29 10:50:25 +02:00
Allow theme to manually control navigation 'active' status with new method: e107::nav('active', [url match]);
This commit is contained in:
@@ -2587,6 +2587,21 @@ class e107
|
|||||||
self::getJs()->addLink($attributes, $browserCache);
|
self::getJs()->addLink($attributes, $browserCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $type eg. 'active'
|
||||||
|
* @param mixed $value eg. existing link-url value.
|
||||||
|
*/
|
||||||
|
public static function nav($type, $value=null)
|
||||||
|
{
|
||||||
|
if($value === null)
|
||||||
|
{
|
||||||
|
return e107::getRegistry('core/e107/navigation/'.$type);
|
||||||
|
}
|
||||||
|
|
||||||
|
return e107::setRegistry('core/e107/navigation/'.$type, $value);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CSS Common Public Function. Prefered is shortcode script path
|
* CSS Common Public Function. Prefered is shortcode script path
|
||||||
|
@@ -1873,8 +1873,18 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// New e107 v.2.3.1 - using e107::nav('active', link url);
|
||||||
|
$manualOverride = e107::getRegistry('core/e107/navigation/active');
|
||||||
|
if(!empty($manualOverride) && empty($data['link_sub']))
|
||||||
|
{
|
||||||
|
if(strpos($data['link_url'], $manualOverride) !==false)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// XXX Temporary Fix - TBD.
|
|
||||||
|
// XXX Temporary Fix - @deprecated.
|
||||||
// Set the URL matching in the page itself. see: forum_viewforum.php and forum_viewtopic.php
|
// Set the URL matching in the page itself. see: forum_viewforum.php and forum_viewtopic.php
|
||||||
if(defined("NAVIGATION_ACTIVE") && empty($data['link_sub']))
|
if(defined("NAVIGATION_ACTIVE") && empty($data['link_sub']))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user