tinymce.module
Search API
- 7.x modules/tinymce/tinymce.module
- 6.x modules/tinymce/tinymce.module
- 4.x modules/tinymce/tinymce.module
- 5.x modules/tinymce/tinymce.module
The TinyMCE module will init TinyMCE (the editor) on appropriate pages. This module is primarily for managing what those pages are.
File
modules/tinymce/tinymce.moduleView source
- <?php
- 
- /**
-  * @file
-  * The TinyMCE module will init TinyMCE (the editor) on appropriate pages.  This module
-  * is primarily for managing what those pages are.
-  */
- 
- function tinymce_init() {
-   
-   $bool_activate = FALSE;
-   
-   $include_paths = explode("\n", variable_get("tinymce_include_on_paths", ""));
-   $include_paths = array_map("trim", $include_paths);
-   
-   // Wildcards are allowed at the END of the path.
-   // So, "content/edit*"  would be OK.  We need to go through
-   // our paths and look at this.
-   foreach($include_paths as $ipath) {
-     
-     if ($ipath == "") continue;
-     
-     if ($ipath == @$_REQUEST["q"]) {
-       $bool_activate = TRUE;
-       break;
-     }
-     
-     // Contains a wildcard!  So, is the ipath partially in the request?
-     if (strstr($ipath, "*")) {
-       $ipath = str_replace("*", "", $ipath);
-       if (substr(@$_REQUEST["q"], 0, strlen($ipath)) == $ipath) {
-         $bool_activate = TRUE;
-         break;
-       }
-     }
-     
-   } 
- 
-   
-     
-   if ($bool_activate) {
-     fp_add_js(array("tinymceModulePath" => fp_get_module_path("tinymce")), "setting");  
-     
-     $toolbar = variable_get("tinymce_toolbar", "bold italic underline | cut copy paste | undo redo | alignleft aligncenter | bullist numlist outdent indent | link unlink | removeformat");
-     
-     fp_add_js(array("tinymceToolbar" => $toolbar), "setting");
-     
-     fp_add_js(fp_get_module_path("tinymce") . "/lib/tinymce/js/tinymce/tinymce.min.js");
-         
-     fp_add_js(fp_get_module_path("tinymce") . "/js/tinymce_module.js");
-     
-     // Set to TRUE for pages where tinymce is in use.
-     $GLOBALS["tinymce_active"] = TRUE;
-   }
-    
- }
- 
- 
- /**
-  * Implementation of hook_menu
-  */
- function tinymce_menu() {
-   $items = array();
-   
-   
-   $items["admin/config/tinymce"] = array(
-     "title" => "TinyMCE Settings",
-     "description" => "Administer settings for the TinyMCE WYSIWYG editor",
-     "page_callback" => "fp_render_form",
-     "page_arguments" => array("tinymce_config_form", "system_settings"),
-     "access_arguments" => array("administer_tinymce"),
-     "page_settings" => array(
-       
-       "menu_icon" => fp_get_module_path('tinymce') . "/icons/text_dropcaps.png",            
-       
-       "page_hide_report_error" => TRUE,
-       "menu_links" => array(         
-         0 => array(
-           "text" => "Admin Console",
-           "path" => "admin-tools/admin",
-           "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
-         ),
-       ),
-     ),    
-     "type" => MENU_TYPE_NORMAL_ITEM,
-     "tab_parent" => "admin-tools/admin",    
-   );     
-   
-   
-   return $items;
- }
- 
- 
- function tinymce_config_form() {
-   $form = array();
-   
-   fp_add_css(fp_get_module_path("tinymce") . "/css/tinymce.css");
-   
-   $form["tinymce_include_on_paths"] = array(
-     "label" => t("Include on paths:"),
-     "type" => "textarea",
-     "value" => variable_get("tinymce_include_on_paths", ""),
-     "description" => t("Enter FlightPath paths, one per line, where
-                       the TinyMCE plugin should be included.  This step is required before you
-                       can make use of the textarea_editor element type (see below).
-                       <br>Ex:<br>  comments<br>  content/*
-                       <br>
-                       Wildcards are also allowed at the END of the path only.
-                       Ex: content/* 
-                       <br><br>
-                       Note: For developers, make sure you specify a <b>type=textarea_editor</b> for fields which
-                       should be rendered with TinyMCE.  Use hook_form_alter to change ordinary textareas into textarea_editor."),
-   );
- 
- 
-   $form["tinymce_toolbar"] = array(
-     "label" => t("Toolbar:"),
-     "type" => "textfield",
-     "value" => variable_get("tinymce_toolbar", "bold italic underline | cut copy paste | undo redo | alignleft aligncenter | bullist numlist outdent indent | link unlink | removeformat"),
-     "description" => t("Enter the toolbar components (based on TinyMCE's documentation) that you would like to as part of TinyMCE.
-                         <br>If unsure what to enter, use:
-                         <br>    bold italic underline | cut copy paste | undo redo | alignleft aligncenter | bullist numlist outdent indent | link unlink | removeformat"),
-   );
- 
- 
-   
-   
-   return $form;
- }
- 
- 
- 
- function tinymce_perm() {
-   return array(
-     "administer_tinymce" => array(
-       "title" => t("Administer TinyMCE"),
-       "description" => t("Configure the TinyMCE module."),
-     ),
-   );
- }
- 
- 
- /**
-  * Implementation of hook_form_alter
-  */
- function tinymce_form_alter(&$form, $form_id) {
-   
-   // if tinymce is active, add instrcutions under the textareas.
-   if (@$GLOBALS["tinymce_active"]) {
-     
-     fp_add_css(fp_get_module_path("tinymce") . "/css/tinymce.css");
-     
-     foreach($form as $key=>$val) {
-       if (@$form[$key]["type"] == "textarea_editor") {        
-         @$form[$key]["description"] .= "<div class='tinymce-extra-instructions'>
-                                         " . t("Trouble with Copy/Paste? Try keyboard 
-                                               shortcuts CTRL-C and CTRL-V. To single-space, press SHIFT-ENTER.") . "</div>";
-       }
-     }
-   }
-   
- }
- 
- 
- 
- 
- 
- 
- 
- 
Functions
| Name   | Description | 
|---|---|
| tinymce_config_form | |
| tinymce_form_alter | Implementation of hook_form_alter | 
| tinymce_init | |
| tinymce_menu | Implementation of hook_menu | 
| tinymce_perm | 
