rounded_corners.inc File Reference

(1.1.2.9 2008/10/24 00:05:59 merlinofchaos)


Detailed Description

Definition of the 'rounded_corners' panel style.

Definition in file rounded_corners.inc.

Go to the source code of this file.

Functions

 panels_add_rounded_corners_css ($display, $where)
 panels_rounded_corners_panels_styles ()
 panels_rounded_corners_style_settings_form ($style_settings)
 theme_panels_rounded_corners_style_render_pane ($content, $pane, $display)
 theme_panels_rounded_corners_style_render_panel ($display, $panel_id, $panes, $settings)
 theme_rounded_corners_box ($content)
 theme_rounded_corners_css ($display, $where= 'pane')


Function Documentation

panels_add_rounded_corners_css ( display,
where 
)

Definition at line 67 of file rounded_corners.inc.

Referenced by theme_panels_rounded_corners_style_render_pane(), and theme_panels_rounded_corners_style_render_panel().

00067                                                           {
00068   static $displays_used = array();
00069   if (empty($displays_used[$display->css_id])) {
00070     theme('rounded_corners_css', $display, $where);
00071     $displays_used[$display->css_id] = TRUE;
00072   }
00073 }

Here is the caller graph for this function:

panels_rounded_corners_panels_styles (  ) 

Implementation of hook_panels_style_info().

Definition at line 15 of file rounded_corners.inc.

00015                                                 {
00016   return array(
00017     'rounded_corners' => array(
00018       'title' => t('Rounded corners'),
00019       'description' => t('Presents the panes or panels with a rounded corner box around them'),
00020       'render panel' => 'panels_rounded_corners_style_render_panel',
00021       'render pane' => 'panels_rounded_corners_style_render_pane',
00022       'settings form' => 'panels_rounded_corners_style_settings_form',
00023     ),
00024   );
00025 }

panels_rounded_corners_style_settings_form ( style_settings  ) 

Settings form callback.

Definition at line 94 of file rounded_corners.inc.

00094                                                                      {
00095   $form['corner_location'] = array(
00096     '#type' => 'select',
00097     '#title' => t('Box around'),
00098     '#options' => array(
00099       'pane' => t('Each pane'),
00100       'panel' => t('Each panel'),
00101     ),
00102     '#default_value' => (isset($style_settings['corner_location'])) ? $style_settings['corner_location'] : 'ul',
00103     '#description' => t('Choose whether to include the box around each pane (piece of content) or panel (each column or region)'),
00104   );
00105 
00106   return $form;
00107 }

theme_panels_rounded_corners_style_render_pane ( content,
pane,
display 
)

Render callback for a single pane.

Definition at line 78 of file rounded_corners.inc.

References panels_add_rounded_corners_css().

00078                                                                                    {
00079   $output = theme('panels_pane', $content, $pane, $display);
00080 
00081   if (!$output) {
00082     return;
00083   }
00084 
00085   // Just stick a box around the standard theme_panels_pane.
00086   $output = panels_rounded_corners_box($output);
00087   panels_add_rounded_corners_css($display, 'pane');
00088   return $output;
00089 }

Here is the call graph for this function:

theme_panels_rounded_corners_style_render_panel ( display,
panel_id,
panes,
settings 
)

Render callback.

Definition at line 35 of file rounded_corners.inc.

References panels_add_rounded_corners_css(), and panels_render_pane().

00035                                                                                                  {
00036   $output = '';
00037 
00038   // Determine where to put the box. If empty or 'pane' around each pane. If
00039   // 'panel' then just around the whole panel.
00040   $where = empty($settings['corner_location']) ? 'pane' : $settings['corner_location'];
00041 
00042   $print_separator = FALSE;
00043   foreach ($panes as $pane_id => $pane) {
00044     // Add the separator if we've already displayed a pane.
00045     if ($print_separator) {
00046       $output .= '<div class="panel-separator"></div>';
00047     }
00048     $text = panels_render_pane($pane, $display->content[$pane_id], $display);
00049     if ($text) {
00050       $output .= ($where == 'pane') ? theme('rounded_corners_box', $text) : $text;
00051     }
00052 
00053     // If we displayed a pane, this will become true; if not, it will become
00054     // false.
00055     $print_separator = (bool) $text;
00056   }
00057 
00058   if ($where == 'panel') {
00059     $output = theme('rounded_corners_box', $output);
00060   }
00061 
00062   panels_add_rounded_corners_css($display, $where);
00063 
00064   return $output;
00065 }

