本文整理汇总了PHP中Dashboard::get_from_alias方法的典型用法代码示例。如果您正苦于以下问题:PHP Dashboard::get_from_alias方法的具体用法?PHP Dashboard::get_from_alias怎么用?PHP Dashboard::get_from_alias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dashboard
的用法示例。
在下文中一共展示了Dashboard::get_from_alias方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dashboard_controller
function dashboard_controller()
{
global $mysqli, $session, $route;
require "Modules/dashboard/dashboard_model.php";
$dashboard = new Dashboard($mysqli);
// id, userid, content, height, name, alias, description, main, public, published, showdescription
$result = false;
$submenu = '';
if ($route->format == 'html') {
if ($route->action == "list" && $session['write']) {
$result = view("Modules/dashboard/Views/dashboard_list.php", array());
} else {
if ($route->action == "view") {
$dashid = (int) get('id');
if ($dashid) {
$dash = $dashboard->get($dashid);
} else {
if ($session['read']) {
if ($route->subaction) {
$dash = $dashboard->get_from_alias($session['userid'], $route->subaction);
} else {
$dash = $dashboard->get_main($session['userid']);
}
}
}
if (isset($dash)) {
if ($dash['public'] || $session['read'] && $session['userid'] > 0 && $dash['userid'] == $session['userid'] && !isset($session['profile'])) {
if (!$session['userid']) {
$session['userid'] = $dash['userid'];
}
// Required for passing userid to feed api
$result = view("Modules/dashboard/Views/dashboard_view.php", array('dashboard' => $dash));
} else {
if ($session['read'] && !isset($session['profile'])) {
$result = view("Modules/dashboard/Views/dashboard_list.php", array());
}
}
}
if ($session['write']) {
$submenu = view("Modules/dashboard/Views/dashboard_menu.php", array('id' => $dash['id'], 'type' => "view"));
}
} else {
if ($route->action == "edit" && $session['write']) {
if ($route->subaction) {
$dash = $dashboard->get_from_alias($session['userid'], $route->subaction);
} elseif (isset($_GET['id'])) {
$dash = $dashboard->get(get('id'));
}
$result = view("Modules/dashboard/Views/dashboard_edit_view.php", array('dashboard' => $dash));
$result .= view("Modules/dashboard/Views/dashboard_config.php", array('dashboard' => $dash));
$submenu = view("Modules/dashboard/Views/dashboard_menu.php", array('id' => $dash['id'], 'type' => "edit"));
}
}
}
} else {
if ($route->format == 'json') {
if ($session['write']) {
if ($route->action == 'list') {
$result = $dashboard->get_list($session['userid'], false, false);
} else {
if ($route->action == 'set') {
$result = $dashboard->set($session['userid'], get('id'), get('fields'));
} else {
if ($route->action == 'setcontent') {
$result = $dashboard->set_content($session['userid'], post('id'), post('content'), post('height'));
} else {
if ($route->action == 'create') {
$result = $dashboard->create($session['userid']);
} else {
if ($route->action == 'delete') {
$result = $dashboard->delete(get('id'));
} else {
if ($route->action == 'clone') {
$result = $dashboard->dashclone($session['userid'], get('id'));
}
}
}
}
}
}
}
}
}
return array('content' => $result, 'submenu' => $submenu);
}
示例2: dashboard_controller
function dashboard_controller()
{
global $mysqli, $path, $session, $route, $user;
require "Modules/dashboard/dashboard_model.php";
$dashboard = new Dashboard($mysqli);
// id, userid, content, height, name, alias, description, main, public, published, showdescription
$result = false;
$submenu = '';
if ($route->format == 'html') {
if ($route->action == "list" && $session['write']) {
$result = view("Modules/dashboard/Views/dashboard_list.php", array());
$menu = $dashboard->build_menu($session['userid'], "view");
$submenu = view("Modules/dashboard/Views/dashboard_menu.php", array('menu' => $menu, 'type' => "view"));
}
if ($route->action == "view" && $session['read']) {
if ($route->subaction) {
$dash = $dashboard->get_from_alias($session['userid'], $route->subaction, false, false);
} elseif (isset($_GET['id'])) {
$dash = $dashboard->get($session['userid'], get('id'), false, false);
} else {
$dash = $dashboard->get_main($session['userid']);
}
if ($dash) {
$result = view("Modules/dashboard/Views/dashboard_view.php", array('dashboard' => $dash));
} else {
$result = view("Modules/dashboard/Views/dashboard_list.php", array());
}
$menu = $dashboard->build_menu($session['userid'], "view");
$submenu = view("Modules/dashboard/Views/dashboard_menu.php", array('id' => $dash['id'], 'menu' => $menu, 'type' => "view"));
}
if ($route->action == "edit" && $session['write']) {
if ($route->subaction) {
$dash = $dashboard->get_from_alias($session['userid'], $route->subaction, false, false);
} elseif (isset($_GET['id'])) {
$dash = $dashboard->get($session['userid'], get('id'), false, false);
}
$result = view("Modules/dashboard/Views/dashboard_edit_view.php", array('dashboard' => $dash));
$result .= view("Modules/dashboard/Views/dashboard_config.php", array('dashboard' => $dash));
$menu = $dashboard->build_menu($session['userid'], "edit");
$submenu = view("Modules/dashboard/Views/dashboard_menu.php", array('id' => $dash['id'], 'menu' => $menu, 'type' => "edit"));
}
}
if ($route->format == 'json') {
if ($route->action == 'list' && $session['write']) {
$result = $dashboard->get_list($session['userid'], false, false);
}
if ($route->action == 'set' && $session['write']) {
$result = $dashboard->set($session['userid'], get('id'), get('fields'));
}
if ($route->action == 'setcontent' && $session['write']) {
$result = $dashboard->set_content($session['userid'], post('id'), post('content'), post('height'));
}
if ($route->action == 'delete' && $session['write']) {
$result = $dashboard->delete(get('id'));
}
if ($route->action == 'create' && $session['write']) {
$result = $dashboard->create($session['userid']);
}
if ($route->action == 'clone' && $session['write']) {
$result = $dashboard->dashclone($session['userid'], get('id'));
}
}
// $result = $dashboard->get_main($session['userid'])
return array('content' => $result, 'submenu' => $submenu);
}