Minor - Cosmetic changes

skala
Julio Montoya 15 years ago
parent 3a4b57ef52
commit c2bfb16132
  1. 10
      main/inc/lib/add_course.lib.inc.php
  2. 5
      main/inc/lib/add_courses_to_session_functions.lib.php
  3. 10
      main/inc/lib/array.lib.php
  4. 23
      main/inc/lib/blog.lib.php
  5. 2
      main/inc/lib/exercise_show_functions.lib.php
  6. 2
      main/survey/survey.php

@ -5,7 +5,7 @@
* This is the course creation library for Chamilo.
* Include/require it in your code for using its functionality.
*
* @package dokeos.library
* @package chamilo.library
* @todo clean up horrible structure, script is unwieldy, for example easier way to deal with
* different tool visibility settings: ALL_TOOLS_INVISIBLE, ALL_TOOLS_VISIBLE, CORE_TOOLS_VISIBLE...
*/
@ -14,9 +14,7 @@ require_once api_get_path(LIBRARY_PATH).'database.lib.php';
require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';
/*
==============================================================================
FUNCTIONS
==============================================================================
*/
/**
@ -32,12 +30,10 @@ require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';
* @param integer Expiration delay in unix timestamp
* @return true if the course creation was succesful, false otherwise.
*/
function create_course($wanted_code, $title, $tutor_name, $category_code, $course_language, $course_admin_id, $db_prefix, $firstExpirationDelay)
{
function create_course($wanted_code, $title, $tutor_name, $category_code, $course_language, $course_admin_id, $db_prefix, $firstExpirationDelay) {
$keys = define_course_keys($wanted_code, "", $db_prefix);
if(sizeof($keys))
{
if(sizeof($keys)) {
$visual_code = $keys["currentCourseCode"];
$code = $keys["currentCourseId"];
$db_name = $keys["currentCourseDbName"];

@ -5,10 +5,9 @@ require_once (api_get_path(LIBRARY_PATH).'xajax/xajax.inc.php');
//require_once (api_get_path(SYS_CODE_PATH).'admin/add_courses_to_session.php');
class AddCourseToSession{
class AddCourseToSession {
public function search_courses($needle,$type)
{
public function search_courses($needle,$type) {
global $tbl_course, $tbl_session_rel_course, $id_session;
$xajax_response = new XajaxResponse();

@ -1,8 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
/**
==============================================================================
* This is the array library for Dokeos.
* This is the array library for Chamilo.
* Include/require it in your code to use its functionality.
*
* @package chamilo.library
@ -15,18 +14,17 @@
* @param array a dimensional array
* @return array an array with unique values
*/
function array_unique_dimensional($array)
{
function array_unique_dimensional($array) {
if(!is_array($array))
return $array;
foreach ($array as &$myvalue){
foreach ($array as &$myvalue) {
$myvalue=serialize($myvalue);
}
$array=array_unique($array);
foreach ($array as &$myvalue){
foreach ($array as &$myvalue) {
$myvalue=unserialize($myvalue);
}
return $array;

@ -7,7 +7,7 @@
* editing,... of a blog
*
* @version 1.0
* @package dokeos.blogs
* @package chamilo.blogs
* @author Toon Keppens <toon@vi-host.net>
* @author Julio Montoya - Cleaning code
*
@ -22,15 +22,13 @@ class Blog {
* @return String Blog Title
*/
public static function get_blog_title ($blog_id) {
if(is_numeric($blog_id))
{
if(is_numeric($blog_id)) {
// init
$tbl_blogs = Database::get_course_table(TABLE_BLOGS);
$sql = "
SELECT blog_name
FROM " . $tbl_blogs . "
WHERE blog_id = " . Database::escape_string((int)$blog_id);
$sql = "SELECT blog_name
FROM " . $tbl_blogs . "
WHERE blog_id = " . intval($blog_id);
$result = Database::query($sql);
$blog = Database::fetch_array($result);
@ -50,10 +48,9 @@ class Blog {
public static function get_blog_subtitle ($blog_id) {
// init
$tbl_blogs = Database::get_course_table(TABLE_BLOGS);
$sql = "SELECT blog_subtitle FROM $tbl_blogs WHERE blog_id ='".Database::escape_string((int)$blog_id)."'";
$sql = "SELECT blog_subtitle FROM $tbl_blogs WHERE blog_id ='".intval($blog_id)."'";
$result = Database::query($sql);
$blog = Database::fetch_array($result);
return stripslashes($blog['blog_subtitle']);
}
@ -73,8 +70,7 @@ class Blog {
$tbl_blogs_rel_user = Database::get_course_table(TABLE_BLOGS_REL_USER);
// Get blog members
$sql = "
SELECT
$sql = "SELECT
user.user_id,
user.firstname,
user.lastname
@ -82,11 +78,8 @@ class Blog {
INNER JOIN " . $tbl_users . " user ON blogs_rel_user.user_id = user.user_id
WHERE blogs_rel_user.blog_id = '" . Database::escape_string((int)$blog_id)."'";
$result = Database::query($sql);
$blog_members = array ();
while($user = Database::fetch_array($result))
{
while($user = Database::fetch_array($result)) {
$blog_members[$user['user_id']] = api_get_person_name($user['firstname'], $user['lastname']);
}

@ -1,7 +1,6 @@
<?php
/* See license terms in /license.txt */
/**
==============================================================================
* EVENTS LIBRARY
*
* This is the events library for Chamilo.
@ -11,7 +10,6 @@
*
* @package chamilo.library
* @todo convert queries to use Database API
==============================================================================
*/
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);

@ -14,7 +14,7 @@
$language_file = 'survey';
// Including the global initialization file
require '../inc/global.inc.php';
require_once '../inc/global.inc.php';
$this_section = SECTION_COURSES;

Loading…
Cancel
Save