当前位置: 首页>>代码示例>>PHP>>正文


PHP Horde类代码示例

本文整理汇总了PHP中Horde的典型用法代码示例。如果您正苦于以下问题:PHP Horde类的具体用法?PHP Horde怎么用?PHP Horde使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Horde类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _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);
 }
开发者ID:horde,项目名称:horde,代码行数:27,代码来源:EditFaces.php

示例2: _attach

 /**
  */
 protected function _attach($init)
 {
     global $page_output;
     if ($init) {
         $page_output->addScriptPackage('Horde_Core_Script_Package_Dialog');
         $page_output->addScriptFile('passphrase.js', 'imp');
     }
     $params = isset($this->_params['params']) ? $this->_params['params'] : array();
     if (isset($params['reload'])) {
         $params['reload'] = strval($params['reload']);
     }
     switch ($this->_params['type']) {
         case 'pgpPersonal':
             $text = _("Enter your personal PGP passphrase.");
             break;
         case 'pgpSymmetric':
             $text = _("Enter the passphrase used to encrypt this message.");
             break;
         case 'smimePersonal':
             $text = _("Enter your personal S/MIME passphrase.");
             break;
     }
     $js_params = array('hidden' => array_merge($params, array('type' => $this->_params['type'])), 'text' => $text);
     $js = 'ImpPassphraseDialog.display(' . Horde::escapeJson($js_params, array('nodelimit' => true)) . ')';
     if (!empty($this->_params['onload'])) {
         $page_output->addInlineScript(array($js), true);
         return false;
     }
     return $js;
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:32,代码来源:PassphraseDialog.php

示例3: _content

 /**
  */
 protected function _content()
 {
     if (!isset($this->_params['forum_id'])) {
         throw new Horde_Exception(_("No forum selected"));
     }
     if (empty($this->_threads)) {
         $this->_threads = $GLOBALS['injector']->getInstance('Agora_Factory_Driver')->create('agora', $this->_params['forum_id']);
         if ($this->_threads instanceof PEAR_Error) {
             throw new Horde_Exception(_("Unable to fetch threads for selected forum."));
         }
     }
     /* Get the sorting. */
     $sort_by = Agora::getSortBy('threads');
     $sort_dir = Agora::getSortDir('threads');
     /* Get a list of threads and display only the most recent if
      * preference is set. */
     $threads_list = $this->_threads->getThreads(0, false, $sort_by, $sort_dir, false, Horde::selfUrl(), null, 0, !empty($this->_params['thread_display']) ? $this->_params['thread_display'] : null);
     /* Show a message if no available threads. Don't raise an error
      * as it is not an error to have no threads. */
     if (empty($threads_list)) {
         return _("No available threads.");
     }
     /* Set up the column headers. */
     $col_headers = array('message_subject' => _("Subject"), 'message_author' => _("Posted by"), 'message_timestamp' => _("Date"));
     $col_headers = Agora::formatColumnHeaders($col_headers, $sort_by, $sort_dir, 'threads');
     /* Set up the template tags. */
     $view = new Agora_View();
     $view->col_headers = $col_headers;
     $view->threads = $threads_list;
     return $view->render('block/threads');
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:33,代码来源:Threads.php

示例4: display

 /**
  */
 public function display(Horde_Core_Prefs_Ui $ui)
 {
     global $injector, $page_output, $prefs, $session;
     $page_output->addScriptPackage('IMP_Script_Package_Imp');
     $imp_pgp = $injector->getInstance('IMP_Crypt_Pgp');
     /* Get list of Public Keys on keyring. */
     try {
         $pubkey_list = $imp_pgp->listPublicKeys();
     } catch (Horde_Exception $e) {
         $pubkey_list = array();
     }
     $pgp_url = IMP_Basic_Pgp::url();
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
     $view->addHelper('Horde_Core_View_Helper_Help');
     $view->addHelper('Text');
     if (!empty($pubkey_list)) {
         $plist = array();
         $self_url = $ui->selfUrl(array('special' => true, 'token' => true));
         foreach ($pubkey_list as $val) {
             $plist[] = array('name' => $val['name'], 'email' => $val['email'], 'view' => Horde::link($pgp_url->copy()->add(array('actionID' => 'view_public_key', 'email' => $val['email'])), sprintf(_("View %s Public Key"), $val['name']), null, 'view_key'), 'info' => Horde::link($pgp_url->copy()->add(array('actionID' => 'info_public_key', 'email' => $val['email'])), sprintf(_("Information on %s Public Key"), $val['name']), null, 'info_key'), 'delete' => Horde::link($self_url->copy()->add(array('delete_pgp_pubkey' => 1, 'email' => $val['email'])), sprintf(_("Delete %s Public Key"), $val['name']), null, null, "window.confirm('" . addslashes(_("Are you sure you want to delete this public key?")) . "')"));
         }
         $view->pubkey_list = $plist;
     }
     if ($session->get('imp', 'file_upload')) {
         $view->can_import = true;
         $view->no_source = !$prefs->getValue('add_source');
         if (!$view->no_source) {
             $page_output->addInlineScript(array('$("import_pgp_public").observe("click", function(e) { ' . Horde::popupJs($pgp_url, array('params' => array('actionID' => 'import_public_key', 'reload' => base64_encode($ui->selfUrl()->setRaw(true))), 'height' => 275, 'width' => 750, 'urlencode' => true)) . '; e.stop(); })'), true);
         }
     }
     return $view->render('pgppublickey');
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:34,代码来源:PgpPublicKey.php

示例5: __construct

 /**
  * Constructor.
  *
  * @param array $config  Configuration key-value pairs.
  */
 public function __construct($config = array())
 {
     global $prefs, $registry;
     parent::__construct($config);
     $blank = new Horde_Url();
     $this->addNewButton(_("_New Event"), $blank, array('id' => 'kronolithNewEvent'));
     $this->newExtra = $blank->link(array_merge(array('id' => 'kronolithQuickEvent'), Horde::getAccessKeyAndTitle(_("Quick _insert"), false, true)));
     $sidebar = $GLOBALS['injector']->createInstance('Horde_View');
     /* Minical. */
     $today = new Horde_Date($_SERVER['REQUEST_TIME']);
     $sidebar->today = $today->format('F Y');
     $sidebar->weekdays = array();
     for ($i = $prefs->getValue('week_start_monday'), $c = $i + 7; $i < $c; $i++) {
         $weekday = Horde_Nls::getLangInfo(constant('DAY_' . ($i % 7 + 1)));
         $sidebar->weekdays[$weekday] = Horde_String::substr($weekday, 0, 2);
     }
     /* Calendars. */
     $sidebar->newShares = $registry->getAuth() && !$prefs->isLocked('default_share');
     $sidebar->admin = $registry->isAdmin();
     $sidebar->resourceAdmin = $registry->isAdmin() || $GLOBALS['injector']->getInstance('Horde_Core_Perms')->hasAppPermission('resource_management');
     $sidebar->resources = $GLOBALS['conf']['resources']['enabled'];
     $sidebar->addRemote = !$prefs->isLocked('remote_cals');
     $remotes = unserialize($prefs->getValue('remote_cals'));
     $sidebar->showRemote = !($prefs->isLocked('remote_cals') && empty($remotes));
     $this->content = $sidebar->render('dynamic/sidebar');
 }
开发者ID:horde,项目名称:horde,代码行数:31,代码来源:Sidebar.php

示例6: _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>';
     }
 }
开发者ID:horde,项目名称:horde,代码行数:27,代码来源:Delivery.php

示例7: 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);
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:10,代码来源:DeleteCalendar.php

