Пример #1
0
<?php

/**
 *
 * @package     Simple File Manager
 * @author       Giovanni Mansillo
 *
 * @copyright   Copyright (C) 2005 - 2014 Giovanni Mansillo. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.formvalidation');
require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/simplefilemanager.php';
$isNew = $this->item->id == 0;
$maxFileSize = SimplefilemanagerHelper::getMaxFileUploadSize();
?>

<script type="text/javascript">
    jQuery(function () {
        jQuery('#jform1_uploader').change(function () {
            var f = this.files[0];
            var s = (f.size || f.fileSize);
            if (<?php 
echo $maxFileSize;
?>
 < s )
            alert("<?php 
echo JText::sprintf('COM_SIMPLEFILEMANAGER_UPLOAD_MAX_SIZE_EXCEEDED_ERROR', $maxFileSize / 1048576);
?>
");