Minor - Replace hardcoded values of panel by a function

pull/2650/head
Julio Montoya 7 years ago
parent 53f3e61923
commit 1fc03fbdfa
  1. 40
      main/inc/lib/userportal.lib.php
  2. 3
      main/template/default/user_portal/classic_courses_with_category.html.twig
  3. 4
      main/template/default/user_portal/classic_courses_without_category.html.twig
  4. 4
      main/template/default/user_portal/classic_session.html.twig
  5. 2
      main/template/default/user_portal/grid_courses_with_category.html.twig
  6. 2
      main/template/default/user_portal/session_category.html.twig

@ -716,25 +716,21 @@ class IndexManager
) {
$html = '';
if (!empty($idAccordion)) {
$html .= '<div class="panel-group" id="'.$idAccordion.'" role="tablist" aria-multiselectable="true">';
/*$html .= '<div class="panel-group" id="'.$idAccordion.'" role="tablist" aria-multiselectable="true">';
$html .= '<div class="panel panel-default" id="'.$id.'">';
$html .= '<div class="panel-heading" role="tab"><h4 class="panel-title">';
$html .= '<a role="button" data-toggle="collapse" data-parent="#'.$idAccordion.'" href="#'.$idCollapse.'" aria-expanded="true" aria-controls="'.$idCollapse.'">'.$title.'</a>';
$html .= '</h4></div>';
$html .= '<div id="'.$idCollapse.'" class="panel-collapse collapse in" role="tabpanel">';
$html .= '<div class="panel-body">'.$content.'</div>';
$html .= '</div></div></div>';
$html .= '</div></div></div>';*/
$html = Display::panel($content, $title);
} else {
if (!empty($id)) {
/*if (!empty($id)) {
$params['id'] = $id;
}
$params['class'] = 'panel panel-default';
$html = null;
if (!empty($title)) {
$html .= '<div class="panel-heading">'.$title.'</div>';
}
$html .= '<div class="panel-body">'.$content.'</div>';
$html = Display::div($html, $params);
} */
$html = Display::panel($content, $title);
}
return $html;
@ -1941,14 +1937,7 @@ class IndexManager
foreach ($listCoursesInSession[$userCategoryId]['courseInUserCatList'] as $i => $listCourse) {
// add course
$listCoursesAlreadyDisplayed[$listCourse['courseId']] = 1;
if ($userCategoryId == 0) {
$htmlCategory .= '<div class="panel panel-default">';
} else {
$htmlCategory .= '<div class="panel panel-default">';
}
$htmlCategory .= '<div class="panel-body">';
$coursesInfo = $listCourse['course'];
$htmlCategory .= self::getHtmlForCourse(
$coursesInfo,
$userCategoryId,
@ -1981,8 +1970,8 @@ class IndexManager
$htmlSessionCategory .= $htmlSession;
}
$htmlSessionCategory .= '</div>'; // end session cat block
$htmlCategory .= $htmlSessionCategory.'</div></div>';
$htmlCategory .= ''; // end course block
$htmlCategory .= Display::panel($htmlSessionCategory, '');
}
$userCategoryHtml .= $htmlCategory;
}
@ -1994,20 +1983,13 @@ class IndexManager
if ($listCourse['userCatId'] == $userCategoryId &&
!isset($listCoursesAlreadyDisplayed[$listCourse['id']])
) {
if ($userCategoryId != 0) {
$htmlCategory .= '<div class="panel panel-default">';
} else {
$htmlCategory .= '<div class="panel panel-default">';
}
$htmlCategory .= '<div class="panel-body">';
$htmlCategory .= self::getHtmlForCourse(
$body = self::getHtmlForCourse(
$listCourse['course'],
$userCategoryId,
0,
$loadDirs
);
$htmlCategory .= '</div></div>';
$htmlCategory .= Display::panel($body, '');
}
}
$htmlCategory .= '';

@ -1,3 +1,4 @@
{% autoescape false %}
{% if not categories is empty %}
<div class="classic-courses">
{% for category in categories %}
@ -100,4 +101,4 @@
{% endfor %}
</div>
{% endif %}
{% endautoescape %}

@ -1,3 +1,4 @@
{% autoescape false %}
{% if not courses is empty %}
<div class="classic-courses">
{% for item in courses %}
@ -95,4 +96,5 @@
</div>
{% endfor %}
</div>
{% endif %}
{% endif %}
{% endautoescape %}

@ -1,3 +1,4 @@
{% autoescape false %}
{% for row in session %}
<div class="panel panel-default">
{% if not row.show_simple_session_info %}
@ -142,4 +143,5 @@
<!-- end view simple info -->
{% endif %}
</div>
{% endfor %}
{% endfor %}
{% endautoescape %}

@ -1,3 +1,4 @@
{% autoescape false %}
<div class="grid-courses">
{% for category in courses.in_category %}
{% set nameCategory = category.title_category %}
@ -98,3 +99,4 @@
</div>
{% endfor %}
</div>
{% endautoescape %}

@ -1,3 +1,4 @@
{% autoescape false %}
<div class="panel panel-default">
<div class="panel-body">
<div class="row">
@ -32,3 +33,4 @@
{{ session_category.sessions }}
</div>
</div>
{% endautoescape %}
Loading…
Cancel
Save