skala
Julio Montoya 16 years ago
commit 7924ba558b
  1. 61
      main/admin/settings.lib.php
  2. 31
      main/announcements/announcements.inc.php
  3. 33
      main/announcements/announcements.php
  4. 6
      main/css/blue_lagoon/default.css
  5. 9
      main/css/chamilo/default.css
  6. 11
      main/css/chamilo_green/default.css
  7. 12
      main/css/chamilo_red/default.css
  8. 6
      main/css/dokeos_blue/default.css
  9. 6
      main/css/public_admin/default.css
  10. 9
      main/work/work.lib.php

@ -192,6 +192,7 @@ function display_plugin_cell($location, $plugin_info, $current_plugin, $active_p
/**
* This function allows the platform admin to choose the default stylesheet
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @author Julio Montoya <gugli100@gmail.com>, Chamilo
*/
function handle_stylesheets()
{
@ -273,41 +274,44 @@ function handle_stylesheets()
// Preview of the stylesheet
echo '<div><iframe src="style_preview.php" width="100%" height="300" name="preview"></iframe></div>';
?>
<script type="text/javascript">
function load_preview(selectobj){
var style_dir = selectobj.options[selectobj.selectedIndex].value;
parent.preview.location='style_preview.php?style=' + style_dir;
}
</script>
<?php
echo '<form name="stylesheets" method="post" action="'.api_get_self().'?category='.Security::remove_XSS($_GET['category']).'">';
echo '<br /><select name="style" onChange="load_preview(this)" >';
$list_of_styles = array();
$list_of_names = array();
if ($handle = @opendir(api_get_path(SYS_PATH).'main/css/')) {
$counter=1;
while (false !== ($style_dir = readdir($handle)))
{
if(substr($style_dir,0,1)=='.') //skip dirs starting with a '.'
{
while (false !== ($style_dir = readdir($handle))) {
if(substr($style_dir,0,1)=='.') { //skip dirs starting with a '.'
continue;
}
$dirpath = api_get_path(SYS_PATH).'main/css/'.$style_dir;
if (is_dir($dirpath))
{
if ($style_dir != '.' && $style_dir != '..')
{
if ($currentstyle == $style_dir OR ($style_dir == 'dokeos_classic' AND !$currentstyle))
{
$selected = 'checked="checked"';
}
else
{
if (is_dir($dirpath)) {
if ($style_dir != '.' && $style_dir != '..') {
if ($currentstyle == $style_dir OR ($style_dir == 'dokeos_classic' AND !$currentstyle)) {
$selected = 'selected="true"';
} else {
$selected = '';
}
$show_name=get_lang(str_replace(' ','', ucwords(str_replace('_',' ', $style_dir))), '');
if ($is_style_changeable)
{
echo "<input type=\"radio\" name=\"style\" value=\"".$style_dir."\" ".$selected." onClick=\"parent.preview.location='style_preview.php?style=".$style_dir."';\"/>";
if ($is_style_changeable) {
$list_of_styles[$style_dir] = "<option value=\"".$style_dir."\" ".$selected." /> $show_name </option>";
$list_of_names[$style_dir] = $show_name;
//echo "<input type=\"radio\" name=\"style\" value=\"".$style_dir."\" ".$selected." onClick=\"parent.preview.location='style_preview.php?style=".$style_dir."';\"/>";
//echo '<a href="style_preview.php?style='.$style_dir.'" target="preview">'.$show_name.'</a>';
} else {
echo '<a href="style_preview.php?style='.$style_dir.'" target="preview">'.$show_name.'</a>';
}
else
echo '<a href="style_preview.php?style='.$style_dir.'" target="preview">'.$show_name.'</a>';
//echo '<div id="Layer'.$counter.'" style="position:relative; width:687px; z-index:2; visibility: hidden;">';
//echo '<a href="#" onClick="MM_showHideLayers(\'Layer'.$counter.'\',\'\',\'hide\')">'.get_lang('Close').'</a>';
//echo '<iframe src="style_preview.php?style='.$file.'" width="100%" style="float:right;"></iframe></div>';
echo "<br />\n";
$counter++;
}
@ -315,8 +319,15 @@ function handle_stylesheets()
}
@closedir($handle);
}
if ($is_style_changeable)
{
//Sort styles in alphabetical order
asort($list_of_names);
foreach($list_of_names as $style_dir=>$item) {
echo $list_of_styles[$style_dir];
}
echo '</select><br />';
//var_dump($list_of_names);
if ($is_style_changeable){
echo '<button class="save" type="submit" name="submit_stylesheets"> '.get_lang('SaveSettings').' </button></form>';
}
}

@ -1,25 +1,5 @@
<?php //$Id: announcements.inc.php 21903 2009-07-08 17:28:02Z juliomontoya $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2008 Dokeos SPRL
Copyright (c) various contributors
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
/* For licensing terms, see /license.txt */
/**
==============================================================================
* Include file with functions for the announcements module.
@ -56,13 +36,11 @@ function display_announcement($announcement_id)
WHERE announcement.id = toolitemproperties.ref
AND announcement.id = '$announcement_id'
AND toolitemproperties.tool='announcement'
AND (toolitemproperties.to_user_id='".$_user['user_id']."' OR toolitemproperties.to_group_id='0')
AND (toolitemproperties.to_user_id='".intval($_user['user_id'])."' OR toolitemproperties.to_group_id='0')
AND toolitemproperties.visibility='1'
ORDER BY display_order DESC";
}
else
{
} else {
$sql_query = " SELECT announcement.*, toolitemproperties.*
FROM $tbl_announcement announcement, $tbl_item_property toolitemproperties
WHERE announcement.id = toolitemproperties.ref
@ -74,8 +52,7 @@ function display_announcement($announcement_id)
$sql_result = Database::query($sql_query);
$result = Database::fetch_array($sql_result);
if ($result !== false) // A sanity check.
{
if ($result !== false) { // A sanity check.
$title = $result['title'];
$content = $result['content'];
$content = make_clickable($content);

@ -1,5 +1,5 @@
<?php //$Id: announcements.php 2009-11-13 18:56:45Z aportugal $
/* For licensing terms, see /dokeos_license.txt */
/* For licensing terms, see /license.txt */
/**
* @author Frederik Vermeire <frederik.vermeire@pandora.be>, UGent Internship
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University: code cleaning
@ -33,7 +33,7 @@ $nameTools = get_lang('Announcement');
//session
if(isset($_GET['id_session'])) {
$_SESSION['id_session'] = Security::remove_XSS($_GET['id_session']);
$_SESSION['id_session'] = intval($_GET['id_session']);
}
/* ------------ ACCESS RIGHTS ------------ */
@ -276,16 +276,15 @@ if($surveyid)
}
if (!empty($_SESSION['toolgroup'])){
$_clean['toolgroup']=(int)$_SESSION['toolgroup'];
$group_properties = GroupManager :: get_group_properties($_clean['toolgroup']);
$_clean_toolgroup=intval($_SESSION['toolgroup']);
$group_properties = GroupManager :: get_group_properties($_clean_toolgroup);
$interbreadcrumb[] = array ("url" => "../group/group.php", "name" => get_lang('Groups'));
$interbreadcrumb[] = array ("url"=>"../group/group_space.php?gidReq=".$_SESSION['toolgroup'], "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')');
$interbreadcrumb[] = array ("url"=>"../group/group_space.php?gidReq=".$_clean_toolgroup, "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')');
} else {
if($surveyid) {
$interbreadcrumb[] = array ("url" => "../survey/survey_list.php?cidReq=$cidReq", "name" => get_lang('Survey'));
$nameTools = get_lang('PublishSurvey');
}else {
$interbreadcrumb[] = array ("url" => "../survey/survey_list.php?cidReq=$cidReq", "name" => get_lang('Survey'));
$nameTools = get_lang('PublishSurvey');
} else {
$nameTools = get_lang('Announcement');
$nameTools12 = get_lang('PublishSurvey');
}
@ -305,9 +304,7 @@ if (empty($_GET['origin']) or $_GET['origin'] !== 'learnpath')
{
//we are not in the learning path
Display::Display_header($nameTools,"Announcements");
}
else
{
} else {
//we are in the learning path, only display central data and change css
$display_title_list = false;
$display_announcement_list = false;
@ -414,7 +411,7 @@ if (api_is_allowed_to_edit(false,true) OR (api_get_course_setting('allow_user_ed
$display_form = true;
// RETRIEVE THE CONTENT OF THE ANNOUNCEMENT TO MODIFY
$id = intval(addslashes($_GET['id']));
$id = intval($_GET['id']);
if (!api_is_course_coach() || api_is_element_in_the_session(TOOL_ANNOUNCEMENT, $id)) {
$sql="SELECT * FROM $tbl_announcement WHERE id='$id'";
@ -424,8 +421,7 @@ if (api_is_allowed_to_edit(false,true) OR (api_get_course_setting('allow_user_ed
$edit_attachment = edit_announcement_attachment_file($last_id, $_FILES['user_upload'], $file_comment);
if ($myrow) {
$announcement_to_modify = $myrow['id'];
$content_to_modify = $myrow['content'];
$content_to_modify = $myrow['content'];
$title_to_modify = $myrow['title'];
if ($originalresource!=="no") {
@ -437,12 +433,9 @@ if (api_is_allowed_to_edit(false,true) OR (api_get_course_setting('allow_user_ed
$display_announcement_list = false;
}
if ($to=="everyone" OR !empty($_SESSION['toolgroup']))
{
if ($to=="everyone" OR !empty($_SESSION['toolgroup'])) {
$_SESSION['select_groupusers']="hide";
}
else
{
} else {
$_SESSION['select_groupusers']="show";
}
}

@ -21,7 +21,7 @@ body {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -3em;
margin: 0 auto -5em;
}
#outerframe {
position: relative; /* do not remove, fixes a bug in IE */
@ -361,13 +361,13 @@ select, input[type=checkbox], input[type=radio], input[type=button], input[type=
background-repeat:repeat-x;
font-size: 12px;
color:#ffffff;
min-height: 50px;
height: 4em; /* Do not change this value */
overflow:hidden;
width: 100%;
padding-bottom:10px;
}
.push {
height: 3em; /* Very important */
height: 5em; /* Very important */
}
#footer .copyright {
float: right;

@ -18,12 +18,12 @@ body {
background-color: #fff;
height: 100%; /* stick */
}
/* Sticky footer*/
#wrapper{
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -8em;
margin: 0 auto -9em;
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
@ -580,13 +580,14 @@ margin-top:0;
background-repeat:repeat-x;
font-size: 12px;
color:#ffffff;
min-height: 100px;
height: 8em; /* Do not change this value */
overflow:hidden;
width: 100%;
padding-bottom:10px;
}
/* Sticky footer*/
.push {
height: 8em; /* Very important */
height: 10em; /* Very important */
}
#footer .copyright {
float: right;

@ -18,12 +18,12 @@ body {
background-color: #fff;
height: 100%; /* stick */
}
/* Sticky footer*/
#wrapper{
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -8em;
margin: 0 auto -9em;
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
@ -583,17 +583,18 @@ margin-top:0;
background-repeat:repeat-x;
font-size: 12px;
color:#ffffff;
min-height: 100px;
height: 8em; /* Do not change this value */
overflow:hidden;
width: 100%;
padding-bottom:10px;
}
/* Sticky footer*/
.push {
height: 8em; /* Very important */
height: 10em; /* Very important */
}
#footer .copyright {
float: right;
padding-top:60px;
padding-top:53px;
margin-right:5%;
background-color: #79aa0b;
background-image: url(images/bg-footer.gif);

@ -19,11 +19,12 @@ body {
height: 100%; /* stick */
}
#wrapper{
/* Sticky footer*/
#wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -8em;
margin: 0 auto -9em; /* Do not change this value */
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
@ -583,17 +584,18 @@ margin-top:0;
background-repeat:repeat-x;
font-size: 12px;
color:#ffffff;
min-height: 100px;
height: 8em; /* Do not change this value */
overflow:hidden;
width: 100%;
padding-bottom:10px;
}
/* Sticky footer*/
.push {
height: 8em; /* Very important */
height: 10em; /* Do not change this value */
}
#footer .copyright {
float: right;
padding-top:60px;
padding-top:53px;
margin-right:5%;
background-color: #a90a0e;
background-image: url(images/bg-footer.gif);

@ -19,7 +19,7 @@ body {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -3em;
margin: 0 auto -5em;
}
#outerframe {
position: relative; /* do not remove, fixes a bug in IE */
@ -347,13 +347,13 @@ input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
background-repeat:repeat-x;
font-size: 12px;
color:#ffffff;
min-height: 50px;
height: 4em; /* Do not change this value */
overflow:hidden;
width: 100%;
padding-bottom:10px;
}
.push {
height: 3em; /* Very important */
height: 5em; /* Very important */
}
#footer .copyright {
float: right;

@ -22,7 +22,7 @@ body {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -8em;
margin: 0 auto -9em;
}
#outerframe {
position: relative; /* do not remove, fixes a bug in IE */
@ -411,13 +411,13 @@ select, input[type=checkbox], input[type=radio], input[type=button], input[type=
background-repeat:repeat-x;
font-size: 12px;
color:#ffffff;
min-height: 100px;
height: 8em; /* Do not change this value */
overflow:hidden;
width: 100%;
padding-bottom:10px;
}
.push {
height: 8em; /* Very important */
height: 9em; /* Very important */
}
#footer .copyright {
float: right;

@ -1041,18 +1041,18 @@ function del_dir($base_work_dir,$dir,$id) {
if(empty($dir) or $dir=='/') {
return -1;
}
$check = Security::check_abs_path($base_work_dir.$dir, $base_work_dir);
$check = Security::check_abs_path($base_work_dir.$dir,$base_work_dir);
if (!$check || !is_dir($base_work_dir.$dir)) {
return -1;
}
$table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
$sql = "DELETE FROM $table WHERE url LIKE BINARY 'work/".$dir."/%'";
$sql = "DELETE FROM $table WHERE url BINARY 'work/".$dir."/%'";
$res = Database::query($sql);
//delete from DB the directories
$sql = "DELETE FROM $table WHERE filetype = 'folder' AND url LIKE BINARY '/".$dir."%'";
$sql = "DELETE FROM $table WHERE filetype = 'folder' AND url BINARY '/".$dir."%'";
$res = Database::query($sql);
require_once(api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
$new_dir= $dir.'_DELETED_'.$id;
if (api_get_setting('permanently_remove_deleted_files') == 'true'){
@ -1064,6 +1064,7 @@ function del_dir($base_work_dir,$dir,$id) {
}
}
/**
* Get the path of a document in the student_publication table (path relative to the course directory)
* @param integer Element ID

Loading…
Cancel
Save