[ 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/ -> ezsimpleshopaccounthandler.php (source)

   1  <?php
   2  //
   3  // Definition of eZSimpleShopAccountHandler class
   4  //
   5  // Created on: <13-Feb-2003 09:54:35 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 eZSimpleShopAccountHandler
  32  {
  33      /*!
  34      */
  35      function eZSimpleShopAccountHandler()
  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/register/' );
  55      }
  56  
  57      /*!
  58       \return custom email 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 custom name 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          return $accountName;
  90      }
  91  
  92      /*!
  93       \return the account information for the given order
  94      */
  95      function accountInformation( $order )
  96      {
  97          $xml = new eZXML();
  98          $xmlDoc =& $order->attribute( 'data_text_1' );
  99          $dom =& $xml->domTree( $xmlDoc );
 100  
 101          $firstName =& $dom->elementsByName( "first-name" );
 102          $lastName =& $dom->elementsByName( "last-name" );
 103          $email =& $dom->elementsByName( "email" );
 104          $address =& $dom->elementsByName( "address" );
 105  
 106          return array( 'first_name' => $firstName[0]->textContent(),
 107                        'last_name' => $lastName[0]->textContent(),
 108                        'email' => $email[0]->textContent(),
 109                        'address' => $address[0]->textContent()
 110                        );
 111      }
 112  }
 113  
 114  ?>


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