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


PHP Kronolith::foregroundColor方法代码示例

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


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

示例1: toHash

 /**
  * Returns a hash representing this calendar.
  *
  * @return array  A simple hash.
  */
 public function toHash()
 {
     global $calendar_manager, $conf, $injector, $registry;
     $owner = $registry->getAuth() && $this->_share->get('owner') == $registry->getAuth();
     $hash = parent::toHash();
     $hash['name'] = Kronolith::getLabel($this->_share);
     $hash['desc'] = (string) $this->_share->get('desc');
     $hash['owner'] = $owner;
     $hash['users'] = Kronolith::listShareUsers($this->_share);
     $hash['fg'] = Kronolith::foregroundColor($this->_share);
     $hash['bg'] = Kronolith::backgroundColor($this->_share);
     $hash['show'] = in_array('tasks/' . $this->_share->getName(), $calendar_manager->get(Kronolith::DISPLAY_EXTERNAL_CALENDARS));
     $hash['edit'] = $this->_share->hasPermission($registry->getAuth(), Horde_Perms::EDIT);
     $hash['caldav'] = $this->caldavUrl();
     $hash['sub'] = Horde::url($registry->get('webroot', 'horde') . ($conf['urls']['pretty'] == 'rewrite' ? '/rpc/nag/' : '/rpc.php/nag/'), true, -1) . ($this->_share->get('owner') ? $registry->convertUsername($this->_share->get('owner'), false) : '-system-') . '/' . $this->_share->getName() . '.ics';
     if ($owner) {
         $hash['perms'] = Kronolith::permissionToJson($this->_share->getPermission(), is_null($this->_share->get('owner')));
     }
     return $hash;
 }
开发者ID:horde,项目名称:horde,代码行数:25,代码来源:Tasks.php

