Changeset 9597


Ignore:
Timestamp:
Mar 10, 2011, 11:50:11 AM (10 years ago)
Author:
plg
Message:

bug 2218: deactivate non core themes after upgrade

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions_upgrade.php

    r8728 r9597  
    111111}
    112112
     113// Deactivate all non-standard themes
     114function deactivate_non_standard_themes()
     115{
     116  global $page;
     117
     118  $standard_themes = array(
     119    'clear',
     120    'Sylvia',
     121    'dark',
     122    );
     123
     124  $query = '
     125SELECT
     126    id,
     127    name
     128  FROM '.PREFIX_TABLE.'themes
     129  WHERE id NOT IN (\''.implode("','", $standard_themes).'\')
     130;';
     131  $result = pwg_query($query);
     132  $theme_ids = array();
     133  $theme_names = array();
     134  while ($row = pwg_db_fetch_assoc($result))
     135  {
     136    array_push($theme_ids, $row['id']);
     137    array_push($theme_names, $row['name']);
     138  }
     139
     140  if (!empty($theme_ids))
     141  {
     142    $query = '
     143DELETE
     144  FROM '.PREFIX_TABLE.'themes
     145  WHERE id IN (\''.implode("','", $theme_ids).'\')
     146;';
     147    pwg_query($query);
     148
     149    array_push($page['infos'],
     150      l10n('As a precaution, following themes have been deactivated. You must check for themes upgrade before reactiving them:').'<p><i>'.implode(', ', $theme_names).'</i></p>');
     151  }
     152}
     153
    113154// Check access rights
    114155function check_upgrade_access_rights()
  • trunk/language/de_DE/upgrade.lang.php

    r8728 r9597  
    3939$lang['As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:'] = 'Als Vorsichtsmaßnahme wurden folgende Plugins abgeschaltet. Prüfen Sie, ob ein Pluginupdate verfügbar ist, bevor Sie diese wieder aktivieren:';
    4040$lang['In <i>%s</i>, before <b>?></b>, insert:'] = 'In der Datei <i>%s</i>, vor <b>?></b> folgendes einfügen:';
     41$lang['As a precaution, following themes have been deactivated. You must check for themes upgrade before reactiving them:'] = 'Als Vorsichtsmaßnahme wurden folgende Themen abgeschaltet. Prüfen Sie, ob ein Pluginupdate verfügbar ist, bevor Sie diese wieder aktivieren:';
    4142?>
  • trunk/language/en_UK/upgrade.lang.php

    r8728 r9597  
    4040$lang['Only thumbnails prefix and webmaster mail address have been saved from previous configuration'] = "Only thumbnails prefix and webmaster mail address have been saved from previous configuration";
    4141$lang['In <i>%s</i>, before <b>?></b>, insert:'] = 'In <i>%s</i>, before <b>?></b>, insert:';
     42$lang['As a precaution, following themes have been deactivated. You must check for themes upgrade before reactiving them:'] = 'As a precaution, following themes have been deactivated. You must check for themes upgrade before reactiving them:';
    4243?>
  • trunk/language/fr_FR/upgrade.lang.php

    r8728 r9597  
    4141$lang['Only thumbnails prefix and webmaster mail address have been saved from previous configuration'] = "Seuls le préfixe des miniatures et l'adresse email du webmestre ont étés conservés de la précédente configuration";
    4242$lang['In <i>%s</i>, before <b>?></b>, insert:'] = 'Dans le fichier <i>%s</i>, avant <b>?></b>, insérez:';
     43$lang['As a precaution, following themes have been deactivated. You must check for themes upgrade before reactiving them:'] = 'Par précaution, les thèmes suivants ont été désactivés. Vérifiez s\'il existe des mises à jour avant de les réactiver:';
    4344?>
  • trunk/upgrade.php

    r9596 r9597  
    340340      deactivate_non_standard_plugins();
    341341    }
     342
     343    deactivate_non_standard_themes();
    342344
    343345    $page['upgrade_end'] = get_moment();
Note: See TracChangeset for help on using the changeset viewer.