Minor - format code

pull/2487/head
jmontoyaa 9 years ago
parent 1b00eb0113
commit f9d5914c2c
  1. 1
      main/auth/courses.php
  2. 17
      main/auth/courses_controller.php
  3. 4
      main/auth/gotocourse.php
  4. 4
      main/auth/inscription.php
  5. 9
      main/auth/set_temp_password.php
  6. 1
      main/badge/assertion.php
  7. 1
      main/badge/class.php
  8. 1
      main/badge/criteria.php
  9. 1
      main/badge/issued.php
  10. 8
      main/badge/issued_all.php
  11. 81
      main/blog/blog.php
  12. 5
      main/blog/blog_admin.php
  13. 9
      main/blog/download.php
  14. 7
      main/calendar/agenda_js.php

@ -203,6 +203,7 @@ switch ($action) {
);
} else {
header('Location: ' . api_get_self());
exit;
}
break;
case 'display_random_courses':

@ -43,8 +43,7 @@ class CoursesController
$data['user_courses'] = $this->model->get_courses_of_user($user_id);
$data['user_course_categories'] = $this->model->get_user_course_categories();
$data['courses_in_category'] = $this->model->get_courses_in_category();
$data['all_user_categories'] = $this->model->get_user_course_categories(
);
$data['all_user_categories'] = $this->model->get_user_course_categories();
$data['action'] = $action;
$data['message'] = $message;
@ -116,7 +115,6 @@ class CoursesController
$data['browse_course_categories'] = $browse_course_categories;
$data['code'] = Security::remove_XSS($category_code);
// getting all the courses to which the user is subscribed to
$curr_user_id = api_get_user_id();
$user_courses = $this->model->get_courses_of_user($curr_user_id);
@ -353,7 +351,9 @@ class CoursesController
/**
* Unsubscribe user from a course
* render to listing view
* @param string Course code
* @param string $course_code
* @param string $search_term
* @param string $category_code
*/
public function unsubscribe_user_from_course($course_code, $search_term = null, $category_code = null)
{
@ -383,9 +383,7 @@ class CoursesController
public function getCoursesCategoriesBlock($code = null, $hiddenLinks = false, $limit = null)
{
$categories = $this->model->browse_course_categories();
$html = '';
if (!empty($categories)) {
$action = 'display_courses';
foreach ($categories[0] as $category) {
@ -517,8 +515,7 @@ class CoursesController
$sessionId,
$sessionName,
$checkRequirements = false
)
{
) {
if ($checkRequirements) {
$url = api_get_path(WEB_AJAX_PATH);
$url .= 'sequence.ajax.php?';
@ -544,9 +541,7 @@ class CoursesController
$catalogSessionAutoSubscriptionAllowed = false;
if (
api_get_setting('catalog_allow_session_auto_subscription') === 'true'
) {
if (api_get_setting('catalog_allow_session_auto_subscription') === 'true') {
$catalogSessionAutoSubscriptionAllowed = true;
}

@ -11,8 +11,8 @@
*
*/
require '../inc/global.inc.php';
require_once(api_get_path(SYS_PATH).'main/auth/cas/authcas.php');
require_once '../inc/global.inc.php';
require_once api_get_path(SYS_PATH).'main/auth/cas/authcas.php';
$msg = null;
if (isset($_GET['firstpage'])) {
$firstpage = $_GET['firstpage'];

@ -1,13 +1,13 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
/**
* This script displays a form for registering new users.
* @package chamilo.auth
*/
use ChamiloSession as Session;
//quick hack to adapt the registration form result to the selected registration language
if (!empty($_POST['language'])) {
$_GET['language'] = $_POST['language'];

@ -1,13 +1,14 @@
<?php
/* For license terms, see /license.txt */
use ChamiloSession as Session;
/**
* This page aims at requesting a password from a user to access a course
* protected by password. If the password matches the course password, we
* store the fact that user can access it during its session
*/
use ChamiloSession as Session;
$cidReset = true;
require_once '../inc/global.inc.php';
$this_section = SECTION_COURSES;
@ -21,9 +22,7 @@ $user_id = api_get_user_id();
if (empty($course_id)) {
api_not_allowed();
}
/**
* Code
*/
$course_info = api_get_course_info_by_id($course_id);
$tpl = new Template(null);

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Show information about a new assertion
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Show information about the OpenBadge class
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Show information about OpenBadge citeria
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Show information about the issued badge
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>

@ -149,8 +149,8 @@ foreach ($userSkills as $index => $skillIssue) {
}
$formAcquiredLevel = new FormValidator(
'acquired_level'.$skillIssue->getId(),
'post',
'acquired_level'.$skillIssue->getId(),
'post',
$skillIssue->getIssueUrlAll()
);
$formAcquiredLevel->addSelect('acquired_level', get_lang('AcquiredLevel'), $acquiredLevel);
@ -202,8 +202,8 @@ foreach ($userSkills as $index => $skillIssue) {
exit;
}
$badgeInfoError = "";
$personalBadge = "";
$badgeInfoError = '';
$personalBadge = '';
if ($allowDownloadExport) {
$backpack = 'https://backpack.openbadges.org/';

@ -311,39 +311,39 @@ Display::display_introduction_section(TOOL_BLOGS);
<div class="row">
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-heading"><?php echo get_lang('Calendar') ?></div>
<div class="panel-body">
<?php
$month = isset($_GET['month']) ? (int)$_GET['month'] : (int) date('m');
$year = isset($_GET['year']) ? (int)$_GET['year'] : date('Y');
Blog::display_minimonthcalendar($month, $year, $blog_id);
?>
</div>
<div class="panel panel-default">
<div class="panel-heading"><?php echo get_lang('Calendar') ?></div>
<div class="panel-body">
<?php
$month = isset($_GET['month']) ? (int)$_GET['month'] : (int) date('m');
$year = isset($_GET['year']) ? (int)$_GET['year'] : date('Y');
Blog::display_minimonthcalendar($month, $year, $blog_id);
?>
</div>
<div class="panel panel-default">
<div class="panel-heading"><?php echo get_lang('Search') ?></div>
<div class="panel-body">
<form action="blog.php" method="get" enctype="multipart/form-data">
<div class="form-group">
<input type="hidden" name="blog_id" value="<?php echo $blog_id ?>" />
<input type="hidden" name="action" value="view_search_result" />
<input type="text" class="form-control" size="20" name="q" value="<?php echo isset($_GET['q']) ? Security::remove_XSS($_GET['q']) : ''; ?>" />
</div>
<button class="btn btn-default btn-block" type="submit"><em class="fa fa-search"></em> <?php echo get_lang('Search'); ?></button>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><?php echo get_lang('Search') ?></div>
<div class="panel-body">
<form action="blog.php" method="get" enctype="multipart/form-data">
<div class="form-group">
<input type="hidden" name="blog_id" value="<?php echo $blog_id ?>" />
<input type="hidden" name="action" value="view_search_result" />
<input type="text" class="form-control" size="20" name="q" value="<?php echo isset($_GET['q']) ? Security::remove_XSS($_GET['q']) : ''; ?>" />
</div>
<button class="btn btn-default btn-block" type="submit">
<em class="fa fa-search"></em> <?php echo get_lang('Search'); ?>
</button>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><?php echo get_lang('MyTasks') ?></div>
<div class="panel-body">
<?php Blog::get_personal_task_list(); ?>
</div>
<div class="panel panel-default">
<div class="panel-heading"><?php echo get_lang('MyTasks') ?></div>
<div class="panel-body">
<?php Blog::get_personal_task_list(); ?>
</div>
</div>
</div>
<div class="col-md-9">
<?php
@ -467,32 +467,33 @@ switch ($action) {
echo '<br /><br />';
Blog :: display_assigned_task_list($blog_id);
echo '<br /><br />';
}
else
api_not_allowed();
} else {
api_not_allowed();
}
break;
case 'execute_task' :
if (isset ($_GET['post_id']))
Blog :: display_post($blog_id, intval($_GET['post_id']));
else
Blog :: display_select_task_post($blog_id, intval($_GET['task_id']));
if (isset ($_GET['post_id'])) {
Blog:: display_post($blog_id, intval($_GET['post_id']));
} else {
Blog:: display_select_task_post($blog_id, intval($_GET['task_id']));
}
break;
case 'view_search_result' :
Blog :: display_search_results($blog_id, Database::escape_string($_GET['q']));
break;
case '' :
default :
case '':
default:
if (isset ($_GET['filter']) && !empty ($_GET['filter'])) {
Blog :: display_day_results($blog_id, Database::escape_string($_GET['filter']));
} else {
Blog :: display_blog_posts($blog_id);
}
break;
}
?>
</div>
</div>
<?php
// Display the footer
Display::display_footer();

@ -67,11 +67,6 @@ if (api_is_allowed_to_edit()) {
Display::display_confirmation_message(get_lang('BlogDeleted'));
}
/*
DISPLAY
*/
//api_display_tool_title($nameTools);
//api_introductionsection(TOOL_BLOG);
if (isset($_GET['action']) && $_GET['action'] == 'add') {
// we show the form if
// 1. no post data

@ -9,9 +9,6 @@
* @package chamilo.blogs
*/
/**
* MAIN CODE
*/
session_cache_limiter('public');
require_once '../inc/global.inc.php';
@ -48,14 +45,16 @@ if (is_dir($full_file_name)) {
exit;
}
$tbl_blogs_attachment = Database::get_course_table(TABLE_BLOGS_ATTACHMENT);
$tbl_blogs_attachment = Database::get_course_table(TABLE_BLOGS_ATTACHMENT);
$course_id = api_get_course_int_id();
// launch event
Event::event_download($doc_url);
$sql = 'SELECT filename FROM '.$tbl_blogs_attachment.'
WHERE c_id = '.$course_id.' AND path LIKE BINARY "'.Database::escape_string($doc_url).'"';
WHERE
c_id = '.$course_id.' AND
path LIKE BINARY "'.Database::escape_string($doc_url).'"';
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
$row = Database::fetch_array($result);

@ -9,9 +9,9 @@ use ChamiloSession as Session;
// use anonymous mode when accessing this course tool
$use_anonymous = true;
$typeList = array('personal', 'course', 'admin', 'platform');
// Calendar type
$type = isset($_REQUEST['type']) && in_array($_REQUEST['type'], array('personal', 'course', 'admin', 'platform')) ? $_REQUEST['type'] : 'personal';
$type = isset($_REQUEST['type']) && in_array($_REQUEST['type'], $typeList) ? $_REQUEST['type'] : 'personal';
$userId = isset($_REQUEST['user_id']) ? $_REQUEST['user_id'] : null;
if ($type == 'personal' || $type == 'admin') {
@ -125,7 +125,8 @@ $tpl->assign('month_names', json_encode($months));
$tpl->assign('month_names_short', json_encode($months_short));
$tpl->assign('day_names', json_encode($days));
$tpl->assign('day_names_short', json_encode($day_short));
$tpl->assign('button_text',
$tpl->assign(
'button_text',
json_encode(array(
'today' => get_lang('Today'),
'month' => get_lang('Month'),

Loading…
Cancel
Save