From 4766f36a4d74924f21ff329c4318ce4e069ffa04 Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 3 Mar 2010 17:53:05 +0000 Subject: Pulled in the interface changes. git-svn-id: http://code.elgg.org/elgg/trunk@5257 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../views/default/pages/sidebar/sidebarthis.php | 92 ++++++++++++++++++++++ mod/pages/views/default/pages/sidebar/starter.php | 21 +++++ mod/pages/views/default/pages/sidebar/tree.php | 8 ++ mod/pages/views/default/pages/sidebar/wrapper.php | 7 ++ 4 files changed, 128 insertions(+) create mode 100644 mod/pages/views/default/pages/sidebar/sidebarthis.php create mode 100644 mod/pages/views/default/pages/sidebar/starter.php create mode 100644 mod/pages/views/default/pages/sidebar/tree.php create mode 100644 mod/pages/views/default/pages/sidebar/wrapper.php (limited to 'mod/pages/views/default/pages/sidebar') diff --git a/mod/pages/views/default/pages/sidebar/sidebarthis.php b/mod/pages/views/default/pages/sidebar/sidebarthis.php new file mode 100644 index 000000000..47a262501 --- /dev/null +++ b/mod/pages/views/default/pages/sidebar/sidebarthis.php @@ -0,0 +1,92 @@ +[parent_guid; + + $currentpage = (int) get_input('currentpage'); + if ($currentpage) { + + $path = pages_get_path($currentpage); + $pathstring = implode(',',$path); + + } else { + $path = array(); + } + + function pages_draw_child($childentity, $path) { + + $child = "\n\t\t{\n"; + $child .= "\t\t\t\"text\": \"getURL()}\\\">" . addslashes($childentity->title) . "\"\n"; + + $extras = ""; + $haschild = elgg_get_entities_from_metadata(array('metadata_name' => 'parent_guid', 'metadata_value' => $childentity->guid, 'limit' => 9999)); + if ($haschild) { + if (in_array($childentity->guid,$path)) { + $extras .= "\t\t\t,\"expanded\": true"; + $extras .= "\t\t\t,\"children\": [\n"; + + $childstring = ""; + foreach($haschild as $subchild) { + $childstringtemp = pages_draw_child($subchild,$path); + if (!empty($childstringtemp)) { + if (!empty($childstring)) $childstring .= ", "; + $childstring .= $childstringtemp; + } + } + + $extras .= $childstring . "\n\t\t\t]\n"; + } else { + $extras .= ",\t\t\t\"id\": \"{$childentity->getGUID()}\",\n\t\t\t\"hasChildren\": true\n"; + } + + } + $child .= $extras . "\t\t}"; + return $child; + } + + if (!$parent) { + echo "{\n"; + echo "\t\"text\": \"getURL()}\\\">" . addslashes($vars['entity']->title) . "\"\n"; + } + + $children = ""; + $temp = ""; + if (isset($vars['children']) && is_array($vars['children']) && (!isset($vars['fulltree']) || $vars['fulltree'] == 0)) { + if (!$parent) $temp .= "\t" . '"expanded": true,' . "\n"; + if (!$parent) $temp .= "\t" . '"children": [' . "\n"; + foreach($vars['children'] as $child) { + $childrentemp = pages_draw_child($child,$path); + if (!empty($childrentemp)) { + if (!empty($children)) $children .= ", \n"; + $children .= $childrentemp; + } + /* + $children .= "\n\t\t{\n"; + $children .= "\t\t\t\"text\": \"getURL()}\\\">{$child->title}\",\n"; + + $haschild = get_entities_from_metadata('parent_guid',$child->guid,'','',0,10,0,'',0,true); + if ($haschild) { + $children .= "\t\t\t\"id\": \"{$child->getGUID()}\",\n\t\t\t\"hasChildren\": true\n"; + } + $children .= "\t\t}"; + */ + } + if (!empty($temp)) echo ',' . $temp; + echo $children; + if (!$parent) echo "\t\t" . ']' . "\n"; + + } + + if (!$parent) echo "}"; + +?>] \ No newline at end of file diff --git a/mod/pages/views/default/pages/sidebar/starter.php b/mod/pages/views/default/pages/sidebar/starter.php new file mode 100644 index 000000000..4734ca929 --- /dev/null +++ b/mod/pages/views/default/pages/sidebar/starter.php @@ -0,0 +1,21 @@ + + + + + \ No newline at end of file diff --git a/mod/pages/views/default/pages/sidebar/tree.php b/mod/pages/views/default/pages/sidebar/tree.php new file mode 100644 index 000000000..c83e3f682 --- /dev/null +++ b/mod/pages/views/default/pages/sidebar/tree.php @@ -0,0 +1,8 @@ + + +
\ No newline at end of file diff --git a/mod/pages/views/default/pages/sidebar/wrapper.php b/mod/pages/views/default/pages/sidebar/wrapper.php new file mode 100644 index 000000000..ed21b4dd6 --- /dev/null +++ b/mod/pages/views/default/pages/sidebar/wrapper.php @@ -0,0 +1,7 @@ + \ No newline at end of file -- cgit v1.2.3