2009-09-30 07:31:11 -07:00
|
|
|
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
2009-09-30 14:25:33 -07:00
|
|
|
<script type="text/javascript">
|
|
|
|
|
$(function() {
|
2009-10-18 20:22:10 -06:00
|
|
|
$(".g-blocks-list ul").sortable({
|
2009-10-04 00:27:22 -06:00
|
|
|
connectWith: ".g-sortable-blocks",
|
2009-09-30 14:25:33 -07:00
|
|
|
opacity: .7,
|
2009-10-07 00:21:23 -06:00
|
|
|
placeholder: "g-target",
|
2009-09-30 14:25:33 -07:00
|
|
|
update: function(event,ui) {
|
2009-10-04 00:27:22 -06:00
|
|
|
if ($(this).attr("id") == "g-active-blocks") {
|
2009-09-30 14:25:33 -07:00
|
|
|
var active_blocks = "";
|
2009-10-04 00:27:22 -06:00
|
|
|
$("ul#g-active-blocks li").each(function(i) {
|
2009-09-30 14:25:33 -07:00
|
|
|
active_blocks += "&block["+i+"]="+$(this).attr("ref");
|
|
|
|
|
});
|
2009-10-18 20:22:10 -06:00
|
|
|
$.getJSON($("#g-admin-blocks").attr("ref").replace("__ACTIVE__", active_blocks), function(data) {
|
2009-09-30 14:25:33 -07:00
|
|
|
if (data.result == "success") {
|
2009-10-04 00:27:22 -06:00
|
|
|
$("ul#g-available-blocks").html(data.available);
|
|
|
|
|
$("ul#g-active-blocks").html(data.active);
|
2009-09-30 14:25:33 -07:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2009-10-07 00:21:23 -06:00
|
|
|
}
|
2009-09-30 14:25:33 -07:00
|
|
|
}).disableSelection();
|
|
|
|
|
});
|
|
|
|
|
</script>
|
2009-10-18 20:22:10 -06:00
|
|
|
<div class="g-block">
|
|
|
|
|
<h1> <?= t("Manage Sidebar") ?> </h1>
|
|
|
|
|
<p>
|
|
|
|
|
<?= t("Select and drag blocks from the available column to the active column to add to the sidebar; remove by dragging the other way.") ?>
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<div id="g-admin-blocks" class="g-block-content ui-helper-clearfix" ref="<?= url::site("admin/sidebar/update?csrf={$csrf}__ACTIVE__") ?>">
|
|
|
|
|
<div class="g-block g-left">
|
|
|
|
|
<h3><?= t("Available Blocks") ?></h3>
|
|
|
|
|
<div class="g-blocks-list g-block-content">
|
|
|
|
|
<ul id="g-available-blocks" class="g-sortable-blocks">
|
|
|
|
|
<?= $available ?>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2009-09-30 14:25:33 -07:00
|
|
|
</div>
|
2009-10-18 20:22:10 -06:00
|
|
|
<div class="g-block g-left">
|
|
|
|
|
<h3><?= t("Active Blocks") ?></h3>
|
|
|
|
|
<div class="g-blocks-list g-block-content">
|
|
|
|
|
<ul id="g-active-blocks" class="g-sortable-blocks">
|
|
|
|
|
<?= $active ?>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2009-09-30 14:25:33 -07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|