Пример #1
0
//fin items
$menu_top = new PhpExt_Panel();
$menu_top->setHeader(true)->setBaseCssClass("PanelClass")->setHeight(70)->setTopToolbar($menu)->setIconCssClass("HeaderClass");
//--------------------------------------------MENU ACORDION-------------------------------------------------------------------------------------------------------//
//trae los items del menu
$tree_loader = new PhpExt_Tree_TreeLoader();
$tree_loader->setDataUrl("/admin/menu");
//armo el nodo root (no es visible)
$root = new PhpExt_Tree_AsyncTreeNode();
$root->setText("Principal Node")->setDraggable(false)->setId("Principal_Node")->setExpanded(true)->setCssClass("feeds-node")->expandChildNodes(false);
$menu_acordion = new PhpExt_Tree_TreePanel();
$menu_acordion->setTitle("Menu Principal")->setId("treePanel")->setWidth(250)->setHeight('fill')->setLines(false)->setAutoScroll(true)->setCollapseFirst(false)->setSingleExpand(true)->setUseArrows(true)->setRootVisible(false)->setRoot($root)->setLoader($tree_loader);
//----------------------------------------PANTALLA PRINCIPAL-------------------------------------------------------------------------------------------------------
$tab_layout = new PhpExt_Layout_TabLayout();
$tab_layout->setDeferredRender(false);
$principal = new PhpExt_TabPanel();
$principal->setActiveTab(0)->setId("TabPanel")->setHideMode(PhpExt_Component::HIDE_MODE_OFFSETS)->setLayout($tab_layout)->setEnableKeyEvents(true)->setenableTabScroll(true);
$onrender = "\n\n\n\n\n//beforeclose\nt.on( 'beforeremove', function(t,c){\n\nvar cnx = new Ext.data.Connection();\nExt.Ajax.request({ url : '/admin/closetab',\n\t\t\t\tmethod : 'POST',\n\t\t\t\tparams : 'tab_id=' + c.id \t\t\t\t\t   \n\t\t\t\t });\n\n});\n";
$principal->attachListener("render", new PhpExt_Listener(PhpExt_Javascript::functionDef(null, $onrender, array("t", "r", "i"))));
$module = new OOB_module('About');
$template_dir = $module->admintpldir() . "/about.tpl";
$html = $ari->t->fetch($template_dir);
$bienvenido = new PhpExt_Panel();
$bienvenido->setTitle("Bienvenido")->setId("panel_bienvenido")->setAutoScroll(true)->setBodyStyle("padding:10px 10px 0")->setHtml($html);
$principal->addItem($bienvenido, new PhpExt_Layout_TabLayoutData(true));
$add_tab_function = "\n\n//oob_download\nExt.DomHelper.append(document.body, {\n                    tag: 'form',\n                    id:'download_form',\n                    frameBorder: 0,\n                    width: 0,\n                    height: 0,\n                    css: 'display:none;visibility:hidden;height:0px;'\n\t\t\t\t\t}); \n\nfunction oob_download( url, params ){\n\nvar form = document.getElementById('download_form');\n\nvar inputs = form.getElementsByTagName('input');\n\nfor (i = 0; i < inputs.length; i++){\n   form.removeChild(inputs[i]); \n}\n\nif( Ext.isArray(params) ){\n\tExt.each( params, function( item, index ){\n\t\tel = document.createElement('input');\n\t\tel = form.appendChild(el);\n\t\tel.name = item.name;\n\t\tel.type = 'hidden';\n\t\tel.value = item.value;\t\n\t});\n}\n\nform.method = 'post';\nform.action = url;\nform.submit();\n\n}\nExt.apply( Ext,{ oob_download : oob_download } );\n//fin oob_download\t\t\t\t\t\n\nvar msgconfig = {\n\t\t   title :'Error',\n\t\tprogress : false,\n\t\t    wait : false,\n\t\t     msg : 'Se produjo un error al cargar la pagina.',\n\t\t buttons : Ext.Msg.OK,\t\t \n\t\t    icon : Ext.MessageBox.ERROR ,\n\t\t\t  fn : function(c,t,o){\n\t\t\t\tExt.MessageBox.getDialog().setTitle(''); \n\t\t\t\tExt.MessageBox.getDialog().hide();\n\t\t\t  }\t\n\t\t}\n\n\n\nExt.Ajax.on('requestexception',function(request,response,f,g,h){\n\t\n\t\t\n\tswitch( response.status ){\n\tcase 401:\n\n\tvar loginDialog = new Ext.ux.form.LoginDialog({\n\t\t\t\tmodal : true,\n\t\t\t\ttitle : 'Nutus Econom&iacute;a',\n\t\t\t  message : 'Por su seguridad debe logearse nuevamente,<br /> ya que no ha utilizado el sistema por más de 30 minutos',\n\t\tusernameLabel : 'Usuario',\n\t\tpasswordLabel : 'Contrase&ntilde;a',\n\t\t cancelButton : 'Cerrar',\n\t\t  loginButton : 'Enviar',\n\t\t  failMessage : 'Usuario o contrase&ntilde;a no v&aacute;lida.',\n\t\t\t\t  url : '/seguridad/login_ajax'\t\t\t\n\t\t\t});\n\n\t\n\tloginDialog.show();\n\n\tloginDialog.on('success',function(){\n\trequest.request(f);\n\t});\n\n\tbreak;\n\tcase 400:\n\t\t\n\t\tvar msgconfig = {\n\t\t   title :'Error 400',\t\t\t\t    \n\t\t     msg : response.getResponseHeader['message'],\n\t\t buttons : Ext.Msg.OK,\t\t \n\t\t    icon : Ext.MessageBox.ERROR ,\n\t\t\t  fn : function(c,t,o){\n\t\t\t\tExt.MessageBox.getDialog().setTitle(''); \n\t\t\t\tExt.MessageBox.getDialog().hide();\n\t\t\t  }\t\n\t\t}\n\t\n\t\tExt.MessageBox.hide();\t \n\t\tvar win = Ext.MessageBox.getDialog();\t\t\n\t\t\n\t\twin.on('beforehide',function(){\n\t\t\t\n\t\t\tif( this.title == 'Error 400'){\n\t\t\t\t\treturn false;\n\t\t\t}\t\t\n\t\t});\n\t\t\n\t\tExt.Msg.show(msgconfig);\n\t\tExt.getCmp('status_bar').clearStatus({useDefaults:true});\n\t\t\n\tbreak;\n\tcase 404:\n\t\tvar msgconfig = {\n\t\t   title :'Error 404',\t\t\t\t    \n\t\t     msg : response.getResponseHeader['message'],\n\t\t buttons : Ext.Msg.OK,\t\t \n\t\t    icon : Ext.MessageBox.ERROR ,\n\t\t\t  fn : function(c,t,o){\n\t\t\t\tExt.MessageBox.getDialog().setTitle(''); \n\t\t\t\tExt.MessageBox.getDialog().hide();\n\t\t\t  }\t\n\t\t}\n\t\tExt.Msg.show(msgconfig);\n\t\tExt.getCmp('status_bar').clearStatus({useDefaults:true});\t\n\tbreak;\n\tcase 500:\t\t\n        Ext.MessageBox.hide();\t \n\t\tvar win = Ext.MessageBox.getDialog();\t\t\n\t\t\n\t\twin.on('beforehide',function(){\n\t\t\t\n\t\t\tif( this.title == 'Error'){\n\t\t\t\t\treturn false;\n\t\t\t}\t\t\n\t\t});\n\t\t\n\t\tExt.Msg.show(msgconfig);\n\t\tExt.getCmp('status_bar').clearStatus({useDefaults:true});\n\t\t \n\tbreak;\n\tcase 9001:\n\t\tExt.MessageBox.alert('" . $ari->title . "',response.getResponseHeader['message']); \n\t\tExt.getCmp('status_bar').clearStatus({useDefaults:true});\n\tbreak;\t\n\t}\n});\n\n\n\nExt.Ajax.on('requestcomplete', function(request,response,f,g,h){\ntry\n  { \n  \n    //Ext.MessageBox.updateProgress(1);\n    //Ext.MessageBox.hide();\t\n\t//alert(response.getResponseHeader['Content-Type']);\n\t\n\n\t \n\t\t\n  }\ncatch(err)\n  {\n  //alert(err.description);\n  }\n  \n\n\n}, this);\n\n\n\nExt.Ajax.request({url: '/admin/getcache',\n\t\t  method: 'POST',\n  \t\t success: function(responseObject){\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t   json = Ext.decode(responseObject.responseText);\t\t\t\t\t\t\t   \n\t\t\t\t\t\t\t   Ext.each( json, function(i){\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\taddTab(i.title,i.url,true,i.params,true,i.id);\n\t\t\t\t\t\t\t   });\t\t\t\t\t\t   \n\t\t\t\t\t   }\t\t\t\t   \n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\n \n//funcion para agregar las tabs \nfunction addTab( Title, Url, Add, Params, cache, tab_id ){\n\nvar panel_tabs = Ext.getCmp('TabPanel'); //obtengo el tabpanel que contiene todas las tabs\nvar cnx = new Ext.data.Connection(); //creo un nuevo objeto conexion\nvar tab_id; //defino la variable tab_id, tiene el id de la tab que se va agregar\n\t\t\t\n\t//pongo la barra de estado(cargando...)\n\tExt.getCmp('status_bar').showBusy();\n\t\t\t\n\t//obtengo un id unico para el contenedor de los contenidos que voy a cargar\n\tvar id = Ext.id();\n\n\t//function para agregar definitivamente la tab\n\tvar add = function( tab_id ){\n\t\n\t\n\t\t\t//si quiero agregar una tab nueva\n\t\t\t\t\t\t\t\t\t\n\n\t\tExt.Ajax.request( { url : Url,\n\t\t\t\t\t\tmethod : 'POST',\t\t\t\t\t\t\n\t\t\t\t\t\tparams : Params,\n\t\t\t\t\t   success : function( responseObject ){\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tvar respuesta = responseObject.responseText;\t\n\n\t\t\t\t\t\t\t\t\tif(Add){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t   var tab = new Ext.Panel({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tid : tab_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t title : Title,\n\t\t\t\t\t\t\t\t\t\t\t\t\tlayout : 'fit',\t\t\t\t\t\t\t\t\t\t\t\t\t   \n\t\t\t\t\t\t\t\t\t\t\t\t  closable : true,\n\t\t\t\t\t\t\t\t\t\t\tdeferredRender : false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t  html : '<div style=\"height:100%;width:100%;\" id=\"' + id + '\"></div>',\n\t\t\t\t\t\t\t\t\t\t\t\tautoScroll : true\t\t\t\t\t\t\t \t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t   });\n\t\t\t\t\t\t\t\t\t\t   \n\t\t\t\t\t\t\t\t\t\t   panel_tabs.add(tab);\n\t\t\t\t\t\t\t\t\t\t   tab.show();\t\t\t\t\t\t\t\t\t\t\t\t\t   \t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse //si quiero agregar en la tab que esta activa\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tvar active_tab = panel_tabs.getActiveTab();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tvar cnx = new Ext.data.Connection();\n\t\t\t\t\t\t\t\t\t\tExt.Ajax.request({ url : '/admin/closetab',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmethod : 'POST',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tparams : 'tab_id=' + active_tab.id \t\t\t\t\t   \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t });\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tactive_tab.setTitle(Title);\n\t\t\t\t\t\t\t\t\t\tactive_tab.body.dom.innerHTML = '<div style=\"height:100%;width:100%;\" id=\"' + id + '\"></div>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//una vez insertado el contenedor con el id unico , se procede a insertar los\n\t\t\t\t\t\t\t\t\t//datos en el mismo\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//si el contenido a cargar es un html\n\t\t\t\t\t\t\t\t\tif( responseObject.getResponseHeader['Content-Type'] == 'text/html' ){\t\t\n\t\t\t\t\t\t\t\t\t\tExt.get(id).dom.innerHTML = respuesta;\t\t\t  \n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse //si el contenido es un json(extjs)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t//ejecuto la respuesta y hago un render de la variable contenido\n\t\t\t\t\t\t\t\t\t\t//sobre el contenedor\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\teval(respuesta);\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tcontenido.render(Ext.get(id));\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//llamo el evento para que aplique los filtros\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tcontenido.fireEvent( 'applyfilters', tab_id );\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tExt.getCmp('status_bar').clearStatus({useDefaults:true});\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\treturn true;\t\t\t\n\t\t\t\t\t}});\n\n\n\t\t\t}//end function addtab\n\n\t\t\n\t\t//si !cache , quiere decir que la tab no esta en cache, por lo tanto llamo a newtab\n\t\t//para que la cachee y me devuelve el tab_id\n\t\tif(!cache){\n\t\t\t  Ext.Ajax.request({url: '/admin/newtab',\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\tparams: 'url=' + Url + '&title=' + Title + '&params=' + Params ,\n\t\t\t\t\t   success: function(responseObject){\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t   json = Ext.decode(responseObject.responseText);\t\t\t\t\t\t\t  \t\t\t\t\t\t\t   \n\t\t\t\t\t\t\t   //este tab_id luego es usado por la funcion tab_id\n\t\t\t\t\t\t\t   tab_id = json.id;\t\t\t\t\t\t\t   \n\t\t\t\t\t\t\t   add(json.id); \t\t\t\t\t\t\t   \t\t\t\t\t\t\t   \t\t\t\t\t   \t\t\t\t\t\t\t\t\n\t\t\t\t\t   }\n\t\t\t\t});\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\t\tadd(tab_id); \t\t\t\t\t\t\t   \n\t\t}\t\t\n\t\n\t\t\n\t}\n\t\n\t\t\t\t\n\t\n\tExt.apply( Ext,{ addTab : addTab } );\n\t\n\t\n\tvar map = new Ext.KeyMap(document, [\n\t\t\t\t{\n\t\t\t\t\tkey: \"t\",\n\t\t\t\t\tctrl:true,\n\t\t\t\t\tshift:true,\n\t\t\t\t\tfn: function(){\n\t\t\t\t\t\tvar panel_tabs = Ext.getCmp('TabPanel'); //obtengo el tabpanel que contiene todas las tabs\n\t\t\t\t\t\tvar active_tab = panel_tabs.getActiveTab();\n\t\t\t\t\t\t if(active_tab){\n\t\t\t\t\t\t\tpanel_tabs.remove(active_tab);\n\t\t\t\t\t\t }//end if\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t]);\n\t\t\n\n\t//esto dejarlo siempre al ultimo por que hace el fadeout del precargador( osea lo oculta )\n\tvar hideMask = function () {\n        Ext.get('loading').remove();\n        Ext.fly('loading-mask').fadeOut({\n            remove:true\n        });\n    }\n\n    hideMask.defer(250);\t\t\t\n\t\n\t\n\t";
$add_tab_invoke = PhpExt_Javascript::callfunction("addTab", array("n.id[0]", "n.id[1]", "true", "''", "false"))->output() . "return false;";
$add_tab_invoke_html = PhpExt_Javascript::callfunction("addTab", array("n.id[0]", "n.id[1]", "false", "''", "false"))->output() . "return false;";
$get_tree_panel = PhpExt_Element::getCmp('treePanel');
$if_leaf = PhpExt_Javascript::functionNoDef("if", $add_tab_invoke, array("n.leaf"));
$if_leaf_html = PhpExt_Javascript::functionNoDef("if", $add_tab_invoke_html, array("n.leaf"));
Пример #2
0
include_once 'PhpExt/Tree/AsyncTreeNode.php';
include_once 'PhpExt/Tree/TreeLoader.php';
include_once 'PhpExt/Tree/MultiSelectionModel.php';
include_once 'PhpExt/Tree/TreeNode.php';
global $ari;
$ari->popup = 1;
// no mostrar el main_frame
$field_width = 180;
//ancho de los controles
if (!isset($_POST['id'])) {
    throw new OOB_Exception_400("La variable [id] no esta definida");
}
PhpExt_Javascript::sendContentType();
$name = $_POST['id'];
//NOMBRE DE LA PERSPECTIVA
$tab_panel = new PhpExt_TabPanel();
$tab_panel->setPlain(true)->setActiveTab(0)->setHeight(200)->setDefaults(new PhpExt_Config_ConfigObject(array("bodyStyle" => "padding:10px")));
$roles_from_store = new PhpExt_Data_JsonStore();
$roles_from_store->setUrl("/admin/perspective/get_roles_nomembers")->setRoot("topics")->setAutoLoad("true")->setBaseParams(array("id" => $name))->setTotalProperty("totalCount");
$roles_from_store->addField(new PhpExt_Data_FieldConfigObject("id", "id"));
$roles_from_store->addField(new PhpExt_Data_FieldConfigObject("name", "name"));
$roles_to_store = new PhpExt_Data_JsonStore();
$roles_to_store->setUrl("/admin/perspective/get_roles_members")->setRoot("topics")->setAutoLoad("true")->setBaseParams(array("id" => $name))->setTotalProperty("totalCount");
$roles_to_store->addField(new PhpExt_Data_FieldConfigObject("id", "id"));
$roles_to_store->addField(new PhpExt_Data_FieldConfigObject("name", "name"));
$tab_roles = new PhpExt_Panel();
$tab_roles->setTitle("Roles")->setLayout(new PhpExt_Layout_FormLayout());
//control para seleccionar los usuarios
$select_roles = new PhpExtUx_Itemselector();
$select_roles->setName("roles")->setId("roles")->setFieldLabel("Roles")->setToLegend("Miembros")->setFromLegend("No Miembros")->setvalueField("id")->setdisplayField("name")->setmsHeight(160)->setmsWidth($field_width)->setToStore($roles_to_store)->setFromStore($roles_from_store)->setdataFields(PhpExt_Javascript::variable('["id", "name"]'))->setimagePath("/scripts/ext/resources/extjs-ux/multiselect/");
$tab_roles->addItem($select_roles);
Пример #3
0
$columnPanel2->setBorder(false)->setLayout(new PhpExt_Layout_ColumnLayout());
$tabs2->addItem($columnPanel2);
//- First column
$firstColumn2 = new PhpExt_Panel();
// Use FormLayout to enable field labels and autoarrange fields on the panel
$firstColumn2->setBorder(false)->setLayout(new PhpExt_Layout_FormLayout());
// Anchor the field to 95% of the panel by setting AnchorLayoutData (FormLayout extends AnchorLayout)
$firstColumn2->addItem(PhpExt_Form_TextField::createTextField("first", "First Name"), new PhpExt_Layout_AnchorLayoutData("95%"))->addItem(PhpExt_Form_TextField::createTextField("company", "Company"), new PhpExt_Layout_AnchorLayoutData("95%"));
// adds the panel as a 50% column using ColumnLayoutData
$columnPanel2->addItem($firstColumn2, new PhpExt_Layout_ColumnLayoutData(0.5));
//- Second column
$secondColumn2 = new PhpExt_Panel();
$secondColumn2->setBorder(false)->setLayout(new PhpExt_Layout_FormLayout())->addItem(PhpExt_Form_TextField::createTextField("last", "Last Name"), new PhpExt_Layout_AnchorLayoutData("95%"))->addItem(PhpExt_Form_TextField::createTextField("email", "Email")->setVType(PhpExt_Form_FormPanel::VTYPE_EMAIL), new PhpExt_Layout_AnchorLayoutData("95%"));
$columnPanel2->addItem($secondColumn2, new PhpExt_Layout_ColumnLayoutData(0.5));
//- Tab Panel
$tabPanel2 = new PhpExt_TabPanel();
$tabPanel2->setPlain(true)->setActiveTab(0)->setHeight(235)->setDefaults(new PhpExt_Config_ConfigObject(array("bodyStyle" => "padding:10px")));
$detailsTab2 = new PhpExt_Panel();
$detailsTab2->setTitle("Personal Details")->setLayout(new PhpExt_Layout_FormLayout())->setDefaults(new PhpExt_Config_ConfigObject(array("width" => 230)))->setDefaultType("textfield")->addItem(PhpExt_Form_TextField::createTextField("first", "First Name")->setAllowBlank(false)->setValue("Jack"))->addItem(PhpExt_Form_TextField::createTextField("company", "Company")->setValue("Slocum"))->addItem(PhpExt_Form_TextField::createTextField("last", "Last Name")->setValue("Ext JS"))->addItem(PhpExt_Form_TextField::createTextField("email", "Email")->setVType(PhpExt_Form_FormPanel::VTYPE_EMAIL));
$phonesTab2 = new PhpExt_Panel();
$phonesTab2->setTitle("Phone Numbers")->setLayout(new PhpExt_Layout_FormLayout())->setDefaults(new PhpExt_Config_ConfigObject(array("width" => 230)))->setDefaultType("textfield")->addItem(PhpExt_Form_TextField::createTextField("home", "Home")->setValue("(888) 555-1212"))->addItem(PhpExt_Form_TextField::createTextField("business", "Business"))->addItem(PhpExt_Form_TextField::createTextField("mobile", "Mobile"))->addItem(PhpExt_Form_TextField::createTextField("fax", "Fax"));
$bioTab = new PhpExt_Panel();
$bioTab->setCssClass("x-plain")->setTitle("Biography")->setLayout(new PhpExt_Layout_FitLayout())->addItem(PhpExt_Form_HtmlEditor::createHtmlEditor("bio2", "Biography", "bio2"));
$tabPanel2->addItem($detailsTab2);
$tabPanel2->addItem($phonesTab2);
$tabPanel2->addItem($bioTab);
$tabs2->addItem($tabPanel2);
$tabs2->addButton(PhpExt_Button::createTextButton("Save"));
$tabs2->addButton(PhpExt_Button::createTextButton("Cancel"));
//****************************** onReady
echo PhpExt_Ext::onReady(PhpExt_QuickTips::init(), PhpExt_Javascript::assign("bd", "Ext.get('centercolumn')"), PhpExt_Javascript::stm("bd.createChild({tag: 'h2', html: 'Form 1 - Very Simple'})"), $simple->getJavascript(false, "simple"), $simple->render(PhpExt_Javascript::variable("Ext.get('centercolumn')")), PhpExt_Javascript::stm("bd.createChild({tag: 'h2', html: 'Form 2 - Adding fieldsets'})"), $fsf->getJavascript(false, "fsf"), $fsf->render(PhpExt_Javascript::variable("Ext.get('centercolumn')")), PhpExt_Javascript::stm("bd.createChild({tag: 'h2', html: 'Form 3 - A little more complex'})"), $top->getJavascript(false, "top"), $top->render(PhpExt_Javascript::variable("Ext.get('centercolumn')")), PhpExt_Javascript::stm("bd.createChild({tag: 'h2', html: 'Form 4 - Forms can be a TabPanel...'})"), $tabs->getJavascript(false, "tabs"), $tabs->render(PhpExt_Javascript::variable("Ext.get('centercolumn')")), PhpExt_Javascript::stm("bd.createChild({tag: 'h2', html: 'Form 5 - ... and forms can contain TabPanel(s)'})"), $tabs2->getJavascript(false, "tabs2"), $tabs2->render(PhpExt_Javascript::variable("Ext.get('centercolumn')")));
Пример #4
0
$east->addItem($eastTabs);
$viewport->addItem($east, PhpExt_Layout_BorderLayoutData::createEastRegion()->setSplit(true)->setMinSize(175)->setMaxSize(400)->setMargins("0 5 0 0"));
// West Region
$west = new PhpExt_Panel();
$west->setTitle("West")->setCollapsible(true)->setWidth(200)->setId("west-panel");
$accordion = new PhpExt_Layout_AccordionLayout();
$accordion->setAnimate(true);
$west->setLayout($accordion);
// panel 1
$p1 = new PhpExt_Panel();
$p1->setContentElement("west")->setTitle("Navigation")->setBorder(false)->setIconCssClass("nav");
$west->addItem($p1);
// panel 2
$p2 = new PhpExt_Panel();
$p2->setHtml('<p>Some settings in here.</p>')->setTitle("Settings")->setBorder(false)->setIconCssClass("settings");
$west->addItem($p2);
$viewport->addItem($west, PhpExt_Layout_BorderLayoutData::createWestRegion()->setSplit(true)->setMinSize(175)->setMaxSize(400)->setMargins("0 0 0 5"));
// Center Region
$center = new PhpExt_TabPanel();
$center->setActiveTab(0);
$tabLayout = new PhpExt_Layout_TabLayout();
$tabLayout->setDeferredRender(true);
$center->setLayout($tabLayout);
$c1 = new PhpExt_Panel();
$c1->setContentElement("center1")->setTitle("Close Me")->setAutoScroll(true);
$center->addItem($c1, new PhpExt_Layout_TabLayoutData(true));
$c2 = new PhpExt_Panel();
$c2->setContentElement("center2")->setTitle("Center Panel")->setAutoScroll(true);
$center->addItem($c2);
$viewport->addItem($center, PhpExt_Layout_BorderLayoutData::createCenterRegion());
echo PhpExt_Ext::OnReady($viewport->getJavascript(false, "v"), $viewport->render("viewport"));
Пример #5
0
    include_once 'PhpExt/Window.php';
    include_once 'PhpExt/AutoLoadConfigObject.php';
    include_once 'PhpExt/Layout/FitLayout.php';
    include_once 'PhpExt/TabPanel.php';
    include_once 'PhpExt/Panel.php';
    $example_id = @$_GET['eid'];
    $file = $example_id . ".php";
    $win = new PhpExt_Window();
    $win->setTitle("Sample Source: " . $file)->setWidth(500)->setHeight(500)->setLayout(new PhpExt_Layout_FitLayout())->setResizable(false)->setCloseAction(PhpExt_Window::CLOSE_ACTION_HIDE)->setBodyBorder(false)->setPlain(true);
    // PHP Source
    $phpTab = new PhpExt_Panel();
    $phpTab->setTitle("PHP Source")->setLayout(new PhpExt_Layout_FitLayout())->setAutoLoad(new PhpExt_AutoLoadConfigObject($baseUrl . "/examples/viewsource.php", array("file" => $file)))->getAutoLoad()->setScripts(true)->setMethod(PhpExt_AutoLoadConfigObject::AUTO_LOAD_METHOD_GET);
    // Generated JS
    $jsTab = new PhpExt_Panel();
    $jsTab->setTitle("Generated JS")->setLayout(new PhpExt_Layout_FitLayout())->setAutoLoad(new PhpExt_AutoLoadConfigObject($baseUrl . "/examples/viewjs.php", array("file" => $file)))->getAutoLoad()->setScripts(true)->setMethod(PhpExt_AutoLoadConfigObject::AUTO_LOAD_METHOD_GET);
    $tabs = new PhpExt_TabPanel();
    $tabs->setActiveTab(0)->setPlain(true)->setFrame(false)->addItem($phpTab)->addItem($jsTab);
    $win->addItem($tabs);
    $customHeaders = '
	    <link rel="stylesheet" type="text/css" href="resources/ext-2.0.2/resources/css/ext-all.css" />
	
	    <!-- GC -->
	 	<!-- LIBS -->
	 	<script type="text/javascript" src="resources/ext-2.0.2/adapter/ext/ext-base.js"></script>
	 	<!-- ENDLIBS -->
	
	    <script type="text/javascript" src="resources/ext-2.0.2/ext-all.js"></script>
	    <script type="text/javascript" src="examples/examples.js"></script>
	    
	    <script type="text/javascript" src="resources/codepress/codepress.js"></script>
		
