Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/etowah_content_stream.module b/etowah_content_stream.module
index 0608746..5775e0d 100644
--- a/etowah_content_stream.module
+++ b/etowah_content_stream.module
@@ -182,7 +182,7 @@ function etowah_content_stream_ctools_plugin_api($module, $api) {
function etowah_content_stream_theme($existing, $type, $theme, $path) {
return array(
'content_stream' => array(
- 'variables' => array('nodes' => NULL, 'presented_by' => NULL, 'social' => NULL),
+ 'variables' => array('overrides' => NULL, 'nodes' => NULL, 'presented_by' => NULL, 'social' => NULL),
),
'content_stream_item' => array(
'variables' => array('node' => NULL),
@@ -196,6 +196,7 @@ function etowah_content_stream_theme($existing, $type, $theme, $path) {
}
function theme_content_stream($variables) {
+ $overrides = $variables['overrides'];
drupal_add_css(drupal_get_path('module', 'etowah_content_stream') .'/styles/content_stream.css', 'file');
drupal_add_js(drupal_get_path('module', 'etowah_content_stream') .'/js/content_stream.js', 'file');
@@ -252,7 +253,7 @@ function theme_content_stream($variables) {
<div id="div-gpt-ad-stream-'. mt_rand(100000, 999999) .'" class="gpt_container" data-size-mobile_320px="300x250" data-size-tablet_640px="300x250" data-size-tablet_768px="300x250" data-size-desktop_1024px="300x250" data-pos-two="" data-pos-one="content_stream" data-section="homepage"></div>
</div>';
}
- $output.= theme('content_stream_item', array('node' => $node));
+ $output.= theme('content_stream_item', array('overrides' => $overrides, 'node' => $node));
$count++;
}
diff --git a/plugins/content_types/content_stream.inc b/plugins/content_types/content_stream.inc
index 1c8d7a6..a0d9a21 100644
--- a/plugins/content_types/content_stream.inc
+++ b/plugins/content_types/content_stream.inc
@@ -26,6 +26,22 @@ function content_stream_edit_form($form, &$form_state) {
'#suffix' => '</div>',
);
+ $form['overrides'] = array(
+ '#type' => 'fieldset',
+ );
+ $form['overrides']['overrides_image'] = array(
+ '#default_value' => !empty($conf['overrides_image']) ? $conf['overrides_image'] : '',
+ );
+ $form['overrides']['overrides_image'] = array(
+ '#default_value' => !empty($conf['filters']['1']) ? $conf['filters']['1'] : '',
+ );
+ $form['overrides']['overrides_image'] = array(
+ '#default_value' => !empty($conf['filters']['1']) ? $conf['filters']['1'] : '',
+ );
+ $form['overrides']['overrides_image'] = array(
+ '#default_value' => !empty($conf['filters']['1']) ? $conf['filters']['1'] : '',
+ );
+
$form['taxonomy_filters'] = array(
'#type' => 'fieldset',
'#title' => t('Taxonomy filters'),
@@ -153,6 +169,18 @@ function content_stream_edit_form_submit($form, &$form_state) {
if(isset($form_state['storage']['presented_image_file'])) {
$form_state['conf']['presented_image'] = $form_state['storage']['presented_image_file']->fid;
}
+ if(isset($form_state['values']['overrides_image'])) {
+ $form_state['conf']['overrides_image'] = $form_state['values']['overrides_image'];
+ }
+ if(isset($form_state['values']['overrides_image'])) {
+ $form_state['conf']['overrides_image'] = $form_state['values']['overrides_image'];
+ }
+ if(isset($form_state['values']['overrides_image'])) {
+ $form_state['conf']['overrides_image'] = $form_state['values']['overrides_image'];
+ }
+ if(isset($form_state['values']['overrides_image'])) {
+ $form_state['conf']['overrides_image'] = $form_state['values']['overrides_image'];
+ }
if($form_state['values']['remove_logo'] == 1){
$form_state['conf']['presented_image'] = null;
@@ -246,8 +274,15 @@ function content_stream_render($subtype, $conf, $args) {
), 'setting');
}
+ $overrides = array(
+ 'image' => $conf['image'],
+ 'title' => $conf['title'],
+ // other two
+ );
+
+
//$block->title = "Content Stream";
$social = array();
- $block->content = theme('content_stream', array('nodes' => $nodes, 'presented_by' => $presented_by, 'social' => $social));
+ $block->content = theme('content_stream', array('overrides' => $overrides, 'nodes' => $nodes, 'presented_by' => $presented_by, 'social' => $social));
return $block;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment