Avoid enter to Custom Icons tool in course session

1.10.x
Angel Fernando Quiroz Campos 11 years ago
parent 2908db1412
commit 6d85e40974
  1. 16
      main/course_info/tools.php
  2. 4
      main/inc/introductionSection.inc.php

@ -6,6 +6,12 @@ require_once '../inc/global.inc.php';
// The section for the tabs
$this_section = SECTION_COURSES;
$sessionId = api_get_session_id();
if (!empty($sessionId)) {
api_not_allowed();
}
api_protect_course_script(true);
if (!api_is_allowed_to_edit()) {
@ -114,9 +120,9 @@ switch ($action) {
foreach ($toolList as $tool) {
if ($tool['id']>20) {
$toolName = $tool['name'];
$toolIconName = $tool['name'];
} else {
$toolName = get_lang('Tool'.api_underscore_to_camel_case($tool['name']));
$toolIconName = get_lang('Tool'.api_underscore_to_camel_case($tool['name']));
}
$iconsTools .= '<div class="col-md-2">';
@ -124,12 +130,12 @@ switch ($action) {
if (!empty($tool['custom_icon'])) {
$image = getCustomWebIconPath().$tool['custom_icon'];
$icon = Display::img($image, $toolName);
$icon = Display::img($image, $toolIconName);
} else {
$image = (substr($tool['image'], 0, strpos($tool['image'], '.'))).'.png';
$icon = Display::return_icon(
$image,
$toolName,
$toolIconName,
array('id' => 'tool_'.$tool['id']),
ICON_SIZE_BIG,
false
@ -143,7 +149,7 @@ switch ($action) {
$edit = '<a class="btn btn-default" href="' . api_get_self() . '?action=edit_icon&id=' . $tool['iid'] . '&'.api_get_cidreq().'"><i class="fa fa-pencil"></i></a>';
$iconsTools .= '<div class="icon-tools">'. $icon . '</div>';
$iconsTools .= '<div class="name-tools">' . $toolName . '</div>';
$iconsTools .= '<div class="name-tools">' . $toolIconName . '</div>';
$iconsTools .= '<div class="toolbar">' . $edit . $delete . '</div>';
$iconsTools .= '</div>';
$iconsTools .= '</div>';

@ -312,7 +312,7 @@ if (!empty($thematic_advance_info)) {
$introduction_section .= '</div>';
}
$editIconButton = '';
if (api_is_allowed_to_edit()) {
if (api_is_allowed_to_edit() && empty($session_id)) {
$editIconButton = Display::url(
'<i class="fa fa-wrench"></i> ',
api_get_path(WEB_CODE_PATH).'course_info/tools.php?'.api_get_cidreq(),
@ -325,7 +325,7 @@ $textIntro = '';
if ($intro_dispCommand) {
if (empty($intro_content)) {
// Displays "Add intro" commands
$toolbar = '<div class="btn-group pull-right" rol="group">';
$toolbar = '<div class="btn-group pull-right" role="group">';
if (!empty($courseId)) {
$textIntro = '<a class="btn btn-default" title="' . get_lang('AddIntro') . '" href="'.api_get_self().'?' . api_get_cidreq().'&intro_cmdAdd=1">';
$textIntro .= '<i class="fa fa-file-text"></i> ';

Loading…
Cancel
Save