Project

General

Profile

« Previous | Next » 

Revision 989

Added by aldus over 15 years ago

Add Droplets Modul to the project and the modificated files (index, seach and frontendfunctions)

View differences:

trunk/wb/framework/frontend.functions.php
338 338
		// define default baselink and filename for optional module javascript and stylesheet files
339 339
		$head_links = "";
340 340
		if($file_id == "css") {
341
      $base_link = '<link href="'.WB_URL.'/modules/{MODULE_DIRECTORY}/frontend.css"'; 
341
			$base_link = '<link href="'.WB_URL.'/modules/{MODULE_DIRECTORY}/frontend.css"'; 
342 342
			$base_link.= ' rel="stylesheet" type="text/css" media="screen" />';
343 343
			$base_file = "frontend.css";
344 344
		} else {
......
346 346
			$base_file = "frontend.js";
347 347
		}
348 348

  
349
  	// gather information for all models embedded on actual page
349
		// gather information for all models embedded on actual page
350 350
		$page_id = $wb->page_id;
351
    $query_modules = $database->query("SELECT module FROM " .TABLE_PREFIX ."sections 
352
			WHERE page_id=$page_id AND module<>'wysiwyg'");
351
		$query_modules = $database->query("SELECT module FROM " .TABLE_PREFIX ."sections 
352
				WHERE page_id=$page_id AND module<>'wysiwyg'");
353 353

  
354
    while($row = $query_modules->fetchRow()) {
355
		// check if page module directory contains a frontend.js or frontend.css file
356
    	if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file")) {
357
				// create link with frontend.js or frontend.css source for the current module
354
		while($row = $query_modules->fetchRow()) {
355
			// check if page module directory contains a frontend.js or frontend.css file
356
			if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file")) {
357
					// create link with frontend.js or frontend.css source for the current module
358 358
				$tmp_link = str_replace("{MODULE_DIRECTORY}", $row['module'], $base_link);
359 359

  
360
        // define constant indicating that the register_frontent_files was invoked
360
				// define constant indicating that the register_frontent_files was invoked
361 361
				if($file_id == 'css') {
362 362
					if(!defined('MOD_FRONTEND_CSS_REGISTERED')) define('MOD_FRONTEND_CSS_REGISTERED', true);
363 363
				} else {
364 364
					if(!defined('MOD_FRONTEND_JAVASCRIPT_REGISTERED')) define('MOD_FRONTEND_JAVASCRIPT_REGISTERED', true);
365 365
				}
366

  
367
        // ensure that frontend.js or frontend.css is only added once per module type
368
        if(strpos($head_links, $tmp_link) === false) {
366
				// ensure that frontend.js or frontend.css is only added once per module type
367
				if(strpos($head_links, $tmp_link) === false) {
369 368
					$head_links .= $tmp_link ."\n";
370 369
				}
371
			}
372
    }
373
  	// include the Javascript email protection function
374
  	if($file_id != 'css' && file_exists(WB_PATH .'/modules/output_filter/js/mdcr.js')) {
375
			$head_links .= '<script type="text/javascript" src="'.WB_URL.'/modules/output_filter/js/mdcr.js"></script>' ."\n";
370
			};
376 371
		}
377
  		
378
		// write out links with all external module javascript/CSS files, remove last line feed
372

  
373
		// include the Javascript email protection function
374
		if( $file_id != 'css' && file_exists(WB_PATH .'/modules/droplets/js/mdcr.js')) {
375
			$head_links .= '<script type="text/javascript" src="'.WB_URL.'/modules/droplets/js/mdcr.js"></script>\n';
376
		} elseif( $file_id != 'css' && file_exists(WB_PATH .'/modules/output_filter/js/mdcr.js')) {
377
			$head_links .= '<script type="text/javascript" src="'.WB_URL.'/modules/output_filter/js/mdcr.js"></script>\n';
378
		}
379 379
		echo $head_links;
380 380
	}
381 381
}
trunk/wb/index.php
92 92
	}
93 93
}
94 94

  
95
if(file_exists(WB_PATH .'/modules/output_filter/filter-routines.php')) {
96
	// reconnect to database
97
	$database = new database();
98
	// include the output filter module routines
99
	@require_once(WB_PATH .'/modules/output_filter/filter-routines.php');
100
	
101
	if(function_exists('filter_frontend_output')) {
102
		// store output in variable for filtering
103
		@ob_start();
104
		require(WB_PATH.'/templates/'.TEMPLATE.'/index.php');
105
		$frontend_output = ob_get_contents();
106
		@ob_end_clean();
107
		// Display the filtered output on the frontend
108
		echo filter_frontend_output($frontend_output);
109
		die;
110
	}
111
}	
95
// Backwards compatible Frontend filter support
96
// include the output filter module routines
97
if(file_exists(WB_PATH .'/modules/output_filter/filter-routines.php')) {@require_once(WB_PATH .'/modules/output_filter/filter-routines.php');}
98
// Load Droplet engine
99
if(file_exists(WB_PATH .'/modules/droplets/droplets.php')) { @require_once(WB_PATH .'/modules/droplets/droplets.php'); }
112 100

  
113
// Display the template (no output filtering)
101
//Get pagecontent in buffer for Droplets and/or Filter operations
102
ob_start();
114 103
require(WB_PATH.'/templates/'.TEMPLATE.'/index.php');
104
$output = ob_get_contents();
105
ob_end_clean();
115 106

  
107
if(function_exists('evalDroplets')) { $output = evalDroplets($output); }
108
if(function_exists('filter_frontend_output')) { $output = filter_frontend_output($output); }
109
echo $output;
110

  
116 111
?>
trunk/wb/search/search.php
196 196
	$string = preg_replace('/\s+/', ' ', $string);
197 197
	$string = trim($string);
198 198
	// remove some bad chars
199
	$string = str_replace ( array('[[',']]'),'', $string);
199 200
	$string = preg_replace('/(^|\s+)[|.]+(?=\s+|$)/', '', $string);
200 201
	$search_display_string = htmlspecialchars($string);
201 202
	$search_entities_string = addslashes(umlauts_to_entities(htmlspecialchars($string)));
trunk/wb/search/search_modext.php
89 89
	$match_array = array();
90 90
	$excerpt_array = array();
91 91
	$word = '('.implode('|', $search_words).')';
92

  
93
	//Filter droplets from the page data
94
	preg_match_all('~\[\[(.*?)\]\]~', $text, $matches);
95
	foreach ($matches[1] as $match) {
96
		$text = str_replace('[['.$match.']]', '', $text);					
97
	}
98

  
92 99
	// Build the regex-string
93 100
	if(strpos(strtoupper(PHP_OS), 'WIN')===0) { // windows -> see below
94 101
		$str1=".!?;";
......
123 130
	} else { // compatible, but may be very slow with large pages
124 131
		if(preg_match_all($regex, $text, $match_array)) {
125 132
			foreach($match_array[1] AS $string) {
126
				if(!preg_match('/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\./', $string)) // skip excerpts with email-addresses
133
				if(!preg_match('/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\./', $string))  // skip excerpts with email-addresses
127 134
					$excerpt_array[] = trim($string);
135
				
128 136
			}
129 137
		}
130 138
	}
