[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package Joomla.Administrator 5 * @subpackage com_media 6 * 7 * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> 8 * @license GNU General Public License version 2 or later; see LICENSE.txt 9 */ 10 11 defined('_JEXEC') or die; 12 13 use Joomla\CMS\Component\ComponentHelper; 14 use Joomla\CMS\Factory; 15 use Joomla\CMS\HTML\HTMLHelper; 16 use Joomla\CMS\Layout\LayoutHelper; 17 use Joomla\CMS\Session\Session; 18 use Joomla\CMS\Toolbar\Toolbar; 19 use Joomla\CMS\Uri\Uri; 20 21 /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ 22 $wa = $this->document->getWebAssetManager(); 23 $wa->useScript('keepalive') 24 ->useScript('form.validate') 25 ->useStyle('com_media.mediamanager'); 26 27 $script = $wa->getAsset('script', 'com_media.edit-images')->getUri(true); 28 29 $params = ComponentHelper::getParams('com_media'); 30 $input = Factory::getApplication()->input; 31 32 /** @var \Joomla\CMS\Form\Form $form */ 33 $form = $this->form; 34 35 $tmpl = $input->getCmd('tmpl'); 36 37 $input->set('hidemainmenu', true); 38 39 // Load the toolbar when we are in an iframe 40 if ($tmpl == 'component') { 41 echo '<div class="subhead noshadow">'; 42 echo Toolbar::getInstance('toolbar')->render(); 43 echo '</div>'; 44 } 45 46 $mediaTypes = $input->getString('mediatypes', '0'); 47 48 // Populate the media config 49 $config = [ 50 'apiBaseUrl' => Uri::base() . 'index.php?option=com_media&format=json' . '&mediatypes=' . $mediaTypes, 51 'csrfToken' => Session::getFormToken(), 52 'uploadPath' => $this->file->path, 53 'editViewUrl' => Uri::base() . 'index.php?option=com_media&view=file' . ($tmpl ? '&tmpl=' . $tmpl : '') . '&mediatypes=' . $mediaTypes, 54 'imagesExtensions' => array_map('trim', explode(',', $params->get('image_extensions', 'bmp,gif,jpg,jpeg,png,webp'))), 55 'audioExtensions' => array_map('trim', explode(',', $params->get('audio_extensions', 'mp3,m4a,mp4a,ogg'))), 56 'videoExtensions' => array_map('trim', explode(',', $params->get('video_extensions', 'mp4,mp4v,mpeg,mov,webm'))), 57 'documentExtensions' => array_map('trim', explode(',', $params->get('doc_extensions', 'doc,odg,odp,ods,odt,pdf,ppt,txt,xcf,xls,csv'))), 58 'maxUploadSizeMb' => $params->get('upload_maxsize', 10), 59 'contents' => $this->file->content, 60 ]; 61 62 $this->document->addScriptOptions('com_media', $config); 63 64 $this->useCoreUI = true; 65 ?> 66 <form action="#" method="post" name="adminForm" id="media-form" class="form-validate main-card media-form mt-3"> 67 <?php $fieldSets = $form->getFieldsets(); ?> 68 <?php if ($fieldSets) : ?> 69 <?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', ['active' => 'attrib-' . reset($fieldSets)->name, 'breakpoint' => 768]); ?> 70 <?php echo LayoutHelper::render('joomla.edit.params', $this); ?> 71 <?php echo '<div id="media-manager-edit-container" class="media-manager-edit"></div>'; ?> 72 <?php echo HTMLHelper::_('uitab.endTabSet'); ?> 73 <?php endif; ?> 74 <input type="hidden" name="mediatypes" value="<?php echo $mediaTypes; ?>"> 75 </form> 76 <script type="module" src="<?php echo $script . '?' . $this->document->getMediaVersion(); ?>"></script>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |