Project

General

Profile

« Previous | Next » 

Revision 1296

Added by Dietmar almost 15 years ago

update headerinfo in module droplets

View differences:

branches/2.8.x/CHANGELOG
12 12

  
13 13
------------------------------------- 2.8.1 -------------------------------------
14 14
19-Feb-2010 Dietmar Woellbrink (Luisehahne)
15
!	update headerinfo in module droplets
16
19-Feb-2010 Dietmar Woellbrink (Luisehahne)
15 17
!	Beginning with Ticket #901 
16 18
+	add siteadd.png to backend themes
17 19
!	change icon add child page
branches/2.8.x/wb/admin/interface/version.php
52 52

  
53 53
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
54 54
if(!defined('VERSION')) define('VERSION', '2.8.x');
55
if(!defined('REVISION')) define('REVISION', '1295');
55
if(!defined('REVISION')) define('REVISION', '1296');
56 56

  
57 57
?>
branches/2.8.x/wb/modules/droplets/delete_droplet.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6
*	@version	1.0
7
*	@author		Ruud Eisinga (Ruud) John (PCWacht)
8
*	@date		June 2009
9
*
10
*	droplets are small codeblocks that are called from anywhere in the template. 
11
* 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]
12
*/
13

  
14
require('../../config.php');
15

  
16
// Get id
17
if(!isset($_GET['droplet_id']) OR !is_numeric($_GET['droplet_id'])) {
18
	header("Location: ".ADMIN_URL."/pages/index.php");
19
} else {
20
	$droplet_id = $_GET['droplet_id'];
21
}
22

  
23
// Include WB admin wrapper script
24
require_once(WB_PATH.'/framework/class.admin.php');
25
require_once(WB_PATH.'/framework/functions.php');
26

  
27
// check website baker platform (with WB 2.7, Admin-Tools were moved out of settings dialogue)
28
if(file_exists(ADMIN_PATH .'/admintools/tool.php')) {
29
	$admintool_link = ADMIN_URL .'/admintools/index.php';
30
	$module_edit_link = ADMIN_URL .'/admintools/tool.php?tool=droplets';
31
	$admin = new admin('admintools', 'admintools');
32
} else {
33
	$admintool_link = ADMIN_URL .'/settings/index.php?advanced=yes#administration_tools"';
34
	$module_edit_link = ADMIN_URL .'/settings/tool.php?tool=droplets';
35
	$admin = new admin('Settings', 'settings_advanced');
36
}
37

  
38
// Delete droplet
39
$database->query("DELETE FROM ".TABLE_PREFIX."mod_droplets WHERE id = '$droplet_id' LIMIT 1");
40

  
41
// Check if there is a db error, otherwise say successful
42
if($database->is_error()) {
43
	$admin->print_error($database->get_error(), WB_URL.'/modules/droplets/modify_droplet.php?droplet_id='.$droplet_id);
44
} else {
45
    $admin->print_success($TEXT['SUCCESS'], $module_edit_link);
46
}
47

  
48
// Print admin footer
49
$admin->print_footer();
50

  
1
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
7
 * @author          WebsiteBaker Project
8
 * @copyright       2004-2009, Ryan Djurovich
9
 * @copyright       2009-2010, Website Baker Org. e.V.
10
 * @link			http://www.websitebaker2.org/
11
 * @license         http://www.gnu.org/licenses/gpl.html
12
 * @platform        WebsiteBaker 2.8.x
13
 * @requirements    PHP 4.4.9 and higher
14
 * @version         $Id$
15
 * @filesource		$HeadURL$
16
 * @lastmodified    $Date$
17
 *
18
 */
