getAvailableLayouts() public static method

public static getAvailableLayouts ( $render_view = false )
Exemplo n.º 1
0
echo $form->error($model, 'parent');
?>
        <script type="text/javascript">
            $('#parent_page_select').change(function() {
                $('#parent_value').val( $('#parent_page_select').val());
                $('#form_suggest_page').val( $('#parent_page_select option:selected:first').html());
            });
        </script>
        
    </div>
    <div class="row">
       <?php 
echo $form->labelEx($model, 'layout');
?>
       <?php 
echo $form->dropDownList($model, 'layout', GxcHelpers::getAvailableLayouts(true), array('id' => 'layout_select', 'options' => $model->layout === null ? array('default' => array('selected' => true)) : array($model->layout => array('selected' => true))));
?>
        <?php 
echo $form->error($model, 'layout');
?>
        
      
    </div>
    
       
    <div class="row">
       
                <?php 
echo $form->labelEx($model, 'display_type', array());
?>
                <?php 
Exemplo n.º 2
0
 public static function changeParent()
 {
     $layout = 'default';
     $parent = isset($_POST['parent']) ? $_POST['parent'] : 0;
     $result = array();
     $result['layout'] = $layout;
     $result['regions'] = array();
     $result['blocks'] = array();
     //From here, we will start to get the layouts info
     $available_layouts = GxcHelpers::getAvailableLayouts(false);
     if ($parent) {
         $page = Page::model()->findByPk($parent);
         if ($page) {
             $result['layout'] = $layout = $page->layout;
             //We now find all blocks of this parent
             $page_blocks = PageBlock::model()->with('block')->findAll(array('condition' => 'page_id = :pid', 'params' => array(':pid' => $parent), 'order' => 'region ASC, block_order ASC'));
             foreach ($page_blocks as $pb) {
                 $temp['region'] = $pb->region;
                 $temp['id'] = $pb->block_id;
                 $temp['status'] = $pb->status;
                 $temp['title'] = $pb->block->name;
                 $result['blocks'][] = $temp;
             }
         }
     }
     $result['regions'] = isset($available_layouts[$layout]['regions']) ? $available_layouts[$layout]['regions'] : $available_layouts['default']['regions'];
     $result['types'] = isset($available_layouts[$layout]['types']) ? $available_layouts[$layout]['types'] : $available_layouts['default']['types'];
     echo json_encode($result);
 }