mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-20 19:39:16 -04:00
Started to wire up album and photo view menus. Need photo's parent album link added. Also need add the slideshow link to the menu.
This commit is contained in:
@@ -20,8 +20,9 @@
|
||||
class Menu_Element {
|
||||
public $label;
|
||||
public $url;
|
||||
public $css_id;
|
||||
public $id;
|
||||
|
||||
|
||||
/**
|
||||
* Set the id
|
||||
* @chainable
|
||||
@@ -48,6 +49,16 @@ class Menu_Element {
|
||||
$this->url = $url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the css id
|
||||
* @chainable
|
||||
*/
|
||||
public function css_id($css_id) {
|
||||
$this->css_id = $css_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,7 +66,12 @@ class Menu_Element {
|
||||
*/
|
||||
class Menu_Element_Link extends Menu_Element {
|
||||
public function __toString() {
|
||||
return "<li><a class=\"gMenuElement\" href=\"$this->url\">$this->label</a></li>";
|
||||
if (isset($this->css_id) && !empty($this->css_id)) {
|
||||
$css_id = " id=\"$this->css_id\"";
|
||||
} else {
|
||||
$css_id = "";
|
||||
}
|
||||
return "<li><a$css_id class=\"gMenuElement\" href=\"$this->url\">$this->label</a></li>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user