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


PHP OC_Calendar_Calendar::findCalendar方法代码示例

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


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

示例1:

<?php

/**
 * Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */
require_once '../../lib/base.php';
OC_JSON::checkLoggedIn();
OC_Util::checkAppEnabled('calendar');
if ($_GET["import"] == "existing") {
    $calid = $_GET["calid"];
    $calendar = OC_Calendar_Calendar::findCalendar($calid);
    if ($calendar['userid'] != OC_User::getUser()) {
        OC_JSON::error();
        exit;
    }
    if ($_GET["path"] != "") {
        $filename = $_GET["path"] . "/" . $_GET["file"];
    } else {
        $filename = "/" . $_GET["file"];
    }
} else {
    $id = OC_Calendar_Calendar::addCalendar(OC_User::getUser(), $_POST['calname']);
    OC_Calendar_Calendar::setCalendarActive($id, 1);
    $calid = $id;
    if ($_POST["path"] != "") {
        $filename = $_POST["path"] . "/" . $_POST["file"];
    } else {
        $filename = "/" . $_POST["file"];
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:31,代码来源:owncloud_apps_calendar_import.php

示例2: OC_L10N

 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */
require_once '../../../lib/base.php';
$l10n = new OC_L10N('calendar');
if (!OC_USER::isLoggedIn()) {
    die('<script type="text/javascript">document.location = oc_webroot;</script>');
}
OC_JSON::checkAppEnabled('calendar');
$calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
$category_options = OC_Calendar_Object::getCategoryOptions($l10n);
$repeat_options = OC_Calendar_Object::getRepeatOptions($l10n);
$id = $_GET['id'];
$data = OC_Calendar_Object::find($id);
$calendar = OC_Calendar_Calendar::findCalendar($data['calendarid']);
if ($calendar['userid'] != OC_User::getUser()) {
    echo $l10n->t('Wrong calendar');
    exit;
}
$object = Sabre_VObject_Reader::read($data['calendardata']);
$vevent = $object->VEVENT;
$dtstart = $vevent->DTSTART;
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
switch ($dtstart->getDateType()) {
    case Sabre_VObject_Element_DateTime::LOCALTZ:
    case Sabre_VObject_Element_DateTime::LOCAL:
        $startdate = $dtstart->getDateTime()->format('d-m-Y');
        $starttime = $dtstart->getDateTime()->format('H:i');
        $enddate = $dtend->getDateTime()->format('d-m-Y');
        $endtime = $dtend->getDateTime()->format('H:i');
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:31,代码来源:owncloud_apps_calendar_ajax_editeventform.php

示例3: OC_L10N

<?php

/**
 * Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */
require_once '../../../lib/base.php';
$l10n = new OC_L10N('calendar');
if (!OC_USER::isLoggedIn()) {
    die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
}
$calendarcolor_options = array('ff0000', '00ff00', 'ffff00', '808000', 'ffa500', 'ff7f50', 'ee82ee', 'ecc255');
OC_JSON::checkAppEnabled('calendar');
$calendar = OC_Calendar_Calendar::findCalendar($_GET['calendarid']);
$tmpl = new OC_Template("calendar", "part.editcalendar");
$tmpl->assign('new', false);
$tmpl->assign('calendarcolor_options', $calendarcolor_options);
$tmpl->assign('calendar', $calendar);
$tmpl->printPage();
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:21,代码来源:owncloud_apps_calendar_ajax_editcalendar.php

示例4: validateRequest

 public static function validateRequest($request)
 {
     $errnum = 0;
     $errarr = array('title' => 'false', 'cal' => 'false', 'from' => 'false', 'fromtime' => 'false', 'to' => 'false', 'totime' => 'false', 'endbeforestart' => 'false');
     if ($request['title'] == '') {
         $errarr['title'] = 'true';
         $errnum++;
     }
     $calendar = OC_Calendar_Calendar::findCalendar($request['calendar']);
     if ($calendar['userid'] != OC_User::getUser()) {
         $errarr['cal'] = 'true';
         $errnum++;
     }
     if (isset($request['categories']) && !is_array($request['categories'])) {
         $errors['categories'] = $l10n->t('Not an array');
     }
     $fromday = substr($request['from'], 0, 2);
     $frommonth = substr($request['from'], 3, 2);
     $fromyear = substr($request['from'], 6, 4);
     if (!checkdate($frommonth, $fromday, $fromyear)) {
         $errarr['from'] = 'true';
         $errnum++;
     }
     $allday = isset($request['allday']);
     if (!$allday && self::checkTime(urldecode($request['fromtime']))) {
         $errarr['fromtime'] = 'true';
         $errnum++;
     }
     $today = substr($request['to'], 0, 2);
     $tomonth = substr($request['to'], 3, 2);
     $toyear = substr($request['to'], 6, 4);
     if (!checkdate($tomonth, $today, $toyear)) {
         $errarr['to'] = 'true';
         $errnum++;
     }
     if (!$allday && self::checkTime(urldecode($request['totime']))) {
         $errarr['totime'] = 'true';
         $errnum++;
     }
     if ($today < $fromday && $frommonth == $tomonth && $fromyear == $toyear) {
         $errarr['endbeforestart'] = 'true';
         $errnum++;
     }
     if ($today == $fromday && $frommonth > $tomonth && $fromyear == $toyear) {
         $errarr['endbeforestart'] = 'true';
         $errnum++;
     }
     if ($today == $fromday && $frommonth == $tomonth && $fromyear > $toyear) {
         $errarr['endbeforestart'] = 'true';
         $errnum++;
     }
     if ($fromday == $today && $frommonth == $tomonth && $fromyear == $toyear) {
         list($tohours, $tominutes) = explode(':', $request['totime']);
         list($fromhours, $fromminutes) = explode(':', $request['fromtime']);
         if ($tohours < $fromhours) {
             $errarr['endbeforestart'] = 'true';
             $errnum++;
         }
         if ($tohours == $fromhours && $tominutes < $fromminutes) {
             $errarr['endbeforestart'] = 'true';
             $errnum++;
         }
     }
     if ($errnum) {
         return $errarr;
     }
     return false;
 }
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:68,代码来源:owncloud_apps_calendar_lib_object.php

示例5: die

<?php

/**
 * Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */
require_once "../../../lib/base.php";
if (!OC_USER::isLoggedIn()) {
    die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
}
OC_JSON::checkAppEnabled('calendar');
$calendarid = $_POST['calendarid'];
OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']);
$cal = OC_Calendar_Calendar::findCalendar($calendarid);
echo $cal['active'];
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:17,代码来源:owncloud_apps_calendar_ajax_activation.php


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