Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.7.x] Some small CS changes after #12396 #12431

Merged
merged 1 commit into from
Oct 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions administrator/components/com_media/views/images/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,11 @@
</div>
<div class="controls">
<input required type="file" id="upload-file" name="Filedata[]" multiple /><button class="btn btn-primary" id="upload-submit"><span class="icon-upload icon-white"></span> <?php echo JText::_('COM_MEDIA_START_UPLOAD'); ?></button>
<p class="help-block"><?php
$cMax = (int) $this->config->get('upload_maxsize');
$maxSize = JUtility::getMaxUploadSize($cMax . 'MB');

echo JText::sprintf('JGLOBAL_MAXIMUM_UPLOAD_SIZE_LIMIT', JHtml::_('number.bytes', $maxSize));
?></p>
<p class="help-block">
<?php $cMax = (int) $this->config->get('upload_maxsize'); ?>
<?php $maxSize = JUtility::getMaxUploadSize($cMax . 'MB'); ?>
<?php echo JText::sprintf('JGLOBAL_MAXIMUM_UPLOAD_SIZE_LIMIT', JHtml::_('number.bytes', $maxSize)); ?>
</p>
</div>
</div>
</fieldset>
Expand Down
11 changes: 5 additions & 6 deletions administrator/components/com_media/views/media/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,11 @@
<fieldset id="upload-noflash" class="actions">
<label for="upload-file" class="control-label"><?php echo JText::_('COM_MEDIA_UPLOAD_FILE'); ?></label>
<input required type="file" id="upload-file" name="Filedata[]" multiple /> <button class="btn btn-primary" id="upload-submit"><span class="icon-upload icon-white"></span> <?php echo JText::_('COM_MEDIA_START_UPLOAD'); ?></button>
<p class="help-block"><?php
$cMax = (int) $this->config->get('upload_maxsize');
$maxSize = JUtility::getMaxUploadSize($cMax . 'MB');

echo JText::sprintf('JGLOBAL_MAXIMUM_UPLOAD_SIZE_LIMIT', JHtml::_('number.bytes', $maxSize));
?></p>
<p class="help-block">
<?php $cMax = (int) $this->config->get('upload_maxsize'); ?>
<?php $maxSize = JUtility::getMaxUploadSize($cMax . 'MB'); ?>
<?php echo JText::sprintf('JGLOBAL_MAXIMUM_UPLOAD_SIZE_LIMIT', JHtml::_('number.bytes', $maxSize)); ?>
</p>
</fieldset>
<input class="update-folder" type="hidden" name="folder" id="folder" value="<?php echo $this->state->folder; ?>" />
<?php JFactory::getSession()->set('com_media.return_url', 'index.php?option=com_media'); ?>
Expand Down
6 changes: 3 additions & 3 deletions layouts/joomla/form/field/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
// Including fallback code for HTML5 non supported browsers.
JHtml::_('jquery.framework');
JHtml::_('script', 'system/html5fallback.js', false, true);

$maxSize = JHtml::_('number.bytes', JUtility::getMaxUploadSize());
?>
<input type="file"
name="<?php echo $name; ?>"
Expand All @@ -60,6 +62,4 @@
<?php echo $autofocus ? ' autofocus' : ''; ?>
<?php echo !empty($onchange) ? ' onchange="' . $onchange . '"' : ''; ?>
<?php echo $required ? ' required aria-required="true"' : ''; ?> /><br>
<?php
$maxSize = JHtml::_('number.bytes', JUtility::getMaxUploadSize());
echo JText::sprintf('JGLOBAL_MAXIMUM_UPLOAD_SIZE_LIMIT', $maxSize);
<?php echo JText::sprintf('JGLOBAL_MAXIMUM_UPLOAD_SIZE_LIMIT', $maxSize); ?>
2 changes: 1 addition & 1 deletion libraries/joomla/utilities/utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static function parseAttributes($string)
*
* @return int Size in number of bytes
*
* @since __DEPLOY_VERSION__
* @since __DEPLOY_VERSION__
*/
public static function getMaxUploadSize($custom = null)
{
Expand Down