Revision 1180
Added by Dietmar almost 15 years ago
branches/2.8.x/wb/admin/pages/index.php | ||
---|---|---|
28 | 28 |
$admin = new admin('Pages', 'pages'); |
29 | 29 |
// Include the WB functions file |
30 | 30 |
require_once(WB_PATH.'/framework/functions.php'); |
31 |
// eggsurplus: add child pages for a specific page |
|
32 |
?> |
|
33 |
<script type="text/javascript" src="<?php print ADMIN_URL; ?>/pages/eggsurplus.js"></script> |
|
34 |
<?php |
|
31 | 35 |
|
36 |
|
|
32 | 37 |
function make_list($parent, $editable_pages) { |
33 | 38 |
// Get objects and vars from outside this function |
34 | 39 |
global $admin, $template, $database, $TEXT, $MESSAGE, $HEADING, $page_tmp_id; |
... | ... | |
118 | 123 |
<img src="<?php echo THEME_URL; ?>/images/none_16.png" alt="<?php echo $TEXT['VISIBILITY']; ?>: <?php echo $TEXT['NONE']; ?>" class="page_list_rights" /> |
119 | 124 |
<?php } elseif($page['visibility'] == 'deleted') { ?> |
120 | 125 |
<img src="<?php echo THEME_URL; ?>/images/deleted_16.png" alt="<?php echo $TEXT['VISIBILITY']; ?>: <?php echo $TEXT['DELETED']; ?>" class="page_list_rights" /> |
121 |
<?php }
|
|
126 |
<?php } |
|
122 | 127 |
echo '<span class="modify_link">'.($page['menu_title']).'</span>'; ?> |
123 | 128 |
</a> |
124 | 129 |
</td> |
... | ... | |
222 | 227 |
</a> |
223 | 228 |
<?php } ?> |
224 | 229 |
</td> |
230 |
<?php |
|
231 |
// eggsurplus: Add action to add a page as a child |
|
232 |
?> |
|
233 |
<td class="list_actions"> |
|
234 |
<?php if($admin->get_permission('pages_delete') == true AND $can_modify == true) { ?> |
|
235 |
<a href="javascript:add_child_page('<?php echo $page['page_id']; ?>');" title="<?php echo $TEXT['ADD']; ?>"> |
|
236 |
<img src="<?php echo THEME_URL; ?>/images/plus_16.png" name="addpage_<?php echo $page['page_id']; ?>" border="0" alt="Add Child Page" /> |
|
237 |
</a> |
|
238 |
<?php } ?> |
|
239 |
</td> |
|
240 |
<?php |
|
241 |
// end [IC] jeggers 2009/10/14: Add action to add a page as a child |
|
242 |
?> |
|
243 |
|
|
225 | 244 |
</tr> |
226 | 245 |
</table> |
227 | 246 |
</li> |
branches/2.8.x/wb/admin/pages/eggsurplus.js | ||
---|---|---|
1 |
function add_child_page(page_id) |
|
2 |
{ |
|
3 |
//find and select the page in the parent dropdown |
|
4 |
var selectBox = document.add.parent; |
|
5 |
for (var i = 0; i < selectBox.options.length; i++) |
|
6 |
{ |
|
7 |
if (selectBox.options[i].value == page_id) |
|
8 |
{ |
|
9 |
selectBox.selectedIndex = i; |
|
10 |
break; |
|
11 |
} |
|
12 |
} |
|
13 |
//set focus to add form |
|
14 |
document.add.title.focus(); |
|
15 |
} |
Also available in: Unified diff
add a child page is cumbersome when the parent dropdown list gets to be too large. (Ticket #821)