-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Development
- Loading branch information
Showing
4 changed files
with
224 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
<div class="media media_card" <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>> | ||
<<?php print $layout_wrapper; print $layout_attributes; ?> class="media media_card <?php print $classes;?>"> | ||
|
||
<?php if (isset($title_suffix['contextual_links'])): ?> | ||
<?php print render($title_suffix['contextual_links']); ?> | ||
<?php endif; ?> | ||
|
||
<?php if (!empty($content['media_left'])): ?> | ||
<div class="media-left"> | ||
<<?php print $media_left_wrapper ?> class="media-left <?php print $media_left_classes; ?>"> | ||
<?php print $content['media_left']; ?> | ||
</div> | ||
</<?php print $media_left_wrapper ?>> | ||
<?php endif; ?> | ||
|
||
<div class="media-body"> | ||
<?php if (!empty($content['media_heading'])): ?> | ||
<div class="media-heading"> | ||
<<?php print $media_heading_wrapper ?> class="media-heading <?php print $media_heading_classes; ?>"> | ||
<?php print $content['media_heading']; ?> | ||
</div> | ||
</<?php print $media_heading_wrapper ?>> | ||
<?php endif; ?> | ||
|
||
<?php if (!empty($content['media_body'])): ?> | ||
<div class="media-body"> | ||
<<?php print $media_body_wrapper ?> class="media-content <?php print $media_body_classes; ?>"> | ||
<?php print $content['media_body']; ?> | ||
</div> | ||
</<?php print $media_body_wrapper ?>> | ||
<?php endif; ?> | ||
</div> | ||
</div> | ||
|
||
</<?php print $layout_wrapper ?>> |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
// Plugin definition | ||
$plugin = array( | ||
// Title and description of the plugin | ||
'title' => t('Add Class'), | ||
'description' => t('Add a class to a panel.'), | ||
// Define a theme function for this plugin | ||
'render region' => 'add_class_style_render_region', | ||
// This defines the settings form for the plugin | ||
'settings form' => 'add_class_style_settings_form', | ||
); | ||
|
||
/** | ||
* Settings form callback. | ||
*/ | ||
function add_class_style_settings_form($settings) { | ||
|
||
$form = array(); | ||
|
||
$form['class'] = array( | ||
'#type' => 'textfield', | ||
'#title' => t('CSS Classes'), | ||
'#description' => t('Enter CSS classes for this style. Separate multiple classes by spaces.'), | ||
'#default_value' => (isset($settings['class'])) ? $settings['class'] : '', | ||
); | ||
|
||
return $form; | ||
} | ||
|
||
/** | ||
* Region render callback. | ||
* | ||
* Please note that it's a theme function | ||
* and has to start with 'theme_' prefix. | ||
*/ | ||
function theme_add_class_style_render_region($vars) { | ||
|
||
// Variable $vars['settings'] gets the class added in the form. | ||
$output = '<div class="'. $vars['settings']['class'] .'">'; | ||
|
||
// Variable $vars['panes'] contains an array of all | ||
// panel panes in current region. Collect them into | ||
// variable. | ||
foreach ($vars['panes'] as $pane) { | ||
$output .= $pane; | ||
} | ||
|
||
$output .= '</div>'; | ||
|
||
return $output; | ||
} |
This file contains 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 characters