first commit
This commit is contained in:
73
administrator/components/com_media/tmpl/file/default.php
Normal file
73
administrator/components/com_media/tmpl/file/default.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_media
|
||||
*
|
||||
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('keepalive')
|
||||
->useScript('form.validate')
|
||||
->useStyle('com_media.mediamanager');
|
||||
|
||||
$script = $wa->getAsset('script', 'com_media.edit-images')->getUri(true);
|
||||
|
||||
$params = ComponentHelper::getParams('com_media');
|
||||
$input = Factory::getApplication()->getInput();
|
||||
|
||||
/** @var \Joomla\CMS\Form\Form $form */
|
||||
$form = $this->form;
|
||||
|
||||
$tmpl = $input->getCmd('tmpl');
|
||||
|
||||
$input->set('hidemainmenu', true);
|
||||
|
||||
$mediaTypes = $input->getString('mediatypes', '0');
|
||||
|
||||
// Populate the media config
|
||||
$config = [
|
||||
'apiBaseUrl' => Uri::base() . 'index.php?option=com_media&format=json' . '&mediatypes=' . $mediaTypes,
|
||||
'csrfToken' => Session::getFormToken(),
|
||||
'uploadPath' => $this->file->path,
|
||||
'editViewUrl' => Uri::base() . 'index.php?option=com_media&view=file' . ($tmpl ? '&tmpl=' . $tmpl : '') . '&mediatypes=' . $mediaTypes,
|
||||
'imagesExtensions' => array_map('trim', explode(',', $params->get('image_extensions', 'bmp,gif,jpg,jpeg,png,webp'))),
|
||||
'audioExtensions' => array_map('trim', explode(',', $params->get('audio_extensions', 'mp3,m4a,mp4a,ogg'))),
|
||||
'videoExtensions' => array_map('trim', explode(',', $params->get('video_extensions', 'mp4,mp4v,mpeg,mov,webm'))),
|
||||
'documentExtensions' => array_map('trim', explode(',', $params->get('doc_extensions', 'doc,odg,odp,ods,odt,pdf,ppt,txt,xcf,xls,csv'))),
|
||||
'maxUploadSizeMb' => $params->get('upload_maxsize', 10),
|
||||
'contents' => $this->file->content,
|
||||
];
|
||||
|
||||
$this->document->addScriptOptions('com_media', $config);
|
||||
|
||||
$this->useCoreUI = true;
|
||||
?>
|
||||
<?php if ($tmpl === 'component') : ?>
|
||||
<div class="subhead noshadow mb-3">
|
||||
<?php echo $this->document->getToolbar('toolbar')->render(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<form action="#" method="post" name="adminForm" id="media-form" class="form-validate main-card media-form mt-3">
|
||||
<?php $fieldSets = $form->getFieldsets(); ?>
|
||||
<?php if ($fieldSets) : ?>
|
||||
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', ['active' => 'attrib-' . reset($fieldSets)->name, 'breakpoint' => 768]); ?>
|
||||
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
|
||||
<?php echo '<div id="media-manager-edit-container" class="media-manager-edit"></div>'; ?>
|
||||
<?php echo HTMLHelper::_('uitab.endTabSet'); ?>
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="mediatypes" value="<?php echo $this->escape($mediaTypes); ?>">
|
||||
</form>
|
||||
<script type="module" src="<?php echo $script . '?' . $this->document->getMediaVersion(); ?>"></script>
|
||||
63
administrator/components/com_media/tmpl/media/default.php
Normal file
63
administrator/components/com_media/tmpl/media/default.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_media
|
||||
*
|
||||
* @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
$app = Factory::getApplication();
|
||||
$params = ComponentHelper::getParams('com_media');
|
||||
$input = $app->getInput();
|
||||
$user = $app->getIdentity();
|
||||
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('keepalive')
|
||||
->useStyle('com_media.mediamanager')
|
||||
->useScript('com_media.mediamanager');
|
||||
|
||||
// Populate the language
|
||||
$this->loadTemplate('texts');
|
||||
|
||||
$tmpl = $input->getCmd('tmpl');
|
||||
|
||||
$mediaTypes = '&mediatypes=' . $input->getString('mediatypes', '0,1,2,3');
|
||||
|
||||
// Populate the media config
|
||||
$config = [
|
||||
'apiBaseUrl' => Uri::base() . 'index.php?option=com_media&format=json' . $mediaTypes,
|
||||
'csrfToken' => Session::getFormToken(),
|
||||
'filePath' => $params->get('file_path', 'images'),
|
||||
'fileBaseUrl' => Uri::root() . $params->get('file_path', 'images'),
|
||||
'fileBaseRelativeUrl' => $params->get('file_path', 'images'),
|
||||
'editViewUrl' => Uri::base() . 'index.php?option=com_media&view=file' . ($tmpl ? '&tmpl=' . $tmpl : '') . $mediaTypes,
|
||||
'imagesExtensions' => array_map('trim', explode(',', $params->get('image_extensions', 'bmp,gif,jpg,jpeg,png,webp'))),
|
||||
'audioExtensions' => array_map('trim', explode(',', $params->get('audio_extensions', 'mp3,m4a,mp4a,ogg'))),
|
||||
'videoExtensions' => array_map('trim', explode(',', $params->get('video_extensions', 'mp4,mp4v,mpeg,mov,webm'))),
|
||||
'documentExtensions' => array_map('trim', explode(',', $params->get('doc_extensions', 'doc,odg,odp,ods,odt,pdf,ppt,txt,xcf,xls,csv'))),
|
||||
'maxUploadSizeMb' => $params->get('upload_maxsize', 10),
|
||||
'providers' => (array) $this->providers,
|
||||
'currentPath' => $this->currentPath,
|
||||
'isModal' => $tmpl === 'component',
|
||||
'canCreate' => $user->authorise('core.create', 'com_media'),
|
||||
'canEdit' => $user->authorise('core.edit', 'com_media'),
|
||||
'canDelete' => $user->authorise('core.delete', 'com_media'),
|
||||
];
|
||||
$this->document->addScriptOptions('com_media', $config);
|
||||
?>
|
||||
<?php if ($tmpl === 'component') : ?>
|
||||
<div class="subhead noshadow mb-3">
|
||||
<?php echo $this->document->getToolbar('toolbar')->render(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div id="com-media"></div>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_MEDIA_MEDIA_VIEW_DEFAULT_TITLE">
|
||||
<message>
|
||||
<![CDATA[COM_MEDIA_MEDIA_VIEW_DEFAULT_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
</metadata>
|
||||
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_media
|
||||
*
|
||||
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
$translationStrings = [
|
||||
'COM_MEDIA_ACTIONS_TOOLBAR_LABEL',
|
||||
'COM_MEDIA_ACTION_DELETE',
|
||||
'COM_MEDIA_ACTION_DOWNLOAD',
|
||||
'COM_MEDIA_ACTION_EDIT',
|
||||
'COM_MEDIA_ACTION_PREVIEW',
|
||||
'COM_MEDIA_ACTION_RENAME',
|
||||
'COM_MEDIA_ACTION_SHARE',
|
||||
'COM_MEDIA_BREADCRUMB_LABEL',
|
||||
'COM_MEDIA_BROWSER_TABLE_CAPTION',
|
||||
'COM_MEDIA_CHANGE_ORDERING',
|
||||
'COM_MEDIA_CONFIRM_DELETE_MODAL',
|
||||
'COM_MEDIA_CONFIRM_DELETE_MODAL_HEADING',
|
||||
'COM_MEDIA_CREATE_NEW_FOLDER',
|
||||
'COM_MEDIA_CREATE_NEW_FOLDER_ERROR',
|
||||
'COM_MEDIA_CREATE_NEW_FOLDER_SUCCESS',
|
||||
'COM_MEDIA_DECREASE_GRID',
|
||||
'COM_MEDIA_DELETE_ERROR',
|
||||
'COM_MEDIA_DELETE_SUCCESS',
|
||||
'COM_MEDIA_DROP_FILE',
|
||||
'COM_MEDIA_ERROR',
|
||||
'COM_MEDIA_ERROR_NOT_AUTHENTICATED',
|
||||
'COM_MEDIA_ERROR_NOT_AUTHORIZED',
|
||||
'COM_MEDIA_ERROR_NOT_FOUND',
|
||||
'COM_MEDIA_ERROR_WARNFILETOOLARGE',
|
||||
'COM_MEDIA_FILE',
|
||||
'COM_MEDIA_FILE_EXISTS_AND_OVERRIDE',
|
||||
'COM_MEDIA_FOLDER',
|
||||
'COM_MEDIA_FOLDER_NAME',
|
||||
'COM_MEDIA_INCREASE_GRID',
|
||||
'COM_MEDIA_MANAGE_ITEM',
|
||||
'COM_MEDIA_MEDIA_DATE_CREATED',
|
||||
'COM_MEDIA_MEDIA_DATE_MODIFIED',
|
||||
'COM_MEDIA_MEDIA_DIMENSION',
|
||||
'COM_MEDIA_MEDIA_EXTENSION',
|
||||
'COM_MEDIA_MEDIA_MIME_TYPE',
|
||||
'COM_MEDIA_MEDIA_NAME',
|
||||
'COM_MEDIA_MEDIA_SIZE',
|
||||
'COM_MEDIA_MEDIA_TYPE',
|
||||
'COM_MEDIA_NAME',
|
||||
'COM_MEDIA_ORDER_ASC',
|
||||
'COM_MEDIA_ORDER_BY',
|
||||
'COM_MEDIA_ORDER_DESC',
|
||||
'COM_MEDIA_ORDER_DIRECTION',
|
||||
'COM_MEDIA_PLEASE_SELECT_ITEM',
|
||||
'COM_MEDIA_RENAME',
|
||||
'COM_MEDIA_RENAME_ERROR',
|
||||
'COM_MEDIA_RENAME_SUCCESS',
|
||||
'COM_MEDIA_SEARCH',
|
||||
'COM_MEDIA_SELECT_ALL',
|
||||
'COM_MEDIA_SERVER_ERROR',
|
||||
'COM_MEDIA_SHARE',
|
||||
'COM_MEDIA_SHARE_COPY',
|
||||
'COM_MEDIA_SHARE_COPY_FAILED_ERROR',
|
||||
'COM_MEDIA_SHARE_DESC',
|
||||
'COM_MEDIA_TOGGLE_INFO',
|
||||
'COM_MEDIA_TOGGLE_LIST_VIEW',
|
||||
'COM_MEDIA_TOGGLE_SELECT_ITEM',
|
||||
'COM_MEDIA_TOOLBAR_LABEL',
|
||||
'COM_MEDIA_UPLOAD_SUCCESS',
|
||||
'ERROR',
|
||||
'JACTION_CREATE',
|
||||
'JAPPLY',
|
||||
'JCANCEL',
|
||||
'JGLOBAL_CONFIRM_DELETE',
|
||||
'JGLOBAL_NO_MATCHING_RESULTS',
|
||||
'JLIB_FORM_FIELD_REQUIRED_VALUE',
|
||||
'MESSAGE',
|
||||
];
|
||||
|
||||
foreach ($translationStrings as $string) {
|
||||
Text::script($string);
|
||||
}
|
||||
Reference in New Issue
Block a user