Skip to content

Commit

Permalink
Added additional conditionals for version check & update.
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparszarinovs committed Apr 3, 2012
1 parent 74c275b commit e9f1fb8
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions engine/inc.version_check_and_updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,35 @@
if( !empty($berta->content['entry']) ) {
$tplName = $berta->template->settings->templateName;

switch($tplName) {
case 'messy':
foreach( $berta->content['entry'] as $eKey => $e ) {
$galleryType = $e['mediaCacheData']['@attributes']['type'];

if( $galleryType == 'row' ) {
$berta->content['entry'][$eKey]['mediaCacheData']['@attributes']['type'] = 'pile';
// Updates for 0.8.2
if( empty($berta->content['@attributes']['last_upd_ver']) || ($berta->content['@attributes']['last_upd_ver'] < 1082) ) {
switch($tplName) {
case 'messy':
foreach( $berta->content['entry'] as $eKey => $e ) {
$galleryType = $e['mediaCacheData']['@attributes']['type'];

if( $galleryType == 'row' ) {
$berta->content['entry'][$eKey]['mediaCacheData']['@attributes']['type'] = 'pile';
}
}
}
break;
break;

case 'mashup':
case 'white':
foreach( $berta->content['entry'] as $eKey => $e ) {
$galleryType = $e['mediaCacheData']['@attributes']['type'];
case 'mashup':
case 'white':
foreach( $berta->content['entry'] as $eKey => $e ) {
$galleryType = $e['mediaCacheData']['@attributes']['type'];

if( $galleryType == 'row' ) {
$berta->content['entry'][$eKey]['mediaCacheData']['@attributes']['type'] = 'column';
if( $galleryType == 'row' ) {
$berta->content['entry'][$eKey]['mediaCacheData']['@attributes']['type'] = 'column';
}
}
}
break;
break;
}

$berta->content['@attributes']['last_upd_ver'] = $options['int_version'];
BertaEditor::saveBlog($berta->sectionName, $berta->content);
//header('Location: ' . $_SERVER['PHP_SELF']);
}
}

$berta->content['@attributes']['last_upd_ver'] = $options['int_version'];

BertaEditor::saveBlog($berta->sectionName, $berta->content);

//header('Location: ' . $_SERVER['PHP_SELF']);

?>

0 comments on commit e9f1fb8

Please sign in to comment.