Index: modules/og_panels/og_panels.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/og/modules/og_panels/og_panels.info,v retrieving revision 1.6 diff -u -p -r1.6 og_panels.info --- modules/og_panels/og_panels.info 3 Nov 2008 15:02:04 -0000 1.6 +++ modules/og_panels/og_panels.info 22 Mar 2009 23:21:51 -0000 @@ -1,9 +1,8 @@ ; $Id: og_panels.info,v 1.6 2008/11/03 15:02:04 weitzman Exp $ -name = Organic groups panels. NOT COMPATIBLE WITH DRUPAL 6 YET. +name = Organic groups panels. description = "Enable group admins to create panel pages." package = "Organic groups" dependencies[] = og dependencies[] = panels dependencies[] = panels_views -dependencies[] = drupal6 ponies -; core = 6.x \ No newline at end of file +core = 6.x Index: modules/og_panels/og_panels.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/og/modules/og_panels/og_panels.module,v retrieving revision 1.41 diff -u -p -r1.41 og_panels.module --- modules/og_panels/og_panels.module 31 Oct 2008 12:14:04 -0000 1.41 +++ modules/og_panels/og_panels.module 22 Mar 2009 23:21:51 -0000 @@ -1,144 +1,245 @@ og_panels settings page. You might want to make some Views available using admin/panels/views. Group admins may designate one page as their group home page.', array('!settings' => url('admin/og/og_panels'), '!apv' => url('admin/panels/views'))); - case (arg(0) == 'node' && arg(2) == 'og_panels' && !arg(3)): - return '

'. t('Create custom pages for your group. Use custom pages to organize your content in a pretty and informative manner. Your group can group to be a whole website within a web site. Each custom page becomes a tab when viewing your group. One of your custom pages should be designated as your group home page. That page will then display when visitors first arrive at your group.') .'

'. t('Start by clicking the Add new page tab. Then you will choose a custom layout for your page. Then you will want to edit content for your custom page.', array('!url' => url('node/'. arg(1). '/og_panels/form'))) .'

'; + case(arg(0) == 'node' && arg(2) == 'og_panels' && !arg(3)): + return '

'. t('Create custom pages for your group. Use custom pages to organize your content in a pretty and informative manner. Your group can group to be a whole website within a web site. Each custom page becomes a tab when viewing your group. One of your custom pages should be designated as your group home page. That page will then display when visitors first arrive at your group.') .'

'. t('Start by clicking the Add new page tab. Then you will choose a custom layout for your page. Then you will want to edit content for your custom page.', array('!url' => url('node/'. arg(1). '/og_panels/form'))) .'

