title)) { $title_wrapper = _panels_extra_styles_wrapper_wrap(!empty($settings['title']) ? $settings['title'] : array()); $content->title = $title_wrapper['prefix'] . $content->title . $title_wrapper['suffix']; } if (!empty($content->content)) { $content_wrapper = _panels_extra_styles_wrapper_wrap(!empty($settings['content']) ? $settings['content'] : array()); $content->content = $content_wrapper['prefix'] . render($content->content) . $content_wrapper['suffix']; } // Theme. if (!empty($settings['theme']) && $settings['theme']) { $output = theme('panels_pane', $vars); } else { $title = !empty($content->title) ? $content->title : NULL; $content = !empty($content->content) ? $content->content : NULL; $output = $title . $content; } return $output; } /** * Wrap it, wrap it real good. * * @return array * Array with prefix and suffix keys. */ function _panels_extra_styles_wrapper_wrap($item = array()) { $wrap['prefix'] = NULL; $wrap['suffix'] = NULL; $wrap['attributes'] = NULL; if (!empty($item['attributes'])) { foreach ($item['attributes'] as $key => $value) { if (!empty($value)) { $wrap['attributes'] .= " $key=\"$value\""; } } } if (!empty($item['element']) && $item['element'] != 'no_wrapper') { $wrap['prefix'] = '<' . $item['element'] . $wrap['attributes'] . '>'; $wrap['suffix'] = ''; } if (!empty($item['prefix'])) { $wrap['prefix'] = $item['prefix']; } if (!empty($item['suffix'])) { $wrap['suffix'] = $item['suffix']; } // Tidy. $wrap['prefix'] = PHP_EOL . $wrap['prefix']; $wrap['suffix'] = $wrap['suffix'] . PHP_EOL; return $wrap; }