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  * @require plugins/Tool.js
 12  * @require GeoExt/widgets/Action.js
 13  */
 14 
 15 /**
 16  * @namespace framework.plugins
 17  */
 18 Ext.ns("framework.plugins");
 19 
 20 /** 
 21  * Class to manage loads of local layer in several formats.
 22  * @name_ ManagementUsers
 23  * @class Class to manage loads of local layer in several formats.
 24  * @constructor
 25  * @extends <a target="_blank" href="http://gxp.opengeo.org/master/doc/lib/plugins/Tool.html">gxp.plugins.Tool</a>
 26  */
 27 framework.plugins.ManagementUsers = Ext.extend(gxp.plugins.Tool, 
 28 /** 
 29 * @lends framework.plugins.ManagementUsers.prototype 
 30 */
 31 {
 32      /**
 33     * framework_importlocallayeraction plugin type.
 34     * @public
 35     * @type String
 36     */
 37     ptype: 'framework_managementusers',
 38     
 39     /**
 40     * Text for zoom in action tooltip (i18n).
 41     * @public
 42     * @type string
 43     */
 44     tooltipText: "Gestione utenti",
 45     
 46     /** 
 47     * The names of the css classes that define the icons of the buttons created 
 48     * @public
 49     * @type String
 50     */
 51     iconCls: "gxp-icon-manageusers",
 52     
 53     /** Adds actions to be performed on click.
 54     * @public
 55     */  
 56     addActions: function() {
 57         var map = this.target.mapPanel.map;
 58         var action = new GeoExt.Action({
 59             iconCls: this.iconCls,
 60             tooltip: this.tooltipText,
 61             map: map,
 62             handler: function() {  
 63                 
 64                 var userManag = new framework.widgets.UsersManagement({
 65                     id: "userManagement",
 66                     collapsed: false,
 67                     height: 370,
 68                     //title: 'Gestione utenti',
 69                     layout: 'fit',
 70                     autoScroll:true,
 71                     userAuthDS: this.userAuthDS,
 72                     servletsObj: this.servletsObj,
 73                     buttons: [{
 74                         text: 'Annulla',
 75                         handler: function() {
 76                           this.userManagWindow.hide();
 77                         //  _self.win.destroy();
 78                         },
 79                         scope:this
 80                     }]
 81                 });
 82                 this.userManagWindow = new Ext.Window({
 83                     id: 'usermanagwindow',
 84                     modal: true,
 85                     plain: true,
 86                     closable: false,
 87                     title: 'Gestione utenti',
 88                     height: 400,
 89                     width: Object.keys(this.userAuthDS).length > 2 ? 420:350,
 90                     border: false,
 91                     items: [
 92                         userManag
 93                     ]
 94                 });
 95                 this.userManagWindow.show();
 96                
 97             
 98                 //GeoExt.ux.data.Import.KMLImport(map, null);         
 99             }, scope:this
100         });
101         return framework.plugins.ManagementUsers.superclass.addActions.apply(this, [action]);
102     }
103 });
104 
105 Ext.preg(framework.plugins.ManagementUsers.prototype.ptype, framework.plugins.ManagementUsers);
106