<commit_before><?php

/*
 * Client Plugin for HiPanel
 *
 * @link      https://github.com/hiqdev/hipanel-module-client
 * @package   hipanel-module-client
 * @license   BSD-3-Clause
 * @copyright Copyright (c) 2014-2015, HiQDev (https://hiqdev.com/)
 */

use hipanel\base\Re;
use hipanel\models\Ref;
use yii\bootstrap\ActiveForm;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;

$langs = ArrayHelper::map(hipanel\modules\client\models\Article::getApiLangs(), 'gl_key', 'gl_value');
$this->registerJs("$(function () {\$('#lang_tab a:first').tab('show');});", yii\web\View::POS_END, 'lng-tabpanel-options');
$modelReflacion = new \ReflectionClass(get_class($model));
\yii\helpers\VarDumper::dump($model, 10, true);
?>

<?php $form = ActiveForm::begin() ?>
    <?= $form->field($model, 'is_published')->widget(kartik\widgets\SwitchInput::className()); ?>

    <?= $form->field($model, 'name'); ?>
    <?= $form->field($model, 'post_date')->widget(kartik\widgets\DatePicker::className(), [
    'value' => date('d-M-Y', strtotime('+2 days')),
    ]); ?>

    <?= $form->field($model, 'type')->dropDownList(ArrayHelper::map(Ref::find()->where(['gtype' => 'type,article'])->getList(false), 'gl_key', function ($l) {
         return ucfirst(Re::l($l->gl_value));
    })); ?>

    <div role="tabpanel" style="margin-bottom: 25px;">

        <!-- Nav tabs -->
        <ul id="lang_tab" class="nav nav-tabs" role="tablist">
            <?php foreach ($langs as $code => $label) : ?>
                <?=Html::beginTag('li', ['role' => 'presentation'])?>
                    <?=Html::a(Re::l($label), '#' . $code, ['role' => 'tab', 'data-toggle' => 'tab']);?>
                <?=Html::endTag('li')?>
            <?php endforeach; ?>
        </ul>

        <!-- Tab panes -->
        <div class="tab-content">
            <?/* foreach ($langs as $code=>$label) : ?>
                <?=Html::beginTag('div',['id'=>$code,'role'=>'tabpanel','class'=>'tab-pane'])?>
                    <?= $form->field($model, "html_title_$code"); ?>
                    <?= $form->field($model, "html_keywords_$code"); ?>
                    <?= $form->field($model, "html_description_$code"); ?>
                    <?= $form->field($model, "title_$code"); ?>
                    <?= $form->field($model, "short_text_$code")->textarea(['row'=>6]); ?>
                    <?= $form->field($model, "text_$code")->textarea(['row'=>9]); ?>
                <?=Html::endTag('div')?>
            <? endforeach; */?>

            <?php foreach ([2867298 => 'ru', 2867299 => 'en'] as $id => $lng) : ?>
                <?=Html::beginTag('div', ['id' => $lng, 'role' => 'tabpanel', 'class' => 'tab-pane'])?>
                    <?= $form->field($model, "data[$id][html_title]")->label('Html Title'); ?>
                    <?= $form->field($model, "data[$id][html_keywords]")->label('Html Keywords'); ?><commit_msg>got rid of Re::l<commit_after><?php

/*
 * Client Plugin for HiPanel
 *
 * @link      https://github.com/hiqdev/hipanel-module-client
 * @package   hipanel-module-client
 * @license   BSD-3-Clause
 * @copyright Copyright (c) 2014-2015, HiQDev (https://hiqdev.com/)
 */

use hipanel\models\Ref;
use yii\bootstrap\ActiveForm;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;

$langs = ArrayHelper::map(hipanel\modules\client\models\Article::getApiLangs(), 'gl_key', 'gl_value');
$this->registerJs("$(function () {\$('#lang_tab a:first').tab('show');});", yii\web\View::POS_END, 'lng-tabpanel-options');
$modelReflacion = new \ReflectionClass(get_class($model));
\yii\helpers\VarDumper::dump($model, 10, true);
?>

<?php $form = ActiveForm::begin() ?>
    <?= $form->field($model, 'is_published')->widget(kartik\widgets\SwitchInput::className()); ?>

    <?= $form->field($model, 'name'); ?>
    <?= $form->field($model, 'post_date')->widget(kartik\widgets\DatePicker::className(), [
    'value' => date('d-M-Y', strtotime('+2 days')),
    ]); ?>

    <?= $form->field($model, 'type')->dropDownList(ArrayHelper::map(Ref::find()->where(['gtype' => 'type,article'])->getList(false), 'gl_key', function ($l) {
         return ucfirst($l->gl_value);
    })); ?>

    <div role="tabpanel" style="margin-bottom: 25px;">

        <!-- Nav tabs -->
        <ul id="lang_tab" class="nav nav-tabs" role="tablist">
            <?php foreach ($langs as $code => $label) : ?>
                <?=Html::beginTag('li', ['role' => 'presentation'])?>
                    <?=Html::a($label, '#' . $code, ['role' => 'tab', 'data-toggle' => 'tab']);?>
                <?=Html::endTag('li')?>
            <?php endforeach; ?>
        </ul>

        <!-- Tab panes -->
        <div class="tab-content">
            <?/* foreach ($langs as $code=>$label) : ?>
                <?=Html::beginTag('div',['id'=>$code,'role'=>'tabpanel','class'=>'tab-pane'])?>
                    <?= $form->field($model, "html_title_$code"); ?>
                    <?= $form->field($model, "html_keywords_$code"); ?>
                    <?= $form->field($model, "html_description_$code"); ?>
                    <?= $form->field($model, "title_$code"); ?>
                    <?= $form->field($model, "short_text_$code")->textarea(['row'=>6]); ?>
                    <?= $form->field($model, "text_$code")->textarea(['row'=>9]); ?>
                <?=Html::endTag('div')?>
            <? endforeach; */?>

            <?php foreach ([2867298 => 'ru', 2867299 => 'en'] as $id => $lng) : ?>
                <?=Html::beginTag('div', ['id' => $lng, 'role' => 'tabpanel', 'class' => 'tab-pane'])?>
                    <?= $form->field($model, "data[$id][html_title]")->label('Html Title'); ?>
                    <?= $form->field($model, "data[$id][html_keywords]")->label('Html Keywords'); ?>
{'fraction_non_alphanumeric': 0.2502623294858342, 'fraction_numerical': 0.01049317943336831, 'mean_word_length': 2.955048409405256, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 147, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4910039', 'n_tokens_mistral': 1955, 'n_tokens_neox': 1877, 'n_words': 277}