Minor - Format code - refs BT#9049

1.10.x
Angel Fernando Quiroz Campos 10 years ago
parent dc773819ce
commit 126984ea2d
  1. 21
      main/inc/ajax/session.ajax.php
  2. 84
      main/template/default/auth/sessions_catalog.tpl

@ -3,7 +3,6 @@
/**
* Responses to AJAX calls
*/
$language_file[] = 'admin';
require_once '../global.inc.php';
@ -16,7 +15,7 @@ switch ($action) {
$list_sessions = SessionManager::get_sessions_by_user($user_id, true);
if (!empty($list_sessions)) {
foreach ($list_sessions as $session_item) {
echo $session_item['session_name'].'<br />';
echo $session_item['session_name'] . '<br />';
}
} else {
echo get_lang('NoSessionsForThisUser');
@ -28,7 +27,7 @@ switch ($action) {
if (api_is_platform_admin()) {
//$results = SessionManager::get_sessions_list(array('s.name LIKE' => "%".$_REQUEST['q']."%"));
$results = SessionManager::get_sessions_list(
array('s.name LIKE' => "%".$_REQUEST['q']."%")
array('s.name LIKE' => "%" . $_REQUEST['q'] . "%")
);
$results2 = array();
if (!empty($results)) {
@ -52,7 +51,7 @@ switch ($action) {
break;
case 'search_session_all':
if (api_is_platform_admin()) {
$results = SessionManager::get_sessions_list(array('s.name LIKE' => "%".$_REQUEST['q']."%", 'c.id ='=>$_REQUEST['course_id']));
$results = SessionManager::get_sessions_list(array('s.name LIKE' => "%" . $_REQUEST['q'] . "%", 'c.id =' => $_REQUEST['course_id']));
$results2 = array();
if (!empty($results)) {
foreach ($results as $item) {
@ -76,7 +75,7 @@ switch ($action) {
break;
case 'search_session_by_course':
if (api_is_platform_admin()) {
$results = SessionManager::get_sessions_list(array('s.name LIKE' => "%".$_REQUEST['q']."%", 'c.id ='=>$_REQUEST['course_id']));
$results = SessionManager::get_sessions_list(array('s.name LIKE' => "%" . $_REQUEST['q'] . "%", 'c.id =' => $_REQUEST['course_id']));
$results2 = array();
if (!empty($results)) {
foreach ($results as $item) {
@ -110,14 +109,14 @@ switch ($action) {
if (class_exists('AdvancedSessionsPlugin') && AdvancedSessionsPlugin::hasDescriptionField()) {
$sessionInfo = api_get_session_info($sessionId);
?>
<h2><?php echo $sessionInfo['name'] ?></h2><br>
<div class="home-course-intro">
<div class="page-course">
<div class="page-course-intro">
<p><?php echo AdvancedSessionsPlugin::getSessionDescription($sessionId) ?></p>
</div>
<h2><?php echo $sessionInfo['name'] ?></h2><br>
<div class="home-course-intro">
<div class="page-course">
<div class="page-course-intro">
<p><?php echo AdvancedSessionsPlugin::getSessionDescription($sessionId) ?></p>
</div>
</div>
</div>
<?php
}
default:

@ -87,70 +87,70 @@
{% if showSessions %}
<div class="well sidebar-nav">
<h4>{{ 'Sessions' | get_lang }}</h4>
<h4>{{ 'Sessions' | get_lang }}</h4>
<ul class="nav nav-list">
<li>{{ 'SearchSessions' | get_lang }}</li>
<li>
<form class="form-search" method="post" action="{{ api_get_self }}?action=display_sessions">
<div class="input-append">
<input type="date" name="date" id="date" class="span2 search-session" value="{{ searchDate }}" readonly>
<button class="btn" type="submit">{{ 'Search' | get_lang }}</button>
</div>
</form></li>
<form class="form-search" method="post" action="{{ api_get_self }}?action=display_sessions">
<div class="input-append">
<input type="date" name="date" id="date" class="span2 search-session" value="{{ searchDate }}" readonly>
<button class="btn" type="submit">{{ 'Search' | get_lang }}</button>
</div>
</form>
</li>
</ul>
</div>
{% endif %}
</div>
<div class="span9">
{% for session in sessions_blocks %}
<div class="well well-small session-group" id="session-{{ session.id }}">
<div class="row-fluid">
<div class="span9">
<div class="row-fluid padding-clear">
<div class="span2">
<span class="thumbnail">
{{ session.icon }}
</span>
</div>
<div class="span10 border-info">
<h3>{{ session.name }}</h3>
<div class="tutor"><img src="{{ _p.web }}/main/img/teachers.gif" width="16px"> {{ 'GeneralCoach' | get_lang }} {{ session.coach_name }}</div>
</div>
{% for session in sessions_blocks %}
<div class="well well-small session-group" id="session-{{ session.id }}">
<div class="row-fluid">
<div class="span9">
<div class="row-fluid padding-clear">
<div class="span2">
<span class="thumbnail">
{{ session.icon }}
</span>
</div>
<div class="row-fluid">
<div class="accordion" id="session-{{ session.id }}-accordion">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#session-{{ session.id }}-accordion" href="#session-{{ session.id }}-courses">
{{ 'CourseList' | get_lang }}
</a>
</div>
<div id="session-{{ session.id }}-courses" class="accordion-body collapse in">
<div class="accordion-inner"></div>
</div>
<div class="span10 border-info">
<h3>{{ session.name }}</h3>
<div class="tutor"><img src="{{ _p.web }}/main/img/teachers.gif" width="16px"> {{ 'GeneralCoach' | get_lang }} {{ session.coach_name }}</div>
</div>
</div>
<div class="row-fluid">
<div class="accordion" id="session-{{ session.id }}-accordion">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#session-{{ session.id }}-accordion" href="#session-{{ session.id }}-courses">
{{ 'CourseList' | get_lang }}
</a>
</div>
<div id="session-{{ session.id }}-courses" class="accordion-body collapse in">
<div class="accordion-inner"></div>
</div>
</div>
</div>
</div>
<div class="span3">
{% if showDescription %}
<div class="buttom-subscribed">
<a class="ajax btn btn-large btn-info" href="{{ _p.web_ajax }}session.ajax.php?a=get_description&session={{ session.id }}">{{ 'Description' | get_lang }}</a>
</div>
{% endif %}
</div>
<div class="span3">
{% if showDescription %}
<div class="buttom-subscribed">
<a class="ajax btn btn-large btn-info" href="{{ _p.web_ajax }}session.ajax.php?a=get_description&session={{ session.id }}">{{ 'Description' | get_lang }}</a>
</div>
{% endif %}
<div class="buttom-subscribed">
{% if session.is_subscribed %}
{{ already_subscribed_label }}
{% else %}
{{ session.subscribe_button }}
{% endif %}
</div>
<div class="time"><img src="{{ _p.web }}/main/img/agenda.gif"> {{ session.date }}</div>
</div>
<div class="time"><img src="{{ _p.web }}/main/img/agenda.gif"> {{ session.date }}</div>
</div>
</div>
</div>
{% endfor %}
{{ cataloguePagination }}
</div>

Loading…
Cancel
Save