Minor - format code

pull/2487/head
jmontoyaa 8 years ago
parent 79c7f17832
commit 5cb56ac03c
  1. 14
      main/course_home/2column.php
  2. 166
      main/course_home/3column.php
  3. 14
      main/course_home/activity.php
  4. 9
      main/course_home/course_home.php
  5. 14
      main/course_home/vertical_activity.php

@ -4,13 +4,13 @@
/** /**
* HOME PAGE FOR EACH COURSE * HOME PAGE FOR EACH COURSE
* *
* This page, included in every course's index.php is the home * This page, included in every course's index.php is the home
* page. To make administration simple, the teacher edits his * page. To make administration simple, the teacher edits his
* course from the home page. Only the login detects that the * course from the home page. Only the login detects that the
* visitor is allowed to activate, deactivate home page links, * visitor is allowed to activate, deactivate home page links,
* access to the teachers tools (statistics, edit forums...). * access to the teachers tools (statistics, edit forums...).
* *
* @package chamilo.course_home * @package chamilo.course_home
*/ */
/* Work with data post askable by admin of course (franglais, clean this) */ /* Work with data post askable by admin of course (franglais, clean this) */
@ -24,7 +24,6 @@ if (api_is_allowed_to_edit(null, true)) {
/* /*
* Display message to confirm that a tool must be hidden from the list of available tools (visibility 0,1->2) * Display message to confirm that a tool must be hidden from the list of available tools (visibility 0,1->2)
*/ */
if (isset($_GET['remove']) && $_GET['remove']) { if (isset($_GET['remove']) && $_GET['remove']) {
$msgDestroy = get_lang('DelLk').'<br />'; $msgDestroy = get_lang('DelLk').'<br />';
$msgDestroy .= '<a href="'.api_get_self().'">'.get_lang('No').'</a>&nbsp;|&nbsp;'; $msgDestroy .= '<a href="'.api_get_self().'">'.get_lang('No').'</a>&nbsp;|&nbsp;';
@ -100,7 +99,6 @@ if (api_is_allowed_to_edit(null, true) && !api_is_coach()) {
"</tr>"; "</tr>";
$content .= CourseHome::show_tool_2column(TOOL_PUBLIC_BUT_HIDDEN); $content .= CourseHome::show_tool_2column(TOOL_PUBLIC_BUT_HIDDEN);
$content .= "</table>"; $content .= "</table>";
$content .= "</div> "; $content .= "</div> ";
} }

@ -4,13 +4,13 @@
/** /**
* HOME PAGE FOR EACH COURSE (BASIC TOOLS FIXED) * HOME PAGE FOR EACH COURSE (BASIC TOOLS FIXED)
* *
* This page, included in every course's index.php is the home * This page, included in every course's index.php is the home
* page.To make administration simple, the professor edits his * page.To make administration simple, the professor edits his
* course from it's home page. Only the login detects that the * course from it's home page. Only the login detects that the
* visitor is allowed to activate, deactivate home page links, * visitor is allowed to activate, deactivate home page links,
* access to Professor's tools (statistics, edit forums...). * access to Professor's tools (statistics, edit forums...).
* *
* @package chamilo.course_home * @package chamilo.course_home
*/ */
$hide = isset($_GET['hide']) && $_GET['hide'] === 'yes' ? 'yes' : null; $hide = isset($_GET['hide']) && $_GET['hide'] === 'yes' ? 'yes' : null;
@ -79,83 +79,76 @@ if (api_is_allowed_to_edit(null, true)) {
"</font></td></tr>\n", "</font></td></tr>\n",
"</table>\n"; "</table>\n";
echo "<br /><br /><br />\n"; echo "<br /><br /><br />\n";
} elseif ($destroy) {
} // if remove // if remove
/* /*
* Process hiding a tools from aivailable tools. * Process hiding a tools from aivailable tools.
* visibility=2 are only view by Dokeos Administrator (visibility 0,1->2) * visibility=2 are only view by Dokeos Administrator (visibility 0,1->2)
*/ */
Database::query("UPDATE $TBL_ACCUEIL SET visibility='2' WHERE c_id = $course_id AND id = $id");
elseif ($destroy) { } elseif ($hide) {
Database::query("UPDATE $TBL_ACCUEIL SET visibility='2' WHERE c_id = $course_id AND id = $id"); // visibility 1 -> 0
} /* HIDE */
Database::query("UPDATE $TBL_ACCUEIL SET visibility=0 WHERE c_id = $course_id AND id=$id");
/* HIDE */ $show_message .= Display::return_message(get_lang('ToolIsNowHidden'), 'confirmation');
} elseif ($restore) {
elseif ($hide) { // visibility 1 -> 0 /* REACTIVATE */
Database::query("UPDATE $TBL_ACCUEIL SET visibility=0 WHERE c_id = $course_id AND id=$id"); // visibility 0,2 -> 1
$show_message .= Display::return_message(get_lang('ToolIsNowHidden'), 'confirmation'); Database::query("UPDATE $TBL_ACCUEIL SET visibility=1 WHERE c_id = $course_id AND id=$id");
} $show_message .= Display::return_message(get_lang('ToolIsNowVisible'), 'confirmation');
} elseif (isset($update) && $update) {
/* REACTIVATE */ /*
* Editing "apparance" of a tools on the course Home Page.
elseif ($restore) { // visibility 0,2 -> 1 */
Database::query("UPDATE $TBL_ACCUEIL SET visibility=1 WHERE c_id = $course_id AND id=$id"); $result = Database::query("SELECT * FROM $TBL_ACCUEIL WHERE c_id = $course_id AND id=$id");
$show_message .= Display::return_message(get_lang('ToolIsNowVisible'), 'confirmation'); $tool = Database::fetch_array($result);
} $racine = api_get_path(SYS_PATH).'/'.$currentCourseID.'/images/';
/* $chemin = $racine;
* Editing "apparance" of a tools on the course Home Page. $name = $tool[1];
*/ $image = $tool[3];
elseif (isset($update) && $update) {
$result = Database::query("SELECT * FROM $TBL_ACCUEIL WHERE c_id = $course_id AND id=$id"); $content .= "<tr>\n".
$tool = Database::fetch_array($result); "<td colspan=\"4\">\n".
$racine = api_get_path(SYS_PATH).'/'.$currentCourseID.'/images/'; "<table>\n".
$chemin = $racine; "<tr>\n".
$name = $tool[1]; "<td>\n".
$image = $tool[3]; "<form method=\"post\" action=\"".api_get_self()."\">\n".
"<input type=\"hidden\" name=\"id\" value=\"$id\">\n".
$content .= "<tr>\n". "Image : ".Display::return_icon($image)."\n".
"<td colspan=\"4\">\n". "</td>\n".
"<table>\n". "<td>\n".
"<tr>\n". "<select name=\"image\">\n".
"<td>\n". "<option selected>".$image."</option>\n";
"<form method=\"post\" action=\"".api_get_self()."\">\n".
"<input type=\"hidden\" name=\"id\" value=\"$id\">\n". if ($dir = @opendir($chemin)) {
"Image : ".Display::return_icon($image)."\n". while ($file = readdir($dir)) {
"</td>\n". if ($file == '..' || $file == '.') {
"<td>\n". unset($file);
"<select name=\"image\">\n". }
"<option selected>".$image."</option>\n"; $content .= "<option>".$file."</option>\n";
if ($dir = @opendir($chemin)) {
while ($file = readdir($dir)) {
if ($file == '..' || $file == '.') {
unset($file);
} }
$content .= "<option>".$file."</option>\n"; closedir($dir);
} }
closedir($dir);
}
$content .= "</select>\n". $content .= "</select>\n".
"</td>\n". "</td>\n".
"</tr>\n". "</tr>\n".
"<tr>\n". "<tr>\n".
"<td>".get_lang('NameOfTheLink')." : </td>\n". "<td>".get_lang('NameOfTheLink')." : </td>\n".
"<td><input type=\"text\" name=\"name\" value=\"".$name."\"></td>\n". "<td><input type=\"text\" name=\"name\" value=\"".$name."\"></td>\n".
"</tr>\n". "</tr>\n".
"<tr>\n". "<tr>\n".
"<td>Lien :</td>\n". "<td>Lien :</td>\n".
"<td><input type=\"text\" name=\"link\" value=\"".$link."\"></td>\n". "<td><input type=\"text\" name=\"link\" value=\"".$link."\"></td>\n".
"</tr>\n". "</tr>\n".
"<tr>\n". "<tr>\n".
"<td colspan=\"2\"><input type=\"submit\" name=\"submit\" value=\"".get_lang('Ok')."\"></td>\n". "<td colspan=\"2\"><input type=\"submit\" name=\"submit\" value=\"".get_lang('Ok')."\"></td>\n".
"</tr>\n". "</tr>\n".
"</form>\n". "</form>\n".
"</table>\n". "</table>\n".
"</td>\n". "</td>\n".
"</tr>\n"; "</tr>\n";
} }
} }
@ -175,13 +168,12 @@ if (api_is_platform_admin() && api_is_allowed_to_edit(null, true) && !api_is_coa
</td> </td>
</tr> </tr>
</table>\n"; </table>\n";
} // if remove } elseif (isset($delete) && $delete) {
// if remove
/* /*
* Process hiding a tools from aivailable tools. * Process hiding a tools from aivailable tools.
* visibility=2 are only viewed by Dokeos Administrator visibility 0,1->2 * visibility=2 are only viewed by Dokeos Administrator visibility 0,1->2
*/ */
elseif (isset($delete) && $delete) {
Database::query("DELETE FROM $TBL_ACCUEIL WHERE c_id = $course_id AND id = $id AND added_tool=1"); Database::query("DELETE FROM $TBL_ACCUEIL WHERE c_id = $course_id AND id = $id AND added_tool=1");
} }
} }

