本文整理汇总了PHP中Horde::linkTooltip方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde::linkTooltip方法的具体用法?PHP Horde::linkTooltip怎么用?PHP Horde::linkTooltip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Horde
的用法示例。
在下文中一共展示了Horde::linkTooltip方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _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>';
}
示例2: getLink
public function getLink($datetime = null, $icons = true, $from_url = null, $full = false, $encoded = true)
{
global $prefs;
if (is_null($datetime)) {
$datetime = $this->start;
}
if (is_null($from_url)) {
$from_url = Horde::selfUrl(true, false, true);
}
$event_title = $this->getTitle();
$view_url = $this->getViewUrl(array('datetime' => $datetime->strftime('%Y%m%d%H%M%S'), 'url' => $from_url), $full, $encoded);
$read_permission = $this->hasPermission(Horde_Perms::READ);
$link = '<span' . $this->getCSSColors() . '>';
if ($read_permission && $view_url) {
$link .= Horde::linkTooltip($view_url, $event_title, $this->getStatusClass(), '', '', $this->getTooltip(), '', array('style' => $this->getCSSColors(false)));
}
$link .= htmlspecialchars($event_title);
if ($read_permission && $view_url) {
$link .= '</a>';
}
if ($icons && $prefs->getValue('show_icons')) {
$icon_color = $this->_foregroundColor == '#000' ? '000' : 'fff';
$status = '';
if ($this->alarm) {
if ($this->alarm % 10080 == 0) {
$alarm_value = $this->alarm / 10080;
$title = sprintf(ngettext("Alarm %d week before", "Alarm %d weeks before", $alarm_value), $alarm_value);
} elseif ($this->alarm % 1440 == 0) {
$alarm_value = $this->alarm / 1440;
$title = sprintf(ngettext("Alarm %d day before", "Alarm %d days before", $alarm_value), $alarm_value);
} elseif ($this->alarm % 60 == 0) {
$alarm_value = $this->alarm / 60;
$title = sprintf(ngettext("Alarm %d hour before", "Alarm %d hours before", $alarm_value), $alarm_value);
} else {
$alarm_value = $this->alarm;
$title = sprintf(ngettext("Alarm %d minute before", "Alarm %d minutes before", $alarm_value), $alarm_value);
}
$status .= Horde::fullSrcImg('alarm-' . $icon_color . '.png', array('attr' => array('alt' => $title, 'title' => $title, 'class' => 'iconAlarm')));
}
if ($this->recurs()) {
$title = Kronolith::recurToString($this->recurrence->getRecurType());
$status .= Horde::fullSrcImg('recur-' . $icon_color . '.png', array('attr' => array('alt' => $title, 'title' => $title, 'class' => 'iconRecur')));
} elseif ($this->baseid) {
$title = _("Exception");
$status .= Horde::fullSrcImg('exception-' . $icon_color . '.png', array('attr' => array('alt' => $title, 'title' => $title, 'class' => 'iconRecur')));
}
if ($this->private) {
$title = _("Private event");
$status .= Horde::fullSrcImg('private-' . $icon_color . '.png', array('attr' => array('alt' => $title, 'title' => $title, 'class' => 'iconPrivate')));
}
if (!empty($this->attendees)) {
$status .= Horde::fullSrcImg('attendees-' . $icon_color . '.png', array('attr' => array('alt' => _("Meeting"), 'title' => _("Meeting"), 'class' => 'iconPeople')));
}
$space = ' ';
if (!empty($this->icon)) {
$link = $status . '<img class="kronolithEventIcon" src="' . $this->icon . '" /> ' . $link;
} elseif (!empty($status)) {
$link .= ' ' . $status;
$space = '';
}
if ((!$this->private || $this->creator == $GLOBALS['registry']->getAuth()) && Kronolith::getDefaultCalendar(Horde_Perms::EDIT)) {
$url = $this->getEditUrl(array('datetime' => $datetime->strftime('%Y%m%d%H%M%S'), 'url' => $from_url), $full);
if ($url) {
$link .= $space . $url->link(array('title' => sprintf(_("Edit %s"), $event_title), 'class' => 'iconEdit')) . Horde::fullSrcImg('edit-' . $icon_color . '.png', array('attr' => array('alt' => _("Edit")))) . '</a>';
$space = '';
}
}
if ($this->hasPermission(Horde_Perms::DELETE)) {
$url = $this->getDeleteUrl(array('datetime' => $datetime->strftime('%Y%m%d%H%M%S'), 'url' => $from_url), $full);
if ($url) {
$link .= $space . $url->link(array('title' => sprintf(_("Delete %s"), $event_title), 'class' => 'iconDelete')) . Horde::fullSrcImg('delete-' . $icon_color . '.png', array('attr' => array('alt' => _("Delete")))) . '</a>';
}
}
}
return $link . '</span>';
}
示例3: getAttachmentLink
/**
* Constructs message attachments link.
*
* @throws Agora_Exception
*/
public function getAttachmentLink($message_id)
{
if (!$this->allowAttachments()) {
return '';
}
$sql = 'SELECT file_id, file_name, file_size, file_type FROM agora_files WHERE message_id = ?';
try {
$files = $this->_db->select($sql, array($message_id));
} catch (Horde_Db_Exception $e) {
throw new Agora_Exception($e->getMessage());
}
if (empty($files)) {
return $files;
}
/* Constuct the link with a tooltip for further info on the download. */
$html = '<br />';
$view_url = Horde::url('view.php');
foreach ($files as $file) {
$mime_icon = $GLOBALS['injector']->getInstance('Horde_Core_Factory_MimeViewer')->getIcon($file['file_type']);
$title = _("download") . ': ' . $file['file_name'];
$tooltip = $title . "\n" . sprintf(_("size: %s"), $this->formatSize($file['file_size'])) . "\n" . sprintf(_("type: %s"), $file['file_type']);
$url = $view_url->add(array('forum_id' => $this->_forum_id, 'message_id' => $message_id, 'file_id' => $file['file_id'], 'file_name' => $file['file_name'], 'file_type' => $file['file_type']));
$html .= Horde::linkTooltip($url, $title, '', '', '', $tooltip) . Horde::img($mime_icon, $title, 'align="middle"', '') . ' ' . $file['file_name'] . '</a> <br />';
}
return $html;
}
示例4: array
$view->headers[] = array('id' => 's' . MNEMO::SORT_MOD_DATE, 'sorted' => $sortby == Mnemo::SORT_MOD_DATE, 'width' => '2%', 'label' => Horde::widget(array('url' => $baseurl->add('sortby', MNEMO::SORT_MOD_DATE), 'class' => 'sortlink', 'title' => _("Date"))));
foreach ($memos as $memo_id => &$memo) {
try {
$share = $mnemo_shares->getShare($memo['memolist_id']);
} catch (Horde_Share_Exception $e) {
$notification->push($e);
continue;
}
if ($view->showNotepad) {
$memo['notepad'] = Mnemo::getLabel($share);
}
if ($share->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$label = sprintf(_("Edit \"%s\""), $memo['desc']);
$memo['edit'] = Horde::url('memo.php')->add(array('memo' => $memo['memo_id'], 'memolist' => $memo['memolist_id'], 'actionID' => 'modify_memo'))->link(array('title' => $label)) . Horde::img('edit.png', $label, '') . '</a>';
}
$memo['link'] = Horde::linkTooltip(Horde::url('view.php')->add(array('memo' => $memo['memo_id'], 'memolist' => $memo['memolist_id'])), '', '', '', '', $memo['body'] != $memo['desc'] ? Mnemo::getNotePreview($memo) : '') . (strlen($memo['desc']) ? htmlspecialchars($memo['desc']) : '<em>' . _("Empty Note") . '</em>') . '</a>';
// Get memo's most recent modification date or, if nonexistent,
// the creation (add) date
if (isset($memo['modified'])) {
$modified = $memo['modified'];
} elseif (isset($memo['created'])) {
$modified = $memo['created'];
} else {
$modified = null;
}
if ($modified) {
$memo['modifiedStamp'] = $modified->timestamp();
$memo['modifiedString'] = $modified->strftime($prefs->getValue('date_format'));
} else {
$memo['modifiedStamp'] = $memo['modifiedString'] = '';
}
示例5: _init
//.........这里部分代码省略.........
switch (get_class($rule)) {
case 'Ingo_Rule_System_Blacklist':
if (!is_null($mbox_search)) {
continue 2;
}
$editurl = Ingo_Basic_Blacklist::url();
$entry['filterimg'] = 'blacklist.png';
break;
case 'Ingo_Rule_System_Whitelist':
if (!is_null($mbox_search)) {
continue 2;
}
$editurl = Ingo_Basic_Whitelist::url();
$entry['filterimg'] = 'whitelist.png';
break;
case 'Ingo_Rule_System_Vacation':
if (!is_null($mbox_search)) {
continue 2;
}
$editurl = Ingo_Basic_Vacation::url();
$entry['filterimg'] = 'vacation.png';
break;
case 'Ingo_Rule_System_Forward':
if (!is_null($mbox_search)) {
continue 2;
}
$editurl = Ingo_Basic_Forward::url();
$entry['filterimg'] = 'forward.png';
break;
case 'Ingo_Rule_System_Spam':
if (!is_null($mbox_search)) {
continue 2;
}
$editurl = Ingo_Basic_Spam::url();
$entry['filterimg'] = 'spam.png';
break;
default:
if (!is_null($mbox_search)) {
if ($mbox_search['exact']) {
if (strcasecmp($filter['action-value'], $mbox_search['query']) !== 0) {
continue 2;
}
} elseif (stripos($filter['action-value'], $mbox_search['query']) === false) {
continue 2;
}
}
$editurl = $rule_url->copy()->add(array('edit' => $rule->uid));
$delurl = $url->copy()->add('actionID', 'rule_delete');
$copyurl = $url->copy()->add('actionID', 'rule_copy');
break;
}
/* Create description. */
if (!$edit_allowed) {
$entry['descriplink'] = htmlspecialchars($rule->name);
} elseif (!empty($rule->conditions)) {
$entry['descriplink'] = Horde::linkTooltip($editurl, sprintf(_("Edit %s"), $rule->name), null, null, null, $rule->description()) . htmlspecialchars($rule->name) . '</a>';
} else {
$entry['descriplink'] = Horde::link($editurl, sprintf(_("Edit %s"), $rule->name)) . htmlspecialchars($rule->name) . '</a>';
}
/* Create delete link. */
if ($delete_allowed && !is_null($delurl)) {
$entry['dellink'] = Horde::link($delurl, sprintf(_("Delete %s"), $rule->name), null, null, "return window.confirm('" . addslashes(_("Are you sure you want to delete this rule?")) . "');");
}
/* Create copy link. */
if ($view->can_copy && !is_null($copyurl)) {
$entry['copylink'] = Horde::link($copyurl, sprintf(_("Copy %s"), $rule->name));
}
/* Create disable/enable link. */
if (!$rule->disable) {
$entry['disabled'] = true;
if ($edit_allowed) {
$entry['disablelink'] = Horde::link($url->copy()->add('actionID', 'rule_disable'), sprintf(_("Disable %s"), $rule->name));
}
} elseif ($edit_allowed) {
$entry['enablelink'] = Horde::link($url->copy()->add('actionID', 'rule_enable'), sprintf(_("Enable %s"), $rule->name));
}
$display[$rule->uid] = $entry;
}
$view->filter = $display;
$view->mbox_search = $mbox_search;
if ($edit_allowed && is_null($mbox_search)) {
if ($factory->hasFeature('on_demand')) {
$view->settings = true;
$view->flags = $prefs->getValue('filter_seen');
$view->show_filter_msg = $prefs->getValue('show_filter_msg');
}
$page_output->addScriptFile('hordecore.js', 'horde');
$page_output->addScriptPackage('Horde_Core_Script_Package_Sortable');
}
$page_output->addScriptFile('stripe.js', 'horde');
$page_output->addScriptFile('filters.js');
$page_output->ajax = true;
$topbar = $injector->getInstance('Horde_View_Topbar');
$topbar->search = true;
$topbar->searchAction = self::url();
$topbar->searchLabel = _("Mailbox Search");
$topbar->searchParameters = array('actionID' => 'mbox_search', 'searchexact' => 0, 'page' => 'filters');
$this->header = _("Filter Rules");
$this->output = $view->render('filters');
}
示例6: _init
//.........这里部分代码省略.........
$url_last = $mailbox_imp_url->copy()->add('mpage', $pageOb['pagecount']);
$pages_last = 'navlastImg';
}
}
/* Generate RSS link. */
if ($mailbox->inbox) {
$rss_box = '';
} else {
$ns_info = $mailbox->namespace_info;
if (is_null($ns_info)) {
$rss_box = null;
} else {
$rss_box = str_replace(rawurlencode($ns_info->delimiter), '/', rawurlencode($ns_info->delimiter . ($ns_info->type == $ns_info::NS_PERSONAL ? $ns_info->stripNamespace($mailbox) : $mailbox)));
}
}
if (!is_null($rss_box)) {
$page_output->addLinkTag(array('href' => Horde::url('rss.php', true, -1) . $rss_box));
}
/* If user wants the mailbox to be refreshed, set time here. */
$refresh_url = $mailbox_imp_url->copy()->add('mpage', $pageOb['page']);
if (isset($filter_url)) {
$filter_url->add('mpage', $pageOb['page']);
}
/* Determine if we are showing previews. */
$preview_tooltip = $show_preview ? $prefs->getValue('preview_show_tooltip') : false;
if (!$preview_tooltip) {
$strip_preview = $prefs->getValue('preview_strip_nl');
}
$unread = $imp_mailbox->unseenMessages(Horde_Imap_Client::SEARCH_RESULTS_COUNT);
$page_output->addInlineJsVars(array('ImpMailbox.pop3' => intval(!$mailbox->is_imap), 'ImpMailbox.text' => array('delete_messages' => _("Are you sure you wish to PERMANENTLY delete these messages?"), 'delete_all' => _("Are you sure you wish to delete all mail in this mailbox?"), 'delete_vfolder' => _("Are you sure you want to delete this Virtual Folder Definition?"), 'innocent_report' => _("Are you sure you wish to report this message as innocent?"), 'moveconfirm' => _("Are you sure you want to move the message(s)? (Some message information might get lost, like message headers, text formatting or attachments!)"), 'newmbox' => _("You are copying/moving to a new mailbox.") . "\n" . _("Please enter a name for the new mailbox:") . "\n", 'no' => _("No"), 'selectone' => _("You must select at least one message first."), 'selectonlyone' => _("You must select only one message for this action."), 'spam_report' => _("Are you sure you wish to report this message as spam?"), 'submit' => _("You must select at least one message first."), 'target_mbox' => _("You must select a target mailbox first.")), 'ImpMailbox.unread' => intval($unread)));
$pagetitle = $this->title = $mailbox->label;
if ($mailbox->editvfolder) {
$query_text = wordwrap($imp_search[$mailbox]->querytext);
$pagetitle .= ' [' . Horde::linkTooltip('#', $query_text, '', '', '', $query_text) . _("Virtual Folder") . '</a>]';
$this->title .= ' [' . _("Virtual Folder") . ']';
} elseif ($mailbox->editquery) {
$query_text = wordwrap($imp_search[$mailbox]->querytext);
$pagetitle = Horde::linkTooltip('#', $query_text, '', '', '', $query_text) . $pagetitle . '</a>';
} else {
$pagetitle = $this->title = htmlspecialchars($this->title);
}
/* Generate mailbox summary string. */
$subinfo = new IMP_View_Subinfo(array('mailbox' => $mailbox));
$subinfo->value = $pagetitle . ' (';
if (empty($pageOb['end'])) {
$subinfo->value .= _("No Messages");
} else {
$subinfo->value .= $pageOb['pagecount'] > 1 ? sprintf(_("%d Messages"), $pageOb['msgcount']) . ' / ' . sprintf(_("Page %d of %d"), $pageOb['page'], $pageOb['pagecount']) : sprintf(_("%d Messages"), $pageOb['msgcount']);
}
$subinfo->value .= ')';
$injector->getInstance('Horde_View_Topbar')->subinfo = $subinfo->render();
$page_output->addScriptFile('hordecore.js', 'horde');
$page_output->addScriptFile('mailbox.js');
$page_output->addScriptPackage('Horde_Core_Script_Package_Dialog');
$page_output->metaRefresh($prefs->getValue('refresh_time'), $refresh_url);
/* Prepare the header template. */
$view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/basic/mailbox'));
$view->addHelper('FormTag');
$view->addHelper('Horde_Core_View_Helper_Accesskey');
$view->addHelper('Tag');
$hdr_view = clone $view;
$hdr_view->readonly = $readonly;
$hdr_view->refresh_url = $refresh_url;
if (isset($filter_url)) {
$hdr_view->filter_url = $filter_url;
}
示例7: render
/**
* Renders the view.
*
* @param Horde_PageOutput $output The output object.
*
* @return string The HTML needed to render the view.
*/
public function render(Horde_PageOutput $output)
{
global $prefs, $injector, $registry, $mnemo_shares;
$output->addScriptFile('tables.js', 'horde');
$output->addScriptFile('quickfinder.js', 'horde');
$output->addScriptFile('list.js');
$output->header(array('title' => $this->_title));
$view = $injector->createInstance('Horde_View');
$view->count = count($this->_notes);
$view->searchImg = Horde::img('search.png', _("Search"), '');
$view->searchUrl = Horde::url('search.php');
$view->title = $this->_title;
$view->browser = $this->_showTagBrowser ? $this->_getRelatedTags() . $this->_getTagTrail() : '';
if (count($this->_notes)) {
$sortby = $prefs->getValue('sortby');
$sortdir = $prefs->getValue('sortdir');
$output->addInlineJsVars(array('Mnemo_List.ajaxUrl' => $registry->getServiceLink('ajax', 'mnemo')->url . 'setPrefValue'));
$view->editImg = Horde::img('edit.png', _("Edit Note"), '');
$view->showNotepad = $prefs->getValue('show_notepad');
$view->sortdirclass = $sortdir ? 'sortup' : 'sortdown';
$view->headers = array();
if ($view->showNotepad) {
$view->headers[] = array('id' => 's' . Mnemo::SORT_NOTEPAD, 'sorted' => $sortby == Mnemo::SORT_NOTEPAD, 'width' => '2%', 'label' => Horde::widget(array('url' => $this->_baseurl->add('sortby', Mnemo::SORT_NOTEPAD), 'class' => 'sortlink', 'title' => _("Notepad"))));
}
$view->headers[] = array('id' => 's' . MNEMO::SORT_DESC, 'sorted' => $sortby == MNEMO::SORT_DESC, 'width' => '80%', 'label' => Horde::widget(array('url' => $this->_baseurl->add('sortby', Mnemo::SORT_DESC), 'class' => 'sortlink', 'title' => _("No_te"))));
$view->headers[] = array('id' => 's' . MNEMO::SORT_MOD_DATE, 'sorted' => $sortby == Mnemo::SORT_MOD_DATE, 'width' => '2%', 'label' => Horde::widget(array('url' => $this->_baseurl->add('sortby', MNEMO::SORT_MOD_DATE), 'class' => 'sortlink', 'title' => _("Date"))));
foreach ($this->_notes as $memo_id => &$memo) {
try {
$share = $mnemo_shares->getShare($memo['memolist_id']);
} catch (Horde_Share_Exception $e) {
$notification->push($e);
continue;
}
if ($view->showNotepad) {
$memo['notepad'] = Mnemo::getLabel($share);
}
if ($share->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$label = sprintf(_("Edit \"%s\""), $memo['desc']);
$memo['edit'] = Horde::url('memo.php')->add(array('memo' => $memo['memo_id'], 'memolist' => $memo['memolist_id'], 'actionID' => 'modify_memo'))->link(array('title' => $label)) . Horde::img('edit.png', $label, '') . '</a>';
}
$memo['link'] = Horde::linkTooltip(Horde::url('view.php')->add(array('memo' => $memo['memo_id'], 'memolist' => $memo['memolist_id'])), '', '', '', '', $memo['body'] != $memo['desc'] ? Mnemo::getNotePreview($memo) : '') . (strlen($memo['desc']) ? htmlspecialchars($memo['desc']) : '<em>' . _("Empty Note") . '</em>') . '</a>';
// Get memo's most recent modification date or, if nonexistent,
// the creation (add) date
if (isset($memo['modified'])) {
$modified = $memo['modified'];
} elseif (isset($memo['created'])) {
$modified = $memo['created'];
} else {
$modified = null;
}
if ($modified) {
$memo['modifiedStamp'] = $modified->timestamp();
$memo['modifiedString'] = $modified->strftime($prefs->getValue('date_format'));
} else {
$memo['modifiedStamp'] = $memo['modifiedString'] = '';
}
}
}
Horde::startBuffer();
echo $view->render('list/header');
if (count($this->_notes)) {
echo $view->render('list/memo_headers');
echo $view->renderPartial('list/summary', array('collection' => array_values($this->_notes)));
echo $view->render('list/memo_footers');
} else {
echo $view->render('list/empty');
}
$output->footer();
return Horde::endBuffer();
}
示例8: _content
/**
*/
protected function _content()
{
global $prefs;
if (isset($this->_params['calendar']) && $this->_params['calendar'] != '__all') {
$calendars = Kronolith::listCalendars();
if (!isset($calendars[$this->_params['calendar']])) {
return _("Calendar not found");
}
if (!$calendars[$this->_params['calendar']]->hasPermission(Horde_Perms::READ)) {
return _("Permission Denied");
}
}
$year = date('Y');
$month = date('m');
$startday = new Horde_Date(array('mday' => 1, 'month' => $month, 'year' => $year));
$startday = $startday->dayOfWeek();
if (!$prefs->getValue('week_start_monday')) {
$startOfView = 1 - $startday;
$endday = new Horde_Date(array('mday' => Horde_Date_Utils::daysInMonth($month, $year), 'month' => $month, 'year' => $year));
} else {
if ($startday == Horde_Date::DATE_SUNDAY) {
$startOfView = -5;
} else {
$startOfView = 2 - $startday;
}
}
$startDate = new Horde_Date($year, $month, $startOfView);
$endDate = new Horde_Date($year, $month, Horde_Date_Utils::daysInMonth($month, $year) + 1);
$endDate->mday += (7 - ($endDate->format('w') - $prefs->getValue('week_start_monday'))) % 7;
/* Table start. and current month indicator. */
$html = '<table cellspacing="1" class="monthgrid" width="100%"><tr>';
/* Set up the weekdays. */
$weekdays = array(_("Mo"), _("Tu"), _("We"), _("Th"), _("Fr"), _("Sa"));
if (!$prefs->getValue('week_start_monday')) {
array_unshift($weekdays, _("Su"));
} else {
$weekdays[] = _("Su");
}
foreach ($weekdays as $weekday) {
$html .= '<th class="item">' . $weekday . '</th>';
}
try {
if (isset($this->_params['calendar']) && $this->_params['calendar'] != '__all') {
list($type, $calendar) = explode('_', $this->_params['calendar'], 2);
$driver = Kronolith::getDriver($type, $calendar);
$all_events = $driver->listEvents($startDate, $endDate, array('show_recurrence' => true));
} else {
$all_events = Kronolith::listEvents($startDate, $endDate, $GLOBALS['calendar_manager']->get(Kronolith::DISPLAY_CALENDARS));
}
} catch (Exception $e) {
return '<em>' . $e->getMessage() . '</em>';
}
$weekday = 0;
$week = -1;
$weekStart = $prefs->getValue('week_start_monday');
for ($date_ob = new Kronolith_Day($month, $startOfView, $year); $date_ob->compareDate($endDate) < 0; $date_ob->mday++) {
if ($weekday == 7) {
$weekday = 0;
}
if ($weekday == 0) {
++$week;
$html .= '</tr><tr>';
}
if ($date_ob->isToday()) {
$td_class = 'kronolith-today';
} elseif ($date_ob->month != $month) {
$td_class = 'kronolith-othermonth';
} elseif ($date_ob->dayOfWeek() == 0 || $date_ob->dayOfWeek() == 6) {
$td_class = 'kronolith-weekend';
} else {
$td_class = '';
}
$html .= '<td align="center" class="' . $td_class . '">';
/* Set up the link to the day view. */
$url = Horde::url('day.php', true)->add('date', $date_ob->dateString());
if (isset($this->_params['calendar']) && $this->_params['calendar'] != '__all') {
$url->add('display_cal', $this->_params['calendar']);
}
$date_stamp = $date_ob->dateString();
if (empty($all_events[$date_stamp])) {
/* No events, plain link to the day. */
$cell = Horde::linkTooltip($url, _("View Day")) . $date_ob->mday . '</a>';
} else {
/* There are events; create a cell with tooltip to
* list them. */
$day_events = '';
foreach ($all_events[$date_stamp] as $event) {
if ($event->isAllDay()) {
$day_events .= _("All day");
} else {
$day_events .= $event->start->strftime($prefs->getValue('twentyFour') ? '%R' : '%I:%M%p') . '-' . $event->end->strftime($prefs->getValue('twentyFour') ? '%R' : '%I:%M%p');
}
$location = $event->getLocation();
$day_events .= ':' . ($location ? ' (' . htmlspecialchars($location) . ')' : '') . ' ' . $event->getTitle() . "\n";
}
$cell = Horde::linkTooltip($url, _("View Day"), '', '', '', $day_events) . $date_ob->mday . '</a>';
}
/* Bold the cell if there are events. */
//.........这里部分代码省略.........
示例9: _init
//.........这里部分代码省略.........
$entry['filterimg'] = 'blacklist.png';
$name = _("Blacklist");
break;
case Ingo_Storage::ACTION_WHITELIST:
if (!is_null($mbox_search)) {
continue 2;
}
$editurl = Ingo_Basic_Whitelist::url();
$entry['filterimg'] = 'whitelist.png';
$name = _("Whitelist");
break;
case Ingo_Storage::ACTION_VACATION:
if (!is_null($mbox_search)) {
continue 2;
}
$editurl = Ingo_Basic_Vacation::url();
$entry['filterimg'] = 'vacation.png';
$name = _("Vacation");
break;
case Ingo_Storage::ACTION_FORWARD:
if (!is_null($mbox_search)) {
continue 2;
}
$editurl = Ingo_Basic_Forward::url();
$entry['filterimg'] = 'forward.png';
$name = _("Forward");
break;
case Ingo_Storage::ACTION_SPAM:
if (!is_null($mbox_search)) {
continue 2;
}
$editurl = Ingo_Basic_Spam::url();
$entry['filterimg'] = 'spam.png';
$name = _("Spam Filter");
break;
default:
if (!is_null($mbox_search)) {
if ($mbox_search['exact']) {
if (strcasecmp($filter['action-value'], $mbox_search['query']) !== 0) {
continue 2;
}
} elseif (stripos($filter['action-value'], $mbox_search['query']) === false) {
continue 2;
}
}
$editurl = $rule_url->copy()->add(array('edit' => $rule_number));
$delurl = $url->copy()->add('actionID', 'rule_delete');
$copyurl = $url->copy()->add('actionID', 'rule_copy');
$name = $filter['name'];
break;
}
/* Create description. */
if (!$edit_allowed) {
$entry['descriplink'] = htmlspecialchars($name);
} elseif (!empty($filter['conditions'])) {
$entry['descriplink'] = Horde::linkTooltip($editurl, sprintf(_("Edit %s"), $name), null, null, null, $ingo_storage->ruleDescription($filter)) . htmlspecialchars($name) . '</a>';
} else {
$entry['descriplink'] = Horde::link($editurl, sprintf(_("Edit %s"), $name)) . htmlspecialchars($name) . '</a>';
}
/* Create delete link. */
if ($delete_allowed && !is_null($delurl)) {
$entry['dellink'] = Horde::link($delurl, sprintf(_("Delete %s"), $name), null, null, "return window.confirm('" . addslashes(_("Are you sure you want to delete this rule?")) . "');");
}
/* Create copy link. */
if ($view->can_copy && !is_null($copyurl)) {
$entry['copylink'] = Horde::link($copyurl, sprintf(_("Copy %s"), $name));
}
/* Create disable/enable link. */
if (empty($filter['disable'])) {
$entry['disabled'] = true;
if ($edit_allowed) {
$entry['disablelink'] = Horde::link($url->copy()->add('actionID', 'rule_disable'), sprintf(_("Disable %s"), $name));
}
} elseif ($edit_allowed) {
$entry['enablelink'] = Horde::link($url->copy()->add('actionID', 'rule_enable'), sprintf(_("Enable %s"), $name));
}
$display[$rule_number] = $entry;
}
$view->filter = $display;
$view->mbox_search = $mbox_search;
}
if ($edit_allowed && is_null($mbox_search)) {
if ($factory->hasFeature('on_demand')) {
$view->settings = true;
$view->flags = $prefs->getValue('filter_seen');
$view->show_filter_msg = $prefs->getValue('show_filter_msg');
}
$page_output->addScriptFile('hordecore.js', 'horde');
$page_output->addScriptPackage('Horde_Core_Script_Package_Sortable');
}
$page_output->addScriptFile('stripe.js', 'horde');
$page_output->addScriptFile('filters.js');
$topbar = $injector->getInstance('Horde_View_Topbar');
$topbar->search = true;
$topbar->searchAction = self::url();
$topbar->searchLabel = _("Mailbox Search");
$topbar->searchParameters = array('actionID' => 'mbox_search', 'searchexact' => 0, 'page' => 'filters');
$this->header = _("Filter Rules");
$this->output = $view->render('filters');
}
示例10: html
public function html()
{
global $prefs;
$html = '<table id="kronolith-view-year" class="kronolith-minical"><tr>';
for ($month = 1; $month <= 12; ++$month) {
$html .= '<td>';
// Heading for each month.
$date = new Horde_Date(sprintf('%04d%02d01010101', $this->year, $month));
$html .= '<table><thead><tr class="kronolith-minical-nav"><th colspan="7">' . Horde::url('month.php')->add('date', $date->dateString())->link() . $date->strftime('%B') . '</a></th></tr><tr><th class="kronolith-minical-empty"> </th>';
if (!$prefs->getValue('week_start_monday')) {
$html .= '<th>' . _("Su") . '</th>';
}
$html .= '<th>' . _("Mo") . '</th>' . '<th>' . _("Tu") . '</th>' . '<th>' . _("We") . '</th>' . '<th>' . _("Th") . '</th>' . '<th>' . _("Fr") . '</th>' . '<th>' . _("Sa") . '</th>';
if ($prefs->getValue('week_start_monday')) {
$html .= '<th>' . _("Su") . '</th>';
}
$html .= '</tr></thead><tbody><tr><td class="kronolith-minical-week">';
$startday = new Horde_Date(array('mday' => 1, 'month' => $month, 'year' => $this->year));
$startday = $startday->dayOfWeek();
$daysInView = Date_Calc::weeksInMonth($month, $this->year) * 7;
if (!$prefs->getValue('week_start_monday')) {
$startOfView = 1 - $startday;
// We may need to adjust the number of days in the
// view if we're starting weeks on Sunday.
if ($startday == Horde_Date::DATE_SUNDAY) {
$daysInView -= 7;
}
$endday = new Horde_Date(array('mday' => Horde_Date_Utils::daysInMonth($month, $this->year), 'month' => $month, 'year' => $this->year));
$endday = $endday->dayOfWeek();
if ($endday == Horde_Date::DATE_SUNDAY) {
$daysInView += 7;
}
} else {
if ($startday == Horde_Date::DATE_SUNDAY) {
$startOfView = -5;
} else {
$startOfView = 2 - $startday;
}
}
$currentCalendars = array(true);
foreach ($currentCalendars as $id => $cal) {
$cell = 0;
for ($day = $startOfView; $day < $startOfView + $daysInView; ++$day) {
$date = new Kronolith_Day($month, $day, $this->year);
$date->hour = $prefs->getValue('twentyFour') ? 12 : 6;
$week = $date->weekOfYear();
if ($cell % 7 == 0) {
if ($cell != 0) {
$html .= "</tr>\n<tr><td class=\"kronolith-minical-week\">";
}
$html .= (int) $date->weekOfYear() . '</td>';
}
if ($date->month != $month) {
$style = 'kronolith-other-month';
} else {
$style = '';
}
/* Set up the link to the day view. */
$url = Horde::url('day.php', true)->add('date', $date->dateString());
if ($date->month == $month && !empty($this->_events[$date->dateString()])) {
/* There are events; create a cell with tooltip to list
* them. */
$day_events = '';
foreach ($this->_events[$date->dateString()] as $event) {
if ($event->status == Kronolith::STATUS_CONFIRMED) {
/* Set the background color to distinguish the
* day */
$style = 'year-event';
}
if ($event->isAllDay()) {
$day_events .= _("All day");
} else {
$day_events .= $event->start->strftime($prefs->getValue('twentyFour') ? '%R' : '%I:%M%p') . '-' . $event->end->strftime($prefs->getValue('twentyFour') ? '%R' : '%I:%M%p');
}
$day_events .= ':' . ($event->getLocation() ? ' (' . $event->getLocation() . ')' : '') . ' ' . $event->getTitle() . "\n";
}
/* Bold the cell if there are events. */
$cellday = '<strong>' . Horde::linkTooltip($url, _("View Day"), '', '', '', $day_events) . $date->mday . '</a></strong>';
} else {
/* No events, plain link to the day. */
$cellday = Horde::linkTooltip($url, _("View Day")) . $date->mday . '</a>';
}
if ($date->isToday() && $date->month == $month) {
$style .= ' kronolith-today';
}
$html .= '<td align="center" class="' . $style . '" height="10" width="5%" valign="top">' . $cellday . '</td>';
++$cell;
}
}
$html .= '</tr></tbody></table></td>';
if ($month % 3 == 0 && $month != 12) {
$html .= '</tr><tr>';
}
}
echo $html . '</tr></table>';
}
示例11: strlen
$params['list'] = $this->smartShare->getName();
}
echo Horde::link($task->edit_link->add($params), $label) . Horde::img('edit.png', $label) . '</a>';
}
?>
</td>
<td>
<?php
echo $task->treeIcons();
$task_name = strlen($task->name) ? htmlspecialchars($task->name) : _("[none]");
if ($have_read) {
$params = array('have_search' => $this->haveSearch, 'tab_name' => $this->tab_name, 'url' => Horde::selfUrl(true));
if ($this->smartShare) {
$params['list'] = $this->smartShare->getName();
}
echo Horde::linkTooltip($task->view_link->add($params), '', '', '', '', $task->desc) . $task_name . '</a>';
} else {
echo $task_name;
}
?>
<ul class='horde-tags'>
<?php
foreach ($task->tags as $t) {
?>
<li><?php
echo $this->h($t);
?>
</li><?php
}
?>
</ul>
示例12: substr
$params['list'] = $this->smartShare->getName();
}
echo Horde::link($task->edit_link->add($params), $label) . Horde::img('edit-sidebar-' . substr($task->foregroundColor(), 1) . '.png', $label) . '</a>';
}
?>
</td>
<td>
<?php
echo $task->treeIcons();
$task_name = strlen($task->name) ? htmlspecialchars($task->name) : _("[none]");
if ($have_read) {
$params = array('have_search' => $this->haveSearch, 'tab_name' => $this->tab_name, 'url' => Horde::selfUrl(true));
if ($this->smartShare) {
$params['list'] = $this->smartShare->getName();
}
echo Horde::linkTooltip($task->view_link->add($params), '', '', '', '', $task->desc, '', array('style' => 'color:' . $task->foregroundColor())) . $task_name . '</a>';
} else {
echo $task_name;
}
?>
<ul class='horde-tags'>
<?php
foreach ($task->tags as $t) {
?>
<li><?php
echo $this->h($t);
?>
</li><?php
}
?>
</ul>