PageRenderTime 851ms CodeModel.GetById 35ms RepoModel.GetById 10ms app.codeStats 0ms

/framework/applications/noviusos_media/views/admin/media_edit.view.php

https://github.com/jay3/core
PHP | 91 lines | 77 code | 6 blank | 8 comment | 2 complexity | e97d9795f9b6c756ccd6140e38b5c796 MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. /**
  3. * NOVIUS OS - Web OS for digital communication
  4. *
  5. * @copyright 2011 Novius
  6. * @license GNU Affero General Public License v3 or (at your option) any later version
  7. * http://www.gnu.org/licenses/agpl-3.0.html
  8. * @link http://www.novius-os.org
  9. */
  10. Nos\I18n::current_dictionary(array('noviusos_media::common', 'nos::common'));
  11. $uniqid = uniqid('id_');
  12. $fieldset->set_config('field_template', '{field}');
  13. $pathinfo = pathinfo($item->media_file);
  14. $filename = $pathinfo['filename'];
  15. $media_title = $fieldset->field('media_title');
  16. $media_title->set_attribute('placeholder', $media_title->label);
  17. ?>
  18. <div class="media_form page line ui-widget" id="<?= $uniqid ?>">
  19. <?= $fieldset->build_hidden_fields(); ?>
  20. <div class="col c1" ></div>
  21. <?php
  22. $main_col_size = 11;
  23. if ($item->isImage()) {
  24. $main_col_size -= 3;
  25. echo '<div class="col c3 preview_zone">';
  26. $src = $item->urlResized(512, 512);
  27. echo '<img src="'.$src.'" />';
  28. echo '</div>';
  29. }
  30. ?>
  31. <div class="col c<?= $main_col_size ?>" style="z-index:99;">
  32. <div class="line" style="margin-bottom:1em;">
  33. <table class="fieldset standalone">
  34. <tr class="title">
  35. <th></th>
  36. <td><?= $media_title->build() ?></td>
  37. </tr>
  38. <tr>
  39. <th><?= $fieldset->field('media')->label ?></th>
  40. <td><?= $fieldset->field('media')->build() ?></td>
  41. </tr>
  42. <tr>
  43. <th></th>
  44. <td>
  45. <p><em><?= strtr(__('The file size must not exceed {{size}}.'), array('{{size}}' => ini_get('upload_max_filesize'), '.')) ?> <?= strtr(__('What’s more these file types are not allowed: {{extensions}}.'), array('{{extensions}}' => implode(', ', \Config::get('novius-os.upload.disabled_extensions', array('php'))))) ?></em></p>
  46. </td>
  47. </tr>
  48. <tr>
  49. <th><?= $fieldset->field('media_file')->label ?></th>
  50. <td class="table-field"><?= $fieldset->field('media_file')->build() ?><span>.<span class="media_extension"><?= $item->media_ext ?></span> &nbsp; <label><input type="checkbox" data-id="same_title" /> <?= __('Use title') ?></label></span></td>
  51. </tr>
  52. <tr>
  53. <th style="vertical-align: top;"><?= $fieldset->field('media_folder_id')->label; ?></th>
  54. <td><?= $fieldset->field('media_folder_id')->build(); ?></td>
  55. </tr>
  56. <tr>
  57. <th style="vertical-align: top;"><?= __('File size:') ?></th>
  58. <td class="media_filesize"><?= \Num::format_bytes($item->media_filesize, 1) ?></td>
  59. </tr>
  60. <?php
  61. if ($item->isImage()) {
  62. ?>
  63. <tr>
  64. <th style="vertical-align: top;"><?= __('Dimensions:') ?></th>
  65. <td class="media_dimensions"><?= $item->media_width.' × '.$item->media_height ?></td>
  66. </tr>
  67. <?php
  68. }
  69. ?>
  70. </table>
  71. </div>
  72. </div>
  73. </div>
  74. <script type="text/javascript">
  75. require(
  76. [
  77. 'jquery-nos-media-edit-form',
  78. 'link!static/apps/noviusos_media/css/admin.css'
  79. ],
  80. function($) {
  81. $(function() {
  82. $('#<?= $uniqid ?>').nosFormUI().nosMediaEditForm();
  83. });
  84. });
  85. </script>