annotate popups_admin.module @ 3:5efa741592f9

Add an alter hook to the js list. Makes it possible for a custom module to disable an auto-detected JavaScript in case you just know it won't work right in a popup.
author Franck Deroche <franck@defr.org>
date Fri, 31 Dec 2010 14:02:22 +0100
parents 76f9b43738f2
children
rev   line source
franck@0 1 <?php
franck@0 2 // $Id: popups_admin.module,v 1.1.6.7 2009/03/21 00:57:16 starbow Exp $
franck@0 3
franck@0 4 /**
franck@0 5 * @file
franck@0 6 * Uses the popups API to add some popups to admin pages.
franck@0 7 *
franck@0 8 * @todo
franck@0 9 * Adding Javascript into popups doesn't always work.
franck@0 10 * tabledrag onmouse up action.
franck@0 11 * user.js and teaser.js bugs.
franck@0 12 * Taxonomy > Add vocab. Adding second item to page does not trigger d-n-d transformation.
franck@0 13 * Might be a problem with Taxonomy. Menus doesn't have problem (adds d-n-d on first item).
franck@0 14 * Comment view: popup is too small to contain comment.
franck@0 15 */
franck@0 16
franck@0 17 /**
franck@0 18 * hook_popups
franck@0 19 *
franck@0 20 * This implements hook_popups, defined in popups_get_popups.
franck@0 21 * It adds page-in-popup behavior to the core admin pages.
franck@0 22 * See the comments in popups_add_popups for explination of the options.
franck@0 23 *
franck@0 24 */
franck@0 25 function popups_admin_popups() {
franck@0 26
franck@0 27 return array(
franck@0 28 'admin/build/block' => array( // Blocks admin page.
franck@0 29 '#tabs-wrapper a[href$=admin/build/block/add]', // Add Block
franck@0 30 '#blocks a[href~=admin/build/block/configure]', // configure
franck@0 31 '#blocks a[href~=admin/build/block/delete]', // delete
franck@0 32 ),
franck@0 33 'admin/build/block/list/*' => array( // Blocks admin page.
franck@0 34 '#tabs-wrapper a[href$=admin/build/block/add]', // Add Block
franck@0 35 '#blocks a[href~=admin/build/block/configure]', // configure
franck@0 36 '#blocks a[href~=admin/build/block/delete]', // delete
franck@0 37 ),
franck@0 38 'admin/build/path' => array( // URL aliases admin page.
franck@0 39 '#tabs-wrapper a[href$=admin/build/path/add]', // Add alias
franck@0 40 'td:nth-child(3) a[href~=admin/build/path/edit]', // edit alias
franck@0 41 'td:nth-child(4) a[href~=admin/build/path/delete]', // delete alias
franck@0 42 ),
franck@0 43 'admin/content/taxonomy' => array( // Taxonomy admin page.
franck@0 44 '#tabs-wrapper a[href$=admin/content/taxonomy/add/vocabulary]', // Add vocabulary
franck@0 45 '#taxonomy-overview-vocabularies td a:contains('. t('edit vocabulary') .')', // edit vocabulary
franck@0 46 '#taxonomy-overview-vocabularies td a:contains('. t('list terms') .')' => array( // list terms
franck@0 47 'noUpdate' => TRUE,
franck@0 48 ),
franck@0 49 '#taxonomy-overview-vocabularies td a:contains('. t('add terms') .')' => array( // add terms
franck@0 50 'noUpdate' => TRUE,
franck@0 51 ),
franck@0 52 ),
franck@0 53 'admin/content/types' => array( // Content Type admin page
franck@0 54 '#tabs-wrapper a[href$=admin/content/types/add]', // Add content type
franck@0 55 'table td:nth-child(4) a, table td:nth-child(5) a, table td:nth-child(7) a' // edit, add field, delete
franck@0 56 ),
franck@0 57 'admin/content/types/list' => array( // Content Type admin page
franck@0 58 '#tabs-wrapper a[href$=admin/content/types/add]', // Add content type
franck@0 59 'table td:nth-child(4) a, table td:nth-child(5) a, table td:nth-child(7) a' // edit, add field, delete
franck@0 60 ),
franck@0 61 'admin/content/node' => array( // Existing Content admin page
franck@0 62 '#node-admin-content td a:contains('. t('edit') .')', // edit
franck@0 63 ),
franck@0 64 // 'page_node_form' => array( // Node edit form
franck@0 65 'node/add/*' => array( // Node edit form
franck@0 66 'a[href$=filter/tips]' => array( // Fixes insane "More information..." link
franck@0 67 'noUpdate' => TRUE,
franck@0 68 )
franck@0 69 ),
franck@0 70 'admin/content/comment' => array( // Comments admin page.
franck@0 71 'table td:nth-child(2) a' => array( // view (TODO: popup too small)
franck@0 72 'noUpdate' => TRUE,
franck@0 73 ),
franck@0 74 '#comment-admin-overview td a:contains('. t('edit') .')', // edit
franck@0 75 ),
franck@0 76 'admin/user/rules' => array( // Access rules admin page.
franck@0 77 '#tabs-wrapper a[href$=admin/user/rules/add]', // Add rule
franck@0 78 'table td:nth-child(4) a, table td:nth-child(5) a', // edit, delete
franck@0 79 '#tabs-wrapper a[href$=/admin/user/rules/check]' => array( // Check rule
franck@0 80 'noUpdate' => TRUE,
franck@0 81 ),
franck@0 82 ),
franck@0 83 'admin/user/user' => array( // Manage all users admin page.
franck@0 84 //Add user (TODO: Can't test, keeps crashing apache!)
franck@0 85 '#tabs-wrapper a[href$=admin/user/user/create]',
franck@0 86 '#user-admin-account td:nth-child(2) a' => array( // View the user
franck@0 87 'noUpdate' => TRUE,
franck@0 88 ),
franck@0 89
franck@0 90 ),
franck@0 91 'menu_overview_form' => array( // Menu admin form.
franck@0 92 // Add Item, , edit, delete
franck@0 93 '#tabs-wrapper a:eq(1), table#menu-overview td:nth-child(5) a, table#menu-overview td:nth-child(6) a',
franck@0 94 '#tabs-wrapper a:eq(2)' => array( // Edit menu: update just page title.
franck@0 95 'updateTitle' => TRUE,
franck@0 96 'noUpdate' => TRUE,
franck@0 97 ),
franck@0 98 ),
franck@0 99
franck@0 100 );
franck@0 101 }
franck@0 102
franck@0 103