Replace custom div actions with a function

pull/3890/head
Julio Montoya 4 years ago
parent 5aee5e5a7a
commit b1cb23d0b5
  1. 14
      public/main/admin/access_urls.php
  2. 17
      public/main/admin/course_information.php

@ -114,35 +114,33 @@ if (-1 == $current_access_url_id) {
}
}
// action menu
echo '<div class="actions">';
echo Display::url(
$actions = Display::url(
Display::return_icon('new_link.png', get_lang('Add URL'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'admin/access_url_edit.php'
);
echo Display::url(
$actions .= Display::url(
Display::return_icon('user.png', get_lang('Manage users'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'admin/access_url_edit_users_to_url.php'
);
echo Display::url(
$actions .= Display::url(
Display::return_icon('course.png', get_lang('Manage courses'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'admin/access_url_edit_courses_to_url.php'
);
$userGroup = new UserGroup();
if ($userGroup->getUseMultipleUrl()) {
echo Display::url(
$actions .= Display::url(
Display::return_icon('class.png', get_lang('Manage user groups'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'admin/access_url_edit_usergroup_to_url.php'
);
}
echo Display::url(
$actions .= Display::url(
Display::return_icon('folder.png', get_lang('Manage course categories'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'admin/access_url_edit_course_category_to_url.php'
);
echo '</div>';
echo Display::toolbarAction('urls', [$actions]);
$data = UrlManager::get_url_data();
$urls = [];

@ -97,13 +97,16 @@ $interbreadcrumb[] = ['url' => 'course_list.php', 'name' => get_lang('Courses')]
$courseId = $courseInfo['real_id'];
$tool_name = $courseInfo['title'].' ('.$courseInfo['visual_code'].')';
Display::display_header($tool_name);
?>
<div class="actions">
<a href="<?php echo $courseInfo['course_public_url']; ?>">
<?php Display::display_icon('home.png', get_lang('Course home'), [], ICON_SIZE_MEDIUM); ?>
</a>
</div>
<?php
echo Display::toolbarAction(
'info',
[
Display::url(
Display::return_icon('home.png', get_lang('Course home'), [], ICON_SIZE_MEDIUM),
$courseInfo['course_public_url']
),
]
);
/*echo Display::page_header(get_lang('Course usage'));
$table = new SortableTableFromArray(

Loading…
Cancel
Save