Skip to content
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
472614a
joomla plugin edit view in modal
shamsbd71 Jun 24, 2015
abf18f3
Merge pull request #1 from shamsbd71/shamsbd71-j3-patch-pluginmodal
shamsbd71 Jun 24, 2015
08866bf
after save the plugin on modal ,close modal
shamsbd71 Jun 25, 2015
8b7812a
getRedirectPluginId method added
shamsbd71 Jun 25, 2015
9e2cc52
com_redirect language updated
shamsbd71 Jun 25, 2015
9f41eab
get the Redirect plugin id
shamsbd71 Jun 25, 2015
426fe93
modal edit view for system Redirect Plugin
shamsbd71 Jun 25, 2015
cc08558
btn class added to edit plugin link
shamsbd71 Jun 25, 2015
761a126
bootstrapization of modal view
shamsbd71 Jun 25, 2015
9eb0c5d
bootstrapization of plugin edit view modal close
shamsbd71 Jun 25, 2015
9d4d31d
bootstrapization of modal method call
shamsbd71 Jun 25, 2015
ac76274
Merge branch 'staging' of https://github.com/joomla/joomla-cms into s…
shamsbd71 Jul 3, 2015
7e428ec
Merge branch 'staging' of https://github.com/joomla/joomla-cms into s…
shamsbd71 Jul 6, 2015
b37762c
JPluginHelper::getPlugin now return id #7355
shamsbd71 Jul 6, 2015
97c9c56
JPluginHelper::protected static function load() updated to load match…
shamsbd71 Jul 6, 2015
0c739d4
JPluginHelper::loadPlugin handled need only enabled as thats used sap…
shamsbd71 Jul 6, 2015
d5cba75
redirect links view updated to use jpluginhelper code and get id from…
shamsbd71 Jul 6, 2015
ea80917
modal wrapper moved from alert wrapper and modal title language added
shamsbd71 Jul 7, 2015
770ca34
Merge branch 'staging' of https://github.com/joomla/joomla-cms into s…
shamsbd71 Jul 13, 2015
d947f77
codestyle changes
brianteeman Jul 19, 2015
d46b210
Merge pull request #2 from brianteeman/patch-1
shamsbd71 Jul 20, 2015
061e538
Merge branch 'staging' of github.com:shamsbd71/joomla-cms into staging
shamsbd71 Jul 20, 2015
5029e4b
pull latest commits from current joomla staging
shamsbd71 Jul 20, 2015
4a1724b
batch permission n modal marged with joomla staging: links list in admin
shamsbd71 Jul 20, 2015
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
{
if (task == 'plugin.cancel' || document.formvalidator.isValid(document.getElementById('style-form'))) {
Joomla.submitform(task, document.getElementById('style-form'));

if (self != top){
window.top.setTimeout('window.parent.jModalClose()', 1000);
Copy link
Contributor

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?

Copy link
Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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:

In administrator/components/com_plugins/views/plugin/tmpl/edit.php
#7259 (comment):

@@ -20,6 +20,10 @@
{
if (task == 'plugin.cancel' || document.formvalidator.isValid(document.getElementById('style-form'))) {
Joomla.submitform(task, document.getElementById('style-form'));

  •       if (self != top){
    
  •           window.top.setTimeout('window.parent.jModalClose()', 1000);
    

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?


Reply to this email directly or view it on GitHub
https://github.com/joomla/joomla-cms/pull/7259/files#r33246541.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}
};
");
Expand Down
26 changes: 26 additions & 0 deletions administrator/components/com_plugins/views/plugin/tmpl/modal.php
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>
Copy link
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, i just did that


<?php
$this->setLayout('edit');
echo $this->loadTemplate();
29 changes: 29 additions & 0 deletions administrator/components/com_redirect/helpers/redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,35 @@ public static function isEnabled()

return $result;
}

/**
* get the redirect system plugin id to use for direct access
*
* @return int
*
* @since 3.4
*/
public static function getRedirectPluginId()
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('extension_id'))
->from('#__extensions')
->where($db->quoteName('folder') . ' = ' . $db->quote('system'))
->where($db->quoteName('element') . ' = ' . $db->quote('redirect'));
$db->setQuery($query);

try
{
$result = (int) $db->loadResult();
}
catch (RuntimeException $e)
{
JError::raiseWarning(500, $e->getMessage());
}

return $result;
}

/**
* Checks whether the option "Collect URLs" is enabled for the output message
Expand Down
60 changes: 29 additions & 31 deletions administrator/components/com_redirect/views/links/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('formbehavior.chosen', 'select');
JHTML::_('behavior.modal');
Copy link
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Bakual , @DGT41
thank you, i have implemented the bootstrap way


$user = JFactory::getUser();
$listOrder = $this->escape($this->state->get('list.ordering'));
Expand All @@ -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">&#215;</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">&#215;</a>
<?php echo JText::_('COM_REDIRECT_PLUGIN_DISABLED'); ?>
</div>

<?php if ($this->enabled) : ?>
<div class="alert alert-info">
<a class="close" data-dismiss="alert">&#215;</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">&#215;</a>
<?php echo JText::_('COM_REDIRECT_PLUGIN_DISABLED'); ?>
<?php endif; ?>

<a class="modal btn btn-small" rel="{handler: 'iframe', size: {x: 900, y: 550}}"
Copy link
Contributor

Choose a reason for hiding this comment

The 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&amp;client_id=0&amp;task=plugin.edit&amp;extension_id=" . $this->redirectpluginid . "&amp;tmpl=component&amp;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'); ?>
Expand Down Expand Up @@ -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; ?>" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class RedirectViewLinks extends JViewLegacy

protected $collect_urls_enabled;

protected $redirectpluginid;

protected $items;

protected $pagination;
Expand All @@ -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');
Expand Down Expand Up @@ -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
Expand All @@ -129,7 +133,7 @@ protected function addToolbar()
JToolbarHelper::divider();
}

if ($canDo->get('core.admin') || $canDo->get('core.options'))
if ($canDo->get('core.admin'))
Copy link
Contributor

Choose a reason for hiding this comment

The 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();
Expand Down
4 changes: 2 additions & 2 deletions administrator/language/en-GB/en-GB.com_redirect.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ COM_REDIRECT_COLLECT_URLS_DISABLED="The option 'Collect URLs' is disabled."
COM_REDIRECT_CONFIGURATION="Redirect Manager Options"
COM_REDIRECT_DISABLE_LINK="Disable Link"
COM_REDIRECT_EDIT_LINK="Edit Link #%d"
COM_REDIRECT_EDIT_PLUGIN = "Edit the Plugin now"
COM_REDIRECT_ENABLE_LINK="Enable Link"
COM_REDIRECT_ERROR_DESTINATION_URL_REQUIRED="The redirect must have a destination URL"
COM_REDIRECT_ERROR_DUPLICATE_OLD_URL="The source URL must be unique."
Expand Down Expand Up @@ -56,8 +57,7 @@ COM_REDIRECT_N_LINKS_UPDATED_1="1 link has been updated."
COM_REDIRECT_NEW_LINK="New Link"
COM_REDIRECT_NO_ITEM_ADDED="No links added."
COM_REDIRECT_NO_ITEM_SELECTED="No links selected."
; Change 'System%20-%20Redirect' to the value in plg_system_redirect.sys.ini for your language
COM_REDIRECT_PLUGIN_DISABLED="The Redirect Plugin is disabled. <a href="_QQ_"index.php?option=com_plugins&view=plugins&filter[search]=System%20-%20Redirect"_QQ_">Enable it in the Plugin Manager</a>."
COM_REDIRECT_PLUGIN_DISABLED="The Redirect Plugin is disabled. You need to enable it."
COM_REDIRECT_PLUGIN_ENABLED="The Redirect Plugin is enabled."
COM_REDIRECT_REDIRECTED_ON="Redirected on: %s."
COM_REDIRECT_SAVE_SUCCESS="Link successfully saved."
Expand Down