> > > > > > > > > > > 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 = api_sql_query($sql,__FILE__,__LINE__); $toolsRow = mysql_fetch_array($result); $tool_name = htmlspecialchars($toolsRow['name'] != "" ? $toolsRow['name'] : $toolsRow['link'],ENT_QUOTES,$charset); if($toolsRow['img'] != "external.gif") { $toolsRow['link']=$clarolineRepositoryWeb.$toolsRow['link']; } $toolsRow['image']=$clarolineRepositoryWeb."img/".$toolsRow['image']; echo "


\n"; echo "\n", "\n", "\n"; echo "\n", "
\n", "\"\"","\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) { api_sql_query("UPDATE $TBL_ACCUEIL SET visibility='2' WHERE id=$id"); } /*-------------------------------------- HIDE --------------------------------------*/ elseif ($hide) // visibility 1 -> 0 { api_sql_query("UPDATE $TBL_ACCUEIL SET visibility=0 WHERE id=$id"); Display::display_confirmation_message(get_lang('ToolIsNowHidden')); } /*-------------------------------------- REACTIVATE --------------------------------------*/ elseif ($restore) // visibility 0,2 -> 1 { api_sql_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 = api_sql_query("SELECT * FROM $TBL_ACCUEIL WHERE id=$id"); $toolsRow = mysql_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 : \"\"\n", "
\n", "\n", "
",get_lang('NameOfTheLink')," :
Lien :
\n", "\n", "\n"; } } // work with data post askable by admin of course if ($is_platformAdmin and is_allowed_to_edit()) { // 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) { api_sql_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 (is_allowed_to_edit()) { echo "\n", "\n","\n","\n"; echo "\n\n\n"; } /*-------------------------------------- TOOLS FOR PLATFORM ADMIN ONLY --------------------------------------*/ if ($is_platformAdmin and is_allowed_to_edit()) { echo "","","\n", "\n","\n","\n"; echo "\n\n\n"; } echo "
 
"; showtools2('Basic'); showtools2('External'); echo "

\n", "\n",get_lang('CourseAdminOnly'),"\n", "
"; showtools2('courseAdmin'); echo "
", "
", "
\n", "",get_lang('PlatformAdminOnly'),"\n", "
"; showtools2('claroAdmin'); echo "
\n"; ?>