Changeset 2815
- Timestamp:
- 11/14/08 21:50:57 (8 weeks ago)
- Location:
- branches/081018-handlers/htdocs/system
- Files:
-
- 9 added
- 1 removed
- 6 modified
-
classes/installhandler.php (modified) (1 diff)
-
schema/mysql/install (added)
-
schema/mysql/install/install.js (added)
-
schema/mysql/install/install.php (added)
-
schema/pgsql/install (added)
-
schema/pgsql/install/install.js (added)
-
schema/pgsql/install/install.php (added)
-
schema/sqlite/install (added)
-
schema/sqlite/install.php (deleted)
-
schema/sqlite/install/install.js (added)
-
schema/sqlite/install/install.php (added)
-
themes/installer/db_setup.php (modified) (1 diff)
-
themes/installer/formcontrols/formcontrol_select.php (modified) (1 diff)
-
themes/installer/script.js (modified) (4 diffs)
-
themes/installer/style.css (modified) (1 diff)
-
themes/installer/theme.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/081018-handlers/htdocs/system/classes/installhandler.php
r2813 r2815 285 285 // Load available schemas' install script 286 286 foreach ($pdo_drivers as $pdo_driver) { 287 $ file_path = HABARI_PATH . '/system/schema/' . $pdo_driver . '/install.php';288 if (file_exists($ file_path)) {289 include_once($ file_path);287 $install_file = HABARI_PATH . '/system/schema/' . $pdo_driver . '/install/install.php'; 288 if (file_exists($install_file)) { 289 include_once($install_file); 290 290 } 291 291 $classname = $pdo_driver.'Install'; -
branches/081018-handlers/htdocs/system/themes/installer/db_setup.php
r2813 r2815 3 3 <head> 4 4 <title><?php _e('Install Habari'); ?></title> 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 6 6 <meta name="robots" content="noindex,nofollow"> 7 7 <link href="<?php Site::out_url('habari'); ?>/system/themes/installer/style.css" rel="stylesheet" type="text/css"> 8 8 <script type="text/javascript" src="<?php Site::out_url('habari'); ?>/scripts/jquery.js"></script> 9 9 <script type="text/javascript" src="<?php Site::out_url('habari'); ?>/system/themes/installer/script.js"></script> 10 <?php Stack::out( 'installer_javascript', '<script type="text/javascript" src="%s"></script>'."\r\n" ) ?> 10 11 </head> 11 12 -
branches/081018-handlers/htdocs/system/themes/installer/formcontrols/formcontrol_select.php
r2813 r2815 1 <div class="inputfield<?php echo ($class) ? ' ' . $class : ''; ?>" <?php echo ($id) ? ' id="' . $id . '"' : ''?>>1 <div class="inputfield<?php echo ($class) ? ' ' . $class : ''; ?>"> 2 2 <label for="<?php echo $id; ?>"><?php echo $this->caption; ?><?php echo (isset($required) && $required) ? ' <strong>*</strong>' : ''?></label> 3 3 <select id="<?php echo $id; ?>" name="<?php echo $field . ( $multiple ? '[]' : '' ); ?>"<?php echo ( $multiple ? ' multiple="multiple" size="' . intval($size) . '"' : '' ) ?>> -
branches/081018-handlers/htdocs/system/themes/installer/script.js
r2813 r2815 1 var habari = {}; 2 habari.installer = { 3 schemas : new Array(), 4 5 registerSchema: function(schema) { 6 var i = habari.installer.schemas.length + 1; 7 habari.installer.schemas[i] = schema; 8 }, 9 10 setDatabaseType: function () { 11 for ( var i in habari.installer.schemas ) { 12 // May use some function per schema (in their class) to show/hide themselves 13 if (habari.installer.schemas[i] != $('#db_type').val()) { 14 $("fieldset[id*='" + habari.installer.schemas[i] + "settings']").hide(); 15 } 16 else { 17 $("fieldset[id*='" + habari.installer.schemas[i] + "settings']").show(); 18 } 19 } 20 }, 21 22 checkDBCredentials: {}, 23 24 checkSiteConfiguration: function () { 25 var warned = false; 26 var installok = true; 27 if ( ( $('#blog_title').val() != '' ) && ( $('#admin_username').val() != '' ) && ( $('#admin_pass1').val() != '' ) && ( $('#admin_pass2').val() != '' ) ) { 28 //Checking fields is ok 29 if ( $('#admin_pass1').val() != $('#admin_pass2').val() ) { 30 warningtext= 'The passwords do not match, try typing them again.'; 31 $('#install').children('.options').fadeOut().removeClass('ready'); 32 $('#admin_pass1').parents('.installstep').removeClass('done'); 33 $('#admin_pass1').parents('.inputfield').removeClass('invalid').removeClass('valid').addClass('invalid').find('.warning:hidden').html(warningtext).fadeIn(); 34 warned = true; 35 installok = false; 36 } 37 } 38 if($('#admin_email').val() == '' ) { 39 installok = false; 40 } 41 if(!warned) { 42 ida= new Array( '#blog_title', '#admin_username', '#admin_pass1', '#admin_pass2', '#admin_email' ); 43 $(ida).each(function(id) { 44 ido= $(ida).get(id); 45 $(ido).parents('.inputfield').removeClass('invalid').find('.warning:visible').fadeOut(); 46 if($(ido).val() != '') { 47 $(ido).addClass('valid'); 48 } 49 }); 50 } 51 if(installok) { 52 $('#siteconfiguration').addClass('done'); 53 $('#install').children('.options').fadeIn().addClass('ready').addClass('done'); 54 $('#pluginactivation').children('.options').fadeIn().addClass('ready').addClass('done'); 55 $('#pluginactivation').children('.help-me').show(); 56 $('#submitinstall').removeAttr( 'disabled' ); 57 } 58 else { 59 $('#siteconfiguration').removeClass('done'); 60 $('#install').children('.options').fadeOut().removeClass('ready').removeClass('done'); 61 } 62 } 63 }; 64 1 65 function handleAjaxError(msg, status, err) 2 66 { … … 12 76 '<p>'+error_msg.replace(/(<([^>]+)>)/ig,"")+'</p>' 13 77 ).fadeIn(); 14 }15 16 function setDatabaseType()17 {18 switch($('#db_type').val()) {19 case 'mysql':20 $('.forpgsql').hide();21 $('.forsqlite').hide();22 $('.formysql').show();23 break;24 case 'pgsql':25 $('.formysql').hide();26 $('.forsqlite').hide();27 $('.forpgsql').show();28 break;29 case 'sqlite':30 $('.formysql').hide();31 $('.forpgsql').hide();32 $('.forsqlite').show();33 checkDBCredentials();34 break;35 }36 78 } 37 79 … … 159 201 160 202 function checkSiteConfigurationCredentials() { 161 var warned = false; 162 var installok = true; 163 if ( ( $('#blog_title').val() != '' ) && ( $('#admin_username').val() != '' ) && ( $('#admin_pass1').val() != '' ) && ( $('#admin_pass2').val() != '' ) ) { 164 //Checking fields is ok 165 if ( $('#admin_pass1').val() != $('#admin_pass2').val() ) { 166 warningtext= 'The passwords do not match, try typing them again.'; 167 $('#install').children('.options').fadeOut().removeClass('ready'); 168 $('#admin_pass1').parents('.installstep').removeClass('done'); 169 $('#admin_pass1').parents('.inputfield').removeClass('invalid').removeClass('valid').addClass('invalid').find('.warning:hidden').html(warningtext).fadeIn(); 170 warned = true; 171 installok = false; 172 } 173 } 174 if($('#admin_email').val() == '' ) { 175 installok = false; 176 } 177 if(!warned) { 178 ida= new Array( '#blog_title', '#admin_username', '#admin_pass1', '#admin_pass2', '#admin_email' ); 179 $(ida).each(function(id) { 180 ido= $(ida).get(id); 181 $(ido).parents('.inputfield').removeClass('invalid').find('.warning:visible').fadeOut(); 182 if($(ido).val() != '') { 183 $(ido).addClass('valid'); 184 } 185 }); 186 } 187 if(installok) { 188 $('#siteconfiguration').addClass('done'); 189 $('#install').children('.options').fadeIn().addClass('ready').addClass('done'); 190 $('#pluginactivation').children('.options').fadeIn().addClass('ready').addClass('done'); 191 $('#pluginactivation').children('.help-me').show(); 192 $('#submitinstall').removeAttr( 'disabled' ); 193 } 194 else { 195 $('#siteconfiguration').removeClass('done'); 196 $('#install').children('.options').fadeOut().removeClass('ready').removeClass('done'); 197 } 203 198 204 } 199 205 … … 297 303 $('form').attr('autocomplete', 'off'); 298 304 itemManage.init(); 299 setDatabaseType();305 habari.installer.setDatabaseType(); 300 306 checkDBCredentials(); 301 307 checkSiteConfigurationCredentials(); 302 $('#db_type').change( setDatabaseType);308 $('#db_type').change(function(){habari.installer.setDatabaseType()}); 303 309 $('#databasesetup input').keyup(function(){queueTimer(checkDBCredentials)}); 304 310 $('#siteconfiguration input').keyup(function(){queueTimer(checkSiteConfigurationCredentials)}); -
branches/081018-handlers/htdocs/system/themes/installer/style.css
r2754 r2815 278 278 padding-left: 3px; 279 279 } 280 281 /* New stuff for handlers branch */ 282 .options fieldset {border:0;padding:0;margin:0;} 283 .options fieldset legend {display:none;} -
branches/081018-handlers/htdocs/system/themes/installer/theme.php
r2813 r2815 46 46 $form->databasesetup->append('wrapper', 'databasesetup_options', null, 'installer_options'); 47 47 // Database Type 48 $form->databasesetup_options->append('select', 'db_type', 'null:null', _t('Database Type') , $this->pdo_drivers);48 $form->databasesetup_options->append('select', 'db_type', 'null:null', _t('Database Type')); 49 49 $form->db_type->selected = $this->db_type; 50 50 $form->db_type->required = true;
