• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List

system/installer/db_setup.php

00001 <?php
00002 namespace Habari;
00003 if ( !defined( 'HABARI_PATH' ) ) { die('No direct access'); }
00004 ?>
00005 <?php include( 'header.php' ); ?>
00006 <?php if ( !isset( $form_errors ) ) $form_errors = array(); ?>
00007 <?php function elem_if_set($a, $k) { if (isset($a[$k])) { return $a[$k]; } } ?>
00008 
00009 <form action="" method="post" id="installform">
00010 <input type="hidden" name="locale" value="<?php echo Utils::htmlspecialchars($locale); ?>" />
00011 
00012 <div class="installstep ready" id="databasesetup">
00013   <h2><?php _e('Database Setup'); ?></h2>
00014   <a href="#" class="help-me"><?php _e('Help'); ?></a>
00015   <div class="options">
00016 
00017     <div class="inputfield">
00018       <label for="db_type"><?php _e('Database Type'); ?> <strong>*</strong></label>
00019       <select id="db_type" name="db_type" tabindex="<?php echo $tab++; ?>">
00020       <?php
00021         foreach($pdo_drivers as $value => $text){
00022           echo '<option value="'.$value.'"';
00023           if ($db_type == (string)$value) {
00024             echo ' selected="selected"';
00025           }
00026           echo '>' . $text . "</option>\n";
00027         }
00028         foreach($pdo_missing_drivers as $value => $text){
00029           echo '<optgroup label="' . _t('%1$s - missing PDO driver, see help', array($text)) . '"></optgroup>';
00030         }
00031       ?>
00032       </select>
00033       <div class="help">
00034         <?php _e('<strong>Database Type</strong> specifies the type of database to which Habari will connect.  Changing this setting may affect the other fields that are available here.  If the database engine that you wanted to use is not in this list, you may need to install a PDO driver to enable it.'); ?>
00035         <a href="#"><?php _e('Learn More&hellip;'); ?></a>
00036       </div>
00037     </div>
00038 
00039     <h3 class="javascript-disabled"><?php _e('MySQL Settings'); ?></h3>
00040     <div class="javascript-disabled"><?php _e('Use the settings below only if you have selected MySQL as your database engine.'); ?></div>
00041 
00042     <div class="inputfield formysql">
00043       <label for="mysqldatabasehost"><?php _e('Database Host'); ?> <strong>*</strong></label>
00044       <input type="text" id="mysqldatabasehost" name="mysql_db_host" value="<?php echo $db_host; ?>" tabindex="<?php echo $tab++ ?>" />
00045       <img class="status" src="<?php Site::out_url( 'habari' ); ?>/system/installer/images/ready.png" alt="" />
00046       <div class="warning"><?php echo elem_if_set( $form_errors, 'mysql_db_host'); ?></div>
00047       <div class="help">
00048         <?php _e('<strong>Database Host</strong> is the host (domain) name or server IP address of the server that runs the MySQL database to which Habari will connect.  If MySQL is running on your web server, and most of the time it is, "localhost" is usually a good value for this field.'); ?>
00049         <a href="#"><?php _e('Learn More&hellip;'); ?></a>
00050       </div>
00051     </div>
00052 
00053     <div class="inputfield formysql">
00054       <label for="mysqldatabaseuser"><?php _e('Username'); ?> <strong>*</strong></label>
00055       <input type="text" id="mysqldatabaseuser" name="mysql_db_user" value="<?php echo $db_user; ?>" tabindex="<?php echo $tab++ ?>" />
00056       <img class="status" src="<?php Site::out_url( 'habari' ); ?>/system/installer/images/ready.png" alt="" />
00057       <div class="warning"><?php echo elem_if_set( $form_errors, 'mysql_db_user'); ?></div>
00058       <div class="help">
00059         <?php _e('<strong>Database User</strong> is the username used to connect Habari to the MySQL database.'); ?>
00060         <a href="#"><?php _e('Learn More&hellip;'); ?></a>
00061       </div>
00062     </div>
00063 
00064     <div class="inputfield formysql">
00065       <label for="mysqldatabasepass"><?php _e('Password'); ?> <strong>*</strong></label>
00066       <input type="password" id="mysqldatabasepass" name="mysql_db_pass" value="<?php /* echo $db_pass; */ ?>" tabindex="<?php echo $tab++ ?>" />
00067       <img class="status" src="<?php Site::out_url( 'habari' ); ?>/system/installer/images/ready.png" alt="" />
00068       <div class="warning"><?php echo elem_if_set( $form_errors, 'mysql_db_pass'); ?></div>
00069       <div class="help">
00070         <?php _e('<strong>Database Password</strong> is the password used to connect the specified user to the MySQL database.'); ?>
00071         <a href="#"><?php _e('Learn More&hellip;'); ?></a>
00072       </div>
00073     </div>
00074 
00075     <div class="inputfield formysql">
00076       <label for="mysqldatabasename"><?php _e('Database Name'); ?> <strong>*</strong></label>
00077       <input type="text" id="mysqldatabasename" name="mysql_db_schema" value="<?php echo $db_schema; ?>" tabindex="<?php echo $tab++ ?>" />
00078       <img class="status" src="<?php Site::out_url( 'habari' ); ?>/system/installer/images/ready.png" alt="" />
00079       <div class="warning"><?php echo elem_if_set( $form_errors, 'mysql_db_schema'); ?></div>
00080       <div class="help">
00081         <?php _e('<strong>Database Name</strong> is the name of the MySQL database to which Habari will connect.'); ?>
00082         <a href="#"><?php _e('Learn More&hellip;'); ?></a>
00083       </div>
00084     </div>
00085 
00086     <h3 class="javascript-disabled"><?php _e('PostgreSQL Settings'); ?></h3>
00087     <div class="javascript-disabled"><?php _e('Use the settings below only if you have selected PostgreSQL as your database engine.'); ?></div>
00088 
00089     <div class="inputfield forpgsql">
00090       <label for="pgsqldatabasehost"><?php _e('Database Host'); ?> <strong>*</strong></label>
00091       <input type="text" id="pgsqldatabasehost" name="pgsql_db_host" value="<?php echo $db_host; ?>" tabindex="<?php echo $tab++ ?>" />
00092       <img class="status" src="<?php Site::out_url( 'habari' ); ?>/system/installer/images/ready.png" alt="" />
00093       <div class="warning"><?php echo elem_if_set( $form_errors, 'pgsql_db_host'); ?></div>
00094       <div class="help">
00095         <?php _e('<strong>Database Host</strong> is the host (domain) name or server IP address of the server that runs the PostgreSQL database to which Habari will connect.  If PostgreSQL is running on your web server, and most of the time it is, "localhost" is usually a good value for this field.'); ?>
00096         <a href="#"><?php _e('Learn More&hellip;'); ?></a>
00097       </div>
00098     </div>
00099 
00100     <div class="inputfield forpgsql">
00101       <label for="pgsqldatabaseuser"><?php _e('Username'); ?> <strong>*</strong></label>
00102       <input type="text" id="pgsqldatabaseuser" name="pgsql_db_user" value="<?php echo $db_user; ?>" tabindex="<?php echo $tab++ ?>" />
00103       <img class="status" src="<?php Site::out_url( 'habari' ); ?>/system/installer/images/ready.png" alt="" />
00104       <div class="warning"><?php echo elem_if_set( $form_errors, 'pgsql_db_user'); ?></div>
00105       <div class="help">
00106         <?php _e('<strong>Database User</strong> is the username used to connect Habari to the PostgreSQL database.'); ?>
00107         <a href="#"><?php _e('Learn More&hellip;'); ?></a>
00108       </div>
00109     </div>
00110 
00111     <div class="inputfield forpgsql">
00112       <label for="pgsqldatabasepass"><?php _e('Password'); ?> <strong>*</strong></label>
00113       <input type="password" id="pgsqldatabasepass" name="pgsql_db_pass" value="<?php /* echo $db_pass; */ ?>" tabindex="<?php echo $tab++ ?>" />
00114       <img class="status" src="<?php Site::out_url( 'habari' ); ?>/system/installer/images/ready.png" alt="" />
00115       <div class="warning"><?php echo elem_if_set( $form_errors, 'pgsql_db_pass'); ?></div>
00116       <div class="help">
00117         <?php _e('<strong>Database Password</strong> is the password used to connect the specified user to the PostgreSQL database.'); ?>
00118         <a href="#"><?php _e('Learn More&hellip;'); ?></a>
00119       </div>
00120     </div>
00121 
00122     <div class="inputfield forpgsql">
00123       <label for="pgsqldatabasename"><?php _e('Database Name'); ?> <strong>*</strong></label>
00124       <input type="text" id="pgsqldatabasename" name="pgsql_db_schema" value="<?php echo $db_schema; ?>" tabindex="<?php echo $tab++ ?>" />
00125       <img class="status" src="<?php Site::out_url( 'habari' ); ?>/system/installer/images/ready.png" alt="" />
00126       <div class="warning"><?php echo elem_if_set( $form_errors, 'pgsql_db_schema'); ?></div>
00127       <div class="help">
00128         <?php _e('<strong>Database Name</strong> is the name of the PostgreSQL database to which Habari will connect.'); ?>
00129         <a href="#"><?php _e('Learn More&hellip;'); ?></a>
00130       </div>
00131     </div>
00132 
00133     <h3 class="javascript-disabled"><?php _e('SQLite Settings'); ?> <strong>*</strong></h3>
00134     <div class="javascript-disabled"><?php _e('Use the settings below only if you have selected SQLite as your database engine.'); ?></div>
00135 
00136     <div class="inputfield forsqlite">
00137       <label for="databasefile"><?php _e('Data file'); ?> <strong>*</strong></label>
00138       <input type="text" id="databasefile" name="db_file" value="<?php echo $db_file; ?>" tabindex="<?php echo $tab++ ?>" />
00139       <img class="status" src="<?php Site::out_url( 'habari' ); ?>/system/installer/images/ready.png" alt="" />
00140       <div class="warning"><?php echo elem_if_set( $form_errors, 'db_file'); ?></div>
00141       <div class="help">
00142         <?php _e('<strong>Data file</strong> is the SQLite file that will store your Habari data.  This should be the path to where your data file resides, relative to the Habari user directory.'); ?> <a href="#"><?php _e('Learn More&hellip;'); ?></a>
00143       </div>
00144     </div>
00145   </div>
00146 
00147   <div class="advanced-options">
00148     <div class="inputfield">
00149       <label for="tableprefix"><?php _e('Table Prefix'); ?></label>
00150       <input type="text" id="tableprefix" name="table_prefix" value="<?php echo $table_prefix; ?>" tabindex="<?php echo $tab++ ?>" />
00151       <img class="status" src="<?php Site::out_url( 'habari' ); ?>/system/installer/images/ready.png" alt="" />
00152       <div class="warning"><?php echo elem_if_set( $form_errors, 'table_prefix'); ?></div>
00153       <div class="help">
00154         <?php _e('<strong>Table Prefix</strong> is a prefix that will be appended to each table that Habari creates in the database, making it easy to distinguish those tables in the database from those of other installations.'); ?>
00155         <a href="#"><?php _e('Learn More&hellip;'); ?></a>
00156       </div>
00157     </div>
00158     <div class="inputfield">
00159       <button type="button" name="check_db_connection" id="check_db_connection" tabindex="<?php echo $tab++ ?>"><?php _e('Check Database Connection'); ?></button>
00160     </div>
00161   </div>
00162   <div class="bottom"></div>
00163 </div>
00164 
00165 <div class="next-section"></div>
00166 
00167 <div class="installstep ready" id="siteconfiguration">
00168   <h2><?php _e('Site Configuration'); ?></h2>
00169   <a href="#" class="help-me"><?php _e('Help'); ?></a>
00170   <div class="options">
00171 
00172     <div class="inputfield">
00173       <label for="sitename"><?php _e('Site Name'); ?> <strong>*</strong></label>
00174       <input type="text" id="sitename" name="blog_title" value="<?php echo $blog_title; ?>" tabindex="<?php echo $tab++ ?>" />
00175       <img class="status" src="<?php Site::out_url( 'habari' ); ?>/system/installer/images/ready.png" alt="" />
00176       <div class="warning"><?php echo elem_if_set( $form_errors, 'blog_title'); ?></div>
00177       <div class="help">
00178         <?php _e('<strong>Site Name</strong> is the name of your site as it will appear to your visitors.'); ?>  <a href="#"><?php _e('Learn More&hellip;'); ?></a>
00179       </div>
00180     </div>
00181 
00182     <div class="inputfield">
00183       <label for="adminuser"><?php _e('Username'); ?> <strong>*</strong></label>
00184       <input type="text" id="adminuser" name="admin_username" value="<?php echo $admin_username; ?>" tabindex="<?php echo $tab++ ?>" />
00185       <img class="status" src="<?php Site::out_url( 'habari' ); ?>/system/installer/images/ready.png" alt="" />
00186       <div class="warning"><?php echo elem_if_set( $form_errors, 'admin_username'); ?></div>
00187       <div class="help">
00188         <?php _e('<strong>Username</strong> is the username of the initial user in Habari.'); ?>  <a href="#"><?php _e('Learn More&hellip;'); ?></a>
00189       </div>
00190     </div>
00191 
00192     <div class="inputfield">
00193       <label for="adminpass1"><?php _e('Password'); ?> <strong>*</strong></label>
00194       <input type="password" id="adminpass1" name="admin_pass1" value="<?php echo $admin_pass1; ?>" tabindex="<?php echo $tab++ ?>" />
00195       <label for="adminpass2"><?php _e('Password (again)'); ?> <strong>*</strong></label>
00196       <input type="password" id="adminpass2" name="admin_pass2" value="<?php echo $admin_pass2; ?>" tabindex="<?php echo $tab++ ?>" />
00197       <img class="status" src="<?php Site::out_url( 'habari' ); ?>/system/installer/images/ready.png" alt="" />
00198       <div class="warning"><?php echo elem_if_set( $form_errors, 'admin_pass'); ?></div>
00199       <div class="help">
00200         <?php _e('<strong>Password</strong> is the password of the initial user in Habari. Both password fields must match.'); ?>  <a href="#"><?php _e('Learn More&hellip;'); ?></a>
00201       </div>
00202     </div>
00203 
00204     <div class="inputfield">
00205       <label for="adminemail"><?php _e('Admin Email'); ?> <strong>*</strong></label>
00206       <input type="text" id="adminemail" name="admin_email" value="<?php echo $admin_email; ?>" tabindex="<?php echo $tab++ ?>" />
00207       <img class="status" src="<?php Site::out_url( 'habari' ); ?>/system/installer/images/ready.png" alt="" />
00208       <div class="warning"><?php echo elem_if_set( $form_errors, 'admin_email'); ?></div>
00209       <div class="help">
00210         <?php _e('<strong>Admin Email</strong> is the email address of the first user account.'); ?>
00211         <a href="#"><?php _e('Learn More&hellip;'); ?></a>
00212       </div>
00213     </div>
00214 
00215   </div>
00216   <div class="bottom"></div>
00217 </div>
00218 
00219 <div class="next-section"></div>
00220 
00221 <div class="installstep ready" id="themeselection">
00222   <h2><?php _e('Theme Selection'); ?></h2>
00223   <a href="#" class="help-items"><?php _e('Help'); ?></a>
00224   <div class="options items">
00225     <?php foreach($themes as $key => $theme) { ?>
00226       <div class="item clear clearfix">
00227         <div class="head">
00228           <span class="checkbox">
00229             <input type="radio" name="theme" value="<?php echo $key; ?>"
00230               id="theme_<?php echo $theme['dir']; ?>" tabindex="<?php echo $tab++ ?>"
00231               class="theme_selection"
00232               data-requires="<?php echo isset($theme['requires']) ? (string)InstallHandler::get_feature_list($theme['requires']) : ''; ?>"
00233               data-provides="<?php echo isset($theme['provides']) ? (string)InstallHandler::get_feature_list($theme['provides']) : ''; ?>"
00234               data-conflicts="<?php echo isset($theme['conflicts']) ? (string)InstallHandler::get_feature_list($theme['conflicts']) : ''; ?>"
00235               />
00236           </span>
00237           <label for="theme_<?php echo $theme['dir']; ?>" class="name"><?php echo $theme['info']->name; ?> <span class="version"><?php echo $theme['info']->version; ?></span></label>
00238           <label for="theme_<?php echo $theme['dir']; ?>" class="image"><img src="<?php echo $theme['screenshot']; ?>" width="150px"></label>
00239         </div>
00240         <div class="item-help"><?php echo $theme['info']->description; ?></div>
00241       </div>
00242     <?php } ?>
00243   </div>
00244   <div class="bottom"></div>
00245 </div>
00246 
00247 <div class="next-section"></div>
00248 
00249 <div class="installstep ready" id="pluginactivation">
00250   <h2><?php _e('Plugin Activation'); ?></h2>
00251   <a href="#" class="help-me"><?php _e('Help'); ?></a>
00252   <div class="options items">
00253     <?php foreach($plugins as $plugin) { ?>
00254     <?php if ( !isset($plugin['info']) ) { ?>
00255 
00256       <div class="item clear">
00257         <div class="head">
00258           <p><?php printf( _t('The plugin file %s is a legacy plugin, and does not include an XML info file.'), $plugin['file'] ); ?></p>
00259         </div>
00260       </div>
00261 
00262       <?php } else { ?>
00263       <div class="item clear">
00264         <div class="head">
00265           <span class="checkbox"><input
00266             type="checkbox"
00267             name="plugin_<?php echo $plugin['plugin_id']; ?>"
00268             id="plugin_<?php echo $plugin['plugin_id']; ?>"
00269             <?php if ($plugin['recommended']) echo ' checked="checked"'; ?>
00270             tabindex="<?php echo $tab++ ?>"
00271             class="plugin_selection"
00272             data-requires="<?php echo $plugin['requires']; ?>"
00273             data-provides="<?php echo $plugin['provides']; ?>"
00274             data-conflicts="<?php echo $plugin['conflicts']; ?>"
00275             /></span><label for="plugin_<?php echo $plugin['plugin_id']; ?>"><span class="name"><?php echo $plugin['info']->name; ?></span> <span class="version"><?php echo $plugin['info']->version; ?></span><span class="feature_note"></span></label>
00276         </div>
00277         <div class="help"><?php echo $plugin['info']->description; ?></div>
00278       </div>
00279       <?php } ?>
00280     <?php } ?>
00281     <div class="controls item">
00282       <span class="checkbox"><input type="checkbox" name="checkbox_controller" id="checkbox_controller" tabindex="<?php echo $tab++ ?>" /></span>
00283       <label for="checkbox_controller">None Selected</label>
00284     </div>
00285   </div>
00286   <div class="bottom"></div>
00287 </div>
00288 
00289 <div class="next-section"></div>
00290 
00291 <div class="installstep ready" id="install">
00292   <h2><?php _e('Install'); ?></h2>
00293   <div class="options">
00294     <div class="inputfield submit">
00295       <p><?php _e('Habari now has all of the information needed to install itself on your server.'); ?></p>
00296       <p id="feature_error"><?php _e('The selected theme and plugins require additional features:'); ?> <span id="unfulfilled_feature_list"></span></p>
00297       <input type="submit" name="submit" value="<?php _e('Install Habari'); ?>" id="submitinstall" tabindex="<?php echo $tab++ ?>" />
00298     </div>
00299   </div>
00300   <div class="bottom"></div>
00301 </div>
00302 
00303 </form>
00304 
00305 <script type="text/javascript" src="<?php Site::out_url('habari'); ?>/system/installer/script.js"></script>
00306 
00307 <?php include( 'footer.php' ); ?>

Generated on Sun Aug 4 2013 12:51:44 for Habari by  doxygen 1.7.1