Skip to content

Commit

Permalink
More changes
Browse files Browse the repository at this point in the history
- Drop the overrides in Isis and Protostar (don't ask)
- Bring the tabs from #3839 thanks @Buddhima
  • Loading branch information
dgrammatiko committed Oct 12, 2015
1 parent ea1d079 commit 6a2bf31
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 438 deletions.
252 changes: 134 additions & 118 deletions administrator/components/com_media/views/images/tmpl/default.php
Expand Up @@ -9,19 +9,19 @@

defined('_JEXEC') or die;

JHtml::_('formbehavior.chosen', 'select');

// Load tooltip instance without HTML support because we have a HTML tag in the tip
JHtml::_('bootstrap.tooltip', '.noHtmlTip', array('html' => false));

$user = JFactory::getUser();
$input = JFactory::getApplication()->input;
$params = JComponentHelper::getParams('com_media');
$lang = JFactory::getLanguage();

JHtml::_('formbehavior.chosen', 'select');

// Load tooltip instance without HTML support because we have a HTML tag in the tip
JHtml::_('bootstrap.tooltip', '.noHtmlTip', array('html' => false));

// Include jQuery
JHtml::_('jquery.framework');
JHtml::_('script', 'media/popup-imagemanager.js', true, false, false, false, true);
JHtml::_('script', 'media/popup-imagemanager.min.js', false, true, false, false, true);
JHtml::_('stylesheet', 'media/popup-imagemanager.css', array(), true);

if ($lang->isRtl())
Expand All @@ -31,126 +31,142 @@

JFactory::getDocument()->addScriptDeclaration(
"
var image_base_path = '" . $params->get('image_path', 'images') . "/';
var image_base_path = '" . $params->get('image_path', 'images') . "/';
"
);
?>
<form action="index.php?option=com_media&amp;asset=<?php echo $input->getCmd('asset');?>&amp;author=<?php echo $input->getCmd('author'); ?>" class="form-vertical" id="imageForm" method="post" enctype="multipart/form-data">
<div id="messages" style="display: none;">
<span id="message"></span><?php echo JHtml::_('image', 'media/dots.gif', '...', array('width' => 22, 'height' => 12), true) ?>
</div>
<div class="well">
<div class="row">
<div class="span9 control-group">
<div class="control-label">
<label class="control-label" for="folder"><?php echo JText::_('COM_MEDIA_DIRECTORY') ?></label>
</div>
<div class="controls">
<?php echo $this->folderList; ?>
<button class="btn" type="button" id="upbutton" title="<?php echo JText::_('COM_MEDIA_DIRECTORY_UP') ?>"><?php echo JText::_('COM_MEDIA_UP') ?></button>
</div>
</div>
<div class="pull-right">
<button class="btn btn-primary" type="button" onclick="<?php if ($this->state->get('field.id')):?>window.parent.jInsertFieldValue(document.getElementById('f_url').value,'<?php echo $this->state->get('field.id');?>');<?php else:?>ImageManager.onok();<?php endif;?>window.parent.jModalClose();"><?php echo JText::_('COM_MEDIA_INSERT') ?></button>
<button class="btn" type="button" onclick="window.parent.jModalClose();"><?php echo JText::_('JCANCEL') ?></button>
</div>
</div>
</div>
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active"><a href="#browse_tab" data-toggle="tab"><?php echo JText::_('COM_MEDIA_BROWSE_FILES') ?></a></li>
<li><a href="#upload_tab" data-toggle="tab"><?php echo JText::_('COM_MEDIA_UPLOAD') ?></a></li>
</ul>

<iframe id="imageframe" name="imageframe" src="index.php?option=com_media&amp;view=imagesList&amp;tmpl=component&amp;folder=<?php echo $this->state->folder?>&amp;asset=<?php echo $input->getCmd('asset');?>&amp;author=<?php echo $input->getCmd('author');?>"></iframe>

<div class="well">
<div class="row">
<div class="span6 control-group">
<div class="control-label">
<label for="f_url"><?php echo JText::_('COM_MEDIA_IMAGE_URL') ?></label>
</div>
<div class="controls">
<input type="text" id="f_url" value="" />
</div>
</div>
<?php if (!$this->state->get('field.id')):?>
<div class="span6 control-group">
<div class="control-label">
<label title="<?php echo JText::_('COM_MEDIA_ALIGN_DESC'); ?>" class="noHtmlTip" for="f_align"><?php echo JText::_('COM_MEDIA_ALIGN') ?></label>
<div class="tab-content">
<div class="tab-pane active" id="browse_tab">
<form action="index.php?option=com_media&amp;asset=<?php echo $input->getCmd('asset');?>&amp;author=<?php echo $input->getCmd('author'); ?>" class="form-vertical" id="imageForm" method="post" enctype="multipart/form-data">
<div id="messages" style="display: none;">
<span id="message"></span><?php echo JHtml::_('image', 'media/dots.gif', '...', array('width' => 22, 'height' => 12), true) ?>
</div>
<div class="controls">
<select size="1" id="f_align">
<option value="" selected="selected"><?php echo JText::_('COM_MEDIA_NOT_SET') ?></option>
<option value="left"><?php echo JText::_('JGLOBAL_LEFT') ?></option>
<option value="center"><?php echo JText::_('JGLOBAL_CENTER') ?></option>
<option value="right"><?php echo JText::_('JGLOBAL_RIGHT') ?></option>
</select>
</div>
</div>
<?php endif;?>
</div>
<?php if (!$this->state->get('field.id')):?>
<div class="row">
<div class="span6 control-group">
<div class="control-label">
<label for="f_alt"><?php echo JText::_('COM_MEDIA_IMAGE_DESCRIPTION') ?></label>
</div>
<div class="controls">
<input type="text" id="f_alt" value="" />
</div>
</div>
<div class="span6 control-group">
<div class="control-label">
<label for="f_title"><?php echo JText::_('COM_MEDIA_TITLE') ?></label>
</div>
<div class="controls">
<input type="text" id="f_title" value="" />
</div>
</div>
</div>
<div class="row">
<div class="span6 control-group">
<div class="control-label">
<label for="f_caption"><?php echo JText::_('COM_MEDIA_CAPTION') ?></label>
</div>
<div class="controls">
<input type="text" id="f_caption" value="" />
</div>
</div>
<div class="span6 control-group">
<div class="control-label">
<label title="<?php echo JText::_('COM_MEDIA_CAPTION_CLASS_DESC'); ?>" class="noHtmlTip" for="f_caption_class"><?php echo JText::_('COM_MEDIA_CAPTION_CLASS_LABEL') ?></label>
</div>
<div class="controls">
<input type="text" list="d_caption_class" id="f_caption_class" value="" />
<datalist id="d_caption_class">
<option value="text-left">
<option value="text-center">
<option value="text-right">
</datalist>
<div class="well">
<div class="row">
<div class="span12 control-group">
<div class="control-label">
<label class="control-label" for="folder"><?php echo JText::_('COM_MEDIA_DIRECTORY') ?></label>
</div>
<div class="controls">
<?php echo $this->folderList; ?>
<button class="btn" type="button" id="upbutton" title="<?php echo JText::_('COM_MEDIA_DIRECTORY_UP') ?>"><?php echo JText::_('COM_MEDIA_UP') ?></button>
</div>
</div>
<div class="pull-right">
<button class="btn btn-primary" type="button" onclick="<?php if ($this->state->get('field.id')):?>parent.updateField('<?php echo $input->getCmd('fieldid'); ?>');<?php else:
// This is for Mootools compatibility ?>ImageManager.onok(); parent.jModalClose();<?php endif;?>" data-dismiss="modal"><?php echo JText::_('COM_MEDIA_INSERT') ?></button>
<button class="btn" type="button" onclick="
<?php if (!$this->state->get('field.id')): // This is for Mootools compatibility ?>parent.jModalClose();<?php endif;?>" data-dismiss="modal"><?php echo JText::_('JCANCEL') ?></button>
</div>
</div>
</div>
</div>
</div>
<?php endif;?>
<a id="imgBtn" onclick="ImageManager.onok();" class="hidden"></a>

<input type="hidden" id="dirPath" name="dirPath" />
<input type="hidden" id="f_file" name="f_file" />
<input type="hidden" id="tmpl" name="component" />
<iframe id="imageframe" name="imageframe" src="index.php?option=com_media&amp;view=imagesList&amp;tmpl=component&amp;folder=<?php echo $this->state->folder?>&amp;asset=<?php echo $input->getCmd('asset');?>&amp;author=<?php echo $input->getCmd('author');?>"></iframe>

</div>
</form>

<?php if ($user->authorise('core.create', 'com_media')) : ?>
<form action="<?php echo JUri::base(); ?>index.php?option=com_media&amp;task=file.upload&amp;tmpl=component&amp;<?php echo $this->session->getName() . '=' . $this->session->getId(); ?>&amp;<?php echo JSession::getFormToken();?>=1&amp;asset=<?php echo $input->getCmd('asset');?>&amp;author=<?php echo $input->getCmd('author');?>&amp;view=images" id="uploadForm" class="form-horizontal" name="uploadForm" method="post" enctype="multipart/form-data">
<div id="uploadform" class="well">
<fieldset id="upload-noflash" class="actions">
<div class="control-group">
<div class="control-label">
<label for="upload-file" class="control-label"><?php echo JText::_('COM_MEDIA_UPLOAD_FILE'); ?></label>
</div>
<div class="controls">
<input 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 echo $this->config->get('upload_maxsize') == '0' ? JText::_('COM_MEDIA_UPLOAD_FILES_NOLIMIT') : JText::sprintf('COM_MEDIA_UPLOAD_FILES', $this->config->get('upload_maxsize')); ?></p>
<div class="well">
<div class="row">
<div class="span6 control-group">
<div class="control-label">
<label for="f_url"><?php echo JText::_('COM_MEDIA_IMAGE_URL') ?></label>
</div>
<div class="controls">
<input type="text" id="f_url" value="" />
</div>
</div>
<?php if (!$this->state->get('field.id')):?>
<div class="span6 control-group">
<div class="control-label">
<label title="<?php echo JText::_('COM_MEDIA_ALIGN_DESC'); ?>" class="noHtmlTip" for="f_align"><?php echo JText::_('COM_MEDIA_ALIGN') ?></label>
</div>
<div class="controls">
<select size="1" id="f_align">
<option value="" selected="selected"><?php echo JText::_('COM_MEDIA_NOT_SET') ?></option>
<option value="left"><?php echo JText::_('JGLOBAL_LEFT') ?></option>
<option value="center"><?php echo JText::_('JGLOBAL_CENTER') ?></option>
<option value="right"><?php echo JText::_('JGLOBAL_RIGHT') ?></option>
</select>
</div>
</div>
<?php endif;?>
</div>
<?php if (!$this->state->get('field.id')):?>
<div class="row">
<div class="span6 control-group">
<div class="control-label">
<label for="f_alt"><?php echo JText::_('COM_MEDIA_IMAGE_DESCRIPTION') ?></label>
</div>
<div class="controls">
<input type="text" id="f_alt" value="" />
</div>
</div>
<div class="span6 control-group">
<div class="control-label">
<label for="f_title"><?php echo JText::_('COM_MEDIA_TITLE') ?></label>
</div>
<div class="controls">
<input type="text" id="f_title" value="" />
</div>
</div>
</div>
<div class="row">
<div class="span6 control-group">
<div class="control-label">
<label for="f_caption"><?php echo JText::_('COM_MEDIA_CAPTION') ?></label>
</div>
<div class="controls">
<input type="text" id="f_caption" value="" />
</div>
</div>
<div class="span6 control-group">
<div class="control-label">
<label title="<?php echo JText::_('COM_MEDIA_CAPTION_CLASS_DESC'); ?>" class="noHtmlTip" for="f_caption_class"><?php echo JText::_('COM_MEDIA_CAPTION_CLASS_LABEL') ?></label>
</div>
<div class="controls">
<input type="text" list="d_caption_class" id="f_caption_class" value="" />
<datalist id="d_caption_class">
<option value="text-left">
<option value="text-center">
<option value="text-right">
</datalist>
</div>
</div>
</div>
<?php endif;?>

<input type="hidden" id="dirPath" name="dirPath" />
<input type="hidden" id="f_file" name="f_file" />
<input type="hidden" id="tmpl" name="component" />

</div>
</fieldset>
<?php JFactory::getSession()->set('com_media.return_url', 'index.php?option=com_media&view=images&tmpl=component&fieldid=' . $input->getCmd('fieldid', '') . '&e_name=' . $input->getCmd('e_name') . '&asset=' . $input->getCmd('asset') . '&author=' . $input->getCmd('author')); ?>
</form>
</div>
</form>
<?php endif;
<div class="tab-pane" id="upload_tab">
<?php if ($user->authorise('core.create', 'com_media')) : ?>
<form action="<?php echo JUri::base(); ?>index.php?option=com_media&amp;task=file.upload&amp;tmpl=component&amp;<?php echo $this->session->getName() . '=' . $this->session->getId(); ?>&amp;<?php echo JSession::getFormToken();?>=1&amp;asset=<?php echo $input->getCmd('asset'); ?>&amp;author=<?php echo $input->getCmd('author'); ?>&amp;view=images" id="uploadForm" class="form-horizontal" name="uploadForm" method="post" enctype="multipart/form-data">
<div id="uploadform" class="well">
<fieldset id="upload-noflash" class="actions">
<div class="control-group">
<div class="control-label">
<label for="upload-file" class="control-label"><?php echo JText::_('COM_MEDIA_UPLOAD_FILE'); ?></label>
</div>
<div class="controls">
<input 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 echo $this->config->get('upload_maxsize') == '0' ? JText::_('COM_MEDIA_UPLOAD_FILES_NOLIMIT') : JText::sprintf('COM_MEDIA_UPLOAD_FILES', $this->config->get('upload_maxsize')); ?></p>
</div>
</div>
</fieldset>
<?php JFactory::getSession()->set('com_media.return_url', 'index.php?option=com_media&view=images&tmpl=component&fieldid=' . $input->getCmd('fieldid', '') . '&e_name=' . $input->getCmd('e_name') . '&asset=' . $input->getCmd('asset') . '&author=' . $input->getCmd('author')); ?>
</div>
</form>
<?php endif; ?>

</div>
</div>
</div>

0 comments on commit 6a2bf31

Please sign in to comment.