Project

General

Profile

« Previous | Next » 

Revision 1576

Added by darkviper over 12 years ago

wysiwyg module changed to domain independend image links

View differences:

modify.php
4 4
 * @category        modules
5 5
 * @package         wysiwyg
6 6
 * @author          WebsiteBaker Project
7
 * @copyright       2009-2011, Website Baker Org. e.V.
7
 * @copyright       2009-2012, Website Baker Org. e.V.
8 8
 * @link			http://www.websitebaker2.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
10 10
 * @platform        WebsiteBaker 2.8.x
......
16 16
 */
17 17

  
18 18
/* -------------------------------------------------------- */
19
if(defined('WB_PATH') == false)
20
{
21
	// Stop this file being access directly
22
		die('<head><title>Access denied</title></head><body><h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2></body></html>');
19
// Must include code to stop this file being accessed directly
20
if(!defined('WB_PATH')) {
21
	require_once(dirname(dirname(__FILE__)).'/framework/globalExceptionHandler.php');
22
	throw new IllegalFileException();
23 23
}
24 24
/* -------------------------------------------------------- */
25 25

  
26
$MEDIA_URL = WB_URL.MEDIA_DIRECTORY;
26 27
// Get page content
27
$query = "SELECT content FROM ".TABLE_PREFIX."mod_wysiwyg WHERE section_id = '$section_id'";
28
$get_content = $database->query($query);
29
$content = $get_content->fetchRow();
30
$content = (htmlspecialchars($content['content']));
31

  
28
$query = 'SELECT `content` FROM `'.TABLE_PREFIX.'mod_wysiwyg` WHERE `section_id`='.(int)$section_id;
29
if ( ($content = $database->get_one($sql)) ) {
30
	$content = htmlspecialchars(str_replace('{SYSVAR:MEDIA_REL}',$MEDIA_URL, $content));
31
}else {
32
	$content = '';
33
}
32 34
if(!isset($wysiwyg_editor_loaded)) {
33 35
	$wysiwyg_editor_loaded=true;
34 36

  
......
37 39
			echo '<textarea name="'.$name.'" id="'.$id.'" style="width: '.$width.'; height: '.$height.';">'.$content.'</textarea>';
38 40
		}
39 41
	} else {
40
		$id_list=array();
41
		$query_wysiwyg = $database->query("SELECT section_id FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' AND module = 'wysiwyg'");
42
		if($query_wysiwyg->numRows() > 0) {
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))) {
43 46
			while($wysiwyg_section = $query_wysiwyg->fetchRow()) {
44 47
				$entry='content'.$wysiwyg_section['section_id'];
45
				array_push($id_list,$entry);
48
				$id_list[] = $entry;
46 49
			}
47 50
			require(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php');
48 51
		}
......
50 53
}
51 54

  
52 55
?>
53

  
54 56
<form name="wysiwyg<?php echo $section_id; ?>" action="<?php echo WB_URL; ?>/modules/wysiwyg/save.php" method="post">
55

  
56
<input type="hidden" name="page_id" value="<?php echo $page_id; ?>" />
57
<input type="hidden" name="section_id" value="<?php echo $section_id; ?>" />
58

  
57
	<input type="hidden" name="page_id" value="<?php echo $page_id; ?>" />
58
	<input type="hidden" name="section_id" value="<?php echo $section_id; ?>" />
59 59
<?php
60 60
echo $admin->getFTAN()."\n"; 
61 61
show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','350');
62 62
?>
63

  
64
<table summary="" cellpadding="0" cellspacing="0" border="0" width="100%" style="padding-bottom: 10px;">
65
<tr>
66
	<td align="left">
67
		<input type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;" />
68
	</td>
69
	<td align="right">
70
		<input type="button" value="<?php echo $TEXT['CANCEL']; ?>" onclick="javascript: window.location = 'index.php';" style="width: 100px; margin-top: 5px;" />
71
	</td>
72
</tr>
73
</table>
74

  
63
	<table summary="" cellpadding="0" cellspacing="0" border="0" width="100%" style="padding-bottom: 10px;">
64
		<tr>
65
			<td align="left">
66
				<input type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;" />
67
			</td>
68
			<td align="right">
69
				<input type="button" value="<?php echo $TEXT['CANCEL']; ?>" onclick="javascript: window.location = 'index.php';" style="width: 100px; margin-top: 5px;" />
70
			</td>
71
		</tr>
72
	</table>
75 73
</form>
76

  
77 74
<br />

Also available in: Unified diff