Commit b6741f5e authored by Ad Schellevis's avatar Ad Schellevis

add external links to menusystem

parent 19265d25
...@@ -202,12 +202,12 @@ ...@@ -202,12 +202,12 @@
</Diagnostics> </Diagnostics>
<Help order="7" cssClass="glyphicon glyphicon-question-sign"> <Help order="7" cssClass="glyphicon glyphicon-question-sign">
<AboutThisPage VisibleName="About this Page" url="/help.php"/> <AboutThisPage VisibleName="About this Page" url="/help.php" IsExternal="Y"/>
<DevelopersWiki VisibleName="Developers Wiki" url="https://wiki.opnsense.org/index.php/developers"/> <DevelopersWiki VisibleName="Developers Wiki" url="https://wiki.opnsense.org/index.php/developers" IsExternal="Y"/>
<Documentation url="https://wiki.opnsense.org/"/> <Documentation url="https://wiki.opnsense.org/" IsExternal="Y"/>
<FreeBSDHandbook VisibleName="FreeBSD Handbook" url="https://www.freebsd.org/doc/en/books/handbook/"/> <FreeBSDHandbook VisibleName="FreeBSD Handbook" url="https://www.freebsd.org/doc/en/books/handbook/" IsExternal="Y"/>
<PaidSupport VisibleName="Paid Support" url="https://opnsense.org/support-overview/commercial-support/"/> <PaidSupport VisibleName="Paid Support" url="https://opnsense.org/support-overview/commercial-support/" IsExternal="Y"/>
<UserForum VisibleName="UserForum" url="https://forum.opnsense.org/"/> <UserForum VisibleName="UserForum" url="https://forum.opnsense.org/" IsExternal="Y"/>
</Help> </Help>
</menu> </menu>
...@@ -72,6 +72,12 @@ class MenuItem ...@@ -72,6 +72,12 @@ class MenuItem
*/ */
private $Url = ""; private $Url = "";
/**
* link to external page
* @var string
*/
private $isExternal = "N";
/** /**
* parent node, used to mark active nodes * parent node, used to mark active nodes
* @var null|MenuItem * @var null|MenuItem
...@@ -195,6 +201,24 @@ class MenuItem ...@@ -195,6 +201,24 @@ class MenuItem
return $this->Url; return $this->Url;
} }
/**
* setter for isExternal
* @param $value
*/
public function setIsExternal($value)
{
$this->isExternal = $value;
}
/**
* getter for isExternal
* @return string
*/
public function getIsExternal()
{
return $this->isExternal;
}
/** /**
* @return bool is this item selected * @return bool is this item selected
*/ */
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
<a href="#{{ topMenuItem.Id }}" class="list-group-item {% if topMenuItem.Selected %} active-menu-title {% endif %}" data-toggle="collapse" data-parent="#mainmenu"><span class="{{ topMenuItem.CssClass }} __iconspacer"></span>{{ topMenuItem.VisibleName }} </a> <a href="#{{ topMenuItem.Id }}" class="list-group-item {% if topMenuItem.Selected %} active-menu-title {% endif %}" data-toggle="collapse" data-parent="#mainmenu"><span class="{{ topMenuItem.CssClass }} __iconspacer"></span>{{ topMenuItem.VisibleName }} </a>
<div class="collapse {% if topMenuItem.Selected %} active-menu in {% endif %}" id="{{ topMenuItem.Id }}"> <div class="collapse {% if topMenuItem.Selected %} active-menu in {% endif %}" id="{{ topMenuItem.Id }}">
{% for subMenuItem in topMenuItem.Children %} {% for subMenuItem in topMenuItem.Children %}
{% if acl.isPageAccessible(session.get('Username'),subMenuItem.Url) %} {% if subMenuItem.IsExternal == "Y" %}
<a href="{{ subMenuItem.Url }}" target="_new" class="list-group-item {% if subMenuItem.Selected %} active {% endif %}">{{ subMenuItem.VisibleName }}</a>
{% elseif acl.isPageAccessible(session.get('Username'),subMenuItem.Url) %}
<a href="{{ subMenuItem.Url }}" class="list-group-item {% if subMenuItem.Selected %} active {% endif %}">{{ subMenuItem.VisibleName }}</a> <a href="{{ subMenuItem.Url }}" class="list-group-item {% if subMenuItem.Selected %} active {% endif %}">{{ subMenuItem.VisibleName }}</a>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment