From be12e4063a9fec24d8d3f7911f1d15efb91112ec Mon Sep 17 00:00:00 2001 From: Robin Poort Date: Thu, 31 May 2018 10:46:50 +0200 Subject: [PATCH] #360: Styling media --- .../elysio/html/com_content/article/edit.php | 7 +- .../elysio/html/com_media/images/default.php | 201 ++++++++++++++++++ .../html/com_media/imageslist/default.php | 81 +++++++ .../com_media/imageslist/default_folder.php | 37 ++++ .../com_media/imageslist/default_image.php | 43 ++++ .../templates/elysio/html/overrides.php | 15 ++ 6 files changed, 382 insertions(+), 2 deletions(-) create mode 100644 web/administrator/templates/elysio/html/com_media/images/default.php create mode 100644 web/administrator/templates/elysio/html/com_media/imageslist/default.php create mode 100644 web/administrator/templates/elysio/html/com_media/imageslist/default_folder.php create mode 100644 web/administrator/templates/elysio/html/com_media/imageslist/default_image.php diff --git a/web/administrator/templates/elysio/html/com_content/article/edit.php b/web/administrator/templates/elysio/html/com_content/article/edit.php index 3b39fd8400..1deb0af915 100644 --- a/web/administrator/templates/elysio/html/com_content/article/edit.php +++ b/web/administrator/templates/elysio/html/com_content/article/edit.php @@ -12,6 +12,9 @@ // Include the component HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); +// Overrides +include_once(JPATH_WEB.'/administrator/templates/elysio/html/overrides.php'); + JHtml::_('behavior.core'); JHtml::_('behavior.tabstate'); JHtml::_('behavior.formvalidation'); @@ -113,10 +116,10 @@
form->getControlGroup('images'); ?> form->getGroup('images') as $field) : ?> - getControlGroup(); ?> + getControlGroup()); ?> form->getGroup('urls') as $field) : ?> - getControlGroup(); ?> + getControlGroup()); ?>
diff --git a/web/administrator/templates/elysio/html/com_media/images/default.php b/web/administrator/templates/elysio/html/com_media/images/default.php new file mode 100644 index 0000000000..e7ec6b1ef1 --- /dev/null +++ b/web/administrator/templates/elysio/html/com_media/images/default.php @@ -0,0 +1,201 @@ +input; +$params = JComponentHelper::getParams('com_media'); +$lang = JFactory::getLanguage(); + +// 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', 'com_media/popup-imagemanager.min.js', false, true, false, false, true); +JHtml::_('stylesheet', 'com_media/popup-imagemanager.css', array(), true); + +if ($lang->isRtl()) +{ + JHtml::_('stylesheet', 'com_media/popup-imagemanager_rtl.css', array(), true); +} + +JFactory::getDocument()->addScriptDeclaration( + " + var image_base_path = '" . $params->get('image_path', 'images') . "/'; + " +); +?> + + + + + +
+ + +
+ + +
+ + +
+ + +
+ +
+ + + +
+
+ + folderList; ?> +
+ +
+
+
+ +
+ +
+ +
+
+ + +
+ +
+
+ + state->get('field.id')):?> +
+
+ +
+
+ +
+
+ + state->get('field.id')):?> +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ + + +
+
+ + + + + + + +
+
+ + authorise('core.create', 'com_media')) : ?> +
+
+
+
+
+
+ + +
+ + 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')); ?> +
+
+
+ +
+
+
+
+ +
+ +
+ +
+ +
+ +
\ No newline at end of file diff --git a/web/administrator/templates/elysio/html/com_media/imageslist/default.php b/web/administrator/templates/elysio/html/com_media/imageslist/default.php new file mode 100644 index 0000000000..de396ed6a8 --- /dev/null +++ b/web/administrator/templates/elysio/html/com_media/imageslist/default.php @@ -0,0 +1,81 @@ +isRtl()) +{ + JHtml::_('stylesheet', 'com_media/popup-imagelist_rtl.css', array(), true); +} + +JFactory::getDocument()->addScriptDeclaration("var ImageManager = window.parent.ImageManager;"); +JFactory::getDocument()->addStyleDeclaration( + " + @media (max-width: 767px) { + li.imgOutline.thumbnail.height-80.width-80.center { + float: left; + margin-left: 15px; + } + } + " +); +?> + + +
+ + +
+ + +
+ + +
+ + +
+ + images) > 0 || count($this->folders) > 0) : ?> + +
+ +
+ +
+

+
+ + +
+ +
+ +
+ +
+ +
+ diff --git a/web/administrator/templates/elysio/html/com_media/imageslist/default_folder.php b/web/administrator/templates/elysio/html/com_media/imageslist/default_folder.php new file mode 100644 index 0000000000..5fc5b81d9d --- /dev/null +++ b/web/administrator/templates/elysio/html/com_media/imageslist/default_folder.php @@ -0,0 +1,37 @@ +input; +?> + + + diff --git a/web/administrator/templates/elysio/html/com_media/imageslist/default_image.php b/web/administrator/templates/elysio/html/com_media/imageslist/default_image.php new file mode 100644 index 0000000000..16cf90aab3 --- /dev/null +++ b/web/administrator/templates/elysio/html/com_media/imageslist/default_image.php @@ -0,0 +1,43 @@ +trigger('onContentBeforeDisplay', array('com_media.file', &$this->_tmp_img, &$params)); +?> + + + +trigger('onContentAfterDisplay', array('com_media.file', &$this->_tmp_img, &$params)); diff --git a/web/administrator/templates/elysio/html/overrides.php b/web/administrator/templates/elysio/html/overrides.php index 009c276bbf..6de69bb79d 100644 --- a/web/administrator/templates/elysio/html/overrides.php +++ b/web/administrator/templates/elysio/html/overrides.php @@ -145,4 +145,19 @@ function addInputGroupAddonClass($input) { $input = str_replace('class="hasPopover', 'class="k-input-group__addon', $input); $input = str_replace('*', '', $input); return $input; +} + + +// Add `k-input-group__addon` class to input group labels +function imagesInputGroup($input) { + $input = str_replace('class="input-prepend input-append', 'class="k-input-group', $input); + $input = str_replace('class="media-preview add-on', 'class="k-input-group__addon', $input); + $input = str_replace('class="icon-eye', 'class="k-icon-eye', $input); + $input = str_replace('class="input-small', 'class="k-form-control', $input); + $input = str_replace('', '', $input); + return $input; } \ No newline at end of file