From f46499c6bad1c60c94e3dbb6aea62526ca415910 Mon Sep 17 00:00:00 2001 From: Jan Marek Date: Wed, 15 Feb 2012 12:54:51 +0100 Subject: [PATCH] typos --- Navigation.php | 34 +++++++++------------------------- NavigationNode.php | 7 +------ 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/Navigation.php b/Navigation.php index e4db46b..9be88f9 100644 --- a/Navigation.php +++ b/Navigation.php @@ -11,10 +11,9 @@ use Nette\Application\UI\Control; - class Navigation extends Control { - + /** @var NavigationNode */ private $homepage; @@ -24,8 +23,6 @@ class Navigation extends Control /** @var bool */ private $useHomepage = false; - - /** * Set node as current * @param NavigationNode $node @@ -39,8 +36,6 @@ public function setCurrent(NavigationNode $node) $this->current = $node; } - - /** * Add navigation node as a child * @param string $label @@ -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 @@ -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 @@ -80,8 +71,6 @@ protected function createComponentHomepage($name) new NavigationNode($this, $name); } - - /** * Render menu * @param bool $renderChildren @@ -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 */ @@ -109,8 +96,6 @@ public function render() $this->renderMenu(); } - - /** * Render main menu */ @@ -119,8 +104,6 @@ public function renderMainMenu() $this->renderMenu(FALSE); } - - /** * Render breadcrumbs */ @@ -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(); } + } diff --git a/NavigationNode.php b/NavigationNode.php index b97aedc..96c426c 100644 --- a/NavigationNode.php +++ b/NavigationNode.php @@ -11,7 +11,6 @@ use Nette\ComponentModel\Container; - class NavigationNode extends Container { @@ -24,8 +23,6 @@ class NavigationNode extends Container /** @var bool */ public $isCurrent = false; - - /** * Add navigation node as a child * @staticvar int $counter @@ -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); } }