Revision 1277
Added by Dietmar almost 15 years ago
branches/2.8.x/LICENSE | ||
---|---|---|
3 | 3 |
WebsiteBaker is released under the GNU General Public License, |
4 | 4 |
Copyright (C) 2004-2009 Ryan Djurovich. |
5 | 5 |
Copyright (C) 2009-2010 Website Baker Org. e.V. |
6 |
Please refer to the COPYING file for a copy of the license. |
|
6 |
Please refer to the COPYING file for a copy of the license. |
|
7 |
|
|
8 |
LICENSE INFORMATION |
|
9 |
|
|
10 |
WebsiteBaker is free software; you can redistribute it and/or |
|
11 |
modify it under the terms of the GNU General Public License |
|
12 |
as published by the Free Software Foundation; either version 2 |
|
13 |
of the License, or (at your option) any later version. |
|
14 |
|
|
15 |
WebsiteBaker is distributed in the hope that it will be useful, |
|
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
18 |
See the GNU General Public License for more details. |
|
19 |
|
|
20 |
You should have received a copy of the GNU General Public License |
|
21 |
along with this program; if not, write to the Free Software |
|
22 |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
branches/2.8.x/CHANGELOG | ||
---|---|---|
11 | 11 |
! = Update/Change |
12 | 12 |
|
13 | 13 |
------------------------------------- 2.8.1 ------------------------------------- |
14 |
24-Jan-2010 Dietmar Woellbrink (Luisehahne) |
|
14 |
28-Jan-2010 Dietmar Woellbrink (Luisehahne) |
|
15 |
! update headertext |
|
16 |
28-Jan-2010 Dietmar Woellbrink (Luisehahne) |
|
15 | 17 |
! update jquery 1.4.0 to 1.4.1, |
16 | 18 |
- removed include/jquery/plugins |
17 | 19 |
! update backend themes |
branches/2.8.x/wb/include/yui/connection/index.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/* |
|
3 |
* |
|
4 |
* About WebsiteBaker |
|
5 |
* |
|
6 |
* Website Baker is a PHP-based Content Management System (CMS) |
|
7 |
* designed with one goal in mind: to enable its users to produce websites |
|
8 |
* with ease. |
|
9 |
* |
|
10 |
* LICENSE INFORMATION |
|
11 |
* |
|
12 |
* WebsiteBaker is free software; you can redistribute it and/or |
|
13 |
* modify it under the terms of the GNU General Public License |
|
14 |
* as published by the Free Software Foundation; either version 2 |
|
15 |
* of the License, or (at your option) any later version. |
|
16 |
* |
|
17 |
* WebsiteBaker is distributed in the hope that it will be useful, |
|
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
20 |
* See the GNU General Public License for more details. |
|
21 |
* |
|
22 |
* You should have received a copy of the GNU General Public License |
|
23 |
* along with this program; if not, write to the Free Software |
|
24 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
25 |
* |
|
26 |
* WebsiteBaker Extra Information |
|
27 |
* |
|
28 |
* |
|
29 |
*/ |
|
30 | 2 |
/** |
31 | 3 |
* |
32 |
* @category backend
|
|
4 |
* @category framework
|
|
33 | 5 |
* @package yui |
34 |
* @author Ryan Djurovich
|
|
6 |
* @author WebsiteBaker Project
|
|
35 | 7 |
* @copyright 2004-2009, Ryan Djurovich |
36 | 8 |
* @copyright 2009-2010, Website Baker Org. e.V. |
37 |
* @filesource $HeadURL$ |
|
38 |
* @author Ryan Djurovich |
|
39 |
* @copyright 2004-2009, Ryan Djurovich |
|
40 |
* |
|
41 |
* @author WebsiteBaker Project |
|
42 | 9 |
* @link http://www.websitebaker2.org/ |
43 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
44 |
* @link http://start.websitebaker2.org/impressum-datenschutz.php |
|
45 | 10 |
* @license http://www.gnu.org/licenses/gpl.html |
46 |
* @version $Id$ |
|
47 | 11 |
* @platform WebsiteBaker 2.8.x |
48 | 12 |
* @requirements PHP 4.3.4 and higher |
13 |
* @version $Id$ |
|
14 |
* @filesource $HeadURL$ |
|
49 | 15 |
* @lastmodified $Date$ |
50 | 16 |
* |
51 | 17 |
*/ |
branches/2.8.x/wb/include/yui/dom/index.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/* |
|
3 |
* |
|
4 |
* About WebsiteBaker |
|
5 |
* |
|
6 |
* Website Baker is a PHP-based Content Management System (CMS) |
|
7 |
* designed with one goal in mind: to enable its users to produce websites |
|
8 |
* with ease. |
|
9 |
* |
|
10 |
* LICENSE INFORMATION |
|
11 |
* |
|
12 |
* WebsiteBaker is free software; you can redistribute it and/or |
|
13 |
* modify it under the terms of the GNU General Public License |
|
14 |
* as published by the Free Software Foundation; either version 2 |
|
15 |
* of the License, or (at your option) any later version. |
|
16 |
* |
|
17 |
* WebsiteBaker is distributed in the hope that it will be useful, |
|
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
20 |
* See the GNU General Public License for more details. |
|
21 |
* |
|
22 |
* You should have received a copy of the GNU General Public License |
|
23 |
* along with this program; if not, write to the Free Software |
|
24 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
25 |
* |
|
26 |
* WebsiteBaker Extra Information |
|
27 |
* |
|
28 |
* |
|
29 |
*/ |
|
30 | 2 |
/** |
31 | 3 |
* |
32 |
* @category backend
|
|
4 |
* @category framework
|
|
33 | 5 |
* @package yui |
34 |
* @author Ryan Djurovich
|
|
6 |
* @author WebsiteBaker Project
|
|
35 | 7 |
* @copyright 2004-2009, Ryan Djurovich |
36 | 8 |
* @copyright 2009-2010, Website Baker Org. e.V. |
37 |
* @filesource $HeadURL$ |
|
38 |
* @author Ryan Djurovich |
|
39 |
* @copyright 2004-2009, Ryan Djurovich |
|
40 |
* |
|
41 |
* @author WebsiteBaker Project |
|
42 | 9 |
* @link http://www.websitebaker2.org/ |
43 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
44 |
* @link http://start.websitebaker2.org/impressum-datenschutz.php |
|
45 | 10 |
* @license http://www.gnu.org/licenses/gpl.html |
46 |
* @version $Id$ |
|
47 | 11 |
* @platform WebsiteBaker 2.8.x |
48 | 12 |
* @requirements PHP 4.3.4 and higher |
13 |
* @version $Id$ |
|
14 |
* @filesource $HeadURL$ |
|
49 | 15 |
* @lastmodified $Date$ |
50 | 16 |
* |
51 | 17 |
*/ |
52 | 18 |
|
19 |
|
|
53 | 20 |
header("Location: ../../../index.php"); |
54 | 21 |
|
55 | 22 |
?> |
branches/2.8.x/wb/include/yui/yahoo/index.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/* |
|
3 |
* |
|
4 |
* About WebsiteBaker |
|
5 |
* |
|
6 |
* Website Baker is a PHP-based Content Management System (CMS) |
|
7 |
* designed with one goal in mind: to enable its users to produce websites |
|
8 |
* with ease. |
|
9 |
* |
|
10 |
* LICENSE INFORMATION |
|
11 |
* |
|
12 |
* WebsiteBaker is free software; you can redistribute it and/or |
|
13 |
* modify it under the terms of the GNU General Public License |
|
14 |
* as published by the Free Software Foundation; either version 2 |
|
15 |
* of the License, or (at your option) any later version. |
|
16 |
* |
|
17 |
* WebsiteBaker is distributed in the hope that it will be useful, |
|
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
20 |
* See the GNU General Public License for more details. |
|
21 |
* |
|
22 |
* You should have received a copy of the GNU General Public License |
|
23 |
* along with this program; if not, write to the Free Software |
|
24 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
25 |
* |
|
26 |
* WebsiteBaker Extra Information |
|
27 |
* |
|
28 |
* |
|
29 |
*/ |
|
30 | 2 |
/** |
31 | 3 |
* |
32 |
* @category backend
|
|
4 |
* @category framework
|
|
33 | 5 |
* @package yui |
34 | 6 |
* @author WebsiteBaker Project |
35 | 7 |
* @copyright 2004-2009, Ryan Djurovich |
branches/2.8.x/wb/include/yui/event/index.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/* |
|
3 |
* |
|
4 |
* About WebsiteBaker |
|
5 |
* |
|
6 |
* Website Baker is a PHP-based Content Management System (CMS) |
|
7 |
* designed with one goal in mind: to enable its users to produce websites |
|
8 |
* with ease. |
|
9 |
* |
|
10 |
* LICENSE INFORMATION |
|
11 |
* |
|
12 |
* WebsiteBaker is free software; you can redistribute it and/or |
|
13 |
* modify it under the terms of the GNU General Public License |
|
14 |
* as published by the Free Software Foundation; either version 2 |
|
15 |
* of the License, or (at your option) any later version. |
|
16 |
* |
|
17 |
* WebsiteBaker is distributed in the hope that it will be useful, |
|
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
20 |
* See the GNU General Public License for more details. |
|
21 |
* |
|
22 |
* You should have received a copy of the GNU General Public License |
|
23 |
* along with this program; if not, write to the Free Software |
|
24 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
25 |
* |
|
26 |
* WebsiteBaker Extra Information |
|
27 |
* |
|
28 |
* |
|
29 |
*/ |
|
30 | 2 |
/** |
31 | 3 |
* |
32 |
* @category backend
|
|
4 |
* @category framework
|
|
33 | 5 |
* @package yui |
34 | 6 |
* @author WebsiteBaker Project |
35 | 7 |
* @copyright 2004-2009, Ryan Djurovich |
branches/2.8.x/wb/include/yui/dragdrop/index.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/* |
|
3 |
* |
|
4 |
* About WebsiteBaker |
|
5 |
* |
|
6 |
* Website Baker is a PHP-based Content Management System (CMS) |
|
7 |
* designed with one goal in mind: to enable its users to produce websites |
|
8 |
* with ease. |
|
9 |
* |
|
10 |
* LICENSE INFORMATION |
|
11 |
* |
|
12 |
* WebsiteBaker is free software; you can redistribute it and/or |
|
13 |
* modify it under the terms of the GNU General Public License |
|
14 |
* as published by the Free Software Foundation; either version 2 |
|
15 |
* of the License, or (at your option) any later version. |
|
16 |
* |
|
17 |
* WebsiteBaker is distributed in the hope that it will be useful, |
|
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
20 |
* See the GNU General Public License for more details. |
|
21 |
* |
|
22 |
* You should have received a copy of the GNU General Public License |
|
23 |
* along with this program; if not, write to the Free Software |
|
24 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
25 |
* |
|
26 |
* WebsiteBaker Extra Information |
|
27 |
* |
|
28 |
* |
|
29 |
*/ |
|
2 |
|
|
30 | 3 |
/** |
31 | 4 |
* |
32 |
* @category backend
|
|
5 |
* @category framework
|
|
33 | 6 |
* @package yui |
34 | 7 |
* @author WebsiteBaker Project |
35 | 8 |
* @copyright 2004-2009, Ryan Djurovich |
branches/2.8.x/wb/admin/groups/groups.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/* |
|
3 |
* |
|
4 |
* About WebsiteBaker |
|
5 |
* |
|
6 |
* Website Baker is a PHP-based Content Management System (CMS) |
|
7 |
* designed with one goal in mind: to enable its users to produce websites |
|
8 |
* with ease. |
|
9 |
* |
|
10 |
* LICENSE INFORMATION |
|
11 |
* |
|
12 |
* WebsiteBaker is free software; you can redistribute it and/or |
|
13 |
* modify it under the terms of the GNU General Public License |
|
14 |
* as published by the Free Software Foundation; either version 2 |
|
15 |
* of the License, or (at your option) any later version. |
|
16 |
* |
|
17 |
* WebsiteBaker is distributed in the hope that it will be useful, |
|
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
20 |
* See the GNU General Public License for more details. |
|
21 |
* |
|
22 |
* You should have received a copy of the GNU General Public License |
|
23 |
* along with this program; if not, write to the Free Software |
|
24 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
25 |
* |
|
26 |
* WebsiteBaker Extra Information |
|
27 |
* |
|
28 |
* |
|
29 |
*/ |
|
30 | 2 |
/** |
31 | 3 |
* |
32 | 4 |
* @category admin |
... | ... | |
42 | 14 |
* @filesource $HeadURL$ |
43 | 15 |
* @lastmodified $Date$ |
44 | 16 |
* |
45 |
*/ |
|
17 |
*/
|
|
46 | 18 |
|
47 | 19 |
// Include config file and admin class file |
48 | 20 |
require('../../config.php'); |
branches/2.8.x/wb/admin/start/index.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/* |
|
3 |
* |
|
4 |
* About WebsiteBaker |
|
5 |
* |
|
6 |
* Website Baker is a PHP-based Content Management System (CMS) |
|
7 |
* designed with one goal in mind: to enable its users to produce websites |
|
8 |
* with ease. |
|
9 |
* |
|
10 |
* LICENSE INFORMATION |
|
11 |
* |
|
12 |
* WebsiteBaker is free software; you can redistribute it and/or |
|
13 |
* modify it under the terms of the GNU General Public License |
|
14 |
* as published by the Free Software Foundation; either version 2 |
|
15 |
* of the License, or (at your option) any later version. |
|
16 |
* |
|
17 |
* WebsiteBaker is distributed in the hope that it will be useful, |
|
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
20 |
* See the GNU General Public License for more details. |
|
21 |
* |
|
22 |
* You should have received a copy of the GNU General Public License |
|
23 |
* along with this program; if not, write to the Free Software |
|
24 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
25 |
* |
|
26 |
* WebsiteBaker Extra Information |
|
27 |
* |
|
28 |
* |
|
29 |
*/ |
|
30 | 2 |
/** |
31 | 3 |
* |
32 | 4 |
* @category admin |
... | ... | |
66 | 38 |
); |
67 | 39 |
|
68 | 40 |
// Insert permission values into the template object |
69 |
if($admin->get_permission('pages') != true) { |
|
41 |
if($admin->get_permission('pages') != true) |
|
42 |
{ |
|
70 | 43 |
$template->set_var('DISPLAY_PAGES', 'display:none;'); |
71 | 44 |
} |
72 |
if($admin->get_permission('media') != true) { |
|
45 |
if($admin->get_permission('media') != true) |
|
46 |
{ |
|
73 | 47 |
$template->set_var('DISPLAY_MEDIA', 'display:none;'); |
74 | 48 |
} |
75 |
if($admin->get_permission('addons') != true) { |
|
49 |
if($admin->get_permission('addons') != true) |
|
50 |
{ |
|
76 | 51 |
$template->set_var('DISPLAY_ADDONS', 'display:none;'); |
77 | 52 |
} |
78 |
if($admin->get_permission('access') != true) { |
|
53 |
if($admin->get_permission('access') != true) |
|
54 |
{ |
|
79 | 55 |
$template->set_var('DISPLAY_ACCESS', 'display:none;'); |
80 | 56 |
} |
81 |
if($admin->get_permission('settings') != true) { |
|
57 |
if($admin->get_permission('settings') != true) |
|
58 |
{ |
|
82 | 59 |
$template->set_var('DISPLAY_SETTINGS', 'display:none;'); |
83 | 60 |
} |
84 |
if($admin->get_permission('admintools') != true) { |
|
61 |
if($admin->get_permission('admintools') != true) |
|
62 |
{ |
|
85 | 63 |
$template->set_var('DISPLAY_ADMINTOOLS', 'display:none;'); |
86 | 64 |
} |
87 | 65 |
|
88 | 66 |
// Check if installation directory still exists |
89 | 67 |
if(file_exists(WB_PATH.'/install/')) { |
90 | 68 |
// Check if user is part of Adminstrators group |
91 |
if(in_array(1, $admin->get_groups_id())) { |
|
69 |
if(in_array(1, $admin->get_groups_id())) |
|
70 |
{ |
|
92 | 71 |
$template->set_var('WARNING', $MESSAGE['START']['INSTALL_DIR_EXISTS']); |
93 | 72 |
} else { |
94 | 73 |
$template->set_var('DISPLAY_WARNING', 'display:none;'); |
... | ... | |
100 | 79 |
// Insert "Add-ons" section overview (pretty complex compared to normal) |
101 | 80 |
$addons_overview = $TEXT['MANAGE'].' '; |
102 | 81 |
$addons_count = 0; |
103 |
if($admin->get_permission('modules') == true) { |
|
82 |
if($admin->get_permission('modules') == true) |
|
83 |
{ |
|
104 | 84 |
$addons_overview .= '<a href="'.ADMIN_URL.'/modules/index.php">'.$MENU['MODULES'].'</a>'; |
105 | 85 |
$addons_count = 1; |
106 | 86 |
} |
107 |
if($admin->get_permission('templates') == true) { |
|
87 |
if($admin->get_permission('templates') == true) |
|
88 |
{ |
|
108 | 89 |
if($addons_count == 1) { $addons_overview .= ', '; } |
109 | 90 |
$addons_overview .= '<a href="'.ADMIN_URL.'/templates/index.php">'.$MENU['TEMPLATES'].'</a>'; |
110 | 91 |
$addons_count = 1; |
111 | 92 |
} |
112 |
if($admin->get_permission('languages') == true) { |
|
93 |
if($admin->get_permission('languages') == true) |
|
94 |
{ |
|
113 | 95 |
if($addons_count == 1) { $addons_overview .= ', '; } |
114 | 96 |
$addons_overview .= '<a href="'.ADMIN_URL.'/languages/index.php">'.$MENU['LANGUAGES'].'</a>'; |
115 | 97 |
} |
branches/2.8.x/wb/admin/pages/settings.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/* |
|
3 |
* |
|
4 |
* About WebsiteBaker |
|
5 |
* |
|
6 |
* Website Baker is a PHP-based Content Management System (CMS) |
|
7 |
* designed with one goal in mind: to enable its users to produce websites |
|
8 |
* with ease. |
|
9 |
* |
|
10 |
* LICENSE INFORMATION |
|
11 |
* |
|
12 |
* WebsiteBaker is free software; you can redistribute it and/or |
|
13 |
* modify it under the terms of the GNU General Public License |
|
14 |
* as published by the Free Software Foundation; either version 2 |
|
15 |
* of the License, or (at your option) any later version. |
|
16 |
* |
|
17 |
* WebsiteBaker is distributed in the hope that it will be useful, |
|
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
20 |
* See the GNU General Public License for more details. |
|
21 |
* |
|
22 |
* You should have received a copy of the GNU General Public License |
|
23 |
* along with this program; if not, write to the Free Software |
|
24 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
25 |
* |
|
26 |
* WebsiteBaker Extra Information |
|
27 |
* |
|
28 |
* |
|
29 |
*/ |
|
30 | 2 |
/** |
31 | 3 |
* |
32 | 4 |
* @category admin |
... | ... | |
42 | 14 |
* @filesource $HeadURL$ |
43 | 15 |
* @lastmodified $Date$ |
44 | 16 |
* |
45 |
*/ |
|
17 |
*/
|
|
46 | 18 |
|
47 | 19 |
// Get page id |
48 |
if(!isset($_GET['page_id']) OR !is_numeric($_GET['page_id'])) { |
|
20 |
if(!isset($_GET['page_id']) OR !is_numeric($_GET['page_id'])) |
|
21 |
{ |
|
49 | 22 |
header("Location: index.php"); |
50 | 23 |
exit(0); |
51 | 24 |
} else { |
... | ... | |
61 | 34 |
require_once(WB_PATH.'/framework/functions-utf8.php'); |
62 | 35 |
|
63 | 36 |
// Get perms |
64 |
$database = new database(); |
|
65 |
$results = $database->query("SELECT * FROM ".TABLE_PREFIX."pages WHERE page_id = '$page_id'"); |
|
37 |
/*$database = new database(); */ |
|
38 |
|
|
39 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'pages` WHERE `page_id` = '.$page_id; |
|
40 |
$results = $database->query($sql); |
|
66 | 41 |
$results_array = $results->fetchRow(); |
42 |
|
|
67 | 43 |
$old_admin_groups = explode(',', $results_array['admin_groups']); |
68 | 44 |
$old_admin_users = explode(',', $results_array['admin_users']); |
69 | 45 |
|
70 | 46 |
// Work-out if we should check for existing page_code |
71 |
$field_sql = $database->query("DESCRIBE ".TABLE_PREFIX."pages page_code"); |
|
47 |
$sql = 'DESCRIBE `'.TABLE_PREFIX.'pages` `page_code`'; |
|
48 |
$field_sql = $database->query($sql); |
|
72 | 49 |
$field_set = $field_sql->numRows(); |
50 |
|
|
73 | 51 |
$in_old_group = FALSE; |
74 |
foreach($admin->get_groups_id() as $cur_gid){ |
|
75 |
if (in_array($cur_gid, $old_admin_groups)) { |
|
52 |
foreach($admin->get_groups_id() as $cur_gid) |
|
53 |
{ |
|
54 |
if (in_array($cur_gid, $old_admin_groups)) |
|
55 |
{ |
|
76 | 56 |
$in_old_group = TRUE; |
77 | 57 |
} |
78 | 58 |
} |
79 |
if((!$in_old_group) AND !is_numeric(array_search($admin->get_user_id(), $old_admin_users))) { |
|
59 |
if((!$in_old_group) AND !is_numeric(array_search($admin->get_user_id(), $old_admin_users))) |
|
60 |
{ |
|
80 | 61 |
$admin->print_error($MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS']); |
81 | 62 |
} |
82 | 63 |
|
83 | 64 |
// Get page details |
84 | 65 |
/* $database = new database(); */ |
85 |
$query = "SELECT * FROM ".TABLE_PREFIX."pages WHERE page_id = '$page_id'";
|
|
86 |
$results = $database->query($query);
|
|
66 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'pages` WHERE `page_id`='.$page_id;
|
|
67 |
$results = $database->query($sql);
|
|
87 | 68 |
if($database->is_error()) { |
88 | 69 |
$admin->print_header(); |
89 | 70 |
$admin->print_error($database->get_error()); |
... | ... | |
98 | 79 |
$user=$admin->get_user_details($results_array['modified_by']); |
99 | 80 |
|
100 | 81 |
// Convert the unix ts for modified_when to human a readable form |
101 |
if($results_array['modified_when'] != 0) { |
|
82 |
if($results_array['modified_when'] != 0) |
|
83 |
{ |
|
102 | 84 |
$modified_ts = gmdate(TIME_FORMAT.', '.DATE_FORMAT, $results_array['modified_when']+TIMEZONE); |
103 | 85 |
} else { |
104 | 86 |
$modified_ts = 'Unknown'; |
... | ... | |
126 | 108 |
); |
127 | 109 |
|
128 | 110 |
// Work-out if we should show the "manage sections" link |
129 |
$query_sections = $database->query("SELECT section_id FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' AND module = 'menu_link'"); |
|
130 |
if($query_sections->numRows() > 0) { |
|
131 |
$template->set_var('DISPLAY_MANAGE_SECTIONS', 'display:none;'); |
|
132 |
} elseif(MANAGE_SECTIONS == 'enabled') { |
|
111 |
$sql = 'SELECT `section_id` FROM `'.TABLE_PREFIX.'sections` WHERE `page_id`='.$page_id.' AND `module`="menu_link"'; |
|
112 |
$query_sections = $database->query($sql); |
|
113 |
if($query_sections->numRows() > 0) |
|
114 |
{ |
|
115 |
$template->set_var('DISPLAY_MANAGE_SECTIONS', 'display:none;'); |
|
116 |
} elseif(MANAGE_SECTIONS == 'enabled') |
|
117 |
{ |
|
133 | 118 |
$template->set_var('TEXT_MANAGE_SECTIONS', $HEADING['MANAGE_SECTIONS']); |
134 | 119 |
} else { |
135 | 120 |
$template->set_var('DISPLAY_MANAGE_SECTIONS', 'display:none;'); |
... | ... | |
150 | 135 |
// Group list 1 (admin_groups) |
151 | 136 |
$admin_groups = explode(',', str_replace('_', '', $results_array['admin_groups'])); |
152 | 137 |
|
153 |
$query = "SELECT * FROM ".TABLE_PREFIX."groups";
|
|
154 |
|
|
155 |
$get_groups = $database->query($query); |
|
138 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'groups`';
|
|
139 |
$get_groups = $database->query($sql); |
|
140 |
|
|
156 | 141 |
$template->set_block('main_block', 'group_list_block', 'group_list'); |
157 | 142 |
// Insert admin group and current group first |
158 | 143 |
$admin_group_name = $get_groups->fetchRow(); |
... | ... | |
204 | 189 |
// Group list 2 (viewing_groups) |
205 | 190 |
$viewing_groups = explode(',', str_replace('_', '', $results_array['viewing_groups'])); |
206 | 191 |
|
207 |
$query = "SELECT * FROM ".TABLE_PREFIX."groups"; |
|
192 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'groups`'; |
|
193 |
$get_groups = $database->query($sql); |
|
208 | 194 |
|
209 |
$get_groups = $database->query($query); |
|
210 | 195 |
$template->set_block('main_block', 'group_list_block2', 'group_list2'); |
211 | 196 |
// Insert admin group and current group first |
212 | 197 |
$admin_group_name = $get_groups->fetchRow(); |
... | ... | |
222 | 207 |
); |
223 | 208 |
$template->parse('group_list2', 'group_list_block2', true); |
224 | 209 |
|
225 |
while($group = $get_groups->fetchRow()) { |
|
210 |
while($group = $get_groups->fetchRow()) |
|
211 |
{ |
|
226 | 212 |
// check if the user is a member of this group |
227 | 213 |
$flag_disabled = ''; |
228 | 214 |
$flag_checked = ''; |
229 | 215 |
$flag_cursor = 'pointer'; |
230 | 216 |
$flag_color = ''; |
231 |
if (in_array($group["group_id"], $admin->get_groups_id())) { |
|
217 |
if (in_array($group["group_id"], $admin->get_groups_id())) |
|
218 |
{ |
|
232 | 219 |
$flag_disabled = ''; //' disabled'; |
233 | 220 |
$flag_checked = ''; //' checked'; |
234 | 221 |
$flag_cursor = 'default'; |
... | ... | |
245 | 232 |
'CHECKED' => $flag_checked |
246 | 233 |
) |
247 | 234 |
); |
248 |
if(is_numeric(array_search($group['group_id'], $viewing_groups))) { |
|
235 |
if(is_numeric(array_search($group['group_id'], $viewing_groups))) |
|
236 |
{ |
|
249 | 237 |
$template->set_var('CHECKED', 'checked="checked"'); |
250 | 238 |
} else { |
251 |
if (!$flag_checked) $template->set_var('CHECKED', '');
|
|
239 |
if (!$flag_checked) {$template->set_var('CHECKED', '');}
|
|
252 | 240 |
} |
241 |
|
|
253 | 242 |
$template->parse('group_list2', 'group_list_block2', true); |
243 |
|
|
254 | 244 |
} |
245 |
|
|
255 | 246 |
// Show private viewers |
256 |
if($results_array['visibility'] == 'private' OR $results_array['visibility'] == 'registered') { |
|
247 |
if($results_array['visibility'] == 'private' OR $results_array['visibility'] == 'registered') |
|
248 |
{ |
|
257 | 249 |
$template->set_var('DISPLAY_VIEWERS', ''); |
258 | 250 |
} else { |
259 | 251 |
$template->set_var('DISPLAY_VIEWERS', 'display:none;'); |
... | ... | |
261 | 253 |
|
262 | 254 |
//-- insert page_code 20090904--> |
263 | 255 |
$template->set_var('DISPLAY_CODE_PAGE_LIST', ' id="multi_lingual" style="display:none;"'); |
256 |
|
|
264 | 257 |
// Work-out if page languages feature is enabled |
265 | 258 |
if((defined('PAGE_LANGUAGES') && PAGE_LANGUAGES) && $field_set && file_exists(WB_PATH.'/modules/mod_multilingual/update_keys.php') ) |
266 | 259 |
{ |
... | ... | |
274 | 267 |
|
275 | 268 |
// Page_code list |
276 | 269 |
/* $database = new database(); */ |
277 |
function page_code_list($parent) { |
|
270 |
function page_code_list($parent) |
|
271 |
{ |
|
278 | 272 |
global $admin, $database, $template, $results_array, $pageCode; |
279 | 273 |
$default_language = DEFAULT_LANGUAGE; |
280 |
$query = "SELECT * FROM ".TABLE_PREFIX."pages WHERE parent = '$parent' AND language = '$default_language' ORDER BY position ASC"; |
|
281 |
$get_pages = $database->query($query); |
|
282 |
while($page = $get_pages->fetchRow()) { |
|
274 |
|
|
275 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'pages` WHERE `parent` = '.$parent.' AND `language` = "'.$default_language.'" ORDER BY `position` ASC'; |
|
276 |
$get_pages = $database->query($sql); |
|
277 |
|
|
278 |
while($page = $get_pages->fetchRow()) |
|
279 |
{ |
|
283 | 280 |
if($admin->page_is_visible($page)==false) |
284 | 281 |
continue; |
285 | 282 |
$template->set_var('FLAG_CODE_ICON',' none '); |
286 |
if( $page['parent'] == 0 ) { |
|
283 |
if( $page['parent'] == 0 ) |
|
284 |
{ |
|
287 | 285 |
$template->set_var('FLAG_CODE_ICON','url('.THEME_URL.'/images/flags/'.strtolower($page['language']).'.png)'); |
288 | 286 |
} |
289 | 287 |
// If the current page cannot be parent, then its children neither |
290 | 288 |
$list_next_level = true; |
291 | 289 |
// Stop users from adding pages with a level of more than the set page level limit |
292 |
if($page['level']+1 < PAGE_LEVEL_LIMIT) { |
|
290 |
if($page['level']+1 < PAGE_LEVEL_LIMIT) |
|
291 |
{ |
|
293 | 292 |
// Get user perms |
294 | 293 |
$admin_groups = explode(',', str_replace('_', '', $page['admin_groups'])); |
295 | 294 |
$admin_users = explode(',', str_replace('_', '', $page['admin_users'])); |
296 | 295 |
|
297 | 296 |
$in_group = FALSE; |
298 |
foreach($admin->get_groups_id() as $cur_gid){ |
|
297 |
foreach($admin->get_groups_id() as $cur_gid) |
|
298 |
{ |
|
299 | 299 |
if (in_array($cur_gid, $admin_groups)) |
300 | 300 |
{ |
301 | 301 |
$in_group = TRUE; |
302 | 302 |
} |
303 | 303 |
} |
304 | 304 |
|
305 |
if(($in_group) OR is_numeric(array_search($admin->get_user_id(), $admin_users))) { |
|
305 |
if(($in_group) OR is_numeric(array_search($admin->get_user_id(), $admin_users))) |
|
306 |
{ |
|
306 | 307 |
$can_modify = true; |
307 | 308 |
} else { |
308 | 309 |
$can_modify = false; |
... | ... | |
333 | 334 |
page_code_list($page['page_id']); |
334 | 335 |
} |
335 | 336 |
} |
337 |
|
|
336 | 338 |
// Insert code_page values from page to modify |
337 | 339 |
$template->set_block('main_block', 'page_code_list_block', 'page_code_list'); |
338 | 340 |
if($admin->get_permission('pages_add_l0') == true OR $results_array['level'] == 0) { |
... | ... | |
347 | 349 |
$template->parse('page_code_list', 'page_code_list_block', true); |
348 | 350 |
} |
349 | 351 |
// get pagecode form this page_id |
350 |
page_code_list(0); |
|
352 |
page_code_list(0);
|
|
351 | 353 |
} |
352 | 354 |
//-- page code --> |
353 | 355 |
|
354 | 356 |
// Parent page list |
355 | 357 |
/* $database = new database(); */ |
356 |
function parent_list($parent) { |
|
358 |
function parent_list($parent) |
|
359 |
{ |
|
357 | 360 |
global $admin, $database, $template, $results_array,$field_set; |
358 |
$query = "SELECT * FROM ".TABLE_PREFIX."pages WHERE parent = '$parent' ORDER BY position ASC"; |
|
359 |
$get_pages = $database->query($query); |
|
360 |
while($page = $get_pages->fetchRow()) { |
|
361 |
|
|
362 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'pages` WHERE `parent` = '.$parent.' ORDER BY `position` ASC'; |
|
363 |
$get_pages = $database->query($sql); |
|
364 |
|
|
365 |
while($page = $get_pages->fetchRow()) |
|
366 |
{ |
|
361 | 367 |
if($admin->page_is_visible($page)==false) |
362 |
continue; |
|
368 |
{ |
|
369 |
continue; |
|
370 |
} |
|
371 |
|
|
363 | 372 |
// if parent = 0 set flag_icon |
364 | 373 |
$template->set_var('FLAG_ROOT_ICON',' none '); |
365 |
if( $page['parent'] == 0 && $field_set) { |
|
374 |
if( $page['parent'] == 0 && $field_set) |
|
375 |
{ |
|
366 | 376 |
$template->set_var('FLAG_ROOT_ICON','url('.THEME_URL.'/images/flags/'.strtolower($page['language']).'.png)'); |
367 | 377 |
} |
368 | 378 |
// If the current page cannot be parent, then its children neither |
369 | 379 |
$list_next_level = true; |
370 | 380 |
// Stop users from adding pages with a level of more than the set page level limit |
371 |
if($page['level']+1 < PAGE_LEVEL_LIMIT) { |
|
381 |
if($page['level']+1 < PAGE_LEVEL_LIMIT) |
|
382 |
{ |
|
372 | 383 |
// Get user perms |
373 | 384 |
$admin_groups = explode(',', str_replace('_', '', $page['admin_groups'])); |
374 | 385 |
$admin_users = explode(',', str_replace('_', '', $page['admin_users'])); |
375 | 386 |
$in_group = FALSE; |
376 |
foreach($admin->get_groups_id() as $cur_gid){ |
|
377 |
if (in_array($cur_gid, $admin_groups)) { |
|
387 |
foreach($admin->get_groups_id() as $cur_gid) |
|
388 |
{ |
|
389 |
if (in_array($cur_gid, $admin_groups)) |
|
390 |
{ |
|
378 | 391 |
$in_group = TRUE; |
379 | 392 |
} |
380 | 393 |
} |
381 |
if(($in_group) OR is_numeric(array_search($admin->get_user_id(), $admin_users))) { |
|
394 |
if(($in_group) OR is_numeric(array_search($admin->get_user_id(), $admin_users))) |
|
395 |
{ |
|
382 | 396 |
$can_modify = true; |
383 | 397 |
} else { |
384 | 398 |
$can_modify = false; |
... | ... | |
394 | 408 |
'FLAG_ICON' => ' none ', |
395 | 409 |
)); |
396 | 410 |
|
397 |
if($results_array['parent'] == $page['page_id']) { |
|
411 |
if($results_array['parent'] == $page['page_id']) |
|
412 |
{ |
|
398 | 413 |
$template->set_var('SELECTED', ' selected="selected"'); |
399 |
} elseif($results_array['page_id'] == $page['page_id']) { |
|
414 |
} elseif($results_array['page_id'] == $page['page_id']) |
|
415 |
{ |
|
400 | 416 |
$template->set_var('SELECTED', ' disabled="disabled" class="disabled"'); |
401 | 417 |
$list_next_level=false; |
402 |
} elseif($can_modify != true) { |
|
418 |
} elseif($can_modify != true) |
|
419 |
{ |
|
403 | 420 |
$template->set_var('SELECTED', ' disabled="disabled" class="disabled"'); |
404 | 421 |
} else { |
405 | 422 |
$template->set_var('SELECTED', ''); |
... | ... | |
407 | 424 |
$template->parse('page_list2', 'page_list_block2', true); |
408 | 425 |
} |
409 | 426 |
if ($list_next_level) |
410 |
parent_list($page['page_id']); |
|
427 |
{ |
|
428 |
parent_list($page['page_id']); |
|
429 |
} |
|
430 |
|
|
411 | 431 |
} |
412 | 432 |
} |
413 | 433 |
|
414 | 434 |
$template->set_block('main_block', 'page_list_block2', 'page_list2'); |
415 | 435 |
if($admin->get_permission('pages_add_l0') == true OR $results_array['level'] == 0) { |
416 |
if($results_array['parent'] == 0) { |
|
436 |
if($results_array['parent'] == 0) |
|
437 |
{ |
|
417 | 438 |
$selected = ' selected="selected"'; |
418 | 439 |
} else { |
419 | 440 |
$selected = ''; |
... | ... | |
428 | 449 |
} |
429 | 450 |
parent_list(0); |
430 | 451 |
|
431 |
if($modified_ts == 'Unknown') { |
|
452 |
if($modified_ts == 'Unknown') |
|
453 |
{ |
|
432 | 454 |
$template->set_var('DISPLAY_MODIFIED', 'hide'); |
433 | 455 |
} else { |
434 | 456 |
$template->set_var('DISPLAY_MODIFIED', ''); |
435 | 457 |
} |
458 |
|
|
436 | 459 |
// Templates list |
437 | 460 |
$template->set_block('main_block', 'template_list_block', 'template_list'); |
438 |
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' and function = 'template' order by name"); |
|
439 |
if($result->numRows() > 0) { |
|
440 |
while($addon = $result->fetchRow()) { |
|
461 |
|
|
462 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'addons` WHERE `type` = "template" AND `function` = "template" order by `name`'; |
|
463 |
$result = $database->query($sql); |
|
464 |
|
|
465 |
if($result->numRows() > 0) |
|
466 |
{ |
|
467 |
while($addon = $result->fetchRow()) |
|
468 |
{ |
|
441 | 469 |
// Check if the user has perms to use this template |
442 |
if($addon['directory'] == $results_array['template'] OR $admin->get_permission($addon['directory'], 'template') == true) { |
|
470 |
if($addon['directory'] == $results_array['template'] OR $admin->get_permission($addon['directory'], 'template') == true) |
|
471 |
{ |
|
443 | 472 |
$template->set_var('VALUE', $addon['directory']); |
444 | 473 |
$template->set_var('NAME', $addon['name']); |
445 |
if($addon['directory'] == $results_array['template']) { |
|
474 |
if($addon['directory'] == $results_array['template']) |
|
475 |
{ |
|
446 | 476 |
$template->set_var('SELECTED', ' selected="selected"'); |
447 | 477 |
} else { |
448 | 478 |
$template->set_var('SELECTED', ''); |
... | ... | |
453 | 483 |
} |
454 | 484 |
|
455 | 485 |
// Menu list |
456 |
if(MULTIPLE_MENUS == false) { |
|
486 |
if(MULTIPLE_MENUS == false) |
|
487 |
{ |
|
457 | 488 |
$template->set_var('DISPLAY_MENU_LIST', 'display:none;'); |
458 | 489 |
} |
459 | 490 |
// Include template info file (if it exists) |
460 |
if($results_array['template'] != '') { |
|
491 |
if($results_array['template'] != '') |
|
492 |
{ |
|
461 | 493 |
$template_location = WB_PATH.'/templates/'.$results_array['template'].'/info.php'; |
462 | 494 |
} else { |
463 | 495 |
$template_location = WB_PATH.'/templates/'.DEFAULT_TEMPLATE.'/info.php'; |
464 | 496 |
} |
465 |
if(file_exists($template_location)) { |
|
497 |
if(file_exists($template_location)) |
|
498 |
{ |
|
466 | 499 |
require($template_location); |
467 | 500 |
} |
468 | 501 |
// Check if $menu is set |
469 |
if(!isset($menu[1]) OR $menu[1] == '') { |
|
502 |
if(!isset($menu[1]) OR $menu[1] == '') |
|
503 |
{ |
|
470 | 504 |
// Make our own menu list |
471 | 505 |
$menu[1] = $TEXT['MAIN']; |
472 | 506 |
} |
473 | 507 |
// Add menu options to the list |
474 | 508 |
$template->set_block('main_block', 'menu_list_block', 'menu_list'); |
475 |
foreach($menu AS $number => $name) { |
|
509 |
foreach($menu AS $number => $name) |
|
510 |
{ |
|
476 | 511 |
$template->set_var('NAME', $name); |
477 | 512 |
$template->set_var('VALUE', $number); |
478 |
if($results_array['menu'] == $number) { |
|
513 |
if($results_array['menu'] == $number) |
|
514 |
{ |
|
479 | 515 |
$template->set_var('SELECTED', ' selected="selected"'); |
480 | 516 |
} else { |
481 | 517 |
$template->set_var('SELECTED', ''); |
... | ... | |
485 | 521 |
|
486 | 522 |
// Insert language values |
487 | 523 |
$template->set_block('main_block', 'language_list_block', 'language_list'); |
488 |
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' order by name"); |
|
489 |
if($result->numRows() > 0) { |
|
490 |
while($addon = $result->fetchRow()) { |
|
524 |
|
|
525 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'addons` WHERE `type` = "language" ORDER BY `name`'; |
|
526 |
$result = $database->query($sql); |
|
527 |
|
|
528 |
if($result->numRows() > 0) |
|
529 |
{ |
|
530 |
while($addon = $result->fetchRow()) |
|
531 |
{ |
|
491 | 532 |
$l_codes[$addon['name']] = $addon['directory']; |
492 | 533 |
$l_names[$addon['name']] = entities_to_7bit($addon['name']); // sorting-problem workaround |
493 | 534 |
} |
494 | 535 |
asort($l_names); |
495 |
foreach($l_names as $l_name=>$v) { |
|
536 |
foreach($l_names as $l_name=>$v) |
|
537 |
{ |
|
496 | 538 |
// Insert code and name |
497 | 539 |
$template->set_var(array( |
498 | 540 |
'VALUE' => $l_codes[$l_name], |
... | ... | |
500 | 542 |
'FLAG_LANG_ICONS' => 'url('.THEME_URL.'/images/flags/'.strtolower($l_codes[$l_name]).'.png)', |
501 | 543 |
)); |
502 | 544 |
// Check if it is selected |
503 |
if($results_array['language'] == $l_codes[$l_name]) { |
|
545 |
if($results_array['language'] == $l_codes[$l_name]) |
|
546 |
{ |
|
504 | 547 |
$template->set_var('SELECTED', ' selected="selected"'); |
505 | 548 |
} else { |
506 | 549 |
$template->set_var('SELECTED', ''); |
... | ... | |
510 | 553 |
} |
511 | 554 |
|
512 | 555 |
// Select disabled if searching is disabled |
513 |
if($results_array['searching'] == 0) { |
|
556 |
if($results_array['searching'] == 0) |
|
557 |
{ |
|
514 | 558 |
$template->set_var('SEARCHING_DISABLED', ' selected="selected"'); |
515 | 559 |
} |
516 | 560 |
// Select what the page target is |
517 |
switch ($results_array['target']) { |
|
561 |
switch ($results_array['target']) |
|
562 |
{ |
|
518 | 563 |
case '_top': |
519 | 564 |
$template->set_var('TOP_SELECTED', ' selected="selected"'); |
520 | 565 |
break; |
... | ... | |
525 | 570 |
$template->set_var('BLANK_SELECTED', ' selected="selected"'); |
526 | 571 |
break; |
527 | 572 |
} |
528 |
|
|
529 | 573 |
|
530 | 574 |
// Insert language text |
531 | 575 |
$template->set_var(array( |
branches/2.8.x/wb/admin/pages/index.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/** |
|
3 |
* |
|
4 |
* @category admin |
|
5 |
* @package pages |
|
6 |
* @author WebsiteBaker Project |
|
7 |
* @copyright 2004-2009, Ryan Djurovich |
|
8 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
9 |
* @link http://www.websitebaker2.org/ |
|
10 |
* @license http://www.gnu.org/licenses/gpl.html |
|
11 |
* @platform WebsiteBaker 2.8.x |
|
12 |
* @requirements PHP 4.3.4 and higher |
|
13 |
* @version $Id$ |
|
14 |
* @filesource $HeadURL: $ |
|
15 |
* @lastmodified $Date: $ |
|
16 |
* |
|
17 |
*/ |
|
2 | 18 |
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
6 |
|
|
7 |
Website Baker Project <http://www.websitebaker.org/> |
|
8 |
Copyright (C) 2004-2009, Ryan Djurovich |
|
9 |
|
|
10 |
Website Baker is free software; you can redistribute it and/or modify |
|
11 |
it under the terms of the GNU General Public License as published by |
|
12 |
the Free Software Foundation; either version 2 of the License, or |
|
13 |
(at your option) any later version. |
|
14 |
|
|
15 |
Website Baker is distributed in the hope that it will be useful, |
|
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
18 |
GNU General Public License for more details. |
|
19 |
|
|
20 |
You should have received a copy of the GNU General Public License |
|
21 |
along with Website Baker; if not, write to the Free Software |
|
22 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
23 |
|
|
24 |
*/ |
|
25 |
|
|
26 | 19 |
require('../../config.php'); |
27 | 20 |
require_once(WB_PATH.'/framework/class.admin.php'); |
28 | 21 |
$admin = new admin('Pages', 'pages'); |
... | ... | |
40 | 33 |
?> |
41 | 34 |
<ul id="p<?php echo $parent; ?>" <?php if($parent != 0) { echo 'class="page_list" '; if(isset($_COOKIE['p'.$parent]) && $_COOKIE['p'.$parent] == '1'){ echo 'style="display:block"'; }} ?>> |
42 | 35 |
<?php |
36 |
// $database = new database(); |
|
37 |
|
|
43 | 38 |
// Get page list from database |
44 |
$database = new database(); |
|
45 |
if(PAGE_TRASH != 'inline') { |
|
46 |
$query = "SELECT * FROM ".TABLE_PREFIX."pages WHERE parent = '$parent' AND visibility != 'deleted' ORDER BY position ASC"; |
|
39 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'pages` WHERE `parent` = '.$parent; |
|
40 |
$sql .= (PAGE_TRASH != 'inline') ? ' AND `visibility` != "deleted"' : ''; |
|
41 |
$sql .= ' ORDER BY `position` ASC'; |
|
42 |
$get_pages = $database->query($sql); |
|
43 |
/* |
|
44 |
if(PAGE_TRASH != 'inline') |
|
45 |
{ |
|
46 |
$sql = "SELECT * FROM ".TABLE_PREFIX."pages WHERE parent = '$parent' AND visibility != 'deleted' ORDER BY position ASC"; |
|
47 | 47 |
} else { |
48 |
$query = "SELECT * FROM ".TABLE_PREFIX."pages WHERE parent = '$parent' ORDER BY position ASC";
|
|
48 |
$sql = "SELECT * FROM ".TABLE_PREFIX."pages WHERE parent = '$parent' ORDER BY position ASC";
|
|
49 | 49 |
} |
50 |
$get_pages = $database->query($query);
|
|
50 |
*/
|
|
51 | 51 |
// Insert values into main page list |
52 | 52 |
if($get_pages->numRows() > 0) { |
53 | 53 |
while($page = $get_pages->fetchRow()) { |
... | ... | |
55 | 55 |
$admin_groups = explode(',', str_replace('_', '', $page['admin_groups'])); |
56 | 56 |
$admin_users = explode(',', str_replace('_', '', $page['admin_users'])); |
57 | 57 |
$in_group = FALSE; |
58 |
foreach($admin->get_groups_id() as $cur_gid) { |
|
59 |
if (in_array($cur_gid, $admin_groups)) { |
|
58 |
foreach($admin->get_groups_id() as $cur_gid) |
|
59 |
{ |
|
60 |
if (in_array($cur_gid, $admin_groups)) |
|
61 |
{ |
|
60 | 62 |
$in_group = TRUE; |
61 | 63 |
} |
62 | 64 |
} |
63 |
if(($in_group) OR is_numeric(array_search($admin->get_user_id(), $admin_users))) { |
|
64 |
if($page['visibility'] == 'deleted') { |
|
65 |
if(PAGE_TRASH == 'inline') { |
|
65 |
if(($in_group) OR is_numeric(array_search($admin->get_user_id(), $admin_users))) |
|
66 |
{ |
|
67 |
if($page['visibility'] == 'deleted') |
|
68 |
{ |
|
69 |
if(PAGE_TRASH == 'inline') |
|
70 |
{ |
|
66 | 71 |
$can_modify = true; |
67 | 72 |
$editable_pages = $editable_pages+1; |
68 | 73 |
} else { |
69 | 74 |
$can_modify = false; |
70 | 75 |
} |
71 |
} elseif($page['visibility'] != 'deleted') { |
|
76 |
} elseif($page['visibility'] != 'deleted') |
|
77 |
{ |
|
72 | 78 |
$can_modify = true; |
73 | 79 |
$editable_pages = $editable_pages+1; |
74 | 80 |
} |
75 | 81 |
} else { |
76 |
if($page['visibility'] == 'private') { |
|
82 |
if($page['visibility'] == 'private') |
|
83 |
{ |
|
77 | 84 |
continue; |
78 | 85 |
} |
79 | 86 |
else { |
... | ... | |
81 | 88 |
} |
82 | 89 |
} |
83 | 90 |
// Work out if we should show a plus or not |
84 |
if(PAGE_TRASH != 'inline') { |
|
91 |
$sql = 'SELECT `page_id`,`admin_groups`,`admin_users` FROM `'.TABLE_PREFIX.'pages` WHERE `parent` = '.$page['page_id']; |
|
92 |
$sql .= (PAGE_TRASH != 'inline') ? ' AND `visibility` != "deleted"' : ''; |
|
93 |
// $sql .= ' ORDER BY `position` ASC'; |
|
94 |
$get_page_subs = $database->query($sql); |
|
95 |
/* |
|
96 |
if(PAGE_TRASH != 'inline') |
|
97 |
{ |
|
85 | 98 |
$get_page_subs = $database->query("SELECT page_id,admin_groups,admin_users FROM ".TABLE_PREFIX."pages WHERE parent = '".$page['page_id']."' AND visibility!='deleted'"); |
86 | 99 |
} else { |
87 | 100 |
$get_page_subs = $database->query("SELECT page_id,admin_groups,admin_users FROM ".TABLE_PREFIX."pages WHERE parent = '".$page['page_id']."'"); |
88 | 101 |
} |
89 |
if($get_page_subs->numRows() > 0) { |
|
102 |
*/ |
|
103 |
if($get_page_subs->numRows() > 0) |
|
104 |
{ |
|
90 | 105 |
$display_plus = true; |
91 | 106 |
} else { |
92 | 107 |
$display_plus = false; |
... | ... | |
175 | 190 |
<td class="list_actions"> |
176 | 191 |
<?php |
177 | 192 |
// Work-out if we should show the "manage dates" link |
178 |
if(MANAGE_SECTIONS == 'enabled' && $admin->get_permission('pages_modify')==true && $can_modify==true) { |
|
179 |
$query_sections = $database->query("SELECT publ_start, publ_end FROM ".TABLE_PREFIX."sections WHERE page_id = '{$page['page_id']}' AND module != 'menu_link'"); |
|
180 |
if($query_sections->numRows() > 0) { |
|
193 |
if(MANAGE_SECTIONS == 'enabled' && $admin->get_permission('pages_modify')==true && $can_modify==true) |
|
194 |
{ |
|
195 |
|
|
196 |
$sql = 'SELECT `publ_start`, `publ_end` FROM `'.TABLE_PREFIX.'sections`'; |
|
197 |
$sql .= ' WHERE `page_id` = '.$page['page_id'].' AND `module` != "menu_link"'; |
|
198 |
$query_sections = $database->query($sql); |
|
199 |
|
|
200 |
// $query_sections = $database->query("SELECT publ_start, publ_end FROM ".TABLE_PREFIX."sections WHERE page_id = '{$page['page_id']}' AND module != 'menu_link'"); |
|
201 |
|
|
202 |
if($query_sections->numRows() > 0) |
|
203 |
{ |
|
181 | 204 |
$mdate_display=false; |
182 |
while($mdate_res = $query_sections->fetchRow()) { |
|
183 |
if($mdate_res['publ_start']!='0' || $mdate_res['publ_end']!='0') { |
|
205 |
while($mdate_res = $query_sections->fetchRow()) |
|
206 |
{ |
|
207 |
if($mdate_res['publ_start']!='0' || $mdate_res['publ_end']!='0') |
|
208 |
{ |
|
184 | 209 |
$mdate_display=true; |
185 | 210 |
break; |
186 | 211 |
} |
187 | 212 |
} |
188 |
if($mdate_display==1) { |
|
213 |
if($mdate_display==1) |
|
214 |
{ |
|
189 | 215 |
$file=$admin->page_is_active($page)?"clock_16.png":"clock_red_16.png"; |
190 | 216 |
?> |
191 | 217 |
<a href="<?php echo ADMIN_URL; ?>/pages/sections.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $HEADING['MANAGE_SECTIONS']; ?>"> |
192 |
<img src="<?php echo THEME_URL."/images/$file"; ?>" border="0" alt="<?php echo $HEADING['MANAGE_SECTIONS']; ?>" />
|
|
218 |
<img src="<?php echo THEME_URL."/images/$file"; ?>" border="0" alt="<?php echo $HEADING['MANAGE_SECTIONS']; ?>" /> |
|
193 | 219 |
</a> |
194 | 220 |
<?php } else { ?> |
195 | 221 |
<a href="<?php echo ADMIN_URL; ?>/pages/sections.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $HEADING['MANAGE_SECTIONS']; ?>"> |
196 |
<img src="<?php echo THEME_URL; ?>/images/noclock_16.png" border="0" alt="<?php echo $HEADING['MANAGE_SECTIONS']; ?>" /></a>
|
|
222 |
<img src="<?php echo THEME_URL; ?>/images/noclock_16.png" border="0" alt="<?php echo $HEADING['MANAGE_SECTIONS']; ?>" /></a> |
|
197 | 223 |
<?php } ?> |
198 | 224 |
<?php } ?> |
199 | 225 |
<?php } ?> |
... | ... | |
245 | 271 |
</table> |
246 | 272 |
</li> |
247 | 273 |
<?php |
248 |
if ( $page['parent'] = 0) { |
|
274 |
if ( $page['parent'] = 0) |
|
275 |
{ |
|
249 | 276 |
$page_tmp_id = $page['page_id']; |
250 | 277 |
} |
251 | 278 |
// Get subs |
... | ... | |
440 | 467 |
|
441 | 468 |
|
442 | 469 |
// Parent page list |
443 |
$database = new database(); |
|
444 |
function parent_list($parent) { |
|
470 |
// $database = new database(); |
|
471 |
function parent_list($parent) |
|
472 |
{ |
|
445 | 473 |
global $admin, $database, $template, $field_set; |
446 | 474 |
$query = "SELECT * FROM ".TABLE_PREFIX."pages WHERE parent = '$parent' AND visibility!='deleted' ORDER BY position ASC"; |
447 | 475 |
$get_pages = $database->query($query); |
branches/2.8.x/wb/admin/pages/settings2.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/** |
|
3 |
* |
|
4 |
* @category admin |
|
5 |
* @package pages |
|
6 |
* @author WebsiteBaker Project |
|
7 |
* @copyright 2004-2009, Ryan Djurovich |
|
8 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
9 |
* @link http://www.websitebaker2.org/ |
|
10 |
* @license http://www.gnu.org/licenses/gpl.html |
|
11 |
* @platform WebsiteBaker 2.8.x |
|
12 |
* @requirements PHP 4.3.4 and higher |
|
13 |
* @version $Id$ |
|
14 |
* @filesource $HeadURL: $ |
|
15 |
* @lastmodified $Date: $ |
|
16 |
* |
|
17 |
*/ |
|
2 | 18 |
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
6 |
|
|
7 |
Website Baker Project <http://www.websitebaker.org/> |
|
8 |
Copyright (C) 2004-2009, Ryan Djurovich |
|
9 |
|
|
10 |
Website Baker is free software; you can redistribute it and/or modify |
|
11 |
it under the terms of the GNU General Public License as published by |
|
12 |
the Free Software Foundation; either version 2 of the License, or |
|
13 |
(at your option) any later version. |
|
14 |
|
|
15 |
Website Baker is distributed in the hope that it will be useful, |
|
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
18 |
GNU General Public License for more details. |
|
19 |
|
|
20 |
You should have received a copy of the GNU General Public License |
|
21 |
along with Website Baker; if not, write to the Free Software |
|
22 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
23 |
|
|
24 |
* @category backend |
|
25 |
* @package pages |
|
26 |
* @author(s) Dietmar W?llbrink <Luisehahne>, Dietrich Roland Pehlke <Aldus> |
|
27 |
* @platform WB 2.8.x |
|
28 |
* @require PHP 5.2.11 |
|
29 |
* @license http://www.gnu.org/licenses/gpl.html |
|
30 |
* @link http://project.websitebaker2.org/browser/branches/2.8.x/wb/pages |
|
31 |
* @changeset 2009/11/30 workout for page_code field, ex catchwords and multilangual |
|
32 |
|
|
33 |
*/ |
|
34 |
|
|
35 | 19 |
// Get page id |
36 |
if(!isset($_POST['page_id']) OR !is_numeric($_POST['page_id'])) { |
|
20 |
if(!isset($_POST['page_id']) OR !is_numeric($_POST['page_id'])) |
|
21 |
{ |
|
37 | 22 |
header("Location: index.php"); |
38 | 23 |
exit(0); |
39 | 24 |
} else { |
... | ... | |
68 | 53 |
$menu = $admin->get_post_escaped('menu'); |
69 | 54 |
|
70 | 55 |
// Validate data |
71 |
if($page_title == '' || substr($page_title,0,1)=='.') { |
|
56 |
if($page_title == '' || substr($page_title,0,1)=='.') |
|
57 |
{ |
|
72 | 58 |
$admin->print_error($MESSAGE['PAGES']['BLANK_PAGE_TITLE']); |
73 | 59 |
} |
74 |
if($menu_title == '' || substr($menu_title,0,1)=='.') { |
|
60 |
if($menu_title == '' || substr($menu_title,0,1)=='.') |
|
61 |
{ |
|
75 | 62 |
$admin->print_error($MESSAGE['PAGES']['BLANK_MENU_TITLE']); |
76 | 63 |
} |
77 | 64 |
|
78 | 65 |
// Get existing perms |
79 |
$database = new database(); |
|
80 |
$results = $database->query("SELECT parent,link,position,admin_groups,admin_users FROM ".TABLE_PREFIX."pages WHERE page_id = '$page_id'"); |
|
66 |
// $database = new database(); |
|
67 |
|
|
68 |
$sql = 'SELECT `parent`,`link`,`position`,`admin_groups`,`admin_users` FROM `'.TABLE_PREFIX.'pages` WHERE `page_id`='.$page_id; |
|
69 |
$results = $database->query($sql); |
|
70 |
|
|
81 | 71 |
$results_array = $results->fetchRow(); |
82 | 72 |
$old_parent = $results_array['parent']; |
83 | 73 |
$old_link = $results_array['link']; |
... | ... | |
86 | 76 |
$old_admin_users = explode(',', str_replace('_', '', $results_array['admin_users'])); |
87 | 77 |
|
88 | 78 |
// Work-out if we should check for existing page_code |
89 |
$field_sql = $database->query("DESCRIBE ".TABLE_PREFIX."pages page_code"); |
|
79 |
$sql = 'DESCRIBE `'.TABLE_PREFIX.'pages` `page_code`'; |
|
80 |
$field_sql = $database->query($sql); |
|
90 | 81 |
$field_set = $field_sql->numRows(); |
91 | 82 |
|
92 | 83 |
$in_old_group = FALSE; |
... | ... | |
95 | 86 |
$in_old_group = TRUE; |
96 | 87 |
} |
97 | 88 |
} |
98 |
if((!$in_old_group) AND !is_numeric(array_search($admin->get_user_id(), $old_admin_users))) { |
|
89 |
if((!$in_old_group) AND !is_numeric(array_search($admin->get_user_id(), $old_admin_users))) |
|
90 |
{ |
|
99 | 91 |
$admin->print_error($MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS']); |
100 | 92 |
} |
101 | 93 |
|
... | ... | |
113 | 105 |
$viewing_groups = implode(',', $viewing_groups); |
114 | 106 |
|
115 | 107 |
// If needed, get new order |
116 |
if($parent != $old_parent) { |
|
108 |
if($parent != $old_parent) |
|
109 |
{ |
|
117 | 110 |
// Include ordering class |
118 | 111 |
require(WB_PATH.'/framework/class.order.php'); |
119 | 112 |
$order = new order(TABLE_PREFIX.'pages', 'position', 'page_id', 'parent'); |
... | ... | |
126 | 119 |
} |
127 | 120 |
|
128 | 121 |
// Work out level and root parent |
129 |
if ($parent!='0') { |
|
122 |
if ($parent!='0') |
|
123 |
{ |
|
130 | 124 |
$level = level_count($parent)+1; |
131 | 125 |
$root_parent = root_parent($parent); |
132 | 126 |
} |
... | ... | |
136 | 130 |
} |
137 | 131 |
|
138 | 132 |
// Work-out what the link should be |
139 |
if($parent == '0') { |
|
133 |
if($parent == '0') |
|
134 |
{ |
|
140 | 135 |
$link = '/'.page_filename($menu_title); |
141 | 136 |
// rename menu titles: index && intro to prevent clashes with intro page feature and WB core file /pages/index.php |
142 |
if($link == '/index' || $link == '/intro') { |
|
137 |
if($link == '/index' || $link == '/intro') |
|
138 |
{ |
|
143 | 139 |
$link .= '_' .$page_id; |
144 | 140 |
$filename = WB_PATH.PAGES_DIRECTORY.'/'.page_filename($menu_title).'_'.$page_id .PAGE_EXTENSION; |
145 | 141 |
} else { |
146 |
$filename = WB_PATH.PAGES_DIRECTORY.'/'.page_filename($menu_title).PAGE_EXTENSION;
|
|
142 |
$filename = WB_PATH.PAGES_DIRECTORY.'/'.page_filename($menu_title).PAGE_EXTENSION; |
|
147 | 143 |
} |
148 | 144 |
} else { |
149 | 145 |
$parent_section = ''; |
150 | 146 |
$parent_titles = array_reverse(get_parent_titles($parent)); |
151 |
foreach($parent_titles AS $parent_title) { |
|
147 |
foreach($parent_titles AS $parent_title) |
|
148 |
{ |
|
152 | 149 |
$parent_section .= page_filename($parent_title).'/'; |
153 | 150 |
} |
154 |
if($parent_section == '/') { $parent_section = ''; } |
|
151 |
if($parent_section == '/') |
|
152 |
{ |
|
153 |
$parent_section = ''; |
|
154 |
} |
|
155 | 155 |
$link = '/'.$parent_section.page_filename($menu_title); |
156 |
$filename = WB_PATH.PAGES_DIRECTORY.'/'.$parent_section.page_filename($menu_title).PAGE_EXTENSION;
|
|
156 |
$filename = WB_PATH.PAGES_DIRECTORY.'/'.$parent_section.page_filename($menu_title).PAGE_EXTENSION; |
|
157 | 157 |
} |
158 | 158 |
|
159 | 159 |
// Check if a page with same page filename exists |
160 |
$database = new database(); |
|
161 |
$get_same_page = $database->query("SELECT page_id,page_title FROM ".TABLE_PREFIX."pages WHERE link = '$link' and page_id != '$page_id'"); |
|
162 |
if($get_same_page->numRows() > 0) { |
|
160 |
// $database = new database(); |
|
161 |
$sql = 'SELECT `page_id`,`page_title` FROM `'.TABLE_PREFIX.'pages` WHERE `link` = "'.$link.'" AND `page_id` != '.$page_id; |
|
162 |
$get_same_page = $database->query($sql); |
|
163 |
|
|
164 |
if($get_same_page->numRows() > 0) |
|
165 |
{ |
|
163 | 166 |
$admin->print_error($MESSAGE['PAGES']['PAGE_EXISTS']); |
164 | 167 |
} |
165 | 168 |
|
166 | 169 |
// Update page with new order |
167 |
$query = "UPDATE ".TABLE_PREFIX."pages SET parent = '$parent', position = '$position' WHERE page_id = '$page_id'";
|
|
168 |
$database = new database(); |
|
169 |
$database->query($query);
|
|
170 |
$sql = 'UPDATE `'.TABLE_PREFIX.'pages` SET `parent`='.$parent.', `position`='.$position.' WHERE `page_id`='.$page_id.'';
|
|
171 |
// $database = new database();
|
|
172 |
$database->query($sql);
|
|
170 | 173 |
|
171 | 174 |
// Get page trail |
172 | 175 |
$page_trail = get_page_trail($page_id); |
173 | 176 |
|
174 | 177 |
// Update page settings in the pages table |
175 |
if((defined('PAGE_LANGUAGES') && PAGE_LANGUAGES) && $field_set ) |
|
178 |
$sql = 'UPDATE `'.TABLE_PREFIX.'pages` SET '; |
|
179 |
$sql .= '`parent` = '.$parent.', '; |
|
180 |
$sql .= '`page_title` = "'.$page_title.'", '; |
|
181 |
$sql .= '`menu_title` = "'.$menu_title.'", '; |
|
182 |
$sql .= '`menu` = '.$menu.', '; |
|
183 |
$sql .= '`level` = '.$level.', '; |
|
184 |
$sql .= '`page_trail` = "'.$page_trail.'", '; |
|
185 |
$sql .= '`root_parent` = '.$root_parent.', '; |
|
186 |
$sql .= '`link` = "'.$link.'", '; |
|
187 |
$sql .= '`template` = "'.$template.'", '; |
|
188 |
$sql .= '`target` = "'.$target.'", '; |
|
189 |
$sql .= '`description` = "'.$description.'", '; |
|
190 |
$sql .= '`keywords` = "'.$keywords.'", '; |
|
191 |
$sql .= '`position` = '.$position.', '; |
|
192 |
$sql .= '`visibility` = "'.$visibility.'", '; |
|
193 |
$sql .= '`searching` = '.$searching.', '; |
|
194 |
$sql .= '`language` = "'.$language.'", '; |
|
195 |
$sql .= '`admin_groups` = "'.$admin_groups.'", '; |
|
196 |
$sql .= '`viewing_groups` = "'.$viewing_groups.'"'; |
|
197 |
$sql .= (defined('PAGE_LANGUAGES') && PAGE_LANGUAGES) && $field_set && (file_exists(WB_PATH.'/modules/mod_multilingual/update_keys.php')) ? ', `page_code` = "'.$page_code.'" ' : ' '; |
|
198 |
$sql .= 'WHERE `page_id` = '.$page_id; |
|
199 |
$database->query($sql); |
|
200 |
|
|
201 |
$target_url = ADMIN_URL.'/pages/settings.php?page_id='.$page_id; |
|
202 |
if($database->is_error()) |
|
176 | 203 |
{ |
177 |
$query = "UPDATE ".TABLE_PREFIX."pages SET parent = '$parent', page_title = '$page_title', menu_title = '$menu_title', menu = '$menu', level = '$level', page_trail = '$page_trail', root_parent = '$root_parent', link = '$link', template = '$template', target = '$target', description = '$description', keywords = '$keywords', position = '$position', visibility = '$visibility', searching = '$searching', language = '$language', admin_groups = '$admin_groups', viewing_groups = '$viewing_groups', page_code = '$page_code' WHERE page_id = '$page_id'"; |
|
178 |
} else |
|
179 |
{ |
|
180 |
$query = "UPDATE ".TABLE_PREFIX."pages SET parent = '$parent', page_title = '$page_title', menu_title = '$menu_title', menu = '$menu', level = '$level', page_trail = '$page_trail', root_parent = '$root_parent', link = '$link', template = '$template', target = '$target', description = '$description', keywords = '$keywords', position = '$position', visibility = '$visibility', searching = '$searching', language = '$language', admin_groups = '$admin_groups', viewing_groups = '$viewing_groups' WHERE page_id = '$page_id'"; |
|
204 |
$admin->print_error($database->get_error(), $target_url ); |
|
181 | 205 |
} |
182 |
|
|
183 |
$database->query($query); |
|
184 |
|
|
185 | 206 |
// Clean old order if needed |
186 |
if($parent != $old_parent) { |
|
207 |
if($parent != $old_parent) |
|
208 |
{ |
|
187 | 209 |
$order->clean($old_parent); |
188 | 210 |
} |
189 | 211 |
|
190 | 212 |
/* BEGIN page "access file" code */ |
191 | 213 |
|
192 | 214 |
// Create a new file in the /pages dir if title changed |
193 |
if(!is_writable(WB_PATH.PAGES_DIRECTORY.'/')) { |
|
215 |
if(!is_writable(WB_PATH.PAGES_DIRECTORY.'/')) |
|
216 |
{ |
|
194 | 217 |
$admin->print_error($MESSAGE['PAGES']['CANNOT_CREATE_ACCESS_FILE']); |
195 | 218 |
} else { |
196 | 219 |
// First check if we need to create a new file |
197 |
if($old_link != $link) { |
|
220 |
if($old_link != $link) |
|
221 |
{ |
|
198 | 222 |
// Delete old file |
199 | 223 |
$old_filename = WB_PATH.PAGES_DIRECTORY.$old_link.PAGE_EXTENSION; |
200 |
if(file_exists($old_filename)) { |
|
224 |
if(file_exists($old_filename)) |
|
225 |
{ |
|
201 | 226 |
unlink($old_filename); |
202 | 227 |
} |
203 | 228 |
// Create access file |
204 | 229 |
create_access_file($filename,$page_id,$level); |
205 | 230 |
// Move a directory for this page |
206 |
if(file_exists(WB_PATH.PAGES_DIRECTORY.$old_link.'/') AND is_dir(WB_PATH.PAGES_DIRECTORY.$old_link.'/')) { |
|
231 |
if(file_exists(WB_PATH.PAGES_DIRECTORY.$old_link.'/') AND is_dir(WB_PATH.PAGES_DIRECTORY.$old_link.'/')) |
|
232 |
{ |
|
207 | 233 |
rename(WB_PATH.PAGES_DIRECTORY.$old_link.'/', WB_PATH.PAGES_DIRECTORY.$link.'/'); |
208 | 234 |
} |
209 | 235 |
// Update any pages that had the old link with the new one |
210 | 236 |
$old_link_len = strlen($old_link); |
237 |
$sql = ''; |
|
211 | 238 |
$query_subs = $database->query("SELECT page_id,link,level FROM ".TABLE_PREFIX."pages WHERE link LIKE '%$old_link/%' ORDER BY LEVEL ASC"); |
212 |
if($query_subs->numRows() > 0) { |
|
213 |
while($sub = $query_subs->fetchRow()) { |
|
239 |
|
|
240 |
if($query_subs->numRows() > 0) |
|
241 |
{ |
|
242 |
while($sub = $query_subs->fetchRow()) |
|
243 |
{ |
|
214 | 244 |
// Double-check to see if it contains old link |
215 |
if(substr($sub['link'], 0, $old_link_len) == $old_link) { |
|
245 |
if(substr($sub['link'], 0, $old_link_len) == $old_link) |
|
246 |
{ |
|
216 | 247 |
// Get new link |
217 | 248 |
$replace_this = $old_link; |
218 | 249 |
$old_sub_link_len =strlen($sub['link']); |
... | ... | |
223 | 254 |
$database->query("UPDATE ".TABLE_PREFIX."pages SET link = '$new_sub_link', level = '$new_sub_level' WHERE page_id = '".$sub['page_id']."' LIMIT 1"); |
224 | 255 |
// Re-write the access file for this page |
225 | 256 |
$old_subpage_file = WB_PATH.PAGES_DIRECTORY.$new_sub_link.PAGE_EXTENSION; |
226 |
if(file_exists($old_subpage_file)) { |
|
257 |
if(file_exists($old_subpage_file)) |
|
258 |
{ |
|
227 | 259 |
unlink($old_subpage_file); |
228 | 260 |
} |
229 | 261 |
create_access_file(WB_PATH.PAGES_DIRECTORY.$new_sub_link.PAGE_EXTENSION, $sub['page_id'], $new_sub_level); |
... | ... | |
234 | 266 |
} |
235 | 267 |
|
236 | 268 |
// Function to fix page trail of subs |
237 |
function fix_page_trail($parent,$root_parent) { |
|
269 |
function fix_page_trail($parent,$root_parent) |
|
270 |
{ |
|
238 | 271 |
// Get objects and vars from outside this function |
239 | 272 |
global $admin, $template, $database, $TEXT, $MESSAGE; |
240 | 273 |
// Get page list from database |
241 |
$database = new database(); |
|
274 |
// $database = new database();
|
|
242 | 275 |
$query = "SELECT page_id FROM ".TABLE_PREFIX."pages WHERE parent = '$parent'"; |
243 | 276 |
$get_pages = $database->query($query); |
244 | 277 |
// Insert values into main page list |
245 |
if($get_pages->numRows() > 0) { |
|
246 |
while($page = $get_pages->fetchRow()) { |
|
278 |
if($get_pages->numRows() > 0) |
|
279 |
{ |
|
280 |
while($page = $get_pages->fetchRow()) |
|
281 |
{ |
|
247 | 282 |
// Fix page trail |
283 |
|
|
248 | 284 |
$database->query("UPDATE ".TABLE_PREFIX."pages SET ".($root_parent != 0 ?"root_parent = '$root_parent', ":"")." page_trail = '".get_page_trail($page['page_id'])."' WHERE page_id = '".$page['page_id']."'"); |
249 | 285 |
// Run this query on subs |
250 | 286 |
fix_page_trail($page['page_id'],$root_parent); |
251 | 287 |
} |
252 | 288 |
} |
253 | 289 |
} |
290 |
|
|
254 | 291 |
// Fix sub-pages page trail |
255 | 292 |
fix_page_trail($page_id,$root_parent); |
256 | 293 |
|
257 | 294 |
/* END page "access file" code */ |
258 | 295 |
|
296 |
$pagetree_url = ADMIN_URL.'/pages/index.php'; |
|
297 |
$target_url = ADMIN_URL.'/pages/settings.php?page_id='.$page_id; |
|
259 | 298 |
// Check if there is a db error, otherwise say successful |
260 |
if($database->is_error()) { |
|
261 |
$admin->print_error($database->get_error(), ADMIN_URL.'/pages/settings.php?page_id='.$page_id); |
|
299 |
if($database->is_error()) |
|
300 |
{ |
|
301 |
$admin->print_error($database->get_error(), $target_url ); |
|
262 | 302 |
} else { |
263 |
$admin->print_success($MESSAGE['PAGES']['SAVED_SETTINGS'], ADMIN_URL.'/pages/index.php');
|
|
303 |
$admin->print_success($MESSAGE['PAGES']['SAVED_SETTINGS'], $target_url );
|
|
264 | 304 |
} |
265 | 305 |
|
266 | 306 |
// Print admin footer |
267 | 307 |
$admin->print_footer(); |
268 | 308 |
|
269 |
?>
|
|
309 |
?> |
branches/2.8.x/wb/admin/pages/sections.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/** |
|
3 |
* |
Also available in: Unified diff
update headertext