[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/kernel/classes/shopaccounthandlers/ -> ezusershopaccounthandler.php (source)

   1  <?php
   2  //
   3  // Definition of eZUserShopAccountHandler class
   4  //
   5  // Created on: <04-Mar-2003 09:40:49 bf>
   6  //
   7  // SOFTWARE NAME: eZ publish
   8  // SOFTWARE RELEASE: 3.9.0
   9  // BUILD VERSION: 17785
  10  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  11  // SOFTWARE LICENSE: GNU General Public License v2.0
  12  // NOTICE: >
  13  //   This program is free software; you can redistribute it and/or
  14  //   modify it under the terms of version 2.0  of the GNU General
  15  //   Public License as published by the Free Software Foundation.
  16  //
  17  //   This program is distributed in the hope that it will be useful,
  18  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  19  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20  //   GNU General Public License for more details.
  21  //
  22  //   You should have received a copy of version 2.0 of the GNU General
  23  //   Public License along with this program; if not, write to the Free
  24  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  25  //   MA 02110-1301, USA.
  26  //
  27  //
  28  
  29  include_once ( 'lib/ezxml/classes/ezxml.php' );
  30  
  31  class eZUserShopAccountHandler
  32  {
  33      /*!
  34      */
  35      function eZUserShopAccountHandler()
  36      {
  37  
  38      }
  39  
  40      /*!
  41       Will verify that the user has supplied the correct user information.
  42       Returns true if we have all the information needed about the user.
  43      */
  44      function verifyAccountInformation()
  45      {
  46          return false;
  47      }
  48  
  49      /*!
  50       Redirectes to the user registration page.
  51      */
  52      function fetchAccountInformation( &$module )
  53      {
  54          $module->redirectTo( '/shop/userregister/' );
  55      }
  56  
  57      /*!
  58       \return the account information for the given order
  59      */
  60      function email( $order )
  61      {
  62          $xml = new eZXML();
  63          $xmlDoc =& $order->attribute( 'data_text_1' );
  64          if( $xmlDoc != null )
  65          {
  66              $dom =& $xml->domTree( $xmlDoc );
  67              $email =& $dom->elementsByName( "email" );
  68              return $email[0]->textContent();
  69          }
  70          else
  71              return false;
  72      }
  73  
  74      /*!
  75       \return the account information for the given order
  76      */
  77      function accountName( $order )
  78      {
  79          $accountName = "";
  80          $xml = new eZXML();
  81          $xmlDoc =& $order->attribute( 'data_text_1' );
  82          if( $xmlDoc != null )
  83          {
  84              $dom =& $xml->domTree( $xmlDoc );
  85              $firstName = $dom->elementsByName( "first-name" );
  86              $lastName = $dom->elementsByName( "last-name" );
  87              $accountName = $firstName[0]->textContent() . " " . $lastName[0]->textContent();
  88          }
  89  
  90          return $accountName;
  91      }
  92  
  93      function accountInformation( $order )
  94      {
  95          $xml = new eZXML();
  96          $xmlDoc =& $order->attribute( 'data_text_1' );
  97          $dom =& $xml->domTree( $xmlDoc );
  98  
  99          $firstName =& $dom->elementsByName( "first-name" );
 100          $lastName =& $dom->elementsByName( "last-name" );
 101          $email =& $dom->elementsByName( "email" );
 102          $street1 =& $dom->elementsByName( "street1" );
 103          $street2 =& $dom->elementsByName( "street2" );
 104          $zip =& $dom->elementsByName( "zip" );
 105          $place =& $dom->elementsByName( "place" );
 106          $state =& $dom->elementsByName( "state" );
 107          $country =& $dom->elementsByName( "country" );
 108          $comment =& $dom->elementsByName( "comment" );
 109  
 110          $firstNameText = "";
 111          if ( is_object( $firstName[0] ) )
 112              $firstNameText = $firstName[0]->textContent();
 113  
 114          $lastNameText = "";
 115          if ( is_object( $lastName[0] ) )
 116              $lastNameText = $lastName[0]->textContent();
 117  
 118          $emailText = "";
 119          if ( is_object( $email[0] ) )
 120              $emailText = $email[0]->textContent();
 121  
 122          $street1Text = "";
 123          if ( is_object( $street1[0] ) )
 124              $street1Text = $street1[0]->textContent();
 125  
 126          $street2Text = "";
 127          if ( is_object( $street2[0] ) )
 128              $street2Text = $street2[0]->textContent();
 129  
 130          $zipText = "";
 131          if ( is_object( $zip[0] ) )
 132              $zipText = $zip[0]->textContent();
 133  
 134          $placeText = "";
 135          if ( is_object( $place[0] ) )
 136              $placeText = $place[0]->textContent();
 137  
 138          $stateText = "";
 139          if ( is_object( $state[0] ) )
 140              $stateText = $state[0]->textContent();
 141  
 142          $countryText = "";
 143          if ( is_object( $country[0] ) )
 144              $countryText = $country[0]->textContent();
 145  
 146          $commentText = "";
 147          if ( is_object( $comment[0] ) )
 148              $commentText = $comment[0]->textContent();
 149  
 150          return array( 'first_name' => $firstNameText,
 151                        'last_name' => $lastNameText,
 152                        'email' => $emailText,
 153                        'street1' => $street1Text,
 154                        'street2' => $street2Text,
 155                        'zip' => $zipText,
 156                        'place' => $placeText,
 157                        'state' => $stateText,
 158                        'country' => $countryText,
 159                        'comment' => $commentText,
 160                        );
 161      }
 162  }
 163  
 164  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7