Commit 539dedaf authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

ajout option 'non modifiable' pour les textarea

parent 441b2673
Loading
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -33,6 +33,30 @@ $array = "[" . implode(",", $temp) . "]";

<script>

    function initTinymce() {
        tinymce.remove();
        tinymce.init({
            selector: '.tinymce',
            toolbar: 'newdocument undo redo | bold italic underline removeformat | bullist',
            resize: true,
            language: 'fr_FR',
            plugins: 'lists',
            statusbar: true,
            browser_spellcheck: true,
            branding: false,
            menu: {},
            menubar: false,
            height: 250,
            body_id: 'description',
            setup: function (editor) {
                editor.on("focusout", function () {
                    console.log(tinymce.get('description').getContent());
                    $('textarea').val(tinymce.get('description').getContent());
                });
            }
        });
    };

    function readOptions(optionsText) {
        let array = optionsText.split(';');
        let fields = [];
@@ -67,6 +91,8 @@ $array = "[" . implode(",", $temp) . "]";
                }
            }
        }

        initTinymce();
    });

    function removeIt(element) {
+33 −19
Original line number Diff line number Diff line
@@ -9,6 +9,19 @@ use UnicaenAutoform\Entity\Db\Champ;
$options = ($champ->getOptions() !== null)??explode(';', $champ->getOptions());
?>

<?php if (in_array('non modifiable', $options)) : ?>
    <div>
        <?php if ($champ->getTexte() !== 'nil') : ?>
            <?php echo $champ->getLibelle(); ?>&nbsp;:
        <?php endif; ?>

        <?php if ($reponse !== 'null') : ?>
            <div style="border-left: 1px solid grey; background: whitesmoke;margin: 0.25rem;padding: 0.5rem;">
                <?php echo $reponse; ?>
            </div>
        <?php endif; ?>
    </div>
<?php else : ?>
    <div class="row">
        <div class="form-group">
            <?php if (trim($champ->getLibelle()) !== 'nil') : ?>
@@ -32,6 +45,7 @@ $options = ($champ->getOptions() !== null)??explode(';', $champ->getOptions());
            </div>
        </div>
    </div>
<?php endif; ?>

<style>
    textarea {