19

  
20
require('../../config.php');
21

  
22
// Get id
23
if(!isset($_GET['droplet_id']) OR !is_numeric($_GET['droplet_id'])) {
24
	header("Location: ".ADMIN_URL."/pages/index.php");
25
} else {
26
	$droplet_id = $_GET['droplet_id'];
27
}
28

  
29
// Include WB admin wrapper script
30
require_once(WB_PATH.'/framework/class.admin.php');
31
require_once(WB_PATH.'/framework/functions.php');
32

  
33
// check website baker platform (with WB 2.7, Admin-Tools were moved out of settings dialogue)
34
if(file_exists(ADMIN_PATH .'/admintools/tool.php')) {
35
	$admintool_link = ADMIN_URL .'/admintools/index.php';
36
	$module_edit_link = ADMIN_URL .'/admintools/tool.php?tool=droplets';
37
	$admin = new admin('admintools', 'admintools');
38
} else {
39
	$admintool_link = ADMIN_URL .'/settings/index.php?advanced=yes#administration_tools"';
40
	$module_edit_link = ADMIN_URL .'/settings/tool.php?tool=droplets';
41
	$admin = new admin('Settings', 'settings_advanced');
42
}
43

  
44
// Delete droplet
45
$database->query("DELETE FROM ".TABLE_PREFIX."mod_droplets WHERE id = '$droplet_id' LIMIT 1");
46

  
47
// Check if there is a db error, otherwise say successful
48
if($database->is_error()) {
49
	$admin->print_error($database->get_error(), WB_URL.'/modules/droplets/modify_droplet.php?droplet_id='.$droplet_id);
50
} else {
51
    $admin->print_success($TEXT['SUCCESS'], $module_edit_link);
52
}
53

  
54
// Print admin footer
55
$admin->print_footer();
56

  
51 57
?>
52 58

  
branches/2.8.x/wb/modules/droplets/info.php
1 1
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
7
 * @author          WebsiteBaker Project
8
 * @copyright       2004-2009, Ryan Djurovich
9
 * @copyright       2009-2010, Website Baker Org. e.V.
10
 * @link			http://www.websitebaker2.org/
11
 * @license         http://www.gnu.org/licenses/gpl.html
12
 * @platform        WebsiteBaker 2.8.x
13
 * @requirements    PHP 4.4.9 and higher
14
 * @version         $Id$
15
 * @filesource		$HeadURL$
16
 * @lastmodified    $Date$
17
 *
18
 */
2 19

  
3
// $Id$
4

  
5
/*
6
*	@version	1.0
7
*	@author		Ruud Eisinga (Ruud) John (PCWacht)
8
*	@date		June 2009
9
*
10
*	droplets are small codeblocks that are called from anywhere in the template. 
11
* 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]
12
*/
13

  
14 20
$module_directory = 'droplets';
15 21
$module_name = 'Droplets';
16 22
$module_function = 'tool';
17 23

  
branches/2.8.x/wb/modules/droplets/droplets.php
1 1
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
7
 * @author          WebsiteBaker Project
8
 * @copyright       2004-2009, Ryan Djurovich
9
 * @copyright       2009-2010, Website Baker Org. e.V.
10
 * @link			http://www.websitebaker2.org/
11
 * @license         http://www.gnu.org/licenses/gpl.html
12
 * @platform        WebsiteBaker 2.8.x
13
 * @requirements    PHP 4.4.9 and higher
14
 * @version         $Id$
15
 * @filesource		$HeadURL$
16
 * @lastmodified    $Date$
17
 *
18
 */
2 19

  
3
// $Id$
4

  
5 20
/*
6
*	@version	1.0.2
7
*	@author		Ruud Eisinga (Ruud) John (PCWacht)
8
*	@date		June 2009
9
*
10
*	droplets are small codeblocks that are called from anywhere in the template. 
11
* 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]\
12
*
13
*   1.0.2, bugfix. Reused the evalDroplet function so the extracted parameters will be only available within the scope of the eval and cleared when ready.
14
*/
21
 *	@version	1.0.2
22
 *	@date		June 2009
23
 *
24
 *	droplets are small codeblocks that are called from anywhere in the template.
25
 * 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]\
26
 *
27
 *  1.0.2, bugfix. Reused the evalDroplet function so the extracted parameters will be only available within the scope of the eval and cleared when ready.
28
 */
15 29

  
16 30
function evalDroplets ($wb_page_data) {
17 31
	global $database;
18 32

  
branches/2.8.x/wb/modules/droplets/install.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6
*	@version	1.0
7
*	@author		Ruud Eisinga (Ruud) John (PCWacht)
8
*	@date		June 2009
9
*
10
*	droplets are small codeblocks that are called from anywhere in the template. 
11
* 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]
12
*/
13

  
14
// prevent this file from being accessed directly
15
if(!defined('WB_PATH')) die(header('Location: ../../index.php'));
16

  
17
global $admin;
18

  
19
$table = TABLE_PREFIX .'mod_droplets';
20
$database->query("DROP TABLE IF EXISTS `$table`");
21

  
22
$database->query("CREATE TABLE `$table` (
23
	`id` INT NOT NULL auto_increment,
24
	`name` VARCHAR(32) NOT NULL,
25
	`code` LONGTEXT NOT NULL ,
26
	`description` TEXT NOT NULL,
27
	`modified_when` INT NOT NULL default '0',
28
	`modified_by` INT NOT NULL default '0',
29
	`active` INT NOT NULL default '0',
30
	`admin_edit` INT NOT NULL default '0',
31
	`admin_view` INT NOT NULL default '0',
32
	`show_wysiwyg` INT NOT NULL default '0',
33
	`comments` TEXT NOT NULL,
34
	PRIMARY KEY ( `id` )
35
	)"
