@@ -308,11 +308,11 @@ |
||
308 | 308 | //$_SESSION['addedresourceid']=null; |
309 | 309 | // cleaning up the session once again |
310 | 310 | $_SESSION['addedresource'] = null; |
311 | - $_SESSION['addedresourceid'] = null; |
|
312 | - $_SESSION['addedresourceassigned'] = null; |
|
313 | - unset ($_SESSION['addedresource']); |
|
314 | - unset ($_SESSION['addedresourceid']); |
|
315 | - unset ($_SESSION['addedresourceassigned']); |
|
311 | + $_SESSION['addedresourceid'] = null; |
|
312 | + $_SESSION['addedresourceassigned'] = null; |
|
313 | + unset ($_SESSION['addedresource']); |
|
314 | + unset ($_SESSION['addedresourceid']); |
|
315 | + unset ($_SESSION['addedresourceassigned']); |
|
316 | 316 | } |
317 | 317 | } |
318 | 318 |
@@ -458,8 +458,8 @@ |
||
458 | 458 | } else if(param == 'cmi.core.student_name'){ |
459 | 459 | // ---- cmi.core.student_name |
460 | 460 | <?php |
461 | - $who = addslashes($user['complete_name']); |
|
462 | - echo "result='$who';"; |
|
461 | + $who = addslashes($user['complete_name']); |
|
462 | + echo "result='$who';"; |
|
463 | 463 | ?> |
464 | 464 | } else if(param == 'cmi.core.lesson_location'){ |
465 | 465 | // ---- cmi.core.lesson_location |
@@ -320,12 +320,12 @@ discard block |
||
320 | 320 | } |
321 | 321 | } |
322 | 322 | |
323 | - /** |
|
324 | - * Intermediate to import_package only to allow import from local zip files |
|
325 | - * @param string Path to the zip file, from the dokeos sys root |
|
326 | - * @param string Current path (optional) |
|
327 | - * @return string Absolute path to the AICC description files or empty string on error |
|
328 | - */ |
|
323 | + /** |
|
324 | + * Intermediate to import_package only to allow import from local zip files |
|
325 | + * @param string Path to the zip file, from the dokeos sys root |
|
326 | + * @param string Current path (optional) |
|
327 | + * @return string Absolute path to the AICC description files or empty string on error |
|
328 | + */ |
|
329 | 329 | function import_local_package($file_path, $current_dir = '') |
330 | 330 | { |
331 | 331 | // TODO: Prepare info as given by the $_FILES[''] vector. |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | $current_dir = api_replace_dangerous_char(trim($current_dir)); // Current dir we are in, inside scorm/ |
356 | 356 | if ($this->debug > 0) { error_log('New LP - aicc::import_package() - Current_dir = '.$current_dir, 0); } |
357 | 357 | |
358 | - //$uploaded_filename = $_FILES['userFile']['name']; |
|
358 | + //$uploaded_filename = $_FILES['userFile']['name']; |
|
359 | 359 | // Get the name of the zip file without the extension. |
360 | 360 | if ($this->debug > 0) { error_log('New LP - aicc::import_package() - Received zip file name: '.$zip_file_path, 0); } |
361 | 361 | $file_info = pathinfo($zip_file_name); |
@@ -458,7 +458,7 @@ |
||
458 | 458 | } |
459 | 459 | |
460 | 460 | if ($myLP->get_type() == 2) { |
461 | - $return .= "update_stats();"; |
|
461 | + $return .= "update_stats();"; |
|
462 | 462 | } |
463 | 463 | |
464 | 464 | // To be sure progress is updated. |
@@ -49,7 +49,7 @@ |
||
49 | 49 | // Create the directory |
50 | 50 | $result = $this->generate_lp_folder($_course, $this->file_name); |
51 | 51 | |
52 | - // Create the directory |
|
52 | + // Create the directory |
|
53 | 53 | $this->base_work_dir = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
54 | 54 | ///learning_path/ppt_dirname directory |
55 | 55 | $this->created_dir = substr($result['dir'], 0, strlen($result['dir']) -1); |
@@ -8,9 +8,9 @@ discard block |
||
8 | 8 | die(); |
9 | 9 | require '../../inc/global.inc.php'; |
10 | 10 | if (empty($_GET['doc'])) { |
11 | - echo "To add a document name to search, add ?doc=abc to the URL\n"; |
|
11 | + echo "To add a document name to search, add ?doc=abc to the URL\n"; |
|
12 | 12 | } else { |
13 | - echo "Received param ".$_GET['doc']."<br />\n"; |
|
13 | + echo "Received param ".$_GET['doc']."<br />\n"; |
|
14 | 14 | } |
15 | 15 | $allowed_mime_types = DocumentManager::file_get_mime_type(true); |
16 | 16 | $allowed_extensions = array( |
@@ -40,30 +40,30 @@ discard block |
||
40 | 40 | $specific_fields = get_specific_field_list(); |
41 | 41 | $specific_fields_values = array(); |
42 | 42 | foreach ($specific_fields as $sf) { |
43 | - $specific_fields_values[$sf['code']] = ''; |
|
43 | + $specific_fields_values[$sf['code']] = ''; |
|
44 | 44 | } |
45 | 45 | $td = Database::get_course_table(TABLE_DOCUMENT); |
46 | 46 | |
47 | 47 | foreach ($courses_list as $course) { |
48 | - $course_dir = $course['directory'].'/document'; |
|
49 | - $title = Database::escape_string($_GET['doc']); |
|
50 | - $sql = "SELECT id, path, session_id FROM $td WHERE c_id = ".$course['id']." AND path LIKE '%$title%' or title LIKE '%$title%'"; |
|
51 | - $res = Database::query($sql); |
|
52 | - if (Database::num_rows($res)>0) { |
|
48 | + $course_dir = $course['directory'].'/document'; |
|
49 | + $title = Database::escape_string($_GET['doc']); |
|
50 | + $sql = "SELECT id, path, session_id FROM $td WHERE c_id = ".$course['id']." AND path LIKE '%$title%' or title LIKE '%$title%'"; |
|
51 | + $res = Database::query($sql); |
|
52 | + if (Database::num_rows($res)>0) { |
|
53 | 53 | while ($row = Database::fetch_array($res)) { |
54 | - $doc_path = api_get_path(SYS_COURSE_PATH).$course_dir.$row['path']; |
|
55 | - $extensions = preg_split("/[\/\\.]/", $doc_path); |
|
56 | - $doc_ext = strtolower($extensions[count($extensions) - 1]); |
|
57 | - if (in_array($doc_ext, $allowed_extensions) && !is_dir($doc_path)) { |
|
54 | + $doc_path = api_get_path(SYS_COURSE_PATH).$course_dir.$row['path']; |
|
55 | + $extensions = preg_split("/[\/\\.]/", $doc_path); |
|
56 | + $doc_ext = strtolower($extensions[count($extensions) - 1]); |
|
57 | + if (in_array($doc_ext, $allowed_extensions) && !is_dir($doc_path)) { |
|
58 | 58 | $doc_mime = mime_content_type($doc_path); |
59 | 59 | echo "Indexing doc ".$row['id']." (".$row['path'].") in course ".$course['code']."\n"; |
60 | 60 | $residx = DocumentManager::index_document($row['id'], $course['code'], $row['session_id'], $course['course_language'], $specific_fields_values); |
61 | 61 | if ($residx) { |
62 | - echo "Success\n"; |
|
62 | + echo "Success\n"; |
|
63 | 63 | } else { |
64 | - echo "Failure\n"; |
|
64 | + echo "Failure\n"; |
|
65 | 65 | } |
66 | - } |
|
66 | + } |
|
67 | + } |
|
67 | 68 | } |
68 | - } |
|
69 | 69 | } |
@@ -14,23 +14,23 @@ discard block |
||
14 | 14 | $views = array('blocks', 'list'); |
15 | 15 | |
16 | 16 | if(isset($_GET['view']) && in_array($_GET['view'], $views)){ |
17 | - $dashboard_view = $_GET['view']; |
|
17 | + $dashboard_view = $_GET['view']; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | $link_blocks_view = $link_list_view = null; |
21 | 21 | |
22 | 22 | if (isset($dashboard_view) && $dashboard_view == 'list') { |
23 | - $link_blocks_view = '<a href="'.api_get_self().'?view=blocks">'. |
|
24 | - Display::return_icon('blocks.png',get_lang('DashboardBlocks'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
23 | + $link_blocks_view = '<a href="'.api_get_self().'?view=blocks">'. |
|
24 | + Display::return_icon('blocks.png',get_lang('DashboardBlocks'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
25 | 25 | } else { |
26 | - $link_list_view = '<a href="'.api_get_self().'?view=list">'. |
|
27 | - Display::return_icon('edit.png',get_lang('EditBlocks'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
26 | + $link_list_view = '<a href="'.api_get_self().'?view=list">'. |
|
27 | + Display::return_icon('edit.png',get_lang('EditBlocks'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | $configuration_link = null; |
31 | 31 | if (api_is_platform_admin()) { |
32 | - $configuration_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Plugins">' |
|
33 | - .Display::return_icon('settings.png',get_lang('ConfigureDashboardPlugin'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
32 | + $configuration_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Plugins">' |
|
33 | + .Display::return_icon('settings.png',get_lang('ConfigureDashboardPlugin'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | echo '<div class="actions">'; |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | } else { |
90 | - // block dashboard list |
|
91 | - if (isset($success)) { |
|
92 | - Display::display_confirmation_message(get_lang('BlocksHaveBeenUpdatedSuccessfully')); |
|
93 | - } |
|
94 | - $user_id = api_get_user_id(); |
|
95 | - DashboardManager::display_user_dashboard_list($user_id); |
|
90 | + // block dashboard list |
|
91 | + if (isset($success)) { |
|
92 | + Display::display_confirmation_message(get_lang('BlocksHaveBeenUpdatedSuccessfully')); |
|
93 | + } |
|
94 | + $user_id = api_get_user_id(); |
|
95 | + DashboardManager::display_user_dashboard_list($user_id); |
|
96 | 96 | } |
@@ -85,40 +85,40 @@ |
||
85 | 85 | $this->view->render(); |
86 | 86 | } |
87 | 87 | |
88 | - /** |
|
89 | - * This method allow store user blocks from dashboard manager |
|
90 | - * render to dashboard.php view |
|
91 | - */ |
|
92 | - public function store_user_block() |
|
88 | + /** |
|
89 | + * This method allow store user blocks from dashboard manager |
|
90 | + * render to dashboard.php view |
|
91 | + */ |
|
92 | + public function store_user_block() |
|
93 | 93 | { |
94 | - $data = array(); |
|
95 | - $user_id = $this->user_id; |
|
96 | - if (strtoupper($_SERVER['REQUEST_METHOD']) == "POST") { |
|
97 | - $enabled_blocks = $_POST['enabled_blocks']; |
|
98 | - $columns = $_POST['columns']; |
|
99 | - $affected_rows = DashboardManager::store_user_blocks($user_id, $enabled_blocks, $columns); |
|
100 | - if ($affected_rows) { |
|
101 | - $data['success'] = true; |
|
102 | - } |
|
103 | - } |
|
104 | - |
|
105 | - $data['dashboard_view'] = 'list'; |
|
106 | - |
|
107 | - // render to the view |
|
108 | - $this->view->set_data($data); |
|
109 | - $this->view->set_layout('layout'); |
|
110 | - $this->view->set_template('dashboard'); |
|
111 | - $this->view->render(); |
|
112 | - } |
|
113 | - |
|
114 | - /** |
|
115 | - * This method is used when you close a block from dashboard block interface |
|
116 | - * render to dashboard.php view |
|
117 | - */ |
|
118 | - public function close_user_block($path) |
|
94 | + $data = array(); |
|
95 | + $user_id = $this->user_id; |
|
96 | + if (strtoupper($_SERVER['REQUEST_METHOD']) == "POST") { |
|
97 | + $enabled_blocks = $_POST['enabled_blocks']; |
|
98 | + $columns = $_POST['columns']; |
|
99 | + $affected_rows = DashboardManager::store_user_blocks($user_id, $enabled_blocks, $columns); |
|
100 | + if ($affected_rows) { |
|
101 | + $data['success'] = true; |
|
102 | + } |
|
103 | + } |
|
104 | + |
|
105 | + $data['dashboard_view'] = 'list'; |
|
106 | + |
|
107 | + // render to the view |
|
108 | + $this->view->set_data($data); |
|
109 | + $this->view->set_layout('layout'); |
|
110 | + $this->view->set_template('dashboard'); |
|
111 | + $this->view->render(); |
|
112 | + } |
|
113 | + |
|
114 | + /** |
|
115 | + * This method is used when you close a block from dashboard block interface |
|
116 | + * render to dashboard.php view |
|
117 | + */ |
|
118 | + public function close_user_block($path) |
|
119 | 119 | { |
120 | - $user_id = $this->user_id; |
|
121 | - $result = DashboardManager::close_user_block($user_id, $path); |
|
122 | - $this->display($result); |
|
123 | - } |
|
120 | + $user_id = $this->user_id; |
|
121 | + $result = DashboardManager::close_user_block($user_id, $path); |
|
122 | + $this->display($result); |
|
123 | + } |
|
124 | 124 | } |
@@ -33,18 +33,18 @@ |
||
33 | 33 | $doc_url = str_replace('/..', '', $doc_url); //echo $doc_url; |
34 | 34 | |
35 | 35 | if (! isset($_course)) { |
36 | - api_not_allowed(true); |
|
36 | + api_not_allowed(true); |
|
37 | 37 | } |
38 | 38 | $full_file_name = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/blog/'.$doc_url; |
39 | 39 | |
40 | 40 | //if the rewrite rule asks for a directory, we redirect to the course view |
41 | 41 | if (is_dir($full_file_name)) { |
42 | - //remove last slash if present |
|
43 | - while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul); |
|
44 | - //create the path |
|
45 | - $document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path |
|
46 | - //redirect |
|
47 | - header('Location: '.$document_explorer); |
|
42 | + //remove last slash if present |
|
43 | + while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul); |
|
44 | + //create the path |
|
45 | + $document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path |
|
46 | + //redirect |
|
47 | + header('Location: '.$document_explorer); |
|
48 | 48 | exit; |
49 | 49 | } |
50 | 50 |