本文整理汇总了PHP中JSON::has方法的典型用法代码示例。如果您正苦于以下问题:PHP JSON::has方法的具体用法?PHP JSON::has怎么用?PHP JSON::has使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSON
的用法示例。
在下文中一共展示了JSON::has方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handler_ajax_get
function handler_ajax_get($page)
{
$json = json_decode(Env::v('json'));
if (isset($json->date)) {
$date = new FrankizDateTime($json->date);
$date->setTime(0, 0);
$date_n = new FrankizDateTime($json->date);
date_add($date_n, date_interval_create_from_date_string('1 day'));
$date_n->setTime(0, 0);
$activities = new ActivityInstanceFilter(new PFC_And(new PFC_Or(new AIFC_User(S::user(), 'restricted'), new AIFC_User(S::user(), 'everybody')), new AIFC_Period($date, $date_n)));
$c = $activities->get();
$c->select(ActivityInstanceSelect::all());
$c->order('hour_begin', false);
$result = array();
foreach ($c as $a) {
$page->assign('day', $date);
$page->assign('activity', $a);
$result[] = $page->fetch(FrankizPage::getTplPath('minimodules/activity/single.tpl'));
}
$page->jsonAssign('success', true);
$page->jsonAssign('activities', $result);
} else {
if (isset($json->ids)) {
$activities = new ActivityInstanceFilter(new PFC_AND(new AIFC_CanBeSeen(S::user()), new AIFC_Id($json->ids)));
$act = $activities->get();
$act->select(ActivityInstanceSelect::all());
$activities = array();
foreach ($act as $a) {
$activities[$a->id()] = $a->export();
}
$page->jsonAssign('success', true);
$page->jsonAssign('activities', $activities);
} else {
if (JSON::has('list')) {
if (JSON::t('visibility') == 'all') {
$activities = new ActivityInstanceFilter(new PFC_AND(new AIFC_CanBeSeen(S::user()), new AIFC_END(new FrankizDateTime(), AIFC_End::AFTER)));
} elseif (JSON::t('visibility') == 'participate') {
$activities = new ActivityInstanceFilter(new PFC_AND(new AIFC_Participants(S::user()), new AIFC_END(new FrankizDateTime(), AIFC_End::AFTER)));
} else {
$activities = new ActivityInstanceFilter(new PFC_Or(new PFC_And(new AIFC_END(new FrankizDateTime(), AIFC_End::AFTER), new AIFC_User(S::user(), 'restricted')), new PFC_And(new AIFC_END(new FrankizDateTime(), AIFC_End::AFTER), new AIFC_User(S::user(), 'everybody'))));
}
$c = $activities->get();
$c->select(ActivityInstanceSelect::all());
$c->order('hour_begin');
$split = $c->split('date');
ksort($split);
$page->assign('activities', $split);
$page->assign('user', S::user());
$page->assign('visibility', JSON::v('visibility'));
$page->jsonAssign('activities', $page->fetch(FrankizPage::getTplPath('activity/activities_list.tpl')));
$page->jsonAssign('success', true);
}
}
}
return PL_JSON;
}