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
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;
},
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);
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
}
}
';
$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();
// 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;
}
// 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;
$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');
}
$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
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'),
* @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);
}
/**
* 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
*/
$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);
$PAGE->set_title($title);
$PAGE->set_heading($course->fullname);
-
+
echo $OUTPUT->header();
/// Check to see if groups are being used here
*/
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?
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>';
}
// 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)) {
}
-// 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.
*/
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);
$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
$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'));