Exemple #1
0
 public virtual XVar createElementContainers()
 {
     foreach (KeyValuePair <XVar, dynamic> elem in this.pSet.getDashboardElements().GetEnumerator())
     {
         dynamic contentHtml = null, dbElementAttrs = null, style = null;
         if (XVar.Pack(!(XVar)(this.elementsPermissions[elem.Key])))
         {
             continue;
         }
         style = new XVar("");
         if (XVar.Pack(isBootstrap()))
         {
             dynamic selectors = XVar.Array();
             if (XVar.Pack(elem.Value["width"]))
             {
                 selectors = XVar.Clone(XVar.Array());
             }
             selectors.InitAndSetArrayItem(MVCFunctions.Concat("#dashelement_", elem.Value["elementName"], this.id, " > * > .tab-content > * > * > * > .panel > .panel-body"), null);
             selectors.InitAndSetArrayItem(MVCFunctions.Concat("#dashelement_", elem.Value["elementName"], this.id, " > * > .tab-content > * > * > .panel > .panel-body"), null);
             selectors.InitAndSetArrayItem(MVCFunctions.Concat("#dashelement_", elem.Value["elementName"], this.id, " > .panel > .panel-body"), null);
             selectors.InitAndSetArrayItem(MVCFunctions.Concat("#dashelement_", elem.Value["elementName"], this.id, " > .bs-containedpage > .panel > .panel-body"), null);
             style = MVCFunctions.Concat(style, MVCFunctions.join(new XVar(",\n"), (XVar)(selectors)), " {\r\n\t\t\t\t\t\twidth: ", elem.Value["width"], "px;\r\n\t\t\t\t\t\toverflow-x: auto;\r\n\t\t\t\t\t}");
             if (XVar.Pack(elem.Value["height"]))
             {
                 style = MVCFunctions.Concat(style, "#dashelement_", elem.Value["elementName"], this.id, " > .panel > .panel-body,\r\n\t\t\t\t\t\t#dashelement_", elem.Value["elementName"], this.id, " > * > .tab-content > * > * > * > .panel > .panel-body, \r\n\t\t\t\t\t\t#dashelement_", elem.Value["elementName"], this.id, " > * > .tab-content > * > * > .panel > .panel-body, \r\n\t\t\t\t\t\t#dashelement_", elem.Value["elementName"], this.id, " > .bs-containedpage > .panel > .panel-body {\r\n\t\t\t\t\t\theight: ", elem.Value["height"], "px;\r\n\t\t\t\t\t\toverflow-y: auto;\r\n\t\t\t\t\t}");
             }
             if (style != XVar.Pack(""))
             {
                 style = XVar.Clone(MVCFunctions.Concat("<style> @media (min-width: 768px){ ", style, " } </style>"));
             }
         }
         contentHtml = new XVar("");
         if (elem.Value["type"] == Constants.DASHBOARD_SNIPPET)
         {
             dynamic method = null, snippetData = XVar.Array();
             method      = XVar.Clone(elem.Value["snippetId"]);
             snippetData = XVar.Clone(MVCFunctions.callDashboardSnippet((XVar)(elem.Value["snippetId"]), (XVar)(this.eventsObject)));
             contentHtml = XVar.Clone(getSnippetHtml((XVar)(snippetData["header"]), (XVar)(snippetData["body"]), (XVar)(elem.Value["width"]), (XVar)(elem.Value["height"])));
         }
         dbElementAttrs = new XVar("");
         if (XVar.Pack(elem.Value["width"]))
         {
             dbElementAttrs = MVCFunctions.Concat(dbElementAttrs, " data-fixed-width");
         }
         if (XVar.Pack(elem.Value["height"]))
         {
             dbElementAttrs = MVCFunctions.Concat(dbElementAttrs, " data-fixed-height");
         }
         this.xt.assign((XVar)(MVCFunctions.Concat("db_", elem.Value["elementName"])), (XVar)(MVCFunctions.Concat(style, "<div ", dbElementAttrs, " class=\"", getElementClass((XVar)(elem.Value)), "\" id=\"dashelement_", elem.Value["elementName"], this.id, "\">", contentHtml, "</div>")));
     }
     return(null);
 }