Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added zf patch. And updated zf overrides to v1.11.2

  • Loading branch information...
commit 68e441286180ee89d99a9341f0e87b6f208495da 1 parent eed7c2e
@balupton balupton authored
View
10 lib/Zend/View/Helper/Navigation/Menu.php
@@ -17,7 +17,7 @@
* @subpackage Helper
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Menu.php 20096 2010-01-06 02:05:09Z bkarwin $
+ * @version $Id: Menu.php 23484 2010-12-10 03:57:59Z mjh_ca $
*/
/**
@@ -64,7 +64,7 @@ class Zend_View_Helper_Navigation_Menu
* @var string|array
*/
protected $_partial = null;
-
+
/**
* Simple template to use in the htmlify process if specified
*
@@ -262,7 +262,7 @@ public function htmlify(Zend_Navigation_Page $page)
} else {
$element = 'span';
}
-
+
// generate result (with or without template)
$template = $this->getTemplate();
if ( !$template ) {
@@ -641,8 +641,8 @@ public function renderPartial(Zend_Navigation_Container $container = null,
if (count($partial) != 2) {
require_once 'Zend/View/Exception.php';
$e = new Zend_View_Exception(
- 'Unable to render menu: A view partial supplied as '
- . 'an array must contain two values: partial view '
+ 'Unable to render menu: A view partial supplied as '
+ . 'an array must contain two values: partial view '
. 'script and module where script can be found'
);
$e->setView($this->view);
View
79 patches/zend-view-helper-navigation-menu.patch
@@ -0,0 +1,79 @@
+From e407c2f65225dd2269be156481c5820166bc7666 Mon Sep 17 00:00:00 2001
+From: Benjamin "balupton" Lupton <contact@balupton.com>
+Date: Wed, 5 Jan 2011 08:42:18 +0800
+Subject: [PATCH] Added templating to View/Helper/Navigation/Menu.php
+
+---
+ library/Zend/View/Helper/Navigation/Menu.php | 41 +++++++++++++++++++++++++-
+ 1 files changed, 40 insertions(+), 1 deletions(-)
+
+diff --git a/library/Zend/View/Helper/Navigation/Menu.php b/library/Zend/View/Helper/Navigation/Menu.php
+index 9b58c12..63dd9ef 100644
+--- a/library/Zend/View/Helper/Navigation/Menu.php
++++ b/library/Zend/View/Helper/Navigation/Menu.php
+@@ -65,6 +65,13 @@ class Zend_View_Helper_Navigation_Menu
+ */
+ protected $_partial = null;
+
++ /**
++ * Simple template to use in the htmlify process if specified
++ *
++ * @var string
++ */
++ protected $_template = null;
++
+ /**
+ * View helper entry point:
+ * Retrieves helper and optionally sets container to operate on
+@@ -195,6 +202,24 @@ class Zend_View_Helper_Navigation_Menu
+ return $this->_partial;
+ }
+
++ /**
++ * Set a simple template to use in the htmlify process
++ * @param string $template
++ * @return $this
++ */
++ public function setTemplate ( $template ) {
++ $this->_template = $template;
++ return $this;
++ }
++
++ /**
++ * Get the simple template to use in the htmlify process if specified
++ * @return string
++ */
++ public function getTemplate ( ) {
++ return $this->_template;
++ }
++
+ // Public methods:
+
+ /**
+@@ -238,8 +263,22 @@ class Zend_View_Helper_Navigation_Menu
+ $element = 'span';
+ }
+
++ // generate result (with or without template)
++ $template = $this->getTemplate();
++ if ( !$template ) {
++ $renderedTemplate = $this->view->escape($label);
++ } else {
++ $renderedTemplate = populate($template,
++ array(
++ 'label' => $this->view->escape($label),
++ 'title' => $this->view->escape($title),
++ 'Page' => $page
++ )
++ );
++ }
++
+ return '<' . $element . $this->_htmlAttribs($attribs) . '>'
+- . $this->view->escape($label)
++ . $renderedTemplate
+ . '</' . $element . '>';
+ }
+
+--
+1.7.3.1
+
Please sign in to comment.
Something went wrong with that request. Please try again.