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


PHP CEvent::canCreate方法代码示例

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


在下文中一共展示了CEvent::canCreate方法的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::canCreate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。