本文整理匯總了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;
}
}