Project

General

Profile

« Previous | Next » 

Revision 1875

Added by Dietmar over 11 years ago

! wysgwyg, now check exitings table entries, otherwise script stop loading content in editor
! typofix in groups
! change constant DB_NAME to $database->DbName

View differences:

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

  
14
28 Feb-2013 Build 1875 Dietmar Woellbrink (Luisehahne)
15
! wysgwyg, now check exitings table entries, otherwise script stop loading content in editor
16
! typofix in groups
17
! change constant DB_NAME to $database->DbName
14 18
27 Feb-2013 Build 1874 Werner v.d.Decken(DarkViper)
15 19
# some little typo fixes in initialize.php
16 20
# readConfiguration() fixed in initialize.php
branches/2.8.x/wb/upgrade-script.php
19 19
/**
20 20
 * 
21 21
 * 
22
 * @category     Module
23
 * @package      Module_bakery
24
 * @subpackage   Name of the subpackage if needed
25
 * @author       Dietmar W?llbrink <dietmar.woellbrink@websitebaker.org>
22
 * @category     Core
23
 * @package      Core_package
24
 * @subpackage   upgrade-script
25
 * @author       Dietmar Wรถllbrink <dietmar.woellbrink@websitebaker.org>
26 26
 * @author       Werner v.d.Decken <wkl@isteam.de>
27 27
 * @copyright    Werner v.d.Decken <wkl@isteam.de>
28 28
 * @license      http://www.gnu.org/licenses/gpl.html   GPL License
......
234 234
	$get_result = $database->query( 'SHOW TABLES LIKE "'.$search_for.'%"');
235 235

  
236 236
	// $get_result = $database->query( "SHOW TABLES FROM ".DB_NAME);
237
    $all_tables = array();
238
    $aTable = array();
239
    if($get_result->numRows() > 0)
240
    {
241
        while ($data = $get_result->fetchRow()) {
242
            $tmp = preg_replace('/^'.preg_quote(TABLE_PREFIX, '/').'/s', '', $data[0]);
243
            if(in_array($tmp,$aPackage)) {
244
                $all_tables[] = $tmp;
245
            } else {
246
                $aTable[] = $tmp;
247
            }
248
        }
249
    }
237
	$all_tables = array();
238
	$aTable = array();
239
	if($get_result->numRows() > 0)
240
	{
241
		while ($data = $get_result->fetchRow()) {
242
		    $tmp = preg_replace('/^'.preg_quote(TABLE_PREFIX, '/').'/s', '', $data[0]);
243
		    if(in_array($tmp,$aPackage)) {
244
		        $all_tables[] = $tmp;
245
		    } else {
246
		        $aTable[] = $tmp;
247
		    }
248
		}
249
	}
250 250

  
251
    return array_merge ( $all_tables, $aTable );
251
	return array_merge ( $all_tables, $aTable );
252 252
}
253 253

  
254 254
// check existing tables
......
415 415

  
416 416
    if( (sizeof($all_tables) >= sizeof($aPackage)) && (sizeof($aTable) == sizeof($aPackage)) )
417 417
    {
418
        echo '<h4 style="margin-left:0;">NOTICE: Your database '.DB_NAME.' has '.sizeof($all_tables).' '.$check_text.' tables from '.sizeof($aPackage).' included in package '.$OK.'</h4>';
418
        echo '<h4 style="margin-left:0;">NOTICE: Your database '.$database->DbName.' has '.sizeof($all_tables).' '.$check_text.' tables from '.sizeof($aPackage).' included in package '.$OK.'</h4>';
419 419
    }
420 420
    else
421 421
    {
branches/2.8.x/wb/admin/groups/languages/EN.php
46 46
$TEXT['CREATE_FOLDER'] = 'Create Folder';
47 47
$TEXT['DELETE'] = 'Delete';
48 48
$TEXT['DELETED'] = 'Deleted';
49
$TEXT['FILESYSTEM_PERMISSIONS'] = 'Filesystem Permissions';
49
$TEXT['FILESYSTEM_PERMISSIONS'] = 'Permissions';
50 50
$TEXT['GROUP'] = 'Group';
51 51
$TEXT['HIDE_ADVANCED'] = 'Hide Advanced Options';
52 52
$TEXT['LANGUAGE'] = 'Language';
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', '1874');
54
if(!defined('REVISION')) define('REVISION', '1875');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/templates/wb_theme/css/screen.css
272 272
div.page-settings-right div.content { border :solid 1px #a8bccb; min-width :10em; }
273 273
div.page-settings-right div.page-settings-tab { border :solid 1px #a8bccb; padding :8px; margin-bottom :8px; }
274 274
div.page-settings-rightcol { float :none; padding :0px; border :none; }
275
h1, h2, h3, h4, h5, h6 { color :#003366; display :block; font-weight :normal; margin :0.5em auto; padding-bottom :5px; }
275
h1, h2, h3, h4, h5, h6 { color :#003366; display :block; font-weight :normal; margin :0.4em auto; padding-bottom :5px; }
276 276
h6 { font-size :100%; }
277 277
/* end depending styles for /admin/pages_settings */
278 278
div.page-settings-leftcol label { background-repeat :no-repeat; background-position :right; text-align :right; padding-right :17px; font-weight :bold; width :156px; }
branches/2.8.x/wb/templates/argos_theme/css/screen.css
298 298
div.page-settings-centercol div#viewers { border :solid 1px #a8bccb; width :210px; padding :5px; }
299 299
div.page-settings-right div.page-settings-tab { border :solid 1px #a8bccb; padding :8px; margin-bottom :8px; }
300 300
div.page-settings-rightcol { float :none; padding :0px; border :none; }
301
h1, h2, h3, h4, h5, h6 { color :#003366; display :block; font-weight :normal; margin :0.5em auto; padding-bottom :5px; }
301
h1, h2, h3, h4, h5, h6 { color :#003366; display :block; font-weight :normal; margin :0.4em auto; padding-bottom :5px; }
302 302
h6 { font-size :105%; }
303 303
/* end depending styles for /admin/pages_settings */
304 304
div.page-settings-leftcol label { background-repeat :no-repeat; background-position :right; text-align :right; padding-right :17px; font-weight :bold; width :156px; }
branches/2.8.x/wb/modules/wysiwyg/save.php
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])) {
40
    $content = $_POST['content'.$section_id];
40
	$content = $_POST['content'.$section_id];
41 41
	if(ini_get('magic_quotes_gpc')==true)
42 42
	{
43 43
		$content = $admin->strip_slashes($_POST['content'.$section_id]);
44
	}
44
	};
