PageRenderTime 26ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/sop/2.0beta1/Lib/Action/MemberCommAction.class.php

http://iiccms.googlecode.com/
PHP | 76 lines | 53 code | 8 blank | 15 comment | 7 complexity | 4673702128eb39e0260fa600d62c7606 MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, LGPL-2.1
  1. <?php
  2. /**
  3. * @author nanze
  4. * @link
  5. * @todo
  6. * @copyright 811046@qq.com
  7. * @version 1.0
  8. * @lastupdate 2010-11-26
  9. */
  10. class MemberCommAction extends Action{
  11. protected static $Model=null; //??Model
  12. var $sessionID, $memberID;
  13. protected $theme;
  14. function _initialize() {
  15. header("Content-Type:text/html; charset=utf-8");
  16. //??????
  17. self::$Model=D("Region");
  18. $this->Countries=self::$Model->where("type=0")->findall();
  19. //??
  20. if($this->theme=GetSettValue('theme')){
  21. }else{
  22. $this->theme='default';
  23. }
  24. //??
  25. L('_OPERATION_SUCCESS_',"Operation Success");
  26. L('_OPERATION_FAIL_','Operation Fail');
  27. //$this->currencies=get_currencies_arr();
  28. //???????session id
  29. $this->sessionID = Session::get ( 'sessionID' );
  30. if (! $this->sessionID) {
  31. $this->sessionID = md5 ( uniqid ( rand () ) );
  32. Session::set ( 'sessionID', $this->sessionID );
  33. }
  34. //????id
  35. $this->memberID = Session::get ( 'memberID' );
  36. if (! $this->memberID) {
  37. $this->memberID = 0;
  38. Session::set('back',$_SERVER['REQUEST_URI']);
  39. $this->redirect("Public/Login");
  40. } else {
  41. //??????
  42. $this->mid=$this->memberID;
  43. self::$Model = D ( "Members" );
  44. $this->memberInfo = self::$Model->where ( "id=" . $this->memberID )->find ();
  45. self::$Model = D ( "Shippingaddress" );
  46. $this->memberShippingAddress = self::$Model->where ( "id=" . $this->memberID )->find ();
  47. }
  48. }
  49. public function top(){
  50. echo preg_replace("/Member-(?!Index|Public)/i","",$this->fetch('Public:header'));
  51. }
  52. public function left(){
  53. echo preg_replace("/Member-(?!Index|Public)/i","",$this->fetch('Public:left'));
  54. }
  55. public function right(){
  56. echo preg_replace("/Member-(?!Index|Public)/i","",$this->fetch('Public:right'));
  57. }
  58. public function footer(){
  59. echo preg_replace("/Member-(?!Index|Public)/i","",$this->fetch('Public:footer'));
  60. }
  61. protected function display($name = ACTION_NAME, $mnane = MODULE_NAME, $charset = 'utf-8', $contentType = 'text/html') {
  62. if(substr_count($name,'success')>0 || substr_count($name,'Home')>0 || substr_count($name,'404')>0){
  63. return $this->view->display($name);
  64. }
  65. return $this->view->display ( $this->theme . '@'.GROUP_NAME.':' . $mnane . '-' . $name, $charset, $contentType );
  66. }
  67. }
  68. ?>