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 | |
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
-rw-r--r-- | core/helpers/core_menu.php | 2 | ||||
-rw-r--r-- | core/js/menu.js | 6 | ||||
-rw-r--r-- | core/libraries/Menu.php | 23 |
3 files changed, 13 insertions, 18 deletions
diff --git a/core/helpers/core_menu.php b/core/helpers/core_menu.php index e43c7762..dc807a36 100644 --- a/core/helpers/core_menu.php +++ b/core/helpers/core_menu.php @@ -27,7 +27,7 @@ class core_menu_Core { if ($user) { $upload_menu = new Menu(_("UPLOAD")); $upload_menu->append( - new Menu(_("File Upload"), "#photo/form/file_upload/" . $theme->item()->id)); + new Menu(_("Add Item"), "#form/add/photos/" . $theme->item()->id)); $upload_menu->append( new Menu(_("Local Upload"), "#photo/form/local_upload/" . $theme->item()->id)); $menus->append($upload_menu); diff --git a/core/js/menu.js b/core/js/menu.js index b5f0a6ee..57484f3f 100644 --- a/core/js/menu.js +++ b/core/js/menu.js @@ -15,9 +15,9 @@ $("document").ready(function() { var href = $(this).attr("href"); if (href == "#") { return false; - } else if (href.match("^#") == "#") { - alert("Display href: " + href.substring(1) + "in a popup"); - return false; +// } else if (href.match("^#") == "#") { +// alert("Display href: " + href.substring(1) + "in a popup"); +// return false; } return true; }); 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)) { |