revert some changes, my cvs client (smartcvs) goes wrong, commited all my local changes, MDL-8224

This commit is contained in:
Dongsheng Cai 2010-05-20 06:35:41 +00:00
parent af140288c4
commit 573e7e3396
8 changed files with 19 additions and 161 deletions

View File

@ -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, '<p>']);
t.addShortcut('ctrl+8', '', ['FormatBlock', false, '<div>']);
t.addShortcut('ctrl+9', '', ['FormatBlock', false, '<address>']);
// 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);

View File

@ -230,39 +230,5 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element {
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
}

View File

@ -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;
}

View File

@ -120,8 +120,8 @@ class page_requirements_manager {
// 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 @@ class page_requirements_manager {
$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 @@ class page_requirements_manager {
$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 @@ class page_requirements_manager {
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 @@ class page_requirements_manager {
* @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);
}

View File

@ -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);

View File

@ -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

View File

@ -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 '</div>';
}
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 '<div class="footer">'.$footer.'</div>';
}
@ -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 = <<<EOD
<div class="comment-userpicture">___picture___</div>
<div class="comment-content">
___name___ - <span>___time___</span>
<div>___content___</div>
</div>
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);

View File

@ -62,7 +62,10 @@ class mod_resource_mod_form extends moodleform_mod {
$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 @@ class mod_resource_mod_form extends moodleform_mod {
$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'));