예제 #1
0
 /**
  * Renders blocks in grid
  * @param  array  $grid Grid data
  * @return string HTML code of rendered blocks
  */
 public function renderBlocks($grid)
 {
     $content = '';
     if (isset($this->_blocks[$grid['grid_id']])) {
         foreach ($this->_blocks[$grid['grid_id']] as $block) {
             if (isset($this->_rendered_blocks[$block['snapping_id']])) {
                 $content = $this->_rendered_blocks[$block['snapping_id']];
             } else {
                 $block['status'] = self::correctStatusForDynamicObject($block, $this->_dynamic_object_scheme);
                 /**
                  * Actions before render block
                  * @param array $grid Grid data
                  * @param array $block Block data
                  * @param object $this Current RenderManager object
                  * @param string $content Rendered content of blocks
                  */
                 fn_set_hook('render_blocks', $grid, $block, $this, $content);
                 if ($this->_area == 'C' && $block['status'] == 'D') {
                     // Do not render block in frontend if it disabled
                     continue;
                 }
                 Debugger::blockRenderingStarted($block);
                 $content .= self::renderBlock($block, $grid, $this->_area);
                 Debugger::blockRenderingEnded($block['block_id']);
                 $this->_rendered_blocks[$block['snapping_id']] = $content;
             }
         }
     }
     return $content;
 }