Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
janmarek committed Feb 15, 2012
1 parent e393883 commit f46499c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 31 deletions.
34 changes: 9 additions & 25 deletions Navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@

use Nette\Application\UI\Control;


class Navigation extends Control
{

/** @var NavigationNode */
private $homepage;

Expand All @@ -24,8 +23,6 @@ class Navigation extends Control
/** @var bool */
private $useHomepage = false;



/**
* Set node as current
* @param NavigationNode $node
Expand All @@ -39,8 +36,6 @@ public function setCurrent(NavigationNode $node)
$this->current = $node;
}



/**
* Add navigation node as a child
* @param string $label
Expand All @@ -49,11 +44,9 @@ public function setCurrent(NavigationNode $node)
*/
public function add($label, $url)
{
return $this->getComponent("homepage")->add($label, $url);
return $this->getComponent('homepage')->add($label, $url);
}



/**
* Setup homepage
* @param string $label
Expand All @@ -62,15 +55,13 @@ public function add($label, $url)
*/
public function setupHomepage($label, $url)
{
$homepage = $this->getComponent("homepage");
$homepage = $this->getComponent('homepage');
$homepage->label = $label;
$homepage->url = $url;
$this->useHomepage = true;
return $homepage;
}



/**
* Homepage factory
* @param string $name
Expand All @@ -80,8 +71,6 @@ protected function createComponentHomepage($name)
new NavigationNode($this, $name);
}



/**
* Render menu
* @param bool $renderChildren
Expand All @@ -91,16 +80,14 @@ protected function createComponentHomepage($name)
public function renderMenu($renderChildren = TRUE, $base = NULL, $renderHomepage = TRUE)
{
$template = $this->createTemplate()
->setFile(dirname(__FILE__) . "/menu.phtml");
$template->homepage = $base ? $base : $this->getComponent("homepage");
->setFile(dirname(__FILE__) . '/menu.phtml');
$template->homepage = $base ? $base : $this->getComponent('homepage');
$template->useHomepage = $this->useHomepage && $renderHomepage;
$template->renderChildren = $renderChildren;
$template->children = $this->getComponent("homepage")->getComponents();
$template->children = $this->getComponent('homepage')->getComponents();
$template->render();
}



/**
* Render full menu
*/
Expand All @@ -109,8 +96,6 @@ public function render()
$this->renderMenu();
}



/**
* Render main menu
*/
Expand All @@ -119,8 +104,6 @@ public function renderMainMenu()
$this->renderMenu(FALSE);
}



/**
* Render breadcrumbs
*/
Expand All @@ -144,9 +127,10 @@ public function renderBreadcrumbs()
}

$template = $this->createTemplate()
->setFile(dirname(__FILE__) . "/breadcrumbs.phtml");
->setFile(dirname(__FILE__) . '/breadcrumbs.phtml');

$template->items = $items;
$template->render();
}

}
7 changes: 1 addition & 6 deletions NavigationNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

use Nette\ComponentModel\Container;


class NavigationNode extends Container
{

Expand All @@ -24,8 +23,6 @@ class NavigationNode extends Container
/** @var bool */
public $isCurrent = false;



/**
* Add navigation node as a child
* @staticvar int $counter
Expand All @@ -44,15 +41,13 @@ public function add($label, $url) {
return $navigationNode;
}



/**
* Set node as current
* @param NavigationNode $node
*/
public function setCurrent(NavigationNode $node)
{
return $this->parent->setCurrent($node);
$this->getParent()->setCurrent($node);
}

}

0 comments on commit f46499c

Please sign in to comment.