Merge pull request #1805 from Polycapa/1.11.x

Improve accessibility
pull/2487/head
Yannick Warnier 9 years ago committed by GitHub
commit 2ea3f25516
  1. 48
      main/auth/courses_categories.php
  2. 44
      main/inc/lib/course.lib.php
  3. 4
      main/inc/lib/message.lib.php
  4. 1
      main/inc/lib/social.lib.php
  5. 6
      main/inc/lib/usermanager.lib.php
  6. 2
      main/template/default/social/avatar_block.tpl

@ -332,17 +332,17 @@ function return_teacher($course)
$length = count($teachers);
foreach ($teachers as $value) {
$name = $value['firstname'].' ' . $value['lastname'];
if ($length > 2) {
$html .= '<a href="'.$value['url'].'" class="ajax" data-title="'.$name.'">
<img src="'.$value['avatar'].'"/></a>';
<img src="'.$value['avatar'].'" alt="'.$name.' ' .get_lang('Profile').'"/></a>';
} else {
$html .= '<a href="'.$value['url'].'" class="ajax" data-title="'.$name.'">
<img src="'.$value['avatar'].'"/></a>';
<img src="'.$value['avatar'].'" alt="'.$name.' ' .get_lang('Profile').'"/></a>';
$html .= '<div class="teachers-details"><h5>
<a href="'.$value['url'].'" class="ajax" data-title="'.$name.'">'
. $name . '</a></h5><p>'. get_lang('Teacher').'</p></div>';
}
//$count ++;
}
$html .= '</div>';
return $html;
@ -388,8 +388,15 @@ function return_description_button($course)
$title = $course['title'];
$html = '';
if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
$html = '<a data-title="' . $title . '" class="ajax btn btn-default btn-sm" href="'.api_get_path(WEB_CODE_PATH).'inc/ajax/course_home.ajax.php?a=show_course_information&code='.$course['code'].'" title="' . get_lang('Description') . '">' .
Display::returnFontAwesomeIcon('info-circle') . '</a>';
$html = Display::url(
Display::returnFontAwesomeIcon('info-circle'),
api_get_path(WEB_CODE_PATH).'inc/ajax/course_home.ajax.php?a=show_course_information&code='.$course['code'],
array(
'class' => 'ajax btn btn-default btn-sm',
'data-title' => $title,'title' => get_lang('Description'),
'aria-label' => get_lang('Description')
)
);
}
return $html;
@ -402,9 +409,12 @@ function return_description_button($course)
*/
function return_goto_button($course)
{
$html = ' <a class="btn btn-default btn-sm" title="' . get_lang('GoToCourse') . '" href="'.api_get_course_url($course['code']).'">'.
Display::returnFontAwesomeIcon('share').'</a>';
$title=get_lang('GoToCourse');
$html = Display::url(
Display::returnFontAwesomeIcon('share'),
api_get_course_url($course['code']),
array('class' => 'btn btn-default btn-sm', 'title' => $title, 'aria-label' => $title)
);
return $html;
}
@ -425,8 +435,8 @@ function return_already_registered_label($in_status)
$html = Display::tag(
'button',
$icon . ' ' . $title,
array('id' => 'register', 'class' => 'btn btn-default btn-sm', 'title' => $title)
$icon,
array('id' => 'register', 'class' => 'btn btn-default btn-sm', 'title' => $title, 'aria-label' => $title)
);
return $html;
@ -443,8 +453,13 @@ function return_already_registered_label($in_status)
*/
function return_register_button($course, $stok, $code, $search_term)
{
$html = ' <a class="btn btn-success btn-sm" title="' . get_lang('Subscribe') . '" href="'.api_get_self().'?action=subscribe_course&sec_token='.$stok.'&subscribe_course='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">' .
get_lang('Subscribe') .' '. Display::returnFontAwesomeIcon('sign-in') . '</a>';
$title = get_lang('Subscribe');
$html = Display::url(
Display::returnFontAwesomeIcon('sign-in'),
api_get_self() . '?action=subscribe_course&sec_token=' . $stok.
'&subscribe_course='.$course['code'].'&search_term='.$search_term.'&category_code='.$code,
array('class' => 'btn btn-success btn-sm', 'title' => $title, 'aria-label' => $title)
);
return $html;
}
@ -459,7 +474,12 @@ function return_register_button($course, $stok, $code, $search_term)
*/
function return_unregister_button($course, $stok, $search_term, $code)
{
$html = ' <a class="btn btn-danger btn-sm" title="' . get_lang('Unsubscribe') . '" href="'. api_get_self().'?action=unsubscribe&sec_token='.$stok.'&unsubscribe='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">' .
Display::returnFontAwesomeIcon('sign-out') . '</a>';
$title = get_lang('Unsubscribe');
$html = Display::url(
Display::returnFontAwesomeIcon('sign-in'),
api_get_self() . '?action=unsubscribe&sec_token='.$stok
.'&unsubscribe='.$course['code'].'&search_term='.$search_term.'&category_code='.$code,
array('class' => 'btn btn-success btn-sm', 'title' => $title, 'aria-label' => $title)
);
return $html;
}

