Beispiel #1
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);
Beispiel #2
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.\""))));