本文整理汇总了PHP中Smarty::config_load方法的典型用法代码示例。如果您正苦于以下问题:PHP Smarty::config_load方法的具体用法?PHP Smarty::config_load怎么用?PHP Smarty::config_load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Smarty
的用法示例。
在下文中一共展示了Smarty::config_load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action
public function action($gpc)
{
$this->_smarty->config_load('textes.de.conf', 'Image');
$this->_img_textes = $this->_smarty->get_config_vars();
$this->_gpc = $gpc;
if (isset($gpc['GET']['img'])) {
$this->_initImg($gpc['GET']['img']);
} elseif (isset($gpc['GET']['thumb'])) {
$this->_initThumb($gpc['GET']['thumb']);
} else {
$this->_initErrImg($this->_img_textes['no_param']);
}
}
示例2: _getRoot
/**
* Liefert der Path der Kategorien aus von der angegebenen Kategorie bis zur Hauptseite.
* Das zurückgelieferte Array sieht etwa folgendermassen aus:
* array(0 => Hauptseite, 1 => Kategorie 1, 2 => Kategorie 1.1, 3 => ...)
*
* @param int $cat_ID KategorieID der untersten Kategorie
* @param bool[optional] $inc_catID Gibt an, ob die Kategorie mit ID = $cat_ID auch in der Wurzel vorkommen soll
* @param bool[optional] $inc_hs Gibt an, ob der Eintrag 'Hauptseite' auch in der Wurzel vorkommen soll
* @return array $root_array Path der Kategorien.
*/
private function _getRoot($cat_ID, $inc_catID = false, $inc_hs = true)
{
/* Wurzel auslesen */
$tmp_arr = array();
if ($inc_catID == false) {
$this->_mysql->query("SELECT `ref_ID` FROM `gallery_categories` WHERE `ID` = '{$cat_ID}' LIMIT 1");
$data = $this->_mysql->fetcharray('assoc');
$tmp_ID = $data['ref_ID'];
} else {
$tmp_ID = $cat_ID;
}
for ($i = 0; $tmp_ID != 0; $i++) {
$this->_mysql->query("SELECT `ID`,`ref_ID`,`name` FROM `gallery_categories` WHERE `ID` = '{$tmp_ID}' LIMIT 1");
$tmp_arr[$i] = $this->_mysql->fetcharray('assoc');
$tmp_ID = $tmp_arr[$i]['ref_ID'];
}
if ($inc_hs == true) {
/*Hauptseite noch einfügen*/
$this->_smarty->config_load('textes.de.conf', 'Gallery');
$gallery_textes = $this->_smarty->get_config_vars();
$tmp_arr[++$i] = array('ID' => '0', 'name' => $gallery_textes['mainsite']);
return array_reverse($tmp_arr);
} else {
return null;
}
}
示例3: action
/**
* Start des Moduls
*
* @param array $gpc
*/
public function action($gpc)
{
$this->_gpc = $gpc;
//Daten laden
$this->_smarty->config_load('textes.de.conf', 'Mail');
$this->_config_textes['Mail'] = $this->_smarty->get_config_vars();
$this->_smarty->config_load('textes.de.conf', 'Form_Error');
$this->_config_textes['Error'] = $this->_smarty->get_config_vars();
if (key_exists('hash', $gpc['GET']) && is_string($gpc['GET']['hash'])) {
$this->_truemail_send($gpc['GET']['hash']);
} elseif (key_exists('nav_id', $gpc['GET']) && is_numeric($gpc['GET']['nav_id'])) {
$this->_checkmail_send($gpc['GET']['nav_id']);
} else {
throw new CMSException(array('mail' => 'invalid_param'), EXCEPTION_MODULE_CODE);
}
}
示例4: action
/**
* Führt die einzelnen Methoden aus, abhängig vom Parameter
*
* @param array $gpc $_POST- und $_GET-Arrays
* @global string dir_smilies Used for the dir where the smilies-gif are saved
* @global int gbook_entries_per_page
* @return boolean
*/
public function action($gpc)
{
//Daten laden
$this->_smarty->config_load('textes.de.conf', 'Gbook');
$this->_configvars['Gbook'] = $this->_smarty->get_config_vars();
$this->_smarty->config_load('textes.de.conf', 'Form_Error');
$this->_configvars['Error'] = $this->_smarty->get_config_vars();
$this->_gpc = $gpc;
$this->_msbox = new MessageBoxes($this->_mysql, 'gbook', array('ID' => 'gbook_ID', 'ref_ID' => 'gbook_ref_ID', 'content' => 'gbook_content', 'name' => 'gbook_name', 'time' => 'gbook_time', 'email' => 'gbook_email', 'hp' => 'gbook_hp', 'title' => 'gbook_title'));
$this->_smilie = new Smilies(SMILIES_DIR);
if (isset($this->_gpc['GET']['action'])) {
switch ($this->_gpc['GET']['action']) {
case 'new':
$this->_add();
break;
case 'comment':
$this->_comment();
break;
case 'view':
$this->_view(GBOOK_ENTRIES_PER_PAGE);
break;
case '':
$this->_view(GBOOK_ENTRIES_PER_PAGE);
break;
default:
throw new CMSException(array('gbook' => 'invalid_option'), EXCEPTION_MODULE_CODE);
}
} else {
$this->_view(GBOOK_ENTRIES_PER_PAGE);
}
return true;
}
示例5: getSmartyTemplate
/**
* Get smarty template
* @return Smarty smarty object
*/
public static function getSmartyTemplate()
{
/*
if(extension_loaded('ionCube Loader')){
include_once(SMARTY_DIR . "Smarty.class.php");
}else{
include_once(SMARTY_DIR . "Smarty.class.src.php");
}
*
*/
$smarty = new \Smarty();
$useTheme = !defined('OPENBIZ_USE_THEME') ? 0 : OPENBIZ_USE_THEME;
if ($useTheme) {
$theme = Openbiz::$app->getCurrentTheme();
$themePath = $theme;
// Openbiz::$app->getConfiguration()->GetThemePath($theme);
if (is_dir(OPENBIZ_THEME_PATH . "/" . $themePath . "/template")) {
$templateRoot = OPENBIZ_THEME_PATH . "/" . $themePath . "/template";
} else {
$templateRoot = OPENBIZ_THEME_PATH . "/" . $themePath . "/templates";
}
$smarty->template_dir = $templateRoot;
$smarty->compile_dir = defined('OPENBIZ_SMARTY_CPL_PATH') ? OPENBIZ_SMARTY_CPL_PATH . "/" . $themePath : $templateRoot . "/cpl";
$smarty->config_dir = $templateRoot . "/cfg";
if (!file_exists($smarty->compile_dir)) {
@mkdir($smarty->compile_dir, 0777);
}
// load the config file which has the images and css url defined
$smarty->config_load('tpl.conf');
} else {
if (defined('SMARTY_TPL_PATH')) {
$smarty->template_dir = SMARTY_TPL_PATH;
}
if (defined('OPENBIZ_SMARTY_CPL_PATH')) {
$smarty->compile_dir = OPENBIZ_SMARTY_CPL_PATH . "/" . $themePath;
}
if (defined('SMARTY_CFG_PATH')) {
$smarty->config_dir = SMARTY_CFG_PATH;
}
}
if (!is_dir($smarty->compile_dir)) {
mkdir($smarty->compile_dir, 0777);
}
// load the config file which has the images and css url defined
$smarty->assign('app_url', OPENBIZ_APP_URL);
$smarty->assign('app_index', OPENBIZ_APP_INDEX_URL);
$smarty->assign('js_url', OPENBIZ_JS_URL);
$smarty->assign('css_url', OPENBIZ_THEME_URL . "/" . $theme . "/css");
$smarty->assign('resource_url', OPENBIZ_RESOURCE_URL);
$smarty->assign('resource_php', OPENBIZ_RESOURCE_PHP);
$smarty->assign('theme_js_url', OPENBIZ_THEME_URL . "/" . $theme . "/js");
$smarty->assign('theme_url', OPENBIZ_THEME_URL . "/" . $theme);
$smarty->assign('image_url', OPENBIZ_THEME_URL . "/" . $theme . "/images");
$smarty->assign('lang', strtolower(I18n::getCurrentLangCode()));
$smarty->assign('lang_name', I18n::getCurrentLangCode());
return $smarty;
}
示例6: render
public function render()
{
$smarty = new Smarty();
$smarty->config_load('server.conf');
$smarty->assign('title', $this->title);
$smarty->assign('keywords', implode(',', $this->keywords));
$smarty->assign('description', $this->description);
$smarty->assign('content', implode("\n", $this->contents));
$smarty->assign('scripts', $this->scripts);
$smarty->assign('styles', $this->styles);
$smarty->assign('nav', $this->nav);
$smarty->display($this->layout);
}
示例7: action
/**
* Fuehrt die einzelnen Methoden aus, abhaengig vom parameter
*
* @param array $parameters POST, GET und COOKIE-Variablen
*/
public function action($gpc)
{
//Daten initialisieren
$this->_gpc['POST'] = $gpc['POST'];
$this->_gpc['GET'] = $gpc['GET'];
/* Daten laden */
$section_load = array('Editor', 'Editor-Entry', 'Editor-Error', 'Menu');
foreach ($section_load as $section) {
$this->_smarty->config_load('textes.de.conf', $section);
$this->_config_textes["{$section}"] = $this->_smarty->get_config_vars();
}
$this->_nav_id = $this->_smarty->get_template_vars('local_link');
if (key_exists('ref_ID', $this->_gpc['GET']) && is_numeric($this->_gpc['GET']['ref_ID'])) {
$id = (int) $this->_gpc['GET']['ref_ID'];
}
//Je nach Get-Parameter die zugehörige Anweisung ausfuehren
if (key_exists('action', $this->_gpc['GET'])) {
switch ($this->_gpc['GET']['action']) {
case 'new':
$this->_create();
break;
case 'edit':
$this->_edit($id);
break;
case 'del':
$this->_del($id);
break;
default:
$this->_view();
}
return true;
} else {
$this->_view();
return true;
}
}
示例8: action
/**
* Fuehrt die einzelnen Methoden aus, abhaengig vom parameter
*
* @param array $parameters POST, GET und COOKIE-Variablen
*/
public function action($gpc)
{
//Daten laden
$this->_smarty->config_load('textes.de.conf', 'News');
$this->_config_textes['News'] = $this->_smarty->get_config_vars();
$this->_smarty->config_load('textes.de.conf', 'Form_Error');
$this->_config_textes['Error'] = $this->_smarty->get_config_vars();
$this->_gpc = $gpc;
$this->_nav_id = $this->_smarty->get_template_vars('local_link');
$this->_msbox = new Messageboxes($this->_mysql, 'news', array('ID' => 'news_ID', 'ref_ID' => 'news_ref_ID', 'content' => 'news_content', 'name' => 'news_name', 'time' => 'news_time', 'email' => 'news_email', 'hp' => 'news_hp', 'title' => 'news_title'));
$this->_smilie = new Smilies(SMILIES_DIR);
if ($this->_getStatus() == 'off') {
$this->_smarty->assign('info', $this->_config_textes['News']['modul_deactivated']);
}
//Je nach Get-Parameter die zugehörige Anweisung ausfuehren
if (key_exists('action', $this->_gpc['GET'])) {
switch ($this->_gpc['GET']['action']) {
case 'new':
$this->_add();
return true;
case 'comment':
$this->_comment();
return true;
case 'edit':
$this->_edit();
return true;
case 'del':
$this->_del();
return true;
case 'view':
$this->_view(15);
return true;
case '':
$this->_view(15);
return true;
default:
//Falsche Angaben enden im Fehler
throw new CMSException(array('news' => 'invalid_url'), EXCEPTION_MODULE_CODE);
}
} else {
//Keine Angabe -> Ausgabe der News
$this->_view(15);
return true;
}
}
示例9: action
/**
* Führt die einzelnen Methoden aus, abhängig vom Parameter
*
* @param array $gpc $_POST- und $_GET-Arrays
* @return boolean
* @uses Smarty als Template-System
*/
public function action($gpc)
{
//Daten laden
$this->_smarty->config_load('textes.de.conf', 'Gbook');
$this->_configvars['Gbook'] = $this->_smarty->get_config_vars();
$this->_smarty->config_load('textes.de.conf', 'Form_Error');
$this->_configvars['Error'] = $this->_smarty->get_config_vars();
$this->_gpc = $gpc;
$this->_nav_id = $this->_smarty->get_template_vars('local_link');
$this->_msbox = new MessageBoxes($this->_mysql, 'gbook', array('ID' => 'gbook_ID', 'ref_ID' => 'gbook_ref_ID', 'content' => 'gbook_content', 'name' => 'gbook_name', 'time' => 'gbook_time', 'email' => 'gbook_email', 'hp' => 'gbook_hp', 'title' => 'gbook_title'));
$this->_smilie = new Smilies(SMILIES_DIR);
if ($this->_getStatus() == 'off') {
$this->_smarty->assign('info', $this->_configvars['Gbook']['modul_deactivated']);
}
if (key_exists('action', $this->_gpc['GET'])) {
switch ($this->_gpc['GET']['action']) {
case 'new':
$this->_add();
break;
case 'comment':
$this->_comment();
break;
case 'edit':
$this->_edit();
break;
case 'del':
$this->_del();
break;
case 'view':
$this->_view(5);
break;
case '':
$this->_view(5);
break;
default:
throw new CMSException(array('gbook' => 'invalid_option'), EXCEPTION_MODULE_CODE);
}
} else {
$this->_view(5);
}
return true;
}
示例10: Smarty
unset($tool, $surl);
//require_once( '/data/project/xtools/public_html/phptemp/PHPtemp.php' );
//require_once( '/data/project/xtools/public_html/phptemp/Language.php' );
require_once "/data/project/xtools/public_html/Smarty/languages.class.php";
require_once "/data/project/xtools/public_html/Smarty/Smarty.class.php";
require_once '/data/project/xtools/public_html/sitenotice.php';
require_once '/data/project/xtools/public_html/ipcalc/base.php';
//$phptemp = new PHPtemp( '/data/project/xtools/public_html/templates/main.tpl' );
//$content = new PHPtemp( '/data/project/xtools/public_html/ipcalc/templates/ipcalc.tpl' );
$phptemp = new Smarty();
$content = new Smarty();
$language = new Language(array("en"));
$lang = $language->getLang();
$langlinks = $language->generateLangLinks();
$phptemp->config_load('../../configs/' . $lang . '.conf', 'main');
$content->config_load('../../configs/' . $lang . '.conf', 'main');
$phptemp->config_load($lang . '.conf', 'ipcalc');
$content->config_load($lang . '.conf', 'ipcalc');
//$phptemp->load_config( '/data/project/xtools/public_html/configs/'.$lang.'.conf', 'main' );
//$phptemp->load_config( '/data/project/xtools/public_html/ipcalc/configs/'.$lang.'.conf', 'ipcalc' );
//$content->load_config( '/data/project/xtools/public_html/ipcalc/configs/'.$lang.'.conf', 'ipcalc' );
$content->assign("form", 'Welcome to X!\'s IP CIDR calculator!<br /><br />
There are two ways to use this tool.
<ol>
<li>IP range: Enter a CIDR range into the box, in the format 0.0.0.0/0</li>
<li>IP list: Enter a list of IPs into the box, separated by newlines.</li>
</ol><br />
<form action="//tools.wmflabs.org/xtools/ipcalc/index.php" method="get">
<table>
<tr>
<td align="center">IP range: <input type="radio" name="type" value="range" ' . ($_GET['type'] == "range" ? 'checked="checked"' : '') . ' /></td>
示例11: GetUtilisateurInfos
$Utilisateur = GetUtilisateurInfos($IP);
//Gets current user infos
//Preferences
define('LANG', 'english');
define('THEME', 'default');
//Smarty
require '_includes/Smarty/Smarty.class.php';
$smarty = new Smarty();
//TODO : trouver solution plus élégante et compatible Windows
$current_dir = dirname(__FILE__);
$smarty->template_dir = $current_dir . '/Themes/' . THEME;
$smarty->compile_dir = $current_dir . '/cache/compiled';
$smarty->cache_dir = $current_dir . '/cache';
$smarty->config_dir = $current_dir;
//Theme preferences
$smarty->config_load("Themes/" . THEME . "/theme.conf");
//Language preferences
$smarty->config_load("Lang/" . LANG . "/core.conf");
$smarty->config_load("Lang/" . LANG . "/personalize.conf");
//Now, we include correct script
switch ($_GET['action']) {
case 'new':
case 'clone':
case 'edit':
include 'edit.php';
break;
case 'view':
include 'view.php';
break;
case 'cloud':
include 'cloud.php';
示例12: getSmartyTemplate
/**
* Get smarty template
* @return Smarty smarty object
*/
public static function getSmartyTemplate()
{
include_once SMARTY_DIR . "Smarty.class.php";
$smarty = new Smarty();
$useTheme = !defined('USE_THEME') ? 0 : USE_THEME;
if ($useTheme) {
$theme = isset($_GET['theme']) ? $_GET['theme'] : THEME_NAME;
$themePath = $theme;
// BizSystem::configuration()->GetThemePath($theme);
if (is_dir(THEME_PATH . "/" . $themePath . "/template")) {
$templateRoot = THEME_PATH . "/" . $themePath . "/template";
} else {
$templateRoot = THEME_PATH . "/" . $themePath . "/templates";
}
$smarty->template_dir = $templateRoot;
$smarty->compile_dir = $templateRoot . "/cpl";
$smarty->config_dir = $templateRoot . "/cfg";
// load the config file which has the images and css url defined
$smarty->config_load('tpl.conf');
} else {
if (defined('SMARTY_TPL_PATH')) {
$smarty->template_dir = SMARTY_TPL_PATH;
}
if (defined('SMARTY_CPL_PATH')) {
$smarty->compile_dir = SMARTY_CPL_PATH;
}
if (defined('SMARTY_CFG_PATH')) {
$smarty->config_dir = SMARTY_CFG_PATH;
}
}
// load the config file which has the images and css url defined
$smarty->assign('app_url', APP_URL);
$smarty->assign('app_index', APP_INDEX);
$smarty->assign('js_url', JS_URL);
$smarty->assign('css_url', THEME_URL . "/" . THEME_NAME . "/css");
$smarty->assign('theme_js_url', THEME_URL . "/" . THEME_NAME . "/js");
$smarty->assign('theme_url', THEME_URL . "/" . THEME_NAME);
$smarty->assign('image_url', THEME_URL . "/" . THEME_NAME . "/images");
$smarty->assign('lang', strtolower(I18n::getInstance()->getCurrentLanguage()));
return $smarty;
}
示例13: config_load
/**
* Переопределение одноименного метода Smarty
* для конфигурационных файлов созданных в теме дизайна.
*
* @param string $file
* @param string $section
* @param string $scope
*/
function config_load($file, $section = null, $scope = 'global')
{
Smarty::config_load($this->_redefine_template($file), $section, $scope);
}
示例14: addSmartyObj
static function addSmartyObj(&$object, $config)
{
global $curlang;
$object = new Smarty();
$object->config_load('../../configs/en.conf', 'main');
$object->config_load('en.conf', $config);
if (is_file('../configs/' . $curlang . '.conf')) {
$object->config_load('../../configs/' . $curlang . '.conf', 'main');
}
if (is_file('configs/' . $curlang . '.conf')) {
$object->config_load($curlang . '.conf', $config);
}
}
示例15: Smarty
if (!empty($_POST)) {
$_POST = addslashes_deep($_POST);
}
$_COOKIE = addslashes_deep($_COOKIE);
$_REQUEST = addslashes_deep($_REQUEST);
}
if (PHP_VERSION >= '5.1' && !empty($timezone)) {
date_default_timezone_set($timezone);
}
require ROOT_PATH . 'includes/cls_mysql.php';
$db = new cls_mysql($db_host, $db_user, $db_password, $db_name);
$db_host = $db_user = $db_password = $db_name = NULL;
$smarty = new Smarty();
$smarty->debugging = false;
$smarty->caching = 2;
$smarty->config_load('xjoj.conf');
$login_user = array();
session_start();
ob_start();
if (isset($_COOKIE['user_id']) && !empty($_COOKIE['user_id'])) {
$sql = "select * from author where password='{$_COOKIE['password']}' and user_id='{$_COOKIE['user_id']}'";
//使用建立缓存的sql查询
$login_user = $db->getRow($sql);
if (empty($login_user['user_id'])) {
setcookie('user_id', '');
setcookie('password', '');
$login_user = array();
}
}
$smarty->assign('login_user', $login_user);
?>