예제 #1
0
 protected function showMainTemplate($page, $content, $continue)
 {
     $filename = "wiz_layout.tpl";
     $path = $this->getRealPath('', $filename);
     jTplConfig::$templatePath = dirname($path) . '/';
     $this->loadLocales('', 'wiz_layout');
     $conf = $this->config[$this->stepName . '.step'];
     $tpl = new jTpl();
     $tpl->assign('title', $page->getLocale($page->title));
     if (isset($conf['messageHeader'])) {
         $tpl->assign('messageHeader', $conf['messageHeader']);
     } else {
         $tpl->assign('messageHeader', '');
     }
     if (isset($conf['messageFooter'])) {
         $tpl->assign('messageFooter', $conf['messageFooter']);
     } else {
         $tpl->assign('messageFooter', '');
     }
     $tpl->assign('MAIN', $content);
     $tpl->assign(array_merge(array('enctype' => ''), $conf));
     $tpl->assign('stepname', $this->stepName);
     $tpl->assign('lang', $this->lang);
     $tpl->assign('next', $continue && isset($conf['next']));
     $tpl->assign('previous', isset($conf['__previous']) ? $conf['__previous'] : '');
     $tpl->assign('appname', isset($this->config['appname']) ? $this->config['appname'] : 'Application');
     $tpl->display($filename, 'html');
 }
예제 #2
0
파일: index.php 프로젝트: hadrienl/jelix
<?php

require 'diff/difflib.php';
require 'diff/diffhtml.php';
if (!defined('SIMPLE_TEST')) {
    define('SIMPLE_TEST', 'simpletest/');
}
require_once SIMPLE_TEST . 'unit_tester.php';
require_once SIMPLE_TEST . 'reporter.php';
require_once SIMPLE_TEST . 'myhtmlreporter.class.php';
require_once SIMPLE_TEST . 'junittestcase.class.php';
require_once '../jtpl_standalone_prepend.php';
require_once 'compiler.php';
require_once 'expressions_parsing.php';
jTplConfig::$lang = 'fr';
$test = new GroupTest('All tests');
$test->addTestCase(new UTjtplcontent());
$test->addTestCase(new UTjtplexpr());
$test->run(new myHtmlReporter());
    static $localizedMessages = array();
    /**
     * @internal
     */
    static $pluginPathList = array();
    static function addPluginsRepository($path)
    {
        if (trim($path) == '') {
            return;
        }
        if (!file_exists($path)) {
            throw new Exception('The given path, ' . $path . ' doesn\'t exists');
        }
        if (substr($path, -1) != '/') {
            $path .= '/';
        }
        if ($handle = opendir($path)) {
            while (false !== ($f = readdir($handle))) {
                if ($f[0] != '.' && is_dir($path . $f)) {
                    self::$pluginPathList[$f][] = $path . $f . '/';
                }
            }
            closedir($handle);
        }
    }
}
jTplConfig::$cachePath = realpath(JTPL_PATH . 'temp/') . '/';
jTplConfig::$localizedMessagesPath = realpath(JTPL_PATH . 'locales/') . '/';
jTplConfig::$templatePath = realpath(JTPL_PATH . 'templates/') . '/';
jTplConfig::addPluginsRepository(realpath(JTPL_PATH . 'plugins/'));
include JTPL_PATH . 'jTpl.class.php';
예제 #4
0
파일: exemple.php 프로젝트: hadrienl/jelix
<?php

error_reporting(E_ALL);
include '../jtpl_standalone_prepend.php';
jTplConfig::$cachePath = dirname(__FILE__) . '/../temp/';
jTplConfig::$templatePath = dirname(__FILE__) . '/';
$tpl = new jTpl();
$countries = array('France', 'Italie', 'Espagne', 'Belgique');
$tpl->assign('countries', $countries);
$tpl->assign('titre', 'This is a test !');
$tpl->display('test.tpl');
$tpl = new jTpl();
$tpl->assign('titre', 'This is an other test !');
$tpl->display('foo/test.tpl');
예제 #5
0
<?php