示例8: create

 /**
  * Return a Horde_Alarm instance.
  *
  * @return Horde_Alarm
  * @throws Horde_Exception
  */
 public function create()
 {
     global $conf;
     if (isset($this->_alarm)) {
         return $this->_alarm;
     }
     $driver = empty($conf['alarms']['driver']) ? 'null' : $conf['alarms']['driver'];
     $params = Horde::getDriverConfig('alarms', $driver);
     switch (Horde_String::lower($driver)) {
         case 'sql':
             $params['db'] = $this->_injector->getInstance('Horde_Core_Factory_Db')->create('horde', 'alarms');
             break;
     }
     $params['logger'] = $this->_injector->getInstance('Horde_Log_Logger');
     $params['loader'] = array($this, 'load');
     $this->_ttl = isset($params['ttl']) ? $params['ttl'] : 300;
     $class = $this->_getDriverName($driver, 'Horde_Alarm');
     $this->_alarm = new $class($params);
     $this->_alarm->initialize();
     $this->_alarm->gc();
     /* Add those handlers that need configuration and can't be auto-loaded
      * through Horde_Alarms::handlers(). */
     $this->_alarm->addHandler('notify', new Horde_Core_Alarm_Handler_Notify());
     $this->_alarm->addHandler('desktop', new Horde_Core_Alarm_Handler_Desktop(array('icon' => new Horde_Core_Alarm_Handler_Desktop_Icon('alerts/alarm.png'), 'js_notify' => array($this->_injector->getInstance('Horde_PageOutput'), 'addInlineScript'))));
     $this->_alarm->addHandler('mail', new Horde_Alarm_Handler_Mail(array('identity' => $this->_injector->getInstance('Horde_Core_Factory_Identity'), 'mail' => $this->_injector->getInstance('Horde_Mail'))));
     return $this->_alarm;
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:33,代码来源:Alarm.php

示例9: create

 /**
  * Return the Agora_Driver:: instance.
  *
  * @param string $scope  Instance scope
  * @param int $forum_id  Forum to link to
  *
  * @return Agora_Driver  The singleton instance.
  * @throws Agora_Exception
  */
 public function create($scope = 'agora', $forum_id = 0)
 {
     if (!isset($this->_instances[$scope])) {
         $driver = $GLOBALS['conf']['threads']['split'] ? 'SplitSql' : 'Sql';
         $params = Horde::getDriverConfig('sql');
         $class = 'Agora_Driver_' . $driver;
         if (!class_exists($class)) {
             throw new Agora_Exception(sprintf('Unable to load the definition of %s.', $class));
         }
         $params = array('db' => $this->_injector->getInstance('Horde_Db_Adapter'), 'charset' => $params['charset']);
         $driver = new $class($scope, $params);
         $this->_instances[$scope] = $driver;
     }
     if ($forum_id) {
         /* Check if there was a valid forum object to get. */
         try {
             $forum = $this->_instances[$scope]->getForum($forum_id);
         } catch (Horde_Exception $e) {
             throw new Agora_Exception($e->getMessage());
         }
         /* Set current forum id and forum data */
         $this->_instances[$scope]->_forum = $forum;
         $this->_instances[$scope]->_forum_id = (int) $forum_id;
     }
     return $this->_instances[$scope];
 }
开发者ID:horde,项目名称:horde,代码行数:35,代码来源:Driver.php

示例10: checkPassphrase

 /**
  * AJAX action: Check passphrase.
  *
  * Variables required in form input:
  *   - dialog_input: (string) Input from the dialog screen.
  *   - reload: (mixed) If set, reloads page instead of returning data.
  *   - symmetricid: (string) The symmetric ID to process.
  *   - type: (string) The passphrase type.
  *
  * @return boolean  True on success.
  */
 public function checkPassphrase()
 {
     global $injector, $notification;
     $result = false;
     if (!$this->vars->dialog_input) {
         $notification->push(_("No passphrase entered."), 'horde.error');
         return $result;
     }
     try {
         Horde::requireSecureConnection();
         switch ($this->vars->type) {
             case 'pgpPersonal':
                 $result = $injector->getInstance('IMP_Pgp')->storePassphrase('personal', $this->vars->dialog_input);
                 break;
             case 'pgpSymmetric':
                 $result = $injector->getInstance('IMP_Pgp')->storePassphrase('symmetric', $this->vars->dialog_input, $this->vars->symmetricid);
                 break;
             case 'smimePersonal':
                 $result = $injector->getInstance('IMP_Smime')->storePassphrase($this->vars->dialog_input, $this->vars->secondary);
                 break;
         }
         if ($result) {
             $notification->push(_("Passphrase verified."), 'horde.success');
         } else {
             $notification->push(_("Invalid passphrase entered."), 'horde.error');
         }
     } catch (Horde_Exception $e) {
         $notification->push($e, 'horde.error');
     }
     return $result && $this->vars->reload ? new Horde_Core_Ajax_Response_HordeCore_Reload($this->vars->reload) : $result;
 }
开发者ID:horde,项目名称:horde,代码行数:42,代码来源:Passphrase.php

示例11: 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');
 }
