public function get_headers($datas = array())
 {
     global $base_path;
     $headers = parent::get_headers($datas);
     $args = array('do' => "get_piwik_script");
     $headers[] = "<script type='text/javascript'>" . $this->generate_piwik_script($datas) . "</script>";
     return $headers;
 }
 public function save_form()
 {
     global $cms_module_common_view_template_choice;
     global $cms_module_common_view_templates;
     global $cms_module_common_view_django_template_content;
     $this->parameters['active_template'] = $this->stripslashes($cms_module_common_view_django_template_content);
     return parent::save_form();
 }
 public function save_form()
 {
     $this->parameters['nb_weight'] = $this->get_value_from_form("nb_weight");
     for ($i = 0; $i < $this->parameters['nb_weight']; $i++) {
         $this->parameters['weight'][$i]['size'] = $this->get_value_from_form("size_" . $i);
         $this->parameters['weight'][$i]['color'] = $this->get_value_from_form("color_" . $i);
     }
     return parent::save_form();
 }
 public function save_form()
 {
     global $cms_module_search_view_help;
     global $cms_module_search_view_title;
     global $cms_module_search_view_link_search_advanced;
     $this->parameters['help'] = $cms_module_search_view_help + 0;
     $this->parameters['title'] = $cms_module_search_view_title;
     $this->parameters['link_search_advanced'] = $cms_module_search_view_link_search_advanced + 0;
     return parent::save_form();
 }
 public function get_headers($datas = array())
 {
     global $lang;
     $headers = parent::get_headers($datas);
     $headers[] = "\n\t\t<script type='text/javascript'>\n\t\t\trequire(['dijit/dijit']);\n\t\t</script>";
     $headers[] = "\n\t\t<script type='text/javascript'>\n\t\t\trequire(['dijit/Calendar']);\n\t\t</script>";
     $headers[] = "<script type='text/javascript' src='" . $this->get_ajax_link(array('do' => "get_js")) . "'/>";
     $headers[] = "<link rel='stylesheet' type='text/css' href='" . $this->get_ajax_link(array('do' => "get_css")) . "'/>";
     return $headers;
 }
 public function save_form()
 {
     global $cms_module_search_view_help;
     global $cms_module_search_view_title;
     global $cms_module_search_view_link_search_advanced;
     global $cms_module_search_view_input_placeholder;
     $this->parameters['help'] = $cms_module_search_view_help + 0;
     $this->parameters['title'] = stripslashes($cms_module_search_view_title);
     $this->parameters['link_search_advanced'] = $cms_module_search_view_link_search_advanced + 0;
     $this->parameters['input_placeholder'] = stripslashes($cms_module_search_view_input_placeholder);
     return parent::save_form();
 }
 public function save_form()
 {
     global $cms_module_common_view_htmlcode_bycurl_url;
     global $cms_module_htmlcode_view_htmlcode_bycurl_auth;
     global $cms_module_htmlcode_view_htmlcode_bycurl_utf8;
     $this->parameters['html_bycurl_url'] = $cms_module_common_view_htmlcode_bycurl_url;
     $this->parameters['html_bycurl_auth'] = $cms_module_htmlcode_view_htmlcode_bycurl_auth;
     if ($cms_module_htmlcode_view_htmlcode_bycurl_utf8) {
         $this->parameters['html_bycurl_utf8'] = 1;
     } else {
         $this->parameters['html_bycurl_utf8'] = 0;
     }
     return parent::save_form();
 }
    public function get_headers($datas = array())
    {
        $headers = parent::get_headers($datas);
        $headers[] = '<script type="text/javascript">
		require(["dojo/_base/window", "dojo/store/Memory", "dojo/store/JsonRest", "dijit/tree/ObjectStoreModel", "dijit/Tree", "dijit/registry", "dojo/domReady!"], function(win, Memory, JsonRest, ObjectStoreModel, Tree, registry){

		var myStore = new JsonRest({
			target: "' . $datas['jsonstore'] . '",
			getChildren: function (object){
 				return this.query({parent: object.id});
 			},
			
		});
		
		// Create the model
	    var myModel = new ObjectStoreModel({
	        store: myStore,
	        query: {id: "root"},
			mayHaveChildren: function(object){
				return object.children;
			}
	    });
	
	    // Create the Tree.
	    var tree = new Tree({
	        model: myModel,
			showRoot: false,
			onClick : function (item,node,evt){
				if(item.explnum_id){
					var url = "./visionneuse.php?lvl=afficheur&explnum="+item.explnum_id;
					registry.byId("' . $this->get_module_dom_id() . '_visualizer").set("content","<iframe src=\'"+url+"\' style=\'border:none;height:99%;width:100%\'></iframe>");
				}
			},
			getIconClass : function (item, opened){
				if(!item.explnum_id){
					return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "dijitLeaf"
				}else{
					return "dijitLeaf"
				}
			}
	    },"' . $this->get_module_dom_id() . '_tree");
	});	
</script>';
        return $headers;
    }
 public function __construct($id = 0)
 {
     parent::__construct($id);
 }
 public function save_form()
 {
     $this->parameters['height'] = $this->get_value_from_form("height");
     $this->parameters['width'] = $this->get_value_from_form("width");
     return parent::save_form();
 }
 public function save_form()
 {
     global $cms_module_common_view_htmlcode;
     $this->parameters['htmlcode'] = $cms_module_common_view_htmlcode;
     return parent::save_form();
 }
    public function get_headers($datas = array())
    {
        $headers = parent::get_headers($datas);
        $headers[] = '<script type="text/javascript">
		require(["dojo/_base/declare", "dojo/_base/window", "dojo/store/Memory", "dojo/store/JsonRest", "dijit/tree/ObjectStoreModel", "dijit/Tree", "dijit/registry", "dojo/topic", "dijit/Tooltip", "dojo/domReady!"], function(declare, win, Memory, JsonRest, ObjectStoreModel, Tree, registry, topic, Tooltip){
		var myStore = new JsonRest({
			target: "' . $datas['jsonstore'] . '",
			getChildren: function (object){
 				return this.query({parent: object.id});
 			},
			getExplnums: function (id){
 				return this.query({parent: id});
 			},
		});
		
		// Create the model
	    var myModel = new ObjectStoreModel({
	        store: myStore,
	        query: {id: "root"},
			mayHaveChildren: function(object){
				return object.children;
			},
	    });
	
	    // Create the Tree.
	    var tree = new Tree({
	        model: myModel,
			showRoot: false,
			onClick : function (item,node,evt){
				if(item.explnum_id){
					var url = "./visionneuse.php?lvl=afficheur&explnum="+item.explnum_id;
  					registry.byId("' . $this->get_module_dom_id() . '_visualizer").set("content","<iframe src=\'"+url+"\' style=\'border:none;height:99%;width:100%\'></iframe>");
					topic.publish("' . $this->get_module_dom_id() . '_openItem", item);
				}
			},
			getIconClass : function (item, opened){
				if(!item.explnum_id){
					return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "dijitLeaf"
				}else{
					return "dijitLeaf"
				}
			},
			switchItem: function(item){
				this._setSelectedNodesAttr(this.getNodesByItem(item));
				this.onClick(item);
			}
	    },"' . $this->get_module_dom_id() . '_tree");
	    new Tooltip({
			connectId: "' . $this->get_module_dom_id() . '_tree",
			selector: "span",
			getContent: function(matchedNode){
				return dijit.getEnclosingWidget(matchedNode).item.name;
			}
		});
	});	
</script>';
        $headers[] = '<script type="text/javascript">
	require(["dojo/_base/declare", "dojo/_base/lang", "dijit/registry", "dojo/dom", "dojo/on", "dojo/ready", "dojo/dom-style", "dojo/topic", "dojo/window"], function(declare, lang, registry, dom, on, ready, domStyle, topic, win){
		ready(function(){
			var Pager = declare(null, {
				domId: "",
				store: "",
				itemClicked: "",
				handlers : "",
				constructor: function(){
					this.handlers = new Array();
					topic.subscribe("' . $this->get_module_dom_id() . '_openItem", lang.hitch(this,this.openedItem));
					this.domId = "' . $this->get_module_dom_id() . '_pager";
					this.model= registry.byId("' . $this->get_module_dom_id() . '_tree").model;
				},
				openedItem: function(item){
					this.itemClicked = item;
					this.model.store.getExplnums(item.parent).then(lang.hitch(this,this.render));
				},
				
				switchPagin: function(item){
					registry.byId("' . $this->get_module_dom_id() . '_tree").switchItem(item);		
				},
				
				render: function(response){
					var content = "<span id=\'pager_current\'>"+this.itemClicked.name+"<\\/span>";
					for(var i=0; i<this.handlers.length ; i++){
						this.handlers[i].remove();
					}	
					if (response.length > 1) {
						previous = next = content = "";		
						for(var i=0 ; i < response.length ; i++){
							if(response[i].id == this.itemClicked.id){
								if(response[i-1]){
									content+= "<span style=\'margin-right:10px;cursor:pointer;\' id=\'pager_previous\' title=\'"+response[i-1].name+"\'>' . $this->format_text($this->msg['cms_module_docnumslist_view_pager_previous']) . '<\\/span>";
									previous = lang.hitch(this,this.switchPagin,response[i-1]);
								}
								content+= "<span id=\'pager_current\' style=\'font-weight:bold;\'>"+this.itemClicked.name+"<\\/span>";
								if(response[i+1]){
									content+= "<span style=\'margin-left:10px;cursor:pointer;\' id=\'pager_next\' title=\'"+response[i+1].name+"\'>' . $this->format_text($this->msg['cms_module_docnumslist_view_pager_next']) . '<\\/span>";
									next = lang.hitch(this,this.switchPagin,response[i+1]);
								}
								break;
							}
						}
					}
					registry.byId(this.domId = "' . $this->get_module_dom_id() . '_pager").set("content", content);
					if(dom.byId("pager_previous")){
						this.handlers.push(on(dom.byId("pager_previous"),"click",previous));
					}
					if(dom.byId("pager_next")){
						this.handlers.push(on(dom.byId("pager_next"),"click",next));
					}
					registry.byId("' . $this->get_module_dom_id() . '_container").resize();
				}
			
			});		
		    var pager = new Pager();				
			var FSSwitcher = declare(null, {
				domId:"",
				style: "",
				state: "",
				fullscreenStyle: "",
				constructor: function(domId){
					var fs = win.getBox();
					this.fullscreenStyle = {
						node: {
							position: "fixed",
							top: "0px",
							left: "0px",
							height: (fs.h)+"px",
							width: (fs.w)+"px",
							background: "rgba(0, 0, 0, 0.5)"
						},
						container: {
							top: (fs.h*0.02)+"px",
							margin: "auto",
							height: (fs.h*0.90)+"px",
							width: (fs.w*0.95)+"px"
						},
						treeContainer: {
							width: ((fs.h*0.90)*0.2)+"px"
						}
					};
					this.style = {};
					this.domId = domId;
					this.saveStyle(dom.byId(this.domId),"node");
					this.saveStyle(registry.byId("' . $this->get_module_dom_id() . '_container").domNode, "container");
					this.saveStyle(registry.byId("' . $this->get_module_dom_id() . '_treeContainer").domNode, "treeContainer");
					this.connect();
				},
				connect: function(){
					on(dom.byId(this.domId+"_fullscreen"),"click",lang.hitch(this,this.clicked));
				},
				clicked: function(){
				
					if(this.state == true){
						this.state = false;
						dom.byId(this.domId+"_fullscreen").innerHTML = "' . $this->msg['cms_module_docnumslist_view_fullsceen'] . '";
						this.setStyle(dom.byId(this.domId),this.style.node);
						this.setStyle(registry.byId("' . $this->get_module_dom_id() . '_container").domNode, this.style.container);
						this.setStyle(registry.byId("' . $this->get_module_dom_id() . '_treeContainer").domNode, this.style.treeContainer);
						registry.byId("' . $this->get_module_dom_id() . '_container").resize();
					}else{
						this.state = true;
						dom.byId(this.domId+"_fullscreen").innerHTML = "' . $this->msg['cms_module_docnumslist_view_reduce'] . '";
						this.setStyle(dom.byId(this.domId),this.fullscreenStyle.node);
						this.setStyle(registry.byId("' . $this->get_module_dom_id() . '_container").domNode, this.fullscreenStyle.container);
						this.setStyle(registry.byId("' . $this->get_module_dom_id() . '_treeContainer").domNode, this.fullscreenStyle.treeContainer);
						registry.byId("' . $this->get_module_dom_id() . '_container").resize();
					}
					
				},
				saveStyle : function(node,type){
					var computedStyle = domStyle.get(node);
					for (key in this.fullscreenStyle[type]){
						if(!this.style[type]){
							this.style[type] = {};
						}
						if(!this.style[type]){
							this.style[type] = {};
						}
						this.style[type][key] = computedStyle[key];
					}
				},
				setStyle: function(node,newStyle){
					try{
					domStyle.set(node, newStyle);
					}catch(e){}
				}
			});
			switcher = new FSSwitcher("' . $this->get_module_dom_id() . '");
		});
	});	
</script>';
        return $headers;
    }