mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
Corrected frontend modal markup. Corrected page registry identifier.
This commit is contained in:
parent
56082cf072
commit
8c0680a18a
@ -685,19 +685,26 @@ if(deftrue('BOOTSTRAP'))
|
||||
{
|
||||
// if(empty($LAYOUT['_modal_'])) // leave it set for now.
|
||||
{
|
||||
$LAYOUT['_modal_'] = '<div id="uiModal" style="display:none" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-caption"> </h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Loading…</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" data-dismiss="modal" class="btn btn-primary">Close</a>
|
||||
$LAYOUT['_modal_'] = '<div id="uiModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-caption"> </h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Loading…</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" data-dismiss="modal" class="btn btn-primary">Close</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
echo $LAYOUT['_modal_'];
|
||||
|
@ -532,6 +532,11 @@ class e107
|
||||
return self::$_registry[$id];
|
||||
}
|
||||
|
||||
if($id == '_all_')
|
||||
{
|
||||
return self::$_registry;
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ class page_shortcodes extends e_shortcode
|
||||
function __construct()
|
||||
{
|
||||
|
||||
$this->request = e107::getRegistry('core/pages/request');
|
||||
$this->request = e107::getRegistry('core/page/request');
|
||||
|
||||
$action = varset($this->request['action']);
|
||||
|
||||
|
@ -21,7 +21,7 @@ $tmpl = e107::getCoreTemplate('chapter','nav',true,true); // always merge and al
|
||||
|
||||
$template = $tmpl['showPage'];
|
||||
|
||||
$request = e107::getRegistry('core/pages/request');
|
||||
$request = e107::getRegistry('core/page/request');
|
||||
if($request && is_array($request))
|
||||
{
|
||||
switch ($request['action'])
|
||||
|
@ -396,6 +396,46 @@ $(document).ready(function()
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Bootstrap Modal window within an iFrame for frontend */
|
||||
$('.e-modal').on('click', function(e)
|
||||
{
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
if($(this).attr('data-cache') == 'false')
|
||||
{
|
||||
$('#uiModal').on('shown.bs.modal', function () {
|
||||
$(this).removeData('bs.modal');
|
||||
});
|
||||
}
|
||||
|
||||
var url = $(this).attr('href');
|
||||
var caption = $(this).attr('data-modal-caption');
|
||||
var height = ($(window).height() * 0.7) - 120;
|
||||
|
||||
if(caption === undefined)
|
||||
{
|
||||
caption = '';
|
||||
}
|
||||
|
||||
if($(this).attr('data-modal-height') !== undefined)
|
||||
{
|
||||
height = $(this).attr('data-modal-height');
|
||||
}
|
||||
|
||||
$('.modal-body').html('<div><iframe id="e-modal-iframe" width="100%" height="'+height+'px" frameborder="0" scrolling="auto" style="display:block;" allowtransparency="true" src="' + url + '"></iframe></div>');
|
||||
$('.modal-caption').html(caption + ' <i id="e-modal-loading" class="fa fa-spin fa-spinner"></i>');
|
||||
$('.modal').modal('show');
|
||||
|
||||
$("#e-modal-iframe").on("load", function () {
|
||||
$('#e-modal-loading').hide();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user