Mercurial > defr > drupal > popups
comparison popups.api.php @ 0:76f9b43738f2
Popups 2.0-alpha5
author | Franck Deroche <franck@defr.org> |
---|---|
date | Fri, 31 Dec 2010 13:41:08 +0100 |
parents | |
children | 4215c43e74eb |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:76f9b43738f2 |
---|---|
1 <?php | |
2 // $Id: popups.api.php,v 1.1.4.2 2009/03/05 19:52:48 starbow Exp $ | |
3 | |
4 /** | |
5 * @file | |
6 * Provides hook documentation for the Popups API. | |
7 */ | |
8 | |
9 /** | |
10 * Creates the rule registry for the popups. | |
11 */ | |
12 function hook_popups() { | |
13 $popups = array(); | |
14 $popups['admin/content/taxonomy'] = array( | |
15 // Act on the first primary tab. | |
16 'div#tabs-wrapper a:eq(1)', | |
17 // Act on the 2nd column link in the table. | |
18 'table td:nth-child(2) a' => array( | |
19 // Don't update the original page. | |
20 'noUpdate' => TRUE, | |
21 ), | |
22 ); | |
23 return $popups; | |
24 } | |
25 | |
26 /** | |
27 * Allows altering of the popup rule registry. | |
28 * | |
29 * @param $popups | |
30 * The popup registry to be altered. | |
31 */ | |
32 function hook_popups_alter(&$popups) { | |
33 // Remove acting on the primary tabs. | |
34 unset($popups['admin/content/taxonomy']['div#tabs-wrapper a:eq(1)']); | |
35 | |
36 // Make clicking on the link update the original page. | |
37 $popups['admin/content/taxonomy']['table td:nth-child(2) a']['noUpdate'] = FALSE; | |
38 } | |
39 | |
40 /** | |
41 * Adds skins to the Popups API. | |
42 * | |
43 * Returns an associative array where the key is the skin name, along | |
44 * with CSS and JS values to tell where the skin can be found. | |
45 */ | |
46 function hook_popups_skins() { | |
47 $skin['My Skin'] = array( | |
48 'css' => drupal_get_path('module', 'myskin') .'/myskin.css', | |
49 'js' => drupal_get_path('module', 'myskin') .'/myskin.js', | |
50 ); | |
51 } |