Example #1
0
 public function __construct()
 {
     parent::__construct();
     $this->setExtClassInfo("Ext.ux.UploadPanel", "uploadpanel");
     $validProps = array("url", "method", "maxFileSize", "autoCreate", "savedfiles", "deletedir", "param");
     $this->addValidConfigProperties($validProps);
 }
Example #2
0
$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"));
$add_tab_onclick = PhpExt_Javascript::functionDef(null, $if_leaf, array("n"));
$add_tab_oncontextmenu = PhpExt_Javascript::functionDef(null, $if_leaf_html, array("n"));
$output_add_tab_onclick = $get_tree_panel->on("click", $add_tab_onclick);
$output_add_tab_oncontextmenu = $get_tree_panel->on("contextmenu", $add_tab_oncontextmenu);
$output_add_tab_function = new PhpExt_JavascriptStm($add_tab_function);
//-----------------------------------------------------------BARRA DE ESTADO--------------------------------------------------------------------------------------------
$function_win_open = PhpExt_Javascript::callfunction("window.open", array("'http://www.nutus.com.ar'"));
$handler_abrir_pagina = PhpExt_Javascript::functionDef("", $function_win_open, array("e"));
$function_win_open2 = PhpExt_Javascript::callfunction("window.open", array("'http://soporte.nutus.info'"));
$handler_abrir_pagina2 = PhpExt_Javascript::functionDef("", $function_win_open2, array("e"));
$barra_estado = new PhpExt_Toolbar_StatusBar();
$barra_estado->setId("status_bar");
$barra_estado->setDefaultText("Terminado");
$barra_estado->addButton("ayuda", "Ayuda on-line", null, $handler_abrir_pagina2);
$barra_estado->addButton("Pagina", "© Nutus 2009", null, $handler_abrir_pagina);
$status_bar = new PhpExt_Panel();
$status_bar->setBottomToolbar($barra_estado);
//USO UN VIEWPORT YA QUE SE ADAPTA AL ANCHO DE LA PAGINA
//creo uno nuevo y le agrego todos los items setando el area
$contenedor = new PhpExt_Viewport();
$contenedor->setLayout(new PhpExt_Layout_BorderLayout());
$contenedor->addItem($menu_top, PhpExt_Layout_BorderLayoutData::createNorthRegion());
$contenedor->addItem($menu_acordion, PhpExt_Layout_BorderLayoutData::createWestRegion());
$contenedor->addItem($principal, PhpExt_Layout_BorderLayoutData::createCenterRegion());
$contenedor->addItem($status_bar, PhpExt_Layout_BorderLayoutData::createSouthRegion());
//FUNCTIONS DE USO GENERAL
$format_money = "\t\nfunction FormatMoney(v,sign){\t\t\t\t\n    v = (Math.round((v-0)*100))/100;\n    v = (v == Math.floor(v)) ? v + '.00' : ((v*10 == Math.floor(v*10)) ? v + '0' : v);\n    v = String(v);        \n        if(v.charAt(0) == '-'){\n            return '-' + sign + v.substr(1).replace('.',',');\n        }\n    return sign +  v.replace('.',',');\n}\n";
$unformat_money = "\nfunction unformatMoney(num) {\n\tvar value = num.replace(',','.');\t\t\n\treturn value.replace(/([^0-9\\.\\-])/g,'')*1;\t\n}\n";
echo PhpExt_Ext::OnReady(PhpExt_QuickTips::init(), $contenedor->getJavascript(false, "Contenedor"), $contenedor->render(PhpExt_Javascript::inlineStm("document.body")), $output_add_tab_function->output(), $output_add_tab_onclick, $output_add_tab_oncontextmenu, $unformat_money, $format_money);
Example #3
0
 public function __construct()
 {
     parent::__construct();
     $this->setExtClassInfo("Ext.grid.GridPanel", "grid");
     $validProps = array("autoExpandColumn", "autoExpandMax", "autoExpandMin", "colModel", "disableSelection", "enableColumnHide", "enableColumnMove", "enableColumnResize", "enableDragDrop", "enableHdMenu", "enableRowHeightSync", "loadMask", "maxHeight", "minColumnWidth", "monitorWindowResize", "selModel", "store", "stripeRows", "trackMouseOver", "view", "enableColLock");
     $this->addValidConfigProperties($validProps);
 }
