Project

General

Profile

« Previous | Next » 

Revision 1581

Added by darkviper almost 13 years ago

some little fixes in wysiwyg module

View differences:

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

  
13 13
=========================== add small Features 2.8.2 ==========================
14
17 Jan-2012 Build 1581 Werner v.d.Decken(DarkViper)
15
# wysiwyg module some little typo fixes a.s.o.
14 16
17 Jan-2012 Build 1580 Dietmar Woellbrink (Luisehahne)
15 17
! dropdown list to choose recipient for email confirmation
16 18
16 Jan-2012 Build 1579 Dietmar Woellbrink (Luisehahne)
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');
55
if(!defined('REVISION')) define('REVISION', '1580');
55
if(!defined('REVISION')) define('REVISION', '1581');
56 56
if(!defined('SP')) define('SP', 'SP2');
branches/2.8.x/wb/modules/wysiwyg/view.php
21 21
	throw new IllegalFileException();
22 22
}
23 23
/* -------------------------------------------------------- */
24
$MEDIA_REL = WB_URL.MEDIA_DIRECTORY;
25
// Get content
24
$sMediaUrl = WB_URL.MEDIA_DIRECTORY;
25
// Get content 
26 26
$content = '';
27 27
$sql = 'SELECT `content` FROM `'.TABLE_PREFIX.'mod_wysiwyg` WHERE `section_id`='.(int)$section_id;
28 28
if( ($content = $database->get_one($sql)) ) {
29
	$content = str_replace('{SYSVAR:MEDIA_REL}',$MEDIA_REL, $content );
29
	$content = str_replace('{SYSVAR:MEDIA_REL}', $sMediaUrl, $content );
30 30
}
31 31
echo $content;
branches/2.8.x/wb/modules/wysiwyg/save.php
24 24
// Include WB admin wrapper script
25 25
require(WB_PATH.'/modules/admin.php');
26 26

  
27
if (!$admin->checkFTAN())
28
{
27
if (!$admin->checkFTAN()) {
29 28
	$admin->print_header();
30 29
	$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
31 30
}
......
35 34
// Include the WB functions file
36 35
require_once(WB_PATH.'/framework/functions.php');
37 36

  
38
$MEDIA_URL = WB_URL.MEDIA_DIRECTORY;
37
$sMediaUrl = WB_URL.MEDIA_DIRECTORY;
39 38
// Update the mod_wysiwygs table with the contents
40 39
if(isset($_POST['content'.$section_id])) {
41 40
    $content = $_POST['content'.$section_id];
42
    $searchfor = '#(<.*= *\")('.quotemeta($MEDIA_URL).')(.*\".*>)#iU';
41
	$searchfor = '@(<[^>]*=\s*")('.preg_quote($sMediaUrl).')([^">]*".*>)@siU';
43 42
    $content = preg_replace($searchfor, '$1{SYSVAR:MEDIA_REL}$3', $content);
44
    $content = $admin->add_slashes($content);
45 43
	// searching in $text will be much easier this way
46 44
	$text = umlauts_to_entities(strip_tags($content), strtoupper(DEFAULT_CHARSET), 0);
47
	$query = "UPDATE ".TABLE_PREFIX."mod_wysiwyg SET content = '$content', text = '$text' WHERE section_id = '$section_id'";
48
	$database->query($query);	
45
    $content = $admin->add_slashes($content);
46
	$sql  = 'UPDATE `'.TABLE_PREFIX.'mod_wysiwyg` ';
47
	$sql .= 'SET `content`=\''.$content.'\', `text`=\''.$text.'\' ';
48
	$sql .= 'WHERE `section_id`='.(int)$section_id;
49
	$database->query($sql);
49 50
}
50 51

  
51 52
$sec_anchor = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? '#'.SEC_ANCHOR.$section['section_id'] : '' );
52
if(defined('EDIT_ONE_SECTION') and EDIT_ONE_SECTION)
53
{
53
if(defined('EDIT_ONE_SECTION') and EDIT_ONE_SECTION){
54 54
    $edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.'&wysiwyg='.$section_id;
55 55
} else {
56 56
    $edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.$sec_anchor;
......
60 60
if($database->is_error()) {
61 61
	$admin->print_error($database->get_error(), $js_back);
62 62
} else {
63
	$admin->print_success($MESSAGE['PAGES']['SAVED'], $edit_page );
63
	$admin->print_success($MESSAGE['PAGES_SAVED'], $edit_page );
64 64
}
65 65

  
66 66
// Print admin footer
branches/2.8.x/wb/modules/wysiwyg/modify.php
23 23
}
24 24
/* -------------------------------------------------------- */
25 25

  
26
$MEDIA_REL = WB_URL.MEDIA_DIRECTORY;
26
$sMediaUrl = WB_URL.MEDIA_DIRECTORY;
27 27
// Get page content
28 28
$sql = 'SELECT `content` FROM `'.TABLE_PREFIX.'mod_wysiwyg` WHERE `section_id`='.(int)$section_id;
29 29
if ( ($content = $database->get_one($sql)) ) {
30
	$content = htmlspecialchars(str_replace('{SYSVAR:MEDIA_REL}',$MEDIA_REL, $content));
30
	$content = htmlspecialchars(str_replace('{SYSVAR:MEDIA_REL}', $sMediaUrl, $content));
31 31
}else {
32 32
	$content = '';
33 33
}
......
71 71
		</tr>
72 72
	</table>
73 73
</form>
74
<br />
74
<br />

Also available in: Unified diff