Browse Source

[enh] Add filters, user perm & ckeditor profile to common feature.

opi 8 years ago
parent
commit
94cb23ad50

+ 116 - 0
sites/all/modules/custom/ffdn_common/ffdn_common.features.ckeditor_profile.inc

@@ -0,0 +1,116 @@
+<?php
+/**
+ * @file
+ * ffdn_common.features.ckeditor_profile.inc
+ */
+
+/**
+ * Implements hook_ckeditor_profile_defaults().
+ */
+function ffdn_common_ckeditor_profile_defaults() {
+  $data = array(
+    'CKEditor Global Profile' => array(
+      'name' => 'CKEditor Global Profile',
+      'settings' => array(
+        'skin' => 'moono',
+        'ckeditor_path' => '//cdn.ckeditor.com/4.4.0/full-all',
+        'ckeditor_local_path' => '',
+        'ckeditor_plugins_path' => '%m/plugins',
+        'ckeditor_plugins_local_path' => '',
+        'ckfinder_path' => '%m/ckfinder',
+        'ckfinder_local_path' => '',
+        'ckeditor_aggregate' => 'f',
+        'toolbar_wizard' => 't',
+        'loadPlugins' => array(),
+      ),
+      'input_formats' => array(),
+    ),
+    'Full' => array(
+      'name' => 'Full',
+      'settings' => array(
+        'ss' => 2,
+        'toolbar' => '[
+    [\'Source\'],
+    [\'Cut\',\'Copy\',\'Paste\',\'PasteText\',\'PasteFromWord\',\'-\',\'SpellChecker\', \'Scayt\'],
+    [\'Undo\',\'Redo\',\'Find\',\'Replace\',\'-\',\'SelectAll\'],
+    [\'Image\',\'Media\',\'Flash\',\'Table\',\'HorizontalRule\',\'Smiley\',\'SpecialChar\',\'Iframe\'],
+    \'/\',
+    [\'Bold\',\'Italic\',\'Underline\',\'Strike\',\'-\',\'Subscript\',\'Superscript\',\'-\',\'RemoveFormat\'],
+    [\'NumberedList\',\'BulletedList\',\'-\',\'Outdent\',\'Indent\',\'Blockquote\',\'CreateDiv\'],
+    [\'JustifyLeft\',\'JustifyCenter\',\'JustifyRight\',\'JustifyBlock\',\'-\',\'BidiLtr\',\'BidiRtl\',\'-\',\'Language\'],
+    [\'Link\',\'Unlink\',\'Anchor\',\'Linkit\'],
+    [\'DrupalBreak\'],
+    \'/\',
+    [\'Format\',\'Font\',\'FontSize\'],
+    [\'TextColor\',\'BGColor\'],
+    [\'Maximize\', \'ShowBlocks\']
+]
+    ',
+        'expand' => 't',
+        'default' => 't',
+        'show_toggle' => 't',
+        'uicolor' => 'default',
+        'uicolor_user' => 'default',
+        'width' => '100%',
+        'lang' => 'en',
+        'auto_lang' => 't',
+        'language_direction' => 'default',
+        'allowed_content' => 't',
+        'extraAllowedContent' => '',
+        'enter_mode' => 'p',
+        'shift_enter_mode' => 'br',
+        'font_format' => 'p;div;pre;address;h1;h2;h3;h4;h5;h6',
+        'custom_formatting' => 'f',
+        'formatting' => array(
+          'custom_formatting_options' => array(
+            'indent' => 'indent',
+            'breakBeforeOpen' => 'breakBeforeOpen',
+            'breakAfterOpen' => 'breakAfterOpen',
+            'breakAfterClose' => 'breakAfterClose',
+            'breakBeforeClose' => 0,
+            'pre_indent' => 0,
+          ),
+        ),
+        'css_mode' => 'none',
+        'css_path' => '',
+        'css_style' => 'theme',
+        'styles_path' => '',
+        'filebrowser' => 'none',
+        'filebrowser_image' => '',
+        'filebrowser_flash' => '',
+        'UserFilesPath' => '%b%f/',
+        'UserFilesAbsolutePath' => '%d%b%f/',
+        'forcePasteAsPlainText' => 'f',
+        'html_entities' => 'f',
+        'scayt_autoStartup' => 'f',
+        'theme_config_js' => 'f',
+        'js_conf' => '',
+        'loadPlugins' => array(
+          'drupalbreaks' => array(
+            'name' => 'drupalbreaks',
+            'desc' => 'Plugin for inserting Drupal teaser and page breaks.',
+            'path' => '%plugin_dir%drupalbreaks/',
+            'buttons' => array(
+              'DrupalBreak' => array(
+                'label' => 'DrupalBreak',
+                'icon' => 'images/drupalbreak.png',
+              ),
+            ),
+            'default' => 't',
+          ),
+          'tableresize' => array(
+            'name' => 'tableresize',
+            'desc' => 'Table Resize plugin. See <a href="http://ckeditor.com/addon/tableresize">addon page</a> for more details.',
+            'path' => '//cdn.ckeditor.com/4.4.0/full-all/plugins/tableresize/',
+            'buttons' => FALSE,
+            'default' => 't',
+          ),
+        ),
+      ),
+      'input_formats' => array(
+        'full_html' => 'Full HTML',
+      ),
+    ),
+  );
+  return $data;
+}

+ 146 - 0
sites/all/modules/custom/ffdn_common/ffdn_common.features.filter.inc

@@ -0,0 +1,146 @@
+<?php
+/**
+ * @file
+ * ffdn_common.features.filter.inc
+ */
+
+/**
+ * Implements hook_filter_default_formats().
+ */
+function ffdn_common_filter_default_formats() {
+  $formats = array();
+
+  // Exported format: Filtered HTML.
+  $formats['filtered_html'] = array(
+    'format' => 'filtered_html',
+    'name' => 'Filtered HTML',
+    'cache' => 1,
+    'status' => 1,
+    'weight' => 0,
+    'filters' => array(
+      'filter_footnotes' => array(
+        'weight' => -20,
+        'status' => 1,
+        'settings' => array(
+          'footnotes_collapse' => 0,
+        ),
+      ),
+      'filter_url' => array(
+        'weight' => 0,
+        'status' => 1,
+        'settings' => array(
+          'filter_url_length' => 72,
+        ),
+      ),
+      'filter_html' => array(
+        'weight' => 1,
+        'status' => 1,
+        'settings' => array(
+          'allowed_html' => '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>',
+          'filter_html_help' => 1,
+          'filter_html_nofollow' => 0,
+        ),
+      ),
+      'filter_autop' => array(
+        'weight' => 2,
+        'status' => 1,
+        'settings' => array(),
+      ),
+      'filter_htmlcorrector' => array(
+        'weight' => 10,
+        'status' => 1,
+        'settings' => array(),
+      ),
+    ),
+  );
+
+  // Exported format: Full HTML.
+  $formats['full_html'] = array(
+    'format' => 'full_html',
+    'name' => 'Full HTML',
+    'cache' => 1,
+    'status' => 1,
+    'weight' => 1,
+    'filters' => array(
+      'filter_footnotes' => array(
+        'weight' => -20,
+        'status' => 1,
+        'settings' => array(
+          'footnotes_collapse' => 0,
+        ),
+      ),
+      'filter_url' => array(
+        'weight' => 0,
+        'status' => 1,
+        'settings' => array(
+          'filter_url_length' => 72,
+        ),
+      ),
+      'filter_autop' => array(
+        'weight' => 1,
+        'status' => 1,
+        'settings' => array(),
+      ),
+      'filter_htmlcorrector' => array(
+        'weight' => 10,
+        'status' => 1,
+        'settings' => array(),
+      ),
+    ),
+  );
+
+  // Exported format: Plain text.
+  $formats['plain_text'] = array(
+    'format' => 'plain_text',
+    'name' => 'Plain text',
+    'cache' => 1,
+    'status' => 1,
+    'weight' => 10,
+    'filters' => array(
+      'filter_footnotes' => array(
+        'weight' => -20,
+        'status' => 1,
+        'settings' => array(
+          'footnotes_collapse' => 0,
+        ),
+      ),
+      'filter_html_escape' => array(
+        'weight' => 0,
+        'status' => 1,
+        'settings' => array(),
+      ),
+      'filter_url' => array(
+        'weight' => 1,
+        'status' => 1,
+        'settings' => array(
+          'filter_url_length' => 72,
+        ),
+      ),
+      'filter_autop' => array(
+        'weight' => 2,
+        'status' => 1,
+        'settings' => array(),
+      ),
+    ),
+  );
+
+  // Exported format: Pure HTML.
+  $formats['pure_html'] = array(
+    'format' => 'pure_html',
+    'name' => 'Pure HTML',
+    'cache' => 1,
+    'status' => 1,
+    'weight' => 0,
+    'filters' => array(
+      'filter_footnotes' => array(
+        'weight' => -20,
+        'status' => 1,
+        'settings' => array(
+          'footnotes_collapse' => 0,
+        ),
+      ),
+    ),
+  );
+
+  return $formats;
+}

+ 64 - 0
sites/all/modules/custom/ffdn_common/ffdn_common.features.user_permission.inc

@@ -0,0 +1,64 @@
+<?php
+/**
+ * @file
+ * ffdn_common.features.user_permission.inc
+ */
+
+/**
+ * Implements hook_user_default_permissions().
+ */
+function ffdn_common_user_default_permissions() {
+  $permissions = array();
+
+  // Exported permission: 'create page content'.
+  $permissions['create page content'] = array(
+    'name' => 'create page content',
+    'roles' => array(
+      'administrator' => 'administrator',
+      'authenticated user' => 'authenticated user',
+    ),
+    'module' => 'node',
+  );
+
+  // Exported permission: 'delete any page content'.
+  $permissions['delete any page content'] = array(
+    'name' => 'delete any page content',
+    'roles' => array(
+      'administrator' => 'administrator',
+      'contributeur' => 'contributeur',
+    ),
+    'module' => 'node',
+  );
+
+  // Exported permission: 'delete own page content'.
+  $permissions['delete own page content'] = array(
+    'name' => 'delete own page content',
+    'roles' => array(
+      'administrator' => 'administrator',
+      'authenticated user' => 'authenticated user',
+    ),
+    'module' => 'node',
+  );
+
+  // Exported permission: 'edit any page content'.
+  $permissions['edit any page content'] = array(
+    'name' => 'edit any page content',
+    'roles' => array(
+      'administrator' => 'administrator',
+      'contributeur' => 'contributeur',
+    ),
+    'module' => 'node',
+  );
+
+  // Exported permission: 'edit own page content'.
+  $permissions['edit own page content'] = array(
+    'name' => 'edit own page content',
+    'roles' => array(
+      'administrator' => 'administrator',
+      'authenticated user' => 'authenticated user',
+    ),
+    'module' => 'node',
+  );
+
+  return $permissions;
+}

+ 15 - 0
sites/all/modules/custom/ffdn_common/ffdn_common.info

@@ -2,11 +2,17 @@ name = ffdn_common
 description = Common module for ffdn.org website
 core = 7.x
 package = Custom
+dependencies[] = ckeditor
 dependencies[] = contact
 dependencies[] = features
 dependencies[] = file
+dependencies[] = filter
+dependencies[] = footnotes
+dependencies[] = image
 dependencies[] = node
 dependencies[] = text
+features[ckeditor_profile][] = CKEditor Global Profile
+features[ckeditor_profile][] = Full
 features[contact_categories][] = Contact
 features[features_api][] = api:2
 features[field_base][] = body
@@ -15,4 +21,13 @@ features[field_base][] = field_attachment
 features[field_instance][] = comment-comment_node_page-comment_body
 features[field_instance][] = node-page-body
 features[field_instance][] = node-page-field_attachment
+features[filter][] = filtered_html
+features[filter][] = full_html
+features[filter][] = plain_text
+features[filter][] = pure_html
 features[node][] = page
+features[user_permission][] = create page content
+features[user_permission][] = delete any page content
+features[user_permission][] = delete own page content
+features[user_permission][] = edit any page content
+features[user_permission][] = edit own page content