_form.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. use yii\helpers\Html;
  3. use yii\widgets\ActiveForm;
  4. use yii\web\View;
  5. /** @var yii\web\View $this */
  6. /** @var app\models\Page $model */
  7. /** @var yii\widgets\ActiveForm $form */
  8. $uuid = 'static_page';
  9. @session_start();
  10. $_SESSION['KCFINDER']['admin_news'] = true;
  11. $this->registerJs(
  12. "$( function() { $( '#tabs' ).tabs();});",
  13. View::POS_READY
  14. );
  15. // CKEditor
  16. $this->registerJs(
  17. <<<JS
  18. $(function () {
  19. if($('#page-content').length != 0){
  20. CKEDITOR.replace('page-content', {
  21. 'filebrowserBrowseUrl': '/components/admin/ckeditor/kcfinder/browse.php?type=files&uid=$uuid',
  22. 'filebrowserImageBrowseUrl': '/components/admin/ckeditor/kcfinder/browse.php?type=images&uid=$uuid',
  23. 'filebrowserFlashBrowseUrl': '/components/admin/ckeditor/kcfinder/browse.php?type=flash&uid=$uuid',
  24. 'filebrowserUploadUrl': '/components/admin/ckeditor/kcfinder/upload.php?type=files&uid=$uuid',
  25. 'filebrowserImageUploadUrl': '/components/admin/ckeditor/kcfinder/upload.php?type=images&uid=$uuid',
  26. 'filebrowserFlashUploadUrl': '/components/admin/ckeditor/kcfinder/upload.php?type=flash&uid=$uuid',
  27. 'filebrowserAudioBrowseUrl': '/components/admin/ckeditor/kcfinder/browse.php?type=files&uid=$uuid',
  28. 'filebrowserlightboxUploadUrl': '/components/admin/ckeditor/kcfinder/browse.php?type=files&uid=$uuid',
  29. 'height': 400
  30. });
  31. }
  32. });
  33. JS
  34. ,
  35. View::POS_READY,
  36. 'ck_editor'
  37. );
  38. ?>
  39. <div class="page-form">
  40. <?php $form = ActiveForm::begin(); ?>
  41. <div id="tabs">
  42. <ul>
  43. <li><a href="#tabs-1">Основные настройки</a></li>
  44. <li><a href="#tabs-2">Дополнения</a></li>
  45. </ul>
  46. <div id="tabs-1">
  47. <?= $form->field($model, 'path')->textInput(['maxlength' => true]) ?>
  48. <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
  49. <?= $form->field($model, 'title_menu')->textInput(['maxlength' => true]) ?>
  50. <?= $form->field($model, 'title_seo')->textInput(['maxlength' => true]) ?>
  51. <?= $form->field($model, 'description_seo')->textInput(['maxlength' => true]) ?>
  52. <?= $form->field($model, 'keywords_seo')->textInput(['maxlength' => true]) ?>
  53. <?= $form->field($model, 'key')->textInput(['maxlength' => true]) ?>
  54. <?= $form->field($model, 'content')->textarea(['rows' => 6]) ?>
  55. <?= $form->field($model, 'norder')->textInput() ?>
  56. <?= $form->field($model, 'status')->textInput() ?>
  57. <?= $form->field($model, 'menu')->textInput() ?>
  58. </div>
  59. <div id="tabs-2">
  60. <?= $form->field($model, 'parent_id')->textInput() ?>
  61. <?= $form->field($model, 'index_controller')->textInput(['maxlength' => true]) ?>
  62. <?= $form->field($model, 'index_action')->textInput(['maxlength' => true]) ?>
  63. <?= $form->field($model, 'view_controller')->textInput(['maxlength' => true]) ?>
  64. <?= $form->field($model, 'view_action')->textInput(['maxlength' => true]) ?>
  65. <?= $form->field($model, 'index_params')->textInput(['maxlength' => true]) ?>
  66. <?= $form->field($model, 'lang')->textInput(['maxlength' => true]) ?>
  67. <?= $form->field($model, 'layout')->textInput(['maxlength' => true]) ?>
  68. <?//= $form->field($model, 'created')->textInput() ?>
  69. <?//= $form->field($model, 'updated')->textInput() ?>
  70. <?//= $form->field($model, 'create_user_id')->textInput() ?>
  71. <?//= $form->field($model, 'update_user_id')->textInput() ?>
  72. </div>
  73. </div>
  74. <div class="form-group">
  75. <?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
  76. </div>
  77. <?php ActiveForm::end(); ?>
  78. </div>