本文整理汇总了PHP中Template::assign_block_vars方法的典型用法代码示例。如果您正苦于以下问题:PHP Template::assign_block_vars方法的具体用法?PHP Template::assign_block_vars怎么用?PHP Template::assign_block_vars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Template
的用法示例。
在下文中一共展示了Template::assign_block_vars方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
static function generate_select($auth_bit, $array_auth = array(), $array_ranks_default = array(), $idselect = '', $disabled = '', $disabled_advanced_auth = false)
{
global $Sql, $LANG, $CONFIG, $array_ranks, $Group;
$array_ranks = is_array($array_ranks) ? $array_ranks : array('-1' => $LANG['guest'], '0' => $LANG['member'], '1' => $LANG['modo'], '2' => $LANG['admin']);
$idselect = (string) $idselect == '' ? $auth_bit : $idselect;
$Template = new Template('framework/groups_auth.tpl');
$Template->assign_vars(array('C_NO_ADVANCED_AUTH' => $disabled_advanced_auth ? true : false, 'C_ADVANCED_AUTH' => $disabled_advanced_auth ? false : true, 'THEME' => get_utheme(), 'PATH_TO_ROOT' => TPL_PATH_TO_ROOT, 'IDSELECT' => $idselect, 'DISABLED_SELECT' => empty($disabled) ? 'if (disabled == 0)' : '', 'L_USERS' => $LANG['member_s'], 'L_ADD_USER' => $LANG['add_member'], 'L_REQUIRE_PSEUDO' => addslashes($LANG['require_pseudo']), 'L_RANKS' => $LANG['ranks'], 'L_GROUPS' => $LANG['groups'], 'L_GO' => $LANG['go'], 'L_ADVANCED_AUTHORIZATION' => $LANG['advanced_authorization'], 'L_SELECT_ALL' => $LANG['select_all'], 'L_SELECT_NONE' => $LANG['select_none'], 'L_EXPLAIN_SELECT_MULTIPLE' => $LANG['explain_select_multiple']));
##### Génération d'une liste à sélection multiple des rangs et membres #####
//Liste des rangs
$j = -1;
foreach ($array_ranks as $idrank => $group_name) {
//Si il s'agit de l'administrateur, il a automatiquement l'autorisation
if ($idrank == 2) {
$Template->assign_block_vars('ranks_list', array('ID' => $j, 'IDRANK' => $idrank, 'RANK_NAME' => $group_name, 'DISABLED' => '', 'SELECTED' => ' selected="selected"'));
} else {
$selected = '';
if (array_key_exists('r' . $idrank, $array_auth) && ((int) $array_auth['r' . $idrank] & (int) $auth_bit) !== 0 && empty($disabled)) {
$selected = ' selected="selected"';
}
$selected = isset($array_ranks_default[$idrank]) && $array_ranks_default[$idrank] === true && empty($disabled) ? 'selected="selected"' : $selected;
$Template->assign_block_vars('ranks_list', array('ID' => $j, 'IDRANK' => $idrank, 'RANK_NAME' => $group_name, 'DISABLED' => !empty($disabled) ? 'disabled = "disabled" ' : '', 'SELECTED' => $selected));
}
$j++;
}
foreach ($Group->get_groups_array() as $idgroup => $group_name) {
$selected = '';
if (array_key_exists($idgroup, $array_auth) && ((int) $array_auth[$idgroup] & (int) $auth_bit) !== 0 && empty($disabled)) {
$selected = ' selected="selected"';
}
$Template->assign_block_vars('groups_list', array('IDGROUP' => $idgroup, 'GROUP_NAME' => $group_name, 'DISABLED' => $disabled, 'SELECTED' => $selected));
}
##### Génération du formulaire pour les autorisations membre par membre. #####
$array_auth_members = array();
if (is_array($array_auth)) {
foreach ($array_auth as $type => $auth) {
if (substr($type, 0, 1) == 'm') {
if (array_key_exists($type, $array_auth) && ((int) $array_auth[$type] & (int) $auth_bit) !== 0) {
$array_auth_members[$type] = $auth;
}
}
}
}
$advanced_auth = count($array_auth_members) > 0;
$Template->assign_vars(array('ADVANCED_AUTH_STYLE' => $advanced_auth ? 'display:block;' : 'display:none;'));
if ($advanced_auth) {
$result = $Sql->query_while("SELECT user_id, login\n\t\t\tFROM " . PREFIX . "member\n\t\t\tWHERE user_id IN(" . implode(str_replace('m', '', array_keys($array_auth_members)), ', ') . ")", __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$Template->assign_block_vars('members_list', array('USER_ID' => $row['user_id'], 'LOGIN' => $row['login']));
}
$Sql->query_close($result);
}
return $Template->parse(TEMPLATE_STRING_MODE);
}
示例2: assign_template
private function assign_template(Template $tpl)
{
$tpl->put('CONTENT', 'fruits:');
foreach ($this->fruits as $fruit) {
$tpl->assign_block_vars('elements', array('NAME' => $fruit));
}
}
示例3: generate_cell
private function generate_cell(HTMLTableRowCell $cell)
{
$cell_values = array('VALUE' => $cell->get_value(), 'C_COLSPAN' => $cell->is_multi_column(), 'COLSPAN' => $cell->get_colspan());
$this->add_css_vars($cell, $cell_values);
$this->add_id_vars($cell, $cell_values);
$this->tpl->assign_block_vars('row.cell', $cell_values);
}
示例4: import
function get_search_form($args = null)
{
global $User, $MODULES, $Errorh, $CONFIG, $CONFIG_FORUM, $Cache, $CAT_FORUM, $LANG, $Sql;
import('io/template');
$Tpl = new Template('forum/forum_search_form.tpl');
if (isset($MODULES['forum']) && $MODULES['forum']['activ'] == 1) {
if (!$User->check_auth($MODULES['forum']['auth'], ACCESS_MODULE)) {
$Errorh->handler('e_auth', E_USER_REDIRECT);
}
}
require_once PATH_TO_ROOT . '/forum/forum_functions.php';
require_once PATH_TO_ROOT . '/forum/forum_defines.php';
load_module_lang('forum');
$Cache->load('forum');
$search = $args['search'];
$idcat = !empty($args['ForumIdcat']) ? numeric($args['ForumIdcat']) : -1;
$time = !empty($args['ForumTime']) ? numeric($args['ForumTime']) : 0;
$where = !empty($args['ForumWhere']) ? strprotect($args['ForumWhere']) : 'all';
$colorate_result = !empty($args['ForumColorate_result']) ? true : false;
$Tpl->assign_vars(array('L_DATE' => $LANG['date'], 'L_DAY' => $LANG['day'], 'L_DAYS' => $LANG['day_s'], 'L_MONTH' => $LANG['month'], 'L_MONTHS' => $LANG['month'], 'L_YEAR' => $LANG['year'], 'IS_SELECTED_30000' => $time == 30000 ? ' selected="selected"' : '', 'IS_SELECTED_1' => $time == 1 ? ' selected="selected"' : '', 'IS_SELECTED_7' => $time == 7 ? ' selected="selected"' : '', 'IS_SELECTED_15' => $time == 15 ? ' selected="selected"' : '', 'IS_SELECTED_30' => $time == 30 ? ' selected="selected"' : '', 'IS_SELECTED_180' => $time == 180 ? ' selected="selected"' : '', 'IS_SELECTED_360' => $time == 360 ? ' selected="selected"' : '', 'L_OPTIONS' => $LANG['options'], 'L_TITLE' => $LANG['title'], 'L_CONTENTS' => $LANG['content'], 'IS_TITLE_CHECKED' => $where == 'title' ? ' checked="checked"' : '', 'IS_CONTENTS_CHECKED' => $where == 'contents' ? ' checked="checked"' : '', 'IS_ALL_CHECKED' => $where == 'all' ? ' checked="checked"' : '', 'L_COLORATE_RESULTS' => $LANG['colorate_result'], 'IS_COLORATION_CHECKED' => $colorate_result ? 'checked="checked"' : '', 'L_CATEGORY' => $LANG['category'], 'L_ALL_CATS' => $LANG['all'], 'IS_ALL_CATS_SELECTED' => $idcat == '-1' ? ' selected="selected"' : ''));
if (is_array($CAT_FORUM)) {
foreach ($CAT_FORUM as $id => $key) {
if ($User->check_auth($CAT_FORUM[$id]['auth'], READ_CAT_FORUM)) {
$Tpl->assign_block_vars('cats', array('MARGIN' => $key['level'] > 0 ? str_repeat('----------', $key['level']) : '----', 'ID' => $id, 'L_NAME' => $key['name'], 'IS_SELECTED' => $id == $idcat ? ' selected="selected"' : ''));
}
}
}
return $Tpl->parse(TEMPLATE_STRING_MODE);
}
示例5: display
function display($Template = false)
{
global $LANG, $Errorh;
if (!is_object($Template) || strtolower(get_class($Template)) != 'template') {
$Template = new Template('framework/builder/forms/fieldset.tpl');
}
$Template->assign_vars(array('C_DISPLAY_WARNING_REQUIRED_FIELDS' => $this->fieldset_display_required, 'L_FORMTITLE' => $this->fieldset_title, 'L_REQUIRED_FIELDS' => $LANG['require']));
foreach ($this->fieldset_errors as $error) {
$Template->assign_block_vars('errors', array('ERROR' => $Errorh->display($error['errstr'], $error['errno'])));
}
foreach ($this->fieldset_fields as $Field) {
foreach ($Field->get_errors() as $error) {
$Template->assign_block_vars('errors', array('ERROR' => $Errorh->display($error['errstr'], $error['errno'])));
}
$Template->assign_block_vars('fields', array('FIELD' => $Field->display()));
}
return $Template->parse(TEMPLATE_STRING_MODE);
}
示例6: display
function display($Template = false)
{
global $LANG;
if (!is_object($Template) || strtolower(get_class($Template)) != 'template') {
$Template = new Template('framework/builder/forms/form.tpl');
}
$Template->assign_vars(array('C_DISPLAY_PREVIEW' => $this->display_preview, 'C_DISPLAY_RESET' => $this->display_reset, 'FORMCLASS' => $this->form_class, 'U_FORMACTION' => $this->form_action, 'L_FORMNAME' => $this->form_name, 'L_FIELD_CONTENT_PREVIEW' => $this->field_identifier_preview, 'L_SUBMIT' => $this->form_submit, 'L_PREVIEW' => $LANG['preview'], 'L_RESET' => $LANG['reset']));
foreach ($this->form_fieldsets as $Fieldset) {
foreach ($Fieldset->get_fields() as $Field) {
$field_required_alert = $Field->get_required_alert();
if (!empty($field_required_alert)) {
$Template->assign_block_vars('check_form', array('FIELD_ID' => $Field->get_id(), 'FIELD_REQUIRED_ALERT' => str_replace('"', '\\"', $field_required_alert)));
}
}
$Template->assign_block_vars('fieldsets', array('FIELDSET' => $Fieldset->display()));
}
return $Template->parse(TEMPLATE_STRING_MODE);
}
示例7: display
function display()
{
$Template = new Template('framework/builder/forms/field_box.tpl');
$Template->assign_vars(array('ID' => $this->field_id, 'FIELD' => $this->field_options, 'L_FIELD_TITLE' => $this->field_title, 'L_EXPLAIN' => $this->field_sub_title, 'L_REQUIRE' => $this->field_required ? '* ' : ''));
foreach ($this->field_options as $Option) {
$Option->field_name = $this->field_name;
$Template->assign_block_vars('field_options', array('OPTION' => $Option->display()));
}
return $Template->parse(TEMPLATE_STRING_MODE);
}
示例8: get_html_results
function get_html_results(&$results, &$html_results, &$results_name)
{
global $CONFIG;
$modules = new ModulesDiscoveryService();
$display_all_results = $results_name == 'all' ? true : false;
$tpl_results = new Template('search/search_generic_pagination_results.tpl');
$tpl_results->assign_vars(array('RESULTS_NAME' => $results_name, 'C_ALL_RESULTS' => $display_all_results));
$nb_pages = round(count($results) / NB_RESULTS_PER_PAGE) + 1;
$nb_results = count($results);
if (!$display_all_results) {
$module = $modules->get_module(strtolower($results_name));
$results_data = array();
$personnal_parse_results = $module->has_functionality('compute_search_results') && $module->has_functionality('parse_search_result');
if ($personnal_parse_results && $results_name != 'all') {
$results_data = $module->functionality('compute_search_results', array('results' => $results));
$nb_results = min($nb_results, count($results_data));
}
}
for ($num_page = 0; $num_page < $nb_pages; $num_page++) {
$tpl_results->assign_block_vars('page', array('NUM_PAGE' => $num_page, 'BLOCK_DISPLAY' => $num_page == 0 ? 'block' : 'none'));
for ($i = 0; $i < NB_RESULTS_PER_PAGE; $i++) {
$num_item = $num_page * NB_RESULTS_PER_PAGE + $i;
if ($num_item >= $nb_results) {
break;
}
if ($display_all_results || !$personnal_parse_results) {
$tpl_result = new Template('search/search_generic_results.tpl');
if ($display_all_results) {
$module = $modules->get_module($results[$num_item]['module']);
$tpl_result->assign_vars(array('C_ALL_RESULTS' => true, 'L_MODULE_NAME' => $module->get_name()));
} else {
$tpl_result->assign_vars(array('C_ALL_RESULTS' => false, 'L_MODULE_NAME' => $module->get_name()));
}
$tpl_result->assign_vars(array('TITLE' => $results[$num_item]['title'], 'U_LINK' => url($results[$num_item]['link'])));
$tpl_results->assign_block_vars('page.results', array('result' => $tpl_result->parse(TEMPLATE_STRING_MODE)));
} else {
$tpl_results->assign_block_vars('page.results', array('result' => $module->functionality('parse_search_result', $results_data[$num_item])));
}
}
}
$html_results = $tpl_results->parse(TEMPLATE_STRING_MODE);
}
示例9: display
function display()
{
$Template = new Template('framework/builder/forms/field_select.tpl');
if ($this->field_multiple) {
$field = '<select name="' . $this->field_name . '[]" multiple="multiple">' . $this->field_options . '</select>';
} else {
$field = '<select name="' . $this->field_name . '">' . $this->field_options . '</select>';
}
$Template->assign_vars(array('ID' => $this->field_id, 'C_SELECT_MULTIPLE' => $this->field_multiple, 'L_FIELD_NAME' => $this->field_name, 'L_FIELD_TITLE' => $this->field_title, 'L_EXPLAIN' => $this->field_sub_title, 'L_REQUIRE' => $this->field_required ? '* ' : ''));
foreach ($this->field_options as $Option) {
$Option->field_name = $this->field_name;
$Template->assign_block_vars('field_options', array('OPTION' => $Option->display()));
}
return $Template->parse(TEMPLATE_STRING_MODE);
}
示例10: afficher
function afficher()
{
$html = '';
if ($this->existe()) {
$t = new Template('modules/archi/templates/');
$t->set_filenames(array('afficherErreurs' => 'listeErreurs.tpl'));
foreach ($this->array_erreurs as $message) {
$t->assign_block_vars('erreur', array('message' => $message));
}
ob_start();
$t->pparse('afficherErreurs');
$html = ob_get_contents();
ob_get_clean();
}
return $html;
}
示例11: Template
exit;
}
}
}
include_once "class/Easy_Mail.class.php";
include_once "class/class.Erro.php";
$theme = ".";
$model = new Template($theme);
$model->set_filenames(array('cabecalho' => 'cabecalho.htm'));
$model->assign_block_vars('sub_titulo', array());
if (isset($layout)){
switch ($layout){
case "inicio":
$model->assign_vars(array('SUB_MENU_ATIVO' => "1"));
// $model->assign_vars(array('MENU_1' => "current"));
// $model->assign_block_vars('sub_titulo.sub_cadastro', array());
break;
case "cadastro":
$model->assign_vars(array('SUB_MENU_ATIVO' => "2"));
// $model->assign_vars(array('MENU_1' => "current"));
// $model->assign_block_vars('sub_titulo.sub_cadastro', array());
break;
case "movimento":
$model->assign_vars(array('SUB_MENU_ATIVO' => "3"));
// $model->assign_vars(array('MENU_1' => "current"));
示例12: stripslashes
if ($session->isInSession('archiIdVilleGeneral') && $session->getFromSession('archiIdVilleGeneral') != '' && $session->getFromSession('archiIdVilleGeneral') != '1') {
$arrayIdVilleGeneral['archiIdVilleGeneral'] = $session->getFromSession('archiIdVilleGeneral');
}
$listPages = archiPage::getListMenu(LANG);
$htmlListPages = "";
foreach ($listPages as $page) {
$htmlListPages .= "<li><a href='index.php?archiAffichage=page&idPage=" . $page["id"] . "'>" . $page["title"] . "</a></li>";
}
// liens
$t->assign_vars(array('listeUtilisateurs' => $config->creerUrl('', 'utilisateurListe'), 'administration' => $config->creerUrl('', 'administration'), 'seDeconnecter' => $config->creerUrl('deconnexion', 'authentification'), 'recherche' => $config->creerUrl('', 'recherche'), 'edito' => $config->creerUrl('', 'edito'), 'quiSommesNous' => $config->creerUrl('', 'quiSommesNous'), 'faq' => $config->creerUrl('', 'faq'), 'inscription' => $config->creerUrl('', 'inscription'), 'listeDossiers' => $config->creerUrl('', 'listeDossiers', $arrayIdVilleGeneral), 'ajoutNouveauDossier' => $config->creerUrl('', 'ajoutNouveauDossier'), "ajoutNouvellePersonne" => $config->creerUrl("", "ajoutNouvelPersonne"), 'contact' => $config->creerUrl('', 'contact'), 'urlMotDePasseOublie' => $config->creerUrl('', 'formulaireMotDePasseOublie'), 'publiciteMedias' => $config->creerUrl('', 'publiciteArticlesPresse'), 'nosSources' => $config->creerUrl('', 'nosSources'), 'faireUnDon' => $config->creerUrl('', 'faireUnDon'), 'ajaxFunctions' => $ajax->getAjaxFunctions(), 'calqueFunctions' => "<script >" . $calque->getJSFunctionContextualHelp() . " " . $i->getJsSetOpacityFunction(array('noBalisesJs' => true)) . "</script>", 'titrePage' => stripslashes($titre), 'descriptionPage' => $description, 'motsCle' => $motsCle, 'urlCheminSite' => $recherche->getHtmlArborescence(), 'titreSite' => $titreSite, 'parcours' => $config->creerUrl('', 'parcours'), 'jsHeader' => $headerJS, "lang" => LANG, "lang_short" => substr(LANG, 0, 2), "listPages" => $htmlListPages, "urlOpendata" => $config->creerUrl('', 'lienOpendata')));
// headerJS = variables contenant le javascript recupéré des fonctions du site que l'on collecte et que l'on place dans la balise header
$labelConnexion = _("Connexion");
$imgConnexion = "images/logo_connexion.png";
if ($authentification->estConnecte() !== true) {
// utilisateur pas connecté
$t->assign_block_vars('utilisateurNonConnecte', array());
if ($authentification->estConnecte()) {
$t->assign_vars(array('etatConnexion' => _("Vous êtes connecté!")));
} else {
$t->assign_vars(array('etatConnexion' => _("Vous n'êtes pas connecté")));
}
$t->assign_vars(array('formulaireConnexion' => $authentification->afficheFormulaireAuthentification('compact'), 'formulaireRecherche' => $recherche->afficheFormulaire(array(), 0, array('noDisplayRechercheAvancee' => false, 'noDisplayCheckBoxResultatsCarte' => false)), 'inscriptionDeconnexion' => _("Inscrivez-vous !"), 'urlInscriptDeconnexion' => $config->creerUrl('', 'inscription'), 'urlAccueil' => $config->creerUrl('', 'afficheAccueil'), 'txtAccueil' => 'Accueil', 'classAuthLinkWrapper' => 'notConnectedAuthLink'));
$t->assign_block_vars('linkConnected', array('authLinkOneClass' => ' authLinkOneClass forgetPasswordLabel', 'authLinkUrl' => $config->creerUrl('', 'formulaireMotDePasseOublie'), 'authLinkLabel' => 'Mot de passe oublié ?'));
$t->assign_block_vars('linkConnected', array('authLinkOneClass' => 'authLinkTwoClass subscribeLabel', 'authLinkUrl' => $config->creerUrl('', 'inscription'), 'authLinkLabel' => 'Inscrivez-vous !'));
} else {
if ($authentification->estAdmin()) {
$t->assign_block_vars('isAdmin', array());
}
// utilisateur connecté
$classFastConnect = "hidden";
$userId = $authentification->getIdUtilisateur();
示例13: RenderContent0
//.........这里部分代码省略.........
break;
case 'varform':
global $G_FORM;
$G_FORM = new Form();
G::LoadSystem("varform");
$xml = new varForm();
//$xml->parseFile ( );
$xml->renderForm($G_FORM, $Part['File']);
$G_FORM->Values = $Part['Data'];
$G_FORM->SetUp($Part['Target']);
$G_FORM->width = 500;
break;
case 'table':
$G_TMP_TARGET = $Part['Target'];
$G_TABLE = G::LoadRawTable($Part['File'], $this->dbc, $Part['Data']);
break;
case 'menu':
$G_TMP_TARGET = $Part['Target'];
$G_OP_MENU = new Menu();
$G_OP_MENU->Load($Part['File']);
break;
case 'smarty':
//To do: Please check it 26/06/07
$template = new Smarty();
$template->compile_dir = PATH_SMARTY_C;
$template->cache_dir = PATH_SMARTY_CACHE;
$template->config_dir = PATH_THIRDPARTY . 'smarty/configs';
$template->caching = false;
$dataArray = $Part['Data'];
// verify if there are templates folders registered, template and method folders are the same
$folderTemplate = explode('/', $Part['Template']);
$oPluginRegistry =& PMPluginRegistry::getSingleton();
if ($oPluginRegistry->isRegisteredFolder($folderTemplate[0])) {
$template->templateFile = PATH_PLUGINS . $Part['Template'] . '.html';
} else {
$template->templateFile = PATH_TPL . $Part['Template'] . '.html';
}
// last change to load the template, maybe absolute path was given
if (!is_file($template->templateFile)) {
$template->templateFile = strpos($Part['Template'], '.html') !== false ? $Part['Template'] : $Part['Template'] . '.html';
}
//assign the variables and use the template $template
$template->assign($dataArray);
print $template->fetch($template->templateFile);
break;
case 'template':
//To do: Please check it 26/06/07
if (gettype($Part['Data']) == 'array') {
G::LoadSystem('template');
//template phpBB
$template = new Template();
$template->set_filenames(array('body' => $Part['Template'] . '.html'));
$dataArray = $Part['Data'];
if (is_array($dataArray)) {
foreach ($dataArray as $key => $val) {
if (is_array($val)) {
foreach ($val as $key_val => $val_array) {
$template->assign_block_vars($key, $val_array);
}
} else {
$template->assign_vars(array($key => $val));
}
}
}
$template->pparse('body');
}
if (gettype($Part['Data']) == 'object' && strtolower(get_class($Part['Data'])) == 'templatepower') {
$Part['Data']->printToScreen();
}
return;
break;
case 'view':
case 'content':
//check if G_PLUGIN_CLASS is defined, because publisher can be called without an environment
$aux = explode(PATH_SEP, $Part['Template']);
if (count($aux) == 2 && defined('G_PLUGIN_CLASS')) {
//if the template doesn't exists, then try it with the plugins folders, after the normal Template
$userTemplate = G::ExpandPath('templates') . $Part['Template'];
$globalTemplate = PATH_TEMPLATE . $Part['Template'];
if (!is_file($userTemplate) && !is_file($globalTemplate)) {
$oPluginRegistry =& PMPluginRegistry::getSingleton();
if ($oPluginRegistry->isRegisteredFolder($aux[0])) {
$pluginTemplate = PATH_PLUGINS . $Part['Template'] . '.php';
include $pluginTemplate;
}
}
}
break;
case 'graphLayout':
//Added by JHL to render GraphLayout component
$G_OBJGRAPH = $Part['Data'];
$G_TMP_TARGET = $Part['Target'];
$G_TMP_FILE = $Part['File'];
break;
}
//krumo( $Part['Template'] );
//check if this LoadTemplate is used, byOnti 12th Aug 2008
G::LoadTemplate($Part['Template']);
$G_TABLE = null;
}
示例14: unset
function get_home_page()
{
global $Sql, $User, $Template, $Cache, $Bread_crumb, $_WIKI_CONFIG, $_WIKI_CATS, $LANG;
load_module_lang('wiki');
include_once '../wiki/wiki_functions.php';
$bread_crumb_key = 'wiki';
require_once '../wiki/wiki_bread_crumb.php';
unset($Template);
$Template = new Template();
$Template->set_filenames(array('wiki' => 'wiki/wiki.tpl', 'index' => 'wiki/index.tpl'));
$Template->assign_vars(array('WIKI_PATH' => $Template->get_module_data_path('wiki')));
if ($_WIKI_CONFIG['last_articles'] > 1) {
$result = $Sql->query_while("SELECT a.title, a.encoded_title, a.id\n\t\t\tFROM " . PREFIX . "wiki_articles a\n\t\t\tLEFT JOIN " . PREFIX . "wiki_contents c ON c.id_contents = a.id_contents\n\t\t\tWHERE a.redirect = 0\n\t\t\tORDER BY c.timestamp DESC\n\t\t\tLIMIT 0, " . $_WIKI_CONFIG['last_articles'], __LINE__, __FILE__);
$articles_number = $Sql->num_rows($result, "SELECT COUNT(*) FROM " . PREFIX . "wiki_articles WHERE encoded_title = '" . $encoded_title . "'", __LINE__, __FILE__);
$Template->assign_block_vars('last_articles', array('L_ARTICLES' => $LANG['wiki_last_articles_list'], 'RSS' => $articles_number > 0 ? '<a href="{PATH_TO_ROOT}/syndication.php?m=wiki"><img src="../templates/' . get_utheme() . '/images/rss.png" alt="RSS" /></a>' : ''));
$i = 0;
while ($row = $Sql->fetch_assoc($result)) {
$Template->assign_block_vars('last_articles.list', array('ARTICLE' => $row['title'], 'TR' => $i > 0 && $i % 2 == 0 ? '</tr><tr>' : '', 'U_ARTICLE' => url('wiki.php?title=' . $row['encoded_title'], $row['encoded_title'])));
$i++;
}
if ($articles_number == 0) {
$Template->assign_vars(array('L_NO_ARTICLE' => '<td style="text-align:center;" class="row2">' . $LANG['wiki_no_article'] . '</td>'));
}
}
if ($_WIKI_CONFIG['display_cats'] != 0) {
$Template->assign_block_vars('cat_list', array('L_CATS' => $LANG['wiki_cats_list']));
$i = 0;
foreach ($_WIKI_CATS as $id => $infos) {
if ($infos['id_parent'] == 0) {
$Template->assign_block_vars('cat_list.list', array('CAT' => $infos['name'], 'U_CAT' => url('wiki.php?title=' . url_encode_rewrite($infos['name']), url_encode_rewrite($infos['name']))));
$i++;
}
}
if ($i == 0) {
$Template->assign_vars(array('L_NO_CAT' => $LANG['wiki_no_cat']));
}
}
$Template->assign_vars(array('TITLE' => !empty($_WIKI_CONFIG['wiki_name']) ? $_WIKI_CONFIG['wiki_name'] : $LANG['wiki'], 'INDEX_TEXT' => !empty($_WIKI_CONFIG['index_text']) ? second_parse(wiki_no_rewrite($_WIKI_CONFIG['index_text'])) : $LANG['wiki_empty_index'], 'L_EXPLORER' => $LANG['wiki_explorer'], 'U_EXPLORER' => url('explorer.php'), 'WIKI_PATH' => $Template->get_module_data_path('wiki')));
$page_type = 'index';
include '../wiki/wiki_tools.php';
$tmp = $Template->pparse('wiki', TRUE);
return $tmp;
}
示例15: switch
switch ($update->get_priority()) {
case ADMIN_ALERT_VERY_HIGH_PRIORITY:
$priority = 'priority_very_high';
break;
case ADMIN_ALERT_HIGH_PRIORITY:
$priority = 'priority_high';
break;
case ADMIN_ALERT_MEDIUM_PRIORITY:
$priority = 'priority_medium';
break;
default:
$priority = 'priority_low';
break;
}
$short_description = $update->get_description();
$maxlength = 300;
$length = strlen($short_description) > $maxlength ? $maxlength + strpos(substr($short_description, $maxlength), ' ') : 0;
$length = $length > $maxlength * 1.1 ? $maxlength : $length;
$tpl->assign_block_vars('apps', array('type' => $update->get_type(), 'name' => $update->get_name(), 'version' => $update->get_version(), 'short_description' => $length > 0 ? substr($short_description, 0, $length) . '...' : $short_description, 'identifier' => $update->get_identifier(), 'L_PRIORITY' => $LANG[$priority], 'priority_css_class' => 'row_' . $priority, 'download_url' => $update->get_download_url(), 'update_url' => $update->get_update_url()));
}
if ($updates_availables = count($updates) > 0) {
$tpl->assign_vars(array('L_UPDATES_ARE_AVAILABLE' => $LANG['updates_are_available'], 'L_AVAILABLES_UPDATES' => $LANG['availables_updates'], 'L_TYPE' => $LANG['type'], 'L_DESCRIPTION' => $LANG['description'], 'L_PRIORITY' => $LANG['priority'], 'L_UPDATE_DOWNLOAD' => $LANG['app_update__download'], 'L_NAME' => $LANG['name'], 'L_VERSION' => $LANG['version'], 'L_MORE_DETAILS' => $LANG['more_details'], 'L_DETAILS' => $LANG['details'], 'L_DOWNLOAD_PACK' => $LANG['app_update__download_pack'], 'L_DOWNLOAD_THE_COMPLETE_PACK' => $LANG['download_the_complete_pack'], 'L_UPDATE_PACK' => $LANG['app_update__update_pack'], 'L_DOWNLOAD_THE_UPDATE_PACK' => $LANG['download_the_update_pack'], 'C_ALL' => $update_type == ''));
} else {
$tpl->assign_vars(array('L_NO_AVAILABLES_UPDATES' => $LANG['no_available_update']));
}
} else {
$tpl->assign_vars(array('L_INCOMPATIBLE_PHP_VERSION' => sprintf($LANG['incompatible_php_version'], PHP_MIN_VERSION_UPDATES), 'C_INCOMPATIBLE_PHP_VERSION' => true));
}
$tpl->assign_vars(array('L_WEBSITE_UPDATES' => $LANG['website_updates'], 'L_KERNEL' => $LANG['kernel'], 'L_MODULES' => $LANG['modules'], 'L_THEMES' => $LANG['themes'], 'C_UPDATES' => $updates_availables, 'U_CHECK' => 'updates.php?check=1' . (!empty($update_type) ? '&type=' . $update_type : '') . '&token=' . $Session->get_token(), 'L_CHECK_FOR_UPDATES_NOW' => $LANG['check_for_updates_now']));
$tpl->parse();
require_once PATH_TO_ROOT . '/admin/admin_footer.php';