Project

General

Profile

« Previous | Next » 

Revision 804

Added by thorn over 16 years ago

fixed viewing_groups-handling in /admin/pages/add.php

View differences:

trunk/CHANGELOG
13 13
------------------------------------- 2.7.0 -------------------------------------
14 14
05-Apr-2008 Thomas Hornik
15 15
!	some small fixes: group_id/groups_id-handling, safe_mode-query in install, better work-around for issue with phplib and code-module (removed {})
16
#	fixed viewing_groups-handling in /admin/pages/add.php
16 17
05-Apr-2008 Christian Sommer
17 18
!	added workaround for template parser class
18 19
!	moved functions to edit module CSS files into the WB core to avoid duplication of code
trunk/wb/admin/pages/index.php
41 41
<script type="text/javascript" language="javascript">
42 42
function toggle_viewers() {
43 43
	if(document.add.visibility.value == 'private') {
44
		document.getElementById('private_viewers').style.display = 'block';
45
		document.getElementById('registered_viewers').style.display = 'none';
44
		document.getElementById('viewers').style.display = 'block';
46 45
	} else if(document.add.visibility.value == 'registered') {
47
		document.getElementById('private_viewers').style.display = 'none';
48
		document.getElementById('registered_viewers').style.display = 'block';
46
		document.getElementById('viewers').style.display = 'block';
49 47
	} else {
50
		document.getElementById('private_viewers').style.display = 'none';
51
		document.getElementById('registered_viewers').style.display = 'none';
48
		document.getElementById('viewers').style.display = 'none';
52 49
	}
53 50
}
54 51
function toggle_visibility(id){
trunk/wb/admin/pages/add.php
40 40
$admin_groups = $admin->get_post('admin_groups');
41 41
$viewing_groups = $admin->get_post('viewing_groups');
42 42

  
43
// work-around: $viewing_groups contains group-numbers for both private _and_ registered - keep group-numbers which appears twice only
44
$view_groups=array();
45
if($viewing_groups===NULL)
46
	$viewing_groups=array();
47
foreach($viewing_groups as $a) {
48
	if(isset($view_groups[$a])) $view_groups[$a]++;
49
	else $view_groups[$a] = 1;
43
// add Admin to admin and viewing-groups
44
$admin_groups[] = 1;
45
if($visibility == 'private' || $visibility == 'registered') {
46
	$viewing_groups[] = 1;
47
} else {
48
	$viewing_groups = array(1);
50 49
}
51
$viewing_groups=array();
52
foreach($view_groups as $k=>$v) {
53
	if($v==2)
54
		$viewing_groups[]=$k;
55
}
56 50

  
57 51
if ($parent!=0) {
58 52
	if (!$admin->get_page_permission($parent,'admin'))
......
66 60
	$admin->print_error($MESSAGE['PAGES']['BLANK_PAGE_TITLE']);
67 61
}
68 62

  
69
// Setup admin groups
70
$admin_groups[] = 1;
71
//if(!in_array(1, $admin->get_groups_id())) {
72
//	$admin_groups[] = implode(",",$admin->get_groups_id());
73
//}
74
// Setup viewing groups
75
$viewing_groups[] = 1;
76
//if(!in_array(1, $admin->get_groups_id())) {
77
//	$viewing_groups[] = implode(",",$admin->get_groups_id());
78
//}
79

  
80 63
// Check to see if page created has needed permissions
81 64
if(!in_array(1, $admin->get_groups_id())) {
82 65
	$admin_perm_ok = false;
trunk/wb/admin/pages/template.html
27 27
		</ul>
28 28
	</td>
29 29
	<td rowspan="6" valign="top" style="padding-left: 20px; padding-top: 8px;">
30
		<div id="private_viewers" style="display: none;">
31
			{TEXT_PRIVATE_VIEWERS}:
32
			<ul style="list-style-type: none; margin: 0; padding: 0;">
33
				<!-- BEGIN group_list_block2 -->
34
				<li>
35
				<input type="checkbox" name="viewing_groups[]" id="viewing_group_{ID}" value="{ID}"{CHECKED}{DISABLED} />
36
				<label for="viewing_group_{TOGGLE}">{NAME}</label>
37
				</li>
38
				<!-- END group_list_block2 -->
39
			</ul>
40
		</div>
41
	</td>
42
	<td rowspan="6" valign="top" style="padding-left: 20px; padding-top: 8px;">
43
		<div id="registered_viewers" style="display: none;">
30
		<div id="viewers" style="display: none;">
44 31
			{TEXT_REGISTERED_VIEWERS}:
45 32
			<ul style="list-style-type: none; margin: 0; padding: 0;">
46 33
				<!-- BEGIN group_list_block2 -->

Also available in: Unified diff