array( // Name of the plugin used to write it. 'name' => 'accordion', // Description of the plugin - it would be displayed in // the plugins management section of profile settings. 'desc' => t('CKEditor Accordion - A plugin to easily create accordions'), // The full URL to the CKEditor plugins directory, // with the trailing slash. 'path' => ckeditor_base_path('local') . '/' . drupal_get_path('module', 'ckeditor_accordion') . '/plugins/accordion/', 'buttons' => array( 'Accordion' => array( // Path to an icon relative to the plugins folder. 'icon' => 'icons/accordion.png', 'label' => 'Accordion', ), ), ), ); } /** * Implements hook_editor_ckeditor_plugins(). */ function ckeditor_accordion_editor_ckeditor_plugins() { return array( 'accordion' => array( 'path' => drupal_get_path('module', 'ckeditor_accordion') . '/plugins/accordion', 'file' => 'plugin.js', 'css' => array(drupal_get_path('module', 'ckeditor_accordion') . '/plugins/accordion/accordion.css'), 'buttons' => array( 'Accordion' => array( 'label' => t('Accordion'), 'image' => drupal_get_path('module', 'ckeditor_accordion') . '/plugins/accordion/icons/accordion.png', ) ) ) ); } /** * Implements hook_menu(). */ function ckeditor_accordion_menu() { $items = array(); $items['admin/config/content/ckeditor_accordion'] = array( 'title' => 'Administer CKEditor Accordion', 'description' => 'Adminster CKEditor Accordion configuration', 'page callback' => 'drupal_get_form', 'page arguments' => array('ckeditor_accordion_admin'), 'access arguments' => array('administer ckeditor'), 'type' => MENU_NORMAL_ITEM, ); return $items; } /** * Create settings page for the module. */ function ckeditor_accordion_admin() { $form = array(); $form['ckeditor_accordion_collapsed'] = array( '#type' => 'checkbox', '#title' => t('Collapse all tabs by default'), '#default_value' => variable_get('ckeditor_accordion_collapsed', 0), '#description' => t("The maximum number of links to display in the block."), ); return system_settings_form($form); } /** * Implements hook_page_build(). */ function ckeditor_accordion_page_build(&$page) { $config = variable_get('ckeditor_accordion_collapsed', 0); if ($config) { drupal_add_js(array('ckeditor_accordion' => array('collapseAll' => 1)), array('type' => 'setting')); } }