Project

General

Profile

« Previous | Next » 

Revision 1443

Added by Dietmar about 13 years ago

remove auto including YUI Framework in backend for modules, enable with >print_footer(true)
>print_error and ->print_success too accept a message as array
auto validate in frontend if style block inside body tag
captcha now XHTML valide

View differences:

branches/2.8.x/CHANGELOG
11 11
! = Update/Change
12 12

  
13 13
------------------------------------- 2.8.2 -------------------------------------
14
15 Apr-2011 Build 1441 Dietmar Woellbrink (Luisehahne)
14
19 Apr-2011 Build 1443 Dietmar Woellbrink (Luisehahne)
15
! remove auto including YUI Framework in backend for modules, enable with ->print_footer(true)
16
! ->print_error and ->print_success too accept a message as array
17
! auto validate in frontend if style block inside body tag
18
! captcha now XHTML valide
19
15 Apr-2011 Build 1442 Dietmar Woellbrink (Luisehahne)
15 20
# bug fixed in class.database.php methode field_add in call field_exists
16 21
! update search, pls test, (Tks to Thorn)
17 22
10 Apr-2011 Build 1441 Dietmar Woellbrink (Luisehahne)
branches/2.8.x/wb/include/captcha/captcha.php
27 27
if(!function_exists('display_captcha_real')) {
28 28
	function display_captcha_real($kind='image') {
29 29
		$t = time();
30
		$output  = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" ";
31
		$output .= "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
32
		$output .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"";
33
		$output .= strtolower(LANGUAGE)."\" lang=\"".strtolower(LANGUAGE)."\">\n";
34
		$output .= "\t<head>\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>\n";
35
		$output .= "\t\t<title>captcha</title>\n\t</head>\n\t<body>\n";
30 36
		$_SESSION['captcha_time'] = $t;
31
		$sec_id = '';
32
		if(isset($_GET['s']) && is_numeric($_GET['s'])) $sec_id = $_GET['s'];
33 37
		if($kind=='image') {
34
			?><a title="reload" href="<?php echo WB_URL.'/include/captcha/captcha.php?display_captcha_X986E21=2'; ?>">
35
			  <img style="border: none;" src="<?php echo WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t&amp;s=$sec_id"; ?>" alt="Captcha" />
36
				</a><?php
38
			$output .= "\t\t<a title=\"reload\" href=\"".WB_REL."/include/captcha/captcha.php?display_captcha_X986E21=2\">";
39
			$output .= "<img style=\"border: none;\" src=\"".WB_REL."/include/captcha/captchas/";
40
			$output .= CAPTCHA_TYPE.".php?t=".$t."\" alt=\"Captcha\" /></a>\n";
37 41
		} else {
38
			echo 'error';
42
			$output .= "\t\t<h2>error</h2>";
39 43
		}
44
		$output .= "\t</body>\n</html>";
45
		echo $output;
40 46
	}
41 47
}
42 48

  
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.2.RC5');
55
if(!defined('REVISION')) define('REVISION', '1442');
55
if(!defined('REVISION')) define('REVISION', '1443');
56 56

  
57 57
?>
branches/2.8.x/wb/framework/class.admin.php
175 175
	}
176 176
	
177 177
	// Print the admin footer
178
	function print_footer() {
178
		function print_footer($activateJsAdmin = false) {
179 179
		// include the required file for Javascript admin
180
		if(file_exists(WB_PATH.'/modules/jsadmin/jsadmin_backend_include.php')){
181
		@include(WB_PATH.'/modules/jsadmin/jsadmin_backend_include.php');
180
		if($activateJsAdmin != false) {
181
			if(file_exists(WB_PATH.'/modules/jsadmin/jsadmin_backend_include.php')){
182
				@include_once(WB_PATH.'/modules/jsadmin/jsadmin_backend_include.php');
183
			}
182 184
		}
185

  
183 186
		$footer_template = new Template(THEME_PATH.'/templates');
184 187
		$footer_template->set_file('page', 'footer.htt');
185 188
		$footer_template->set_block('page', 'footer_block', 'header');
branches/2.8.x/wb/framework/class.wb.php
377 377
	// Print a success message which then automatically redirects the user to another page
378 378
	function print_success( $message, $redirect = 'index.php' ) {
379 379
	    global $TEXT;
380
        if(is_array($message)) {
381
           $message = implode ('<br />',$message);
382
        }
380 383
	    // fetch redirect timer for sucess messages from settings table
381 384
	    $redirect_timer = ((defined( 'REDIRECT_TIMER' )) && (REDIRECT_TIMER <= 10000)) ? REDIRECT_TIMER : 0;
382 385
	    // add template variables
......
402 405
	// Print an error message
403 406
	function print_error($message, $link = 'index.php', $auto_footer = true) {
404 407
		global $TEXT;
408
        if(is_array($message)) {
409
           $message = implode ('<br />',$message);
410
        }
405 411
		$success_template = new Template(THEME_PATH.'/templates');
406 412
		$success_template->set_file('page', 'error.htt');
407 413
		$success_template->set_block('page', 'main_block', 'main');
......
461 467
	}
462 468

  
463 469
}
464
?>
branches/2.8.x/wb/framework/frontend.functions.php
593 593
    }
594 594
}
595 595

  
596
	function moveCssToHead($content) {
597
		// move css definitions into head section
598
		$pattern1 = '/(?:.*?<body.*?)(<link[^>]*?\"text\/css\".*?\/>)(?:.*)/si';
599
		$pattern2 = '/(?:.*?<body.*?)(<style[^>]*?\"text\/css\"[^>]*?>.*?<\/style>)(?:.*)/si';
600
		$insert1 = array();
601
		$insert2 = array();
602
		if(preg_match_all($pattern1, $content, $matches)) {
603
			$insert1 = $matches[1];
604
			$content = str_replace($insert1, '', $content);
605
		}
606
		if(preg_match_all($pattern2, $content, $matches)) {
607
			$insert2 = $matches[1];
608
			$content = str_replace($insert2, '', $content);
609
		}
610
		$insert = array_merge($insert1, $insert2);
611
		$insert = "\n".implode("\n", $insert)."\n</head>\n<body";
612
		$content = preg_replace('/<\/head>.*?<body/si', $insert, $content);
613
		return $content;
614
	}
615

  
596 616
// Begin WB < 2.4.x template compatibility code
597 617
	// Make extra_sql accessable through private_sql
598 618
	$private_sql = $extra_sql;
......
610 630
// End WB < 2.4.x template compatibility code
611 631
// Include template file
612 632

  
613

  
614
?>
branches/2.8.x/wb/index.php
145 145
        $output = filter_frontend_output($output);
146 146
    }
147 147
}
148

  
149
// move css definitions into head section
150
$output = moveCssToHead($output);
148 151
echo $output;
149 152
// end of wb-script
150 153
exit;
151
?>

Also available in: Unified diff