diff --git a/README.txt b/README.txt index e1b52dc..93ed654 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ -Fieldable Panel Panes support multiple bundles, but at this time there is no -UI to create bundles. +Fieldable Panel Panes support multiple bundles; they can be +created in admin/structure/fieldable-panels-panes/add. -Bundles can be created in a module via hook_entity_info_alter(). The code +Bundles can also be created in a module via hook_entity_info_alter(). The code will look something like this: function MYMODULE_entity_info_alter(&$entity_info) { @@ -11,7 +11,7 @@ function MYMODULE_entity_info_alter(&$entity_info) { 'pane top level' => FALSE, // set to true to make this show as a top level icon 'pane icon' => '/path/to/custom/icon/for/this/pane.png', 'admin' => array( - 'path' => 'admin/structure/fieldable-panels-panes/manage/%fieldable_panels_panes_type', + 'path' => 'admin/structure/fieldable-panels-panes/manage/%fieldable_panels_pane_type', 'bundle argument' => 4, // Note that this has all _ replaced with - from the bundle name. 'real path' => 'admin/structure/fieldable-panels-panes/manage/my-bundle-name', @@ -25,4 +25,6 @@ Display Fields tabs in the UI. You can use this hook to rename or remove the default bundle but remember that doing so will break any content currently using that bundle. If you do this -be sure to also fix any content already using it. +be sure to also fix any content already using it. It is recommended that you +use the bundle management UI in admin/structure/fiedlable-panels-panes so you +don't have to maintain this yourself. diff --git a/fieldable_panels_panes.info b/fieldable_panels_panes.info index 6304ac4..77126ca 100644 --- a/fieldable_panels_panes.info +++ b/fieldable_panels_panes.info @@ -5,6 +5,8 @@ core = "7.x" dependencies[] = "panels" dependencies[] = "views" +configure = admin/structure/fieldable-panels-panes + files[] = includes/PanelsPaneController.class.php files[] = includes/translation.handler.fieldable_panels_pane.inc files[] = plugins/views/fieldable_panels_panes_handler_argument_bundle.inc diff --git a/fieldable_panels_panes.install b/fieldable_panels_panes.install index f17d3fe..4a58e33 100644 --- a/fieldable_panels_panes.install +++ b/fieldable_panels_panes.install @@ -5,6 +5,111 @@ */ /** + * Implements hook_requirements(). + */ +function fieldable_panels_panes_requirements($phase) { + $requirements = array(); + + if ($phase == 'runtime') { + ctools_include('export'); + + $hook = 'entity_info_alter'; + $items = ctools_export_crud_load_all('fieldable_panels_pane_type'); + + // Check each module that implements 'entity_info_alter' to see if they + // provide a bundle for Fieldable Panels Panes. + foreach (module_implements($hook) as $module) { + $info = array(); + $function = $module . '_' . $hook; + + $function($info); + + if (isset($info['fieldable_panels_pane']['bundles']) && is_array($info['fieldable_panels_pane']['bundles'])) { + + // For each bundle provided, we track some meta-information to provide decent reporting. + foreach ($info['fieldable_panels_pane']['bundles'] as $bundle_name => $bundle_info) { + $offenders[] = array( + 'module' => $module, + 'bundle label' => $bundle_info['label'], + 'duplicate' => isset($items[$bundle_name]), + 'obsolete path' => strpos($bundle_info['admin']['path'], 'admin/structure/panels/entity/manage') !== FALSE, + 'function' => $function, + ); + } + } + } + + if (!empty($offenders)) { + $items = array(); + foreach ($offenders as $offender) { + $string = array(); + $replacements = array( + '%module' => $offender['module'], + '%bundle' => $offender['bundle label'], + '%function' => $offender['function'] . '()', + '!add_page' => l(t('Add type page'), 'admin/structure/panels/fieldable-panels-panes/add'), + ); + $string[] = t('The module %module provides the bundle %bundle in %function.', $replacements); + + // If bundle admin paths are set in the wrong position, invalid tabs can + // render in the wrong position and cause all kinds of confusion. + if ($offender['obsolete path']) { + $string[] = t('%module also provided bundles with obsolete admin paths, however, automatically correction has been attempted by Fieldable Panels Panes.', $replacements); + } + + // The upgrade path will handle migrating code-provided bundles into the + // database. There is no harm in having them both the alter hook and in + // the database, we're just notifying that the former doesn't need to exist + // anymore. + if ($offender['duplicate']) { + $string[] = t('It should now be safe to remove the bundle from %function.', $replacements); + } + else { + // Otherwise, if a bundle is provided in an alter hook AFTER the + // upgrade process, we recommend creating a type for it in the UI so + // that the module can handle the necessary processing and logic. + $string[] = t('It is recommended that a type be created for %bundle in the !add_page so the Fieldable Panels Panes module can manage all the necessary processing.', $replacements); + } + + $items[] = implode(' ', $string); + } + + $requirements['fieldable_panels_panes'] = array( + 'title' => t('Fieldable Panels Panes'), + 'severity' => REQUIREMENT_WARNING, + 'value' => theme('item_list', array('items' => $items)), + 'description' => t('It is still possible to provide bundles in entity_info_alter(), however, it has limited support. Upgrading from a previous version of Fieldable Panels Panes would have updated those bundles to be managed by the bundle user interface (meaning the bundles in entity_info_alter() can safely be removed.) There is, however, no harm in having both exists.'), + ); + } + } + + return $requirements; +} + +/** + * Implements hook_install(). + */ +function fieldable_panels_panes_install() { + ctools_include('export'); + + $item = ctools_export_crud_new('fieldable_panels_pane_type'); + $item->name = 'fieldable_panels_pane'; + $item->title = t('Panels Pane'); + ctools_export_crud_save('fieldable_panels_pane_type', $item); +} + + +/** + * Implements hook_uninstall(). + */ +function fieldable_panels_panes_uninstall() { + $results = db_query('SELECT name FROM {fieldable_panels_pane_type}'); + foreach ($results as $type) { + field_attach_delete_bundle('fieldable_panels_pane', $type->name); + } +} + +/** * Implements hook_schema(). */ function fieldable_panels_panes_schema() { @@ -162,6 +267,45 @@ function fieldable_panels_panes_schema() { ), ); + $schema['fieldable_panels_pane_type'] = array( + 'description' => 'Entity bundle table for panel pane content.', + 'fields' => array( + 'name' => array( + 'description' => 'The machine-readable name of this type.', + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + 'default' => '', + ), + 'title' => array( + 'description' => 'The human-readable name of this type.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'translatable' => TRUE, + ), + 'description' => array( + 'description' => 'A brief description of this type.', + 'type' => 'text', + 'size' => 'big', + 'not null' => TRUE, + ), + ), + 'export' => array( + 'admin_title' => 'title', + 'admin_description' => 'description', + 'api' => array( + 'owner' => 'fieldable_panels_panes', + 'api' => 'fieldable_panels_pane_type', + 'minimum_version' => 1, + 'current_version' => 1, + ), + ), + 'primary key' => array('name'), + ); + + // Optional cache table for entitycache support. $schema['cache_entity_fieldable_panels_pane'] = drupal_get_schema_unprocessed('system', 'cache'); $schema['cache_entity_fieldable_panels_pane']['description'] = 'Cache table used to store fieldable_panels_pane entity records.'; @@ -248,3 +392,230 @@ function fieldable_panels_panes_update_7107() { db_create_table('cache_entity_fieldable_panels_pane', $schema); } } + +/** + * Adding Fieldable Panels Panes Type table and saving existing bundles to + * database. + */ +function fieldable_panels_panes_update_7108(&$sandbox) { + ctools_include('export'); + $messages = array(); + + // Add the new table for storing bundles. + $schema = array(); + + $schema['fieldable_panels_panes'] = array( + 'description' => 'Entity table for panel pane content with fields.', + 'fields' => array( + 'fpid' => array( + 'description' => 'The primary identifier for the entity.', + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'vid' => array( + 'description' => 'The current version in use for this entity.', + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'bundle' => array( + 'description' => 'The bundle of the entity.', + 'type' => 'varchar', + 'length' => 255, + ), + 'title' => array( + 'description' => 'The title of the entity.', + 'type' => 'varchar', + 'length' => 255, + ), + 'link' => array( + 'description' => 'Whether or not this entity title will link to another page.', + 'type' => 'int', + 'size' => 'tiny', + ), + 'path' => array( + 'description' => 'The path the title should link to.', + 'type' => 'varchar', + 'length' => 255, + ), + 'reusable' => array( + 'description' => 'Whether or not this entity will appear in the Add Content dialog.', + 'type' => 'int', + 'size' => 'tiny', + ), + 'admin_title' => array( + 'description' => 'The title it will appear in the Add Content dialog as.', + 'type' => 'varchar', + 'length' => 255, + ), + 'admin_description' => array( + 'description' => 'The description it will appear in the Add Content dialog with.', + 'type' => 'text', + ), + 'category' => array( + 'description' => 'The category it will appear in the Add Content dialog under.', + 'type' => 'text', + ), + 'view_access' => array( + 'type' => 'text', + 'size' => 'big', + 'description' => 'Access rules to describe if the user has view access to this entity.', + 'serialize' => TRUE, + 'object default' => array(), + ), + 'edit_access' => array( + 'type' => 'text', + 'size' => 'big', + 'description' => 'Access rules to describe if the user has view access to this entity.', + 'serialize' => TRUE, + 'object default' => array(), + ), + 'created' => array( + 'description' => 'The Unix timestamp when the entity was created.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'changed' => array( + 'description' => 'The Unix timestamp when the entity was most recently saved.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'uuid' => array( + 'type' => 'char', + 'length' => 36, + 'default' => '', + 'description' => 'The Universally Unique Identifier.', + ), + 'language' => array( + 'description' => 'The {languages}.language of this entity.', + 'type' => 'varchar', + 'length' => 12, + 'not null' => TRUE, + 'default' => '', + ), + ), + 'primary key' => array('fpid'), + 'indexes' => array( + 'reusable' => array('reusable'), + ), + ); + + $schema['fieldable_panels_panes_revision'] = array( + 'description' => 'Entity revision table for panel pane content with fields.', + 'fields' => array( + 'fpid' => array( + 'description' => 'The id this revision belongs to', + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'vid' => array( + 'description' => 'The primary identifier for this version.', + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'timestamp' => array( + 'description' => 'The Unix timestamp when the revision was most recently saved.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'uid' => array( + 'description' => 'The author of the revision.', + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'title' => array( + 'description' => 'The title of the entity.', + 'type' => 'varchar', + 'length' => 255, + ), + 'log' => array( + 'description' => t('A log message associated with the revision.'), + 'type' => 'text', + 'size' => 'big', + ), + 'vuuid' => array( + 'type' => 'char', + 'length' => 36, + 'default' => '', + 'description' => 'The Universally Unique Identifier.', + ), + ), + 'primary key' => array('vid'), + 'indexes' => array( + 'fpid' => array('fpid', 'vid'), + ), + ); + + $schema['fieldable_panels_pane_type'] = array( + 'description' => 'Entity bundle table for panel pane content.', + 'fields' => array( + 'name' => array( + 'description' => 'The machine-readable name of this type.', + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + 'default' => '', + ), + 'title' => array( + 'description' => 'The human-readable name of this type.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'translatable' => TRUE, + ), + 'description' => array( + 'description' => 'A brief description of this type.', + 'type' => 'text', + 'size' => 'big', + 'not null' => TRUE, + ), + ), + 'export' => array( + 'admin_title' => 'title', + 'admin_description' => 'description', + 'api' => array( + 'owner' => 'fieldable_panels_panes', + 'api' => 'fieldable_panels_pane_type', + 'minimum_version' => 1, + 'current_version' => 1, + ), + ), + 'primary key' => array('name'), + ); + + + // Optional cache table for entitycache support. + $schema['cache_entity_fieldable_panels_pane'] = drupal_get_schema_unprocessed('system', 'cache'); + $schema['cache_entity_fieldable_panels_pane']['description'] = 'Cache table used to store fieldable_panels_pane entity records.'; + + db_create_table('fieldable_panels_pane_type', $schema); + + // Store possible existing bundles provided by other modules. + $bundles = array(); + $entity_info = entity_get_info('fieldable_panels_pane'); + foreach ($entity_info['bundles'] as $bundle_name => $bundle_info) { + $bundles[] = $bundle_info['label']; + + $item = ctools_export_crud_new('fieldable_panels_pane_type'); + $item->name = $bundle_name; + $item->title = $bundle_info['label']; + ctools_export_crud_save('fieldable_panels_pane_type', $item); + } + + if (!empty($bundles)) { + $messages[] = format_plural(count($bundles), 'Added existing bundle %bundle_names to database.', 'Added existing bundles %bundle_names to database.', array('%bundle_names' => implode(', ', $bundles))); + } + + return implode('
', $messages); +} diff --git a/fieldable_panels_panes.module b/fieldable_panels_panes.module index 6204b63..084cb7e 100644 --- a/fieldable_panels_panes.module +++ b/fieldable_panels_panes.module @@ -15,6 +15,21 @@ function fieldable_panels_panes_entity_info() { $info = array(); + ctools_include('export'); + $bundles = array(); + + foreach (ctools_export_crud_load_all('fieldable_panels_pane_type') as $type) { + $bundles[$type->name] = array( + 'label' => $type->title, + 'admin' => array( + 'path' => 'admin/structure/fieldable-panels-panes/%ctools_export_ui', + 'bundle argument' => 3, + 'real path' => 'admin/structure/fieldable-panels-panes/' . $type->name, + 'access arguments' => array('administer fieldable panels panes'), + ), + ); + } + $info['fieldable_panels_pane'] = array( 'label' => t('Fieldable panel pane'), 'controller class' => 'PanelsPaneController', @@ -31,20 +46,8 @@ function fieldable_panels_panes_entity_info() { 'uuid' => 'uuid', 'revision uuid' => 'vuuid', ), - 'bundles' => array( - // @todo We need to store the possible bundles and create a UI. - // to allow for more bundles. For now, hook_panels_panes_entity_info_alter - // will work. - 'fieldable_panels_pane' => array( - 'label' => t('Panels pane'), - 'admin' => array( - 'path' => 'admin/structure/fieldable-panels-panes/manage/%fieldable_panels_panes_type', - 'bundle argument' => 4, - 'real path' => 'admin/structure/fieldable-panels-panes/manage/fieldable-panels-pane', - 'access arguments' => array('administer fieldable panels panes'), - ), - ), - ), + 'bundles' => $bundles, + 'bundle keys' => array('bundle' => 'name'), 'view modes' => array( // @todo we should support view modes. 'full' => array( @@ -102,7 +105,40 @@ function fieldable_panels_panes_entity_info() { } /** - * Implements hook_fied_extra_fields(). + * Implements hook_module_implements_alter(). + */ +function fieldable_panels_panes_module_implements_alter(&$implementations, $hook) { + if ($hook == 'entity_info_alter') { + // Fieldable Panels Panes will do a bit of clean-up to prevent issues with + // obsolete paths found in legacy bundles that are provided by modules via + // hook_entity_info_alter(), but we need to make sure that our + // implementation is called last. + $group = $implementations['fieldable_panels_panes']; + unset($implementations['fieldable_panels_panes']); + $implementations['fieldable_panels_panes'] = $group; + } +} + +/** + * Implements hook_entity_info_alter(). + */ +function fieldable_panels_panes_entity_info_alter(&$info) { + $old_base_path = 'admin/structure/panels/entity/manage'; + $new_base_path = 'admin/structure/fieldable-panels-panes/manage'; + + if (is_array($info) && !empty($info)) { + foreach ($info['fieldable_panels_pane']['bundles'] as $name => &$bundle) { + if (strpos($bundle['admin']['path'], $old_base_path) !== FALSE) { + $bundle['admin']['path'] = str_replace($old_base_path, $new_base_path, $bundle['admin']['path']); + $bundle['admin']['real path'] = str_replace($old_base_path, $new_base_path, $bundle['admin']['real path']); + $bundle['admin']['bundle argument'] = $bundle['admin']['bundle argument'] - 1; + } + } + } +} + +/** + * Implements hook_field_extra_fields(). */ function fieldable_panels_panes_field_extra_fields() { $extra = array(); @@ -141,19 +177,7 @@ function fieldable_panels_panes_menu() { 'file' => 'includes/admin.inc', ); - - $items['admin/structure/fieldable-panels-panes'] = array( - 'title' => 'Fieldable Panels Panes', - 'description' => 'Manage pane content types.', - 'page callback' => 'fieldable_panels_panes_entities_page', - ) + $base; - - $items['admin/structure/fieldable-panels-panes/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ) + $base; - + // Legacy paths to support the old method of providing bundles via entity_hook_info(). $items['admin/structure/fieldable-panels-panes/view/%fieldable_panels_panes'] = array( 'title callback' => 'fieldable_panels_panes_entity_title', 'title arguments' => array(4), @@ -318,20 +342,20 @@ function fieldable_panels_panes_menu() { ); } - $items['admin/structure/fieldable-panels-panes/manage/%fieldable_panels_panes_type'] = array( + $items['admin/structure/fieldable-panels-panes/manage/%fieldable_panels_pane_type'] = array( 'title callback' => 'fieldable_panels_panes_entities_title', 'title arguments' => array(4), 'page callback' => 'fieldable_panels_panes_entities_list_page', 'page arguments' => array(4), ) + $base; - $items['admin/structure/fieldable-panels-panes/manage/%fieldable_panels_panes_type/list'] = array( + $items['admin/structure/fieldable-panels-panes/manage/%fieldable_panels_pane_type/list'] = array( 'title' => 'List', 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10, ); - $items['admin/structure/fieldable-panels-panes/manage/%fieldable_panels_panes_type/add'] = array( + $items['admin/structure/fieldable-panels-panes/manage/%fieldable_panels_pane_type/add'] = array( 'title' => 'Add fieldable panel pane', 'page callback' => 'fieldable_panels_panes_entities_add_page', 'page arguments' => array(4), @@ -391,10 +415,10 @@ function fieldable_panels_panes_theme() { function fieldable_panels_panes_admin_menu_map() { $map = array(); - $bundles = array(); + $bundle_keys = array(); $info = entity_get_info('fieldable_panels_pane'); foreach ($info['bundles'] as $bundle_name => $bundle_info) { - $bundles[] = strtr($bundle_name, '_', '-'); + $bundle_keys[] = $bundle_name; // Add mapping for the individual fields if the Field UI module is enabled. if (module_exists('field_ui')) { @@ -408,21 +432,20 @@ function fieldable_panels_panes_admin_menu_map() { $map["$admin_path/fields/%field_ui_menu"]['parent'] = "$admin_path/fields"; $map["$admin_path/fields/%field_ui_menu"]['arguments'][] = array( - '%fieldable_panels_panes_type' => array($bundle_name), + '%ctools_export_ui' => array($bundle_name), '%field_ui_menu' => $fields, ); } } } - $map['admin/structure/fieldable-panels-panes/manage/%fieldable_panels_panes_type'] = array( + $map['admin/structure/fieldable-panels-panes/%ctools_export_ui'] = array( 'parent' => 'admin/structure/fieldable-panels-panes', 'arguments' => array( - array('%fieldable_panels_panes_type' => $bundles), + array('%ctools_export_ui' => $bundle_keys), ), ); - return $map; } @@ -437,24 +460,23 @@ function fieldable_panels_panes_flush_caches() { * Implementation of hook_panels_dashboard_blocks(). */ function fieldable_panels_panes_panels_dashboard_blocks(&$vars) { + ctools_include('export'); + $vars['links']['fieldable_panels_panes'] = array( 'title' => l(t('Fieldable Panels Panes'), 'admin/structure/fieldable-panels-panes'), 'description' => t('Fieldable Panels Panes are fieldable entities that can be created directly in the Panels UI or created in a separate administrative UI to reuse later in a panel pane.'), ); - $entity_info = entity_get_info('fieldable_panels_pane'); $count = 0; $rows = array(); - foreach ($entity_info['bundles'] as $bundle => $info) { - $type_url_str = str_replace('_', '-', $bundle); - + foreach (ctools_export_crud_load_all('fieldable_panels_pane_type') as $type) { $rows[] = array( - check_plain($info['label']), - l(t('List'), 'admin/structure/fieldable-panels-panes/manage/' . $type_url_str), - l(t('Add'), 'admin/structure/fieldable-panels-panes/manage/' . $type_url_str . '/add'), - l(t('Manage Fields'), 'admin/structure/fieldable-panels-panes/manage/' . $type_url_str . '/fields'), - l(t('Manage Display'), 'admin/structure/fieldable-panels-panes/manage/' . $type_url_str . '/display'), + $type->title, + l(t('List'), 'admin/structure/fieldable-panels-panes/' . $type->name), + l(t('Add'), 'admin/structure/fieldable-panels-panes/' . $type->name . '/add'), + l(t('Manage Fields'), 'admin/structure/fieldable-panels-panes/' . $type->name . '/fields'), + l(t('Manage Display'), 'admin/structure/fieldable-panels-panes/' . $type->name . '/display'), ); // Only display 10. @@ -478,7 +500,6 @@ function fieldable_panels_panes_panels_dashboard_blocks(&$vars) { 'class' => 'dashboard-fieldable-panels-panes', 'section' => 'right', ); - } // ------------------------------------------------------------------------- @@ -487,7 +508,7 @@ function fieldable_panels_panes_panels_dashboard_blocks(&$vars) { /** * Properly format the type from the URL version to the internal version. */ -function fieldable_panels_panes_type_load($type) { +function fieldable_panels_pane_type_load($type) { $type = str_replace('-', '_', $type); $entity_info = entity_get_info('fieldable_panels_pane'); @@ -509,6 +530,16 @@ function fieldable_panels_panes_entities_title($type) { } /** + * Title callback for fieldable panels panes exportable items. + * + * @param $item + * A %ctools_export_ui object. + */ +function fieldable_panels_pane_type_title($item) { + return $item->title; +} + +/** * Ensure an entity can be accessed via URL. * * This requires only administrative access. @@ -554,6 +585,10 @@ function fieldable_panels_panes_entity_make_current_access($entity) { * Implements hook_ctools_plugin_directory() */ function fieldable_panels_panes_ctools_plugin_directory($owner, $plugin_type) { + if ($owner == 'ctools' && $plugin_type == 'export_ui') { + return 'plugins/' . $plugin_type; + } + if ($owner == 'ctools' && $plugin_type == 'content_types') { return 'plugins/' . $plugin_type; } diff --git a/includes/admin.inc b/includes/admin.inc index 9aaf400..d0e8911 100644 --- a/includes/admin.inc +++ b/includes/admin.inc @@ -6,62 +6,6 @@ */ /** - * List all bundles and administrative options for entity panes. - */ -function fieldable_panels_panes_entities_page() { - $entity_info = entity_get_info('fieldable_panels_pane'); - - $header = array(t('Name'), array('data' => t('Operations'), 'colspan' => 2)); - $rows = array(); - - foreach ($entity_info['bundles'] as $bundle => $info) { - $type_url_str = str_replace('_', '-', $bundle); - - $row = array(); - - $label = check_plain($info['label']); - $label .= ' ' . t('(Machine name: @type)', array('@type' => $bundle)) . ''; - - $row[] = $label; - - $operations = array(); - - $operations['list'] = array( - 'title' => t('list'), - 'href' => 'admin/structure/fieldable-panels-panes/manage/' . $type_url_str, - ); - - $operations['add'] = array( - 'title' => t('add'), - 'href' => 'admin/structure/fieldable-panels-panes/manage/' . $type_url_str . '/add', - ); - - $operations['fields'] = array( - 'title' => t('manage fields'), - 'href' => 'admin/structure/fieldable-panels-panes/manage/' . $type_url_str . '/fields', - ); - - $operations['display'] = array( - 'title' => t('manage display'), - 'href' => 'admin/structure/fieldable-panels-panes/manage/' . $type_url_str . '/display', - ); - - $ops = theme('links', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline')))); - - $row[] = $ops; - $rows[] = $row; - } - - $build['panes_table'] = array( - '#theme' => 'table', - '#header' => $header, - '#rows' => $rows, - ); - - return $build; -} - -/** * List all entities for the given type. */ function fieldable_panels_panes_entities_list_page($type) { diff --git a/plugins/entity/FieldablePanelsPaneEntity.class.php b/plugins/entity/FieldablePanelsPaneEntity.class.php index 404b3d9..c40a9e1 100644 --- a/plugins/entity/FieldablePanelsPaneEntity.class.php +++ b/plugins/entity/FieldablePanelsPaneEntity.class.php @@ -11,8 +11,8 @@ */ class FieldablePanelsPaneEntity extends PanelizerEntityDefault { // @todo this path is too deep to handle. -// public $entity_admin_root = 'admin/structure/fieldable-panels-panes/manage/%'; -// public $entity_admin_bundle = 5; +// public $entity_admin_root = 'admin/structure/fieldable-panels-panes/%'; +// public $entity_admin_bundle = 4; public $views_table = 'fieldable_panels_panes'; public function entity_access($op, $entity) {