示例#1
0
function intSetGroupInfo(&$smarty, $group_name)
{
    $group_info_req = new GetGroupInfo($group_name);
    list($success, $group_info) = $group_info_req->send();
    if ($success) {
        $smarty->assign_array($group_info);
        $smarty->assign("group_attrs", parseAttrs($smarty, $group_info["attrs"]));
    } else {
        $smarty->set_page_error($group_info->getErrorMsgs());
    }
}
示例#2
0
/**
 * Get Body Attributes
 *
 * @return  string
 */
function bodyAttrs($class = null)
{
    $attrs = ['id' => 'home', 'class' => 'halaman'];
    $classes = [];
    if ($segments = app('uri')->segments()) {
        $attrs['id'] = implode('-', $segments);
        foreach ($segments as $segment => $path) {
            $prev = ($tmp = $segment - 1) > 0 ? $tmp : 0;
            if ($segment > $prev) {
                $classes[$segment] = $classes[$prev] . '-' . $segments[$segment];
            } else {
                $classes[$segment] = $segments[$segment];
            }
        }
    }
    if ($class !== null) {
        if (is_string($class)) {
            $class = explode(' ', $class);
        }
        $classes += $class;
    }
    $attrs['class'] .= ' ' . implode(' ', array_unique($classes));
    echo parseAttrs($attrs);
}
示例#3
0
function intSetSingleUserInfoIntoSmarty(&$smarty, $user_info)
{
    $smarty->assign("user_id", $user_info["basic_info"]["user_id"]);
    $smarty->assign("user_info", $user_info);
    $smarty->assign("user_attrs", parseAttrs($smarty, $user_info["attrs"]));
}