wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
common.js.php
Go to the documentation of this file.
1 Ext.namespace('wcmf', 'wcmf.grid', 'wcmf.tree');
2 
3 Ext.MessageBox.buttonText.yes = Message.get("Yes");
4 Ext.MessageBox.buttonText.no = Message.get("No");
5 
6 // overrides for IE9
7 Ext.isIE9 = Ext.isIE && (/msie 9/).test(navigator.userAgent.toLowerCase());
8 if (Ext.isIE9) {
9  if (typeof Range.prototype.createContextualFragment == "undefined") {
10  Range.prototype.createContextualFragment = function (html) {
11  var doc = window.document;
12  var container = doc.createElement("div");
13  container.innerHTML = html;
14  var frag = doc.createDocumentFragment(), n;
15  while ((n = container.firstChild)) {
16  frag.appendChild(n);
17  }
18  return frag;
19  };
20  }
21  Ext.override(Ext.tree.TreeEventModel, {
22  getNode: function (e) {
23  var t;
24  if (t = e.getTarget('.x-tree-node-el', 10)) {
25  //var id = Ext.fly(t, '_treeEvents').getAttribute('tree-node-id', 'ext');// BUG !!!
26  var id = e.getTarget('.x-tree-node-el', 10).getAttribute("ext:tree-node-id") // FIX!!!
27  if (id) {
28  return this.tree.getNodeById(id);
29  }
30  }
31  return null;
32  }
33  });
34 }
35 
36 /**
37  * Global datatype mapping from wcmf
38  */
40 
41 /**
42  * @class Action
43  */
44 Action = function() {};
45 
46 /**
47  * Perform a wcmf action as Ajax request
48  * @param action The name of the action
49  * @param customParams An object defining custom parameters to be passed to the next controller
50  * @param callback The function to call after execution
51  * @param scope The scope in which to execute the callback function. The handler function's "this" context.
52  */
53 Action.perform = function(action, customParams, callback, scope) {
54  // define the call parameters
55  var callParams = {controller:'<?php echo $controller; ?>', context:'<?php echo $context; ?>', usr_action:action, sid:'<?php echo session_id() ?>'};
56  for (var i in customParams)
57  callParams[i] = customParams[i];
58 
59  // create the proxy and do the request
60  var proxy = new Ext.data.HttpProxy({
61  url: '<?php echo $APP_URL; ?>'
62  });
63  proxy.load(callParams, null, callback, scope);
64 };
get($message, $parameters=null, $domain='', $lang='')
const DATATYPE_ATTRIBUTE
const DATATYPE_ELEMENT
const DATATYPE_IGNORE
Use the Message class to output messages. You need not instantiate a Message object because the metho...
const DATATYPE_DONTCARE