trunk/wb/modules/droplets/delete_droplet.php
1
<?php
2
/*
3
*	@version	1.0
4
*	@author		Ruud Eisinga (Ruud) John (PCWacht)
5
*	@date		June 2009
6
*
7
*	droplets are small codeblocks that are called from anywhere in the template. 
8
* 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]
9
*/
10

  
11
require('../../config.php');
12

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

  
20
// Include WB admin wrapper script
21
require_once(WB_PATH.'/framework/class.admin.php');
22
require_once(WB_PATH.'/framework/functions.php');
23

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

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

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

  
45
// Print admin footer
46
$admin->print_footer();
47

  
48
?>
0 49

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

  
11
$module_directory = 'droplets';
12
$module_name = 'Droplets';
13
$module_function = 'tool';
14
$module_version = '1.0.0';
15
$module_platform = '2.8.x';
16
$module_author = 'Ruud and pcwacht';
17
$module_license = 'GPL';
18
$module_description = 'This tool allows you to manage your local Droplets.';
19

  
20
$module_home = 'http://www.websitebakers.com/pages/droplets/about-droplets.php';
21
$module_guid = '9F2AC2DF-C3E1-4E15-BA4C-2A86E37FE6E5';
22
?>
0 23

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

  
11
function evalDroplets ($wb_page_data) {
12
	global $database;
13
	$parameter = array();
14
	preg_match_all('~\[\[(.*?)\]\]~', $wb_page_data, $matches);
15
	foreach ($matches[1] as $match) {
16
		if (strpos($match,"?")) {
17
			list ($droplet,$params) = explode("?",$match);
18
			if(!empty($params)) {
19
				$params = str_replace("&amp;", "&", $params); // replace &amp; to single &
20
				$paramarray = explode("&",$params); //create array of parms as parm=value
21
				foreach ($paramarray as $paramelement) {
22
					$parameterTemp = explode("=", $paramelement,2);
23
					if (count($parameterTemp) == 2)
24
						$parameter[$parameterTemp[0]] = $parameterTemp[1];
25
					else
26
						$parameter['parm'] = $parameterTemp[0];
27
				}
28
			}
29
		} else {
30
			$droplet = $match;
31
			$parameter = "";
32
		}
33
		$query_content = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_droplets WHERE name = '$droplet' AND active = 1 ");
34
		if ($query_content && $query_content->numRows() > 0){
35
			$fetch_content = $query_content->fetchRow();
36
			$codedata = ($fetch_content['code']);
37
			if(is_array($parameter)) extract($parameter, EXTR_SKIP);
38
			$newvalue = eval($codedata);
39
			if ($newvalue == "" && !$newvalue === true) 
40
				$newvalue = "<font color=\"red\">Error in: $match, no correct returnvalue.</font>";
41
			if ($newvalue === true) 
42
				$newvalue = "";
43
			$wb_page_data = str_replace("[[".$match."]]", $newvalue, $wb_page_data);
44
		}
45
	}
46
	return $wb_page_data;
47
}
48
?>
0 49

  
trunk/wb/modules/droplets/example/PreviousPage.php
1
//:Create a previous link to your page
2
//:Display a link to the previous page on the same menu level
3
$info = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, '[if(class==menu-current){[level] [sib] [sibCount] [parent]}]', '', '', '');
+list($nLevel, $nSib, $nSibCount, $nParent) = explode(' ', $info);
+
+// show previous
+$prv = $nSib > 1 ? $nSib - 1 : 0;
+if ($prv > 0) { 
+return show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, "[if(sib==$prv){[a][menu_title]</a> &lt;&lt;}]", '', '', '');
+}
+else 
+return '(no previous)';
+
Index: trunk/wb/modules/droplets/example/Text2Image.php
trunk/wb/modules/droplets/example/Text2Image.php
1
//:Create an image from the textparameter
2
//:Use [[text2image?text=The text to create]]
3
//clean up old files..
+$dir = WB_PATH.'/temp/';
+$dp = opendir($dir) or die ('Could not open '.$dir);
+while ($file = readdir($dp)) {
+	if ((eregi('img_',$file)) && (filemtime($dir.$file)) < (strtotime('-10 minutes'))) {
+		unlink($dir.$file);
+	}
+}
+closedir($dp);
+
+$imgfilename = 'img_'.rand().'_'.time().'.jpg';
+//create image
+$padding = 0;
+$font = 3;  	
+
+$height = imagefontheight($font) + ($padding * 2);
+$width = imagefontwidth($font) * strlen($text) + ($padding * 2);
+$image_handle = imagecreatetruecolor($width, $height);
+$text_color = imagecolorallocate($image_handle, 0, 0, 0);
+$background_color = imagecolorallocate($image_handle, 255, 255, 255);
+$bg_height = imagesy($image_handle);
+$bg_width = imagesx($image_handle);
+imagefilledrectangle($image_handle, 0, 0, $bg_width, $bg_height, $background_color);
+imagestring($image_handle, $font, $padding, $padding, $text, $text_color);
+imagejpeg($image_handle,WB_PATH.'/temp/'.$imgfilename,100);
+imagedestroy($image_handle);
+
+return '<img src="'.WB_URL.'/temp/'.$imgfilename.'" style="border:0px;margin:0px;padding:0px;vertical-align:middle;" />';
trunk/wb/modules/droplets/example/NextPage.php
1
//:Create a next link to your page
2
//:Display a link to the next page on the same menu level
3
$info = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, '[if(class==menu-current){[level] [sib] [sibCount] [parent]}]', '', '', '');
+list($nLevel, $nSib, $nSibCount, $nParent) = explode(' ', $info);
+
+// show next
+$nxt = $nSib < $nSibCount ? $nSib + 1 : 0;
+if ($nxt > 0) {
+return show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER,	"[if(sib==$nxt){&gt;&gt; [a][menu_title]</a>}]", '', '', '');
+}
+else return '(no next)';
Index: trunk/wb/modules/droplets/example/Oneliner.php
trunk/wb/modules/droplets/example/Oneliner.php
1
//:Create a random oneliner on your page
2
//:Use: [[OneLiner]]. The file with the oneliner data is located in /modules/droplets/example/oneliners.txt
3
$line = file (dirname(__FILE__)."/example/oneliners.txt");
+shuffle($line);
+return $line[0]; 
Index: trunk/wb/modules/droplets/example/Skype.php
trunk/wb/modules/droplets/example/Skype.php
1
//:Your skype status as an image
2
//:Commandline to use: [[skype?user=skypename]]
3
return '<img src="http://mystatus.skype.com/'.$user.'.png?t='.time().'" alt="My Skype status" />';
trunk/wb/modules/droplets/example/EmailFilter.php
1
//:Emailfiltering on your output - output filtering with the options below - Mailto links can be encrypted by a Javascript 
2
//:usage:  [[EmailFilter]] 
+ 
3
// You can configure the output filtering with the options below.
4
// Tip: Mailto links can be encrypted by a Javascript function. 
5
// To make use of this option, one needs to add the PHP code 
6
//       register_frontend_modfiles('js');
7
// into the <head> section of the index.php of your template. 
8
// Without this modification, only the @ character in the mailto part will be replaced.
9

  
10
// Basic Email Configuration: 
11
// Filter Email addresses in text 0 = no, 1 = yes - default 1
12
$filter_settings['email_filter'] = '1';
13

  
14
// Filter Email addresses in mailto links 0 = no, 1 = yes - default 1
15
$filter_settings['mailto_filter'] = '1';
16

  
17
// Email Replacements, replace the '@' and the '.' by default (at) and (dot)
18
$filter_settings['at_replacement']  = '(at)';
19
$filter_settings['dot_replacement'] = '(dot)';
20

  
21
// No need to change stuff underneatch unless you know what you are doing.
22

  
23
// work out the defined output filter mode: possible output filter modes: [0], 1, 2, 3, 6, 7
24
// 2^0 * (0.. disable, 1.. enable) filtering of mail addresses in text
25
// 2^1 * (0.. disable, 1.. enable) filtering of mail addresses in mailto links
26
// 2^2 * (0.. disable, 1.. enable) Javascript mailto encryption (only if mailto filtering enabled)
27

  
28
// only filter output if we are supposed to
29
if($filter_settings['email_filter'] != '1' && $filter_settings['mailto_filter'] != '1'){
30
	// nothing to do ...
31
	return true;
32
}
33

  
34
// check if non mailto mail addresses needs to be filtered
35
$output_filter_mode = ($filter_settings['email_filter'] == '1') ? 1 : 0;		// 0|1
36
	
