A QCodo powered CMS
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.

101 lines
2.7 KiB

  1. <?php
  2. if (!defined('QUINTACMS'))
  3. die("No quinta.");
  4. if (!defined("ACCOUNTADDRESSMODULE.CLASS.PHP")) {
  5. define("ACCOUNTADDRESSMODULE.CLASS.PHP", 1);
  6. /**
  7. * Class AccountAddressModule - view/manage orders for a user account
  8. * This class is a manager module; it creates a panel for a list of account addresses
  9. * and/or a panel to edit or create an address.
  10. * @author Erik Winn <sidewalksoftware@gmail.com>
  11. *
  12. * @version 0.3
  13. *
  14. * @package Quinta
  15. * @subpackage Modules
  16. */
  17. class AccountAddressModule extends ListModuleBase {
  18. private $intAddressId;
  19. /**
  20. * Note: the parameter array is derived from the request url string by AccountManagerModule.
  21. * This array is passed by default to Account function modules, in this case it contains only
  22. * one optional element - an address id.
  23. *
  24. * Module constructor
  25. * @param ContentBlock - parent controller object.
  26. * @param array - aryParameters, should contain one element with an address id or be empty
  27. */
  28. public function __construct($objParentObject, $aryParameters) {
  29. $this->objParentObject = & $objParentObject;
  30. if (!empty($aryParameters))
  31. $this->intAddressId = $aryParameters[0];
  32. try {
  33. parent::__construct($this->objParentObject);
  34. } catch (QCallerException $objExc) {
  35. $objExc->IncrementOffset();
  36. throw $objExc;
  37. }
  38. $this->AutoRenderChildren = true;
  39. // $this->strTemplate = __QUINTA_CORE_VIEWS__ . '/AccountAddressModule.tpl.php';
  40. if ($this->objAccount instanceof Account)
  41. $this->InitPanels();
  42. }
  43. protected function InitPanels() {
  44. ///@todo parse the parameters to accept going directly to edit a specific address ..
  45. //if($this->intAddressId) ...
  46. // Get rid of all child controls for list and edit panels - not sure we need to do this here, remove?
  47. $this->pnlListView->RemoveChildControls(true);
  48. $this->pnlItemView->RemoveChildControls(true);
  49. $this->pnlItemView->Visible = false;
  50. $objNewPanel = new AccountAddressListPanel($this->pnlListView,
  51. $this,
  52. 'ShowItemPanel',
  53. 'CloseItemPanel');
  54. $this->pnlListView->Visible = true;
  55. }
  56. /**
  57. * Unused
  58. */
  59. public function Validate() {
  60. $blnToReturn = true;
  61. // validate input here
  62. return $blnToReturn;
  63. }
  64. public function __get($strName) {
  65. switch ($strName) {
  66. default:
  67. try {
  68. return parent::__get($strName);
  69. } catch (QCallerException $objExc) {
  70. $objExc->IncrementOffset();
  71. throw $objExc;
  72. }
  73. }
  74. }
  75. public function __set($strName, $mixValue) {
  76. switch ($strName) {
  77. default:
  78. try {
  79. return (parent::__set($strName, $mixValue));
  80. } catch (QCallerException $objExc) {
  81. $objExc->IncrementOffset();
  82. throw $objExc;
  83. }
  84. }
  85. }
  86. }
  87. //end class
  88. }//end define
  89. ?>