<section class="content">
    <div class="row">
        <div class="col-sm-12">
            <div class="tabbable">
                <div class="tab-content no-border padding-24">
                    <div class="tab-pane fade in active" id="faq-tab-1">
                        <div class="space-8"></div>
                        <div class="panel-group accordion-style1 accordion-style2" id="faq-list-1">
                            <div class="panel panel-default">
                                <?php if($view ==''){?>
                                <div class="panel-headingnew">Add Page</div>
                                <?php }else{?>
                                 <div class="panel-headingnew">View Details</div>
                                <?php
                                }
                                $form = $this->form;
                                $form->prepare();
                                $form->setAttribute('action', $this->url('menu', ['action' => 'edit-cms-page']));
                                $form->setAttribute('method', 'post');
                                echo $this->form()->openTag($form);
                                echo $this->formHidden($form->get('id'));
                                if($view !=''){
                                foreach ($form->getElements() as $element) {
                                $element->setAttribute('disabled', true);
                                $element->setAttribute('readonly',true);
                                 } }
                                
                                ?>

                                <div class="left_panel col-sm-12 padding_margin0 pull-left bg-white">
                                    <div class="col-sm-12  " align="right">
                                        <div class="tool-bar margin">
                                            <div style="text-align: right" class="col-md-8 pull-right"><a href="<?php echo $this->url('menu', array('action' => 'cms-pages')); ?>" id="system_restore" class="btn btn-danger"><i class="fa fa-backward"></i> Back</a>
                                            <?php if($view ==''){?>
                                            
                                                <a href="#" class="reset_btn btn btn-success"><i class="fa fa-retweet"></i> Reset</a>
                                                <?php echo $this->FormElement($form->get('save')); ?>
                                            
                                            <?php } ?>