开发者ID:horde,项目名称:horde,代码行数:7,代码来源:Trean.php

示例12: execute

 public function execute()
 {
     parent::execute();
     $this->getInfo($this->_vars, $info);
     $next_page = Horde::url('edit.php', true)->add(array('source' => $info['source'], 'original_source' => $info['original_source'], 'objectkeys' => $info['objectkeys'], 'url' => $info['url'], 'actionID' => 'groupedit'));
     $objectkey = array_search($info['source'] . ':' . $info['key'], $info['objectkeys']);
     $submitbutton = $this->_vars->get('submitbutton');
     if ($submitbutton == _("Finish")) {
         $next_page = Horde::url('browse.php', true);
         if ($info['original_source'] == '**search') {
             $next_page->add('key', $info['original_source']);
         } else {
             $next_page->add('source', $info['original_source']);
         }
     } elseif ($submitbutton == _("Previous") && $info['source'] . ':' . $info['key'] != $info['objectkeys'][0]) {
         /* Previous contact */
         list(, $previous_key) = explode(':', $info['objectkeys'][$objectkey - 1]);
         $next_page->add('key', $previous_key);
         if ($this->getOpenSection()) {
             $next_page->add('__formOpenSection', $this->getOpenSection());
         }
     } elseif ($submitbutton == _("Next") && $info['source'] . ':' . $info['key'] != $info['objectkeys'][count($info['objectkeys']) - 1]) {
         /* Next contact */
         list(, $next_key) = explode(':', $info['objectkeys'][$objectkey + 1]);
         $next_page->add('key', $next_key);
         if ($this->getOpenSection()) {
             $next_page->add('__formOpenSection', $this->getOpenSection());
         }
     }
     $next_page->redirect();
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:31,代码来源:EditContactGroup.php

示例13: gc

 /**
  */
 public function gc()
 {
     global $registry;
     if (empty($this->_params['lifetime'])) {
         return;
     }
     /* Keep a file in the static directory that prevents us from doing
      * garbage collection more than once a day. */
     $curr_time = time();
     $static_dir = $registry->get('fileroot', 'horde') . '/static';
     $static_stat = $static_dir . '/gc_cachecss';
     $next_run = !is_readable($static_stat) ?: @file_get_contents($static_stat);
     if (!$next_run || $curr_time > $next_run) {
         file_put_contents($static_stat, $curr_time + 86400);
     }
     if (!$next_run || $curr_time < $next_run) {
         return;
     }
     $curr_time -= $this->_params['lifetime'];
     $removed = 0;
     foreach (glob($static_dir . '/*.css') as $file) {
         if ($curr_time > filemtime($file)) {
             @unlink($file);
             ++$removed;
         }
     }
     Horde::log(sprintf('Cleaned out static CSS files (removed %d file(s)).', $removed), 'DEBUG');
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:30,代码来源:File.php

示例14: _content

 /**
  */
 protected function _content()
 {
     /* Return empty if we don't have a thread set. */
     if (empty($this->_params['thread_id'])) {
         return '';
     }
     /* Set up the message object. */
     list($forum_id, $message_id) = explode('.', $this->_params['thread_id']);
     $messages = $GLOBALS['injector']->getInstance('Agora_Factory_Driver')->create('agora', $forum_id);
     /* Check if valid thread, otherwise show forum list. */
     if ($messages instanceof PEAR_Error || empty($messages)) {
         throw new Horde_Exception(_("Unable to fetch selected thread."));
     }
     /* Get the sorting. */
     $sort_by = Agora::getSortBy('threads');
     $sort_dir = Agora::getSortDir('threads');
     $view_bodies = $GLOBALS['prefs']->getValue('thread_view_bodies');
     /* Get the message array and the sorted thread list. */
     $threads_list = $messages->getThreads($messages->getThreadRoot($message_id), true, $sort_by, $sort_dir, $view_bodies, Horde::selfUrl());
     /* Set up the column headers. */
     $col_headers = array(array('message_thread' => _("Thread"), 'message_subject' => _("Subject")), 'message_author' => _("Posted by"), 'message_timestamp' => _("Date"));
     $col_headers = Agora::formatColumnHeaders($col_headers, $sort_by, $sort_dir, 'threads');
     /* Set up the template tags. */
     $view = new Agora_View();
     $view->col_headers = $col_headers;
     $view->threads_list = $threads_list;
     $view->threads_list_header = _("Thread List");
     $view->thread_view_bodies = $view_bodies;
     return $view->render('block/thread');
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:32,代码来源:Thread.php

示例15: status

 /**
  */
 public function status()
 {
     global $notification;
     Horde::startBuffer();
     $notification->notify(array('listeners' => array('status', 'audio')));
     return Horde::endBuffer();
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:9,代码来源:Base.php


注:本文中的Horde类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。