> > > > > > > > > > > MODIFY HOME PAGE < < < < < < < < < < < <*/ /* * Edit visibility of tools * * visibility = 1 - everybody * visibility = 0 - prof and admin * visibility = 2 - admin * * Who can change visibility ? * * admin = 0 - prof and admin * admin = 1 - admin * * Show message to confirm that a tools must be hide from aivailable tools * * visibility 0,1->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 id=$id"; $result = Database::query($sql); $toolsRow = Database::fetch_array($result); $tool_name = htmlspecialchars($toolsRow['name'] != "" ? $toolsRow['name'] : $toolsRow['link'],ENT_QUOTES,$charset); if($toolsRow['img'] != "external.gif") { $toolsRow['link']=api_get_path(WEB_CODE_PATH).$toolsRow['link']; } $toolsRow['image']=api_get_path(WEB_CODE_PATH)."img/".$toolsRow['image']; echo "


\n"; echo "\n", "\n", "\n"; echo "\n", "
\n", "".Display::return_icon($toolsRow['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 id=$id"); } /*-------------------------------------- HIDE --------------------------------------*/ elseif ($hide) // visibility 1 -> 0 { Database::query("UPDATE $TBL_ACCUEIL SET visibility=0 WHERE id=$id"); Display::display_confirmation_message(get_lang('ToolIsNowHidden')); } /*-------------------------------------- REACTIVATE --------------------------------------*/ elseif ($restore) // visibility 0,2 -> 1 { Database::query("UPDATE $TBL_ACCUEIL SET visibility=1 WHERE id=$id"); Display::display_confirmation_message(get_lang('ToolIsNowVisible')); } /* * editing "apparance" of a tools on the course Home Page. */ elseif (isset ($update) && $update) { $result = Database::query("SELECT * FROM $TBL_ACCUEIL WHERE id=$id"); $toolsRow = Database::fetch_array($result); $racine = $_configuration['root_sys']."/".$currentCourseID."/images/"; $chemin = $racine; $name = $toolsRow[1]; $image = $toolsRow[3]; echo "\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 ($is_platformAdmin && 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) { echo "\n", "\n", "", "
\n", "

\n", "", "   ", "",get_lang('DelLk'),"", "
   \n", "",get_lang('No'),"\n", " | \n", "",get_lang('Yes'),"\n", "
\n", "


\n", "
\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 id=$id AND added_tool=1"); } } echo "\n"; /*========================== TOOLS FOR EVERYBODY ==========================*/ echo "\n\n\n"; echo "\n\n\n"; /*========================== PROF ONLY VIEW ==========================*/ if (api_is_allowed_to_edit(null,true) && !api_is_coach()) { echo "\n", "\n","\n","\n"; echo "\n\n\n"; } /*-------------------------------------- TOOLS FOR PLATFORM ADMIN ONLY --------------------------------------*/ if ($is_platformAdmin && api_is_allowed_to_edit(null,true) && !api_is_coach()) { echo "","","\n", "\n","\n","\n"; echo "\n\n\n"; } echo "
 
"; CourseHome::show_tool_3column('Basic'); CourseHome::show_tool_3column('External'); echo "

\n", "\n",get_lang('CourseAdminOnly'),"\n", "
"; CourseHome::show_tool_3column('courseAdmin'); echo "
", "
", "
\n", "",get_lang('PlatformAdminOnly'),"\n", "
"; CourseHome::show_tool_3column('platformAdmin'); echo "
\n"; ?>