summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2008-12-01 20:54:25 +0000
committerTim Almdal <tnalmdal@shaw.ca>2008-12-01 20:54:25 +0000
commit0ebd4f6b28e9fbe51d6214e9b845c94c54ca92a0 (patch)
treede506db999eef0f65e5f4f80b18e639dfa8a84dd
parented2cb2a86d691895ce4dac9b6de6665c5021c4c4 (diff)
New Rearrange gui based on jqueryFileTree (http://www.abeautifulsite.net/notebook.php?article=58). I like the look of this one better. Still need to implement the drag and drop functionality.
-rw-r--r--modules/rearrange/controllers/rearrange.php60
-rw-r--r--modules/rearrange/css/jquery.simple.tree.css179
-rw-r--r--modules/rearrange/css/rearrange.css60
-rw-r--r--modules/rearrange/helpers/rearrange.php17
-rw-r--r--modules/rearrange/helpers/rearrange_block.php5
-rw-r--r--modules/rearrange/images/arrow_refresh.pngbin685 -> 0 bytes
-rw-r--r--modules/rearrange/images/bin_closed.pngbin0 -> 363 bytes
-rw-r--r--modules/rearrange/images/collapsable-last.gifbin655 -> 0 bytes
-rw-r--r--modules/rearrange/images/collapsable.gifbin1518 -> 0 bytes
-rw-r--r--modules/rearrange/images/cross.pngbin655 -> 0 bytes
-rw-r--r--modules/rearrange/images/directory.pngbin0 -> 537 bytes
-rw-r--r--modules/rearrange/images/disk.pngbin620 -> 0 bytes
-rw-r--r--modules/rearrange/images/expandable-last.gifbin670 -> 0 bytes
-rw-r--r--modules/rearrange/images/expandable.gifbin1539 -> 0 bytes
-rw-r--r--modules/rearrange/images/file.pngbin0 -> 294 bytes
-rw-r--r--modules/rearrange/images/folder_delete.pngbin666 -> 0 bytes
-rw-r--r--modules/rearrange/images/folder_edit.pngbin733 -> 0 bytes
-rw-r--r--modules/rearrange/images/folder_open.pngbin0 -> 583 bytes
-rw-r--r--modules/rearrange/images/leaf-last.gifbin615 -> 0 bytes
-rw-r--r--modules/rearrange/images/leaf.gifbin1458 -> 0 bytes
-rw-r--r--modules/rearrange/images/line_bg.gifbin93 -> 0 bytes
-rw-r--r--modules/rearrange/images/line_bg_over.gifbin251 -> 0 bytes
-rw-r--r--modules/rearrange/images/line_bg_over_last.gifbin235 -> 0 bytes
-rw-r--r--modules/rearrange/images/minus.gifbin267 -> 0 bytes
-rw-r--r--modules/rearrange/images/page_add.pngbin739 -> 0 bytes
-rw-r--r--modules/rearrange/images/page_delete.pngbin740 -> 0 bytes
-rw-r--r--modules/rearrange/images/page_edit.pngbin807 -> 0 bytes
-rw-r--r--modules/rearrange/images/picture.pngbin0 -> 606 bytes
-rw-r--r--modules/rearrange/images/plus.gifbin167 -> 0 bytes
-rw-r--r--modules/rearrange/images/root.gifbin1004 -> 0 bytes
-rw-r--r--modules/rearrange/images/spacer.gifbin43 -> 0 bytes
-rw-r--r--modules/rearrange/images/tree_line.gifbin197 -> 0 bytes
-rw-r--r--modules/rearrange/index.htm337
-rw-r--r--modules/rearrange/js/jquery.gallery.rearrange.tree.js90
-rw-r--r--modules/rearrange/js/jquery.simple.tree.js451
-rw-r--r--modules/rearrange/js/rearrange_tree.js0
-rw-r--r--modules/rearrange/loadTree.php32
-rw-r--r--modules/rearrange/views/rearrange.html.php50
-rw-r--r--modules/rearrange/views/rearrange_item_list.html.php13
39 files changed, 224 insertions, 1070 deletions
diff --git a/modules/rearrange/controllers/rearrange.php b/modules/rearrange/controllers/rearrange.php
index a04cc158..e9f96c93 100644
--- a/modules/rearrange/controllers/rearrange.php
+++ b/modules/rearrange/controllers/rearrange.php
@@ -17,34 +17,52 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class Rearrange_Controller extends REST_Controller {
- protected $resource_type = "item";
+class Rearrange_Controller extends Controller {
- public function _show($item) {
- print rearrange::get_html($item)->render();
+ public function _show($id) {
+ Kohana::log("debug", sprintf("[%s%s] Rearrange::_show(): %s", __FILE__, __LINE__, print_r($id, true)));
+ print rearrange::get_children($id)->render();
}
public function _index() {
- print rearrange::get_html()->render();
+ Kohana::log("debug", sprintf("[%s%s] Rearrange::_index(): %s", __FILE__, __LINE__, print_r(1, true)));
+ print rearrange::get_children()->render();
}
- public function _form_add($item_id) {
- throw new Exception("@todo Rearrange_Controller::_form_add NOT IMPLEMENTED");
- }
+ /**
+ * Handle dispatching for all REST controllers.
+ */
+ public function __call($function, $args) {
+ Kohana::log("debug", sprintf("[%s%s] Rearrange::$function(): %s", __FILE__, __LINE__, print_r($args, true)));
+ // If no parameter was provided after the controller name (eg "/albums") then $function will
+ // be set to "index". Otherwise, $function is the first parameter, and $args are all
+ // subsequent parameters.
+ $request_method = rest::request_method();
+ if ($function == "index" && $request_method == "get") {
+ return $this->_index();
+ }
- public function _form_edit($tag) {
- throw new Exception("@todo Rearrange_Controller::_form_edit NOT IMPLEMENTED");
- }
+ // @todo this needs security checks
+ $id = $function;
- public function _create($tag) {
- throw new Exception("@todo Rearrange_Controller::_create NOT IMPLEMENTED");
- }
+ switch ($request_method) {
+ case "get":
+ $this->_show($id);
- public function _delete($tag) {
- throw new Exception("@todo Rearrange_Controller::_delete NOT IMPLEMENTED");
- }
+ if (Session::instance()->get("use_profiler", false)) {
+ $profiler = new Profiler();
+ $profiler->render();
+ }
+ return;
- public function _update($tag) {
- throw new Exception("@todo Rearrange_Controller::_update NOT IMPLEMENTED");
- }
-}
+ case "put":
+ return $this->_update($id);
+
+ case "delete":
+ return $this->_delete($id);
+
+ case "post":
+ return $this->_create($id);
+ }
+ }
+} \ No newline at end of file
diff --git a/modules/rearrange/css/jquery.simple.tree.css b/modules/rearrange/css/jquery.simple.tree.css
deleted file mode 100644
index a874c53b..00000000
--- a/modules/rearrange/css/jquery.simple.tree.css
+++ /dev/null
@@ -1,179 +0,0 @@
-@CHARSET "UTF-8";
-
-.simpleTree {
- font: normal 12px arial, tahoma, helvetica, sans-serif;
- margin:0;
- padding:20px;
- margin:0;
- padding:0;
- /*
- overflow:auto;
- width: 250px;
- height:350px;
- overflow:auto;
- border: 1px solid #444444;
- */
-}
-
-.simpleTree li {
- list-style: none;
- margin:0;
- padding:0 0 0 34px;
- line-height: 14px;
-}
-.simpleTree li span {
- display:inline;
- clear: left;
- white-space: nowrap;
-}
-
-.simpleTree ul {
- margin:0;
- padding:0;
-}
-.simpleTree .root {
- margin-left:-16px;
- background: url(../images/root.gif) no-repeat 16px 0 #ffffff;
-}
-
-.simpleTree .line {
- margin:0 0 0 -16px;
- padding:0;
- line-height: 3px;
- height:3px;
- font-size:3px;
- background: url(../images/line_bg.gif) 0 0 no-repeat transparent;
-}
-
-.simpleTree .line-last {
- margin:0 0 0 -16px;
- padding:0;
- line-height: 3px;
- height:3px;
- font-size:3px;
- background: url(../images/spacer.gif) 0 0 no-repeat transparent;
-}
-
-.simpleTree .line-over {
- margin:0 0 0 -16px;
- padding:0;
- line-height: 3px;
- height:3px;
- font-size:3px;
- background: url(../images/line_bg_over.gif) 0 0 no-repeat transparent;
-}
-
-.simpleTree .line-over-last {
- margin:0 0 0 -16px;
- padding:0;
- line-height: 3px;
- height:3px;
- font-size:3px;
- background: url(../images/line_bg_over_last.gif) 0 0 no-repeat transparent;
-}
-
-.simpleTree .folder-open {
- margin-left:-16px;
- background: url(../images/collapsable.gif) 0 -2px no-repeat #fff;
-}
-
-.simpleTree .folder-open-last {
- margin-left:-16px;
- background: url(../images/collapsable-last.gif) 0 -2px no-repeat #fff;
-}
-
-.simpleTree .folder-close {
- margin-left:-16px;
- background: url(../images/expandable.gif) 0 -2px no-repeat #fff;
-}
-
-.simpleTree .folder-close-last {
- margin-left:-16px;
- background: url(../images/expandable-last.gif) 0 -2px no-repeat #fff;
-}
-
-.simpleTree .doc {
- margin-left:-16px;
- background: url(../images/leaf.gif) 0 -1px no-repeat #fff;
-}
-
-.simpleTree .doc-last {
- margin-left:-16px;
- background: url(../images/leaf-last.gif) 0 -1px no-repeat #fff;
-}
-
-.simpleTree .ajax {
- background: url(../images/spinner.gif) no-repeat 0 0 #ffffff;
- height: 16px;
- display:none;
-}
-
-.simpleTree .ajax li {
- display:none;
- margin:0;
- padding:0;
-}
-
-.simpleTree .trigger {
- display:inline;
- margin-left:-32px;
- width: 28px;
- height: 11px;
- cursor:pointer;
-}
-
-.simpleTree .text {
- cursor: default;
-}
-
-.simpleTree .active {
- cursor: default;
- background-color:#F7BE77;
- padding:0px 2px;
- border: 1px dashed #444;
-}
-
-#drag_container {
- background:#ffffff;
- color:#000;
- font: normal 11px arial, tahoma, helvetica, sans-serif;
- border: 1px dashed #767676;
-}
-
-#drag_container ul {
- list-style: none;
- padding:0;
- margin:0;
-}
-
-
-#drag_container li {
- list-style: none;
- background-color:#ffffff;
- line-height:18px;
- white-space: nowrap;
- padding:1px 1px 0px 16px;
- margin:0;
-}
-
-#drag_container li span {
- padding:0;
-}
-
-
-#drag_container li.doc, #drag_container li.doc-last {
- background: url(../images/leaf.gif) no-repeat -17px 0 #ffffff;
-}
-
-#drag_container .folder-close, #drag_container .folder-close-last {
- background: url(../images/expandable.gif) no-repeat -17px 0 #ffffff;
-}
-
-
-#drag_container .folder-open, #drag_container .folder-open-last {
- background: url(../images/collapsable.gif) no-repeat -17px 0 #ffffff;
-}
-
-.contextMenu {
- display:none;
-}
diff --git a/modules/rearrange/css/rearrange.css b/modules/rearrange/css/rearrange.css
new file mode 100644
index 00000000..c371edf0
--- /dev/null
+++ b/modules/rearrange/css/rearrange.css
@@ -0,0 +1,60 @@
+@CHARSET "UTF-8";
+#gRearrange {
+ font-family: Verdana, sans-serif;
+ font-size: 11px;
+}
+
+#gAddAlbum {
+ background-image: url(../images/folder_add.png);
+ background-repeat: no-repeat;
+ padding-left: 20px;
+ padding-bottom: 5px
+}
+
+#gDeleteItem {
+ background-image: url(../images/bin_closed.png);
+ background-repeat: no-repeat;
+ padding-left: 20px;
+ padding-bottom: 5px
+}
+
+UL.jqueryFileTree {
+ font-family: Verdana, sans-serif;
+ font-size: 11px;
+ line-height: 18px;
+ padding: 0px;
+ margin: 0px;
+}
+
+UL.jqueryFileTree LI {
+ list-style: none;
+ padding: 0px;
+ padding-left: 20px;
+ margin: 0px;
+ white-space: nowrap;
+}
+
+UL.jqueryFileTree A {
+ color: #333;
+ text-decoration: none;
+ display: block;
+ padding: 0px 2px;
+}
+
+UL.jqueryFileTree A:hover {
+ background: #BDF;
+}
+
+/* Core Styles */
+.jqueryFileTree LI.directory { background: url(../images/directory.png) left top no-repeat; }
+.jqueryFileTree LI.expanded { background: url(../images/folder_open.png) left top no-repeat; }
+.jqueryFileTree LI.file { background: url(../images/file.png) left top no-repeat; }
+.jqueryFileTree LI.wait { background: url(../images/spinner.gif) left top no-repeat; }
+.jqueryFileTree LI.item { background: url(../images/picture.png) left top no-repeat; }
+
+/*
+ * File Extensions Support
+ * If we want to add differnt icons for different file extentions. then we just need to add
+ * classes for each extension and then add this class to the end of the classes on the 'li' element
+ * i.e. .jqueryFileTree LI.ext_fla { background: url(../images/flash.png) left top no-repeat; }
+*/
diff --git a/modules/rearrange/helpers/rearrange.php b/modules/rearrange/helpers/rearrange.php
index 815014bc..558899b2 100644
--- a/modules/rearrange/helpers/rearrange.php
+++ b/modules/rearrange/helpers/rearrange.php
@@ -18,16 +18,23 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class rearrange_Core {
- public static function get_html($item=null) {
- $view = new View("rearrange.html");
+ public static function get_html() {
+ return new View("rearrange.html");
+ }
+
+ public static function get_children($id=null) {
+ $view = new View("rearrange_item_list.html");
$view->root = null;
- if (empty($item)) {
+ if (empty($id)) {
$item = ORM::factory("item", 1);
- $view->root = $item;
+ $view->children = array($item);
+ } else {
+ $item = ORM::factory("item", $id);
+ $view->children = $item->children();
}
- $view->children = $item->children();
return $view;
}
+
}
diff --git a/modules/rearrange/helpers/rearrange_block.php b/modules/rearrange/helpers/rearrange_block.php
index 24dead6b..df9818a9 100644
--- a/modules/rearrange/helpers/rearrange_block.php
+++ b/modules/rearrange/helpers/rearrange_block.php
@@ -19,9 +19,10 @@
*/
class rearrange_block_Core {
public static function head($theme) {
- $head[] = html::script("modules/rearrange/js/jquery.simple.tree.js");
+ $head[] = html::script("modules/rearrange/js/jquery.gallery.rearrange.tree.js");
+ $head[] = html::script("modules/rearrange/js/rearrange.js");
- $url = url::file("modules/rearrange/css/jquery.simple.tree.css");
+ $url = url::file("modules/rearrange/css/rearrange.css");
$head[] = "<link rel=\"stylesheet\" type=\"text/css\" href=\"$url\" " .
"media=\"screen,print,projection\" />";
diff --git a/modules/rearrange/images/arrow_refresh.png b/modules/rearrange/images/arrow_refresh.png
deleted file mode 100644
index 0de26566..00000000
--- a/modules/rearrange/images/arrow_refresh.png
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/bin_closed.png b/modules/rearrange/images/bin_closed.png
new file mode 100644
index 00000000..afe22ba9
--- /dev/null
+++ b/modules/rearrange/images/bin_closed.png
Binary files differ
diff --git a/modules/rearrange/images/collapsable-last.gif b/modules/rearrange/images/collapsable-last.gif
deleted file mode 100644
index 5d1ea601..00000000
--- a/modules/rearrange/images/collapsable-last.gif
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/collapsable.gif b/modules/rearrange/images/collapsable.gif
deleted file mode 100644
index 20dbdad2..00000000
--- a/modules/rearrange/images/collapsable.gif
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/cross.png b/modules/rearrange/images/cross.png
deleted file mode 100644
index 1514d51a..00000000
--- a/modules/rearrange/images/cross.png
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/directory.png b/modules/rearrange/images/directory.png
new file mode 100644
index 00000000..784e8fa4
--- /dev/null
+++ b/modules/rearrange/images/directory.png
Binary files differ
diff --git a/modules/rearrange/images/disk.png b/modules/rearrange/images/disk.png
deleted file mode 100644
index 99d532e8..00000000
--- a/modules/rearrange/images/disk.png
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/expandable-last.gif b/modules/rearrange/images/expandable-last.gif
deleted file mode 100644
index fb468bc3..00000000
--- a/modules/rearrange/images/expandable-last.gif
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/expandable.gif b/modules/rearrange/images/expandable.gif
deleted file mode 100644
index 451f6a30..00000000
--- a/modules/rearrange/images/expandable.gif
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/file.png b/modules/rearrange/images/file.png
new file mode 100644
index 00000000..8b8b1ca0
--- /dev/null
+++ b/modules/rearrange/images/file.png
Binary files differ
diff --git a/modules/rearrange/images/folder_delete.png b/modules/rearrange/images/folder_delete.png
deleted file mode 100644
index 112b0163..00000000
--- a/modules/rearrange/images/folder_delete.png
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/folder_edit.png b/modules/rearrange/images/folder_edit.png
deleted file mode 100644
index ad669cc7..00000000
--- a/modules/rearrange/images/folder_edit.png
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/folder_open.png b/modules/rearrange/images/folder_open.png
new file mode 100644
index 00000000..4e354835
--- /dev/null
+++ b/modules/rearrange/images/folder_open.png
Binary files differ
diff --git a/modules/rearrange/images/leaf-last.gif b/modules/rearrange/images/leaf-last.gif
deleted file mode 100644
index e5d301db..00000000
--- a/modules/rearrange/images/leaf-last.gif
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/leaf.gif b/modules/rearrange/images/leaf.gif
deleted file mode 100644
index 2f5c2ef1..00000000
--- a/modules/rearrange/images/leaf.gif
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/line_bg.gif b/modules/rearrange/images/line_bg.gif
deleted file mode 100644
index 3189f90b..00000000
--- a/modules/rearrange/images/line_bg.gif
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/line_bg_over.gif b/modules/rearrange/images/line_bg_over.gif
deleted file mode 100644
index 421883d7..00000000
--- a/modules/rearrange/images/line_bg_over.gif
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/line_bg_over_last.gif b/modules/rearrange/images/line_bg_over_last.gif
deleted file mode 100644
index b43d2b60..00000000
--- a/modules/rearrange/images/line_bg_over_last.gif
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/minus.gif b/modules/rearrange/images/minus.gif
deleted file mode 100644
index e4f90c27..00000000
--- a/modules/rearrange/images/minus.gif
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/page_add.png b/modules/rearrange/images/page_add.png
deleted file mode 100644
index d5bfa071..00000000
--- a/modules/rearrange/images/page_add.png
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/page_delete.png b/modules/rearrange/images/page_delete.png
deleted file mode 100644
index 3141467c..00000000
--- a/modules/rearrange/images/page_delete.png
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/page_edit.png b/modules/rearrange/images/page_edit.png
deleted file mode 100644
index 046811ed..00000000
--- a/modules/rearrange/images/page_edit.png
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/picture.png b/modules/rearrange/images/picture.png
new file mode 100644
index 00000000..4a158fef
--- /dev/null
+++ b/modules/rearrange/images/picture.png
Binary files differ
diff --git a/modules/rearrange/images/plus.gif b/modules/rearrange/images/plus.gif
deleted file mode 100644
index c253770d..00000000
--- a/modules/rearrange/images/plus.gif
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/root.gif b/modules/rearrange/images/root.gif
deleted file mode 100644
index 27012fbd..00000000
--- a/modules/rearrange/images/root.gif
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/spacer.gif b/modules/rearrange/images/spacer.gif
deleted file mode 100644
index 1d11fa9a..00000000
--- a/modules/rearrange/images/spacer.gif
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/images/tree_line.gif b/modules/rearrange/images/tree_line.gif
deleted file mode 100644
index 2d6fa89c..00000000
--- a/modules/rearrange/images/tree_line.gif
+++ /dev/null
Binary files differ
diff --git a/modules/rearrange/index.htm b/modules/rearrange/index.htm
deleted file mode 100644
index 7ada5ce9..00000000
--- a/modules/rearrange/index.htm
+++ /dev/null
@@ -1,337 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
-<title>SimpleTree Drag&Drop</title>
-<style>
-body
-{
- font: normal 12px arial, tahoma, helvetica, sans-serif;
- margin:0;
- padding:20px;
-}
-.simpleTree
-{
-
- margin:0;
- padding:0;
- /*
- overflow:auto;
- width: 250px;
- height:350px;
- overflow:auto;
- border: 1px solid #444444;
- */
-}
-.simpleTree li
-{
- list-style: none;
- margin:0;
- padding:0 0 0 34px;
- line-height: 14px;
-}
-.simpleTree li span
-{
- display:inline;
- clear: left;
- white-space: nowrap;
-}
-.simpleTree ul
-{
- margin:0;
- padding:0;
-}
-.simpleTree .root
-{
- margin-left:-16px;
- background: url(images/root.gif) no-repeat 16px 0 #ffffff;
-}
-.simpleTree .line
-{
- margin:0 0 0 -16px;
- padding:0;
- line-height: 3px;
- height:3px;
- font-size:3px;
- background: url(images/line_bg.gif) 0 0 no-repeat transparent;
-}
-.simpleTree .line-last
-{
- margin:0 0 0 -16px;
- padding:0;
- line-height: 3px;
- height:3px;
- font-size:3px;
- background: url(images/spacer.gif) 0 0 no-repeat transparent;
-}
-.simpleTree .line-over
-{
- margin:0 0 0 -16px;
- padding:0;
- line-height: 3px;
- height:3px;
- font-size:3px;
- background: url(images/line_bg_over.gif) 0 0 no-repeat transparent;
-}
-.simpleTree .line-over-last
-{
- margin:0 0 0 -16px;
- padding:0;
- line-height: 3px;
- height:3px;
- font-size:3px;
- background: url(images/line_bg_over_last.gif) 0 0 no-repeat transparent;
-}
-.simpleTree .folder-open
-{
- margin-left:-16px;
- background: url(images/collapsable.gif) 0 -2px no-repeat #fff;
-}
-.simpleTree .folder-open-last
-{
- margin-left:-16px;
- background: url(images/collapsable-last.gif) 0 -2px no-repeat #fff;
-}
-.simpleTree .folder-close
-{
- margin-left:-16px;
- background: url(images/expandable.gif) 0 -2px no-repeat #fff;
-}
-.simpleTree .folder-close-last
-{
- margin-left:-16px;
- background: url(images/expandable-last.gif) 0 -2px no-repeat #fff;
-}
-.simpleTree .doc
-{
- margin-left:-16px;
- background: url(images/leaf.gif) 0 -1px no-repeat #fff;
-}
-.simpleTree .doc-last
-{
- margin-left:-16px;
- background: url(images/leaf-last.gif) 0 -1px no-repeat #fff;
-}
-.simpleTree .ajax
-{
- background: url(images/spinner.gif) no-repeat 0 0 #ffffff;
- height: 16px;
- display:none;
-}
-.simpleTree .ajax li
-{
- display:none;
- margin:0;
- padding:0;
-}
-.simpleTree .trigger
-{
- display:inline;
- margin-left:-32px;
- width: 28px;
- height: 11px;
- cursor:pointer;
-}
-.simpleTree .text
-{
- cursor: default;
-}
-.simpleTree .active
-{
- cursor: default;
- background-color:#F7BE77;
- padding:0px 2px;
- border: 1px dashed #444;
-}
-#drag_container
-{
- background:#ffffff;
- color:#000;
- font: normal 11px arial, tahoma, helvetica, sans-serif;
- border: 1px dashed #767676;
-}
-#drag_container ul
-{
- list-style: none;
- padding:0;
- margin:0;
-}
-
-#drag_container li
-{
- list-style: none;
- background-color:#ffffff;
- line-height:18px;
- white-space: nowrap;
- padding:1px 1px 0px 16px;
- margin:0;
-}
-#drag_container li span
-{
- padding:0;
-}
-
-#drag_container li.doc, #drag_container li.doc-last
-{
- background: url(images/leaf.gif) no-repeat -17px 0 #ffffff;
-}
-#drag_container .folder-close, #drag_container .folder-close-last
-{
- background: url(images/expandable.gif) no-repeat -17px 0 #ffffff;
-}
-
-#drag_container .folder-open, #drag_container .folder-open-last
-{
- background: url(images/collapsable.gif) no-repeat -17px 0 #ffffff;
-}
-.contextMenu
-{
- display:none;
-}
-</style>
-<script type="text/javascript" src="js/jquery.js"></script>
-<script type="text/javascript" src="js/jquery.simple.tree.js"></script>
-<script type="text/javascript">
-var simpleTreeCollection;
-$(document).ready(function(){
- simpleTreeCollection = $('.simpleTree').simpleTree({
- autoclose: true,
- afterClick:function(node){
- //alert("text-"+$('span:first',node).text());
- },
- afterDblClick:function(node){
- //alert("text-"+$('span:first',node).text());
- },
- afterMove:function(destination, source, pos){
- //alert("destination-"+destination.attr('id')+" source-"+source.attr('id')+" pos-"+pos);
- },
- afterAjax:function()
- {
- //alert('Loaded');
- },
- animate:true
- //,docToFolderConvert:true
- });
-});
-</script>
-</head>
-
-<body>
-<div class="contextMenu" id="myMenu1">
- <ul>
- <li id="add"><img src="images/folder_add.png" /> Add child</li>
- <li id="reload"><img src="images/arrow_refresh.png" /> Reload</li>
- <li id="edit"><img src="images/folder_edit.png" /> Edit</li>
- <li id="delete"><img src="images/folder_delete.png" /> Delete</li>
- </ul>
-</div>
-<div class="contextMenu" id="myMenu2">
- <ul>
- <li id="edit"><img src="images/page_edit.png" /> Edit</li>
- <li id="delete"><img src="images/page_delete.png" /> Delete</li>
- </ul>
-</div>
-<ul class="simpleTree">
- <li class="root" id='1'><span>Tree Root 1</span>
- <ul>
-
- <li class="open" id='2'><span>Tree Node 1</span>
- <ul>
-
- <li id='3'><span>Tree Node 1-1</span>
- <ul class="ajax">
- <li id='4'>{url:loadTree.php?tree_id=1}</li>
- </ul>
- </li>
-
- </ul>
- </li>
-
- <li id='5'><span>Tree Node 2</span>
- <ul>
-
- <li id='6'><span>Tree Node 2-1</span>
- <ul>
-
- <li id='7'><span>Tree Node 2-1-1</span></li>
-
- <li id='8'><span>Tree Node 2-1-2</span></li>
-
- <li id='9'><span>Tree Node 2-1-3</span></li>
-
- <li id='10'><span>Tree Node 2-1-4</span>
- <ul class="ajax">
- <li id='11'>{url:loadTree.php?tree_id=1}</li>
- </ul>
- </li>
-
- </ul>
- </li>
-
- <li id='12'><span>Tree Node 2-2</span>
- <ul>
-
- <li id='13'><span>Tree Node 2-2-1</span></li>
-
- </ul>
- </li>
-
-
- <li id='14'><span>Tree Node 2-3</span>
- <ul>
-
- <li id='15'><span>Tree Node 2-3-1</span>
- <ul>
-
- <li id='16'><span>Tree Node 2-3-1-1</span></li>
-
- <li id='17'><span>Tree Node 2-3-1-2</span></li>
-
- <li id='18'><span>Tree Node 2-3-1-3</span>
- <ul>
-
- <li id='19'><span>Tree Node 2-3-1-3-1</span></li>
-
- </ul>
- </li>
-
- <li id='20'><span>Tree Node 2-3-1-4</span></li>
-
- <li id='21'><span>Tree Node 2-3-1-5</span></li>
-
- <li id='22'><span>Tree Node 2-3-1-6</span>
- <ul>
-
- <li id='23'><span>Tree Node 2-3-1-6-1</span></li>
-
- </ul>
- </li>
-
- <li id='24'><span>Tree Node 2-3-1-7</span></li>
-
- <li id='25'><span>Tree Node 2-3-1-8</span></li>
-
- <li id='26'><span>Tree Node 2-3-1-9</span>
- <ul>
-
- <li id='27'><span>Tree Node 2-3-1-9-1</span></li>
-
- </ul>
- </li>
-
- </ul>
- </li>
-
- </ul>
- </li>
-
- </ul>
- </li>
-
- </ul>
- </li>
-</ul>
-
-</body>
-
-</html>
diff --git a/modules/rearrange/js/jquery.gallery.rearrange.tree.js b/modules/rearrange/js/jquery.gallery.rearrange.tree.js
new file mode 100644
index 00000000..875873ab
--- /dev/null
+++ b/modules/rearrange/js/jquery.gallery.rearrange.tree.js
@@ -0,0 +1,90 @@
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2008 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * This script is based on the
+ * jQuery File Tree Plugin,
+ * developed by Cory S.N. LaViska
+ * A Beautiful Site (http://abeautifulsite.net/)
+ * Originally released under a Creative Commons License and is copyrighted
+ * (C)2008 by Cory S.N. LaViska.
+ * For details, visit http://creativecommons.org/licenses/by/3.0/us/
+ *
+ */
+if(jQuery) (function($){
+
+ $.extend($.fn, {
+ RearrangeTree: function(o, h) {
+ // Defaults
+ if( !o ) var o = {};
+ if( o.root == undefined ) o.root = '/1';
+ if( o.script == undefined ) o.script = 'rearrange';
+ if( o.folderEvent == undefined ) o.folderEvent = 'click';
+ if( o.expandSpeed == undefined ) o.expandSpeed= 500;
+ if( o.collapseSpeed == undefined ) o.collapseSpeed= 500;
+ if( o.expandEasing == undefined ) o.expandEasing = null;
+ if( o.collapseEasing == undefined ) o.collapseEasing = null;
+ if( o.multiFolder == undefined ) o.multiFolder = true;
+ if( o.loadMessage == undefined ) o.loadMessage = 'Loading...';
+
+ $(this).each( function() {
+
+ function showTree(c, t) {
+ $(c).addClass('wait');
+ $(".jqueryFileTree.start").remove();
+ $.get(o.script + "/" + t, {}, function(data) {
+ $(c).find('.start').html('');
+ $(c).removeClass('wait').append(data);
+ if( o.root == t ) $(c).find('UL:hidden').show(); else $(c).find('UL:hidden').slideDown({ duration: o.expandSpeed, easing: o.expandEasing });
+ bindTree(c);
+ });
+ }
+
+ function bindTree(t) {
+ $(t).find('LI A').bind(o.folderEvent, function() {
+ if( $(this).parent().hasClass('directory') ) {
+ if( $(this).parent().hasClass('collapsed') ) {
+ // Expand
+ if( !o.multiFolder ) {
+ $(this).parent().parent().find('UL').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing });
+ $(this).parent().parent().find('LI.directory').removeClass('expanded').addClass('collapsed');
+ }
+ $(this).parent().find('UL').remove(); // cleanup
+ showTree( $(this).parent(), escape($(this).attr('rel')) );
+ $(this).parent().removeClass('collapsed').addClass('expanded');
+ } else {
+ // Collapse
+ $(this).parent().find('UL').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing });
+ $(this).parent().removeClass('expanded').addClass('collapsed');
+ }
+ } else {
+ h($(this).attr('rel'));
+ }
+ return false;
+ });
+ // Prevent A from triggering the # on non-click events
+ if( o.folderEvent.toLowerCase != 'click' ) $(t).find('LI A').bind('click', function() { return false; });
+ }
+ // Loading message
+ $(this).html('<ul class="jqueryFileTree start"><li class="wait">' + o.loadMessage + '<li></ul>');
+ // Get the initial file list
+ showTree( $(this), "" );
+ });
+ }
+ });
+
+})(jQuery); \ No newline at end of file
diff --git a/modules/rearrange/js/jquery.simple.tree.js b/modules/rearrange/js/jquery.simple.tree.js
deleted file mode 100644
index 8e3bc783..00000000
--- a/modules/rearrange/js/jquery.simple.tree.js
+++ /dev/null
@@ -1,451 +0,0 @@
-/*
-* jQuery SimpleTree Drag&Drop plugin
-* Update on 22th May 2008
-* Version 0.3
-*
-* Licensed under BSD <http://en.wikipedia.org/wiki/BSD_License>
-* Copyright (c) 2008, Peter Panov <panov@elcat.kg>, IKEEN Group http://www.ikeen.com
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-* * Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* * Redistributions in binary form must reproduce the above copyright
-* notice, this list of conditions and the following disclaimer in the
-* documentation and/or other materials provided with the distribution.
-* * Neither the name of the Peter Panov, IKEEN Group nor the
-* names of its contributors may be used to endorse or promote products
-* derived from this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY Peter Panov, IKEEN Group ``AS IS'' AND ANY
-* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-* DISCLAIMED. IN NO EVENT SHALL Peter Panov, IKEEN Group BE LIABLE FOR ANY
-* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-$.fn.simpleTree = function(opt){
- return this.each(function(){
- var TREE = this;
- var ROOT = $('.root',this);
- var mousePressed = false;
- var mouseMoved = false;
- var dragMoveType = false;
- var dragNode_destination = false;
- var dragNode_source = false;
- var dragDropTimer = false;
- var ajaxCache = Array();
-
- TREE.option = {
- drag: true,
- animate: false,
- autoclose: false,
- speed: 'fast',
- afterAjax: false,
- afterMove: false,
- afterClick: false,
- afterDblClick: false,
- // added by Erik Dohmen (2BinBusiness.nl) to make context menu cliks available
- afterContextMenu: false,
- docToFolderConvert:false
- };
- TREE.option = $.extend(TREE.option,opt);
- $.extend(this, {getSelected: function(){
- return $('span.active', this).parent();
- }});
- TREE.closeNearby = function(obj)
- {
- $(obj).siblings().filter('.folder-open, .folder-open-last').each(function(){
- var childUl = $('>ul',this);
- var className = this.className;
- this.className = className.replace('open','close');
- if(TREE.option.animate)
- {
- childUl.animate({height:"toggle"},TREE.option.speed);
- }else{
- childUl.hide();
- }
- });
- };
- TREE.nodeToggle = function(obj)
- {
- var childUl = $('>ul',obj);
- if(childUl.is(':visible')){
- obj.className = obj.className.replace('open','close');
-
- if(TREE.option.animate)
- {
- childUl.animate({height:"toggle"},TREE.option.speed);
- }else{
- childUl.hide();
- }
- }else{
- obj.className = obj.className.replace('close','open');
- if(TREE.option.animate)
- {
- childUl.animate({height:"toggle"},TREE.option.speed, function(){
- if(TREE.option.autoclose)TREE.closeNearby(obj);
- if(childUl.is('.ajax'))TREE.setAjaxNodes(childUl, obj.id);
- });
- }else{
- childUl.show();
- if(TREE.option.autoclose)TREE.closeNearby(obj);
- if(childUl.is('.ajax'))TREE.setAjaxNodes(childUl, obj.id);
- }
- }
- };
- TREE.setAjaxNodes = function(node, parentId, callback)
- {
- if($.inArray(parentId,ajaxCache) == -1){
- ajaxCache[ajaxCache.length]=parentId;
- var url = $.trim($('>li', node).text());
- if(url && url.indexOf('url:'))
- {
- url=$.trim(url.replace(/.*\{url:(.*)\}/i ,'$1'));
- $.ajax({
- type: "GET",
- url: url,
- contentType:'html',
- cache:false,
- success: function(responce){
- node.removeAttr('class');
- node.html(responce);
- $.extend(node,{url:url});
- TREE.setTreeNodes(node, true);
- if(typeof TREE.option.afterAjax == 'function')
- {
- TREE.option.afterAjax(node);
- }
- if(typeof callback == 'function')
- {
- callback(node);
- }
- }
- });
- }
-
- }
- };
- TREE.setTreeNodes = function(obj, useParent){
- obj = useParent? obj.parent():obj;
- $('li>span', obj).addClass('text')
- .bind('selectstart', function() {
- return false;
- }).click(function(){
- $('.active',TREE).attr('class','text');
- if(this.className=='text')
- {
- this.className='active';
- }
- if(typeof TREE.option.afterClick == 'function')
- {
- TREE.option.afterClick($(this).parent());
- }
- return false;
- }).dblclick(function(){
- mousePressed = false;
- TREE.nodeToggle($(this).parent().get(0));
- if(typeof TREE.option.afterDblClick == 'function')
- {
- TREE.option.afterDblClick($(this).parent());
- }
- return false;
- // added by Erik Dohmen (2BinBusiness.nl) to make context menu actions
- // available
- }).bind("contextmenu",function(){
- $('.active',TREE).attr('class','text');
- if(this.className=='text')
- {
- this.className='active';
- }
- if(typeof TREE.option.afterContextMenu == 'function')
- {
- TREE.option.afterContextMenu($(this).parent());
- }
- return false;
- }).mousedown(function(event){
- mousePressed = true;
- cloneNode = $(this).parent().clone();
- var LI = $(this).parent();
- if(TREE.option.drag)
- {
- $('>ul', cloneNode).hide();
- $('body').append('<div id="drag_container"><ul></ul></div>');
- $('#drag_container').hide().css({opacity:'0.8'});
- $('#drag_container >ul').append(cloneNode);
- $("<img>").attr({id : "tree_plus",src : "images/plus.gif"}).css({width: "7px",display: "block",position: "absolute",left : "5px",top: "5px", display:'none'}).appendTo("body");
- $(document).bind("mousemove", {LI:LI}, TREE.dragStart).bind("mouseup",TREE.dragEnd);
- }
- return false;
- }).mouseup(function(){
- if(mousePressed && mouseMoved && dragNode_source)
- {
- TREE.moveNodeToFolder($(this).parent());
- }
- TREE.eventDestroy();
- });
- $('li', obj).each(function(i){
- var className = this.className;
- var open = false;
- var cloneNode=false;
- var LI = this;
- var childNode = $('>ul',this);
- if(childNode.size()>0){
- var setClassName = 'folder-';
- if(className && className.indexOf('open')>=0){
- setClassName=setClassName+'open';
- open=true;
- }else{
- setClassName=setClassName+'close';
- }
- this.className = setClassName + ($(this).is(':last-child')? '-last':'');
-
- if(!open || className.indexOf('ajax')>=0)childNode.hide();
-
- TREE.setTrigger(this);
- }else{
- var setClassName = 'doc';
- this.className = setClassName + ($(this).is(':last-child')? '-last':'');
- }
- }).before('<li class="line">&nbsp;</li>')
- .filter(':last-child').after('<li class="line-last"></li>');
- TREE.setEventLine($('.line, .line-last', obj));
- };
- TREE.setTrigger = function(node){
- $('>span',node).before('<img class="trigger" src="images/spacer.gif" border=0>');
- var trigger = $('>.trigger', node);
- trigger.click(function(event){
- TREE.nodeToggle(node);
- });
- if(!$.browser.msie)
- {
- trigger.css('float','left');
- }
- };
- TREE.dragStart = function(event){
- var LI = $(event.data.LI);
- if(mousePressed)
- {
- mouseMoved = true;
- if(dragDropTimer) clearTimeout(dragDropTimer);
- if($('#drag_container:not(:visible)')){
- $('#drag_container').show();
- LI.prev('.line').hide();
- dragNode_source = LI;
- }
- $('#drag_container').css({position:'absolute', "left" : (event.pageX + 5), "top": (event.pageY + 15) });
- if(LI.is(':visible'))LI.hide();
- var temp_move = false;
- if(event.target.tagName.toLowerCase()=='span' && $.inArray(event.target.className, Array('text','active','trigger'))!= -1)
- {
- var parent = event.target.parentNode;
- var offs = $(parent).offset({scroll:false});
- var screenScroll = {x : (offs.left - 3),y : event.pageY - offs.top};
- var isrc = $("#tree_plus").attr('src');
- var ajaxChildSize = $('>ul.ajax',parent).size();
- var ajaxChild = $('>ul.ajax',parent);
- screenScroll.x += 19;
- screenScroll.y = event.pageY - screenScroll.y + 5;
-
- if(parent.className.indexOf('folder-close')>=0 && ajaxChildSize==0)
- {
- if(isrc.indexOf('minus')!=-1)$("#tree_plus").attr('src','images/plus.gif');
- $("#tree_plus").css({"left": screenScroll.x, "top": screenScroll.y}).show();
- dragDropTimer = setTimeout(function(){
- parent.className = parent.className.replace('close','open');
- $('>ul',parent).show();
- }, 700);
- }else if(parent.className.indexOf('folder')>=0 && ajaxChildSize==0){
- if(isrc.indexOf('minus')!=-1)$("#tree_plus").attr('src','images/plus.gif');
- $("#tree_plus").css({"left": screenScroll.x, "top": screenScroll.y}).show();
- }else if(parent.className.indexOf('folder-close')>=0 && ajaxChildSize>0)
- {
- mouseMoved = false;
- $("#tree_plus").attr('src','images/minus.gif');
- $("#tree_plus").css({"left": screenScroll.x, "top": screenScroll.y}).show();
-
- $('>ul',parent).show();
- /*
- Thanks for the idea of Erik Dohmen
- */
- TREE.setAjaxNodes(ajaxChild,parent.id, function(){
- parent.className = parent.className.replace('close','open');
- mouseMoved = true;
- $("#tree_plus").attr('src','images/plus.gif');
- $("#tree_plus").css({"left": screenScroll.x, "top": screenScroll.y}).show();
- });
-
- }else{
- if(TREE.option.docToFolderConvert)
- {
- $("#tree_plus").css({"left": screenScroll.x, "top": screenScroll.y}).show();
- }else{
- $("#tree_plus").hide();
- }
- }
- }else{
- $("#tree_plus").hide();
- }
- return false;
- }
- return true;
- };
- TREE.dragEnd = function(){
- if(dragDropTimer) clearTimeout(dragDropTimer);
- TREE.eventDestroy();
- };
- TREE.setEventLine = function(obj){
- obj.mouseover(function(){
- if(this.className.indexOf('over')<0 && mousePressed && mouseMoved)
- {
- this.className = this.className.replace('line','line-over');
- }
- }).mouseout(function(){
- if(this.className.indexOf('over')>=0)
- {
- this.className = this.className.replace('-over','');
- }
- }).mouseup(function(){
- if(mousePressed && dragNode_source && mouseMoved)
- {
- dragNode_destination = $(this).parents('li:first');
- TREE.moveNodeToLine(this);
- TREE.eventDestroy();
- }
- });
- };
- TREE.checkNodeIsLast = function(node)
- {
- if(node.className.indexOf('last')>=0)
- {
- var prev_source = dragNode_source.prev().prev();
- if(prev_source.size()>0)
- {
- prev_source[0].className+='-last';
- }
- node.className = node.className.replace('-last','');
- }
- };
- TREE.checkLineIsLast = function(line)
- {
- if(line.className.indexOf('last')>=0)
- {
- var prev = $(line).prev();
- if(prev.size()>0)
- {
- prev[0].className = prev[0].className.replace('-last','');
- }
- dragNode_source[0].className+='-last';
- }
- };
- TREE.eventDestroy = function()
- {
- // added by Erik Dohmen (2BinBusiness.nl), the unbind mousemove TREE.dragStart action
- // like this other mousemove actions binded through other actions ain't removed (use it myself
- // to determine location for context menu)
- $(document).unbind('mousemove',TREE.dragStart).unbind('mouseup').unbind('mousedown');
- $('#drag_container, #tree_plus').remove();
- if(dragNode_source)
- {
- $(dragNode_source).show().prev('.line').show();
- }
- dragNode_destination = dragNode_source = mousePressed = mouseMoved = false;
- //ajaxCache = Array();
- };
- TREE.convertToFolder = function(node){
- node[0].className = node[0].className.replace('doc','folder-open');
- node.append('<ul><li class="line-last"></li></ul>');
- TREE.setTrigger(node[0]);
- TREE.setEventLine($('.line, .line-last', node));
- };
- TREE.convertToDoc = function(node){
- $('>ul', node).remove();
- $('img', node).remove();
- node[0].className = node[0].className.replace(/folder-(open|close)/gi , 'doc');
- };
- TREE.moveNodeToFolder = function(node)
- {
- if(!TREE.option.docToFolderConvert && node[0].className.indexOf('doc')!=-1)
- {
- return true;
- }else if(TREE.option.docToFolderConvert && node[0].className.indexOf('doc')!=-1){
- TREE.convertToFolder(node);
- }
- TREE.checkNodeIsLast(dragNode_source[0]);
- var lastLine = $('>ul >.line-last', node);
- if(lastLine.size()>0)
- {
- TREE.moveNodeToLine(lastLine[0]);
- }
- };
- TREE.moveNodeToLine = function(node){
- TREE.checkNodeIsLast(dragNode_source[0]);
- TREE.checkLineIsLast(node);
- var parent = $(dragNode_source).parents('li:first');
- var line = $(dragNode_source).prev('.line');
- $(node).before(dragNode_source);
- $(dragNode_source).before(line);
- node.className = node.className.replace('-over','');
- var nodeSize = $('>ul >li', parent).not('.line, .line-last').filter(':visible').size();
- if(TREE.option.docToFolderConvert && nodeSize==0)
- {
- TREE.convertToDoc(parent);
- }else if(nodeSize==0)
- {
- parent[0].className=parent[0].className.replace('open','close');
- $('>ul',parent).hide();
- }
-
- // added by Erik Dohmen (2BinBusiness.nl) select node
- if($('span:first',dragNode_source).attr('class')=='text')
- {
- $('.active',TREE).attr('class','text');
- $('span:first',dragNode_source).attr('class','active');
- }
-
- if(typeof(TREE.option.afterMove) == 'function')
- {
- var pos = $(dragNode_source).prevAll(':not(.line)').size();
- TREE.option.afterMove($(node).parents('li:first'), $(dragNode_source), pos);
- }
- };
-
- TREE.addNode = function(id, text, callback)
- {
- var temp_node = $('<li><ul><li id="'+id+'"><span>'+text+'</span></li></ul></li>');
- TREE.setTreeNodes(temp_node);
- dragNode_destination = TREE.getSelected();
- dragNode_source = $('.doc-last',temp_node);
- TREE.moveNodeToFolder(dragNode_destination);
- temp_node.remove();
- if(typeof(callback) == 'function')
- {
- callback(dragNode_destination, dragNode_source);
- }
- };
- TREE.delNode = function(callback)
- {
- dragNode_source = TREE.getSelected();
- TREE.checkNodeIsLast(dragNode_source[0]);
- dragNode_source.prev().remove();
- dragNode_source.remove();
- if(typeof(callback) == 'function')
- {
- callback(dragNode_destination);
- }
- };
-
- TREE.init = function(obj)
- {
- TREE.setTreeNodes(obj, false);
- };
- TREE.init(ROOT);
- });
-} \ No newline at end of file
diff --git a/modules/rearrange/js/rearrange_tree.js b/modules/rearrange/js/rearrange_tree.js
deleted file mode 100644
index e69de29b..00000000
--- a/modules/rearrange/js/rearrange_tree.js
+++ /dev/null
diff --git a/modules/rearrange/loadTree.php b/modules/rearrange/loadTree.php
deleted file mode 100644
index a13faae9..00000000
--- a/modules/rearrange/loadTree.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<li id='35'><span class="text">Tree Node Ajax 1</span></li>
-<li id='36'><span class="text">Tree Node Ajax 2</span></li>
-<li id='37'><span class="text">Tree Node Ajax 3</span>
- <ul>
- <li id='38'><span class="text">Tree Node Ajax 3-1</span>
- <ul>
- <li id='39'><span class="text">Tree Node Ajax 3-1-1</span></li>
- <li id='40'><span class="text">Tree Node Ajax 3-1-2</span></li>
- <li id='41'><span class="text">Tree Node Ajax 3-1-3</span></li>
- <li id='42'><span class="text">Tree Node Ajax 3-1-4</span></li>
- </ul>
- </li>
- <li id='43'><span class="text">Tree Node Ajax 3-2</span></li>
- <li id='44'><span class="text">Tree Node Ajax 3-3</span>
- <ul>
- <li id='45'><span class="text">Tree Node Ajax 3-3-1</span></li>
- <li id='46'><span class="text">Tree Node Ajax 3-3-2</span></li>
- <li id='47'><span class="text">Tree Node Ajax 3-3-3</span></li>
- </ul>
- </li>
- <li id='48'><span class="text">Tree Node Ajax 3-4</span></li>
- <li id='49'><span class="text">Tree Node Ajax 3-5</span>
- <ul>
- <li id='50'><span class="text">Tree Node Ajax 3-5-1</span></li>
- <li id='51'><span class="text">Tree Node Ajax 3-5-2</span></li>
- <li id='52'><span class="text">Tree Node Ajax 3-5-3</span></li>
- </ul>
- </li>
- <li id='53'><span class="text">Tree Node Ajax 3-6</span></li>
- </ul>
-</li>
-<li id='54'><span class="text">Tree Node Ajax 4</span></li> \ No newline at end of file
diff --git a/modules/rearrange/views/rearrange.html.php b/modules/rearrange/views/rearrange.html.php
index 64b711ff..22e3399e 100644
--- a/modules/rearrange/views/rearrange.html.php
+++ b/modules/rearrange/views/rearrange.html.php
@@ -1,44 +1,8 @@
<?php defined("SYSPATH") or die("No direct script access."); ?>
-
-<? if ($root): ?>
- <script>
- var simpleTree_Rearrange;
- $(document).ready(function() {
- simpleTree_Rearrange = $(".simpleTree").simpleTree({
- autoclose: false,
- animate: true,
- afterClick:function(node) {
- alert("text-"+$('span:first', node).text());
- },
- afterDblClick:function(node) {
- alert("text-"+$('span:first', node).text());
- },
- afterMove:function(destination, source, pos) {
- alert("destination: "+destination.attr('id') + "\n" +
- "source: "+source.attr('id') + "\n" +
- "pos: " + pos);
- },
- afterAjax:function() {
- }
- });
- });
- </script>
- <ul class="simpleTree">
- <li class="root" id="<?= $root->id?>"><span><?= $root->title?></span>
-<? endif; ?>
-<ul>
- <? foreach ($children as $child): ?>
- <li id="<?= $child->id?>"><span class="text"><?= $child->title?></span>
- <? if ($child->type == "album"): ?>
- <ul class="ajax">
- <li><?= url::site("rearrange/$child->id") ?></li>
- </ul>
- <? endif; ?>
- </li>
- <? endforeach;?>
-</ul>
-<? if ($root): ?>
- </li>
- </ul>
-<? endif; ?>
-
+<div id="gRearrange">
+ <span id="gAddAlbum">New Album</span>
+ &nbsp;
+ <span id="gDeleteItem">Delete</span>
+ <hr/>
+ <div id="gRearrangeTree" />
+</div
diff --git a/modules/rearrange/views/rearrange_item_list.html.php b/modules/rearrange/views/rearrange_item_list.html.php
new file mode 100644
index 00000000..52881fa1
--- /dev/null
+++ b/modules/rearrange/views/rearrange_item_list.html.php
@@ -0,0 +1,13 @@
+<?php defined("SYSPATH") or die("No direct script access."); ?>
+<ul class="jqueryFileTree" style="display: none">
+ <? foreach ($children as $item): ?>
+ <? if ($item->type == "album"): ?>
+ <li class="directory <?= $item->children_count() > 0 ? "collapsed" : "" ?>" id="<?= $item->id?>">
+ <a href="#" rel="<?= $item->id?>"><?= $item->title?></a>
+ </li>
+ <? else: ?>
+ <li class="file item" id="<?= $item->id?>"><a href="#" rel="<?= $item->id?>"><?= $item->title?></a>
+ </li>
+ <? endif; ?>
+ <? endforeach;?>
+</ul>