Example #1
0
 /**
  *
  */
 public function getIconByFileType($file, $asImage = true)
 {
     $config = Zend_Registry::get('config');
     $this->icons = $config->filetypes;
     $icon = $this->getIcon($file);
     if ($asImage) {
         $base = $this->view->getBaseUrl() . '/' . $config->filepath->icons;
         return "<img src='{$base}/{$icon}' />";
     } else {
         return $icon;
     }
 }
Example #2
0
 /**
  *
  */
 public function link($label, $link, $icon = null, $class = 'link', $target = null)
 {
     $this->link = Digitalus_Toolbox_String::stripLeading('/', $link);
     $this->baseUrl = Digitalus_Toolbox_String::stripLeading('/', $this->view->getBaseUrl());
     // clean the link
     if ($this->isRemoteLink($link) || $this->isAnchorLink($link)) {
         $cleanLink = $link;
     } else {
         $cleanLink = '/' . $this->addBaseUrl($this->link);
     }
     if ($target != null) {
         $target = "target='{$target}'";
     }
     $linkParts[] = "<a href='{$cleanLink}' class='{$class}' {$target}>";
     if (null !== $icon) {
         $linkParts[] = $this->getIcon($icon, $label);
     }
     if (!empty($label)) {
         $linkParts[] = $this->view->getTranslation((string) $label);
     }
     $linkParts[] = '</a>';
     return implode(null, $linkParts);
 }