36
);
37

  
38
//add all droplets from the droplet subdirectory
39
$folder=opendir(WB_PATH.'/modules/droplets/example/.'); 
40
$names = array();
41
while ($file = readdir($folder)) {
42
	$ext=strtolower(substr($file,-4));
43
	if ($ext==".php"){
44
		if ($file<>"index.php" ) {
45
			$names[count($names)] = $file; 
46
		}
47
	}
48
}
49
closedir($folder);
50

  
51
foreach ($names as $dropfile) {
52
	$droplet = addslashes(getDropletCodeFromFile($dropfile));
53
	if ($droplet != "") {
54
		$description = "Example Droplet";
55
		$comments = "Example Droplet";
56
		$cArray = explode("\n",$droplet);
57
		if (substr($cArray[0],0,3) == "//:") {
58
			$description = trim(substr($cArray[0],3));
59
			array_shift ( $cArray );
60
		}
61
		if (substr($cArray[0],0,3) == "//:") {
62
			$comments = trim(substr($cArray[0],3));
63
			array_shift ( $cArray );
64
		}
65
		$droplet = implode ( "\n", $cArray );
66
		$name = substr($dropfile,0,-4);
67
		$modified_when = time();
68
		$modified_by = method_exists($admin, 'get_user_id') ? $admin->get_user_id() : 1;
69
		$database->query("INSERT INTO `$table`  
70
			(name, code, description, comments, active, modified_when, modified_by) 
71
			VALUES 
72
			('$name', '$droplet', '$description', '$comments', '1', '$modified_when', '$modified_by')");
73
		
74
		// do not output anything if this script is called during fresh installation
75
		if (method_exists($admin, 'get_user_id')) echo "Droplet import: $name<br/>";
76
	}  
77
}
78

  
79
function getDropletCodeFromFile ( $dropletfile ) {
80
	$data = "";
81
	$filename = WB_PATH."/modules/droplets/example/".$dropletfile;
82
	if (file_exists($filename)) {
83
		$filehandle = fopen ($filename, "r");
84
		$data = fread ($filehandle, filesize ($filename));
85
		fclose($filehandle);
86
		// unlink($filename); doesnt work in unix
87
	}	
88
	return $data;
89
}
1
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
7
 * @author          WebsiteBaker Project
8
 * @copyright       2004-2009, Ryan Djurovich
9
 * @copyright       2009-2010, Website Baker Org. e.V.
10
 * @link			http://www.websitebaker2.org/
11
 * @license         http://www.gnu.org/licenses/gpl.html
12
 * @platform        WebsiteBaker 2.8.x
13
 * @requirements    PHP 4.4.9 and higher
14
 * @version         $Id$
15
 * @filesource		$HeadURL$
16
 * @lastmodified    $Date$
17
 *
18
 */
19

  
20
// prevent this file from being accessed directly
21
if(!defined('WB_PATH')) die(header('Location: ../../index.php'));
22

  
23
global $admin;
24

  
25
$table = TABLE_PREFIX .'mod_droplets';
26
$database->query("DROP TABLE IF EXISTS `$table`");
27

  
28
$database->query("CREATE TABLE `$table` (
29
	`id` INT NOT NULL auto_increment,
30
	`name` VARCHAR(32) NOT NULL,
31
	`code` LONGTEXT NOT NULL ,
32
	`description` TEXT NOT NULL,
33
	`modified_when` INT NOT NULL default '0',
34
	`modified_by` INT NOT NULL default '0',
35
	`active` INT NOT NULL default '0',
36
	`admin_edit` INT NOT NULL default '0',
37
	`admin_view` INT NOT NULL default '0',
38
	`show_wysiwyg` INT NOT NULL default '0',
39
	`comments` TEXT NOT NULL,
40
	PRIMARY KEY ( `id` )
41
	)"
42
);
43

  
44
//add all droplets from the droplet subdirectory
45
$folder=opendir(WB_PATH.'/modules/droplets/example/.'); 
46
$names = array();
47
while ($file = readdir($folder)) {
48
	$ext=strtolower(substr($file,-4));
49
	if ($ext==".php"){
50
		if ($file<>"index.php" ) {
51
			$names[count($names)] = $file; 
52
		}
53
	}
54
}
55
closedir($folder);
56

  
57
foreach ($names as $dropfile) {
58
	$droplet = addslashes(getDropletCodeFromFile($dropfile));
59
	if ($droplet != "") {
60
		$description = "Example Droplet";
61
		$comments = "Example Droplet";
62
		$cArray = explode("\n",$droplet);
63
		if (substr($cArray[0],0,3) == "//:") {
64
			$description = trim(substr($cArray[0],3));
65
			array_shift ( $cArray );
66
		}
67
		if (substr($cArray[0],0,3) == "//:") {
68
			$comments = trim(substr($cArray[0],3));
69
			array_shift ( $cArray );
70
		}
71
		$droplet = implode ( "\n", $cArray );
72
		$name = substr($dropfile,0,-4);
73
		$modified_when = time();
74
		$modified_by = method_exists($admin, 'get_user_id') ? $admin->get_user_id() : 1;
75
		$database->query("INSERT INTO `$table`  
76
			(name, code, description, comments, active, modified_when, modified_by) 
77
			VALUES 
78
			('$name', '$droplet', '$description', '$comments', '1', '$modified_when', '$modified_by')");
79
		
80
		// do not output anything if this script is called during fresh installation
81
		if (method_exists($admin, 'get_user_id')) echo "Droplet import: $name<br/>";
82
	}  
83
}
84

  
85
function getDropletCodeFromFile ( $dropletfile ) {
86
	$data = "";
87
	$filename = WB_PATH."/modules/droplets/example/".$dropletfile;
88
	if (file_exists($filename)) {
89
		$filehandle = fopen ($filename, "r");
90
		$data = fread ($filehandle, filesize ($filename));
91
		fclose($filehandle);
92
		// unlink($filename); doesnt work in unix
93
	}	
94
	return $data;
95
}
90 96
?>
91 97

  
branches/2.8.x/wb/modules/droplets/index.php
1
<?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
header('Location: ../index.php');
27

  
1
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
7
 * @author          WebsiteBaker Project
8
 * @copyright       2004-2009, Ryan Djurovich
9
 * @copyright       2009-2010, Website Baker Org. e.V.
10
 * @link			http://www.websitebaker2.org/
11
 * @license         http://www.gnu.org/licenses/gpl.html
12
 * @platform        WebsiteBaker 2.8.x
13
 * @requirements    PHP 4.4.9 and higher
14
 * @version         $Id$
15
 * @filesource		$HeadURL$
16
 * @lastmodified    $Date$
17
 *
18
 */
19

  
20
header('Location: ../index.php');
21

  
28 22
?>
29 23

  
branches/2.8.x/wb/modules/droplets/uninstall.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6
*	@version	1.0
7
*	@author		Ruud Eisinga (Ruud) John (PCWacht)
8
*	@date		June 2009
9
*
10
*	droplets are small codeblocks that are called from anywhere in the template. 
11
* 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]
12
*/
13

  
14
// prevent this file from being accessed directly
15
if(!defined('WB_PATH')) die(header('Location: ../index.php'));
16

  
17
$table = TABLE_PREFIX .'mod_droplets';
18
$database->query("DROP TABLE IF EXISTS `$table`");
19

  
1
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
7
 * @author          WebsiteBaker Project
