コード例 #1
0
<?php

/**
 * This page should handle all of the print requests.
 *
 * @package Business-Card-Generator
 */
global $http, $html, $app;
if (!defined('ROOT')) {
    define('ROOT', dirname(__FILE__));
}
require_once ROOT . '/m.inc.php';
tryDef('CURRENT_PAGE_NAME', false);
if (!isset($html)) {
    $html = new html();
}
tryReq('app.inc.php');
if (!isset($app)) {
    $app = new App();
}
// print requests can now be handled.
$html->code('<!doctype html><html><head><meta charset="uft-8"><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">' . "<link href='http://fonts.googleapis.com/css?family=" . GOOGLE_FONTS . "' rel='stylesheet' type='text/css'>" . '<style type="text/css">');
$html->code('#front,#back{width: 200mm;height: 257mm;page-break-before:always}#front div,#back div{margin:2mm;height:51mm;width:89mm;-moz-border-radius:5px;-o-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}#front div p,#back p{font-family:\'Lato\', sans-serif;font-size:15px;margin:0;padding:0;line-height:100%;letter-spacing:0');
$html->code('</style></head><body><div id="front">');
$app->card($_GET, 1, 10, true);
$html->code('</div><div id="back">');
$app->card($_GET, 2, 10, true);
$html->code('</div><script type="text/javascript">javascript:window.print()</script></body></html>');
$html->dump();
コード例 #2
0
<?php

/**
 * The configuration settings of some important things. To change the text that is displayed, check out talk.inc.php
 *
 * @package Business-Card-Generator
 */
if (!defined('ROOT')) {
    define('ROOT', dirname(__FILE__));
}
require_once ROOT . '/m.inc.php';
// Behind-the-scenes (but important!!!)
tryDef('FORCE_HTTPS', false);
// If this is set to true, this will force the user to use HTTPS.
tryDef('HAS_HTTPS', false);
// If your website works over HTTPS, please set this to true. Else, it should be set to false.
tryDef('HOME_URL', 'localhost/git/Business-Card-Generator');
// The URL (without the protocol) where the website is.
tryDef('GOOGLE_ANALYTICS_ID', false);
// e.g. UA-XXXXX-X
tryDef('BUFFER_SIZE', 300);
// In characters. This applies to the HTML (and the JSON that comes out of the exporter) - not any of the resources, like the CSS and JS.
tryDef('EXPORT_FNAME', 'business-card.json');
// The default name of the export file.
tryDef('MAX_IMPORT_SIZE', 10240);
// Max filesize for an import. Default: 10kb.
tryDef('GOOGLE_FONTS', 'Lato|Crete+Round:400italic');
tryDef('PREVENT_IE', true);
// If this is true, then IE users won't be able to view any of the pages on this website.
コード例 #3
0
<?php

/**
 * The home page.
 *
 * @package Business-Card-Generator
 */
global $http, $html;
if (!defined('ROOT')) {
    define('ROOT', dirname(__FILE__));
}
require_once ROOT . '/m.inc.php';
tryDef('CURRENT_PAGE_NAME', __(7));
tryReq('top.inc.php');
$html->hero(9, 10);
tryReq('bottom.inc.php');
コード例 #4
0
     * @since 0.1
     * @uses ROOT as the default prefix
     *
     * @param string $file
     * @param bool|string $prefix Optional. Either false for ROOT or a string ending with a slash (/)
     * @return bool False means that the file could not be read. True means that the file could be read and was retrieved.
     */
    function tryReq($file, $prefix = false)
    {
        if (is_readable(($prefix ? $prefix : ROOT . '/') . $file)) {
            require_once ($prefix ? $prefix : ROOT . '/') . $file;
        } else {
            return false;
        }
        // File isn't readable, so return FALSE.
        return true;
        // We can read the file, and we already have by the time we get here, so we should return TRUE.
    }
}
if (!defined('HAS_M_INC_PHP')) {
    tryDef('HAS_M_INC_PHP', true);
    if (!defined('NO_PRELOAD')) {
        tryReq('callbacks.inc.php');
        tryReq('config.inc.php');
        tryReq('talk.inc.php');
        tryReq('basic-security.inc.php');
        tryReq('http.inc.php');
        tryReq('html.inc.php');
        hook('ready');
    }
}
コード例 #5
0
<?php

/**
 * The Create page (I wanted to avoid using .htaccess so I ended up putting this file into a new dir)
*
* @package Business-Card-Generator
*/
global $http, $html, $app;
if (!defined('ROOT')) {
    define('ROOT', dirname(dirname(__FILE__)));
}
require_once ROOT . '/m.inc.php';
tryDef('CURRENT_PAGE_NAME', __(8));
tryDef('FORCE_NEW_TAB', true);
function end_head_hook()
{
    global $html, $http;
    $html->code("<link href='http://fonts.googleapis.com/css?family=" . GOOGLE_FONTS . "' rel='stylesheet' type='text/css'>" . '<link rel="stylesheet" href="' . $http->where('app-css') . '">');
}
function footer_hook()
{
    global $html, $http;
    $html->code('<script src="' . $http->where('bootstrap-tab-js') . '"></script><script src="' . $http->where('app-js') . '"></script>');
}
tryReq('top.inc.php');
$html->row(array('width' => 12, 'title' => 11, 'p' => array(12)));
tryReq('app.inc.php');
$app = new App();
$app->launch();
tryReq('bottom.inc.php');