Merge branch 'w41_MDL-35645_m24_tinymcebuttons' of git://github.com/skodak/moodle
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
|
||||
$string['javaneeded'] = 'To use this page you need a Java-enabled browser. Download the latest Java plug-in from {$a}.';
|
||||
$string['pluginname'] = 'Insert equation';
|
||||
$string['requiretex'] = 'Require TeX filter';
|
||||
$string['requiretex_desc'] = 'If enabled the Dragmath button is visible only when the TeX filter is enabled in the editor context. Disable if you have a custom TeX filter that is enabled in global scope.';
|
||||
$string['title'] = 'DragMath Equation Editor';
|
||||
|
||||
/* All lang strings used from TinyMCE JavaScript code must be named 'pluginname:stringname', no need to create langs/en_dlg.js */
|
||||
|
||||
@@ -30,10 +30,12 @@ class tinymce_dragmath extends editor_tinymce_plugin {
|
||||
protected function update_init_params(array &$params, context $context,
|
||||
array $options = null) {
|
||||
|
||||
// If TeX filter is disabled, do not add button.
|
||||
$filters = filter_get_active_in_context($context);
|
||||
if (!array_key_exists('filter/tex', $filters)) {
|
||||
return;
|
||||
if ($this->get_config('requiretex', 1)) {
|
||||
// If TeX filter is disabled, do not add button.
|
||||
$filters = filter_get_active_in_context($context);
|
||||
if (!array_key_exists('filter/tex', $filters)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Add button before 'nonbreaking' in advancedbuttons3.
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* DragMath integration settings.
|
||||
*
|
||||
* @package tinymce_dragmath
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
if ($ADMIN->fulltree) {
|
||||
$settings->add(new admin_setting_configcheckbox('tinymce_dragmath/requiretex',
|
||||
get_string('requiretex', 'tinymce_dragmath'), get_string('requiretex_desc', 'tinymce_dragmath'), 1));
|
||||
}
|
||||
@@ -25,8 +25,8 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
// The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2012051700;
|
||||
$plugin->version = 2012100200;
|
||||
// Required Moodle version.
|
||||
$plugin->requires = 2011112900;
|
||||
$plugin->requires = 2012092700;
|
||||
// Full name of the plugin (used for diagnostics).
|
||||
$plugin->component = 'tinymce_dragmath';
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
*/
|
||||
|
||||
$string['pluginname'] = 'Insert emoticon';
|
||||
$string['requireemoticon'] = 'Require emoticon filter';
|
||||
$string['requireemoticon_desc'] = 'If enabled the emoticon button is visible only when the emoticon filter is enabled in the editor context.';
|
||||
|
||||
/* All lang strings used from TinyMCE JavaScript code must be named 'pluginname:stringname', no need to create langs/en_dlg.js */
|
||||
$string['moodleemoticon:desc'] = 'Insert emoticon';
|
||||
|
||||
@@ -31,10 +31,12 @@ class tinymce_moodleemoticon extends editor_tinymce_plugin {
|
||||
array $options = null) {
|
||||
global $OUTPUT;
|
||||
|
||||
// If emoticon filter is disabled, do not add button.
|
||||
$filters = filter_get_active_in_context($context);
|
||||
if (!array_key_exists('filter/emoticon', $filters)) {
|
||||
return;
|
||||
if ($this->get_config('requireemoticon', 1)) {
|
||||
// If emoticon filter is disabled, do not add button.
|
||||
$filters = filter_get_active_in_context($context);
|
||||
if (!array_key_exists('filter/emoticon', $filters)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Add button after 'image' in advancedbuttons3.
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Emoticon integration settings.
|
||||
*
|
||||
* @package tinymce_moodleemoticon
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
if ($ADMIN->fulltree) {
|
||||
$settings->add(new admin_setting_configcheckbox('tinymce_moodleemoticon/requireemoticon',
|
||||
get_string('requireemoticon', 'tinymce_moodleemoticon'), get_string('requireemoticon_desc', 'tinymce_moodleemoticon'), 1));
|
||||
}
|
||||
@@ -25,8 +25,8 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
// The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2012051700;
|
||||
$plugin->version = 2012100200;
|
||||
// Required Moodle version.
|
||||
$plugin->requires = 2011112900;
|
||||
$plugin->requires = 2012092700;
|
||||
// Full name of the plugin (used for diagnostics).
|
||||
$plugin->component = 'tinymce_moodleemoticon';
|
||||
|
||||
Reference in New Issue
Block a user