Index: library/Zend/Navigation/Page.php =================================================================== --- library/Zend/Navigation/Page.php (revision 24182) +++ library/Zend/Navigation/Page.php (working copy) @@ -43,6 +43,11 @@ /** * Page id + * + * This attribute assigns a name to an element. This name must be unique in + * a document. + * + * @link http://www.w3.org/TR/html4/struct/global.html#adef-id * * @var string|null */ @@ -50,6 +55,12 @@ /** * Style class for this page (CSS) + * + * This attribute assigns a class name or set of class names to an element. + * Any number of elements may be assigned the same class name or names. + * Multiple class names must be separated by white space characters. + * + * @link http://www.w3.org/TR/html4/struct/global.html#adef-class * * @var string|null */ @@ -57,6 +68,11 @@ /** * A more descriptive title for this page + * + * This attribute offers advisory information about the element for which it + * is set. + * + * @link http://www.w3.org/TR/html4/struct/global.html#adef-title * * @var string|null */ @@ -64,15 +80,36 @@ /** * This page's target + * + * This attribute specifies the name of a frame where a document is to be + * opened. + * + * @link http://www.w3.org/TR/html4/present/frames.html#adef-target * * @var string|null */ protected $_target; /** + * Accessibility key character + * + * This attribute assigns an access key to an element. An access key is a + * single character from the document character set. + * + * @link http://www.w3.org/TR/html401/interact/forms.html#access-keys + * + * @var string|null + */ + protected $_accesskey; + + /** * Forward links to other pages + * + * This attribute describes the relationship from the current document to + * the anchor specified by the href attribute. The value of this attribute + * is a space-separated list of link types. * - * @link http://www.w3.org/TR/html4/struct/links.html#h-12.3.1 + * @link http://www.w3.org/TR/html4/struct/links.html#adef-rel * * @var array */ @@ -80,8 +117,12 @@ /** * Reverse links to other pages + * + * This attribute is used to describe a reverse link from the anchor + * specified by the href attribute to the current document. The value of + * this attribute is a space-separated list of link types. * - * @link http://www.w3.org/TR/html4/struct/links.html#h-12.3.1 + * @link http://www.w3.org/TR/html4/struct/links.html#adef-rev * * @var array */ @@ -449,8 +490,42 @@ { return $this->_target; } + + /** + * Sets access key for this page + * + * @param string|null $character [optional] access key to set. Default + * is null, which sets no access key. + * @return Zend_Navigation_Page fluent interface, returns self + * @throws Zend_Navigation_Exception if access key is not string or null or + * if the string length not equal to one + */ + public function setAccesskey($character = null) + { + if (null !== $character + && (!is_string($character) || 1 != strlen($character))) + { + require_once 'Zend/Navigation/Exception.php'; + throw new Zend_Navigation_Exception( + 'Invalid argument: $character must be a single character or null' + ); + } + $this->_accesskey = $character; + return $this; + } + /** + * Returns page access key + * + * @return string|null page access key or null + */ + public function getAccesskey() + { + return $this->_accesskey; + } + + /** * Sets the page's forward links to other pages * * This method expects an associative array of forward links to other pages, @@ -1095,6 +1170,7 @@ 'class' => $this->getClass(), 'title' => $this->getTitle(), 'target' => $this->getTarget(), + 'accesskey' => $this->getAccesskey(), 'rel' => $this->getRel(), 'rev' => $this->getRev(), 'order' => $this->getOrder(),