Project

General

Profile

« Previous | Next » 

Revision 1640

Added by Dietmar over 12 years ago

! optimize modules WYSIWYG for editors

View differences:

branches/2.8.x/CHANGELOG
12 12
===============================================================================
13 13

  
14 14

  
15
22 Mar-2012 Build 1640 Dietmar Woellbrink (Luisehahne)
16
! optimize modules WYSIWYG for editors
15 17
22 Mar-2012 Build 1639 Dietmar Woellbrink (Luisehahne)
16 18
+ Installer add const DEBUG to config.php
17 19
! move const DEBUG and var $starttime from index.php to initialize.php
branches/2.8.x/wb/admin/interface/version.php
51 51

  
52 52
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
53 53
if(!defined('VERSION')) define('VERSION', '2.8.3');
54
if(!defined('REVISION')) define('REVISION', '1639');
54
if(!defined('REVISION')) define('REVISION', '1640');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/modules/wysiwyg/save.php
33 33

  
34 34
// Include the WB functions file
35 35
require_once(WB_PATH.'/framework/functions.php');
36

  
36
$aErrors = array();
37 37
$sMediaUrl = WB_URL.MEDIA_DIRECTORY;
38 38
// Update the mod_wysiwygs table with the contents
39 39
if(isset($_POST['content'.$section_id])) {
......
50 50
	$sql  = 'UPDATE `'.TABLE_PREFIX.'mod_wysiwyg` ';
51 51
	$sql .= 'SET `content`=\''.$content.'\', `text`=\''.$text.'\' ';
52 52
	$sql .= 'WHERE `section_id`='.(int)$section_id;
53
	$database->query($sql);
53
	if(!$database->query($sql)){
54
		$aErrors[] = $MESSAGE['GENERIC_NOT_UPGRADED'].((defined('DEBUG') && DEBUG) ? '<br />'.$database->get_error() : '');
55
	}
56
} else {
57
	$aErrors[] = $MESSAGE['GENERIC_NOT_UPGRADED'].((defined('DEBUG') && DEBUG) ? '<br />'.$MESSAGE['FRONTEND_SORRY_NO_ACTIVE_SECTIONS'] : '');
54 58
}
55 59

  
56 60
$sec_anchor = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? '#'.SEC_ANCHOR.$section['section_id'] : '' );
......
61 65
}
62 66

  
63 67
// Check if there is a database error, otherwise say successful
64
if($database->is_error()) {
65
	$admin->print_error($database->get_error(), $js_back);
68
if(sizeof($aErrors) ) {
69
	$admin->print_error( implode('<br />',$aErrors), $edit_page);
66 70
} else {
67
	$admin->print_success($MESSAGE['PAGES_SAVED'], $edit_page );
71
	$admin->print_success($MESSAGE['GENERIC_UPGRADED'], $edit_page );
68 72
}
69 73

  
70 74
// Print admin footer
branches/2.8.x/wb/modules/wysiwyg/modify.php
31 31
}else {
32 32
	$content = '';
33 33
}
34
if(!isset($wysiwyg_editor_loaded)) {
35
	$wysiwyg_editor_loaded=true;
36 34

  
37
	if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="none" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php')) {
38
		function show_wysiwyg_editor($name,$id,$content,$width,$height) {
35
if(!function_exists('show_wysiwyg_editor'))
36
{
37
	if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="none" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php'))
38
	{
39
		function show_wysiwyg_editor($name,$id,$content,$width,$height)
40
		{
39 41
			echo '<textarea name="'.$name.'" id="'.$id.'" style="width: '.$width.'; height: '.$height.';">'.$content.'</textarea>';
40 42
		}
41 43
	} else {
42
		$id_list = array();
43
		$sql  = 'SELECT `section_id` FROM `'.TABLE_PREFIX.'sections` ';
44
		$sql .= 'WHERE `page_id`='.(int)$page_id.' AND `module`=\'wysiwyg\'';
45
		if (($query_wysiwyg = $database->query($sql))) {
46
			while($wysiwyg_section = $query_wysiwyg->fetchRow()) {
47
				$entry='content'.$wysiwyg_section['section_id'];
48
				$id_list[] = $entry;
49
			}
50
			require(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php');
51
		}
44
		require(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php');
52 45
	}
53 46
}
54 47

  
......
57 50
	<input type="hidden" name="page_id" value="<?php echo $page_id; ?>" />
58 51
	<input type="hidden" name="section_id" value="<?php echo $section_id; ?>" />
59 52
<?php
60
echo $admin->getFTAN()."\n"; 
61
show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','350');
53
echo $admin->getFTAN()."\n";
54
echo show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','350');
62 55
?>
63 56
	<table summary="" cellpadding="0" cellspacing="0" border="0" width="100%" style="padding-bottom: 10px;">
64 57
		<tr>

Also available in: Unified diff