Revision 1277
Added by Luisehahne almost 16 years ago
| 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); |
Also available in: Unified diff
update headertext