Fix toolbarAction calls

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent 2c1dfe2ce7
commit c1294ca5d7
  1. 12
      main/admin/dashboard_add_courses_to_user.php
  2. 19
      main/admin/dashboard_add_sessions_to_user.php
  3. 2
      main/coursecopy/copy_course_session.php
  4. 16
      main/document/create_document.php
  5. 4
      main/document/upload.php
  6. 2
      main/gradebook/index.php
  7. 3
      main/group/group.php
  8. 4
      main/inc/lib/display.lib.php
  9. 12
      main/lp/learnpath.class.php
  10. 7
      main/mySpace/course.php
  11. 3
      main/mySpace/student.php
  12. 2
      main/mySpace/teachers.php
  13. 13
      main/mySpace/users.php
  14. 8
      main/tracking/courseLog.php
  15. 10
      main/tracking/exams.php
  16. 9
      main/user/class.php
  17. 7
      main/user/subscribe_user.php
  18. 9
      main/wiki/wiki.inc.php

@ -171,12 +171,18 @@ Display::display_header($tool_name);
// actions
$actionsLeft = '<a href="dashboard_add_users_to_user.php?user='.$user_id.'">'.Display::return_icon('add-user.png', get_lang('AssignUsers'), null, ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a href="dashboard_add_sessions_to_user.php?user='.$user_id.'">'.Display::return_icon('session-add.png', get_lang('AssignSessions'), null, ICON_SIZE_MEDIUM).'</a>';
$actionsLeft = '<a href="dashboard_add_users_to_user.php?user='.$user_id.'">'.
Display::return_icon('add-user.png', get_lang('AssignUsers'), null, ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a href="dashboard_add_sessions_to_user.php?user='.$user_id.'">'.
Display::return_icon('session-add.png', get_lang('AssignSessions'), null, ICON_SIZE_MEDIUM).'</a>';
echo $html = Display::toolbarAction('toolbar-dashboard', array($actionsLeft));
echo Display::page_header(sprintf(get_lang('AssignCoursesToX'), api_get_person_name($user_info['firstname'], $user_info['lastname'])), null, 'h3');
echo Display::page_header(
sprintf(get_lang('AssignCoursesToX'), api_get_person_name($user_info['firstname'], $user_info['lastname'])),
null,
'h3'
);
$assigned_courses_to_hrm = CourseManager::get_courses_followed_by_drh($user_id);
$assigned_courses_code = array_keys($assigned_courses_to_hrm);

@ -165,17 +165,20 @@ if (isset($_POST['formSent']) && intval($_POST['formSent']) == 1) {
// display header
Display::display_header($tool_name);
// actions
// Actions
if ($user_info['status'] != SESSIONADMIN) {
$actionsLeft = '<a href="dashboard_add_users_to_user.php?user='.$user_id.'">' . Display::return_icon('add-user.png', get_lang('AssignUsers'), null, ICON_SIZE_MEDIUM ) . '</a>';
$actionsLeft .= '<a href="dashboard_add_courses_to_user.php?user='.$user_id.'">' . Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM) . '</a>';
$actionsLeft = '<a href="dashboard_add_users_to_user.php?user='.$user_id.'">' .
Display::return_icon('add-user.png', get_lang('AssignUsers'), null, ICON_SIZE_MEDIUM ) . '</a>';
$actionsLeft .= '<a href="dashboard_add_courses_to_user.php?user='.$user_id.'">' .
Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM) . '</a>';
}
echo Display::toolbarAction('toolbar-dashboard', array( 0 => $actionsLeft, 1 => ''));
echo Display::page_header(sprintf(get_lang('AssignSessionsToX'), api_get_person_name($user_info['firstname'], $user_info['lastname'])), null, 'h3');
echo Display::toolbarAction('toolbar-dashboard', array($actionsLeft));
echo Display::page_header(
sprintf(get_lang('AssignSessionsToX'), api_get_person_name($user_info['firstname'], $user_info['lastname'])),
null,
'h3'
);
$assigned_sessions_to_hrm = SessionManager::get_sessions_followed_by_drh($user_id);
$assigned_sessions_id = array_keys($assigned_sessions_to_hrm);

@ -95,7 +95,7 @@ function display_form()
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM).
'</a>';
$html .= Display::toolbarAction('toolbar-copysession', array(0 => $actionsLeft));
$html .= Display::toolbarAction('toolbar-copysession', array($actionsLeft));
$html .= Display::return_message(get_lang('CopyCourseFromSessionToSessionExplanation'), 'warning');

