2 /************************************************************************/
\r
4 /************************************************************************/
\r
5 /* Copyright (c) 2002 - 2009 */
\r
6 /* Adaptive Technology Resource Centre / University of Toronto */
\r
8 /* This program is free software. You can redistribute it and/or */
\r
9 /* modify it under the terms of the GNU General Public License */
\r
10 /* as published by the Free Software Foundation. */
\r
11 /************************************************************************/
\r
13 define('AT_INCLUDE_PATH', '../../../include/');
\r
14 require (AT_INCLUDE_PATH.'vitals.inc.php');
\r
16 $fha_student_tools = array();
\r
18 $sql = "SELECT links FROM ".TABLE_PREFIX."fha_student_tools WHERE course_id=$_SESSION[course_id]";
\r
19 $result = mysql_query($sql, $db);
\r
20 if ($row = mysql_fetch_assoc($result)) {
\r
21 $fha_student_tools = explode('|', $row['links']);
\r
24 if($fha_student_tools[0] == "" ){
\r
25 $msg->addInfo('NO_TOOLS_FOUND');
\r
28 $sql = "SELECT home_view FROM ".TABLE_PREFIX."fha_student_tools WHERE course_id = $_SESSION[course_id]";
\r
29 $result = mysql_query($sql,$db);
\r
30 $row= mysql_fetch_assoc($result);
\r
31 $home_view = $row['home_view'];
\r
33 // Enable drag and drop to reorder displayed modules when the module view mode is
\r
34 // set to "detail view" and user role is instructor
\r
35 if ($home_view == 1 && authenticate(AT_PRIV_ADMIN,AT_PRIV_RETURN))
\r
38 <link rel="stylesheet" type="text/css" href="'.AT_BASE_HREF.'jscripts/infusion/framework/fss/css/fss-layout.css" />
\r
39 <link rel="stylesheet" type="text/css" href="'.AT_BASE_HREF.'jscripts/infusion/framework/fss/css/fss-text.css" />
\r
40 <link rel="stylesheet" type="text/css" href="'.AT_BASE_HREF.'jscripts/infusion/framework/fss/css/fss-theme-mist.css" />
\r
41 <link rel="stylesheet" type="text/css" href="'.AT_BASE_HREF.'jscripts/infusion/framework/fss/css/fss-theme-hc.css" />
\r
42 <link rel="stylesheet" type="text/css" href="'.AT_BASE_HREF.'jscripts/infusion/components/reorderer/css/Reorderer.css" />
\r
44 <script type="text/javascript">
\r
45 jQuery(document).ready(function () {
\r
46 var reorder_example_grid = fluid.reorderGrid("#details_view", {
\r
48 movables : ".home_box"
\r
51 afterMove: function (item, requestedPosition, movables) {
\r
52 //save the state to the db
\r
53 var myDivs = jQuery ("div[class^=home_box]", "#details_view");
\r
54 var moved_modules = "";
\r
56 if (myDivs.constructor.toString().indexOf("Array")) // myDivs is an array
\r
58 for (i=0; i<myDivs.length; i++)
\r
59 moved_modules += myDivs[i].id+"|";
\r
61 moved_modules = moved_modules.substring(0, moved_modules.length-1); // remove the last "|"
\r
63 if (moved_modules != "")
\r
64 jQuery.post("'.AT_BASE_HREF.'move_module.php", { "moved_modules":moved_modules, "from":"student_tools" }, function(data) {});
\r
68 selected: "draggable_selected",
\r
69 hover: "draggable_selected"
\r
75 function remove_module(module)
\r
77 jQuery.post("'.AT_BASE_HREF.'move_module.php", { "remove":module, "from":"student_tools" }, function(data) {});
\r
78 $("div[id="+module+"]").slideUp("slow");
\r
86 require (AT_INCLUDE_PATH.'header.inc.php');
\r
88 $home_links = array();
\r
90 if($fha_student_tools[0] != "" ){
\r
91 //query reading the type of home viewable. 0: icon view 1: detail view
\r
93 $savant->assign('view_mode', $home_view);
\r
94 $savant->assign('home_links', get_home_navigation($fha_student_tools));
\r
97 $savant->assign('num_pages', 0);
\r
98 $savant->assign('current_page', 0);
\r
99 $savant->display('index.tmpl.php');
\r
104 <?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>