當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CEvent::canAddEdit方法代碼示例

本文整理匯總了PHP中CEvent::canAddEdit方法的典型用法代碼示例。如果您正苦於以下問題:PHP CEvent::canAddEdit方法的具體用法?PHP CEvent::canAddEdit怎麽用?PHP CEvent::canAddEdit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CEvent的用法示例。


在下文中一共展示了CEvent::canAddEdit方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: die

<?php

/* $Id$ $URL$ */
if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
global $AppUI, $cal_sdf;
$AppUI->loadCalendarJS();
$event_id = intval(w2PgetParam($_GET, 'event_id', 0));
$is_clash = isset($_SESSION['event_is_clash']) ? $_SESSION['event_is_clash'] : false;
$obj = new CEvent();
$obj->event_id = $event_id;
$canAddEdit = $obj->canAddEdit();
$canAuthor = $obj->canCreate();
$canEdit = $obj->canEdit();
if (!$canAddEdit) {
    $AppUI->redirect(ACCESS_DENIED);
}
// get the passed timestamp (today if none)
$date = w2PgetParam($_GET, 'date', null);
// get the passed timestamp (today if none)
$event_project = (int) w2PgetParam($_GET, 'event_project', 0);
// load the record data
if ($is_clash) {
    $obj->bind($_SESSION['add_event_post']);
} else {
    if (!$obj->load($event_id) && $event_id) {
        $AppUI->setMsg('Event');
        $AppUI->setMsg('invalidID', UI_MSG_ERROR, true);
        $AppUI->redirect();
    }
開發者ID:caseysoftware,項目名稱:web2project-planner,代碼行數:31,代碼來源:addedit.php

示例2: die

<?php

if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
// @todo    convert to template
$object_id = intval(w2PgetParam($_GET, 'event_id', 0));
$object = new CEvent();
$object->setId($object_id);
$canAddEdit = $object->canAddEdit();
$canAuthor = $object->canCreate();
$canEdit = $object->canEdit();
if (!$canAddEdit) {
    $AppUI->redirect(ACCESS_DENIED);
}
global $AppUI, $cal_sdf;
$AppUI->getTheme()->loadCalendarJS();
// get the passed timestamp (today if none)
$date = w2PgetParam($_GET, 'date', null);
// get the passed timestamp (today if none)
$event_project = (int) w2PgetParam($_GET, 'project_id', 0);
$obj = $AppUI->restoreObject();
if ($obj) {
    $object = $obj;
    $object_id = $object->getId();
} else {
    $object->load($object_id);
}
// load the record data
if (!$object && $object_id > 0) {
    $AppUI->setMsg('Event');
開發者ID:illuminate3,項目名稱:web2project,代碼行數:31,代碼來源:addedit.php


注:本文中的CEvent::canAddEdit方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。