Project

General

Profile

« Previous | Next » 

Revision 1543

Added by Dietmar almost 13 years ago

fix droplet sectionPicker
fix install config.php not writeable
check table droplet if empty import examples

View differences:

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

  
13 13
=========================== add small Features 2.8.2 ==========================
14
14 Dez-2011 Build 1543 Dietmar Woellbrink (Luisehahne)
15
# fix droplet sectionPicker
16
# fix install config.php not writeable 
17
# check table droplet if empty import examples
14 18
12 Dez-2011 Build 1542 Dietmar Woellbrink (Luisehahne)
15 19
# fix wrong background url in "Website Under Construction"
16 20
12 Dez-2011 Build 1541 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', '1542');
55
if(!defined('REVISION')) define('REVISION', '1543');
56 56
if(!defined('SP')) define('SP', 'SP2');
branches/2.8.x/wb/admin/addons/reload.php
143 143
$admin->print_header();
144 144
$admin->print_success(implode($msg, '<br />'), $js_back);
145 145
$admin->print_footer();
146

  
147
?>
branches/2.8.x/wb/install/index.php
194 194
	$configFile = '/config.php';
195 195
	if(!isset($_SESSION['config_rename']) )
196 196
	{
197

  
197
// cnfig.php or config.php.new
198 198
		if( (file_exists($wb_path.$configFile)==true))
199 199
		{
200

  
201
			if ( filesize($wb_path.$configFile) > 128)
200
// next operation only if file is writeable
201
			if(is_writeable($wb_path.$configFile))
202 202
			{
203
				$installFlag = false;
204
				$config = '<font class="bad">Not empty!!?</font>';
205
			} elseif(!$handle = fopen($wb_path.$configFile, 'w') )
206
			{
207
				$installFlag = false;
208
                $config = '<font class="bad">Not Writeable</font>';
209
			} else {
210
				if (fwrite($handle, $config_content) === FALSE) {
203
// already installed? it's not empty
204
				if ( filesize($wb_path.$configFile) > 128)
205
				{
211 206
					$installFlag = false;
207
					$config = '<font class="bad">Not empty!!?</font>';
208
// try to open and to write
209
				} elseif( !$handle = fopen($wb_path.$configFile, 'w') )
210
				{
211
					$installFlag = false;
212 212
	                $config = '<font class="bad">Not Writeable</font>';
213 213
				} else {
214
					$config = '<font class="good">Writeable</font>';
215
					$_SESSION['config_rename'] = true;
216
				}
217
				// Close file
218
				fclose($handle);
219
				}
220

  
214
					if (fwrite($handle, $config_content) === FALSE) {
215
						$installFlag = false;
216
		                $config = '<font class="bad">Not Writeable</font>';
217
					} else {
218
						$config = '<font class="good">Writeable</font>';
219
						$_SESSION['config_rename'] = true;
220
					}
221
					// Close file
222
					fclose($handle);
223
					}
224
			} else {
225
				$installFlag = false;
226
                $config = '<font class="bad">Not Writeable</font>';
227
			}
228
// it's config.php.new
221 229
		} elseif((file_exists($wb_path.'/config.php.new')==true))
222 230
		{
223 231
			$configFile = '/config.php.new';
branches/2.8.x/wb/modules/droplets/example/SectionPicker.php
1 1
//:Load the view.php from any other section-module
2 2
//:Use [[SectionPicker?sid=123]]
3
global $database, $wb, $TEXT, $DGTEXT;
3
global $database, $wb, $TEXT, $DGTEXT, $output;
4 4
$content = '';
5 5
if( intval($sid)>0 ) {
6 6
	$sql  = 'SELECT `page_id`, `section_id`, `module` FROM `'.TABLE_PREFIX.'sections` ';
......
14 14
		$_sFrontendCss = '/modules/'.$module.'/frontend.css';
15 15
		if(is_readable(WB_PATH.$_sFrontendCss)) {
16 16
			$_sSearch = preg_quote(WB_URL.'/modules/'.$module.'/frontend.css', '/');
17
			if(preg_match('/<link[^>]*?href\s*=\s*\"'.$_sSearch.'\".*?\/>/si', $wb_page_data)) {
17
			if(preg_match('/<link[^>]*?href\s*=\s*\"'.$_sSearch.'\".*?\/>/si', $output)) {
18 18
				$_sFrontendCss = '';
19 19
			}else {
20 20
				$_sFrontendCss = '<link href="'.WB_URL.$_sFrontendCss.'" rel="stylesheet" type="text/css" media="screen" />';
21 21
			}
22
		}
22
		} else { $_sFrontendCss = ''; }
23 23
		ob_start();
24 24
		require(WB_PATH.'/modules/'.$module.'/view.php');
25 25
		$content = $_sFrontendCss.ob_get_clean();
26 26
	}
27 27
}
28
return $content;
28
return $content;
branches/2.8.x/wb/modules/droplets/tool.php
25 25
}
26 26
/* -------------------------------------------------------- */
27 27

  
28
$msg = array();
28 29
// Load Language file
29 30
if(LANGUAGE_LOADED) {
30 31
	if(!file_exists(WB_PATH.'/modules/droplets/languages/'.LANGUAGE.'.php')) {
......
50 51
$admintool_url = ADMIN_URL .'/admintools/index.php';
51 52

  
52 53
//removes empty entries from the table so they will not be displayed
53
$sql = 'DELETE FROM '.TABLE_PREFIX.'mod_droplets ';
54
$sql = 'DELETE FROM `'.TABLE_PREFIX.'mod_droplets` ';
54 55
$sql .= 'WHERE name = \'\' ';
55
$database->query($sql);
56

  
57
?>
58

  
59
<br />
56
if( !$database->query($sql) ) {
57
	$msg[] = $database->get_error();
58
}
59
// if import failed after installation, should be only 1 time
60
$sql = 'SELECT COUNT(`id`) FROM `'.TABLE_PREFIX.'mod_droplets` ';
61
if( !$database->get_one($sql) ) {
62
	include('install.php');
63
}
64
?><br />
60 65
<table summary="" cellpadding="0" cellspacing="0" border="0" width="100%">
61 66
<tr>
62 67
	<td valign="bottom" width="50%">
63
		<button class="add" type="button" name="add_droplet" onclick="javascript: window.location = '<?php echo WB_URL; ?>/modules/droplets/add_droplet.php';"><?php echo $TEXT['ADD'].' '.$DR_TEXT['DROPLETS']; ?></button>	
68
		<button class="add" type="button" name="add_droplet" onclick="javascript: window.location = '<?php echo WB_URL; ?>/modules/droplets/add_droplet.php';"><?php echo $TEXT['ADD'].' '.$DR_TEXT['DROPLETS']; ?></button>
64 69
	</td>
65 70
	<!-- commentet out the droplets logo for a more similar backend design with other admin tools
66 71
	<td align="center"><img src="<?php /*echo WB_URL;*/ ?>/modules/droplets/img/droplets_logo.png" border="1" alt=""/></td>

Also available in: Unified diff