You are here

ckeditor_tabber.module in CKEditor Tabber 7

Same filename and directory in other branches
  1. 8 ckeditor_tabber.module

File

ckeditor_tabber.module
View source
<?php

/**
 * Implements hook_page_alter().
 */
function ckeditor_tabber_page_alter() {

  // Add settings for the semantic tabs plugin
  drupal_add_js(array(
    'ckeditor_tabber' => array(
      'elements' => variable_get('ckeditor_tabber_semantic_tabs_elements', 'dl.ckeditor-tabber'),
    ),
  ), 'setting');
}

/**
 * Implements hook_menu().
 */
function ckeditor_tabber_menu() {
  $items['admin/config/content/ckeditor_tabber'] = array(
    'title' => 'Configure CKEditor Tabber',
    'description' => 'Choose which elements to display as tabs.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ckeditor_tabber_admin_form',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'ckeditor_tabber.admin.inc',
    'type' => MENU_NORMAL_ITEM,
  );
  return $items;
}

/**
 * Hook to register the CKEditor plugin.
 */
function ckeditor_tabber_ckeditor_plugin() {
  return array(
    'tabber' => array(
      'name' => 'tabber',
      'desc' => t('Create tabs with CKeditor'),
      'path' => drupal_get_path('module', 'ckeditor_tabber') . '/tabber/',
      'buttons' => array(
        'addTab' => array(
          'icon' => 'icons/tabber.png',
          'label' => t('Add tab'),
        ),
      ),
    ),
  );
}

/**
 * Implements hook_wysiwyg_plugin().
 */
function ckeditor_tabber_wysiwyg_plugin($editor) {
  if ($editor == 'ckeditor') {
    $path = drupal_get_path('module', 'ckeditor_tabber') . '/tabber';
    return array(
      'tabber' => array(
        'path' => $path,
        'buttons' => array(
          'addTab' => t('CKEditor Tabber'),
        ),
        'load' => TRUE,
      ),
    );
  }
}

Functions