diff options
Diffstat (limited to 'mod/pages/views')
31 files changed, 966 insertions, 0 deletions
diff --git a/mod/pages/views/default/annotation/icon.php b/mod/pages/views/default/annotation/icon.php new file mode 100644 index 000000000..5f943f8ce --- /dev/null +++ b/mod/pages/views/default/annotation/icon.php @@ -0,0 +1,32 @@ +<?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-2010 + * @link http://elgg.com/ + */ + + + $annotation = $vars['annotation']; + $entity = get_entity($annotation->entity_guid); + + // Get size + if (!in_array($vars['size'],array('small','medium','large','tiny','master','topbar'))) + $vars['size'] = "medium"; + + // Get any align and js + if (!empty($vars['align'])) { + $align = " align=\"{$vars['align']}\" "; + } else { + $align = ""; + } + + +?> + +<div class="groupicon"> +<a href="<?php echo $entity->getURL() . "?rev=" . $annotation->id; ?>"><img src="<?php echo $entity->getIcon($vars['size']); ?>" border="0" <?php echo $align; ?> <?php echo $vars['js']; ?> /></a> +</div>
\ No newline at end of file diff --git a/mod/pages/views/default/annotation/page.php b/mod/pages/views/default/annotation/page.php new file mode 100644 index 000000000..27135b30d --- /dev/null +++ b/mod/pages/views/default/annotation/page.php @@ -0,0 +1,40 @@ +<?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-2010 + * @link http://elgg.com/ + */ + + $annotation = $vars['annotation']; + $entity = get_entity($annotation->entity_guid); + + $icon = elgg_view( + "annotation/icon", array( + 'annotation' => $vars['annotation'], + 'size' => 'small', + ) + ); + + $owner_guid = $annotation->owner_guid; + $owner = get_entity($owner_guid); + + $rev = sprintf(elgg_echo('pages:revision'), + friendly_time($annotation->time_created), + + "<a href=\"" . $owner->getURL() . "\">" . $owner->name ."</a>" + ); + + $link = $entity->getURL() . "?rev=" . $annotation->id; + + $info = <<< END + +<div><a href="$link">{$entity->title}</a></div> +<div>$rev</div> +END; + + echo elgg_view_listing($icon, $info); +?>
\ No newline at end of file diff --git a/mod/pages/views/default/forms/pages/edit.php b/mod/pages/views/default/forms/pages/edit.php new file mode 100644 index 000000000..2b57fe814 --- /dev/null +++ b/mod/pages/views/default/forms/pages/edit.php @@ -0,0 +1,92 @@ +<?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-2010 + * @link http://elgg.com/ + */ + + $parent_guid = get_input('parent_guid'); + $container_guid = get_input('container_guid'); + if (!$container_guid) $container_guid = page_owner(); + + $new_page = false; + if (!$vars['entity']) { + $new_page = true; + + // bootstrap the access permissions in the entity array so we can use defaults + if (defined('ACCESS_DEFAULT')) { + $vars['entity']->access_id = ACCESS_DEFAULT; + $vars['entity']->write_access_id = ACCESS_DEFAULT; + } else { + $vars['entity']->access_id = 0; + $vars['entity']->write_access_id = 0; + } + } +?> +<div class="contentWrapper"> +<form action="<?php echo $vars['url']; ?>action/pages/edit" method="post"> +<?php + echo elgg_view('input/securitytoken'); + if (is_array($vars['config']->pages) && sizeof($vars['config']->pages) > 0) + foreach($vars['config']->pages as $shortname => $valtype) { + + $disabled = ""; + + if (!$new_page && ($shortname == 'title')) + { + $disabled = true; + } +?> + + <p> + <label> + <?php echo elgg_echo("pages:{$shortname}") ?><br /> + <?php echo elgg_view("input/{$valtype}",array( + 'internalname' => $shortname, + 'value' => $vars['entity']->$shortname, + 'disabled' => $disabled + )); ?> + </label> + </p> + +<?php + + } + $cats = elgg_view('categories',$vars); + if (!empty($cats)) { + +?> + <p> + <?php + echo $cats; + ?> + </p> +<?php + + } + +?> + <p> + <?php + if (!$new_page) + { + ?><input type="hidden" name="pages_guid" value="<?php echo $vars['entity']->getGUID(); ?>" /><?php + } + ?> + <?php + if ($container_guid) + { + ?><input type="hidden" name="container_guid" value="<?php echo $container_guid; ?>" /><?php + } + ?> + <input type="hidden" name="parent_guid" value="<?php if (!$new_page) echo $vars['entity']->parent_guid; else echo $parent_guid; ?>" /> + <input type="hidden" name="owner_guid" value="<?php if (!$new_page) echo $vars['entity']->owner_guid; else echo page_owner(); ?>" /> + <input type="submit" class="submit_button" value="<?php echo elgg_echo("save"); ?>" /> + </p> + +</form> +</div> diff --git a/mod/pages/views/default/forms/pages/editwelcome.php b/mod/pages/views/default/forms/pages/editwelcome.php new file mode 100644 index 000000000..996c3a58a --- /dev/null +++ b/mod/pages/views/default/forms/pages/editwelcome.php @@ -0,0 +1,61 @@ +<?php + /** + * Elgg Pages Edit welcome page + * + * @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-2010 + * @link http://elgg.com/ + */ + + //set some variables + if($vars['entity']){ + foreach($vars['entity'] as $welcome){ + $current_message = $welcome->description; + $object_guid = $welcome->guid; + $access_id = $welcome->access_id; + } + }else{ + $current_message = ''; + $object_guid = ''; + $access_id = ACCESS_PRIVATE; + } + + $page_owner = $vars['owner']->guid; + +?> +<div class="contentWrapper"> +<form action="<?php echo $vars['url']; ?>action/pages/editwelcome" method="post"> + + <p class="longtext_editarea"> + <label> + <?php echo elgg_view("input/longtext",array( + 'internalname' => "pages_welcome", + 'value' => $current_message, + 'disabled' => $disabled + )); ?> + </label> + </p> + <p> + <label> + <?php echo elgg_echo('access'); ?><br /> + <?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => $access_id)); ?> + </label> + </p> + <input type="hidden" name="owner_guid" value="<?php echo $page_owner; ?>" /> + + <?php + echo elgg_view('input/securitytoken'); + + //if it is editing, include the object guid + if($object_guid != ''){ + ?> + <input type="hidden" name="object_guid" value="<?php echo $object_guid; ?>" /> + <?php + } + ?> + + <input type="submit" class="submit_button" value="<?php echo elgg_echo("save"); ?>" /> +</form> +</div> diff --git a/mod/pages/views/default/icon/object/page/medium.php b/mod/pages/views/default/icon/object/page/medium.php new file mode 100644 index 000000000..3822ae7a2 --- /dev/null +++ b/mod/pages/views/default/icon/object/page/medium.php @@ -0,0 +1,3 @@ +<?php + echo $vars['url'] . "mod/pages/images/pages_lrg.gif"; +?>
\ No newline at end of file diff --git a/mod/pages/views/default/icon/object/page/small.php b/mod/pages/views/default/icon/object/page/small.php new file mode 100644 index 000000000..81d83523f --- /dev/null +++ b/mod/pages/views/default/icon/object/page/small.php @@ -0,0 +1,3 @@ +<?php + echo $vars['url'] . "mod/pages/images/pages.gif"; +?>
\ No newline at end of file diff --git a/mod/pages/views/default/icon/object/page_top/medium.php b/mod/pages/views/default/icon/object/page_top/medium.php new file mode 100644 index 000000000..3822ae7a2 --- /dev/null +++ b/mod/pages/views/default/icon/object/page_top/medium.php @@ -0,0 +1,3 @@ +<?php + echo $vars['url'] . "mod/pages/images/pages_lrg.gif"; +?>
\ No newline at end of file diff --git a/mod/pages/views/default/icon/object/page_top/small.php b/mod/pages/views/default/icon/object/page_top/small.php new file mode 100644 index 000000000..81d83523f --- /dev/null +++ b/mod/pages/views/default/icon/object/page_top/small.php @@ -0,0 +1,3 @@ +<?php + echo $vars['url'] . "mod/pages/images/pages.gif"; +?>
\ No newline at end of file diff --git a/mod/pages/views/default/object/page.php b/mod/pages/views/default/object/page.php new file mode 100644 index 000000000..09c1852e1 --- /dev/null +++ b/mod/pages/views/default/object/page.php @@ -0,0 +1,21 @@ +<?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-2010 + * @link http://elgg.com/ + */ + + if ($vars['full']) { + echo elgg_view("pages/pageprofile",$vars); + } else { + if (get_input('search_viewtype') == "gallery") { + echo elgg_view('pages/pagegallery',$vars); + } else { + echo elgg_view("pages/pagelisting",$vars); + } + } +?>
\ No newline at end of file diff --git a/mod/pages/views/default/object/page_top.php b/mod/pages/views/default/object/page_top.php new file mode 100644 index 000000000..09c1852e1 --- /dev/null +++ b/mod/pages/views/default/object/page_top.php @@ -0,0 +1,21 @@ +<?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-2010 + * @link http://elgg.com/ + */ + + if ($vars['full']) { + echo elgg_view("pages/pageprofile",$vars); + } else { + if (get_input('search_viewtype') == "gallery") { + echo elgg_view('pages/pagegallery',$vars); + } else { + echo elgg_view("pages/pagelisting",$vars); + } + } +?>
\ No newline at end of file diff --git a/mod/pages/views/default/pages/breadcrumbs.php b/mod/pages/views/default/pages/breadcrumbs.php new file mode 100644 index 000000000..c7e1bfb83 --- /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..c396d45f7 --- /dev/null +++ b/mod/pages/views/default/pages/css.php @@ -0,0 +1,146 @@ +<?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-2010 + * @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; +} + +#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 $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; +} + +.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; +} + + 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..a1da4bd6b --- /dev/null +++ b/mod/pages/views/default/pages/groupprofile_pages.php @@ -0,0 +1,27 @@ +<?php + + // pages on the group index page + + //check to make sure this group forum has been activated + if($vars['entity']->pages_enable != 'no'){ + +?> + +<div id="group_pages_widget"> +<h2><?php echo elgg_echo("pages:groupprofile"); ?></h2> +<?php + + $objects = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'container_guid' => page_owner(), 'limit' => 5, 'full_view' => FALSE)); + + if($objects) + echo $objects; + else + echo "<div class=\"forum_latest\">" . elgg_echo("pages:nogroup") . "</div>"; + +?> +<br class="clearfloat" /> +</div> + +<?php + } +?>
\ 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..7b2df4c90 --- /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-2010 + * @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..82b291e2c --- /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..84d95b53b --- /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-2010 + * @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..806f60c9b --- /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-2010 + * @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..b879ca7a2 --- /dev/null +++ b/mod/pages/views/default/pages/pageprofile.php @@ -0,0 +1,83 @@ +<?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-2010 + * @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 class="contentWrapper"> + <div id="pages_page"> + +<?php + if ($entity) + { + echo elgg_view('output/longtext', array('value' => /*$entity->description*/ $latest->value)); + + $tags = $vars['entity']->tags; + if (!empty($tags)) { + +?> + <!-- display tags --> + <p class="tags"> + <?php + + echo elgg_view('output/tags', array('tags' => $tags)); + + ?> + </p> + +<?php + + } + $cats = elgg_view('categories/view',$vars); + if (!empty($cats)) { + +?> + <p class="categories"> + <?php echo $cats; ?> + </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> + +</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..47a262501 --- /dev/null +++ b/mod/pages/views/default/pages/sidebar/sidebarthis.php @@ -0,0 +1,92 @@ +[<?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-2010 + * @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()}\\\">" . 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 new file mode 100644 index 000000000..4734ca929 --- /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..c83e3f682 --- /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..ed21b4dd6 --- /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..deefdba30 --- /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-2010 + * @link http://elgg.com/ + */ + + if($vars['entity']){ + + foreach($vars['entity'] as $welcome){ + + echo "<div class=\"contentWrapper pageswelcome\">" . $welcome->description . "</div>"; + + } + + } else { + +?> + +<div class="contentWrapper pageswelcome"><p><?php elgg_echo('pages:welcomemessage'); ?></p></div> + +<?php + } +?>
\ No newline at end of file diff --git a/mod/pages/views/default/river/object/page/annotate.php b/mod/pages/views/default/river/object/page/annotate.php new file mode 100644 index 000000000..e26671623 --- /dev/null +++ b/mod/pages/views/default/river/object/page/annotate.php @@ -0,0 +1,14 @@ +<?php + + $statement = $vars['statement']; + $performed_by = $statement->getSubject(); + $object = $statement->getObject(); + + $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; + $string = sprintf(elgg_echo("pages:river:posted"),$url) . " "; + $string .= "<a href=\"" . $object->getURL() . "\">" . elgg_echo("pages:river:annotate:create") . "</a> " . $object->title; + //$string .= "<div class=\"river_content\">" . $object->title . "</div>"; + +?> + +<?php echo $string; ?>
\ No newline at end of file diff --git a/mod/pages/views/default/river/object/page/create.php b/mod/pages/views/default/river/object/page/create.php new file mode 100644 index 000000000..27352cef6 --- /dev/null +++ b/mod/pages/views/default/river/object/page/create.php @@ -0,0 +1,22 @@ +<?php + + $performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject(); + $object = get_entity($vars['item']->object_guid); + $url = $object->getURL(); + + + $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; + $contents = strip_tags($object->description); //strip tags from the contents to stop large images etc blowing out the river view + $string = sprintf(elgg_echo("pages:river:created"),$url) . " "; + $string .= elgg_echo("pages:river:create") . " <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>"; + $string .= "<div class=\"river_content_display\">"; + if(strlen($contents) > 200) { + $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "..."; + }else{ + $string .= $contents; + } + $string .= "</div>"; + +?> + +<?php echo $string; ?>
\ No newline at end of file diff --git a/mod/pages/views/default/river/object/page/update.php b/mod/pages/views/default/river/object/page/update.php new file mode 100644 index 000000000..ff16e0af8 --- /dev/null +++ b/mod/pages/views/default/river/object/page/update.php @@ -0,0 +1,14 @@ +<?php + + $performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject(); + $object = get_entity($vars['item']->object_guid); + $url = $object->getURL(); + + + $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; + $string = sprintf(elgg_echo("pages:river:updated"),$url) . " "; + $string .= elgg_echo("pages:river:update") . " <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>"; + +?> + +<?php echo $string; ?>
\ No newline at end of file diff --git a/mod/pages/views/default/river/object/page_top/annotate.php b/mod/pages/views/default/river/object/page_top/annotate.php new file mode 100644 index 000000000..fea3e570b --- /dev/null +++ b/mod/pages/views/default/river/object/page_top/annotate.php @@ -0,0 +1,14 @@ +<?php + + $statement = $vars['statement']; + $performed_by = $statement->getSubject(); + $object = $statement->getObject(); + + $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; + $string = sprintf(elgg_echo("pages:river:posted"),$url) . " "; + $string .= elgg_echo("pages:river:annotate:create") . " <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>"; + //$string .= "<div class=\"river_content\">" . $object->title . "</div>"; + +?> + +<?php echo $string; ?>
\ No newline at end of file diff --git a/mod/pages/views/default/river/object/page_top/create.php b/mod/pages/views/default/river/object/page_top/create.php new file mode 100644 index 000000000..5ff28dfaf --- /dev/null +++ b/mod/pages/views/default/river/object/page_top/create.php @@ -0,0 +1,14 @@ +<?php + + $statement = $vars['statement']; + $performed_by = $statement->getSubject(); + $object = $statement->getObject(); + + $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; + $string = sprintf(elgg_echo("pages:river:created"),$url) . " "; + $string .= elgg_echo("pages:river:create") . "<a href=\"" . $object->getURL() . "\">" . $object->title . "</a>"; + //$string .= "<div class=\"river_content\">Page title: " . $object->title . "</div>"; + +?> + +<?php echo $string; ?>
\ No newline at end of file diff --git a/mod/pages/views/default/river/object/page_top/update.php b/mod/pages/views/default/river/object/page_top/update.php new file mode 100644 index 000000000..cf4dfbe7d --- /dev/null +++ b/mod/pages/views/default/river/object/page_top/update.php @@ -0,0 +1,14 @@ +<?php + + $statement = $vars['statement']; + $performed_by = $statement->getSubject(); + $object = $statement->getObject(); + + $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; + $string = sprintf(elgg_echo("pages:river:updated"),$url) . " "; + $string .= elgg_echo("pages:river:update") . " <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>"; + //$string .= "<div class=\"river_content\">Title: " . $object->title . "</div>"; + +?> + +<?php echo $string; ?>
\ No newline at end of file diff --git a/mod/pages/views/default/widgets/pages/edit.php b/mod/pages/views/default/widgets/pages/edit.php new file mode 100644 index 000000000..8fb2511f7 --- /dev/null +++ b/mod/pages/views/default/widgets/pages/edit.php @@ -0,0 +1,17 @@ +<?php + + /** + * Elgg pages widget edit + * + * @package ElggPages + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd <info@elgg.com> + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + */ + +?> + <p> + <?php echo elgg_echo("pages:num"); ?> + <input type="text" name="params[pages_num]" value="<?php echo htmlentities($vars['entity']->pages_num); ?>" /> + </p>
\ No newline at end of file diff --git a/mod/pages/views/default/widgets/pages/view.php b/mod/pages/views/default/widgets/pages/view.php new file mode 100644 index 000000000..2ca32b284 --- /dev/null +++ b/mod/pages/views/default/widgets/pages/view.php @@ -0,0 +1,26 @@ +<style type="text/css"> +#pages_widget .pagination { + display:none; +} +</style> +<?php + + /** + * Elgg pages widget edit + * + * @package ElggPages + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd <info@elgg.com> + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + */ + + $num_display = (int) $vars['entity']->pages_num; + + $pages = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'container_guid' => page_owner(), 'limit' => $num_display, 'full_view' => FALSE)); + $pagesurl = $vars['url'] . "pg/pages/owned/" . page_owner_entity()->username; + $pages .= "<div class=\"pages_widget_singleitem_more\"><a href=\"{$pagesurl}\">" . elgg_echo('pages:more') . "</a></div>"; + + echo "<div id=\"pages_widget\">" . $pages . "</div>"; + +?>
\ No newline at end of file |