Using absolut URLs

skala
Julio Montoya 12 years ago
parent 6d5155bc9d
commit b85ac09678
  1. 43
      main/admin/user_fields_add.php
  2. 21
      main/announcements/announcements.php
  3. 63
      main/announcements/resources/js/main.js
  4. 224
      main/calendar/agenda.inc.php
  5. 2
      main/calendar/agenda.php
  6. 2
      main/tracking/courseLogCSV.php

@ -16,36 +16,39 @@ $this_section=SECTION_PLATFORM_ADMIN;
// user permissions
api_protect_admin_script();
$showImg = Display::return_icon('div_show.gif');
$hideImg = Display::return_icon('div_hide.gif');
$htmlHeadXtra[] = '<script>
function change_image_user_field (image_value) {
if (image_value==1) {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.$showImg.'&nbsp;'.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html("&nbsp;");
$("div#id_image_user_field").html('."'<br />".Display::return_icon('userfield_text.png', get_lang('AddUserFields'))."'".');
} else if (image_value==2) {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.$showImg.'&nbsp;'.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html("&nbsp;");
$("div#id_image_user_field").html('."'<br />".Display::return_icon('userfield_text_area.png', get_lang('AddUserFields'))."'".');
} else if (image_value==3) {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.$hideImg.'&nbsp;'.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html("&nbsp;");
$("div#id_image_user_field").html('."'<br />".Display::return_icon('add_user_field_howto.png', get_lang('AddUserFields'))."'".');
} else if (image_value==4) {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.$hideImg.'&nbsp;'.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html("&nbsp;");
$("div#id_image_user_field").html('."'<br />".Display::return_icon('userfield_drop_down.png', get_lang('AddUserFields'))."'".');
} else if (image_value==5) {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.$hideImg.'&nbsp;'.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html("&nbsp;");
$("div#id_image_user_field").html('."'<br />".Display::return_icon('userfield_multidropdown.png', get_lang('AddUserFields'))."'".');
@ -56,39 +59,39 @@ function change_image_user_field (image_value) {
} else if (image_value==7) {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.$showImg.'&nbsp;'.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html("&nbsp;");
$("div#id_image_user_field").html('."'<br />".Display::return_icon('userfield_date_time.png', get_lang('AddUserFields'))."'".');
} else if (image_value==8) {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.$hideImg.'&nbsp;'.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html("&nbsp;");
$("div#id_image_user_field").html('."'<br />".Display::return_icon('userfield_doubleselect.png', get_lang('AddUserFields'))."'".');
} else if (image_value==9) {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.$showImg.'&nbsp;'.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html("&nbsp;");
$("div#id_image_user_field").html('."'<br />".Display::return_icon('userfield_divider.png', get_lang('AddUserFields'))."'".');
} else if (image_value==10) {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.$showImg.'&nbsp;'.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html("&nbsp;");
$("div#id_image_user_field").html('."'<br />".Display::return_icon('userfield_user_tag.png', get_lang('UserTag'))."'".');
}
}
function advanced_parameters() {
function advanced_parameters() {
if(document.getElementById(\'options\').style.display == \'none\') {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.$hideImg.'&nbsp;'.get_lang('AdvancedParameters').'\';
} else {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.$showImg.'&nbsp;'.get_lang('AdvancedParameters').'\';
}
}
@ -124,8 +127,8 @@ $form->addElement('select','fieldtype',get_lang('FieldType'), $types, array('onc
$form->addRule('fieldtype', get_lang('ThisFieldIsRequired'), 'required');
//Advanced parameters
$form -> addElement('advanced_settings','<a href="javascript://" onclick=" return advanced_parameters()"><span id="img_plus_and_minus"><div style="vertical-align:top;" ><img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'</div></span></a>');
//When edit, the combobox displey the field type displeyed else none
$form -> addElement('advanced_settings','<a href="javascript://" onclick=" return advanced_parameters()"><span id="img_plus_and_minus"><div style="vertical-align:top;" >'.$showImg.'&nbsp;'.get_lang('AdvancedParameters').'</div></span></a>');
//When edit, the combobox displey the field type displeyed else none
if ( (isset($_GET['action']) && $_GET['action'] == 'edit') && in_array($_GET['field_type'],array(3,4,5,8))) {
$form -> addElement('html','<div id="options" style="display:block">');
} else {
@ -180,7 +183,7 @@ $form->setDefaults($defaults);
if(isset($_GET['field_id']) && !empty($_GET['field_id'])) {
$class="save";
$text=get_lang('buttonEditUserField');
} else {
} else {
$class="add";
$text=get_lang('buttonAddUserField');
}
@ -190,11 +193,11 @@ $form->addElement('html','</div>');
$form->addElement('style_submit_button', 'submit',$text, 'class='.$class.'');
// Validate form
if( $form->validate()) {
$check = Security::check_token('post');
$check = Security::check_token('post');
if($check) {
$field = $form->exportValues();
$fieldlabel = empty($field['fieldlabel'])?$field['fieldtitle']:$field['fieldlabel'];
$fieldlabel = trim(strtolower(str_replace(" ","_",$fieldlabel)));
$fieldlabel = empty($field['fieldlabel'])?$field['fieldtitle']:$field['fieldlabel'];
$fieldlabel = trim(strtolower(str_replace(" ","_",$fieldlabel)));
$fieldtype = $field['fieldtype'];
$fieldtitle = $field['fieldtitle'];
$fielddefault = $field['fielddefaultvalue'];
@ -261,4 +264,4 @@ if(!empty($defaults['fieldtype'])) {
echo '</div>';
// footer
Display::display_footer();
Display::display_footer();

@ -29,6 +29,23 @@ $use_anonymous = true;
// setting the global file that gets the general configuration, the databases, the languages, ...
require_once '../inc/global.inc.php';
$showImg = Display::return_icon('div_show.gif');
$hideImg = Display::return_icon('div_hide.gif');
$htmlHeadXtra[] = "
<script>
function plus_attachment() {
'use strict';
if (document.getElementById('options').style.display == 'none') {
document.getElementById('options').style.display = 'block';
document.getElementById('plus').innerHTML = '&nbsp;".$hideImg."&nbsp;' + lang.AddAnAttachment;
} else {
document.getElementById('options').style.display = 'none';
document.getElementById('plus').innerHTML = '&nbsp;".$showImg."&nbsp;' + lang.AddAnAttachment;
}
}
</script>";
/* Sessions */
$ctok = Security::getCurrentToken();
@ -790,7 +807,7 @@ if ($display_form) {
//File attachment
echo ' <div class="control-group">
<div class="controls">
<a href="javascript://" onclick="return plus_attachment();"><span id="plus"><img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;'.get_lang(
<a href="javascript://" onclick="return plus_attachment();"><span id="plus">'.$showImg.'&nbsp;'.get_lang(
'AddAnAttachment'
).'</span></a>
<br />
@ -1197,4 +1214,4 @@ if (isset($_GET['action']) && $_GET['action'] == 'view') {
if (empty($_GET['origin']) or $_GET['origin'] !== 'learnpath') {
//we are not in learnpath tool
Display::display_footer();
}
}

@ -66,7 +66,7 @@ function move_selected_option(from, to){
}
function update_hidden_field(name){
var select = $('#' + name + '_selected');
var options = $("option", select)
//update hidden field
@ -77,7 +77,7 @@ function update_hidden_field(name){
keys.push(option.val());
});
keys = keys.join(',');
var hidden = $('#' + name);
hidden.val(keys);
}
@ -96,9 +96,9 @@ function toggle_list_selector(name)
list.hide();
overview.show();
}
var select = $('#' + name + '_selected');
//update overview
var content = [];
var options = $("option", select)
@ -107,7 +107,7 @@ function toggle_list_selector(name)
option = $(option);
content.push(option.text());
});
content = content.join(', ');
content = (content == '') ? lang.Everybody : content;
overview.text(content);
@ -127,7 +127,7 @@ function toggle_sendto()
list.hide();
overview.show();
}
var selected = $('#selectedform');
var content = list_box_content(selected[0])
content = (content == '') ? lang.Everybody : content;
@ -158,7 +158,7 @@ function move(fbox, tbox) {
var arrFboxIsDisabled = []; // if this from checkbox after move is disabled or not
var arrTboxIsDisabled = []; // if this to checkbox after move is disabled or not
var key_value = ""; // key for arrays arrFboxIsDisabled and arrTboxIsDisabled, use associative array key_value is the value of the array element (eg : GROUP:1 or USER:24)
var i;
for (i = 0; i < tbox.options.length; i++) {
arrLookup[tbox.options[i].text] = tbox.options[i].value;
@ -178,8 +178,8 @@ function move(fbox, tbox) {
{
arrTbox[tLength] = fbox.options[i].text;
tLength++;
}
else
}
else
{
arrFbox[fLength] = fbox.options[i].text;
key_value = fbox.options[i].value;
@ -187,14 +187,14 @@ function move(fbox, tbox) {
fLength++;
}
}
arrFbox.sort();
arrTbox.sort();
var arrFboxGroup = [];
var arrFboxUser = [];
var prefix_x;
var x;
for (x = 0; x < arrFbox.length; x++) {
prefix_x = arrFbox[x].substring(0, 2);
@ -204,15 +204,15 @@ function move(fbox, tbox) {
arrFboxUser.push(arrFbox[x]);
}
}
arrFboxGroup.sort();
arrFboxUser.sort();
arrFbox = arrFboxGroup.concat(arrFboxUser);
var arrTboxGroup = [];
var arrTboxUser = [];
var prefix_y;
var y;
for (y = 0; y < arrTbox.length; y++) {
prefix_y = arrTbox[y].substring(0, 2);
@ -222,16 +222,16 @@ function move(fbox, tbox) {
arrTboxUser.push(arrTbox[y]);
}
}
arrTboxGroup.sort();
arrTboxUser.sort();
arrTbox = arrTboxGroup.concat(arrTboxUser);
fbox.length = 0;
tbox.length = 0;
var c;
for (c = 0; c < arrFbox.length; c++)
for (c = 0; c < arrFbox.length; c++)
{
var no = new Option();
no.value = arrLookup[arrFbox[c]];
@ -242,7 +242,7 @@ function move(fbox, tbox) {
}
fbox[c] = no;
}
for (c = 0; c < arrTbox.length; c++)
for (c = 0; c < arrTbox.length; c++)
{
var no = new Option();
no.value = arrLookup[arrTbox[c]];
@ -250,12 +250,12 @@ function move(fbox, tbox) {
key_value = no.value;
if (arrTboxIsDisabled[key_value]) {
no.disabled = "disabled";
}
}
tbox[c] = no;
}
}
function validate()
function validate()
{
"use strict";
var f = document.new_calendar_item;
@ -266,7 +266,7 @@ function validate()
function selectAll(cbList, bSelect, showwarning) {
"use strict";
if (document.getElementById('emailTitle').value == '') {
document.getElementById('msg_error').innerHTML = lang.FieldRequired;
document.getElementById('msg_error').style.display = 'block';
@ -286,11 +286,11 @@ function selectAll(cbList, bSelect, showwarning) {
}
}
function reverseAll(cbList)
function reverseAll(cbList)
{
"use strict";
var i;
for (i = 0; i < cbList.length; i++)
for (i = 0; i < cbList.length; i++)
{
cbList[i].checked = !(cbList[i].checked);
cbList[i].selected = !(cbList[i].selected);
@ -298,14 +298,5 @@ function reverseAll(cbList)
}
function plus_attachment() {
"use strict";
if (document.getElementById('options').style.display == 'none') {
document.getElementById('options').style.display = 'block';
document.getElementById('plus').innerHTML = '&nbsp;<img style="vertical-align:middle;" src="../img/div_hide.gif" alt="" />&nbsp;' + lang.AddAnAttachment;
} else {
document.getElementById('options').style.display = 'none';
document.getElementById('plus').innerHTML = '&nbsp;<img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;' + lang.AddAnAttachment;
}
}
// End
// End

@ -648,7 +648,10 @@ function display_monthcalendar($month, $year, $agenda_items)
*/
function to_javascript()
{
return "<script type=\"text/javascript\" language=\"javascript\">
$showImg = Display::return_icon('div_show.gif');
$hideImg = Display::return_icon('div_hide.gif');
return "<script type=\"text/javascript\">
$(function() {
//js used when generating images on the fly see function Tracking::show_course_detail()
$(\".dialog\").dialog(\"destroy\");
@ -668,8 +671,6 @@ $(function() {
});
});
<!-- Begin javascript menu swapper
function move(fbox, tbox)
{
// @todo : change associative arrays arrLookup and arrLookupTitle that use firstname/lastnam as key
@ -768,23 +769,23 @@ function move(fbox, tbox)
function checkDate(month, day, year)
{
var monthLength =
var monthLength =
new Array(31,28,31,30,31,30,31,31,30,31,30,31);
if (!day || !month || !year)
if (!day || !month || !year)
return false;
// check for bisestile year
if (year/4 == parseInt(year/4))
// check for bisestile year
if (year/4 == parseInt(year/4))
monthLength[1] = 29;
if (month < 1 || month > 12)
if (month < 1 || month > 12)
return false;
if (day > monthLength[month-1])
if (day > monthLength[month-1])
return false;
return true;
return true;
}
function mktime() {
@ -820,79 +821,76 @@ function validate() {
}
function selectAll(cbList,bSelect,showwarning) {
var start_day = document.new_calendar_item.fday.value;
var start_month = document.new_calendar_item.fmonth.value;
var start_year = document.new_calendar_item.fyear.value;
var start_hour = document.new_calendar_item.fhour.value;
var start_minute = document.new_calendar_item.fminute.value;
var start_date = mktime(start_hour,start_minute,0,start_month,start_day,start_year)
var ends_day = document.new_calendar_item.end_fday.value;
var ends_month = document.new_calendar_item.end_fmonth.value;
var ends_year = document.new_calendar_item.end_fyear.value;
var ends_hour = document.new_calendar_item.end_fhour.value;
var ends_minute = document.new_calendar_item.end_fminute.value;
var ends_date = mktime(ends_hour,ends_minute,0,ends_month,ends_day,ends_year)
msg_err1 = document.getElementById(\"err_date\");
msg_err2 = document.getElementById(\"err_start_date\");
msg_err3 = document.getElementById(\"err_end_date\");
msg_err4 = document.getElementById(\"err_title\");
var error = false;
if (start_date > ends_date) {
if ($('#empty_end_date').is(':checked')) {
msg_err1.innerHTML=\"\";
msg_err2.innerHTML=\"\";
msg_err3.innerHTML=\"\";
} else {
error = true;
msg_err1.style.display =\"block\";
msg_err1.innerHTML=\"".get_lang('EndDateCannotBeBeforeTheStartDate')."\";
msg_err2.innerHTML=\"\";
msg_err3.innerHTML=\"\";
}
}
if (!checkDate(start_month,start_day,start_year)) {
msg_err2.style.display =\"block\";
msg_err2.innerHTML=\"".get_lang('InvalidDate')."\";
msg_err1.innerHTML=\"\";
msg_err3.innerHTML=\"\";
error = true;
}
if (!checkDate(ends_month,ends_day,ends_year)) {
msg_err3.style.display =\"block\";
msg_err3.innerHTML=\"".get_lang('InvalidDate')."\";
msg_err1.innerHTML=\"\";msg_err2.innerHTML=\"\";
error = true;
}
var start_day = document.new_calendar_item.fday.value;
var start_month = document.new_calendar_item.fmonth.value;
var start_year = document.new_calendar_item.fyear.value;
var start_hour = document.new_calendar_item.fhour.value;
var start_minute = document.new_calendar_item.fminute.value;
var start_date = mktime(start_hour,start_minute,0,start_month,start_day,start_year)
var ends_day = document.new_calendar_item.end_fday.value;
var ends_month = document.new_calendar_item.end_fmonth.value;
var ends_year = document.new_calendar_item.end_fyear.value;
var ends_hour = document.new_calendar_item.end_fhour.value;
var ends_minute = document.new_calendar_item.end_fminute.value;
var ends_date = mktime(ends_hour,ends_minute,0,ends_month,ends_day,ends_year)
msg_err1 = document.getElementById(\"err_date\");
msg_err2 = document.getElementById(\"err_start_date\");
msg_err3 = document.getElementById(\"err_end_date\");
msg_err4 = document.getElementById(\"err_title\");
var error = false;
if (start_date > ends_date) {
if ($('#empty_end_date').is(':checked')) {
msg_err1.innerHTML=\"\";
msg_err2.innerHTML=\"\";
msg_err3.innerHTML=\"\";
if (document.new_calendar_item.title.value == '') {
msg_err4.style.display =\"block\";
msg_err4.innerHTML=\"".get_lang('FieldRequired')."\";
msg_err1.innerHTML=\"\";msg_err2.innerHTML=\"\";msg_err3.innerHTML=\"\";
error = true;
}
if (error == false) {
if (cbList) {
if (cbList.length < 1) {
if (!confirm(\"".get_lang('Send2All')."\")) {
return false;
}
}
for (var i=0; i<cbList.length; i++)
cbList[i].selected = cbList[i].checked = bSelect;
}
document.new_calendar_item.submit();
}
} else {
error = true;
msg_err1.style.display =\"block\";
msg_err1.innerHTML=\"".get_lang('EndDateCannotBeBeforeTheStartDate')."\";
msg_err2.innerHTML=\"\";
msg_err3.innerHTML=\"\";
}
}
if (!checkDate(start_month,start_day,start_year)) {
msg_err2.style.display =\"block\";
msg_err2.innerHTML=\"".get_lang('InvalidDate')."\";
msg_err1.innerHTML=\"\";
msg_err3.innerHTML=\"\";
error = true;
}
if (!checkDate(ends_month,ends_day,ends_year)) {
msg_err3.style.display =\"block\";
msg_err3.innerHTML=\"".get_lang('InvalidDate')."\";
msg_err1.innerHTML=\"\";msg_err2.innerHTML=\"\";
error = true;
}
if (document.new_calendar_item.title.value == '') {
msg_err4.style.display =\"block\";
msg_err4.innerHTML=\"".get_lang('FieldRequired')."\";
msg_err1.innerHTML=\"\";msg_err2.innerHTML=\"\";msg_err3.innerHTML=\"\";
error = true;
}
if (error == false) {
if (cbList) {
if (cbList.length < 1) {
if (!confirm(\"".get_lang('Send2All')."\")) {
return false;
}
}
for (var i=0; i<cbList.length; i++)
cbList[i].selected = cbList[i].checked = bSelect;
}
document.new_calendar_item.submit();
}
}
function reverseAll(cbList)
@ -905,43 +903,41 @@ function reverseAll(cbList)
}
function plus_attachment() {
if (document.getElementById('options').style.display == 'none') {
document.getElementById('options').style.display = 'block';
document.getElementById('plus').innerHTML='&nbsp;<img style=\"vertical-align:middle;\" src=\"../img/div_hide.gif\" alt=\"\" />&nbsp;".get_lang(
'AddAnAttachment'
)."';
} else {
document.getElementById('options').style.display = 'none';
document.getElementById('plus').innerHTML='&nbsp;<img style=\"vertical-align:middle;\" src=\"../img/div_show.gif\" alt=\"\" />&nbsp;".get_lang(
'AddAnAttachment'
)."';
}
if (document.getElementById('options').style.display == 'none') {
document.getElementById('options').style.display = 'block';
document.getElementById('plus').innerHTML='&nbsp;".$hideImg."&nbsp;".get_lang(
'AddAnAttachment'
)."';
} else {
document.getElementById('options').style.display = 'none';
document.getElementById('plus').innerHTML='&nbsp;".$showImg."&nbsp;".get_lang(
'AddAnAttachment'
)."';
}
}
function plus_repeated_event() {
if (document.getElementById('options2').style.display == 'none') {
document.getElementById('options2').style.display = 'block';
document.getElementById('plus2').innerHTML='&nbsp;<img style=\"vertical-align:middle;\" src=\"../img/div_hide.gif\" alt=\"\" />&nbsp;".get_lang(
'RepeatEvent'
if (document.getElementById('options2').style.display == 'none') {
document.getElementById('options2').style.display = 'block';
document.getElementById('plus2').innerHTML='&nbsp;".$hideImg."&nbsp;".get_lang(
'RepeatEvent'
)."';
} else {
document.getElementById('options2').style.display = 'none';
document.getElementById('plus2').innerHTML='&nbsp;<img style=\"vertical-align:middle;\" src=\"../img/div_show.gif\" alt=\"\" />&nbsp;".get_lang(
'RepeatEvent'
} else {
document.getElementById('options2').style.display = 'none';
document.getElementById('plus2').innerHTML='&nbsp;".$showImg."&nbsp;".get_lang(
'RepeatEvent'
)."';
}
}
}
/*
function plus_ical() {
if (document.getElementById('icalform').style.display == 'none') {
document.getElementById('icalform').style.display = 'block';
document.getElementById('plusical').innerHTML='';
}
if (document.getElementById('icalform').style.display == 'none') {
document.getElementById('icalform').style.display = 'block';
document.getElementById('plusical').innerHTML='';
}
}
*/
// End -->
</script>";
}
@ -952,15 +948,12 @@ function plus_ical() {
*/
function user_group_filter_javascript()
{
return "<script language=\"JavaScript\" type=\"text/JavaScript\">
<!--
return "<script type=\"text/JavaScript\">
function MM_jumpMenu(targ,selObj,restore){
eval(targ+\".location='\"+selObj.options[selObj.selectedIndex].value+\"'\");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
";
</script>";
}
/**
@ -1670,6 +1663,7 @@ function load_edit_users($tool, $id)
$sql = "SELECT * FROM $TABLE_ITEM_PROPERTY WHERE c_id = $course_id AND tool='$tool' AND ref='$id'";
$result = Database::query($sql) or die(Database::error());
$to = array();
while ($row = Database::fetch_array($result)) {
$to_group = $row['to_group_id'];
switch ($to_group) {
@ -2501,11 +2495,13 @@ function display_one_agenda_item($agenda_id)
*/
function show_add_form($id = '', $type = null)
{
$showImg = Display::return_icon('div_show.gif');
$hideImg = Display::return_icon('div_hide.gif');
global $MonthsLong;
$htmlHeadXtra[] = to_javascript();
// the default values for the forms
if ($_GET['originalresource'] !== 'no') {
if (isset($_GET['originalresource']) && $_GET['originalresource'] !== 'no') {
$day = date('d');
$month = date('m');
$year = date('Y');
@ -2523,7 +2519,7 @@ function show_add_form($id = '', $type = null)
// When we clicked on the button to add resources we stored every form information into a session and now we
// are doing the opposite thing: getting the information out of the session and putting it into variables to
// display it in the forms.
$form_elements = $_SESSION['formelements'];
$form_elements = isset($_SESSION['formelements']) ? $_SESSION['formelements'] : null;
$day = $form_elements['day'];
$month = $form_elements['month'];
$year = $form_elements['year'];
@ -2893,7 +2889,7 @@ function show_add_form($id = '', $type = null)
<label class="control-label"></label>
<div class="controls">
<a href="javascript://" onclick="return plus_repeated_event();"><span id="plus2">
<img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('RepeatEvent').'</span>
'.$showImg.'&nbsp;'.get_lang('RepeatEvent').'</span>
</a>';
?>
<table id="options2" style="display: none;">
@ -3008,7 +3004,7 @@ function show_add_form($id = '', $type = null)
echo '</div>
</div>';
if ($agendaObj->type == 'course') {
if (isset($agendaObj) && $agendaObj->type == 'course') {
// File attachment
echo ' <div class="control-group">

@ -41,7 +41,7 @@ if (empty($action)) {
/* Resource linker */
$_SESSION['source_type'] = 'Agenda';
require_once '../resourcelinker/resourcelinker.inc.php';
require_once api_get_path(SYS_CODE_PATH).'resourcelinker/resourcelinker.inc.php';
if (!empty($addresources)) {
// When the "Add Resource" button is clicked we store all the form data into a session

@ -68,7 +68,7 @@ if ($view == "00000010")
$interbreadcrumb[] = array("url" => api_get_self() . "?view=0000000", "name" => get_lang('ToolName'));
include(api_get_path(LIBRARY_PATH) . "statsUtils.lib.inc.php");
include("../resourcelinker/resourcelinker.inc.php");
require_once api_get_path(SYS_CODE_PATH).'resourcelinker/resourcelinker.inc.php';
$is_allowedToTrack = api_is_course_admin() || api_is_platform_admin() || api_is_drh();

Loading…
Cancel
Save