jTplConfig::$localizedMessages = array('file.directory.notexists' => 'Le répertoire demandé (%s) n\'existe pas', 'file.directory.notwritable' => 'Impossible d\'écrire le fichier %s, assurez vous que le répertoire %s autorise l\'écriture', 'file.write.error' => 'Un problème est survenu lors de l\'écriture du fichier %s en utilisant le fichier temporaire %s', 'errors.tpl.tag.syntax.invalid' => 'Dans le template %2$s La syntaxe de balise %1$s est invalide', 'errors.tpl.tag.function.invalid' => 'Dans le template %2$s La syntaxe de la fonction %1$s est invalide', 'errors.tpl.tag.function.unknown' => 'Dans le template %2$s La fonction %1$s est inconnue', 'errors.tpl.tag.modifier.invalid' => 'Dans le tag %s du template %3$s La syntaxe du modificateur %2$s est invalide', 'errors.tpl.tag.modifier.unknown' => 'Dans le tag %s du template %3$s Le modificateur %2$s est inconnu', 'errors.tpl.tag.block.end.missing' => 'Dans le template %2$s, la fin d\'un bloc %1$s est manquant', 'errors.tpl.tag.block.begin.missing' => 'Dans le template %2$s, le début d\'un bloc %1$s est manquant', 'errors.tpl.tag.phpsyntax.invalid' => 'Dans le tag %s du template %3$s, le code php %2$s n\'est pas autorisé', 'errors.tpl.tag.locale.invalid' => 'Dans le tag %s du template %s, clef de localisation vide', 'errors.tpl.tag.character.invalid' => 'Dans le tag %s du template %3$s, le caractère  %2$s n\'est pas autorisé', 'errors.tpl.tag.bracket.error' => 'Dans le tag %s du template %s, il y a des erreurs au niveau des parenthèses', 'errors.tpl.not.found' => 'Le fichier template %s est introuvable', 'errors.tpl.tag.meta.unknown' => 'Dans le template %2$s La balise meta %1$s est inconnue', 'errors.tpl.tag.meta.invalid' => 'Dans le template %2$s La syntaxe de la meta %1$s est invalide', 'errors.tplplugin.block.too.few.arguments' => 'Dans le tag %s du template %s, arguments manquants', 'errors.tplplugin.block.too.many.arguments' => 'Dans le tag %s du template %s, arguments en trop', 'errors.tplplugin.block.bad.argument.number' => 'Dans le tag %s du template %3$s, nombre d\'arguments incorrect (%2$s attendus)', 'errors.tpl.tag.constant.notallowed' => 'Dans le tag %s du template %3$s, les constantes (%2$s) sont interdites', 'errors.tpl.tag.locale.end.missing' => 'Dans le tag %s du template %s, il manque la fin de la clef de localisation', 'errors.tplplugin.cfunction.bad.argument.number' => 'Dans le tag %s du template %3$s, nombre d\'arguments incorrect (%2$s attendus)', 'errors.tplplugin.cmodifier.bad.argument.number' => 'Dans le modificateur %s dans le template %3$s, nombre d\'arguments incorrect (%2$s attendus)', 'errors.tplplugin.untrusted.not.available' => 'Le tag %s dans le template %2$s n\'est pas autorisé dans un template sans confiance', 'errors.tplplugin.function.argument.unknown' => 'Dans le tag %2$s du template %3$s l\'argument %1$s est inconnu', 'errors.tplplugin.function.invalid' => 'Dans le tag %1$s du template %3$s la syntaxe est invalide');
예제 #6
0
<?php

jTplConfig::$localizedMessages = array('file.directory.notexists' => 'The directory (%s) doesn\'t exist', 'file.directory.notwritable' => 'Impossible to write into the file %s, verify that rights are enabled', 'file.write.error' => 'A problem has occured during the writing of the file %s by using the temporary file %s', 'errors.tpl.tag.syntax.invalid' => 'In the template %2$s, invalid syntax on tag %1$s', 'errors.tpl.tag.function.invalid' => 'In the template %2$s, invalid syntax on the function %1$s', 'errors.tpl.tag.function.unknown' => 'In the template %2$s, unknown fonction %1$s', 'errors.tpl.tag.modifier.invalid' => 'In the tag %s in the template %3$s, invalid syntax on the modifier %2$s', 'errors.tpl.tag.modifier.unknown' => 'In the tag %s  in the template %3$s,  unknown modifier %2$s', 'errors.tpl.tag.block.end.missing' => 'In the template %2$s, end of  bloc %1$s is missing', 'errors.tpl.tag.block.begin.missing' => 'In the template %2$s, begin of bloc %1$s is missing', 'errors.tpl.tag.phpsyntax.invalid' => 'In the tag %s  in the template %3$s, php code %2$s is not allowed', 'errors.tpl.tag.locale.invalid' => 'In the tag %s  in the template %s, locale key is empty', 'errors.tpl.tag.character.invalid' => 'In the tag %s  in the template %3$s, character %2$s not allowed', 'errors.tpl.tag.bracket.error' => 'In the tag %s  in the template %s, bracket error', 'errors.tpl.not.found' => 'The %s template file doesn\'t exist', 'errors.tpl.tag.meta.unknown' => 'In the template %2$s, the meta tag %1$s is unknown', 'errors.tpl.tag.meta.invalid' => 'In the template %2$s, the meta tag syntax %1$s is invalid', 'errors.tplplugin.block.too.few.arguments' => 'In the tag %s  in the template  %s, too few arguments', 'errors.tplplugin.block.too.many.arguments' => 'In the tag %s  in the template  %s, too many arguments', 'errors.tplplugin.block.bad.argument.number' => 'In the tag %s  in the template %3$s, bad argument number (%2$s expected)', 'errors.tpl.tag.constant.notallowed' => 'In the tag %s in the template %3$s, constants (%2$s) are not allowed', 'errors.tpl.tag.locale.end.missing' => 'In the tag %s  in the template  %s, the end of a locale key is missing', 'errors.tplplugin.cfunction.bad.argument.number' => 'In the tag %s in the template %3$s, bad argument number (%2$s expected)', 'errors.tplplugin.cmodifier.bad.argument.number' => 'In the modifier %s in the template %3$s, bad argument number (%2$s expected)', 'errors.tplplugin.untrusted.not.available' => 'In the tag %s in the template %2$s, is not allowed in a untrusted template', 'errors.tplplugin.function.argument.unknown' => 'In the tag %2$s in the template %3$s, the %1$s argument is unknown', 'errors.tplplugin.function.invalid' => 'Invalid syntax in the tag %1$s in the template %3$s');