Here is the call graph for this function:

theme_rounded_corners_box ( content  ) 

Create the HTML for our rounded corner box.

Parameters:
$text The content of this rounded corner box.
Returns:
The created HTML.

Definition at line 210 of file rounded_corners.inc.

00210                                              {
00211   return <<<EOF
00212 <div class="rounded_corner">
00213   <div class="wrap-corner">
00214     <div class="t-edge"><div class="l"></div><div class="r"></div></div>
00215     <div class="l-edge">
00216       <div class="r-edge">
00217         $content
00218       </div>
00219     </div>
00220     <div class="b-edge"><div class="l"></div><div class="r"></div></div>
00221   </div>
00222 </div>
00223 EOF;
00224 }

theme_rounded_corners_css ( display,
where = 'pane' 
)

Generates the dynamic CSS.

Parameters:
$display A Panels display object.
$where String indicating where the rounded corners should be applied, either 'pane' or 'panel'.

Definition at line 127 of file rounded_corners.inc.

References panels_get_path().

00127                                                               {
00128   $idstr = empty($display->css_id) ? '.rounded_corner' : "#$display->css_id";
00129   $url = panels_get_path('styles/corners', TRUE);
00130 
00131   $css = <<<EOF
00132 
00133 $idstr .t-edge, .b-edge, .l-edge, .r-edge, .wrap-corner {
00134   position: relative;
00135   /* hasLayout -1 ? For IE only */
00136   zoom: 1;
00137 }
00138 $idstr .t-edge {
00139   background: url($url/shadow-t.png) repeat-x 0 top;
00140   font-size: 1px;
00141 }
00142 $idstr .b-edge {
00143   background: url($url/shadow-b.png) repeat-x 0 bottom;
00144   font-size: 1px;
00145 }
00146 $idstr .l-edge {
00147   background: url($url/shadow-l.png) repeat-y 0 0;
00148 }
00149 $idstr .r-edge {
00150   background: url($url/shadow-r.png) repeat-y right 0;
00151 }
00152 $idstr .wrap-corner {
00153   background: #fff !important;
00154 }
00155 $idstr .wrap-corner .t-edge, .wrap-corner .b-edge {
00156   height: 11px;
00157 }
00158 $idstr .wrap-corner .l, .wrap-corner .r {
00159   position: absolute;
00160   top: 0;
00161   height: 11px;
00162   width: 11px;
00163   background-image: url($url/corner-bits.png);
00164 }
00165 $idstr .wrap-corner .l {
00166   left: 0;
00167 }
00168 $idstr .wrap-corner .r {
00169   right: 0;
00170   background-position: -11px 0;
00171 }
00172 $idstr .wrap-corner .b-edge .l {
00173   background-position: 0 -11px;
00174 }
00175 $idstr .wrap-corner .b-edge .r {
00176   background-position: -11px -11px;
00177 }
00178 $idstr .wrap-corner .r-edge {
00179   padding: 5px 24px;
00180 }
00181 $idstr div.admin-links {
00182   margin-top: -14px;
00183   margin-left: -12px;
00184 }
00185 
00186 EOF;
00187 
00188   if ($where == 'panel') {
00189     $css .= <<<EOF
00190 $idstr .panel-separator {
00191   background: url($url/shadow-b.png) repeat-x 0 center;
00192   font-size: 1px;
00193   height: 30px;
00194   }
00195 EOF;
00196   }
00197 
00198   drupal_set_html_head("<style type=\"text/css\" media=\"all\">\n$css</style>\n");
00199 }

Here is the call graph for this function:


Generated on Sun Sep 5 05:00:20 2010 for Panels 2 by  doxygen 1.5.6