Uri.php #1

  • //
  • guest/
  • perforce_software/
  • chronicle/
  • main/
  • library/
  • P4Cms/
  • Navigation/
  • Page/
  • Uri.php
  • View
  • Commits
  • Open Download .zip Download (1 KB)
<?php
/**
 * Extends Zend_Navigation_Page_Uri to add macro support.
 *
 * @copyright   2011 Perforce Software. All rights reserved.
 * @license     Please see LICENSE.txt in top-level folder of this distribution.
 * @version     <release>/<patch>
 */
class P4Cms_Navigation_Page_Uri extends Zend_Navigation_Page_Uri
{
    /**
     * Returns page label with support for macros.
     *
     * @return  string  page label or null
     */
    public function getLabel()
    {
        return P4Cms_Navigation::expandMacros(parent::getLabel(), $this);
    }

    /**
     * Returns page title with support for macros.
     *
     * @return  string|null     page title or null
     */
    public function getTitle()
    {
        return P4Cms_Navigation::expandMacros(parent::getTitle(), $this);
    }

    /**
     * Returns href for this page with support for macros
     *
     * @return  string  the href
     */
    public function getHref()
    {
        return P4Cms_Navigation::expandMacros(parent::getHref(), $this);
    }

    /**
     * Returns an array representation of the page
     *
     * @return  array   associative array containing all page properties
     */
    public function toArray()
    {
        return array_merge(
            parent::toArray(),
            array(
                'label' => $this->_label,
                'title' => $this->_title
            )
        );
    }
}
# Change User Description Committed
#1 16170 perforce_software Move Chronicle files to follow new path scheme for branching.
//guest/perforce_software/chronicle/library/P4Cms/Navigation/Page/Uri.php
#1 8972 Matt Attaway Initial add of the Chronicle source code