From 573e7e3396d67b361f2b7c6e9b7c1210ea5aefe9 Mon Sep 17 00:00:00 2001 From: Dongsheng Cai Date: Thu, 20 May 2010 06:35:41 +0000 Subject: [PATCH] revert some changes, my cvs client (smartcvs) goes wrong, commited all my local changes, MDL-8224 --- lib/editor/tinymce/tiny_mce_src.js | 31 ------------ lib/form/editor.php | 34 ------------- lib/formslib.php | 7 +-- lib/outputrequirementslib.php | 14 +++--- mod/assignment/lib.php | 4 +- mod/data/view.php | 2 +- mod/forum/lib.php | 78 ++---------------------------- mod/resource/mod_form.php | 10 ++-- 8 files changed, 19 insertions(+), 161 deletions(-) diff --git a/lib/editor/tinymce/tiny_mce_src.js b/lib/editor/tinymce/tiny_mce_src.js index 5b576a6b60633..c412aa1a0b301 100644 --- a/lib/editor/tinymce/tiny_mce_src.js +++ b/lib/editor/tinymce/tiny_mce_src.js @@ -10080,16 +10080,11 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager; t.setContent(t.startContent, {format : 'raw'}); }); - // coreplugin shortcut start // Add shortcuts if (s.custom_shortcuts) { if (s.custom_undo_redo_keyboard_shortcuts) { t.addShortcut('ctrl+z', t.getLang('undo_desc'), 'Undo'); t.addShortcut('ctrl+y', t.getLang('redo_desc'), 'Redo'); - // Adding shortcuts Coreplugins - // not finished yet - t.addShortcut('ctrl+alt+x', t.getLang('justifyleft_desc'), 'Align left'); - // end of this comment } // Add default shortcuts for gecko @@ -10106,7 +10101,6 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager; t.addShortcut('ctrl+7', '', ['FormatBlock', false, '

']); t.addShortcut('ctrl+8', '', ['FormatBlock', false, '

