Skip to content

Commit f57c380

Browse files
committed
Fix issue with publication of additional links on course homepage (was using c_tool.id instead of c_tool.iid)
1 parent 88083e3 commit f57c380

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

main/inc/lib/course_home.lib.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ public static function show_tools_category($all_tools_list, $rows = false)
827827
$link['name'] = Display::return_icon(
828828
'invisible.png',
829829
get_lang('Activate'),
830-
array('id' => 'linktool_'.$tool['id']),
830+
array('id' => 'linktool_'.$tool['iid']),
831831
ICON_SIZE_SMALL,
832832
false
833833
);
@@ -838,7 +838,7 @@ public static function show_tools_category($all_tools_list, $rows = false)
838838
$link['name'] = Display::return_icon(
839839
'visible.png',
840840
get_lang('Deactivate'),
841-
array('id' => 'linktool_'.$tool['id']),
841+
array('id' => 'linktool_'.$tool['iid']),
842842
ICON_SIZE_SMALL,
843843
false
844844
);
@@ -850,7 +850,7 @@ public static function show_tools_category($all_tools_list, $rows = false)
850850
$link['name'] = Display::return_icon(
851851
'visible.png',
852852
get_lang('Deactivate'),
853-
array('id' => 'linktool_'.$tool['id']),
853+
array('id' => 'linktool_'.$tool['iid']),
854854
ICON_SIZE_SMALL,
855855
false
856856
);
@@ -874,7 +874,7 @@ public static function show_tools_category($all_tools_list, $rows = false)
874874
if (isset($lnk) && is_array($lnk)) {
875875
foreach ($lnk as $this_link) {
876876
if (empty($tool['adminlink'])) {
877-
$item['visibility'] .= '<a class="make_visible_and_invisible" href="'.api_get_self().'?'.api_get_cidreq().'&id='.$tool['id'].'&'.$this_link['cmd'].'">'.
877+
$item['visibility'] .= '<a class="make_visible_and_invisible" href="'.api_get_self().'?'.api_get_cidreq().'&id='.$tool['iid'].'&'.$this_link['cmd'].'">'.
878878
$this_link['name'].'</a>';
879879
}
880880
}
@@ -909,28 +909,28 @@ public static function show_tools_category($all_tools_list, $rows = false)
909909
}
910910

911911
$tool_link_params = array();
912-
$toolId = isset($tool["id"]) ? $tool["id"] : null;
912+
$toolIid = isset($tool["iid"]) ? $tool["iid"] : null;
913913

914914
//@todo this visio stuff should be removed
915915
if (strpos($tool['name'], 'visio_') !== false) {
916916
$tool_link_params = array(
917-
'id' => 'tooldesc_'.$toolId,
917+
'id' => 'tooldesc_'.$toolIid,
918918
'href' => '"javascript: void(0);"',
919919
'class' => $class,
920920
'onclick' => 'javascript: window.open(\''.$tool['link'].'\',\'window_visio'.api_get_course_id().'\',config=\'height=\'+730+\', width=\'+1020+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')',
921921
'target' => $tool['target']
922922
);
923923
} elseif (strpos($tool['name'], 'chat') !== false && api_get_course_setting('allow_open_chat_window')) {
924924
$tool_link_params = array(
925-
'id' => 'tooldesc_'.$toolId,
925+
'id' => 'tooldesc_'.$toolIid,
926926
'class' => $class,
927927
'href' => 'javascript: void(0);',
928928
'onclick' => 'javascript: window.open(\''.$tool['link'].'\',\'window_chat'.api_get_course_id().'\',config=\'height=\'+600+\', width=\'+825+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')', //Chat Open Windows
929929
'target' => $tool['target']
930930
);
931931
} else {
932932
$tool_link_params = array(
933-
'id' => 'tooldesc_'.$toolId,
933+
'id' => 'tooldesc_'.$toolIid,
934934
'href' => $tool['link'],
935935
'class' => $class,
936936
'target' => $tool['target']
@@ -957,7 +957,7 @@ public static function show_tools_category($all_tools_list, $rows = false)
957957
$icon = Display::return_icon(
958958
$tool['image'],
959959
$tool_name,
960-
array('class' => 'tool-icon', 'id' => 'toolimage_'.$toolId),
960+
array('class' => 'tool-icon', 'id' => 'toolimage_'.$toolIid),
961961
ICON_SIZE_BIG,
962962
false
963963
);
@@ -1006,13 +1006,13 @@ public static function show_tools_category($all_tools_list, $rows = false)
10061006
$data = '';
10071007
$html .= '<div class="col-xs-6 col-md-3 course-tool">';
10081008
$image = (substr($item['tool']['image'], 0, strpos($item['tool']['image'], '.'))).'.png';
1009-
$toolId = isset($item['tool']['id']) ? $item['tool']['id'] : null;
1009+
$toolIid = isset($item['tool']['iid']) ? $item['tool']['iid'] : null;
10101010

10111011
if (isset($item['tool']['custom_image'])) {
10121012
$original_image = Display::img(
10131013
$item['tool']['custom_image'],
10141014
$item['name'],
1015-
array('id' => 'toolimage_'.$toolId)
1015+
array('id' => 'toolimage_'.$toolIid)
10161016
);
10171017
} elseif (isset($item['tool']['custom_icon']) &&
10181018
!empty($item['tool']['custom_icon'])
@@ -1025,13 +1025,13 @@ public static function show_tools_category($all_tools_list, $rows = false)
10251025
$original_image = Display::img(
10261026
self::getCustomWebIconPath().$customIcon,
10271027
$item['name'],
1028-
array('id' => 'toolimage_'.$toolId)
1028+
array('id' => 'toolimage_'.$toolIid)
10291029
);
10301030
} else {
10311031
$original_image = Display::return_icon(
10321032
$image,
10331033
$item['name'],
1034-
array('id' => 'toolimage_'.$toolId),
1034+
array('id' => 'toolimage_'.$toolIid),
10351035
ICON_SIZE_BIG,
10361036
false
10371037
);
@@ -1059,7 +1059,7 @@ public static function show_tools_category($all_tools_list, $rows = false)
10591059
$original_image = Display::return_icon(
10601060
$image,
10611061
$item['name'],
1062-
array('id' => 'toolimage_'.$item['tool']['id']),
1062+
array('id' => 'toolimage_'.$item['tool']['iid']),
10631063
ICON_SIZE_SMALL,
10641064
false
10651065
);

0 commit comments

Comments
 (0)