本文整理汇总了PHP中Xtempl::assign_function方法的典型用法代码示例。如果您正苦于以下问题:PHP Xtempl::assign_function方法的具体用法?PHP Xtempl::assign_function怎么用?PHP Xtempl::assign_function使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xtempl
的用法示例。
在下文中一共展示了Xtempl::assign_function方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DisplayMasterTableInfo_BranchMaster
function DisplayMasterTableInfo_BranchMaster($params)
{
global $cman;
$detailtable = $params["detailtable"];
$keys = $params["keys"];
$xt = new Xtempl();
$tName = "BranchMaster";
$xt->eventsObject = getEventObject($tName);
$settings = new ProjectSettings($tName, PAGE_LIST);
$cipherer = new RunnerCipherer($tName);
$connection = $cman->byTable($tName);
$masterQuery = $settings->getSQLQuery();
$viewControls = new ViewControlsContainer($settings, PAGE_LIST);
$where = "";
$keysAssoc = array();
$showKeys = "";
if ($detailtable == "Fact_SalesTransaction") {
$keysAssoc["GroupID"] = $keys[1 - 1];
$keysAssoc["CompanyID"] = $keys[2 - 1];
$where .= RunnerPage::_getFieldSQLDecrypt("GroupID", $connection, $settings, $cipherer) . "=" . $cipherer->MakeDBValue("GroupID", $keys[1 - 1], "", true);
$keyValue = $viewControls->showDBValue("GroupID", $keysAssoc);
$showKeys .= " " . GetFieldLabel("BranchMaster", "GroupID") . ": " . $keyValue;
$where .= " and ";
$showKeys .= " , ";
$where .= RunnerPage::_getFieldSQLDecrypt("CompanyID", $connection, $settings, $cipherer) . "=" . $cipherer->MakeDBValue("CompanyID", $keys[2 - 1], "", true);
$keyValue = $viewControls->showDBValue("CompanyID", $keysAssoc);
$showKeys .= " " . GetFieldLabel("BranchMaster", "CompanyID") . ": " . $keyValue;
$xt->assign('showKeys', $showKeys);
}
if (!$where) {
return;
}
$str = SecuritySQL("Search", $tName);
if (strlen($str)) {
$where .= " and " . $str;
}
$strWhere = whereAdd($masterQuery->WhereToSql(), $where);
if (strlen($strWhere)) {
$strWhere = " where " . $strWhere . " ";
}
$strSQL = $masterQuery->HeadToSql() . ' ' . $masterQuery->FromToSql() . $strWhere . $masterQuery->TailToSql();
LogInfo($strSQL);
$data = $cipherer->DecryptFetchedArray($connection->query($strSQL)->fetchAssoc());
if (!$data) {
return;
}
// reassign pagetitlelabel function adding extra params
$xt->assign_function("pagetitlelabel", "xt_pagetitlelabel", array("record" => $data, "settings" => $settings));
$keylink = "";
$xt->assign("BranchCloudFolder_mastervalue", $viewControls->showDBValue("BranchCloudFolder", $data, $keylink));
$format = $settings->getViewFormat("BranchCloudFolder");
$class = " rnr-field-text";
if ($format == FORMAT_FILE) {
$class = ' rnr-field-file';
}
if ($format == FORMAT_AUDIO) {
$class = ' rnr-field-audio';
}
if ($format == FORMAT_CHECKBOX) {
$class = ' rnr-field-checkbox';
}
if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("BranchCloudFolder"))) {
$class = ' rnr-field-number';
}
$xt->assign("BranchCloudFolder_class", $class);
// add class for field header as field value
$xt->assign("BranchLastSyncDate_mastervalue", $viewControls->showDBValue("BranchLastSyncDate", $data, $keylink));
$format = $settings->getViewFormat("BranchLastSyncDate");
$class = " rnr-field-text";
if ($format == FORMAT_FILE) {
$class = ' rnr-field-file';
}
if ($format == FORMAT_AUDIO) {
$class = ' rnr-field-audio';
}
if ($format == FORMAT_CHECKBOX) {
$class = ' rnr-field-checkbox';
}
if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("BranchLastSyncDate"))) {
$class = ' rnr-field-number';
}
$xt->assign("BranchLastSyncDate_class", $class);
// add class for field header as field value
$xt->assign("l_mastervalue", $viewControls->showDBValue("l", $data, $keylink));
$format = $settings->getViewFormat("l");
$class = " rnr-field-text";
if ($format == FORMAT_FILE) {
$class = ' rnr-field-file';
}
if ($format == FORMAT_AUDIO) {
$class = ' rnr-field-audio';
}
if ($format == FORMAT_CHECKBOX) {
$class = ' rnr-field-checkbox';
}
if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("l"))) {
$class = ' rnr-field-number';
}
$xt->assign("l_class", $class);
// add class for field header as field value
//.........这里部分代码省略.........
示例2: DisplayMasterTableInfo_GE_ESTADO_CIVIL
function DisplayMasterTableInfo_GE_ESTADO_CIVIL($params)
{
global $cman;
$detailtable = $params["detailtable"];
$keys = $params["keys"];
$xt = new Xtempl();
$tName = "GE.ESTADO_CIVIL";
$settings = new ProjectSettings($tName, PAGE_LIST);
$cipherer = new RunnerCipherer($tName);
$connection = $cman->byTable($tName);
$masterQuery = $settings->getSQLQuery();
$viewControls = new ViewControlsContainer($settings, PAGE_LIST);
$where = "";
$keysAssoc = array();
$showKeys = "";
if ($detailtable == "GE.PERSONA_DISPONIBLE") {
$keysAssoc["ESTADO_CIVIL_ID"] = $keys[1 - 1];
$where .= RunnerPage::_getFieldSQLDecrypt("ESTADO_CIVIL_ID", $connection, $settings, $cipherer) . "=" . $cipherer->MakeDBValue("ESTADO_CIVIL_ID", $keys[1 - 1], "", true);
$keyValue = $viewControls->showDBValue("ESTADO_CIVIL_ID", $keysAssoc);
$showKeys .= " " . GetFieldLabel("GE_ESTADO_CIVIL", "ESTADO_CIVIL_ID") . ": " . $keyValue;
$xt->assign('showKeys', $showKeys);
}
if (!$where) {
return;
}
$str = SecuritySQL("Search");
if (strlen($str)) {
$where .= " and " . $str;
}
$strWhere = whereAdd($masterQuery->WhereToSql(), $where);
if (strlen($strWhere)) {
$strWhere = " where " . $strWhere . " ";
}
$strSQL = $masterQuery->HeadToSql() . ' ' . $masterQuery->FromToSql() . $strWhere . $masterQuery->TailToSql();
LogInfo($strSQL);
$data = $cipherer->DecryptFetchedArray($connection->query($strSQL)->fetchAssoc());
if (!$data) {
return;
}
// reassign pagetitlelabel function adding extra params
$xt->assign_function("pagetitlelabel", "xt_pagetitlelabel", array("record" => $data, "settings" => $settings));
$keylink = "";
$keylink .= "&key1=" . runner_htmlspecialchars(rawurlencode(@$data["ESTADO_CIVIL_ID"]));
$xt->assign("ESTADO_CIVIL_ID_mastervalue", $viewControls->showDBValue("ESTADO_CIVIL_ID", $data, $keylink));
$format = $settings->getViewFormat("ESTADO_CIVIL_ID");
$class = " rnr-field-text";
if ($format == FORMAT_FILE) {
$class = ' rnr-field-file';
}
if ($format == FORMAT_AUDIO) {
$class = ' rnr-field-audio';
}
if ($format == FORMAT_CHECKBOX) {
$class = ' rnr-field-checkbox';
}
if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("ESTADO_CIVIL_ID"))) {
$class = ' rnr-field-number';
}
$xt->assign("ESTADO_CIVIL_ID_class", $class);
// add class for field header as field value
$xt->assign("NOMBRE_mastervalue", $viewControls->showDBValue("NOMBRE", $data, $keylink));
$format = $settings->getViewFormat("NOMBRE");
$class = " rnr-field-text";
if ($format == FORMAT_FILE) {
$class = ' rnr-field-file';
}
if ($format == FORMAT_AUDIO) {
$class = ' rnr-field-audio';
}
if ($format == FORMAT_CHECKBOX) {
$class = ' rnr-field-checkbox';
}
if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("NOMBRE"))) {
$class = ' rnr-field-number';
}
$xt->assign("NOMBRE_class", $class);
// add class for field header as field value
$xt->assign("FEC_CREACION_mastervalue", $viewControls->showDBValue("FEC_CREACION", $data, $keylink));
$format = $settings->getViewFormat("FEC_CREACION");
$class = " rnr-field-text";
if ($format == FORMAT_FILE) {
$class = ' rnr-field-file';
}
if ($format == FORMAT_AUDIO) {
$class = ' rnr-field-audio';
}
if ($format == FORMAT_CHECKBOX) {
$class = ' rnr-field-checkbox';
}
if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("FEC_CREACION"))) {
$class = ' rnr-field-number';
}
$xt->assign("FEC_CREACION_class", $class);
// add class for field header as field value
$xt->assign("USUARIO_CREACION_mastervalue", $viewControls->showDBValue("USUARIO_CREACION", $data, $keylink));
$format = $settings->getViewFormat("USUARIO_CREACION");
$class = " rnr-field-text";
if ($format == FORMAT_FILE) {
$class = ' rnr-field-file';
}
//.........这里部分代码省略.........
示例3: DisplayMasterTableInfoForPrint_calendar_table
function DisplayMasterTableInfoForPrint_calendar_table($params)
{
global $cman;
$detailtable = $params["detailtable"];
$keys = $params["keys"];
$xt = new Xtempl();
$tName = "calendar_table";
$xt->eventsObject = getEventObject($tName);
$cipherer = new RunnerCipherer($tName);
$settings = new ProjectSettings($tName, PAGE_PRINT);
$connection = $cman->byTable($tName);
$masterQuery = $settings->getSQLQuery();
$viewControls = new ViewControlsContainer($settings, PAGE_PRINT);
$where = "";
$keysAssoc = array();
$showKeys = "";
if ($detailtable == "Fact_SalesTransaction") {
$keysAssoc["dt"] = $keys[1 - 1];
$where .= RunnerPage::_getFieldSQLDecrypt("dt", $connection, $settings, $cipherer) . "=" . $cipherer->MakeDBValue("dt", $keys[1 - 1], "", true);
$keyValue = $viewControls->showDBValue("dt", $keysAssoc);
$showKeys .= " " . GetFieldLabel("calendar_table", "dt") . ": " . $keyValue;
$xt->assign('showKeys', $showKeys);
}
if ($detailtable == "Current Year Sales") {
$keysAssoc["dt"] = $keys[1 - 1];
$where .= RunnerPage::_getFieldSQLDecrypt("dt", $connection, $settings, $cipherer) . "=" . $cipherer->MakeDBValue("dt", $keys[1 - 1], "", true);
$keyValue = $viewControls->showDBValue("dt", $keysAssoc);
$showKeys .= " " . GetFieldLabel("calendar_table", "dt") . ": " . $keyValue;
$xt->assign('showKeys', $showKeys);
}
if (!$where) {
return;
}
$str = SecuritySQL("Export", $tName);
if (strlen($str)) {
$where .= " and " . $str;
}
$strWhere = whereAdd($masterQuery->m_where->toSql($masterQuery), $where);
if (strlen($strWhere)) {
$strWhere = " where " . $strWhere . " ";
}
$strSQL = $masterQuery->HeadToSql() . ' ' . $masterQuery->FromToSql() . $strWhere . $masterQuery->TailToSql();
LogInfo($strSQL);
$data = $cipherer->DecryptFetchedArray($connection->query($strSQL)->fetchAssoc());
if (!$data) {
return;
}
// reassign pagetitlelabel function adding extra params
$xt->assign_function("pagetitlelabel", "xt_pagetitlelabel", array("record" => $data, "settings" => $settings));
$keylink = "";
$keylink .= "&key1=" . runner_htmlspecialchars(rawurlencode(@$data["dt"]));
$xt->assign("dt_mastervalue", $viewControls->showDBValue("dt", $data, $keylink));
$format = $settings->getViewFormat("dt");
$class = " rnr-field-text";
if ($format == FORMAT_FILE) {
$class = ' rnr-field-file';
}
if ($format == FORMAT_AUDIO) {
$class = ' rnr-field-audio';
}
if ($format == FORMAT_CHECKBOX) {
$class = ' rnr-field-checkbox';
}
if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("dt"))) {
$class = ' rnr-field-number';
}
$xt->assign("dt_class", $class);
// add class for field header as field value
$xt->assign("y_mastervalue", $viewControls->showDBValue("y", $data, $keylink));
$format = $settings->getViewFormat("y");
$class = " rnr-field-text";
if ($format == FORMAT_FILE) {
$class = ' rnr-field-file';
}
if ($format == FORMAT_AUDIO) {
$class = ' rnr-field-audio';
}
if ($format == FORMAT_CHECKBOX) {
$class = ' rnr-field-checkbox';
}
if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("y"))) {
$class = ' rnr-field-number';
}
$xt->assign("y_class", $class);
// add class for field header as field value
$xt->assign("q_mastervalue", $viewControls->showDBValue("q", $data, $keylink));
$format = $settings->getViewFormat("q");
$class = " rnr-field-text";
if ($format == FORMAT_FILE) {
$class = ' rnr-field-file';
}
if ($format == FORMAT_AUDIO) {
$class = ' rnr-field-audio';
}
if ($format == FORMAT_CHECKBOX) {
$class = ' rnr-field-checkbox';
}
if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("q"))) {
$class = ' rnr-field-number';
}
//.........这里部分代码省略.........
示例4: setDetailChartOnEditView
/**
* @param String cartTName
* @param Number chartId
* @param &Array data
*/
protected function setDetailChartOnEditView($cartTName, $chartId, &$data)
{
global $useFlashChartLibrary;
include_once getabspath('classes/chartpage.php');
$xt = new Xtempl(true);
//#9607 1. Temporary fix
$options = array();
$options["xt"] =& $xt;
$options["id"] = $chartId;
$options["tName"] = $cartTName;
$options["mode"] = CHART_DETAILS;
//
$options["pageType"] = PAGE_CHART;
$options["masterTable"] = $this->tName;
$options["flyId"] = $this->genId() + 1;
//fix it
$mkr = 1;
$mKeys = $this->pSet->getMasterKeysByDetailTable($cartTName);
foreach ($mKeys as $mk) {
$options["masterKeysReq"][$mkr++] = $data[$mk];
}
$masterKeysReq = $options["masterKeysReq"];
if (count($masterKeysReq)) {
// copy keys to session
for ($i = 1; $i <= count($masterKeysReq); $i++) {
$_SESSION[$cartTName . "_masterkey" . $i] = $masterKeysReq[$i];
}
if (isset($_SESSION[$cartTName . "_masterkey" . $i])) {
unset($_SESSION[$cartTName . "_masterkey" . $i]);
}
}
$chartPageObject = new ChartPage($options);
$chartPageObject->init();
$chartXtParams["id"] = $options["flyId"];
$chartXtParams["table"] = $cartTName;
$chartXtParams["ctype"] = $chartPageObject->pSet->getChartType();
$chartXtParams["chartname"] = $chartPageObject->shortTableName;
$chartXtParams["singlePage"] = true;
$xt->assign_function($chartPageObject->shortTableName . "_chart", "xt_showchart", $chartXtParams);
$xt->assign("body", $chartPageObject->body);
$xt->assign("chart_block", true);
$chartPageObject->addControlsJSAndCSS();
$chartPageObject->fillSetCntrlMaps();
$this->AddJSFile('libs/js/AnyChart.js');
$this->AddJSFile('libs/js/AnyChartHTML5.js');
$this->copyDetailPreviewJSAndCSS($chartPageObject);
$this->assignDisplayDetailTableXtVariable($chartPageObject);
//add detail settings to master settings
$this->updateSettingsWidthDPData($chartPageObject);
$this->viewControlsMap["dViewControlsMap"][$cartTName] = $chartPageObject->viewControlsMap;
$this->controlsMap["dControlsMap"][$cartTName] = $chartPageObject->controlsMap;
$this->controlsMap["dControlsMap"]["useFlashChartLibrary"] = $useFlashChartLibrary;
$this->controlsMap["dpTablesParams"][] = array("tName" => $cartTName, "id" => $options['id'], "pType" => PAGE_CHART, "pParam" => $chartXtParams);
}
示例5: DisplayMasterTableInfoForPrint_GE_PERSONA_DISPONIBLE
//.........这里部分代码省略.........
$xt->assign('showKeys', $showKeys);
}
if ($detailtable == "GE.PERSONA_DISPONIBLEXMASCOTA") {
$keysAssoc["USERNAME"] = $keys[1 - 1];
$keysAssoc["ES_REAL"] = $keys[2 - 1];
$where .= RunnerPage::_getFieldSQLDecrypt("USERNAME", $connection, $settings, $cipherer) . "=" . $cipherer->MakeDBValue("USERNAME", $keys[1 - 1], "", true);
$keyValue = $viewControls->showDBValue("USERNAME", $keysAssoc);
$showKeys .= " " . GetFieldLabel("GE_PERSONA_DISPONIBLE", "USERNAME") . ": " . $keyValue;
$where .= " and ";
$showKeys .= " , ";
$where .= RunnerPage::_getFieldSQLDecrypt("ES_REAL", $connection, $settings, $cipherer) . "=" . $cipherer->MakeDBValue("ES_REAL", $keys[2 - 1], "", true);
$keyValue = $viewControls->showDBValue("ES_REAL", $keysAssoc);
$showKeys .= " " . GetFieldLabel("GE_PERSONA_DISPONIBLE", "ES_REAL") . ": " . $keyValue;
$xt->assign('showKeys', $showKeys);
}
if (!$where) {
return;
}
$str = SecuritySQL("Export");
if (strlen($str)) {
$where .= " and " . $str;
}
$strWhere = whereAdd($masterQuery->m_where->toSql($masterQuery), $where);
if (strlen($strWhere)) {
$strWhere = " where " . $strWhere . " ";
}
$strSQL = $masterQuery->HeadToSql() . ' ' . $masterQuery->FromToSql() . $strWhere . $masterQuery->TailToSql();
LogInfo($strSQL);
$data = $cipherer->DecryptFetchedArray($connection->query($strSQL)->fetchAssoc());
if (!$data) {
return;
}
// reassign pagetitlelabel function adding extra params
$xt->assign_function("pagetitlelabel", "xt_pagetitlelabel", array("record" => $data, "settings" => $settings));
$keylink = "";
$keylink .= "&key1=" . runner_htmlspecialchars(rawurlencode(@$data["USERNAME"]));
$keylink .= "&key2=" . runner_htmlspecialchars(rawurlencode(@$data["ES_REAL"]));
$xt->assign("USERNAME_mastervalue", $viewControls->showDBValue("USERNAME", $data, $keylink));
$format = $settings->getViewFormat("USERNAME");
$class = " rnr-field-text";
if ($format == FORMAT_FILE) {
$class = ' rnr-field-file';
}
if ($format == FORMAT_AUDIO) {
$class = ' rnr-field-audio';
}
if ($format == FORMAT_CHECKBOX) {
$class = ' rnr-field-checkbox';
}
if ($format == FORMAT_NUMBER || IsNumberType($settings->getFieldType("USERNAME"))) {
$class = ' rnr-field-number';
}
$xt->assign("USERNAME_class", $class);
// add class for field header as field value
$xt->assign("ES_REAL_mastervalue", $viewControls->showDBValue("ES_REAL", $data, $keylink));
$format = $settings->getViewFormat("ES_REAL");
$class = " rnr-field-text";
if ($format == FORMAT_FILE) {
$class = ' rnr-field-file';
}
if ($format == FORMAT_AUDIO) {
$class = ' rnr-field-audio';
}
if ($format == FORMAT_CHECKBOX) {
$class = ' rnr-field-checkbox';
}