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()); } }
/** * 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); }
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"])); }