diff --git a/main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary.js.php b/main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary.js.php
new file mode 100755
index 0000000000..8b13789179
--- /dev/null
+++ b/main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary.js.php
@@ -0,0 +1 @@
+
diff --git a/main/inc/lib/fckeditor/editor/plugins/glossary/fckplugin.js b/main/inc/lib/fckeditor/editor/plugins/glossary/fckplugin.js
new file mode 100644
index 0000000000..d09105f4e9
--- /dev/null
+++ b/main/inc/lib/fckeditor/editor/plugins/glossary/fckplugin.js
@@ -0,0 +1,56 @@
+// Register the command.
+
+var FCKGlossary = function( name )
+{
+ this.Name = name ;
+ this.StyleName = '_FCK_Glossary' ;
+ this.IsActive = false ;
+ this.EditMode = FCK.EditMode;
+
+ FCKStyles.AttachStyleStateChange( this.StyleName, this._OnStyleStateChange, this ) ;
+}
+
+FCKGlossary.prototype =
+ {
+ Execute : function()
+ {
+ FCKUndo.SaveUndoStep() ;
+
+ if ( this.IsActive ) {
+ FCKStyles.RemoveStyle(this.StyleName) ;
+ }
+ else {
+ FCKStyles.ApplyStyle( this.StyleName ) ;
+ }
+ FCK.Focus() ;
+ FCK.Events.FireEvent( 'OnSelectionChange' ) ;
+ },
+
+ GetState : function()
+ {
+ if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
+ return FCK_TRISTATE_DISABLED ;
+ return this.IsActive ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF;
+ },
+
+ _OnStyleStateChange : function( styleName, isActive )
+ {
+ this.IsActive = isActive ;
+ }
+ };
+
+
+
+
+FCKCommands.RegisterCommand( 'Glossary' , new FCKGlossary( 'Glossary' ) ) ;
+
+/*FCKCommands.RegisterCommand( 'Glossary',
+ new FCKCoreStyleCommand( 'Italic' )
+) ;*/
+
+// Create and register the Audio toolbar button.
+var oGlossaryItem = new FCKToolbarButton( 'Glossary', FCKLang['GlossaryTitle'], null, null, null, null, null );
+
+oGlossaryItem.IconPath = FCKConfig.PluginsPath + 'glossary/glossary.gif' ;
+
+ FCKToolbarItems.RegisterItem( 'Glossary', oGlossaryItem ) ;
diff --git a/main/inc/lib/fckeditor/editor/plugins/glossary/glossary.gif b/main/inc/lib/fckeditor/editor/plugins/glossary/glossary.gif
new file mode 100644
index 0000000000..5293fc25fe
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/glossary/glossary.gif differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/glossary/lang/en.js b/main/inc/lib/fckeditor/editor/plugins/glossary/lang/en.js
new file mode 100755
index 0000000000..08ac904bc8
--- /dev/null
+++ b/main/inc/lib/fckeditor/editor/plugins/glossary/lang/en.js
@@ -0,0 +1,7 @@
+// Glossary.
+// English language file.
+// Please, use UTF-8 encoding.
+
+FCKLang['GlossaryTitle'] = 'Glossary' ;
+
+
diff --git a/main/inc/lib/fckeditor/editor/plugins/glossary/lang/es.js b/main/inc/lib/fckeditor/editor/plugins/glossary/lang/es.js
new file mode 100755
index 0000000000..8b5d507fd1
--- /dev/null
+++ b/main/inc/lib/fckeditor/editor/plugins/glossary/lang/es.js
@@ -0,0 +1,5 @@
+// Glossary.
+// Spanish language file.
+// Please, use UTF-8 encoding.
+
+FCKLang['GlossaryTitle'] = 'Glosario' ;
diff --git a/main/inc/lib/fckeditor/fckconfig.js b/main/inc/lib/fckeditor/fckconfig.js
index 8128b8ffdc..b2210a5b1c 100644
--- a/main/inc/lib/fckeditor/fckconfig.js
+++ b/main/inc/lib/fckeditor/fckconfig.js
@@ -229,6 +229,14 @@ FCKConfig.CoreStyles =
'h6' : { Element : 'h6' },
// Other formatting features.
+
+ 'Glossary' :
+ {
+ Element : 'span',
+ Styles : { 'color' : '#00974A','cursor' : 'pointer','font-weight' : 'bold' },
+ Attributes : { 'class' : 'glossary' }
+ },
+
'FontFace' :
{
Element : 'span',
diff --git a/main/inc/lib/fckeditor/fckstyles.xml b/main/inc/lib/fckeditor/fckstyles.xml
index 49718f9f85..84d45724e6 100644
--- a/main/inc/lib/fckeditor/fckstyles.xml
+++ b/main/inc/lib/fckeditor/fckstyles.xml
@@ -55,6 +55,11 @@
+
+
+
diff --git a/main/inc/lib/fckeditor/fcktemplates.xml.php b/main/inc/lib/fckeditor/fcktemplates.xml.php
index 5076e55537..714b5e146c 100644
--- a/main/inc/lib/fckeditor/fcktemplates.xml.php
+++ b/main/inc/lib/fckeditor/fcktemplates.xml.php
@@ -17,6 +17,14 @@ $IMConfig['base_url'] = $_configuration['root_web'].'main/img/gallery/';
// load a stylesheet
$css = loadCSS(api_get_setting('stylesheets'));
+
+// load libreries js
+$js = '';
+if (api_get_setting('show_glossary_in_documents') != 'none') {
+ $js .= ''.PHP_EOL;
+ $js .= '';
+}
+
// setting some paths
$img_dir = api_get_path(REL_CODE_PATH).'img/';
$default_course_dir = api_get_path(REL_CODE_PATH).'default_course_document/';
@@ -87,7 +95,7 @@ function s2($var)
function load_platform_templates() {
// Database table definition
$table_template = Database::get_main_table('system_template');
- global $css, $img_dir, $default_course_dir;
+ global $css, $img_dir, $default_course_dir,$js;
$sql = "SELECT title, image, comment, content FROM $table_template";
$result = api_sql_query($sql, __FILE__, __LINE__);
@@ -97,7 +105,8 @@ function load_platform_templates() {
} else {
$image = api_get_path(WEB_PATH).'home/default_platform_document/template_thumb/empty.gif';
}
- $row['content'] = str_replace('{CSS}',$css, $row['content']);
+
+ $row['content'] = str_replace('{CSS}',$css.$js, $row['content']);
$row['content'] = str_replace('{IMG_DIR}',$img_dir, $row['content']);
$row['content'] = str_replace('{REL_PATH}', api_get_path(REL_PATH), $row['content']);
$row['content'] = str_replace('{COURSE_DIR}',$default_course_dir, $row['content']);
@@ -176,7 +185,7 @@ function load_personal_templates($user_id=0) {
function load_empty_template()
{
- global $css;
+ global $css,$js;
?>
@@ -184,7 +193,8 @@ function load_empty_template()
-
+
+