PageRenderTime 23ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/administrator/components/com_media/views/images/tmpl/default.php

https://gitlab.com/endomorphosis/OLAAaction
PHP | 93 lines | 92 code | 1 blank | 0 comment | 2 complexity | a7bb9fda6f3735d8e0cd955d100c47ab MD5 | raw file
  1. <?php defined('_JEXEC') or die('Restricted access'); ?>
  2. <script type='text/javascript'>
  3. var image_base_path = '<?php $params =& JComponentHelper::getParams('com_media');
  4. echo $params->get('image_path', 'images/stories');?>/';
  5. </script>
  6. <form action="index.php" id="imageForm" method="post" enctype="multipart/form-data">
  7. <div id="messages" style="display: none;">
  8. <span id="message"></span><img src="<?php echo JURI::base() ?>components/com_media/images/dots.gif" width="22" height="12" alt="..." />
  9. </div>
  10. <fieldset>
  11. <div style="float: left">
  12. <label for="folder"><?php echo JText::_('Directory') ?></label>
  13. <?php echo $this->folderList; ?>
  14. <button type="button" id="upbutton" title="<?php echo JText::_('Directory Up') ?>"><?php echo JText::_('Up') ?></button>
  15. </div>
  16. <div style="float: right">
  17. <button type="button" onclick="ImageManager.onok();window.parent.document.getElementById('sbox-window').close();"><?php echo JText::_('Insert') ?></button>
  18. <button type="button" onclick="window.parent.document.getElementById('sbox-window').close();"><?php echo JText::_('Cancel') ?></button>
  19. </div>
  20. </fieldset>
  21. <iframe id="imageframe" name="imageframe" src="index.php?option=com_media&amp;view=imagesList&amp;tmpl=component&amp;folder=<?php echo $this->state->folder?>"></iframe>
  22. <fieldset>
  23. <table class="properties">
  24. <tr>
  25. <td><label for="f_url"><?php echo JText::_('Image URL') ?></label></td>
  26. <td><input type="text" id="f_url" value="" /></td>
  27. <td><label for="f_align"><?php echo JText::_('Align') ?></label></td>
  28. <td>
  29. <select size="1" id="f_align" title="Positioning of this image">
  30. <option value="" selected="selected"><?php echo JText::_('Not Set') ?></option>
  31. <option value="left"><?php echo JText::_('Left') ?></option>
  32. <option value="right"><?php echo JText::_('Right') ?></option>
  33. </select>
  34. </td>
  35. </tr>
  36. <tr>
  37. <td><label for="f_alt"><?php echo JText::_('Image description') ?></label></td>
  38. <td><input type="text" id="f_alt" value="" /></td>
  39. </tr>
  40. <tr>
  41. <td><label for="f_title"><?php echo JText::_('Title') ?></label></td>
  42. <td><input type="text" id="f_title" value="" /></td>
  43. <td><label for="f_caption"><?php echo JText::_('Caption') ?></label></td>
  44. <td><input type="checkbox" id="f_caption" /></td>
  45. </tr>
  46. </table>
  47. </fieldset>
  48. <input type="hidden" id="dirPath" name="dirPath" />
  49. <input type="hidden" id="f_file" name="f_file" />
  50. <input type="hidden" id="tmpl" name="component" />
  51. </form>
  52. <?php $params =& JComponentHelper::getParams('com_media');
  53. $acl = & JFactory::getACL();
  54. switch ($params->get('allowed_media_usergroup'))
  55. {
  56. case '1':
  57. $acl->addACL( 'com_media', 'upload', 'users', 'publisher' );
  58. break;
  59. case '2':
  60. $acl->addACL( 'com_media', 'upload', 'users', 'publisher' );
  61. $acl->addACL( 'com_media', 'upload', 'users', 'editor' );
  62. break;
  63. case '3':
  64. $acl->addACL( 'com_media', 'upload', 'users', 'publisher' );
  65. $acl->addACL( 'com_media', 'upload', 'users', 'editor' );
  66. $acl->addACL( 'com_media', 'upload', 'users', 'author' );
  67. break;
  68. case '4':
  69. $acl->addACL( 'com_media', 'upload', 'users', 'publisher' );
  70. $acl->addACL( 'com_media', 'upload', 'users', 'editor' );
  71. $acl->addACL( 'com_media', 'upload', 'users', 'author' );
  72. $acl->addACL( 'com_media', 'upload', 'users', 'registered' );
  73. break;
  74. } ?>
  75. <?php $user = & JFactory::getUser(); ?>
  76. <?php $canUpload= ($user->authorize('com_media', 'upload')); ?>
  77. <?php if ($canUpload) : ?>
  78. <form action="<?php echo JURI::base(); ?>index.php?option=com_media&amp;task=file.upload&amp;tmpl=component&amp;<?php echo $this->session->getName().'='.$this->session->getId(); ?>&amp;pop_up=1&amp;<?php echo JUtility::getToken();?>=1" id="uploadForm" method="post" enctype="multipart/form-data">
  79. <fieldset>
  80. <legend><?php echo JText::_('Upload'); ?></legend>
  81. <fieldset class="actions">
  82. <input type="file" id="file-upload" name="Filedata" />
  83. <input type="submit" id="file-upload-submit" value="<?php echo JText::_('Start Upload'); ?>"/>
  84. <span id="upload-clear"></span>
  85. </fieldset>
  86. <ul class="upload-queue" id="upload-queue">
  87. <li style="display: none" />
  88. </ul>
  89. </fieldset>
  90. <input type="hidden" name="return-url" value="<?php echo base64_encode('index.php?option=com_media&view=images&tmpl=component&e_name='.JRequest::getCmd('e_name')); ?>" />
  91. </form>
  92. <?php endif; ?>