setCellContents(0, 0, '
'); $table->updateCellAttributes(0, 0, 'colspan="3"'); $cell_number += $numcols; } foreach ($toolsRow_all as $toolsRow) { $cell_content = ''; // the name of the tool $tool_name = ($toolsRow['name_translated'] != "" ? $toolsRow['name_translated'] : htmlspecialchars($toolsRow['name'],ENT_QUOTES,$charset)); // RH: added htmlspecialchars $link_annex = ''; // the url of the tool if ($toolsRow['img'] != "external.gif") { $toolsRow['link'] = api_get_path(WEB_CODE_PATH).$toolsRow['link']; $qm_or_amp = ((strpos($toolsRow['link'], '?') === FALSE) ? '?' : '&'); $link_annex = $qm_or_amp.api_get_cidreq(); } else // if an external link ends with 'login=', add the actual login... { $pos = strpos($toolsRow['link'], "?login="); $pos2 = strpos($toolsRow['link'], "&login="); if ($pos !== false or $pos2 !== false) { $link_annex = $_user['username']; } } // setting the actual image url $toolsRow['img'] = api_get_path(WEB_IMG_PATH).$toolsRow['img']; // VISIBLE if ($toolsRow['visibility'] or $cat == 'courseAdmin' or $cat == 'platformAdmin') { if(strpos($toolsRow['name'],'chat')!==false && api_get_course_setting('allow_open_chat_window')==true) { $cell_content .= ''.get_lang(ucfirst($toolsRow['name'])).' '.$tool_name.''."\n"; // don't replace img with display::return_icon because $toolsRow['img'] = api_get_path(WEB_IMG_PATH).$toolsRow['img'] } else { $cell_content .= ''.get_lang(ucfirst($toolsRow['name'])).' '.$tool_name.''."\n"; // don't replace img with display::return_icon because $toolsRow['img'] = api_get_path(WEB_IMG_PATH).$toolsRow['img'] } } // INVISIBLE else { if (api_is_allowed_to_edit()) { if(strpos($toolsRow['name'],'chat')!==false && api_get_course_setting('allow_open_chat_window')==true) { $cell_content .= ''."\n"; // don't replace img with display::return_icon because $toolsRow['img'] = api_get_path(WEB_IMG_PATH).$toolsRow['img'] } else { $cell_content .= ''."\n";// don't replace img with display::return_icon because $toolsRow['img'] = api_get_path(WEB_IMG_PATH).$toolsRow['img'] } } else { $cell_content .= ''.get_lang(ucfirst($toolsRow['name'])).' '; // don't replace img with display::return_icon because $toolsRow['img'] = api_get_path(WEB_IMG_PATH).$toolsRow['img'] $cell_content .= ''; } } $lnk = array (); if (api_is_allowed_to_edit() and $cat != "courseAdmin" && !strpos($toolsRow['link'], 'learnpath_handler.php?learnpath_id')) { if ($toolsRow["visibility"]) { $link['name'] = Display::return_icon('remove.gif', get_lang('Deactivate'), array('style' => 'vertical-align:middle;')); $link['cmd'] = "hide=yes"; $lnk[] = $link; } else { $link['name'] = Display::return_icon('add.gif', get_lang('Activate'), array('style' => 'vertical-align:middle;')); $link['cmd'] = "restore=yes"; $lnk[] = $link; /*if($toolsRow["img"] == $dokeosRepositoryWeb."img/external.gif") { $link['name'] = get_lang('Remove'); $link['cmd'] = "remove=yes"; if ($toolsRow["visibility"]==2 and $cat=="platformAdmin") { $link['name'] = get_lang('Delete'); $link['cmd'] = "askDelete=yes"; $lnk[] = $link; } }*/ } //echo "
"; if (is_array($lnk)) { foreach ($lnk as $thisLnk) { if ($toolsRow['adminlink']) { $cell_content .= ''.Display::return_icon('edit.gif', get_lang('Edit')).''; //echo "edit link:".$properties['adminlink']; } else { $cell_content .= "".$thisLnk['name'].""; } } } // RH: Allow editing of invisible homepage links (modified external_module) if ($toolsRow["added_tool"] == 1 && api_is_allowed_to_edit() && !$toolsRow["visibility"]) { $cell_content .= "".get_lang("Edit").""; } } $table->setCellContents($cell_number / $numcols, ($cell_number) % $numcols, $cell_content); $table->updateCellAttributes($cell_number / $numcols, ($cell_number) % $numcols, 'width="32%" height="42"'); $cell_number ++; } $table->display(); } // end function showtools2($cat) ?>