\n"; } // NOTE : table contains only the image file name, not full path if(!stristr($toolsRow['link'],'http://') && !stristr($toolsRow['link'],'https://') && !stristr($toolsRow['link'],'ftp://')) { $toolsRow['link']=$web_code_path.$toolsRow['link']; } if ($course_tool_category == TOOL_PUBLIC_BUT_HIDDEN) { $class="class=\"invisible\""; } $qm_or_amp = ((strpos($toolsRow['link'],'?')===FALSE)?'?':'&'); $toolsRow['link'] = $toolsRow['link']; echo '', "\n", '', '', $toolsRow['image'],'', ' ', ($toolsRow['image']=="external.gif" || $toolsRow['image']=="external_na.gif" || $toolsRow['image']=="scormbuilder.gif" || $toolsRow['image']=="blog.gif") ? htmlspecialchars( $toolsRow['name'],ENT_QUOTES,$charset) : get_lang(ucfirst($toolsRow['name'])), "\n "; // This part displays the links to hide or remove a tool. // These links are only visible by the course manager. unset($lnk); if (api_is_allowed_to_edit()) { if ($toolsRow["visibility"] == '1') { $link['name'] = ''.get_lang('; $link['cmd'] = "hide=yes"; $lnk[] = $link; } if ($course_tool_category == TOOL_PUBLIC_BUT_HIDDEN) { $link['name'] = ''.get_lang('; $link['cmd'] = "restore=yes"; $lnk[] = $link; if($toolsRow["added_tool"] == 1) { $link['name'] = ''.get_lang('; $link['cmd'] = "remove=yes"; $lnk[] = $link; } } if ($toolsRow['adminlink']) { echo ''.get_lang('; //echo "edit link:".$properties['adminlink']; } } if ( api_is_platform_admin() ) { if ($toolsRow["visibility"]==2) { $link['name'] = ''.get_lang('; $link['cmd'] = "hide=yes"; $lnk[] = $link; if($toolsRow["added_tool"] == 1) { $link['name'] = get_lang("Delete"); $link['cmd'] = "askDelete=yes"; $lnk[] = $link; } } if ($toolsRow["visibility"] == 0 && $toolsRow["added_tool"] == 0) { $link['name'] = ''.get_lang('; $link['cmd'] = "remove=yes"; $lnk[] = $link; } } if (is_array($lnk)) { foreach($lnk as $this_link) { if (!$toolsRow['adminlink']) { echo "" . $this_link['name'] . ""; } } } // Allow editing of invisible homepage links (modified external_module) if ($toolsRow["added_tool"] == 1 && api_is_allowed_to_edit() && !$toolsRow["visibility"]) echo "". get_lang("Edit"). ""; echo "\n"; if($i%2) { echo "\n"; } $i++; } } if($i%2) { echo " \n", "\n"; } } /* ============================================================================== MAIN CODE ============================================================================== */ /* ----------------------------------------------------------- Work with data post askable by admin of course (franglais, clean this) ----------------------------------------------------------- */ if (api_is_allowed_to_edit()) { /* Work request */ /* ----------------------------------------------------------- Modify home page ----------------------------------------------------------- */ /* * display message to confirm that a tool must be hidden from the list of available tools * (visibility 0,1->2) */ if($_GET["remove"]) { $msgDestroy=get_lang('DelLk').'
'; $msgDestroy.=''.get_lang('No').' | '; $msgDestroy.=''.get_lang('Yes').''; Display :: display_confirmation_message($msgDestroy); } /* * Process hiding a tools from available tools. * visibility=2 are only view by Dokeos Administrator (visibility 0,1->2) */ elseif ($_GET["destroy"]) { api_sql_query("UPDATE $tool_table SET visibility='2' WHERE id='".$_GET["id"]."'",__FILE__,__LINE__); } /* ----------------------------------------------------------- HIDE ----------------------------------------------------------- */ elseif ($_GET["hide"]) // visibility 1 -> 0 { api_sql_query("UPDATE $tool_table SET visibility=0 WHERE id='".$_GET["id"]."'",__FILE__,__LINE__); Display::display_confirmation_message(get_lang('ToolIsNowHidden')); } /* ----------------------------------------------------------- REACTIVATE ----------------------------------------------------------- */ elseif ($_GET["restore"]) // visibility 0,2 -> 1 { api_sql_query("UPDATE $tool_table SET visibility=1 WHERE id='".$_GET["id"]."'",__FILE__,__LINE__); Display::display_confirmation_message(get_lang('ToolIsNowVisible')); } } // work with data post askable by admin of course if (api_is_platform_admin()) { // Show message to confirm that a tools must be hide from available tools // visibility 0,1->2 if($_GET["askDelete"]) { ?>

     |  ">
2 */ elseif (isset($_GET["delete"]) && $_GET["delete"]) { api_sql_query("DELETE FROM $tool_table WHERE id='$id' AND added_tool=1",__FILE__,__LINE__); } } /* ============================================================================== TOOLS VISIBLE FOR EVERYBODY ============================================================================== */ echo "
"; echo ""; show_tools(TOOL_PUBLIC); echo "
"; echo "
"; /* ============================================================================== COURSE ADMIN ONLY VIEW ============================================================================== */ // start of tools for CourseAdmins (teachers/tutors) if (api_is_allowed_to_edit()) { echo "
"; echo ""; echo get_lang("CourseAdminOnly"); echo ""; echo ""; show_tools(TOOL_COURSE_ADMIN); /* ----------------------------------------------------------- INACTIVE TOOLS - HIDDEN (GREY) LINKS ----------------------------------------------------------- */ echo "\n", "\n", "\n", "\n"; show_tools(TOOL_PUBLIC_BUT_HIDDEN); echo "

\n", "
\n",get_lang("InLnk"),"
", "
"; echo "
"; } /* ----------------------------------------------------------- Tools for platform admin only ----------------------------------------------------------- */ if (api_is_platform_admin() && api_is_allowed_to_edit()) { ?>