2 - $remove * * Process hiding a tools from aivailable tools. * * visibility=2 are only view by Dokeos * Administrator visibility 0,1->2 - $destroy * * visibility 1 -> 0 - $hide / $restore */ /* * Diplay message to confirm that a tools must be hide from aivailable tools * (visibility 0,1->2) */ if ($remove) { $sql = "SELECT * FROM $TBL_ACCUEIL WHERE c_id = $course_id AND id=$id"; $result = Database::query($sql); $tool = Database::fetch_array($result); $tool_name = @htmlspecialchars($tool['name'] != '' ? $tool['name'] : $tool['link'], ENT_QUOTES, api_get_system_encoding()); if ($tool['img'] != 'external.gif') { $tool['link'] = api_get_path(WEB_CODE_PATH).$tool['link']; } $tool['image'] = Display::returnIconPath($tool['image']); echo "


\n"; echo "\n", "\n", "\n"; echo "\n", "
\n", "".Display::return_icon($tool['image'], get_lang('Delete')), "\n", "".$tool_name."\n", "", "   ", "", get_lang('DelLk'), "", "
   \n", "", get_lang('No'), "\n", " | \n", "", get_lang('Yes'), "\n", "
\n"; echo "


\n"; } // if remove /* * Process hiding a tools from aivailable tools. * visibility=2 are only view by Dokeos Administrator (visibility 0,1->2) */ elseif ($destroy) { Database::query("UPDATE $TBL_ACCUEIL SET visibility='2' WHERE c_id = $course_id AND id = $id"); } /* HIDE */ elseif ($hide) { // visibility 1 -> 0 Database::query("UPDATE $TBL_ACCUEIL SET visibility=0 WHERE c_id = $course_id AND id=$id"); $show_message .= Display::return_message(get_lang('ToolIsNowHidden'), 'confirmation'); } /* REACTIVATE */ elseif ($restore) { // visibility 0,2 -> 1 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'); } /* * Editing "apparance" of a tools on the course Home Page. */ elseif (isset($update) && $update) { $result = Database::query("SELECT * FROM $TBL_ACCUEIL WHERE c_id = $course_id AND id=$id"); $tool = Database::fetch_array($result); $racine = api_get_path(SYS_PATH).'/'.$currentCourseID.'/images/'; $chemin = $racine; $name = $tool[1]; $image = $tool[3]; $content .= "\n". "\n". "\n". "\n". "\n". "\n". "\n". "\n". "\n". "\n". "\n". "\n". "\n". "\n". "\n". "\n". "\n". "\n". "\n". "
\n". "
\n". "\n". "Image : ".Display::return_icon($image)."\n". "
\n". "\n". "
". get_lang('NameOfTheLink'). " :
Lien :
\n". "\n". "\n"; } } // Work with data post askable by admin of course if (api_is_platform_admin() && api_is_allowed_to_edit(null, true) && !api_is_coach()) { // Show message to confirm that a tools must be hide from aivailable tools // visibility 0,1->2 if ($askDelete) { $content .= "


   ".get_lang('DelLk')."
    ".get_lang('No')."  |  ".get_lang('Yes')."



\n"; } // if remove /* * Process hiding a tools from aivailable tools. * 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"); } } $content .= "\n"; /* TOOLS FOR EVERYBODY */ $content .= "\n\n\n"; $content .= "\n\n\n"; /* PROF ONLY VIEW */ if (api_is_allowed_to_edit(null, true) && !api_is_coach()) { $content .= "\n". "\n"; $content .= "\n\n\n"; } /* TOOLS FOR PLATFORM ADMIN ONLY */ if (api_is_platform_admin() && api_is_allowed_to_edit(null, true) && !api_is_coach()) { $content .= "".""."\n". "\n"."\n"."\n"; $content .= "\n\n\n"; } $content .= "
 
"; $content .= CourseHome::show_tool_3column('Basic'); $content .= CourseHome::show_tool_3column('External'); $content .= "

\n".get_lang('CourseAdminOnly')."
"; $content .=CourseHome::show_tool_3column('courseAdmin'); $content .= "
". "
". "
\n". "". get_lang('PlatformAdminOnly'). "\n". "
"; $content .= CourseHome::show_tool_3column('platformAdmin'); $content .= "
\n";