Use bootstrap tab instead of jquery-ui.

1.10.x
Julio Montoya 11 years ago
parent ae05cd20e3
commit ac6f010ebe
  1. 2
      main/document/upload.php
  2. 27
      main/inc/lib/display.lib.php
  3. 12
      main/newscorm/lp_add_item.php
  4. 7
      main/template/default/layout/footer.tpl

@ -78,8 +78,8 @@ $(function () {
return $('<tr><td>' + file.name + '<\/td> <td> ' + file.size + ' <\/td> <td>&nbsp;' + file.result + ' <\/td> <\/tr>'); return $('<tr><td>' + file.name + '<\/td> <td> ' + file.size + ' <\/td> <td>&nbsp;' + file.result + ' <\/td> <\/tr>');
} }
}); });
$('#tabs').tabs();
}); });
</script>"; </script>";
// Variables // Variables

@ -1018,21 +1018,36 @@ class Display
$lis = ''; $lis = '';
$i = 1; $i = 1;
foreach ($header_list as $item) { foreach ($header_list as $item) {
$item =self::tag('a', $item, array('href'=>'#'.$id.'-'.$i)); $active = '';
$lis .=self::tag('li', $item, $ul_attributes); if ($i == 1) {
$active = ' active';
}
$item = self::tag('a', $item, array('href'=>'#'.$id.'-'.$i, 'role'=> 'tab'));
$ul_attributes['data-toggle'] = 'tab';
$ul_attributes['role'] = 'presentation';
$ul_attributes['class'] = $active;
$lis .= self::tag('li', $item, $ul_attributes);
$i++; $i++;
} }
$ul = self::tag('ul',$lis); $ul = self::tag('ul', $lis, ['class' => 'nav nav-tabs', 'role'=> 'tablist']);
$i = 1; $i = 1;
$divs = ''; $divs = '';
foreach ($content_list as $content) { foreach ($content_list as $content) {
$content = self::tag('p',$content); $active = '';
$divs .=self::tag('div', $content, array('id'=>$id.'-'.$i)); if ($i == 1) {
$active = ' active';
}
$divs .= self::tag('div', $content, array('id'=> $id.'-'.$i, 'class' => 'tab-pane '.$active, 'role' => 'tabpanel'));
$i++; $i++;
} }
$attributes['id'] = $id; $attributes['id'] = $id;
$main_div = self::tag('div',$ul.$divs, $attributes); $attributes['role'] = 'tabpanel';
$attributes['class'] = 'tab-wrapper';
$main_div = self::tag('div', $ul.self::tag('div', $divs, ['class' => 'tab-content']), $attributes);
return $main_div ; return $main_div ;
} }

@ -48,9 +48,6 @@ $(function() {
load_cbo($(\'#idParent\').val()); load_cbo($(\'#idParent\').val());
} }
} }
//Loads LP item tabs
$("#resource_tab").tabs();
$(\'.lp_resource_element\').click(function() { $(\'.lp_resource_element\').click(function() {
window.location.href = $(\'a\', this).attr(\'href\'); window.location.href = $(\'a\', this).attr(\'href\');
}); });
@ -99,14 +96,14 @@ $interbreadcrumb[] = array('url' => api_get_self()."?action=build&lp_id=$learnpa
switch ($type) { switch ($type) {
case 'chapter': case 'chapter':
$interbreadcrumb[]= array ('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$learnPath->get_id(), 'name' => get_lang('NewStep')); $interbreadcrumb[]= array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$learnPath->get_id(), 'name' => get_lang('NewStep'));
$interbreadcrumb[]= array ('url' => '#', 'name' => get_lang('NewChapter')); $interbreadcrumb[]= array('url' => '#', 'name' => get_lang('NewChapter'));
break; break;
case 'document': case 'document':
$interbreadcrumb[]= array ('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$learnPath->get_id(), 'name' => get_lang('NewStep')); $interbreadcrumb[]= array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$learnPath->get_id(), 'name' => get_lang('NewStep'));
break; break;
default: default:
$interbreadcrumb[]= array ('url' => '#', 'name' => get_lang('NewStep')); $interbreadcrumb[]= array('url' => '#', 'name' => get_lang('NewStep'));
break; break;
} }
@ -194,7 +191,6 @@ if (in_array($message, array('ItemUpdated'))) {
} }
if (isset($new_item_id) && is_numeric($new_item_id)) { if (isset($new_item_id) && is_numeric($new_item_id)) {
switch ($type) { switch ($type) {
case 'chapter': case 'chapter':
echo $learnPath->display_manipulate($new_item_id, $_POST['type']); echo $learnPath->display_manipulate($new_item_id, $_POST['type']);

@ -90,6 +90,13 @@
$.datepicker.setDefaults($.datepicker.regional["{{ locale }}"]); $.datepicker.setDefaults($.datepicker.regional["{{ locale }}"]);
$.datepicker.regional["local"] = $.datepicker.regional["{{ locale }}"]; $.datepicker.regional["local"] = $.datepicker.regional["{{ locale }}"];
$('.tab-wrapper a').click(function (e) {
e.preventDefault()
$(this).tab('show');
//$('#tabs a:first').tab('show') // Select first tab
})
/** /**
* Advanced options * Advanced options
* Usage * Usage

Loading…
Cancel
Save