Пример #6
0
//CONTROLES
//nombre del role
$txt_nombre = PhpExt_Form_TextField::createTextField("txt_nombre", "Nombre")->setWidth($field_width)->setMsgTarget(PhpExt_Form_FormPanel::MSG_TARGET_SIDE)->setValue($role->get("name"));
//descripcion del role
$txt_descripcion = PhpExt_Form_TextArea::createTextArea("txt_descripcion", "Descripci&oacute;n")->setMsgTarget(PhpExt_Form_FormPanel::MSG_TARGET_SIDE)->setWidth($field_width)->setValue($role->get("description"));
//usuario anonimo
$chk_anonimo = PhpExt_Form_Checkbox::createCheckbox("chk_anonimo", "An&oacute;nimo")->setMsgTarget(PhpExt_Form_FormPanel::MSG_TARGET_SIDE)->setWidth($field_width);
if ($role->get("anonymous") == ANONIMO) {
    $chk_anonimo->setChecked(true);
}
//usuario confiado
$chk_confiados = PhpExt_Form_Checkbox::createCheckbox("chk_confiados", "Confiado")->setMsgTarget(PhpExt_Form_FormPanel::MSG_TARGET_SIDE)->setWidth($field_width);
if ($role->get("trustees") == YES) {
    $chk_confiados->setChecked(true);
}
$tab_panel = new PhpExt_TabPanel();
$tab_panel->setPlain(true)->setActiveTab(0)->setHeight(300)->setWidth(550)->setDefaults(new PhpExt_Config_ConfigObject(array("bodyStyle" => "padding:10px")));
$usuarios_from_store = new PhpExt_Data_JsonStore();
$usuarios_from_store->setUrl("/seguridad/role/get_users_nomembers")->setRoot("topics")->setBaseParams(array("id" => $role->get("role")))->setTotalProperty("totalCount");
$usuarios_from_store->addField(new PhpExt_Data_FieldConfigObject("id", "id"));
$usuarios_from_store->addField(new PhpExt_Data_FieldConfigObject("uname", "uname"));
$usuarios_to_store = new PhpExt_Data_JsonStore();
$usuarios_to_store->setUrl("/seguridad/role/get_users_members")->setRoot("topics")->setAutoLoad("true")->setBaseParams(array("id" => $role->get("role")))->setTotalProperty("totalCount");
$usuarios_to_store->addField(new PhpExt_Data_FieldConfigObject("id", "id"));
$usuarios_to_store->addField(new PhpExt_Data_FieldConfigObject("uname", "uname"));
$tab_general = new PhpExt_Panel();
$tab_general->setTitle("General")->setLayout(new PhpExt_Layout_FormLayout());
$tab_general->addItem($txt_nombre);
$tab_general->addItem($txt_descripcion);
$tab_general->addItem($chk_anonimo);
$tab_general->addItem($chk_confiados);