diff --git a/main/document/slideshow.php b/main/document/slideshow.php
index a05bc82261..3a3b8996f2 100755
--- a/main/document/slideshow.php
+++ b/main/document/slideshow.php
@@ -15,15 +15,15 @@ $pathurl = urlencode($path);
$slide_id = isset($_GET['slide_id']) ? Security::remove_XSS($_GET['slide_id']) : null;
if (empty($slide_id)) {
- $edit_slide_id = 1;
+ $edit_slide_id = 1;
} else {
- $edit_slide_id = $slide_id;
+ $edit_slide_id = $slide_id;
}
if ($path != '/') {
- $folder = $path.'/';
+ $folder = $path.'/';
} else {
- $folder = '/';
+ $folder = '/';
}
$sys_course_path = api_get_path(SYS_COURSE_PATH);
@@ -41,19 +41,19 @@ Display :: display_header($originaltoolname, 'Doc');
// Loading the slides from the session
if (isset($_SESSION['image_files_only'])) {
- $image_files_only = $_SESSION['image_files_only'];
+ $image_files_only = $_SESSION['image_files_only'];
}
// Calculating the current slide, next slide, previous slide and the number of slides
$slide = null;
if ($slide_id != 'all') {
- $slide = $slide_id ? $slide_id : 0;
- $previous_slide = $slide - 1;
- $next_slide = $slide + 1;
+ $slide = $slide_id ? $slide_id : 0;
+ $previous_slide = $slide - 1;
+ $next_slide = $slide + 1;
}
$total_slides = count($image_files_only);
?>
-
+ var delta_height = height - initial_height * resize_factor_width;
+
+ if (delta_width > delta_height) {
+ width = Math.ceil(initial_width * resize_factor_height);
+ height= Math.ceil(initial_height * resize_factor_height);
+ }
+ else if(delta_width < delta_height) {
+ width = Math.ceil(initial_width * resize_factor_width);
+ height = Math.ceil(initial_height * resize_factor_width);
+ }
+ else {
+ width = Math.ceil(width);
+ height = Math.ceil(height);
+ }
+
+ document.getElementById('image').style.height = height +"px";
+ document.getElementById('image').style.width = width +"px";
+ document.getElementById('td_image').style.background='none';
+ document.getElementById('image').style.visibility='visible';
+ };
+
+ if (initial_height>height || initial_width>width) {
+ document.getElementById('image').style.visibility='hidden';
+ document.getElementById('td_image').style.background='url() center no-repeat';
+ document.getElementById('image').onload = resizeImage;
+ window.onresize = resizeImage;
+ }
+
+
";
- }
+ } else {
+ echo "";
+ }
- echo '';
+ echo '';
echo '
'.$row['comment'].'
'; echo '', '
', '', '
', '- | + | - | -- + | + - | - -- + | + ++ '.nl2br($answerComment).''; } - ?> - | - -- - | + + + - | |||||||||||||
- - | -+ $icon .= $studentChoice?'_on':'_off'; + $icon .= '.gif'; + $iconAnswer = in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION)) ? 'radio':'checkbox'; + $iconAnswer .= $answerCorrect?'_on':'_off'; + $iconAnswer .= '.gif'; + + ?> + | ||||||||||||||||||||
+ + | +- | -- - | - - -- + | + + | + + ++ '.nl2br($answerComment).''; - } else { + //echo ''.nl2br($answerComment).''; + } else { $color = 'black'; //echo ''.nl2br($answerComment).''; - } - if ($hide_expected_answer) { - $color = ''; - } + } + if ($hide_expected_answer) { + $color = ''; + } echo ''.nl2br($answerComment).''; - } - ?> - | - - -- - | + + + @@ -422,7 +423,7 @@ class ExerciseShowFunctions | - + | @@ -448,8 +449,8 @@ class ExerciseShowFunctions } if ($hide_expected_answer) { - $color = ''; - } + $color = ''; + } echo ''.nl2br($answerComment).''; } @@ -510,7 +511,7 @@ class ExerciseShowFunctions|||||||||||||
options[$studentChoice])) { echo $question->options[$studentChoice]; @@ -521,7 +522,7 @@ class ExerciseShowFunctions |
options[$answerCorrect])) {
echo $question->options[$answerCorrect];
@@ -550,10 +551,10 @@ class ExerciseShowFunctions
if ($studentChoice == $answerCorrect) {
$color = "green";
}
- //echo ''.nl2br($answerComment).'';
+ //echo ''.nl2br($answerComment).'';
if ($hide_expected_answer) {
$color = '';
- }
+ }
echo ''.nl2br($answerComment).'';
}
?>
@@ -572,12 +573,11 @@ class ExerciseShowFunctions
public static function displayAnnotationAnswer(
$feedback_type,
- $exe_id,
- $questionId,
- $questionScore = null,
- $results_disabled = 0
- )
- {
+ $exe_id,
+ $questionId,
+ $questionScore = null,
+ $results_disabled = 0
+ ) {
$comments = Event::get_comments($exe_id, $questionId);
if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
diff --git a/main/inc/lib/thematic.lib.php b/main/inc/lib/thematic.lib.php
index c9c2e41fd9..18d7e567bd 100755
--- a/main/inc/lib/thematic.lib.php
+++ b/main/inc/lib/thematic.lib.php
@@ -61,6 +61,7 @@ class Thematic
* @param int Number of users to get
* @param int Column to sort on
* @param string Order (ASC,DESC)
+ * @return array
* @see SortableTable#get_table_data($from)
*/
public function get_thematic_data($from, $number_of_items, $column, $direction)
@@ -177,8 +178,8 @@ class Thematic
/**
* Move a thematic
*
- * @param string $direction (up, down)
- * @param int $thematic_id
+ * @param string $direction (up, down)
+ * @param int $thematic_id
*/
public function move_thematic($direction, $thematic_id)
{
@@ -241,11 +242,11 @@ class Thematic
/**
* get thematic list
- * @param int Thematic id (optional), get list by id
+ * @param int Thematic id (optional), get list by id
* @param integer $thematic_id
* @param string $course_code
* @param integer $session_id
- * @return array Thematic data
+ * @return array Thematic data
*/
public static function get_thematic_list(
$thematic_id = null,
@@ -365,8 +366,8 @@ class Thematic
/**
* Delete logically (set active field to 0) a thematic
- * @param int|array One or many thematic ids
- * @return int Affected rows
+ * @param int|array One or many thematic ids
+ * @return int Affected rows
*/
public function thematic_destroy($thematic_id)
{
@@ -394,8 +395,8 @@ class Thematic
);
}
}
- } else {
- $thematic_id = intval($thematic_id);
+ } else {
+ $thematic_id = intval($thematic_id);
$sql = "UPDATE $tbl_thematic SET active = 0
WHERE c_id = $course_id AND id = $thematic_id";
$result = Database::query($sql);
@@ -432,8 +433,8 @@ class Thematic
$new_thematic_id = $thematic_copy->thematic_save();
if (!empty($new_thematic_id)) {
$thematic_advanced = self::get_thematic_advance_by_thematic_id($thematic_id);
- if(!empty($thematic_advanced)) {
- foreach($thematic_advanced as $item) {
+ if (!empty($thematic_advanced)) {
+ foreach ($thematic_advanced as $item) {
$thematic = new Thematic();
$thematic->set_thematic_advance_attributes(
0,
@@ -481,13 +482,13 @@ class Thematic
return $obj->total_number_of_items;
}
-
/**
* Get the thematic advances to display on the current page (fill the sortable-table)
* @param int offset of first user to recover
* @param int Number of users to get
* @param int Column to sort on
* @param string Order (ASC,DESC)
+ * @return array
* @see SortableTable#get_table_data($from)
*/
public static function get_thematic_advance_data($from, $number_of_items, $column, $direction)
@@ -501,11 +502,8 @@ class Thematic
$direction = 'ASC';
}
$data = array();
-
$course_id = api_get_course_int_id();
-
if (api_is_allowed_to_edit(null, true)) {
-
$sql = "SELECT id AS col0, start_date AS col1, duration AS col2, content AS col3
FROM $tbl_thematic_advance
WHERE c_id = $course_id AND thematic_id = $thematic_id
@@ -592,7 +590,6 @@ class Thematic
foreach ($data as $thematic_id => $thematic_advance_data) {
foreach ($thematic_advance_data as $key => $thematic_advance) {
-
$session_star = '';
if (api_is_allowed_to_edit(null, true)) {
if ($thematic_advance['session_id'] !=0) {
@@ -654,11 +651,6 @@ class Thematic
}
}
$final_return[$thematic_id] = $return;
- /*
- if ($no_data) {
- $return .= ' '.get_lang('StillDoNotHaveAThematicPlan').' ';
- }
- */
}
return $final_return;
@@ -671,7 +663,10 @@ class Thematic
* @param bool $force_session_id Force to have a session id
* @return array $data
*/
- public function get_thematic_advance_list($thematic_advance_id = null, $course_code = null, $force_session_id = false
+ public function get_thematic_advance_list(
+ $thematic_advance_id = null,
+ $course_code = null,
+ $force_session_id = false
) {
$course_info = api_get_course_info($course_code);
$tbl_thematic_advance = Database::get_course_table(TABLE_THEMATIC_ADVANCE);
@@ -734,7 +729,6 @@ class Thematic
public function thematic_advance_save()
{
$_course = api_get_course_info();
-
// definition database table
$tbl_thematic_advance = Database::get_course_table(TABLE_THEMATIC_ADVANCE);
@@ -846,7 +840,6 @@ class Thematic
// definition database table
$tbl_thematic_plan = Database::get_course_table(TABLE_THEMATIC_PLAN);
$tbl_thematic = Database::get_course_table(TABLE_THEMATIC);
-
$course_id = api_get_course_int_id();
$data = array();
@@ -967,7 +960,6 @@ class Thematic
if (Database::num_rows($rs) > 0) {
$row_thematic_plan = Database::fetch_array($rs);
$thematic_plan_id = $row_thematic_plan['id'];
-
$update = false;
if (in_array($thematic_plan_id, $elements_to_show)) {
$update = true;
@@ -1128,7 +1120,11 @@ class Thematic
{
$_course = api_get_course_info();
$thematic_data = $this->get_thematic_list(null, api_get_course_id());
- $thematic_advance_data = $this->get_thematic_advance_list(null, api_get_course_id(), true);
+ $thematic_advance_data = $this->get_thematic_advance_list(
+ null,
+ api_get_course_id(),
+ true
+ );
$tbl_thematic_advance = Database::get_course_table(TABLE_THEMATIC_ADVANCE);
$affected_rows = 0;
diff --git a/main/lp/aicc.class.php b/main/lp/aicc.class.php
index 354abbfeac..43e88ce220 100755
--- a/main/lp/aicc.class.php
+++ b/main/lp/aicc.class.php
@@ -5,8 +5,8 @@
* Class aicc
* Defines the AICC class, which is meant to contain the aicc items (nuclear elements)
* @package chamilo.learnpath
- * @author Yannick Warnier des:'.print_r($des_params, true).''; if ($this->debug > 1) { error_log('New LP - In aicc::parse_config_files() - '.$des_file.' has been parsed', 0); } // Distribute des params into the aicc object. - foreach ($des_params as $des){ + foreach ($des_params as $des) { // One AU in AICC is equivalent to one SCO in SCORM (scormItem class). $oDes = new aiccResource('config', $des); $this->deslist[$oDes->identifier] = $oDes; @@ -215,8 +217,8 @@ class aicc extends learnpath /** * Import the aicc object (as a result from the parse_config_files function) into the database structure - * @param string $course_code - * @return bool Returns -1 on error + * @param string $course_code + * @return bool Returns -1 on error */ public function import_aicc($course_code) { @@ -376,9 +378,7 @@ class aicc extends learnpath } */ $zipFile = new PclZip($zip_file_path); - // Check the zip content (real size and file extension). - $zipContentArray = $zipFile->listContent(); $package_type = ''; // The type of the package. Should be 'aicc' after the next few lines. @@ -562,12 +562,13 @@ class aicc extends learnpath } else { return ''; } + return $course_sys_dir.$new_dir.$config_dir; } /** * Sets the proximity setting in the database - * @param string $proxy Proximity setting + * @param string $proxy Proximity setting */ function set_proximity($proxy = '') { @@ -586,7 +587,7 @@ class aicc extends learnpath /** * Sets the theme setting in the database - * @param string Theme setting + * @param string Theme setting */ function set_theme($theme = '') { @@ -605,7 +606,7 @@ class aicc extends learnpath /** * Sets the image LP in the database - * @param string $preview_image Theme setting + * @param string $preview_image Theme setting */ function set_preview_image($preview_image = '') { @@ -624,7 +625,7 @@ class aicc extends learnpath /** * Sets the Author LP in the database - * @param string $author + * @param string $author */ function set_author($author = '') { @@ -643,7 +644,7 @@ class aicc extends learnpath /** * Sets the content maker setting in the database - * @param string $maker + * @param string $maker */ function set_maker($maker = '') { @@ -662,7 +663,7 @@ class aicc extends learnpath /** * Exports the current AICC object's files as a zip. Excerpts taken from learnpath_functions.inc.php::exportpath() - * @param integer Learnpath ID (optional, taken from object context if not defined) + * @param integer Learnpath ID (optional, taken from object context if not defined) */ function export_zip($lp_id = null) { @@ -758,7 +759,8 @@ class aicc extends learnpath * Gets the default organisation's title * @return string The organization's title */ - function get_title(){ + function get_title() + { if ($this->debug > 0) { error_log('In aicc::get_title() method', 0); } $title = ''; if (isset($this->config['organizations']['default'])) { @@ -778,7 +780,8 @@ class aicc extends learnpath * updating the existing table... This will prove very useful in case initial data * from config files were not imported well enough. */ - function reimport_aicc() { + function reimport_aicc() + { if ($this->debug > 0) { error_log('In aicc::reimport_aicc() method', 0); } //query current items list //get the identifiers @@ -794,7 +797,8 @@ class aicc extends learnpath * @param string File path * @return array Structured array */ - function parse_ini_file_quotes_safe($f) { + function parse_ini_file_quotes_safe($f) + { $null = ''; $r = $null; $sec = $null; @@ -845,7 +849,8 @@ class aicc extends learnpath * @param array List of names of sections that should be considered as containing only hard string data (no variables), provided in lower case * @return array Structured array */ - function parse_ini_string_quotes_safe($s, $pure_strings = array()) { + function parse_ini_string_quotes_safe($s, $pure_strings = array()) + { $null = ''; $r = $null; $sec = $null; @@ -908,7 +913,8 @@ class aicc extends learnpath * @param boolean Might one field name happen more than once on the same line? (then split by comma in the values) * @return array Simple structured array */ - function parse_csv_file($f, $delim = ',', $enclosure = '"', $multiples = false) { + function parse_csv_file($f, $delim = ',', $enclosure = '"', $multiples = false) + { $data = @file_get_contents($f); $data = api_convert_encoding($data, api_get_system_encoding(), $this->config_encoding); $enclosed = false; @@ -982,6 +988,7 @@ class aicc extends learnpath } } } + return $ret_ret_array; } } diff --git a/plugin/dashboard/block_teacher/block_teacher.class.php b/plugin/dashboard/block_teacher/block_teacher.class.php index 4db0673d45..82b3370e56 100755 --- a/plugin/dashboard/block_teacher/block_teacher.class.php +++ b/plugin/dashboard/block_teacher/block_teacher.class.php @@ -1,4 +1,6 @@ user_id = $user_id; - $this->path = 'block_teacher'; - if ($this->is_block_visible_for_user($user_id)) { - $this->teachers = UserManager::get_users_followed_by_drh($user_id, COURSEMANAGER); - } + $this->user_id = $user_id; + $this->path = 'block_teacher'; + if ($this->is_block_visible_for_user($user_id)) { + $this->teachers = UserManager::get_users_followed_by_drh($user_id, COURSEMANAGER); + } } /** - * This method check if a user is allowed to see the block inside dashboard interface - * @param int User id - * @return bool Is block visible for user - */ + * This method check if a user is allowed to see the block inside dashboard interface + * @param int User id + * @return bool Is block visible for user + */ public function is_block_visible_for_user($user_id) { - $user_info = api_get_user_info($user_id); - $user_status = $user_info['status']; - $is_block_visible_for_user = false; - if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { - $is_block_visible_for_user = true; - } - return $is_block_visible_for_user; + $user_info = api_get_user_info($user_id); + $user_status = $user_info['status']; + $is_block_visible_for_user = false; + if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { + $is_block_visible_for_user = true; + } + return $is_block_visible_for_user; } /** - * This method return content html containing information about teachers and its position for showing it inside dashboard interface - * it's important to use the name 'get_block' for beeing used from dashboard controller + * This method return content html containing information about + * teachers and its position for showing it inside dashboard interface + * it's important to use the name 'get_block' for beeing used from + * dashboard controller * @return array column and content html */ public function get_block() { + global $charset; + $column = 1; + $data = array(); + $teacher_content_html = $this->get_teachers_content_html_for_drh(); - global $charset; - $column = 1; - $data = array(); - $teacher_content_html = $this->get_teachers_content_html_for_drh(); - - $html = ' + $html = '
'.get_lang('TeachersInformationsList').'
@@ -77,133 +75,131 @@ class BlockTeacher extends Block
'.$teacher_content_html.'
';
- $content = ' ';
-
- return $content;
- }
-
- public function get_teachers_content_html_for_drh()
+ if (count($teachers) > 0) {
+ $teachers_table .= ''.get_lang('YourTeachers').''; + $teachers = $this->teachers; + $content = ''.get_lang('YourTeachers').''; $teachers_table = null; - if (count($teachers) > 0) { - $teachers_table .= '
';
- $content = ' ';
-
- return $content;
- }
+ if (count($teachers) > 0) {
+ $a_last_week = get_last_week();
+ $last_week = date('Y-m-d',$a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]);
+
+ $teachers_table .= ''.get_lang('YourTeachers').''; + $teachers = $this->teachers; + $content = ''.get_lang('YourTeachers').''; $teachers_table = null; - if (count($teachers) > 0) { - $a_last_week = get_last_week(); - $last_week = date('Y-m-d',$a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]); - - $teachers_table .= '
|