Skip to content

Commit

Permalink
Merge pull request #1 from darwin26/master
Browse files Browse the repository at this point in the history
Class für UL hinzugefügt
  • Loading branch information
RexDude committed Nov 14, 2015
2 parents f56b42b + f08d02e commit b27c9ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ echo '<hr>';
$nav = new rex_lang_nav();

$nav->setulId("lang-nav"); // ul id: "lang-nav"
$nav->setUlClass("my-lang-class"; // ul class: "my-lang-class"
$nav->setselectedClass("current"); // li klasse für selektierten menüpunkt: "current"
$nav->setshowLiIds(true); // zusätzliche, eindeutige li id's werden ausgegeben
$nav->sethideLiIfOfflineArticle(false); // bei einem offline artikel li nicht verstecken sondern auf startartikel der website verlinken
Expand Down
11 changes: 11 additions & 0 deletions classes/class.rex_lang_nav.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class rex_lang_nav {
protected $ulId;
protected $ulClass;
protected $selectedClass;
protected $showLiIds;
protected $hideLiIfOfflineArticle;
Expand All @@ -10,6 +11,7 @@ class rex_lang_nav {

public function __construct() {
$this->ulId = '';
$this->ulClass = '';
$this->selectedClass = 'selected';
$this->showLiIds = false;
$this->hideLiIfOfflineArticle = false;
Expand All @@ -20,6 +22,10 @@ public function __construct() {
public function setUlId($ulId) {
$this->ulId = $ulId;
}

public function setUlClass($ulClass) {
$this->ulClass = $ulClass;
}

public function setSelectedClass($selectedClass) {
$this->selectedClass = $selectedClass;
Expand Down Expand Up @@ -50,6 +56,11 @@ public function getNavigation() {
} else {
$ulIdAttribute = ' id="' . $this->ulId . '"';
}

// ul class
if ($this->ulClass != '') {
$ulIdAttribute .= ' class="' . $this->ulClass . '"';
}

$out = '<ul' . $ulIdAttribute . '>';

Expand Down

0 comments on commit b27c9ee

Please sign in to comment.