public virtual XVar addCommonHtml() { this.body.InitAndSetArrayItem(CommonFunctions.GetBaseScriptsForPage(new XVar(false)), "begin"); this.body.InitAndSetArrayItem(XTempl.create_method_assignment(new XVar("assignBodyEnd"), this), "end"); this.xt.assignbyref(new XVar("body"), (XVar)(this.body)); return(null); }
public virtual XVar getCtrlParamsArr(dynamic _param_fName, dynamic _param_recId, dynamic _param_fieldNum, dynamic _param_value, dynamic _param_opt, dynamic _param_renderHidden = null, dynamic _param_isCached = null) { #region default values if (_param_renderHidden as Object == null) { _param_renderHidden = new XVar(false); } if (_param_isCached as Object == null) { _param_isCached = new XVar(true); } #endregion #region pass-by-value parameters dynamic fName = XVar.Clone(_param_fName); dynamic recId = XVar.Clone(_param_recId); dynamic fieldNum = XVar.Clone(_param_fieldNum); dynamic value = XVar.Clone(_param_value); dynamic opt = XVar.Clone(_param_opt); dynamic renderHidden = XVar.Clone(_param_renderHidden); dynamic isCached = XVar.Clone(_param_isCached); #endregion dynamic parameters = null; parameters = XVar.Clone(buildCtrlParamsArr((XVar)(fName), (XVar)(recId), (XVar)(fieldNum), (XVar)(value), (XVar)(opt), (XVar)(renderHidden), (XVar)(isCached))); return(XTempl.create_function_assignment(new XVar("xt_buildeditcontrol"), (XVar)(parameters))); }
protected override XVar assignBody() { this.body["begin"] = MVCFunctions.Concat(this.body["begin"], CommonFunctions.GetBaseScriptsForPage(new XVar(false))); this.body.InitAndSetArrayItem(XTempl.create_method_assignment(new XVar("assignBodyEnd"), this), "end"); this.xt.assignbyref(new XVar("body"), (XVar)(this.body)); return(null); }
public virtual XVar doCommonAssignments() { this.body["begin"] = MVCFunctions.Concat(this.body["begin"], CommonFunctions.GetBaseScriptsForPage(new XVar(false))); this.body.InitAndSetArrayItem(XTempl.create_method_assignment(new XVar("assignBodyEnd"), this), "end"); this.xt.assignbyref(new XVar("body"), (XVar)(this.body)); this.xt.assign(new XVar("grid_block"), new XVar(true)); this.xt.assign(new XVar("page_number"), new XVar(true)); if (XVar.Pack(!(XVar)(this.splitByRecords))) { this.xt.assign(new XVar("divideintopages_block"), new XVar(true)); } if ((XVar)(!(XVar)(this.pdfMode)) && (XVar)((XVar)(!(XVar)(this.splitByRecords)) || (XVar)(this.pSet.isPrinterPagePDF()))) { this.xt.assign(new XVar("printbuttons"), new XVar(true)); } this.xt.assign(new XVar("printheader"), new XVar(true)); if (1 < MVCFunctions.count(this.gridTabs)) { dynamic curTabId = null; curTabId = XVar.Clone(getCurrentTabId()); this.xt.assign(new XVar("printtabheader"), new XVar(true)); this.xt.assign(new XVar("printtabheader_text"), (XVar)(getTabTitle((XVar)(curTabId)))); } return(null); }
public override XVar getCtrlParamsArr(dynamic _param_fName, dynamic _param_recId, dynamic _param_fieldNum, dynamic _param_value, dynamic _param_opt, dynamic _param_renderHidden = null, dynamic _param_isCached = null) { #region default values if (_param_renderHidden as Object == null) { _param_renderHidden = new XVar(false); } if (_param_isCached as Object == null) { _param_isCached = new XVar(true); } #endregion #region pass-by-value parameters dynamic fName = XVar.Clone(_param_fName); dynamic recId = XVar.Clone(_param_recId); dynamic fieldNum = XVar.Clone(_param_fieldNum); dynamic value = XVar.Clone(_param_value); dynamic opt = XVar.Clone(_param_opt); dynamic renderHidden = XVar.Clone(_param_renderHidden); dynamic isCached = XVar.Clone(_param_isCached); #endregion dynamic control = null, ctrlsMap = null, parameters = XVar.Array(); parameters = XVar.Clone(base.buildCtrlParamsArr((XVar)(fName), (XVar)(recId), (XVar)(fieldNum), (XVar)(value), (XVar)(opt), (XVar)(renderHidden), (XVar)(isCached))); control = XVar.Clone(XVar.Array()); parameters.InitAndSetArrayItem(true, "additionalCtrlParams", "searchPanelControl"); parameters.InitAndSetArrayItem((XVar.Pack(this.pageObj.mobileTemplateMode()) ? XVar.Pack("width: 35%;") : XVar.Pack("width: 115px;")), "additionalCtrlParams", "style"); ctrlsMap = XVar.Clone(getExtraControlMap()); this.pageObj.fillControlsMap((XVar)(ctrlsMap), new XVar(true)); return(XTempl.create_function_assignment(new XVar("xt_buildeditcontrol"), (XVar)(parameters))); }
public override XVar addCommonHtml() { this.body["begin"] = MVCFunctions.Concat(this.body["begin"], CommonFunctions.GetBaseScriptsForPage((XVar)(this.isDisplayLoading))); base.addCommonHtml(); this.body.InitAndSetArrayItem(XTempl.create_method_assignment(new XVar("assignBodyEnd"), this), "end"); return(null); }
protected virtual XVar doCommonAssignments() { this.xt.assign(new XVar("id"), (XVar)(this.id)); if (this.mode == Constants.EXPORT_SIMPLE) { this.body.InitAndSetArrayItem(CommonFunctions.GetBaseScriptsForPage(new XVar(false)), "begin"); this.body.InitAndSetArrayItem(XTempl.create_method_assignment(new XVar("assignBodyEnd"), this), "end"); this.xt.assignbyref(new XVar("body"), (XVar)(this.body)); } else { this.xt.assign(new XVar("cancel_button"), new XVar(true)); } this.xt.assign(new XVar("groupExcel"), new XVar(true)); this.xt.assign(new XVar("exportlink_attrs"), (XVar)(MVCFunctions.Concat("id=\"saveButton", this.id, "\""))); if ((XVar)(this.pSet.checkExportFieldsSelection()) && (XVar)(isBootstrap())) { this.xt.assign(new XVar("choosefields"), new XVar(true)); this.xt.assign(new XVar("exportFieldsCtrl"), (XVar)(getChooseFieldsCtrlMarkup())); } if ((XVar)(!(XVar)(this.selection)) || (XVar)(!(XVar)(MVCFunctions.count(this.selection)))) { this.xt.assign(new XVar("rangeheader_block"), new XVar(true)); this.xt.assign(new XVar("range_block"), new XVar(true)); } if (this.textFormattingType == Constants.EXPORT_BOTH) { this.xt.assign(new XVar("exportformat"), new XVar(true)); } return(null); }
public virtual XVar assignCellAttrs(dynamic cellMap, dynamic _param_cell, dynamic _param_location, dynamic _param_pageObject, dynamic _param_xt_packed, dynamic recordData, dynamic _param_forceCellSpans = null) { #region packeted values XTempl _param_xt = XVar.UnPackXTempl(_param_xt_packed); #endregion #region default values if (_param_forceCellSpans as Object == null) { _param_forceCellSpans = new XVar(false); } #endregion #region pass-by-value parameters dynamic cell = XVar.Clone(_param_cell); dynamic location = XVar.Clone(_param_location); dynamic pageObject = XVar.Clone(_param_pageObject); XTempl xt = XVar.Clone(_param_xt); dynamic forceCellSpans = XVar.Clone(_param_forceCellSpans); #endregion dynamic cellAttrs = XVar.Array(), hCell = XVar.Array(); cellAttrs = XVar.Clone(XVar.Array()); hCell = cellMap.cells[cell]; if (XVar.Pack(!(XVar)(pageObject.pdfJsonMode()))) { if ((XVar)(0 == MVCFunctions.count(hCell["rows"])) || (XVar)(0 == MVCFunctions.count(hCell["cols"]))) { cellAttrs.InitAndSetArrayItem("data-hidden", null); } if ((XVar)(forceCellSpans) || (XVar)(1 < MVCFunctions.count(hCell["cols"]))) { cellAttrs.InitAndSetArrayItem(MVCFunctions.Concat("colspan=\"", MVCFunctions.count(hCell["cols"]), "\""), null); } if ((XVar)(forceCellSpans) || (XVar)(1 < MVCFunctions.count(hCell["rows"]))) { cellAttrs.InitAndSetArrayItem(MVCFunctions.Concat("rowspan=\"", MVCFunctions.count(hCell["rows"]), "\""), null); } if (XVar.Pack(MVCFunctions.count(cellAttrs))) { assignPageVar((XVar)(recordData), (XVar)(xt), (XVar)(MVCFunctions.Concat("cell_", location, "_", cell)), (XVar)(MVCFunctions.implode(new XVar(" "), (XVar)(cellAttrs)))); } } else { if ((XVar)(0 == MVCFunctions.count(hCell["rows"])) || (XVar)(0 == MVCFunctions.count(hCell["cols"]))) { assignPageVar((XVar)(recordData), (XVar)(xt), (XVar)(MVCFunctions.Concat("cellblock_", location, "_", cell)), new XVar(false)); } if ((XVar)(forceCellSpans) || (XVar)(1 < MVCFunctions.count(hCell["cols"]))) { assignPageVar((XVar)(recordData), (XVar)(xt), (XVar)(MVCFunctions.Concat("colspan_", location, "_", cell)), (XVar)(MVCFunctions.count(hCell["cols"]))); } if ((XVar)(forceCellSpans) || (XVar)(1 < MVCFunctions.count(hCell["rows"]))) { assignPageVar((XVar)(recordData), (XVar)(xt), (XVar)(MVCFunctions.Concat("rowspan_", location, "_", cell)), (XVar)(MVCFunctions.count(hCell["rows"]))); } } return(null); }
protected virtual XVar buildDetails(dynamic _param_data) { #region pass-by-value parameters dynamic data = XVar.Clone(_param_data); #endregion dynamic details = XVar.Array(), multipleDetails = null; details = XVar.Clone(XVar.Array()); multipleDetails = XVar.Clone(1 < MVCFunctions.count(this.detailTables)); foreach (KeyValuePair <XVar, dynamic> dt in this.detailTables.GetEnumerator()) { dynamic dTable = null, dtableArrParams = XVar.Array(), mkeys = XVar.Array(), tSet = null, tType = null; dTable = XVar.Clone(CommonFunctions.GetTableByShort((XVar)(dt.Value))); mkeys = XVar.Clone(this.pSet.getMasterKeysByDetailTable((XVar)(dTable))); if (XVar.Pack(!(XVar)(mkeys))) { continue; } tSet = XVar.Clone(this.pSet.getTable((XVar)(dTable))); tType = XVar.Clone(tSet.getTableType()); dtableArrParams = XVar.Clone(XVar.Array()); dtableArrParams = XVar.Clone(XVar.Array()); dtableArrParams.InitAndSetArrayItem(1, "id"); dtableArrParams.InitAndSetArrayItem(new XTempl(), "xt"); dtableArrParams.InitAndSetArrayItem(dTable, "tName"); dtableArrParams.InitAndSetArrayItem(multipleDetails, "multipleDetails"); if (tType == Constants.PAGE_REPORT) { dynamic i = null; dtableArrParams.InitAndSetArrayItem(Constants.PAGE_RPRINT, "pageType"); dtableArrParams.InitAndSetArrayItem(true, "isDetail"); dtableArrParams.InitAndSetArrayItem(this.tName, "masterTable"); dtableArrParams.InitAndSetArrayItem(XVar.Array(), "masterKeysReq"); i = new XVar(0); foreach (KeyValuePair <XVar, dynamic> mkey in mkeys.GetEnumerator()) { i++; dtableArrParams.InitAndSetArrayItem(data[mkey.Value], "masterKeysReq", i); } } else { dtableArrParams.InitAndSetArrayItem(Constants.PAGE_PRINT, "pageType"); dtableArrParams.InitAndSetArrayItem(this.tName, "printMasterTable"); dtableArrParams.InitAndSetArrayItem(XVar.Array(), "printMasterKeys"); foreach (KeyValuePair <XVar, dynamic> mkey in mkeys.GetEnumerator()) { dtableArrParams.InitAndSetArrayItem(data[mkey.Value], "printMasterKeys", null); } } details.InitAndSetArrayItem(new XVar("details", XTempl.create_method_assignment(new XVar("showDetails"), this, (XVar)(dtableArrParams))), null); } return(details); }
public virtual XVar assign_function(dynamic _param_name, dynamic _param_func, dynamic _param_params) { #region pass-by-value parameters dynamic name = XVar.Clone(_param_name); dynamic func = XVar.Clone(_param_func); dynamic var_params = XVar.Clone(_param_params); #endregion this.xt_vars.InitAndSetArrayItem(XTempl.create_function_assignment((XVar)(func), (XVar)(var_params)), name); return(null); }
public virtual XVar addCommonHtml() { this.body.InitAndSetArrayItem(CommonFunctions.GetBaseScriptsForPage(new XVar(false)), "begin"); if (XVar.Pack(!(XVar)(mobileTemplateMode()))) { this.body["begin"] = MVCFunctions.Concat(this.body["begin"], "<div id=\"search_suggest\" class=\"search_suggest\"></div>"); } this.body.InitAndSetArrayItem(XTempl.create_method_assignment(new XVar("assignBodyEnd"), this), "end"); this.xt.assignbyref(new XVar("body"), (XVar)(this.body)); return(null); }
public virtual XVar setCurrMenuElem(dynamic xt_packed) { #region packeted values XTempl xt = XVar.UnPackXTempl(xt_packed); #endregion dynamic i = null; if ((XVar)(this.pageObject.tName == this.table) && (XVar)((XVar)(this.pageType == "AdminArea") || (XVar)(this.id != 0))) { if ((XVar)(XSession.Session.KeyExists("menuItemId")) && (XVar)(1 < this.menuTableMap[this.table][MVCFunctions.strtolower((XVar)(this.pageType))])) { if (XSession.Session["menuItemId"] == this.id) { setAsCurrMenuElem((XVar)(xt)); return(true); } } else { if (this.pageObject.getPageType() == MVCFunctions.strtolower((XVar)(this.pageType))) { setAsCurrMenuElem((XVar)(xt)); return(true); } else { if ((XVar)(!(XVar)(isSetParentElem())) && (XVar)(!(XVar)(isThisPageInMenu()))) { setAsCurrMenuElem((XVar)(xt)); return(true); } } } } i = new XVar(0); for (; i < MVCFunctions.count(this.children); i++) { if (XVar.Pack(this.children[i].setCurrMenuElem((XVar)(xt)))) { if (XVar.Pack(isBootstrap())) { xt.assign((XVar)(MVCFunctions.Concat("submenu", this.id, "_class")), new XVar("in")); } else { setAsCurrMenuElem((XVar)(xt)); } return(true); } } return(false); }
public virtual XVar setAsCurrMenuElem(dynamic xt_packed) { #region packeted values XTempl xt = XVar.UnPackXTempl(xt_packed); #endregion xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_current")), new XVar("current")); if (XVar.Pack(isBootstrap())) { xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_current")), new XVar("active")); } return(null); }
public virtual XVar assignGroupOnly(dynamic xt_packed) { #region packeted values XTempl xt = XVar.UnPackXTempl(xt_packed); #endregion dynamic attrForAssign = null; xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_title")), (XVar)(this.title)); attrForAssign = XVar.Clone(MVCFunctions.Concat(" id=\"itemlink", this.id, "\" itemtitle=\"", this.title, "\" ", (XVar.Pack(this.style) ? XVar.Pack(MVCFunctions.Concat(" style=\"cursor:default;text-decoration:none; ", this.style, "\"")) : XVar.Pack("")))); xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_menulink_attrs")), (XVar)(attrForAssign)); xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_optionattrs")), new XVar("disabled")); return(null); }
public FilterPanel(dynamic var_params) { CommonFunctions.RunnerApply(this, (XVar)(var_params)); this.id = XVar.Clone(this.pageObj.id); this.xt = XVar.UnPackXTempl(this.pageObj.xt); this.tName = XVar.Clone(this.pageObj.tName); this.filterFileds = XVar.Clone(this.pageObj.pSet.getFilterFields()); this.viewControls = XVar.Clone(new ViewControlsContainer((XVar)(this.pageObj.pSet), new XVar(Constants.PAGE_LIST))); this.xt.enable_section(new XVar("filterPanel")); if (XVar.Pack(!(XVar)(this.pageObj.controlsMap["filters"]))) { this.pageObj.controlsMap.InitAndSetArrayItem(new XVar("controls", XVar.Array()), "filters"); } }
protected override XVar assignBody() { this.body["begin"] = MVCFunctions.Concat(this.body["begin"], CommonFunctions.GetBaseScriptsForPage(new XVar(false))); this.body.InitAndSetArrayItem(XTempl.create_method_assignment(new XVar("assignBodyEnd"), this), "end"); this.xt.assignbyref(new XVar("body"), (XVar)(this.body)); this.xt.assign(new XVar("grid_block"), new XVar(true)); this.xt.assign(new XVar("grid_header"), new XVar(true)); if ((XVar)(this.format) && (XVar)(this.format != "pdf")) { this.body.InitAndSetArrayItem("", "begin"); this.body.InitAndSetArrayItem("", "end"); this.xt.assignbyref(new XVar("body"), (XVar)(this.body)); } return(null); }
public virtual XVar assign_method(dynamic _param_name, dynamic var_object, dynamic _param_method, dynamic _param_params = null) { #region default values if (_param_params as Object == null) { _param_params = new XVar(); } #endregion #region pass-by-value parameters dynamic name = XVar.Clone(_param_name); dynamic method = XVar.Clone(_param_method); dynamic var_params = XVar.Clone(_param_params); #endregion this.xt_vars.InitAndSetArrayItem(XTempl.create_method_assignment((XVar)(method), (XVar)(var_object), (XVar)(var_params)), name); return(null); }
public virtual XVar doCommonAssignments() { this.xt.assign(new XVar("id"), (XVar)(this.id)); this.xt.assign(new XVar("searchPanel"), new XVar(true)); if (XVar.Pack(isShowMenu())) { this.xt.assign(new XVar("menu_block"), new XVar(true)); } setLangParams(); this.xt.assign(new XVar("chart_block"), new XVar(true)); this.xt.assign(new XVar("asearch_link"), new XVar(true)); this.xt.assign(new XVar("exportpdflink_attrs"), new XVar("onclick='chart.saveAsPDF();'")); this.xt.assign(new XVar("advsearchlink_attrs"), (XVar)(MVCFunctions.Concat("id=\"advButton", this.id, "\""))); if (XVar.Pack(!(XVar)(CommonFunctions.GetChartXML((XVar)(this.shortTableName))))) { this.xt.assign(new XVar("chart_block"), new XVar(false)); } this.xt.assign(new XVar("message_block"), new XVar(true)); if ((XVar)((XVar)((XVar)(this.mode == Constants.CHART_SIMPLE) || (XVar)(this.mode == Constants.CHART_DASHBOARD)) && (XVar)(this.pSet.noRecordsOnFirstPage())) && (XVar)(!(XVar)(this.searchClauseObj.isSearchFunctionalityActivated()))) { this.show_message_block = new XVar(true); hideElement(new XVar("chart")); this.xt.assign(new XVar("chart_block"), new XVar(false)); this.xt.assign(new XVar("message"), (XVar)(noRecordsMessage())); this.xt.assign(new XVar("message_class"), new XVar("alert-warning")); } if (XVar.Pack(!(XVar)(this.show_message_block))) { hideElement(new XVar("message")); } if (XVar.Pack(mobileTemplateMode())) { this.xt.assign(new XVar("tableinfomobile_block"), new XVar(true)); } assignChartElement(); this.body["begin"] = MVCFunctions.Concat(this.body["begin"], CommonFunctions.GetBaseScriptsForPage((XVar)(this.isDisplayLoading))); if ((XVar)(!(XVar)(isDashboardElement())) && (XVar)(!(XVar)(mobileTemplateMode()))) { this.body["begin"] = MVCFunctions.Concat(this.body["begin"], "<div id=\"search_suggest\" class=\"search_suggest\"></div>"); } this.body.InitAndSetArrayItem(XTempl.create_method_assignment(new XVar("assignBodyEnd"), this), "end"); this.xt.assignbyref(new XVar("body"), (XVar)(this.body)); return(null); }
public virtual XVar prepareWelcomeMenuItem(dynamic xt_packed) { #region packeted values XTempl xt = XVar.UnPackXTempl(xt_packed); #endregion if (XVar.Pack(!(XVar)(isWelcome()))) { return(null); } if (this.color != "") { xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_menulink_style")), (XVar)(MVCFunctions.Concat("style=\"background-color:", this.color, "\""))); } if (XVar.Pack(MVCFunctions.strlen((XVar)(this.comments)))) { xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_comments")), new XVar(true)); xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_comments_text")), (XVar)(this.comments)); } return(null); }
public virtual XVar assignPageVar(dynamic recordData, dynamic _param_xt_packed, dynamic _param_name, dynamic _param_value) { #region packeted values XTempl _param_xt = XVar.UnPackXTempl(_param_xt_packed); #endregion #region pass-by-value parameters XTempl xt = XVar.Clone(_param_xt); dynamic name = XVar.Clone(_param_name); dynamic value = XVar.Clone(_param_value); #endregion if (XVar.Equals(XVar.Pack(recordData), XVar.Pack(null))) { xt.assign((XVar)(name), (XVar)(value)); } else { recordData.InitAndSetArrayItem(value, name); } return(null); }
public SearchPanel(dynamic var_params) { CommonFunctions.RunnerApply(this, (XVar)(var_params)); this.searchClauseObj = this.pageObj.searchClauseObj; this.id = XVar.Clone(this.pageObj.id); this.pSet = XVar.UnPackProjectSettings(this.pageObj.pSetSearch); this.tName = XVar.Clone(this.pageObj.searchTableName); this.xt = XVar.UnPackXTempl(this.pageObj.xt); this.panelState = XVar.Clone(this.searchClauseObj.getSrchPanelAttrs()); this.isUseAjaxSuggest = XVar.Clone(this.pSet.isUseAjaxSuggest()); if (XVar.Pack(this.pageObj.mobileTemplateMode())) { this.isUseAjaxSuggest = new XVar(false); } this.searchControlBuilder = XVar.Clone(new PanelSearchControl((XVar)(this.id), (XVar)(this.tName), (XVar)(this.searchClauseObj), (XVar)(this.pageObj))); if (XVar.Pack(!(XVar)(var_params.KeyExists("panelSearchFields")))) { this.panelSearchFields = XVar.Clone(this.pSet.getPanelSearchFields()); } if (XVar.Pack(!(XVar)(var_params.KeyExists("allSearchFields")))) { this.allSearchFields = XVar.Clone(this.pSet.getAllSearchFields()); } }
public virtual XVar prepareForms(dynamic _param_xt_packed, dynamic _param_itemsToHide, dynamic _param_recordItemsToHide, dynamic _param_pageObject) { #region packeted values XTempl _param_xt = XVar.UnPackXTempl(_param_xt_packed); #endregion #region pass-by-value parameters XTempl xt = XVar.Clone(_param_xt); dynamic itemsToHide = XVar.Clone(_param_itemsToHide); dynamic recordItemsToHide = XVar.Clone(_param_recordItemsToHide); dynamic pageObject = XVar.Clone(_param_pageObject); #endregion dynamic cellMaps = XVar.Array(), formItems = XVar.Array(), formTags = XVar.Array(), helper = XVar.Array(), invisibleItems = XVar.Array(), present = null, ps = null, visibleCellsMap = XVar.Array(); if (XVar.Pack(pageObject)) { ps = XVar.Clone(pageObject.pSet); } else { ps = XVar.Clone(new ProjectSettings((XVar)(CommonFunctions.GetTableByShort((XVar)(this.table))), (XVar)(this.page["type"]), (XVar)(this.page["id"]))); } helper = ps.helperFormItems(); invisibleItems = XVar.Clone(itemsToHide); GlobalVars.mediaType = XVar.Clone((XVar.Pack(pageObject.pdfJsonMode()) ? XVar.Pack(Constants.MEDIA_DESKTOP) : XVar.Pack(CommonFunctions.getMediaType()))); foreach (KeyValuePair <XVar, dynamic> visibility in helper["itemVisiblity"].GetEnumerator()) { if (XVar.Pack(!(XVar)(visibleOnMedia((XVar)(GlobalVars.mediaType), (XVar)(visibility.Value))))) { invisibleItems.InitAndSetArrayItem(true, visibility.Key); } } visibleCellsMap = XVar.Clone(XVar.Array()); cellMaps = ps.helperCellMaps(); foreach (KeyValuePair <XVar, dynamic> loc in MVCFunctions.array_keys((XVar)(cellMaps)).GetEnumerator()) { dynamic formRecordItemsToHide = XVar.Array(), hMap = null; formRecordItemsToHide = XVar.Clone(XVar.Array()); foreach (KeyValuePair <XVar, dynamic> itemRecords in recordItemsToHide.GetEnumerator()) { if (helper["itemForms"][itemRecords.Key] == loc.Value) { formRecordItemsToHide.InitAndSetArrayItem(MVCFunctions.array_keys((XVar)(itemRecords.Value)), itemRecords.Key); } } hMap = prepareGrid((XVar)(xt), (XVar)(invisibleItems), (XVar)(formRecordItemsToHide), (XVar)(new CellMapPD((XVar)(cellMaps[loc.Value]))), (XVar)(loc.Value), (XVar)(pageObject)); if (XVar.Pack(pageObject)) { visibleCellsMap.InitAndSetArrayItem(prepareClientCellMap((XVar)(cellMaps[loc.Value]), (XVar)(hMap)), loc.Value); } } if (XVar.Pack(pageObject)) { pageObject.setPageData(new XVar("cellMaps"), (XVar)(visibleCellsMap)); } if (XVar.Pack(!(XVar)(pageObject.pdfJsonMode()))) { foreach (KeyValuePair <XVar, dynamic> item in MVCFunctions.array_keys((XVar)(invisibleItems)).GetEnumerator()) { if (XVar.Pack(itemsToHide[item.Value])) { xt.assign((XVar)(MVCFunctions.Concat("item_", item.Value)), new XVar("data-hidden")); } else { xt.assign((XVar)(MVCFunctions.Concat("item_", item.Value)), new XVar("data-media-hidden")); } } } else { foreach (KeyValuePair <XVar, dynamic> item in MVCFunctions.array_keys((XVar)(invisibleItems)).GetEnumerator()) { xt.assign((XVar)(MVCFunctions.Concat("item_hide_", item.Value)), new XVar("1")); } } if (XVar.Pack(pageObject)) { foreach (KeyValuePair <XVar, dynamic> itemRecords in recordItemsToHide.GetEnumerator()) { foreach (KeyValuePair <XVar, dynamic> recordId in MVCFunctions.array_keys((XVar)(itemRecords.Value)).GetEnumerator()) { pageObject.hideRecordItem((XVar)(itemRecords.Key), (XVar)(recordId.Value)); } } } xt.assign(new XVar("firstAboveGridCell"), new XVar(true)); formTags = helper["formXtTags"]; foreach (KeyValuePair <XVar, dynamic> loc in MVCFunctions.array_keys((XVar)(formTags)).GetEnumerator()) { present = new XVar(false); foreach (KeyValuePair <XVar, dynamic> tag in formTags[loc.Value].GetEnumerator()) { if (XVar.Pack(xt.getVar((XVar)(tag.Value)))) { present = new XVar(true); break; } } if (XVar.Pack(!(XVar)(present))) { xt.assign((XVar)(MVCFunctions.Concat(loc.Value, "_block")), new XVar(false)); } } formItems = helper["formItems"]; foreach (KeyValuePair <XVar, dynamic> loc in MVCFunctions.array_keys((XVar)(formItems)).GetEnumerator()) { present = new XVar(false); foreach (KeyValuePair <XVar, dynamic> item in formItems[loc.Value].GetEnumerator()) { if (XVar.Pack(!(XVar)(invisibleItems.KeyExists(item.Value)))) { present = new XVar(true); break; } } if (XVar.Pack(!(XVar)(present))) { xt.assign((XVar)(MVCFunctions.Concat("form_", loc.Value)), new XVar("data-hidden")); } } return(null); }
public virtual XVar prepareGrid(dynamic _param_xt_packed, dynamic _param_itemsToHide, dynamic _param_recordItemsToHide, dynamic cellMap, dynamic _param_location, dynamic _param_pageObject) { #region packeted values XTempl _param_xt = XVar.UnPackXTempl(_param_xt_packed); #endregion #region pass-by-value parameters XTempl xt = XVar.Clone(_param_xt); dynamic itemsToHide = XVar.Clone(_param_itemsToHide); dynamic recordItemsToHide = XVar.Clone(_param_recordItemsToHide); dynamic location = XVar.Clone(_param_location); dynamic pageObject = XVar.Clone(_param_pageObject); #endregion dynamic checkRecordItems = null, hiddenColsRows = XVar.Array(), hidingMap = null, recordsToCheck = XVar.Array(), removedColsRows = XVar.Array(), visibleWidth = null; checkRecordItems = XVar.Clone(!(XVar)(!(XVar)(MVCFunctions.count(recordItemsToHide)))); recordsToCheck = XVar.Clone(XVar.Array()); foreach (KeyValuePair <XVar, dynamic> dummy in cellMap.cells.GetEnumerator()) { dynamic cMapRef = XVar.Array(), hidden = null, var_empty = null, visibleItems = XVar.Array(); cMapRef = cellMap.cells[dummy.Key]; if (XVar.Pack(cMapRef["fixedAtClient"])) { continue; } var_empty = new XVar(false); if (XVar.Pack(!(XVar)(cMapRef["fixedAtServer"]))) { var_empty = new XVar(true); foreach (KeyValuePair <XVar, dynamic> item in cMapRef["tags"].GetEnumerator()) { if (XVar.Pack(xt.getVar((XVar)(item.Value)))) { var_empty = new XVar(false); break; } } } hidden = new XVar(true); visibleItems = XVar.Clone(XVar.Array()); foreach (KeyValuePair <XVar, dynamic> item in cMapRef["items"].GetEnumerator()) { if (XVar.Pack(!(XVar)(itemsToHide[item.Value]))) { hidden = new XVar(false); if (XVar.Pack(checkRecordItems)) { visibleItems.InitAndSetArrayItem(true, item.Value); } else { break; } } } if ((XVar)((XVar)((XVar)(checkRecordItems) && (XVar)(!(XVar)(hidden))) && (XVar)(!(XVar)(var_empty))) && (XVar)(visibleItems)) { cMapRef.InitAndSetArrayItem(findHiddenRecords((XVar)(visibleItems), (XVar)(recordItemsToHide)), "hiddenRecords"); recordsToCheck = XVar.Clone(CommonFunctions.addToAssocArray((XVar)(recordsToCheck), (XVar)(cMapRef["hiddenRecords"]))); } if (XVar.Pack(var_empty)) { cMapRef.InitAndSetArrayItem(true, "removable"); } if (XVar.Pack(hidden)) { cMapRef.InitAndSetArrayItem(true, "hidable"); } } removedColsRows = XVar.Clone(cellMap.removeRowsColumns(new XVar("removable"))); hidingMap = XVar.Clone(cellMap.makeClone()); hiddenColsRows = XVar.Clone(hidingMap.removeRowsColumns(new XVar("hidable"))); visibleWidth = XVar.Clone(cellMap.width - MVCFunctions.count(hiddenColsRows["cols"])); xt.assign((XVar)(MVCFunctions.Concat("formwidth_", location)), (XVar)(visibleWidth)); if (XVar.Pack(!(XVar)(pageObject.pdfJsonMode()))) { foreach (KeyValuePair <XVar, dynamic> row in removedColsRows["rows"].GetEnumerator()) { xt.assign((XVar)(MVCFunctions.Concat("row_", location, "_", row.Value)), new XVar("data-hidden")); } foreach (KeyValuePair <XVar, dynamic> row in hiddenColsRows["rows"].GetEnumerator()) { xt.assign((XVar)(MVCFunctions.Concat("row_", location, "_", row.Value)), new XVar("data-hidden")); } } else { dynamic col = null, row = null; row = new XVar(0); for (; row < cellMap.height; ++(row)) { xt.assign((XVar)(MVCFunctions.Concat("row_", location, "_", row)), new XVar(true)); } foreach (KeyValuePair <XVar, dynamic> _row in removedColsRows["rows"].GetEnumerator()) { xt.assign((XVar)(MVCFunctions.Concat("row_", location, "_", _row.Value)), new XVar(false)); } foreach (KeyValuePair <XVar, dynamic> _row in hiddenColsRows["rows"].GetEnumerator()) { xt.assign((XVar)(MVCFunctions.Concat("row_", location, "_", _row.Value)), new XVar(false)); } col = new XVar(0); for (; col < cellMap.width; ++(col)) { xt.assign((XVar)(MVCFunctions.Concat("col_", location, "_", col)), new XVar(true)); } foreach (KeyValuePair <XVar, dynamic> _col in removedColsRows["cols"].GetEnumerator()) { xt.assign((XVar)(MVCFunctions.Concat("col_", location, "_", _col.Value)), new XVar(false)); } foreach (KeyValuePair <XVar, dynamic> _col in hiddenColsRows["cols"].GetEnumerator()) { xt.assign((XVar)(MVCFunctions.Concat("col_", location, "_", _col.Value)), new XVar(false)); } } foreach (KeyValuePair <XVar, dynamic> cMap in cellMap.cells.GetEnumerator()) { dynamic dummyData = null; if ((XVar)(0 == MVCFunctions.count(cMap.Value["rows"])) || (XVar)(0 == MVCFunctions.count(cMap.Value["cols"]))) { continue; } xt.assign((XVar)(MVCFunctions.Concat("cellblock_", location, "_", cMap.Key)), new XVar(true)); dummyData = new XVar(null); assignCellAttrs((XVar)(hidingMap), (XVar)(cMap.Key), (XVar)(location), (XVar)(pageObject), (XVar)(xt), (XVar)(dummyData)); } if (XVar.Pack(checkRecordItems)) { foreach (KeyValuePair <XVar, dynamic> dummy in recordsToCheck.GetEnumerator()) { dynamic hiddenRecordRows = XVar.Array(), recordData = XVar.Array(), recordHidingMap = null; recordHidingMap = XVar.Clone(hidingMap.makeClone()); recordHidingMap.setRecordId((XVar)(dummy.Key)); hiddenRecordRows = XVar.Clone(recordHidingMap.removeRowsColumns(new XVar("hidable"), new XVar(true))); recordData = pageObject.findRecordAssigns((XVar)(dummy.Key)); if (XVar.Pack(!(XVar)(pageObject.pdfJsonMode()))) { foreach (KeyValuePair <XVar, dynamic> row in hiddenRecordRows["rows"].GetEnumerator()) { recordData.InitAndSetArrayItem("data-hidden", MVCFunctions.Concat("row_", location, "_", row.Value)); } } else { foreach (KeyValuePair <XVar, dynamic> row in hiddenRecordRows["rows"].GetEnumerator()) { recordData.InitAndSetArrayItem(false, MVCFunctions.Concat("row_", location, "_", row.Value)); } } foreach (KeyValuePair <XVar, dynamic> cMap in cellMap.cells.GetEnumerator()) { if ((XVar)(0 == MVCFunctions.count(cMap.Value["rows"])) || (XVar)(0 == MVCFunctions.count(cMap.Value["cols"]))) { continue; } assignCellAttrs((XVar)(recordHidingMap), (XVar)(cMap.Key), (XVar)(location), (XVar)(pageObject), (XVar)(xt), (XVar)(recordData), new XVar(true)); } } } return(hidingMap); }
public virtual XVar assignMenuAttrsToTempl(dynamic xt_packed, dynamic _param_visibleElementIds = null) { #region packeted values XTempl xt = XVar.UnPackXTempl(xt_packed); #endregion #region default values if (_param_visibleElementIds as Object == null) { _param_visibleElementIds = new XVar(XVar.Array()); } #endregion #region pass-by-value parameters dynamic visibleElementIds = XVar.Clone(_param_visibleElementIds); #endregion dynamic displayElement = null, i = null, showSubmenu = null; prepareWelcomeMenuItem((XVar)(xt)); if (XVar.Pack(isSeparator())) { if (this.name == "-------") { xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_separator")), new XVar("<hr>")); } else { xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_separator")), (XVar)(MVCFunctions.Concat("<a class=\"rnr-menu-usrsep\" style=\"", this.style, "\">", this.name, "</a>"))); } xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_optionattrs")), new XVar("disabled")); } if ((XVar)((XVar)((XVar)(!(XVar)(isShowAsGroup())) && (XVar)(!(XVar)(isShowAsLink()))) && (XVar)(!(XVar)(isSeparator()))) && (XVar)(this.id != 0)) { return(null); } if (XVar.Pack(isShowAsGroup())) { xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_groupimage")), new XVar(true)); xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_groupclass")), new XVar("group")); } displayElement = new XVar(true); showSubmenu = new XVar(true); if (XVar.Pack(visibleElementIds)) { displayElement = XVar.Clone(visibleElementIds[this.id]); if (XVar.Pack(!(XVar)(this.parentItem))) { showSubmenu = new XVar(true); } else { showSubmenu = XVar.Clone(!(XVar)(visibleElementIds.KeyExists(this.parentItem.id))); } } if (XVar.Pack(displayElement)) { xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_menulink")), new XVar(true)); } xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_nbsps")), (XVar)(makeOffset((XVar)(this.depth)))); if ((XVar)(isShowAsLink()) || (XVar)(isShowAsGroup())) { assignLinks((XVar)(xt), (XVar)(showSubmenu)); } i = new XVar(0); for (; i < MVCFunctions.count(this.children); i++) { this.children[i].assignMenuAttrsToTempl((XVar)(xt), (XVar)(visibleElementIds)); } return(null); }
public virtual XVar assignLinks(dynamic xt_packed, dynamic _param_showSubmenu = null) { #region packeted values XTempl xt = XVar.UnPackXTempl(xt_packed); #endregion #region default values if (_param_showSubmenu as Object == null) { _param_showSubmenu = new XVar(true); } #endregion #region pass-by-value parameters dynamic showSubmenu = XVar.Clone(_param_showSubmenu); #endregion dynamic attrs = XVar.Array(), groupOnlyAttrs = XVar.Array(), groupOnlyMode = null, link_attrs = null, option_attrs = null, title = null; title = XVar.Clone(this.title); if ((XVar)((XVar)(isBootstrap()) && (XVar)(isShowAsGroup())) && (XVar)(!(XVar)(isWelcome()))) { if (XVar.Pack(!(XVar)(isTreelike()))) { if (XVar.Pack(showSubmenu)) { title = MVCFunctions.Concat(title, "<span class=\"caret\"></span>"); } else { title = XVar.Clone(MVCFunctions.Concat("<span class=\"glyphicon glyphicon-triangle-right\"></span>", title)); } } else { title = XVar.Clone(MVCFunctions.Concat("<span class=\"menu-triangle glyphicon glyphicon-triangle-right\"></span>", title)); } } title = XVar.Clone(MVCFunctions.Concat(getIconHTML(), " ", title)); xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_title")), (XVar)(title)); attrs = XVar.Clone(getMenuItemAttributes((XVar)(showSubmenu))); groupOnlyAttrs = XVar.Clone(XVar.Array()); groupOnlyAttrs.InitAndSetArrayItem(true, "id"); groupOnlyAttrs.InitAndSetArrayItem(true, "title"); groupOnlyAttrs.InitAndSetArrayItem(true, "style"); groupOnlyAttrs.InitAndSetArrayItem(true, "class"); groupOnlyAttrs.InitAndSetArrayItem(true, "data-toggle"); groupOnlyAttrs.InitAndSetArrayItem(true, "data-target"); groupOnlyAttrs.InitAndSetArrayItem(true, "aria-haspopup"); groupOnlyAttrs.InitAndSetArrayItem(true, "aria-expanded"); groupOnlyMode = XVar.Clone((XVar)(!(XVar)(isShowAsLink())) && (XVar)(isShowAsGroup())); if ((XVar)((XVar)(isBootstrap()) && (XVar)(groupOnlyMode)) && (XVar)(!(XVar)(isTreelike()))) { dynamic childWithLink = null; childWithLink = XVar.Clone(getFirstChildWithLink()); if (XVar.Pack(childWithLink)) { dynamic linkChildAttrs = XVar.Array(); groupOnlyAttrs.InitAndSetArrayItem(true, "href"); linkChildAttrs = XVar.Clone(childWithLink.getMenuItemAttributes()); attrs.InitAndSetArrayItem(linkChildAttrs["href"], "href"); } } option_attrs = new XVar(""); link_attrs = new XVar(""); foreach (KeyValuePair <XVar, dynamic> value in attrs.GetEnumerator()) { if ((XVar)(groupOnlyMode) && (XVar)(!(XVar)(groupOnlyAttrs[value.Key]))) { continue; } if (XVar.Pack(!(XVar)(value.Value))) { continue; } if ((XVar)(value.Key == "value") || (XVar)(value.Key == "link")) { option_attrs = MVCFunctions.Concat(option_attrs, " ", value.Key, "=\"", value.Value, "\""); } else { link_attrs = MVCFunctions.Concat(link_attrs, " ", value.Key, "=\"", value.Value, "\""); } } if (XVar.Pack(groupOnlyMode)) { option_attrs = new XVar("disabled"); } xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_menulink_attrs")), (XVar)(link_attrs)); xt.assign((XVar)(MVCFunctions.Concat("item", this.id, "_optionattrs")), (XVar)(option_attrs)); return(null); }