Adding Display::label function in order to use inline labels

skala
Julio Montoya 14 years ago
parent d5ddbe414c
commit 4c2539d64d
  1. 13
      main/css/base.css
  2. 4
      main/exercice/exercise.lib.php
  3. 10
      main/exercice/overview.php
  4. 28
      main/inc/lib/display.lib.php

@ -19,7 +19,7 @@ select {
visibility: visible;
}
.label {
form .label {
padding: 1px 3px 2px;
font-size: 100%;
font-weight: normal;
@ -115,10 +115,13 @@ form .formw input {
height:26px;
}
#lp_navigation_elem .buttons,
#lp_navigation_elem #progress_bar {
width:130px;
margin:0px 0px 10px 15px;
#lp_navigation_elem .buttons{
margin-bottom: 5px;
}
#lp_navigation_elem {
padding-left: 15px;
width: 110px;
}
* {

@ -1130,9 +1130,9 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
}
if ($revised) {
$revised = Display::span(get_lang('Validated'), array('class'=>'label_tag success'));
$revised = Display::label(get_lang('Validated'), 'success');
} else {
$revised = Display::span(get_lang('NotValidated'), array('class'=>'label_tag notice'));
$revised = Display::label(get_lang('NotValidated'), 'info');
}
if ($is_allowedToEdit || $is_tutor) {

@ -102,7 +102,6 @@ if ($visible_return['value'] == false) {
$exercise_url_button = $visible_return['message'];
}
//Message "you already try this exercise"
$message = '';
@ -126,17 +125,17 @@ $table_content = '';
if (!empty($attempts)) {
$i = $counter;
foreach ($attempts as $attempt_result) {
foreach ($attempts as $attempt_result) {
$score = show_score($attempt_result['exe_result'], $attempt_result['exe_weighting']);
$attempt_url = api_get_path(WEB_CODE_PATH).'exercice/result.php?'.api_get_cidreq().'&id='.$attempt_result['exe_id'].'&id_session='.api_get_session_id().'&height=500&width=750';
$attempt_link = Display::url(get_lang('Show'), $attempt_url, array('class'=>'ajax btn'));
$teacher_revised = Display::span(get_lang('Validated'), array('class'=>'label_tag success'));
$teacher_revised = Display::label(get_lang('Validated'), 'success');
//$attempt_link = get_lang('NoResult');
//$attempt_link = Display::return_icon('quiz_na.png', get_lang('NoResult'), array(), ICON_SIZE_SMALL);
if ($attempt_result['attempt_revised'] == 0) {
$teacher_revised = Display::span(get_lang('NotValidated'), array('class'=>'label_tag notice'));
$teacher_revised = Display::label(get_lang('NotValidated'), 'info');
}
$row = array('count' => $i,
'date' => api_convert_and_format_date($attempt_result['start_date'], DATE_TIME_FORMAT_LONG)
@ -167,8 +166,7 @@ if (!empty($attempts)) {
case EXERCISE_FEEDBACK_TYPE_EXAM:
$header_names = array(get_lang('Attempt'), get_lang('Date'), get_lang('Score'));
break;
}
}
$row = 0;
$column = 0;
foreach ($header_names as $item) {

@ -1379,4 +1379,32 @@ class Display {
return '';
}
function label($content, $type = 'default') {
$class = '';
switch ($type) {
case 'success':
$class = 'label-success';
break;
case 'warning':
$class = 'label-warning';
break;
case 'important':
$class = 'label-important';
break;
case 'info':
$class = 'label-info';
break;
case 'inverse':
$class = 'label-inverse';
break;
}
$html = '';
if (!empty($content)) {
$html = '<span class="label '.$class.'">';
$html .= $content;
$html .='</span>';
}
return $html;
}
} //end class Display

Loading…
Cancel
Save