8
 * @copyright       2004-2009, Ryan Djurovich
9
 * @copyright       2009-2010, Website Baker Org. e.V.
10
 * @link			http://www.websitebaker2.org/
11
 * @license         http://www.gnu.org/licenses/gpl.html
12
 * @platform        WebsiteBaker 2.8.x
13
 * @requirements    PHP 4.4.9 and higher
14
 * @version         $Id$
15
 * @filesource		$HeadURL$
16
 * @lastmodified    $Date$
17
 *
18
 */
19

  
20
// prevent this file from being accessed directly
21
if(!defined('WB_PATH')) die(header('Location: ../index.php'));
22

  
23
$table = TABLE_PREFIX .'mod_droplets';
24
$database->query("DROP TABLE IF EXISTS `$table`");
25

  
20 26
?>
21 27

  
branches/2.8.x/wb/modules/droplets/tool.php
1 1
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
7
 * @author          WebsiteBaker Project
8
 * @copyright       2004-2009, Ryan Djurovich
9
 * @copyright       2009-2010, Website Baker Org. e.V.
10
 * @link			http://www.websitebaker2.org/
11
 * @license         http://www.gnu.org/licenses/gpl.html
12
 * @platform        WebsiteBaker 2.8.x
13
 * @requirements    PHP 4.4.9 and higher
