Commit 06bc8839 authored by sept_7's avatar sept_7

[UPDATE] Update to Smarty 3.0.8

All should work as expected, but I might have missed some pb. 
So please test carefully and report any pb to me.
Will try to go to 3.1 very soon...
parent cd943ef8
......@@ -321,6 +321,30 @@ function check_smarty_syntax(&$error_msg) {
require_once 'lib/init/smarty.php';
set_error_handler('check_smarty_syntax_error_handler');
$templates_dir = $smarty->template_dir;
$templates_dir_length = strlen($templates_dir);
if ( $templates_dir_length > 1 && $templates_dir{$templates_dir_length - 1} == '/' )
$templates_dir = substr($templates_dir, 0, --$templates_dir_length);
$temp_compile_file = TEMP_DIR . 'smarty_compiled_content';
$smarty->compileAllTemplates('.tpl', true);
}
function check_smarty_syntax2(&$error_msg) {
global $tikidomain, $prefs, $smarty;
$tikidomain = '';
// Initialize $prefs with some variables needed by the tra() function and smarty autosave plugin
$prefs = array(
'lang_use_db' => 'n',
'language' => 'en',
'site_language' => 'en',
'feature_ajax' => 'n'
);
// Load Tiki Smarty
require_once 'lib/init/smarty.php';
set_error_handler('check_smarty_syntax_error_handler');
$templates_dir = $smarty->template_dir;
$templates_dir_length = strlen($templates_dir);
if ( $templates_dir_length > 1 && $templates_dir{$templates_dir_length - 1} == '/' )
......
......@@ -173,7 +173,7 @@ class Smarty_Tiki_Installer extends Smarty
{
function Smarty_Tiki_Installer($tikidomain) {
parent::Smarty();
parent::__construct();
if ($tikidomain) {
$tikidomain .= '/';
}
......@@ -204,11 +204,11 @@ class Smarty_Tiki_Installer extends Smarty
//$this->debug_tpl = 'debug.tpl';
}
function fetch($_smarty_tpl_file, $_smarty_cache_id = null, $_smarty_compile_id = null, $_smarty_display = false) {
function fetch($_smarty_tpl_file, $_smarty_cache_id = null, $_smarty_compile_id = null, $parent = null, $_smarty_display = false) {
global $language;
$_smarty_cache_id = $language . $_smarty_cache_id;
$_smarty_compile_id = $language . $_smarty_compile_id;
return parent::fetch($_smarty_tpl_file, $_smarty_cache_id, $_smarty_compile_id, $_smarty_display);
return parent::fetch($_smarty_tpl_file, $_smarty_cache_id, $_smarty_compile_id, $parent, $_smarty_display);
}
}
......@@ -590,8 +590,9 @@ $_SESSION["install-logged-$multi"] = 'y';
// Init smarty
global $tikidomain;
$smarty = new Smarty_Tiki_Installer($tikidomain);
$smarty->load_filter('pre', 'tr');
$smarty->load_filter('output', 'trimwhitespace');
$smarty->loadFilter('pre', 'tr');
$smarty->loadFilter('output', 'trimwhitespace');
$smarty->auto_literal = false;
$smarty->assign('mid', 'tiki-install.tpl');
$smarty->assign('virt', isset($virt) ? $virt : null );
$smarty->assign('multi', isset($multi) ? $multi : null );
......@@ -613,7 +614,7 @@ $smarty->assign('tiki_version_name', preg_replace('/^(\d+\.\d+)([^\d])/', '\1 \2
$dbservers = array();
if (function_exists('mysqli_connect')) $dbservers['mysqli'] = tra('MySQL Improved (mysqli)');
if (function_exists('mysql_connect')) $dbservers['mysql'] = tra('MySQL classic (mysql)');
$smarty->assign_by_ref('dbservers', $dbservers);
$smarty->assignByRef('dbservers', $dbservers);
$errors = '';
......@@ -663,7 +664,7 @@ include('lib/tikilib.php');
// Get list of available languages
$languages = TikiLib::list_languages(false, null, true);
$smarty->assign_by_ref("languages", $languages);
$smarty->assignByRef("languages", $languages);
$client_charset = '';
......@@ -877,7 +878,7 @@ if ( isset( $_GET['lockenter'] ) || isset( $_GET['nolockenter'] ) ) {
exit;
}
$smarty->assign_by_ref('tikifeedback', $tikifeedback);
$smarty->assignByRef('tikifeedback', $tikifeedback);
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
......@@ -1045,11 +1046,11 @@ jqueryTiki.effect_tabs_speed = 400;
$headerlib->add_js($js, 100);
$smarty->assign_by_ref('headerlib',$headerlib);
$smarty->assignByRef('headerlib',$headerlib);
$smarty->assign('install_step', $install_step);
$smarty->assign('install_type', $install_type);
$smarty->assign_by_ref('prefs', $prefs);
$smarty->assignByRef('prefs', $prefs);
$smarty->assign('detected_https',isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on');
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6') !== false) {
......
......@@ -118,7 +118,7 @@ class AjaxLib
//$objResponse->setCharacterEncoding('UTF-8');
$confirmation_text = $smarty->get_template_vars('confirmation_text');
$confirmation_text = $smarty->getTemplateVars('confirmation_text');
if ( $last_user != $user ) {
......@@ -128,14 +128,14 @@ class AjaxLib
} elseif ( $this->templateIsRegistered($template) ) {
$content = '';
if ($smarty->get_template_vars('mid') == $template) {
$content = $smarty->get_template_vars('mid_data');
if ($smarty->getTemplateVars('mid') == $template) {
$content = $smarty->getTemplateVars('mid_data');
}
if (empty($content)) {
$content = $smarty->fetch($template);
}
// Help
require_once $smarty->_get_plugin_filepath('function', 'show_help');
$smarty->loadPlugin('smarty_function_show_help');
$content .= smarty_function_show_help(null,$smarty);
// Handle TikiTabs in order to display only the current tab in the XAJAX response
// This has to be done here, since it is tikitabs() is usually called when loading the <body> tag
......@@ -170,7 +170,7 @@ class AjaxLib
// if ( $prefs['feature_ticketlib2'] == 'y' ) {
// $objResponse->confirmCommands(1, $confirmation_text);
// $params['daconfirm'] = 'y';
// $params['ticket'] = $smarty->get_template_vars('ticket');
// $params['ticket'] = $smarty->getTemplateVars('ticket');
// }
//
// require_once('lib/smarty_tiki/block.self_link.php');
......
......@@ -10,7 +10,7 @@ class Search_Formatter_ValueFormatter_Objectlink implements Search_Formatter_Val
function render($name, $value, array $entry)
{
global $smarty;
require_once $smarty->_get_plugin_filepath('function', 'object_link');
$smarty->loadPlugin('smarty_function_object_link');
$params = array(
'type' => $entry['object_type'],
......
......@@ -24,7 +24,7 @@ class Search_Formatter_ValueFormatter_Reference implements Search_Formatter_Valu
function render($name, $value, array $entry)
{
global $smarty;
require_once $smarty->_get_plugin_filepath('function', 'object_link');
$smarty->loadPlugin('smarty_function_object_link');
foreach ((array) $value as $id) {
$params = array(
......
......@@ -78,8 +78,8 @@ class Tracker_Field_File extends Tracker_Field_Abstract
$attachment = TikiLib::lib('trk')->get_item_attachment($att_id);
$smarty = TikiLib::lib('smarty');
require_once $smarty->_get_plugin_filepath('block', 'self_link');
require_once $smarty->_get_plugin_filepath('function', 'icon');
$smarty->loadPlugin('smarty_block_self_link');
$smarty->loadPlugin('smarty_function_icon');
$link = smarty_block_self_link(array(
'_script' => 'tiki-download_item_attachment.php',
......
......@@ -156,7 +156,7 @@ class Tracker_field_Image extends Tracker_Field_File
return '';
}
}
require_once $smarty->_get_plugin_filepath('function', 'html_image');
$smarty->loadPlugin('smarty_function_html_image');
$ret = smarty_function_html_image($params, $smarty);
if (!empty($pre))
$ret = $pre.$ret.'</a>';
......
......@@ -95,7 +95,7 @@ class Tracker_Field_ItemLink extends Tracker_Field_Abstract implements Tracker_F
$label = isset($list[$item]) ? $list[$item] : '';
}
if ($item && $context['list_mode'] !== 'csv' && $this->getOption(2)) {
require_once $smarty->_get_plugin_filepath('function', 'object_link');
$smarty->loadPlugin('smarty_function_object_link');
return smarty_function_object_link(array(
'type' => 'trackeritem',
......
......@@ -82,7 +82,7 @@ class Tracker_Field_PageSelector extends Tracker_Field_Abstract
return $value;
} else {
$smarty = TikiLib::lib('smarty');
require_once $smarty->_get_plugin_filepath('function', 'object_link');
$smarty->loadPlugin('smarty_function_object_link');
return smarty_function_object_link( array(
'type' => 'wikipage',
'id' => $value,
......
......@@ -44,7 +44,7 @@ class Tracker_Field_Url extends Tracker_Field_Abstract implements Tracker_Field_
if (empty($url) || $context['list_mode'] == 'csv') {
return $url;
} else {
require_once $smarty->_get_plugin_filepath('function', 'object_link');
$smarty->loadPlugin('smarty_function_object_link');
return smarty_function_object_link(array(
'type' => 'external',
'id' => $url,
......
......@@ -99,7 +99,7 @@ class Tracker_Field_UserSelector extends Tracker_Field_Abstract implements Track
if ($autoassign == 0 || $tiki_p_admin_trackers === 'y') {
$groupIds = $this->getOption(2, '');
require_once $smarty->_get_plugin_filepath('function', 'user_selector');
$smarty->loadPlugin('smarty_function_user_selector');
return smarty_function_user_selector(
array( 'user' => $value,
'id' => 'user_selector_' . $this->getConfiguration('fieldId'),
......@@ -110,7 +110,7 @@ class Tracker_Field_UserSelector extends Tracker_Field_Abstract implements Track
'groupIds' => $groupIds,
), $smarty);
} else {
require_once $smarty->_get_plugin_filepath('modifier', 'username');
$smarty->loadPlugin('smarty_modifier_username');
return smarty_modifier_username( $value ) . '<input type="hidden" name="' . $this->getInsertId() . '" value="' . $value . '">';
}
}
......@@ -121,7 +121,7 @@ class Tracker_Field_UserSelector extends Tracker_Field_Abstract implements Track
if (empty($value)) {
return '';
} else {
require_once TikiLib::lib('smarty')->_get_plugin_filepath('modifier', 'username');
TikiLib::lib('smarty')->loadPlugin('smarty_modifier_username');
return smarty_modifier_username( $value );
}
}
......
......@@ -46,7 +46,7 @@ class DbgFeatures extends DebuggerCommand
$mask = count($p) > 0 ? str_replace('$', '', trim($p[0])) : '';
// Get list of all vars
global $smarty;
$tpl_vars = $smarty->get_template_vars();
$tpl_vars = $smarty->getTemplateVars();
// convert to vector of names, filter permissions only, and sort
$perms = array();
$len = strlen($mask);
......
......@@ -46,7 +46,7 @@ class DbgPermissions extends DebuggerCommand
$mask = count($p) > 0 ? str_replace('$', '', trim($p[0])) : '';
// Get list of all vars
global $smarty;
$tpl_vars = $smarty->get_template_vars();
$tpl_vars = $smarty->getTemplateVars();
// Get descriptions for all permissions
global $userlib;
$pd = $userlib->get_permissions();
......
......@@ -45,7 +45,7 @@ class DbgSList extends DebuggerCommand
$mask = count($p) > 0 ? str_replace('$', '', trim($p[0])) : '';
// Get list of vars
global $smarty;
$tpl_vars = $smarty->get_template_vars();
$tpl_vars = $smarty->getTemplateVars();
// convert to vector of names and sort
$vars = array();
$len = strlen($mask);
......
......@@ -48,7 +48,7 @@ class DbgSPrint extends DebuggerCommand
$v = trim(str_replace("$", "", $v));
if (strlen($v) != 0) {
$tmp = $smarty->get_template_vars();
$tmp = $smarty->getTemplateVars();
if (is_array($tmp) && isset($tmp[$v]))
$result .= $v . ' = ' . print_r($tmp[$v], true). "\n";
......
......@@ -159,7 +159,7 @@ class DbgCmd_Watch extends DebuggerCommand
$result = '';
if (strlen($v) != 0) {
$tmp = $smarty->get_template_vars();
$tmp = $smarty->getTemplateVars();
if (is_array($tmp) && isset($tmp[$v]))
$result .= print_r($tmp[$v], true). "\n";
......
......@@ -672,4 +672,4 @@ class HeaderLib
}
$headerlib = new HeaderLib;
$smarty->assign_by_ref('headerlib', $headerlib);
$smarty->assignByRef('headerlib', $headerlib);
This diff is collapsed.
......@@ -368,7 +368,7 @@ function initialize_prefs() {
// Unserialize serialized preferences
if ( isset($_SESSION['serialized_prefs']) && is_array($_SESSION['serialized_prefs']) ) {
foreach ( $_SESSION['serialized_prefs'] as $p ) {
if ( isset($modified[$p]) && ! is_array($modified[$p]) ) $modified[$p] = unserialize($modified[$p]);
if ( isset($modified[$p]) && ! is_array($modified[$p]) ) $modified[$p] = @unserialize($modified[$p]);
}
}
......
......@@ -39,7 +39,7 @@ function smarty_block_add_help($params, $content, &$smarty, &$repeat) {
if (!isset($params['show']) or $params['show'] == 'y') {
global $headerlib;
require_once $smarty->_get_plugin_filepath('block', 'self_link');
$smarty->loadPlugin('smarty_block_self_link');
$self_link_params['_alt'] = tra('Click for Help');
$self_link_params['_icon'] = 'help';
$self_link_params['_ajax'] = 'n';
......
......@@ -72,9 +72,9 @@ function smarty_block_pagination_links($params, $url, &$smarty, $repeat) {
) ) return '';
if ( ! isset($params['reloff']) && ( $params['offset'] >= $params['cant'] + $zero_based_min || $params['offset'] < $zero_based_min ) ) return '';
// Include smarty functions used below
require_once $smarty->_get_plugin_filepath('block', 'ajax_href');
require_once $smarty->_get_plugin_filepath('function', 'query');
require_once $smarty->_get_plugin_filepath('function', 'icon');
$smarty->loadPlugin('smarty_block_ajax_href');
$smarty->loadPlugin('smarty_function_query');
$smarty->loadPlugin('smarty_function_icon');
// Make sure every params are initialized
if ( ! isset($params['itemname']) ) $params['itemname'] = 'Page';
......
......@@ -72,6 +72,6 @@ function smarty_block_remarksbox($params, $content, &$smarty) {
$smarty->assign('remarksbox_icon', $icon);
$smarty->assign('remarksbox_close', $close);
$smarty->assign('remarksbox_width', $width);
$smarty->assign_by_ref('remarksbox_content', $content);
$smarty->assignByRef('remarksbox_content', $content);
return $smarty->fetch('remarksbox.tpl');
}
......@@ -40,7 +40,7 @@ function smarty_block_self_link($params, $content, &$smarty, $repeat = false) {
$default_icon_type = 'relative';
if ( $repeat ) return;
require_once $smarty->_get_plugin_filepath('function', 'query');
$smarty->loadPlugin('smarty_function_query');
if ( is_array($params) ) {
......@@ -93,7 +93,7 @@ function smarty_block_self_link($params, $content, &$smarty, $repeat = false) {
if ( empty($params['_disabled']) ) {
if ( $params['_ajax'] === 'y' && $params['_script'] === '' ) {
require_once $smarty->_get_plugin_filepath('block', 'ajax_href');
$smarty->loadPlugin('smarty_block_ajax_href');
if ( ! isset($params['_htmlelement']) ) $params['_htmlelement'] = 'role_main';
if ( ! isset($params['_onclick']) ) $params['_onclick'] = '';
if ( ! isset($params['_template']) ) {
......@@ -117,7 +117,7 @@ function smarty_block_self_link($params, $content, &$smarty, $repeat = false) {
if ( isset($params['_icon']) ) {
if ( ! isset($params['_title']) && $content != '' ) $params['_title'] = $content;
require_once $smarty->_get_plugin_filepath('function', 'icon');
$smarty->loadPlugin('smarty_function_icon');
$icon_params = array('_id' => $params['_icon'], '_type' => $default_icon_type);
if ( isset($params['_alt']) ) {
......@@ -160,7 +160,7 @@ function smarty_block_self_link($params, $content, &$smarty, $repeat = false) {
$ret = "<a $link>".$content.'</a>';
if ( !empty($params['_sort_field']) ) {
require_once $smarty->_get_plugin_filepath('function', 'show_sort');
$smarty->loadPlugin('smarty_function_show_sort');
$ret .= "<a $link style='text-decoration:none;'>".smarty_function_show_sort(
array('sort' => $params['_sort_arg'], 'var' => $params['_sort_field']),
$smarty
......
......@@ -31,7 +31,7 @@ function smarty_block_tab($params, $content, &$smarty, &$repeat) {
if ( $repeat ) {
return;
} else {
$print_page = $smarty->get_template_vars('print_page');
$print_page = $smarty->getTemplateVars('print_page');
if ($print_page != 'y') {
$smarty_tabset_i_tab = count($smarty_tabset[$tabset_index]['tabs']) + 1;
......
......@@ -31,8 +31,7 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
function smarty_block_tabset($params, $content, &$smarty, &$repeat) {
global $prefs, $smarty_tabset_name, $smarty_tabset, $smarty_tabset_i_tab, $cookietab, $headerlib, $tabset_index, $tikilib;
if ($smarty->get_template_vars('print_page') == 'y' || $prefs['layout_tabs_optional'] === 'n') {
if ($smarty->getTemplateVars('print_page') == 'y' || $prefs['layout_tabs_optional'] === 'n') {
$params['toggle'] = 'n';
}
if ( $repeat ) {
......@@ -79,7 +78,7 @@ function smarty_block_tabset($params, $content, &$smarty, &$repeat) {
//closing
if ( $prefs['feature_tabs'] == 'y') {
if (empty($params['toggle']) || $params['toggle'] != 'n') {
require_once $smarty->_get_plugin_filepath('function','button');
$smarty->loadPlugin('smarty_function_button');
if ($cookietab == 'n') {
$button_params['_text'] = tra('Tab View');
} else {
......
......@@ -78,7 +78,8 @@ function smarty_block_textarea($params, $content, &$smarty, $repeat) {
$as_id = $params['id'];
include_once('lib/smarty_tiki/block.remarksbox.php');
$editWarning = $prefs['wiki_timeout_warning'] == 'y' && isset($smarty->_tpl_vars['page']) && $smarty->_tpl_vars['page'] != 'sandbox';
$tmp_var = $smarty->getTemplateVars('page');
$editWarning = $prefs['wiki_timeout_warning'] === 'y' && isset($tmp_var) && $tmp_var !== 'sandbox';
if ($params['_simple'] === 'n' && $editWarning) {
$html .= smarty_block_remarksbox( array( 'type'=>'tip', 'title'=>tra('Tip')),
tra('This edit session will expire in') .
......@@ -153,7 +154,7 @@ function smarty_block_textarea($params, $content, &$smarty, $repeat) {
$headerlib->add_jsfile('lib/ckeditor/adapters/jquery.js', 0, true);
$headerlib->add_jsfile('lib/ckeditor_tiki/tikilink_dialog.js');
include_once( $smarty->_get_plugin_filepath('function', 'toolbars') );
$smarty->loadPlugin('smarty_function_toolbars');
$cktools = smarty_function_toolbars($params, $smarty);
$cktools = json_encode($cktools);
$cktools = substr($cktools, 1, strlen($cktools) - 2); // remove surrouding [ & ]
......@@ -256,7 +257,7 @@ function CKeditor_OnComplete() {
if ( $textarea_attributes != '' ) {
$smarty->assign('textarea_attributes', $textarea_attributes);
}
$smarty->assign_by_ref('pagedata', htmlspecialchars($content));
$smarty->assignByRef('pagedata', htmlspecialchars($content));
$smarty->assign('comments', $params['comments']); // jb removed fallback to using _simple here if comments not set 110720
$smarty->assign('switcheditor', isset($params['switcheditor']) ? $params['switcheditor'] : 'n');
$smarty->assign('toolbar_section', $params['section']);
......
......@@ -72,6 +72,6 @@ function smarty_block_tikimodule($params, $content, &$smarty) {
$smarty->assign('module_decorations', $decorations);
if ( empty($type) ) $type = "module";
$smarty->assign('module_type', $type);
$smarty->assign_by_ref('module_content', $content);
$smarty->assignByRef('module_content', $content);
return $smarty->fetch('module.tpl');
}
......@@ -32,7 +32,7 @@ function smarty_block_title($params, $content, &$smarty, $repeat) {
if ( ! isset($params['help']) ) $params['help'] = '';
if ( ! isset($params['admpage']) ) $params['admpage'] = '';
if ( ! isset($params['url']) ) {
require_once $smarty->_get_plugin_filepath('function', 'query');
$smarty->loadPlugin('smarty_function_query');
$params['url'] = smarty_function_query(array('_type' => 'absolute_path'), $smarty);
}
......@@ -55,18 +55,18 @@ function smarty_block_title($params, $content, &$smarty, $repeat) {
$html = '<h1>';
$html .= '<a class="' . $class . '"' . $metadata . ' href="' . $params['url'] . '">' . htmlspecialchars($content) . "</a>\n";
if ($smarty->get_template_vars('print_page') != 'y') {
if ($smarty->getTemplateVars('print_page') != 'y') {
if ( $prefs['feature_help'] == 'y' && $prefs['helpurl'] != '' && $params['help'] != '' ) {
$html .= '<a href="' . $prefs['helpurl'] . rawurlencode($params['help']) . '" class="titletips" title="' . tra('Help page:') . ' ' . htmlspecialchars($content) . '">'
. smarty_function_icon(array('_id' => 'help') , $smarty)
. "</a>\n";
}
if ($prefs['feature_edit_templates'] == 'y' && $tiki_p_edit_templates == 'y' && ($tpl = $smarty->get_template_vars('mid'))) {
if ($prefs['feature_edit_templates'] == 'y' && $tiki_p_edit_templates == 'y' && ($tpl = $smarty->getTemplateVars('mid'))) {
$html .= '<a href="tiki-edit_templates.php?template=' . $tpl . '" class="titletips" title="' . tra('View or edit tpl:') . ' ' . htmlspecialchars($content) . '">'
. smarty_function_icon(array('_id' => 'shape_square_edit', 'alt' => tra('Edit Template')), $smarty)
. "</a>\n";
} elseif ($prefs['feature_view_tpl'] == 'y' && $tiki_p_view_templates == 'y' && ($tpl = $smarty->get_template_vars('mid'))) {
} elseif ($prefs['feature_view_tpl'] == 'y' && $tiki_p_view_templates == 'y' && ($tpl = $smarty->getTemplateVars('mid'))) {
$html .= '<a href="tiki-edit_templates.php?template=' . $tpl . '" class="titletips" title="' . tra('View tpl:') . ' ' . htmlspecialchars($content) . '">'
. smarty_function_icon(array('_id' => 'shape_square', 'alt' => tra('View Template')), $smarty)
. "</a>\n";
......
......@@ -30,7 +30,7 @@ function smarty_block_translation($params, $content, &$smarty)
{
if (isset($content)) {
$lang = $params['lang'];
if ($smarty->get_template_vars('language') == $lang) {
if ($smarty->getTemplateVars('language') == $lang) {
return $content;
} else {
return '';
......
......@@ -51,6 +51,7 @@ function smarty_compiler_assign($tag_attrs, &$compiler) {
// and will be simply available in smarty as $myarray.foo.bar
//
if ( strpos($_params['var'], '.') !== false ) {
//FIXME
return "\$this->_tpl_vars[".str_replace('.', "']['", $_params['var'])."] = {$_params['value']};";
}
......
......@@ -49,7 +49,7 @@ function s_f_attachments_actionshandler( $params ) {
/* check_ticket('index'); */
global $smarty;
require_once $smarty->_get_plugin_filepath('function', 'query');
$smarty->loadPlugin('smarty_function_query');
$galleryId = $filegallib->get_attachment_gallery( $params['page'], 'wiki page' );
$filegallib->actionHandler( 'uploadFile', array(
......
......@@ -27,7 +27,7 @@ function smarty_function_button($params, &$smarty) {
if ( ! is_array($params) || ! isset($params['_text']) ) return;
global $tikilib, $prefs, $auto_query_args;
require_once $smarty->_get_plugin_filepath('block', 'self_link');
$smarty->loadPlugin('smarty_block_self_link');
$selected = false ;
if ( ! empty($params['_selected']) ) {
......
......@@ -38,7 +38,7 @@ function smarty_function_debugger($params, &$smarty) {
if ($debugger->result_type() == TPL_RESULT) {
$smarty->assign('result_tpl', $debugger->result_tpl());
$smarty->assign_by_ref('command_result', $command_result);
$smarty->assignByRef('command_result', $command_result);
} else {
$smarty->assign('command_result', $command_result);
}
......@@ -77,7 +77,7 @@ function smarty_function_debugger($params, &$smarty) {
$c = getCookie('debugconsole', 'menu');
$smarty->assign('debugconsole_style', $c == 'o' ? 'display:block;' : 'display:none;');
$smarty->assign_by_ref('tabs', $tabs);
$smarty->assignByRef('tabs', $tabs);
$js = '';
if ($prefs['feature_jquery_ui'] == 'y') {
......
......@@ -57,11 +57,11 @@ function smarty_function_fgal_browse($params, &$smarty) {
include_once('fgal_listing_conf.php');
$gal_info['show_action'] = 'n';
$smarty->assign_by_ref('gal_info', $gal_info);
$smarty->assignByRef('gal_info', $gal_info);
// Get list of files in the gallery
$files = $filegallib->get_files($params['_offset'], $params['_maxRecords'], $params['_sort_mode'], $params['_find'], $params['_id']);
$smarty->assign_by_ref('files', $files['data']);
$smarty->assignByRef('files', $files['data']);
$smarty->assign('cant', $files['cant']); ///FIXME
}
......
......@@ -17,7 +17,7 @@ function smarty_function_html_body_attributes($params, &$smarty) {
$onload = '';
$class = '';
$dblclickedit = $smarty->get_template_vars('dblclickedit');
$dblclickedit = $smarty->getTemplateVars('dblclickedit');
if (isset($section) && $section == 'wiki page' && $prefs['user_dbl'] == 'y' and $dblclickedit == 'y' and $tiki_p_edit == 'y') {
$back .= ' ondblclick="location.href=\'tiki-editpage.php?page='.rawurlencode($page).'\';"';
......
......@@ -50,9 +50,9 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
function smarty_function_html_select_date($params, &$smarty)
{
global $tikilib; // TIKI
require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
require_once $smarty->_get_plugin_filepath('shared','make_timestamp');
require_once $smarty->_get_plugin_filepath('function','html_options');
$smarty->loadPlugin('smarty_shared_escape_special_chars');
$smarty->loadPlugin('smarty_shared_make_timestamp');
$smarty->loadPlugin('smarty_function_html_options');
/* Default values. */
$prefix = "Date_";
$start_year = strftime("%Y");
......
......@@ -29,7 +29,7 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
function smarty_function_html_select_duration($params, &$smarty)
{
global $smarty;
require_once $smarty->_get_plugin_filepath('function','html_options');
$smarty->loadPlugin('smarty_function_html_options');
$html_result = '';
$default = array('prefix'=>'Duration_', 'default_unit'=>'week', 'default'=>'', 'default_value'=>'');
$params = array_merge($default, $params);
......
......@@ -34,8 +34,8 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
function smarty_function_html_select_time($params, &$smarty)
{
global $tikilib;
require_once $smarty->_get_plugin_filepath('shared','make_timestamp');
require_once $smarty->_get_plugin_filepath('function','html_options');
$smarty->loadPlugin('smarty_shared_make_timestamp');
$smarty->loadPlugin('smarty_function_html_options');
/* Default values. */
$prefix = "Time_";
$time = time();
......
......@@ -89,7 +89,7 @@ function smarty_function_icon($params, &$smarty) {
global $url_path, $base_url, $tikipath, $tikilib;
// Include smarty functions used below
require_once $smarty->_get_plugin_filepath('function', 'html_image');
$smarty->loadPlugin('smarty_function_html_image');
// auto-detect 'alt' param if not set
if ( ! isset($params['alt']) ) {
......
......@@ -23,8 +23,8 @@ function smarty_function_initials_filter_links($params, &$smarty) {
// Include smarty functions used below
global $smarty;
require_once $smarty->_get_plugin_filepath('block', 'ajax_href');
require_once $smarty->_get_plugin_filepath('function', 'query');
$smarty->loadPlugin('smarty_block_ajax_href');
$smarty->loadPlugin('smarty_function_query');
$tag_start = "\n".'<a class="'.$params['_class'].'" '.smarty_block_ajax_href(
array('template' => $params['_template'], 'htmlelement' => $params['_htmlelement']),
......
......@@ -25,7 +25,7 @@ function smarty_function_interactivetranslation($params, &$smarty) {
$strings = json_encode( $strings );
// add wrench icon link
require_once $smarty->_get_plugin_filepath('block', 'self_link');
$smarty->loadPlugin('smarty_block_self_link');
$help .= smarty_block_self_link(
array( '_icon'=>'wrench',
'_script'=>'tiki-edit_languages.php',
......
......@@ -41,11 +41,11 @@ function smarty_function_menu($params, &$smarty)
if (empty($translate)) {
$translate = 'y';
}
$smarty->assign_by_ref('translate', $translate);
$smarty->assignByRef('translate', $translate);
if (empty($menu_cookie)) {
$menu_cookie = 'y';
}
$smarty->assign_by_ref('menu_cookie', $menu_cookie);
$smarty->assignByRef('menu_cookie', $menu_cookie);
if ($css !== 'n' && $prefs['feature_cssmenus'] == 'y') {
static $idCssmenu = 0;
if (empty($type)) {
......
......@@ -21,7 +21,7 @@ function smarty_function_show_help($params, &$smarty)
global $help_sections;
if (count($help_sections)) {
$smarty->assign_by_ref('help_sections',$help_sections);
$smarty->assignByRef('help_sections',$help_sections);
return $smarty->fetch('tiki-show_help.tpl');
}
}
......@@ -16,7 +16,7 @@ function smarty_function_show_sort($params, &$smarty) {
if ( isset($_REQUEST[$params['sort']]) ) {
$p = $_REQUEST[$params['sort']];
} elseif ( $s = $smarty->get_template_vars($params['sort']) ) {
} elseif ( $s = $smarty->getTemplateVars($params['sort']) ) {
$p = $s;
}
......@@ -25,7 +25,7 @@ function smarty_function_show_sort($params, &$smarty) {
$order = substr($p, strrpos($p, '_') + 1);
if ( strtolower($prop) == strtolower(trim($params['var'])) ) {
require_once $smarty->_get_plugin_filepath('function', 'icon');
$smarty->loadPlugin('smarty_function_icon');
$icon_params = array('alt' => tra('Invert Sort'), 'style' => 'vertical-align:middle');