37
// check if mailto mail addresses needs to be filtered
38
if($filter_settings['mailto_filter'] == '1') {
39
	$output_filter_mode = $output_filter_mode + 2;								// 0|2
40
					
41
	// check if Javascript mailto encryption is enabled (call register_frontend_functions in the template)
42
	$search = '<script type="text/javascript" src="' .WB_URL .'/modules/droplets/js/mdcr.js"></script>';
43
	if(strpos($wb_page_data, $search) !== false) { 
44
		$output_filter_mode = $output_filter_mode + 4;							// 0|4
45
	}
46
}
47
		
48
// define some constants so we do not call the database in the callback function again
49
define('OUTPUT_FILTER_MODE', (int) $output_filter_mode);
50
define('OUTPUT_FILTER_AT_REPLACEMENT', $filter_settings['at_replacement']);
51
define('OUTPUT_FILTER_DOT_REPLACEMENT', $filter_settings['dot_replacement']);
52
	
53
// function to filter mail addresses embedded in text or mailto links before outputing them on the frontend
54
if (!function_exists('filter_mail_addresses')) {
55
	function filter_mail_addresses($match) { 
56
		
57
	// check if required output filter mode is defined
58
		if(!(defined('OUTPUT_FILTER_MODE') && defined('OUTPUT_FILTER_MODE') && defined('OUTPUT_FILTER_MODE'))) {
59
			return $match[0];
60
		}
61
		
62
		$search = array('@', '.');
63
		$replace = array(OUTPUT_FILTER_AT_REPLACEMENT ,OUTPUT_FILTER_DOT_REPLACEMENT);
64
		
65
		// check if the match contains the expected number of subpatterns (6|8)
66
		if(count($match) == 8) {
67
			/**
68
				OUTPUT FILTER FOR EMAIL ADDRESSES EMBEDDED IN TEXT
69
			**/
70
			
71
			// 1.. text mails only, 3.. text mails + mailto (no JS), 7 text mails + mailto (JS)
72
			if(!in_array(OUTPUT_FILTER_MODE, array(1,3,7))) return $match[0];
73

  
74
			// do not filter mail addresses included in input tags (<input ... value = "test@mail)
75
			if (strpos($match[6], 'value') !== false) return $match[0];
76
			
77
			// filtering of non mailto email addresses enabled
78
			return str_replace($search, $replace, $match[0]);
79
				
80
		} elseif(count($match) == 6) {
81
			/**
82
				OUTPUT FILTER FOR EMAIL ADDRESSES EMBEDDED IN MAILTO LINKS
83
			**/
84

  
85
			// 2.. mailto only (no JS), 3.. text mails + mailto (no JS), 6.. mailto only (JS), 7.. all filters active
86
			if(!in_array(OUTPUT_FILTER_MODE, array(2,3,6,7))) return $match[0];
87
			
88
			// check if last part of the a href link: >xxxx</a> contains a email address we need to filter
89
			$pattern = '#[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}#i';
90
			if(preg_match_all($pattern, $match[5], $matches)) {
91
				foreach($matches as $submatch) {
92
					foreach($submatch as $value) {
93
						// replace all . and all @ in email address parts by (dot) and (at) strings
94
						$match[5] = str_replace($value, str_replace($search, $replace, $value), $match[5]);
95
					}
96
				}
97
			}
98

  
99
			// check if Javascript encryption routine is enabled
100
			if(in_array(OUTPUT_FILTER_MODE, array(6,7))) {
101
				/** USE JAVASCRIPT ENCRYPTION FOR MAILTO LINKS **/
102
				
103
				// extract possible class and id attribute from ahref link
104
				preg_match('/class\s*?=\s*?("|\')(.*?)\1/ix', $match[0], $class_attr);
105
				$class_attr = empty($class_attr) ? '' : 'class="' . $class_attr[2] . '" ';
106
				preg_match('/id\s*?=\s*?("|\')(.*?)\1/ix', $match[0], $id_attr);
107
				$id_attr = empty($id_attr) ? '' : 'id="' . $id_attr[2] . '" ';
108
				
109
				// preprocess mailto link parts for further usage
110
				$search = array('@', '.', '_', '-'); $replace = array('F', 'Z', 'X', 'K');
111
				$email_address = str_replace($search, $replace, strtolower($match[2]));
112
				$email_subject = rawurlencode(html_entity_decode($match[3]));
113
				
114
				// create a random encryption key for the Caesar cipher
115
				mt_srand((double)microtime()*1000000);	// (PHP < 4.2.0)
116
				$shift = mt_rand(1, 25);
117
				
118
				// encrypt the email using an adapted Caesar cipher
119
		  		$encrypted_email = "";
120
				for($i = strlen($email_address) -1; $i > -1; $i--) {
121
					if(preg_match('#[FZXK0-9]#', $email_address[$i], $characters)) {
122
						$encrypted_email .= $email_address[$i];
123
					} else {	
124
						$encrypted_email .= chr((ord($email_address[$i]) -97 + $shift) % 26 + 97);
125
					}
126
				}
127
				$encrypted_email .= chr($shift + 97);
128

  
129
				// build the encrypted Javascript mailto link
130
				$mailto_link  = "<a {$class_attr}{$id_attr}href=\"javascript:mdcr('$encrypted_email','$email_subject')\">" .$match[5] ."</a>";
131
				
132
				return $mailto_link;	
133

  
134
			} else {
135
				/** DO NOT USE JAVASCRIPT ENCRYPTION FOR MAILTO LINKS **/
136

  
137
				// as minimum protection, replace replace @ in the mailto part by (at)
138
				// dots are not transformed as this would transform my.name@domain.com into: my(dot)name(at)domain(dot)com
139
				
140
				// rebuild the mailto link from the subpatterns (at the missing characters " and </a>")
141
				return $match[1] .str_replace('@', OUTPUT_FILTER_AT_REPLACEMENT, $match[2]) .$match[3] .'"' .$match[4] .$match[5] .'</a>';
142
				// if you want to protect both, @ and dots, comment out the line above and remove the comment from the line below
143
				// return $match[1] .str_replace($search, $replace, $match[2]) .$match[3] .'"' .$match[4] .$match[5] .'</a>';
144
			}
145
		
146
		}
147
		
148
		// number of subpatterns do not match the requirements ... do nothing
149
		return $match[0];
150
	}		
151
}
152
	
153
// first search part to find all mailto email addresses
154
$pattern = '#(<a[^<]*href\s*?=\s*?"\s*?mailto\s*?:\s*?)([A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4})([^"]*?)"([^>]*>)(.*?)</a>';
155
// second part to find all non mailto email addresses
156
$pattern .= '|(value\s*=\s*"|\')??\b([A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4})\b#i';
157

  
158
// Sub 1:\b(<a.[^<]*href\s*?=\s*?"\s*?mailto\s*?:\s*?)		-->	"<a id="yyy" class="xxx" href = " mailto :" ignoring white spaces
159
// Sub 2:([A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4})		-->	the email address in the mailto: part of the mail link
160
// Sub 3:([^"]*?)"							--> possible ?Subject&cc... stuff attached to the mail address
161
// Sub 4:([^>]*>)							--> all class or id statements after the mailto but before closing ..>
162
// Sub 5:(.*?)</a>\b						--> the mailto text; all characters between >xxxxx</a>
163
// Sub 6:|\b([A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4})\b		--> email addresses which may appear in the text (require word boundaries)
164
$content = $wb_page_data;			
165
// find all email addresses embedded in the content and filter them using a callback function
166
$content = preg_replace_callback($pattern, 'filter_mail_addresses', $content);
167
$wb_page_data = $content;
168
return true;
169
		
