<commit_before><?php
$form = $this->form;
$routeArray = array('action' => $this->formAction);
if (isset($this->articleId)) $routeArray['id'] = $this->articleId;

if (!$form->get('userId')->getValue()) {
    $userId = $this->identity()->getUserId();
    $form->get('userId')->setValue($userId);
}

?>
<?=$this->headScript()
    ->appendFile($this->themePath('/assets/js/LiveEditor/scripts/innovaeditor.js'))
    ->appendFile($this->themePath('/assets/js/LiveEditor/scripts/jquery.innovaeditor.js'))
    ->appendFile('//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js')
    ->appendFile($this->themePath('/assets/js/LiveEditor/scripts/common/webfont.js'))
;
?>
<div class="row">
    <form class="col-md-12 form form-horizontal" method="post" action="<?=$this->url('admin/article/edit', $routeArray) ?>">
        <fieldset>
        <legend><?=ucwords($this->formAction); ?> Article Form:</legend>
        <div class="row">
            <div class="col-sm-6">
                <fieldset>
           	        <legend>Article Details</legend>
                    <div class="form-group<?php if ($form->get('title')->getMessages()) echo ' has-error'; ?>">
                        <label class="col-md-4 control-label" for="title"><?=$form->get('title')->getLabel();?></label>
                        <div class="col-md-8">
                            <?=$this->formText($form->get('title')); ?>
                            <span class="help-block">
                                <?=$this->formElementErrors($form->get('title'), [
                                    'class' => 'list-unstyled'
                                ]); ?>
                            </span>
                        </div>
                    </div>
                    
                     <div class="form-group<?php if ($form->get('slug')->getMessages()) echo ' has-error'; ?>">
                        <label class="col-md-4 control-label" for="slug"><?=$form->get('slug')->getLabel();?></label>
                        <div class="col-md-8">
                            <?=$this->formText($form->get('slug')); ?>
                            <span class="help-block">
                            <?=$this->formElementErrors($form->get('slug'), [
                                'class' => 'list-unstyled'
                            ]); ?>
                            </span>
                        </div>
                    </div>

                     <div class="form-group<?php if ($form->get('description')->getMessages()) echo ' has-error'; ?>">
                        <label class="col-md-4 control-label" for="description"><?=$form->get('description')->getLabel();?></label>
                        <div class="col-md-8">
                            <?=$this->formText($form->get('description')); ?>
                            <span class="help-block">
                            <?=$this->formElementErrors($form->get('description'), [
                                'class' => 'list-unstyled'
                            ]); ?>
                            </span>
                        </div>
                    </div>

                    <div class="form-group<?php if ($form->get('resource')->getMessages()) echo ' has-error'; ?>">
                        <label class="col-md-4 control-label" for="resource"><?=$form->get('resource')->getLabel();?></label>
                        <div class="col-md-8">
                            <?=$this->formSelect($form->get('resource')); ?>
                            <span class="help-block">
                            <?=$this->formElementErrors($form->get('resource'), [
                                'class' => 'list-unstyled'
                            ]); ?>
                            </span>
                        </div>
                    </div>
                </fieldset>
           	</div>
            
            <div class="col-sm-6">
                <fieldset>
           	        <legend>Menu</legend>
           	        
                    <?=$this->navigationForm(); ?>
                    
           	        <div class="form-group">
                        <div class="col-md-offset-4 col-md-8">
                             <label class="radio">
                                <input type="radio" name="menuInsertType" id="menuInsertType1" value="noInsert" checked >
                                do not add to menu/no change.
                            </label>
                       	    <label class="radio">
                                <input type="radio" name="menuInsertType" id="menuInsertType2" value="insert">
                                insert after this page.
                            </label>
                            <label class="radio">
                                <input type="radio" name="menuInsertType" id="menuInsertType3" value="insertSub">
                                insert as a sub-page of this page.
                            </label>
                        </div>
                    </div>
                </fieldset>
           	</div>
        </div>
        
        <div class="row">
            <div class="col-md-12">
                <fieldset>
                    <legend>HTML Content</legend>
                    <?=$this->formTextarea($form->get('content')); ?>
                </fieldset>
            </div>
        </div>
                
        <?=$this->formElement($form->get('articleId')); ?>
        <?=$this->formElement($form->get('userId')); ?>
        <input type="hidden" name="action" value="<?=$this->formAction;?>">
        
        <div class="clearfix">&nbsp;</div>
        
        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <button type="submit" class="btn btn-primary" 
                data-loading-text="Please wait...">Submit</button>
                <button type="button" class="btn btn-warning" 
                data-loading-text="Please wait..." onClick="window.location = '<?=$this->url('admin/article', array(
                        'action' => 'list',
                    )) ?>';">Cancel</button>
            </div>
        </div>
        </fieldset>
    </form>
