diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2008-12-07 22:10:23 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2008-12-07 22:10:23 +0000 |
commit | 3449827c5ae3f28b0353d7babd354b92f403e5bf (patch) | |
tree | 2d5fbfe308f393c0a2d0f0cc3119815bc9753322 /core/libraries/Menu.php | |
parent | eaffc5e085141a639c15699739b63368eccca945 (diff) |
Change the menu processing to add the gDialogLink class if the url starts with a #. this results in a modal dialog box being opened. At this point the url is not retrieved and the text just shows up in the dialog box... need to look at that
Diffstat (limited to 'core/libraries/Menu.php')
-rw-r--r-- | core/libraries/Menu.php | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/core/libraries/Menu.php b/core/libraries/Menu.php index c1426e87..6f1114a9 100644 --- a/core/libraries/Menu.php +++ b/core/libraries/Menu.php @@ -17,19 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Menu_Item { - protected $_text; - protected $_url; - - function __constructor($text, $url="#") { - $this->_text = $text; - $this->_url = $url; - } - - function __toString() { - return "<li><a href=\"$this->_url\">$this->_text</a></li>"; - } -} class Menu_Core { protected $_text; @@ -89,7 +76,15 @@ class Menu_Core { public function __toString() { $items_html = array(); if (!empty($this->_text)) { - $items_html[] = "<li><a href=\"$this->_url\">$this->_text</a>"; + if ($this->_url[0] == "#") { + $class = "class=\"gDialogLink\""; + $url = substr($this->_url, 1); + } else { + $class = ""; + $url = $this->_url; + } + + $items_html[] = "<li><a $class href=\"$url\">$this->_text</a>"; } if (!empty($this->_items)) { |