- md5
- eb9c5bd0d9f43499b83be0db86f7088b
- sha1
- 1df0cc2b4d59ebea7c45ad00af8262d3d7654186
- sha256
- aef522872ee863688400398b350d4c8b54407a793f8acf3c43e08e1567b8a2ec
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Media\Administrator\View\File;
defined('_JEXEC') or die;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
\JLoader::import('joomla.filesystem.file');
/**
* View to edit an file.
*
* @since __DEPLOY_VERSION__
*/
class HtmlView extends BaseHtmlView
{
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @since __DEPLOY_VERSION__
*/
public function display($tpl = null)
{
$input = Factory::getApplication()->input;
$this->form = $this->get('Form');
// The component params
$this->params = ComponentHelper::getParams('com_media');
// The requested file
$this->file = $this->getModel()->getFileInformation($input->getString('path', null));
// At the moment we only support local files to edit
if (strpos($this->file->adapter, 'local-') !== 0)
{
// @todo error handling controller redirect files
throw new \Exception('Image file is not locally');
}
$this->addToolbar();
return parent::display($tpl);
}
/**
* Add the toolbar buttons
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
protected function addToolbar()
{
ToolbarHelper::title(\JText::_('COM_MEDIA_EDIT'), 'images mediamanager');
ToolbarHelper::apply('apply');
ToolbarHelper::save('save');
ToolbarHelper::custom('reset', 'refresh', '', 'COM_MEDIA_RESET', false);
ToolbarHelper::cancel('cancel');
}
}
No other release has this exact content. See every version of this file.