Révision 018e218c
Ajouté par Assos Assos il y a plus de 10 ans
htmltest/sites/all/modules/flag/flag.api.php | ||
---|---|---|
350 | 350 |
/** |
351 | 351 |
* Alter the javascript structure that describes the flag operation. |
352 | 352 |
* |
353 |
* @param $info |
|
354 |
* The info array before it is returned from flag_build_javascript_info(). |
|
353 | 355 |
* @param $flag |
354 | 356 |
* The full flag object. |
355 |
* @param $entity_id |
|
356 |
* The ID of the node, comment, user or other object being flagged. |
|
357 | 357 |
* |
358 | 358 |
* @see flag_build_javascript_info() |
359 | 359 |
*/ |
360 |
function hook_flag_javascript_info_alter() { |
|
361 |
|
|
360 |
function hook_flag_javascript_info_alter(&$info, $flag) { |
|
361 |
if ($flag->name === 'test') { |
|
362 |
$info['newLink'] = $flag->theme($flag->is_flagged($info['contentId']) ? 'unflag' : 'flag', $info['contentId'], array( |
|
363 |
'after_flagging' => TRUE, |
|
364 |
'errors' => $flag->get_errors(), |
|
365 |
// Additional options to pass to theme's preprocess function/template. |
|
366 |
'icon' => TRUE, |
|
367 |
'hide_text' => TRUE, |
|
368 |
)); |
|
369 |
} |
|
362 | 370 |
} |
363 | 371 |
|
364 | 372 |
/** |
Formats disponibles : Unified diff
Weekly update of contrib modules