@ -4819,7 +4819,12 @@ class CourseManager
$my_course['already_register_as'] = Display::tag(
'button',
$icon,
array('id' => 'register', 'class' => 'btn btn-default btn-sm', 'title' => $title)
array(
'id' => 'register',
'class' => 'btn btn-default btn-sm',
'title' => $title,
'aria-label' => $title
)
);
} elseif ($userRegisterdInCourseAsTeacher) {
// if user registered as teacher
@ -4828,7 +4833,12 @@ class CourseManager
$my_course['already_register_as'] = Display::tag(
'button',
$icon,
array('id' => 'register', 'class' => 'btn btn-default btn-sm', 'title' => $title)
array(
'id' => 'register',
'class' => 'btn btn-default btn-sm',
'title' => $title,
'aria-label' => $title
)
);
} */
@ -4837,9 +4847,15 @@ class CourseManager
$my_course['register_button'] = Display::url(
get_lang('Subscribe') . ' ' .
Display::returnFontAwesomeIcon('sign-in'),
api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php?action=subscribe&sec_token=' . $stok,
array('class' => 'btn btn-success btn-sm', 'title' => get_lang('Subscribe'))
api_get_path(WEB_COURSE_PATH) . $course_info['path'] .
'/index.php?action=subscribe&sec_token=' . $stok,
array(
'class' => 'btn btn-success btn-sm',
'title' => get_lang('Subscribe'),
'aria-label' => get_lang('Subscribe')
)
);
}
if ($access_link && in_array('enter',
@ -4849,17 +4865,28 @@ class CourseManager
get_lang('GoToCourse'). ' ' .
Display::returnFontAwesomeIcon('share'),
api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php',
array('class' => 'btn btn-default btn-sm', 'title' => get_lang('GoToCourse'))
array(
'class' => 'btn btn-default btn-sm',
'title' => get_lang('GoToCourse'),
'aria-label' => get_lang('GoToCourse')
)
);
}
if ($access_link && in_array('unsubscribe', $access_link)) {
$my_course['unsubscribe_button'] = Display::url(
get_lang('Unreg') . ' ' .
Display::returnFontAwesomeIcon('sign-out'),
api_get_path(WEB_CODE_PATH) . 'auth/courses.php?action=unsubscribe&unsubscribe=' . $courseCode . '&sec_token=' . $stok . '&category_code=' . $categoryCode,
array('class' => 'btn btn-danger btn-sm', 'title' => get_lang('Unreg'))
api_get_path(WEB_CODE_PATH) . 'auth/courses.php?action=unsubscribe&unsubscribe=' . $courseCode
. '&sec_token=' . $stok . '&category_code=' . $categoryCode,
array(
'class' => 'btn btn-danger btn-sm',
'title' => get_lang('Unreg'),
'aria-label' => get_lang('Unreg')
)
);
}
// start buycourse validation
@ -4890,7 +4917,8 @@ class CourseManager
[
'class' => 'btn btn-default btn-sm ajax',
'data-title' => get_lang('Description'),
'title' => get_lang('Description')
'title' => get_lang('Description'),
'aria-label' => get_lang('Description')
]
);
//}

@ -1862,7 +1862,9 @@ class MessageManager
FormValidator::LAYOUT_INLINE
);
$form->addElement('text', 'keyword');
$form->addElement('text', 'keyword', false, array(
'aria-label' => get_lang('Search')
));
$form->addButtonSearch(get_lang('Search'));
return $form;

@ -2014,6 +2014,7 @@ class SocialManager extends UserManager
[
'placeholder' => $socialWallPlaceholder,
'cols-size' => [1, 10, 1],
'aria-label' => $socialWallPlaceholder
]
);
$form->addHidden('url_content', '');

@ -3977,7 +3977,9 @@ class UserManager
FormValidator::LAYOUT_HORIZONTAL
);
$form->addText('q', get_lang('UsersGroups'), false);
$form->addText('q', get_lang('UsersGroups'), false, array(
"id" => "q"
));
$options = array(
0 => get_lang('Select'),
1 => get_lang('User'),
@ -3987,7 +3989,7 @@ class UserManager
'search_type',
get_lang('Type'),
$options,
array('onchange' => 'javascript: extra_field_toogle();')
array('onchange' => 'javascript: extra_field_toogle();', 'id' => 'search_type')
);
// Extra fields

@ -18,7 +18,7 @@
</div>
{% elseif show_user %}
<a href="{{ user_image.big }}" class="expand-image">
<img class="img-responsive img-circle" src="{{ user_image.big }}">
<img class="img-responsive img-circle" src="{{ user_image.big }}" alt="Avatar">
</a>
{% endif %}
</div>

Loading…
Cancel
Save