']); t.addShortcut('ctrl+9', '', ['FormatBlock', false, '
']); - // coreplugin shortcut end function find(e) { var v = null; @@ -11596,33 +11590,8 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager; }, setup : function() { - var t = this, ed = t.editor, s = ed.settings; - // Adding additional Shortcuts added from Colin Brinckmann - - ed.addShortcut('ctrl+alt+a', 'forecolor', 'mceForeColor'); - ed.addShortcut('ctrl+alt+b', 'emoticons', 'mceEmotion'); - ed.addShortcut('ctrl+alt+c', 'backcolor', 'mceBackColor'); - ed.addShortcut('ctrl+alt+d', 'charmap', 'mceCharMap'); - ed.addShortcut('ctrl+alt+e', 'fullscreen', 'mceFullScreen'); - ed.addShortcut('ctrl+alt+f', 'link', 'mceAdvLink'); - ed.addShortcut('ctrl+alt+g', 'anchor', 'mceInsertAnchor'); - ed.addShortcut('ctrl+alt+h', 'removeformat', 'RemoveFormat'); - ed.addShortcut('ctrl+alt+i', 'unlink', 'UnLink'); - ed.addShortcut('ctrl+alt+j', 'image', 'mceAdvImage'); - ed.addShortcut('ctrl+alt+k', 'table', 'mceInsertTable'); - ed.addShortcut('ctrl+alt+m', 'table.del', 'mceTableDelete'); - ed.addShortcut('ctrl+alt+o', 'moodlenolink', 'mcemoodlenolink'); - ed.addShortcut('ctrl+alt+p', 'layer', 'mceInsertLayer'); - ed.addShortcut('ctrl+alt+q', 'unsorted_list', 'UnsortedList'); - ed.addShortcut('ctrl+alt+r', 'sorted_list', 'SortedList'); - ed.addShortcut('ctrl+alt+s', 'dragmath', 'mceDragMath'); - ed.addShortcut('ctrl+alt+t', 'visualaid', 'mceVisualChars'); - ed.addShortcut('ctrl+alt+u', 'autosave', 'mceTinyAutoSaveRestore'); - ed.addShortcut('ctrl+alt+v', 'moodlemedia', 'mceMoodleMedia'); - ed.addShortcut('ctrl+alt+w', 'Print', 'mcePrint'); - // Force root blocks when typing and when getting output if (s.forced_root_block) { ed.onKeyUp.add(t.forceRoots, t); diff --git a/lib/form/editor.php b/lib/form/editor.php index 3dee9ffd3dc37..d9895f7ed1a3c 100644 --- a/lib/form/editor.php +++ b/lib/form/editor.php @@ -230,39 +230,5 @@ function toHtml() { return $str; } - /** - * Called by HTML_QuickForm whenever form event is made on this element - * - * @param string $event Name of event - * @param mixed $arg event arguments - * @param object $caller calling object - * @since 1.0 - * @access public - * @return void - */ - function onQuickFormEvent($event, $arg, &$caller) - { - switch ($event) { - case 'updateValue': - // constant values override both default and submitted ones - // default values are overriden by submitted - $value = $this->_findValue($caller->_constantValues); - if (null === $value) { - $value = $this->_findValue($caller->_submitValues); - if (null === $value) { - $value = $this->_findValue($caller->_defaultValues); - } - } - if (!is_array($value)) { - $value = array('value' => $value); - } - if (null !== $value) { - $this->setValue($value); - } - return true; - break; - } - return parent::onQuickFormEvent($event, $arg, $caller); - } // end func onQuickFormEvent } diff --git a/lib/formslib.php b/lib/formslib.php index f4496ad362b0f..7408ed3389206 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -1693,11 +1693,7 @@ function validate_' . $this->_formName . '_' . $elementName . '(element) { } '; $validateJS .= ' - element = frm.elements[\''.$elementName.'\']; - if (!element) { - element = frm.elements[\''.$elementName.'[text]\']; - } - ret = validate_' . $this->_formName . '_' . $elementName.'(element) && ret; + ret = validate_' . $this->_formName . '_' . $elementName.'(frm.elements[\''.$elementName.'\']) && ret; if (!ret && !first_focus) { first_focus = true; frm.elements[\''.$elementName.'\'].focus(); @@ -1717,7 +1713,6 @@ function validate_' . $this->_formName . '_' . $elementName . '(element) { // do not rely on frm function parameter, because htmlarea breaks it when overloading the onsubmit method $js .= ' function validate_' . $this->_formName . '(frm) { - var element; if (skipClientValidation) { return true; } diff --git a/lib/outputrequirementslib.php b/lib/outputrequirementslib.php index a54f45f03c503..c153c187bbfcb 100644 --- a/lib/outputrequirementslib.php +++ b/lib/outputrequirementslib.php @@ -120,8 +120,8 @@ public function __construct() { // set up some loader options if (debugging('', DEBUG_DEVELOPER)) { - $this->yui3loader->filter = YUI_RAW; // alternatively we could use just YUI_RAW here - $this->yui2loader->filter = YUI_RAW; // alternatively we could use just YUI_RAW here + $this->yui3loader->filter = YUI_DEBUG; // alternatively we could use just YUI_RAW here + $this->yui2loader->filter = YUI_DEBUG; // alternatively we could use just YUI_RAW here } else { $this->yui3loader->filter = null; $this->yui2loader->filter = null; @@ -249,7 +249,7 @@ protected function init_requirements_data(moodle_page $page, core_renderer $rend $this->string_for_js('confirmation', 'admin'); $this->string_for_js('cancel', 'moodle'); $this->string_for_js('yes', 'moodle'); - + if ($page->pagelayout === 'frametop') { $this->js_init_call('M.util.init_frametop'); } @@ -338,7 +338,7 @@ protected function find_module($component) { $module = null; - + if (strpos($component, 'core_') === 0) { // must be some core stuff - list here is not complete, this is just the stuff used from multiple places // so that we do nto have to repeat the definition of these modules over and over again @@ -346,7 +346,7 @@ protected function find_module($component) { case 'core_filepicker': $module = array('name' => 'core_filepicker', 'fullpath' => '/repository/filepicker.js', - 'requires' => array('base', 'node', 'node-event-simulate', 'json', 'async-queue', 'io', 'yui2-button', 'yui2-container', 'yui2-layout', 'yui2-menu', 'yui2-treeview', 'yui2-dragdrop', 'yui2-resize'), + 'requires' => array('base', 'node', 'node-event-simulate', 'json', 'async-queue', 'io', 'yui2-button', 'yui2-container', 'yui2-layout', 'yui2-menu', 'yui2-treeview', 'yui2-dragdrop'), 'strings' => array(array('add', 'repository'), array('back', 'repository'), array('cancel', 'moodle'), array('close', 'repository'), array('cleancache', 'repository'), array('copying', 'repository'), array('date', 'repository'), array('downloadsucc', 'repository'), array('emptylist', 'repository'), array('error', 'repository'), array('federatedsearch', 'repository'), @@ -714,8 +714,8 @@ public function data_for_js($variable, $data, $inhead=false) { * @param string $function The name of the function to call * @param array $arguments An optional array of argument parameters to pass to the function * @return void - */ - public function event_handler($selector, $event, $function, array $arguments = null) { + */ + public function event_handler($selector, $event, $function, array $arguments = null) { $this->eventhandlers[] = array('selector'=>$selector, 'event'=>$event, 'function'=>$function, 'arguments'=>$arguments); } diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index b7a2f1fee0a31..253f88ca9f74e 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -3347,7 +3347,7 @@ function assignment_supports($feature) { /** * Adds module specific settings to the settings block - * + * * @param settings_navigation $settings The settings navigation object * @param navigation_node $assignmentnode The node to add module settings to */ @@ -3356,7 +3356,7 @@ function assignment_extend_settings_navigation(settings_navigation $settings, na $assignmentrow = $DB->get_record("assignment", array("id" => $PAGE->cm->instance)); require_once "$CFG->dirroot/mod/assignment/type/$assignmentrow->assignmenttype/assignment.class.php"; - + $assignmentclass = 'assignment_'.$assignmentrow->assignmenttype; $assignmentinstance = new $assignmentclass($PAGE->cm->id, $assignmentrow, $PAGE->cm, $PAGE->course); diff --git a/mod/data/view.php b/mod/data/view.php index f79cc1082c788..3579984f55ee8 100755 --- a/mod/data/view.php +++ b/mod/data/view.php @@ -295,7 +295,7 @@ $PAGE->set_title($title); $PAGE->set_heading($course->fullname); - + echo $OUTPUT->header(); /// Check to see if groups are being used here diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 38308a11c6a80..6045ffdf51c7a 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -1428,10 +1428,10 @@ function forum_print_recent_activity($course, $viewfullnames, $timestart) { */ function forum_get_user_grades($forum, $userid=0) { global $CFG; - + require_once($CFG->dirroot.'/rating/lib.php'); $rm = new rating_manager(); - + $ratingoptions = new stdclass(); //need these to work backwards to get a context id. Is there a better way to get contextid from a module instance? @@ -3384,18 +3384,6 @@ function forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=fa echo '
'; } - if (!empty($CFG->usecomments)) { - require_once($CFG->dirroot . '/comment/lib.php'); - $cmt = new stdclass; - $cmt->context = $modcontext; - $cmt->area = 'forum_post'; - $cmt->itemid = $post->id; - $cmt->pluginname = 'forum'; - $cmt->course = $course; - $comment = new comment($cmt); - $html = $comment->output(true); - echo $html; - } if ($footer) { echo ''; } @@ -7007,7 +6995,7 @@ function forum_reset_userdata($data) { // remove all ratings in this course's forums if (!empty($data->reset_forum_ratings)) { $ratingdeloptions = new stdclass(); - + if ($forums) { foreach ($forums as $forumid=>$unused) { if (!$cm = get_coursemodule_from_instance('forum', $forumid)) { @@ -7366,64 +7354,6 @@ function forum_get_extra_capabilities() { } -// a callback function to control permissions -function forum_comment_permissions($params) { - return array('post'=>true, 'view'=>true); -} - -// a callback function to modify user's comment before incerting into db -function forum_comment_add(&$comment, $params) { - global $USER; - $comment->content .= (' ~ by ' . fullname($USER)); - return true; -} - -// a cb function to format comments listing -function forum_comment_display($comments, $params) { - foreach($comments as &$c) { - $c->content .= ' did call back'; - } - return $comments; -} -// a cb function to return comment template -function forum_comment_template($options) { - $ret = <<___picture___ -
- ___name___ - ___time___ -
___content___
-
-EOD; - return $ret; -} - -// a cb function to return original url of comments -function forum_comment_url($options) { - global $CFG, $DB; - if (!$context = get_context_instance_by_id($options->contextid)) { - return null; - } - if ($context->contextlevel == CONTEXT_MODULE) { - switch ($options->commentarea) { - case 'forum_post': - if ($record = $DB->get_record('forum_posts', array('id'=>$options->itemid))){ - $parentid = $record->discussion; - } else { - $parentid = $options->itemid; - } - $url = $CFG->httpswwwroot.'/mod/forum/discuss.php?d='.$parentid.'#p' . $options->itemid; - return $url; - break; - default: - return null; - break; - } - } else { - return null; - } - -} - /** * This function is used to extend the global navigation by add forum nodes if there * is relevant content. @@ -7435,7 +7365,7 @@ function forum_comment_url($options) { */ function forum_extend_navigation($navref, $course, $module, $cm) { global $CFG, $OUTPUT, $USER; - + $limit = 5; $discussions = forum_get_discussions($cm,"d.timemodified DESC", false, -1, $limit); diff --git a/mod/resource/mod_form.php b/mod/resource/mod_form.php index a7f91207dee82..f40de2dd127c7 100644 --- a/mod/resource/mod_form.php +++ b/mod/resource/mod_form.php @@ -62,7 +62,10 @@ function definition() { $mform->addElement('header', 'contentsection', get_string('contentheader', 'resource')); $mainfile = 'mainfile'; - $mform->addElement('static', 'warning', '', get_string('notmigrated', 'resource')); + $mform->addElement('text', $mainfile, get_string('selectedfile')); + $mform->setType($mainfile, PARAM_PATH); + $mform->addRule($mainfile, null, 'required', null, 'client'); + $filemanager_options = array(); // 3 == FILE_EXTERNAL & FILE_INTERNAL // These two constant names are defined in repository/lib.php @@ -74,11 +77,6 @@ function definition() { $mform->addElement('filemanager', 'files', get_string('selectfiles'), null, $filemanager_options); - $mform->addElement('text', $mainfile, get_string('selectedfile')); - $mform->setType($mainfile, PARAM_PATH); - $mform->addRule($mainfile, null, 'required', null, 'client'); - - //------------------------------------------------------- $mform->addElement('header', 'optionssection', get_string('optionsheader', 'resource'));