@ -2,15 +2,15 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* HOME PAGE FOR EACH COURSE * HOME PAGE FOR EACH COURSE
* *
* This page, included in every course's index.php is the home * This page, included in every course's index.php is the home
* page. To make administration simple, the teacher edits his * page. To make administration simple, the teacher edits his
* course from the home page. Only the login detects that the * course from the home page. Only the login detects that the
* visitor is allowed to activate, deactivate home page links, * visitor is allowed to activate, deactivate home page links,
* access to the teachers tools (statistics, edit forums...). * access to the teachers tools (statistics, edit forums...).
* *
* @package chamilo.course_home * @package chamilo.course_home
*/ */
$id = isset($_GET['id']) ? intval($_GET['id']) : null; $id = isset($_GET['id']) ? intval($_GET['id']) : null;

@ -276,13 +276,13 @@ if ($show_autolaunch_lp_warning) {
} }
if (api_get_setting('homepage_view') === 'activity' || api_get_setting('homepage_view') === 'activity_big') { if (api_get_setting('homepage_view') === 'activity' || api_get_setting('homepage_view') === 'activity_big') {
require 'activity.php'; require 'activity.php';
} elseif (api_get_setting('homepage_view') === '2column') { } elseif (api_get_setting('homepage_view') === '2column') {
require '2column.php'; require '2column.php';
} elseif (api_get_setting('homepage_view') === '3column') { } elseif (api_get_setting('homepage_view') === '3column') {
require '3column.php'; require '3column.php';
} elseif (api_get_setting('homepage_view') === 'vertical_activity') { } elseif (api_get_setting('homepage_view') === 'vertical_activity') {
require 'vertical_activity.php'; require 'vertical_activity.php';
} }
$content = '<div id="course_tools">'.$content.'</div>'; $content = '<div id="course_tools">'.$content.'</div>';
@ -293,7 +293,6 @@ $tpl->assign('content', $content);
// Direct login to course // Direct login to course
$tpl->assign('course_code', $course_code); $tpl->assign('course_code', $course_code);
$tpl->display_one_col_template(); $tpl->display_one_col_template();
// Deleting the objects // Deleting the objects

@ -2,15 +2,15 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* HOME PAGE FOR EACH COURSE * HOME PAGE FOR EACH COURSE
* *
* This page, included in every course's index.php is the home * This page, included in every course's index.php is the home
* page. To make administration simple, the teacher edits his * page. To make administration simple, the teacher edits his
* course from the home page. Only the login detects that the * course from the home page. Only the login detects that the
* visitor is allowed to activate, deactivate home page links, * visitor is allowed to activate, deactivate home page links,
* access to the teachers tools (statistics, edit forums...). * access to the teachers tools (statistics, edit forums...).
* *
* @package chamilo.course_home * @package chamilo.course_home
*/ */
$id = isset($_GET['id']) ? intval($_GET['id']) : null; $id = isset($_GET['id']) ? intval($_GET['id']) : null;

Loading…
Cancel
Save