Project

General

Profile

1
<?php
2
/*
3
*
4
*                       About WebsiteBaker
5
*
6
* Website Baker is a PHP-based Content Management System (CMS)
7
* designed with one goal in mind: to enable its users to produce websites
8
* with ease.
9
*
10
*                       LICENSE INFORMATION
11
*
12
* WebsiteBaker is free software; you can redistribute it and/or
13
* modify it under the terms of the GNU General Public License
14
* as published by the Free Software Foundation; either version 2
15
* of the License, or (at your option) any later version.
16
*
17
* WebsiteBaker is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
* See the GNU General Public License for more details.
21
*
22
* You should have received a copy of the GNU General Public License
23
* along with this program; if not, write to the Free Software
24
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25
*
26
*                   WebsiteBaker Extra Information
27
*
28
*
29
*/
30
/**
31
 *
32
 * @category        backend
33
 * @package         wysiwyg
34
 * @author          WebsiteBaker Project
35
 * @copyright       2004-2009, Ryan Djurovich
36
 * @copyright       2009-2010, Website Baker Org. e.V.
37
 * @link			http://www.websitebaker2.org/
38
 * @license         http://www.gnu.org/licenses/gpl.html
39
 * @platform        WebsiteBaker 2.8.x
40
 * @requirements    PHP 4.3.4 and higher
41
 * @version         $Id: save.php 1271 2010-01-23 02:30:24Z Luisehahne $
42
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/modules/wysiwyg/save.php $
43
 * @lastmodified    $Date: 2010-01-23 03:30:24 +0100 (Sat, 23 Jan 2010) $
44
 *
45
*/
46

    
47
require('../../config.php');
48

    
49
// Include WB admin wrapper script
50
$update_when_modified = true; // Tells script to update when this page was last updated
51
require(WB_PATH.'/modules/admin.php');
52

    
53
// Include the WB functions file
54
require_once(WB_PATH.'/framework/functions.php');
55

    
56
// Update the mod_wysiwygs table with the contents
57
if(isset($_POST['content'.$section_id])) {
58
	$content = $admin->add_slashes($_POST['content'.$section_id]);
59
	// searching in $text will be much easier this way
60
	$text = umlauts_to_entities(strip_tags($content), strtoupper(DEFAULT_CHARSET), 0);
61
	$database = new database();
62
	$query = "UPDATE ".TABLE_PREFIX."mod_wysiwyg SET content = '$content', text = '$text' WHERE section_id = '$section_id'";
63
	$database->query($query);	
64
}
65

    
66
if(defined('EDIT_ONE_SECTION') and EDIT_ONE_SECTION)
67
{
68
    $edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.'&wysiwyg='.$section_id;
69
}
70
else
71
{
72
    $edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.'#wb'.$section_id;
73
}
74

    
75
// Check if there is a database error, otherwise say successful
76
if($database->is_error()) {
77
	$admin->print_error($database->get_error(), $js_back);
78
} else {
79
	$admin->print_success($MESSAGE['PAGES']['SAVED'], $edit_page );
80
}
81

    
82
// Print admin footer
83
$admin->print_footer();
84

    
85
?>
(7-7/9)