Advertisement
Guest User

Untitled

a guest
Aug 7th, 2011
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.3.0
  8. * @ Author : DeZender
  9. * @ Release on : 17.05.2011
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class Cerebrum_All_Model_Observer
  15. {
  16. const MODULE_NAME = "Cerebrum_All";
  17.  
  18. public function preDispatch( $observer )
  19. {
  20. if ( Mage::getsingleton( "admin/session" )->isLoggedIn() ) {
  21. $feedModel = Mage::getmodel( "all/feed" );
  22. $feedModel->checkUpdate();
  23. }
  24. }
  25.  
  26. public function core_block_abstract_to_html_before( $observer = NULL )
  27. {
  28. try {
  29. if ( "1.4.1" <= Mage::getversion() ) {
  30. return $this;
  31. }
  32. if ( $observer == null ) {
  33. return $this;
  34. }
  35. $event = $observer->getEvent();
  36. $block = $event->getBlock();
  37. $block_name = $block->getNameInLayout();
  38. $action = $block->getAction();
  39. $action_name = gettype( $action ) == "object" ? $action->getFullActionName() : "";
  40. $processor = "";
  41. if ( $action_name == "checkout_onepage_success" && strpos( $block_name, "content" ) === 0 ) {
  42. $processor = "SuccessPageProcessor";
  43. }
  44. if ( $processor != "" ) {
  45. $html = $this->GetBlockHtml( $block );
  46. $html = $this->$processor( $html );
  47. $this->SetBlockHtml( $block, $html );
  48. }
  49. if ( $action_name == "adminhtml_dashboard_index" && strpos( $block_name, "content" ) === 0 ) {
  50. $processor = "AdminhtmlDashboardIndex_Content";
  51. }
  52. if ( $processor != "" ) {
  53. $html = $this->GetBlockHtml( $block );
  54. $html = $this->$processor( $html );
  55. $this->SetBlockHtml( $block, $html );
  56. }
  57. }
  58. catch ( Exception $e ) {
  59. echo $e->getMessage();
  60. }
  61. return $this;
  62. }
  63.  
  64. public function core_block_abstract_to_html_after( $observer = null )
  65. {
  66. try {
  67. if ( Mage::getversion() < "1.4.1" ) {
  68. return $this;
  69. }
  70. if ( $observer == null ) {
  71. return $this;
  72. }
  73. $event = $observer->getEvent();
  74. $block_name = $event->getBlock()->getNameInLayout();
  75. $action_name = gettype( $event->getBlock()->getAction() ) == "object" ? $event->getBlock()->getAction()->getFullActionName() : "";
  76. $transport = $event->getTransport();
  77. if ( $action_name == "checkout_onepage_success" && strpos( $block_name, "content" ) === 0 ) {
  78. $transport['html'] = $this->SuccessPageProcessor( $transport['html'] );
  79. }
  80. if ( "checkout.success" == $observer->getEvent()->getBlock()->getNameInLayout() && !Mage::getstoreconfig( "advanced/modules_disable_output/" . self::MODULE_NAME ) ) {
  81. $block = new Cerebrum_All_Block_Googleadwordsconversion();
  82. $block->setPassingTransport( $transport['html'] );
  83. $block->toHtml();
  84. $block = new Cerebrum_All_Block_Ebit();
  85. $block->setPassingTransport( $transport['html'] );
  86. $block->toHtml();
  87. }
  88. if ( $action_name == "adminhtml_dashboard_index" && strpos( $block_name, "content" ) === 0 ) {
  89. $transport['html'] = $this->AdminhtmlDashboardIndex_Content( $transport['html'] );
  90. }
  91. }
  92. catch ( Exception $e ) {
  93. echo $e->getMessage();
  94. }
  95. return $this;
  96. }
  97. ..............
  98. ......
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement