comparison popups_admin.module @ 0:76f9b43738f2

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