Revision 385
Added by Matthias almost 18 years ago
index.php | ||
---|---|---|
28 | 28 |
require_once(WB_PATH.'/framework/functions.php'); |
29 | 29 |
|
30 | 30 |
?> |
31 |
<!-- Addition for remembering expanded state of pages --> |
|
32 |
<script language="JavaScript"> |
|
33 |
function writeSessionCookie (cookieName, cookieValue) { |
|
34 |
document.cookie = escape(cookieName) + "=" + escape(cookieValue) + ";"; |
|
35 |
} |
|
36 |
</script> |
|
37 |
<!-- End addition --> |
|
38 |
|
|
31 | 39 |
<script type="text/javascript" language="javascript"> |
32 | 40 |
function toggle_viewers() { |
33 | 41 |
if(document.add.visibility.value == 'private') { |
... | ... | |
44 | 52 |
function toggle_visibility(id){ |
45 | 53 |
if(document.getElementById(id).style.display == "block") { |
46 | 54 |
document.getElementById(id).style.display = "none"; |
55 |
writeSessionCookie (id, "0");//Addition for remembering expanded state of pages |
|
47 | 56 |
} else { |
48 | 57 |
document.getElementById(id).style.display = "block"; |
58 |
writeSessionCookie (id, "1");//Addition for remembering expanded state of pages |
|
49 | 59 |
} |
50 | 60 |
} |
51 | 61 |
var plus = new Image; |
... | ... | |
89 | 99 |
// Get objects and vars from outside this function |
90 | 100 |
global $admin, $template, $database, $TEXT, $MESSAGE; |
91 | 101 |
?> |
92 |
<ul id="p<?php echo $parent; ?>" <?php if($parent != 0) { echo 'class="page_list"'; } ?>>
|
|
102 |
<ul id="p<?php echo $parent; ?>" <?php if($parent != 0) { echo 'class="page_list" '; if($_COOKIE["p".$parent] =="1"){echo'style="display:block;"'; }} ?>>
|
|
93 | 103 |
<?php |
94 | 104 |
// Get page list from database |
95 | 105 |
$database = new database(); |
... | ... | |
146 | 156 |
if($display_plus == true) { |
147 | 157 |
?> |
148 | 158 |
<a href="javascript: toggle_visibility('p<?php echo $page['page_id']; ?>');" title="<?php echo $TEXT['EXPAND'].'/'.$TEXT['COLLAPSE']; ?>"> |
149 |
<img src="<?php echo ADMIN_URL; ?>/images/plus_16.png" onclick="toggle_plus_minus('<?php echo $page['page_id']; ?>');" name="plus_minus_<?php echo $page['page_id']; ?>" border="0" alt="+" />
|
|
159 |
<img src="<?php echo ADMIN_URL; ?>/images/<?php if($_COOKIE["p".$page['page_id']] =="1"){echo"minus";}else{echo"plus";}?>_16.png" onclick="toggle_plus_minus('<?php echo $page['page_id']; ?>');" name="plus_minus_<?php echo $page['page_id']; ?>" border="0" alt="+" />
|
|
150 | 160 |
</a> |
151 | 161 |
<?php |
152 | 162 |
} |
Also available in: Unified diff
Added Remember-expanded-pages-in-admin (thanks to ephraimt)