Dotclear

Changeset 2319:abe2702e1585


Ignore:
Timestamp:
10/09/13 08:37:56 (12 years ago)
Author:
Denis Jean-Chirstian <contact@…>
Branch:
default
Message:

Move ex-daInstaller settings to core and install and upgrade

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • admin/blog_theme.php

    r2314 r2319  
    1515dcPage::check('admin'); 
    1616 
    17 # -- "First time" settings setup -- 
    18 if ($core->blog->settings->system->store_theme_url === null) { 
    19      $core->blog->settings->system->put( 
    20           'store_theme_url', 'http://update.dotaddict.org/dc2/themes.xml', 'string', 'Themes XML feed location', true, true 
    21      ); 
    22 } 
    23  
    2417# -- Loading themes -- 
    2518$core->themes = new dcThemes($core); 
  • admin/install/index.php

    r2303 r2319  
    162162          $blog_settings->system->put('date_formats',serialize($date_formats),'string','Date formats examples',true); 
    163163          $blog_settings->system->put('time_formats',serialize($time_formats),'string','Time formats examples',true); 
    164  
     164           
     165          # Add repository URL for themes and plugins 
     166          $blog_settings->system->put('store_plugin_url','http://update.dotaddict.org/dc2/plugins.xml','string','Plugins XML feed location',true); 
     167          $blog_settings->system->put('store_theme_url','http://update.dotaddict.org/dc2/themes.xml','string','Themes XML feed location',true); 
     168           
    165169          # Add Dotclear version 
    166170          $cur = $core->con->openCursor($core->prefix.'version'); 
  • admin/plugins.php

    r2314 r2319  
    1515dcPage::check('admin'); 
    1616 
    17 # -- "First time" settings setup -- 
    18 if ($core->blog->settings->system->plugins_allow_multi_install === null) { 
    19      $core->blog->settings->system->put( 
    20           'plugins_allow_multi_install', false, 'boolean', 'Allow multi-installation for plugins', true, true 
    21      ); 
    22 } 
    23 if ($core->blog->settings->system->store_plugin_url === null) { 
    24      $core->blog->settings->system->put( 
    25           'store_plugin_url', 'http://update.dotaddict.org/dc2/plugins.xml', 'string', 'Plugins XML feed location', true, true 
    26      ); 
    27 } 
    28  
    2917# -- Page helper -- 
    3018$list = new adminModulesList( 
     
    3422); 
    3523 
    36 adminModulesList::$allow_multi_install = $core->blog->settings->system->plugins_allow_multi_install; 
     24adminModulesList::$allow_multi_install = (boolean) DC_ALLOW_MULTI_MODULES; 
    3725adminModulesList::$distributed_modules = explode(',', DC_DISTRIB_PLUGINS); 
    3826 
  • inc/core/class.dc.store.reader.php

    r2222 r2319  
    148148          $this->setAuthorization($user, $pass); 
    149149 
    150           return $this->get($path); 
     150          try { 
     151               return $this->get($path); 
     152          } 
     153          catch(Exception $e) { 
     154               // @todo Log error when repository query fail 
     155               return false; 
     156          } 
    151157     } 
    152158 
  • inc/dbschema/upgrade.php

    r2295 r2319  
    361361                    } 
    362362 
    363                     # add new settings for date and time formats 
     363                    # Some settings change, prepare db queries 
     364                    $strReqFormat = 'INSERT INTO '.$core->prefix.'setting'; 
     365                    $strReqFormat .= ' (setting_id,setting_ns,setting_value,setting_type,setting_label)'; 
     366                    $strReqFormat .= ' VALUES(\'%s\',\'system\',\'%s\',\'string\',\'%s\')'; 
     367 
     368                    $strReqSelect = 'SELECT count(1) FROM '.$core->prefix.'setting'; 
     369                    $strReqSelect .= ' WHERE setting_id = \'%s\''; 
     370                    $strReqSelect .= ' AND setting_ns = \'system\''; 
     371                    $strReqSelect .= ' AND blog_id IS NULL'; 
     372 
     373                    # Add date and time formats 
    364374                    $date_formats = array('%Y-%m-%d','%m/%d/%Y','%d/%m/%Y','%Y/%m/%d','%d.%m.%Y','%b %e %Y','%e %b %Y','%Y %b %e', 
    365375                    '%a, %Y-%m-%d','%a, %m/%d/%Y','%a, %d/%m/%Y','%a, %Y/%m/%d','%B %e, %Y','%e %B, %Y','%Y, %B %e','%e. %B %Y', 
     
    372382                    } 
    373383 
    374                     $strReqFormat = 'INSERT INTO '.$core->prefix.'setting'; 
    375                     $strReqFormat .= ' (setting_id,setting_ns,setting_value,setting_type,setting_label)'; 
    376                     $strReqFormat .= ' VALUES(\'%s\',\'system\',\'%s\',\'string\',\'%s\')'; 
    377                      
    378                     $strReqSelect = 'SELECT count(1) FROM '.$core->prefix.'setting'; 
    379                     $strReqSelect .= ' WHERE setting_id = \'%s\''; 
    380                     $strReqSelect .= ' AND setting_ns = \'system\''; 
    381                     $strReqSelect .= ' AND blog_id IS NULL'; 
    382  
    383384                    $rs = $core->con->select(sprintf($strReqSelect,'date_formats')); 
    384385                    if ($rs->f(0)==0) { 
     
    390391                         $strReq = sprintf($strReqFormat,'time_formats',serialize($time_formats),'Time formats examples'); 
    391392                         $core->con->execute($strReq); 
     393                    } 
     394 
     395                    # Add repository URL for themes and plugins as daInstaller move to core 
     396                    $rs = $core->con->select(sprintf($strReqSelect,'store_plugin_url')); 
     397                    if ($rs->f(0)==0) { 
     398                         $strReq = sprintf($strReqFormat,'store_plugin_url','http://update.dotaddict.org/dc2/plugins.xml','Plugins XML feed location'); 
     399                         $core->con->execute($strReq);                       
     400                    } 
     401                    $rs = $core->con->select(sprintf($strReqSelect,'store_theme_url')); 
     402                    if ($rs->f(0)==0) { 
     403                         $strReq = sprintf($strReqFormat,'store_theme_url','http://update.dotaddict.org/dc2/themes.xml','Themes XML feed location'); 
     404                         $core->con->execute($strReq);                       
    392405                    } 
    393406               } 
  • inc/prepend.php

    r2286 r2319  
    167167if (!defined('DC_UPDATE_VERSION')) { 
    168168     define('DC_UPDATE_VERSION','stable'); 
     169} 
     170 
     171if (!defined('DC_ALLOW_MULTI_MODULES')) { 
     172     define('DC_ALLOW_MULTI_MODULES',false); 
    169173} 
    170174 
Note: See TracChangeset for help on using the changeset viewer.

Sites map