1 /** 2 * @fileOverview 3 * Copyright (c) 2013 Regione Autonoma della Sardegna 4 * Published under the GPL license.<br> 5 * See <a href="https://sardegnageoportale.it/webgis/license.txt">https://sardegnageoportale.it/webgis/license.txt</a> 6 * for the full text of the license. 7 * @version 0.1 8 */ 9 10 /** 11 * @namespace framework.plugins 12 */ 13 Ext.namespace("framework.plugins"); 14 15 /** 16 * Provides control for link to info application. 17 * @name_ InfoLinker 18 * @class Provides control for link to info application. 19 * @constructor 20 * @extends <a target="_blank" href="http://gxp.opengeo.org/master/doc/lib/plugins/Tool.html">gxp.plugins.Tool</a> 21 */ 22 framework.plugins.InfoLinker = Ext.extend(gxp.plugins.Tool, 23 /** 24 * @lends framework.plugins.InfoLinker.prototype 25 */ 26 { 27 /** 28 * plugin type. 29 * @public 30 * @type String 31 */ 32 ptype: "framework_infolinker", 33 34 /** 35 * Menu text. 36 * @public 37 * @type String 38 */ 39 menuText: "Informazioni su SardegnaMappe", 40 41 /** 42 * Tooltip text. 43 * @public 44 * @type String 45 */ 46 tooltip: "Regione Autonoma della Sardegna - Info SardegnaMappe", 47 48 49 /** 50 * Css class for icon. 51 * @public 52 * @type String 53 */ 54 iconCls: "gxp-icon-rasinfo", 55 56 /** 57 * html panel content. 58 * @public 59 * @type String 60 */ 61 htmlText: null, 62 63 /** 64 * constrainHeader True to constrain the window header within its containing element. 65 * @public 66 * @type boolean 67 */ 68 constrainHeader : true, 69 70 71 html: '<div class="gx-info-panel">' + 72 '<div class="logoras"></div>' + 73 '<div class="logo"></div>' + 74 '<h1>SardegnaMappe</h1>' + 75 '<h2>versione 6.0</h2>' + 76 '<p><a href="http://www.regione.sardegna.it" target="_blank">Regione Autonoma della Sardegna</a></br /></br />'+ 77 'SardegnaMappe è stato realizzato nell\'ambito del progetto SITR-EVO.<br /><br />' + 78 'Per ulteriori informazioni visita il portale di riferimento ' + 79 '<a href="http://www.sardegnageoportale.it" target="_blank">SardegnaGeoPortale</a><br /><br />'+ 80 '<a href="doc/manuale.pdf" target="_blank">Manuale d\'uso</a><br /><br />'+ 81 'SardegnaMappe รจ stato sviluppato con il Framework OpenSource ' + 82 '<a href="../sardegnamappe_api/" target="_blank">SardegnaMappe API</a>'+ 83 '</p></div>', 84 85 86 /** 87 * @private 88 * @param {Object} config configuration object 89 */ 90 constructor: function(config) { 91 framework.plugins.InfoLinker.superclass.constructor.apply(this, arguments); 92 }, 93 94 /** 95 * Create and append info action 96 * @public 97 * @returns {framework.plugins.InfoLinker} Object with info control inside 98 */ 99 addActions: function() { 100 var self = this; 101 var action = new GeoExt.Action({ 102 xtype: "button", 103 iconCls: this.iconCls, 104 tooltip: this.tooltip, 105 htmlText: this.htmlText, 106 handler: function() { 107 var mapInfo = new Ext.Panel({ 108 title: self.mapInfoText, 109 html:self.htmlText?self.htmlText: self.html, 110 height: 'auto', 111 width: 'auto' 112 }); 113 114 var win = new Ext.Window({ 115 title: "Credits", 116 constrainHeader: this.constrainHeader, 117 modal: true, 118 layout: "fit", 119 width: 300, 120 height: 350, 121 items: [mapInfo] 122 }); 123 win.show(); 124 } 125 }); 126 return framework.plugins.InfoLinker.superclass.addActions.apply(this, [action]); 127 } 128 129 }); 130 131 Ext.preg(framework.plugins.InfoLinker.prototype.ptype, framework.plugins.InfoLinker); 132