示例2: colors

 /**
  * Returns the colors of the current calendar.
  *
  * @return array  The calendar background and foreground color.
  */
 public function colors()
 {
     $color = $this->backgroundColor();
     return array($color, Kronolith::foregroundColor($color));
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:10,代码来源:Driver.php

示例3: array

        $owner = $GLOBALS['registry']->getAuth() && $calendar->owner() == $GLOBALS['registry']->getAuth();
        if ($my && $owner || !$my && !$owner) {
            $code['conf']['calendars']['internal'][$id] = array('name' => ($owner || !$calendar->owner() ? '' : '[' . $GLOBALS['registry']->convertUsername($calendar->owner(), false) . '] ') . $calendar->name(), 'desc' => $calendar->description(), 'owner' => $owner, 'fg' => $calendar->foreground(), 'bg' => $calendar->background(), 'show' => in_array($id, $GLOBALS['calendar_manager']->get(Kronolith::DISPLAY_CALENDARS)), 'edit' => $calendar->hasPermission(Horde_Perms::EDIT), 'feed' => (string) Kronolith::feedUrl($id), 'embed' => Kronolith::embedCode($id));
            if ($owner) {
                $code['conf']['calendars']['internal'][$id]['perms'] = Kronolith::permissionToJson($calendar->share()->getPermission());
            }
        }
    }
    // Tasklists
    if (!$has_tasks) {
        continue;
    }
    foreach ($registry->tasks->listTasklists($my, Horde_Perms::SHOW) as $id => $tasklist) {
        $owner = $GLOBALS['registry']->getAuth() && $tasklist->get('owner') == $GLOBALS['registry']->getAuth();
        if ($my && $owner || !$my && !$owner) {
            $code['conf']['calendars']['tasklists']['tasks/' . $id] = array('name' => Kronolith::getLabel($tasklist), 'desc' => $tasklist->get('desc'), 'owner' => $owner, 'fg' => Kronolith::foregroundColor($tasklist), 'bg' => Kronolith::backgroundColor($tasklist), 'show' => in_array('tasks/' . $id, $GLOBALS['calendar_manager']->get(Kronolith::DISPLAY_EXTERNAL_CALENDARS)), 'edit' => $tasklist->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT));
            if ($owner) {
                $code['conf']['calendars']['tasklists']['tasks/' . $id]['perms'] = Kronolith::permissionToJson($tasklist->getPermission());
            }
        }
    }
}
// Timeobjects
foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_EXTERNAL_CALENDARS) as $id => $calendar) {
    if ($calendar->api() == 'tasks') {
        continue;
    }
    if (!$calendar->display()) {
        continue;
    }
    $code['conf']['calendars']['external'][$id] = array('name' => $calendar->name(), 'fg' => $calendar->foreground(), 'bg' => $calendar->background(), 'api' => $registry->get('name', $registry->hasInterface($calendar->api())), 'show' => in_array($id, $GLOBALS['calendar_manager']->get(Kronolith::DISPLAY_EXTERNAL_CALENDARS)));
开发者ID:raz0rsdge,项目名称:horde,代码行数:31,代码来源:javascript_defs.php

示例4: fromDriver

 /**
  * Imports a backend specific event object.
  *
  * @param mixed $event  Backend specific event object that this object
  *                      will represent.
  */
 public function fromDriver($event)
 {
     $this->id = '_' . $this->_api . $event['id'];
     $this->icon = !empty($event['icon']) ? $event['icon'] : null;
     $this->title = $event['title'];
     $this->description = isset($event['description']) ? $event['description'] : '';
     if (isset($event['location'])) {
         $this->location = $event['location'];
     }
     try {
         $this->start = new Horde_Date($event['start']);
         $this->end = new Horde_Date($event['end']);
     } catch (Horde_Date_Exception $e) {
         throw new Kronolith_Exception($e);
     }
     if (isset($event['status'])) {
         switch ($event['status']) {
             case 'confirmed':
                 $this->status = Kronolith::STATUS_CONFIRMED;
                 break;
             case 'tentative':
                 $this->status = Kronolith::STATUS_TENTATIVE;
                 break;
             default:
                 $this->status = Kronolith::STATUS_FREE;
         }
     } else {
         $this->status = Kronolith::STATUS_FREE;
     }
     if (isset($event['private'])) {
         $this->private = $event['private'];
     }
     $this->_params = $event['params'];
     $this->_link = !empty($event['link']) ? $event['link'] : null;
     $this->url = !empty($event['url']) ? (string) $event['url'] : null;
     $this->_editLink = !empty($event['edit_link']) ? $event['edit_link'] : null;
     $this->_deleteLink = !empty($event['delete_link']) ? $event['delete_link'] : null;
     $this->_ajaxLink = !empty($event['ajax_link']) ? $event['ajax_link'] : null;
     $this->_backgroundColor = Kronolith::backgroundColor($event);
     $this->_foregroundColor = Kronolith::foregroundColor($event);
     if (isset($event['recurrence'])) {
         $recurrence = new Horde_Date_Recurrence($this->start);
         $recurrence->setRecurType($event['recurrence']['type']);
         if (isset($event['recurrence']['end'])) {
             $recurrence->setRecurEnd(new Horde_Date($event['recurrence']['end']));
         }
         if (isset($event['recurrence']['interval'])) {
             $recurrence->setRecurInterval($event['recurrence']['interval']);
         }
         if (isset($event['recurrence']['count'])) {
             $recurrence->setRecurCount($event['recurrence']['count']);
         }
         if (isset($event['recurrence']['days'])) {
             $recurrence->setRecurOnDay($event['recurrence']['days']);
         }
         if (isset($event['recurrence']['exceptions'])) {
             foreach ($event['recurrence']['exceptions'] as $exception) {
                 $recurrence->addException(substr($exception, 0, 4), substr($exception, 4, 2), substr($exception, 6, 2));
             }
         }
         if (isset($event['recurrence']['completions'])) {
             foreach ($event['recurrence']['completions'] as $completion) {
                 $recurrence->addCompletion(substr($completion, 0, 4), substr($completion, 4, 2), substr($completion, 6, 2));
             }
         }
         $this->recurrence = $recurrence;
     }
     if (isset($event['owner'])) {
         $this->_owner = $event['owner'];
     }
     if (isset($event['permissions'])) {
         $this->_permissions = $event['permissions'];
     }
     if (isset($event['variable_length'])) {
         $this->_variableLength = $event['variable_length'];
     }
     $this->initialized = true;
     $this->stored = true;
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:85,代码来源:Horde.php


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