rpicms

A CMS for the Raspberry Pi
git clone git://archive.git.mtrnord.blog/RpicmsTeam/rpicms.git
Log | Files | Refs | README | LICENSE

set_variables.php (6800B)


      1 <!--/**
      2 * Set Variable
      3 *
      4 * This script sets the requierd Variables.
      5 *
      6 * @author	Marcel Radzio <info@nordgedanken.de>
      7 * @version	0.2 18/08/2014 18:45
      8 */-->
      9 <?php
     10   ###############################
     11   # include files from root dir #
     12   ###############################
     13   $root_1 = realpath($_SERVER["DOCUMENT_ROOT"]);
     14   $currentdir = getcwd();
     15   $root_2 = str_replace($root_1, '', $currentdir);
     16   $root_3 = explode("/", $root_2);
     17   if ($root_3[1] == 'core') {
     18     echo $root_3[1];
     19     $root = realpath($_SERVER["DOCUMENT_ROOT"]);
     20   }else{
     21     $root = $root_1 . '/' . $root_3[1];
     22   }
     23 ?>
     24 <html>
     25 <head>
     26   <title>Installer | Set Variables</title>
     27 	<!-- Bootstrap core CSS -->
     28 	<link href="../core/libs/theme_engine/BootStrap/css/bootstrap.min.css" rel="stylesheet">
     29 	<!-- Custom styles for this template -->
     30 	<link href="../themes/jumbotron/jumbotron.min.css" rel="stylesheet">
     31 	<link rel="stylesheet" href="../core/libs/theme_engine/font-awesome/css/font-awesome.min.css">
     32 	<link rel="stylesheet" href="../core/libs/theme_engine/bootstrap-social/bootstrap-social.min.css">
     33   <script type="text/javascript">
     34     function foo() {
     35       $(".check > :input").keyup(function() {
     36         var button = document.getElementById("button");
     37         var $emptyFields = $('.check :input').filter(function() {
     38           return $.trim(this.value) === "";
     39         });
     40         if (!$emptyFields.length) {
     41           button.style.display = "block";
     42         }
     43       });
     44     }
     45     onload = foo;
     46   </script>
     47 </head>
     48 <body>
     49   <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
     50     <div class="container">
     51       <div class="navbar-header">
     52         <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
     53           <span class="sr-only">Toggle navigation</span>
     54           <span class="icon-bar"></span>
     55           <span class="icon-bar"></span>
     56           <span class="icon-bar"></span>
     57         </button>
     58         <a class="navbar-brand" href="index.php">Installer</a>
     59       </div>
     60     </div>
     61   </nav>
     62 
     63   <div class="jumbotron">
     64     <div class="container">
     65       <h1>Set Variables</h1>
     66       <!-- Form to give data to config-generator -->
     67       <form action="generate_configs.php" method="post" class="form-horizontal">
     68         <div class="form-group">
     69           <h3>MySQL</h3>
     70             <label for="db_address" class="col-sm-2 control-label">Datenbank Adresse:</label>
     71             <div class="col-sm-10 check">
     72               <input type="name" name="db_address" required="required" placeholder="Datenbank Adresse" maxlength="255" class="form-control" id="db_address">
     73             </div>
     74 
     75             <label for="db_username" class="col-sm-2 control-label">Datenbank Nutzername:</label>
     76             <div class="col-sm-10 check">
     77               <input type="name" name="db_username" required="required" placeholder="Datenbank Nutzername" maxlength="255" class="form-control" id="db_username">
     78             </div>
     79 
     80             <label for="db_password" class="col-sm-2 control-label">Datenbank Passwort:</label>
     81             <div class="col-sm-10 check">
     82               <input type="password" name="db_password" required="required" placeholder="Datenbank Passwort" maxlength="50" class="form-control" id="db_username">
     83             </div>
     84 
     85             <label for="db_name" class="col-sm-2 control-label">Datenbank Name:</label>
     86             <div class="col-sm-10 check">
     87               <input type="name" name="db_name" required="required" placeholder="Datenbank Name" maxlength="255" class="form-control" id="db_username">
     88             </div>
     89         </div>
     90         <div class="form-group">
     91           <h3>Basics</h3>
     92             <label for="blog_name" class="col-sm-2 control-label">Website Name:</label>
     93             <div class="col-sm-10 check">
     94               <input type="name" name="blog_name" required="required" placeholder="Website Name" maxlength="255" class="form-control" id="blog_name">
     95             </div>
     96 
     97             <label for="undertitle" class="col-sm-2 control-label">Untertitel:</label>
     98             <div class="col-sm-10 check">
     99               <input type="name" name="undertitle" required="required" placeholder="Untertitel" maxlength="255" class="form-control" id="undertitle">
    100             </div>
    101 
    102             <label for="keywords" class="col-sm-2 control-label">Schlagw&ouml;rter:</label>
    103             <div class="col-sm-10 check">
    104               <input type="name" name="keywords" placeholder="Schlagw&ouml;rter" maxlength="50" class="form-control" id="keywords">
    105             </div>
    106 
    107             <label for="admin_username" class="col-sm-2 control-label">Admin Username:</label>
    108             <div class="col-sm-10 check">
    109               <input type="name" name="admin_username" required="required" placeholder="Admin Username" maxlength="255" class="form-control" id="admin_username">
    110             </div>
    111 
    112             <label for="admin_password" class="col-sm-2 control-label">Admin Password:</label>
    113             <div class="col-sm-10 check">
    114               <input type="password" name="admin_password" required="required" placeholder="Admin Password" maxlength="50" class="form-control" id="admin_password">
    115             </div>
    116         </div>
    117         <div class="form-group">
    118           <h3>Design</h3>
    119             <label for="theme" class="col-sm-2 control-label">Theme</label>
    120             <div class="col-sm-10">
    121               <select name="theme" class="form-control" id="theme">
    122                 <?php
    123                   $dirs = scandir($root . "/themes");
    124                   $ausnahmen["1"] = ".htaccess";
    125                   $ausnahmen["2"] = ".";
    126                   $ausnahmen["3"] = "..";
    127                   $dirs = array_diff($dirs, $ausnahmen);
    128                   foreach($dirs as $dir){
    129                     $dir_name = ucwords($dir);
    130                     echo "
    131                       <option>$dir_name</option>
    132                     ";
    133                   }
    134                 ?>
    135               </select>
    136             </div>
    137         </div>
    138         <div class="form-group">
    139           <div class="col-sm-offset-2 col-sm-10">
    140             <button type="submit" name="send" class="btn btn-success" style="display:none;" id="button">Go On!</button>
    141           </div>
    142         </div>
    143       </form>
    144     </div>
    145 	</div>
    146 	<div class="container">
    147 		<hr>
    148 		<footer>
    149 			<p>&copy; RpicmsTeam 2014 &amp; 2015</p>
    150 			<?php include($root . '/core/backend/admin/modules/footer.php'); ?>
    151 		</footer>
    152 	</div>
    153 	<!-- Bootstrap core JavaScript
    154 	================================================== -->
    155 	<!-- Placed at the end of the document so the pages load faster -->
    156 	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
    157 	<script src="../core/libs/theme_engine/BootStrap/js/bootstrap.min.js"></script>
    158 </body>
    159 </html>