Changeset 27370
- Timestamp:
- Feb 13, 2014, 11:24:06 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/block.class.php
r26461 r27370 50 50 public function load_registered_blocks() 51 51 { 52 trigger_action('blockmanager_register_blocks', array( &$this));52 trigger_action('blockmanager_register_blocks', array($this)); 53 53 } 54 54 … … 72 72 * Add a block with the menu. Usually called in 'blockmanager_register_blocks' event. 73 73 * 74 * @param RegisteredBlock &$block75 */ 76 public function register_block( &$block)74 * @param RegisteredBlock $block 75 */ 76 public function register_block($block) 77 77 { 78 78 if (isset($this->registered_blocks[$block->get_id()])) 79 79 { 80 trigger_error("Block '".$block->get_id()."' is already registered", E_USER_WARNING);81 80 return false; 82 81 } 83 $this->registered_blocks[$block->get_id()] = &$block;82 $this->registered_blocks[$block->get_id()] = $block; 84 83 return true; 85 84 } … … 112 111 } 113 112 $this->sort_blocks(); 114 trigger_action('blockmanager_prepare_display', array( &$this));113 trigger_action('blockmanager_prepare_display', array($this)); 115 114 $this->sort_blocks(); 116 115 } … … 141 140 * 142 141 * @param string $block_id 143 * @return &DisplayBlock|null 144 */ 145 public function &get_block($block_id) 146 { 147 $tmp = null; 142 * @return DisplayBlock|null 143 */ 144 public function get_block($block_id) 145 { 148 146 if (isset($this->display_blocks[$block_id])) 149 147 { 150 148 return $this->display_blocks[$block_id]; 151 149 } 152 return $tmp;150 return null; 153 151 } 154 152 … … 194 192 195 193 $template->set_filename('menubar', $file); 196 trigger_action('blockmanager_apply', array( &$this) );194 trigger_action('blockmanager_apply', array($this) ); 197 195 198 196 foreach ($this->display_blocks as $id=>$block) … … 280 278 281 279 /** 282 * @param RegisteredBlock &$block280 * @param RegisteredBlock $block 283 281 */ 284 282 public function __construct($block) 285 283 { 286 $this->_registeredBlock = &$block;287 } 288 289 /** 290 * @return &RegisteredBlock291 */ 292 public function &get_block()284 $this->_registeredBlock = $block; 285 } 286 287 /** 288 * @return RegisteredBlock 289 */ 290 public function get_block() 293 291 { 294 292 return $this->_registeredBlock;
Note: See TracChangeset
for help on using the changeset viewer.