コード例 #1
0
 /**
  * Overrides hook_menu() defaults.
  * https://www.drupal.org/node/1021576
  */
 public function hook_menu()
 {
     $items = parent::hook_menu();
     $items[$this->path]['description'] = 'Manage products, including fields.';
     // Menu item for operations like revert and delete.
     return $items;
 }
コード例 #2
0
 public function hook_menu()
 {
     $items = parent::hook_menu();
     // Add a tab to manage embedded entities
     // @todo Don't display this if there are no embedded entity types for this entity type
     $items[$this->path . '/embedded'] = array('title' => 'Manage embedded entity types', 'page callback' => 'mongo_entity_embedded_entity_types', 'page arguments' => array($this->entityType), 'access callback' => 'user_access', 'access arguments' => array('administer site configuration'), 'type' => MENU_LOCAL_TASK, 'weight' => 100);
     return $items;
 }
コード例 #3
0
 /**
  * Provides definitions for implementing hook_menu().
  */
 public function hook_menu()
 {
     $items = parent::hook_menu();
     // Set this on the object so classes that extend hook_menu() can use it.
     $id_count = count(explode('/', $this->path));
     $wildcard = isset($this->entityInfo['admin ui']['menu wildcard']) ? $this->entityInfo['admin ui']['menu wildcard'] : '%entity_object';
     $plural_label = isset($this->entityInfo['plural label']) ? $this->entityInfo['plural label'] : $this->entityInfo['label'] . 's';
     $entityType = $this->entityInfo['entity class'];
     // @todo: Allow modules to insert their own action links to the 'workflow',
     // $workflow_operations = module_invoke_all('workflow_operations', 'workflow', NULL);
     $item = array('file path' => isset($this->entityInfo['admin ui']['file path']) ? $this->entityInfo['admin ui']['file path'] : drupal_get_path('module', $this->entityInfo['module']), 'access arguments' => array('administer workflow'), 'type' => MENU_LOCAL_TASK);
     $items[$this->path . '/manage/' . $wildcard . '/states'] = $item + array('file' => 'workflow_admin_ui/workflow_admin_ui.page.states.inc', 'title' => 'States', 'weight' => '11', 'page callback' => 'drupal_get_form', 'page arguments' => array('workflow_admin_ui_states_form', $id_count + 1, $id_count + 2));
     $items[$this->path . '/manage/' . $wildcard . '/transitions'] = $item + array('file' => 'workflow_admin_ui/workflow_admin_ui.page.transitions.inc', 'title' => 'Transitions', 'weight' => '12', 'page callback' => 'drupal_get_form', 'page arguments' => array('workflow_admin_ui_transitions_form', $id_count + 1, $id_count + 2));
     $items[$this->path . '/manage/' . $wildcard . '/labels'] = $item + array('file' => 'workflow_admin_ui/workflow_admin_ui.page.labels.inc', 'title' => 'Labels', 'weight' => '13', 'page callback' => 'drupal_get_form', 'page arguments' => array('workflow_admin_ui_labels_form', $id_count + 1, $id_count + 2));
     $items[$this->path . '/manage/' . $wildcard . '/permissions'] = $item + array('file' => 'workflow_admin_ui/workflow_admin_ui.page.permissions.inc', 'title' => 'Permission summary', 'weight' => '14', 'page callback' => 'workflow_admin_ui_view_permissions_form', 'page arguments' => array($id_count + 1, $id_count + 2));
     return $items;
 }
コード例 #4
0
 /**
  * {@inheritdoc}
  */
 public function hook_menu()
 {
     $items = parent::hook_menu();
     // Add back in the admin overview form.
     $wildcard = isset($this->entityInfo['admin ui']['menu wildcard']) ? $this->entityInfo['admin ui']['menu wildcard'] : '%entity_object';
     $plural_label = isset($this->entityInfo['plural label']) ? $this->entityInfo['plural label'] : $this->entityInfo['label'] . 's';
     $items[$this->path] = array('title' => $plural_label, 'page callback' => 'drupal_get_form', 'page arguments' => array($this->entityType . '_overview_form', $this->entityType), 'description' => 'Manage ' . $plural_label . '.', 'access callback' => 'entity_access', 'access arguments' => array('view', $this->entityType), 'file' => 'includes/entity.ui.inc');
     // Override the "add" path.
     $items[$this->path . '/add'] = array('title callback' => 'entity_ui_get_page_title', 'title arguments' => array('add', $this->entityType), 'page callback' => 'entity_ui_get_form', 'page arguments' => array($this->entityType, NULL, 'add'), 'access callback' => 'entity_access', 'access arguments' => array('create', $this->entityType), 'type' => MENU_LOCAL_ACTION);
     // Advanced.
     $items[$this->path . '/advanced'] = array('title' => t('Advanced'), 'page callback' => 'drupal_get_form', 'page arguments' => array('git_clone_advanced_form'), 'access callback' => 'entity_access', 'access arguments' => array('update', $this->entityType), 'type' => MENU_LOCAL_TASK);
     if (!empty($this->entityInfo['admin ui']['file'])) {
         // Add in the include file for the entity form.
         foreach (array('/add', '/advanced') as $path_end) {
             $items[$this->path . $path_end]['file'] = $this->entityInfo['admin ui']['file'];
             $items[$this->path . $path_end]['file path'] = isset($this->entityInfo['admin ui']['file path']) ? $this->entityInfo['admin ui']['file path'] : drupal_get_path('module', $this->entityInfo['module']);
         }
     }
     return $items;
 }
コード例 #5
0
 /**
  * Overrides hook_menu() defaults.
  */
 public function hook_menu()
 {
     $items = parent::hook_menu();
     $items[$this->path]['description'] = 'Manage Custom Entity, including fields.';
     return $items;
 }
コード例 #6
0
 /**
  * Overrides hook_menu() defaults.
  */
 public function hook_menu()
 {
     $items = parent::hook_menu();
     $items[$this->path]['description'] = 'Manage Playlist types.';
     return $items;
 }