本文整理汇总了PHP中Template::clear_var方法的典型用法代码示例。如果您正苦于以下问题:PHP Template::clear_var方法的具体用法?PHP Template::clear_var怎么用?PHP Template::clear_var使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Template
的用法示例。
在下文中一共展示了Template::clear_var方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: board_admin_list
function board_admin_list($statusText = '')
{
global $_CONF, $_TABLES, $_FF_CONF, $LANG_ADMIN, $LANG_GF93, $LANG_GF01, $LANG_GF00, $LANG_GF91, $LANG_GF06;
$retval = '';
$selected = '';
$menu_arr = array();
$boards = new Template($_CONF['path'] . 'plugins/forum/templates/admin/');
$boards->set_file('boards', 'boards.thtml');
$boards->set_var('block_start', COM_startBlock($LANG_GF06[10], '', COM_getBlockTemplate('_admin_block', 'header')));
$menu_arr = FF_adminNav($LANG_GF06['3']);
$boards->set_var('admin_menu', ADMIN_createMenu($menu_arr, $LANG_GF00['instructions'], $_CONF['site_url'] . '/forum/images/forum.png'));
$boards->set_var(array('s_form_action' => $_CONF['site_admin_url'] . '/plugins/forum/boards.php', 'lang_addcat' => $LANG_GF93['addcat'], 'lang_cat' => $LANG_GF01['category'], 'lang_edit' => $LANG_GF01['EDIT'], 'lang_delete' => $LANG_GF01['DELETE'], 'lang_topic' => $LANG_GF01['TOPIC'], 'LANG_posts' => $LANG_GF93['posts'], 'LANG_order' => $LANG_GF93['ordertitle'], 'lang_catorder' => $LANG_GF93['catorder'], 'LANG_action' => $LANG_GF93['action'], 'LANG_forumdesc' => $LANG_GF93['forumdescription'], 'lang_addforum' => $LANG_GF93['addforum'], 'lang_addcat' => $LANG_GF93['addcat'], 'lang_description' => $LANG_GF01['DESCRIPTION'], 'lang_resync' => $LANG_GF01['RESYNC'], 'lang_edit' => $LANG_GF01['EDIT'], 'lang_resync_cat' => $LANG_GF01['RESYNCCAT'], 'lang_delete' => $LANG_GF01['DELETE'], 'lang_submit' => $LANG_GF01['SUBMIT'], 'phpself' => $_CONF['site_admin_url'] . '/plugins/forum/boards.php', 'addcat' => $LANG_GF93['addcat'], 'cat' => $LANG_GF01['category'], 'edit' => $LANG_GF01['EDIT'], 'delete' => $LANG_GF01['DELETE'], 'topic' => $LANG_GF01['TOPIC'], 'catorder' => $LANG_GF93['catorder'], 'addforum' => $LANG_GF93['addforum'], 'addcat' => $LANG_GF93['addcat'], 'description' => $LANG_GF01['DESCRIPTION'], 'resync' => $LANG_GF01['RESYNC'], 'edit' => $LANG_GF01['EDIT'], 'resync_cat' => $LANG_GF01['RESYNCCAT'], 'delete' => $LANG_GF01['DELETE'], 'submit' => $LANG_GF01['SUBMIT']));
if (!empty($statusText)) {
$boards->set_var('status_text', $statusText);
}
// Display each Forum Category
$cat_sql = DB_query("SELECT * FROM {$_TABLES['ff_categories']} ORDER BY cat_order");
while ($C = DB_fetchArray($cat_sql)) {
$boards->set_var('catid', $C['id']);
$boards->set_var('catname', $C['cat_name']);
$boards->set_var('order', $C['cat_order']);
// Display each forum within this category
$forum_sql_result = DB_query("SELECT * FROM {$_TABLES['ff_forums']} WHERE forum_cat=" . (int) $C['id'] . " ORDER BY forum_order");
$forum_number_of_rows = DB_numRows($forum_sql_result);
$boards->set_block('boards', 'catrows', 'crow');
$boards->clear_var('frow');
$boards->set_block('boards', 'forumrows', 'frow');
for ($j = 1; $j <= $forum_number_of_rows; $j++) {
$F = DB_fetchArray($forum_sql_result);
$boards->set_var(array('forumname' => $F['forum_name'], 'forumid' => $F['forum_id'], 'messagecount' => $F['post_count'], 'forumorder' => $F['forum_order']));
// Check if this is a private forum
if ($F['grp_id'] != '2') {
$grp_name = DB_getItem($_TABLES['groups'], 'grp_name', "grp_id=" . (int) $F['grp_id']);
$boards->set_var('forumdscp', "[{$LANG_GF93['private']} - {$grp_name}]<br/>{$F['forum_dscp']}");
} else {
$boards->set_var('forumdscp', $F['forum_dscp']);
}
$boards->parse('frow', 'forumrows', true);
}
$boards->parse('crow', 'catrows', true);
}
$boards->set_var('block_end', COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer')));
$boards->parse('output', 'boards');
$retval .= $boards->finish($boards->get_var('output'));
return $retval;
}
示例2: testClearVarHashMultiple
public function testClearVarHashMultiple()
{
$tp2 = new Template();
$hash = array('test1' => 'test41', 'test2' => 'test42');
$tp2->set_var($hash);
$this->assertEquals("test41", $tp2->get_var('test1'));
$this->assertEquals("test42", $tp2->get_var('test2'));
$hash2 = array('test1', 'test2');
$tp2->clear_var($hash2);
$this->assertEquals("", $tp2->get_var('test1'));
$this->assertEquals("", $tp2->get_var('test2'));
}
示例3: foreach
$sql .= 'WHERE `directory` = "' . $section['module'] . '"';
if (!$database->get_one($sql) || !file_exists(LEPTON_PATH . '/modules/' . $section['module'])) {
$edit_page = '<span class="module_disabled">' . $section['module'] . '</span>';
} else {
$edit_page = '';
}
$edit_page_0 = '<a id="sid' . $section['section_id'] . '" href="' . ADMIN_URL . '/pages/modify.php?page_id=' . $page_id;
$edit_page_1 = $section['section_id'] . '">' . $section['module'] . '</a>';
if (SECTION_BLOCKS) {
if ($edit_page == '') {
$edit_page = $edit_page_0 . '#' . SEC_ANCHOR . $edit_page_1;
}
$input_attribute = 'input_normal';
$template->set_var(array('STYLE_DISPLAY_SECTION_BLOCK' => ' style="visibility:visible;"', 'NAME_SIZE' => 300, 'INPUT_ATTRIBUTE' => $input_attribute, 'VAR_SECTION_ID' => $section['section_id'], 'VAR_POSITION' => $section['position'], 'LINK_MODIFY_URL_VAR_MODUL_NAME' => $edit_page, 'SELECT' => '', 'SET_NONE_DISPLAY_OPTION' => ''));
// Add block options to the section_list
$template->clear_var('block_list');
foreach ($block as $number => $name) {
$template->set_var('NAME', htmlentities(strip_tags($name)));
$template->set_var('VALUE', $number);
$template->set_var('SIZE', 1);
if ($section['block'] == $number) {
$template->set_var('SELECTED', ' selected="selected"');
} else {
$template->set_var('SELECTED', '');
}
$template->parse('block_list', 'block_block', true);
}
} else {
if ($edit_page == '') {
$edit_page = $edit_page_0 . '#' . SEC_ANCHOR . $edit_page_1;
}
示例4: elseif
echo "[[LibInclude?lib=" . $parts[0] . "&plugin=" . $parts[2] . "]]";
} elseif (file_exists(WB_PATH . '/modules/jqueryadmin/plugins/' . $settings['lightbox'] . '/foldergallery_template.htt')) {
$viewTemplate = 'foldergallery_template.htt';
$t = new Template(WB_PATH . '/modules/jqueryadmin/plugins/' . $settings['lightbox'], 'remove');
echo "[[jQueryInclude?plugin=" . $settings['lightbox'] . "]]";
} else {
$viewTemplate = 'view.htt';
// --- added by WebBird, 29.07.2010 ---
$t = new Template(dirname(__FILE__) . '/templates', 'remove');
// --- end added by WebBird, 29.07.2010 ---
}
// --- commented by WebBird, 29.07.2010 ---
$t->halt_on_error = 'no';
$t->set_file('view', $viewTemplate);
$t->set_block('view', 'CommentDoc');
$t->clear_var('CommentDoc');
$t->set_block('view', 'categories', 'CATEGORIES');
$t->set_block('categories', 'show_categories', 'SHOW_CATEGORIES');
$t->set_block('view', 'images', 'IMAGES');
$t->set_block('images', 'thumbnails', 'THUMBNAILS');
$t->set_block('images', 'invisiblePre', 'INVISIBLEPRE');
// Für weitere Bilder
$t->set_block('images', 'invisiblePost', 'INVISIBLEPOST');
$t->set_block('view', 'hr', 'HR');
$t->set_block('view', 'error', 'ERROR');
// Dieser Fehler wird nicht ausgegeben, BUG
$t->set_block('view', 'pagenav', 'PAGE_NAV');
// As the error reporting is not implemented in the frontend, set error to false
$error = false;
if ($error) {
$t->set_var('FRONT_END_ERROR_STRING', $MOD_FOLDERGALLERY['FRONT_END_ERROR']);
示例5: EVLIST_yearview
/**
* Display a yearly calendar.
* Dates that have events scheduled are highlighted.
*
* @param integer $year Year to display, default is current year
* @param integer $month Starting month
* @param integer $day Starting day
* @param integer $cat Category to show
* @param integer $cal Calendar to show
* @return string HTML for calendar page
*/
function EVLIST_yearview($year = 0, $month = 0, $day = 0, $cat = 0, $cal = 0, $opt = '')
{
global $_CONF, $_EV_CONF, $LANG_MONTH;
EVLIST_setViewSession('year', $year, $month, $day);
$retval = '';
// Default to the current year
if ($year == 0) {
$year = date('Y');
}
if ($month == 0) {
$month = date('m');
}
if ($day == 0) {
$day = date('d');
}
$cat = (int) $cat;
$cal = (int) $cal;
// Get all the dates in the year
$starting_date = date('Y-m-d', mktime(0, 0, 0, 1, 1, $year));
$ending_date = date('Y-m-d', mktime(0, 0, 0, 1, 1, $year + 1));
$calendarView = Date_Calc::getCalendarYear($year, '%Y-%m-%d');
$daynames = EVLIST_getDayNames(1);
$events = EVLIST_getEvents($starting_date, $ending_date, array('cat' => $cat, 'cal' => $cal));
$T = new Template(EVLIST_PI_PATH . '/templates/yearview');
$tpl = 'yearview';
if ($opt == 'print') {
$tpl .= '_print';
} elseif ($_EV_CONF['cal_tmpl'] == 'json') {
$tpl .= '_json';
}
$T->set_file(array('yearview' => $tpl . '.thtml'));
$count = 0;
$T->set_block('yearview', 'month', 'mBlock');
foreach ($calendarView as $monthnum => $monthdata) {
$monthnum_str = sprintf("%02d", $monthnum + 1);
$count++;
if (($count - 1) % 4 == 0) {
$T->set_var('st_row', 'true');
} else {
$T->clear_var('st_row');
}
$M = new Template($_CONF['path'] . 'plugins/evlist/templates/yearview');
$M->set_file(array('smallmonth' => 'smallmonth.thtml'));
$M->set_var('thisyear', $year);
$M->set_var('month', $monthnum + 1);
$M->set_var('monthname', $LANG_MONTH[$monthnum + 1]);
$M->set_block('smallmonth', 'daynames', 'nBlock');
for ($i = 0; $i < 7; $i++) {
$M->set_var('dayname', $daynames[$i]);
$M->parse('nBlock', 'daynames', true);
}
$M->set_block('smallmonth', 'week', 'wBlock');
foreach ($monthdata as $weeknum => $weekdata) {
list($weekYear, $weekMonth, $weekDay) = explode('-', $weekdata[0]);
$M->set_var(array('weekyear' => $weekYear, 'weekmonth' => $weekMonth, 'weekday' => $weekDay, 'urlfilt_cat' => $cat, 'urlfilt_cal' => $cal));
$M->set_block('smallmonth', 'day', 'dBlock');
foreach ($weekdata as $daynum => $daydata) {
list($y, $m, $d) = explode('-', $daydata);
$M->clear_var('no_day_link');
if ($daydata == $_EV_CONF['_today']) {
$dayclass = 'today';
} elseif ($m == $monthnum_str) {
$dayclass = 'on';
} else {
$M->set_var('no_day_link', 'true');
$dayclass = 'off';
}
if (isset($events[$daydata])) {
// Create the mootip hover text
$popup = '';
$daylinkclass = $dayclass == 'off' ? 'nolink-events' : 'day-events';
foreach ($events[$daydata] as $event) {
// Separate events by a line (if more than one)
if (!empty($popup)) {
$popup .= '<hr />' . LB;
}
// Don't show a time for all-day events
if ($event['allday'] == 0) {
$popup .= date($_CONF['timeonly'], strtotime($event['date_start'] . ' ' . $event['time_start1'])) . ': ';
}
$popup .= htmlentities($event['title']);
}
$M->set_var('popup', $popup);
} else {
$daylinkclass = 'day-noevents';
$M->clear_var('popup');
}
$M->set_var(array('daylinkclass' => $daylinkclass, 'dayclass' => $dayclass, 'day' => substr($daydata, 8, 2), 'pi_url' => EVLIST_URL, 'urlfilt_cat' => $cat, 'urlfilt_cal' => $cal));
$M->parse('dBlock', 'day', true);
//.........这里部分代码省略.........
示例6: Template
echo $section_id;
?>
';
}
window.setTimeout("Weiterleitung()", 2000); // in msecs 1000 => eine Sekunde
</script>
<?php
echo "<div class=\"info\">" . $MOD_FOLDERGALLERY['REDIRECT'] . "\n</div>\n";
} else {
// Template
$t = new Template(dirname(__FILE__) . '/admin/templates', 'remove');
$t->halt_on_error = 'no';
$t->set_file('modify', 'modify.htt');
// clear the comment-block, if present
$t->set_block('modify', 'CommentDoc');
$t->clear_var('CommentDoc');
$t->set_block('modify', 'ListElement', 'LISTELEMENT');
$t->clear_var('ListElement');
// Löschen, da dies über untenstehende Funktion erledigt wird.
// Links im Template setzen
$t->set_var(array('SETTINGS_ONCLICK' => 'javascript: window.location = \'' . WB_URL . '/modules/foldergallery/admin/modify_settings.php?page_id=' . $page_id . '&section_id=' . $section_id . '\';', 'SYNC_ONKLICK' => 'javascript: window.location = \'' . WB_URL . '/modules/foldergallery/admin/sync.php?page_id=' . $page_id . '&section_id=' . $section_id . '\';', 'HELP_ONCLICK' => 'javascript: window.location = \'' . WB_URL . '/modules/foldergallery/help.php?page_id=' . $page_id . '&section_id=' . $section_id . '\';', 'NEW_CAT_ONCLICK' => 'javascript: window.location = \'' . WB_URL . '/modules/foldergallery/admin/new_cat.php?page_id=' . $page_id . '&section_id=' . $section_id . '\';', 'EDIT_PAGE' => $page_id, 'EDIT_SECTION' => $section_id, 'WB_URL' => WB_URL));
// Text im Template setzten
$t->set_var(array('TITEL_BACKEND_STRING' => $MOD_FOLDERGALLERY['TITEL_BACKEND'], 'TITEL_MODIFY' => $MOD_FOLDERGALLERY['TITEL_MODIFY'], 'SETTINGS_STRING' => $MOD_FOLDERGALLERY['SETTINGS'], 'FOLDER_IN_FS_STRING' => $MOD_FOLDERGALLERY['FOLDER_IN_FS'], 'CAT_TITLE_STRING' => $MOD_FOLDERGALLERY['CAT_TITLE'], 'ACTIONS_STRING' => $MOD_FOLDERGALLERY['ACTION'], 'SYNC_STRING' => $MOD_FOLDERGALLERY['SYNC'], 'EDIT_CSS_STRING' => $MOD_FOLDERGALLERY['EDIT_CSS'], 'EXPAND_COLAPSE_STRING' => $MOD_FOLDERGALLERY['EXPAND_COLAPSE'], 'HELP_STRING' => $MOD_FOLDERGALLERY['HELP_INFORMATION'], 'NEW_CAT_STRING' => $MOD_FOLDERGALLERY['NEW_CAT']));
// Template ausgeben
$t->pparse('output', 'modify');
// Kategorien von der obersten Ebene aus DB hohlen
$sql = "SELECT * FROM " . TABLE_PREFIX . "mod_foldergallery_categories WHERE section_id=" . $section_id . " AND niveau=0;";
$query = $database->query($sql);
while ($result = $query->fetchRow()) {
$results[] = $result;
}
示例7: EVLIST_smallmonth
/**
* Display a small monthly calendar for the current month.
* Dates that have events scheduled are highlighted.
*
* @param integer $year Year to display, default is current year
* @param integer $month Starting month
* @return string HTML for calendar page
*/
function EVLIST_smallmonth($year = 0, $month = 0, $opts = array())
{
global $_CONF, $_EV_CONF, $LANG_MONTH, $_SYSTEM;
$retval = '';
// Default to the current year
if ($year == 0) {
$year = date('Y');
}
if ($month == 0) {
$month = date('m');
}
$monthnum_str = sprintf("%02d", (int) $month);
// Get all the dates in the period
$starting_date = date('Y-m-d', mktime(0, 0, 0, $month, 1, $year));
$ending_date = date('Y-m-d', mktime(23, 59, 59, $month, 31, $year));
$calendarView = Date_Calc::getCalendarMonth($month, $year, '%Y-%m-%d');
$events = EVLIST_getEvents($starting_date, $ending_date, $opts);
$T = new Template(EVLIST_PI_PATH . '/templates');
$T->set_file(array('smallmonth' => 'phpblock_month.thtml'));
$T->set_var('thisyear', $year);
$T->set_var('month', $month);
$T->set_var('monthname', $LANG_MONTH[(int) $month]);
// Set each day column header to the first letter of the day name
$T->set_block('smallmonth', 'daynames', 'nBlock');
$daynames = EVLIST_getDayNames(1);
foreach ($daynames as $key => $dayname) {
$T->set_var('dayname', $dayname);
$T->parse('nBlock', 'daynames', true);
}
$T->set_block('smallmonth', 'week', 'wBlock');
USES_class_date();
$dt = new Date('now', $_CONF['timezone']);
foreach ($calendarView as $weeknum => $weekdata) {
list($weekYear, $weekMonth, $weekDay) = explode('-', $weekdata[0]);
$T->set_var(array('weekyear' => $weekYear, 'weekmonth' => $weekMonth, 'weekday' => $weekDay));
$T->set_block('smallmonth', 'day', 'dBlock');
foreach ($weekdata as $daynum => $daydata) {
list($y, $m, $d) = explode('-', $daydata);
$T->clear_var('no_day_link');
if ($daydata == $_EV_CONF['_today']) {
$dayclass = 'monthtoday';
} elseif ($m == $monthnum_str) {
$dayclass = 'monthon';
} else {
$T->set_var('no_day_link', 'true');
$dayclass = 'monthoff';
}
$popup = '';
if (isset($events[$daydata])) {
// Create the tooltip hover text
$daylinkclass = $dayclass == 'monthoff' ? 'nolink-events' : 'day-events';
foreach ($events[$daydata] as $event) {
// Show event titles on different lines if more than one
if (!empty($popup)) {
$popup .= EVLIST_tooltip_newline();
}
// Don't show a time for all-day events
if ($event['allday'] == 0 && $event['rp_date_start'] == $event['rp_date_end']) {
$dt->setTimestamp(strtotime($event['rp_date_start'] . ' ' . $event['rp_time_start1']));
// Time is a localized string, not a timestamp, so
// don't adjust for the timezone
$popup .= $dt->format($_CONF['timeonly'], false) . ': ';
}
$popup .= htmlentities($event['title']);
}
$T->set_var('popup', $popup);
} else {
$daylinkclass = 'day-noevents';
$T->clear_var('popup');
}
$T->set_var(array('daylinkclass' => $daylinkclass, 'dayclass' => $dayclass, 'day' => substr($daydata, 8, 2), 'pi_url' => EVLIST_URL));
$T->parse('dBlock', 'day', true);
}
$T->parse('wBlock', 'week', true);
$T->clear_var('dBlock');
}
$T->parse('output', 'smallmonth');
return $T->finish($T->get_var('output'));
}
示例8: editpoll
//.........这里部分代码省略.........
}
SEC_setDefaultPermissions($T, $_PO_CONF['default_permissions']);
$T['statuscode'] = 0;
$T['commentcode'] = $_CONF['comment_code'];
$access = 3;
}
$poll_templates->set_var('lang_pollid', $LANG25[6]);
$poll_templates->set_var('poll_id', $T['pid']);
$poll_templates->set_var('lang_donotusespaces', $LANG25[7]);
$poll_templates->set_var('lang_topic', $LANG25[9]);
$poll_templates->set_var('poll_topic', htmlspecialchars($T['topic']));
$poll_templates->set_var('lang_mode', $LANG25[1]);
$poll_templates->set_var('lang_metadescription', $LANG_ADMIN['meta_description']);
$poll_templates->set_var('lang_metakeywords', $LANG_ADMIN['meta_keywords']);
if (!empty($T['meta_description'])) {
$poll_templates->set_var('meta_description', $T['meta_description']);
}
if (!empty($T['meta_keywords'])) {
$poll_templates->set_var('meta_keywords', $T['meta_keywords']);
}
$poll_templates->set_var('status_options', COM_optionList($_TABLES['statuscodes'], 'code,name', $T['statuscode']));
$poll_templates->set_var('comment_options', COM_optionList($_TABLES['commentcodes'], 'code,name', $T['commentcode']));
$poll_templates->set_var('lang_appearsonhomepage', $LANG25[8]);
$poll_templates->set_var('lang_openforvoting', $LANG25[33]);
$poll_templates->set_var('lang_hideresults', $LANG25[37]);
$poll_templates->set_var('poll_hideresults_explain', $LANG25[38]);
$poll_templates->set_var('poll_topic_info', $LANG25[39]);
if ($T['display'] == 1) {
$poll_templates->set_var('poll_display', 'checked="checked"');
}
if ($T['is_open'] == 1) {
$poll_templates->set_var('poll_open', 'checked="checked"');
}
if ($T['hideresults'] == 1) {
$poll_templates->set_var('poll_hideresults', 'checked="checked"');
}
// user access info
$poll_templates->set_var('lang_accessrights', $LANG_ACCESS['accessrights']);
$poll_templates->set_var('lang_owner', $LANG_ACCESS['owner']);
$ownername = COM_getDisplayName($T['owner_id']);
$poll_templates->set_var('owner_username', DB_getItem($_TABLES['users'], 'username', "uid = {$T['owner_id']}"));
$poll_templates->set_var('owner_name', $ownername);
$poll_templates->set_var('owner', $ownername);
$poll_templates->set_var('owner_id', $T['owner_id']);
$poll_templates->set_var('lang_group', $LANG_ACCESS['group']);
$poll_templates->set_var('group_dropdown', SEC_getGroupDropdown($T['group_id'], $access));
$poll_templates->set_var('lang_permissions', $LANG_ACCESS['permissions']);
$poll_templates->set_var('lang_permissionskey', $LANG_ACCESS['permissionskey']);
$poll_templates->set_var('lang_perm_key', $LANG_ACCESS['permissionskey']);
$poll_templates->set_var('permissions_editor', SEC_getPermissionsHTML($T['perm_owner'], $T['perm_group'], $T['perm_members'], $T['perm_anon']));
$poll_templates->set_var('lang_permissions_msg', $LANG_ACCESS['permmsg']);
$poll_templates->set_var('lang_answersvotes', $LANG25[10]);
$poll_templates->set_var('lang_save', $LANG_ADMIN['save']);
$poll_templates->set_var('lang_cancel', $LANG_ADMIN['cancel']);
// repeat for several questions
$question_sql = "SELECT question,qid " . "FROM {$_TABLES['pollquestions']} WHERE pid='{$pid}' ORDER BY qid;";
$questions = DB_query($question_sql);
include $_CONF['path_system'] . 'classes/navbar.class.php';
$navbar = new navbar();
for ($j = 0; $j < $_PO_CONF['maxquestions']; $j++) {
$display_id = $j + 1;
if ($j > 0) {
$poll_templates->set_var('style', 'style="display:none;"');
} else {
$poll_templates->set_var('style', '');
}
$navbar->add_menuitem($LANG25[31] . " {$display_id}", "showhidePollsEditorDiv(\"{$j}\",{$j},{$_PO_CONF['maxquestions']});return false;", true);
$Q = DB_fetchArray($questions);
$poll_templates->set_var('question_text', $Q['question']);
$poll_templates->set_var('question_id', $j);
$poll_templates->set_var('lang_question', $LANG25[31] . " {$display_id}");
$poll_templates->set_var('lang_saveaddnew', $LANG25[32]);
// answers
$answer_sql = "SELECT answer,aid,votes,remark " . "FROM {$_TABLES['pollanswers']} WHERE qid='{$j}' AND pid='{$pid}' ORDER BY aid";
$answers = DB_query($answer_sql);
for ($i = 0; $i < $_PO_CONF['maxanswers']; $i++) {
if (isset($answers)) {
$A = DB_fetchArray($answers);
$poll_templates->set_var('answer_text', htmlspecialchars($A['answer']));
$poll_templates->set_var('answer_votes', $A['votes']);
$poll_templates->set_var('remark_text', $A['remark']);
} else {
$poll_templates->set_var('answer_text', '');
$poll_templates->set_var('answer_votes', '');
$poll_templates->set_var('remark_text', '');
}
$poll_templates->parse('answer_option', 'answer', true);
}
$poll_templates->parse('question_list', 'question', true);
$poll_templates->clear_var('answer_option');
}
$navbar->set_selected($LANG25[31] . " 1");
$poll_templates->set_var('navbar', $navbar->generate());
$poll_templates->set_var('gltoken_name', CSRF_TOKEN);
$poll_templates->set_var('gltoken', $token);
$poll_templates->parse('output', 'editor');
$retval .= $poll_templates->finish($poll_templates->get_var('output'));
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
return $retval;
}
示例9: TOPIC_edit
//.........这里部分代码省略.........
// default values for topic permissions
if (empty($A['owner_id'])) {
$A['owner_id'] = $_USER['uid'];
// this is the one instance where we default the group
// most topics should belong to the Topic Admin group
if (isset($_GROUPS['Topic Admin'])) {
$A['group_id'] = $_GROUPS['Topic Admin'];
} else {
$A['group_id'] = SEC_getFeatureGroup('topic.edit');
}
SEC_setDefaultPermissions($A, $_CONF['default_permissions_topic']);
} else {
if (isset($T['perm_owner'])) {
$A['perm_owner'] = SEC_getPermissionValue($T['perm_owner']);
$A['perm_group'] = SEC_getPermissionValue($T['perm_group']);
$A['perm_members'] = SEC_getPermissionValue($T['perm_members']);
$A['perm_anon'] = SEC_getPermissionValue($T['perm_anon']);
} else {
SEC_setDefaultPermissions($A, $_CONF['default_permissions_topic']);
}
}
$access = 3;
}
// display the topic editor
$topic_templates = new Template($_CONF['path_layout'] . 'admin/topic');
$topic_templates->set_file('editor', 'topiceditor.thtml');
// generate input for topic id
if (!empty($topicEdit) && SEC_hasRights('topic.edit')) {
$tid_input = $tid . '<input type="hidden" size="20" maxlength="128" name="tid" value="' . $tid . '"' . XHTML . '>';
$delbutton = '<input type="submit" value="' . $LANG_ADMIN['delete'] . '" name="delete"%s' . XHTML . '>';
$jsconfirm = ' onclick="return doubleconfirm(\'' . $LANG27[40] . '\',\'' . $LANG27[6] . '\');"';
$topic_templates->set_var('delete_option', sprintf($delbutton, $jsconfirm));
$topic_templates->set_var('delete_option_no_confirmation', sprintf($delbutton, ''));
$topic_templates->clear_var('lang_donotusespaces');
} else {
$tid_input = '<input class="required alphanumeric" type="text" size="20" maxlength="128" name="tid" id="tid" value="' . $tid . '"' . XHTML . '>';
$topic_templates->set_var('lang_donotusespaces', $LANG27[5]);
}
$topic_templates->set_var('tid_input', $tid_input);
$topic_templates->set_var('lang_topicid', $LANG27[2]);
$topic_templates->set_var('topic_id', $A['tid']);
$topic_templates->set_var('lang_accessrights', $LANG_ACCESS['accessrights']);
$topic_templates->set_var('lang_owner', $LANG_ACCESS['owner']);
$ownername = COM_getDisplayName($A['owner_id']);
$topic_templates->set_var('owner_username', DB_getItem($_TABLES['users'], 'username', "uid = {$A['owner_id']}"));
$topic_templates->set_var('owner_name', $ownername);
$topic_templates->set_var('owner', $ownername);
$topic_templates->set_var('owner_id', $A['owner_id']);
$topic_templates->set_var('owner_dropdown', COM_buildOwnerList('owner_id', $A['owner_id']));
$topic_templates->set_var('lang_group', $LANG_ACCESS['group']);
$topic_templates->set_var('lang_save', $LANG_ADMIN['save']);
$topic_templates->set_var('lang_cancel', $LANG_ADMIN['cancel']);
$topic_templates->set_var('group_dropdown', SEC_getGroupDropdown($A['group_id'], $access));
$topic_templates->set_var('lang_permissions', $LANG_ACCESS['permissions']);
$topic_templates->set_var('lang_permissions_key', $LANG_ACCESS['permissionskey']);
$topic_templates->set_var('permissions_editor', SEC_getPermissionsHTML($A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']));
$sort_select = '<select id="sortnum" name="sortnum">' . LB;
$sort_select .= '<option value="0">' . 'First Position' . '</option>' . LB;
$result = DB_query("SELECT tid,topic,sortnum FROM {$_TABLES['topics']} ORDER BY sortnum ASC");
if ($topicEdit == 1) {
$testvar = 10;
} else {
$testvar = 0;
}
$order = 10;
while ($row = DB_fetchArray($result)) {
示例10: draw
/**
* draws installation screens
* @global type $urlServer
* @global type $langStep
* @global type $langStepTitle
* @global type $langTitleInstall
* @global type $langInstallProgress
* @param type $toolContent
*/
function draw($toolContent, $options=null) {
global $urlServer, $langStep, $langStepTitle, $langTitleInstall, $langInstallProgress;
if (!$options) {
$options = array();
}
$t = new Template();
$t->set_file('fh', '../template/default/theme.html');
$t->set_block('fh', 'mainBlock', 'main');
$t->set_var('SITE_NAME', 'Open eClass');
$t->set_block('mainBlock', 'sideBarBlock', 'delete');
$t->set_block('mainBlock', 'LoggedInBlock', 'delete');
$t->set_block('mainBlock', 'LoggedOutBlock', 'delete');
$t->set_block('mainBlock', 'toolTitleBlock', 'delete');
$t->set_block('mainBlock', 'statusSwitchBlock', 'delete');
$t->set_var('logo_img', '../template/default/img/logo_eclass.png');
$t->set_var('logo_img_small', '../template/default/img/logo_eclass_small.png');
$t->set_var('template_base', '../template/default');
if (isset($options['no-menu'])) {
$t->set_block('mainBlock', 'leftNavBlock', 'delete');
$t->set_block('mainBlock', 'breadCrumbs', 'delete');
$t->set_block('mainBlock', 'normalViewOpenDiv', 'delete');
} else {
//display the left column (installation steps)
$toolArr = installerMenu();
$numOfToolGroups = count($toolArr);
$t->set_block('mainBlock', 'leftNavCategoryBlock', 'leftNavCategory');
$t->set_block('leftNavCategoryBlock', 'leftNavLinkBlock', 'leftNavLink');
$t->set_block('mainBlock', 'mobileViewOpenDiv', 'delete');
$t->set_block('mainBlock', 'searchBlock', 'delete');
if (is_array($toolArr)) {
for ($i = 0; $i < $numOfToolGroups; $i++) {
$t->set_var('ACTIVE_TOOLS', $langInstallProgress);
$t->set_var('TOOL_GROUP_ID', $i + 1);
$t->set_var('GROUP_CLASS', 'in');
$numOfTools = count($toolArr[$i][0]);
for ($j = 0; $j < $numOfTools; $j++) {
$t->set_var('TOOL_TEXT', $toolArr[$i][0][$j]);
$t->set_var('TOOL_CLASS', $toolArr[$i][1][$j]? 'active': '');
$t->set_var('IMG_CLASS', $toolArr[$i][2][$j]);
$t->set_var('TOOL_LINK', '#');
$t->parse('leftNavLink', 'leftNavLinkBlock', true);
// remember current step to use as title
}
$t->parse('leftNavCategory', 'leftNavCategoryBlock',true);
$t->clear_var('leftNavLink'); //clear inner block
}
$t->set_var('THIRD_BAR_TEXT', $langInstallProgress);
$t->set_var('BREAD_TEXT', $langStep);
$t->set_var('FOUR_BAR_TEXT', $langTitleInstall);
$pageTitle = "$langTitleInstall - " . $langStepTitle . " (" . $langStep . ")";
$t->set_var('PAGE_TITLE', $pageTitle);
}
}
$t->set_var('URL_PATH', empty($urlServer)? '../': $urlServer);
$t->set_var('TOOL_CONTENT', $toolContent);
$t->parse('main', 'mainBlock', false);
$t->pparse('Output', 'fh');
exit;
}
示例11: defined
$sec_anchor = defined('SEC_ANCHOR') && SEC_ANCHOR != '' ? SEC_ANCHOR : '';
$edit_page_0 = '<a id="sid' . $section['section_id'] . '" href="' . ADMIN_URL . '/pages/modify.php?page_id=' . $results_array['page_id'];
$edit_page_1 = $sec_anchor != '' ? '#' . $sec_anchor . $section['section_id'] . '">' : '">';
$edit_page_1 .= $section['module'] . '</a>';
if (SECTION_BLOCKS) {
if ($edit_page == '') {
if (defined('EDIT_ONE_SECTION') && EDIT_ONE_SECTION) {
$edit_page = $edit_page_0 . '&wysiwyg=' . $section['section_id'] . $edit_page_1;
} else {
$edit_page = $edit_page_0 . $edit_page_1;
}
}
$input_attribute = 'input_normal';
$tpl->set_var(array('STYLE_DISPLAY_SECTION_BLOCK' => ' style="visibility:visible;"', 'NAME_SIZE' => 300, 'INPUT_ATTRIBUTE' => $input_attribute, 'VAR_SECTION_ID' => $section['section_id'], 'VAR_SECTION_IDKEY' => $admin->getIDKEY($section['section_id']), 'VAR_POSITION' => $section['position'], 'LINK_MODIFY_URL_VAR_MODUL_NAME' => $edit_page, 'SELECT' => '', 'SET_NONE_DISPLAY_OPTION' => ''));
// Add block options to the section_list
$tpl->clear_var('block_list');
foreach ($block as $number => $name) {
$tpl->set_var('NAME', htmlentities(strip_tags($name)));
$tpl->set_var('VALUE', $number);
$tpl->set_var('SIZE', 1);
if ($section['block'] == $number) {
$tpl->set_var('SELECTED', ' selected="selected"');
} else {
$tpl->set_var('SELECTED', '');
}
$tpl->parse('block_list', 'block_block', true);
}
} else {
if ($edit_page == '') {
$edit_page = $edit_page_0 . '#wb_' . $edit_page_1;
}
示例12: getFormattedOutput
/**
* Generates the HTML code based on the preset style
*
* @access public
* @param array $rows_arr The rows to display in the list
* @param string $title The title of the list
* @param string $list_top HTML that will appear before the list is printed
* @param string $list_bottom HTML that will appear after the list is printed
* @param boolean $show_sort True to enable column sorting, false to disable
* @param boolean $show_limit True to show page limits, false to hide
* @return string HTML output
*
*/
function getFormattedOutput($rows_arr, $title, $list_top = '', $list_bottom = '', $show_sort = true, $show_limit = true)
{
global $_CONF, $_IMAGE_TYPE, $LANG_ADMIN, $LANG09, $LANG05;
// get all template fields.
$list_templates = new Template($_CONF['path_layout'] . 'lists/' . $this->_style);
$list_templates->set_file(array('list' => 'list.thtml', 'limit' => 'page_limit.thtml', 'sort' => 'page_sort.thtml', 'row' => 'item_row.thtml', 'field' => 'item_field.thtml'));
$search_helper = '';
$string_offsets = '';
$string_pp = '';
for ($i = 0; $i < count($this->_limits); $i++) {
if ($i != 0) {
$string_offsets .= ',';
$string_pp .= ',';
}
$name = $this->_limits[$i]['name'];
$value = $this->_limits[$i]['offset'];
$pp = $this->_limits[$i]['limit'];
$string_offsets .= $name . '=' . $value;
$string_pp .= $name . '=' . $pp;
}
$offset_encode = urlencode(base64_encode($string_offsets));
$pp_encode = urlencode(base64_encode($string_pp));
if (count($rows_arr) == 0) {
$list_templates->set_var('message', $LANG_ADMIN['no_results']);
$list_templates->set_var('list_top', $list_top);
$list_templates->set_var('list_bottom', $list_bottom);
$list_templates->parse('output', 'list');
// No results to show so quickly print a message and exit
$retval = '';
if (!empty($title)) {
$retval .= COM_startBlock($title, '', COM_getBlockTemplate('_admin_block', 'header'));
}
$retval .= $list_templates->finish($list_templates->get_var('output'));
if (!empty($title)) {
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
}
return $retval;
}
if ($this->_style == 'table') {
foreach ($this->_fields as $field) {
if ($field['display'] == true && $field['title'] != '') {
$text = $sort_text . $field['title'];
$href = '';
$selected = '';
$list_templates->set_var('sort_text', $text);
$list_templates->set_var('sort_href', $href);
$list_templates->set_var('sort_selected', $selected);
$list_templates->parse('page_sort', 'sort', true);
}
}
}
$offset = ($this->_page - 1) * $this->_per_page;
$list_templates->set_var('show_message', 'display:none;');
// Run through all the results
$r = 1;
foreach ($rows_arr as $row) {
if (is_callable($this->_function)) {
$row = call_user_func($this->_function, false, $row);
}
foreach ($this->_fields as $field) {
if ($field['display'] == true) {
$fieldvalue = '';
if ($field['name'] == ROW_NUMBER) {
$fieldvalue = $r + $offset;
} else {
if (!empty($row[$field['name']])) {
$fieldvalue = $row[$field['name']];
}
}
if ($fieldvalue != '') {
$fieldvalue = sprintf($field['format'], $fieldvalue, $field['title']);
// Write field
$list_templates->set_var('field_text', $fieldvalue);
$list_templates->parse('item_field', 'field', true);
}
}
}
// Write row
$r++;
$list_templates->set_var('cssid', $r % 2 + 1);
$list_templates->parse('item_row', 'row', true);
$list_templates->clear_var('item_field');
}
// Print page numbers
$page_url = $this->_page_url . 'order=' . $this->_sort_arr['field'] . '&direction=' . $this->_sort_arr['direction'] . '&results=' . $this->_per_page . '&page=' . $this->_page . '&i=' . $offset_encode . '&j=' . $pp_encode;
$num_pages = ceil($this->_total_found / $this->_per_page);
$gp = '';
//.........这里部分代码省略.........
示例13: ADMIN_list
//.........这里部分代码省略.........
// page number
$th_subtags .= !empty($page) ? '&' . $component . 'listpage=' . $page : '';
// query
$th_subtags .= !empty($query) ? '&q=' . urlencode($query) : '';
// query limit
$th_subtags .= !empty($query_limit) ? '&query_limit=' . $query_limit : '';
$th_subtags .= "';\"";
} else {
$th_subtags = '';
}
// apply field styling if specified
if (!empty($header_arr[$i]['header_class'])) {
$admin_templates->set_var('class', $header_arr[$i]['header_class']);
} else {
$admin_templates->set_var('class', 'admin-list-headerfield');
}
// apply field alignment options if specified
$header_column_style = '';
if (!empty($header_arr[$i]['align'])) {
if ($header_arr[$i]['align'] == 'center') {
$header_column_style = 'text-align:center;';
} elseif ($header_arr[$i]['align'] == 'right') {
$header_column_style = 'text-align:right;';
}
}
// apply field wrap option if specified
$header_column_style .= isset($header_arr[$i]['nowrap']) ? ' white-space:nowrap;' : '';
// apply field width option if specified
$header_column_style .= isset($header_arr[$i]['width']) ? ' width:' . $header_arr[$i]['width'] . ';' : '';
// apply field style option if specified
if (!empty($header_column_style)) {
$admin_templates->set_var('header_column_style', 'style="' . $header_column_style . '"');
} else {
$admin_templates->clear_var('header_column_style');
}
// output the header field
$admin_templates->set_var('header_text', $header_text);
$admin_templates->set_var('th_subtags', $th_subtags);
$admin_templates->parse('header_row', 'header', true);
// clear all for next header
$admin_templates->clear_var('th_subtags');
$admin_templates->clear_var('class');
$admin_templates->clear_var('header_text');
}
if ($has_limit) {
$admin_templates->set_var('lang_limit_results', $LANG_ADMIN['limit_results']);
$limit = !empty($query_limit) ? $query_limit : 50;
// query limit (default=50)
if ($query != '') {
# set query into form after search
$admin_templates->set_var('query', urlencode($query));
} else {
$admin_templates->set_var('query', '');
}
$admin_templates->set_var('query_limit', $query_limit);
# choose proper dropdown field for query limit
$admin_templates->set_var($limit . '_selected', 'selected="selected"');
// set the default sql filter (if any)
$filtersql = isset($query_arr['default_filter']) && !empty($query_arr['default_filter']) ? " {$query_arr['default_filter']}" : '';
// now add the query fields
if (!empty($query)) {
# add query fields with search term
$filtersql .= " AND (";
for ($f = 0; $f < count($query_arr['query_fields']); $f++) {
$filtersql .= $query_arr['query_fields'][$f] . " LIKE '%" . DB_escapeString($query) . "%'";
if ($f < count($query_arr['query_fields']) - 1) {
示例14: Edit
/**
* Creates the edit form
* @param integer $id Optional ID, current record used if zero
* @return string HTML for edit form
*/
public function Edit($eid = '', $rp_id = 0, $saveaction = '')
{
global $_CONF, $_EV_CONF, $_TABLES, $_USER, $LANG_EVLIST, $LANG_ADMIN, $_GROUPS, $LANG_ACCESS, $_SYSTEM;
// If an eid is specified and this is an object, then read the
// event data- UNLESS a repeat ID is given in which case we're
// editing a repeat and already have the info we need.
// This probably needs to change, since we should always read event
// data during construction.
if (!$this->isSubmitter) {
// At least submit privilege required
COM_404();
} elseif ($eid != '' && $rp_id == 0 && is_object($this)) {
// If an id is passed in, then read that record
if (!$this->Read($eid)) {
return 'Invalid object ID';
}
} elseif (isset($_POST['eid']) && !empty($_POST['eid'])) {
// Returning to an existing form, probably due to errors
$this->SetVars($_POST);
// Make sure the current user has access to this event.
if (!$this->hasAccess(3)) {
COM_404();
}
}
$T = new Template($_CONF['path'] . 'plugins/evlist/templates/');
if ($_SYSTEM['disable_jquery_slimbox']) {
$T->set_file('editor', 'editor.uikit.thtml');
} else {
$T->set_file('editor', 'editor.thtml');
}
// Basic tabs for editing both events and instances, show up on
// all edit forms
//$tabs = array('ev_info', 'ev_schedule', 'ev_location', 'ev_contact',);
$tabs = array('ev_info', 'ev_location', 'ev_contact');
$rp_id = (int) $rp_id;
if ($rp_id > 0) {
// Make sure the current user has access to this event.
if (!$this->hasAccess(3)) {
COM_404();
}
if ($saveaction == 'savefuturerepeat') {
$alert_msg = EVLIST_alertMessage($LANG_EVLIST['editing_future'], 'warning');
} else {
$alert_msg = EVLIST_alertMessage($LANG_EVLIST['editing_instance'], 'info');
}
//$T->clear_var('contact_section');
$T->clear_var('category_section');
$T->clear_var('permissions_editor');
// Set the static calendar name for the edit form. Can't
// change it for a single instance.
$cal_name = DB_getItem($_TABLES['evlist_calendars'], 'cal_name', "cal_id='" . (int) $this->cal_id . "'");
$T->set_var(array('contact_section' => 'true', 'is_repeat' => 'true', 'cal_name' => $cal_name));
// Override our dates & times with those from the repeat.
// $rp_id is passed when this is called from class evRepeat.
// Maybe that should pass in the repeat's data instead to avoid
// another DB lookup. An array of values could be used.
$Rep = DB_fetchArray(DB_query("SELECT * \n FROM {$_TABLES['evlist_repeat']}\n WHERE rp_id='{$rp_id}'"), false);
if ($Rep) {
$this->date_start1 = $Rep['rp_date_start'];
$this->date_end1 = $Rep['rp_date_end'];
$this->time_start1 = $Rep['rp_time_start1'];
$this->time_end1 = $Rep['rp_time_end1'];
$this->time_start2 = $Rep['rp_time_start2'];
$this->time_end2 = $Rep['rp_time_end2'];
}
} else {
// Editing the main event record
if ($this->id != '' && $this->recurring == 1) {
$alert_msg = EVLIST_alertMessage($LANG_EVLIST['editing_series'], 'error');
}
if ($this->isAdmin) {
$tabs[] = 'ev_perms';
// Add permissions tab, event edit only
$T->set_var('permissions_editor', 'true');
}
$T->set_var(array('contact_section' => 'true', 'category_section' => 'true', 'upcoming_chk' => $this->show_upcoming ? EVCHECKED : ''));
}
$action_url = EVLIST_URL . '/event.php';
$delaction = 'delevent';
if (isset($_GET['from']) && $_GET['from'] == 'admin') {
$cancel_url = EVLIST_ADMIN_URL . '/index.php';
} else {
$cancel_url = EVLIST_URL . '/index.php';
}
switch ($saveaction) {
case 'saverepeat':
case 'savefuturerepeat':
case 'saveevent':
break;
case 'moderate':
// Approving a submission
$saveaction = 'approve';
$delaction = 'disapprove';
$action_url = EVLIST_ADMIN_URL . '/index.php';
$cancel_url = $_CONF['site_admin_url'] . '/moderation.php';
//.........这里部分代码省略.........
示例15: ADMIN_list
/**
* Creates a list of data with a search, filter, clickable headers etc.
*
* @param string $component name of the list
* @param string $fieldfunction name of the function that handles special entries
* @param array $header_arr array of header fields with sortables and table fields
* @param array $text_arr array with different text strings
* @param array $query_arr array with sql-options
* @param array $defsort_arr default sorting values
* @param string $filter additional drop-down filters
* @param string $extra additional values passed to fieldfunction
* @param array $options array of options - intially just used for the Check-All feature
* @param array $form_arr optional extra forms at top or bottom
* @return string HTML output of function
*
*/
function ADMIN_list($component, $fieldfunction, $header_arr, $text_arr, $query_arr, $defsort_arr, $filter = '', $extra = '', $options = '', $form_arr = '')
{
global $_CONF, $_TABLES, $LANG_ADMIN, $LANG_ACCESS, $LANG01, $_IMAGE_TYPE, $MESSAGE;
// set all variables to avoid warnings
$retval = '';
$filter_str = '';
$order_sql = '';
$limit = '';
$prevorder = '';
if (isset($_GET['prevorder'])) {
# what was the last sorting?
$prevorder = COM_applyFilter($_GET['prevorder']);
}
$query = '';
if (isset($_REQUEST['q'])) {
// get query (text-search)
$query = strip_tags(COM_stripslashes($_REQUEST['q']));
}
$query_limit = '';
if (isset($_REQUEST['query_limit'])) {
// get query-limit (list-length)
$query_limit = COM_applyFilter($_REQUEST['query_limit'], true);
if ($query_limit == 0) {
$query_limit = 50;
}
}
// we assume that the current page is 1 to set it.
$curpage = 1;
$page = '';
// get the current page from the interface. The variable is linked to the
// component, i.e. the plugin/function calling this here to avoid overlap
if (isset($_REQUEST[$component . 'listpage'])) {
$page = COM_applyFilter($_REQUEST[$component . 'listpage'], true);
$curpage = $page;
}
if ($curpage <= 0) {
$curpage = 1;
#current page has to be larger 0
}
$help_url = '';
# do we have a help url for the block-header?
if (!empty($text_arr['help_url'])) {
$help_url = $text_arr['help_url'];
}
$form_url = '';
# what is the form-url for the search button and list sorters?
if (!empty($text_arr['form_url'])) {
$form_url = $text_arr['form_url'];
}
$title = '';
# what is the title of the page?
if (!empty($text_arr['title'])) {
$title = $text_arr['title'];
}
$inline_form = false;
if (isset($text_arr['inline'])) {
$inline_form = $text_arr['inline'];
}
# get all template fields.
$admin_templates = new Template($_CONF['path_layout'] . 'admin/lists');
$admin_templates->set_file(array('search' => 'searchmenu.thtml', 'list' => $inline_form ? 'inline.thtml' : 'list.thtml', 'header' => 'header.thtml', 'row' => 'listitem.thtml', 'field' => 'field.thtml'));
# insert std. values into the template
$admin_templates->set_var('xhtml', XHTML);
$admin_templates->set_var('site_url', $_CONF['site_url']);
$admin_templates->set_var('site_admin_url', $_CONF['site_admin_url']);
$admin_templates->set_var('layout_url', $_CONF['layout_url']);
$admin_templates->set_var('form_url', $form_url);
$admin_templates->set_var('lang_edit', $LANG_ADMIN['edit']);
$admin_templates->set_var('lang_deleteall', $LANG01[124]);
$admin_templates->set_var('lang_delconfirm', $LANG01[125]);
if (isset($form_arr['top'])) {
$admin_templates->set_var('formfields_top', $form_arr['top']);
}
if (isset($form_arr['bottom'])) {
$admin_templates->set_var('formfields_bottom', $form_arr['bottom']);
}
// Check if the delete checkbox and support for the delete all feature should be displayed
if (is_array($options) and $options['chkdelete']) {
$admin_templates->set_var('header_text', '<input type="checkbox" name="chk_selectall" title="' . $LANG01[126] . '" onclick="caItems(this.form);"' . XHTML . '>');
$admin_templates->set_var('class', "admin-list-field");
$admin_templates->set_var('show_deleteimage', '');
$admin_templates->parse('header_row', 'header', true);
$admin_templates->clear_var('on_click');
} else {
//.........这里部分代码省略.........