<?php

$this->template('/public/placeholder/top-bar.php');

$this->template('/public/placeholder/banner.php');

?>



<div id="my_agency">

    <div id="inner_my_agency" class="container">



        <h1><?= $this->input('title')?></h1>



        <div class="intro"><?= $this->wysiwyg('intro',   ['toolbarGroups' => [["name" => "clipboard", "groups" => ['clipboard', 'undo', 'cleanup']]]]); ?></div>



        <div class="step" id="name">

            <div class="heading">

                <span><?=$this->input('agency-name') ?></span>

                <span class="edit"><?= $this->t('edit') ?></span>

            </div>

            <div class="content <?php if(!$this->formName->hasErrors() || $this->formName->updated) echo 'fold has-error'; ?>">

                <?php

                if($this->editmode)

                    echo $this->input('name-label');

                else

                    $this->formName->setAgencyNameLabel($this->input('name-label')->text);



                ?>

                <?= $this->formName ?>

            </div>

        </div>



        <div class="step" id="logo">

            <div class="heading">

                <span><?=$this->input('agency-logo') ?></span>

                <span class="edit"><?= $this->t('edit') ?></span>

            </div>

            <div class="content <?php if(!$this->formName->hasErrors() || $this->formName->updated) echo 'fold has-error'; ?>">

                <?= $this->formLogo ?>

            </div>

        </div>



        <div class="step" id="address">

            <div class="heading">

                <span><?=$this->input('agency-address') ?></span>

                <span class="edit"><?= $this->t('edit') ?></span>

            </div>

            <div class="content <?php if(!$this->formAddress->hasErrors() || $this->formAddress->updated) echo 'fold has-error'; ?>">

                <?= $this->formAddress ?>

            </div>

        </div>



        <div class="step" id="websites">

            <div class="heading">

                <span><?=$this->input('agency-websites') ?></span>

                <span class="edit"><?= $this->t('edit') ?></span>

            </div>

            <div class="content <?php if(!$this->formWebsites->hasErrors()) echo 'fold has-error'; ?>">

                <?= $this->formWebsites ?>

            </div>

        </div>



        <div class="step" id="descriptions">

            <div class="heading">

                <span><?=$this->input('agency-descriptions') ?></span>

                <span class="edit"><?= $this->t('edit') ?></span>

            </div>

            <div class="content <?php if(!$this->formDescription->hasErrors()) echo 'fold has-error'; ?>">

                <?= $this->formDescription ?>

            </div>

        </div>



    </div>

</div>



<script type="text/javascript">

    $(function() {$('#upload_logo').picEdit({

        <?php if($this->agency instanceof Website\Model\Agency) { ?>

        defaultImage : '/upload/<?= $this->agency->getUid()?>/logo.png'

        <?php } ?>

    });});

</script>



<script>

    CKEDITOR.replace( 'long_description_fr', {

        toolbar :

            [

                { name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },

                { name: 'basicstyles', items : [ 'Bold','Italic','Strike','-','RemoveFormat' ] },

                { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent' ] }

            ]

    } );

    CKEDITOR.replace( 'long_description_Nl', {

        toolbar :

            [

                { name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },

                { name: 'basicstyles', items : [ 'Bold','Italic','Strike','-','RemoveFormat' ] },

                { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent' ] }

            ]

    } );

    CKEDITOR.replace( 'long_description_En', {

        toolbar :

            [

                { name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },

                { name: 'basicstyles', items : [ 'Bold','Italic','Strike','-','RemoveFormat' ] },

                { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent' ] }

            ]

    } );

</script>



<script>

    $('.heading').click(function(){

        $($(this).siblings()[0]).toggleClass('fold');

    });

</script>





