Pman.Dialog.CmsBlog.bjs
[Pman.Cms] / Pman.Dialog.AddChildElementToPage.bjs
index 8484489..36433b6 100644 (file)
@@ -6,22 +6,21 @@
  "permname" : "",
  "modOrder" : "001",
  "strings" : {
-  "6a5b847af3d97df722040debdbccfbed" : "Page Type",
-  "2d7f1475d69868c106ba9ee5006e76de" : "Edit / Create Category Type",
+  "463ab1bc075f498d1aa03b9bc062efa3" : "Element Type",
+  "9656c9cdb7ecd471b88284047d6d885b" : "Select Element",
   "1243daf593fa297e07ab03bf06d925af" : "Searching...",
   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
-  "20bec77364d863100a1f9325873a8504" : "Select Page Type",
   "c9cc8cce247e49bae79f15173ce97354" : "Save",
-  "779e2624ddf330fb05b51ae59faf212d" : "Select Status Type"
+  "f4b319f11758cc6fe44c71999f7690ac" : "Type of element to add"
  },
  "items" : [
   {
    "listeners" : {
-    "show" : "function (_self)\n{\n  this.form.findField('name').focus();\n\n}"
+    "show" : "function (_self)\n{\n    \n    \n}"
    },
    "collapsible" : false,
+   "title" : "Type of element to add",
    "xtype" : "LayoutDialog",
-   "title" : "Edit / Create Category Type",
    "width" : 400,
    "$ xns" : "Roo",
    "closable" : false,
      "items" : [
       {
        "listeners" : {
-        "|actioncomplete" : "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       //_this.dialog.el.mask(\"Loading\");\n       //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n       return;\n    }\n    if (action.type == 'load') {\n        _this.dialog.el.unmask();\n        return;\n    }\n    if (action.type =='submit') {\n    \n        _this.dialog.el.unmask();\n        _this.dialog.hide();\n    \n         if (_this.callback) {\n            _this.callback.call(_this, _this.form.getValues());\n         }\n         _this.form.reset();\n         return;\n    }\n}\n",
-        "|rendered" : "function (form)\n{\n    _this.form= form;\n}\n"
+        "|actioncomplete" : "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       \n       return;\n    }\n    if (action.type == 'load') {\n        \n        return;\n    }\n    if (action.type =='submit') {\n    \n        _this.dialog.hide();\n    \n         if (_this.callback) {\n            _this.callback.call(_this, _this.form.getFieldValues());\n         }\n         \n         _this.form.reset();\n         \n         return;\n    }\n}\n",
+        "|rendered" : "function (form)\n{\n    _this.form = form;\n}\n"
        },
        "$ url" : "baseURL + '/Roo/cms_category_type.php'",
-       "method" : "POST",
        "xtype" : "Form",
+       "method" : "POST",
        "style" : "margin:10px;",
        "$ xns" : "Roo.form",
        "items" : [
         {
-         "listeners" : {
-          "render" : "function (_self)\n{\n    _this.page_type = _self;\n}",
-          "select" : "function (combo, record, index)\n{\n//    _this.grid.footer.onClick('first');\n    var page_type_name = record.data.name;\n    _this.form.findField('page_type_id_name').setValue(page_type_name);\n    if(page_type_name == 'blog' || page_type_name == 'category'){ // blog || category unset attachment\n        _this.form.findField('is_attachment').setValue(0);\n        return;\n    }\n    if (_this.form) { \n        _this.form.showHide.defer(100, _this.form);      \n    } \n    \n}"
-         },
          "alwaysQuery" : true,
          "listWidth" : 400,
          "triggerAction" : "all",
-         "fieldLabel" : "Page Type",
+         "fieldLabel" : "Element Type",
          "forceSelection" : true,
          "selectOnFocus" : true,
          "pageSize" : 20,
-         "displayField" : "display_name",
-         "emptyText" : "Select Status Type",
-         "hiddenName" : "page_type_id",
+         "displayField" : "name",
+         "emptyText" : "Select Element",
+         "hiddenName" : "element_id",
          "minChars" : 2,
          "valueField" : "id",
          "xtype" : "ComboBox",
          "typeAhead" : false,
          "editable" : false,
          "$ xns" : "Roo.form",
-         "name" : "page_type_id_display_name",
-         "qtip" : "Select Page Type",
-         "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>",
+         "name" : "element_id_name",
+         "qtip" : "Select Element",
+         "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
          "loadingText" : "Searching...",
          "items" : [
           {
            "listeners" : {
-            "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n    o.params.etype = 'cms_page_type'; \n}\n"
+            "|beforeload" : "function (_self, o){\n    \n    o.params = o.params || {};\n    \n    Roo.log(_this.data);\n    \n    if(!_this.data.template_id || _this.data.template_id * 1 < 1){\n        return false;\n    }\n    \n    o.params.template_id = _this.data.template_id;\n    \n}\n"
            },
            "xtype" : "Store",
            "remoteSort" : true,
@@ -86,9 +81,9 @@
            "* prop" : "store",
            "items" : [
             {
-             "$ url" : "baseURL + '/Roo/core_enum.php'",
-             "method" : "GET",
+             "$ url" : "baseURL + '/Roo/Cms_template_element.php'",
              "xtype" : "HttpProxy",
+             "method" : "GET",
              "$ xns" : "Roo.data",
              "* prop" : "proxy"
             },
@@ -96,7 +91,7 @@
              "id" : "id",
              "root" : "data",
              "xtype" : "JsonReader",
-             "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"display_name\",\"type\":\"string\"}]",
+             "$ fields" : "[\n    {\n        \"name\":\"id\",\n        \"type\":\"int\"\n    },\n    {\n        \"name\":\"name\",\n        \"type\":\"string\"\n    }\n]",
              "$ xns" : "Roo.data",
              "* prop" : "reader",
              "totalProperty" : "total"
     },
     {
      "listeners" : {
-      "click" : "function (_self, e)\n{\n    // do some checks?\n     \n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
+      "click" : "function (_self, e)\n{\n    _this.form.doAction(\"submit\");\n\n}"
      },
      "text" : "Save",
      "xtype" : "Button",