Minor - format code

pull/2487/head
jmontoyaa 8 years ago
parent 04047d2932
commit f2a2876739
  1. 10
      main/auth/my_progress.php
  2. 59
      main/course_home/course_home.php
  3. 21
      main/inc/lib/api.lib.php
  4. 1
      main/template/default/blog/blog.tpl

@ -59,10 +59,10 @@ if (!empty($course_user_list)) {
$issues .= '<div class="text-course">';
$issues .= '<p>'.sprintf(
get_lang('YouHaveEnteredTheCourseXInY'),
'" '.$courseInfo['name'].' "',
api_convert_and_format_date($login, DATE_TIME_FORMAT_LONG)
).'</p>';
get_lang('YouHaveEnteredTheCourseXInY'),
'" '.$courseInfo['name'].' "',
api_convert_and_format_date($login, DATE_TIME_FORMAT_LONG)
).'</p>';
$issues .= '</div>';
$issues .= '</li>';
$count++;
@ -90,13 +90,11 @@ if (!empty($dates)) {
}
$message = null;
if (empty($content)) {
$message = Display::return_message(get_lang('NoDataAvailable'), 'warning');
}
$tpl = new Template($nameTools);
$tpl->assign('message', $message);
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -4,31 +4,30 @@
use ChamiloSession as Session;
/**
HOME PAGE FOR EACH COURSE
*
* This page, included in every course's index.php is the home
* page. To make administration simple, the teacher edits his
* course from the home page. Only the login detects that the
* visitor is allowed to activate, deactivate home page links,
* access to the teachers tools (statistics, edit forums...).
*
* Edit visibility of tools
*
* visibility = 1 - everybody
* visibility = 0 - course admin (teacher) and platform admin
*
* Who can change visibility ?
*
* admin = 0 - course admin (teacher) and platform admin
* admin = 1 - platform admin
*
* Show message to confirm that a tools must be hide from available tools
*
* visibility 0,1
*
*
* @package chamilo.course_home
*/
* HOME PAGE FOR EACH COURSE
*
* This page, included in every course's index.php is the home
* page. To make administration simple, the teacher edits his
* course from the home page. Only the login detects that the
* visitor is allowed to activate, deactivate home page links,
* access to the teachers tools (statistics, edit forums...).
*
* Edit visibility of tools
*
* visibility = 1 - everybody
* visibility = 0 - course admin (teacher) and platform admin
*
* Who can change visibility ?
*
* admin = 0 - course admin (teacher) and platform admin
* admin = 1 - platform admin
*
* Show message to confirm that a tools must be hide from available tools
*
* visibility 0,1
*
* @package chamilo.course_home
*/
$use_anonymous = true;
require_once __DIR__.'/../inc/global.inc.php';
@ -159,11 +158,11 @@ if (isset($_GET['action']) && $_GET['action'] == 'subscribe') {
}
}
}
/* Is the user allowed here? */
api_protect_course_script(true);
/* STATISTICS */
if (!isset($coursesAlreadyVisited[$course_code])) {
Event::accessCourse();
$coursesAlreadyVisited[$course_code] = 1;
@ -181,8 +180,8 @@ if (!empty($auto_launch)) {
} else {
$session_key = 'lp_autolaunch_'.$session_id.'_'.api_get_course_int_id().'_'.api_get_user_id();
if (!isset($_SESSION[$session_key])) {
//redirecting to the LP
$url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?' . api_get_cidreq() . '&id_session=' . $session_id;
// Redirecting to the LP
$url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq().'&id_session='.$session_id;
$_SESSION[$session_key] = true;
header("Location: $url");
exit;
@ -212,12 +211,12 @@ if (!empty($auto_launch)) {
$lp_data = Database::fetch_array($result, 'ASSOC');
if (!empty($lp_data['id'])) {
if (api_is_platform_admin() || api_is_allowed_to_edit()) {
$show_autolaunch_lp_warning = true;
$show_autolaunch_lp_warning = true;
} else {
$session_key = 'lp_autolaunch_'.$session_id.'_'.api_get_course_int_id().'_'.api_get_user_id();
if (!isset($_SESSION[$session_key])) {
//redirecting to the LP
$url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?' . api_get_cidreq() . '&action=view&lp_id=' . $lp_data['id'];
$url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$lp_data['id'];
$_SESSION[$session_key] = true;
header("Location: $url");

@ -3,6 +3,7 @@
use ChamiloSession as Session;
use Chamilo\CourseBundle\Entity\CItemProperty;
use Chamilo\UserBundle\Entity\User;
use Symfony\Component\Finder\Finder;
/**
@ -1047,9 +1048,9 @@ function api_valid_email($address)
* visibility and user status).
*
* This is only the first proposal, test and improve!
* @param boolean Option to print headers when displaying error message. Default: false
* @param boolean Whether session admins should be allowed or not.
* @return boolean True if the user has access to the current course or is out of a course context, false otherwise
* @param boolean Option to print headers when displaying error message. Default: false
* @param boolean Whether session admins should be allowed or not.
* @return boolean True if the user has access to the current course or is out of a course context, false otherwise
* @todo replace global variable
* @author Roan Embrechts
*/
@ -1830,7 +1831,9 @@ function api_get_course_info_by_id($id = null)
}
global $_course;
if ($_course == '-1') $_course = array();
if ($_course == '-1') {
$_course = array();
}
return $_course;
}
@ -1970,7 +1973,6 @@ function api_generate_password($length = 8)
// Min uppercase
$password .= $generator->generateString($minUpperCase, $charactersUpperCase);
$password = str_shuffle($password);
return $password;
@ -2081,6 +2083,7 @@ function api_clear_anonymous($db_check = false)
* Returns the status string corresponding to the status code
* @author Noel Dieschburg
* @param the int status code
* @return string
*/
function get_status_from_code($status_code)
{
@ -2124,8 +2127,6 @@ function api_set_anonymous()
return true;
}
/* CONFIGURATION SETTINGS */
/**
* Gets the current Chamilo (not PHP/cookie) session ID
* @return int O if no active session, the session ID otherwise
@ -5042,7 +5043,8 @@ function api_set_setting_simple($params)
/**
* @param int $id
*/
function api_delete_setting_option($id) {
function api_delete_setting_option($id)
{
$table = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
if (!empty($id)) {
Database::delete($table, array('id = ? '=> $id));
@ -5157,6 +5159,7 @@ function api_set_setting($var, $value, $subvar = null, $cat = null, $access_url
* @param array Optional array of filters on field type
* @param string $category
* @param string $value
* @return bool
*/
function api_set_settings_category($category, $value = null, $access_url = 1, $fieldtype = array())
{
@ -5306,7 +5309,7 @@ function &api_get_settings($cat = null, $ordering = 'list', $access_url = 1, $ur
}
$result = Database::query($sql);
if ($result === null) {
return array();
return [];
}
$result = Database::store_result($result,'ASSOC');

@ -62,7 +62,6 @@
<a href="{{ _p.web_self ~ '?' ~ _p.web_cid_query ~ '&' ~ {'action':'view_post', 'blog_id':item.id_blog, 'post_id':item.id_post}|url_encode }}#add_comment"
title="{{ item.title }}">{{ item.title }}</a>
</h3>
<div class="info-post">
<span class="date"><i class="fa fa-clock-o"></i> {{ item.post_date }}</span>
<span class='comments'>

Loading…
Cancel
Save