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


PHP Kronolith::parseAttendees方法代码示例

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


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

示例1: readForm

 /**
  * Reads form/post data and updates this event's properties.
  *
  * @param  Kronolith_Event|null $existing  If this is an exception event
  *                                         this is taken as the base event.
  *                                         @since 4.2.6
  *
  */
 public function readForm(Kronolith_Event $existing = null)
 {
     global $prefs, $session;
     // Event owner.
     $targetcalendar = Horde_Util::getFormData('targetcalendar');
     if (strpos($targetcalendar, '\\')) {
         list(, $this->creator) = explode('\\', $targetcalendar, 2);
     } elseif (!isset($this->_id)) {
         $this->creator = $GLOBALS['registry']->getAuth();
     }
     // Basic fields.
     $this->title = Horde_Util::getFormData('title', $this->title);
     $this->description = Horde_Util::getFormData('description', $this->description);
     $this->location = Horde_Util::getFormData('location', $this->location);
     $this->timezone = Horde_Util::getFormData('timezone', $this->timezone);
     $this->private = (bool) Horde_Util::getFormData('private');
     // URL.
     $url = Horde_Util::getFormData('eventurl', $this->url);
     if (strlen($url)) {
         // Analyze and re-construct.
         $url = @parse_url($url);
         if ($url) {
             if (function_exists('http_build_url')) {
                 if (empty($url['path'])) {
                     $url['path'] = '/';
                 }
                 $url = http_build_url($url);
             } else {
                 $new_url = '';
                 if (isset($url['scheme'])) {
                     $new_url .= $url['scheme'] . '://';
                 }
                 if (isset($url['user'])) {
                     $new_url .= $url['user'];
                     if (isset($url['pass'])) {
                         $new_url .= ':' . $url['pass'];
                     }
                     $new_url .= '@';
                 }
                 if (isset($url['host'])) {
                     // Convert IDN hosts to ASCII.
                     if (function_exists('idn_to_ascii')) {
                         $url['host'] = @idn_to_ascii($url['host']);
                     } elseif (Horde_Mime::is8bit($url['host'])) {
                         //throw new Kronolith_Exception(_("Invalid character in URL."));
                         $url['host'] = '';
                     }
                     $new_url .= $url['host'];
                 }
                 if (isset($url['path'])) {
                     $new_url .= $url['path'];
                 }
                 if (isset($url['query'])) {
                     $new_url .= '?' . $url['query'];
                 }
                 if (isset($url['fragment'])) {
                     $new_url .= '#' . $url['fragment'];
                 }
                 $url = $new_url;
             }
         }
     }
     $this->url = $url;
     // Status.
     $this->status = Horde_Util::getFormData('status', $this->status);
     // Attendees.
     $attendees = $session->get('kronolith', 'attendees', Horde_Session::TYPE_ARRAY);
     if (!is_null($newattendees = Horde_Util::getFormData('attendees'))) {
         $newattendees = Kronolith::parseAttendees(trim($newattendees));
         foreach ($newattendees as $email => $attendee) {
             if (!isset($attendees[$email])) {
                 $attendees[$email] = $attendee;
             }
         }
         foreach (array_keys($attendees) as $email) {
             if (!isset($newattendees[$email])) {
                 unset($attendees[$email]);
             }
         }
     }
     $this->attendees = $attendees;
     // Event start.
     $allDay = Horde_Util::getFormData('whole_day');
     if ($start_date = Horde_Util::getFormData('start_date')) {
         // From ajax interface.
         $this->start = Kronolith::parseDate($start_date . ' ' . Horde_Util::getFormData('start_time'), true, $this->timezone);
         if ($allDay) {
             $this->start->hour = $this->start->min = $this->start->sec = 0;
         }
     } else {
         // From traditional interface.
         $start = Horde_Util::getFormData('start');
//.........这里部分代码省略.........
开发者ID:GenerationLabs,项目名称:horde,代码行数:101,代码来源:Event.php

示例2: readForm

 public function readForm()
 {
     global $prefs, $session;
     // Event owner.
     $targetcalendar = Horde_Util::getFormData('targetcalendar');
     if (strpos($targetcalendar, '\\')) {
         list(, $this->creator) = explode('\\', $targetcalendar, 2);
     } elseif (!isset($this->_id)) {
         $this->creator = $GLOBALS['registry']->getAuth();
     }
     // Basic fields.
     $this->title = Horde_Util::getFormData('title', $this->title);
     $this->description = Horde_Util::getFormData('description', $this->description);
     $this->location = Horde_Util::getFormData('location', $this->location);
     $this->timezone = Horde_Util::getFormData('timezone', $this->timezone);
     $this->private = (bool) Horde_Util::getFormData('private');
     // URL.
     $url = Horde_Util::getFormData('eventurl', $this->url);
     if (strlen($url)) {
         // Analyze and re-construct.
         $url = @parse_url($url);
         if ($url) {
             if (function_exists('http_build_url')) {
                 if (empty($url['path'])) {
                     $url['path'] = '/';
                 }
                 $url = http_build_url($url);
             } else {
                 $new_url = '';
                 if (isset($url['scheme'])) {
                     $new_url .= $url['scheme'] . '://';
                 }
                 if (isset($url['user'])) {
                     $new_url .= $url['user'];
                     if (isset($url['pass'])) {
                         $new_url .= ':' . $url['pass'];
                     }
                     $new_url .= '@';
                 }
                 if (isset($url['host'])) {
                     // Convert IDN hosts to ASCII.
                     if (function_exists('idn_to_ascii')) {
                         $url['host'] = @idn_to_ascii($url['host']);
                     } elseif (Horde_Mime::is8bit($url['host'])) {
                         //throw new Kronolith_Exception(_("Invalid character in URL."));
                         $url['host'] = '';
                     }
                     $new_url .= $url['host'];
                 }
                 if (isset($url['path'])) {
                     $new_url .= $url['path'];
                 }
                 if (isset($url['query'])) {
                     $new_url .= '?' . $url['query'];
                 }
                 if (isset($url['fragment'])) {
                     $new_url .= '#' . $url['fragment'];
                 }
                 $url = $new_url;
             }
         }
     }
     $this->url = $url;
     // Status.
     $this->status = Horde_Util::getFormData('status', $this->status);
     // Attendees.
     $attendees = $session->get('kronolith', 'attendees', Horde_Session::TYPE_ARRAY);
     if (!is_null($newattendees = Horde_Util::getFormData('attendees'))) {
         $newattendees = Kronolith::parseAttendees(trim($newattendees));
         foreach ($newattendees as $email => $attendee) {
             if (!isset($attendees[$email])) {
                 $attendees[$email] = $attendee;
             }
         }
         foreach (array_keys($attendees) as $email) {
             if (!isset($newattendees[$email])) {
                 unset($attendees[$email]);
             }
         }
     }
     $this->attendees = $attendees;
     // Event start.
     $allDay = Horde_Util::getFormData('whole_day');
     if ($start_date = Horde_Util::getFormData('start_date')) {
         // From ajax interface.
         $this->start = Kronolith::parseDate($start_date . ' ' . Horde_Util::getFormData('start_time'), true, $this->timezone);
         if ($allDay) {
             $this->start->hour = $this->start->min = $this->start->sec = 0;
         }
     } else {
         // From traditional interface.
         $start = Horde_Util::getFormData('start');
         $start_year = $start['year'];
         $start_month = $start['month'];
         $start_day = $start['day'];
         $start_hour = Horde_Util::getFormData('start_hour');
         $start_min = Horde_Util::getFormData('start_min');
         $am_pm = Horde_Util::getFormData('am_pm');
         if (!$prefs->getValue('twentyFour')) {
             if ($am_pm == 'PM') {
//.........这里部分代码省略.........
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:101,代码来源:Event.php

示例3: switch

$editAttendee = null;
// Get the action ID and value. This specifies what action the user initiated.
$actionID = Horde_Util::getFormData('actionID');
if (Horde_Util::getFormData('clearAll')) {
    $actionID = 'clear';
}
$actionValue = Horde_Util::getFormData('actionValue');
// Perform the specified action, if there is one.
switch ($actionID) {
    case 'add':
        // Add new attendees and/or resources. Multiple attendees can be seperated
        // on a single line by whitespace and/or commas. Resources are added one
        // at a time (at least for now).
        $newAttendees = trim(Horde_Util::getFormData('newAttendees'));
        $newResource = trim(Horde_Util::getFormData('resourceselect'));
        $newAttendees = Kronolith::parseAttendees($newAttendees);
        if ($newAttendees) {
            $session->set('kronolith', 'attendees', $attendees + $newAttendees);
        }
        // Any new resources?
        if (!empty($newResource)) {
            /* Get the requested resource */
            $resource = Kronolith::getDriver('Resource')->getResource($newResource);
            /* Do our best to see what the response will be. Note that this response
             * is only guarenteed once the event is saved. */
            $date = new Horde_Date(Horde_Util::getFormData('startdate'));
            $end = new Horde_Date(Horde_Util::getFormData('enddate'));
            $response = $resource->getResponse(array('start' => $date, 'end' => $end));
            $resources[$resource->getId()] = array('attendance' => Kronolith::PART_REQUIRED, 'response' => $response, 'name' => $resource->get('name'));
            $session->set('kronolith', 'resources', $resources);
        }
开发者ID:raz0rsdge,项目名称:horde,代码行数:31,代码来源:attendees.php


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