Projet

Général

Profil

Paste
Télécharger (1,67 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / panelizer / docs.php @ 87dbc3bf

1
<?php
2
/**
3
 * @file
4
 *
5
 * Documentation for panelizer hooks.
6
 */
7

    
8
/**
9
 * Add operations to Panelizer objects.
10
 *
11
 * Operations can be performed on panelizer defaults as well as entities.
12
 * Panelizer provides the 4 default operations, but modules can add
13
 * additional operations to add additional functionality.
14
 *
15
 * Data can be stored in $panelizer->extra which is a serialized array.
16
 * Modules should be sure to namespace their keys in this extra to avoid
17
 * collisions.
18
 *
19
 * Each operation supports the following keys:
20
 * - 'menu title': The title to use in menu tab entries. This will be
21
 *   translated by the menu system, so do not t() it.
22
 * - 'link title': The title to use in links. This will not be translated by
23
 *   the menu system, so t() it. In Drupal, the link title is typically in
24
 *   lower case when the tab would be in upper case, so this will not quite
25
 *   match the menu title.
26
 * - 'entity callback': If not using the normal operation hook on the object,
27
 *   put this may be a function callback. It will receive the following args:
28
 *   $handler, $js, $input, $entity, $view_mode.
29
 * - 'admin callback': The callback to use when editing a panelizer default.
30
 *   It will receive the following arguments: $handler, $bundle, $name,
31
 *   $view_mode.
32
 * - 'file path': A 'file path' entry to be used for hook_menu entries.
33
 * - 'file': A 'file' entry to be used for hook_menu entries.
34
 */
35
function hook_panelizer_operations_alter(&$operations) {
36
  $operations['example'] = array(
37
    'menu title' => 'Example',
38
    'link title' => t('example'),
39
    'entity callback' => 'mymodule_panelizer_example_entity_page',
40
    'admin callback' => 'mymodule_panelizer_example_admin_page',
41
  );
42
}