Example #4
0
<?php

set_include_path(get_include_path() . PATH_SEPARATOR . realpath('../../library'));
include_once 'PhpExt/Javascript.php';
PhpExt_Javascript::sendContentType();
include_once 'PhpExt/Ext.php';
include_once 'PhpExt/Panel.php';
$p = new PhpExt_Panel();
$p->setTitle("My Panel")->setCollapsible(true)->setRenderTo(PhpExt_Javascript::variable("Ext.get('centercolumn')"))->setWidth(400)->setHtml(PhpExt_Javascript::variable("Ext.example.bogusMarkup"));
echo PhpExt_Ext::OnReady($p->getJavascript(false, "p"));
Example #5
0
include_once "PhpExtUx/App/SearchField.php";
// Configure Reader and Store
$reader = new PhpExt_Data_JsonReader();
$reader->setRoot("topics")->setTotalProperty("totalCount")->setId("post_id");
$reader->addField(new PhpExt_Data_FieldConfigObject("postId", "post_id"));
$reader->addField(new PhpExt_Data_FieldConfigObject("title", "topic_title"));
$reader->addField(new PhpExt_Data_FieldConfigObject("topicId", "topic_id"));
$reader->addField(new PhpExt_Data_FieldConfigObject("author", "author"));
$reader->addField(new PhpExt_Data_FieldConfigObject("lastPost", "post_time", "date", "timestamp"));
$reader->addField(new PhpExt_Data_FieldConfigObject("excerpt", "post_text"));
$ds = new PhpExt_Data_Store();
$ds->setProxy(new PhpExt_Data_ScriptTagProxy('http://extjs.com/forum/topics-remote.php'))->setReader($reader)->setBaseParams(array("limit" => 20, "forumId" => 21));
// ->setBaseParams(new PhpExt_Config_ConfigObject(array("limit"=>20,"forumId"=>21));
// Configure Custom SearchField
$resultTpl = new PhpExt_XTemplate('<tpl for=".">', '<div class="search-item">', '<h3><span>{lastPost:date("M j, Y")}<br />by {author}</span>', '<a href="http://extjs.com/forum/showthread.php?t={topicId}&p={postId}" target="_blank">{title}</a></h3>', '<p>{excerpt}</p>', '</div></tpl>');
$panel = new PhpExt_Panel();
$panel->setApplyTo("search-panel")->setTitle("Forum Search")->setHeight(300)->setAutoScroll(true);
$dv = new PhpExt_DataView("div.search-item");
$dv->setStore($ds)->setTemplate($resultTpl);
$panel->addItem($dv);
$searchField = new PhpExtUx_App_SearchField();
$searchField->setStore($ds)->setWidth(320);
$tb = $panel->getTopToolbar();
$tb->addTextItem(1, "Search: ");
$tb->addSpacer(2);
$tb->addItem(3, $searchField);
$paging = new PhpExt_Toolbar_PagingToolbar();
$paging->setStore($ds)->setPageSize(20)->setDisplayInfo("Topics {0} - {1} of {2}")->setEmptyMessage("No topics to display");
$panel->setBottomToolbar($paging);
//------------ Ext.OnReady
echo PhpExt_Ext::onReady($ds->getJavascript(false, "ds"), $resultTpl->getJavascript(false, "resultTpl"), $panel->getJavascript(false, "panel"), $ds->load(new PhpExt_Data_StoreLoadOptions(array("start" => 0, "limit" => 0, "forumId" => 21, "query" => "\"PHP-Ext 0.\""))));
Example #6
0
$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);
$tab_panel->addItem($tab_roles);
$tab_modulos = new PhpExt_Panel();
$tab_modulos->setTitle("Modulos")->setLayout(new PhpExt_Layout_FormLayout());
$modulos_from_store = new PhpExt_Data_JsonStore();
$modulos_from_store->setUrl("/admin/perspective/get_modules_nomembers")->setRoot("topics")->setAutoLoad("true")->setBaseParams(array("id" => $name))->setTotalProperty("totalCount");
$modulos_from_store->addField(new PhpExt_Data_FieldConfigObject("id", "id"));
$modulos_from_store->addField(new PhpExt_Data_FieldConfigObject("name", "name"));
$modulos_to_store = new PhpExt_Data_JsonStore();
$modulos_to_store->setUrl("/admin/perspective/get_modules_members")->setRoot("topics")->setAutoLoad("true")->setBaseParams(array("id" => $name))->setTotalProperty("totalCount");
$modulos_to_store->addField(new PhpExt_Data_FieldConfigObject("id", "id"));
$modulos_to_store->addField(new PhpExt_Data_FieldConfigObject("name", "name"));
//control para seleccionar los grupos
$select_modulos = new PhpExtUx_Itemselector();
$select_modulos->setName("modulos")->setId("modulos")->setFieldLabel("Modulos")->setToLegend("Miembros")->setFromLegend("No Miembros")->setvalueField("id")->setdisplayField("name")->setmsHeight(160)->setmsWidth($field_width)->setToStore($modulos_to_store)->setFromStore($modulos_from_store)->setdataFields(PhpExt_Javascript::variable('["id", "name"]'))->setimagePath("/scripts/ext/resources/extjs-ux/multiselect/");
$tab_modulos->addItem($select_modulos);
$tab_panel->addItem($tab_modulos);
//Boton actualizar OnClick
Example #7
0
               ->setHeight(600);
