/** * Initialize Node * * @param array $rec * @return void */ function __construct($rec) { $this->recordId = $rec['Id']; $this->recordParentId = $rec['PId']; $this->objectName = $rec['title']; $this->module = $rec['module']; $this->objectDescription = $rec['description']; $this->url = $rec['link']; if (Expression::isExpression($this->url)) { $this->url = Expression::evaluateExpression($this->url, $this); } else { if (!empty($this->url)) { if (strpos($this->url, '/') === 0) { $this->url = OPENBIZ_APP_INDEX_URL . $this->url; } else { $this->url = OPENBIZ_APP_INDEX_URL . '/' . $this->url; } } } $this->url_Match = $rec['alias']; //$this->cssClass = $rec['Id']; $this->iconImage = $rec['icon']; $this->iconCSSClass = $rec['icon_css']; $this->access = $rec['access']; $this->translate(); // translate for multi-language support }
/** * Get style of element * * @return string style of Element */ protected function getStyle() { $htmlClass = $this->cssClass ? "class='" . $this->cssClass . "' " : "class='editcombobox'"; /* $width = $this->width ? $this->width : 146; $this->widthInput = ($width-18).'px'; $this->width = $width.'px'; $style = "position: absolute; width: $this->width; z-index: 1; clip: rect(auto, auto, auto, $this->widthInput);"; */ if ($this->style) { $style .= $this->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; }
protected function getStyle() { $formobj = $this->getFormObj(); $htmlClass = Expression::evaluateExpression($this->cssClass, $formobj); $htmlClass = "CLASS='{$htmlClass}'"; if (!$htmlClass) { $htmlClass = null; } $style = ''; if ($this->style) { $style .= $this->style; } if (!isset($style) && !$htmlClass) { return null; } if (isset($style)) { $style = Expression::evaluateExpression($style, $formobj); $style = "STYLE='{$style}'"; } if ($formobj->errors[$this->objectName]) { $htmlClass = "CLASS='" . $this->cssErrorClass . "'"; } if ($htmlClass) { $style = $htmlClass . " " . $style; } return $style; }
/** * Render element, according to the mode * * @return string HTML text */ public function render() { $val = $this->getText() ? $this->getText() : $this->getValue(); $style = $this->getStyle(); $text = $this->getText(); $id = $this->objectName; $func = $this->getFunction(); if ($val === '1' || $val === 'true' || strtoupper($val) == 'Y' || $val > 0 || $val == $this->trueValue) { $image_url = $this->trueImg; } else { $image_url = $this->falseImg; } if (preg_match("/\\{.*\\}/si", $image_url)) { $formobj = $this->getFormObj(); $image_url = Expression::evaluateExpression($image_url, $formobj); } else { $image_url = Openbiz::$app->getImageUrl() . "/" . $image_url; } if ($this->link) { $link = $this->getLink(); $target = $this->getTarget(); $sHTML = "<a id=\"{$id}\" href=\"{$link}\" {$target} {$func} {$style}><img src='{$image_url}' /></a>"; } else { $sHTML = "<img id=\"{$id}\" alt=\"" . $text . "\" title=\"" . $text . "\" src='{$image_url}' />"; } return $sHTML; }
public function render() { $sHTML = ""; if (Openbiz::getService('system.lib.ModuleService')->isModuleInstalled('oauth')) { $do = Openbiz::getObject('oauth.do.OauthProviderDO'); $recArr = $do->directFetch("[status]=1", 30); $recArr = $recArr->toArray(); if ($this->redirectURL) { $this->redirectURL = Expression::evaluateExpression($this->redirectURL, $this); $url_append .= "redirect_url=" . urlencode($this->redirectURL) . "&"; } if ($this->assocURL) { $this->assocURL = Expression::evaluateExpression($this->assocURL, $this); $url_append .= "assoc_url=" . urlencode($this->assocURL) . "&"; } if (count($recArr)) { $sHTML .= "<span class=\"oauth_bar\" {$style}>"; foreach ($recArr as $oauthProvider) { $url = OPENBIZ_APP_URL . "/ws.php/oauth/callback/login/type_" . $oauthProvider['type'] . '/'; if ($url_append) { $url .= '?' . $url_append; } $sHTML .= "<a id=\"oauth_" . $oauthProvider['type'] . "\" title=\"" . $oauthProvider['type'] . "\" href=\"{$url}\" style=\"\"></a>"; } $sHTML .= "</span>"; } } return $sHTML; }
/** * Get image title * * @return string */ protected function getTitle() { if ($this->title == null) { return null; } $formobj = $this->getFormObj(); return Expression::evaluateExpression($this->title, $formobj); }
/** * Get text of element * * @return string */ protected function getText() { if ($this->text == null) { return null; } $formObj = $this->getFormObj(); return Expression::evaluateExpression($this->text, $formObj); }
public function getLocationInfo($id) { $locationRec = Openbiz::getObject("backup.do.BackupDeviceDO")->fetchById($id); if ($locationRec) { $this->folder = Expression::evaluateExpression($locationRec['location'], null); $this->folder = Expression::evaluateExpression($locationRec['location'], null); } }
/** * Get link that evaluated by Expression::evaluateExpression * * @return string link */ protected function getLink() { if ($this->link == null) { return null; } $formobj = $this->getFormObj(); return Expression::evaluateExpression($this->link, $formobj); }
protected function getHeight() { if ($this->height == null) { return null; } $formobj = $this->getFormObj(); return Expression::evaluateExpression($this->height, $formobj); }
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->errors[$this->objectName]) { $func .= "onclick=\"this.className='{$this->cssClass}'\""; } else { $func .= "onmouseover=\"this.className='{$this->cssFocusClass}'\" onmouseout=\"this.className='{$this->cssClass}'\""; } $sHTML = "<input type=\"hidden\" NAME=\"" . $this->objectName . "\" ID=\"" . $this->objectName . "\" value=\"" . $value . "\" {$disabledStr} {$this->htmlAttr} />"; $sHTML .= "<ul id=\"image_list_" . $this->objectName . "\" {$style} {$func} >"; if ($this->blankOption) { $entry = explode(",", $this->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->width) { $width_str = " width=\"" . $this->width . "\" "; } if ($this->height) { $height_str = " height=\"" . $this->height . "\" "; } $image_url = $option['pic']; if (preg_match("/\\{.*\\}/si", $image_url)) { $formobj = $this->getFormObj(); $image_url = Expression::evaluateExpression($image_url, $formobj); } else { $image_url = Openbiz::$app->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->objectName . "').value='" . $option['val'] . "'; \t\t\t\t\t\t\t\n \t\t\t\t\t\t\tOpenbiz.ImageSelector.reset('image_list_" . $this->objectName . "');\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; }
protected function getSelectFrom() { $formobj = $this->getFormObj(); if (!Openbiz::$app->allowUserAccess("data_assign.assign_to_other")) { $groups = Openbiz::$app->getUserProfile("groups"); if ($groups) { $ids = implode(",", $groups); $selectFrom = $this->selectFrom . ",[Id] IN ({$ids})"; } else { $selectFrom = $this->selectFrom; } } else { $selectFrom = $this->selectFrom; } return Expression::evaluateExpression($selectFrom, $formobj); }
/** * Render, draw the element according to the mode * * @return string HTML text */ public function render() { $value = $this->value; $name = $this->objectName . '[]'; $style = $this->getStyle(); if ($this->checkStatus) { $formObj = $this->getFormObj(); $testResult = Expression::evaluateExpression($this->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->htmlAttr} {$style}/>"; return $sHTML; }
public function render() { $formobj = $this->getFormObj(); $this->totalPage = Expression::evaluateExpression($this->totalPage, $formobj); $this->currentPage = Expression::evaluateExpression($this->currentPage, $formobj); $style = $this->getStyle(); $id = $this->objectName; $func = $this->getFunction(); $sHTML = ""; $link = $this->getLink(); $target = $this->getTarget(); for ($i = 1; $i < $this->totalPage + 1; $i++) { if ($i == $this->currentPage) { $sHTML .= "<a id=\"{$id}\" href=\"" . $link . $i . "\" {$target} {$func} class=\"" . $this->currentCss . "\">" . $i . "</a>"; } else { $sHTML .= "<a id=\"{$id}\" href=\"" . $link . $i . "\" {$target} {$func} {$style}>" . $i . "</a>"; } } return $sHTML; }
/** * Render, draw the control according to the mode * * @return string HTML text */ public function render() { $this->prefix = Expression::evaluateExpression($this->prefix, $formobj); $func = $this->getFunction(); if ($this->width) { $width_str = " width=\"" . $this->width . "\" "; } if ($this->height) { $height_str = " height=\"" . $this->height . "\" "; } $value = $this->getText() ? $this->getText() : $this->getValue(); if ($value) { if ($this->link) { $link = $this->getLink(); $target = $this->getTarget(); $sHTML = "<a href=\"{$link}\" {$target} {$func} {$style}>" . "<img src=\"" . $this->prefix . $value . "\" border=\"0\" {$width_str} {$height_str} />" . "</a>"; } else { $sHTML = "<img border=\"0\" src=\"" . $this->prefix . $value . "\" {$func} {$width_str} {$height_str} />"; } } return $sHTML; }
public function render() { $value = $this->text ? $this->getText() : $this->value; if ($this->color) { $formObj = $this->getFormObj(); $color = Expression::evaluateExpression($this->color, $formObj); if (!$color) { $color = '33b5fb'; } $bgcolor_str = "background-color: #" . $color . ";"; } else { $bgcolor_str = "background-color: #33b5fb;"; } if ($this->displayFormat) { $value = sprintf($this->displayFormat, $value); } if ($this->percent == 'Y') { $value = sprintf("%.2f", $value * 100) . '%'; } $style = $this->getStyle(); $id = $this->objectName; $func = $this->getFunction(); $height = $this->height; $width = $this->width - 80; $max_value = Expression::evaluateExpression($this->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->displayUnit . "</span>\n \t</span>\n \t"; return $sHTML; }
function readMetadata($xmlArr) { $this->recordId = $xmlArr["ATTRIBUTES"]["ID"]; $this->objectName = $xmlArr["ATTRIBUTES"]["NAME"]; $this->objectDescription = $xmlArr["ATTRIBUTES"]["DESCRIPTION"]; $this->url = $xmlArr["ATTRIBUTES"]["URL"]; $this->url = Expression::evaluateExpression($this->url, $this); $this->url_Match = $xmlArr["ATTRIBUTES"]["URLMATCH"]; $this->target = $xmlArr["ATTRIBUTES"]["TARGET"]; $this->cssClass = $xmlArr["ATTRIBUTES"]["CSSCLASS"]; $this->iconImage = $xmlArr["ATTRIBUTES"]["ICONIMAGE"]; $this->iconCSSClass = $xmlArr["ATTRIBUTES"]["ICONCSSCLASS"]; if (is_array($xmlArr["MENUITEM"])) { $this->childNodes = array(); if (isset($xmlArr["MENUITEM"]["ATTRIBUTES"])) { $this->childNodes[$xmlArr["MENUITEM"]["ATTRIBUTES"]["ID"]] = new MenuItemObj($xmlArr["MENUITEM"], $this->recordId); } else { foreach ($xmlArr["MENUITEM"] as $menuItem) { $this->childNodes[$menuItem["ATTRIBUTES"]["ID"]] = new MenuItemObj($menuItem, $this->recordId); } } } }
/** * Execute action * * @param TriggerAction $triggerAction * @param BizDataObj $dataObj * @return void */ protected function executeAction($triggerAction, $dataObj) { // action method $methodName = $triggerAction->action; // action method arguments if (method_exists($this, $methodName)) { // evaluate arguments as expression support foreach ($triggerAction->argList as $argName => $argValue) { $argList[$argName] = Expression::evaluateExpression($argValue, $dataObj); } // check the immediate flag if ($triggerAction->immediate == "Y") { // call the method if Immediate is "Y" $this->{$methodName}($argList); } else { // put it to a passive queue /* $passiveQueueSvc->Push($methodName, $argList, $triggerAction->delayMinutes, $triggerAction->repeatMinutes); */ } } }
protected function getSelectFromSQL() { $formobj = $this->getFormObj(); return Expression::evaluateExpression($this->selectFromSQL, $formobj); }
/** * Replace var expression * @objname:property, @objname:field[fldname].property, @objname:control[ctrlname].property * @:prop = @thisobjname:prop * * @global BizSystem $g_BizSystem * @param string $expression * @param object $object * @return string */ protected static function replaceVarExpr($expression, $object) { // replace @objname:property to GetObject()->getProperty(property) while (true) { // TODO: one clause must be separated by whitespace //modified by jixian for support package full name of a object //e.g : shared.objects.compaines.objCompany:Field[Id].Value $pattern = "/@([[a-zA-Z0-9_\\.]*):([a-zA-Z0-9_\\.\\[\\]]+)/"; if (!preg_match($pattern, $expression, $matches)) { break; } $macro = $matches[0]; $objName = $matches[1]; $propExpr = $matches[2]; $obj = null; if ($objName == "profile") { // @profile:attribute is reserved $profileAttribute = Openbiz::$app->getUserProfile($propExpr); $expression = str_replace($macro, $profileAttribute, $expression); continue; } if ($objName == "home") { // @home:url is reserved switch ($propExpr) { case "url": $value = "'" . OPENBIZ_APP_INDEX_URL . "'"; break; case "base_url": $value = "'" . OPENBIZ_APP_URL . "'"; break; } $expression = str_replace($macro, $value, $expression); continue; } elseif (in_array($objName, array_keys(Expression::$services))) { // reserved keywords $body = $expression; $objFunc = '@' . $objName . ':' . $propExpr; $posStart = strpos($body, $objFunc); $beforeString = substr($body, 0, $posStart); $paramStart = strpos($body, $objFunc . '(') + strlen($objFunc . '('); $paramEnd = strpos($body, ')', $paramStart); $paramLen = $paramEnd - $paramStart; $function = $propExpr; $paramString = substr($body, $paramStart, $paramLen); $restString = substr($body, $paramEnd + 1); $paramString = Expression::evaluateExpression('{' . $paramString . '}', $object); $serviceName = Expression::$services[$objName]; $serviceObj = Openbiz::getService($serviceName); $params = explode(',', $paramString); for ($i = 0; $i < count($params); $i++) { $params[$i] = trim($params[$i]); } $val_result = call_user_func_array(array($serviceObj, $function), $params); return $beforeString . $val_result . $restString; } elseif ($objName == "" || $objName == "this") { $obj = $object; $body = $expression; $objFunc = '@' . $objName . ':' . $propExpr; $posStart = strpos($body, $objFunc); $beforeString = substr($body, 0, $posStart); if (strpos($body, '(') > 0 && substr($expression, 0, 2) == '@:') { $paramStart = strpos($body, $objFunc . '(') + strlen($objFunc . '('); $paramEnd = strpos($body, ')', $paramStart); $paramLen = $paramEnd - $paramStart; $function = $propExpr; $paramString = substr($body, $paramStart, $paramLen); $restString = substr($body, $paramEnd + 1); $params = explode(',', $paramString); // bug fix for ($i = 0; $i < count($params); $i++) { $params[$i] = trim($params[$i]); } if (!is_array($params)) { $params = array(); } if (method_exists($obj, $function)) { $val_result = call_user_func_array(array($obj, $function), $params); return $beforeString . $val_result . $restString; } } } else { $obj = Openbiz::getObject($objName); } if ($obj == null) { throw new \Exception("Wrong expression syntax " . $expression . ", cannot get object " . $objName); } $pos = strpos($propExpr, "."); $paramStart = strpos($expression, $objFunc . '('); if ($pos > 0) { // in case of @objname:field[fldname].property $property1 = substr($propExpr, 0, $pos); $property2 = substr($propExpr, $pos + 1); $propertyObj = $obj->getProperty($property1); if ($propertyObj == null) { $propertyObj = $obj->getDataObj()->getProperty($property1); if ($propertyObj == null) { throw new Exception("Wrong expression syntax " . $expression . ", cannot get property object " . $property1 . " of object " . $objName); } else { $val = $propertyObj->getProperty($property2); } } $val = $propertyObj->getProperty($property2); } else { // in case of @objname:property $val = $obj->getProperty($propExpr); } if ($val === null) { $val = ""; } if (is_string($val)) { $val = "'{$val}'"; } $expression = str_replace($macro, $val, $expression); } return $expression; }
/** * Convert search/sort rule to sql clause, replace [fieldName] with table.column * openbiz SQL expression as : * "[fieldName] opr 'Value' AND/OR [fieldName] opr 'Value'...". "()" is valid syntax * * @param BizDataObj $dataObj * @param string $rule "[fieldName] ..." * @return string sql statement * */ private function _ruleToSql($dataObj, $rule) { $cacheKey = $dataObj->objectName . "-" . $rule; if (isset($this->_doRuleCache[$cacheKey])) { return $this->_doRuleCache[$cacheKey]; } //echo " _ruleToSql ".$dataObj->objectName." ". $rule."\n"; $dataSqlObj = $this->getDataSqlObj(); $rule = Expression::evaluateExpression($rule, $dataObj); // replace all [field] with table.column // use regexp to find [] parts and replace with fields if (!preg_match_all("/\\[([0-9a-zA-Z_]+)\\]/", $rule, $m)) { $this->_doRuleCache[$cacheKey] = $rule; return $rule; } foreach ($m[1] as $fld) { $bizField = $dataObj->getField($fld); if (!$bizField) { continue; } $fld_pattern = "[" . $bizField->objectName . "]"; if ($bizField->column && strpos($bizField->column, ',') != 0) { // handle composite key. if (!preg_match('/\\[' . $bizField->objectName . '\\].*=.*\'(.+)\'/', $rule, $matches)) { continue; } //print_r($matches); $keyval = $matches[1]; // replace the matching part [compkey field]='value' $compkey_value = $this->_compKeyRuleToSql($bizField->column, $keyval); $rule = $str_replace($matches[0], $compkey_value, $rule); } else { if ($bizField->aliasName) { $rule = str_replace($fld_pattern, $bizField->aliasName, $rule); } elseif ($bizField->sqlExpression) { $rule = str_replace($fld_pattern, $bizField->sqlExpression, $rule); } else { $tableColumn = $dataSqlObj->getTableColumn($bizField->join, $bizField->column); $rule = str_replace($fld_pattern, $tableColumn, $rule); } } } $this->_doRuleCache[$cacheKey] = $rule; return $rule; }
protected function getDOFromList(&$list, $selectFrom) { // from Database $pos0 = strpos($selectFrom, "["); $pos1 = strpos($selectFrom, "]"); if ($pos0 > 0 && $pos1 > $pos0) { // select from bizObj // support BizObjName[BizFieldName] or BizObjName[BizFieldName4Text:BizFieldName4Value] $bizObjName = substr($selectFrom, 0, $pos0); $pos3 = strpos($selectFrom, ":"); if ($pos3 > $pos0 && $pos3 < $pos1) { $fieldName = substr($selectFrom, $pos0 + 1, $pos3 - $pos0 - 1); $fieldName_v = substr($selectFrom, $pos3 + 1, $pos1 - $pos3 - 1); } else { $fieldName = substr($selectFrom, $pos0 + 1, $pos1 - $pos0 - 1); $fieldName_v = $fieldName; } $this->selectFieldName = $fieldName; $commaPos = strpos($selectFrom, ",", $pos1); $commaPos2 = strpos($selectFrom, ",", $commaPos + 1); if ($commaPos > $pos1) { if ($commaPos2) { $searchRule = trim(substr($selectFrom, $commaPos + 1, $commaPos2 - $commaPos - 1)); } else { $searchRule = trim(substr($selectFrom, $commaPos + 1)); } } if ($commaPos2 > $commaPos) { $rootSearchRule = trim(substr($selectFrom, $commaPos2 + 1)); } $bizObj = Openbiz::getObject($bizObjName); if (!$bizObj) { return; } $recList = array(); $oldAssoc = $bizObj->association; $bizObj->association = null; if ($searchRule) { $searchRule = Expression::evaluateExpression($searchRule, $this->getFormObj()); } if ($rootSearchRule) { $rootSearchRule = Expression::evaluateExpression($rootSearchRule, $this->getFormObj()); } else { $rootSearchRule = "[PId]=0 OR [PId]='' OR [PId] is NULL"; } $recListTree = $bizObj->fetchTree($rootSearchRule, 100, $searchRule); $bizObj->association = $oldAssoc; if (!$recListTree) { return; } // bugfix : error if data blank foreach ($recListTree as $recListTreeNode) { $this->tree2array($recListTreeNode, $recList); } foreach ($recList as $rec) { $list[$i]['val'] = $rec[$fieldName_v]; $list[$i]['txt'] = $rec[$fieldName]; $i++; } return; } }
protected function getSelectFromSQL($selectFrom) { return Expression::evaluateExpression($selectFrom, null); }
protected function getRequired() { $formObj = $this->getFormObj(); return Expression::evaluateExpression($this->required, $formObj); }
/** * Get output attributs as array * * @return array array of attributs * @todo rename to getOutputAttribute or getAttribute (2.5?) */ public function outputAttrs() { $output['name'] = $this->objectName; $output['title'] = Expression::evaluateExpression($this->title, $this); $output['icon'] = $this->icon; $output['hasSubform'] = $this->subForms ? 1 : 0; $output['currentPage'] = $this->currentPage; $output['currentRecordId'] = $this->recordId; $output['totalPages'] = $this->totalPages; $output['totalRecords'] = $this->totalRecords; $output['description'] = str_replace('\\n', "<br />", Expression::evaluateExpression($this->objectDescription, $this)); $output['elementSets'] = $this->getElementSet(); $output['tabSets'] = $this->getTabSet(); $output['ActionElementSets'] = $this->getElementSet($this->actionPanel); if ($output['icon']) { if (preg_match("/{.*}/si", $output['icon'])) { $output['icon'] = Expression::evaluateExpression($output['icon'], null); } else { $output['icon'] = OPENBIZ_THEME_URL . "/" . Openbiz::$app->getCurrentTheme() . "/images/" . $output['icon']; } } return $output; }
/** * Get output attributs as array * * @return array array of attributs * @todo rename to getOutputAttribute or getAttribute (2.5?) */ public function outputAttrs() { $output['name'] = $this->objectName; $output['title'] = Expression::evaluateExpression($this->title, $this); $output['icon'] = $this->icon; return $output; }
public function getContinent() { $formobj = $this->getFormObj(); return Expression::evaluateExpression($this->continent, $formobj); }
/** * Get output attributs * * @return array * @todo need to raname to getOutputAttributs() or getAttributes */ public function outputAttrs() { $out['name'] = $this->objectName; $out['module'] = $this->getModuleName($this->objectName); $out['description'] = $this->objectDescription; $out["keywords"] = $this->keywords; if ($this->title) { $title = Expression::evaluateExpression($this->title, $this); } else { $title = $this->objectDescription; } $out['title'] = $title; return $out; }
/** * Gather all template variables needed. Should play well with Smarty or \Zend templates * * @param WebPage $viewObj * @return array associative array holding all needed VIEW based template variables */ public static function buildTemplateAttributes($viewObj) { // Assocative Array to hold all Template Values // Fill with default viewobj attributes //$tplAttributes = $viewObj->outputAttrs(); //Not sure what this is doing... $newClntObjs = ''; //Fill other direct view variables $tplAttributes["module"] = $viewObj->getModuleName($viewObj->objectName); $tplAttributes["description"] = $viewObj->objectDescription; $tplAttributes["keywords"] = $viewObj->keywords; if (isset($viewObj->tiles)) { foreach ($viewObj->tiles as $tname => $tile) { foreach ($tile as $formRef) { if ($formRef->display == false) { continue; } $tiles[$tname][$formRef->objectName] = Openbiz::getObject($formRef->objectName)->render(); $tiletabs[$tname][$formRef->objectName] = $formRef->objectDescription; } } } else { foreach ($viewObj->formRefs as $formRef) { if ($formRef->display == false) { continue; } $forms[$formRef->objectName] = Openbiz::getObject($formRef->objectName)->render(); $formtabs[$formRef->objectName] = $formRef->objectDescription; } } if (count($viewObj->widgets)) { foreach ($viewObj->widgets as $formRef) { if ($formRef->display == false) { continue; } $widgets[$formRef->objectName] = Openbiz::getObject($formRef->objectName)->render(); } } //Fill Loop related data $tplAttributes["forms"] = $forms; $tplAttributes["widgets"] = $widgets; $tplAttributes["formtabs"] = $formtabs; $tplAttributes["tiles"] = $tiles; $tplAttributes["tiletabs"] = $tiletabs; // add clientProxy scripts $includedScripts = Openbiz::$app->getClientProxy()->getAppendedScripts(); $tplAttributes["style_sheets"] = Openbiz::$app->getClientProxy()->getAppendedStyles(); if ($viewObj->isPopup && $bReRender == false) { $moveToCenter = "moveToCenter(self, " . $viewObj->width . ", " . $viewObj->height . ");"; $tplAttributes["scripts"] = $includedScripts . "\n<script>\n" . $newClntObjs . $moveToCenter . "</script>\n"; } else { $tplAttributes["scripts"] = $includedScripts . "\n<script>\n" . $newClntObjs . "</script>\n"; } if ($viewObj->title) { $tplAttributes["title"] = Expression::evaluateExpression($viewObj->title, $viewObj); } else { $tplAttributes["title"] = $viewObj->objectDescription; } if (OPENBIZ_DEFAULT_SYSTEM_NAME) { $tplAttributes["title"] = $tplAttributes["title"] . ' - ' . OPENBIZ_DEFAULT_SYSTEM_NAME; } return $tplAttributes; }
public function getDefaultChecked() { $formObj = $this->getFormObj(); return Expression::evaluateExpression($this->defaultChecked, $formObj); }