14
 * @version         $Id$
15
 * @filesource		$HeadURL$
16
 * @lastmodified    $Date$
17
 *
18
 */
2 19

  
3
// $Id$
4

  
5
/*
6
*	@version	1.0
7
*	@author		Ruud Eisinga (Ruud) John (PCWacht)
8
*	@date		June 2009
9
*
10
*	droplets are small codeblocks that are called from anywhere in the template. 
11
* 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]
12
*/
13

  
14 20
// Direct access prevention
15 21
defined('WB_PATH') OR die(header('Location: ../index.php'));
16 22

  
17 23

  
branches/2.8.x/wb/modules/droplets/modify_droplet.php
1 1
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
7
 * @author          WebsiteBaker Project
8
 * @copyright       2004-2009, Ryan Djurovich
9
 * @copyright       2009-2010, Website Baker Org. e.V.
10
 * @link			http://www.websitebaker2.org/
11
 * @license         http://www.gnu.org/licenses/gpl.html
12
 * @platform        WebsiteBaker 2.8.x
13
 * @requirements    PHP 4.4.9 and higher
14
 * @version         $Id$
15
 * @filesource		$HeadURL$
16
 * @lastmodified    $Date$
17
 *
18
 */
2 19

  
3
// $Id$
4

  
5
/*
6
*	@version	1.0
7
*	@author		Ruud Eisinga (Ruud) John (PCWacht)
8
*	@date		June 2009
9
*
10
*	droplets are small codeblocks that are called from anywhere in the template. 
11
* 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]
12
*/
13

  
14 20
require('../../config.php');
15 21

  
16 22
// Get id
17 23

  
branches/2.8.x/wb/modules/droplets/add_droplet.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6
*	@version	1.0
7
*	@author		Ruud Eisinga (Ruud) John (PCWacht)
8
*	@date		June 2009
9
*
10
*	droplets are small codeblocks that are called from anywhere in the template. 
11
* 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]
12
*/
13

  
14
require('../../config.php');
15

  
16
require_once(WB_PATH.'/framework/class.admin.php');
17
require_once(WB_PATH.'/framework/functions.php');
18
$admin = new admin('admintools','admintools',false,false);
19
if($admin->get_permission('admintools') == true) {
20
	
21
	$admintool_link = ADMIN_URL .'/admintools/index.php';
22
	$module_edit_link = ADMIN_URL .'/admintools/tool.php?tool=droplets';
23
	$admin = new admin('admintools', 'admintools');
24

  
25
	$modified_when = time();
26
	$modified_by = $admin->get_user_id();
27

  
28
	// Insert new row into database
29
	$database->query("INSERT INTO ".TABLE_PREFIX."mod_droplets (active,modified_when,modified_by) VALUES ('1','$modified_when','$modified_by' )");
30

  
31
	// Get the id
32
	$droplet_id = $database->get_one("SELECT LAST_INSERT_ID()");
33

  
34
	// Say that a new record has been added, then redirect to modify page
35
	if($database->is_error()) {
36
		$admin->print_error($database->get_error(), $module_edit_link);
37
	} else {
38
		$admin->print_success($TEXT['SUCCESS'], WB_URL.'/modules/droplets/modify_droplet.php?droplet_id='.$droplet_id);
39
	}
40

  
41
	// Print admin footer
42
	$admin->print_footer();
43
} else {
44
	die(header('Location: ../../index.php'));
45
} 
1
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
7
 * @author          WebsiteBaker Project
8
 * @copyright       2004-2009, Ryan Djurovich
9
 * @copyright       2009-2010, Website Baker Org. e.V.
10
 * @link			http://www.websitebaker2.org/
11
 * @license         http://www.gnu.org/licenses/gpl.html
12
 * @platform        WebsiteBaker 2.8.x
13
 * @requirements    PHP 4.4.9 and higher
14
 * @version         $Id$
15
 * @filesource		$HeadURL$
16
 * @lastmodified    $Date$
17
 *
18
 */
