diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-15 15:04:39 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-15 15:04:39 +0000 |
commit | e8d148970261207efbe5435e1abcf68c5ed59cc8 (patch) | |
tree | 17e3d167941f30dbb22ea4d689227e3a13c06ec2 /mod/pages/views/default | |
parent | 4dc8868b80fdded7931f715b655970a858836b3d (diff) | |
download | elgg-e8d148970261207efbe5435e1abcf68c5ed59cc8.tar.gz elgg-e8d148970261207efbe5435e1abcf68c5ed59cc8.tar.bz2 |
pages plugin using new layout - still need to get subpages working and navigation
git-svn-id: http://code.elgg.org/elgg/trunk@7885 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/pages/views/default')
-rw-r--r-- | mod/pages/views/default/forms/pages/editwelcome.php | 56 | ||||
-rw-r--r-- | mod/pages/views/default/object/page_top.php | 83 | ||||
-rw-r--r-- | mod/pages/views/default/pages/breadcrumbs.php | 30 | ||||
-rw-r--r-- | mod/pages/views/default/pages/welcome.php | 16 |
4 files changed, 75 insertions, 110 deletions
diff --git a/mod/pages/views/default/forms/pages/editwelcome.php b/mod/pages/views/default/forms/pages/editwelcome.php deleted file mode 100644 index a0ad3131b..000000000 --- a/mod/pages/views/default/forms/pages/editwelcome.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * Welcome page edit form - * - * @package ElggPages - */ - -//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_PUBLIC; -} - -$page_owner = $vars['owner']->guid; - -?> -<form action="<?php echo elgg_get_site_url(); ?>action/pages/editwelcome" method="post"> - - <p class="longtext_inputarea"> - <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 - } - - echo elgg_view('input/submit', array('value' => elgg_echo('save'))); -?> - -</form> diff --git a/mod/pages/views/default/object/page_top.php b/mod/pages/views/default/object/page_top.php index 0a1cfdf83..d1a9ef7e8 100644 --- a/mod/pages/views/default/object/page_top.php +++ b/mod/pages/views/default/object/page_top.php @@ -5,12 +5,79 @@ * @package ElggPages */ -if ($vars['full']) { - echo elgg_view("pages/pageprofile", $vars); + +$full = elgg_get_array_value('full', $vars, FALSE); +$page = elgg_get_array_value('entity', $vars, FALSE); + +if (!$page) { + return TRUE; +} + +$owner = $page->getOwnerEntity(); +$owner_icon = elgg_view('profile/icon', array('entity' => $owner, 'size' => 'tiny')); +$owner_link = elgg_view('output/url', array( + 'href' => "pg/pages/owner/$owner->username", + 'text' => $owner->name, +)); +$author_text = elgg_echo('blog:author_by_line', array($owner_link)); +$tags = elgg_view('output/tags', array('tags' => $page->tags)); +$date = elgg_view_friendly_time($page->time_created); +$excerpt = elgg_get_excerpt($page->description); + +$comments_count = elgg_count_comments($page); +//only display if there are commments +if ($comments_count != 0) { + $text = elgg_echo("comments") . " ($comments_count)"; + $comments_link = elgg_view('output/url', array( + 'href' => $page->getURL() . '#page-comments', + 'text' => $text, + )); } else { - if (get_input('listtype') == "gallery") { - echo elgg_view('pages/pagegallery', $vars); - } else { - echo elgg_view("pages/pagelisting", $vars); - } -}
\ No newline at end of file + $comments_link = ''; +} + +$metadata = elgg_view('layout/objects/list/metadata', array( + 'entity' => $page, + 'handler' => 'pages', +)); + +$subtitle = "$author_text $date $categories $comments_link"; + +// do not show the metadata and controls in widget view +if (elgg_in_context('widgets')) { + $metadata = ''; +} + +if ($full) { + $body = elgg_view('output/longtext', array('value' => $page->description)); + + $params = array( + 'entity' => $page, + 'title' => false, + 'metadata' => $metadata, + 'subtitle' => $subtitle, + 'tags' => $tags, + ); + $list_body = elgg_view('layout/objects/list/body', $params); + + $info = elgg_view_image_block($owner_icon, $list_body); + + echo <<<HTML +$info +$body +HTML; + +} else { + // brief view + + $params = array( + 'entity' => $page, + 'metadata' => $metadata, + 'subtitle' => $subtitle, + 'tags' => $tags, + 'content' => $excerpt, + ); + $list_body = elgg_view('layout/objects/list/body', $params); + + echo elgg_view_image_block($owner_icon, $list_body); +} diff --git a/mod/pages/views/default/pages/breadcrumbs.php b/mod/pages/views/default/pages/breadcrumbs.php deleted file mode 100644 index 9c95c64c2..000000000 --- a/mod/pages/views/default/pages/breadcrumbs.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php -/** - * Breadcrumbs for pages. - * - * @package ElggPages - */ - -$page_owner = elgg_get_page_owner_guid(); -$parent = $vars['parent']; - -$breadcrumbs = ''; - -$owner_url = elgg_get_site_url() . "pg/pages/owned/" . get_entity($page_owner)->username; -echo "<div id='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/welcome.php b/mod/pages/views/default/pages/welcome.php deleted file mode 100644 index 7dbc6109a..000000000 --- a/mod/pages/views/default/pages/welcome.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -/** - * Elgg Pages welcome message - * - * @package ElggPages - */ - -if($vars['entity']) { - foreach($vars['entity'] as $welcome){ - echo "<div class=\"contentWrapper pageswelcome\">" . $welcome->description . "</div>"; - } -} else { -?> -<div class="contentWrapper pageswelcome"><p><?php echo elgg_echo('pages:welcomemessage', array($vars['config']->sitename)); ?></p></div> -<?php -} |