PHP Classes

File: view/melis-cms/page-languages/render-pagetab-lang-create.phtml

Recommend this page to a friend!
  Classes of Fabrice Fesch   Melis CMS   view/melis-cms/page-languages/render-pagetab-lang-create.phtml   Download  
File: view/melis-cms/page-languages/render-pagetab-lang-create.phtml
Role: Example script
Content type: text/plain
Description: Example script
Class: Melis CMS
Content management system that provides its tools
Author: By
Last change:
Date: 1 year ago
Size: 2,775 bytes
 

Contents

Class file image Download
<?php
    $id
= $this->idPage.'_'.$this->zoneconfig['conf']['id'];
   
$data_melisKey = $this->zoneconfig['conf']['melisKey'];
?>
<div class="col-xs-12 col-md-6" id="<?= $id; ?>" data-melisKey='<?= $data_melisKey; ?>'>
    <div class="widget">
        <div class="widget-body padding-none">
            <div class="bg-white margin-none">
                <h4 class="pagelang-title"><?php echo $this->translate('tr_meliscms_page_lang_create_form')?></h4>
                <?php
                    $form
= $this->createPageLangform;
                   
$form->prepare();
                   
$form->setAttribute('id', $this->idPage.'_'.$form->getAttribute('id'));
                   
$formId = $form->getAttribute('id');
                   
$form->get('pageLangLocale')->setAttribute('class', 'dropdown-lang');
                    echo
$this->form()->openTag($form);
                    echo
$this->formRow($form->get('pageLangPageId'));
               
?>
<div class="dropdown-lang-box">
                        <?php
                            $form
->get('pageLangLocale')->setLabel('');
                            echo
$this->formRow($form->get('pageLangLocale'));
                       
?>
<div class="form-group">
                            <button type="button" class="btn btn-success float-right pageLangCreate" data-pageid="<?php echo $idPage?>" data-formid="<?php echo $formId?>"><?php echo $this->translate('tr_meliscms_page_lang_create_btn')?></button>
                        </div>
                    </div>
                <?php echo $this->form()->closeTag($form);?>
</div>
        </div>
    </div>
    <div id="<?php echo $this->idPage?>_pageLangFlagsPath" class="hidden">
        <?php echo $this->langFlags?>
</div>
</div>
<script>
    $(function() {
        var langlists = $('form#<?php echo $form->getAttribute('id')?> select.dropdown-lang');
        $('div.loadAttrCont').hide();
        langlists.fadeIn();
        langlists.select2({
            placeholder: translations.tr_meliscms_page_lang_choose_opt,
            templateResult: formatState,
            language: {
                noResults: function() {
                    return translations.tr_meliscms_page_lang_no_result_opt;
                }
            },
        });
       
        $("langlists").next(".select2").addClass("select-lang");
        function formatState (state) {
           
            if (!state.id) {
                return state.text;
            }
           
            var $state = $(
                '<span>'+$("#<?php echo$this->idPage?>_pageLangFlagsPath #<?php echo $this->idPage?>"+state.element.value).html()+'<span>'
            );
           
            return $state;
        };
    });
</script>