Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Andras Toth  >  PHP Translate  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Unit test script
Class: PHP Translate
Get text translations for database or scripts
Author: By
Last change: Update index.php
Date: 2 months ago
Size: 4,053 bytes
 

Contents

Class file image Download
<!DOCTYPE html>
<html lang="en">
  <?php
  
require_once('Translator.php');
  
//$T = Translator::GetInstance('home', 'en', "mysql:host=server;dbname=db;charset=utf8", 'user', 'pass');
  
$T Translator::GetInstance('demo.lang.php''en');
  if(isset(
$_REQUEST['lang'])){$lg=$_REQUEST['lang'];}else{$lg='en';}
  
$T->SetLang($lg);
  
?>
    <head>
        <title>Translator</title>
           <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
        <style type="text/css">
          a,a:focus,a:hover{color:#fff;}.btn-default,.btn-default:hover,
          .btn-default:focus{color:#333;text-shadow:none;background-color:#fff;border:1px solid #fff;}html,body{height:100%;background-color:#333;}body{color:#fff;text-align:center;text-shadow:0 1px 3px rgba(0,0,0,.5);box-shadow:inset 0 0 100px rgba(0,0,0,.5);}
          .site-wrapper{display:table;width:100%;height:100%;min-height:100%;}.site-wrapper-inner{display:table-cell;vertical-align:top;}.cover-container{margin-right:auto;margin-left:auto;}
          .inner{padding:30px;}.masthead-brand{margin-top:10px;margin-bottom:10px;}
          .masthead-nav>li{display:inline-block;}.masthead-nav>li+li{margin-left:20px;}
          .masthead-nav>li>a{padding-right:0;padding-left:0;font-size:16px;font-weight:bold;color:#fff;color:rgba(255,255,255,.75);border-bottom:2px solid transparent;}
          .masthead-nav>li>a:hover,.masthead-nav>li>a:focus{background-color:transparent;border-bottom-color:rgba(255,255,255,.25);}
          .masthead-nav>.active>a,.masthead-nav>.active>a:hover,.masthead-nav>.active>a:focus{color:#fff;border-bottom-color:#fff;}@media(min-width:768px){.masthead-brand{float:left;}
          .masthead-nav{float:right;}}.cover{padding:0 20px;}.cover .btn-lg{padding:10px 20px;font-weight:bold;}
          .mastfoot{color:#999;color:rgba(255,255,255,.5);}@media(min-width:768px){.masthead{position:fixed;top:0;}.mastfoot{position:fixed;bottom:0;}.site-wrapper-inner{vertical-align:middle;}
          .masthead,.mastfoot,.cover-container{width:100%;}}@media(min-width:992px){.masthead,.mastfoot,.cover-container{width:700px;}}
        </style>
    </head>
    <body>
        <div class="site-wrapper">
          <div class="site-wrapper-inner">
            <div class="cover-container">
              <div class="masthead clearfix">
                <div class="inner">
                  <h3 class="masthead-brand"><a href="/"><?php echo $T->T('HOME');?></a></h3>
                  <ul class="nav masthead-nav">
                    <li <?php if($lg=='hu') echo 'class="active"';?>><a href="index.php?lang=hu">Magyar</a></li>
                    <li <?php if($lg=='en') echo 'class="active"';?>><a href="index.php?lang=en">English</a></li>
                    <li <?php if($lg=='ger') echo 'class="active"';?>><a href="index.php?lang=ger">German</a></li>
                    <li <?php if($lg=='fr') echo 'class="active"';?>><a href="index.php?lang=fr">French</a></li>
                  </ul>
                </div>
              </div>
              <div class="inner cover">
                <h1 class="cover-heading"><?php echo $T->T('HEADLINE');?>.</h1>
                <p class="lead">
                    <?php echo $T->T('DIVINFO');?>
                </p>
                <p class="lead">
                  <a href="https://github.com/andrastoth" class="btn btn-lg btn-default" style="margin:5px;"><?php echo $T->T('MOREINFO');?></a>
                  <a href="https://github.com/andrastoth" class="btn btn-lg btn-default" style="margin:5px;"><?php echo $T->T('DOWN');?> - GitHub</a>
                  <a href="http://www.phpclasses.org/package/8606-PHP-PHP-Translator.html" class="btn btn-lg btn-default" style="margin:5px;"><?php echo $T->T('DOWN');?> - PHP Classes</a>
                </p>
              </div>
              <div class="mastfoot">
                <div class="inner">
                  <p>PHP Class <a href="https://github.com/andrastoth">Translator</a>, by <a href="https://atandrastoth.co.uk">Andras Toth</a>.</p>
                </div>
              </div>
            </div>
          </div>
        </div>
    </body>
</html>