<?php
//define this module's name and path
$mn = basename(__FILE__ , ".php");
include("modules/modules.php");

/*
Available variables:
All system classes
All request variables
$p (the template path)
$mp (the module path)
$sufixID (id sufix for this module's divs)
*/

//global $admin;
if($admin){
?>
<script>
$().ready(function(){
	$('div[data-editable="editable"]').each(function(index) {
		$(this).css("position", "relative")
		var temp = $(this).attr("id").split("-");
		var moduleName = temp[0];
		var moduleID = temp[1];
		var divID = "module_" + moduleID;
		var linkID = "link_" + moduleID;
		$(this).append("<div id='" + divID + "' class='editable'><a id='" + linkID + "' href='admin/inner_modules.php?action=form&moduleID="+moduleID+"'><div style='width:50px; height:50px;'></div></a></div>");
		$(this).hover(function(){
			$('#'+divID).toggle();
		});
		$('#'+linkID).fancybox({
			onClosed : function() {if(window.dataSaved){document.location.reload();}},
			'overlayOpacity' : 0.9,
			'overlayColor' :'#000',
			'width' : 950,
			'height' : '100%',
			'autoScale' : false,
			'type' : 'iframe',
			'showNavArrows' : false,
			'titleShow' : false
		});

	});
});
</script>
<?php
}
?>