trunk/wb/modules/droplets/example/Lorem.php
1
//:Create Lorum Ipsum text
2
//:Use: [[Lorem?blocks=6]] (max 6 paragraphs)
3
$lorem = array();
4
$lorem[] = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut odio. Nam sed est. Nam a risus et est iaculis adipiscing. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Integer ut justo. In tincidunt viverra nisl. Donec dictum malesuada magna. Curabitur id nibh auctor tellus adipiscing pharetra. Fusce vel justo non orci semper feugiat. Cras eu leo at purus ultrices tristique.<br /><br />";
5
$lorem[] = "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.<br /><br />";
6
$lorem[] = "Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.<br /><br />";
7
$lorem[] = "Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.<br /><br />";
8
$lorem[] = "Cras consequat magna ac tellus. Duis sed metus sit amet nunc faucibus blandit. Fusce tempus cursus urna. Sed bibendum, dolor et volutpat nonummy, wisi justo convallis neque, eu feugiat leo ligula nec quam. Nulla in mi. Integer ac mauris vel ligula laoreet tristique. Nunc eget tortor in diam rhoncus vehicula. Nulla quis mi. Fusce porta fringilla mauris. Vestibulum sed dolor. Aliquam tincidunt interdum arcu. Vestibulum eget lacus. Curabitur pellentesque egestas lectus. Duis dolor. Aliquam erat volutpat. Aliquam erat volutpat. Duis egestas rhoncus dui. Sed iaculis, metus et mollis tincidunt, mauris dolor ornare odio, in cursus justo felis sit amet arcu. Aenean sollicitudin. Duis lectus leo, eleifend mollis, consequat ut, venenatis at, ante.<br /><br />";
9
$lorem[] = "Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.<br /><br />"; 
10

  
11
$blocks = (int)$blocks - 1;
12
if ($blocks <= 0) $blocks = 0;
13
if ($blocks > 5) $blocks = 5;
14
$returnvalue = "";
15
for ( $i=0 ; $i<=$blocks ; $i++) {
16
    $returnvalue .= $lorem[$i];
17
}
18
return $returnvalue;
trunk/wb/modules/droplets/example/SearchBox.php
1
//:Create a searchbox
2
//:Creates a serachbox on the position of [[searchbox]]. Optional parameter "?msg=the search message"
3
global $TEXT;
4
$return_value = true;
5
if (!isset($msg)) $msg='search this site..';
6
$j = "onfocus=\"if(this.value=='$msg'){this.value='';this.style.color='#000';}else{this.select();}\"
7
        onblur=\"if(this.value==''){this.value='$msg';this.style.color='#b3b3b3';}\"";
