本文整理汇总了PHP中Smarty::assign_by_ref方法的典型用法代码示例。如果您正苦于以下问题:PHP Smarty::assign_by_ref方法的具体用法?PHP Smarty::assign_by_ref怎么用?PHP Smarty::assign_by_ref使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Smarty
的用法示例。
在下文中一共展示了Smarty::assign_by_ref方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Render
public function Render()
{
include_once 'libs/smartylibs/Smarty.class.php';
$smarty = new Smarty();
$smarty->template_dir = 'components/templates';
$smarty->assign_by_ref('Page', $this);
$users = $this->tableBasedGrantsManager->GetAllUsersAsJson();
$smarty->assign_by_ref('Users', $users);
$localizerCaptions = $this->GetLocalizerCaptions();
$smarty->assign_by_ref('Captions', $localizerCaptions);
/* $roles = $this->tableBasedGrantsManager->GetAllRolesAsJson();
$smarty->assign_by_ref('Roles', $roles); */
$headerString = 'Content-Type: text/html';
if ($this->GetContentEncoding() != null) {
StringUtils::AddStr($headerString, 'charset=' . $this->GetContentEncoding(), ';');
}
header($headerString);
$pageInfos = GetPageInfos();
$pageListViewData = array('Pages' => array(), 'CurrentPageOptions' => array());
foreach ($pageInfos as $pageInfo) {
$pageListViewData['Pages'][] = array('Caption' => $this->RenderText($pageInfo['caption']), 'Hint' => $this->RenderText($pageInfo['short_caption']), 'Href' => $pageInfo['filename'], 'GroupName' => $this->RenderText($pageInfo['group_name']), 'BeginNewGroup' => $pageInfo['add_separator']);
}
$pageGroups = GetPageGroups();
foreach ($pageGroups as &$pageGroup) {
$pageGroup = $this->RenderText($pageGroup);
}
$pageListViewData['Groups'] = $pageGroups;
$smarty->assign_by_ref('PageList', $pageListViewData);
$authenticationViewData = $this->GetAuthenticationViewData();
$smarty->assign_by_ref('Authentication', $authenticationViewData);
$smarty->display('admin_panel.tpl');
}
示例2: _run
/**
* fetch a template, echos the result,
*
* @see Zend_View_Abstract::render()
* @param string $name the template
* @return void
*/
protected function _run()
{
$this->strictVars(true);
//assign variables to the template engine
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if ('_' != substr($key, 0, 1)) {
$this->_smarty->assign($key, $value);
}
}
//why 'this'?
//to emulate standard zend view functionality
//doesn't mess up smarty in any way
$this->_smarty->assign_by_ref('this', $this);
//smarty needs a template_dir, and can only use templates,
//found in that directory, so we have to strip it from the
// filename
//This checks the default application/smarty/template directory
// as well as the module views/scripts directory to find the
// template
$paths = $this->getScriptPaths();
$arg = func_get_arg(0);
foreach ($paths as $path) {
if (0 === strpos($arg, $path)) {
if ($file = substr($arg, strlen($path))) {
$this->_smarty->template_dir = $path;
break;
}
}
}
//process the template (and filter the output)
echo $this->_smarty->fetch($file);
}
示例3: renderFile
/**
* sfSmarty::renderFile()
* render template file using Smarty
*
* @param sfSmartyView $view
* @param mixed $file
* @return
* @access protected
**/
public function renderFile($view, $file)
{
$sf_context = sfContext::getInstance();
$sf_request = $sf_context->getRequest();
$sf_params = $sf_request->getParameterHolder();
$sf_user = $sf_context->getUser();
if ($view->getAttribute('sf_type') == 'layout') {
self::$smarty->compile_id = $view->getDecoratorTemplate();
} else {
self::$smarty->compile_id = $view->getModuleName();
}
$this->loadCoreAndStandardHelpers();
$_escaping = $view->getAttributeHolder()->getEscaping();
if ($_escaping === true || $_escaping == 'on') {
$sf_data = $this->getSfData($view, $view->getAttributeHolder()->getEscapingMethod());
} elseif ($_escaping === false || $_escaping == 'off') {
$sf_data = $this->getSfData($view);
$data =& $view->getAttributeHolder()->getAll();
foreach ($data as $key => &$value) {
self::$smarty->assign_by_ref($key, $value);
}
}
// we need to add the data to smarty
self::$smarty->assign_by_ref('sf_data', $sf_data);
// we need to add the context to smarty
self::$smarty->assign_by_ref('sf_context', $sf_context);
// we need to add the request to smarty
self::$smarty->assign_by_ref('sf_request', $sf_request);
// we need to add the params to smarty
self::$smarty->assign_by_ref('sf_params', $sf_params);
// we need to add the user to smarty
self::$smarty->assign_by_ref('sf_user', $sf_user);
return self::$smarty->fetch("file:{$file}");
}
示例4: _run
/**
* fetch a template, echos the result,
*
* @see Zend_View_Abstract::render()
* @param string $name the template
* @return void
*/
protected function _run()
{
$this->strictVars(true);
//assign variables to the template engine
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if ('_' != substr($key, 0, 1)) {
$this->_smarty->assign($key, $value);
}
}
//why 'this'?
//to emulate standard zend view functionality
//doesn't mess up smarty in any way
$this->_smarty->assign_by_ref('this', $this);
//smarty needs a template_dir, and can only use templates,
//found in that directory, so we have to strip it from the filename
$file = func_get_arg(0);
echo $this->_smarty->fetch($file);
//process the template (and filter the output)
}
示例5: smarty_factory
public static function smarty_factory()
{
if (!isset($_SERVER['smartybase'])) {
$_SERVER['smartybase'] = "/var/tmp/smarty-" . md5($_SERVER['SCRIPT_FILENAME']);
}
if (!lib::$appvars) {
lib::$appvars = array('filebase' => $_SERVER['filebase'], 'mediabase' => $_SERVER['mediabase'], 'uribase' => $_SERVER['uribase'], 'urirequest' => $_SERVER['urirequest']);
}
$smbase = $_SERVER['smartybase'];
#@mkdir("$smbase/templates", 0777, true);
@mkdir("{$smbase}/templates_c", 0777, true);
@mkdir("{$smbase}/cache", 0777, true);
$smarty = new Smarty();
$smarty->template_dir = "./views";
$smarty->compile_dir = "{$smbase}/templates_c";
$smarty->cache_dir = "{$smbase}/cache";
# we don't set config dir, we most likely won't use it initially
$smext = array('smarty_extensions', 'smarty_custom');
foreach ($smext as $smo) {
$mnames = get_class_methods($smo);
foreach ($mnames as $method) {
if (preg_match('/^func_(\\w+)$/', $method, $m)) {
$smarty->register_function($m[1], array($smo, $method));
} elseif (preg_match('/^modifier_(\\w+)$/', $method, $m)) {
$smarty->register_modifier($m[1], array($smo, $method));
} elseif (preg_match('/^block_(\\w+)$/', $method, $m)) {
$smarty->register_block($m[1], array($smo, $method));
}
}
}
# these are order dependent
$smarty->register_prefilter(array('smarty_extensions', 'prefilter_convert_loop_breaks'));
$smarty->register_prefilter(array('smarty_extensions', 'prefilter_convert_loop_continue'));
$smarty->assign_by_ref('app', lib::$appvars);
if (file_exists("setup/template_conf.php")) {
include "setup/template_conf.php";
}
return $smarty;
}
示例6: task
$C_list = new CORE_list();
$C_block = new CORE_block();
for ($i = 0; $i < count(@$_SERVER["argv"]); $i++) {
if (@$_SERVER["argv"][$i] == "_task=1") {
$VAR['_task'] = 1;
}
}
if (isset($VAR['_task'])) {
require_once PATH_MODULES . 'task/task.inc.php';
$task = new task();
$task->run_all();
exit;
}
$C_method->do_all();
if (isset($C_auth2) && $C_auth2 != false && defined("FORCE_SESS_ACCOUNT")) {
$smarty->assign("SESS_LOGGED", FORCE_SESS_LOGGED);
$smarty->assign("SESS_ACCOUNT", FORCE_SESS_ACCOUNT);
} else {
$smarty->assign("SESS_LOGGED", SESS_LOGGED);
$smarty->assign("SESS_ACCOUNT", SESS_ACCOUNT);
}
$smarty->assign_by_ref("method", $C_method);
$smarty->assign_by_ref("list", $C_list);
$smarty->assign_by_ref("block", $C_block);
$smarty->assign_by_ref("alert", $C_debug->alert);
$smarty->assign("VAR", $VAR);
$smarty->assign("SESS", SESS);
$smarty->assign("SSL_URL", SSL_URL);
$smarty->assign("URL", URL);
$C_theme = new CORE_theme();
ob_end_flush();
示例7: EasyDB
// Load other config file (temporary)
include "config.php";
// Connect to database
require 'includes/EasyDB.php';
$db = new EasyDB($dbhost, $dbuname, $dbpass, $dbname);
unset($dbhost, $dbuname, $dbpass, $dbname);
$misc = $db->FetchAll("SELECT * FROM `miscinfo`");
// Set up some variables
$page = array();
$data = array();
$input = array();
// Temporarily put team names here until a better place/way is found
$data['teamnames'] = array('R' => 'Red', 'G' => 'Green', 'B' => 'Blue', 'P' => 'Purple', 'O' => 'Observer', 'H' => 'Rabbit', 'X' => 'Rogue');
$page['theme'] = 'bluetangerine';
if (array_key_exists($_COOKIE['theme'], $config['themes'])) {
$page['theme'] = $_COOKIE['theme'];
}
$page['refresh'] = $_COOKIE['refresh'] == true;
$page['servername'] = $_SERVER['SERVER_NAME'];
$page['baseURL'] = 'http://' . $_SERVER['HTTP_HOST'] . '/';
$page['refreshed_date'] = date('D, M d H:i:s T Y', $misc[0]['lastrefreshed']);
$page['refreshed_epoch'] = $misc[0]['lastrefreshed'];
$page['refreshed_rfc2822'] = date('r', $misc[0]['lastrefreshed']);
$page['separator'] = '<div class="center">· · · · · · ·</div>';
// Set up Smarty Template Engine
include 'includes/smarty/Smarty.class.php';
$tpl = new Smarty();
$tpl->assign_by_ref('page', $page);
$tpl->assign_by_ref('data', $data);
$tpl->assign_by_ref('input', $input);
$tpl->assign('themes', $config['themes']);
示例8: load_plugins
if ($cfg['data_provider'] == 'redis') {
include HAMMOCK_ROOT . "/lib/data_redis.php";
} else {
include HAMMOCK_ROOT . "/lib/data_files.php";
}
include HAMMOCK_ROOT . "/lib/http.php";
include HAMMOCK_ROOT . "/lib/service.php";
include HAMMOCK_ROOT . "/lib/auth.php";
include HAMMOCK_ROOT . "/lib/smarty/Smarty.class.php";
if (!file_exists(HAMMOCK_ROOT . "/data/templates_c")) {
mkdir(HAMMOCK_ROOT . "/data/templates_c", 0777, true);
}
$smarty = new Smarty();
$smarty->template_dir = HAMMOCK_ROOT . "/templates";
$smarty->compile_dir = HAMMOCK_ROOT . "/data/templates_c";
$smarty->assign_by_ref('cfg', $cfg);
function load_plugins()
{
$GLOBALS['plugins'] = array();
$dir = HAMMOCK_ROOT . "/plugins";
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if (is_dir("{$dir}/{$file}") && is_file("{$dir}/{$file}/plugin.php")) {
if (include "{$dir}/{$file}/plugin.php") {
$GLOBALS['plugins'][$file] = 1;
}
}
}
closedir($dh);
}
$GLOBALS['plugins_services'] = array();
示例9: fopen
//exit(1);
echo "Generating tests truncate file\n";
$truncate = '<?xml version="1.0" encoding="UTF-8" ?>
<!-- Truncate all tables that will be used in the tests -->
<dataset>';
$tbls = array_keys($tables);
foreach ($tbls as $d => $t) {
$truncate = $truncate . "\n <{$t} />\n";
}
$truncate = $truncate . "</dataset>\n";
$ft = fopen($sqlCodePath . "../tests/phpunit/CiviTest/truncate.xml", "w");
fputs($ft, $truncate);
fclose($ft);
unset($ft);
unset($truncate);
$smarty->assign_by_ref('database', $database);
$smarty->assign_by_ref('tables', $tables);
$tmpArray = array_keys($tables);
$tmpArray = array_reverse($tmpArray);
$smarty->assign_by_ref('dropOrder', $tmpArray);
$smarty->assign('mysql', 'modern');
echo "Generating sql file\n";
$sql = $smarty->fetch('schema.tpl');
createDir($sqlCodePath);
$fd = fopen($sqlCodePath . "civicrm.mysql", "w");
fputs($fd, $sql);
fclose($fd);
echo "Generating sql drop tables file\n";
$sql = $smarty->fetch('drop.tpl');
createDir($sqlCodePath);
$fd = fopen($sqlCodePath . "civicrm_drop.mysql", "w");
示例10: application
/**
* Constructor
*
* @param Request $request
* @return ApplicationController
*/
function __construct($request)
{
parent::__construct($request);
// Set detault layout for application pages
$this->setLayout(array('module' => SYSTEM_MODULE, 'layout' => 'wireframe'));
// Get Smarty instance... We need it
$this->smarty =& Smarty::instance();
// Load and init owner company
$this->owner_company = get_owner_company();
if (instance_of($this->owner_company, 'Company')) {
cache_set('owner_company', $this->owner_company);
} else {
$this->httpError(HTTP_ERR_NOT_FOUND, 'Owner company is not defined');
}
// if
$this->application =& application();
$this->authentication =& Authentication::instance();
$this->logged_user =& $this->authentication->provider->getUser();
$this->wireframe =& Wireframe::instance();
$this->wireframe->page_company = $this->owner_company;
$this->theme_name = instance_of($this->logged_user, 'User') ? UserConfigOptions::getValue('theme', $this->logged_user) : ConfigOptions::getValue('theme');
$this->smarty->assign(array('root_url' => ROOT_URL, 'assets_url' => ASSETS_URL));
// Maintenance mode
if (ConfigOptions::getValue('maintenance_enabled')) {
if (instance_of($this->logged_user, 'User') && $this->logged_user->isAdministrator()) {
$this->wireframe->addPageMessage(lang('System is in maintenance mode and can be used by administrators only. <a href=":url">Click here</a> to turn off maintenance mode', array('url' => assemble_url('admin_settings_maintenance'))), 'warning');
} else {
$additional_error_info = ConfigOptions::getValue('maintenance_message');
if ($additional_error_info) {
$additional_error_info .= "\n\n";
}
// if
$additional_error_info .= lang('When system is in maintenance mode, administrators can log in and access the system') . ": " . assemble_url('login');
$this->smarty->assign('additional_error_info', $additional_error_info);
if ($this->restrict_access_in_maintenance_mode) {
$this->httpError(503);
}
// if
}
// if
}
// if
// Check permissions
if ($this->login_required && !instance_of($this->logged_user, 'User')) {
// If async don't redirect to loging, just server proper HTTP code
if ($this->request->isAsyncCall()) {
$this->httpError(HTTP_ERR_UNAUTHORIZED, null, true, true);
// Not async? Redirect to login with extracted route data...
} else {
$params = array();
if ($request->matched_route != 'login') {
$params['re_route'] = $request->matched_route;
foreach ($this->request->url_params as $k => $v) {
if ($k == 'module' || $k == 'controller' || $k == 'action') {
continue;
}
// if
$params["re_{$k}"] = $v;
}
// foreach
}
// if
$this->redirectTo($this->login_route, $params);
}
// if
}
// if
if (instance_of($this->logged_user, 'User') && !$this->logged_user->getSystemPermission('system_access')) {
$this->authentication->provider->logUserOut();
$this->httpError(HTTP_ERR_FORBIDDEN);
}
// if
$loaded_modules = $this->application->getModules();
$assets_query_string = 'v=' . $this->application->version . '&modules=';
foreach ($loaded_modules as $loaded_module) {
$assets_query_string .= $loaded_module->getName() . ',';
}
// foreach
$this->smarty->assign(array('api_status' => API_STATUS, 'application' => $this->application, 'owner_company' => $this->owner_company, 'authentication' => $this->authentication, 'logged_user' => $this->logged_user, 'request' => $this->request, 'theme_name' => $this->theme_name, 'request_time' => $this->request_time, 'loaded_modules' => $this->application->getModules(), 'captcha_url' => ROOT_URL . '/captcha.php?id=' . md5(time()), 'assets_query_string' => $assets_query_string, 'js_disabled_url' => assemble_url('js_disabled')));
$this->smarty->assign_by_ref('wireframe', $this->wireframe);
js_assign(array('homepage_url' => ROOT_URL, 'assets_url' => ASSETS_URL, 'indicator_url' => get_image_url('indicator.gif'), 'big_indicator_url' => get_image_url('indicator_big.gif'), 'ok_indicator_url' => get_image_url('ok_indicator.gif'), 'warning_indicator_url' => get_image_url('warning_indicator.gif'), 'error_indicator_url' => get_image_url('error_indicator.gif'), 'pending_indicator_url' => get_image_url('pending_indicator.gif'), 'url_base' => URL_BASE, 'keep_alive_interval' => KEEP_ALIVE_INTERVAL, 'refresh_session_url' => assemble_url('refresh_session'), 'jump_to_project_url' => assemble_url('jump_to_project_widget'), 'quick_add_url' => assemble_url('quick_add'), 'path_info_through_query_string' => PATH_INFO_THROUGH_QUERY_STRING, 'image_picker_url' => assemble_url('image_picker'), 'copyright_removed' => LICENSE_COPYRIGHT_REMOVED, 'custom_tabs_manager' => assemble_url('custom_tabs_manager'), 'add_milestone_url' => assemble_url('project_milestones_add', array('project_id' => '--PROJECT_ID--')), 'add_checklist_url' => assemble_url('project_checklists_add', array('project_id' => '--PROJECT_ID--')), 'add_discussion_url' => assemble_url('project_discussions_add', array('project_id' => '--PROJECT_ID--')), 'add_file_url' => assemble_url('project_files_upload', array('project_id' => '--PROJECT_ID--')), 'add_page_url' => assemble_url('project_pages_add', array('project_id' => '--PROJECT_ID--')), 'add_ticket_url' => assemble_url('project_tickets_add', array('project_id' => '--PROJECT_ID--')), 'add_timerecord_url' => assemble_url('project_time_add', array('project_id' => '--PROJECT_ID--')), 'attachment_rename_url' => assemble_url('attachment_rename', array('project_id' => '--PROJECT_ID--', 'attachment_id' => '--ATTACHMENT_ID--')), 'attachment_copy_to_url' => assemble_url('attachment_copy_to', array('project_id' => '--PROJECT_ID--', 'attachment_id' => '--ATTACHMENT_ID--')), 'attachment_move_to_url' => assemble_url('attachment_move_to', array('project_id' => '--PROJECT_ID--', 'attachment_id' => '--ATTACHMENT_ID--')), 'image_uploader_url' => assemble_url('image_uploader'), 'render_comments_url' => assemble_url('render_comments'), 'move_task_url' => assemble_url('project_task_move', array('project_id' => '--PROJECT_ID--', 'task_id' => '--TASK_ID--')), 'get_collection_url' => assemble_url('collection'), 'quick_task_reminder_url' => assemble_url('project_task_quickreminder', array('project_id' => '--PROJECT_ID--', 'task_id' => '--TASK_ID--')), 'convert_to_ticket_url' => assemble_url('project_object_convert_to_ticket', array('project_id' => '--PROJECT_ID--', 'object_id' => '--OBJECT_ID--')), 'convert_to_milestone_url' => assemble_url('project_object_convert_to_milestone', array('project_id' => '--PROJECT_ID--', 'object_id' => '--OBJECT_ID--')), 'convert_to_page_url' => assemble_url('project_object_convert_to_page', array('project_id' => '--PROJECT_ID--', 'object_id' => '--OBJECT_ID--')), 'snooze_task_url' => assemble_url('project_task_snooze', array('project_id' => '--PROJECT_ID--', 'task_id' => '--TASK_ID--'))));
if ($this->logged_user) {
$link = mysql_connect(DB_HOST, DB_USER, DB_PASS);
mysql_select_db(DB_NAME);
if (!empty($_SESSION['pg_ttl'])) {
mysql_query("update healingcrystals_user_visited_pages set title='" . mysql_real_escape_string($_SESSION['pg_ttl']) . "' where user_id='" . $this->logged_user->getId() . "' and access_time='" . date('Y-m-d H:i:s', $_SESSION['temp_time']) . "'");
}
$current_url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
$pos = strpos($_SERVER['QUERY_STRING'], '%2F');
if ($pos !== false) {
$max_pages_count_per_user = 50;
//require_once SMARTY_PATH . '/plugins/function.page_title.php';
//$current_page_title = smarty_function_page_title(array('default' => 'Projects'));
//$current_page_title = PageConstruction::getPageTitle();
//.........这里部分代码省略.........
示例11: CDatabase
<?php
//инициализируем класс БД
require PATH_CORE . 'database/database.php';
$oDb = new CDatabase('mysql', 'mysql:host=' . DB_HOST_SYSGEN . ';dbname=' . DB_NAME_SYSGEN, DB_USER_SYSGEN, DB_PASS_SYSGEN);
//$oDb = new CDatabase('pgsql', 'pgsql:port=5432 dbname='.DB_NAME_SYSGEN, DB_USER_SYSGEN, DB_PASS_SYSGEN);
$oDb->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$oDb->connect();
//инициализируем Config
config::load();
$oConfig =& config::$data;
if (BFF_DEBUG || FORDEV) {
include PATH_CORE . 'vardump.php';
$oDb->bShowStatistic = true;
$oDb->bMakeStatistic = true;
}
//инициализируем Smarty
require PATH_CORE . 'external/smarty/smarty.class.php';
$oSm = new Smarty();
$oSm->force_compile = false;
$oSm->compile_check = true;
$oSm->debugging = false;
$oSm->compile_dir = PATH_BASE . 'tpl_c';
$oSm->config_dir = PATH_BASE . 'config';
$oSm->plugins_dir = array('plugins', 'plugins/bff');
Module::adminCustomCenterArea(false);
$oSm->assign('fordev', FORDEV);
$oSm->assign('site_url', SITEURL);
$oSm->assign_by_ref('config', $oConfig);
示例12: Smarty
* The form is ready to be processed, just output it again as read only to
* display the submitted values. A real form processing script usually may
* do something else like storing the form values in a database.
*/
$form->ReadOnly = 1;
}
/*
* Create the Smarty engine object to process the form template first
*
* NOTE: the form template needs to be processed separately from any other
* page templates to prevent that the form prefilter interferes with the
* normal processing of the other templates
*/
$smarty = new Smarty();
if ($smarty->template_exists("form.tpl")) {
$smarty->assign_by_ref("form", $form);
$smarty->assign("title", "Form class test");
$smarty->assign("error_message", $error_message);
$smarty->assign_by_ref("verify", $verify);
$smarty->assign("doit", $doit);
$smarty->assign("mark", "[Verify]");
$smarty->assign("credit_card_field", "credit_card_number");
$smarty->register_prefilter("smarty_prefilter_form");
$smarty->fetch("form.tpl");
$smarty->unregister_prefilter("smarty_prefilter_form");
} else {
$form->AddDataPart("<h2><center>Please copy the template file <tt>templates/form.tpl</tt> to your Smarty <tt>templates</tt> directory.</center></h2>\n");
$doit = 1;
}
/*
* If the form was not submitted or was not valid, make the page ONLOAD
示例13: array
$fullinput_value .= ":" . max_min($maxminbrws_fld_C, "min", 0);
$fullinput_value2 .= ":" . max_min($maxminbrws_fld_C, "max", 1);
// $fullinput_value .= ":3";
// $fullinput_value2 .= ":6";
$fullinput_alph .= ":" . $browse_field_C;
}
// end if
if ($aliasname != "") {
$or_input = " " . $strings['or'] . " [" . $fullinput_alph . "]";
} else {
$or_input = "";
}
// end else
// $versecounteralph = chr($printversecounter);
// $printversecounter++;
$smarty->assign_by_ref('printversecounter', $printversecounter);
$smarty->assign('fullinput_value', $fullinput_value);
$smarty->assign('fullinput_value2', $fullinput_value2);
$smarty->assign('or_input', $or_input);
// } // end if
/////////////////Call the function to display the input boxes for which range of verses one wishes to browse////////////////////
$levels = array('blevela', 'blevelb', 'blevelc', 'elevela', 'elevelb', 'elevelc');
$max_arr_all = array(verse_selection(array($browse_field_A, $browse_field_B, $browse_field_C), array($textdirecA, $textdirecB, $textdirecC), array($maxminbrws_fld_A, $maxminbrws_fld_B, $maxminbrws_fld_C), $levels, 1));
/// Fix: This was designed to add an indefinite number of "or" options if one were to give the option to browse by more than 2 fields (perhaps the Collins database could use this?). browse9.php also should be fixed when testing to see if these blevela2+ items exist already or not. Do this also for browse_levels 2 and 3 or if any more levels are ever needed (dynamically added?!?--I hope they are not necessary since it is rather complicated to delineate all the possibilities!!!)
// Look for a field shortcut; if none, use the default.
$maxminbrws_fld_A = $browse_field_A;
$maxminbrws_fld_B = $browse_field_B;
$maxminbrws_fld_C = $browse_field_C;
localize_fields($browse_field_A, $fieldface);
$browse_field_A = $fieldshortcut;
$textdirecA = $textdirec;
示例14: array
$input = array();
// Used to contain messages
$messages = array();
// Used to trigger invalid color highlights
$invalid = array();
// Per-page information
$page = array();
// Smarty Template System
if (defined('USING_SMARTY') && USING_SMARTY) {
// Load Smarty
require $config['paths']['includes'] . 'smarty/Smarty.class.php';
// Create a new Smarty object
$tpl = new Smarty();
// This is where uncompiled template files are located
$tpl->template_dir = $config['paths']['templates'];
// This is where compiled templates are stored
$tpl->compile_dir = $config['paths']['templates_c'];
// Assign the configuration to Smarty
// TODO: Once we have DB support, remove those from the config array
// before assigning this to Smarty.
$tpl->assign('config', $config);
// Assign several variables by reference, since they may/will change during
// script execution
$tpl->assign_by_ref('user', $user);
$tpl->assign_by_ref('input', $input);
$tpl->assign_by_ref('messages', $messages);
$tpl->assign_by_ref('invalid', $invalid);
$tpl->assign_by_ref('page', $page);
$tpl->assign_by_ref('data', $data);
$tpl->assign('lang', $lang);
}
示例15: assign_by_ref
public function assign_by_ref($tpl_var, &$value, $nocache = false)
{
if (method_exists($this, "assignByRef")) {
return $this->assignByRef($tpl_var, $value, $nocache);
} else {
return parent::assign_by_ref($tpl_var, $value);
}
}