/**
 * This contains all html specific functions
 * @version     $Id: html.php 40 2011-02-09 14:10:00Z biyi $
 * @package     Platform
 * @category    Function
 * @author      Biyi Akinpelu
 * @link        mailto:biyi@entilda.com
 * @copyright   Copyright (C) 2011 - 2012 The Platform Authors. All rights reserved.
 * @license     GNU Public Licence, see LICENSE.php
 * Platform is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */
function html($title = 'Test Application', $file = 'index.html')
{
    ob_start();
    ?>
<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <title><?php 
    echo $title;
    ?>
</title>
    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Ubuntu:400,500,700,regular,bold&subset=Latin">
    <link rel="stylesheet" type="text/css" href="assets/css/app.css" />
    <?php 
    js_add_jquery();
    ?>
  </head>
  <body>
    <h1>Hello World</h1>
    <p>This is a sample test application.</p>
    <p>Edit this content as you wish.</p>
    <p>Enjoy!</p>
    <div id="overlay_canvas">
      <div id="app">
        <span class="logo" style="background: transparent url('<?php 
    echo image_data_uri("assets/images/icons/application-128x128.png", "png");
    ?>
') no-repeat;"></span><span class="navigator text"><?php 
    echo $title;
    ?>
</span>
      </div>
    </div>
    <?php 
    js_add('assets/js/app.js');
    ?>
  
  </body>
</html>

  <?php 
    $html = ob_get_clean();
    create_file($file, $html);
}
Exemple #2
0
<?php

include_once 'ressources/class.templates.inc';
include_once 'ressources/class.ldap.inc';
include_once 'ressources/class.users.menus.inc';
include_once 'ressources/class.apache.inc';
include_once 'ressources/class.system.network.inc';
include_once 'ressources/class.pdns.inc';
$usersmenus = new usersMenus();
if (!$usersmenus->AsOrgAdmin) {
    $tpl = new templates();
    echo $tpl->javascript_parse_text('{ERROR_NO_PRIVS}');
    exit;
}
if (isset($_GET["add"])) {
    js_add();
    exit;
}
if (isset($_GET["popup-add"])) {
    popup_add();
    exit;
}
if (isset($_GET["wwwInfos"])) {
    wwwInfos();
    exit;
}
if (isset($_GET["add-www-service"])) {
    add_web_service();
    exit;
}
if (isset($_GET["delete-www-service"])) {
  $('#go').click(function(){
    var address = $('#address-bar-input').val();
    urlprotocol(address);
  });

  system_load('notification_network');

});
</script>
<?php 
// Keybase.io
js_add('http://' . HOST . '/sandbox/system/languages/javascript/libraries/kbpgp/kbpgp-2.0.8-min.js');
// TODO: Geolocation Detection
// Test Link: https://maps.googleapis.com/maps/api/js?key=AlzaSyCzl78mQ2pspVcc3CHJBYVhS1mpg4pqsZs&v=3.19
js_add("https://maps.googleapis.com/maps/api/js?key=AIzaSyAo5nL84P30jpU1MCHcpF6vU-gN9IRn9WM&sensor=true");
?>
<script>
// Geolocation Detection Code Examples
// HTML5: JavaScript Detection
// http://www.w3schools.com/html/html5_geolocation.asp
// http://diveintohtml5.info/geolocation.html
// http://krister.fi/jquery.geolocator/
// http://www.sitepoint.com/geolocation-jquery-api-geoplugin
// http://www.geoplugin.com/webservices/javascript

// PHP: Geolocation Detection
// http://php.net/manual/en/book.geoip.php
// https://github.com/maxmind/
// https://packagist.org/packages/geoip/geoip
// https://packagist.org/packages/geoip2/geoip2
?>
<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Ubuntu:400,500,700,regular,bold&subset=Latin">
    <link rel="stylesheet" type="text/css" href="assets/css/app.css" />
    <?php 
js_add('https://maps.googleapis.com/maps/api/js?key=AIzaSyAo5nL84P30jpU1MCHcpF6vU-gN9IRn9WM&sensor=true&v=3.19');
?>
  
    <?php 
js_add_jquery();
?>
    <?php 
js_add('assets/js/app.js');
?>
  
  </head>
  <body>
    <div id="map_canvas"></div>
    <div id="directions_panel"></div>
    <div id="overlay_canvas">
      <div id="brand">
        <span class="navigator logo" style="background: transparent url('<?php 
echo image_data_uri("assets/images/map.png", "png");
?>
') no-repeat;"></span><span class="navigator text">navi<span style="color: rgb(118, 160, 213);">gate</span><!--<sup>&lt;maps&gt;</sup><sub>&lt;/maps&gt;</sub>--></span>
      </div>
      <div id="coordinate">
        <label for="latitude">Latitude</label> <span class="coords latitude">0.00000</span>