Main.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. MWF.xDesktop.requireApp("Setting", "Document", null, false);
  2. MWF.xDesktop.requireApp("Setting", "SettingBase", null, false);
  3. MWF.xDesktop.requireApp("Setting", "SettingMobile", null, false);
  4. MWF.xDesktop.requireApp("Setting", "SettingCloud", null, false);
  5. MWF.xDesktop.requireApp("Setting", "SettingEmpty", null, false);
  6. MWF.xDesktop.requireApp("Setting", "SettingLoginUI", null, false);
  7. MWF.xDesktop.requireApp("Setting", "SettingIndexUI", null, false);
  8. MWF.xDesktop.requireApp("Setting", "SettingModuleUI", null, false);
  9. MWF.xDesktop.requireApp("Setting", "SettingModuleService", null, false);
  10. MWF.xDesktop.requireApp("Setting", "SettingModuleResource", null, false);
  11. MWF.xApplication.Setting.Main = new Class({
  12. Extends: MWF.xApplication.Common.Main,
  13. Implements: [Options, Events],
  14. options: {
  15. "style": "default",
  16. "name": "Setting",
  17. "icon": "icon.png",
  18. "width": "1020",
  19. "height": "660",
  20. "title": MWF.xApplication.Setting.LP.title
  21. },
  22. onQueryLoad: function(){
  23. this.lp = MWF.xApplication.Setting.LP;
  24. this.actions = MWF.Actions.get("x_program_center");
  25. //this.actions = new MWF.xApplication.Setting.Actions.RestActions();
  26. },
  27. loadApplication: function(callback){
  28. debugger;
  29. this.baseAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
  30. //this.uiAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
  31. this.mobileAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
  32. this.cloudAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
  33. this.disposeAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
  34. // this.serverAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
  35. // this.applicationAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
  36. // this.resourceAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
  37. // this.mobileAreaNode = new Element("div", {"styles": this.css.tabAreaNode}).inject(this.content);
  38. MWF.require("MWF.widget.Tab", function(){
  39. this.tab = new MWF.widget.Tab(this.content, {"style": "administrator"});
  40. this.tab.load();
  41. this.basePage = this.tab.addTab(this.baseAreaNode, this.lp.tab_base, false);
  42. // this.uiPage = this.tab.addTab(this.uiAreaNode, this.lp.tab_ui, false);
  43. this.cloudPage = this.tab.addTab(this.cloudAreaNode, this.lp.tab_cloud, false);
  44. this.mobilePage = this.tab.addTab(this.mobileAreaNode, this.lp.tab_mobile, false);
  45. this.disposePage = this.tab.addTab(this.disposeAreaNode, this.lp.tab_dispose, false);
  46. this.basePage.addEvent("postShow", function(){
  47. if (!this.baseExplorer) this.baseExplorer = new MWF.xApplication.Setting.BaseExplorer(this, this.baseAreaNode);
  48. }.bind(this));
  49. // this.uiPage.addEvent("postShow", function(){
  50. // if (!this.uiExplorer) this.uiExplorer = new MWF.xApplication.Setting.UIExplorer(this, this.uiAreaNode);
  51. // }.bind(this));
  52. this.mobilePage.addEvent("postShow", function(){
  53. if (!this.mobileExplorer) this.mobileExplorer = new MWF.xApplication.Setting.MobileExplorer(this, this.mobileAreaNode);
  54. }.bind(this));
  55. this.cloudPage.addEvent("postShow", function(){
  56. if (!this.emptyExplorer) this.emptyExplorer = new MWF.xApplication.Setting.EmptyExplorer(this, this.cloudAreaNode);
  57. }.bind(this));
  58. this.disposePage.addEvent("postShow", function(){
  59. if (!this.disposeExplorer) this.disposeExplorer = new MWF.xApplication.Setting.DisposeExplorer(this, this.disposeAreaNode);
  60. }.bind(this));
  61. // this.serverPage = this.tab.addTab(this.serverAreaNode, this.lp.tab_Server, false);
  62. // this.applicationPage = this.tab.addTab(this.applicationAreaNode, this.lp.tab_Application, false);
  63. // this.resourcePage = this.tab.addTab(this.resourceAreaNode, this.lp.tab_Resource, false);
  64. // this.mobilePage = this.tab.addTab(this.mobileAreaNode, this.lp.tab_Mobile, false);
  65. // this.serverPage.addEvent("postShow", function(){
  66. // if (!this.serversExplorer) this.serversExplorer = new MWF.xApplication.Setting.ServersExplorer(this);
  67. // }.bind(this));
  68. //
  69. // this.applicationPage.addEvent("postShow", function(){
  70. // if (!this.applicationExplorer) this.applicationExplorer = new MWF.xApplication.Setting.ApplicationsExplorer(this);
  71. // }.bind(this));
  72. //
  73. // this.resourcePage.addEvent("postShow", function(){
  74. // if (!this.resourceExplorer) this.resourceExplorer = new MWF.xApplication.Setting.ResourceExplorer(this);
  75. // }.bind(this));
  76. //
  77. // this.mobilePage.addEvent("postShow", function(){
  78. // if (!this.mobileExplorer) this.mobileExplorer = new MWF.xApplication.Setting.MobileExplorer(this);
  79. // }.bind(this));
  80. this.basePage.showIm();
  81. //this.loadServers();
  82. this.setContentHeight();
  83. this.addEvent("resize", function(){this.setContentHeight();}.bind(this));
  84. }.bind(this));
  85. //MWF.xDesktop.requireApp("Setting", "ApplicationServers", function(){
  86. // this.applicationServerList = new MWF.xApplication.Setting.ApplicationServers(this);
  87. //}.bind(this));
  88. //this.loadApplicationServers();
  89. },
  90. loadTitle: function(){
  91. this.titleBar = new Element("div", {"styles": this.css.titleBar}).inject(this.content);
  92. this.taskTitleTextNode = new Element("div", {"styles": this.css.titleTextNode,"text": this.lp.title}).inject(this.titleBar);
  93. },
  94. setContentHeight: function(node){
  95. var size = this.content.getSize();
  96. //var titleSize = this.titleBar.getSize();
  97. var tabSize = this.tab.tabNodeContainer.getSize();
  98. //var height = size.y-tabSize.y-titleSize.y;
  99. var height = size.y-tabSize.y;
  100. this.tab.pages.each(function(page){
  101. page.contentNodeArea.setStyles({"height": ""+height+"px", "overflow": "auto"})
  102. });
  103. //this.appDeploymentContent.setStyle("height", height);
  104. }
  105. });
  106. MWF.xApplication.Setting.BaseExplorer = new Class({
  107. Implements: [Events],
  108. initialize: function(app, content){
  109. this.app = app;
  110. this.lp = this.app.lp;
  111. this.container = content;
  112. this.actions = this.app.actions;
  113. this.css = this.app.css;
  114. this.naviItems = [];
  115. this.collectData = null;
  116. this.personData = null;
  117. this.tokenData = null;
  118. this.portalData = null;
  119. this.loadDataBack = null;
  120. this.publicData = null;
  121. this.load();
  122. },
  123. getData: function(){
  124. var checkData = function(){
  125. if (this.collectData && this.personData && this.tokenData && this.portalData && this.publicData && this.ternaryData){
  126. if (this.loadDataBack){
  127. var fun = this.loadDataBack;
  128. this.loadDataBack = null;
  129. fun();
  130. }
  131. }
  132. }.bind(this);
  133. this.actions.getCollect(function(json){
  134. this.collectData = json.data;
  135. checkData();
  136. }.bind(this));
  137. this.actions.getPerson(function(json){
  138. this.personData = json.data;
  139. checkData();
  140. }.bind(this));
  141. this.actions.getToken(function(json){
  142. this.tokenData = json.data;
  143. checkData();
  144. }.bind(this));
  145. this.actions.getPortal(function(json){
  146. this.portalData = json.data;
  147. checkData();
  148. }.bind(this));
  149. o2.Actions.load("x_program_center").ConfigAction.getTernaryManagement(function(json){
  150. this.ternaryData = json.data;
  151. checkData();
  152. }.bind(this));
  153. //o2.UD.deletePublicData("faceKeys");
  154. o2.UD.getPublicData("faceKeys", function(json){
  155. if (json){
  156. if (json["api-key"]){
  157. json.api_key = json["api-key"];
  158. delete json["api-key"]
  159. }
  160. if (json["api_secret"]){
  161. json.api_secret = json["api_secret"];
  162. delete json["api_secret"]
  163. }
  164. }
  165. this.publicData = json || {"api": {"api_key":"", "api_secret":""}};
  166. checkData();
  167. }.bind(this));
  168. },
  169. load: function(){
  170. if (MWF.AC.isAdministrator()) this.getData();
  171. this.naviAreaNode = new Element("div", {"styles": this.css.explorerNaviAreaNode}).inject(this.container);
  172. this.naviNode = new Element("div", {"styles": this.css.explorerNaviNode}).inject(this.naviAreaNode);
  173. this.contentAreaNode = new Element("div", {"styles": this.css.explorerContentAreaNode}).inject(this.container);
  174. this.loadNavi();
  175. },
  176. loadNavi: function(){
  177. var json = this.getNaviJson();
  178. json.each(function(navi){
  179. this.naviItems.push(this.createNaviItem(navi));
  180. }.bind(this));
  181. this.naviItems[0].click();
  182. },
  183. createNaviItem: function(navi){
  184. var naviItemNode = new Element("div", {"styles": this.css.naviItemNode}).inject(this.naviNode);
  185. //var naviItemIconNode = new Element("div", {"styles": this.css.naviItemIconNode}).inject(naviItemNode);
  186. naviItemNode.setStyle("background-image", "url(../x_component_Setting/$Main/default/icon/"+navi.icon+".png)");
  187. //var naviItemTextNode = new Element("div", {"styles": this.css.naviItemTextNode}).inject(naviItemNode);
  188. naviItemNode.set("text", navi.text);
  189. naviItemNode.store("navi", navi);
  190. var _self = this;
  191. naviItemNode.addEvent("click", function(){
  192. _self.setNavi(this);
  193. });
  194. return naviItemNode;
  195. },
  196. setNavi: function(item){
  197. var navi = item.retrieve("navi");
  198. this.naviItems.each(function(node){
  199. var itemNavi = node.retrieve("navi");
  200. var content = node.retrieve("content", null);
  201. if (content) content.destroy();
  202. node.eliminate("content");
  203. node.setStyles(this.css.naviItemNode);
  204. node.setStyle("background-image", "url(../x_component_Setting/$Main/default/icon/"+itemNavi.icon+".png)");
  205. }.bind(this));
  206. item.setStyles(this.css.naviItemNode_current);
  207. item.setStyle("background-image", "url(../x_component_Setting/$Main/default/icon/"+navi.icon+"_current.png)");
  208. if (this[navi.action]) this[navi.action](item);
  209. },
  210. getNaviJson: function(){
  211. return [
  212. {
  213. "text": this.app.lp.tab_name,
  214. "icon": "name",
  215. "action": "loadSystemNameSetting"
  216. },
  217. {
  218. "text": this.app.lp.tab_user,
  219. "icon": "user",
  220. "action": "loadSystemPersonSetting"
  221. },
  222. {
  223. "text": this.app.lp.tab_login,
  224. "icon": "login",
  225. "action": "loadSystemLoginSetting"
  226. },
  227. {
  228. "text": this.app.lp.tab_sso,
  229. "icon": "sso",
  230. "action": "loadSystemSSOSetting"
  231. },
  232. {
  233. "text": this.app.lp.tab_config,
  234. "icon": "config",
  235. "action": "loadSystemConfigSetting"
  236. }
  237. ];
  238. },
  239. loadSystemConfigSetting:function(item){
  240. if (MWF.AC.isAdministrator()) {
  241. var appId = "ConfigDesigner";
  242. if (layout.desktop.apps["ConfigDesigner"]){
  243. layout.desktop.apps[appId].setCurrent();
  244. return;
  245. }
  246. layout.openApplication(null, "ConfigDesigner",{
  247. "appId": appId
  248. });
  249. }
  250. },
  251. loadSystemNameSetting: function(item){
  252. if (MWF.AC.isAdministrator()) {
  253. if (this.collectData && this.personData && this.tokenData){
  254. this.baseNameSetting = new MWF.xApplication.Setting.BaseNameDocument(this, this.contentAreaNode);
  255. item.store("content", this.baseNameSetting);
  256. }else{
  257. this.loadDataBack = function(){this.loadSystemNameSetting(item)}.bind(this);
  258. }
  259. }
  260. },
  261. loadSystemPersonSetting: function(item){
  262. if (MWF.AC.isAdministrator()) if (this.collectData && this.personData && this.tokenData){
  263. this.basePersonSetting = new MWF.xApplication.Setting.BasePersonDocument(this, this.contentAreaNode);
  264. item.store("content", this.basePersonSetting);
  265. }else{
  266. this.loadDataBack = function(){this.loadSystemPersonSetting(item)}.bind(this);
  267. }
  268. },
  269. loadSystemLoginSetting: function(item){
  270. if (MWF.AC.isAdministrator()) if (this.collectData && this.personData && this.tokenData){
  271. this.baseLoginSetting = new MWF.xApplication.Setting.BaseLoginDocument(this, this.contentAreaNode);
  272. item.store("content", this.baseLoginSetting);
  273. }else{
  274. this.loadDataBack = function(){this.loadSystemLoginSetting(item)}.bind(this);
  275. }
  276. },
  277. loadSystemSSOSetting: function(item){
  278. if (MWF.AC.isAdministrator()) if (this.collectData && this.personData && this.tokenData){
  279. this.baseLoginSetting = new MWF.xApplication.Setting.BaseSSODocument(this, this.contentAreaNode);
  280. item.store("content", this.baseLoginSetting);
  281. }else{
  282. this.loadDataBack = function(){this.loadSystemSSOSetting(item)}.bind(this);
  283. }
  284. }
  285. });
  286. MWF.xApplication.Setting.MobileExplorer = new Class({
  287. Extends: MWF.xApplication.Setting.BaseExplorer,
  288. initialize: function(app, content){
  289. this.app = app;
  290. this.lp = this.app.lp;
  291. this.container = content;
  292. this.actions = this.app.actions;
  293. this.css = this.app.css;
  294. this.naviItems = [];
  295. this.collectData = null;
  296. this.personData = null;
  297. this.tokenData = null;
  298. this.loadDataBack = null;
  299. this.load();
  300. },
  301. getNaviJson: function(){
  302. return [
  303. {
  304. "text": this.app.lp.tab_cloud_connect,
  305. "icon": "connect",
  306. "action": "loadCloudConnectSetting"
  307. },
  308. {
  309. "text": this.app.lp.tab_mobile_module,
  310. "icon": "module",
  311. "action": "loadMobileModuleSetting"
  312. },
  313. {
  314. "text": this.app.lp.tab_mobile_style,
  315. "icon": "style",
  316. "action": "loadMobileStyleSetting"
  317. },
  318. {
  319. "text": this.app.lp.tab_mobile_mpweixin_menu,
  320. "icon": "style",
  321. "action": "loadMPWeixinMenuSetting"
  322. },
  323. {
  324. "text": this.app.lp.tab_mobile_app_pack,
  325. "icon": "service",
  326. "action": "loadAppPackSetting"
  327. }
  328. ];
  329. },
  330. getData: function(){
  331. var checkData = function(){
  332. if (this.proxyData && this.nativeData && this.imagesData){
  333. if (this.loadDataBack){
  334. var fun = this.loadDataBack;
  335. this.loadDataBack = null;
  336. fun();
  337. }
  338. }
  339. }.bind(this);
  340. this.actions.getProxy(function(json){
  341. this.proxyData = json.data;
  342. checkData();
  343. }.bind(this));
  344. this.actions.mobile_currentStyle(function(json){
  345. this.nativeData = {"indexType": json.data.indexType, "indexPortal": json.data.indexPortal, "simpleMode": json.data.simpleMode, "systemMessageSwitch": json.data.systemMessageSwitch, "nativeAppList": Array.clone(json.data.nativeAppList)};
  346. this.imagesData = {"images": Array.clone(json.data.images)};
  347. //this.indexData = {"indexType": json.data.indexType, "indexId": json.data.indexId};
  348. this.portalData = {"portalList": Array.clone(json.data.portalList)};
  349. delete json.data;
  350. json = null;
  351. checkData();
  352. }.bind(this));
  353. //微信菜单数据
  354. o2.Actions.load("x_program_center").MPWeixinAction.menuWeixinList(function (json) {
  355. if (json.data && json.data.button) {
  356. this.mpweixinListData = json.data.button;
  357. } else {
  358. this.mpweixinListData = [];
  359. }
  360. }.bind(this));
  361. // 微信公众号关注 回复
  362. o2.Actions.load("x_program_center").MPWeixinAction.menuWeixinSubscribe(function (json) {
  363. if (json.data ) {
  364. this.mpweixinSubscribe = json.data;
  365. }
  366. }.bind(this));
  367. },
  368. loadCloudConnectSetting: function(item){
  369. if (MWF.AC.isAdministrator()) if (this.proxyData && this.nativeData && this.imagesData){
  370. this.mobileConnectSetting = new MWF.xApplication.Setting.CloudConnectDocument(this, this.contentAreaNode);
  371. item.store("content", this.mobileConnectSetting);
  372. }else{
  373. this.loadDataBack = function(){this.loadCloudConnectSetting(item)}.bind(this);
  374. }
  375. },
  376. // loadMobileConnectSetting: function(item){
  377. // if (MWF.AC.isAdministrator()) if (this.proxyData && this.nativeData && this.imagesData){
  378. // this.mobileConnectSetting = new MWF.xApplication.Setting.MobileConnectDocument(this, this.contentAreaNode);
  379. // item.store("content", this.mobileConnectSetting);
  380. // }else{
  381. // this.loadDataBack = function(){this.loadMobileConnectSetting(item)}.bind(this);
  382. // }
  383. // },
  384. loadMobileModuleSetting: function(item){
  385. if (MWF.AC.isAdministrator()) if (this.proxyData && this.nativeData && this.imagesData){
  386. this.mobileModuleSetting = new MWF.xApplication.Setting.MobileModuleDocument(this, this.contentAreaNode);
  387. item.store("content", this.mobileModuleSetting);
  388. }else{
  389. this.loadDataBack = function(){this.loadMobileModuleSetting(item)}.bind(this);
  390. }
  391. },
  392. loadMobileStyleSetting: function(item){
  393. if (MWF.AC.isAdministrator()) if (this.proxyData && this.nativeData && this.imagesData){
  394. this.mobileStyleSetting = new MWF.xApplication.Setting.MobileStyleDocument(this, this.contentAreaNode);
  395. item.store("content", this.mobileStyleSetting);
  396. }else{
  397. this.loadDataBack = function(){this.loadMobileStyleSetting(item)}.bind(this);
  398. }
  399. },
  400. loadMPWeixinMenuSetting: function(item) {
  401. if (MWF.AC.isAdministrator()) if (this.proxyData && this.nativeData && this.imagesData){
  402. this.mpweixinMenuSetting = new MWF.xApplication.Setting.MPWeixinMenuSettingDocument(this, this.contentAreaNode);
  403. item.store("content", this.mpweixinMenuSetting);
  404. }else{
  405. this.loadDataBack = function(){this.loadMPWeixinMenuSetting(item)}.bind(this);
  406. }
  407. },
  408. loadAppPackSetting: function(item) {
  409. if (MWF.AC.isAdministrator()) {
  410. this.mobileAppPackOnline = new MWF.xApplication.Setting.AppPackOnlineDocument(this, this.contentAreaNode);
  411. item.store("content", this.mobileAppPackOnline);
  412. }
  413. }
  414. });
  415. // 废弃
  416. // MWF.xApplication.Setting.CloudExplorer = new Class({
  417. // Extends: MWF.xApplication.Setting.BaseExplorer,
  418. // initialize: function(app, content){
  419. // this.app = app;
  420. // this.lp = this.app.lp;
  421. // this.container = content;
  422. // this.actions = this.app.actions;
  423. // this.css = this.app.css;
  424. // this.naviItems = [];
  425. // this.collectData = null;
  426. // this.personData = null;
  427. // this.tokenData = null;
  428. // this.loadDataBack = null;
  429. // this.load();
  430. // },
  431. // getNaviJson: function(){
  432. // return [
  433. // {
  434. // "text": this.app.lp.tab_cloud_connect,
  435. // "icon": "connect",
  436. // "action": "loadCloudConnectSetting"
  437. // }
  438. // ];
  439. // },
  440. // getData: function(){
  441. // var checkData = function(){
  442. // if (this.proxyData && this.nativeData && this.imagesData){
  443. // if (this.loadDataBack){
  444. // var fun = this.loadDataBack;
  445. // this.loadDataBack = null;
  446. // fun();
  447. // }
  448. // }
  449. // }.bind(this);
  450. // this.actions.getProxy(function(json){
  451. // this.proxyData = json.data;
  452. // checkData();
  453. // }.bind(this));
  454. // this.actions.mobile_currentStyle(function(json){
  455. // this.nativeData = {"indexType": json.data.indexType, "indexPortal": json.data.indexPortal, "nativeAppList": Array.clone(json.data.nativeAppList)};
  456. // this.imagesData = {"images": Array.clone(json.data.images)};
  457. // //this.indexData = {"indexType": json.data.indexType, "indexId": json.data.indexId};
  458. // this.portalData = {"portalList": Array.clone(json.data.portalList)};
  459. // delete json.data;
  460. // json = null;
  461. // checkData();
  462. // }.bind(this));
  463. // },
  464. // loadCloudConnectSetting: function(item){
  465. // if (MWF.AC.isAdministrator()) if (this.proxyData && this.nativeData && this.imagesData){
  466. // this.mobileConnectSetting = new MWF.xApplication.Setting.CloudConnectDocument(this, this.contentAreaNode);
  467. // item.store("content", this.mobileConnectSetting);
  468. // }else{
  469. // this.loadDataBack = function(){this.loadCloudConnectSetting(item)}.bind(this);
  470. // }
  471. // },
  472. // });
  473. // O2云 账号登录相关
  474. MWF.xApplication.Setting.EmptyExplorer = new Class({
  475. Extends: MWF.xApplication.Setting.BaseExplorer,
  476. initialize: function(app, content){
  477. this.app = app;
  478. this.lp = this.app.lp;
  479. this.container = content;
  480. this.actions = this.app.actions;
  481. this.css = this.app.css;
  482. this.naviItems = [];
  483. this.collectData = null;
  484. this.personData = null;
  485. this.tokenData = null;
  486. this.loadDataBack = null;
  487. this.load();
  488. },
  489. getNaviJson: function(){
  490. return [
  491. {
  492. "text": this.app.lp.tab_cloud_connect,
  493. "icon": "connect",
  494. "action": "loadCloudConnectSetting"
  495. }
  496. ];
  497. },
  498. getData: function(){
  499. },
  500. loadCloudConnectSetting: function(item){
  501. if (MWF.AC.isAdministrator()) {
  502. this.mobileConnectSetting = new MWF.xApplication.Setting.EmptyDocument(this, this.contentAreaNode);
  503. item.store("content", this.mobileConnectSetting);
  504. }
  505. },
  506. });
  507. MWF.xApplication.Setting.UIExplorer = new Class({
  508. Extends: MWF.xApplication.Setting.BaseExplorer,
  509. initialize: function(app, content){
  510. this.app = app;
  511. this.lp = this.app.lp;
  512. this.container = content;
  513. this.actions = this.app.actions;
  514. this.css = this.app.css;
  515. this.naviItems = [];
  516. this.load();
  517. },
  518. getNaviJson: function(){
  519. return [
  520. {
  521. "text": this.app.lp.tab_ui_index,
  522. "icon": "index",
  523. "action": "loadUIIndexSetting"
  524. },
  525. {
  526. "text": this.app.lp.tab_ui_login,
  527. "icon": "login",
  528. "action": "loadUILoginSetting"
  529. }
  530. ];
  531. },
  532. getData: function(){
  533. },
  534. loadUILoginSetting: function(item){
  535. if (MWF.AC.isAdministrator()){
  536. this.uiLoginSetting = new MWF.xApplication.Setting.UILoginDocument(this, this.contentAreaNode);
  537. item.store("content", this.uiLoginSetting);
  538. }
  539. },
  540. loadUIIndexSetting: function(item){
  541. if (MWF.AC.isAdministrator()) {
  542. this.uiIndexSetting = new MWF.xApplication.Setting.UIIndexDocument(this, this.contentAreaNode);
  543. item.store("content", this.uiIndexSetting);
  544. }
  545. }
  546. });
  547. MWF.xApplication.Setting.DisposeExplorer = new Class({
  548. Extends: MWF.xApplication.Setting.BaseExplorer,
  549. initialize: function(app, content){
  550. this.app = app;
  551. this.lp = this.app.lp;
  552. this.container = content;
  553. this.actions = this.app.actions;
  554. this.css = this.app.css;
  555. this.naviItems = [];
  556. this.load();
  557. },
  558. getNaviJson: function(){
  559. return [
  560. {
  561. "text": this.app.lp.tab_ui_module,
  562. "icon": "module",
  563. "action": "loadUIModuleSetting"
  564. },
  565. {
  566. "text": this.app.lp.tab_ui_resource,
  567. "icon": "resource",
  568. "action": "loadResourceModuleSetting"
  569. },
  570. {
  571. "text": this.app.lp.tab_ui_service,
  572. "icon": "service",
  573. "action": "loadServiceModuleSetting"
  574. },
  575. {
  576. "text": this.app.lp.tab_ui_menu,
  577. "icon": "menu",
  578. "action": "loadMenuSetting"
  579. }
  580. ];
  581. },
  582. getData: function(){
  583. },
  584. loadUIModuleSetting: function(item){
  585. if (MWF.AC.isAdministrator()) {
  586. this.contentAreaNode.empty();
  587. this.uiModuleSetting = new MWF.xApplication.Setting.UIModuleDocument(this, this.contentAreaNode);
  588. item.store("content", this.uiModuleSetting);
  589. }
  590. },
  591. loadServiceModuleSetting: function(item){
  592. if (MWF.AC.isAdministrator()) {
  593. this.contentAreaNode.empty();
  594. this.serviceModuleSetting = new MWF.xApplication.Setting.ServiceModuleDocument(this, this.contentAreaNode);
  595. item.store("content", this.serviceModuleSetting);
  596. }
  597. },
  598. loadResourceModuleSetting: function(item){
  599. if (MWF.AC.isAdministrator()) {
  600. this.contentAreaNode.empty();
  601. this.resourceModuleSetting = new MWF.xApplication.Setting.ResourceModuleDocument(this, this.contentAreaNode);
  602. item.store("content", this.resourceModuleSetting);
  603. }
  604. },
  605. loadMenuSetting: function(item){
  606. if (MWF.AC.isAdministrator()) {
  607. o2.xDesktop.requireApp("Setting", "SettingModuleMenu", function(){
  608. this.moduleMenuSetting = new MWF.xApplication.Setting.ModuleMenuDocument(this, this.contentAreaNode);
  609. item.store("content", this.moduleMenuSetting);
  610. }.bind(this));
  611. }
  612. }
  613. });