本文整理汇总了PHP中Expression::evaluateExpression方法的典型用法代码示例。如果您正苦于以下问题:PHP Expression::evaluateExpression方法的具体用法?PHP Expression::evaluateExpression怎么用?PHP Expression::evaluateExpression使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Expression
的用法示例。
在下文中一共展示了Expression::evaluateExpression方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getStyle
protected function getStyle()
{
$formobj = $this->getFormObj();
$htmlClass = Expression::evaluateExpression($this->m_cssClass, $formobj);
$htmlClass = "CLASS='{$htmlClass}'";
if (!$htmlClass) {
$htmlClass = null;
}
$style = '';
if ($this->m_Style) {
$style .= $this->m_Style;
}
if (!isset($style) && !$htmlClass) {
return null;
}
if (isset($style)) {
$style = Expression::evaluateExpression($style, $formobj);
$style = "STYLE='{$style}'";
}
if ($formobj->m_Errors[$this->m_Name]) {
$htmlClass = "CLASS='" . $this->m_cssErrorClass . "'";
}
if ($htmlClass) {
$style = $htmlClass . " " . $style;
}
return $style;
}
示例2: render
/**
* Render, draw the control according to the mode
*
* @return string HTML text
*/
public function render()
{
$value = $this->m_Value ? $this->m_Value : $this->getText();
$disabledStr = $this->getEnabled() == "N" ? "READONLY=\"true\"" : "";
$style = $this->getStyle();
$func = $this->getFunction();
$optionList = $this->renderList();
$htmlClass = Expression::evaluateExpression($this->m_cssClass, $formobj);
$htmlClass = "CLASS='{$htmlClass}'";
$sHTML .= "<div class=\"div_" . $this->m_cssClass . "\" style=\"float:left;\">";
if ($this->m_ReadOnly == 'Y') {
$display_input = "style=\"display:none;\"";
$display_span = "";
} else {
$display_span = "style=\"display:none;\"";
$display_input = "";
}
$sHTML .= "<div {$display_span}>";
$sHTML .= "<span ID=\"span_" . $this->m_Name . "\" {$this->m_HTMLAttr} {$style}\n\t\t \t\t\tonclick=\"if(\$('" . $this->m_Name . "_list').visible()){\$('" . $this->m_Name . "_list').hide();\$('" . $this->m_Name . "').className='" . $this->m_cssClass . "'}else{\$('" . $this->m_Name . "_list').show();\$('" . $this->m_Name . "').className='" . $this->m_cssFocusClass . "'}\"\n\t\t \t\t\tonmouseover=\"\$('span_" . $this->m_Name . "').className='" . $this->m_cssHoverClass . "'\"\n\t\t \t\t\tonmouseout=\"\$('span_" . $this->m_Name . "').className='" . $this->m_cssClass . "'\"\n\t\t \t\t\t>" . $this->m_DefaultDisplayValue . "</span>";
$sHTML .= "</div>";
$sHTML .= "<div {$display_input}>";
$sHTML .= "<INPUT NAME=\"" . $this->m_Name . "\" ID=\"" . $this->m_Name . "\" VALUE=\"" . $value . "\" {$disabledStr} {$this->m_HTMLAttr} {$style} {$func}\n\t\t \t\t\tonclick=\"if(\$('" . $this->m_Name . "_list').visible()){\$('" . $this->m_Name . "_list').hide();\$('" . $this->m_Name . "').className='" . $this->m_cssClass . "'}else{\$('" . $this->m_Name . "_list').show();\$('" . $this->m_Name . "').className='" . $this->m_cssFocusClass . "'}\"\n\t\t \t\t\tonmouseover=\"\$('" . $this->m_Name . "').className='" . $this->m_cssHoverClass . "'\"\n\t\t \t\t\tonmouseout=\"\$('" . $this->m_Name . "').className='" . $this->m_cssClass . "'\"\n\t\t \t\t\t/>";
$sHTML .= "</div>";
$sHTML .= $optionList;
$sHTML .= "</div>";
$sHTML .= "<script>\$('" . $this->m_Name . "_list').hide()</script>";
return $sHTML;
}
示例3: __construct
/**
* Initialize Node
*
* @param array $rec
* @return void
*/
function __construct($rec)
{
$this->m_Id = $rec['Id'];
$this->m_PId = $rec['PId'];
$this->m_Name = $rec['title'];
$this->m_Module = $rec['module'];
$this->m_Description = $rec['description'];
$this->m_URL = $rec['link'];
if (strpos($this->m_URL, '{') === 0) {
$this->m_URL = Expression::evaluateExpression($this->m_URL, $this);
} else {
if (!empty($this->m_URL)) {
if (strpos($this->m_URL, '/') === 0) {
$this->m_URL = APP_INDEX . $this->m_URL;
} else {
$this->m_URL = APP_INDEX . '/' . $this->m_URL;
}
}
}
$this->m_URL_Match = $rec['alias'];
//$this->m_CssClass = $rec['Id'];
$this->m_IconImage = $rec['icon'];
$this->m_IconCSSClass = $rec['icon_css'];
$this->m_Access = $rec['access'];
$this->translate();
// translate for multi-language support
}
示例4: getStyle
/**
* Get style of element
*
* @return string style of Element
*/
protected function getStyle()
{
$htmlClass = $this->m_cssClass ? "class='" . $this->m_cssClass . "' " : "class='editcombobox'";
/*
$width = $this->m_Width ? $this->m_Width : 146;
$this->m_WidthInput = ($width-18).'px';
$this->m_Width = $width.'px';
$style = "position: absolute; width: $this->m_Width; z-index: 1; clip: rect(auto, auto, auto, $this->m_WidthInput);";
*/
if ($this->m_Style) {
$style .= $this->m_Style;
}
if (!isset($style) && !$htmlClass) {
return null;
}
if (isset($style)) {
$formObj = $this->getFormObj();
$style = Expression::evaluateExpression($style, $formObj);
$style = "style='{$style}'";
}
if ($htmlClass) {
$style = $htmlClass . " " . $style;
}
return $style;
}
示例5: getText
/**
* Get text of element
*
* @return string
*/
protected function getText()
{
if ($this->m_Text == null) {
return null;
}
$formObj = $this->getFormObj();
return Expression::evaluateExpression($this->m_Text, $formObj);
}
示例6: getLink
/**
* Get link that evaluated by Expression::evaluateExpression
*
* @return string link
*/
protected function getLink()
{
if ($this->m_Link == null) {
return null;
}
$formobj = $this->getFormObj();
return Expression::evaluateExpression($this->m_Link, $formobj);
}
示例7: renderSmarty
/**
* Render smarty template for view object
*
* @param EasyView $viewObj
* @param string $tplFile
* @return string result of rendering process
*/
protected static function renderSmarty($viewObj, $tplFile)
{
$smarty = BizSystem::getSmartyTemplate();
$newClntObjs = '';
// render the viewobj attributes
$smarty->assign("view", $viewObj->outputAttrs());
$smarty->assign("module", $viewObj->getModuleName($viewObj->m_Name));
if ($viewObj->m_Tiles) {
foreach ($viewObj->m_Tiles as $tname => $tile) {
foreach ($tile as $formRef) {
if ($formRef->m_Display == false) {
continue;
}
$tiles[$tname][$formRef->m_Name] = BizSystem::getObject($formRef->m_Name)->render();
$tiletabs[$tname][$formRef->m_Name] = $formRef->m_Description;
}
}
} else {
foreach ($viewObj->m_FormRefs as $formRef) {
if ($formRef->m_Display == false) {
continue;
}
$forms[$formRef->m_Name] = BizSystem::getObject($formRef->m_Name)->render();
$formtabs[$formRef->m_Name] = $formRef->m_Description;
}
}
// add clientProxy scripts
$includedScripts = BizSystem::clientProxy()->getAppendedScripts();
$styles = BizSystem::clientProxy()->getAppendedStyles();
if ($viewObj->m_IsPopup && $bReRender == false) {
$moveToCenter = "moveToCenter(self, " . $viewObj->m_Width . ", " . $viewObj->m_Height . ");";
$scripts = $includedScripts . "\n<script>\n" . $newClntObjs . $moveToCenter . "</script>\n";
} else {
$scripts = $includedScripts . "\n<script>\n" . $newClntObjs . "</script>\n";
}
if ($viewObj->m_Title) {
$title = Expression::evaluateExpression($viewObj->m_Title, $viewObj);
} else {
$title = $viewObj->m_Description;
}
$smarty->assign("scripts", $scripts);
$smarty->assign("style_sheets", $styles);
$smarty->assign("title", $title);
$smarty->assign("description", $viewObj->m_Description);
$smarty->assign("keywords", $viewObj->m_Keywords);
$smarty->assign("forms", $forms);
$smarty->assign("formtabs", $formtabs);
$smarty->assign("tiles", $tiles);
$smarty->assign("tiletabs", $tiletabs);
if ($viewObj->m_ConsoleOutput) {
$smarty->display(BizSystem::getTplFileWithPath($viewObj->m_TemplateFile, $viewObj->m_Package));
} else {
return $smarty->fetch(BizSystem::getTplFileWithPath($viewObj->m_TemplateFile, $viewObj->m_Package));
}
}
示例8: render
public function render()
{
$fromList = array();
$this->getFromList($fromList);
$value = $this->getValue() != 'null' ? $this->getValue() : $this->getDefaultValue();
$value = $value === null ? $this->getDefaultValue() : $value;
$valueArray = explode(',', $value);
$disabledStr = $this->getEnabled() == "N" ? "DISABLED=\"true\"" : "";
$style = $this->getStyle();
$func = $this->getFunction();
$formobj = $this->GetFormObj();
if ($formobj->m_Errors[$this->m_Name]) {
$func .= "onclick=\"this.className='{$this->m_cssClass}'\"";
} else {
$func .= "onmouseover=\"this.className='{$this->m_cssFocusClass}'\" onmouseout=\"this.className='{$this->m_cssClass}'\"";
}
$sHTML = "<input type=\"hidden\" NAME=\"" . $this->m_Name . "\" ID=\"" . $this->m_Name . "\" value=\"" . $value . "\" {$disabledStr} {$this->m_HTMLAttr} />";
$sHTML .= "<ul id=\"image_list_" . $this->m_Name . "\" {$style} {$func} >";
if ($this->m_BlankOption) {
$entry = explode(",", $this->m_BlankOption);
$text = $entry[0];
$value = $entry[1] != "" ? $entry[1] : null;
$entryList = array(array("val" => $value, "txt" => $text));
$fromList = array_merge($entryList, $fromList);
}
foreach ($fromList as $option) {
$test = array_search($option['val'], $valueArray);
if ($test === false) {
$selectedStr = 'normal';
} else {
$selectedStr = "current";
}
if ($this->m_Width) {
$width_str = " width=\"" . $this->m_Width . "\" ";
}
if ($this->m_Height) {
$height_str = " height=\"" . $this->m_Height . "\" ";
}
$image_url = $option['pic'];
if (preg_match("/\\{.*\\}/si", $image_url)) {
$formobj = $this->getFormObj();
$image_url = Expression::evaluateExpression($image_url, $formobj);
} else {
$image_url = Resource::getImageUrl() . "/" . $image_url;
}
$sHTML .= "<a title=\"" . $option['txt'] . "\" \n \t\t\t\thref=\"javascript:;\"\n \t\t\t\tclass=\"{$selectedStr}\"\n \t\t\t\tonclick =\"\$('" . $this->m_Name . "').value='" . $option['val'] . "'; \t\t\t\t\t\t\t\n \t\t\t\t\t\t\tOpenbiz.ImageSelector.reset('image_list_" . $this->m_Name . "');\n \t\t\t\t\t\t\tthis.className='current';\n \t\t\t\t\t\t\t\"\t\n \t\t\t>\n \t\t\t<img\n \t\t\t {$width_str} {$height_str}\n \t\t\t src=\"" . $image_url . "\" \n \t\t\t\ttitle=\"" . $option['txt'] . "\" \n \t\t\t\t /></a>";
}
$sHTML .= "</ul>";
return $sHTML;
}
示例9: getSelectFrom
protected function getSelectFrom()
{
$formobj = $this->getFormObj();
if (!BizSystem::allowUserAccess("data_assign.assign_to_other")) {
$groups = BizSystem::getUserProfile("groups");
if ($groups) {
$ids = implode(",", $groups);
$selectFrom = $this->m_SelectFrom . ",[Id] IN ({$ids})";
} else {
$selectFrom = $this->m_SelectFrom;
}
} else {
$selectFrom = $this->m_SelectFrom;
}
return Expression::evaluateExpression($selectFrom, $formobj);
}
示例10: render
public function render()
{
$value = $this->m_Value ? $this->m_Value : $this->m_Text;
$disabledStr = $this->getEnabled() == "N" ? "READONLY=\"true\"" : "";
$style = $this->getStyle();
$func = $this->getFunction();
$formobj = $this->GetFormObj();
if ($formobj->m_Errors[$this->m_Name]) {
$func .= "onchange=\"this.className='{$this->m_cssClass}'\"";
} else {
$func .= "onfocus=\"this.className='{$this->m_cssFocusClass}'\" onblur=\"this.className='{$this->m_cssClass}'\"";
}
$formObj = $this->getFormObj();
$this->m_AntiSpamImage = Expression::evaluateExpression($this->m_AntiSpamImage, $formObj);
$sHTML = "<INPUT maxlength='" . $this->m_Lenght . "' NAME=\"" . $this->m_Name . "\" ID=\"" . $this->m_Name . "\" VALUE=\"" . $value . "\" {$disabledStr} {$this->m_HTMLAttr} {$style} {$func}>";
$sHTML .= "<IMG style='margin-left:10px;' BRODER='0' SRC=\"" . $this->m_AntiSpamImage . "?form=" . $formobj->m_Name . "&name=" . $this->m_Name . "&length=" . $this->m_Length . "&level=" . $this->m_SpamLevel . "&rand=" . rand() . "\" />";
return $sHTML;
}
示例11: render
/**
* Render, draw the element according to the mode
*
* @return string HTML text
*/
public function render()
{
$value = $this->m_Value;
$name = $this->m_Name . '[]';
$style = $this->getStyle();
if ($this->m_CheckStatus) {
$formObj = $this->getFormObj();
$testResult = Expression::evaluateExpression($this->m_CheckStatus, $formObj);
if ($testResult) {
$checkStatus = " checked=\"checked\" ";
} else {
$checkStatus = "";
}
} else {
$checkStatus = "";
}
$sHTML = "<INPUT TYPE=\"CHECKBOX\" {$checkStatus} NAME=\"{$name}\" VALUE='{$value}' onclick=\"event.cancelBubble=true;\" {$this->m_HTMLAttr} {$style}/>";
return $sHTML;
}
示例12: render
public function render()
{
$formobj = $this->getFormObj();
$this->m_TotalPage = Expression::evaluateExpression($this->m_TotalPage, $formobj);
$this->m_CurrentPage = Expression::evaluateExpression($this->m_CurrentPage, $formobj);
$style = $this->getStyle();
$id = $this->m_Name;
$func = $this->getFunction();
$sHTML = "";
$link = $this->getLink();
$target = $this->getTarget();
for ($i = 1; $i < $this->m_TotalPage + 1; $i++) {
if ($i == $this->m_CurrentPage) {
$sHTML .= "<a id=\"{$id}\" href=\"" . $link . $i . "\" {$target} {$func} class=\"" . $this->m_CurrentCss . "\">" . $i . "</a>";
} else {
$sHTML .= "<a id=\"{$id}\" href=\"" . $link . $i . "\" {$target} {$func} {$style}>" . $i . "</a>";
}
}
return $sHTML;
}
示例13: render
/**
* Render, draw the control according to the mode
*
* @return string HTML text
*/
public function render()
{
$this->m_Prefix = Expression::evaluateExpression($this->m_Prefix, $formobj);
$func = $this->getFunction();
if ($this->m_Width) {
$width_str = " width=\"" . $this->m_Width . "\" ";
}
if ($this->m_Height) {
$height_str = " height=\"" . $this->m_Height . "\" ";
}
$value = $this->getText() ? $this->getText() : $this->getValue();
if ($value) {
if ($this->m_Link) {
$link = $this->getLink();
$target = $this->getTarget();
$sHTML = "<a href=\"{$link}\" {$target} {$func} {$style}>" . "<img src=\"" . $this->m_Prefix . $value . "\" border=\"0\" {$width_str} {$height_str} />" . "</a>";
} else {
$sHTML = "<img border=\"0\" src=\"" . $this->m_Prefix . $value . "\" {$func} {$width_str} {$height_str} />";
}
}
return $sHTML;
}
示例14: render
public function render()
{
$value = $this->m_Text ? $this->getText() : $this->m_Value;
if ($this->m_Color) {
$formObj = $this->getFormObj();
$color = Expression::evaluateExpression($this->m_Color, $formObj);
if (!$color) {
$color = '33b5fb';
}
$bgcolor_str = "background-color: #" . $color . ";";
} else {
$bgcolor_str = "background-color: #33b5fb;";
}
if ($this->m_DisplayFormat) {
$value = sprintf($this->m_DisplayFormat, $value);
}
if ($this->m_Percent == 'Y') {
$value = sprintf("%.2f", $value * 100) . '%';
}
$style = $this->getStyle();
$id = $this->m_Name;
$func = $this->getFunction();
$height = $this->m_Height;
$width = $this->m_Width - 80;
$max_value = Expression::evaluateExpression($this->m_MaxValue, $this->getFormObj());
$width_rate = $value / $max_value;
if ($width_rate > 1) {
$width_rate = 1;
}
$width_bar = (int) ($width * $width_rate);
if (!preg_match("/MSIE 6/si", $_SERVER['HTTP_USER_AGENT'])) {
$bar_overlay = "<span class=\"bar_data_bg\" style=\"" . $bgcolor_str . "height:" . $height . "px;width:" . $width_bar . "px;\"></span>";
$bar = "<span class=\"bar_data\" style=\"" . $bgcolor_str . "height:" . $height . "px;width:" . $width_bar . "px;\"></span>";
} else {
$bar = "<span class=\"bar_data\" style=\"" . $bgcolor_str . "height:" . $height . "px;width:" . $width_bar . "px;opacity: 0.4;filter: alpha(opacity=40);\"></span>";
}
$sHTML = "\n \t<span id=\"{$id}\" {$func} {$style} >\n \t\t\n \t\t<span class=\"bar_bg\" style=\"height:" . $height . "px;width:" . $width . "px;\"> \t\t\t\n \t\t{$bar_overlay}\n \t\t{$bar}\t \n \t\t</span>\n \t\t\n \t\t<span class=\"value\" style=\"text-align:left;text-indent:10px;\">{$value}" . $this->m_DisplayUnit . "</span>\n \t</span>\n \t";
return $sHTML;
}
示例15: readMetadata
function readMetadata($xmlArr)
{
$this->m_Id = $xmlArr["ATTRIBUTES"]["ID"];
$this->m_Name = $xmlArr["ATTRIBUTES"]["NAME"];
$this->m_Description = $xmlArr["ATTRIBUTES"]["DESCRIPTION"];
$this->m_URL = $xmlArr["ATTRIBUTES"]["URL"];
$this->m_URL = Expression::evaluateExpression($this->m_URL, $this);
$this->m_URL_Match = $xmlArr["ATTRIBUTES"]["URLMATCH"];
$this->m_Target = $xmlArr["ATTRIBUTES"]["TARGET"];
$this->m_CssClass = $xmlArr["ATTRIBUTES"]["CSSCLASS"];
$this->m_IconImage = $xmlArr["ATTRIBUTES"]["ICONIMAGE"];
$this->m_IconCSSClass = $xmlArr["ATTRIBUTES"]["ICONCSSCLASS"];
if (is_array($xmlArr["MENUITEM"])) {
$this->m_ChildNodes = array();
if (isset($xmlArr["MENUITEM"]["ATTRIBUTES"])) {
$this->m_ChildNodes[$xmlArr["MENUITEM"]["ATTRIBUTES"]["ID"]] = new MenuItemObj($xmlArr["MENUITEM"], $this->m_Id);
} else {
foreach ($xmlArr["MENUITEM"] as $menuItem) {
$this->m_ChildNodes[$menuItem["ATTRIBUTES"]["ID"]] = new MenuItemObj($menuItem, $this->m_Id);
}
}
}
}