$accordion = new PhpExt_Layout_AccordionLayout();
$accordion->setTitleCollapse(true)
		  
		  ->setActiveOnTop(true)
          ->setAnimate(true)
          ;
$accordionPanel->setLayout($accordion);
$p1 = new PhpExt_Panel();
$p1->setTitle("Navigation")
   ->setHtml("This <bt>is the navigation panel");
$p2 = new PhpExt_Panel();
$p2->setTitle("Settings")
   ->setHtml("This <br>is the settings panel");
$accordionPanel->addItem($p1);
$accordionPanel->addItem($p2); 
$accordionPanel->setRenderTo(PhpExt_Javascript::inlineStm("Ext.get('centercolumn')"));
*/
$accordionPanel = new PhpExt_Panel();
$accordionPanel->setTitle("Accordion Sample")->setWidth(500)->setHeight(300);
$accordion = new PhpExt_Layout_AccordionLayout();
$accordion->setTitleCollapse(true)->setAnimate(true);
$accordionPanel->setLayout($accordion);
$p1 = new PhpExt_Panel();
$p1->setTitle("Navigation")->setHtml("This <bt>is the navigation panel");
$p2 = new PhpExt_Panel();
$p2->setTitle("Settings")->setHtml("This <br>is the settings panel");
$accordionPanel->addItem($p1);
$accordionPanel->addItem($p2);
$accordionPanel->setRenderTo(PhpExt_Javascript::inlineStm("Ext.get('centercolumn')"));
echo PhpExt_Ext::onReady($accordionPanel->getJavascript(false, "accordionPanel"));
Example #8
0
 public function __construct()
 {
     parent::__construct();
     $this->setExtClassInfo("Ext.TabPanel", "tabpanel");
     $validProps = array("activeTab", "animScroll", "autoTabSelector", "autoTabs", "baseCls", "deferredRender", "enableTabScroll", "layoutOnTabChange", "minTabWidth", "monitorResize", "plain", "resizeTabs", "scrollDuration", "scrollIncrement", "tabMargin", "tabPosition", "tabWidth", "wheelIncrement");
     $this->addValidConfigProperties($validProps);
     $this->_defaultLayout = new PhpExt_Layout_TabLayout();
     $this->setLayout($this->_defaultLayout);
 }
