You are here

function commons_media_ckeditor_profile_defaults_alter in Drupal Commons 7.3

Implements hook_ckeditor_profile_defaults().

File

modules/commons/commons_media/commons_media.module, line 220

Code

function commons_media_ckeditor_profile_defaults_alter(&$profiles) {
  if (module_exists('entity_embed') && !empty($profiles['Advanced'])) {

    // Disable the advanced content filter.
    $profiles['Advanced']['settings']['allowed_content'] = 'f';

    // Add the media button.
    $profiles['Advanced']['settings']['toolbar'] = '[
    [\'Format\'],
    [\'Bold\',\'Italic\',\'Strike\'],
    [\'NumberedList\',\'BulletedList\',\'Indent\',\'Outdent\',\'Blockquote\'],
    [\'Link\',\'Unlink\',\'file\']
    ]';

    // Load the Entity Embed plugin.
    $profiles['Advanced']['settings']['loadPlugins'] += array(
      'drupalentity' => array(
        'name' => 'drupalentity',
        'desc' => 'Plugin for embedding entities',
        'path' => '/profiles/commons/modules/contrib/entity_embed/js/plugins/drupalentity/',
        'default' => 'f',
        'buttons' => array(
          'file' => array(
            'label' => 'File',
            'icon' => 'entity.png',
          ),
          'node' => array(
            'label' => 'Content',
            'icon' => 'entity.png',
          ),
        ),
      ),
    );
  }
}