8
if(SHOW_SEARCH) { 
9
	$return_value  = '<div class="searchbox">';
10
	$return_value  .= '<form action="'.WB_URL.'/search/index'.PAGE_EXTENSION.'" method="get" name="search" class="searchform" id="search">';
11
	$return_value  .= '<input style="color:#b3b3b3;" type="text" name="string" size="25" class="textbox" value="'.$msg.'" '.$j.'  />&nbsp;';
12
	$return_value  .= '</form>';
13
	$return_value  .= '</div>';
14
}
15
return $return_value;
trunk/wb/modules/droplets/example/LoginBox.php
1
//:Puts a Login / Logout box on your page.
2
//:Use: [[LoginBox]]. Remember to enable frontend login in your website settings.
3
global $wb, $TEXT, $MENU;
4
$return_value = " ";
5
if(FRONTEND_LOGIN == 'enabled' && VISIBILITY != 'private' && $wb->get_session('USER_ID') == '') {
6
	$return_value  = '<form name="login" action="'.LOGIN_URL.'" method="post" class="login_table">';
7
	$return_value .= '<h2>'.$TEXT['LOGIN'].'</h2>';
8
	$return_value .= $TEXT['USERNAME'].':<input type="text" name="username" style="text-transform: lowercase;" /><br />';
9
	$return_value .= $TEXT['PASSWORD'].':<input type="password" name="password" /><br />';
10
	$return_value .= '<input type="submit" name="submit" value="'.$TEXT['LOGIN'].'" class="dbutton" /><br />';
11
	$return_value .= '<a href="'.FORGOT_URL.'">'.$TEXT['FORGOT_DETAILS'].'</a><br />';
12
	if(is_numeric(FRONTEND_SIGNUP))  
13
		$return_value .= '<a href="'.SIGNUP_URL.'">'.$TEXT['SIGNUP'].'</a>';
14
	$return_value .= '</form>';
15
} elseif(FRONTEND_LOGIN == 'enabled' && is_numeric($wb->get_session('USER_ID'))) {
16
	$return_value = '<form name="logout" action="'.LOGOUT_URL.'" method="post" class="login_table">';
17
	$return_value .= '<h2>'.$TEXT['LOGGED_IN'].'</h2>';
18
	$return_value .= $TEXT['WELCOME_BACK'].', '.$wb->get_display_name().'<br />';
19
	$return_value .= '<input type="submit" name="submit" value="'.$MENU['LOGOUT'].'" class="dbutton" /><br />';
20
	$return_value .= '<a href="'.PREFERENCES_URL.'">'.$MENU['PREFERENCES'].'</a><br />';
21
	$return_value .= '<a href="'.ADMIN_URL.'/index.php" target="_blank">'.$TEXT['ADMINISTRATION'].'</a>';
22
	$return_value .= '</form>';
23
}
24
return $return_value;
trunk/wb/modules/droplets/example/ModifiedWhen.php
1
//:Displays the last modification time of the current page
2
//:Use [[ModifiedWhen]]
3
global $database, $wb;
+if (PAGE_ID>0) {
+	$query=$database->query("SELECT modified_when FROM ".TABLE_PREFIX."pages where page_id=".PAGE_ID);
+	$mod_details=$query->fetchRow();
+	return "This page was last modified on ".date("d/m/Y",$mod_details[0]). " at ".date("H:i",$mod_details[0]).".";
+}
trunk/wb/modules/droplets/example/RandomImage.php
1
//:Get a random image from a folder in the MEDIA folder.
2
//:Commandline to use: [[RandomImage?dir=subfolder_in_mediafolder]]
3
$folder=opendir(WB_PATH.MEDIA_DIRECTORY.'/'.$dir.'/.'); 
+$names = array();
+while ($file = readdir($folder))  {
+	$ext=strtolower(substr($file,-4));
+	if ($ext==".jpg"||$ext==".gif"||$ext==".png"){
+		$names[count($names)] = $file; 
+	}
+}
+closedir($folder);
+shuffle($names);
+$image=$names[0]; 
+$name=substr($image,0,-4);
+return '<img src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/'.$image.'" alt="'.$name.'" width="'.$width.'" height="'.$height.'"/>';
Index: trunk/wb/modules/droplets/example/SiteModified.php
trunk/wb/modules/droplets/example/SiteModified.php
1
//:Create information on when your site was last updated.
2
//:Create information on when your site was last updated. Any page update counts.
3
global $database, $wb;
+if (PAGE_ID>0) {
+	$query=$database->query("SELECT max(modified_when) FROM ".TABLE_PREFIX."pages");
+	$mod_details=$query->fetchRow();
+	return "This site was last modified on ".date("d/m/Y",$mod_details[0]). " at ".date("H:i",$mod_details[0]).".";
+}
trunk/wb/modules/droplets/example/ParentPage.php
1
//:Create a parent link to your page
2
//:Display a link to the parent page of the current page
3
$info = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, '[if(class==menu-current){[level] [sib] [sibCount] [parent]}]', '', '', '');
+list($nLevel, $nSib, $nSibCount, $nParent) = explode(' ', $info);
+
+// show up level
+if ($nLevel > 0) {
+$lev = $nLevel - 1;
+return show_menu2(0, SM2_ROOT, SM2_CURR, SM2_CRUMB|SM2_BUFFER, "[if(level==$lev){[a][menu_title]</a>}]", '', '', '');
+}
+else 
+return '(no parent)';
+
Index: trunk/wb/modules/droplets/example/oneliners.txt
trunk/wb/modules/droplets/example/oneliners.txt
1
A bug in the code is worth two in the documentation.
2
According to my calculations the problem doesn't exist.
3
A computer's attention span is as long as its power cord.
4
A computer scientist is someone who fixes things that aren't broken.
5
Adding manpower to a late software project makes it later.
6
Air conditioned environment - Do NOT open Windows!
7
All computers wait at the same speed.
8
All wiyht. Rho sritched mg kegtops awound?
9
Willyoupleasehelpmefixmykeyboard?Thespacebarisbroken!
10
All you need to know is the user interface.
11
Alpha. Software undergoes alpha testing as a first step in getting user feedback. Alpha is Latin for "doesn't work."
12
Any programming language is at its best before it is implemented and used.
13
Any program that runs right is obsolete.
14
A paperless office has about as much chance as a paperless bathroom.
15
A printer consists of three main parts: the case, the jammed paper tray and the blinking red light.
16
A Life? Cool! Where can I download one of those from?
17
A program is never finished until the programmer dies.
18
ASCII stupid question, get a stupid ANSI!
19
As far as we know, our computer has never had an undetected error.
20
A user friendly computer first requires a friendly user.
21
A user will find any interface design intuitive...with enough practice.
22
Backup not found: (A)bort (R)etry (P)anic
23
Bad or missing mouse driver. Spank the cat [Y/N]?
24
Be aware of Programmers who carry screwdrivers.
25
Best file compression around: "DEL *.*" = 100% compression
26
Beta. Software undergoes beta testing shortly before it's released. Beta is Latin for "still doesn't work."
27
Bug? That's not a bug, that's a feature.
28
Build a system that even a fool can use, and only a fool will use it.
29
Buy a Pentium IV 2GHz so you can reboot faster.
30
Cannot load Windows 95, Incorrect DOS Version.
31
COFFEE.EXE Missing---Insert Cup and Press Any Key.
32
Compatible: Gracefully accepts erroneous data from any source.
33
Computer analyst to programmer: "You start coding. I'll go find out what they want."
34
Computer and car salesmen differ in that the latter know when they are lying.
35
Computer programmers do it byte by byte.
36
Computer programmers don't byte, they nibble a bit.
37
Computers are a more fun way to do the same work you'd have to do without them.
38
Computers are like air-conditioners: both stop working, if you open windows.
39
Computers are not intelligent. They only think they are.
40
Computers are unreliable, but humans are even more unreliable.
41
Computers can never replace human stupidity.
42
Computer Science: solving today's problems tomorrow.
43
Computers follow your orders, not your intentions.
44
Computers make very fast, very accurate mistakes.
45
Crashing is the only thing windows does quickly.
46
Daddy, what does FORMATTING DRIVE C mean?
47
Disclaimer: Any errors in spelling, tact, or fact are transmission errors.
48
Disinformation is not as good as datinformation.
49
Don't compute and drive; the life you save may be your own.
50
Don't document the program; program the document.
51
Don't hit the keys so hard, it hurts.
52
Don't let the computer bugs bite!
53
DOS=HIGH? I knew it was on something!
54
DOS Tip #1: Add DEVICE=FNGRCROS.SYS to CONFIG.SYS
55
DOS Tip #2: Add BUGS=OFF to your CONFIG.SYS
56
Email returned to sender -- insufficient voltage.
57
Enter any 11-digit prime number to continue...
58
Error:015: Unable to exit Windows. Try the door.
59
Error reading FAT record: Try the SKINNY one? (Y/N)
60
Ever notice how fast Windows runs? Neither did I...
61
Every bug you find is the last one.
62
Every time I type 'win', I loose ...
63
Excuse me for butting in, but I'm interrupt-driven.
64
Failure is not an option, it comes bundled with the software.
65
.....File not found. Should I fake it? (Y/N)
66
For any problem there is a solution that is simple, quick, and ultimately worse than the problem.
67
Hardware: The parts of a computer system that can be kicked.
68
Hi, my name is Any Key. Please don't hit me!
69
Hiroshima..45........Tjernobil..86........Windows..95....
70
Hit any user to continue.
71
Home is where the computer is plugged in.
72
How an engineer writes a program: Start by debugging an empty file...
73
I am a computer, dumber than any human and smarter than an administrator.
74
If at first you don't succeed, call it version 1.0.
75
If a train station is where the train stops, what is a work station?
76
I finally made my stupid computer faster; I dropped it out of the window, and it went really fast.
77
If the automobile had followed the same development cycle as the computer, a Rolls-Royce today would cost $100, get a million miles to the gallon, and explode once a year, illing everyone inside.
78
If the pen is mightier than the sword, and a picture is worth a thousand words, how dangerous is a fax?
79
If your computer says, "Printer out of Paper," this problem cannot be resolved by continuously clicking the "OK" button.
80
I have a dream: 1073741824 bytes free.
81
I haven't lost my mind; it's backed up on tape somewhere.
82
I hit the CTRL key but I'm still not in control!
83
I'm writing a book. I've got the page numbers done.
84
In a few minutes a computer can make a mistake so great that it would take many men many months to equal it.
85
Is reading in the bathroom considered Multi-Tasking.
86
It is easier to write an incorrect program than understand a correct one.
87
It said "Insert disk 3..." but only 2 fit.
88
It's not a bug; it's an undocumented feature.
89
It works! Now if only I could remember what I did...
90
I wish life has a scroll back buffer.
91
Keyboard : Instrument used to enter errors into computer.
92
Keyboard not connected, press F1 to continue.
93
MACINTOSH stands for Most Applications Crash If Not The Operating System Hangs.
94
Maintenance-free: When it breaks, it can't be fixed...
95
Math problems? Call 1-800-[(10x)(ln(13e))]-[sin(xy)/2.362x]
96
Melted fruit snacks found on Keyboard. Delete nephew [Y/N]?
97
MICROSOFT: Most Intelligent Customers Realize Our Software is Only for Fools and Teenagers.
98
Mommy! The cursor's winking at me!
99
My software never has bugs. It just develops random features.
100
Never say "OOPS!" always say "Ah, Interesting!"
101
No matter how much data you add to your laptop, it will not get heavier.
102
Of course I know how to copy disks. Where's the xerox machine?
103
One person's error is another person's data.
104
One picture is worth 128K words.
105
Operator! Trace this call and tell me where I am.
106
Owners of digital watches: Your day's are numbered!
107
Oxymoron: Microsoft Works.
108
Press any key...no, no, no, NOT THAT ONE!
109
Press any key to continue or any other key to quit...
110
Press CTRL-ALT-DEL to continue....
111
Programmers don't die, they just GOSUB without RETURN.
112
Programmer's Time-Space Continuum: Programmers continuously space the time.
113
RAM disk is NOT an installation procedure.
114
Reference Manual: Object that raises the monitor to eye level. Also used to compensate for that short table leg.
115
Scheduled Release Date: A carefully calculated date determined by estimating the actual shipping date and subtracting six months from it.
116
Shift to the left! Shift to the right! Pop up, push down, byte, byte, byte!
117
Southern DOS: Y'all reckon? (Yep/Nope)
118
Speed Kills! Use Windows 95.
119
System going down at 1:45 for disk crashing.
120
The box said: 'install on Windows 95, NT 4.0 or better'. So I installed it on Linux.
121
The definition of an upgrade: Take old bugs out, put new ones in.
122
The name is Baud......, James Baud.
123
The program is absolutely right; therefore the computer must be wrong.
124
The programmer's national anthem is 'AAAAAAAAHHHHHHHH'.
125
The Queue Principle: The longer you wait in line, the greater the likelihood that you are standing in the wrong line.
126
There are never enough hours in a day, but always too many days before Saturday.
127
There are two ways to write error-free programs; only the third one works.
128
There can never be a computer language in which you cannot write a bad program.
129
There were computers in Biblical times. Eve had an Apple.
130
These settings will have no effect until you restart the system.
131
Reset Universe (Y/N) ?
132
Those who can, do. Those who cannot, teach. Those who cannot teach, HACK!
133
To be, or not to be, those are the parameters.
134
To err is human, but to really foul things up requires a computer.
135
User error: replace user and press any key to continue.
136
Warning, keyboard not found. Press Enter to continue.
137
What boots up must come down.
138
Who's General Failure and why's he reading my disk?
139
Why doesn't DOS ever say "EXCELLENT command or filename!"
140
Why do they call this a word processor? It's simple, ... you've seen what food processors do to food, right?
141
Why do we want intelligent terminals when there are so many stupid users?
142
Will the information superhighway have any rest stops?
143
Windows 3.1 not found: (C)heer, (P)arty, (D)ance?
144
Windows is NOT a virus. Viruses DO something.
145
WINDOWS stands for Will Install Needless Data On Whole System.
146
Windows: the ultimate triumph of marketing over technology.
147
You are making progress if each mistake is a new one.
148
You don't have to know how the computer works, just how to work the computer.
149
You forgot to do your backup 16 days ago. Tomorrow you'll need that version.
150
You had mail, but the super-user read it, and deleted it!
151
You never finish a program, you just stop working on it. 
trunk/wb/modules/droplets/example/index.php
1
<?php
2

  
3
// $Id: index.php 915 2009-01-21 19:27:01Z 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
header("Location: ../../../index.php");
27

  
28
?>
trunk/wb/modules/droplets/install.php
1
<?php
2
/*
3
*	@version	1.0
4
*	@author		Ruud Eisinga (Ruud) John (PCWacht)
5
*	@date		June 2009
6
*
7
*	droplets are small codeblocks that are called from anywhere in the template. 
8
* 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]
9
*/
10

  
11
// prevent this file from being accessed directly
12
if(!defined('WB_PATH')) die(header('Location: ../index.php'));
13

  
14
$table = TABLE_PREFIX .'mod_droplets';
15
$database->query("DROP TABLE IF EXISTS `$table`");
16

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

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

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

  
74

  
75
function getDropletCodeFromFile ( $dropletfile ) {
76
	$data = "";
77
	$filename = WB_PATH."/modules/droplets/example/".$dropletfile;
78
	if (file_exists($filename)) {
79
		$filehandle = fopen ($filename, "r");
80
		$data = fread ($filehandle, filesize ($filename));
81
		fclose($filehandle);
82
		// unlink($filename); doesnt work in unix
83
	}	
84
	return $data;
85
}
86
?>
0 87

  
trunk/wb/modules/droplets/index.php
1
<?php
2

  
3
header('Location: ../index.php');
4

  
5
?>
0 6

  
trunk/wb/modules/droplets/readme/readme.html
1
<html>
2

  
3
	<head>
