Changeset 2815

Show
Ignore:
Timestamp:
11/14/08 21:50:57 (8 weeks ago)
Author:
freakerz
Message:

Moving the schema install files to a subdir, worked on the JS. FormUI for schemas is now complete, need to work on the backend now\!

Location:
branches/081018-handlers/htdocs/system
Files:
9 added
1 removed
6 modified

Legend:

Unmodified
Added
Removed
  • branches/081018-handlers/htdocs/system/classes/installhandler.php

    r2813 r2815  
    285285        // Load available schemas' install script 
    286286        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); 
    290290            } 
    291291            $classname = $pdo_driver.'Install'; 
  • branches/081018-handlers/htdocs/system/themes/installer/db_setup.php

    r2813 r2815  
    33<head> 
    44    <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"> 
    66    <meta name="robots" content="noindex,nofollow"> 
    77    <link href="<?php Site::out_url('habari'); ?>/system/themes/installer/style.css" rel="stylesheet" type="text/css"> 
    88    <script type="text/javascript" src="<?php Site::out_url('habari'); ?>/scripts/jquery.js"></script> 
    99    <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" ) ?> 
    1011</head> 
    1112 
  • 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 : ''; ?>"> 
    22    <label for="<?php echo $id; ?>"><?php echo $this->caption; ?><?php echo (isset($required) && $required) ? ' <strong>*</strong>' : ''?></label> 
    33    <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  
     1var habari = {}; 
     2habari.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 
    165function handleAjaxError(msg, status, err) 
    266{ 
     
    1276        '<p>'+error_msg.replace(/(<([^>]+)>)/ig,"")+'</p>' 
    1377    ).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     } 
    3678} 
    3779 
     
    159201 
    160202function 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 
    198204} 
    199205 
     
    297303    $('form').attr('autocomplete', 'off'); 
    298304    itemManage.init(); 
    299     setDatabaseType(); 
     305    habari.installer.setDatabaseType(); 
    300306    checkDBCredentials(); 
    301307    checkSiteConfigurationCredentials(); 
    302     $('#db_type').change(setDatabaseType); 
     308    $('#db_type').change(function(){habari.installer.setDatabaseType()}); 
    303309    $('#databasesetup input').keyup(function(){queueTimer(checkDBCredentials)}); 
    304310    $('#siteconfiguration input').keyup(function(){queueTimer(checkSiteConfigurationCredentials)}); 
  • branches/081018-handlers/htdocs/system/themes/installer/style.css

    r2754 r2815  
    278278    padding-left: 3px; 
    279279} 
     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  
    4646        $form->databasesetup->append('wrapper', 'databasesetup_options', null, 'installer_options'); 
    4747        // 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')); 
    4949        $form->db_type->selected = $this->db_type; 
    5050        $form->db_type->required = true;