1 |
1030
|
Ruebenwurz
|
<?php
|
2 |
|
|
|
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 |
|
|
// 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 |
1034
|
aldus
|
$template->set_block('main_block', 'droplets_list_block', 'page_list');
|
40 |
1030
|
Ruebenwurz
|
$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 |
1032
|
Ruebenwurz
|
$list = "";
|
45 |
1030
|
Ruebenwurz
|
while($droplet = $get_droplet->fetchRow()) {
|
46 |
|
|
// method page_is_visible was introduced with WB 2.7
|
47 |
|
|
$title = stripslashes($droplet['name']);
|
48 |
|
|
$desc = stripslashes($droplet['description']);
|
49 |
|
|
$comm = stripslashes($droplet['comments']);
|
50 |
|
|
$template->set_var('TITLE', $title);
|
51 |
|
|
$template->set_var('DESC', $desc);
|
52 |
1034
|
aldus
|
$list .= "<div id='".$title."' class='hidden'><b>".$title.": </b> ".$desc."<br>".$comm."</div>";
|
53 |
|
|
$template->parse('page_list', 'droplets_list_block', true);
|
54 |
1030
|
Ruebenwurz
|
}
|
55 |
|
|
} else {
|
56 |
|
|
$template->set_var('TITLE', 'None found');
|
57 |
1034
|
aldus
|
$template->parse('page_list', 'droplets_list_block', false);
|
58 |
1030
|
Ruebenwurz
|
}
|
59 |
|
|
$template->set_var('LIST', $list);
|
60 |
1032
|
Ruebenwurz
|
$template->set_var("CHARSET", defined('DEFAULT_CHARSET') ? DEFAULT_CHARSET : 'utf-8' );
|
61 |
1030
|
Ruebenwurz
|
|
62 |
|
|
// Parse the template object
|
63 |
|
|
$template->parse('main', 'main_block', false);
|
64 |
|
|
$template->pparse('output', 'page');
|
65 |
|
|
|
66 |
|
|
?>
|