本文整理汇总了PHP中Horde::img方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde::img方法的具体用法?PHP Horde::img怎么用?PHP Horde::img使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Horde
的用法示例。
在下文中一共展示了Horde::img方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: content
/**
* Renders this page in content mode.
*
* @return string The page content.
* @throws Wicked_Exception
*/
public function content()
{
global $wicked;
$days = (int) Horde_Util::getGet('days', 3);
$summaries = $wicked->getRecentChanges($days);
if (count($summaries) < 10) {
$summaries = $wicked->mostRecent(10);
}
$bydate = array();
$changes = array();
foreach ($summaries as $page) {
$page = new Wicked_Page_StandardPage($page);
$createDate = $page->versionCreated();
$tm = localtime($createDate, true);
$createDate = mktime(0, 0, 0, $tm['tm_mon'], $tm['tm_mday'], $tm['tm_year'], $tm['tm_isdst']);
$version_url = $page->pageUrl()->add('version', $page->version());
$diff_url = Horde::url('diff.php')->add(array('page' => $page->pageName(), 'v1' => '?', 'v2' => $page->version()));
$diff_alt = sprintf(_("Show changes for %s"), $page->version());
$diff_img = Horde::img('diff.png', $diff_alt);
$pageInfo = array('author' => $page->author(), 'name' => $page->pageName(), 'url' => $page->pageUrl(), 'version' => $page->version(), 'version_url' => $version_url, 'version_alt' => sprintf(_("Show version %s"), $page->version()), 'diff_url' => $diff_url, 'diff_alt' => $diff_alt, 'diff_img' => $diff_img, 'created' => $page->formatVersionCreated(), 'change_log' => $page->changeLog());
$bydate[$createDate][$page->versionCreated()][$page->version()] = $pageInfo;
}
krsort($bydate);
foreach ($bydate as $bysecond) {
$day = array();
krsort($bysecond);
foreach ($bysecond as $pageList) {
krsort($pageList);
$day = array_merge($day, array_values($pageList));
}
$changes[] = array('date' => $day[0]['created'], 'pages' => $day);
}
return $changes;
}
示例2: bookmarkletLink
public static function bookmarkletLink()
{
$view = $GLOBALS['injector']->createInstance('Horde_View');
$view->url = Horde::url('add.php', true, array('append_session' => -1))->add('popup', 1);
$view->image = Horde::img('add.png');
return $view->render('bookmarklet');
}
示例3: _content
/**
*/
protected function _content()
{
try {
$channels = $GLOBALS['injector']->getInstance('Jonah_Driver')->getChannels();
} catch (Jonah_Exception $e) {
$channels = array();
}
$html = '';
foreach ($channels as $key => $channel) {
/* Link for HTML delivery. */
$url = Horde::url('delivery/html.php')->add('channel_id', $channel['channel_id']);
$label = sprintf(_("\"%s\" stories in HTML"), $channel['channel_name']);
$html .= '<tr><td width="140">' . Horde::img('story_marker.png') . ' ' . $url->link(array('title' => $label)) . htmlspecialchars($channel['channel_name']) . '</a></td>';
$html .= '<td>' . ($channel['channel_updated'] ? date('M d, Y H:i', (int) $channel['channel_updated']) : '-') . '</td>';
/* Link for feed delivery. */
$url = Horde::url('delivery/rss.php', true, -1)->add('channel_id', $channel['channel_id']);
$label = sprintf(_("RSS Feed of \"%s\""), $channel['channel_name']);
$html .= '<td align="right" class="nowrap">' . $url->link(array('title' => $label)) . Horde::img('feed.png') . '</a> ';
}
if ($html) {
return '<table cellspacing="0" width="100%" class="linedRow striped">' . $html . '</table>';
} else {
return '<p><em>' . _("No feeds are available.") . '</em></p>';
}
}
示例4: _content
function _content()
{
if (empty($this->_params['location'])) {
return _("No location is set.");
}
// Set the timezone variable, if available.
NLS::setTimeZone();
list($lat, $long) = explode(':', $this->_params['location']);
$rise = $this->_calculateSunset(time(), $lat, $long, false, floor(date('Z') / 3600));
$set = $this->_calculateSunset(time(), $lat, $long, true, floor(date('Z') / 3600));
$location = '';
global $coordinates;
if (!is_array($coordinates)) {
require HORDE_LIBS . 'Horde/NLS/coordinates.php';
}
foreach ($coordinates as $country) {
if (array_key_exists($this->_params['location'], $country)) {
$location = $country[$this->_params['location']];
break;
}
}
$html = '<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"><tr>';
$html .= '<td colspan="2" class="control"><b>' . $location . '</b></td></tr><tr height="100%">';
$html .= '<td width="50%" align="center">';
$html .= Horde::img('block/sunrise/sunrise.gif', _("Sun Rise"));
$html .= '<br/>' . $rise;
$html .= '</td>';
$html .= '<td width="50%" align="center">';
$html .= Horde::img('block/sunrise/sunset.gif', _("Sun Set"));
$html .= '<br/>' . $set;
$html .= '</td>';
$html .= '</tr></table>';
return $html;
}
示例5: _content
/**
*/
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>';
}
示例6: _title
/**
* The title to go in this block.
*
* @return string The title text.
*/
function _title()
{
global $registry;
$title = isset($this->_params['title']) ? $this->_params['title'] : $this->_params['iframe'];
$html = Horde::link($this->_params['iframe'], $title, 'header') . $title . '</a>';
$html .= Horde::link($this->_params['iframe'], _("Open in a new window"), 'smallheader', '_new') . Horde::img('webserver.gif', _("Open in a new window"), 'hspace="5"', Horde::url($registry->getParam('graphics'), true, -1)) . _("Open in a new window") . '</a>';
return $html;
}
示例7: _renderVarInput_KronolithTags
/**
* Render tag field.
*/
protected function _renderVarInput_KronolithTags($form, $var, $vars)
{
$varname = htmlspecialchars($var->getVarName());
$value = $var->getValue($vars);
$html = sprintf('<input id="%s" type="text" name="%s" value="%s" />', $varname, $varname, $value);
$html .= sprintf('<span id="%s_loading_img" style="display:none;">%s</span>', $varname, Horde::img('loading.gif', _("Loading...")));
$GLOBALS['injector']->getInstance('Horde_Core_Factory_Imple')->create('Kronolith_Ajax_Imple_TagAutoCompleter', array('id' => $varname));
return $html;
}
示例8: _title
protected function _title()
{
global $prefs;
$prev = new Horde_Date($this->_start);
$prev->mday--;
$next = new Horde_Date($this->_start);
$next->mday++;
return Horde::url('#')->link(array('title' => _("Previous Day"), 'onclick' => 'return switchDate(' . $prev->dateString() . ');')) . Horde::img('nav/left.png', '<') . '</a>' . $this->_start->strftime($prefs->getValue('date_format')) . Horde::url('#')->link(array('title' => _("Next Day"), 'onclick' => 'return switchDate(' . $next->dateString() . ');')) . Horde::img('nav/right.png', '>') . '</a>';
}
示例9: _title
protected function _title()
{
$end = new Horde_Date($this->_start);
$end->mday += $this->_days - 1;
$prev = new Horde_Date($this->_start);
$prev->month--;
$next = new Horde_Date($this->_start);
$next->month++;
return Horde::url('#')->link(array('title' => _("Previous Month"), 'onclick' => 'return switchDate(' . $prev->dateString() . ');')) . Horde::img('nav/left.png', '<') . '</a>' . $this->_start->strftime('%B %Y') . Horde::url('#')->link(array('title' => _("Next Month"), 'onclick' => 'return switchDate(' . $next->dateString() . ');')) . Horde::img('nav/right.png', '>') . '</a>';
}
示例10: _content
function _content()
{
$phases = $this->_calculateMoonPhases(date('Y'));
$now = time();
$lastNew = 0;
$lastNewStamp = 0;
$offset = 0;
foreach ($phases as $key => $val) {
if ($key < $now && $key > $lastNewStamp && $val == _("New Moon")) {
$lastNew = $offset;
$lastNewStamp = $key;
}
$offset++;
}
if (isset($this->_params['phase']) && $this->_params['phase'] == 'next') {
$dates = array_slice(array_keys($phases), $lastNew + 4, 4);
} else {
$dates = array_slice(array_keys($phases), $lastNew, 4);
}
if (isset($this->_params['hemisphere']) && $this->_params['hemisphere'] == 'northern') {
$location = _("Northern Hemisphere");
} else {
$location = _("Southern Hemisphere");
}
$html = '<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">';
$html .= '<tr><td colspan="4" class="control"><b>' . $location . '</b></td></tr>';
$html .= '<tr height="100%"><td width="25%" align="center">';
$html .= Horde::img('block/moon/newmoon.gif', _("New Moon"));
$html .= '<br/>' . strftime('%d %b', $dates[0]);
$html .= '</td>';
$html .= '<td width="25%" align="center">';
if (isset($this->_params['hemisphere']) && $this->_params['hemisphere'] == 'northern') {
$html .= Horde::img('block/moon/lastquarter.gif', _("First Quarter"));
} else {
$html .= Horde::img('block/moon/firstquarter.gif', _("First Quarter"));
}
$html .= '<br/>' . strftime('%d %b', $dates[1]);
$html .= '</td>';
$html .= '<td width="25%" align="center">';
$html .= Horde::img('block/moon/fullmoon.gif', _("Full Moon"));
$html .= '<br/>' . strftime('%d %b', $dates[2]);
$html .= '</td>';
$html .= '<td width="25%" align="center">';
if (isset($this->_params['hemisphere']) && $this->_params['hemisphere'] == 'northern') {
$html .= Horde::img('block/moon/firstquarter.gif', _("Last Quarter"));
} else {
$html .= Horde::img('block/moon/lastquarter.gif', _("Last Quarter"));
}
$html .= '<br/>' . strftime('%d %b', $dates[3]);
$html .= '</td>';
$html .= "</tr></table>";
return $html;
}
示例11: _content
/**
* The content to go in this block.
*
* @return string The content
*/
function _content()
{
require_once __DIR__ . '/../base.php';
global $prefs, $klutz, $klutz_driver;
$showall = $prefs->getValue('summ_showall');
$date = time();
// Get the list of comics to display.
$comics = explode("\t", $prefs->getValue('viewcomics'));
if (count($comics) == 1 && empty($comics[0])) {
$comics = null;
}
$comicstoday = $klutz->listEnabled($comics, $date);
if ($showall) {
$summary = '';
foreach ($comicstoday as $index) {
$name = $klutz->getProperty($index, 'name');
$author = $klutz->getProperty($index, 'author');
if ($klutz_driver->imageExists($index, $date)) {
$size = $klutz_driver->imageSize($index, $date);
$url = Horde::url('comics.php')->add(array('date' => $date, 'index' => $index));
$img = Horde::img($url->copy()->add('actionID', 'image'), sprintf("%s by %s", $name, $author), $size, '');
$link = Horde::link($url->copy()->add('actionID', 'comic'), sprintf("%s by %s", $name, $author));
$summary .= '<p>' . $link . $img . '</a></p>';
}
}
} else {
$this->updateable = true;
// Pick a comic from the list and make sure it exists.
do {
// Make sure we actually have some comics to choose
// from.
if (!count($comicstoday)) {
return _("Could not find any comics to display.");
}
// Pick a comic by random and remove it from the list.
$i = rand(0, count($comicstoday) - 1);
$tmp = array_splice($comicstoday, $i, 1);
$index = array_shift($tmp);
} while ($klutz_driver->imageExists($index, $date) === false);
$name = $klutz->getProperty($index, 'name');
$author = $klutz->getProperty($index, 'author');
$size = $klutz_driver->imageSize($index, $date);
$url = Horde::url('comics.php')->add(array('date' => $date, 'index' => $index));
$img = Horde::img($url->copy()->add('actionID', 'image'), sprintf("%s by %s", $name, $author), $size, '');
$link = Horde::link($url->copy()->add('actionID', 'comic'), sprintf("%s by %s", $name, $author));
$summary = '<p class="text">' . $link . $name . ' by ' . $author . '</a></p>' . '<p>' . $link . $img . '</a></p>';
}
return $summary;
}
示例12: getTagTrail
/**
* Get breadcrumb style navigation html for choosen tags
*
* @return string HTML necessary for displaying the tag trail.
*/
public function getTagTrail()
{
global $registry;
$html = '<ul class="horde-tags">';
// Use the local cache to preserve the order
$count = 0;
foreach ($this->_tags as $tagname => $tagid) {
$remove_url = Horde::url('view.php', true)->add(array('view' => 'Results', 'tag' => $tagname, 'actionID' => 'remove'));
if (!empty($this->_owner)) {
$remove_url->add('owner', $this->_owner);
}
$delete_label = sprintf(_("Remove %s from search"), htmlspecialchars($tagname));
$html .= '<li>' . htmlspecialchars($tagname) . $remove_url->link(array('title' => $delete_label)) . Horde::img('delete-small.png', $delete_label) . '</a></li>';
}
return $html . '</ul>';
}
示例13: run
/**
*
*/
public function run()
{
extract($this->_params, EXTR_REFS);
try {
$channels = $GLOBALS['injector']->getInstance('Jonah_Driver')->getChannels();
} catch (Exception $e) {
$notification->push(sprintf(_("An error occurred fetching channels: %s"), $e->getMessage()), 'horde.error');
$channels = false;
}
if ($channels) {
$channels = Jonah::checkPermissions('channels', Horde_Perms::SHOW, $channels);
/* Build channel specific fields. */
foreach ($channels as $key => $channel) {
/* Edit channel link. */
$url = Horde::url('channels/edit.php')->add('channel_id', $channel['channel_id']);
$channels[$key]['edit_link'] = $url->link(array('title' => _("Edit channel"))) . Horde::img('edit.png') . '</a>';
/* Delete channel link. */
$url = Horde::url('channels/delete.php')->add('channel_id', $channel['channel_id']);
$channels[$key]['delete_link'] = $url->link(array('title' => _("Delete channel"))) . Horde::img('delete.png') . '</a>';
/* View stories link. */
$channels[$key]['stories_url'] = Horde::url('stories/index.php')->add('channel_id', $channel['channel_id']);
/* Channel type specific links. */
$channels[$key]['addstory_link'] = '';
$channels[$key]['refresh_link'] = '';
switch ($channel['channel_type']) {
case Jonah::INTERNAL_CHANNEL:
/* Add story link. */
$url = Horde::url('stories/edit.php')->add('channel_id', $channel['channel_id']);
$channels[$key]['addstory_link'] = $url->link(array('title' => _("Add story"))) . Horde::img('new.png') . '</a>';
break;
}
$channels[$key]['channel_type'] = Jonah::getChannelTypeLabel($channel['channel_type']);
$channels[$key]['channel_updated'] = $channel['channel_updated'] ? strftime($prefs->getValue('date_format'), (int) $channel['channel_updated']) : '-';
}
}
$view = new Horde_View(array('templatePath' => JONAH_TEMPLATES . '/view'));
$view->addHelper('Tag');
$view->channels = $channels;
$view->search_img = Horde::img('search.png');
global $page_output;
$page_output->addScriptFile('tables.js', 'horde');
$page_output->addScriptFile('quickfinder.js', 'horde');
$page_output->header(array('title' => _("Feeds")));
$notification->notify(array('listeners' => 'status'));
echo $view->render('channellist');
$page_output->footer();
}
示例14: _content
/**
* The content to go in this block.
*
* @return string The content
*/
function _content()
{
$html = '<form name="google" onsubmit="open_google_win(); return false;">';
$html .= '<table width="100%" height="100%">';
$html .= '<tr><script language="JavaScript" type="text/javascript" src="' . $GLOBALS['registry']->getParam('webroot', 'horde') . '/services/javascript.php?file=open_google_win.js&app=horde"></script>';
$html .= '<td>' . Horde::img('google.png', 'Google') . '</td></tr>';
$html .= '<tr><td><input maxLength="256" size="40" name="q" width="100%" /></td></tr>';
$html .= '<tr><td><table width="100%"><tr><td align="center"><input type="radio" name="area" value="web" width="20%" checked="checked" />' . _("Web") . '</td>';
$html .= '<td align="center"><input type="radio" name="area" value="images" width="20%" />' . _("Images") . '</td>';
$html .= '<td align="center"><input type="radio" name="area" value="groups" width="20%" />' . _("Groups") . '</td>';
$html .= '<td align="center"><input type="radio" name="area" value="directory" width="20%" />' . _("Directory") . '</td>';
$html .= '<td align="center"><input type="radio" name="area" value="news" width="20%" />' . _("News") . '</td></tr></table></td></tr>';
$html .= '<tr><td><input type="submit" class="button" value="' . _("Google Search") . '" /></td></tr>';
$html .= '</table>';
$html .= '</form>';
return $html;
}
示例15: _content
/**
*/
protected function _content()
{
$gallery = $GLOBALS['injector']->getInstance('Ansel_Storage')->getRandomGallery();
if (!$gallery) {
return _("There are no photo galleries available.");
}
$imagelist = $gallery->listImages(rand(0, $gallery->countImages() - 1), 1);
if (empty($imagelist)) {
return '';
}
$imageId = $imagelist[0];
$viewurl = Ansel::getUrlFor('view', array('gallery' => $gallery->id, 'slug' => $gallery->get('slug'), 'image' => $imageId, 'view' => 'Image'), true);
if ($gallery->isOldEnough() && !$gallery->hasPasswd()) {
$img = '<img src="' . Ansel::getImageUrl($imageId, 'thumb', true, Ansel::getStyleDefinition('ansel_default')) . '" alt="[random photo]" />';
} else {
$img = Horde::img('thumb-error.png');
}
return $viewurl->link(array('title' => _("View Photo"))) . $img . '</a>';
}