Beispiel #1
0
 /**
  * Slice name view helper.
  *
  * @param string $name name
  * @param int $nchar number of characters
  * @return string sliced name
  */
 public function slicename($name, $nchar)
 {
     return htmlspecialchars(UtilityComponent::sliceName($name, $nchar), ENT_QUOTES, 'UTF-8');
 }
 /**
  * Create a custom breadcrumb from the node.  Should have the following keys:
  * -text The text of the breadcrumb
  * -icon The icon of the breadcrumb
  * -[href] The URL to link to.  If not set, will just render text instead of a link.
  * -[maxLength] Number of characters to limit the text to.
  *
  * @param array $node
  * @param Zend_View $view
  * @return string
  * @throws Zend_Exception
  */
 protected function _createCustomBreadcrumb($node, &$view)
 {
     if (!isset($node['text']) || !isset($node['icon'])) {
         throw new Zend_Exception('Custom breadcrumbs must have a text and an icon parameter');
     }
     $text = isset($node['maxLength']) ? UtilityComponent::sliceName($node['text'], (int) $node['maxLength']) : $node['text'];
     $str = '<li class="pathCustom"><img alt="" src="' . $node['icon'] . '" /><span>';
     if (isset($node['href'])) {
         $str .= '<a href="' . $node['href'] . '">' . $text . '</a>';
     } else {
         $str .= $text;
     }
     $str .= '</span></li>';
     return $str;
 }