コード例 #1
0
ファイル: bootstrap.php プロジェクト: peterbrinck/PHPMvcCms
define('PATH_APP_CONTROLLERS', PATH_APP . 'controller' . DIRECTORY_SEPARATOR);
define('PATH_APP_VIEWS', PATH_APP . 'view' . DIRECTORY_SEPARATOR);
define('PATH_APP_MODELS', PATH_APP . 'model' . DIRECTORY_SEPARATOR);
// set public uploads folders
define('PATH_PUBLIC_UPLOADS_SOURCE', PATH_ROOT . 'public/uploads/source' . DIRECTORY_SEPARATOR);
define('PATH_PUBLIC_UPLOADS_THUMBS', PATH_ROOT . 'public/uploads/thumbs' . DIRECTORY_SEPARATOR);
// set vendor folder dependencies
define('PATH_VENDOR', PATH_ROOT . 'vendor' . DIRECTORY_SEPARATOR);
// this is the (totally optional) auto-loader for Composer-dependencies (to load tools into your project).
// If you have no idea what this means: Don't worry, you don't need it, simply leave it like it is. The
// default will be used instead.
if (file_exists(PATH_VENDOR . 'autoload.php')) {
    require_once PATH_VENDOR . 'autoload.php';
} else {
    //Define the paths to the directories holding class files
    require_once PATH_VENDOR . 'thom855j/PHPAutoloader/Autoload.php';
    thom855j\PHPAutoloader\Autoload::load(array(PATH_APP, PATH_VENDOR))->namespaces();
}
// load application config (error reporting etc.)
require_once PATH_APP . 'config.php';
// load app class for setting app up
require_once PATH_APP . 'App.php';
// set env
App::load()->set('env', DEBUG);
App::load()->set('date_format', 'd/m/Y H:i');
use thom855j\PHPI18n\I18n;
// set locale
I18n::set('da_DK');
// register i18n
i18n::register(PATH_LANG . 'system', 'system');
i18n::register(PATH_LANG . 'post', 'post');
コード例 #2
0
ファイル: read.php プロジェクト: peterbrinck/PHPMvcCms
<?php

use thom855j\PHPI18n\I18n, thom855j\PHPHtml\Table;
?>
<h2 class="sub-header"><?php 
I18n::output('POST_SUB_HEADER', $this->controller);
?>
</h2> 
<?php 
if (!empty($this->results)) {
    ?>
 
    <div class="table-responsive"> 
        <?php 
    Table::start("class='table table-striped'");
    Table::head(array('ID', i18n::get('POST_TITLE', $this->controller), i18n::get('POST_CREATED', $this->controller), i18n::get('POST_UPDATED', $this->controller), i18n::get('POST_AUTHOR', $this->controller), i18n::get('POST_ACTIONS', $this->controller)));
    foreach ($this->results->data as $view) {
        // Check dates
        $updated = "";
        $created = "";
        if ($view->Updated < 0) {
            $updated = date($this->date_format, $view->Updated);
        }
        if ($view->Created > 0) {
            $created = date($this->date_format, $view->Created);
        }
        $form = "<form action='" . $this->project_url . "admin/delete/post/" . $this->type . "' method='post' onsubmit=\"return confirm('Er du sikker?')\"><input type='hidden' name='id' value='" . $view->ID . "'>" . "<input type='submit' value='" . i18n::get('POST_DELETE', $this->controller) . "' class='btn btn-danger'></form>";
        Table::data(array("#" . $view->ID, $view->Title . " <small>(" . $view->Slug . ")</small>", $created, $updated, " <small>(" . $view->Username . ")</small>", "<a class='btn btn-success' href='" . $this->project_url . 'admin/update/post/' . $this->type . '/' . $view->ID . "'>" . i18n::get('POST_UPDATE', $this->controller) . "</a>", $form));
    }
    Table::end();
    ?>