1
0
mirror of https://github.com/e107inc/e107.git synced 2025-09-01 18:32:44 +02:00

Theme shortcodes may now be used as content for sitelink functions. eg. To generate drop-down mega-menus.

This commit is contained in:
Cameron
2017-03-15 16:49:55 -07:00
parent 5a5f92392c
commit be44bc8f09
6 changed files with 55 additions and 50 deletions

View File

@@ -1688,25 +1688,33 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
return $row['link_sub'];
}
if(vartrue($row['link_function']))
if(!empty($row['link_function']))
{
$parm = false;
list($path,$method) = explode("::",$row['link_function']);
if($path === 'theme')
{
$text = e107::callMethod('theme_shortcodes',$method, $row); // no parms as theme_shortcodes may be added as needed.
if(!empty($text))
{
return '<div class="dropdown-menu">'.$text.'</div>'; // @todo use template?
}
}
if(strpos($method,"("))
{
list($method,$prm) = explode("(",$method);
$parm = rtrim($prm,")");
}
if(include_once(e_PLUGIN.$path."/e_sitelink.php"))
{
$class = $path."_sitelink";
if($sublinkArray = e107::callMethod($class,$method,$parm,$row)) //TODO Cache it.
{
return $sublinkArray;
}
}