Projet

Général

Profil

Révision 7e72b748

Ajouté par Assos Assos il y a plus de 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ctools/ctools.api.php
17 17
 * Inform CTools about plugin types.
18 18
 *
19 19
 * @return array
20
 *  An array of plugin types, keyed by the type name.
21
 *  See the advanced help topic 'plugins-creating' for details of the array
22
 *  properties.
20
 *   An array of plugin types, keyed by the type name.
21
 *   See the advanced help topic 'plugins-creating' for details of the array
22
 *   properties.
23 23
 */
24 24
function hook_ctools_plugin_type() {
25 25
  $plugins['my_type'] = array(
......
65 65
 *   directory location is being requested.
66 66
 * @param string $plugin_type
67 67
 *   The name of the plugin type for which a base directory is being requested.
68
 *
68 69
 * @return string
69 70
 *   The path where CTools' plugin system should search for plugin files,
70 71
 *   relative to your module's root. Omit leading and trailing slashes.
......
94 95
    // Yes, this is exactly like Form 2 - just a different reasoning for it.
95 96
    return "plugins/$plugin_type";
96 97
  }
97
  // Finally, if nothing matches, it's safe to return nothing at all (or NULL).
98
  // Finally, if nothing matches, it's safe to return nothing at all (== NULL).
98 99
}
99 100

  
100 101
/**
......
155 156
 * allow to use it in the math expression api.
156 157
 *
157 158
 * @param $functions
158
 *    An array which has the functions as value.
159
 *   An array which has the functions as value.
159 160
 */
160 161
function hook_ctools_math_expression_functions_alter(&$functions) {
161 162
  // Allow to convert from degrees to radiant.
......
200 201
 */
201 202
function hook_ctools_content_subtype_alter($subtype, $plugin) {
202 203
  // Force a particular subtype of a particular plugin to render last.
203
  if ($plugin['module'] == 'some_plugin_module' && $plugin['name'] == 'some_plugin_name' && $subtype['subtype_id'] == 'my_subtype_id') {
204
  if ($plugin['module'] === 'some_plugin_module'
205
    && $plugin['name'] === 'some_plugin_name'
206
    && $subtype['subtype_id'] === 'my_subtype_id'
207
  ) {
204 208
    $subtype['render last'] = TRUE;
205 209
  }
206 210
}
......
228 232
  }
229 233
}
230 234

  
235
/**
236
 * Alter the conversion of context items by ctools context plugin convert()s.
237
 *
238
 * @param ctools_context $context
239
 *   The current context plugin object. If this implemented a 'convert'
240
 *   function, the value passed in has been processed by that function.
241
 * @param string $converter
242
 *   A string associated with the plugin type, identifying the operation.
243
 * @param string $value
244
 *   The value being converted; this is the only return from the function.
245
 * @param $converter_options
246
 *   Array of key-value pairs to pass to a converter function from higher
247
 *   levels.
248
 *
249
 * @see ctools_context_convert_context()
250
 */
251
function hook_ctools_context_converter_alter($context, $converter, &$value, $converter_options) {
252
  if ($converter === 'mystring') {
253
    $value = 'fixed';
254
  }
255
}
256

  
231 257
/**
232 258
 * Alter the definition of entity context plugins.
233 259
 *
......
266 292
  $settings['lower case'] = TRUE;
267 293
}
268 294

  
295
/**
296
 * Let other modules modify the context handler before it is rendered.
297
 *
298
 * @param object $handler
299
 *   A handler for a current task and subtask.
300
 * @param array $contexts
301
 *   An associative array of contexts.
302
 * @param array $args
303
 *   An array for current args.
304
 *
305
 * @see ctools_context_handler_pre_render()
306
 */
307
function ctools_context_handler_pre_render($handler, $contexts, $args) {
308
  $handler->conf['css_id'] = 'my-id';
309
}
310

  
269 311
/**
270 312
 * @} End of "addtogroup hooks".
271 313
 */

Formats disponibles : Unified diff