</div>
                                        </div>
                                    </div>


                                    <div class="col-sm-col-sm-offset-1 margin-10auto0 paddingRL10px">
                                        <div class="row">
                                            <div class="col-sm-12" >
                                                <fieldset class=""><legend>General Information</legend><span class="top-go clearfix"><a href="#topGo" title="Click To Go Top" class="btn btn-blue btn-xs pull-right"><i class="fa fa-chevron-up"></i></a></span>


                                                    <div class="form-group clearfix margintopbottom20">
                                                        <label class="col-sm-2 col-xs-12 control-label" for="site_name"><?php echo $this->translate($this->formLabel($form->get('page_title'))); ?></label>
                                                        <div class="col-sm-6 col-xs-10">
                                                            <?php echo $this->FormElement($form->get('page_title')); ?>
                                                            <?php echo $this->formElementErrors($form->get('page_title'), ['class' => 'error']); ?>
                                                        </div>
                                                    </div>

                                                    <div class="form-group clearfix margintopbottom20">
                                                        <label class="col-sm-2 col-xs-12 control-label" for="site_name"><?php echo $this->translate($this->formLabel($form->get('page_type'))); ?></label>
                                                        <div class="col-sm-6 col-xs-10">
                                                            <?php echo $this->FormElement($form->get('page_type')); ?>
                                                            <?php echo $this->formElementErrors($form->get('page_type'), ['class' => 'error']); ?>
                                                        </div>
                                                    </div>

                                                    <div class="form-group clearfix margintopbottom20">
                                                        <label class="col-sm-2 col-xs-12 control-label" for="site_name"><?php echo $this->translate($this->formLabel($form->get('page_url'))); ?></label>
                                                        <div class="col-sm-6 col-xs-10">
                                                            <?php echo $this->FormElement($form->get('page_url')); ?>
                                                            <?php echo $this->formElementErrors($form->get('page_url'), ['class' => 'error']); ?>
                                                        </div>
                                                    </div>

                                                    <div class="form-group clearfix margintopbottom20">
                                                        <label class="col-sm-2 col-xs-12 control-label" for="site_name"><?php echo $this->translate($this->formLabel($form->get('page_image'))); ?></label>
                                                        <div class="col-sm-6 col-xs-10">
                                                            <?php echo $this->FormElement($form->get('page_image')); ?>
                                                        </div>
                                                    </div>

                                                    <div class="form-group clearfix margintopbottom20">
                                                        <label class="col-sm-2 col-xs-12 control-label" for="site_name"><?php echo $this->translate($this->formLabel($form->get('page_order'))); ?></label>
                                                        <div class="col-sm-6 col-xs-10">
                                                            <?php echo $this->FormElement($form->get('page_order')); ?>
                                                            <?php echo $this->formElementErrors($form->get('page_order'), ['class' => 'error']); ?>
                                                        </div>
                                                    </div>


                                                    <div class="form-group clearfix margintopbottom20">
                                                        <label class="col-sm-2 col-xs-12 control-label" for="site_name"><?php echo $this->translate($this->formLabel($form->get('page_desc'))); ?></label>
                                                        <div class="col-sm-10 col-xs-10">
                                                            <?php echo $this->FormElement($form->get('page_desc')); ?>
                                                            <?php echo $this->formElementErrors($form->get('page_desc'), ['class' => 'error']); ?>
                                                        </div>
                                                    </div>

                                                    <div class="form-group clearfix margintopbottom20">
                                                        <label class="col-sm-2 col-xs-12 control-label" for="site_name"><?php echo $this->translate($this->formLabel($form->get('show_after_login'))); ?></label>
                                                        <div class="col-sm-6 col-xs-10">
                                                            <?php echo $this->FormElement($form->get('show_after_login')); ?>
                                                            <?php echo $this->formElementErrors($form->get('show_after_login'), ['class' => 'error']); ?>
                                                        </div>
                                                    </div>

                                                    <div class="form-group clearfix margintopbottom20">
                                                        <label class="col-sm-2 col-xs-12 control-label" for="site_name"><?php echo $this->translate($this->formLabel($form->get('page_target'))); ?></label>
                                                        <div class="col-sm-6 col-xs-10">
                                                            <?php echo $this->FormElement($form->get('page_target')); ?>
                                                            <?php echo $this->formElementErrors($form->get('page_target'), ['class' => 'error']); ?>
                                                        </div>
                                                    </div>

                                                    <div class="form-group clearfix margintopbottom20">
                                                        <label class="col-sm-2 col-xs-12 control-label" for="site_name"><?php echo $this->translate($this->formLabel($form->get('icon_class'))); ?></label>
                                                        <div class="col-sm-6 col-xs-10">
                                                            <?php echo $this->FormElement($form->get('icon_class')); ?>
                                                            <?php echo $this->formElementErrors($form->get('icon_class'), ['class' => 'error']); ?>
                                                        </div>
                                                    </div>

                                                    <legend>Meta Information</legend>

                                                    <div class="form-group clearfix margintopbottom20">
                                                        <label class="col-sm-2 col-xs-12 control-label" for="site_name"><?php echo $this->translate($this->formLabel($form->get('meta_title'))); ?></label>
                                                        <div class="col-sm-6 col-xs-10">
                                                            <?php echo $this->FormElement($form->get('meta_title')); ?>
                                                            <?php echo $this->formElementErrors($form->get('meta_title'), ['class' => 'error']); ?>
                                                        </div>
                                                    </div>

                                                    <div class="form-group clearfix margintopbottom20">
                                                        <label class="col-sm-2 col-xs-12 control-label" for="site_name"><?php echo $this->translate($this->formLabel($form->get('meta_keywords'))); ?></label>
                                                        <div class="col-sm-6 col-xs-10">
                                                            <?php echo $this->FormElement($form->get('meta_keywords')); ?>
                                                            <?php echo $this->formElementErrors($form->get('meta_keywords'), ['class' => 'error']); ?>
                                                        </div>
                                                    </div>

                                                    <div class="form-group clearfix margintopbottom20">
                                                        <label class="col-sm-2 col-xs-12 control-label" for="site_name"><?php echo $this->translate($this->formLabel($form->get('meta_desc'))); ?></label>
                                                        <div class="col-sm-6 col-xs-10">
                                                            <?php echo $this->FormElement($form->get('meta_desc')); ?>
                                                            <?php echo $this->formElementErrors($form->get('meta_desc'), ['class' => 'error']); ?>
                                                        </div>
                                                    </div>
                                                </fieldset>
                                            </div>
                                        </div>
                                    </div>



                                    <div class="col-sm-12  " align="right">
                                        <div class="tool-bar margin">
                                            <a href="<?php echo $this->url('menu', array('action' => 'cms-pages')); ?>" id="system_restore" class="btn btn-danger"><i class="fa fa-backward"></i> Back</a>
                                        <?php if($view ==''){?>
                                        
                                            <a href="#" class="reset_btn btn btn-success"><i class="fa fa-retweet"></i> Reset</a>
                                            <?php echo $this->FormElement($form->get('save')); ?>
                                       
                                        <?php }?> </div>
                                    </div>
                                </div>

                                <?php echo $this->form()->closeTag(); ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <br>
    </div>
</section>

<?php echo $this->inlineScript()->appendFile($this->basePath('/includes/ckeditor/ckeditor.js')); ?>
<script type="text/javascript">
    CKEDITOR.dtd.$removeEmpty['i'] = false;
    CKEDITOR.replace('page_desc',
            {
                filebrowserBrowseUrl: '/includes/ckfinder/ckfinder.html',
                filebrowserImageBrowseUrl: '/includes/ckfinder/ckfinder.html?type=Images',
                filebrowserFlashBrowseUrl: '/includes/ckfinder/ckfinder.html?type=Flash',
                filebrowserUploadUrl: '/includes/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
                filebrowserImageUploadUrl: '/includes/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
                filebrowserFlashUploadUrl: '/includes/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash',
                enterMode: CKEDITOR.ENTER_BR
            });
</script>
