Minor - cleaning code

skala
Julio Montoya 15 years ago
parent e4f11ee807
commit f56e947152
  1. 6
      main/calendar/agenda.inc.php
  2. 52
      main/calendar/agenda.php

@ -1751,7 +1751,7 @@ function showhide_agenda_item($id)
* @author Yannick Warnier <yannick.warnier@dokeos.com> - cleanup
*/
function display_agenda_items()
{
{
global $TABLEAGENDA;
global $TABLE_ITEM_PROPERTY;
global $select_month, $select_year;
@ -1760,10 +1760,10 @@ function display_agenda_items()
global $dateFormatLong, $timeNoSecFormat,$charset, $_user, $_course;
// getting the group memberships
$group_memberships=GroupManager::get_group_ids($_course['dbName'],$_user['user_id']);
$group_memberships = GroupManager::get_group_ids($_course['dbName'],$_user['user_id']);
// getting the name of the groups
$group_names=get_course_groups();
$group_names = get_course_groups();
/*--------------------------------------------------
CONSTRUCT THE SQL STATEMENT

@ -1,10 +1,8 @@
<?php //$Id: agenda.php 22201 2009-07-17 19:57:03Z cfasanando $
<?php
/* For licensing terms, see /license.txt */
/*
==============================================================================
INIT SECTION
==============================================================================
*/
/* INIT SECTION */
// name of the language file that needs to be included
$language_file = array('agenda','group');
@ -12,30 +10,26 @@ $language_file = array('agenda','group');
$use_anonymous = true;
// setting the global file that gets the general configuration, the databases, the languages, ...
include('../inc/global.inc.php');
require_once '../inc/global.inc.php';
//session
if(isset($_GET['id_session']))
{
$_SESSION['id_session'] = Security::remove_XSS($_GET['id_session']);
if(isset($_GET['id_session'])) {
$_SESSION['id_session'] = intval($_GET['id_session']);
}
$this_section=SECTION_COURSES;
//error_reporting(E_ALL);
require (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
/* ==============================================================================
ACCESS RIGHTS
============================================================================== */
/* ACCESS RIGHTS */
// notice for unauthorized people.
api_protect_course_script();
/*
-----------------------------------------------------------
Resource linker (Patrick Cool, march 2004)
-----------------------------------------------------------
*/
$_SESSION['source_type'] = 'Agenda';
require_once '../resourcelinker/resourcelinker.inc.php';
require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
@ -410,28 +404,18 @@ if (api_is_allowed_to_edit(false,true) OR (api_get_course_setting('allow_user_ed
}
// this is for students and whenever the courseaministrator has not chosen any action. It is in fact the default behaviour
if (!$_GET['action'] || $_GET['action']=="showall" || $_GET['action']=="showcurrent" || $_GET['action']=="view")
{
if ($_GET['origin'] != 'learnpath')
{
if (!$_SESSION['view'] || $_SESSION['view'] <> 'month')
{
if(!empty($_GET['agenda_id']))
{
if (!$_GET['action'] || $_GET['action']=="showall" || $_GET['action']=="showcurrent" || $_GET['action']=="view") {
if ($_GET['origin'] != 'learnpath') {
if (!$_SESSION['view'] || $_SESSION['view'] <> 'month') {
if(!empty($_GET['agenda_id'])) {
display_one_agenda_item((int)$_GET['agenda_id']);
} else {
display_agenda_items();
}
else
{
display_agenda_items();
}
}
else
{
} else {
display_monthcalendar($select_month, $select_year);
}
}
else
{
} else {
display_one_agenda_item((int)$_GET['agenda_id']);
}
}

Loading…
Cancel
Save