</div>

<script type="text/javascript">
    $(document).ready(function () {
        $('#article-content-textarea').liveEdit({
            css: [
                'http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css',
                'http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css',
                'http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css'
            ] /* Apply bootstrap css into the editing area */ ,
            groups: [
                ["group1", "", ["Bold", "Italic", "Underline", "ForeColor", "RemoveFormat"]],
                ["group2", "", ["Bullets", "Numbering", "Indent", "Outdent"]],
                ["group3", "", ["Paragraph", "FontSize", "FontDialog", "TextDialog"]],
                ["group4", "", ["LinkDialog", "ImageDialog", "TableDialog", "Emoticons", "Snippets"]],
                ["group5", "", ["Undo", "Redo", "FullScreen", "SourceDialog"]]
            ] /* Toolbar configuration */ ,
            fileBrowser: '<?=$this->basePath('/admin/asset-manager')?>'
        });
        $('#article-content-textarea').data('liveEdit').startedit(); /* Run the Editor */
    });
</script>
<commit_msg>change to TinyMce editor<commit_after><?php
$form = $this->form;
$routeArray = array('action' => $this->formAction);
if (isset($this->articleId)) $routeArray['id'] = $this->articleId;

if (!$form->get('userId')->getValue()) {
    $userId = $this->identity()->getUserId();
    $form->get('userId')->setValue($userId);
}

?>
<?=$this->headScript()
    ->appendFile($this->themePath('/assets/js/tinymce/tinymce.min.js'))
    //->appendFile($this->themePath('/assets/js/LiveEditor/scripts/innovaeditor.js'))
    //->appendFile($this->themePath('/assets/js/LiveEditor/scripts/jquery.innovaeditor.js'))
    //->appendFile('//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js')
    //->appendFile($this->themePath('/assets/js/LiveEditor/scripts/common/webfont.js'))
