/resources/views/modules/video/edit.blade.php

https://github.com/gunet/openeclass · PHP · 183 lines · 179 code · 4 blank · 0 comment · 18 complexity · 915ada44f168b80fece40469844f2aa4 MD5 · raw file

  1. <?php
  2. $form_enctype = 'application/x-www-form-urlencoded';
  3. if ($form_input === 'file') {
  4. $form_enctype = 'multipart/form-data';
  5. }
  6. ?>
  7. @extends('layouts.default')
  8. @section('content')
  9. {!!
  10. action_bar(array(
  11. array('title' => $GLOBALS['langBack'],
  12. 'url' => $backPath,
  13. 'icon' => 'fa-reply',
  14. 'level' => 'primary-label')
  15. )
  16. )
  17. !!}
  18. <div class='row'>
  19. <div class='col-sm-12'>
  20. <div class='form-wrapper'>
  21. <form class='form-horizontal'
  22. role='form'
  23. method='POST'
  24. action='{{ $_SERVER["SCRIPT_NAME"] . "?course=" . $course_code }}'
  25. enctype='{{ $form_enctype }}'
  26. onsubmit="return checkrequired(this, 'title');">
  27. <fieldset>
  28. <div class='form-group'>
  29. @if (isset($pendingCloudUpload))
  30. <label for='fileCloudName' class='col-sm-2 control-label'>{{ trans('langCloudFile') }}</label>
  31. <div class='col-sm-10'>
  32. <input type='hidden' class='form-control' id='fileCloudInfo' name='fileCloudInfo' value='{{ $pendingCloudUpload }}'>
  33. <input type='text' class='form-control' name='fileCloudName' value='{{ CloudFile::fromJSON($pendingCloudUpload)->name() }}' readonly>
  34. </div>
  35. @elseif ($form_input === 'file')
  36. <label for='FileName' class='col-sm-2 control-label'>{{ trans('langWorkFile') }}:</label>
  37. <div class='col-sm-10'>
  38. <input type='hidden' name='MAX_FILE_SIZE' value='{{ fileUploadMaxSize() }}'>
  39. {!! CloudDriveManager::renderAsButtons() !!}
  40. <input type='file' name='userFile'>
  41. </div>
  42. @elseif ($form_input === 'url')
  43. <label for='Url' class='col-sm-2 control-label'>{{ trans('langURL') }}:</label>
  44. <div class='col-sm-10'>
  45. <input class='form-control' type='text' name='URL'>
  46. </div>
  47. @elseif (isset($_GET['id']) && isset($_GET['table_edit']) && $table_edit == 'videolink')
  48. <label for='Url' class='col-sm-2 control-label'>{{ trans('langURL') }}:</label>
  49. <div class='col-sm-10'>
  50. <input class='form-control' type='text' name='url' value='{{ $edititem->url }}'>
  51. </div>
  52. @elseif (isset($_GET['id']) && isset($_GET['table_edit']) && $table_edit == 'video')
  53. <input type='hidden' name='url' value='{{ $edititem->url }}'>
  54. <label class='col-sm-2 control-label'>{{ trans('langWorkFile') }}:</label>
  55. <div class='col-sm-10 margin-top-thin'>{{ $edititem->url }}</div>
  56. @endif
  57. </div>
  58. <div class='form-group'>
  59. <label for='Title' class='col-sm-2 control-label'>{{ trans('langTitle') }}:</label>
  60. <div class='col-sm-10'>
  61. @if (isset($edititem))
  62. <input class='form-control' type='text' name='title' value='{{ $edititem->title }}'>
  63. @else
  64. <input class='form-control' type='text' name='title' size='55'>
  65. @endif
  66. </div>
  67. </div>
  68. <div class='form-group'>
  69. <label for='Desc' class='col-sm-2 control-label'>{{ trans('langDescription') }}:</label>
  70. <div class='col-sm-10'>
  71. <textarea class='form-control' rows='3' name='description'>@if (isset($_GET['id']) && isset($_GET['table_edit'])){{ $edititem->description }}@endif</textarea>
  72. </div>
  73. </div>
  74. <div class='form-group'>
  75. <label for='Creator' class='col-sm-2 control-label'>{{ trans('langcreator') }}:</label>
  76. <div class='col-sm-10'>
  77. @if (isset($form_input))
  78. <input class='form-control' type='text' name='creator' value='{{ $nick }}'>
  79. @elseif (isset($_GET['id']) && isset($_GET['table_edit']))
  80. <input class='form-control' type='text' name='creator' value='{{ $edititem->creator }}'>
  81. @endif
  82. </div>
  83. </div>
  84. <div class='form-group'>
  85. <label for='Publisher' class='col-sm-2 control-label'>{{ trans('langpublisher') }}:</label>
  86. <div class='col-sm-10'>
  87. @if (isset($form_input))
  88. <input class='form-control' type='text' name='publisher' value='{{ $nick }}'>
  89. @elseif (isset($_GET['id']) && isset($_GET['table_edit']))
  90. <input class='form-control' type='text' name='publisher' value='{{ $edititem->publisher }}'>
  91. @endif
  92. </div>
  93. </div>
  94. @if (isset($form_input))
  95. <div class='form-group'>
  96. <label for='Date' class='col-sm-2 control-label'>{{ trans('langDate') }}:</label>
  97. <div class='col-sm-10'><input class='form-control' type='text' name='date' value='{{ date('Y-m-d G:i') }}'></div>
  98. </div>
  99. @endif
  100. <div class='form-group'>
  101. <label for='Category' class='col-sm-2 control-label'>{{ trans('langCategory') }}:</label>
  102. <div class='col-sm-10'>
  103. <select class='form-control' name='selectcategory'>
  104. <option value='0'>--</option>
  105. @foreach ($resultcategories as $cat)
  106. <?php
  107. if (isset($form_input)) {
  108. $selected = '';
  109. } else if (isset($_GET['id']) && isset($_GET['table_edit'])) {
  110. $selected = '';
  111. if (isset($edititem->category) && $edititem->category == $cat->id) {
  112. $selected = " selected='selected'";
  113. }
  114. }
  115. ?>
  116. <option value='{{ $cat->id }}' {{ $selected }}>{{ $cat->name }}</option>
  117. @endforeach
  118. </select>
  119. </div>
  120. </div>
  121. <div class='form-group'>
  122. <div class='col-sm-offset-2 col-sm-10'>
  123. @if ($form_input === 'file')
  124. {!!
  125. form_buttons(array(
  126. array(
  127. 'text' => $GLOBALS['langUpload'],
  128. 'name' => 'add_submit',
  129. 'value' => $GLOBALS['langUpload']
  130. ),
  131. array(
  132. 'href' => $backPath
  133. )
  134. ))
  135. !!}
  136. @elseif ($form_input === 'url')
  137. {!!
  138. form_buttons(array(
  139. array(
  140. 'text' => $GLOBALS['langSave'],
  141. 'name' => 'add_submit',
  142. 'value' => $GLOBALS['langAdd']
  143. ),
  144. array(
  145. 'href' => $backPath
  146. )
  147. ))
  148. !!}
  149. @elseif (isset($_GET['id']) && isset($_GET['table_edit']))
  150. {!!
  151. form_buttons(array(
  152. array(
  153. 'text' => $GLOBALS['langSave'],
  154. 'name' => 'edit_submit',
  155. 'value' => $GLOBALS['langEditChange']
  156. ),
  157. array(
  158. 'href' => $backPath
  159. )
  160. ))
  161. !!}
  162. <input type='hidden' name='id' value='{{ $edititem->id }}'>
  163. <input type='hidden' name='table' value='{{ $table_edit }}'>
  164. @endif
  165. </div>
  166. </div>
  167. </fieldset>
  168. @if ($form_input === 'file')
  169. <div class='form-group'>
  170. <div class='col-sm-offset-2 col-sm-10'>
  171. <div class='smaller right'>{{ trans('langMaxFileSize') }} {{ ini_get('upload_max_filesize') }}</div>
  172. </div>
  173. </div>
  174. @endif
  175. </form>
  176. </div>
  177. </div>
  178. </div>
  179. @endsection