本文整理汇总了PHP中calendar::delete_view方法的典型用法代码示例。如果您正苦于以下问题:PHP calendar::delete_view方法的具体用法?PHP calendar::delete_view怎么用?PHP calendar::delete_view使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类calendar
的用法示例。
在下文中一共展示了calendar::delete_view方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calendar
$GO_MODULES->authenticate('calendar');
require $GO_LANGUAGE->get_language_file('calendar');
require $GO_MODULES->path . 'classes/calendar.class.inc';
$cal = new calendar();
$post_action = isset($_REQUEST['post_action']) ? $_REQUEST['post_action'] : '';
$task = isset($_POST['task']) ? $_POST['task'] : '';
$return_to = isset($_REQUEST['return_to']) ? $_REQUEST['return_to'] : $_SERVER['HTTP_REFERER'];
$link_back = isset($_REQUEST['link_back']) ? $_REQUEST['link_back'] : $_SERVER['REQUEST_URI'];
$view_type = isset($_REQUEST['view_type']) ? $_REQUEST['view_type'] : 0;
$calendar_id = isset($_REQUEST['calendar_id']) ? $_REQUEST['calendar_id'] : 0;
$db = new db();
switch ($task) {
case 'delete_view':
$view = $cal->get_view($_POST['delete_view_id']);
if ($GO_SECURITY->user_id == $view['user_id']) {
if (isset($_POST['delete_view_id']) && $cal->delete_view($_POST['delete_view_id'])) {
$GO_SECURITY->delete_acl($view['acl_write']);
$GO_SECURITY->delete_acl($view['acl_read']);
}
}
$db->query("SELECT view_id FROM cal_view_subscriptions WHERE user_id='" . $GO_SECURITY->user_id . "'");
while ($db->next_record()) {
$subscribed[] = $db->f('view_id');
}
break;
case 'subscribe':
$db->query("DELETE FROM cal_view_subscriptions WHERE user_id='" . $GO_SECURITY->user_id . "'");
$subscribed = $_REQUEST['subscribed'];
for ($i = 0; $i < sizeof($subscribed); $i++) {
$db->query("INSERT INTO cal_view_subscriptions VALUES ('" . $GO_SECURITY->user_id . "','" . $subscribed[$i] . "')");
}
示例2: calendar
$GO_MODULES->authenticate('calendar');
require $GO_LANGUAGE->get_language_file('calendar');
require $GO_MODULES->path . 'classes/calendar.class.inc';
$cal = new calendar();
$post_action = isset($_REQUEST['post_action']) ? $_REQUEST['post_action'] : '';
$task = isset($_POST['task']) ? $_POST['task'] : '';
$return_to = isset($_REQUEST['return_to']) ? $_REQUEST['return_to'] : $_SERVER['HTTP_REFERER'];
$link_back = isset($_REQUEST['link_back']) ? $_REQUEST['link_back'] : $_SERVER['REQUEST_URI'];
$view_type = isset($_REQUEST['view_type']) ? $_REQUEST['view_type'] : 0;
$calendar_id = isset($_REQUEST['calendar_id']) ? $_REQUEST['calendar_id'] : 0;
$db = new db();
switch ($task) {
case 'delete_view':
$view = $cal->get_view($_POST['delete_view_id']);
if ($GO_SECURITY->user_id == $view['user_id']) {
if ($cal->delete_view($_POST['delete_cview_id'])) {
$GO_SECURITY->delete_acl($view['acl_write']);
$GO_SECURITY->delete_acl($view['acl_read']);
}
}
$db->query('SELECT view_id FROM cal_view_subscriptions WHERE user_id="' . $GO_SECURITY->user_id . '"');
while ($db->next_record()) {
$subscribed[] = $db->f('view_id');
}
break;
case 'subscribe':
$db->query('DELETE FROM cal_view_subscriptions WHERE user_id="' . $GO_SECURITY->user_id . '"');
$subscribed = $_REQUEST['subscribed'];
for ($i = 0; $i < sizeof($subscribed); $i++) {
$db->query('INSERT INTO cal_view_subscriptions VALUES ("' . $GO_SECURITY->user_id . '","' . $subscribed[$i] . '")');
}