Example #9
0
 public function __construct()
 {
     parent::__construct();
     $this->setExtClassInfo("Ext.tree.TreePanel", "treepanel");
     $validProps = array("animate", "containerScroll", "ddAppendOnly", "ddGroup", "ddScroll", "enableDD", "enableDrag", "enableDrop", "hlColor", "hlDrop", "lines", "loader", "pathSeparator", "root", "selModel", "singleExpand", "trackMouseOver", "useArrows");
     $this->addValidConfigProperties($validProps);
 }
Example #10
0
$reader->addField(new PhpExt_Data_FieldConfigObject("lastChange", null, "date", "n/j h:ia", null, null, null));
$store->setReader($reader)->setData(PhpExt_Javascript::variable("data"));
/* Data array could be used directly also as
 $store->setData($myData)
*/
$italicRenderer = PhpExt_Javascript::functionDef("italic", "return '<i>' + value + '</i>'", array("value"));
$changeRenderer = PhpExt_Javascript::functionDef("change", "if(val > 0){\r\n            return '<span style=\"color:green;\">' + val + '</span>';\r\n        }else if(val < 0){\r\n            return '<span style=\"color:red;\">' + val + '</span>';\r\n        }\r\n        return val;", array("val"));
$pctChangeRenderer = PhpExt_Javascript::functionDef("pctChange", "if(val > 0){\r\n            return '<span style=\"color:green;\">' + val + '%</span>';\r\n        }else if(val < 0){\r\n            return '<span style=\"color:red;\">' + val + '%</span>';\r\n        }\r\n        return val;", array("val"));
// ColumnModel
$colModel = new PhpExt_Grid_ColumnModel();
$colModel->addColumn(PhpExt_Grid_ColumnConfigObject::createColumn("Company", "company", "company", 160, null, null, true, false))->addColumn(PhpExt_Grid_ColumnConfigObject::createColumn("Price", "price", null, 75, null, PhpExt_Javascript::variable("Ext.util.Format.usMoney"), null, true))->addColumn(PhpExt_Grid_ColumnConfigObject::createColumn("Change", "change", null, 75, null, PhpExt_Javascript::variable('change'), null, true))->addColumn(PhpExt_Grid_ColumnConfigObject::createColumn("% Change", "pctChange", null, 75, null, PhpExt_Javascript::variable('pctChange'), null, true))->addColumn(PhpExt_Grid_ColumnConfigObject::createColumn("Last Updated", "lastChange", null, 75, null, PhpExt_Javascript::variable("Ext.util.Format.dateRenderer('m/d/Y')"), null, true));
// Form Panel
$gridForm = new PhpExt_Form_FormPanel("company-form");
$gridForm->setFrame(true)->setLabelAlign(PhpExt_Form_FormPanel::LABEL_ALIGN_LEFT)->setTitle("Company Data")->setBodyStyle("padding: 5px;")->setWidth(750)->setLayout(new PhpExt_Layout_ColumnLayout());
// Setup Grid
$leftPanel = new PhpExt_Panel();
$leftPanel->setLayout(new PhpExt_Layout_FitLayout());
$selModel = new PhpExt_Grid_RowSelectionModel();
$selModel->setSingleSelect(true)->attachListener("rowselect", new PhpExt_Listener(PhpExt_Javascript::functionDef(null, "Ext.getCmp(\"company-form\").getForm().loadRecord(rec);", array("sm", "row", "rec"))));
$grid = new PhpExt_Grid_GridPanel();
$grid->setStore($store)->setColumnModel($colModel)->setSelectionModel($selModel)->setAutoExpandColumn("company")->setHeight(350)->setTitle("Company Data")->setBorder(true)->attachListener("render", new PhpExt_Listener(PhpExt_Javascript::functionDef(null, "g.getSelectionModel().selectRow(0);", array("g")), null, 10));
$leftPanel->addItem($grid);
$gridForm->addItem($leftPanel, new PhpExt_Layout_ColumnLayoutData(0.6));
// Setup Fields
$rightPanel = new PhpExt_Form_FieldSet();
$rightPanel->setLabelWidth(90)->setTitle("Company Details")->setDefaults(new PhpExt_Config_ConfigObject(array("width" => 140)))->setDefaultType("textfield")->setAutoHeight(true)->setBodyStyle(PhpExt_Javascript::inlineStm("Ext.isIE ? 'padding:0 0 5px 15px;' : 'padding:10px 15px;'"))->setBorder(false)->setCssStyle(new PhpExt_Config_ConfigObject(array("margin-left" => "10px", "margin-right" => PhpExt_Javascript::inlineStm('Ext.isIE6 ? (Ext.isStrict ? "-10px" : "-13px") : "0"'))));
$rightPanel->addItem(PhpExt_Form_TextField::createTextField("company", "Name"));
$rightPanel->addItem(PhpExt_Form_TextField::createTextField("price", "Price"));
$rightPanel->addItem(PhpExt_Form_TextField::createTextField("pctChange", "% Change"));
$rightPanel->addItem(PhpExt_Form_TextField::createTextField("lastChange", "Last Updated"));
$gridForm->addItem($rightPanel, new PhpExt_Layout_ColumnLayoutData(0.4));
Example #11
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')")));
Example #12
0
include_once 'PhpExt/TabPanel.php';
include_once 'PhpExt/Viewport.php';
include_once 'PhpExt/Layout/FitLayout.php';
include_once 'PhpExt/Layout/AccordionLayout.php';
include_once 'PhpExt/Layout/TabLayout.php';
include_once 'PhpExt/Layout/BorderLayout.php';
include_once 'PhpExt/Layout/BorderLayoutData.php';
include_once 'PhpExt/Layout/TabLayoutData.php';
include_once 'PhpExt/Grid/PropertyGrid.php';
/*
 * The container component for the border layout can also be a PhpExt_Viewport which will
 * fill the space provided by the browser. In these example a Panel is used to keep the website layout. 
 * See API Documentation for more info on Viewport.
 * 
 */
