本文整理汇总了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'];
}
}
示例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'])));
}
示例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');
}
示例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);
}
}
示例5: __construct
/**
* Constructor
*/
public function __construct()
{
/* Set default data. */
parent::__construct(array('templatePath' => AGORA_TEMPLATES));
}