From 4a6af98cfcf115219216b2f1102cc3785083c6c8 Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 11 May 2007 12:14:26 +0000 Subject: Update address book demo --- .../protected/pages/AddressProvider.php | 27 +------ demos/address-book/protected/pages/Home.page | 11 ++- .../protected/pages/flex/.actionScriptProperties | 4 +- .../protected/pages/flex/bin/flex_address_book.swf | Bin 307529 -> 300246 bytes .../protected/pages/flex/flex_address_book.mxml | 86 ++++----------------- demos/address-book/protected/pages/sqlite.db | Bin 2048 -> 2048 bytes 6 files changed, 30 insertions(+), 98 deletions(-) (limited to 'demos/address-book') diff --git a/demos/address-book/protected/pages/AddressProvider.php b/demos/address-book/protected/pages/AddressProvider.php index ae0b369f..94b71e11 100644 --- a/demos/address-book/protected/pages/AddressProvider.php +++ b/demos/address-book/protected/pages/AddressProvider.php @@ -1,35 +1,12 @@ - * @version $Id$ * @since 3.1 */ -class AddressProvider extends TApplicationComponent +class AddressProvider { - /** - * @throws exception if not logged in - */ - public function __construct($server) - { - $authMethods = $server->getRequestedMethod()!=='login'; - $guestUser = $this->User ? $this->User->IsGuest : true; - if($authMethods && $guestUser) - throw new TException('authentication required'); - } - - /** - * @param string $username - * @param string $password - * @return boolean - * @soapmethod - */ - public function login($username, $password) - { - return $this->Application->Modules['auth']->login($username, $password); - } - /** * @return AddressRecord[] * @soapmethod diff --git a/demos/address-book/protected/pages/Home.page b/demos/address-book/protected/pages/Home.page index 1489cf86..12d36ecf 100644 --- a/demos/address-book/protected/pages/Home.page +++ b/demos/address-book/protected/pages/Home.page @@ -2,15 +2,20 @@ Prado Address Book + -

Prado + Flex + Soap Demo

-

Flash player version 9 or greater is required.

-

Username/password: demo/demo

+

Prado + Adobe Flex + Soap Demo

+

View SOAP WSDL

+

Flash player version 9 or greater is required.

AppName="flex_address_book" Parameters.wsdl="<%= $this->Request->constructUrl('soap', 'address-book.wsdl') %>" Width="100%" Height="300"/> + + \ No newline at end of file diff --git a/demos/address-book/protected/pages/flex/.actionScriptProperties b/demos/address-book/protected/pages/flex/.actionScriptProperties index 43e782c3..3adb49a4 100644 --- a/demos/address-book/protected/pages/flex/.actionScriptProperties +++ b/demos/address-book/protected/pages/flex/.actionScriptProperties @@ -1,6 +1,6 @@ - + @@ -8,11 +8,13 @@ + + diff --git a/demos/address-book/protected/pages/flex/bin/flex_address_book.swf b/demos/address-book/protected/pages/flex/bin/flex_address_book.swf index 03e29cf8..8eadaf84 100644 Binary files a/demos/address-book/protected/pages/flex/bin/flex_address_book.swf and b/demos/address-book/protected/pages/flex/bin/flex_address_book.swf differ diff --git a/demos/address-book/protected/pages/flex/flex_address_book.mxml b/demos/address-book/protected/pages/flex/flex_address_book.mxml index eac50fe7..6a82966e 100644 --- a/demos/address-book/protected/pages/flex/flex_address_book.mxml +++ b/demos/address-book/protected/pages/flex/flex_address_book.mxml @@ -10,24 +10,7 @@ backgroundGradientColors="0" layout="vertical" creationComplete="initApp()"> - - - - - - - - - - - - - - - - - + @@ -46,14 +29,9 @@ - - - - - @@ -71,6 +49,7 @@ private function initApp():void { addrSrv.loadWSDL(getAddressBookWsdl()); + addrSrv.getAllAddress(); } private function getAddressBookWsdl():String @@ -96,62 +75,31 @@ data.username = _username.text; data.phone = _phone.text; addrSrv.saveAddress(data); - currentState='grid'; + currentState=''; } } private function doDelete():void { addrSrv.deleteAddress(list1.selectedItem.id); - currentState='grid'; - } - - private function doLogin():void - { - if(Validator.validateAll([val3, val4]).length == 0) - { - addrSrv.login(login_name.text, login_pass.text); - login_name.enabled=false; - login_pass.enabled=false; - progress1.visible=true; - } - } - - private function loginReturned(event:ResultEvent):void - { - if(!event.result) - { - login_name.enabled=true; - login_pass.enabled=true; - progress1.visible=false; - Alert.show("Username and password did not match!", "Login Error"); - } - else - { - addrSrv.getAllAddress(); - currentState='grid'; - } - } + currentState=''; + } ]]> - - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/demos/address-book/protected/pages/sqlite.db b/demos/address-book/protected/pages/sqlite.db index 997be3ed..6b7ec59e 100644 Binary files a/demos/address-book/protected/pages/sqlite.db and b/demos/address-book/protected/pages/sqlite.db differ -- cgit v1.2.3