First of all, if you chose the standard "Execute PHP" then you should change "return" to "echo".
See, when it's on, Geeklog doesn't care one bit which UI module you've turned on.
Instead, it always loads all of the modules (by calling the overall jquery-ui.min.js).
So the iframe code only works with jquery-ui.min.js itself. However, Geeklog provides no automated way to call the local version. So one has to call it manually. But the automated way must still be used in order to load the relevant CSS files. I chose effect-fade because it's the smallest file.
Text Formatted Code
global $_SCRIPTS, $_CONF;
$_SCRIPTS->setJavaScriptLibrary('jquery.ui.effect-fade'); // dummy file needed in order to load jQuery's CSS files and - in case of cdn_hosted - the actual JS
$cdn_hosted = true;
$js='';
if (empty($_CONF['cdn_hosted'])) {
$cdn_hosted = false;
$js .= '<script type="text/javascript" src="' . $_CONF['site_url'] . '/javascript/jquery_ui/jquery-ui.min.js"></script>
<script type="text/javascript">
';
}
$js .= '
$("#dialog").dialog({
autoOpen: false,
modal: true,
height: 600,
open: function(ev, ui){
$("#myIframe").attr("src","http://www.jQuery.com");
}
});
$("#dialogBtn").click(function(){
$("#dialog").dialog("open");
});
';
if (empty($_CONF['cdn_hosted']))
$js .= '</script>';
$_SCRIPTS->setJavaScript($js, $cdn_hosted);
?>
<div id="dialog">
Your Iframe Below
<iframe id="myIframe" src=""></iframe>
</div>
<button id="dialogBtn">Open Dialog</button>
<?php
echo '';