45 45
	$searchfor = '@(<[^>]*=\s*")('.preg_quote($sMediaUrl).')([^">]*".*>)@siU';
46
    $content = preg_replace($searchfor, '$1{SYSVAR:MEDIA_REL}$3', $content);
46
	$content = preg_replace($searchfor, '$1{SYSVAR:MEDIA_REL}$3', $content);
47 47
	// searching in $text will be much easier this way
48
    $content = WbDatabase::getInstance()->escapeString ($content);
48
	$content = WbDatabase::getInstance()->escapeString ($content);
49 49
	$text = umlauts_to_entities(strip_tags($content), strtoupper(DEFAULT_CHARSET), 0);
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
	if(!$database->query($sql)){
54
		$aErrors[] = $MESSAGE['GENERIC_NOT_UPGRADED'].((defined('DEBUG') && DEBUG) ? '<br />'.$database->get_error() : '');
53
	if(!WbDatabase::getInstance()->query($sql)){
54
		$aErrors[] = $MESSAGE['GENERIC_NOT_UPGRADED'].((defined('DEBUG') && DEBUG) ? '<br />'.WbDatabase::getInstance()->get_error() : '');
55 55
	}
56 56
} else {
57 57
	$aErrors[] = $MESSAGE['GENERIC_NOT_UPGRADED'].((defined('DEBUG') && DEBUG) ? '<br />'.$MESSAGE['FRONTEND_SORRY_NO_ACTIVE_SECTIONS'] : '');
......
59 59

  
60 60
$sec_anchor = '#'.(defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? SEC_ANCHOR.$section_id : 'section_'.$section_id );
61 61
if(defined('EDIT_ONE_SECTION') and EDIT_ONE_SECTION){
62
    $edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.'&wysiwyg='.$section_id;
62
	$edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.'&wysiwyg='.$section_id;
63 63
} else {
64
    $edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.$sec_anchor;
64
	$edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.$sec_anchor;
65 65
}
66 66

  
67 67
// Check if there is a database error, otherwise say successful
branches/2.8.x/wb/modules/wysiwyg/modify.php
26 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
if ( ($content = $database->get_one($sql)) ) {
29
if ( ($content = $database->get_one($sql)) !== null  ) {
30 30
	$content = htmlspecialchars(str_replace('{SYSVAR:MEDIA_REL}', $sMediaUrl, $content));
31
}else {
32
	$content = '';
31
} else {
32
	throw new AppException('Database: missing entry in table \''.TABLE_PREFIX.'mod_wysiwyg\' for section_id='.$section_id);
33 33
}
34 34

  
35 35
if(!isset($wysiwyg_editor_loaded)) {
36
    $wysiwyg_editor_loaded=true;
36
	$wysiwyg_editor_loaded=true;
37 37
	if(!function_exists('show_wysiwyg_editor'))
38 38
	{
39 39
		if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="none" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php'))
branches/2.8.x/wb/modules/wysiwyg/upgrade.php
24 24

  
25 25
if(!function_exists('mod_wysiwyg_upgrade'))
26 26
{
27
    function mod_wysiwyg_upgrade () {
28
        global $database,$bDebugModus;
29
        $callingScript = $_SERVER["SCRIPT_NAME"];
30
        // check if upgrade startet by upgrade-script to echo a message
31
        $tmp = 'upgrade-script.php';
32
        $globalStarted = substr_compare($callingScript, $tmp,(0-strlen($tmp)),strlen($tmp)) === 0;
27
	function mod_wysiwyg_upgrade () {
28
		global $database,$bDebugModus;
29
		$callingScript = $_SERVER["SCRIPT_NAME"];
30
		// check if upgrade startet by upgrade-script to echo a message
31
		$tmp = 'upgrade-script.php';
32
		$globalStarted = substr_compare($callingScript, $tmp,(0-strlen($tmp)),strlen($tmp)) === 0;
33 33

  
34
        $msg = array();
35
        $aTable = array('mod_wysiwyg');
36
        for($x=0; $x<sizeof($aTable);$x++) {
37
        	if(($sOldType = $database->getTableEngine(TABLE_PREFIX.$aTable[$x]))) {
38
        		if(('myisam' != strtolower($sOldType))) {
39
        			if(!$database->query('ALTER TABLE `'.TABLE_PREFIX.$aTable[$x].'` Engine = \'MyISAM\' ')) {
40
        				$msg[] = $database->get_error();
41
        			} else{
42
                        $msg[] = 'TABLE `'.TABLE_PREFIX.$aTable[$x].'` changed to Engine = \'MyISAM\'';
43
        			}
44
        		} else {
45
                 $msg[] = 'TABLE `'.TABLE_PREFIX.$aTable[$x].'` has Engine = \'MyISAM\'';
46
        		}
47
        	} else {
48
        		$msg[] = $database->get_error();
49
        	}
50
        }
34
		$msg = array();
35
		$aTable = array('mod_wysiwyg');
36
		for($x=0; $x<sizeof($aTable);$x++) {
37
			if(($sOldType = $database->getTableEngine(TABLE_PREFIX.$aTable[$x]))) {
38
				if(('myisam' != strtolower($sOldType))) {
39
					if(!$database->query('ALTER TABLE `'.TABLE_PREFIX.$aTable[$x].'` Engine = \'MyISAM\' ')) {
40
						$msg[] = $database->get_error();
41
					} else{
42
						$msg[] = 'TABLE `'.TABLE_PREFIX.$aTable[$x].'` changed to Engine = \'MyISAM\'';
43
					}
44
				} else {
45
					 $msg[] = 'TABLE `'.TABLE_PREFIX.$aTable[$x].'` has Engine = \'MyISAM\'';
46
				}
47
			} else {
48
				$msg[] = $database->get_error();
49
			}
50
		}
51 51

  
52
        $sTable = TABLE_PREFIX.'mod_wysiwyg';
53
        if($database->index_exists($sTable, 'PRIMARY')) {
54
            $sql = 'ALTER TABLE `'.DB_NAME.'`.`'.$sTable.'` DROP PRIMARY KEY';
55
            if(!$database->query($sql)) {
56
                $msg[] = ''.$database->get_error().'';
57
            }
58
        }
52
		$sTable = TABLE_PREFIX.'mod_wysiwyg';
53
		if($database->index_exists($sTable, 'PRIMARY')) {
54
			$sql = 'ALTER TABLE `'.$database->DbName.'`.`'.$sTable.'` DROP PRIMARY KEY';
55
			if(!$database->query($sql)) {
56
			    $msg[] = ''.$database->get_error().'';
57
			}
58
		}
59 59

  
60
        if(!$database->index_add($sTable, '', 'section_id', 'PRIMARY')) {
61
        	$msg[] = ''.$database->get_error().'';
62
        } else {
63
            $msg[] = 'Create PRIMARY KEY ( `section_id` )';
64
        }
60
		if(!$database->index_add($sTable, '', 'section_id', 'PRIMARY')) {
61
			$msg[] = ''.$database->get_error().'';
62
		} else {
63
		    $msg[] = 'Create PRIMARY KEY ( `section_id` )';
64
		}
65 65

  
66
        // change internal absolute links into relative links
67
        $sTable = TABLE_PREFIX.'mod_wysiwyg';
68
        $sql  = 'UPDATE `'.$sTable.'` ';
69
        $sql .= 'SET `content` = REPLACE(`content`, \'"'.WB_URL.MEDIA_DIRECTORY.'\', \'"{SYSVAR:MEDIA_REL}\')';
70
        if (!$database->query($sql)) {
71
        	$msg[] = ''.$database->get_error().'';
72
        } else {
73
            $msg[] = 'Change internal absolute links into relative links';
74
        }
75
        // only for upgrade-script
76
        if($globalStarted) {
77
            if($bDebugModus) {
78
                foreach($msg as $title) {
79
                    echo '<strong>'.$title.'</strong><br />';
80
                }
81
            }
82
        }
83
        return $msg;
84
    }
66
		// change internal absolute links into relative links
67
		$sTable = TABLE_PREFIX.'mod_wysiwyg';
68
		$sql  = 'UPDATE `'.$sTable.'` ';
69
		$sql .= 'SET `content` = REPLACE(`content`, \'"'.WB_URL.MEDIA_DIRECTORY.'\', \'"{SYSVAR:MEDIA_REL}\')';
70
		if (!$database->query($sql)) {
71
			$msg[] = ''.$database->get_error().'';
72
		} else {
73
		    $msg[] = 'Change internal absolute links into relative links';
74
		}
75
		// only for $callingScript upgrade-script.php
76
		if($globalStarted) {
77
			if($bDebugModus) {
78
				foreach($msg as $title) {
79
				    echo '<strong>'.$title.'</strong><br />';
80
				}
81
			}
82
		}
83
		return $msg;
84
	}
85 85
}
86 86
// ------------------------------------
87 87

  

Also available in: Unified diff