diff --git a/sites/all/modules/unl/unl.module b/sites/all/modules/unl/unl.module index 7ad316d94ce36ea75535e380ed136d18d6d772f6..ea9f95736119f8136a641eeae94de84a8cd0c496 100644 --- a/sites/all/modules/unl/unl.module +++ b/sites/all/modules/unl/unl.module @@ -2,70 +2,96 @@ function unl_node_prepare($node) { - $node->menu['expanded'] = 1; + $node->menu['expanded'] = 1; } +/** + * Implementation of hook_wywiwyg_plugin() found in wysiwyg.api.php + */ function unl_wysiwyg_plugin($editor) { - switch ($editor) { - case 'tinymce': - return array( - 'unl' => array( - 'path' => drupal_get_path('module', 'unl') . '/tinymce/editor_plugin.js', - 'extensions' => array('unl' => 'UNL Extension'), - 'internal' => FALSE, - 'load' => TRUE, - // 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'), - '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)' - ), - '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">' - ) - ) - ); - } + 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' => drupal_get_path('module', 'unl') . '/tinymce/editor_plugin.js', + // 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' => FALSE, + // 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'), + ) + ); + } } + +/** + * Adds UNL Migration Tool to the Content menu for admin + */ 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('administer comments'), - 'page callback' => 'unl_migration_page', - 'type' => MENU_LOCAL_TASK, - 'file' => 'unl_migration.php' - ); - - return $items; + $access = array(); + $items['admin/content/unl/migration'] = array( + 'title' => 'UNL Migration Tool', + 'description' => 'Migrate a static UNL template page into drupal', + 'access arguments' => array('administer comments'), + 'page callback' => 'unl_migration_page', + 'type' => MENU_LOCAL_TASK, + 'file' => 'unl_migration.php' + ); + + return $items; } diff --git a/sites/all/themes/unl_wdn/html.tpl.php b/sites/all/themes/unl_wdn/html.tpl.php index 1a28e222d38a07a2b50c75d095cd76edda33c3fd..caccfa53dddefd6139a2e002dae2b2bc9edee38a 100644 --- a/sites/all/themes/unl_wdn/html.tpl.php +++ b/sites/all/themes/unl_wdn/html.tpl.php @@ -40,6 +40,7 @@ $t->head .= PHP_EOL . $scripts . PHP_EOL . '<link href="' . url('<front>', array('absolute' => TRUE)) . '" rel="home" />' . PHP_EOL . '<link rel="logout" href="user/logout" title="Log out of myapp" />' . PHP_EOL + . theme_get_setting('head_html') . PHP_EOL ; if (theme_get_setting('use_base')) { diff --git a/sites/all/themes/unl_wdn/theme-settings.php b/sites/all/themes/unl_wdn/theme-settings.php index fd65149caf890b9c9d58504fa351a0fa01a07d9c..cd13d6b380e5802c8e6032ddadf4a188d9a8aa9e 100644 --- a/sites/all/themes/unl_wdn/theme-settings.php +++ b/sites/all/themes/unl_wdn/theme-settings.php @@ -7,9 +7,9 @@ function unl_wdn_form_system_theme_settings_alter(&$form, &$form_state) '#title' => t('Site Name Abbreviation'), 'site_name_abbreviation' => array( - '#type' => 'textfield', - '#default_value' => theme_get_setting('site_name_abbreviation'), - '#description' => t('An abbreviated version of your site\'s name to use in breadcrumbs.') + '#type' => 'textfield', + '#default_value' => theme_get_setting('site_name_abbreviation'), + '#description' => t('An abbreviated version of your site\'s name to use in breadcrumbs.') ) ); @@ -17,7 +17,7 @@ function unl_wdn_form_system_theme_settings_alter(&$form, &$form_state) '#type' => 'fieldset', '#title' => t('Intermediate Breadcrumb'), '#description' => t('A breadcrumb that is displayed between the UNL breadcrumb and this site\'s breadcrumb'), - + 'intermediate_breadcrumb_text' => array( '#type' => 'textfield', '#title' => t('Text'), @@ -33,22 +33,33 @@ function unl_wdn_form_system_theme_settings_alter(&$form, &$form_state) ) ); + $form[] = array( + '#type' => 'fieldset', + '#title' => t('Head HTML'), + '#description' => t('Additional HTML (your own css, js) to be added inside the <head></head> tags.'), + + 'head_html' => array( + '#type' => 'textarea', + '#default_value' => theme_get_setting('head_html') + ) + ); + $form['advanced_settings'] = array( '#type' => 'fieldset', '#title' => t('Advanced Settings'), - + 'zen_forms' => array( - '#type' => 'checkbox', - '#title' => t('Use Zen Forms'), - '#default_value' => theme_get_setting('zen_forms'), - '#description' => t('Transforms all forms into the list-based zen forms.') + '#type' => 'checkbox', + '#title' => t('Use Zen Forms'), + '#default_value' => theme_get_setting('zen_forms'), + '#description' => t('Transforms all forms into the list-based zen forms.') ), - + 'use_base' => array( - '#type' => 'checkbox', - '#title' => t('Use HTML Base Tag in Head'), - '#default_value' => theme_get_setting('use_base'), - '#description' => t('Adds an HTML Base tag to the <head> section with href="' . url('<front>', array('absolute' => TRUE)) . '"') + '#type' => 'checkbox', + '#title' => t('Use HTML Base Tag in Head'), + '#default_value' => theme_get_setting('use_base'), + '#description' => t('Adds an HTML Base tag to the <head> section with href="' . url('<front>', array('absolute' => TRUE)) . '"') ) ); }