A Qcodo based CMS/ecommerce framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 lines
4.5 KiB

13 years ago
  1. <?php
  2. if(!defined('QUASICMS') ) die("No quasi.");
  3. if (!defined("ACCOUNTADDRESSMODULE.CLASS.PHP")){
  4. define("ACCOUNTADDRESSMODULE.CLASS.PHP",1);
  5. /**
  6. * Class AccountAddressModule - view/manage orders for a user account
  7. * This class is a manager module; it creates a panel for a list of account addresses
  8. * and/or a panel to edit or create an address.
  9. *@author Erik Winn <erikwinnmail@yahoo.com>
  10. *
  11. *
  12. * $Id: AccountAddressModule.class.php 109 2008-09-03 17:38:39Z erikwinn $
  13. *@version 0.1
  14. *
  15. *@copyright (C) 2008 by Erik Winn
  16. *@license GPL v.2
  17. This program is free software; you can redistribute it and/or modify
  18. it under the terms of the GNU General Public License as published by
  19. the Free Software Foundation; either version 2 of the License, or
  20. (at your option) any later version.
  21. This program is distributed in the hope that it will be useful,
  22. but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. GNU General Public License for more details.
  25. You should have received a copy of the GNU General Public License
  26. along with this program; if not, write to the Free Software
  27. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
  28. *
  29. *@package Quasi
  30. * @subpackage Modules
  31. */
  32. class AccountAddressModule extends ListModuleBase
  33. {
  34. private $intAddressId;
  35. /**
  36. * Note: the parameter array is derived from the request url string by AccountManagerModule.
  37. * This array is passed by default to Account function modules, in this case it contains only
  38. * one optional element - an address id.
  39. *
  40. * Module constructor
  41. *@param ContentBlock - parent controller object.
  42. *@param array - aryParameters, should contain one element with an address id or be empty
  43. */
  44. public function __construct( $objParentObject, $aryParameters)
  45. {
  46. $this->objParentObject =& $objParentObject;
  47. if(!empty($aryParameters))
  48. $this->intAddressId = $aryParameters[0];
  49. try {
  50. parent::__construct($this->objParentObject);
  51. } catch (QCallerException $objExc) {
  52. $objExc->IncrementOffset();
  53. throw $objExc;
  54. }
  55. $this->AutoRenderChildren = true;
  56. // $this->strTemplate = __QUASI_CORE_TEMPLATES__ . '/AccountAddressModule.tpl.php';
  57. if($this->objAccount instanceof Account)
  58. $this->InitPanels();
  59. }
  60. protected function InitPanels()
  61. {
  62. ///@todo parse the parameters to accept going directly to edit a specific address ..
  63. //if($this->intAddressId) ...
  64. // Get rid of all child controls for list and edit panels - not sure we need to do this here, remove?
  65. $this->pnlListView->RemoveChildControls(true);
  66. $this->pnlItemView->RemoveChildControls(true);
  67. $this->pnlItemView->Visible = false;
  68. $objNewPanel = new AccountAddressListPanel($this->pnlListView,
  69. $this,
  70. 'ShowItemPanel',
  71. 'CloseItemPanel',
  72. $this->Account->Id);
  73. $this->pnlListView->Visible = true;
  74. }
  75. /**
  76. * Unused
  77. */
  78. public function Validate()
  79. {
  80. $blnToReturn = true;
  81. // validate input here
  82. return $blnToReturn;
  83. }
  84. public function __get($strName)
  85. {
  86. switch ($strName)
  87. {
  88. default:
  89. try {
  90. return parent::__get($strName);
  91. } catch (QCallerException $objExc) {
  92. $objExc->IncrementOffset();
  93. throw $objExc;
  94. }
  95. }
  96. }
  97. public function __set($strName, $mixValue)
  98. {
  99. switch ($strName)
  100. {
  101. default:
  102. try {
  103. return (parent::__set($strName, $mixValue));
  104. } catch (QCallerException $objExc) {
  105. $objExc->IncrementOffset();
  106. throw $objExc;
  107. }
  108. }
  109. }
  110. }//end class
  111. }//end define
  112. ?>