Created
June 27, 2014 03:30
-
-
Save augustine-tran/c42f407d527695c356b5 to your computer and use it in GitHub Desktop.
PhalconEye how modal box works
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$params = ['hide' => true, 'hideTimeout' => 1000]; | |
$callbackFn = $this->request->getQuery('callbackFn', 'string'); | |
if ($callbackFn) { | |
$params['customJs'] = $callbackFn . '('. $jsonData .')'; | |
} | |
$this->resolveModal($params); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# | |
+------------------------------------------------------------------------+ | |
| PhalconEye CMS | | |
+------------------------------------------------------------------------+ | |
| Copyright (c) 2013-2014 PhalconEye Team (http://phalconeye.com/) | | |
+------------------------------------------------------------------------+ | |
| This source file is subject to the New BSD License that is bundled | | |
| with this package in the file LICENSE.txt. | | |
| | | |
| If you did not receive a copy of the license and are unable to | | |
| obtain it through the world-wide-web, please send an email | | |
| to [email protected] so we can send you a copy immediately. | | |
+------------------------------------------------------------------------+ | |
| Author: Ivan Vorontsov <[email protected]> | | |
+------------------------------------------------------------------------+ | |
#} | |
<script type="text/javascript"> | |
var hideModal = function () { | |
PhalconEye.widget.modal.hide(); | |
{% if reload is defined %} | |
window.location.reload(); | |
{% endif %} | |
}; | |
{% if hide is defined %} | |
var hideTimeout = parseInt('{{ hide }}'); | |
if (hideTimeout) { | |
setTimeout(hideModal, hideTimeout); | |
} | |
else { | |
hideModal(); | |
} | |
{% elseif reload is defined %} | |
var reloadTimeout = parseInt('{{ reload }}'); | |
if (reloadTimeout) { | |
setTimeout(function () { | |
window.location.reload(); | |
}, reloadTimeout); | |
} | |
else { | |
window.location.reload(); | |
} | |
{% endif %} | |
{% if customJs is defined %} | |
{{ customJs }} | |
{% endif %} | |
</script> | |
{% block body %} | |
{% if message is defined %} | |
<div class="modal-message"> | |
{{ message|i18n }} | |
</div> | |
{% endif %} | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment