10 // Load Elgg framework
11 @require_once
("../../includes.php");
13 // We need to be logged on for this!
18 define("context","dashboard");
20 // Load global variables
21 global $CFG, $PAGE, $db, $page_owner, $messages;
24 $ident = optional_param('widget',PARAM_INT
,0);
25 $ident = $db->qstr($ident);
26 $widget = get_record_sql("select * from ".$CFG->prefix
."dashboard_widgets where ident = $ident");
28 // Get moving instructions
29 $move = optional_param('move');
31 // Page owner = where the widget resides
32 $page_owner = $widget->owner
;
34 // Do we have permission to touch this?
36 if (run("permissions:check","profile")) {
39 adash_widget_moveup($widget);
40 } else if ($move == "down") {
41 adash_widget_movedown($widget);
46 // Get the username of the widget owner
47 $username = user_info("username",$widget->owner
);
50 $messages[] = __gettext("Widget moved.");
51 $_SESSION['messages'] = $messages;
53 // Redirect back to the dashboard
54 header("Location: " . $CFG->wwwroot
. $username . "/dashboard/");