本文整理汇总了PHP中Json::v方法的典型用法代码示例。如果您正苦于以下问题:PHP Json::v方法的具体用法?PHP Json::v怎么用?PHP Json::v使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Json
的用法示例。
在下文中一共展示了Json::v方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handler_group_ajax_admin_users
function handler_group_ajax_admin_users($page)
{
$group = Group::fromId(Json::i('gid'));
$limit = 10;
$total = 0;
$users = false;
if ($group) {
$users = array();
$order = new UFO_Name(UFO_Name::LASTNAME);
$filters = array();
$rights = Rights::everybody();
if (Json::s('rights', '') != '') {
$rights = new Rights(Json::s('rights'));
}
$filters[] = new UFC_Group($group, $rights);
if (Json::t('promo', '') != '') {
$filters[] = new UFC_Group(explode(';', Json::v('promo')));
}
if (Json::t('name', '') != '') {
$filters[] = new UFC_Name(Json::t('name'), UFC_Name::LASTNAME | UFC_Name::FIRSTNAME | UFC_Name::NICKNAME, UFC_Name::CONTAINS);
}
$uf = new UserFilter(new PFC_And($filters), $order);
$users = $uf->get(new PlLimit($limit, (Json::i('page', 1) - 1) * $limit));
$total = $uf->getTotalCount();
$export = array();
if ($users->count() > 0) {
$users->select(UserSelect::base());
/*
* Fetching rights
*/
$users_rights = $group->selectRights($users);
/*
* Fetching comments
*/
$users_comments = array();
$iter = XDB::iterRow('SELECT uid, comment
FROM users_comments
WHERE gid = {?} AND uid IN {?}', $group->id(), $users->ids());
while (list($uid, $comment) = $iter->next()) {
$users_comments[$uid] = $comment;
}
/*
* Exporting
*/
$page->assign('defaultrights', array(Rights::admin(), Rights::member(), Rights::friend()));
foreach ($users as $uid => $u) {
$page->assign('user', $u);
$page->assign('rights', empty($users_rights[$uid]) ? array() : $users_rights[$uid]);
$page->assign('comment', empty($users_comments[$uid]) ? "" : $users_comments[$uid]);
$export[$uid] = $page->filteredFetch(FrankizPage::getTplPath('groups/admin_user.tpl'));
}
}
}
$page->jsonAssign('limit', $limit);
$page->jsonAssign('total', $total);
$page->jsonAssign('users', $export);
return PL_JSON;
}
示例2: handler_ajax_minimodules_layout
function handler_ajax_minimodules_layout($page)
{
$layout = FrankizMiniModule::emptyLayout();
foreach (array_keys($layout) as $col) {
if (Json::has($col)) {
$layout[$col] = Json::v($col);
}
}
if (!S::user()->layoutMinimodules($layout)) {
$page->jsonAssign('error', "Le réagencement des minimodules n'a pas pu se faire");
}
return PL_JSON;
}