'; } } -function og_panels_menu($may_cache) { - if ($may_cache) { - $items[] = array( - 'path' => 'admin/og/og_panels', - 'title' => 'Organic groups panels', - 'description' => 'Configure the content that is available to group admins when creating group pages.', - 'callback' => 'og_panels_admin_content', - 'access' => user_access('administer organic groups'), - ); +function og_panels_menu() { + $items['admin/og/og_panels'] = array( + 'title' => 'Organic groups panels', + 'description' => 'Configure the content that is available to group admins when creating group pages.', + 'page callback' => 'og_panels_admin_content', + 'access arguments' => array('administer organic groups'), + ); + $items['node/%node/og_panels'] = array( + 'title' => 'Pages', + 'page callback' => 'og_panels_overview', + 'page arguments' => array(1), + 'access callback' => 'og_panels_access_admin', + 'access arguments' => array(1), + 'type' => MENU_LOCAL_TASK, + 'weight' => 8, + ); + $items['node/%node/og_panels/list'] = array( + 'title' => 'List', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -10, + ); + $items['node/%node/og_panels/form'] = array( + 'page callback' => 'drupal_get_form', + 'page arguments' => array('og_panels_form', 1), + 'title callback' => 'og_panels_node_node_og_panels_form_title_callback', + 'title arguments' => array(4), + 'access callback' => 'og_panels_access_admin', + 'access arguments' => array(1), + 'type' => MENU_LOCAL_TASK, + 'weight' => 0, + ); + $items['node/%/og_panels/%/view'] = array( + 'page callback' => 'og_panels_page', + 'page arguments' => array(3, 1), + 'type' => MENU_CALLBACK, + ); + + $items['node/%node/og_panels/%/panel_layout'] = array( + 'page callback' => 'og_panels_edit_layout', + 'page arguments' => array(3, 1), + 'type' => MENU_CALLBACK, + 'access callback' => 'og_panels_access_admin', + 'access arguments' => array(1), + ); + + $items['node/%node/og_panels/%/panel_settings'] = array( + 'page callback' => 'og_panels_edit_layout_settings', + 'page arguments' => array(3, 1), + 'type' => MENU_CALLBACK, + 'access callback' => 'og_panels_access_admin', + 'access arguments' => array(1), + ); + + $items['node/%node/og_panels/%/panel_content'] = array( + 'page callback' => 'og_panels_edit_content', + 'page arguments' => array(3, 1), + 'type' => MENU_CALLBACK, + 'access callback' => 'og_panels_access_admin', + 'access arguments' => array(1), + ); + + $items['node/%node/og_panels/%/delete'] = array( + 'title' => 'Delete', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('og_panels_delete_confirm', 3, 1), + 'type' => MENU_CALLBACK, + 'access callback' => 'og_panels_access_admin', + 'access arguments' => array(1), + ); + // Add specific callbacks for og_paneling nodes + $items = array_merge($items, _og_panels_nodes_menu()); + return $items; +} + +/** + * Implementation of hook_menu_alter() + * + * This replaces old "hijack" functionlaity for node/view on og_panel nodes + */ +function og_panels_menu_alter(&$callbacks) { + + $callbacks['node/%node'] = array( + 'title callback' => 'node_page_title', + 'title arguments' => array(1), + 'page callback' => 'og_panels_node_page_view', + 'page arguments' => array(1, $callbacks['node/%node']['page callback'], $callbacks['node/%node']['page arguments']), + 'access callback' => 'node_access', + 'access arguments' => array('view', 1), + 'type' => MENU_CALLBACK, + ); + $callbacks['node/%node/view'] = array( + 'title callback' => 'og_panels_main_tab_title', + 'title arguments' => array(1), + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -10, + ); +} + +function og_panels_node_node_og_panels_form_title_callback($item = NULL) { + if ($item) { + return t('Edit page'); } else { - if (arg(0) == 'node' && is_numeric(arg(1))) { - $node = node_load(arg(1)); - if (og_is_group_type($node->type) && node_access('view', $node)) { - $nid = arg(1); - $items[] = array( - 'path' => "node/$nid/og_panels", - 'title' => 'Pages', - 'callback' => 'og_panels_overview', - 'callback arguments' => array($node), - 'access' => og_is_group_admin($node) && user_access('manage OG panels pages'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 8, - ); - - $items[] = array( - 'path' => "node/$nid/og_panels/list", - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ); - - $items[] = array( - 'path' => "node/$nid/og_panels/form", - 'callback' => 'drupal_get_form', - 'callback arguments' => array('og_panels_form', $node), - 'title' => arg(4) ? 'Edit page' : 'Add new page', - 'type' => MENU_LOCAL_TASK, - 'weight' => 0, - ); - - $displays = og_panels_get_all($node->nid); - foreach ($displays as $display) { - if ($display->default_page && $display->published && arg(2) != 'feed') { - // Hijack the menu handler for this node. - $items[] = array( - 'path' => "node/$nid", - 'title' => $node->title, // doesn't work - 'callback' => 'og_panels_page', - 'callback arguments' => array($display->did, $node, $node->title), - ); - - /* - * Optional. Horrible hack since the tab title is not changeable in D5. Add the following code - * to your theme's template.php in the _phptemplate_variables('page') section. - * if (isset($GLOBALS['og_panels_view_tab_fix'])) { - * $variables['tabs'] = str_replace('>View<', '>'. $GLOBALS['og_panels_view_tab_fix']. '<', $variables['tabs']); - * } - */ - $GLOBALS['og_panels_view_tab_fix'] = check_plain($display->page_title); - } - else { - $items[] = array( - 'path' => "node/$nid/$display->path", - 'title' => $display->page_title, - 'callback' => 'og_panels_page', - // have to pass all these args so the args are known in panels_page() - 'callback arguments' => array($display->did, $node, $display->page_title), - 'type' => MENU_LOCAL_TASK, - 'access' => $display->published || (og_is_group_admin($node) && user_access('manage OG panels pages')), - 'weight' => $display->weight, - ); - } - } - - $items[] = array( - 'path' => "node/$nid/og_panels/". arg(3). '/view', - 'callback' => 'og_panels_page', - 'callback arguments' => array(arg(3), $node), - 'type' => MENU_CALLBACK, - ); - - if (is_numeric(arg(3))) { - $items[] = array( - 'path' => "node/$nid/og_panels/". arg(3). '/panel_layout', - 'callback' => 'og_panels_edit_layout', - 'callback arguments' => array(arg(3), $node), - 'type' => MENU_CALLBACK, - ); - - $items[] = array( - 'path' => "node/$nid/og_panels/". arg(3). '/panel_settings', - 'callback' => 'og_panels_edit_layout_settings', - 'callback arguments' => array(arg(3), $node), - 'type' => MENU_CALLBACK, - ); - - $items[] = array( - 'path' => "node/$nid/og_panels/". arg(3). '/panel_content', - 'callback' => 'og_panels_edit_content', - 'callback arguments' => array(arg(3), $node), - 'type' => MENU_CALLBACK, - ); - - $items[] = array( - 'path' => "node/$nid/og_panels/". arg(3). '/delete', - 'title' => 'Delete', - 'callback' => 'drupal_get_form', - 'callback arguments' => array('og_panels_delete_confirm', arg(3), $node), - 'type' => MENU_CALLBACK, - ); - } + return t('Add new page'); + } +} + +/** + * Override default node_page functionality if we're in an og_panels situation + */ +function og_panels_node_page_view($node, $callback = 'node_page_view', $map = array(), $path = NULL) { + if (og_is_group_type($node->type)) { + $displays = og_panels_get_all($node->nid); + foreach ($displays as $display) { + // match a default display and a plain node url + if (($display->default_page && $display->published && $path == NULL) || $display->path == $path) { + return og_panels_page($display->did, $node, $node->title); } } } + // We didn't get anywhere, oh dear! + foreach ($map as $key => $value) { + if ($value === 1) { + $map[$key] = $node; + } + } + + // Load the appropriate delegator files + ctools_include('plugins'); + ctools_get_plugins('delegator', 'tasks'); + if (function_exists($callback)) { + return call_user_func_array($callback, $map); + } + else { + drupal_not_found(); + } + return node_page_view($node); +} + + + +/** + * Custom callback to return specific menu items for OGs that have og_panels. + * + * This is a compromise to allow for panels module itself to own node/% as + * the more-specific node/1 will win out over node/% + * + * If you are interested in taking og_panels to scale, you should investigate + * implementing hook_menu_alter as was originally concieved in this patch: + * + * http://drupal.org/node/307980#comment-1049754 + */ +function _og_panels_nodes_menu() { + $items = array(); + $result = db_query("SELECT did, nid, path, page_title FROM {og_panels} WHERE published = 1 AND (default_page IS NULL OR default_page = 0)"); + while ($display = db_fetch_object($result)) { + $items['node/'. $display->nid . '/' . $display->path] = array( + 'title' => $display->page_title, + 'page callback' => 'og_panels_page', + 'page arguments' => array($display->did, 1, $display->page_title), + 'access callback' => '_og_panels_node_access', + 'access arguments' => array('view', (string)$display->nid), + 'type' => MENU_LOCAL_TASK, + 'tab_parent' => 'node/%', + 'tab_root' => 'node/%', + ); + } return $items; } +function _og_panels_node_access($op, $nid) { + return node_access($op, node_load($nid)); +} + +function _og_panels_node_page_title($nid) { + return node_page_title(node_load($nid)); +} +/** + * Implementation of hook_menu_alter(). + * + * Fix the "view" tab on og_panels to be the primary panel name. + */ +/*function og_panels_menu_alter(&$callbacks) { + $callbacks['node/%node/view'] = array( + 'title callback' => 'og_panels_main_tab_title', + 'title arguments' => array(1), + ); +}*/ + + +/** + * Override default "view" tab if we're in a og_panels situation + */ +function og_panels_main_tab_title($node) { + $displays = og_panels_get_all($node->nid); + foreach ($displays as $display) { + if ($display->default_page) { + return check_plain($display->page_title); + } + } + return t('View'); +} + function og_panels_perm() { return array('manage OG panels pages'); } -function og_panels_delete_confirm($did, $group_node) { +/** + * Manu access functions for checking multiple variables + */ +function og_panels_access_admin($node) { + if (og_is_group_admin($node) && user_access('manage OG panels pages')) { + return TRUE; + } +} + +function og_panels_access_view($node, $display) { + // show admins unpublished displays + if ($display->published || (og_is_group_admin($node) && user_access('manage OG panels pages'))) { + return TRUE; + } +} + +function og_panels_delete_confirm(&$form_state, $did, $group_node) { $form['did'] = array('#type' => 'value', '#value' => $did); $form['nid'] = array('#type' => 'value', '#value' => $group_node->nid); $sql = "SELECT page_title FROM {og_panels} WHERE did = %d"; $page_title = db_result(db_query($sql, $did)); $form['page_title'] = array('#type' => 'value', '#value' => $page_title); - + return confirm_form($form, t('Are you sure you want to delete %title?', array('%title' => $page_title)), isset($_GET['destination']) ? $_GET['destination'] : 'node/'. $node->nid. 'og_panels', @@ -148,8 +249,8 @@ function og_panels_delete_confirm($did, } function og_panels_delete_confirm_submit($form_id, $form_values) { - og_panels_delete($form_values['did']); - drupal_set_message(t('%title has been deleted', array('%title' => $form_values['page_title']))); + og_panels_delete($form_values['values']['did']); + drupal_set_message(t('%title has been deleted', array('%title' => $form_values['values']['page_title']))); } function og_panels_delete($did) { @@ -160,7 +261,7 @@ function og_panels_delete($did) { /** * Menu callback. List the pages for this specified group. Provide helpful operations links. - * + * * @return string **/ function og_panels_overview($group_node) { @@ -172,12 +273,14 @@ function og_panels_overview($group_node) /** * A form for setting the group homepage. Includes a helpful table of Pages and their operations links. - * + * * @return $form array **/ -function og_panels_table($displays, $group_node) { +function og_panels_table(&$form_state, $displays, $group_node) { $nid = $group_node->nid; $form['#tree'] = TRUE; // #tree must be true in order to separate out the entries in the weight field + $options = array(); + $default_page = NULL; foreach ($displays as $display) { $item['page_title'] = array('#value' => l($display->page_title, "node/$nid/$display->path")); $item['weight'] = array('#type' => 'weight', '#default_value' => $display->weight); @@ -186,9 +289,9 @@ function og_panels_table($displays, $gro $item['edit layout settings'] = array('#value' => l(t('Edit layout settings'), "node/$nid/og_panels/$display->did/panel_settings")); $item['edit page'] = array('#value' => l(t('Edit page'), "node/$nid/og_panels/form/$display->did", array('query' => drupal_get_destination()))); $item['delete page'] = array('#value' => l(t('Delete page'), "node/$nid/og_panels/$display->did/delete", array('query' => drupal_get_destination()))); - + $form['displays'][$display->did] = $item; - + // Store the default_page for later. if ($display->default_page == 1) { $default_page = $display->did; @@ -196,14 +299,14 @@ function og_panels_table($displays, $gro // Prepare the options for the radios. $options[$display->did] = ''; } - + $form['default_page'] = array( - '#type' => 'radios', - '#options' => $options, + '#type' => 'radios', + '#options' => $options, '#default_value' => $default_page, ); $form['submit'] = array( - '#type' => 'submit', + '#type' => 'submit', '#value' => t('Save settings'), ); @@ -212,10 +315,23 @@ function og_panels_table($displays, $gro } /** + * Implementation of hook_theme() + * + * For the table theme on the form + */ +function og_panels_theme($existing, $type, $theme, $path) { + return array( + 'og_panels_table' => array( + 'arguments' => array('form' => NULL), + ), + ); +} + +/** * Wrangle the $form into a tabular listing of pages. * * @ingroup Themeable functions - * + * * @return void **/ function theme_og_panels_table($form) { @@ -223,38 +339,41 @@ function theme_og_panels_table($form) { if (is_numeric($did)) { $rows[] = array( drupal_render($form['default_page'][$did]), - drupal_render($form['displays'][$did]['page_title']), + drupal_render($form['displays'][$did]['page_title']), drupal_render($form['displays'][$did]['weight']), drupal_render($form['displays'][$did]['edit content']), - drupal_render($form['displays'][$did]['change layout']), - drupal_render($form['displays'][$did]['edit layout settings']), + drupal_render($form['displays'][$did]['change layout']), + drupal_render($form['displays'][$did]['edit layout settings']), drupal_render($form['displays'][$did]['edit page']), drupal_render($form['displays'][$did]['delete page']), ); } } - + $output = drupal_render($form); $header = array(t('Home page'), t('Title'), t('Weight'), array('align' => 'center', 'colspan' => 5, 'data' => t('Operations'))); return theme('table', $header, $rows). $output; } -function og_panels_table_submit($form_id, $form_values) { - db_query("UPDATE {og_panels} SET default_page = 0 WHERE nid = %d", $form_values['group_node']->nid); - foreach ($form_values['displays'] as $did => $settings) { - $default = $did == $form_values['default_page'] ? TRUE : FALSE; +function og_panels_table_submit($form, &$form_state) { + db_query("UPDATE {og_panels} SET default_page = 0 WHERE nid = %d", $form_state['values']['group_node']->nid); + foreach ($form_state['values']['displays'] as $did => $settings) { + $default = $did == $form_state['values']['default_page'] ? TRUE : FALSE; $sql = "UPDATE {og_panels} SET weight = %d, default_page = %d WHERE did = %d"; db_query($sql, $settings['weight'], $default, $did); } + // rebuild the menus: + menu_rebuild(); drupal_set_message(t('Updated panels configuration.')); } /** - * A menu callback. Renders an og_panel based upon its display ID. - * + * A menu callback. Renders an og_panel based upon the nid and current path (if any) + * * @return void **/ -function og_panels_page($did, $group_node, $title = NULL) { +function og_panels_page($did, $group_node, $title) { + $og_panel = og_panels_get_one_by_display($did); // Set breadcrumb and title on non group nodes if ($title) { @@ -270,8 +389,8 @@ function og_panels_page($did, $group_nod // Mark node as read and show feed icon for any group panel page (how to do this better?) drupal_add_feed(url("node/$group_node->nid/feed"), t('@name at @site', array('@name' => $group_node->title, '@site' => variable_get('site_name', 'drupal')))); node_tag_new($group_node->nid); - - + + $allargs = func_get_args(); $args = array_slice($allargs, 3); $display = og_panels_load_display($did, $group_node); @@ -283,10 +402,10 @@ function og_panels_page($did, $group_nod /** * Add/edit an og_panel. - * + * * @return void **/ -function og_panels_form($group_node, $did = NULL) { +function og_panels_form(&$form_state, $group_node, $did = NULL) { drupal_set_title(check_plain($group_node->title)); if (!is_null($did)) { $display = og_panels_get_one_by_display($did); @@ -294,7 +413,7 @@ function og_panels_form($group_node, $di else { $display = new stdClass; } - + $form['page_title'] = array( '#title' => t('Page title'), '#type' => 'textfield', @@ -333,9 +452,9 @@ function og_panels_form($group_node, $di '#default_value' => $display->published, '#description' => t('If unchecked, this page is only accessible by group or site administrators. Thats useful while you are configuring the page.'), ); - + $form['submit'] = array( - '#type' => 'submit', + '#type' => 'submit', '#value' => $did ? t('Update page') : t('Create page'), ); $form['did'] = array('#type' => 'value', '#value' => $did); @@ -350,7 +469,7 @@ function og_panels_form($group_node, $di * @return array $rows * An associative array keyed by the $did of the og_panel */ -function og_panels_get_all($nid) { +function og_panels_get_all($nid) { $sql = "SELECT * FROM {og_panels} WHERE nid = %d ORDER BY default_page DESC, weight ASC"; $result = db_query($sql, $nid); while ($row = db_fetch_object($result)) { @@ -390,24 +509,25 @@ function og_panels_get_one_by_nid_defaul /** * Load an og_panel's display information. - * - * Loads a panels display object with various parameters, depending on the information passed into the load function. - * + * + * Loads a panels display object with various parameters, depending on the information passed into the load function. + * * @param int $did * The did of the panels display. * @param object $group_node = NULL * The node object for the group to which the panel is attached. * @param bool $ct = FALSE - * If TRUE, content_types are also loaded into the $display object - * + * If TRUE, content_types are also loaded into the $display object + * * @return mixed * Either returns a display object, or FALSE if no display was found with the parameters provided. */ function og_panels_load_display($did, $group_node = NULL, $ct = FALSE) { panels_load_include('plugins'); + ctools_include('context'); $display = panels_load_display($did); if (is_object($group_node)) { - $display->context = array('og_panels' => panels_context_create('group', $group_node)); + $display->context = array('og_panels' => ctools_context_create('node', $group_node)); if ($ct) { panels_load_include('common'); $display->content_types = panels_common_get_allowed_types('og_panels', $display->context); @@ -416,28 +536,28 @@ function og_panels_load_display($did, $g return is_object($display) ? $display : FALSE; } -function og_panels_form_validate($form_id, $form_values, $form) { +function og_panels_form_validate($form, &$form_state) { $pathblacklist = array('view', 'edit', 'delete', 'outline', 'load', 'render', 'clone'); - if (in_array($form_values['path'], $pathblacklist)) { - form_error($form['path'], t('%path is a reserved system path, and cannot be used for a group page. Please enter another path.', array('%path' => $form_values['path']))); + if (in_array($form_state['values']['path'], $pathblacklist)) { + form_error($form['path'], t('%path is a reserved system path, and cannot be used for a group page. Please enter another path.', array('%path' => $form_state['values']['path']))); } - else if (preg_match("/[^A-Za-z0-9-]/", $form_values['path'])) { + else if (preg_match("/[^A-Za-z0-9-]/", $form_state['values']['path'])) { form_error($form['path'], t('Panel paths may only contain alphanumeric characters and dashes.')); } - else if (db_result(db_query("SELECT path FROM {og_panels} WHERE path = '%s' AND did <> %d AND nid = %d", $form_values['path'], $form_values['did'], $form_values['nid']))) { + else if (db_result(db_query("SELECT path FROM {og_panels} WHERE path = '%s' AND did <> %d AND nid = %d", $form_state['values']['path'], $form_state['values']['did'], $form_state['values']['nid']))) { form_error($form['path'], t("That path is currently in use by another one of your group's pages. Please enter another path.")); } } /** * INSERT or UPDATE a new og_panel. If insert, redirect to layout form. - * + * * @return void **/ -function og_panels_form_submit($form_id, $form_values) { - if ($form_values['did']) { +function og_panels_form_submit($form, &$form_state) { + if ($form_state['values']['did']) { $sql = "UPDATE {og_panels} SET page_title='%s', path='%s', published=%d, show_blocks=%d WHERE did = %d"; - db_query($sql, $form_values['page_title'], $form_values['path'], $form_values['published'], $form_values['show_blocks'], $form_values['did']); + db_query($sql, $form_state['values']['page_title'], $form_state['values']['path'], $form_state['values']['published'], $form_state['values']['show_blocks'], $form_state['values']['did']); drupal_set_message(t('Group page updated.')); } else { @@ -445,9 +565,9 @@ function og_panels_form_submit($form_id, $display = panels_new_display(); panels_save_display($display); $sql = "INSERT INTO {og_panels} (did, nid, page_title, path, published, show_blocks) VALUES (%d, %d, '%s', '%s', %d, %d)"; - db_query($sql, $display->did, $form_values['nid'], $form_values['page_title'], $form_values['path'], $form_values['published'], $form_values['show_blocks']); + db_query($sql, $display->did, $form_state['values']['nid'], $form_state['values']['page_title'], $form_state['values']['path'], $form_state['values']['published'], $form_state['values']['show_blocks']); drupal_set_message(t('Group page created.')); - return 'node/'. $form_values['nid']. "/og_panels/$display->did/panel_layout"; + $form_state['redirect'] = 'node/'. $form_state['values']['nid']. "/og_panels/$display->did/panel_layout"; } } @@ -481,10 +601,10 @@ function og_panels_nodeapi($node, $op) { /** * Pass through to the panels layout editor. - * + * * @param int $did - * the $did of the og_panel to be edited. - * + * the $did of the og_panel to be edited. + * * @param object $group_node * the node object to which the og_panel is attached. */ @@ -496,10 +616,10 @@ function og_panels_edit_layout($did, $gr /** * Pass through to the panels layout settings editor. - * + * * @param int $did - * the $did of the og_panel to be edited. - * + * the $did of the og_panel to be edited. + * * @param object $group_node * the node object to which the og_panel is attached. */ @@ -511,10 +631,10 @@ function og_panels_edit_layout_settings( /** * Pass through to the panels content editor. - * + * * @param int $did - * the $did of the og_panel to be edited. - * + * the $did of the og_panel to be edited. + * * @param object $group_node * the node object to which the og_panel is attached. */ @@ -534,10 +654,10 @@ function og_panels_admin_content() { /** * Implementation of hook_panels_contexts() - * + * */ function og_panels_panels_contexts() { - include_once './'. drupal_get_path('module', 'og_panels') .'/includes/groupcontext.inc'; + include_once './'. drupal_get_path('module', 'og') .'/includes/og.panelscontext.inc'; $args['group'] = array( 'title' => t('Group'), 'description' => t('A node object that is flagged as an OG group type.'), @@ -554,7 +674,7 @@ function og_panels_panels_contexts() { * Implementation of hook_panels_content_types() */ function og_panels_panels_content_types() { - include_once './'. drupal_get_path('module', 'og_panels') .'/includes/groupcontent.inc'; + include_once './'. drupal_get_path('module', 'og') .'/includes/og.panelscontent.inc'; $items['og_mission'] = array( 'title' => t('OG mission'), 'content_types' => 'og_panels_ct_list_mission', @@ -574,7 +694,7 @@ function og_panels_panels_content_types( 'render callback' => 'og_panels_ct_render_callback_description', 'title callback' => 'og_panels_ct_title_callback_description', ); - + $items['og_subscribers'] = array( 'title' => t('OG members'), 'content_types' => 'og_panels_ct_list_subscribers', @@ -586,7 +706,7 @@ function og_panels_panels_content_types( 'add validate callback' => 'og_panels_content_types_validate_callback_subscribers', 'edit validate callback' => 'og_panels_content_types_validate_callback_subscribers', ); - + if (module_exists('search')) { $items['og_search'] = array( 'title' => t('Group search'), @@ -596,7 +716,7 @@ function og_panels_panels_content_types( 'title callback' => 'og_panels_ct_title_callback_search', ); } - + if (og_is_picture()) { $items['og_faces'] = array( 'title' => t('OG faces'), @@ -609,8 +729,8 @@ function og_panels_panels_content_types( 'add validate callback' => 'og_panels_content_types_validate_callback_faces', 'edit validate callback' => 'og_panels_content_types_validate_callback_faces', ); - - } + + } return $items; } @@ -641,9 +761,9 @@ function og_panels_block_info($module, $ $info['category'] = t('Organic groups'); break; } - + // These blocks do not need group context. if ($delta == 3 || $delta == 6) { unset($info['required context']); } -} \ No newline at end of file +}