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