t('This is pane one'), 'mymod_item_2' => t('This is pane two'), ); return $items; } /** * display the content for item 1 * @param array $conf * @return string * html return */ function theme_mymod_item_1($conf) { return "my module item 1 theme function output"; } /** * display the content for item 2 * @param array $conf * @return string * html return */ function theme_mymod_item_2($conf) { return "my module item 2 theme function output"; } /* *************************************************** */ /* Panels hooks */ /* *************************************************** */ /** * Callback function to supply a list of content types. * @return array */ function mymod_panels_panels_content_types() { $items['mymod panes'] = array( 'title' => t('My Module panes'), 'content_types' => 'mymod_panels_admin_content_types', 'title callback' => 'mymod_panels_admin_title', 'add callback' => 'mymod_panels_admin_add', 'render callback' => 'mymod_panels_content', ); return $items; } /** * Return all block content types available. * @return array */ function mymod_panels_admin_content_types() { $types = array(); foreach (mymod_panels_content_define() as $id => $title) { $info = array( 'title' => $title, 'category' => array(t('My Module panes')), 'icon' => drupal_get_path('module', 'mymod_panels') .'/images/mymod.gif', 'id' => $id, ); $types["mymod_panels-$id"] = $info; } return $types; } /** * Returns the form for a new block. * @return array * drupal form array */ function mymod_panels_admin_add($id, $parents, $conf = array()) { list($conf['module'], $conf['delta']) = explode('-', $id, 2); $form['module'] = array( '#type' => 'value', '#value' => $conf['module'], ); $form['delta'] = array( '#type' => 'value', '#value' => $conf['delta'], ); return $form; } /** * call the content to generate for the pane in question * calls a theme(module_name_pane_name, $conf); * @param array $conf * @return object */ function mymod_panels_content($conf) { $function = $conf['module'] .'_'. $conf['delta']; $block = new stdClass(); $block->content = theme("$function", $conf); return $block; } /** * Returns the administrative title for a type. * @param array $conf */ function mymod_panels_admin_title($conf) { $panels = mymod_panels_content_define(); return $panels[$conf['delta']]; }