Project

General

Profile

1
<?php
2

    
3
// $Id: fck_wbdroplets.php 1030 2009-07-04 11:22:03Z Ruebenwurzel $
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
// Include the config file
27
require('../../../../../../config.php');
28

    
29
// Create new admin object
30
require(WB_PATH.'/framework/class.admin.php');
31
$admin = new admin('Pages', 'pages_modify', false);
32

    
33
// Setup the template
34
$template = new Template(WB_PATH.'/modules/fckeditor/fckeditor/editor/plugins/WBDroplets');
35
$template->set_file('page', 'wbdroplets.htt');
36
$template->set_block('page', 'main_block', 'main');
37

    
38
// Get pages and put them into the pages list
39
$template->set_block('main_block', 'page_list_block', 'page_list');
40
$database = new database();
41
$get_droplet = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_droplets where active=1 ORDER BY name");
42
if($get_droplet->numRows() > 0) {
43
	// Loop through pages
44
	while($droplet = $get_droplet->fetchRow()) {
45
		// method page_is_visible was introduced with WB 2.7
46
		$title = stripslashes($droplet['name']);
47
		$desc = stripslashes($droplet['description']);
48
		$comm = stripslashes($droplet['comments']);
49
		$template->set_var('TITLE', $title);
50
		$template->set_var('DESC', $desc);
51
		$list .= "<div id=$title class=hidden><b>$title: </b> $desc<br>$comm</div>";
52
		$template->parse('page_list', 'page_list_block', true);
53
	}
54
} else {
55
	$template->set_var('TITLE', 'None found');
56
	$template->parse('page_list', 'page_list_block', false);
57
}
58
$template->set_var('LIST', $list);
59

    
60
// Parse the template object
61
$template->parse('main', 'main_block', false);
62
$template->pparse('output', 'page');
63

    
64
?>
(1-1/8)