diff --git a/README.txt b/README.txt index 33c4ddb..29e713a 100644 --- a/README.txt +++ b/README.txt @@ -1,26 +1,32 @@ -About +ABOUT -Panelizer allows you to treat any node type as a panel node. You can provide default panels, per node type, and control both the available content and available layouts, also per node type. +Panelizer allows you to treat any node type as a panel node. You can provide +default panels, per node type, and control both the available content and +available layouts, also per node type. -Installing +INSTALLING -Install this through the normal Drupal method of putting the module in sites/all/modules and going to admin/build/modules to activate it. +Install this through the normal Drupal method of putting the module in +sites/all/modules and going to admin/build/modules to activate it. It requires Panels and Page Manager. -Initial configuration +INITIAL CONFIGURATION -Visit administer >> settings >> panelizer to enable the module for the node types you need. +Visit administer >> settings >> panelizer to enable the module for the node +types you need. Ensure that the node template system page is enabled. API @todo - drupal_alter('panelizer_default_types', $types, 'node'); + drupal_alter('panelizer_default_types', $types, $context1); Future functionality - Allow panels for different build modes -- this is tricky - - Fully implement the ability to choose from different defaults and restrict custom panel per node + - Fully implement the ability to choose from different defaults and restrict + custom panel per node - Implement user panelizer - - Implement panel subtabs. i.e, allow node/27/arbitrarylink to be a subtab of a node, using panelizer. + - Implement panel subtabs. i.e, allow node/27/arbitrarylink to be a subtab + of a node, using panelizer. diff --git a/includes/admin.inc b/includes/admin.inc index 810dd44..e1f0ae3 100644 --- a/includes/admin.inc +++ b/includes/admin.inc @@ -1,6 +1,4 @@ 'panelizer_node_settings_page_form', ); - $types = node_get_types('names'); - drupal_alter('panelizer_default_types', $types, 'node'); + $types = node_type_get_names(); + $context1 = 'node'; + drupal_alter('panelizer_default_types', $types, $context1); $settings = variable_get('panelizer_defaults', array()); @@ -51,8 +50,7 @@ function panelizer_settings_page_form(&$form_state) { $base_id = str_replace(array('][', '_', ' '), '-', 'edit-types-node-' . $type); $form['types']['node'][$type]['title'] = array( - '#value' => $title, - // '#markup' => $title, // for d7 port + '#markup' => $title, ); $form['types']['node'][$type]['status'] = array( @@ -63,19 +61,19 @@ function panelizer_settings_page_form(&$form_state) { $form['types']['node'][$type]['default'] = array( '#type' => 'checkbox', '#default_value' => !empty($settings['node'][$type]['default']), - '#process' => array('ctools_dependent_process'), + '#pre_render' => array('ctools_dependent_pre_render'), '#dependency' => array($base_id . '-status' => array(TRUE)), ); $form['types']['node'][$type]['choice'] = array( '#type' => 'checkbox', '#default_value' => !empty($settings['node'][$type]['choice']), - '#process' => array('ctools_dependent_process'), + '#pre_render' => array('ctools_dependent_pre_render'), '#dependency' => array($base_id . '-status' => array(TRUE)), '#access' => FALSE, // Allowing a choice is curently disabled ); - $base_url = 'admin/settings/panelizer/node/' . $type; + $base_url = 'admin/config/panelizer/node/' . $type; $form['types']['node'][$type]['links'] = array( '#prefix' => '
', @@ -94,13 +92,17 @@ function panelizer_settings_page_form(&$form_state) { $form['types']['node'][$type]['links']['basic'] = array( '#type' => 'item', '#input' => TRUE, // necessary to fake the #process - '#value' => theme('links', $links, array('class' => 'links inline')), + '#title' => theme('links', array( + 'links' => $links, + 'attributes' => array('class' => 'links inline'), + )), '#id' => $base_id . '-links-basic', - '#process' => array('ctools_dependent_process'), '#dependency' => array($base_id . '-status' => array(TRUE)), ); } + // TODO: The 'default' links do not display, probably because the default + // option, above, does not save. if (!empty($settings['node'][$type]['default'])) { // add links $links = array( @@ -125,9 +127,11 @@ function panelizer_settings_page_form(&$form_state) { $form['types']['node'][$type]['links']['default'] = array( '#type' => 'item', '#input' => TRUE, // necessary to fake the #process - '#value' => theme('links', $links, array('class' => 'links inline')), + '#item' => theme('links', array( + 'links' => $links, + 'attributes' => array('class' => 'links inline'), + )), '#id' => $base_id . '-links-default', - '#process' => array('ctools_dependent_process'), '#dependency_count' => 2, '#dependency' => array( $base_id . '-default' => array(TRUE), @@ -145,9 +149,11 @@ function panelizer_settings_page_form(&$form_state) { $form['types']['node'][$type]['links']['default2'] = array( '#type' => 'item', '#input' => TRUE, // necessary to fake the #process - '#value' => theme('links', $links, array('class' => 'links inline')), + '#title' => theme('links', array( + 'links' => $links, + 'attributes' => array('class' => 'links inline'), + )), '#id' => $base_id . '-links-default2', - '#process' => array('ctools_dependent_process'), '#dependency_count' => 2, '#dependency' => array( $base_id . '-default' => array(TRUE), @@ -173,7 +179,8 @@ function panelizer_settings_page_form(&$form_state) { * * We want our checkboxes to show up in a table. */ -function theme_panelizer_node_settings_page_form($element) { +function theme_panelizer_node_settings_page_form($variables) { + $element = $variables['form']; $output = ''; // Render the 'node' table @@ -194,12 +201,12 @@ function theme_panelizer_node_settings_page_form($element) { ); } - $output .= theme('table', $header, $rows); + $output .= theme('table', array('header' => $header, 'rows' => $rows)); // Render the 'user' table // Render everything else - $output .= drupal_render($element); + $output .= drupal_render_children($element); return $output; } @@ -228,7 +235,8 @@ function panelizer_allowed_content_page($type, $key) { // Drupal kills our breadcrumb. Put it back. ctools_include('menu'); - ctools_menu_set_trail_parent('admin/settings/panelizer'); + // TODO: Replace ctools_menu_set_trail_parent(). + // ctools_menu_set_trail_parent('admin/config/panelizer'); ctools_include('common', 'panels'); return drupal_get_form('panels_common_settings', 'panelizer_' . $type . ':' . $key); @@ -252,16 +260,18 @@ function panelizer_default_settings_page($type, $key, $name) { // Drupal kills our breadcrumb. Put it back. ctools_include('menu'); - ctools_menu_set_trail_parent('admin/settings/panelizer'); + // TODO: Replace ctools_menu_set_trail_parent(). + // ctools_menu_set_trail_parent('admin/config/panelizer'); $form_state = array( 'panelizer' => &$panelizer, 'no_redirect' => TRUE, ); - ctools_include('form'); + // TODO: CTools no longer includes form.inc. +// ctools_include('form'); ctools_include('common', 'panelizer'); - $output = ctools_build_form('panelizer_settings_form', $form_state); + $output = drupal_build_form('panelizer_settings_form', $form_state); if (!empty($form_state['executed'])) { drupal_set_message(t('The settings have been updated.')); ctools_include('export'); @@ -285,7 +295,8 @@ function panelizer_default_context_page($type, $key, $name) { // Drupal kills our breadcrumb. Put it back. ctools_include('menu'); - ctools_menu_set_trail_parent('admin/settings/panelizer'); + // TODO: Replace ctools_menu_set_trail_parent(). + // ctools_menu_set_trail_parent('admin/config/panelizer'); $form_state = array( 'panelizer' => &$panelizer, @@ -295,9 +306,10 @@ function panelizer_default_context_page($type, $key, $name) { 'no_redirect' => TRUE, ); - ctools_include('form'); + // TODO: CTools no longer includes form.inc. +// ctools_include('form'); ctools_include('common', 'panelizer'); - $output = ctools_build_form('panelizer_default_context_form', $form_state); + $output = drupal_build_form('panelizer_default_context_form', $form_state); if (!empty($form_state['executed'])) { if (!empty($form_state['clicked_button']['#write'])) { drupal_set_message(t('The settings have been updated.')); @@ -326,7 +338,8 @@ function panelizer_default_layout_page($type, $key, $name) { // Drupal kills our breadcrumb. Put it back. ctools_include('menu'); - ctools_menu_set_trail_parent('admin/settings/panelizer'); + // TODO: Replace ctools_menu_set_trail_parent(). + // ctools_menu_set_trail_parent('admin/config/panelizer'); $display = panelizer_load_display($panelizer); @@ -363,7 +376,8 @@ function panelizer_default_content_page($type, $key, $name) { // Drupal kills our breadcrumb. Put it back. ctools_include('menu'); - ctools_menu_set_trail_parent('admin/settings/panelizer'); + // TODO: Replace ctools_menu_set_trail_parent(). + // ctools_menu_set_trail_parent('admin/config/panelizer'); $cache = panels_edit_cache_get('panelizer:default:' . $type . ':' . $key . ':' . $name); @@ -394,5 +408,6 @@ function panelizer_default_content_page($type, $key, $name) { // Print this with theme('page') so that blocks are disabled while editing a display. // This is important because negative margins in common block layouts (i.e, Garland) // messes up the drag & drop. + // TODO Please change this theme call as discussed at http://drupal.org/node/224333#theme_page. print theme('page', $output, FALSE); } diff --git a/includes/common.inc b/includes/common.inc index ab909f3..e3332e1 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1,6 +1,4 @@ '
', '#suffix' => '
', - '#value' => theme('ctools_context_list', $panelizer, t('Summary of contexts'), $description), + '#value' => theme('ctools_context_list', array( + 'object' => $panelizer, + 'header' => array(), + '' => t('Summary of contexts'), + 'description' => $description, + )), ); $form['submit'] = array( @@ -143,4 +149,3 @@ function panelizer_default_context_form(&$form_state) { return $form; } - diff --git a/includes/node.inc b/includes/node.inc index 445f738..ed46191 100644 --- a/includes/node.inc +++ b/includes/node.inc @@ -1,6 +1,4 @@ nid)); + $panelizer = db_fetch_object(db_query("SELECT * FROM {panelizer_node} WHERE nid = :nid", array(':nid' => $node->nid))); if ($panelizer && !empty($panelizer->did)) { ctools_include('export'); $panelizer = ctools_export_unpack_object('panelizer_node', $panelizer); @@ -128,6 +126,10 @@ function panelizer_edit_node_settings_page($node) { return $output; } +/** + * @todo Please document this function. + * @see http://drupal.org/node/1354 + */ function panelizer_panelize_node_form(&$form_state) { $form = array(); @@ -251,7 +253,8 @@ function panelizer_edit_node_content_page($node) { // Print this with theme('page') so that blocks are disabled while editing a display. // This is important because negative margins in common block layouts (i.e, Garland) // messes up the drag & drop. - print theme('page', $output, FALSE); + // TODO Please change this theme call as discussed at http://drupal.org/node/224333#theme_page. + // print theme('page', $output, FALSE); } /** @@ -271,80 +274,80 @@ function panelizer_get_default_display_node() { $display->title = ''; $display->content = array(); $display->panels = array(); - $pane = new stdClass; - $pane->pid = 'new-1'; - $pane->panel = 'center'; - $pane->type = 'node_content'; - $pane->subtype = 'node_content'; - $pane->shown = TRUE; - $pane->access = array(); - $pane->configuration = array( - 'links' => 1, - 'page' => 1, - 'no_extras' => 0, - 'override_title' => 0, - 'override_title_text' => '', - 'identifier' => '', - 'link' => 0, - 'leave_node_title' => 0, - 'context' => 'panelizer', - 'build_mode' => 'full', - ); - $pane->cache = array(); - $pane->style = array( - 'settings' => NULL, - ); - $pane->css = array(); - $pane->extras = array(); - $pane->position = 0; - $display->content['new-1'] = $pane; - $display->panels['center'][0] = 'new-1'; - $pane = new stdClass; - $pane->pid = 'new-2'; - $pane->panel = 'center'; - $pane->type = 'node_comments'; - $pane->subtype = 'node_comments'; - $pane->shown = TRUE; - $pane->access = array(); - $pane->configuration = array( - 'mode' => '4', - 'order' => '2', - 'comments_per_page' => '50', - 'context' => 'panelizer', - 'override_title' => 0, - 'override_title_text' => '', - ); - $pane->cache = array(); - $pane->style = array( - 'settings' => NULL, - ); - $pane->css = array(); - $pane->extras = array(); - $pane->position = 1; - $display->content['new-2'] = $pane; - $display->panels['center'][1] = 'new-2'; - $pane = new stdClass; - $pane->pid = 'new-3'; - $pane->panel = 'center'; - $pane->type = 'node_comment_form'; - $pane->subtype = 'node_comment_form'; - $pane->shown = TRUE; - $pane->access = array(); - $pane->configuration = array( - 'anon_links' => 1, - 'context' => 'panelizer', - 'override_title' => 0, - 'override_title_text' => '', - ); - $pane->cache = array(); - $pane->style = array( - 'settings' => NULL, - ); - $pane->css = array(); - $pane->extras = array(); - $pane->position = 2; - $display->content['new-3'] = $pane; - $display->panels['center'][2] = 'new-3'; + $pane = new stdClass; + $pane->pid = 'new-1'; + $pane->panel = 'center'; + $pane->type = 'node_content'; + $pane->subtype = 'node_content'; + $pane->shown = TRUE; + $pane->access = array(); + $pane->configuration = array( + 'links' => 1, + 'page' => 1, + 'no_extras' => 0, + 'override_title' => 0, + 'override_title_text' => '', + 'identifier' => '', + 'link' => 0, + 'leave_node_title' => 0, + 'context' => 'panelizer', + 'build_mode' => 'full', + ); + $pane->cache = array(); + $pane->style = array( + 'settings' => NULL, + ); + $pane->css = array(); + $pane->extras = array(); + $pane->position = 0; + $display->content['new-1'] = $pane; + $display->panels['center'][0] = 'new-1'; + $pane = new stdClass; + $pane->pid = 'new-2'; + $pane->panel = 'center'; + $pane->type = 'node_comments'; + $pane->subtype = 'node_comments'; + $pane->shown = TRUE; + $pane->access = array(); + $pane->configuration = array( + 'mode' => '4', + 'order' => '2', + 'comments_per_page' => '50', + 'context' => 'panelizer', + 'override_title' => 0, + 'override_title_text' => '', + ); + $pane->cache = array(); + $pane->style = array( + 'settings' => NULL, + ); + $pane->css = array(); + $pane->extras = array(); + $pane->position = 1; + $display->content['new-2'] = $pane; + $display->panels['center'][1] = 'new-2'; + $pane = new stdClass; + $pane->pid = 'new-3'; + $pane->panel = 'center'; + $pane->type = 'node_comment_form'; + $pane->subtype = 'node_comment_form'; + $pane->shown = TRUE; + $pane->access = array(); + $pane->configuration = array( + 'anon_links' => 1, + 'context' => 'panelizer', + 'override_title' => 0, + 'override_title_text' => '', + ); + $pane->cache = array(); + $pane->style = array( + 'settings' => NULL, + ); + $pane->css = array(); + $pane->extras = array(); + $pane->position = 2; + $display->content['new-3'] = $pane; + $display->panels['center'][2] = 'new-3'; $display->hide_title = PANELS_TITLE_FIXED; $display->title_pane = 'new-1'; @@ -369,7 +372,7 @@ function panelizer_get_base_context_node($object = NULL) { 'name' => 'node', 'identifier' => t('This node'), 'keyword' => 'node', - 'context_settings' => array() + 'context_settings' => array(), ), ); } diff --git a/includes/panelizer.pages_default.inc b/includes/panelizer.pages_default.inc index 401b171..c5944c6 100644 --- a/includes/panelizer.pages_default.inc +++ b/includes/panelizer.pages_default.inc @@ -1,13 +1,11 @@ 'text', 'size' => 'big', 'description' => 'Any CSS the author provided for the panel.', - 'default' => '', ), 'pipeline' => array( 'type' => 'varchar', @@ -99,7 +101,7 @@ function panelizer_schema_1() { 'minimum_version' => 1, 'current_version' => 1, ), -// 'create callback' => 'panelizer_export_create_callback', + // 'create callback' => 'panelizer_export_create_callback', 'save callback' => 'panelizer_export_save_callback', 'export callback' => 'panelizer_export_export_callback', 'delete callback' => 'panelizer_export_delete_callback', @@ -142,17 +144,27 @@ function panelizer_schema_1() { } /** - * Implementation of hook_install(). + * Implements hook_install(). */ function panelizer_install() { - db_query("UPDATE {system} SET weight = 21 WHERE name = 'panelizer'"); - drupal_install_schema('panelizer'); + // TODO Please review the conversion of this statement to the D7 database API syntax. + /* db_query("UPDATE {system} SET weight = 21 WHERE name = 'panelizer'") */ + // Set the module weight so it can execute after Panels. + db_update('system') + ->fields(array( + 'weight' => 21, + )) + ->condition('name', 'panelizer') + ->execute(); } /** - * Implementation of hook_uninstall(). + * Implements hook_uninstall(). */ function panelizer_uninstall() { - drupal_uninstall_schema('panelizer'); - db_query("DELETE FROM {variable} WHERE name like 'panelizer%%'"); + // TODO Please review the conversion of this statement to the D7 database API syntax. + /* db_query("DELETE FROM {variable} WHERE name like 'panelizer%%'") */ + // db_delete('variable') + // ->condition("name LIKE 'panelizer%%'", '') + // ->execute(); } diff --git a/panelizer.module b/panelizer.module index cd52ab9..54da4ce 100644 --- a/panelizer.module +++ b/panelizer.module @@ -1,7 +1,4 @@ array( + 'title' => t('administer panelizer'), + 'description' => t('TODO Add a description for \'administer panelizer\''), + ), + ); } /** - * Implements hook_theme() + * Implements hook_theme(). */ function panelizer_theme() { $items = array(); $items['panelizer_node_settings_page_form'] = array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'includes/admin.inc', ); @@ -31,7 +33,7 @@ function panelizer_theme() { } /** - * Implementation of hook_menu(). + * Implements hook_menu(). */ function panelizer_menu() { // Safety: go away if CTools is not at an appropriate version. @@ -45,7 +47,7 @@ function panelizer_menu() { 'file' => 'includes/admin.inc', ); - $items['admin/settings/panelizer'] = array( + $items['admin/config/panelizer'] = array( 'title' => 'Panelizer', 'description' => 'Configure panelizer availability and defaults', 'page callback' => 'drupal_get_form', @@ -53,7 +55,7 @@ function panelizer_menu() { 'type' => MENU_NORMAL_ITEM, ) + $settings_base; - $items['admin/settings/panelizer/%/%'] = array( + $items['admin/config/panelizer/%/%'] = array( 'title callback' => 'panelizer_default_title_callback', 'title arguments' => array(3, 4), 'page callback' => 'panelizer_allowed_content_page', @@ -61,7 +63,7 @@ function panelizer_menu() { 'type' => MENU_CALLBACK, ) + $settings_base; - $items['admin/settings/panelizer/%/%/allowed'] = array( + $items['admin/config/panelizer/%/%/allowed'] = array( 'title' => 'Available content', 'page callback' => 'panelizer_allowed_content_page', 'page arguments' => array(3, 4), @@ -69,7 +71,7 @@ function panelizer_menu() { 'weight' => -10, ) + $settings_base; - $items['admin/settings/panelizer/%/%/list'] = array( + $items['admin/config/panelizer/%/%/list'] = array( 'title' => 'List defaults', 'access callback' => 'panelizer_has_choice_callback', 'access arguments' => array(3, 4, ''), @@ -87,26 +89,26 @@ function panelizer_menu() { 'file' => 'includes/admin.inc', ); - $items['admin/settings/panelizer/%/%/settings'] = array( + $items['admin/config/panelizer/%/%/settings'] = array( 'title' => 'Settings', 'page callback' => 'panelizer_default_settings_page', 'weight' => -5, ) + $tabs_base; - $items['admin/settings/panelizer/%/%/context'] = array( + $items['admin/config/panelizer/%/%/context'] = array( 'title' => 'Contexts', 'page callback' => 'panelizer_default_context_page', 'weight' => -4, ) + $tabs_base; - $items['admin/settings/panelizer/%/%/layout'] = array( + $items['admin/config/panelizer/%/%/layout'] = array( 'title' => 'Layout', 'page callback' => 'panelizer_default_layout_page', 'weight' => -3, ) + $tabs_base; - $items['admin/settings/panelizer/%/%/content'] = array( + $items['admin/config/panelizer/%/%/content'] = array( 'title' => 'Content', 'page callback' => 'panelizer_default_content_page', 'weight' => -2, @@ -120,33 +122,33 @@ function panelizer_menu() { 'file' => 'includes/admin.inc', ); - $items['admin/settings/panelizer/%/%/%'] = array( + $items['admin/config/panelizer/%/%/%'] = array( 'title' => 'Settings', 'page callback' => 'panelizer_default_settings_page', 'title callback' => 'panelizer_default_name_title_callback', 'type' => MENU_CALLBACK, ) + $subtabs_base; - $items['admin/settings/panelizer/%/%/%/settings'] = array( + $items['admin/config/panelizer/%/%/%/settings'] = array( 'title' => 'Settings', 'page callback' => 'panelizer_default_settings_page', 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -5, ) + $subtabs_base; - $items['admin/settings/panelizer/%/%/%/context'] = array( + $items['admin/config/panelizer/%/%/%/context'] = array( 'title' => 'Contexts', 'page callback' => 'panelizer_default_context_page', 'weight' => -4, ) + $subtabs_base; - $items['admin/settings/panelizer/%/%/%/layout'] = array( + $items['admin/config/panelizer/%/%/%/layout'] = array( 'title' => 'Layout', 'page callback' => 'panelizer_default_layout_page', 'weight' => -3, ) + $subtabs_base; - $items['admin/settings/panelizer/%/%/%/content'] = array( + $items['admin/config/panelizer/%/%/%/content'] = array( 'title' => 'Content', 'page callback' => 'panelizer_default_content_page', 'weight' => -2, @@ -225,7 +227,7 @@ function panelizer_edit_node_callback($node, $check_for_default = TRUE) { function panelizer_default_title_callback($type, $key) { switch ($type) { case 'node': - $name = node_get_types('name', $key); + $name = node_type_get_name($key); return check_plain($name); case 'user': } @@ -342,7 +344,7 @@ function panelizer_load_default_by_name($load_name, $default_anyway = FALSE) { * to them. This fetches the display, if there is one. */ function panelizer_load_default($type, $key, $name, $default_anyway = FALSE) { - $load_name = $type . ':' . $key. ':' . $name; + $load_name = $type . ':' . $key . ':' . $name; return _panelizer_load_default($type, $key, $name, $load_name, $default_anyway); } @@ -460,7 +462,11 @@ function panelizer_export_delete_callback($object) { panels_delete_display($object->did); } - db_query("DELETE FROM {panelizer_defaults} WHERE name = '%s'", $object->name); + // TODO Please review the conversion of this statement to the D7 database API syntax. + /* db_query("DELETE FROM {panelizer_defaults} WHERE name = '%s'", $object->name) */ + db_delete('panelizer_defaults') + ->condition('name', $object->name) + ->execute(); } // --------------------------------------------------------------------------- @@ -541,7 +547,7 @@ function panelizer_context_cache_clear($type, $key) { function panelizer_panels_cache_get($argument) { ctools_include('object-cache'); list($type, $key) = explode(':', $argument, 2); - $cache = ctools_object_cache_get('panelizer_display_cache', $type . ':' .$key); + $cache = ctools_object_cache_get('panelizer_display_cache', $type . ':' . $key); if (!empty($cache)) { $cache->cached = TRUE; switch ($type) { @@ -594,7 +600,7 @@ function panelizer_panels_cache_get($argument) { function panelizer_panels_cache_set($argument, $cache) { list($type, $key) = explode(':', $argument, 2); ctools_include('object-cache'); - ctools_object_cache_set('panelizer_display_cache', $type . ':' .$key, $cache); + ctools_object_cache_set('panelizer_display_cache', $type . ':' . $key, $cache); } /** @@ -603,7 +609,7 @@ function panelizer_panels_cache_set($argument, $cache) { function panelizer_panels_cache_clear($argument, $cache) { list($type, $key) = explode(':', $argument, 2); ctools_include('object-cache'); - ctools_object_cache_clear('panelizer_display_cache', $type . ':' .$key); + ctools_object_cache_clear('panelizer_display_cache', $type . ':' . $key); } /** @@ -663,7 +669,7 @@ function panelizer_get_contexts($panelizer, $object = NULL) { // Contrib module hooks to provide needed functionality. /** - * Implementation of hook_ctools_plugin_directory() to let the system know + * Implements hook_ctools_plugin_directory() to let the system know(). * where our task_handler plugins are. */ function panelizer_ctools_plugin_directory($owner, $plugin_type) { @@ -673,7 +679,7 @@ function panelizer_ctools_plugin_directory($owner, $plugin_type) { } /** - * Implementation of hook_ctools_plugin_api(). + * Implements hook_ctools_plugin_api(). */ function panelizer_ctools_plugin_api($module, $api) { if ($module == 'page_manager' && $api == 'pages_default') { @@ -685,7 +691,7 @@ function panelizer_ctools_plugin_api($module, $api) { } /** - * Implementation of hook_export_node_alter() + * Implements hook_export_node_alter(). * * Integrate with export.module for saving panel_nodes into code. */ @@ -694,7 +700,7 @@ function panelizer_export_node_alter(&$node, $original_node, $method) { } /** - * Implementation of hook_panelizer_defaults_alter + * Implements hook_panelizer_defaults_alter(). * * Remove the panels node because there is no point to panelizing it. */ diff --git a/plugins/task_handlers/panelizer_node.inc b/plugins/task_handlers/panelizer_node.inc index ade209b..1c24e48 100644 --- a/plugins/task_handlers/panelizer_node.inc +++ b/plugins/task_handlers/panelizer_node.inc @@ -1,6 +1,4 @@ 'context', // may NOT be added up front. 'visible' => FALSE, - // Administrative fields. 'title' => t('Panelizer'), - 'admin summary' =>'panelizer_panelizer_task_admin_summary', + 'admin summary' => 'panelizer_panelizer_task_admin_summary', 'operations' => array(), - // Callback to render the data. 'render' => 'panelizer_panelizer_task_render', ); +/** + * @todo Please document this function. + * @see http://drupal.org/node/1354 + */ function panelizer_panelizer_task_admin_summary($handler, $task, $subtask, $page, $show_title = TRUE) { $output = ''; @@ -46,12 +46,18 @@ function panelizer_panelizer_task_admin_summary($handler, $task, $subtask, $page $access = t('This variant will be selected if the node being viewed is panelized. This variant must be enabled and selected for panelizer to work!'); $rows[] = array( - array('class' => t('page-summary-label'), 'data' => t('Selection rule')), - array('class' => t('page-summary-data'), 'data' => $access), + array( + 'class' => t('page-summary-label'), + 'data' => t('Selection rule'), + ), + array( + 'class' => t('page-summary-data'), + 'data' => $access, + ), array('class' => t('page-summary-operation'), ''), ); - $output .= theme('table', array(), $rows, array('class' => 'page-manager-handler-summary')); + $output .= theme('table', array('header' => array(), 'rows' => $rows, 'attributes' => array('class' => 'page-manager-handler-summary'))); $output .= '
'; return $output;