本文整理汇总了PHP中Calendar::saveCalendar方法的典型用法代码示例。如果您正苦于以下问题:PHP Calendar::saveCalendar方法的具体用法?PHP Calendar::saveCalendar怎么用?PHP Calendar::saveCalendar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Calendar
的用法示例。
在下文中一共展示了Calendar::saveCalendar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveCalendar
function saveCalendar()
{
global $error;
global $obj_smarty;
$arr_submit = array(array('calendar_id', 'int', false, -1), array('name', 'string', true, ''), array('dditems', 'string', true, ''), array('calendar_color', 'string', true, ''), array('can_add', 'bool', false, 0), array('can_edit', 'bool', false, 0), array('can_delete', 'bool', false, 0), array('can_change_color', 'bool', false, 0), array('checkbox_use_color_for_all_events', 'bool', false, 0), array('initial_show', 'bool', false, 0), array('share_type', 'string', true, 'private_group'), array('active', 'bool', false, 0));
$frm_submitted = validate_var($arr_submit);
if (!$error) {
$bln_success = Calendar::saveCalendar($frm_submitted);
if (is_string($bln_success)) {
echo json_encode(array('success' => false, 'error' => $bln_success));
exit;
}
} else {
$obj_smarty->assign('error', $error);
}
header('location: ' . FULLCAL_URL . '/user/calendars/public');
exit;
}
示例2: saveCalendar
function saveCalendar()
{
global $error;
global $obj_smarty;
$arr_submit = array(array('calendar_id', 'int', false, -1), array('name', 'string', true, ''), array('dditems', 'string', false, ''), array('calendar_color', 'string', true, ''), array('can_add', 'bool', false, 0), array('can_edit', 'bool', false, 0), array('can_delete', 'bool', false, 0), array('can_change_color', 'bool', false, 0), array('checkbox_use_color_for_all_events', 'bool', false, 0), array('initial_show', 'bool', false, 0), array('share_type', 'string', false, 'private'), array('active', 'string', true, ''), array('cal_startdate', 'string', false, ''), array('cal_enddate', 'string', false, ''), array('alterable_startdate', 'string', false, ''), array('alterable_enddate', 'string', false, ''));
$frm_submitted = validate_var($arr_submit);
if (!$error) {
$bln_success = Calendar::saveCalendar($frm_submitted);
if (is_string($bln_success)) {
echo json_encode(array('success' => false, 'save_calendar_error' => $bln_success));
exit;
}
} else {
$obj_smarty->assign('save_calendar_error', $error);
}
if (!is_null($error) && $error !== false) {
// give feedback about the error
$arr_calendar = Calendar::getCalendar($frm_submitted['calendar_id'], true);
$obj_smarty->assign('active', 'calendar');
$obj_smarty->assign('calendar', $arr_calendar);
$obj_smarty->display(FULLCAL_DIR . '/view/user_panel.tpl');
exit;
} else {
header('location: ' . FULLCAL_URL . '/user/calendars');
exit;
}
}
示例3: saveCalendar
function saveCalendar()
{
global $error;
global $obj_smarty;
$arr_submit = array(array('calendar_id', 'int', false, -1), array('name', 'string', true, ''), array('dditems', 'string', false, ''), array('calendar_color', 'string', true, ''), array('can_add', 'bool', false, 0), array('can_edit', 'bool', false, 0), array('can_delete', 'bool', false, 0), array('can_change_color', 'bool', false, 0), array('can_dd_drag', 'string', false, ''), array('checkbox_use_color_for_all_events', 'bool', false, 0), array('initial_show', 'bool', false, 0), array('users_can_email_event', 'bool', false, 0), array('all_event_mods_to_admin', 'bool', false, 0), array('active', 'string', true, ''), array('cal_startdate', 'string', false, ''), array('cal_enddate', 'string', false, ''), array('alterable_startdate', 'string', false, ''), array('alterable_enddate', 'string', false, ''), array('share_type', 'string', true, 'private_group'), array('calendar_admin_email', 'email', false, ''));
$frm_submitted = validate_var($arr_submit);
//if(User::isAdminUser($frm_submitted['user_id'])) {
if (!$error || is_null($error)) {
$bln_success = Calendar::saveCalendar($frm_submitted);
if (is_string($bln_success)) {
echo json_encode(array('success' => false, 'save_calendar_error' => $bln_success));
exit;
}
} else {
$obj_smarty->assign('save_calendar_error', $error);
}
//} else {
// $obj_smarty->assign('error', 'NO rights to change this user');
//}
if (!is_null($error) && $error !== false) {
// give feedback about the error
$arr_calendar = Calendar::getCalendar($frm_submitted['calendar_id'], true);
//$arr_birthdate = explode('-', $arr_calendar['birth_date']);
$obj_smarty->assign('active', 'calendar');
$obj_smarty->assign('calendar', $arr_calendar);
$obj_smarty->display(FULLCAL_DIR . '/view/admin_panel.tpl');
exit;
} else {
header('location: ' . FULLCAL_URL . '/admin/calendars');
exit;
}
}