4
	<title>Droplets</title>
5
	<link href="readme.css" rel="stylesheet" type="text/css" media="screen" />
6
</head>
7

  
8
	<body>
9
		<small><font color="#7f7f7f">Droplets Help</font></small><br />
10
		<h2> <img src="../img/droplets_logo.png" alt="" width="297" height="81" border="0"></h2> <br />
11
		Droplets are small chunks of php code (just like the code module) that can be included in your template or any other content section. <br />
12
		Including a droplet is done by encapsulating the droplet name in double brackets. <br />
13
		If you want to use the droplet &quot;ModifiedWhen&quot; (to show the last modified date and time of the current page) you only need to add <b>[[ModifiedWhen]]</b> to your template or WYSIWYG contentpage. <br />
14
		<br />
15
		You are encouraged to create your own droplets and share them with the community. <br />
16
		<br />
17
		<h3>Installation</h3>
18
		<br />
19
		Droplets are installed as a admin tool. The installation is done using the normal &quot;Add module&quot; page in the WB backend. <br />
20
		When the installation is successfull, there is a new tool added to the Admin-Tools menu. <br />
21
		Clicking the tool will display the current installed droplets, and a button to create your own. <br />
22
		<br />
23
		<h3>Getting Droplets</h3>
24
		<br />
25
		A fast growing number of Droplets are available for use, you can use the <a href="http://www.websitebakers.com/pages/droplets/official-library.php" target="_new">Official Droplets Library</a> in the AMASP project website, or you can search the WB Forum. <br />
26
		<br />
27
		<h3>Coding Droplets</h3>
28
		<br />
29
		Droplets run in PHP mode, no <font color="#ff0000">&lt;?php</font> or <font color="#ff0000">?&gt;</font> is allowed in the code! If any of these tags are found in the code they will be removed. Your code will not run as expected. <br />
30
		The droplet code can NOT echo or print data to the output stream directly. The Droplet name is replaced by the return value of the PHP code.<br />
31
		Example: [[HelloWorld]] <br />
32
		<br />
33
		<font color="#ff0000">Wrong code:</font> echo &quot;Hello World&quot;; <br />
34
		<font color="#339966">Correct code:</font> return &quot;Hello World&quot;; <br />
35
		<br />
36
		Since version 0.3 Droplets can modify the complete page content. <br />
37
		When the Droplet is called, an extra variable ($wb_page_data) is made available. 
38
		This variable holds all the content of your current generated webpage.
39
		You can modify any part of this content simply by replacing it in the variable. There is no need to return this variable, the Droplet code will process changed content automatically.<br /><br />
40
		
41
		Since version 0.3 Droplets will check the PHP code you have saved for validity. <br />
42
		When the code will not execute correctly a red flashing icon will apear in the backend Droplets list. <br />
43
		The standard blue icon is no guarantee that the Droplets does what you would expect it to do, it will just tell you if the code is valid PHP code.<br /><br />
44
		
45
		Since version 0.3 Droplets you do not need to return any data. When you end your code with <pre>return true;</pre> there will not be an errormessage. The processed Droplet tag will be removed.<br />
46

  
47
		<br />
48
		<h3>PHP color coding</h3>
49
		<br />
50
		The Droplets edit page is ready to use the EditArea module. This module creates a color coded editor for PHP code. <br />
51
		EditArea comes as a seperate module (installed as an admin tool). <br />
52
		Use the WB Forum or the <a href="http://www.websitebakers.com/" target="_new">AMASP</a> project to find the latest EditArea download. <br />
53
		<br />
54
		<h3>More Information</h3>
55
		<br />
56
		More information (including localized help) can be found on the <a href="http://www.websitebakers.com/pages/droplets/about-droplets.php" target="_new">Droplets pages</a> of the AMASP project website. <br />
57
		<br />
58
		<br />
59
		<br />
60
	</body>
61

  
62
</html>
trunk/wb/modules/droplets/readme/readme.css
1
html {
2
font-size:76%;
3
}
4
body {
5
font-family:"Trebuchet MS",Tahoma,Verdana,Arial,Helvetica,sans-serif;
6
font-size:1.1em;
7
line-height:1.5em;
8
margin:10px;
9
padding:0;
10
text-align:left;
11
}
12
h1, h2, h3, h4, h5, h6 {
13
color:#009999;
14
font-family:"Trebuchet MS",Tahoma,Verdana,Arial,Helvetica,sans-serif;
15
font-weight:normal;
16
letter-spacing:-1px;
17
margin:0;
18
}
19
h1, h2 {
20
border-bottom:1px solid #009999;
21
font-size:1.8em;
22
margin:15px 0 5px;
23
padding-bottom:15px;
24
}
25
h3 {
26
border-bottom:1px solid #009999;
27
font-size:1.8em;
28
margin:15px 0 5px;
29
padding-bottom:15px;
30
}
31
h4 {
32
font-size:1.4em;
33
margin:10px 0 5px;
34
}
35
h5 {
36
font-size:1.2em;
37
margin:10px 0 5px;
38
}
39
h6 {
40
font-size:1em;
41
margin:10px 0 0;
42
}
43
p {
44
margin:8px 0;
45
}
46
acronym {
47
cursor:help;
48
}
49
code, blockquote {
50
background:#FFFFFF none repeat scroll 0 0;
51
border:1px dashed #DDDDDD;
52
color:#666666;
53
display:block;
54
margin:15px 0;
55
padding:5px;
56
}
57
pre {
58
background:#FFFFFF none repeat scroll 0 0;
59
border:1px dashed #DDDDDD;
60
color:#666666;
61
display:inline;
62
margin:15px 0;
63
padding:5px;
64
}
65
hr {
66
background-color:#009999;
67
border:0 none;
68
color:#DDDDDD;
69
height:1px;
70
margin:5px 0;
71
}
72
.left {
73
float:left;
74
}
75
.right {
76
float:right;
77
}
78
.hide {
79
display:none;
80
}
81

  
82
#body {
83
background:#222222;
84
padding:20px;
85
}
trunk/wb/modules/droplets/readme/index.php
1
<?php
2

  
3
// $Id: index.php 915 2009-01-21 19:27:01Z 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
header("Location: ../../../index.php");
27

  
28
?>
trunk/wb/modules/droplets/uninstall.php
1
<?php
2
/*
3
*	@version	1.0
4
*	@author		Ruud Eisinga (Ruud) John (PCWacht)
5
*	@date		June 2009
6
*
7
*	droplets are small codeblocks that are called from anywhere in the template. 
8
* 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]
9
*/
10

  
11
// prevent this file from being accessed directly
12
if(!defined('WB_PATH')) die(header('Location: ../index.php'));
13

  
14
$table = TABLE_PREFIX .'mod_droplets';
15
$database->query("DROP TABLE IF EXISTS `$table`");
16

  
17
?>
0 18

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

  
11
// Direct access prevention
12
defined('WB_PATH') OR die(header('Location: ../index.php'));
13

  
14
// Load Language file
15
if(LANGUAGE_LOADED) {
16
	if(!file_exists(WB_PATH.'/modules/droplets/languages/'.LANGUAGE.'.php')) {
17
		require_once(WB_PATH.'/modules/droplets/languages/EN.php');
18
	} else {
19
		require_once(WB_PATH.'/modules/droplets/languages/'.LANGUAGE.'.php');
20
	}
21
}
22

  
23
// check if backend.css file needs to be included into the <body></body>
24
if(!method_exists($admin, 'register_backend_modfiles') && file_exists(WB_PATH .'/modules/droplets/backend.css')) {
25
	echo '<style type="text/css">';
26
	include(WB_PATH .'/modules/droplets/backend.css');
27
	echo "\n</style>\n";
28
}
29

  
30
// Get userid for showing admin only droplets or not
31
$loggedin_user = $admin->get_user_id();
32
	
