本文整理汇总了PHP中Horde::url方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde::url方法的具体用法?PHP Horde::url怎么用?PHP Horde::url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Horde
的用法示例。
在下文中一共展示了Horde::url方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: verifyIdentity
/**
* Sends a message to an email address supposed to be added to the
* identity.
*
* A message is send to this address containing a time-sensitive link to
* confirm that the address really belongs to that user.
*
* @param integer $id The identity's ID.
* @param string $old_addr The old From: address.
*
* @throws Horde_Mime_Exception
*/
public function verifyIdentity($id, $old_addr)
{
global $injector, $notification, $registry;
$hash = strval(new Horde_Support_Randomid());
$pref = $this->_confirmEmail();
$pref[$hash] = $this->get($id);
$pref[$hash][self::EXPIRE] = time() + self::EXPIRE_SECS;
$this->_confirmEmail($pref);
$new_addr = $this->getValue($this->_prefnames['from_addr'], $id);
$confirm = Horde::url($registry->getServiceLink('emailconfirm')->add('h', $hash)->setRaw(true), true);
$message = sprintf(Horde_Core_Translation::t("You have requested to add the email address \"%s\" to the list of your personal email addresses.\n\nGo to the following link to confirm that this is really your address:\n%s\n\nIf you don't know what this message means, you can delete it."), $new_addr, $confirm);
$msg_headers = new Horde_Mime_Headers();
$msg_headers->addHeaderOb(Horde_Mime_Headers_MessageId::create());
$msg_headers->addHeaderOb(Horde_Mime_Headers_UserAgent::create());
$msg_headers->addHeaderOb(Horde_Mime_Headers_Date::create());
$msg_headers->addHeader('To', $new_addr);
$msg_headers->addHeader('From', $old_addr);
$msg_headers->addHeader('Subject', Horde_Core_Translation::t("Confirm new email address"));
$body = new Horde_Mime_Part();
$body->setType('text/plain');
$body->setContents(Horde_String::wrap($message, 76));
$body->setCharset('UTF-8');
$body->send($new_addr, $msg_headers, $injector->getInstance('Horde_Mail'));
$notification->push(sprintf(Horde_Core_Translation::t("A message has been sent to \"%s\" to verify that this is really your address. The new email address is activated as soon as you confirm this message."), $new_addr), 'horde.message');
}
示例2: processRequest
public function processRequest(Horde_Controller_Request $request, Horde_Controller_Response $response)
{
$id = Horde_Util::getFormData('bookmark');
$gateway = $this->getInjector()->getInstance('Trean_Bookmarks');
$notification = $this->getInjector()->getInstance('Horde_Notification');
try {
$bookmark = $gateway->getBookmark($id);
$old_url = $bookmark->url;
$bookmark->url = Horde_Util::getFormData('bookmark_url');
$bookmark->title = Horde_Util::getFormData('bookmark_title');
$bookmark->description = Horde_Util::getFormData('bookmark_description');
$bookmark->tags = Horde_Util::getFormData('treanBookmarkTags');
if ($old_url != $bookmark->url) {
$bookmark->http_status = '';
}
$bookmark->save();
$result = array('data' => 'saved');
} catch (Horde_Exception $e) {
$notification->push(sprintf(_("There was an error saving the bookmark: %s"), $e->getMessage()), 'horde.error');
$result = array('error' => $e->getMessage());
}
if (Horde_Util::getFormData('format') == 'json') {
$response->setContentType('application/json');
$response->setBody(json_encode($result));
} else {
$response->setRedirectUrl(Horde_Util::getFormData('url', Horde::url('browse.php', true)));
}
}
示例3: 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;
}
示例4: menu
/**
*/
public function menu($menu)
{
$scope = Horde_Util::getGet('scope', 'agora');
/* Agora Home. */
$url = Horde::url('forums.php')->add('scope', $scope);
$menu->add($url, _("_Forums"), 'forums.png', null, null, null, dirname($_SERVER['PHP_SELF']) == $GLOBALS['registry']->get('webroot') && basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
/* Thread list, if applicable. */
if (isset($GLOBALS['forum_id'])) {
$menu->add(Agora::setAgoraId($GLOBALS['forum_id'], null, Horde::url('threads.php')), _("_Threads"), 'threads.png');
if ($scope == 'agora' && $GLOBALS['registry']->getAuth()) {
$menu->add(Agora::setAgoraId($GLOBALS['forum_id'], null, Horde::url('messages/edit.php')), _("New Thread"), 'newmessage.png');
}
}
if ($scope == 'agora' && Agora_Driver::hasPermission(Horde_Perms::DELETE, 0, $scope)) {
$menu->add(Horde::url('editforum.php'), _("_New Forum"), 'newforum.png', null, null, null, Horde_Util::getFormData('agora') ? '__noselection' : null);
}
if (Agora_Driver::hasPermission(Horde_Perms::DELETE, 0, $scope)) {
$url = Horde::url('moderate.php')->add('scope', $scope);
$menu->add($url, _("_Moderate"), 'moderate.png');
}
if ($GLOBALS['registry']->isAdmin()) {
$menu->add(Horde::url('moderators.php'), _("_Moderators"), 'hot.png');
}
$url = Horde::url('search.php')->add('scope', $scope);
$menu->add($url, _("_Search"), 'search.png');
}
示例5: tag
/**
* Constructs a correctly-pathed tag to an image.
*
* @param mixed $src The image file (either a string or a
* Horde_Themes_Image object).
* @param array $opts Additional options:
* - alt: (string) Text describing the image.
* - attr: (mixed) Any additional attributes for the image tag. Can be a
* pre-built string or an array of key/value pairs that will be
* assembled and html-encoded.
* - fullsrc: (boolean) TODO
* - imgopts: (array) TODO
*
* @return string The full image tag.
*/
public static function tag($src, array $opts = array())
{
global $browser, $conf;
$opts = array_merge(array('alt' => '', 'attr' => array(), 'fullsrc' => false, 'imgopts' => array()), $opts);
/* If browser does not support images, simply return the ALT text. */
if (!$browser->hasFeature('images')) {
return htmlspecialchars($opts['alt']);
}
$xml = new SimpleXMLElement('<root><img ' . (is_array($opts['attr']) ? '' : $opts['attr']) . '/></root>');
$img = $xml->img;
if (is_array($opts['attr'])) {
foreach ($opts['attr'] as $key => $val) {
$img->addAttribute($key, $val);
}
}
if (strlen($opts['alt'])) {
$img->addAttribute('alt', $opts['alt']);
}
/* If no directory has been specified, get it from the registry. */
if (!$src instanceof Horde_Themes_Image && substr($src, 0, 1) != '/') {
$src = Horde_Themes::img($src, $opts['imgopts']);
}
if (empty($conf['nobase64_img'])) {
$src = self::base64ImgData($src);
}
if ($opts['fullsrc'] && substr($src, 0, 10) != 'data:image') {
$src = Horde::url($src, true, array('append_session' => -1));
}
$img->addAttribute('src', $src);
return $img->asXML();
}
示例6: html
public function html($active = true)
{
if (!$this->contact) {
echo '<h3>' . _("The requested contact was not found.") . '</h3>';
return;
}
if (!$this->contact->hasPermission(Horde_Perms::DELETE)) {
if (!$this->contact->hasPermission(Horde_Perms::READ)) {
echo '<h3>' . _("You do not have permission to view this contact.") . '</h3>';
return;
} else {
echo '<h3>' . _("You only have permission to view this contact.") . '</h3>';
return;
}
}
echo '<div id="DeleteContact"' . ($active ? '' : ' style="display:none"') . '>';
?>
<form action="<?php
echo Horde::url('delete.php');
?>
" method="post">
<?php
echo Horde_Util::formInput();
?>
<input type="hidden" name="url" value="<?php
echo htmlspecialchars(Horde_Util::getFormData('url'));
?>
" />
<input type="hidden" name="source" value="<?php
echo htmlspecialchars($this->contact->driver->getName());
?>
" />
<input type="hidden" name="key" value="<?php
echo htmlspecialchars($this->contact->getValue('__key'));
?>
" />
<div class="headerbox" style="padding: 8px">
<p><?php
echo _("Permanently delete this contact?");
?>
</p>
<input type="submit" class="horde-delete" name="delete" value="<?php
echo _("Delete");
?>
" />
</div>
</form>
</div>
<?php
if ($active && $GLOBALS['browser']->hasFeature('dom')) {
if ($this->contact->hasPermission(Horde_Perms::READ)) {
$view = new Turba_View_Contact($this->contact);
$view->html(false);
}
if ($this->contact->hasPermission(Horde_Perms::EDIT)) {
$delete = new Turba_View_EditContact($this->contact);
$delete->html(false);
}
}
}
示例7: _hours
protected function _hours()
{
$hours_html = '';
$dayWidth = round(100 / $this->_days);
$week = $this->_start->weekOfYear();
$span = (7 - $week) % 7 + 1;
$span_left = $this->_days;
$t = new Horde_Date($this->_start);
while ($span_left > 0) {
$span_left -= $span;
$week_label = Horde::url('#')->link(array('onclick' => 'return switchDateView(\'Week\',' . $t->dateString() . ');')) . "Week" . ' ' . $week . '</a>';
$hours_html .= sprintf('<th colspan="%d" width="%s%%">%s</th>', $span, $dayWidth, $week_label);
$week++;
$t->mday += 7;
$span = min($span_left, 7);
}
$hours_html .= '</tr><tr><td width="100" class="label"> </td>';
for ($i = 0; $i < $this->_days; $i++) {
$t = new Horde_Date(array('month' => $this->_start->month, 'mday' => $this->_start->mday + $i, 'year' => $this->_start->year));
$day_label = Horde::url('#')->link(array('onclick' => 'return switchDateView(\'Day\',' . $t->dateString() . ');')) . ($i + 1) . '.</a>';
$hours_html .= sprintf('<th width="%s%%">%s</th>', $dayWidth, $day_label);
}
for ($i = 0; $i < $this->_days; $i++) {
$start = new Horde_Date(array('hour' => $this->_startHour, 'month' => $this->_start->month, 'mday' => $this->_start->mday + $i, 'year' => $this->_start->year));
$end = new Horde_Date(array('hour' => $this->_endHour, 'month' => $this->_start->month, 'mday' => $this->_start->mday + $i, 'year' => $this->_start->year));
$this->_timeBlocks[] = array($start, $end);
}
return $hours_html;
}
示例8: _addBaseVars
/**
* Add base javascript variables to the page.
*/
protected function _addBaseVars()
{
global $conf, $injector, $prefs, $registry;
$auth_name = $registry->getAuth();
$has_tasks = Kronolith::hasApiPermission('tasks');
$identity = $injector->getInstance('Horde_Core_Factory_Identity')->create();
$app_urls = $js_vars = array();
if (isset($conf['menu']['apps']) && is_array($conf['menu']['apps'])) {
foreach ($conf['menu']['apps'] as $app) {
$app_urls[$app] = strval(Horde::url($registry->getInitialPage($app), true));
}
}
/* Variables used in core javascript files. */
$js_vars['conf'] = array_filter(array('URI_CALENDAR_EXPORT' => str_replace(array('%23', '%2523', '%7B', '%257B', '%7D', '%257D'), array('#', '#', '{', '{', '}', '}'), strval($registry->downloadUrl('#{calendar}.ics', array('actionID' => 'export', 'all_events' => 1, 'exportID' => Horde_Data::EXPORT_ICALENDAR, 'exportCal' => 'internal_#{calendar}'))->setRaw(true))), 'URI_RESOURCE_EXPORT' => str_replace(array('%23', '%2523', '%7B', '%257B', '%7D', '%257D'), array('#', '#', '{', '{', '}', '}'), strval($registry->downloadUrl('#{calendar}.ics', array('actionID' => 'export', 'all_events' => 1, 'exportID' => Horde_Data::EXPORT_ICALENDAR, 'exportCal' => 'resource_#{calendar}'))->setRaw(true))), 'URI_EVENT_EXPORT' => str_replace(array('%23', '%7B', '%7D'), array('#', '{', '}'), Horde::url('event.php', true)->add(array('view' => 'ExportEvent', 'eventID' => '#{id}', 'calendar' => '#{calendar}', 'type' => '#{type}'))), 'images' => array('alarm' => strval(Horde_Themes::img('alarm-fff.png')), 'attendees' => strval(Horde_Themes::img('attendees-fff.png')), 'exception' => strval(Horde_Themes::img('exception-fff.png')), 'new_event' => strval(Horde_Themes::img('new.png')), 'new_task' => strval(Horde_Themes::img('new_task.png')), 'recur' => strval(Horde_Themes::img('recur-fff.png'))), 'new_event' => $injector->getInstance('Kronolith_View_Sidebar')->newLink . $injector->getInstance('Kronolith_View_Sidebar')->newText . '</a>', 'new_task' => $injector->getInstance('Kronolith_View_SidebarTasks')->newLink . $injector->getInstance('Kronolith_View_SidebarTasks')->newText . '</a>', 'user' => $registry->convertUsername($auth_name, false), 'name' => $identity->getName(), 'email' => strval($identity->getDefaultFromAddress()), 'prefs_url' => strval($registry->getServiceLink('prefs', 'kronolith')->setRaw(true)), 'app_urls' => $app_urls, 'name' => $registry->get('name'), 'has_tasks' => intval($has_tasks), 'has_resources' => intval(!empty($conf['resource']['driver'])), 'login_view' => $prefs->getValue('defaultview') == 'workweek' ? 'week' : $prefs->getValue('defaultview'), 'default_calendar' => 'internal|' . Kronolith::getDefaultCalendar(Horde_Perms::EDIT), 'max_events' => intval($prefs->getValue('max_events')), 'date_format' => Horde_Core_Script_Package_Datejs::translateFormat(Horde_Nls::getLangInfo(D_FMT)), 'time_format' => $prefs->getValue('twentyFour') ? 'HH:mm' : 'hh:mm tt', 'import_file' => Horde_Data::IMPORT_FILE, 'import_url' => Horde_Data::IMPORT_URL, 'show_time' => Kronolith::viewShowTime(), 'default_alarm' => intval($prefs->getValue('default_alarm')), 'status' => array('cancelled' => Kronolith::STATUS_CANCELLED, 'confirmed' => Kronolith::STATUS_CONFIRMED, 'free' => Kronolith::STATUS_FREE, 'tentative' => Kronolith::STATUS_TENTATIVE), 'recur' => array(Horde_Date_Recurrence::RECUR_NONE => 'None', Horde_Date_Recurrence::RECUR_DAILY => 'Daily', Horde_Date_Recurrence::RECUR_WEEKLY => 'Weekly', Horde_Date_Recurrence::RECUR_MONTHLY_DATE => 'Monthly', Horde_Date_Recurrence::RECUR_MONTHLY_WEEKDAY => 'Monthly', Horde_Date_Recurrence::RECUR_YEARLY_DATE => 'Yearly', Horde_Date_Recurrence::RECUR_YEARLY_DAY => 'Yearly', Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY => 'Yearly'), 'perms' => array('all' => Horde_Perms::ALL, 'show' => Horde_Perms::SHOW, 'read' => Horde_Perms::READ, 'edit' => Horde_Perms::EDIT, 'delete' => Horde_Perms::DELETE, 'delegate' => Kronolith::PERMS_DELEGATE), 'tasks' => $has_tasks ? $registry->tasks->ajaxDefaults() : null));
/* Make sure this value is not optimized out by array_filter(). */
$js_vars['conf']['week_start'] = intval($prefs->getValue('week_start_monday'));
/* Gettext strings. */
$js_vars['text'] = array('alarm' => _("Alarm:"), 'alerts' => _("Notifications"), 'allday' => _("All day"), 'delete_calendar' => _("Are you sure you want to delete this calendar and all the events in it?"), 'delete_tasklist' => _("Are you sure you want to delete this task list and all the tasks in it?"), 'external_category' => _("Other events"), 'fix_form_values' => _("Please enter correct values in the form first."), 'geocode_error' => _("Unable to locate requested address"), 'hidelog' => _("Hide Notifications"), 'import_warning' => _("Importing calendar data. This may take a while..."), 'more' => _("more..."), 'no_assignee' => _("None"), 'no_calendar_title' => _("The calendar title must not be empty."), 'no_parent' => _("No parent task"), 'no_tasklist_title' => _("The task list title must not be empty."), 'no_url' => _("You must specify a URL."), 'prefs' => _("Preferences"), 'searching' => sprintf(_("Events matching \"%s\""), '#{term}'), 'shared' => _("Shared"), 'tasks' => _("Tasks"), 'unknown_resource' => _("Unknown resource."), 'wrong_auth' => _("The authentication information you specified wasn't accepted."), 'wrong_date_format' => sprintf(_("You used an unknown date format \"%s\". Please try something like \"%s\"."), '#{wrong}', '#{right}'), 'wrong_time_format' => sprintf(_("You used an unknown time format \"%s\". Please try something like \"%s\"."), '#{wrong}', '#{right}'));
for ($i = 1; $i <= 12; ++$i) {
$js_vars['text']['month'][$i - 1] = Horde_Nls::getLangInfo(constant('MON_' . $i));
}
for ($i = 1; $i <= 7; ++$i) {
$js_vars['text']['weekday'][$i] = Horde_Nls::getLangInfo(constant('DAY_' . $i));
}
foreach (array_diff(array_keys($js_vars['conf']['recur']), array(Horde_Date_Recurrence::RECUR_NONE)) as $recurType) {
$js_vars['text']['recur'][$recurType] = Kronolith::recurToString($recurType);
}
$js_vars['text']['recur']['exception'] = _("Exception");
// Maps
$js_vars['conf']['maps'] = $conf['maps'];
return $js_vars;
}
示例9: execute
/**
* @throws Kronolith_Exception
*/
public function execute()
{
if ($this->_vars->get('submitbutton') == _("Cancel")) {
Horde::url($GLOBALS['prefs']->getValue('defaultview') . '.php', true)->redirect();
}
return Kronolith::unsubscribeRemoteCalendar($this->_vars->get('url'));
}
示例10: execute
/**
* @throws Turba_Exception
*/
public function execute()
{
// If cancel was clicked, return false.
if ($this->_vars->get('submitbutton') == _("Cancel")) {
Horde::url('', true)->redirect();
}
if (!$GLOBALS['registry']->getAuth() || $this->_addressbook->get('owner') != $GLOBALS['registry']->getAuth()) {
throw new Turba_Exception(_("You do not have permissions to delete this address book."));
}
$driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($this->_addressbook->getName());
if ($driver->hasCapability('delete_all')) {
try {
$driver->deleteAll();
} catch (Turba_Exception $e) {
Horde::log($e->getMessage(), 'ERR');
throw $e;
}
}
// Address book successfully deleted from backend, remove the share.
try {
$GLOBALS['injector']->getInstance('Turba_Shares')->removeShare($this->_addressbook);
} catch (Horde_Share_Exception $e) {
Horde::log($e->getMessage(), 'ERR');
throw new Turba_Exception($e);
}
if ($GLOBALS['session']->get('turba', 'source') == Horde_Util::getFormData('deleteshare')) {
$GLOBALS['session']->remove('turba', 'source');
}
}
示例11: _hours
protected function _hours()
{
global $prefs;
$hours_html = '';
$dayWidth = round(100 / $this->_days);
$span = floor(($this->_endHour - $this->_startHour) / 3);
if (($this->_endHour - $this->_startHour) % 3) {
$span++;
}
$date_format = $prefs->getValue('date_format');
for ($i = 0; $i < $this->_days; $i++) {
$t = new Horde_Date(array('month' => $this->_start->month, 'mday' => $this->_start->mday + $i, 'year' => $this->_start->year));
$day_label = Horde::url('#')->link(array('onclick' => 'return switchDateView(\'Day\',' . $t->dateString() . ');')) . $t->strftime($date_format) . '</a>';
$hours_html .= sprintf('<th colspan="%d" width="%s%%">%s</th>', $span, $dayWidth, $day_label);
}
$hours_html .= '</tr><tr><td width="100" class="label"> </td>';
$width = round(100 / ($span * $this->_days));
for ($i = 0; $i < $this->_days; $i++) {
for ($h = $this->_startHour; $h < $this->_endHour; $h += 3) {
$start = new Horde_Date(array('hour' => $h, 'month' => $this->_start->month, 'mday' => $this->_start->mday + $i, 'year' => $this->_start->year));
$end = new Horde_Date($start);
$end->hour += 2;
$end->min = 59;
$this->_timeBlocks[] = array($start, $end);
$hour = $start->strftime($prefs->getValue('twentyFour') ? '%H:00' : '%I:00');
$hours_html .= sprintf('<th width="%d%%">%s</th>', $width, $hour);
}
}
return $hours_html;
}
示例12: _handle
/**
*/
protected function _handle(Horde_Variables $vars)
{
global $injector, $prefs;
$faces = $injector->getInstance('Ansel_Faces');
$image_id = intval($vars->image_id);
$results = $faces->getImageFacesData($image_id);
// Attempt to get faces from the picture if we don't already have
// results, or if we were asked to explicitly try again.
if (empty($results)) {
$image = $injector->getInstance('Ansel_Storage')->getImage($image_id);
$image->createView('screen', null, $prefs->getValue('watermark_auto') ? $prefs->getValue('watermark_text', '') : '');
$results = $faces->getFromPicture($image_id, true);
}
if (empty($results)) {
$results = new stdClass();
$results->response = _("No faces found");
return new Horde_Core_Ajax_Response($results);
}
$customurl = Horde::url('faces/custom.php');
Horde::startBuffer();
include ANSEL_TEMPLATES . '/faces/image.inc';
$response = new stdClass();
$response->response = Horde::endBuffer();
return new Horde_Core_Ajax_Response($response);
}
示例13: _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>';
}
}
示例14: execute
/**
* @throws Kronolith_Exception
*/
public function execute()
{
if ($this->_vars->get('submitbutton') == _("Cancel")) {
Horde::url($GLOBALS['prefs']->getValue('defaultview') . '.php', true)->redirect();
}
Kronolith::deleteShare($this->_calendar);
}
示例15: _create
/**
*/
protected function _create($mbox, $subject, $body)
{
global $notification, $registry;
$list = str_replace(self::TASKLIST_EDIT, '', $mbox);
/* Create a new iCalendar. */
$vCal = new Horde_Icalendar();
$vCal->setAttribute('PRODID', '-//The Horde Project//IMP ' . $registry->getVersion() . '//EN');
$vCal->setAttribute('METHOD', 'PUBLISH');
/* Create a new vTodo object using this message's contents. */
$vTodo = Horde_Icalendar::newComponent('vtodo', $vCal);
$vTodo->setAttribute('SUMMARY', $subject);
$vTodo->setAttribute('DESCRIPTION', $body);
$vTodo->setAttribute('PRIORITY', '3');
/* Get the list of editable tasklists. */
$lists = $this->getTasklists(true);
/* Attempt to add the new vTodo item to the requested tasklist. */
try {
$res = $registry->call('tasks/import', array($vTodo, 'text/calendar', $list));
} catch (Horde_Exception $e) {
$notification->push($e);
return;
}
if (!$res) {
$notification->push(_("An unknown error occured while creating the new task."), 'horde.error');
} elseif (!empty($lists)) {
$name = '"' . htmlspecialchars($subject) . '"';
/* Attempt to convert the object name into a hyperlink. */
if ($registry->hasLink('tasks/show')) {
$name = sprintf('<a href="%s">%s</a>', Horde::url($registry->link('tasks/show', array('uid' => $res))), $name);
}
$notification->push(sprintf(_("%s was successfully added to \"%s\"."), $name, htmlspecialchars($lists[$list]->get('name'))), 'horde.success', array('content.raw'));
}
}