Skip to content

Commit c2ed834

Browse files
committed
Melhorias no módulo book
1 parent acf0a4c commit c2ed834

File tree

14 files changed

+12493
-9
lines changed

14 files changed

+12493
-9
lines changed

lib/editor/tinymce/lib.php

+3
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public function supports_repositories() {
6767
* Sets up head code if necessary.
6868
*/
6969
public function head_setup() {
70+
7071
}
7172

7273
/**
@@ -83,6 +84,8 @@ public function use_editor($elementid, array $options=null, $fpoptions=null) {
8384
$PAGE->requires->js(new moodle_url($CFG->httpswwwroot.'/lib/editor/tinymce/tiny_mce/'.$this->version.'/tiny_mce_src.js'));
8485
} else {
8586
$PAGE->requires->js(new moodle_url($CFG->httpswwwroot.'/lib/editor/tinymce/tiny_mce/'.$this->version.'/tiny_mce.js'));
87+
$PAGE->requires->js(new moodle_url($CFG->httpswwwroot.'/lib/editor/tinymce/tiny_mce/'.$this->version.'/bootstrap.js'));
88+
8689
}
8790
$PAGE->requires->js_init_call('M.editor_tinymce.init_editor', array($elementid, $this->get_init_params($elementid, $options)), true);
8891
if ($fpoptions) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
$string['pluginname'] = 'Example';
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
defined('MOODLE_INTERNAL') || die();
4+
5+
class tinymce_example extends editor_tinymce_plugin {
6+
/** @var array list of buttons defined by this plugin */
7+
protected $buttons = array('example');
8+
9+
protected function update_init_params(array &$params, context $context,
10+
array $options = null) {
11+
12+
// Add button after 'spellchecker' in advancedbuttons3.
13+
$this->add_button_after($params, 3, 'example', 'spellchecker');
14+
15+
// Add JS file, which uses default name.
16+
$this->add_js_plugin($params);
17+
18+
}
19+
}
1.08 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
(function() {
2+
3+
// Load plugin specific language pack
4+
tinymce.PluginManager.requireLangPack('example');
5+
6+
tinymce.create('tinymce.plugins.Example', {
7+
/**
8+
* Initializes the plugin, this will be executed after the plugin has been created.
9+
* This call is done before the editor instance has finished it's initialization so use the onInit event
10+
* of the editor instance to intercept that event.
11+
*
12+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
13+
* @param {string} url Absolute URL to where the plugin is located.
14+
*/
15+
init : function(ed, url) {
16+
17+
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
18+
ed.addCommand('mceExample', function() {
19+
ed.windowManager.open({
20+
file : ed.getParam("moodle_plugin_base") + 'example/tinymce/example.html',
21+
width : 520 + ed.getLang('example.delta_width', 0),
22+
height : 320 + ed.getLang('example.delta_height', 0),
23+
inline : 1
24+
}, {
25+
plugin_url : url
26+
});
27+
});
28+
29+
// Register example button
30+
ed.addButton('example', {
31+
title : 'Example Plugin',
32+
cmd : 'mceExample',
33+
image : url + '/img/example.gif'
34+
});
35+
36+
},
37+
38+
/**
39+
* Returns information about the plugin as a name/value array.
40+
* The current keys are longname, author, authorurl, infourl and version.
41+
*
42+
* @return {Object} Name/value array containing information about the plugin.
43+
*/
44+
getInfo : function() {
45+
return {
46+
longname : 'Example plugin',
47+
author : 'Some author',
48+
authorurl : '',
49+
infourl : '',
50+
version : "1.0"
51+
};
52+
}
53+
});
54+
55+
// Register plugin
56+
tinymce.PluginManager.add('example', tinymce.plugins.Example);
57+
})();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<html>
2+
<div id="id_nome_da_infografia" class="infografia">
3+
<h6>Título da infografia, se existir</h6>
4+
<ul>
5+
<li id="bt_AAA" class="bt_info"><a href="#AAA">Título 1</a></li>
6+
<li id="bt_BBB" class="bt_info"><a href="#BBB">Título 2</a></li>
7+
<li id="bt_CCC" class="bt_info"><a href="#CCC">Título X</a></li>
8+
</ul>
9+
<div id="AAA" class="box_info">
10+
<p>Conteúdo 1</p>
11+
</div>
12+
<div id="BBB" class="box_info">
13+
<p>Conteúdo 2</p>
14+
</div>
15+
<div id="CCC" class="box_info">
16+
<p>Conteúdo X</p>
17+
</div>
18+
19+
</div>
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
defined('MOODLE_INTERNAL') || die();
4+
5+
// The current plugin version (Date: YYYYMMDDXX).
6+
$plugin->version = 2012112900;
7+
// Required Moodle version.
8+
$plugin->requires = 2012112900;
9+
// Full name of the plugin (used for diagnostics).
10+
$plugin->component = 'tinymce_example';

0 commit comments

Comments
 (0)