From 09eadcc8bae7daa61c71bd3233c3f133009c2a09 Mon Sep 17 00:00:00 2001 From: Arthur Portugal Date: Wed, 6 Jan 2010 11:30:28 -0500 Subject: [PATCH] Changed in the java script $(window) by $(document) CT#462 --- main/announcements/announcements.php | 8 ++++---- main/calendar/agenda.inc.php | 6 +++--- main/document/create_document.php | 14 +++++++------- main/document/upload.php | 8 ++++---- main/dropbox/dropbox_functions.inc.php | 8 ++++---- main/exercice/exercise.class.php | 8 ++++---- main/forum/forumfunction.inc.php | 13 +++++++------ main/glossary/index.php | 4 ++-- main/gradebook/lib/fe/evalform.class.php | 8 ++++---- main/newscorm/lp_add.php | 6 +++--- main/notebook/index.php | 6 +++--- main/survey/create_new_survey.php | 6 +++--- main/survey/survey.lib.php | 6 +++--- main/wiki/index.php | 8 ++++---- main/wiki/wiki.inc.php | 18 +++++++----------- main/work/work.php | 6 +++--- 16 files changed, 65 insertions(+), 68 deletions(-) diff --git a/main/announcements/announcements.php b/main/announcements/announcements.php index 5c471629d8..0791f5602f 100755 --- a/main/announcements/announcements.php +++ b/main/announcements/announcements.php @@ -25,7 +25,7 @@ $language_file[] = 'survey'; $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'; $this_section=SECTION_COURSES; $nameTools = get_lang('Announcement'); @@ -211,9 +211,9 @@ $htmlHeadXtra[] = to_javascript(); $htmlHeadXtra[] = ''; //jQuery $htmlHeadXtra[] = ''; @@ -1125,7 +1125,7 @@ if ($display_form == true) {
- +
'; diff --git a/main/calendar/agenda.inc.php b/main/calendar/agenda.inc.php index 4d18901ec8..2777c1c68d 100755 --- a/main/calendar/agenda.inc.php +++ b/main/calendar/agenda.inc.php @@ -39,9 +39,9 @@ $htmlHeadXtra[] = to_javascript(); $htmlHeadXtra[] = ''; //jQuery $htmlHeadXtra[] = ''; @@ -2859,7 +2859,7 @@ function show_add_form($id = '')
-
diff --git a/main/document/create_document.php b/main/document/create_document.php index be996a1e0a..6e26371fed 100755 --- a/main/document/create_document.php +++ b/main/document/create_document.php @@ -42,12 +42,12 @@ // name of the language file that needs to be included $language_file = 'document'; -include ('../inc/global.inc.php'); +require_once '../inc/global.inc.php'; $_SESSION['whereami'] = 'document/create'; $this_section = SECTION_COURSES; -$htmlHeadXtra[] = ''; //jQuery -$htmlHeadXtra[]=''; //jQuery +$htmlHeadXtra[] = ''; require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php'; @@ -361,7 +361,7 @@ $group = array(); if (api_get_setting('use_document_title') == 'true') { //$group[]= $form->add_textfield('title', get_lang('Title'),true,'class="input_titles" id="title"'); // replace the add_textfield with this - $group[]=$form->createElement('text','title',get_lang('Title'),'class="input_titles" id="title"'); + $group[]=$form->createElement('text','title',get_lang('Title'),'class="input_titles" id="document_title"'); //$form->applyFilter('title','trim'); //$form->addRule('title', get_lang('ThisFieldIsRequired'), 'required'); @@ -371,7 +371,7 @@ if (api_get_setting('use_document_title') == 'true') { } else { //$form->add_textfield('filename', get_lang('FileName'),true,'class="input_titles" id="filename" onblur="check_if_still_empty()"'); // replace the add_textfield with this - $group[]=$form->createElement('text','filename',get_lang('FileName'),'class="input_titles" id="filename" onblur="check_if_still_empty()"'); + $group[]=$form->createElement('text','filename',get_lang('FileName'),'class="input_titles" id="document_title" onblur="check_if_still_empty()"'); //$form->applyFilter('filename','trim'); //$form->addRule('filename', get_lang('ThisFieldIsRequired'), 'required'); //$form->addRule('filename', get_lang('FileExists'), 'callback', 'document_exists'); diff --git a/main/document/upload.php b/main/document/upload.php index a711470652..e262eb1086 100755 --- a/main/document/upload.php +++ b/main/document/upload.php @@ -59,7 +59,7 @@ $language_file = 'document'; // including the global Dokeos file -require_once "../inc/global.inc.php"; +require_once '../inc/global.inc.php'; // including additional libraries require_once api_get_path(LIBRARY_PATH) . 'fileUpload.lib.php'; @@ -95,9 +95,9 @@ function advanced_parameters() { } function setFocus(){ - $("#title").focus(); + $("#title_file").focus(); } - $(window).load(function () { + $(document).ready(function () { setFocus(); }); '; @@ -555,7 +555,7 @@ $form->addElement('file','user_upload',get_lang('File'),'id="user_upload" size=" if(api_get_setting('use_document_title')=='true') { - $form->addElement('text','title',get_lang('Title'),array('size'=>'20','style' => 'width:300px','id' => 'title')); + $form->addElement('text','title',get_lang('Title'),array('size'=>'20','style' => 'width:300px','id' => 'title_file')); $form->addElement('textarea','comment',get_lang('Comment'),'wrap="virtual" style="width:300px;"'); } //Advanced parameters diff --git a/main/dropbox/dropbox_functions.inc.php b/main/dropbox/dropbox_functions.inc.php index 7158b10888..2b6334fbe6 100755 --- a/main/dropbox/dropbox_functions.inc.php +++ b/main/dropbox/dropbox_functions.inc.php @@ -5,7 +5,7 @@ * functions in the init files also but I have moved them over * to one file -- Patrick Cool , Ghent University */ -include('../inc/global.inc.php'); +require_once '../inc/global.inc.php'; /* ----------------------------------------------------------- Javascript @@ -15,9 +15,9 @@ include('../inc/global.inc.php'); $htmlHeadXtra[] = ''; //jQuery $htmlHeadXtra[] = ''; @@ -502,7 +502,7 @@ function display_addcategory_form($category_name='', $id='',$action) { echo ''.get_lang('CategoryAlreadyExistsEditIt').'
'; } - echo ' + echo ' '; diff --git a/main/exercice/exercise.class.php b/main/exercice/exercise.class.php index 3273057a5e..c69b7f9257 100755 --- a/main/exercice/exercise.class.php +++ b/main/exercice/exercise.class.php @@ -7,7 +7,7 @@ * @author Olivier Brouckaert * @version $Id: exercise.class.php 22046 2009-07-14 01:45:19Z ivantcholakov $ */ -include ('../inc/global.inc.php'); +require_once '../inc/global.inc.php'; define('ALL_ON_ONE_PAGE',1); define('ONE_PER_PAGE',2); @@ -18,9 +18,9 @@ define('EXERCISE_FEEDBACK_TYPE_EXAM',2); $htmlHeadXtra[] = ''; //jQuery $htmlHeadXtra[] = ''; @@ -917,7 +917,7 @@ class Exercise } $form->addElement('header', '', $form_title); // title - $form -> addElement('text', 'exerciseTitle', get_lang('ExerciseName'),'class="input_titles" id="title"'); + $form -> addElement('text', 'exerciseTitle', get_lang('ExerciseName'),'class="input_titles" id="exercise_title"'); //$form->applyFilter('exerciseTitle','html_filter'); $form -> addElement('html','
diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php index 230aba38b6..30268c545e 100755 --- a/main/forum/forumfunction.inc.php +++ b/main/forum/forumfunction.inc.php @@ -66,7 +66,6 @@ * -- Patrick Cool ************************************************************************** */ -require_once '../inc/global.inc.php'; require_once(api_get_path(LIBRARY_PATH).'mail.lib.inc.php'); require_once(api_get_path(LIBRARY_PATH).'text.lib.php'); require_once(api_get_path(INCLUDE_PATH).'/conf/mail.conf.php'); @@ -82,9 +81,11 @@ get_notifications_of_user(); $htmlHeadXtra[] = ''; //jQuery $htmlHeadXtra[] = ''; @@ -171,7 +172,7 @@ function show_add_forumcategory_form($inputvalues=array()) { // settting the form elements $form->addElement('header', '', get_lang('AddForumCategory')); - $form->addElement('text', 'forum_category_title', get_lang('Title'),'class="input_titles" id="title"'); + $form->addElement('text', 'forum_category_title', get_lang('Title'),'class="input_titles" id="category_title"'); //$form->applyFilter('forum_category_title', 'html_filter'); $form->addElement('html_editor', 'forum_category_comment', get_lang('Comment'), null, array('ToolbarSet' => 'Forum', 'Width' => '98%', 'Height' => '200')); //$form->applyFilter('forum_category_comment', 'html_filter'); @@ -225,7 +226,7 @@ function show_add_forum_form($inputvalues=array()) { $form->addElement('hidden', 'forum_id', $my_forum_id); } // The title of the forum - $form->addElement('text', 'forum_title', get_lang('Title'),'class="input_titles" id="title"'); + $form->addElement('text', 'forum_title', get_lang('Title'),'class="input_titles" id="forum_title"'); //$form->applyFilter('forum_title', 'html_filter'); // The comment of the forum $form->addElement('html_editor', 'forum_comment', get_lang('Comment'), null, array('ToolbarSet' => 'Forum', 'Width' => '98%', 'Height' => '200')); @@ -3223,7 +3224,7 @@ function forum_search() { // settting the form elements $form->addElement('header', '', get_lang('ForumSearch')); - $form->addElement('text', 'search_term', get_lang('SearchTerm'),'class="input_titles" id="title"'); + $form->addElement('text', 'search_term', get_lang('SearchTerm'),'class="input_titles" id="search_title"'); $form->applyFilter('search_term', 'html_filter'); $form->addElement('static', 'search_information', '', get_lang('ForumSearchInformation')/*, $dissertation[$_GET['opleidingsonderdeelcode']]['code']*/); $form->addElement('style_submit_button', null, get_lang('Search'), 'class="search"'); diff --git a/main/glossary/index.php b/main/glossary/index.php index 4159d0e28c..62a88b6a5a 100755 --- a/main/glossary/index.php +++ b/main/glossary/index.php @@ -10,7 +10,7 @@ $language_file = array('glossary'); // including the global dokeos file -require_once('../inc/global.inc.php'); +require_once '../inc/global.inc.php'; // the section (tabs) $this_section=SECTION_COURSES; @@ -28,7 +28,7 @@ $htmlHeadXtra[] = ''; diff --git a/main/gradebook/lib/fe/evalform.class.php b/main/gradebook/lib/fe/evalform.class.php index 8d0299b09a..67f814cbc7 100755 --- a/main/gradebook/lib/fe/evalform.class.php +++ b/main/gradebook/lib/fe/evalform.class.php @@ -33,12 +33,12 @@ require_once (api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.ph * @package dokeos.gradebook */ - $htmlHeadXtra[] = ''; //jQuery +$htmlHeadXtra[] = ''; //jQuery $htmlHeadXtra[] = ''; @@ -326,7 +326,7 @@ class EvalForm extends FormValidator $this->add_textfield('name', get_lang('EvaluationName'), true, array ( 'size' => '54', 'maxlength' => '50', - 'id' => 'title' + 'id' => 'evaluation_title' )); $this->add_textfield('weight', get_lang('Weight'), true, array ( 'size' => '4', diff --git a/main/newscorm/lp_add.php b/main/newscorm/lp_add.php index f5d1dc655d..6d03ce0278 100755 --- a/main/newscorm/lp_add.php +++ b/main/newscorm/lp_add.php @@ -68,9 +68,9 @@ $htmlHeadXtra[] = ''; $htmlHeadXtra[] = ''; //jQuery $htmlHeadXtra[] = ''; @@ -154,7 +154,7 @@ echo '
'; echo ''; echo '
'; echo '
'; -echo ''; +echo ''; echo '
'; echo '
'; diff --git a/main/notebook/index.php b/main/notebook/index.php index e04d22a5be..bbc798f913 100755 --- a/main/notebook/index.php +++ b/main/notebook/index.php @@ -29,9 +29,9 @@ $htmlHeadXtra[] = javascript_notebook(); $htmlHeadXtra[] = ''; //jQuery $htmlHeadXtra[] = ''; @@ -80,7 +80,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'addnote') $form = new FormValidator('note','post', api_get_self().'?action='.Security::remove_XSS($_GET['action'])); // settting the form elements $form->addElement('header', '', get_lang('NoteAddNew')); - $form->addElement('text', 'note_title', get_lang('NoteTitle'),array('size'=>'95', 'id'=> 'notetitle')); + $form->addElement('text', 'note_title', get_lang('NoteTitle'),array('size'=>'95', 'id'=> 'note_title')); //$form->applyFilter('note_title', 'html_filter'); $form->addElement('html_editor', 'note_comment', get_lang('NoteComment'), null, api_is_allowed_to_edit() ? array('ToolbarSet' => 'Notebook', 'Width' => '100%', 'Height' => '300') diff --git a/main/survey/create_new_survey.php b/main/survey/create_new_survey.php index 7e14b856f7..f90b0b19e1 100755 --- a/main/survey/create_new_survey.php +++ b/main/survey/create_new_survey.php @@ -64,9 +64,9 @@ $htmlHeadXtra[] = ''; @@ -155,7 +155,7 @@ if ($_GET['action'] == 'edit' AND isset($survey_id) AND is_numeric($survey_id)) $form->addElement('hidden', 'survey_id'); } -$survey_code = $form->addElement('text', 'survey_code', get_lang('SurveyCode'), array('size' => '20','maxlength'=>'20', 'id'=>'SurveyCode')); +$survey_code = $form->addElement('text', 'survey_code', get_lang('SurveyCode'), array('size' => '20','maxlength'=>'20', 'id'=>'surveycode_title')); //$form->applyFilter('survey_code', 'html_filter'); if ($_GET['action'] == 'edit') { diff --git a/main/survey/survey.lib.php b/main/survey/survey.lib.php index 269e58dcda..42be0d65b8 100755 --- a/main/survey/survey.lib.php +++ b/main/survey/survey.lib.php @@ -36,9 +36,9 @@ require_once(api_get_path(LIBRARY_PATH).'usermanager.lib.php'); $htmlHeadXtra[] = ''; //jQuery $htmlHeadXtra[] = ''; @@ -4396,7 +4396,7 @@ class SurveyUtil { '.get_lang('Title').'
- +
'; echo '
diff --git a/main/wiki/index.php b/main/wiki/index.php index 94e69155f7..b61550ef3e 100755 --- a/main/wiki/index.php +++ b/main/wiki/index.php @@ -43,7 +43,7 @@ if(isset($_GET['id_session'])) { } // including the global dokeos file -include('../inc/global.inc.php'); +require_once '../inc/global.inc.php'; // section (for the tabs) $this_section=SECTION_COURSES; @@ -76,9 +76,9 @@ function advanced_parameters() { } } function setFocus(){ - $("#search_term").focus(); + $("#search_title").focus(); } - $(window).load(function () { + $(document).ready(function () { setFocus(); }); @@ -1040,7 +1040,7 @@ if ($_GET['action']=='searchpages') // settting the form elements - $form->addElement('text', 'search_term', get_lang('SearchTerm'),'class="input_titles" id="search_term"'); + $form->addElement('text', 'search_term', get_lang('SearchTerm'),'class="input_titles" id="search_title"'); $form->addElement('checkbox', 'search_content', null, get_lang('AlsoSearchContent')); $form->addElement('style_submit_button', 'SubmitWikiSearch', get_lang('Search'), 'class="search"'); diff --git a/main/wiki/wiki.inc.php b/main/wiki/wiki.inc.php index 56474165b8..2a0a83deb3 100755 --- a/main/wiki/wiki.inc.php +++ b/main/wiki/wiki.inc.php @@ -32,16 +32,6 @@ * @package dokeos.wiki */ -$htmlHeadXtra[] = ''; //jQuery -$htmlHeadXtra[] = ''; - /* ============================================================================== FUNCTIONS FOR WIKI @@ -603,12 +593,18 @@ function CheckSend() } return true; } + function setFocus(){ + $("#wiki_title").focus(); + } + $(document).ready(function () { + setFocus(); + }); '; echo '
'; - echo '* '.get_lang(Title).': '; + echo '* '.get_lang(Title).': '; if(api_is_allowed_to_edit(false,true) || api_is_platform_admin()) { diff --git a/main/work/work.php b/main/work/work.php index 83fb36b649..e6f280f521 100755 --- a/main/work/work.php +++ b/main/work/work.php @@ -100,9 +100,9 @@ $htmlHeadXtra[] = to_javascript_work(); $htmlHeadXtra[] = ''; //jQuery $htmlHeadXtra[] = ''; @@ -1404,7 +1404,7 @@ function draw_date_picker($prefix,$default='') {
- +
'; //$new_folder_text .= '';