aboutsummaryrefslogtreecommitdiff
path: root/mod/pages/views
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-22 20:33:28 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-22 20:33:28 +0000
commit8423cda014c6aee9fb3a3f7ebe78bc0465e7355f (patch)
treee1baa523308221d33908e4ea4014191ade8d5d66 /mod/pages/views
parentcec8a4f34681d4c2a43e0c07de0a68bc22f1b558 (diff)
downloadelgg-8423cda014c6aee9fb3a3f7ebe78bc0465e7355f.tar.gz
elgg-8423cda014c6aee9fb3a3f7ebe78bc0465e7355f.tar.bz2
finished the first pass on the pages plugin for using the new HTML/CSS
git-svn-id: http://code.elgg.org/elgg/trunk@7904 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/pages/views')
-rw-r--r--mod/pages/views/default/pages/css.php139
-rw-r--r--mod/pages/views/default/pages/metatags.php27
-rw-r--r--mod/pages/views/default/pages/sidebar/history.php19
-rw-r--r--mod/pages/views/default/pages/sidebar/navigation.php42
-rw-r--r--mod/pages/views/default/pages/sidebar/sidebarthis.php88
-rw-r--r--mod/pages/views/default/pages/sidebar/starter.php19
-rw-r--r--mod/pages/views/default/pages/sidebar/tree.php12
-rw-r--r--mod/pages/views/default/pages/sidebar/wrapper.php10
8 files changed, 67 insertions, 289 deletions
diff --git a/mod/pages/views/default/pages/css.php b/mod/pages/views/default/pages/css.php
index 245c39b47..24e45cb9d 100644
--- a/mod/pages/views/default/pages/css.php
+++ b/mod/pages/views/default/pages/css.php
@@ -6,141 +6,14 @@
*/
?>
-.pages-nav .elgg-child-menu {
- display: none;
- margin-left: 15px;
+.pages-nav.treeview ul {
+ background-color: transparent;
}
-.treeview, .treeview ul {
- padding: 0;
- margin: 0;
- list-style: none;
+.pages-nav.treeview a.selected {
+ color: #555555;
}
-.treeview ul {
- background-color: white;
- margin-top: 4px;
-}
-
-.treeview .hitarea {
- background: url(<?php echo elgg_get_site_url(); ?>mod/pages/images/treeview-default.gif) -64px -25px no-repeat;
- height: 16px;
- width: 16px;
- margin-left: -16px;
- float: left;
- cursor: pointer;
-}
-/* fix for IE6 */
-* html .hitarea {
- display: inline;
- float:none;
-}
-
-.treeview li {
- margin: 0;
- padding: 3px 0pt 3px 16px;
-}
-
-.treeview a.selected {
- background-color: #eee;
-}
-
-#treecontrol { margin: 1em 0; display: none; }
-
-.treeview .hover { color: red; cursor: pointer; }
-
-.treeview li { background: url(<?php echo elgg_get_site_url(); ?>mod/pages/images/treeview-default-line.gif) 0 0 no-repeat; }
-.treeview li.collapsable, .treeview li.expandable { background-position: 0 -176px; }
-
-.treeview .expandable-hitarea { background-position: -80px -3px; }
-
-.treeview li.last { background-position: 0 -1766px }
-.treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url(<?php echo elgg_get_site_url(); ?>mod/pages/images/treeview-default.gif); }
-.treeview li.lastCollapsable { background-position: 0 -111px }
-.treeview li.lastExpandable { background-position: -32px -67px }
-
-.treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; }
-
-.treeview-red li { background-image: url(<?php echo elgg_get_site_url(); ?>mod/pages/images/treeview-red-line.gif); }
-.treeview-red .hitarea, .treeview-red li.lastCollapsable, .treeview-red li.lastExpandable { background-image: url(<?php echo elgg_get_site_url(); ?>mod/pages/images/treeview-red.gif); }
-
-.treeview-black li { background-image: url(<?php echo elgg_get_site_url(); ?>mod/pages/images/treeview-black-line.gif); }
-.treeview-black .hitarea, .treeview-black li.lastCollapsable, .treeview-black li.lastExpandable { background-image: url(<?php echo elgg_get_site_url(); ?>mod/pages/images/treeview-black.gif); }
-
-.treeview-gray li { background-image: url(<?php echo elgg_get_site_url(); ?>mod/pages/images/treeview-gray-line.gif); }
-.treeview-gray .hitarea, .treeview-gray li.lastCollapsable, .treeview-gray li.lastExpandable { background-image: url(<?php echo elgg_get_site_url(); ?>mod/pages/images/treeview-gray.gif); }
-
-.treeview-famfamfam li { background-image: url(<?php echo elgg_get_site_url(); ?>mod/pages/images/treeview-famfamfam-line.gif); }
-.treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url(<?php echo elgg_get_site_url(); ?>mod/pages/images/treeview-famfamfam.gif); }
-
-
-.filetree li { padding: 3px 0 2px 16px; }
-.filetree span.folder, .filetree span.file { padding: 1px 0 1px 16px; display: block; }
-.filetree span.folder { background: url(<?php echo elgg_get_site_url(); ?>mod/pages/images/folder.gif) 0 0 no-repeat; }
-.filetree li.expandable span.folder { background: url(<?php echo elgg_get_site_url(); ?>mod/pages/images/folder-closed.gif) 0 0 no-repeat; }
-.filetree span.file { background: url(<?php echo elgg_get_site_url(); ?>mod/pages/images/file.gif) 0 0 no-repeat; }
-
-.pagesTreeContainer {
- margin:0;
- min-height: 200px;
-}
-
-#pages_page .strapline {
- text-align:right;
- border-top:1px solid #efefef;
- margin:10px 0 10px 0;
- color:#666666;
-}
-#pages_page .categories {
- border:none !important;
- padding:0 !important;
-}
-
-#pages_page .tags {
- padding:0 0 0 16px;
- margin:10px 0 4px 0;
- background:transparent url(<?php echo elgg_get_site_url(); ?>_graphics/icon_tag.gif) no-repeat scroll left 2px;
-}
-
-#pages_page img[align="left"] {
- margin: 10px 20px 10px 0;
- float:left;
-}
-#pages_page img[align="right"] {
- margin: 10px 0 10px 10px;
- float:right;
-}
-
-.pageswelcome p {
- margin:0 0 5px 0;
-}
-
-#sidebar_page_tree {
- background:white;
- -webkit-border-radius: 8px;
- -moz-border-radius: 8px;
- padding:10px;
- margin:0 10px 10px 10px;
-}
-#sidebar_page_tree h3 {
- background: none;
- border-top: none;
- border-bottom: 1px solid #cccccc;
- font-size:1.25em;
- line-height:1.2em;
- margin:0 0 5px 0;
- padding:0 0 5px 5px;
- color:#0054A7;
-}
-
-/* IE6 */
-* html #pages_welcome_tbl { width:676px !important;}
-
-.pages_widget_singleitem_more {
- margin:0 10px 0 10px;
- padding:5px;
- display:block;
- background:white;
- -webkit-border-radius: 8px;
- -moz-border-radius: 8px;
+.pages-nav.treeview .hover {
+ color: #0054a7;
} \ No newline at end of file
diff --git a/mod/pages/views/default/pages/metatags.php b/mod/pages/views/default/pages/metatags.php
deleted file mode 100644
index f40cc9b2d..000000000
--- a/mod/pages/views/default/pages/metatags.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-/**
- * Metatag extended view.
- *
- * @package ElggPages
- */
-
-$treeguid = get_input('treeguid');
-
-if (empty($treeguid)) {
- $treeguid = get_input('page_guid');
-}
-?>
-
-<script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>mod/pages/javascript/jquery.treeview.js" ></script>
-<script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>mod/pages/javascript/jquery.treeview.async.js" ></script>
-<script type="text/javascript">
-
- $(document).ready( function() {
-
- $("#pagesTree").treeview({
- url: "<?php echo elgg_get_site_url(); ?>mod/pages/pagesTree.php",
- currentpage: "<?php echo get_input('page_guid'); ?>"
- }, "<?php echo $treeguid; ?>")
-
- });
-</script>
diff --git a/mod/pages/views/default/pages/sidebar/history.php b/mod/pages/views/default/pages/sidebar/history.php
new file mode 100644
index 000000000..f9de2c13d
--- /dev/null
+++ b/mod/pages/views/default/pages/sidebar/history.php
@@ -0,0 +1,19 @@
+<?php
+/**
+ * History of this page
+ *
+ * @uses $vars['page']
+ */
+
+$title = elgg_echo('pages:history');
+
+if ($vars['page']) {
+ $content = $content = list_annotations($vars['page']->guid, 'page', 20, false);
+}
+
+echo elgg_view('layout/objects/module', array(
+ 'title' => $title,
+ 'body' => $content,
+ 'class' => 'elgg-aside-module',
+));
+
diff --git a/mod/pages/views/default/pages/sidebar/navigation.php b/mod/pages/views/default/pages/sidebar/navigation.php
index ddd931dab..806fc2f52 100644
--- a/mod/pages/views/default/pages/sidebar/navigation.php
+++ b/mod/pages/views/default/pages/sidebar/navigation.php
@@ -1,16 +1,58 @@
<?php
/**
* Navigation menu for a user's or a group's pages
+ *
+ * @uses $vars['page'] Page object if manually setting selected item
*/
+$selected_page = elgg_get_array_value('page', $vars, false);
+if ($selected_page) {
+ $url = $selected_page->getURL();
+}
+
$title = elgg_echo('pages:navigation');
pages_register_navigation_tree(elgg_get_page_owner());
$content = elgg_view_menu('pages_nav', array('class' => 'pages-nav'));
+if (!$content) {
+ $content = '<p>' . elgg_echo('pages:none') . '</p>';
+}
echo elgg_view('layout/objects/module', array(
'title' => $title,
'body' => $content,
'class' => 'elgg-aside-module',
));
+
+?>
+<script type="text/javascript">
+$(document).ready(function() {
+ $(".pages-nav").treeview({
+ persist: "location",
+ collapsed: true,
+ unique: true
+ });
+
+<?php
+if ($selected_page) {
+ // if on a history page, we need to manually select the correct menu item
+ // code taken from the jquery.treeview library
+?>
+ var current = $(".pages-nav a[href='<?php echo $url; ?>']");
+ var items = current.addClass("selected").parents("ul, li").add( current.next() ).show();
+ var CLASSES = $.treeview.classes;
+ items.filter("li")
+ .swapClass( CLASSES.collapsable, CLASSES.expandable )
+ .swapClass( CLASSES.lastCollapsable, CLASSES.lastExpandable )
+ .find(">.hitarea")
+ .swapClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea )
+ .swapClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea );
+<?php
+}
+?>
+
+});
+
+</script>
+
diff --git a/mod/pages/views/default/pages/sidebar/sidebarthis.php b/mod/pages/views/default/pages/sidebar/sidebarthis.php
deleted file mode 100644
index 173ddb91a..000000000
--- a/mod/pages/views/default/pages/sidebar/sidebarthis.php
+++ /dev/null
@@ -1,88 +0,0 @@
-[<?php
-/**
- * Side bar page tree.
- *
- * @package ElggPages
- */
-
-global $CONFIG;
-$entity = $vars['entity'];
-$parent = $vars['entity']->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\": \"<a href=\\\"{$childentity->getURL()}\\\">" . addslashes($childentity->title) . "</a>\"\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\": \"<a href=\\\"{$vars['entity']->getURL()}\\\">" . addslashes($vars['entity']->title) . "</a>\"\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\": \"<a href=\\\"{$child->getURL()}\\\">{$child->title}</a>\",\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
deleted file mode 100644
index f533356b3..000000000
--- a/mod/pages/views/default/pages/sidebar/starter.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-/**
- * Start Pages page output
- *
- * @package ElggPages
- */
-
-if (isset($vars['entity']) && $vars['entity'] instanceof ElggEntity) {
-
-?>
-
-<script type="text/javascript">
- $(document).ready( function() {
- $("#pagetree<?php echo $vars['entity']->getGUID(); ?>").click();
- });
-</script>
-
-<?php
-} \ 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
deleted file mode 100644
index 399caf108..000000000
--- a/mod/pages/views/default/pages/sidebar/tree.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-/**
- * Side bar tree wrapper.
- *
- * @package ElggPages
- */
-?>
-<div id="sidebar_page_tree">
- <h3><?php echo elgg_echo("pages:navigation"); ?></h3>
- <div id="pagesTree" class="pagesTreeContainer"></div>
-</div>
-<br class="clearfloat" />
diff --git a/mod/pages/views/default/pages/sidebar/wrapper.php b/mod/pages/views/default/pages/sidebar/wrapper.php
deleted file mode 100644
index 93b746eb0..000000000
--- a/mod/pages/views/default/pages/sidebar/wrapper.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-/**
- * Pages page wrapper
- *
- * @package ElggPages
- */
-
-echo "[";
-echo $vars['body'];
-echo "]"; \ No newline at end of file