$viewport = new PhpExt_Panel();
$viewport->setHeight(600);
$viewport->setLayout(new PhpExt_Layout_BorderLayout());
// Norht Region
$north = new PhpExt_BoxComponent();
$north->setEl("north");
$north->setHeight(32);
$viewport->addItem($north, PhpExt_Layout_BorderLayoutData::createNorthRegion());
// South Region
$south = new PhpExt_Panel();
$south->setContentElement("south")->setCollapsible(true)->setTitle("South")->setHeight(100);
$viewport->addItem($south, PhpExt_Layout_BorderLayoutData::createSouthRegion()->setSplit(true)->setMinSize(100)->setMaxSize(200)->setMargins("0 0 0 0"));
// East Region
$east = new PhpExt_Panel();
$east->setTitle("East Size")->setCollapsible(true)->setWidth(225)->setLayout(new PhpExt_Layout_FitLayout());
$eastTabs = new PhpExt_TabPanel();
Example #13
0
$baseUrl = str_replace($docRoot, $httpHost, $dir);
$extjsCheck = realpath(dirname(__FILE__) . "/../resources/ext-2.0.2/ext-core.js");
if ($extjsCheck !== false) {
    set_include_path(get_include_path() . PATH_SEPARATOR . realpath("../library"));
    include_once 'PhpExt/Ext.php';
    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 -->
	
Example #14
0
 public function __construct()
 {
     parent::__construct();
     $this->setExtClassInfo("Ext.Window", "window");
     $validProps = array("animateTarget", "baseCls", "closable", "closeAction", "constrain", "constrainHeader", "defaultButton", "draggable", "expandOnShow", "maximizable", "minHeight", "minWidth", "minimizable", "modal", "onEsc", "plain", "resizable");
     $this->addValidConfigProperties($validProps);
 }
Example #15
0
<?php

set_include_path(get_include_path() . PATH_SEPARATOR . realpath('../../library'));
include_once 'PhpExt/Javascript.php';
PhpExt_Javascript::sendContentType();
include_once 'PhpExt/Ext.php';
include_once 'PhpExt/Handler.php';
include_once 'PhpExt/Template.php';
include_once 'PhpExt/XTemplate.php';
include_once 'PhpExt/Panel.php';
include_once 'PhpExt/Toolbar/Toolbar.php';
$data = array('name' => 'Jack Slocum', 'company' => 'Ext JS, LLC', 'address' => '4 Red Bulls Drive', 'city' => 'Cleveland', 'state' => 'Ohio', 'zip' => '44102', 'kids' => array(array('name' => 'Sara Grace', 'age' => 3), array('name' => 'Zachary', 'age' => 2), array('name' => 'John James', 'age' => 0)));
/* Example 1: Basic Template */
$t = new PhpExt_Template("<p>Name: {name}</p>", "<p>Company: {company}</p>", '<p>Location: {city}, {state}</p>');
$p = new PhpExt_Panel();
$p->setTitle('Basic Template')->setWidth('300')->setHtml('<p><i>Apply the template to see results here</i></p>');
$tb = $p->getTopToolbar();
$tb->addButton("apply", "Apply Template", null, new PhpExt_Handler(PhpExt_Javascript::stm($t->getJavascript(false, "tpl")), $t->overwrite(PhpExt_Javascript::variable("p.body"), PhpExt_Javascript::variable("data"))));
$p->setRenderTo(PhpExt_Javascript::inlineStm("Ext.get('centercolumn')"));
/** Example 2: XTemplate */
$t2 = new PhpExt_XTemplate('<p>Name: {name}</p>', '<p>Company: {company}</p>', '<p>Location: {city}, {state}</p>', '<p>Kids: ', '<tpl for="kids" if="name==\\\'Jack Slocum\\\'">', '<tpl if="age &gt; 1"><p>{#}. {parent.name}\\\'s kid - {name}</p></tpl>', '</tpl></p>');
//$t2->VarName = "tpl2";
$p2 = new PhpExt_Panel();
$p2->setTitle('XTemplate')->setWidth('300')->setHtml('<p><i>Apply the template to see results here</i></p>');
$tb2 = $p2->getTopToolbar();
$tb2->addButton("apply", "Apply Template", null, new PhpExt_Handler(PhpExt_Javascript::stm($t2->getJavascript(false, "tpl2")), $t2->overwrite(PhpExt_Javascript::variable("p2.body"), PhpExt_Javascript::variable("data"))));
$p2->setRenderTo(PhpExt_Javascript::variable("Ext.get('centercolumn')"));
echo PhpExt_Ext::onReady(PhpExt_Javascript::stm("var data = " . PhpExt_Javascript::jsonEncode($data) . ";"), $p->getJavascript(false, "p"), $p2->getJavascript(false, "p2"));
Example #16
0
 public function __construct($id = null, $url = null)
 {
     parent::__construct();
     $this->setExtClassInfo("Ext.form.FormPanel", "form");
     $validProps = array("buttonAlign", "itemCls", "labelAlign", "labelWidth", "minButtonWidth", "monitorPoll", "monitorValid", "baseParams", "errorReader", "fileUpload", "method", "reader", "standardSubmit", "timeout", "trackResetOnLoad", "url", "waitMsgTarget", "onSubmit");
     $this->addValidConfigProperties($validProps);
     if ($id !== null) {
         $this->setId($id);
     }
     if ($url !== null) {
         $this->setUrl($url);
     }
     $this->_defaultLayout = new PhpExt_Layout_FormLayout();
     $this->setLayout($this->_defaultLayout);
 }
Example #17
0
 public function __construct()
 {
     parent::__construct();
     $this->setExtClassInfo("Ext.form.FieldSet", "fieldset");
     $validProps = array("baseCls", "checkboxName", "checkboxToggle", "itemCls", "labelWidth", "layout");
     $this->addValidConfigProperties($validProps);
     $this->_defaultLayout = new PhpExt_Layout_FormLayout();
     $this->setLayout($this->_defaultLayout);
 }