|
|
@ -614,10 +614,11 @@ class CourseHome { |
|
|
|
$is_platform_admin = api_is_platform_admin(); |
|
|
|
$is_platform_admin = api_is_platform_admin(); |
|
|
|
|
|
|
|
|
|
|
|
$i = 0; |
|
|
|
$i = 0; |
|
|
|
|
|
|
|
$items = array(); |
|
|
|
if (isset($all_tools_list)) { |
|
|
|
if (isset($all_tools_list)) { |
|
|
|
$lnk = ''; |
|
|
|
$lnk = ''; |
|
|
|
if ($theme == 'vertical_activity') echo '<ul>'; |
|
|
|
|
|
|
|
foreach ($all_tools_list as & $tool) { |
|
|
|
foreach ($all_tools_list as & $tool) { |
|
|
|
|
|
|
|
$item = array(); |
|
|
|
|
|
|
|
|
|
|
|
if ($tool['image'] == 'scormbuilder.gif') { |
|
|
|
if ($tool['image'] == 'scormbuilder.gif') { |
|
|
|
// display links to lp only for current session |
|
|
|
// display links to lp only for current session |
|
|
@ -633,23 +634,12 @@ class CourseHome { |
|
|
|
|
|
|
|
|
|
|
|
if (api_get_session_id() != 0 && in_array($tool['name'], array('course_maintenance', 'course_setting'))) { |
|
|
|
if (api_get_session_id() != 0 && in_array($tool['name'], array('course_maintenance', 'course_setting'))) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
if ($theme == 'activity') { |
|
|
|
|
|
|
|
if (!($i % 2)) { |
|
|
|
|
|
|
|
echo '<tr valign="top">'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} elseif ($theme == 'vertical_activity') { |
|
|
|
|
|
|
|
echo '<li>'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// This part displays the links to hide or remove a tool. |
|
|
|
// This part displays the links to hide or remove a tool. |
|
|
|
// These links are only visible by the course manager. |
|
|
|
// These links are only visible by the course manager. |
|
|
|
unset($lnk); |
|
|
|
unset($lnk); |
|
|
|
|
|
|
|
|
|
|
|
if ($theme == 'activity') { |
|
|
|
|
|
|
|
echo '<td width="50%">'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($is_allowed_to_edit && !api_is_coach()) { |
|
|
|
if ($is_allowed_to_edit && !api_is_coach()) { |
|
|
|
|
|
|
|
|
|
|
|
if ($tool['visibility'] == '1' && $tool['admin'] != '1') { |
|
|
|
if ($tool['visibility'] == '1' && $tool['admin'] != '1') { |
|
|
@ -663,7 +653,7 @@ class CourseHome { |
|
|
|
$lnk[] = $link; |
|
|
|
$lnk[] = $link; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!empty($tool['adminlink'])) { |
|
|
|
if (!empty($tool['adminlink'])) { |
|
|
|
echo '<a href="'.$tool['adminlink'].'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>'; |
|
|
|
$item['extra'] = '<a href="'.$tool['adminlink'].'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>'; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -677,11 +667,11 @@ class CourseHome { |
|
|
|
if (isset($lnk) && is_array($lnk)) { |
|
|
|
if (isset($lnk) && is_array($lnk)) { |
|
|
|
foreach ($lnk as $this_link) { |
|
|
|
foreach ($lnk as $this_link) { |
|
|
|
if (empty($tool['adminlink'])) { |
|
|
|
if (empty($tool['adminlink'])) { |
|
|
|
echo '<a class="make_visible_and_invisible" href="'.api_get_self().'?'.api_get_cidreq().'&id='.$tool['id'].'&'.$this_link['cmd'].'">'.$this_link['name'].'</a>'; |
|
|
|
$item['visibility'] .= '<a class="make_visible_and_invisible" href="'.api_get_self().'?'.api_get_cidreq().'&id='.$tool['id'].'&'.$this_link['cmd'].'">'.$this_link['name'].'</a>'; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
echo ' '; |
|
|
|
$item['visibility'] .= ' '; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// NOTE : Table contains only the image file name, not full path |
|
|
|
// NOTE : Table contains only the image file name, not full path |
|
|
@ -721,40 +711,88 @@ class CourseHome { |
|
|
|
$toollink = '<a id="tooldesc_'.$tool["id"].'" ' . $class . ' href="' . htmlspecialchars($tool['link']) . '" target="' . $tool['target'] . '">'; |
|
|
|
$toollink = '<a id="tooldesc_'.$tool["id"].'" ' . $class . ' href="' . htmlspecialchars($tool['link']) . '" target="' . $tool['target'] . '">'; |
|
|
|
$my_tool_link = '<a id="istooldesc_'.$tool["id"].'" ' . $class . ' href="' . htmlspecialchars($tool['link']) . '" target="' . $tool['target'] . '">'; |
|
|
|
$my_tool_link = '<a id="istooldesc_'.$tool["id"].'" ' . $class . ' href="' . htmlspecialchars($tool['link']) . '" target="' . $tool['target'] . '">'; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$tool_name = self::translate_tool_name($tool); |
|
|
|
$tool_name = self::translate_tool_name($tool); |
|
|
|
$icon = Display::return_icon($tool['image'], $tool_name, array('class' => 'tool-icon', 'id' => 'toolimage_'.$tool['id'])); |
|
|
|
$icon = Display::return_icon($tool['image'], $tool_name, array('class' => 'tool-icon', 'id' => 'toolimage_'.$tool['id'])); |
|
|
|
|
|
|
|
|
|
|
|
// Validacion when belongs to a session |
|
|
|
// Validacion when belongs to a session |
|
|
|
$session_img = api_get_session_image($tool['session_id'], $_user['status']); |
|
|
|
$session_img = api_get_session_image($tool['session_id'], $_user['status']); |
|
|
|
|
|
|
|
|
|
|
|
echo $toollink; //<a> |
|
|
|
$item['icon'] = $toollink.$icon.'</a>'; |
|
|
|
echo $icon; |
|
|
|
$item['link'] = $my_tool_link.$tool_name.$session_img.'</a>'; |
|
|
|
echo '</a> '; |
|
|
|
$item['id'] = $tool['image']; |
|
|
|
|
|
|
|
|
|
|
|
echo $my_tool_link; //<a> |
|
|
|
$items[] = $item; |
|
|
|
echo $tool_name.$session_img; |
|
|
|
|
|
|
|
echo '</a>'; |
|
|
|
$i++; |
|
|
|
|
|
|
|
} // end of foreach |
|
|
|
if ($theme == 'activity') { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$i = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//$theme = 'activity_big'; |
|
|
|
|
|
|
|
if (!empty($items)) |
|
|
|
|
|
|
|
foreach($items as $item) { |
|
|
|
|
|
|
|
switch($theme) { |
|
|
|
|
|
|
|
case 'activity_big': |
|
|
|
|
|
|
|
if ($i == 0) { |
|
|
|
|
|
|
|
echo '<table width="100%">'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ($i % 3 == 0) { |
|
|
|
|
|
|
|
echo '<tr valign="top">'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
echo '<td width="33%">'; |
|
|
|
|
|
|
|
echo $item['extra']; |
|
|
|
|
|
|
|
echo $item['visibility']; |
|
|
|
|
|
|
|
echo $item['icon']; |
|
|
|
|
|
|
|
echo $item['link']; |
|
|
|
echo '</td>'; |
|
|
|
echo '</td>'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($i % 3 == 2) { |
|
|
|
|
|
|
|
echo '</tr>'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ($i == count($items) -1) { |
|
|
|
|
|
|
|
echo '</table>'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 'activity': |
|
|
|
|
|
|
|
if ($i == 0) { |
|
|
|
|
|
|
|
echo '<table width="100%">'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!($i % 2)) { |
|
|
|
|
|
|
|
echo '<tr valign="top">'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
echo '<td width="50%">'; |
|
|
|
|
|
|
|
echo $item['extra']; |
|
|
|
|
|
|
|
echo $item['visibility']; |
|
|
|
|
|
|
|
echo $item['icon']; |
|
|
|
|
|
|
|
echo $item['link']; |
|
|
|
|
|
|
|
echo '</td>'; |
|
|
|
if ($i % 2) { |
|
|
|
if ($i % 2) { |
|
|
|
echo '</tr>'; |
|
|
|
echo '</tr>'; |
|
|
|
} |
|
|
|
} |
|
|
|
} elseif($theme == 'vertical_activity') { |
|
|
|
if ($i == count($items) -1) { |
|
|
|
|
|
|
|
echo '</table>'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 'vertical_activity': |
|
|
|
|
|
|
|
if ($i == 0) { |
|
|
|
|
|
|
|
echo '<ul>'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
echo '<li>'; |
|
|
|
|
|
|
|
echo $item['extra']; |
|
|
|
|
|
|
|
echo $item['visibility']; |
|
|
|
|
|
|
|
echo $item['icon']; |
|
|
|
|
|
|
|
echo $item['link']; |
|
|
|
echo '</li>'; |
|
|
|
echo '</li>'; |
|
|
|
} |
|
|
|
|
|
|
|
$i++; |
|
|
|
if ($i == count($items) -1) { |
|
|
|
} // end of foreach |
|
|
|
echo '</ul>'; |
|
|
|
} |
|
|
|
} |
|
|
|
if ($theme == 'activity') { |
|
|
|
break; |
|
|
|
if ($i % 2) { |
|
|
|
} |
|
|
|
echo '<td width=\"50%\"> </td></tr>'; |
|
|
|
$i++; |
|
|
|
} |
|
|
|
} |
|
|
|
} elseif($theme == 'vertical_activity') { |
|
|
|
|
|
|
|
echo '</ul>'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|