@ -610,18 +610,23 @@ if ($form->validate()) {
if ($is_certificate_mode) {
$actionsLeft = '<a href="document.php?certificate=true&id='.$folder_id.'&selectcat=' . Security::remove_XSS($_GET['selectcat']).'">'.
Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('CertificateOverview'),'',ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="hide_bar_template" href="#">'.Display::return_icon('expand.png',get_lang('Back'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Back'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="hide_bar_template" href="#">'.
Display::return_icon('expand.png',get_lang('Back'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Back'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>';
} else {
$actionsLeft = '<a href="document.php?curdirpath='.Security::remove_XSS($dir).'">'.
Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="hide_bar_template" href="#">'.Display::return_icon('expand.png',get_lang('Expand'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Collapse'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="hide_bar_template" href="#">'.
Display::return_icon('expand.png',get_lang('Expand'),array('id'=>'expand'),ICON_SIZE_MEDIUM).
Display::return_icon('contract.png',get_lang('Collapse'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>';
}
echo $toolbar = Display::toolbarAction('actions-documents', array(0 => $actionsLeft, 1 => ''));
echo $toolbar = Display::toolbarAction('actions-documents', array($actionsLeft));
if ($is_certificate_mode) {
$all_information_by_create_certificate = DocumentManager::get_all_info_to_certificate(api_get_user_id(), api_get_course_id());
$all_information_by_create_certificate = DocumentManager::get_all_info_to_certificate(
api_get_user_id(),
api_get_course_id()
);
$str_info = '';
foreach ($all_information_by_create_certificate[0] as $info_value) {
@ -630,6 +635,7 @@ if ($form->validate()) {
$create_certificate = get_lang('CreateCertificateWithTags');
Display::display_normal_message($create_certificate.': <br /><br/>'.$str_info,false);
}
// HTML-editor
echo '<div class="page-create">
<div class="row" style="overflow:hidden">

@ -198,7 +198,6 @@ if (!empty($_FILES)) {
}
// Actions
// Link back to the documents overview
if ($is_certificate_mode) {
$actions = '<a href="document.php?id='.$document_id.'&selectcat=' . $selectcat.'&'.api_get_cidreq().'">'.
@ -209,8 +208,7 @@ if ($is_certificate_mode) {
}
// Link to create a folder
echo $toolbar = Display::toolbarAction('toolbar-upload', array(0 => $actions), 1);
echo $toolbar = Display::toolbarAction('toolbar-upload', array($actions), 1);
// Form to select directory
$folders = DocumentManager::get_all_document_folders($_course, $groupId, $is_allowed_to_edit);
if (!$is_certificate_mode) {

@ -787,7 +787,7 @@ if (!api_is_allowed_to_edit(null, true)) {
);
}
echo $toolbar = Display::toolbarAction('gradebook-student-actions', array(0 => $actionsLeft, 1 => ''));
echo $toolbar = Display::toolbarAction('gradebook-student-actions', array($actionsLeft));
if (api_is_allowed_to_edit(null, true)) {
// Tool introduction

@ -194,9 +194,8 @@ if (api_is_allowed_to_edit(false, true)) {
Display::return_icon('group_summary.png', get_lang('GroupOverview'), '', ICON_SIZE_MEDIUM).'</a>';
}
$actionsRight = GroupManager::getSearchForm();
$toolbar = Display::toolbarAction('toolbar-groups', $content = array( 0 => $actionsLeft, 1 => $actionsRight ));
$toolbar = Display::toolbarAction('toolbar-groups', $content = array($actionsLeft, $actionsRight));
$group_cats = GroupManager::get_categories(api_get_course_id());
echo $toolbar;

@ -2371,7 +2371,9 @@ class Display
$html .= '<div id="' . $id . '" class="actions">';
$html .= '<div class="row">';
if ($col > 4) {
$html = '<div class="alert alert-warning" role="alert">Action toolbar design does not work when exceeding four columns - check Display::toolbarAction()</div>';
$html = '<div class="alert alert-warning" role="alert">
Action toolbar design does not work when exceeding four columns - check Display::toolbarAction()
</div>';
} else {
for ($i = 0; $i < $col; $i++) {
$html .= '<div class="col-md-' . $columns . '">';

@ -5911,8 +5911,7 @@ class learnpath
public function build_action_menu($returnContent = false)
{
$gradebook = isset($_GET['gradebook']) ? Security :: remove_XSS($_GET['gradebook']) : null;
$actionsLeft = null;
$actionsLeft = '';
$actionsLeft .= '<a href="lp_controller.php?'.api_get_cidreq().'&gradebook=' . $gradebook . '&action=view&lp_id=' . $_SESSION['oLP']->lp_id . '&isStudentView=true" target="_self">' . Display :: return_icon('preview_view.png', get_lang('Display'),'',ICON_SIZE_MEDIUM).'</a> ';
$actionsLeft .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=admin_view&lp_id=' . $_SESSION['oLP']->lp_id . '&updateaudio=true">' . Display :: return_icon('upload_audio.png', get_lang('UpdateAllAudioFragments'),'',ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a href="lp_controller.php?'.api_get_cidreq().'&action=edit&lp_id=' . $_SESSION['oLP']->lp_id . '">' . Display :: return_icon('settings.png', get_lang('CourseSettings'),'',ICON_SIZE_MEDIUM).'</a>';
@ -5927,15 +5926,16 @@ class learnpath
'href' => 'lp_controller.php?'.api_get_cidreq().'&action=clear_prerequisites&lp_id=' . $_SESSION['oLP']->lp_id,
),
);
$actionsRigth = Display::group_button(get_lang('PrerequisitesOptions'), $buttons);
$actionsRight = Display::group_button(get_lang('PrerequisitesOptions'), $buttons);
$toolbar = Display::toolbarAction('actions-lp-controller', array($actionsLeft, $actionsRight));
if ($returnContent) {
return $toolbar=null;
}
echo $toolbar = Display::toolbarAction('actions-lp-controller', array(0 => $actionsLeft, 1 => $actionsRigth));
return $toolbar;
}
echo $toolbar;
}
/**

@ -114,8 +114,8 @@ if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) {
$actionsLeft .= $item;
}
}
if (count($a_courses) > 0) {
if (count($a_courses) > 0) {
$actionsRight .= Display::url(
Display::return_icon('printer.png', get_lang('Print'), array(), 32),
'javascript: void(0);',
@ -124,10 +124,8 @@ if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) {
}
$toolbar = Display::toolbarAction('toolbar-course', $content = array( 0 => $actionsLeft, 1 => $actionsRight ));
$toolbar = Display::toolbarAction('toolbar-course', [$actionsLeft, $actionsRight]);
echo $toolbar;
echo Display::page_header($title);
}
@ -300,7 +298,6 @@ function get_courses($from, $limit, $column, $direction)
return $courseList;
}
$table = new SortableTable(
'tracking_course',
'get_count_courses',

@ -241,8 +241,7 @@ $actionsRight .= Display::url(
api_get_self().'?export=csv&keyword='.$keyword
);
$toolbar = Display::toolbarAction('toolbar-student', $content = array( 0 => $actionsLeft, 1 => $actionsRight ));
$toolbar = Display::toolbarAction('toolbar-student', [$actionsLeft, $actionsRight]);
$table = new SortableTable(
'tracking_student',

@ -208,7 +208,7 @@ $actionsRight .= Display::url(
);
$toolbar = Display::toolbarAction('toolbar-teachers', $content = array( 0 => $actionsLeft, 1 => $actionsRight ));
$toolbar = Display::toolbarAction('toolbar-teachers', [$actionsLeft, $actionsRight]);
$table = new SortableTable(
'tracking_teachers',

@ -197,9 +197,16 @@ if (api_is_drh()) {
}
}
$actionsRight = Display::url(Display::return_icon('printer.png', get_lang('Print'), array(), ICON_SIZE_MEDIUM), 'javascript: void(0);', array('onclick'=>'javascript: window.print();'));
$actionsRight .= Display::url(Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), array(), ICON_SIZE_MEDIUM), api_get_self().'?export=csv&keyword='.$keyword);
$toolbar = Display::toolbarAction('toolbar-user', $content = array( 0 => $actionsLeft, 1 => $actionsRight ));
$actionsRight = Display::url(
Display::return_icon('printer.png', get_lang('Print'), array(), ICON_SIZE_MEDIUM),
'javascript: void(0);',
array('onclick'=>'javascript: window.print();')
);
$actionsRight .= Display::url(
Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), array(), ICON_SIZE_MEDIUM),
api_get_self().'?export=csv&keyword='.$keyword
);
$toolbar = Display::toolbarAction('toolbar-user', [$actionsLeft, $actionsRight]);
$table = new SortableTable(
'tracking_student',

@ -261,21 +261,15 @@ $form_search->addElement('hidden', 'session_id', $sessionId);
$form_search->addElement('hidden', 'id_session', $sessionId);
$form_search->addElement('text', 'user_keyword');
$form_search->addButtonSearch(get_lang('SearchUsers'));
echo Display::toolbarAction('toolbar-courselog', array( 0 => $actionsLeft, 1 => $form_search->returnForm(), 2 => $actionsRight ), 3);
echo Display::toolbarAction('toolbar-courselog', [$actionsLeft, $form_search->returnForm(), $actionsRight], 3);
$course_name = get_lang('Course').' '.$courseInfo['name'];
if ($session_id) {
$titleSession = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.api_get_session_name($session_id);
$titleCourse = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_name;
} else {
$titleSession = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$courseInfo['name'];
}
$teacherList = CourseManager::get_teacher_list_from_course_code_to_string(
$courseInfo['code'],
',',

@ -68,7 +68,6 @@ if ($global) {
while ($row = Database::fetch_array($result)) {
$exerciseList[$row['id']] = $row['title'];
}
$form->addElement('select', 'exercise_id', get_lang('Exercise'), $exerciseList);
}
@ -83,13 +82,9 @@ if (!$exportToXLS) {
Display :: display_header(get_lang('Reporting'));
$actionsLeft = $actionsRight ='';
if ($global) {
$actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'auth/my_progress.php">'.
Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM);
$actionsLeft .= '</a>';
$courseLink = '';
$courseInfo = api_get_course_info();
@ -102,7 +97,6 @@ if (!$exportToXLS) {
$actionsRight .= '<a href="javascript: void(0);" onclick="javascript: window.print()">'.
Display::return_icon('printer.png',get_lang('Print'),'',ICON_SIZE_MEDIUM).'</a>';
$menuItems[] = Display::url(
Display::return_icon('teacher.png', get_lang('TeacherInterface'), array(), 32),
api_get_path(WEB_CODE_PATH).'mySpace/?view=teacher'
@ -143,11 +137,9 @@ if (!$exportToXLS) {
Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), array(), 32),
api_get_self().'?'.api_get_cidreq().'&export=1&score='.$filter_score.'&exercise_id='.$exerciseId
);
}
$toolbar = Display::toolbarAction('toolbar-exams', $content = array( 0 => $actionsLeft, 1 => $actionsRight ));
$toolbar = Display::toolbarAction('toolbar-exams', [$actionsLeft, $actionsRight]);
echo $toolbar;
$form->display();

@ -41,8 +41,7 @@ $actionsLeft = '';
$actionsRight = '';
$usergroup = new UserGroup();
if (api_is_allowed_to_edit()) {
if ($type == 'registered') {
if ($type === 'registered') {
$actionsLeft .= '<a href="class.php?'.api_get_cidreq().'&type=not_registered">'.
Display::return_icon('add-class.png', get_lang("AddClassesToACourse"), array(), ICON_SIZE_MEDIUM).'</a>';
} else {
@ -53,15 +52,13 @@ if (api_is_allowed_to_edit()) {
$options = [
-1 => get_lang('All'),
1 => get_lang('SocialGroups'),
0 => get_lang('Classes'),
0 => get_lang('Classes')
];
$form->addSelect('group_filter', get_lang('Groups'), $options, ['id' => 'group_filter']);
$form->setDefaults(['group_filter' => $groupFilter]);
$actionsRight = $form->returnForm();
}
$actions = Display::toolbarAction('actions-class', array(0=>$actionsLeft, 1=> $actionsRight));
$actions = Display::toolbarAction('actions-class', [$actionsLeft, $actionsRight]);
}
if (api_is_allowed_to_edit()) {

@ -255,14 +255,13 @@ $form = new FormValidator('search_user', 'get', '', '', null, FormValidator::LAY
$form->addText('keyword', '', false);
$form->addElement('hidden', 'type', $type);
$form->addButtonSearch(get_lang('Search'));
echo Display::toolbarAction('toolbar-subscriber', array(0 => $actionsLeft, 1 => $form->returnForm()));
echo Display::toolbarAction('toolbar-subscriber', [$actionsLeft, $form->returnForm()]);
$option = $type == COURSEMANAGER ? 2 : 1;
echo UserManager::getUserSubscriptionTab($option);
// Display table
$table->display();
Display::display_footer();
/* SHOW LIST OF USERS */
@ -281,10 +280,8 @@ function get_number_of_users()
$courseCode = api_get_course_id();
$sessionId = api_get_session_id();
if (isset($_REQUEST['type']) && $_REQUEST['type']=='teacher') {
if (isset($_REQUEST['type']) && $_REQUEST['type'] === 'teacher') {
if (api_get_session_id() != 0) {
$sql = "SELECT COUNT(u.user_id)
FROM $user_table u
LEFT JOIN $tbl_session_rel_course_user cu

@ -1093,9 +1093,7 @@ class Wiki
);
}
echo Display::toolbarAction('toolbar-wikistudent', array(0 => $actionsLeft, 1 => $actionsRight));
echo Display::toolbarAction('toolbar-wikistudent', [$actionsLeft, $actionsRight]);
if (empty($title)) {
$pageTitle = get_lang('DefaultTitle');
@ -1107,7 +1105,6 @@ class Wiki
$pageTitle = api_htmlentities($title);
}
$pageWiki = self::make_wiki_link_clickable(
self::detect_external_link(
self::detect_anchor_link(
@ -4747,9 +4744,7 @@ class Wiki
// menu recent changes
$actionsLeft .= '<a class="btn btn-default" href="index.php?cidReq='.$_course['id'].'&action=recentchanges&session_id='.$session_id.'&group_id='.$groupId.'"'.self::is_active_navigation_tab('recentchanges').'>'.
get_lang('RecentChanges').'</a>';
echo Display::toolbarAction('toolbar-wiki', array( 0 => $actionsLeft));
echo Display::toolbarAction('toolbar-wiki', [$actionsLeft]);
}
/**

Loading…
Cancel
Save