You are here

public function fieldable_panels_pane::build_operations in Fieldable Panels Panes (FPP) 7

Add some additional operations for handling entities.

Overrides ctools_export_ui::build_operations

File

plugins/export_ui/fieldable_panels_pane.class.php, line 16
Class for Export UI to manage Fieldable Panels Pane bundles.

Class

fieldable_panels_pane
Fieldable Panels Panes type Export UI plugin class.

Code

public function build_operations($item) {
  $base_path = ctools_export_ui_plugin_base_path($this->plugin);
  $name = $item->{$this->plugin['export']['key']};
  if (user_access('administer fieldable panels panes') || user_access('access fieldable panels panes master list')) {
    $operations['list'] = array(
      'title' => t('List'),
      'href' => $base_path . '/' . $name . '/list',
    );
  }
  if (user_access('administer fieldable panels panes') || user_access('create fieldable ' . $name)) {
    $operations['add_entity'] = array(
      'title' => t('Add Entity'),
      'href' => $base_path . '/' . $name . '/add',
    );
  }
  if (user_access('administer fieldable panels panes')) {
    $operations['edit_entity'] = array(
      'title' => t('Edit'),
      'href' => $base_path . '/' . $name . '/edit',
    );
    $operations['delete_entity'] = array(
      'title' => t('Delete'),
      'href' => $base_path . '/' . $name . '/delete',
    );
    $operations['export_entity'] = array(
      'title' => t('Export'),
      'href' => $base_path . '/' . $name . '/export',
    );
    if (module_exists('field_ui')) {
      $operations['field'] = array(
        'title' => t('Manage Fields'),
        'href' => $base_path . '/' . $name . '/fields',
      );
      $operations['display'] = array(
        'title' => t('Manage Display'),
        'href' => $base_path . '/' . $name . '/display',
      );
    }
  }
  return $operations;
}