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


PHP Horde_View::__construct方法代码示例

本文整理汇总了PHP中Horde_View::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde_View::__construct方法的具体用法?PHP Horde_View::__construct怎么用?PHP Horde_View::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Horde_View的用法示例。


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

示例1: __construct

 /**
  * Constructor.
  *
  * @param array $config  Configuration key-value pairs. Additional options:
  *   - mailbox: (string) Mailbox to use for quota query.
  */
 public function __construct(array $config = array())
 {
     $config['templatePath'] = IMP_TEMPLATES . '/basic';
     parent::__construct($config);
     $quotadata = $GLOBALS['injector']->getInstance('IMP_Quota_Ui')->quota(isset($config['mailbox']) ? $config['mailbox'] : null, true);
     if (!empty($quotadata)) {
         $this->quotaClass = $quotadata['class'];
         $this->quotaText = $quotadata['message'];
     }
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:16,代码来源:Subinfo.php

示例2: __construct

 /**
  * Constructor.
  *
  * @param array $config  Configuration key-value pairs.
  */
 public function __construct($config = array())
 {
     if (empty($config['templatePath'])) {
         $config['templatePath'] = $GLOBALS['registry']->get('templates', 'horde') . '/sidebar';
     }
     parent::__construct($config);
     $this->addHelper('Text');
     $this->containers = array();
     $this->width = $GLOBALS['prefs']->getValue('sidebar_width');
     $this->left = ($GLOBALS['registry']->nlsconfig->curr_rtl ? 'right:' : 'left:') . $this->width;
     $pageOutput = $GLOBALS['injector']->getInstance('Horde_PageOutput');
     $pageOutput->addScriptFile('sidebar.js', 'horde');
     $pageOutput->addInlineJsVars(array('HordeSidebar.text' => array('collapse' => _("Collapse"), 'expand' => _("Expand")), 'HordeSidebar.opts' => array('cookieDomain' => $GLOBALS['conf']['cookie']['domain'], 'cookiePath' => $GLOBALS['conf']['cookie']['path'])));
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:19,代码来源:Sidebar.php

示例3: __construct

 /**
  * Constructor.
  *
  * @param array $config  Configuration key-value pairs.
  */
 public function __construct($config = array())
 {
     global $injector, $prefs, $registry;
     if (empty($config['templatePath'])) {
         $config['templatePath'] = $registry->get('templates', 'horde') . '/topbar';
     }
     parent::__construct($config);
     $this->addHelper('Text');
     /* Logo. */
     $this->portalUrl = $registry->getServiceLink('portal', $registry->getApp());
     if (class_exists('Horde_Bundle')) {
         $this->version = Horde_Bundle::SHORTNAME . ' ' . Horde_Bundle::VERSION;
     } else {
         $this->version = $registry->getVersion('horde');
     }
     /* Main menu. */
     $topbar = $injector->getInstance('Horde_Core_Factory_Topbar')->create('Horde_Tree_Renderer_Menu', array('nosession' => true));
     $this->menu = $topbar->getTree();
     /* Search form. */
     $this->searchAction = '#';
     $this->searchIcon = Horde_Themes::img('search-topbar.png');
     $this->searchLabel = _("Search");
     /* Login/Logout. */
     if ($registry->getAuth()) {
         if ($registry->showService('logout')) {
             $this->logoutUrl = $registry->getServiceLink('logout', $registry->getApp())->setRaw(false);
         }
     } else {
         if ($registry->showService('login')) {
             $this->loginUrl = $registry->getServiceLink('login', $registry->getApp())->setRaw(false)->add('url', Horde::selfUrl(true, true, true));
         }
     }
     /* Sub bar. */
     $this->date = strftime($prefs->getValue('date_format'));
     $pageOutput = $injector->getInstance('Horde_PageOutput');
     $pageOutput->addScriptPackage('Horde_Core_Script_Package_Datejs');
     $pageOutput->addScriptFile('topbar.js', 'horde');
     $pageOutput->addInlineJsVars(array('HordeTopbar.conf' => array('URI_AJAX' => $registry->getServiceLink('ajax', 'horde')->url, 'app' => $registry->getApp(), 'format' => Horde_Core_Script_Package_Datejs::translateFormat($prefs->getValue('date_format')), 'hash' => $topbar->getHash(), 'refresh' => intval($prefs->getValue('menu_refresh_time')))));
     /* Sidebar. */
     $this->sidebarWidth = $prefs->getValue('sidebar_width');
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:46,代码来源:Topbar.php

示例4: __construct

 /**
  * Constructor.
  *
  * @param array $config  Configuration key-value pairs.
  */
 public function __construct($config = array())
 {
     global $conf, $injector, $registry, $session;
     $config['templatePath'] = KRONOLITH_TEMPLATES . '/attendees';
     parent::__construct($config);
     $this->addHelper('Text');
     $this->formInput = Horde_Util::formInput();
     $this->view = Horde_Util::getFormData('view', 'Day');
     $this->date = $config['start']->dateString();
     $this->end = $config['end']->dateString();
     $this->freeBusy = $config['fbView']->render($config['start']);
     $auth = $injector->getInstance('Horde_Core_Factory_Auth')->create();
     if ($auth->hasCapability('list') && ($conf['auth']['list_users'] == 'list' || $conf['auth']['list_users'] == 'both')) {
         $this->userList = $auth->listNames();
     }
     $this->resourcesEnabled = !empty($conf['resources']['enabled']);
     if ($registry->hasMethod('contacts/search')) {
         $this->addressbookLink = Horde::url('#')->link(array('class' => 'widget', 'onclick' => 'window.open(\'' . Horde::url('contacts.php') . '\', \'contacts\', \'toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=550,height=270,left=100,top=100\'); return false;')) . Horde::img('addressbook_browse.png') . '<br />' . _("Address Book") . '</a>';
     }
     $vars = Horde_Variables::getDefaultVariables();
     $tabs = new Horde_Core_Ui_Tabs(null, $vars);
     $tabs->addTab(_("Day"), new Horde_Url('javascript:switchView(\'Day\')'), 'Day');
     $tabs->addTab(_("Work Week"), new Horde_Url('javascript:switchView(\'Workweek\')'), 'Workweek');
     $tabs->addTab(_("Week"), new Horde_Url('javascript:switchView(\'Week\')'), 'Week');
     $tabs->addTab(_("Month"), new Horde_Url('javascript:switchView(\'Month\')'), 'Month');
     $this->tabs = $tabs->render($this->view);
     $attendees = $session->get('kronolith', 'attendees');
     if ($attendees) {
         $roles = array(Kronolith::PART_REQUIRED, Kronolith::PART_OPTIONAL, Kronolith::PART_NONE);
         $responses = array(Kronolith::RESPONSE_ACCEPTED, Kronolith::RESPONSE_DECLINED, Kronolith::RESPONSE_TENTATIVE, Kronolith::RESPONSE_NONE);
         $this->attendees = array();
         foreach ($attendees as $attendee) {
             $viewAttendee = array('id' => $attendee->id, 'name' => strval($attendee), 'deleteLink' => Horde::url('#')->link(array('title' => sprintf(_("Remove %s"), $attendee->displayName), 'onclick' => "performAction('remove', decodeURIComponent('" . rawurlencode($attendee->id) . "')); return false;")) . Horde::img('delete.png') . '</a>');
             if ($attendee->user) {
                 unset($this->userList[$attendee->user]);
             } else {
                 $viewAttendee['editLink'] = Horde::url('#')->link(array('title' => sprintf(_("Edit %s"), $attendee->displayName), 'onclick' => "performAction('edit', decodeURIComponent('" . rawurlencode($attendee->id) . "')); return false;")) . Horde::img('edit.png') . '</a>';
             }
             foreach ($roles as $role) {
                 $viewAttendee['roles'][$role] = array('selected' => $attendee->role == $role, 'label' => Kronolith::partToString($role));
             }
             foreach ($responses as $response) {
                 $viewAttendee['responses'][$response] = array('selected' => $attendee->response == $response, 'label' => Kronolith::responseToString($response));
             }
             $this->attendees[] = $viewAttendee;
         }
     }
     $this->resources = $session->get('kronolith', 'resources', Horde_Session::TYPE_ARRAY);
     foreach ($this->resources as $id => &$resource) {
         $resource['id'] = $id;
         $resource['deleteLink'] = Horde::url('#')->link(array('title' => sprintf(_("Remove %s"), $resource['name']), 'onclick' => "performAction('removeResource', decodeURIComponent('" . $id . "')); return false;")) . Horde::img('delete.png') . '</a>';
         foreach ($roles as $role) {
             $resource['roles'][$role] = array('selected' => $resource['attendance'] == $role, 'label' => Kronolith::partToString($role));
         }
         foreach ($responses as $response) {
             $resource['responses'][$response] = array('selected' => $resource['response'] == $response, 'label' => Kronolith::responseToString($response));
         }
     }
     /* Get list of resources for select list, and remove those we already
      * added. */
     if ($this->resourcesEnabled) {
         $this->allResources = array_diff_key(Kronolith::getDriver('Resource')->listResources(Horde_Perms::READ, array(), 'name'), $this->resources);
     }
 }
开发者ID:horde,项目名称:horde,代码行数:69,代码来源:Attendees.php

示例5: __construct

 /**
  * Constructor
  */
 public function __construct()
 {
     /* Set default data. */
     parent::__construct(array('templatePath' => AGORA_TEMPLATES));
 }
开发者ID:horde,项目名称:horde,代码行数:8,代码来源:View.php


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