Last active
February 8, 2018 14:41
-
-
Save ndeet/8998990 to your computer and use it in GitHub Desktop.
Revisions
-
ndeet revised this gist
Feb 18, 2014 . 2 changed files with 9 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,15 +9,15 @@ $plugin = array( 'title' => t('Color preset'), 'description' => t('Set a color preset.'), // Achtung: render pane wird im Methodenaufruf mit "theme_" prefixed! 'render pane' => 'MYTHEME_color_preset_style_render_pane', 'pane settings form' => 'MYTHEME_color_preset_settings_form', 'category' => t('MYTHEME'), ); /** * Renders the pane content. */ function theme_MYTHEME_color_preset_style_render_pane($content) { if (!empty($content)) { return theme('panels_pane', $content); } @@ -26,13 +26,13 @@ function theme_ohm_color_preset_style_render_pane($content) { /** * Color preset settings form. */ function MYTHEME_color_preset_settings_form($style_settings) { $form = array(); $form['preset_color'] = array( '#type' => 'select', '#title' => t('Choose color preset'), '#default_value' => (isset($style_settings['preset_color'])) ? $style_settings['preset_color'] : FALSE, '#options' => theme_MYTHEME_color_preset_colors(), ); return $form; @@ -42,7 +42,7 @@ function ohm_color_preset_settings_form($style_settings) { * Available color presets. * @return array */ function theme_MYTHEME_color_preset_colors() { return array( 'grey' => t('Grey'), 'yellow' => t('Yellow'), This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,12 +7,12 @@ /** * Implements hook_preprocess_panels_pane(). */ function MYTHEME_preprocess_panels_pane(&$variables) { // Prüfen ob unser Style Plugin aktiv ist. if(isset($variables['pane']->style['style'])) { if($variables['pane']->style['style'] === 'color_presets') { // Setzt die in o.g. theme_MYTHEME_preset_colors definierte Farbe als CSS-Klasse $variables['attributes_array']['class'][] = $variables['pane']->style['settings']['preset_color']; } } -
ndeet revised this gist
Feb 14, 2014 . 2 changed files with 2 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -49,6 +49,4 @@ function theme_ohm_color_preset_colors() { 'pink' => t('Pink') // etc. ); } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,6 +18,4 @@ function ohm_preprocess_panels_pane(&$variables) { } return $variables; } -
ndeet revised this gist
Feb 14, 2014 . 2 changed files with 7 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ <?php /** * @file * Custom panels color presets. @@ -49,4 +49,6 @@ function theme_ohm_color_preset_colors() { 'pink' => t('Pink') // etc. ); } ?> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,4 +18,6 @@ function ohm_preprocess_panels_pane(&$variables) { } return $variables; } ?> -
ndeet revised this gist
Feb 14, 2014 . No changes.There are no files selected for viewing
-
ndeet created this gist
Feb 14, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ ; Register Style Plugin directory plugins[panels][styles] = panels/styles This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ .grey { background-color: #CCC; color: black; } .yellow { background-color: yellow; border: 1px solid red; } .pink { background-color: deeppink; color: white; font-size: 120%; h2 { text-transform: uppercase; } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ <?php /** * @file * Custom panels color presets. */ // Plugin registrieren $plugin = array( 'title' => t('Color preset'), 'description' => t('Set a color preset.'), // Achtung: render pane wird im Methodenaufruf mit "theme_" prefixed! 'render pane' => 'ohm_color_preset_style_render_pane', 'pane settings form' => 'ohm_color_preset_settings_form', 'category' => t('Ohm'), ); /** * Renders the pane content. */ function theme_ohm_color_preset_style_render_pane($content) { if (!empty($content)) { return theme('panels_pane', $content); } } /** * Color preset settings form. */ function ohm_color_preset_settings_form($style_settings) { $form = array(); $form['preset_color'] = array( '#type' => 'select', '#title' => t('Choose color preset'), '#default_value' => (isset($style_settings['preset_color'])) ? $style_settings['preset_color'] : FALSE, '#options' => theme_ohm_color_preset_colors(), ); return $form; } /** * Available color presets. * @return array */ function theme_ohm_color_preset_colors() { return array( 'grey' => t('Grey'), 'yellow' => t('Yellow'), 'pink' => t('Pink') // etc. ); } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ <?php /** * @file * Preprocess panels color presets. */ /** * Implements hook_preprocess_panels_pane(). */ function ohm_preprocess_panels_pane(&$variables) { // Prüfen ob unser Style Plugin aktiv ist. if(isset($variables['pane']->style['style'])) { if($variables['pane']->style['style'] === 'color_presets') { // Setzt die in o.g. theme_ohm_preset_colors definierte Farbe als CSS-Klasse $variables['attributes_array']['class'][] = $variables['pane']->style['settings']['preset_color']; } } return $variables; }