;
?>
<div class="row">
    <form class="col-md-12 form form-horizontal" method="post" action="<?=$this->url('admin/article/edit', $routeArray) ?>">
        <fieldset>
        <legend><?=ucwords($this->formAction); ?> Article Form:</legend>
        <div class="row">
            <div class="col-sm-6">
                <fieldset>
           	        <legend>Article Details</legend>
                    <div class="form-group<?php if ($form->get('title')->getMessages()) echo ' has-error'; ?>">
                        <label class="col-md-4 control-label" for="title"><?=$form->get('title')->getLabel();?></label>
                        <div class="col-md-8">
                            <?=$this->formText($form->get('title')); ?>
                            <span class="help-block">
                                <?=$this->formElementErrors($form->get('title'), [
                                    'class' => 'list-unstyled'
                                ]); ?>
                            </span>
                        </div>
                    </div>
                    
                     <div class="form-group<?php if ($form->get('slug')->getMessages()) echo ' has-error'; ?>">
                        <label class="col-md-4 control-label" for="slug"><?=$form->get('slug')->getLabel();?></label>
                        <div class="col-md-8">
                            <?=$this->formText($form->get('slug')); ?>
                            <span class="help-block">
                            <?=$this->formElementErrors($form->get('slug'), [
                                'class' => 'list-unstyled'
                            ]); ?>
                            </span>
                        </div>
                    </div>

                     <div class="form-group<?php if ($form->get('description')->getMessages()) echo ' has-error'; ?>">
                        <label class="col-md-4 control-label" for="description"><?=$form->get('description')->getLabel();?></label>
                        <div class="col-md-8">
                            <?=$this->formText($form->get('description')); ?>
                            <span class="help-block">
                            <?=$this->formElementErrors($form->get('description'), [
                                'class' => 'list-unstyled'
                            ]); ?>
                            </span>
                        </div>
                    </div>

                    <div class="form-group<?php if ($form->get('resource')->getMessages()) echo ' has-error'; ?>">
                        <label class="col-md-4 control-label" for="resource"><?=$form->get('resource')->getLabel();?></label>
                        <div class="col-md-8">
                            <?=$this->formSelect($form->get('resource')); ?>
                            <span class="help-block">
                            <?=$this->formElementErrors($form->get('resource'), [
                                'class' => 'list-unstyled'
                            ]); ?>
                            </span>
                        </div>
                    </div>
                </fieldset>
           	</div>
            
            <div class="col-sm-6">
                <fieldset>
           	        <legend>Menu</legend>
           	        
                    <?=$this->navigationForm(); ?>
                    
           	        <div class="form-group">
                        <div class="col-md-offset-4 col-md-8">
                             <label class="radio">
                                <input type="radio" name="menuInsertType" id="menuInsertType1" value="noInsert" checked >
                                do not add to menu/no change.
                            </label>
                       	    <label class="radio">
                                <input type="radio" name="menuInsertType" id="menuInsertType2" value="insert">
                                insert after this page.
                            </label>
                            <label class="radio">
                                <input type="radio" name="menuInsertType" id="menuInsertType3" value="insertSub">
                                insert as a sub-page of this page.
                            </label>
                        </div>
                    </div>
                </fieldset>
           	</div>
        </div>
        
        <div class="row">
            <div class="col-md-12">
                <fieldset>
                    <legend>HTML Content</legend>
                    <?=$this->formTextarea($form->get('content')); ?>
                </fieldset>
            </div>
        </div>
                
        <?=$this->formElement($form->get('articleId')); ?>
        <?=$this->formElement($form->get('userId')); ?>
        <input type="hidden" name="action" value="<?=$this->formAction;?>">
        
        <div class="clearfix">&nbsp;</div>
        
        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <button type="submit" class="btn btn-primary" 
                data-loading-text="Please wait...">Submit</button>
                <button type="button" class="btn btn-warning" 
                data-loading-text="Please wait..." onClick="window.location = '<?=$this->url('admin/article', array(
                        'action' => 'list',
                    )) ?>';">Cancel</button>
            </div>
        </div>
        </fieldset>
    </form>
</div>

<script type="text/javascript">
    $(document).ready(function () {
    	tinymce.init({
        	selector:'textarea',
        	plugins: [
                "advlist autolink lists link image charmap print preview hr anchor pagebreak",
                "searchreplace wordcount visualblocks visualchars code fullscreen",
                "insertdatetime media nonbreaking save table contextmenu directionality",
                "emoticons template paste textcolor colorpicker textpattern bootstrap"
            ],
            toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
            toolbar2: "bootstrap print preview media | forecolor backcolor emoticons",
            image_advtab: true,

            bootstrapConfig: {
                'imagesPath': '<?=$this->basePath('/userfiles');?>/' // replace with your images folder path
            },

            //external_filemanager_path:"<?=$this->basePath('/filemanager');?>/",
            //filemanager_title:"Responsive Filemanager" ,
            //external_plugins: { "filemanager" : "<?=$this->basePath('/filemanager/plugin.min.js');?>"}
            
    	});
        /*$('#article-content-textarea').liveEdit({
            css: [
                'http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css',
                'http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css',
                'http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css'
            ],
            groups: [
                ["group1", "", ["Bold", "Italic", "Underline", "ForeColor", "RemoveFormat"]],
                ["group2", "", ["Bullets", "Numbering", "Indent", "Outdent"]],
                ["group3", "", ["Paragraph", "FontSize", "FontDialog", "TextDialog"]],
                ["group4", "", ["LinkDialog", "ImageDialog", "TableDialog", "Emoticons", "Snippets"]],
                ["group5", "", ["Undo", "Redo", "FullScreen", "SourceDialog"]]
            ],
            fileBrowser: '<?=$this->basePath('/admin/asset-manager')?>'
        });
        $('#article-content-textarea').data('liveEdit').startedit();*/
    });
</script>

{'fraction_non_alphanumeric': 0.17724385181457952, 'fraction_numerical': 0.004780174853764388, 'mean_word_length': 1.429335370511841, 'pattern_counts': {'":': 0, '<': 236, '<?xml version=': 0, '>': 377, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2133332', 'n_tokens_mistral': 4229, 'n_tokens_neox': 4079, 'n_words': 632}