Minor - format code

pull/2487/head
jmontoyaa 8 years ago
parent 658dce049d
commit c4228df6e4
  1. 9
      main/course_info/infocours.php
  2. 18
      main/inc/ajax/install.ajax.php
  3. 2
      main/inc/ajax/social.ajax.php
  4. 65
      main/inc/ajax/thematic.ajax.php
  5. 7
      main/inc/lib/social.lib.php
  6. 2
      main/social/home.php
  7. 2
      main/social/index.php

@ -118,17 +118,16 @@ $form->addHtml('
<div class="panel-body">
');
$image_html = '';
$image = '';
// Display course picture
$course_path = api_get_path(SYS_COURSE_PATH).$currentCourseRepository; // course path
if (file_exists($course_path.'/course-pic85x85.png')) {
$course_web_path = api_get_path(WEB_COURSE_PATH).$currentCourseRepository; // course web path
$course_medium_image = $course_web_path.'/course-pic85x85.png?'.rand(1, 1000); // redimensioned image 85x85
$image_html = '<div class="row"><label class="col-md-2 control-label">'.get_lang('Image').'</label> <div class="col-md-8"><img src="'.$course_medium_image.'" /></div></div>';
$image = '<div class="row"><label class="col-md-2 control-label">'.get_lang('Image').'</label>
<div class="col-md-8"><img src="'.$course_medium_image.'" /></div></div>';
}
$form->addElement('html', $image_html);
$form->addHtml($image);
$form->addText('title', get_lang('Title'), true);
$form->applyFilter('title', 'html_filter');

@ -1,5 +1,5 @@
<?php
/* For licensing terms, see /chamilo_license.txt */
/* For licensing terms, see /license.txt */
/**
* Responses to AJAX calls for install
*/
@ -9,7 +9,7 @@
$action = $_GET['a'];
switch ($action) {
case 'send_contact_information':
case 'send_contact_information':
if (!empty($_POST)) {
// get params from contact form
$person_name = $_POST['person_name'];
@ -35,7 +35,6 @@ switch ($action) {
if ($required_field_error) {
echo 'required_field_error';
} else {
// save contact information with web service
// create a client
$client = new SoapClient('https://version.chamilo.org/contact.php?wsdl');
@ -53,14 +52,15 @@ switch ($action) {
'company_city' => $company_city
);
$result = $client->__soapCall('ws_add_contact_information', array('contact_params' => $contact_params));
$result = $client->__soapCall(
'ws_add_contact_information',
array('contact_params' => $contact_params)
);
echo $result;
}
}
}
break;
default:
echo '';
default:
echo '';
}
exit;

@ -1,5 +1,5 @@
<?php
/* For licensing terms, see /chamilo_license.txt */
/* For licensing terms, see /license.txt */
/**
* Responses to AJAX calls
*/

@ -1,5 +1,5 @@
<?php
/* For licensing terms, see /chamilo_license.txt */
/* For licensing terms, see /license.txt */
/**
* Responses to AJAX calls for thematic
*/
@ -11,27 +11,27 @@ $action = $_GET['a'];
$thematic = new Thematic();
switch ($action) {
case 'save_thematic_plan':
/*$title_list = $_REQUEST['title'];
$description_list = $_REQUEST['desc'];
//$description_list = $_REQUEST['description'];
$description_type = $_REQUEST['description_type'];
if (api_is_allowed_to_edit(null, true)) {
for($i=1;$i<count($title_list)+1; $i++) {
$thematic->set_thematic_plan_attributes($_REQUEST['thematic_id'], $title_list[$i], $description_list[$i], $description_type[$i]);
$affected_rows = $thematic->thematic_plan_save();
}
}
$thematic_plan_data = $thematic->get_thematic_plan_data();
$return = $thematic->get_thematic_plan_div($thematic_plan_data);
echo $return[$_REQUEST['thematic_id']];*/
break;
case 'save_thematic_advance':
if (!api_is_allowed_to_edit(null, true)) {
echo '';
exit;
}
/*
case 'save_thematic_plan':
/*$title_list = $_REQUEST['title'];
$description_list = $_REQUEST['desc'];
//$description_list = $_REQUEST['description'];
$description_type = $_REQUEST['description_type'];
if (api_is_allowed_to_edit(null, true)) {
for($i=1;$i<count($title_list)+1; $i++) {
$thematic->set_thematic_plan_attributes($_REQUEST['thematic_id'], $title_list[$i], $description_list[$i], $description_type[$i]);
$affected_rows = $thematic->thematic_plan_save();
}
}
$thematic_plan_data = $thematic->get_thematic_plan_data();
$return = $thematic->get_thematic_plan_div($thematic_plan_data);
echo $return[$_REQUEST['thematic_id']];*/
break;
case 'save_thematic_advance':
if (!api_is_allowed_to_edit(null, true)) {
echo '';
exit;
}
/*
if (($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) || (!empty($_REQUEST['duration_in_hours']) && !is_numeric($_REQUEST['duration_in_hours'])) ) {
if ($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) {
$start_date_error = true;
@ -79,7 +79,7 @@ switch ($action) {
$thematic_advance_data = $thematic->get_thematic_advance_list(null, null, true);
$return = $thematic->get_thematic_advance_div($thematic_advance_data);
echo $return[$_REQUEST['thematic_id']][$_REQUEST['thematic_advance_id']];*/
break;
break;
case 'get_datetime_by_attendance':
$attendance_id = intval($_REQUEST['attendance_id']);
$thematic_advance_id = intval($_REQUEST['thematic_advance_id']);
@ -98,9 +98,12 @@ switch ($action) {
}
$new_thematic_list = array();
foreach($thematic_list_temp as $item) {
if (!empty($item['attendance_id']) ) {
$new_thematic_list[$item['id']] = array('attendance_id' =>$item['attendance_id'], 'start_date'=>$item['start_date']);
foreach ($thematic_list_temp as $item) {
if (!empty($item['attendance_id'])) {
$new_thematic_list[$item['id']] = array(
'attendance_id' => $item['attendance_id'],
'start_date' => $item['start_date'],
);
}
}
@ -114,8 +117,7 @@ switch ($action) {
$insert = true;
//checking if was already taken
foreach ($new_thematic_list as $key => $thematic_item) {
//if ($calendar['db_date_time'] == $thematic_item['start_date'] && $calendar['attendance_id'] == $thematic_item['attendance_id'] ) {
if ($calendar['db_date_time'] == $thematic_item['start_date'] ) {
if ($calendar['db_date_time'] == $thematic_item['start_date']) {
$insert = false;
if ($thematic_advance_id == $key) {
$insert = true;
@ -146,9 +148,10 @@ switch ($action) {
if (!empty($thematic_advance_id)) {
$thematic = new Thematic();
$affected_rows = $thematic->update_done_thematic_advances($thematic_advance_id);
//if ($affected_rows) {
$total_average = $thematic->get_total_average_of_thematic_advances(api_get_course_id(), api_get_session_id());
//}
$total_average = $thematic->get_total_average_of_thematic_advances(
api_get_course_id(),
api_get_session_id()
);
}
echo $total_average;
break;

@ -496,7 +496,6 @@ class SocialManager extends UserManager
$my_course['course_info']['real_id']
);
//$valor = api_get_settings_params();
$course_path = api_get_path(SYS_COURSE_PATH).$course_directory; // course path
if (api_get_setting('course_images_in_courses_list') === 'true') {
if (file_exists($course_path.'/course-pic85x85.png')) {
@ -510,7 +509,11 @@ class SocialManager extends UserManager
);
}
} else {
$imageCourse = Display::return_icon('course.png', get_lang('Course'), array('class' => 'img-default'));
$imageCourse = Display::return_icon(
'course.png',
get_lang('Course'),
array('class' => 'img-default')
);
}
//display course entry

@ -1,5 +1,5 @@
<?php
/* For licensing terms, see /chamilo_license.txt */
/* For licensing terms, see /license.txt */
/**
* @package chamilo.social

@ -1,5 +1,5 @@
<?php
/* For licensing terms, see /chamilo_license.txt */
/* For licensing terms, see /license.txt */
/**
* Redirect file for social network default page
* @package chamilo.social

Loading…
Cancel
Save