diff options
Diffstat (limited to 'mod/pages/views/default/pages')
-rw-r--r-- | mod/pages/views/default/pages/breadcrumbs.php | 28 | ||||
-rw-r--r-- | mod/pages/views/default/pages/css.php | 108 | ||||
-rw-r--r-- | mod/pages/views/default/pages/groupprofile_pages.php | 9 | ||||
-rw-r--r-- | mod/pages/views/default/pages/menu.php | 14 | ||||
-rw-r--r-- | mod/pages/views/default/pages/metatags.php | 22 | ||||
-rw-r--r-- | mod/pages/views/default/pages/pagegallery.php | 37 | ||||
-rw-r--r-- | mod/pages/views/default/pages/pagelisting.php | 38 | ||||
-rw-r--r-- | mod/pages/views/default/pages/pageprofile.php | 66 | ||||
-rw-r--r-- | mod/pages/views/default/pages/sidebar/sidebarthis.php | 82 | ||||
-rw-r--r-- | mod/pages/views/default/pages/sidebar/starter.php | 21 | ||||
-rw-r--r-- | mod/pages/views/default/pages/sidebar/tree.php | 8 | ||||
-rw-r--r-- | mod/pages/views/default/pages/sidebar/wrapper.php | 7 | ||||
-rw-r--r-- | mod/pages/views/default/pages/welcome.php | 29 |
13 files changed, 469 insertions, 0 deletions
diff --git a/mod/pages/views/default/pages/breadcrumbs.php b/mod/pages/views/default/pages/breadcrumbs.php new file mode 100644 index 000000000..52662b5bd --- /dev/null +++ b/mod/pages/views/default/pages/breadcrumbs.php @@ -0,0 +1,28 @@ +<?php
+
+ $page_owner = $vars['page_owner'];
+ $parent = $vars['parent'];
+
+ $breadcrumbs = '';
+
+ $owner_url = $CONFIG->wwwroot . "pg/pages/owned/" . get_entity($page_owner)->username;
+ echo "<div id=\"pages_breadcrumbs\"><b><a href=\"{$owner_url}\">" . elgg_echo('pages:user') . "</a></b>";
+
+ //see if the new page's parent has a parent
+ $getparent = get_entity($parent->parent_guid);
+ while ($getparent instanceof ElggObject){
+
+ $breadcrumbs = " > <a href=\"{$getparent->getURL()}\">$getparent->title</a>" . $breadcrumbs;
+ $getparent = get_entity($getparent->parent_guid);
+
+ }
+
+ echo $breadcrumbs;
+ //if it is adding a page, make the last page a link, otherwise, don't
+ if($vars['add']){
+ echo " > <a href=\"{$parent->getURL()}\">$parent->title</a></div>";
+ }else{
+ echo " > $parent->title</div>";
+ }
+
+?>
\ No newline at end of file diff --git a/mod/pages/views/default/pages/css.php b/mod/pages/views/default/pages/css.php new file mode 100644 index 000000000..1fc1e5abb --- /dev/null +++ b/mod/pages/views/default/pages/css.php @@ -0,0 +1,108 @@ +<?php
+ /**
+ * Elgg Pages
+ *
+ * @package ElggPages
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+?>
+
+.treeview, .treeview ul {
+ padding: 0;
+ margin: 0;
+ list-style: none;
+}
+
+.treeview ul {
+ background-color: white;
+ margin-top: 4px;
+}
+
+.treeview .hitarea {
+ background: url(<?php echo $vars['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 $vars['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 $vars['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 $vars['url']; ?>mod/pages/images/treeview-red-line.gif); }
+.treeview-red .hitarea, .treeview-red li.lastCollapsable, .treeview-red li.lastExpandable { background-image: url(<?php echo $vars['url']; ?>mod/pages/images/treeview-red.gif); }
+
+.treeview-black li { background-image: url(<?php echo $vars['url']; ?>mod/pages/images/treeview-black-line.gif); }
+.treeview-black .hitarea, .treeview-black li.lastCollapsable, .treeview-black li.lastExpandable { background-image: url(<?php echo $vars['url']; ?>mod/pages/images/treeview-black.gif); }
+
+.treeview-gray li { background-image: url(<?php echo $vars['url']; ?>mod/pages/images/treeview-gray-line.gif); }
+.treeview-gray .hitarea, .treeview-gray li.lastCollapsable, .treeview-gray li.lastExpandable { background-image: url(<?php echo $vars['url']; ?>mod/pages/images/treeview-gray.gif); }
+
+.treeview-famfamfam li { background-image: url(<?php echo $vars['url']; ?>mod/pages/images/treeview-famfamfam-line.gif); }
+.treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url(<?php echo $vars['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 $vars['url']; ?>mod/pages/images/folder.gif) 0 0 no-repeat; }
+.filetree li.expandable span.folder { background: url(<?php echo $vars['url']; ?>mod/pages/images/folder-closed.gif) 0 0 no-repeat; }
+.filetree span.file { background: url(<?php echo $vars['url']; ?>mod/pages/images/file.gif) 0 0 no-repeat; }
+
+.pagesTreeContainer {
+ margin:0;
+ min-height: 200px;
+ }
+
+/* delete, Dave's test addition */
+
+#pages_page .strapline {
+ text-align:right;
+ border-top:1px solid #efefef;
+ margin:10px 0 10px 0;
+}
+
+#pages_page .tags {
+ padding:0 0 0 16px;
+ margin:10px 0 4px 0;
+ background:transparent url(<?php echo $vars['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;
+}
+
diff --git a/mod/pages/views/default/pages/groupprofile_pages.php b/mod/pages/views/default/pages/groupprofile_pages.php new file mode 100644 index 000000000..b32ccf3b0 --- /dev/null +++ b/mod/pages/views/default/pages/groupprofile_pages.php @@ -0,0 +1,9 @@ +<div id="group_pages_widget">
+<h2><?php echo elgg_echo("pages:groupprofile"); ?></h2>
+<?php
+
+ $objects = list_entities("object", "page_top", page_owner(), 5, false);
+ echo $objects;
+
+?>
+</div>
\ No newline at end of file diff --git a/mod/pages/views/default/pages/menu.php b/mod/pages/views/default/pages/menu.php new file mode 100644 index 000000000..ca8620f70 --- /dev/null +++ b/mod/pages/views/default/pages/menu.php @@ -0,0 +1,14 @@ +<?php + /** + * Elgg Pages: Add group menu + * + * @package ElggPages + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + */ +?> +<p class="user_menu_pages"> + <a href="<?php echo $vars['url']; ?>pg/pages/owned/<?php echo $vars['entity']->username; ?>"><?php echo elgg_echo("pages"); ?></a> + </p>
\ No newline at end of file diff --git a/mod/pages/views/default/pages/metatags.php b/mod/pages/views/default/pages/metatags.php new file mode 100644 index 000000000..895df6657 --- /dev/null +++ b/mod/pages/views/default/pages/metatags.php @@ -0,0 +1,22 @@ +<?php
+
+ $treeguid = get_input('treeguid');
+ if (empty($treeguid)) {
+ $treeguid = get_input('page_guid');
+ }
+
+?>
+
+ <script type="text/javascript" src="<?php echo $vars['url']; ?>mod/pages/javascript/jquery.treeview.js" ></script>
+ <script type="text/javascript" src="<?php echo $vars['url']; ?>mod/pages/javascript/jquery.treeview.async.js" ></script>
+ <script type="text/javascript">
+
+ $(document).ready( function() {
+
+ $("#pagesTree").treeview({
+ url: "<?php echo $vars['url']; ?>mod/pages/pagesTree.php",
+ currentpage: "<?php echo get_input('page_guid'); ?>"
+ }, "<?php echo $treeguid; ?>")
+
+ });
+ </script>
diff --git a/mod/pages/views/default/pages/pagegallery.php b/mod/pages/views/default/pages/pagegallery.php new file mode 100644 index 000000000..b49150927 --- /dev/null +++ b/mod/pages/views/default/pages/pagegallery.php @@ -0,0 +1,37 @@ +<?php + /** + * Elgg Pages + * + * @package ElggPages + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + */ + + $icon = elgg_view( + "graphics/icon", array( + 'entity' => $vars['entity'], + 'size' => 'medium', + ) + ); + + $info = "<div><p><b><a href=\"" . $vars['entity']->getUrl() . "\">" . $vars['entity']->title . "</a></b></p></div>"; + + + $latest = $vars['entity']->getAnnotations('page', 1, 0, 'desc'); + if ($latest) { + $latest = $latest[0]; + + $time_updated = $latest->time_created; + $owner_guid = $latest->owner_guid; + $owner = get_entity($owner_guid); + + + $info .= "<br /><div>". + strip_tags(substr($latest->value, 0, 100)) + . "</div>"; + } + + echo elgg_view_listing($icon, $info); +?>
\ No newline at end of file diff --git a/mod/pages/views/default/pages/pagelisting.php b/mod/pages/views/default/pages/pagelisting.php new file mode 100644 index 000000000..a04e53bd4 --- /dev/null +++ b/mod/pages/views/default/pages/pagelisting.php @@ -0,0 +1,38 @@ +<?php + /** + * Elgg Pages + * + * @package ElggPages + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + */ + + $icon = elgg_view( + "graphics/icon", array( + 'entity' => $vars['entity'], + 'size' => 'small', + ) + ); + + $info .= "<p><b><a href=\"" . $vars['entity']->getUrl() . "\">" . $vars['entity']->title . "</a></b></p>"; + + + $latest = $vars['entity']->getAnnotations('page', 1, 0, 'desc'); + if ($latest) { + $latest = $latest[0]; + + $time_updated = $latest->time_created; + $owner_guid = $latest->owner_guid; + $owner = get_entity($owner_guid); + + + $info .= "<p class=\"owner_timestamp\">".sprintf(elgg_echo("pages:strapline"), + friendly_time($time_updated), + "<a href=\"" . $owner->getURL() . "\">" . $owner->name ."</a>" + ) . "</p>"; + } + + echo elgg_view_listing($icon, $info); +?>
\ No newline at end of file diff --git a/mod/pages/views/default/pages/pageprofile.php b/mod/pages/views/default/pages/pageprofile.php new file mode 100644 index 000000000..e82e91728 --- /dev/null +++ b/mod/pages/views/default/pages/pageprofile.php @@ -0,0 +1,66 @@ +<?php + /** + * Elgg Pages + * + * @package ElggPages + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + */ + + // Output body + $entity = $vars['entity']; + + $rev = (int)get_input('rev'); + + if ($rev) + { + $latest = get_annotation($rev); + } + else + { + $latest = $entity->getAnnotations('page', 1, 0, 'desc'); + if ($latest) $latest = $latest[0]; + } + +?> + + <div id="pages_page"> + +<?php + if ($entity) + { + echo elgg_view('output/longtext', array('value' => /*$entity->description*/ $latest->value)); + +?> + <!-- display tags --> + <p class="tags"> + <?php + + echo elgg_view('output/tags', array('tags' => $vars['entity']->tags)); + + ?> + </p> + +<?php + } + + // last edit & by whome +?> + + <p class="strapline"> + <?php + + $time_updated = $latest->time_created; + $owner_guid = $latest->owner_guid; + $owner = get_entity($owner_guid); + + echo sprintf(elgg_echo("pages:strapline"), + friendly_time($time_updated), + "<a href=\"" . $owner->getURL() . "\">" . $owner->name ."</a>" + ); + + ?> + </p> +</div>
\ No newline at end of file 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..ffdc6c802 --- /dev/null +++ b/mod/pages/views/default/pages/sidebar/sidebarthis.php @@ -0,0 +1,82 @@ +[<?php + /** + * Elgg Pages + * + * @package ElggPages + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + */ + + 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()}\\\">{$childentity->title}</a>\",\n";
+
+ $haschild = get_entities_from_metadata('parent_guid',$childentity->guid,'','',0,9999);
+ if ($haschild) {
+ if (in_array($childentity->getGUID(),$path)) {
+ $child .= "\t\t\t\"expanded\": true,";
+ $child .= "\t\t\t\"children\": [\n";
+
+ $childstring = "";
+ foreach($haschild as $subchild) {
+ if (!empty($childstring)) $childstring .= ", ";
+ $childstring .= pages_draw_child($subchild,$path);
+ }
+
+ $child .= $childstring . "\n\t\t\t]\n";
+ } else {
+ $child .= "\t\t\t\"id\": \"{$childentity->getGUID()}\",\n\t\t\t\"hasChildren\": true\n";
+ }
+
+ }
+ $child .= "\t\t}";
+ return $child;
+ }
+
+ if (!$parent) {
+ echo "{\n";
+ echo "\t\"text\": \"<a href=\\\"{$vars['entity']->getURL()}\\\">{$vars['entity']->title}</a>\",\n";
+ }
+ $children = "";
+ if (isset($vars['children']) && is_array($vars['children']) && (!isset($vars['fulltree']) || $vars['fulltree'] == 0)) {
+ if (!$parent) echo "\t" . '"expanded": true,' . "\n";
+ if (!$parent) echo "\t" . '"children": [' . "\n";
+ foreach($vars['children'] as $child) {
+ if (!empty($children)) $children .= ", \n";
+ /*
+ $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}";
+ */
+ $children .= pages_draw_child($child,$path);
+ }
+ 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..234ec28e5 --- /dev/null +++ b/mod/pages/views/default/pages/sidebar/starter.php @@ -0,0 +1,21 @@ +<?php
+
+ 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 new file mode 100644 index 000000000..1424eeebe --- /dev/null +++ b/mod/pages/views/default/pages/sidebar/tree.php @@ -0,0 +1,8 @@ +<?php
+
+?>
+<div id="sidebar_page_tree">
+ <h3><?php echo elgg_echo("pages:navigation"); ?></h3>
+ <div id="pagesTree" class="pagesTreeContainer"></div>
+</div>
+<br class="clearfloat" />
\ 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..08e6a5b7d --- /dev/null +++ b/mod/pages/views/default/pages/sidebar/wrapper.php @@ -0,0 +1,7 @@ +<?php
+
+ echo "[";
+ echo $vars['body'];
+ echo "]";
+
+?>
\ No newline at end of file diff --git a/mod/pages/views/default/pages/welcome.php b/mod/pages/views/default/pages/welcome.php new file mode 100644 index 000000000..0974ba151 --- /dev/null +++ b/mod/pages/views/default/pages/welcome.php @@ -0,0 +1,29 @@ +<?php
+
+ /**
+ * Elgg Pages welcome message
+ *
+ * @package ElggPages
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ if($vars['entity']){
+
+ foreach($vars['entity'] as $welcome){
+
+ echo $welcome->description;
+
+ }
+
+ } else {
+
+?>
+
+ <p>Welcome to this Elgg pages plugin. This feature allows you to create pages on any topic and select who can view them and edit them.</p>
+
+<?php
+ }
+?>
\ No newline at end of file |