-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
new feature: plugin modal view needed for quicker edit #7259
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
Changes from 8 commits
472614a
abf18f3
08866bf
8b7812a
9e2cc52
9f41eab
426fe93
cc08558
761a126
9eb0c5d
9d4d31d
ac76274
7e428ec
b37762c
97c9c56
0c739d4
d5cba75
ea80917
770ca34
d947f77
d46b210
061e538
5029e4b
4a1724b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| <?php | ||
| /** | ||
| * @package Joomla.Administrator | ||
| * @subpackage com_plugins | ||
| * | ||
| * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. | ||
| * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
| */ | ||
|
|
||
| defined('_JEXEC') or die; | ||
| ?> | ||
| <div class="btn-toolbar"> | ||
| <div class="btn-group"> | ||
| <button type="button" class="btn btn-primary" onclick="Joomla.submitbutton('plugin.save');"> | ||
| <?php echo JText::_('JSAVE');?></button> | ||
| </div> | ||
| <div class="btn-group"> | ||
| <button type="button" class="btn" onclick="window.parent.jModalClose();"> | ||
| <?php echo JText::_('JCANCEL');?></button> | ||
| </div> | ||
| <div class="clearfix"></div> | ||
| </div> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you use the bootstrap modal these buttons can go to the modal footer
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks, i just did that |
||
|
|
||
| <?php | ||
| $this->setLayout('edit'); | ||
| echo $this->loadTemplate(); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ | |
| JHtml::_('bootstrap.tooltip'); | ||
| JHtml::_('behavior.multiselect'); | ||
| JHtml::_('formbehavior.chosen', 'select'); | ||
| JHTML::_('behavior.modal'); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we directly introduce a bootstrap modal here? It seems like we stepping backwards introducing a mootools dependency here
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| $user = JFactory::getUser(); | ||
| $listOrder = $this->escape($this->state->get('list.ordering')); | ||
|
|
@@ -35,31 +36,40 @@ | |
| <input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('COM_REDIRECT_SEARCH_LINKS'); ?>" /> | ||
| </div> | ||
| <div class="btn-group pull-left"> | ||
| <button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><span class="icon-search"></span></button> | ||
| <button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.getElementById('filter_search').value='';this.form.submit();"><span class="icon-remove"></span></button> | ||
| <button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button> | ||
| <button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.getElementById('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button> | ||
| </div> | ||
| <div class="btn-group pull-right hidden-phone"> | ||
| <label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC'); ?></label> | ||
| <?php echo $this->pagination->getLimitBox(); ?> | ||
| </div> | ||
| </div> | ||
| <div class="clearfix"> </div> | ||
| <?php if ($this->enabled) : ?> | ||
| <div class="alert alert-info"> | ||
| <a class="close" data-dismiss="alert">×</a> | ||
| <?php echo JText::_('COM_REDIRECT_PLUGIN_ENABLED'); ?> | ||
| <?php if ($this->collect_urls_enabled) : ?> | ||
| <?php echo JText::_('COM_REDIRECT_COLLECT_URLS_ENABLED'); ?> | ||
| <?php else : ?> | ||
| <?php echo JText::_('COM_REDIRECT_COLLECT_URLS_DISABLED'); ?> | ||
| <?php endif; ?> | ||
| </div> | ||
| <?php else : ?> | ||
| <div class="alert alert-error"> | ||
| <a class="close" data-dismiss="alert">×</a> | ||
| <?php echo JText::_('COM_REDIRECT_PLUGIN_DISABLED'); ?> | ||
| </div> | ||
|
|
||
| <?php if ($this->enabled) : ?> | ||
| <div class="alert alert-info"> | ||
| <a class="close" data-dismiss="alert">×</a> | ||
|
|
||
| <?php echo JText::_('COM_REDIRECT_PLUGIN_ENABLED'); ?> | ||
| <?php if ($this->collect_urls_enabled) : ?> | ||
| <?php echo JText::_('COM_REDIRECT_COLLECT_URLS_ENABLED'); ?> | ||
| <?php else : ?> | ||
| <?php echo JText::_('COM_REDIRECT_COLLECT_URLS_DISABLED'); ?> | ||
| <?php endif; ?> | ||
|
|
||
| <?php else : ?> | ||
| <div class="alert alert-error"> | ||
| <a class="close" data-dismiss="alert">×</a> | ||
| <?php echo JText::_('COM_REDIRECT_PLUGIN_DISABLED'); ?> | ||
| <?php endif; ?> | ||
|
|
||
| <a class="modal btn btn-small" rel="{handler: 'iframe', size: {x: 900, y: 550}}" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can use the bootstrap alternative her, something like: <?php echo JHtml::_(
'bootstrap.renderModal',
'module' . $module->id . 'Modal',
array(
'url' => $link,
'title' => JText::_('COM_MENUS_EDIT_MODULE_SETTINGS'),
'height' => '300px',
'width' => '800px',
'footer' => '<button class="btn" data-dismiss="modal" aria-hidden="true">'
. JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</button>'
. '<button class="btn btn-success" data-dismiss="modal" aria-hidden="true" onclick="jQuery(\'#module' . $module->id . 'Modal iframe\').contents().find(\'#saveBtn\').click();">'
. JText::_("JSAVE") . '</button>'
)
); ?> |
||
| title="<?php echo JText::_("COM_REDIRECT_EDIT_PLUGIN"); ?>" | ||
| href="<?php echo JRoute::_("index.php?option=com_plugins&client_id=0&task=plugin.edit&extension_id=" . $this->redirectpluginid . "&tmpl=component&layout=modal");?>"> | ||
| <?php echo JText::_("COM_REDIRECT_EDIT_PLUGIN"); ?> | ||
| </a> | ||
| </div> | ||
|
|
||
| <?php if (empty($this->items)) : ?> | ||
| <div class="alert alert-no-items"> | ||
| <?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?> | ||
|
|
@@ -141,26 +151,14 @@ | |
| <?php endforeach; ?> | ||
| </tbody> | ||
| </table> | ||
| <?php //Load the batch processing form if user is allowed ?> | ||
| <?php if ($user->authorise('core.create', 'com_redirect') | ||
| && $user->authorise('core.edit', 'com_redirect') | ||
| && $user->authorise('core.edit.state', 'com_redirect')) : ?> | ||
| <?php echo JHtml::_( | ||
| 'bootstrap.renderModal', | ||
| 'collapseModal', | ||
| array( | ||
| 'title' => JText::_('COM_REDIRECT_BATCH_OPTIONS'), | ||
| 'footer' => $this->loadTemplate('batch_footer') | ||
| ), | ||
| $this->loadTemplate('batch_body') | ||
| ); ?> | ||
| <?php endif;?> | ||
| <?php endif; ?> | ||
|
|
||
| <?php if (!empty($this->items)) : ?> | ||
| <?php echo $this->loadTemplate('addform'); ?> | ||
| <?php endif; ?> | ||
|
|
||
| <?php echo $this->loadTemplate('batch'); ?> | ||
|
|
||
| <input type="hidden" name="task" value="" /> | ||
| <input type="hidden" name="boxchecked" value="0" /> | ||
| <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,8 @@ class RedirectViewLinks extends JViewLegacy | |
|
|
||
| protected $collect_urls_enabled; | ||
|
|
||
| protected $redirectpluginid; | ||
|
|
||
| protected $items; | ||
|
|
||
| protected $pagination; | ||
|
|
@@ -39,6 +41,7 @@ public function display($tpl = null) | |
| { | ||
| $this->enabled = RedirectHelper::isEnabled(); | ||
| $this->collect_urls_enabled = RedirectHelper::collectUrlsEnabled(); | ||
| $this->redirectpluginid = RedirectHelper::getRedirectPluginId(); | ||
| $this->items = $this->get('Items'); | ||
| $this->pagination = $this->get('Pagination'); | ||
| $this->state = $this->get('State'); | ||
|
|
@@ -109,6 +112,7 @@ protected function addToolbar() | |
| // Get the toolbar object instance | ||
| $bar = JToolBar::getInstance('toolbar'); | ||
|
|
||
| JHtml::_('bootstrap.modal', 'collapseModal'); | ||
| $title = JText::_('JTOOLBAR_BATCH'); | ||
|
|
||
| // Instantiate a new JLayoutFile instance and render the batch button | ||
|
|
@@ -129,7 +133,7 @@ protected function addToolbar() | |
| JToolbarHelper::divider(); | ||
| } | ||
|
|
||
| if ($canDo->get('core.admin') || $canDo->get('core.options')) | ||
| if ($canDo->get('core.admin')) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert that line to the original. I guess it comes from a bad merge. |
||
| { | ||
| JToolbarHelper::preferences('com_redirect'); | ||
| JToolbarHelper::divider(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be obvious but I suck at JS. What's the purpose of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when we save the plugin it will show the plugin list as its loaded in iframe.
btw, module modal used the same approach and more, i just picked up the code necessary to close modal after it save
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, can't see that in https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_modules/views/module/tmpl/modal.php. Maybe it got changed recently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I think #6804
On 25 June 2015 at 12:55, Thomas Hunziker [email protected] wrote:
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry i didn't mention the exact file
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_modules/views/module/tmpl/edit.php#L123
but seems its already changed to jquery