19

  
20
require('../../config.php');
21

  
22
require_once(WB_PATH.'/framework/class.admin.php');
23
require_once(WB_PATH.'/framework/functions.php');
24
$admin = new admin('admintools','admintools',false,false);
25
if($admin->get_permission('admintools') == true) {
26
	
27
	$admintool_link = ADMIN_URL .'/admintools/index.php';
28
	$module_edit_link = ADMIN_URL .'/admintools/tool.php?tool=droplets';
29
	$admin = new admin('admintools', 'admintools');
30

  
31
	$modified_when = time();
32
	$modified_by = $admin->get_user_id();
33

  
34
	// Insert new row into database
35
	$database->query("INSERT INTO ".TABLE_PREFIX."mod_droplets (active,modified_when,modified_by) VALUES ('1','$modified_when','$modified_by' )");
36

  
37
	// Get the id
38
	$droplet_id = $database->get_one("SELECT LAST_INSERT_ID()");
39

  
40
	// Say that a new record has been added, then redirect to modify page
41
	if($database->is_error()) {
42
		$admin->print_error($database->get_error(), $module_edit_link);
43
	} else {
44
		$admin->print_success($TEXT['SUCCESS'], WB_URL.'/modules/droplets/modify_droplet.php?droplet_id='.$droplet_id);
45
	}
46

  
47
	// Print admin footer
48
	$admin->print_footer();
49
} else {
50
	die(header('Location: ../../index.php'));
51
} 
46 52
?>
47 53

  
branches/2.8.x/wb/modules/droplets/backup_droplets.php
1 1
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
7
 * @author          WebsiteBaker Project
8
 * @copyright       2004-2009, Ryan Djurovich
9
 * @copyright       2009-2010, Website Baker Org. e.V.
10
 * @link			http://www.websitebaker2.org/
11
 * @license         http://www.gnu.org/licenses/gpl.html
12
 * @platform        WebsiteBaker 2.8.x
13
 * @requirements    PHP 4.4.9 and higher
14
 * @version         $Id$
15
 * @filesource		$HeadURL$
16
 * @lastmodified    $Date$
17
 *
18
 */
2 19

  
3
// $Id$
4

  
5
/*
6
*	@version	1.0
7
*	@author		Ruud Eisinga (Ruud) John (PCWacht)
8
*	@date		June 2009
9
*
10
*/
11

  
12 20
// tool_edit.php
13 21
require_once('../../config.php');
14 22
require_once(WB_PATH.'/framework/class.admin.php');
15 23

  
branches/2.8.x/wb/modules/droplets/save_droplet.php
1 1
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
7
 * @author          WebsiteBaker Project
8
 * @copyright       2004-2009, Ryan Djurovich
9
 * @copyright       2009-2010, Website Baker Org. e.V.
10
 * @link			http://www.websitebaker2.org/
11
 * @license         http://www.gnu.org/licenses/gpl.html
12
 * @platform        WebsiteBaker 2.8.x
13
 * @requirements    PHP 4.4.9 and higher
14
 * @version         $Id$
15
 * @filesource		$HeadURL$
16
 * @lastmodified    $Date$
17
 *
18
 */
2 19

  
3
// $Id$
4

  
5
/*
6
*	@version	1.0
7
*	@author		Ruud Eisinga (Ruud) John (PCWacht)
8
*	@date		June 2009
9
*
10
*	droplets are small codeblocks that are called from anywhere in the template. 
11
* 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]
12
*/
13

  
14 20
require('../../config.php');
15 21

  
16 22
// Get id
17 23

  
branches/2.8.x/wb/modules/droplets/upgrade.php
1 1
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
7
 * @author          WebsiteBaker Project
8
 * @copyright       2004-2009, Ryan Djurovich
9
 * @copyright       2009-2010, Website Baker Org. e.V.
10
 * @link			http://www.websitebaker2.org/
11
 * @license         http://www.gnu.org/licenses/gpl.html
12
 * @platform        WebsiteBaker 2.8.x
13
 * @requirements    PHP 4.4.9 and higher
14
 * @version         $Id$
15
 * @filesource		$HeadURL$
16
 * @lastmodified    $Date$
17
 *
18
 */
2 19

  
3
// $Id$
4

  
5
/*
6
*	@version	1.0
7
*	@author		Ruud Eisinga (Ruud) John (PCWacht)
8
*	@date		June 2009
9
*
10
*
11
*	droplets are small codeblocks that are called from anywhere in the template. 
12
* 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]
13
*/
14

  
15 20
if(!defined('WB_PATH')) die(header('Location: ../../index.php'));
16 21

  
17 22
$table = TABLE_PREFIX .'mod_droplets';
18 23

  

Also available in: Unified diff