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 $actions = Display::url(
echo '<div class="actions">';
echo Display::url(
Display::return_icon('new_link.png', get_lang('Add URL'), [], ICON_SIZE_MEDIUM), Display::return_icon('new_link.png', get_lang('Add URL'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'admin/access_url_edit.php' 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), 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' 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), 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' api_get_path(WEB_CODE_PATH).'admin/access_url_edit_courses_to_url.php'
); );
$userGroup = new UserGroup(); $userGroup = new UserGroup();
if ($userGroup->getUseMultipleUrl()) { if ($userGroup->getUseMultipleUrl()) {
echo Display::url( $actions .= Display::url(
Display::return_icon('class.png', get_lang('Manage user groups'), [], ICON_SIZE_MEDIUM), 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' 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), 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' 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(); $data = UrlManager::get_url_data();
$urls = []; $urls = [];

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

Loading…
Cancel
Save