Skip to content

Instantly share code, notes, and snippets.

@Renrhaf
Created March 22, 2016 15:28
Show Gist options
  • Save Renrhaf/e9b52494b41b76f71cba to your computer and use it in GitHub Desktop.
Save Renrhaf/e9b52494b41b76f71cba to your computer and use it in GitHub Desktop.
AFOUND-501
diff --git a/foundation.make b/foundation.make
index 071878f..f06dab9 100755
--- a/foundation.make
+++ b/foundation.make
@@ -197,6 +197,9 @@ projects[scald][version] = 1.6
projects[scald][subdir] = "contrib"
; See http://gist.github.com/pvhee/7326203. Can be removed once the APIOS mapping is fully defined and organized within the $data variable
projects[scald][patch][] = "http://gist.github.com/pvhee/7326203/raw/1df3dbe78e25b998d5663fcd20db6f7355c6d8f4/output_data_variables_with_vardump.patch"
+; See http://jira.newtech.arte.tv/browse/AFOUND-501 ; will be in 1.7
+projects[scald][patch][] = "https://www.drupal.org/files/issues/2684143-2-pluggable-default-data.patch"
+
projects[scald_youtube][version] = 1.5
projects[scald_youtube][subdir] = "contrib"
diff --git a/modules/custom/arte_apios_player/arte_apios_player.module b/modules/custom/arte_apios_player/arte_apios_player.module
index e8b322d..04a8064 100755
--- a/modules/custom/arte_apios_player/arte_apios_player.module
+++ b/modules/custom/arte_apios_player/arte_apios_player.module
@@ -650,14 +650,14 @@ function arte_apios_player_google_rich_snippet_markup($atom) {
// won't cause fatal errors.
try {
$html = array();
- $html[] = '<div itemscope itemtype="http://schema.org/VideoObject" style="display:none;">';
+ $html[] = '<div itemscope itemtype="http://schema.org/VideoObject" style="display: none;">';
$html[] = ' <span itemprop="name">' . $title . '</span>';
$html[] = ' <span itemprop="description">' . $desc . '</span>';
$html[] = ' <img itemprop="thumbnailUrl" src="' . $thumbnail_url . '" alt="' . $title . '"/>';
- $html[] = ' <meta itemprop="uploadDate" content="' . $atom_wrapper->videoRightsBegin->value() . '"/>';
- $html[] = ' <meta itemprop="expires" content="' . $atom_wrapper->videoRightsEnd->value() . '"/>';
- $html[] = ' <meta itemprop="duration" content="' . $atom_wrapper->durationSeconds->value() . '" />';
- $html[] = ' <link itemprop="embedUrl" href="' . $player_url . '" />';
+ $html[] = ' <span itemprop="uploadDate" content="' . $atom_wrapper->videoRightsBegin->value() . '"></span>';
+ $html[] = ' <span itemprop="expires" content="' . $atom_wrapper->videoRightsEnd->value() . '"/></span>';
+ $html[] = ' <span itemprop="duration" content="' . $atom_wrapper->durationSeconds->value() . '" /></span>';
+ $html[] = ' <span itemprop="embedUrl" href="' . $player_url . '"></span>';
$html[] = '</div>';
return implode("\n", $html) . "\n";
} catch (Exception $e) {
diff --git a/modules/custom/scald_contexts/scald_contexts.library.js b/modules/custom/scald_contexts/scald_contexts.library.js
new file mode 100644
index 0000000..76d302c
--- /dev/null
+++ b/modules/custom/scald_contexts/scald_contexts.library.js
@@ -0,0 +1,13 @@
+(function($) {
+Drupal.behaviors.ScaldContextLibrary = {
+ attach: function(context, settings) {
+ CKEDITOR.once('instanceReady', function(e) {
+ Drupal.dndck4.registerCallback('GetDefaultInsertData', function(data) {
+ if (Drupal.settings.scald_contexts[data.type]) {
+ data.context = Drupal.settings.scald_contexts[data.type];
+ }
+ });
+ });
+ }
+}
+})(jQuery);
diff --git a/modules/custom/scald_contexts/scald_contexts.module b/modules/custom/scald_contexts/scald_contexts.module
index 114f3cf..4e1ca3d 100755
--- a/modules/custom/scald_contexts/scald_contexts.module
+++ b/modules/custom/scald_contexts/scald_contexts.module
@@ -173,6 +173,30 @@ function scald_contexts_init() {
}
/**
+ * Implements hook_library_alter().
+ */
+function scald_contexts_library_alter(&$libraries, $module) {
+ if ($module == 'dnd' && isset($libraries['library']) && variable_get('mee_store_format') === 'embed_div') {
+ $type_contexts = array();
+ foreach (scald_types() as $type => $data) {
+ $type_context = variable_get('scald_default_context_' . $type, NULL);
+ if ($type_context) {
+ $type_contexts[$type] = $type_context;
+ }
+ }
+
+ if ($type_contexts) {
+ $path = drupal_get_path('module', 'scald_contexts');
+ $libraries['library']['js'][$path . '/scald_contexts.library.js'] = array();
+ $libraries['library']['js'][] = array(
+ 'type' => 'setting',
+ 'data' => array('scald_contexts' => $type_contexts),
+ );
+ }
+ }
+}
+
+/**
* Defines ARTE specific display contexts.
*
* Implements hook_scald_contexts().
diff --git a/modules/features/foundation_ckeditor/foundation_ckeditor.features.ckeditor_profile.inc b/modules/features/foundation_ckeditor/foundation_ckeditor.features.ckeditor_profile.inc
index d22a317..a526422 100644
--- a/modules/features/foundation_ckeditor/foundation_ckeditor.features.ckeditor_profile.inc
+++ b/modules/features/foundation_ckeditor/foundation_ckeditor.features.ckeditor_profile.inc
@@ -69,10 +69,10 @@ function foundation_ckeditor_ckeditor_profile_defaults() {
config.format_tags = \'p;h2;h3;h4;div\';
',
'loadPlugins' => array(
- 'dnd' => array(
- 'name' => 'dnd',
- 'desc' => 'Scald Drag and Drop integration',
- 'path' => '%base_path%profiles/foundation/modules/contrib/scald/modules/fields/mee/plugins/ckeditor/',
+ 'dndck4' => array(
+ 'name' => 'dndck4',
+ 'desc' => 'Scald Drag and Drop integration - CKEditor 4 widgets',
+ 'path' => '%base_path%profiles/foundation/modules/contrib/scald/modules/fields/mee/plugins/dndck4/',
'buttons' => array(
'ScaldAtom' => array(
'label' => 'ScaldAtom',
diff --git a/modules/features/foundation_ckeditor/foundation_ckeditor.features.filter.inc b/modules/features/foundation_ckeditor/foundation_ckeditor.features.filter.inc
index 7176ea2..dd24b8c 100644
--- a/modules/features/foundation_ckeditor/foundation_ckeditor.features.filter.inc
+++ b/modules/features/foundation_ckeditor/foundation_ckeditor.features.filter.inc
@@ -48,6 +48,11 @@ function foundation_ckeditor_filter_default_formats() {
'status' => 1,
'settings' => array(),
),
+ 'mee_scald_widgets' => array(
+ 'weight' => 1,
+ 'status' => 1,
+ 'settings' => array(),
+ ),
),
);
diff --git a/modules/features/foundation_ckeditor/foundation_ckeditor.features.inc b/modules/features/foundation_ckeditor/foundation_ckeditor.features.inc
new file mode 100644
index 0000000..fb00fed
--- /dev/null
+++ b/modules/features/foundation_ckeditor/foundation_ckeditor.features.inc
@@ -0,0 +1,14 @@
+<?php
+/**
+ * @file
+ * foundation_ckeditor.features.inc
+ */
+
+/**
+ * Implements hook_ctools_plugin_api().
+ */
+function foundation_ckeditor_ctools_plugin_api($module = NULL, $api = NULL) {
+ if ($module == "strongarm" && $api == "strongarm") {
+ return array("version" => "1");
+ }
+}
diff --git a/modules/features/foundation_ckeditor/foundation_ckeditor.info b/modules/features/foundation_ckeditor/foundation_ckeditor.info
index 0e84246..9dd6940 100644
--- a/modules/features/foundation_ckeditor/foundation_ckeditor.info
+++ b/modules/features/foundation_ckeditor/foundation_ckeditor.info
@@ -9,9 +9,13 @@ dependencies[] = features
dependencies[] = filter
dependencies[] = foundation_ckeplugins
dependencies[] = libraries
+dependencies[] = mee
+dependencies[] = strongarm
features[ckeditor_profile][] = Advanced
features[ckeditor_profile][] = CKEditor Global Profile
features[ckeditor_profile][] = Limited
+features[ctools][] = strongarm:strongarm:1
features[features_api][] = api:2
features[filter][] = limited_html
features[filter][] = wysiwyg
+features[variable][] = mee_store_format
diff --git a/modules/features/foundation_ckeditor/foundation_ckeditor.module b/modules/features/foundation_ckeditor/foundation_ckeditor.module
index 44788b0..f9f9e39 100644
--- a/modules/features/foundation_ckeditor/foundation_ckeditor.module
+++ b/modules/features/foundation_ckeditor/foundation_ckeditor.module
@@ -1,5 +1,7 @@
<?php
/**
* @file
- * Drupal needs this blank file.
+ * Code for the ARTE Foundation CKEditor feature.
*/
+
+include_once 'foundation_ckeditor.features.inc';
diff --git a/modules/features/foundation_ckeditor/foundation_ckeditor.strongarm.inc b/modules/features/foundation_ckeditor/foundation_ckeditor.strongarm.inc
new file mode 100644
index 0000000..2255035
--- /dev/null
+++ b/modules/features/foundation_ckeditor/foundation_ckeditor.strongarm.inc
@@ -0,0 +1,21 @@
+<?php
+/**
+ * @file
+ * foundation_ckeditor.strongarm.inc
+ */
+
+/**
+ * Implements hook_strongarm().
+ */
+function foundation_ckeditor_strongarm() {
+ $export = array();
+
+ $strongarm = new stdClass();
+ $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
+ $strongarm->api_version = 1;
+ $strongarm->name = 'mee_store_format';
+ $strongarm->value = 'embed_div';
+ $export['mee_store_format'] = $strongarm;
+
+ return $export;
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment