本文整理汇总了PHP中smarty_function_button函数的典型用法代码示例。如果您正苦于以下问题:PHP smarty_function_button函数的具体用法?PHP smarty_function_button怎么用?PHP smarty_function_button使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了smarty_function_button函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_function_favorite
function smarty_function_favorite($params, $smarty)
{
global $prefs, $user;
// Disabled, do nothing
if (empty($user) || $prefs['user_favorites'] != 'y') {
return;
}
$smarty->loadPlugin('smarty_function_button');
$smarty->loadPlugin('smarty_function_service');
return smarty_function_button(array('_keepall' => 'y', '_class' => 'favorite-toggle', 'href' => smarty_function_service(array('controller' => 'favorite', 'action' => 'toggle', 'type' => $params['type'], 'object' => $params['object']), $smarty), '_text' => tr('Favorite')), $smarty);
}
示例2: smarty_function_formAction
function smarty_function_formAction(array $params, Smarty_Internal_Template $template)
{
$html = '<div class="formAction clearfix">';
if (!isset($params['theme'])) {
$params['theme'] = 'highlight';
}
$html .= smarty_function_button($params, $template);
if (isset($params['alternatives'])) {
$html .= '<div class="formAction-alternatives">';
$html .= (string) $params['alternatives'];
$html .= '</div>';
}
$html .= '</div>';
return $html;
}
示例3: wikiplugin_toc
function wikiplugin_toc($data, $params)
{
$defaults = array('order' => 'asc', 'showdesc' => false, 'shownum' => false, 'type' => 'plain', 'structId' => '', 'maxdepth' => 0, 'numberPrefix' => '', 'pagename' => '');
$params = array_merge($defaults, $params);
extract($params, EXTR_SKIP);
global $page_ref_id;
$structlib = TikiLib::lib('struct');
global $prefs;
if ($prefs['feature_jquery_ui'] === 'y' && $type === 'admin') {
TikiLib::lib('header')->add_jsfile('lib/structures/tiki-edit_structure.js')->add_jsfile('vendor/jquery/plugins/nestedsortable/jquery.ui.nestedSortable.js');
$smarty = TikiLib::lib('smarty');
$smarty->loadPlugin('smarty_function_button');
$button = smarty_function_button(array('_text' => tra('Save'), '_style' => 'display:none;', '_class' => 'save_structure', '_ajax' => 'n', '_auto_args' => 'save_structure,page_ref_id'), $smarty);
} else {
$button = '';
}
if (empty($structId)) {
$pageName_ref_id = null;
if (!empty($pagename)) {
$pageName_ref_id = $structlib->get_struct_ref_id($pagename);
} else {
if (!empty($page_ref_id)) {
$pageName_ref_id = $page_ref_id;
}
}
if (!empty($pageName_ref_id)) {
// we have a structure
$page_info = $structlib->s_get_page_info($pageName_ref_id);
$structure_info = $structlib->s_get_structure_info($pageName_ref_id);
if (isset($page_info)) {
$html = $structlib->get_toc($pageName_ref_id, $order, $showdesc, $shownum, $numberPrefix, $type, '', $maxdepth, $structure_info['pageName']);
return "~np~{$button} {$html} {$button}~/np~";
}
}
return '';
} else {
$structure_info = $structlib->s_get_structure_info($structId);
$html = $structlib->get_toc($structId, $order, $showdesc, $shownum, $numberPrefix, $type, '', $maxdepth, $structure_info['pageName']);
return "~np~{$button} {$html} {$button}~/np~";
}
}
示例4: is_array
<td width="170" align="right">Доступно материалов: <b><?php
echo $this->_tpl_vars['indexall'];
?>
</b></td>
<?php
if ($this->_tpl_vars['indexdate']) {
?>
<td width="210" align="right">Дата обновления: <b><?php
echo is_array($_tmp = $this->_tpl_vars['indexdate']) ? $this->_run_mod_handler('date_format', true, $_tmp, "%d.%m.%Y %T") : smarty_modifier_date_format($_tmp, "%d.%m.%Y %T");
?>
</b></td>
<?php
}
?>
<td width="125" align="right"><?php
echo smarty_function_button(array('caption' => "Проиндексировать", 'onclick' => "getindexform()"), $this);
?>
</td>
</tr>
</table>
<?php
if ($this->_tpl_vars['tags']) {
?>
<div class="box">
<?php
unset($this->_sections['i']);
$this->_sections['i']['name'] = 'i';
$this->_sections['i']['loop'] = is_array($_loop = $this->_tpl_vars['tags']) ? count($_loop) : max(0, (int) $_loop);
unset($_loop);
$this->_sections['i']['show'] = true;
示例5: smarty_function_button
Sortable.create(\'fieldsbox\',{tag:\'table\',onUpdate: setfieldssort});
</script>';
?>
<?php
} else {
?>
<div class="box">Нет дополнительных полей.</div>
<?php
}
?>
<table class="actiongrid">
<tr>
<td align="right">
<?php
echo smarty_function_button(array('caption' => "Добавить", 'onclick' => "getaddfieldform()"), $this);
?>
</td>
</tr>
</table>
<?php
} else {
?>
<div class="box">Не найдены разделы использующие категории.</div>
<?php
}
?>
<?php
$_smarty_tpl_vars = $this->_tpl_vars;
示例6: wikiplugin_sheet
//.........这里部分代码省略.........
$page = htmlentities($page);
$content = htmlentities($data);
$formId = "form{$index}";
return <<<EOF
\t\t\t\t~np~
\t\t\t\t<form id="{$formId}" method="post" action="tiki-wikiplugin_edit.php">
\t\t\t\t<div>
\t\t\t\t\t<input type="hidden" name="page" value="{$page}"/>
\t\t\t\t\t<input type="hidden" name="content" value="{$data}"/>
\t\t\t\t\t<input type="hidden" name="index" value="{$index}"/>
\t\t\t\t\t<input type="hidden" name="type" value="sheet"/>
\t\t\t\t\t<input type="hidden" name="params[id]" value="{$sheetId}"/>
\t\t\t\t</div>
\t\t\t\t</form>
\t\t\t\t<script type="text/javascript">
\t\t\t\tdocument.getElementById('{$formId}').submit();
\t\t\t\t</script>
\t\t\t\t~/np~
EOF;
} else {
$label = tra('Create New Sheet');
return <<<EOF
~np~
<form method="post" action="">
\t<p>
\t\t<input type="submit" name="create_sheet" value="{$label}"/>
\t\t<input type="hidden" name="index" value="{$index}"/>
\t</p>
</form>
~/np~
EOF;
}
}
}
$sheet = new TikiSheet();
if (empty($url)) {
$info;
if (!empty($id)) {
$info = $sheetlib->get_sheet_info($id);
}
if (empty($info)) {
return tra("Error loading spreadsheet");
}
$objectperms = Perms::get('sheet', $id);
if (!$objectperms->view_sheet && !($user && $info['author'] == $user)) {
return tra('Permission denied');
}
// Build required objects
$db = new TikiSheetDatabaseHandler($id);
//$out = new TikiSheetOutputHandler($data);
// Fetch sheet from database
$sheet->import($db);
} else {
if (!isset($simple)) {
$simple = 'y';
}
}
$calcOff = '';
if (!empty($range)) {
$sheet->setRange($range);
$calcOff = ',calcOff: true';
}
// Grab sheet output
if (isset($url)) {
$file = file_get_contents($url);
$pathInfo = pathinfo($url);
if ($pathInfo['extension'] == 'csv') {
$handler = new TikiSheetCSVHandler($url);
$grid = new TikiSheet();
$grid->import($handler);
$ret = $grid->getTableHtml(true, null, false);
} else {
$ret = file_get_contents($url);
}
} else {
$ret = $sheet->getTableHtml($subsheets);
}
if (strpos($ret, '<table ') === false) {
return '~np~' . $ret . '~/np~';
// return a single cell raw
}
if (!isset($simple) || $simple != 'y') {
global $headerlib;
$sheetlib->setup_jquery_sheet();
$headerlib->add_jq_onready('$("div.tiki_sheet").each(function() {
$(this).sheet($.extend($.sheet.tikiOptions,{
editable:false' . $calcOff . '}));
});');
}
$ret = '<div id="tiki_sheet' . $sheet->instance . '" class="tiki_sheet' . $class . '" style="overflow:hidden;' . $style . '">' . $ret . '</div>';
if ($editable && ($objectperms->edit_sheet || $objectperms->admin_sheet || $tiki_p_admin == 'y')) {
$smarty->loadPlugin('smarty_function_button');
//If you've given the sheet a url, you can't edit it, disable if not possible
if (!isset($url)) {
$button_params = array('_text' => tra("Edit Sheet"), '_script' => "tiki-view_sheets.php?sheetId={$id}&parse=edit{$urlHeight}&page={$page}");
}
$ret .= smarty_function_button($button_params, $smarty);
}
return '~np~' . $ret . '~/np~';
}
示例7: smarty_block_tabset
function smarty_block_tabset($params, $content, $smarty, &$repeat)
{
global $prefs, $smarty_tabset_name, $smarty_tabset, $smarty_tabset_i_tab, $cookietab, $tabset_index;
$headerlib = TikiLib::lib('header');
if ($smarty->getTemplateVars('print_page') == 'y' || $prefs['layout_tabs_optional'] === 'n') {
$params['toggle'] = 'n';
}
if ($repeat) {
// opening
if (!is_array($smarty_tabset)) {
$smarty_tabset = array();
}
$tabset_index = count($smarty_tabset) + 1;
$smarty_tabset_name = getTabsetName($params, $tabset_index);
$smarty_tabset[$tabset_index] = array('name' => $smarty_tabset_name, 'tabs' => array());
if (!isset($smarty_tabset_i_tab)) {
$smarty_tabset_i_tab = 1;
}
if (!isset($cookietab) || $tabset_index > 1) {
$cookietab = getCookie($smarty_tabset_name, 'tabs', 1);
}
// work out cookie value if there
if (isset($_REQUEST['cookietab']) && $tabset_index) {
// overrides cookie if added to request as in tiki-admin.php?page=look&cookietab=6
$cookietab = empty($_REQUEST['cookietab']) ? 1 : $_REQUEST['cookietab'];
setCookieSection($smarty_tabset_name, $cookietab, 'tabs');
// too late to set it here as output has started
}
// If the tabset specifies the tab, override any kind of memory but only if not doing "no tabs" mode
if (isset($params['cookietab']) && $cookietab !== 'n') {
$cookietab = $params['cookietab'];
}
$smarty_tabset_i_tab = 1;
return;
} else {
$content = trim($content);
if (empty($content)) {
return '';
}
if (!empty($params['skipsingle']) && count($smarty_tabset[$tabset_index]['tabs']) == 1) {
return $content;
}
$ret = '';
$notabs = '';
//closing
if ($prefs['feature_tabs'] == 'y') {
if (empty($params['toggle']) || $params['toggle'] != 'n') {
$smarty->loadPlugin('smarty_function_button');
if ($cookietab == 'n') {
$button_params['_text'] = tra('Tab View');
} else {
$button_params['_text'] = tra('No Tabs');
}
$button_params['_size'] = 'mini';
$button_params['_auto_args'] = '*';
$button_params['_onclick'] = "setCookie('{$smarty_tabset_name}','" . ($cookietab == 'n' ? 1 : 'n') . "', 'tabs') ;";
$button_params['_class'] = 'btn-xs';
$notabs = smarty_function_button($button_params, $smarty);
$notabs = "<div class='pull-right'>{$notabs}</div>";
$content_class = '';
} else {
$content_class = ' full_width';
// no no-tabs button
}
} else {
return $content;
}
if ($cookietab == 'n') {
return $ret . $notabs . $content;
}
$smarty_tabset_name = getTabsetName($params, $tabset_index);
$ret .= '<div class="clearfix tabs" data-name="' . $smarty_tabset_name . '">' . $notabs;
$count = 1;
$ret .= '<ul class="nav nav-tabs">';
foreach ($smarty_tabset[$tabset_index]['tabs'] as $value) {
$ret .= '<li class="' . $value['active'] . '"><a href="#' . $value['id'] . '" data-toggle="tab">' . $value['label'] . '</a></li>';
++$count;
}
$ret .= '</ul>';
$ret .= "</div>";
$tabset_index--;
return $ret . '<div class="tab-content">' . $content . '</div>';
}
}
示例8: wikiplugin_toc
function wikiplugin_toc( $data, $params )
{
$defaults = array(
'order' => 'asc',
'showdesc' => false,
'shownum' => false,
'type' => 'plain',
'structId' => '',
'maxdepth' => 0,
'numberPrefix' => '',
'pagename' => '',
);
$params = array_merge($defaults, $params);
extract($params, EXTR_SKIP);
global $structlib, $page_ref_id;
include_once ("lib/structures/structlib.php");
global $prefs;
if ($prefs['feature_jquery_ui'] === 'y' && $type === 'admin') {
TikiLib::lib('header')
->add_jsfile('lib/structures/tiki-edit_structure.js')
->add_jsfile('lib/jquery/jquery.mjs.nestedSortable.js');
$smarty = TikiLib::lib('smarty');
$smarty->loadPlugin('smarty_function_button');
$button = smarty_function_button(array(
'_text' => tra('Save'),
'_style' => 'display:none;',
'_class' => 'save_structure',
'_ajax' => 'n',
'_auto_args'=> 'save_structure,page_ref_id',
), $smarty);
} else {
$button = '';
}
if (empty($structId)) {
if (!empty($page_ref_id)) { //And we are currently viewing a structure
$pageName_ref_id = null;
if (!empty($pagename)) {
$pageName_ref_id = $structlib->get_struct_ref_id($pagename);
} else {
$pageName_ref_id = $page_ref_id;
}
$page_info = $structlib->s_get_page_info($pageName_ref_id);
$structure_info = $structlib->s_get_structure_info($pageName_ref_id);
if (isset($page_info)) {
$html = $structlib->get_toc($pageName_ref_id, $order, $showdesc, $shownum, $numberPrefix, $type, '', $maxdepth, $structure_info['pageName']);
return "~np~$button $html $button~/np~";
}
}
//Dont display the {toc} string for non structure pages
return '';
} else {
$structure_info = $structlib->s_get_structure_info($structId);
$html = $structlib->get_toc($structId, $order, $showdesc, $shownum, $numberPrefix, $type, '', $maxdepth, $structure_info['pageName']);
return "~np~$button $html $button~/np~";
}
}
示例9: wikiplugin_vimeo
function wikiplugin_vimeo($data, $params)
{
global $prefs;
static $instance = 0;
$instance++;
if (isset($params['url'])) {
$params['vimeo'] = $params['url'];
unset($params['url']);
return wikiplugin_flash($data, $params);
} elseif (isset($params['fileId'])) {
$fileIds = preg_split('/\\D+/', $params['fileId'], -1, PREG_SPLIT_NO_EMPTY);
unset($params['fileId']);
$out = '';
foreach ($fileIds as $fileId) {
$attributelib = TikiLib::lib('attribute');
$attributes = $attributelib->get_attributes('file', $fileId);
if (!empty($attributes['tiki.content.url'])) {
$params['vimeo'] = $attributes['tiki.content.url'];
$out .= wikiplugin_flash($data, $params);
} else {
TikiLib::lib('errorreport')->report(tr('Vimeo video not found for file #%0', $fileId));
}
}
return $out;
} else {
global $page;
$smarty = TikiLib::lib('smarty');
if ($prefs['vimeo_upload'] !== 'y') {
$smarty->loadPlugin('smarty_block_remarksbox');
$repeat = false;
return smarty_block_remarksbox(array('type' => 'error', 'title' => tra('Feature required')), tra('Feature "vimeo_upload" is required to be able to add videos here.'), $smarty, $repeat);
}
// old perms access to get "special" gallery perms to handle user gals etc
$perms = TikiLib::lib('tiki')->get_perm_object(!empty($params['galleryId']) ? $params['galleryId'] : $prefs['vimeo_default_gallery'], 'file gallery', TikiLib::lib('filegal')->get_file_gallery_info($prefs['vimeo_default_gallery']), false);
if ($perms['tiki_p_upload_files'] !== 'y') {
return '';
//$permMessage = tra('You do not have permsission to add files here.');
} else {
if (!empty($params['fromFieldId'])) {
$fieldInfo = TikiLib::lib('trk')->get_tracker_field($params['fromFieldId']);
if (empty($params['fromItemId'])) {
$item = Tracker_Item::newItem($fieldInfo['trackerId']);
} else {
$item = Tracker_Item::fromId($params['fromItemId']);
}
if (!$item->canModify()) {
return '';
//$permMessage = tra('You do not have permsission modify this tracker item.');
}
} else {
if ($page) {
$pagePerms = Perms::get(array('type' => 'wiki page', 'object' => $page))->edit;
if (!$pagePerms) {
return '';
//$permMessage = tra('You do not have permsission modify this page.');
}
}
}
}
// set up for an upload
$smarty->loadPlugin('smarty_function_button');
$smarty->loadPlugin('smarty_function_service');
$html = smarty_function_button(array('_keepall' => 'y', '_class' => 'vimeo dialog', 'href' => smarty_function_service(array('controller' => 'vimeo', 'action' => 'upload'), $smarty), '_text' => tra('Upload Video')), $smarty);
$js = '
$(".vimeo.dialog").click(function () {
var link = this;
$(this).serviceDialog({
title: tr("Upload Video"),
data: {
controller: "vimeo",
action: "upload"' . (!empty($params['galleryId']) ? ',galleryId:' . $params['galleryId'] : '') . (!empty($params['fromFieldId']) ? ',fieldId:' . $params['fromFieldId'] : '') . (!empty($params['fromItemId']) ? ',itemId:' . $params['fromItemId'] : '') . '
},
load: function(data) {
var $dialog = $(".vimeo_upload").parents(".ui-dialog-content"); // odd its the content, not the outer div
$(".vimeo_upload").on("vimeo_uploaded", function(event, data) {';
if (!empty($page) && empty($params['fromFieldId'])) {
$js .= '
var params = {
page: ' . json_encode($page) . ',
content: "",
index: ' . $instance . ',
type: "vimeo",
params: {
url: data.url
}
};
$.post("tiki-wikiplugin_edit.php", params, function() {
$("input[type=file]", $dialog).val(""); // webkit reloads the dialog as it destroys it for some reason
$dialog.dialog("destroy").remove();
$.get($.service("wiki", "get_page", {page:' . json_encode($page) . '}), function (data) {
if (data) {
$("#page-data").html(data);
}
});
});';
} else {
$js .= '
$dialog.dialog("destroy").remove();
handleVimeoFile(link, data);
';
//.........这里部分代码省略.........
示例10: wikiplugin_tour
function wikiplugin_tour($data, $params)
{
$defaults = array();
$plugininfo = wikiplugin_tour_info();
foreach ($plugininfo['params'] as $key => $param) {
$defaults["{$key}"] = $param['default'];
}
$params = array_merge($defaults, $params);
$cookie_id = 'tour' . md5($params['tour_id']);
if (getCookie($cookie_id, 'tours') == 'y') {
$dontStart = true;
} else {
$dontStart = false;
if ($params['show_once'] === 'y') {
setCookieSection($cookie_id, 'y', 'tours');
}
}
static $id = 0;
$unique = 'wptour_' . ++$id;
static $wp_tour = array('steps' => array());
if (!isset($wp_tour['start'])) {
$wp_tour['start'] = $params['start'];
}
$headerlib = TikiLib::lib('header');
$headerlib->add_jsfile('vendor/sorich87/bootstrap-tour/build/js/bootstrap-tour.js')->add_cssfile('vendor/sorich87/bootstrap-tour/build/css/bootstrap-tour.css');
// non changing init js in ransk 11 and 13 (the tour definition goes in 12)
$headerlib->add_jq_onready('var tour;
', 11);
if ($wp_tour['start'] === 'y' && !$dontStart) {
$headerlib->add_jq_onready('
if (tour) {
// Start the tour
tour.restart();
} else {
console.log("Warning: Tour not initialized, the last step needs to have parameter next set to -1");
}
', 13);
}
unset($params['start']);
unset($params['tour_id']);
$html = '';
$params['orphan'] = $params['orphan'] === 'y';
$params['backdrop'] = $params['backdrop'] === 'y';
if (empty($params['element']) && !$params['orphan']) {
$params['element'] = "#{$unique}";
$html = '<span id="' . $unique . '"></span>';
if (!empty($params['show_restart_button'])) {
$smarty = TikiLib::lib('smarty');
$smarty->loadPlugin('smarty_function_button');
$html .= smarty_function_button(['_text' => tra($params['show_restart_button']), '_id' => $unique . '_restart', 'href' => '#'], $smarty);
$headerlib->add_jq_onready('$("#' . $unique . '_restart").click(function() {
tour.goTo(0);
tour.restart();
return false;
});', 13);
}
}
$params['content'] = TikiLib::lib('parser')->parse_data($data);
$wp_tour['steps'][] = array_filter($params);
if ($params['next'] == -1 || $params['path']) {
$js = '// Instance the tour
tour = new Tour(' . json_encode($wp_tour) . ');
';
$headerlib->add_jq_onready($js, 12);
}
return $html;
}
示例11: smarty_core_load_plugins
<?php
/* Smarty version 2.6.26, created on 2015-10-22 16:40:05
compiled from categoriestree.tpl */
require_once SMARTY_CORE_DIR . 'core.load_plugins.php';
smarty_core_load_plugins(array('plugins' => array(array('function', 'object', 'categoriestree.tpl', 2, false), array('function', 'button', 'categoriestree.tpl', 9, false))), $this);
if ($this->_tpl_vars['treebox']->object->items) {
echo smarty_function_object(array('obj' => $this->_tpl_vars['treebox']), $this);
?>
<?php
} else {
?>
<div class="box">Нет категорий</div>
<?php
}
?>
<table class="actiongrid">
<tr>
<td align="right">
<?php
echo smarty_function_button(array('caption' => "Добавить", 'onclick' => "getaddcatform(-1,-1,-1)"), $this);
?>
</td>
</tr>
</table>
<script type="text/javascript">tc_sortable();</script>
示例12: smarty_block_tabset
function smarty_block_tabset($params, $content, $smarty, &$repeat)
{
global $prefs, $smarty_tabset_name, $smarty_tabset, $smarty_tabset_i_tab, $cookietab, $headerlib, $tabset_index;
if ($smarty->getTemplateVars('print_page') == 'y' || $prefs['layout_tabs_optional'] === 'n') {
$params['toggle'] = 'n';
}
if ($repeat) {
// opening
if (!is_array($smarty_tabset)) {
$smarty_tabset = array();
}
$tabset_index = count($smarty_tabset) + 1;
if (isset($params['name']) and !empty($params['name'])) {
$smarty_tabset_name = $params['name'];
// names have to be unique
} else {
$short_name = str_replace(array('tiki-', '.php'), '', basename($_SERVER['SCRIPT_NAME']));
$smarty_tabset_name = 't_' . $short_name . $tabset_index;
}
$smarty_tabset_name = TikiLib::remove_non_word_characters_and_accents($smarty_tabset_name);
$smarty_tabset[$tabset_index] = array('name' => $smarty_tabset_name, 'tabs' => array());
if (!isset($smarty_tabset_i_tab)) {
$smarty_tabset_i_tab = 1;
}
if (!isset($cookietab) || $tabset_index > 1) {
$cookietab = getCookie($smarty_tabset_name, 'tabs', 1);
}
// work out cookie value if there
if (isset($_REQUEST['cookietab']) && $tabset_index === 1) {
// overrides cookie if added to request as in tiki-admin.php?page=look&cookietab=6
$cookietab = empty($_REQUEST['cookietab']) ? 1 : $_REQUEST['cookietab'];
setCookieSection($smarty_tabset_name, $cookietab, 'tabs');
// too late to set it here as output has started
}
// If the tabset specifies the tab, override any kind of memory but only if not doing "no tabs" mode
if (isset($params['cookietab']) && $cookietab !== 'n') {
$cookietab = $params['cookietab'];
}
$smarty_tabset_i_tab = 1;
return;
} else {
$content = trim($content);
if (empty($content)) {
return '';
}
$ret = '';
$notabs = '';
//closing
if ($prefs['feature_tabs'] == 'y') {
if (empty($params['toggle']) || $params['toggle'] != 'n') {
$smarty->loadPlugin('smarty_function_button');
if ($cookietab == 'n') {
$button_params['_text'] = tra('Tab View');
} else {
$button_params['_text'] = tra('No Tabs');
}
$button_params['_auto_args'] = '*';
$button_params['_onclick'] = "setCookie('{$smarty_tabset_name}','" . ($cookietab == 'n' ? 1 : 'n') . "', 'tabs') ;";
$notabs = smarty_function_button($button_params, $smarty);
$notabs = "<div class='tabstoggle floatright'>{$notabs}</div>";
$content_class = '';
} else {
$content_class = ' full_width';
// no no-tabs button
}
} else {
return $content;
}
if ($cookietab == 'n') {
return $ret . $notabs . $content;
}
$ret .= '<div class="clearfix tabs" data-name="' . $smarty_tabset_name . '">' . $notabs;
$count = 1;
if ($prefs['mobile_feature'] === 'y' && $prefs['mobile_mode'] === 'y') {
$ret .= '<div class="container' . $content_class . '" data-role="navbar"><ul>';
foreach ($smarty_tabset[$tabset_index]['tabs'] as $value) {
$ret .= '<li>' . '<a href="#" class="tabmark tab' . $count . ' ' . ($count == $cookietab ? 'ui-btn-active' : '') . '"' . ' onclick="tikitabs(' . $count . ',this); return false;">' . $value . '</a></li>';
++$count;
}
$ret .= '</ul></div>';
} else {
// notmal non-mobile rendering
$ret .= '<div class="container' . $content_class . '">';
foreach ($smarty_tabset[$tabset_index]['tabs'] as $value) {
$ret .= '<span class="tabmark tab' . $count . ' ' . ($count == $cookietab ? 'tabactive' : '') . '">' . '<a href="#content' . $count . '"' . ' onclick="tikitabs(' . $count . ',this); return false;">' . $value . '</a></span>';
++$count;
}
$ret .= '</div>';
}
$ret .= "</div>{$content}";
// add some jq to initialize the tab, needed when page is cached
if ($tabset_index === 1) {
// override cookie with query cookietab
$headerlib->add_jq_onready('
var ctab = location.search.match(/cookietab=(\\d+)/);
if (ctab) {
setCookie("' . $smarty_tabset_name . '", ctab[1],"tabs");
}');
}
if ($cookietab != getCookie($smarty_tabset_name, 'tabs', 1)) {
//.........这里部分代码省略.........
示例13: smarty_function_hidden
echo smarty_function_hidden(array('name' => 'item', 'value' => $this->_tpl_vars['system']['item']), $this);
?>
<?php
echo smarty_function_hidden(array('name' => 'tab', 'value' => 'pages'), $this);
?>
</form>
</td>
<td align="right" width="80%">
<?php
echo smarty_function_button(array('caption' => "Новый подраздел", 'onclick' => "getadddirform()"), $this);
?>
<?php
echo smarty_function_button(array('caption' => "Новая страница", 'onclick' => "getaddpageform()"), $this);
?>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
indir(<?php
echo $this->_tpl_vars['curdir'];
?>
);
</script>
<?php
$_block_content = ob_get_contents();
ob_end_clean();
示例14: smarty_function_button
</div>
<div id="images_editbox" class="box" style="display:none">
<table class="invisiblegrid" width="100%">
<tr>
<td>Заменить:</td>
<td width="80%">Описание:</td>
</tr>
<tr>
<td><div id="images_filebox2"></div></td>
<td width="80%"><input type="text" id="images_caption2" name="images_caption2" style="width:100%"></td>
</tr>
</table>
<div align="right" style="margin-top:10px">
<input type="hidden" id="images_id" name="images_id" value="0">
<?php
echo smarty_function_button(array('caption' => "Сохранить", 'onclick' => "images_save()"), $this);
?>
<?php
echo smarty_function_button(array('caption' => "Отмена", 'onclick' => "images_cancel()"), $this);
?>
</div>
</div>
<div id="images_messagebox" class="box" style="display:none" align="center"></div>
<?php
if ($this->_tpl_vars['mainframe']) {
?>
<script type="text/javascript">images_refresh();</script>
<?php
}
示例15: smarty_core_load_plugins
<?php
/* Smarty version 2.6.26, created on 2015-12-13 17:33:16
compiled from fileadmin.tpl */
require_once SMARTY_CORE_DIR . 'core.load_plugins.php';
smarty_core_load_plugins(array('plugins' => array(array('function', 'button', 'fileadmin.tpl', 5, false))), $this);
?>
<div id="fa_gridbox"></div>
<table class="actiongrid">
<tr>
<td align="right">
<?php
echo smarty_function_button(array('caption' => "Создать каталог", 'onclick' => "createfolder()"), $this);
?>
<?php
echo smarty_function_button(array('caption' => "Создать файл", 'onclick' => "createfile()"), $this);
?>
<?php
echo smarty_function_button(array('caption' => "Загрузить файл", 'onclick' => "uploadform()"), $this);
?>
</td>
</tr>
</table>
<script type="text/javascript">fagopage(0)</script>