Horde_Themes::img PHP Method

img() public static method

Return the path to an image, using the default image if the image does not exist in the current theme.
public static img ( string $name = null, mixed $options = [] ) : Horde_Themes_Image
$name string The image name. If null, will return the image directory.
$options mixed Additional options. If a string, is taken to be the 'app' parameter. If an array, the following options are available: - app: (string) Use this application instead of the current app. - nohorde: (boolean) If true, do not fallback to horde for image. - noview: (boolean) If true, do not load images from view-specific directories. (Since 2.4.0) - theme: (string) Use this theme instead of the Horde default.
return Horde_Themes_Image An object which contains the URI and filesystem location of the image.
    public static function img($name = null, $options = array())
    {
        if (is_string($options)) {
            $options = array('app' => $options);
        }
        return new Horde_Themes_Image($name, $options);
    }

Usage Example

Exemplo n.º 1
0
 /**
  */
 protected function _content()
 {
     global $registry, $prefs;
     if (!empty($this->_params['show_notepad'])) {
         $shares = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Share')->create();
     }
     $html = '';
     $memos = Mnemo::listMemos($prefs->getValue('sortby'), $prefs->getValue('sortdir'));
     foreach ($memos as $id => $memo) {
         $html .= '<tr>';
         if (!empty($this->_params['show_actions'])) {
             $editImg = Horde_Themes::img('edit.png');
             $editurl = Horde::url('memo.php')->add(array('memo' => $memo['memo_id'], 'memolist' => $memo['memolist_id']));
             $html .= '<td width="1%">' . Horde::link(htmlspecialchars(Horde::url($editurl, true)->add('actionID', 'modify_memo')), _("Edit Note")) . Horde::img($editImg, _("Edit Note")) . '</a></td>';
         }
         if (!empty($this->_params['show_notepad'])) {
             $html .= '<td>' . htmlspecialchars(Mnemo::getLabel($shares->getShare($memo['memolist_id']))) . '</td>';
         }
         $viewurl = Horde::url('view.php')->add(array('memo' => $memo['memo_id'], 'memolist' => $memo['memolist_id']));
         $html .= '<td>' . Horde::linkTooltip(htmlspecialchars(Horde::url($viewurl, true)), '', '', '', '', $memo['body'] != $memo['desc'] ? Mnemo::getNotePreview($memo) : '') . (strlen($memo['desc']) ? htmlspecialchars($memo['desc']) : '<em>' . _("Empty Note") . '</em>') . '</a> <ul class="horde-tags">';
         foreach ($memo['tags'] as $tag) {
             $html .= '<li>' . htmlspecialchars($tag) . '</li>';
         }
         $html .= '</ul></td></tr>';
     }
     if (!$memos) {
         return '<p><em>' . _("No notes to display") . '</em></p>';
     }
     return '<table cellspacing="0" width="100%" class="linedRow">' . $html . '</table>';
 }
All Usage Examples Of Horde_Themes::img