2009-01-18 09:06:46 +00:00
|
|
|
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
update_blocks = function() {
|
|
|
|
|
$.get("<?= url::site("admin/dashboard/reorder") ?>",
|
2009-03-27 03:43:21 +00:00
|
|
|
{"csrf": "<?= $csrf ?>",
|
2009-01-18 09:06:46 +00:00
|
|
|
"dashboard_center[]": $("#gAdminDashboard").sortable(
|
|
|
|
|
"toArray", {attribute: "block_id"}),
|
|
|
|
|
"dashboard_sidebar[]": $("#gAdminDashboardSidebar").sortable(
|
|
|
|
|
"toArray", {attribute: "block_id"})});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
2009-06-09 23:54:02 -04:00
|
|
|
$("#gAdminDashboard .gBlock .ui-widget-header").addClass("gDraggable");
|
2009-01-18 09:06:46 +00:00
|
|
|
$("#gAdminDashboard").sortable({
|
|
|
|
|
connectWith: ["#gAdminDashboardSidebar"],
|
|
|
|
|
containment: "document",
|
|
|
|
|
cursor: "move",
|
2009-06-09 23:54:02 -04:00
|
|
|
handle: $(".ui-widget-header"),
|
2009-01-18 09:06:46 +00:00
|
|
|
opacity: 0.6,
|
|
|
|
|
placeholder: "gDropTarget",
|
|
|
|
|
stop: update_blocks
|
|
|
|
|
});
|
|
|
|
|
|
2009-06-09 23:54:02 -04:00
|
|
|
$("#gAdminDashboardSidebar .gBlock .ui-widget-header").addClass("gDraggable");
|
2009-01-18 09:06:46 +00:00
|
|
|
$("#gAdminDashboardSidebar").sortable({
|
|
|
|
|
connectWith: ["#gAdminDashboard"],
|
|
|
|
|
containment: "document",
|
|
|
|
|
cursor: "move",
|
2009-06-09 23:54:02 -04:00
|
|
|
handle: $(".ui-widget-header"),
|
2009-01-18 09:06:46 +00:00
|
|
|
opacity: 0.6,
|
|
|
|
|
placeholder: "gDropTarget",
|
|
|
|
|
stop: update_blocks
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<div id="gAdminDashboard">
|
|
|
|
|
<?= $blocks ?>
|
|
|
|
|
</div>
|