\dom\html.phpclass JDomHtml extends JDom
{
protected $modal_height;
protected $iconLibrary;
protected $modal_onclose;
protected $modal_scrolling;
function __construct($args)
{
.
.
.
$this->arg('iconLibrary', null, $args, 'icomoon');
$this->arg('modal_onclose', null, $args);
$this->arg('modal_scrolling', null, $args);
.
.
.
}
protected function embedLink($html)
{
.
.
.
if ((isset($this->href) || isset($this->target) || isset($this->task)) && (isset($this->dataValue)) && (!empty($this->dataValue)))
{
$html = JDom::_("html.link", array(
.
.
.
'modal_onclose' => (isset($this->modal_onclose)?$this->modal_onclose:null),
'modal_scrolling' => (isset($this->modal_scrolling)?$this->modal_scrolling:null),
));
}
return $html;
}
}
\dom\html\link.phpclass JDomHtmlLink extends JDomHtml
{
.
.
.
protected $modal_onclose;
protected $modal_scrolling;
function __construct($args)
{
.
.
.
$this->arg('alertConfirm' , null, $args);
$this->arg('modal_onclose' , null, $args);
$this->arg('modal_scrolling' , null, $args);
}
function modalLink()
{
JHTML::_('behavior.modal');
$this->addClass('modal');
$rel = "{";
$rel.= "handler: '" . ($this->handler?$this->handler:'') . "'";
if ($this->modal_width && $this->modal_height)
{
$rel .= ", size: {x: " . ((int)$this->modal_width?(int)$this->modal_width:"null")
. ", y: " . ((int)$this->modal_height?(int)$this->modal_height:"null")
. "}";
}
if ($this->modal_scrolling)
{
$options = array("auto", "no", "yes");
if (!in_array(strtolower($this->modal_scrolling), $options))
$this->modal_scrolling = "auto";
$rel .= ", iframeOptions: {scrolling:'" . $this->modal_scrolling
. "'}";
}
if ($this->modal_onclose)
{
$rel .= ", onClose: function() {" . $this->modal_onclose . "}";
}
$rel.= "}";
$this->addSelector('rel', $rel);
}
}
Usage for reloading parent on modal close:<?php echo JDom::_('html.fly', array(
'dataKey' => 'account',
'dataObject' => $row,
'modal_height' => 350,
'modal_onclose' => 'var js = window.location.reload();',
'modal_scrolling' => 'no',
'modal_width' => 350,
'route' => array('view' => 'clients','layout' => 'ajax','render=account&account' => $row->id),
'target' => 'modal'
));?>
This event can also be used for checking in the record on modal close and many more actions related to the unloading of the form. I and not blissfully happy with this solution so I am continuing my research into this matter; however, this function was the quickest to implement to move my project along.
Regards
vlemos