|
|
|
@ -464,7 +464,7 @@ if (!empty($action)) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$class_add_in_tab = 'class="show_menu"'; |
|
|
|
|
|
|
|
|
|
if (!$add_in_tab) { |
|
|
|
|
$class_add_in_tab = 'class="hide_menu"'; |
|
|
|
|
} |
|
|
|
@ -472,7 +472,7 @@ if (!empty($action)) { |
|
|
|
|
// If the requested action is to create a link, make some room |
|
|
|
|
// for the new link in the home_menu array at the requested place |
|
|
|
|
// and insert the new link there |
|
|
|
|
$icon = '<em class="fa fa-external-link"></em>'; |
|
|
|
|
|
|
|
|
|
if ($action == 'insert_link' || $action == 'insert_tabs') { |
|
|
|
|
for ($i = sizeof($home_menu); $i; $i--) { |
|
|
|
|
if ($i > $insert_where) { |
|
|
|
@ -481,10 +481,10 @@ if (!empty($action)) { |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$home_menu[$insert_where + 1] = '<li '.$class_add_in_tab.'><a href="'.$link_url.'" target="'.($target_blank ? '_blank' : '_self').'">'.$icon.' '.$link_name.'</a></li>'; |
|
|
|
|
$home_menu[$insert_where + 1] = '<li><a href="'.$link_url.'" target="'.($target_blank ? '_blank' : '_self').'">'. $link_name .'</a></li>'; |
|
|
|
|
} else { |
|
|
|
|
// If the request is about a link edition, change the link |
|
|
|
|
$home_menu[$link_index]='<li '.$class_add_in_tab.'><a href="'.$link_url.'" target="'.($target_blank?'_blank':'_self').'">'.$icon.' '.$link_name.'</a></li>'; |
|
|
|
|
$home_menu[$link_index]='<li><a href="'.$link_url.'" target="'.($target_blank?'_blank':'_self').'">'. $link_name .'</a></li>'; |
|
|
|
|
} |
|
|
|
|
// Re-build the file from the home_menu array |
|
|
|
|
$home_menu = implode("\n", $home_menu); |
|
|
|
@ -1073,8 +1073,7 @@ switch ($action) { |
|
|
|
|
</div> |
|
|
|
|
<div id="links-list" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne"> |
|
|
|
|
<div class="panel-body"> |
|
|
|
|
<a href="<?php echo api_get_self(); ?>?action=insert_link"><?php Display::display_icon('addd.gif', get_lang('InsertLink')); ?> |
|
|
|
|
<?php echo get_lang('InsertLink'); ?> |
|
|
|
|
<a href="<?php echo api_get_self(); ?>?action=insert_link"><?php echo Display::return_icon('add.png', get_lang('InsertLink')).' '. get_lang('InsertLink'); ?> |
|
|
|
|
</a> |
|
|
|
|
<ul class="menulist"> |
|
|
|
|
<?php |
|
|
|
@ -1096,9 +1095,9 @@ switch ($action) { |
|
|
|
|
foreach ($home_menu as $enreg) { |
|
|
|
|
$enreg = trim($enreg); |
|
|
|
|
if (!empty($enreg)) { |
|
|
|
|
$edit_link = '<a href="'.api_get_self().'?action=edit_link&link_index='.$i.'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>'; |
|
|
|
|
$delete_link = '<a href="'.api_get_self().'?action=delete_link&link_index='.$i.'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)).'\')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>'; |
|
|
|
|
echo str_replace(array('href="'.api_get_path(WEB_PATH).'index.php?include=', '</li>'), array('href="'.api_get_path(WEB_CODE_PATH).'admin/'.basename(api_get_self()).'?action=open_link&link=', '<br />'.$edit_link.' '.$delete_link.'</li>'), $enreg); |
|
|
|
|
$edit_link = '<a href="'.api_get_self().'?action=edit_link&link_index='.$i.'">'.Display::return_icon('edit.png', get_lang('Edit')).'</a>'; |
|
|
|
|
$delete_link = '<a href="'.api_get_self().'?action=delete_link&link_index='.$i.'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)).'\')) return false;">'.Display::return_icon('delete.png', get_lang('Delete')).'</a>'; |
|
|
|
|
echo str_replace(array('href="'.api_get_path(WEB_PATH).'index.php?include=', '</li>'), array('href="'.api_get_path(WEB_CODE_PATH).'admin/'.basename(api_get_self()).'?action=open_link&link=', $edit_link.' '.$delete_link.'</li>'), $enreg); |
|
|
|
|
$i++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1113,8 +1112,7 @@ switch ($action) { |
|
|
|
|
<div class="col-md-9"> |
|
|
|
|
<div class="actions"> |
|
|
|
|
<a href="<?php echo api_get_self(); ?>?action=edit_top&language=<?php echo $languageGet; ?>">
|
|
|
|
|
<?php echo Display::return_icon('edit.png', get_lang('EditHomePage'),null,ICON_SIZE_SMALL); ?> |
|
|
|
|
<?php echo get_lang('EditHomePage'); ?> |
|
|
|
|
<?php echo Display::return_icon('edit.png', get_lang('EditHomePage'),null,ICON_SIZE_SMALL).' '. get_lang('EditHomePage'); ?> |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
<section id="homepage-home"> |
|
|
|
@ -1140,14 +1138,14 @@ switch ($action) { |
|
|
|
|
|
|
|
|
|
if ($access_url_id == 1) { |
|
|
|
|
echo '<div class="actions">'; |
|
|
|
|
echo '<a href="course_category.php">'.Display::return_icon('edit.png', get_lang('Edit')).get_lang('EditCategories').'</a>'; |
|
|
|
|
echo '<a href="course_category.php">'.Display::return_icon('edit.png', get_lang('Edit')).' '.get_lang('EditCategories').'</a>'; |
|
|
|
|
echo '</div>'; |
|
|
|
|
} |
|
|
|
|
echo '<ul class="list-group">'; |
|
|
|
|
if ($access_url_id == 1) { |
|
|
|
|
if (sizeof($Categories)) { |
|
|
|
|
foreach ($Categories as $enreg) { |
|
|
|
|
echo '<li class="list-group-item">'.Display::return_icon('folder_document.gif', $enreg['name']).' '.$enreg['name'].'</li>'; |
|
|
|
|
echo '<li class="list-group-item">'.Display::return_icon('folder.png', $enreg['name']).' '.$enreg['name'].'</li>'; |
|
|
|
|
} |
|
|
|
|
unset($Categories); |
|
|
|
|
} else { |
|
|
|
@ -1195,8 +1193,8 @@ switch ($action) { |
|
|
|
|
foreach ($home_menu as $enreg) { |
|
|
|
|
$enreg = trim($enreg); |
|
|
|
|
if (!empty($enreg)) { |
|
|
|
|
$edit_link = ' <a href="'.api_get_self().'?action=edit_tabs&link_index='.$tab_counter.'" ><span>'.Display::return_icon('edit.gif', get_lang('Edit')).'</span></a>'; |
|
|
|
|
$delete_link = ' <a href="'.api_get_self().'?action=delete_tabs&link_index='.$tab_counter.'" onclick="javascript: if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)).'\')) return false;"><span>'.Display::return_icon('delete.gif', get_lang('Delete')).'</span></a>'; |
|
|
|
|
$edit_link = ' <a href="'.api_get_self().'?action=edit_tabs&link_index='.$tab_counter.'" ><span>'.Display::return_icon('edit.png', get_lang('Edit')).'</span></a>'; |
|
|
|
|
$delete_link = ' <a href="'.api_get_self().'?action=delete_tabs&link_index='.$tab_counter.'" onclick="javascript: if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)).'\')) return false;"><span>'.Display::return_icon('delete.png', get_lang('Delete')).'</span></a>'; |
|
|
|
|
$tab_string = str_replace(array('href="'.api_get_path(WEB_PATH).'index.php?include=', '</li>'), |
|
|
|
|
array('href="'.api_get_path(WEB_CODE_PATH).'admin/'.basename(api_get_self()).'?action=open_link&link=', $edit_link.$delete_link.'</li>'), |
|
|
|
|
$enreg); |
|
|
|
@ -1208,7 +1206,7 @@ switch ($action) { |
|
|
|
|
?> |
|
|
|
|
<div class="actions"> |
|
|
|
|
<a href="<?php echo api_get_self(); ?>?action=insert_tabs">
|
|
|
|
|
<?php Display::display_icon('addd.gif', get_lang('InsertLink')); echo get_lang('InsertLink'); ?> |
|
|
|
|
<?php echo Display::return_icon('add.png', get_lang('InsertLink')) .' '. get_lang('InsertLink'); ?> |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
<?php |
|
|
|
|