33
// And... action
34
$admintool_url = ADMIN_URL .'/admintools/index.php';
35

  
36
//removes empty entries from the table so they will not be displayed
37
$database->query("DELETE FROM ".TABLE_PREFIX."mod_droplets WHERE name=''");
38
?>
39
<style type="text/css">
40
a.tooltip span {display:none; margin-left:14px; width:430px;}
41
a.tooltip:hover span{display:inline; position:absolute; padding:5px; border:1px solid #000000; background:#ffffff; color:#000000;}
42
</style>
43

  
44
<br />
45
<table cellpadding="0" cellspacing="0" border="0" width="100%">
46
<tr>
47
	<td valign="bottom" width="30%">
48
		<button class="add" type="button" name="add_droplet" onclick="javascript: window.location = '<?php echo WB_URL; ?>/modules/droplets/add_droplet.php';"><?php echo $TEXT['ADD'].' '.$DR_TEXT['DROPLETS']; ?></button>	
49
	</td>
50
	<td align="center"><img src="<?php echo WB_URL; ?>/modules/droplets/img/droplets_logo.png" border="1" alt=""/></td>
51
	<td valign="top" width="30%" align="right">
52
		<a href="#" onclick="javascript: window.open('<?php echo WB_URL; ?>/modules/droplets/readme/<?php echo $DR_TEXT['README']; ?>','helpwindow','width=700,height=550,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes');"><?php echo $DR_TEXT['HELP']; ?></a>
53
		<br /><br />
54
		<a href="#" onclick="javascript: window.location = '<?php echo WB_URL; ?>/modules/droplets/backup_droplets.php';"><?php echo $DR_TEXT['BACKUP']; ?></a>
55
	</td>
56
</tr>
57
</table>
58
<br />
59

  
60
<h2><?php echo $TEXT['MODIFY'].'/'.$TEXT['DELETE'].' '.$DR_TEXT['DROPLETS']; ?></h2>
61
<?php
62
if ($loggedin_user == '1') {
63
	$query_droplets = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_droplets ORDER BY modified_when DESC");
64
} else { 
65
	$query_droplets = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_droplets WHERE admin_view <> '1' ORDER BY modified_when DESC");
66
}
67
$num_droplets = $query_droplets->numRows();
68
if($num_droplets > 0) {
69
	?>
70
	<table class="row_a" border="0" cellspacing="0" cellpadding="3" width="100%">
71
	<tr>
72
		<thead>
73
			<td width="3%"></td>
74
			<td width="21%"><?php echo $TEXT['NAME']; ?></td>
75
			<td width="68%"><?php echo $TEXT['DESCRIPTION']; ?></td>
76
			<td width="4%"><?php echo $TEXT['ACTIVE']; ?></td>  
77
			<td width="3%"></td>
78
		</thead>
79
	</tr>
80
	<?php
81
	$row = 'a';
82
	while($droplet = $query_droplets->fetchRow()) {
83
		$get_modified_user = $database->query("SELECT display_name,username, user_id FROM ".TABLE_PREFIX."users WHERE user_id = '".$droplet['modified_by']."' LIMIT 1");
84
		if($get_modified_user->numRows() > 0) {
85
			$fetch_modified_user = $get_modified_user->fetchRow();
86
			$modified_user = $fetch_modified_user['username'];
87
			$modified_userid = $fetch_modified_user['user_id'];
88
		} else {
89
			$modified_user = $TEXT['UNKNOWN'];
90
			$modified_userid = 0;
91
		}
92
		$comments = str_replace(array("\r\n", "\n", "\r"), '<br />', $droplet['comments']);
93
		if (!strpos($comments,"[[")) $comments = "Use: [[".$droplet['name']."]]<br />".$comments;
94
		$comments = str_replace(array("[[", "]]"), array('<b>[[',']]</b>'), $comments);
95
		$valid_code = check_syntax($droplet['code']);
96
		if (!$valid_code === true) $comments = '<font color=\'red\'><strong>'.$DR_TEXT['INVALIDCODE'].'</strong></font><br /><br />'.$comments;
97
		$unique_droplet = check_unique ($droplet['name']);
98
		if ($unique_droplet === false) $comments = '<font color=\'red\'><strong>'.$DR_TEXT['NOTUNIQUE'].'</strong></font><br /><br />'.$comments;
99
		$comments = '<span>'.$comments.'</span>';
100
		?>
101
		
102
		<tr class="row_<?php echo $row; ?>" height="20">
103
			<td >
104
				<a href="<?php echo WB_URL; ?>/modules/droplets/modify_droplet.php?droplet_id=<?php echo $droplet['id']?>" title="<?php echo $TEXT['MODIFY']; ?>">
105
					<img src="<?php echo THEME_URL; ?>/images/modify_16.png" border="0" alt="Modify" /> 
106
				</a>
107
			</td>
108
			<td >
109
				<a href="<?php echo WB_URL; ?>/modules/droplets/modify_droplet.php?droplet_id=<?php echo $droplet['id']?>" class="tooltip">
110
							<?php if ($valid_code && $unique_droplet) { ?><img src="<?php echo WB_URL; ?>/modules/droplets/img/droplet.png" border="0" alt=""/>
111
							<?php } else {  ?><img src="<?php echo WB_URL; ?>/modules/droplets/img/invalid.gif" border="0" title="" alt=""/><?php }  ?>
112
					<?php echo $droplet['name']; ?><?php echo $comments; ?>
113
				</a>
114
			</td>
115
			<td >
116
				<small><?php echo substr($droplet['description'],0,90); ?></small>
117
			</td>
118
			<td >
119
				<b><?php if($droplet['active'] == 1){ echo '<span style="color: green;">'. $TEXT['YES']. '</span>'; } else { echo '<span style="color: red;">'.$TEXT['NO'].'</span>';  } ?></b>
120
			</td>
121
			<td >
122
				<a href="javascript: confirm_link('<?php echo $TEXT['ARE_YOU_SURE']; ?>', '<?php echo WB_URL; ?>/modules/droplets/delete_droplet.php?droplet_id=<?php echo $droplet['id']?>');" title="<?php echo $TEXT['DELETE']; ?>">
123
					<img src="<?php echo THEME_URL; ?>/images/delete_16.png" border="0" alt="X" />
124
				</a>
125
			</td>
126
		</tr>
127
		<?php
128
		// Alternate row color
129
		if($row == 'a') {
130
			$row = 'b';
131
		} else {
132
			$row = 'a';
133
		}
134
	}
135
	?>
136
	</table>
137
	<?php
138
}
139

  
140
function check_syntax($code) {
141
    return @eval('return true;' . $code);
142
}
143

  
144
function check_unique($name) {
145
	global $database;
146
	$query_droplets = $database->query("SELECT name FROM ".TABLE_PREFIX."mod_droplets WHERE name = '$name'");
147
	return ($query_droplets->numRows() == 1);
148

  
149

  
150

  
151
}
152

  
153
?>
0 154

  
trunk/wb/modules/droplets/languages/EN.php
1
<?php
2

  
3
$DR_TEXT['DROPLETS']	= 'Droplet';
4
$DR_TEXT['BACKUP']		= 'Backup Droplets (Zip)';
5
$DR_TEXT['RESTORE']		= 'Restore Droplets (Zipped)';
6
$DR_TEXT['HELP']		= 'Help / Readme';
7
$DR_TEXT['README']		= 'readme.html';
8
$DR_TEXT['INVALIDCODE']	= 'This Droplet has invalid PHP code';
9
$DR_TEXT['NOTUNIQUE']	= 'This Dropletname is used more than once!';
10
$DR_TEXT['ADMIN_EDIT']	= 'Edit-Only';
11
$DR_TEXT['ADMIN_VIEW']	= 'View-Only';
12
$DR_TEXT['WYSIWYG']		= 'Wysiwyg';
13
$DR_TEXT['HELP']		= 'Help / Readme';
14

  
15
?>
trunk/wb/modules/droplets/languages/index.php
1
<?php
2

  
3
// $Id: index.php 915 2009-01-21 19:27:01Z 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
header("Location: ../../../index.php");
27

  
28
?>
trunk/wb/modules/droplets/modify_droplet.php
1
<?php
2
/*
3
*	@version	1.0
4
*	@author		Ruud Eisinga (Ruud) John (PCWacht)
5
*	@date		June 2009
6
*
7
*	droplets are small codeblocks that are called from anywhere in the template. 
8
* 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]
9
*/
10

  
11
require('../../config.php');
12

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

  
20
require_once(WB_PATH.'/framework/class.admin.php');
21
require_once(WB_PATH.'/framework/functions.php');
22

  
23
$admintool_link = ADMIN_URL .'/admintools/index.php';
24
$module_edit_link = ADMIN_URL .'/admintools/tool.php?tool=droplets';
25
$admin = new admin('admintools', 'admintools');
26

  
27
// check if backend.css file needs to be included into the <body></body> of modify.php
28
if(!method_exists($admin, 'register_backend_modfiles') && file_exists(WB_PATH ."/modules/droplets/backend.css")) {
29
	echo '<style type="text/css">';
30
	include(WB_PATH .'/modules/droplets/backend.css');
31
	echo "n</style>n";
32
}
33

  
34
// Load Language file
35
if(LANGUAGE_LOADED) {
36
	if(!file_exists(WB_PATH.'/modules/droplets/languages/'.LANGUAGE.'.php')) {
37
		require_once(WB_PATH.'/modules/droplets/languages/EN.php');
38
	} else {
39
		require_once(WB_PATH.'/modules/droplets/languages/'.LANGUAGE.'.php');
40
	}
41
}
42
require_once(WB_PATH . '/include/editarea/wb_wrapper_edit_area.php');
43
echo registerEditArea ('contentedit','php',true,'both',true,true,600,450,'search, fullscreen, |, undo, redo, |, select_font,|, highlight, reset_highlight, |, help');
44
		
45

  
46
$modified_when = mktime();
47
$modified_by = $admin->get_user_id();
48

  
49
// Get header and footer
50
$query_content = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_droplets WHERE id = '$droplet_id'");
51
$fetch_content = $query_content->fetchRow();
52
$content = (htmlspecialchars($fetch_content['code']));
53
?>
54
<h4 style="margin: 0; border-bottom: 1px solid #DDD; padding-bottom: 5px;">
55
	<a href="<?php echo $admintool_link;?>"><?php echo $HEADING['ADMINISTRATION_TOOLS']; ?></a>
56
	->
57
	<a href="<?php echo $module_edit_link;?>">Droplet Edit</a>
58
</h4>
59
<br />
60
<form name="modify" action="<?php echo WB_URL; ?>/modules/droplets/save_droplet.php" method="post" style="margin: 0;">
61
<input type="hidden" name="data_codepress" value="" />
62
<input type="hidden" name="droplet_id" value="<?php echo $droplet_id; ?>">
63
<input type="hidden" name="show_wysiwyg" value="<?php echo $fetch_content['show_wysiwyg']; ?>">
64

  
65
<table class="row_a" cellpadding="4" cellspacing="0" border="0" width="100%">
66
		<tr>
67
		<td width="10%" class="setting_name">
68
			<?php echo $TEXT['NAME']; ?>:
69
		</td>
70
		<td width="90%">
71
			<input type="text" name="title" value="<?php echo stripslashes($fetch_content['name']); ?>" style="width: 38%;" maxlength="32" />
72
		</td>
73
	</tr>
74
	<tr>
75
		<td valign="top" class="setting_name" width="60px"><?php echo $TEXT['DESCRIPTION']; ?>:</td>
76
		<td>
77
			<input type="text" name="description" value="<?php echo stripslashes($fetch_content['description']); ?>" style="width: 98%;" />
78
		</td>
79
	</tr>
80
	<tr>
81
		<td class="setting_name" width="60px">
82
			<?php echo $TEXT['ACTIVE']; ?>:
83
		</td>
84
		<td>	
85
			<input type="radio" name="active" id="active_true" value="1" <?php if($fetch_content['active'] == 1) { echo ' checked'; } ?> />
86
			<a href="#" onclick="javascript: document.getElementById('active_true').checked = true;">
87
			<label><?php echo $TEXT['YES']; ?></label>
88
			</a>
89
			<input type="radio" name="active" id="active_false" value="0" <?php if($fetch_content['active'] == 0) { echo ' checked'; } ?> />
90
			<a href="#" onclick="javascript: document.getElementById('active_false').checked = true;">
91
			<label><?php echo $TEXT['NO']; ?></label>
92
			</a>
93
		</td>
94
	</tr>
95
<?php
96
// Next show only if admin is logged in, user_id = 1
97
if ($modified_by == 1) {
98
	?>
99
	<tr>
100
		<td class="setting_name" width="60px">
101
			<?php echo $TEXT['ADMIN']; ?>:
102
		</td>
103
		<td> 
104
			<?php echo $DR_TEXT['ADMIN_EDIT']; ?>&nbsp;   	
105
			<input type="radio" name="admin_edit" id="admin_edit_true" value="1" <?php if($fetch_content['admin_edit'] == 1) { echo ' checked'; } ?> />
106
			<a href="#" onclick="javascript: document.getElementById('admin_edit_true').checked = true;">
107
			<label><?php echo $TEXT['YES']; ?></label>
108
			</a>
109
			<input type="radio" name="admin_edit" id="admin_edit_false" value="0" <?php if($fetch_content['admin_edit'] == 0) { echo ' checked'; } ?> />
110
			<a href="#" onclick="javascript: document.getElementById('admin_edit_false').checked = true;">
111
			<label><?php echo $TEXT['NO']; ?></label>
112
			</a>
113
			&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
114
			<?php echo $DR_TEXT['ADMIN_VIEW']; ?>:
115
			<input type="radio" name="admin_view" id="admin_view_true" value="1" <?php if($fetch_content['admin_view'] == 1) { echo ' checked'; } ?> />
116
			<a href="#" onclick="javascript: document.getElementById('admin_view_true').checked = true;">
117
			<label><?php echo $TEXT['YES']; ?></label>
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff