From 7744d5cdb98a91fdb7e1ead3e0192095bc62f0be Mon Sep 17 00:00:00 2001 From: Tim Steiner <tsteiner2@unl.edu> Date: Tue, 10 Aug 2010 22:27:09 +0000 Subject: [PATCH] Remove the non-menu options for UNL TinyMCE buttons. git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@147 20a16fea-79d4-4915-8869-1ea9d5ebf173 --- sites/all/modules/unl/unl.module | 158 ++++++++++++++----------------- 1 file changed, 69 insertions(+), 89 deletions(-) diff --git a/sites/all/modules/unl/unl.module b/sites/all/modules/unl/unl.module index fadcb77b..7b960615 100644 --- a/sites/all/modules/unl/unl.module +++ b/sites/all/modules/unl/unl.module @@ -10,87 +10,67 @@ function unl_node_prepare($node) */ function unl_wysiwyg_plugin($editor) { - switch ($editor) { - case 'tinymce': - return array( - 'unl' => array( - // A URL to the plugin's homepage. - 'url' => 'http://gforge.unl.edu/gf/project/wdn_tinymce/', - // The full path to the native editor plugin. - 'path' => $editor['library path'] . '/plugins/unl', - // A list of editor extensions provided by this native plugin. - // Extensions are not displayed as buttons and touch the editor's - // internals, so you should know what you are doing. - 'extensions' => array('unl' => 'UNL Extension'), - // Boolean whether this plugin is a native plugin, i.e. shipped with - // the editor. Definition must be ommitted for plugins provided by - // other modules. - 'internal' => TRUE, - // Boolean whether the editor needs to load this plugin. When TRUE, - // the editor will automatically load the plugin based on the 'path' - // variable provided. If FALSE, the plugin either does not need to - // be loaded or is already loaded by something else on the page. - // Most plugins should define TRUE here. - 'load' => TRUE, - // A list of buttons provided by this native plugin. The key has to - // match the corresponding JavaScript implementation. The value is - // is displayed on the editor configuration form only. - 'buttons' => array('unl' => 'UNL Test', - 'unlZenBoxBright' => 'UNL Zen Box Bright', - 'unlZenBoxCool' => 'UNL Zen Box Cool', - 'unlZenBoxEnergetic' => 'UNL Zen Box Energetic', - 'unlZenBoxSoothing' => 'UNL Zen Box Soothing', - 'unlZenBoxPrimary' => 'UNL Zen Box Primary', - 'unlZenBoxNeutral' => 'UNL Zen Box Neutral', - 'unlZenBox' => 'UNL Zen Box (Menu)', - 'unlZenTableBright' => 'UNL Zen Table Bright', - 'unlZenTableCool' => 'UNL Zen Table Cool', - 'unlZenTableEnergetic' => 'UNL Zen Table Energetic', - 'unlZenTableSoothing' => 'UNL Zen Table Soothing', - 'unlZenTablePrimary' => 'UNL Zen Table Primary', - 'unlZenTableNeutral' => 'UNL Zen Table Neutral', - 'unlZenTableNeutral' => 'UNL Zen Table Neutral', - 'unlZenTable' => 'UNL Zen Table (Menu)', - 'unlCol13' => 'UNL Layout 1/3', - 'unlCol22' => 'UNL Layout 2/2', - 'unlCol31' => 'UNL Layout 3/1', - 'unlCol112' => 'UNL Layout 1/1/2', - 'unlCol121' => 'UNL Layout 1/2/1', - 'unlCol211' => 'UNL Layout 2/1/1', - 'unlCol1111' => 'UNL Layout 1/1/1/1', - 'unlLayout' => 'UNL Layout (Menu)', - ), - // A list of global, native editor configuration settings to - // override. To be used rarely and only when required. - 'options' => array( - 'skin' => 'unl', - 'doctype' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' - ), - // Wysiwyg wrapper plugin AJAX callback. - // 'callback' => url('myplugin/browse'), - // 'icon' => drupal_get_path('module', 'mymodule') . '/myplugin/myplugin.png', - // Might need to be set later on; after retrieving customized editor - // layout. - //'theme_advanced_buttons1' => array(t('Button title (optional)') => 'myplugin'), - ) - ); - } + switch ($editor) { + case 'tinymce': + return array( + 'unl' => array( + // A URL to the plugin's homepage. + 'url' => 'http://gforge.unl.edu/gf/project/wdn_tinymce/', + // The full path to the native editor plugin. + 'path' => $editor['library path'] . '/plugins/unl', + // A list of editor extensions provided by this native plugin. + // Extensions are not displayed as buttons and touch the editor's + // internals, so you should know what you are doing. + 'extensions' => array('unl' => 'UNL Extension'), + // Boolean whether this plugin is a native plugin, i.e. shipped with + // the editor. Definition must be ommitted for plugins provided by + // other modules. + 'internal' => TRUE, + // Boolean whether the editor needs to load this plugin. When TRUE, + // the editor will automatically load the plugin based on the 'path' + // variable provided. If FALSE, the plugin either does not need to + // be loaded or is already loaded by something else on the page. + // Most plugins should define TRUE here. + 'load' => TRUE, + // A list of buttons provided by this native plugin. The key has to + // match the corresponding JavaScript implementation. The value is + // is displayed on the editor configuration form only. + 'buttons' => array( + 'unlZenBox' => 'UNL Zen Box', + 'unlZenTable' => 'UNL Zen Table', + 'unlLayout' => 'UNL Layout' + ), + // A list of global, native editor configuration settings to + // override. To be used rarely and only when required. + 'options' => array( + 'skin' => 'unl', + 'doctype' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' + ), + // Wysiwyg wrapper plugin AJAX callback. + // 'callback' => url('myplugin/browse'), + // 'icon' => drupal_get_path('module', 'mymodule') . '/myplugin/myplugin.png', + // Might need to be set later on; after retrieving customized editor + // layout. + //'theme_advanced_buttons1' => array(t('Button title (optional)') => 'myplugin'), + ) + ); + } } function unl_permission() { - return array( + return array( 'unl migration' => array( 'title' => t('Migration'), 'description' => t('Migrate UNL Template based sites to drupal') - ), - - 'unl site creation' => array( + ), + + 'unl site creation' => array( 'title' => t('Site Creation'), 'description' => t('Create new drupal sites using the UNL profile') - ) - ); + ) + ); } /** @@ -98,26 +78,26 @@ function unl_permission() */ function unl_menu() { - $access = array(); - $items['admin/content/unl/migration'] = array( - 'title' => 'UNL Migration Tool', - 'description' => 'Migrate a static UNL template page into drupal', - 'access arguments' => array('unl migration'), - 'page callback' => 'unl_migration_page', - 'type' => MENU_LOCAL_TASK, - 'file' => 'unl_migration.php' - ); + $access = array(); + $items['admin/content/unl/migration'] = array( + 'title' => 'UNL Migration Tool', + 'description' => 'Migrate a static UNL template page into drupal', + 'access arguments' => array('unl migration'), + 'page callback' => 'unl_migration_page', + 'type' => MENU_LOCAL_TASK, + 'file' => 'unl_migration.php' + ); - $items['admin/sites/unl/add'] = array( - 'title' => 'UNL Site Creation Tool', - 'description' => 'Create a new UNL Drupal site', - 'access arguments' => array('unl site creation'), - 'page callback' => 'unl_site_creation_page', - 'type' => MENU_LOCAL_TASK, - 'file' => 'unl_site_creation.php' - ); + $items['admin/sites/unl/add'] = array( + 'title' => 'UNL Site Creation Tool', + 'description' => 'Create a new UNL Drupal site', + 'access arguments' => array('unl site creation'), + 'page callback' => 'unl_site_creation_page', + 'type' => MENU_LOCAL_TASK, + 'file' => 'unl_site_creation.php' + ); - return $items; + return $items; } function unl_form_alter(&$form, $form_state, $form_id) -- GitLab