panels_export.module File Reference

(1.1.2.5 2008/07/29 07:39:26 sdboyer)


Detailed Description

Provides functionality to export multiple items at once to make it easy to dump a set of panels into code.

Definition in file panels_export.module.

Go to the source code of this file.

Functions

 panels_export_export ()
 panels_export_export_form ($exportables)
 panels_export_export_form_submit ($form_id, $form_values)
 panels_export_menu ($may_cache)
 panels_export_perm ()
 theme_panels_export_export_form ($form)


Function Documentation

panels_export_export_form ( exportables  ) 

Form to choose a group of panels to export.

Definition at line 71 of file panels_export.module.

00071                                                  {
00072   foreach ($exportables as $module => $panels) {
00073     $form['modules']['#tree'] = TRUE;
00074     $form['modules'][$module] = array(
00075       '#type' => 'checkboxes',
00076       '#options' => $panels,
00077       '#default_value' => array(),
00078     );
00079   }
00080 
00081   $form['name'] = array(
00082     '#type' => 'textfield',
00083     '#title' => t('Module name'),
00084     '#description' => t('Enter the module name to export code to.'),
00085   );
00086 
00087   $form['submit'] = array(
00088     '#type' => 'submit',
00089     '#value' => t('Export'),
00090   );
00091 
00092   $form['#action'] = url('admin/panels/export/results');
00093   $form['#redirect'] = FALSE;
00094   $form['#exportables'] = $exportables;
00095   return $form;
00096 }

panels_export_menu ( may_cache  ) 

Implementation of hook_menu().

Definition at line 15 of file panels_export.module.

00015                                         {
00016   if ($may_cache) {
00017     $items = array();
00018     $items[] = array(
00019       'path' => 'admin/panels/export',
00020       'title' => t('Export panels'),
00021       'access' => user_access('use panels exporter'),
00022       'callback' => 'panels_export_export',
00023       'description' => t('Export panels in bulk.'),
00024     );
00025     $items[] = array(
00026       'path' => 'admin/panels/export/results',
00027       'access' => user_access('use panels exporter'),
00028       'callback' => 'panels_export_export',
00029       'type' => MENU_CALLBACK,
00030     );
00031     return $items;
00032   }
00033 }

panels_export_perm (  ) 

Implementation of hook_perm().

Definition at line 38 of file panels_export.module.

00038                               {
00039   return array('use panels exporter');
00040 }

theme_panels_export_export_form ( form  ) 

Definition at line 98 of file panels_export.module.

References panels_get_path().

00098                                                 {
00099   $files = module_rebuild_cache();
00100   $exportables = $form['#exportables'];
00101   $output = '';
00102 
00103   foreach ($exportables as $module => $panels) {
00104     $header = array(theme('table_select_header_cell'), $files[$module]->info['name']);
00105     $rows = array();
00106     foreach ($panels as $name => $panel) {
00107       $title = $form['modules'][$module][$name]['#title'];
00108       unset($form['modules'][$module][$name]['#title']);
00109       $rows[] = array(drupal_render($form['modules'][$module][$name]), $title);
00110     }
00111     $output .= '<div class="export-container">';
00112     $output .= theme('table', $header, $rows);
00113     $output .= "</div>\n";
00114   }
00115   drupal_add_css(panels_get_path('panels_export/panels_export.css'));
00116   $output .= drupal_render($form);
00117   return $output;
00118 }

Here is the call graph for this function:


Generated on Sun Feb 5 05:00:22 2012 for Panels 2 by  doxygen 1.5.6