Skip to content

Commit

Permalink
revert some changes, my cvs client (smartcvs) goes wrong, commited al…
Browse files Browse the repository at this point in the history
…l my local changes, MDL-8224
  • Loading branch information
Dongsheng Cai committed May 20, 2010
1 parent af14028 commit 573e7e3
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 161 deletions.
31 changes: 0 additions & 31 deletions lib/editor/tinymce/tiny_mce_src.js
Expand Up @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
34 changes: 0 additions & 34 deletions lib/form/editor.php
Expand Up @@ -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
}
7 changes: 1 addition & 6 deletions lib/formslib.php
Expand Up @@ -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();
Expand All @@ -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;
}
Expand Down
14 changes: 7 additions & 7 deletions lib/outputrequirementslib.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
}
Expand Down Expand Up @@ -338,15 +338,15 @@ 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
switch($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'),
Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions mod/assignment/lib.php
Expand Up @@ -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
*/
Expand All @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion mod/data/view.php
Expand Up @@ -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
Expand Down
78 changes: 4 additions & 74 deletions mod/forum/lib.php
Expand Up @@ -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?
Expand Down Expand Up @@ -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>';
}
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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.
Expand All @@ -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);
Expand Down
10 changes: 4 additions & 6 deletions mod/resource/mod_form.php
Expand Up @@ -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
Expand All @@ -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'));

Expand Down

0 comments on commit 573e7e3

Please sign in to comment.