aboutsummaryrefslogtreecommitdiff
path: root/mod/blog
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-15 13:35:37 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-15 13:35:37 +0000
commit1a08a1f4a273737afb508c781d5f39cef021a273 (patch)
tree7b4c1766c7b6d0f1e492e467dccb19869f39445a /mod/blog
parentef3e87ebcf82fbf172aa719e23ef1a6cfca7a948 (diff)
downloadelgg-1a08a1f4a273737afb508c781d5f39cef021a273.tar.gz
elgg-1a08a1f4a273737afb508c781d5f39cef021a273.tar.bz2
Moving some stuff into the plugins repo, where it belongs.
git-svn-id: https://code.elgg.org/elgg/trunk@646 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/blog')
-rw-r--r--mod/blog/actions/add.php66
-rw-r--r--mod/blog/actions/comments/add.php44
-rw-r--r--mod/blog/actions/comments/delete.php34
-rw-r--r--mod/blog/actions/delete.php38
-rw-r--r--mod/blog/actions/edit.php70
-rw-r--r--mod/blog/add.php25
-rw-r--r--mod/blog/edit.php31
-rw-r--r--mod/blog/everyone.php23
-rw-r--r--mod/blog/index.php32
-rw-r--r--mod/blog/languages/en.php52
-rw-r--r--mod/blog/read.php52
-rw-r--r--mod/blog/start.php111
-rw-r--r--mod/blog/views/default/blog/css.php58
-rw-r--r--mod/blog/views/default/blog/forms/edit.php89
-rw-r--r--mod/blog/views/default/blog/notfound.php21
-rw-r--r--mod/blog/views/default/blog/view.php26
-rw-r--r--mod/blog/views/default/object/blog-comment.php50
-rw-r--r--mod/blog/views/default/object/blog-comments.php52
-rw-r--r--mod/blog/views/default/object/blog.php88
19 files changed, 0 insertions, 962 deletions
diff --git a/mod/blog/actions/add.php b/mod/blog/actions/add.php
deleted file mode 100644
index f51bbedac..000000000
--- a/mod/blog/actions/add.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-
- /**
- * Elgg blog: add post action
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.org/
- */
-
- // Make sure we're logged in (send us to the front page if not)
- if (!isloggedin()) forward();
-
- // Get input data
- $title = get_input('blogtitle');
- $body = get_input('blogbody');
- $tags = get_input('blogtags');
-
- // Cache to the session
- $_SESSION['blogtitle'] = $title;
- $_SESSION['blogbody'] = $body;
- $_SESSION['blogtags'] = $tags;
-
- // Convert string of tags into a preformatted array
- $tagarray = string_to_tag_array($tags);
-
- // Make sure the title / description aren't blank
- if (empty($title) || empty($body)) {
- register_error(elgg_echo("blog:blank"));
- forward("mod/blog/add.php");
-
- // Otherwise, save the blog post
- } else {
-
- // Initialise a new ElggObject
- $blog = new ElggObject();
- // Tell the system it's a blog post
- $blog->subtype = "blog";
- // Set its owner to the current user
- $blog->owner_guid = $_SESSION['user']->getGUID();
- // For now, set its access to public (we'll add an access dropdown shortly)
- $blog->access_id = 2;
- // Set its title and description appropriately
- $blog->title = $title;
- $blog->description = $body;
- // Before we can set metadata, we need to save the blog post
- if (!$blog->save()) {
- register_error(elgg_echo("blog:error"));
- forward("mod/blog/add.php");
- }
- // Now let's add tags. We can pass an array directly to the object property! Easy.
- if (is_array($tagarray)) {
- $blog->tags = $tagarray;
- }
- // Success message
- system_message(elgg_echo("blog:posted"));
- // Remove the blog post cache
- unset($_SESSION['blogtitle']); unset($_SESSION['blogbody']); unset($_SESSION['blogtags']);
- // Forward to the main blog page
- forward("mod/blog/?username=" . $_SESSION['user']->username);
-
- }
-
-?> \ No newline at end of file
diff --git a/mod/blog/actions/comments/add.php b/mod/blog/actions/comments/add.php
deleted file mode 100644
index 8a54cde13..000000000
--- a/mod/blog/actions/comments/add.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-
- /**
- * Elgg blog: add comment action
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.org/
- */
-
- // Make sure we're logged in; forward to the front page if not
- if (!isloggedin()) forward();
-
- // Get input
- $blogpost_guid = (int) get_input('blogpost_guid');
- $comment = get_input('comment');
-
- // Let's see if we can get an entity with the specified GUID, and that it's a blog post
- if ($blogpost = get_entity($blogpost_guid)) {
- if ($blogpost->getSubtype() == "blog") {
-
- // If posting the comment was successful, say so
- if ($blogpost->annotate('comment',$comment,$blogpost->access_id, $_SESSION['guid'])) {
-
- system_message(elgg_echo("comment:success"));
-
- } else {
- system_message(elgg_echo("comment:failure"));
- }
-
- }
-
- } else {
-
- system_message(elgg_echo("blog:notfound"));
-
- }
-
- // Forward to the
- forward("mod/blog/read.php?blogpost=" . $blogpost_guid);
-
-?> \ No newline at end of file
diff --git a/mod/blog/actions/comments/delete.php b/mod/blog/actions/comments/delete.php
deleted file mode 100644
index 8eee2c961..000000000
--- a/mod/blog/actions/comments/delete.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
- /**
- * Elgg blog: delete comment action
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.org/
- */
-
- // Ensure we're logged in
- if (!isloggedin()) forward();
-
- // Make sure we can get the comment in question
- $comment_id = (int) get_input('comment_id');
- if ($comment = get_annotation($comment_id)) {
-
- $url = "mod/blog/read.php?blogpost=" . $comment->entity_guid;
- if ($comment->canEdit()) {
- $comment->delete();
- system_message(elgg_echo("comment:deleted"));
- forward($url);
- }
-
- } else {
- $url = "";
- }
-
- system_message(elgg_echo("comment:notdeleted"));
- forward($url);
-
-?> \ No newline at end of file
diff --git a/mod/blog/actions/delete.php b/mod/blog/actions/delete.php
deleted file mode 100644
index cb494e59f..000000000
--- a/mod/blog/actions/delete.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-
- /**
- * Elgg blog: delete post action
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.org/
- */
-
- // Make sure we're logged in (send us to the front page if not)
- if (!isloggedin()) forward();
-
- // Get input data
- $guid = (int) get_input('blogpost');
-
- // Make sure we actually have permission to edit
- $blog = get_entity($guid);
- if ($blog->getSubtype() == "blog" && $blog->canEdit()) {
-
- // Get owning user
- $owner = get_entity($blog->getOwner());
- // Delete it!
- $rowsaffected = $blog->delete();
- if ($rowsaffected > 0) {
- // Success message
- system_message(elgg_echo("blog:deleted"));
- } else {
- system_message(elgg_echo("blog:notdeleted"));
- }
- // Forward to the main blog page
- forward("mod/blog/?username=" . $owner->username);
-
- }
-
-?> \ No newline at end of file
diff --git a/mod/blog/actions/edit.php b/mod/blog/actions/edit.php
deleted file mode 100644
index fba4763a6..000000000
--- a/mod/blog/actions/edit.php
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-
- /**
- * Elgg blog: edit post action
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.org/
- */
-
- // Make sure we're logged in (send us to the front page if not)
- if (!isloggedin()) forward();
-
- // Get input data
- $guid = (int) get_input('blogpost');
- $title = get_input('blogtitle');
- $body = get_input('blogbody');
- $tags = get_input('blogtags');
-
- // Make sure we actually have permission to edit
- $blog = get_entity($guid);
- if ($blog->getSubtype() == "blog" && $blog->canEdit()) {
-
- // Cache to the session
- $_SESSION['blogtitle'] = $title;
- $_SESSION['blogbody'] = $body;
- $_SESSION['blogtags'] = $tags;
-
- // Convert string of tags into a preformatted array
- $tagarray = string_to_tag_array($tags);
-
- // Make sure the title / description aren't blank
- if (empty($title) || empty($body)) {
- register_error(elgg_echo("blog:blank"));
- forward("mod/blog/add.php");
-
- // Otherwise, save the blog post
- } else {
-
- // Get owning user
- $owner = get_entity($blog->getOwner());
- // For now, set its access to public (we'll add an access dropdown shortly)
- $blog->access_id = 2;
- // Set its title and description appropriately
- $blog->title = $title;
- $blog->description = $body;
- // Before we can set metadata, we need to save the blog post
- if (!$blog->save()) {
- register_error(elgg_echo("blog:error"));
- forward("mod/blog/add.php");
- }
- // Now let's add tags. We can pass an array directly to the object property! Easy.
- $blog->clearMetadata('tags');
- if (is_array($tagarray)) {
- $blog->tags = $tagarray;
- }
- // Success message
- system_message(elgg_echo("blog:posted"));
- // Remove the blog post cache
- unset($_SESSION['blogtitle']); unset($_SESSION['blogbody']); unset($_SESSION['blogtags']);
- // Forward to the main blog page
- forward("mod/blog/?username=" . $owner->username);
-
- }
-
- }
-
-?> \ No newline at end of file
diff --git a/mod/blog/add.php b/mod/blog/add.php
deleted file mode 100644
index 15abe819e..000000000
--- a/mod/blog/add.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
- /**
- * Elgg blog add entry page
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.com/
- */
-
- // Load Elgg engine
- require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
- // If we're not logged in, forward to the front page
- if (!isloggedin()) forward();
-
- // Get the current page's owner
- $page_owner = page_owner();
-
- // Display page
- page_draw(elgg_echo('blog:addpost'),elgg_view("blog/forms/edit"));
-
-?> \ No newline at end of file
diff --git a/mod/blog/edit.php b/mod/blog/edit.php
deleted file mode 100644
index 262973f54..000000000
--- a/mod/blog/edit.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
- /**
- * Elgg blog edit entry page
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.com/
- */
-
- // Load Elgg engine
- require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
- // Get the post, if it exists
- $blogpost = (int) get_input('blogpost');
- if ($post = get_entity($blogpost)) {
-
- if ($post->canEdit()) {
-
- $body = elgg_view("blog/forms/edit", array('entity' => $post));
-
- }
-
- }
-
- // Display page
- page_draw(sprintf(elgg_echo('blog:editpost'),$post->title),$body);
-
-?> \ No newline at end of file
diff --git a/mod/blog/everyone.php b/mod/blog/everyone.php
deleted file mode 100644
index a97733c46..000000000
--- a/mod/blog/everyone.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-
- /**
- * Elgg view all blog posts from all users page
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.com/
- */
-
- // Load Elgg engine
- require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
- if ($blogposts = get_entities('object','blog')) {
- $body = elgg_view("blog/view",array('posts' => $blogposts));
- }
-
- // Display page
- page_draw(elgg_echo('blog:everyone'),$body);
-
-?> \ No newline at end of file
diff --git a/mod/blog/index.php b/mod/blog/index.php
deleted file mode 100644
index b7f1912f6..000000000
--- a/mod/blog/index.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-
- /**
- * Elgg blog index page
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.com/
- */
-
- // Load Elgg engine
- require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
- // Get the current page's owner
- $page_owner = page_owner_entity();
- if ($page_owner === false || is_null($page_owner)) {
- $page_owner = $_SESSION['user'];
- set_page_owner($page_owner->getGUID());
- }
-
- // Get any blog posts to display
- $posts = $page_owner->getObjects('blog');
-
- // Display them
- $body = elgg_view("blog/view",array('posts' => $posts));
-
- // Display page
- page_draw(sprintf(elgg_echo('blog:user'),$page_owner->name),$body);
-
-?> \ No newline at end of file
diff --git a/mod/blog/languages/en.php b/mod/blog/languages/en.php
deleted file mode 100644
index 845303700..000000000
--- a/mod/blog/languages/en.php
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-
- $english = array(
-
- /**
- * Menu items and titles
- */
-
- 'blog' => "Blog",
- 'blog:user' => "%s's blog",
- 'blog:posttitle' => "%s's blog: %s",
- 'blog:everyone' => "All blog posts",
-
- 'blog:read' => "Read blog",
-
- 'blog:addpost' => "Write an entry",
- 'blog:editpost' => "Edit entry (%s)",
-
- 'blog:text' => "Blog text",
-
- 'blog:strapline' => "%s",
-
- 'blog:comment:add' => "Add a comment",
- 'blog:comment:text' => "Comment text",
-
- 'comments' => "Comments",
-
- /**
- * Status messages
- */
-
- 'blog:posted' => "Your blog post was successfully posted.",
- 'comment:success' => "Your comment was successfully added.",
- 'blog:deleted' => "Your blog post was successfully deleted.",
- 'comment:deleted' => "The comment was successfully deleted.",
-
- /**
- * Error messages
- */
-
- 'blog:blank' => "Sorry; you need to fill in both the title and body before you can make a post.",
- 'blog:notfound' => "Sorry; we could not find the specified blog post.",
- 'blog:notdeleted' => "Sorry; we could not delete this blog post.",
-
- 'comment:failure' => "An unexpected error occurred when adding your comment. Please try again.",
- 'comment:notdeleted' => "The comment could not be deleted.",
-
- );
-
- add_translation("en",$english);
-
-?> \ No newline at end of file
diff --git a/mod/blog/read.php b/mod/blog/read.php
deleted file mode 100644
index 84e29d0ea..000000000
--- a/mod/blog/read.php
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-
- /**
- * Elgg read blog post page
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.com/
- */
-
- // Load Elgg engine
- require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
- // Get the specified blog post
- $post = (int) get_input('blogpost');
-
- // If we can get out the blog post ...
- if ($blogpost = get_entity($post)) {
-
- // Get any comments
- $comments = $blogpost->getAnnotations('comments');
-
- // Set the page owner
- set_page_owner($blogpost->getOwner());
- $page_owner = get_entity($blogpost->getOwner());
-
- // Display it
- $body = elgg_view("object/blog",array(
- 'entity' => $blogpost,
- 'entity_owner' => $page_owner,
- 'comments' => $comments,
- 'full' => true
- ));
-
- // Set the title appropriately
- $title = sprintf(elgg_echo("blog:posttitle"),$page_owner->name,$blogpost->title);
-
- // If we're not allowed to see the blog post
- } else {
-
- // Display the 'post not found' page instead
- $body = elgg_view("blog/notfound");
- $title = elgg_echo("blog:notfound");
-
- }
-
- // Display page
- page_draw($title,$body);
-
-?> \ No newline at end of file
diff --git a/mod/blog/start.php b/mod/blog/start.php
deleted file mode 100644
index 8a39e4435..000000000
--- a/mod/blog/start.php
+++ /dev/null
@@ -1,111 +0,0 @@
-<?php
-
- /**
- * Elgg blog plugin
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.com/
- */
-
- /**
- * Blog initialisation
- *
- * These parameters are required for the event API, but we won't use them:
- *
- * @param unknown_type $event
- * @param unknown_type $object_type
- * @param unknown_type $object
- */
-
- function blog_init() {
-
- // Load system configuration
- global $CONFIG;
-
- // Load the language file
- register_translations($CONFIG->pluginspath . "blog/languages/");
-
- // Set up menu for logged in users
- if (isloggedin()) {
- add_menu(elgg_echo('blog'), $CONFIG->wwwroot . "pg/blog/",array(
- menu_item(elgg_echo('blog:read'),$CONFIG->wwwroot."pg/blog/" . $_SESSION['user']->username),
- menu_item(elgg_echo('blog:addpost'),$CONFIG->wwwroot."mod/blog/add.php"),
- menu_item(elgg_echo('blog:everyone'),$CONFIG->wwwroot."mod/blog/everyone.php"),
- ));
- // And for logged out users
- } else {
- add_menu(elgg_echo('blog'), $CONFIG->wwwroot . "mod/blog/everyone.php",array(
- menu_item(elgg_echo('blog:everyone'),$CONFIG->wwwroot."mod/blog/everyone.php"),
- ));
- }
-
- // Extend system CSS with our own styles, which are defined in the blog/css view
- extend_view('css','blog/css');
-
- // Register a page handler, so we can have nice URLs
- register_page_handler('blog','blog_page_handler');
-
- // Register a URL handler for blog posts
- register_entity_url_handler('blog_url','object','blog');
- }
-
- /**
- * Blog page handler; allows the use of fancy URLs
- *
- * @param array $page From the page_handler function
- * @return true|false Depending on success
- */
- function blog_page_handler($page) {
-
- // The first component of a blog URL is the username
- if (isset($page[0])) {
- set_input('username',$page[0]);
- }
-
- // The second part dictates what we're doing
- if (isset($page[1])) {
- switch($page[1]) {
- case "read": set_input('blogpost',$page[2]);
- @include(dirname(__FILE__) . "/read.php");
- break;
- case "friends": // TODO: add friends blog page here
- break;
- }
- // If the URL is just 'blog/username', or just 'blog/', load the standard blog index
- } else {
- @include(dirname(__FILE__) . "/index.php");
- return true;
- }
-
- return false;
-
- }
-
- /**
- * Populates the ->getUrl() method for blog objects
- *
- * @param ElggEntity $blogpost Blog post entity
- * @return string Blog post URL
- */
- function blog_url($blogpost) {
-
- global $CONFIG;
- return $CONFIG->url . "pg/blog/" . $blogpost->getOwnerEntity()->username . "/read/" . $blogpost->getGUID();
-
- }
-
- // Make sure the blog initialisation function is called on initialisation
- register_event_handler('init','system','blog_init');
-
- // Register actions
- global $CONFIG;
- register_action("blog/add",false,$CONFIG->pluginspath . "blog/actions/add.php");
- register_action("blog/edit",false,$CONFIG->pluginspath . "blog/actions/edit.php");
- register_action("blog/delete",false,$CONFIG->pluginspath . "blog/actions/delete.php");
- register_action("blog/comments/add",false,$CONFIG->pluginspath . "blog/actions/comments/add.php");
- register_action("blog/comments/delete",false,$CONFIG->pluginspath . "blog/actions/comments/delete.php");
-
-?> \ No newline at end of file
diff --git a/mod/blog/views/default/blog/css.php b/mod/blog/views/default/blog/css.php
deleted file mode 100644
index 2808508d6..000000000
--- a/mod/blog/views/default/blog/css.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-
- /**
- * Elgg blog CSS extender
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.com/
- */
-
-?>
-
-.blog-post {
-
- margin-bottom: 30px;
- border: 0px;
- border-bottom: 1px;
- border-style: solid;
- border-color: #aaa;
-
-}
-
-.blog-post a {
-
- text-decoration: underline;
- color: #777;
-
-}
-
-.blog-post h3 {
-
- font-size: 200%;
- margin-bottom: 15px;
-
-}
-
-.blog-post h3 a {
-
- text-decoration: none;
-
-}
-
-.blog-post .strapline {
-
- font-size: 130%;
- margin-bottom: 20px;
- color: #aaa;
-
-}
-
-.blog-post .strapline a {
-
- text-decoration: none;
- color: #aaa;
-
-} \ No newline at end of file
diff --git a/mod/blog/views/default/blog/forms/edit.php b/mod/blog/views/default/blog/forms/edit.php
deleted file mode 100644
index ff8ae8767..000000000
--- a/mod/blog/views/default/blog/forms/edit.php
+++ /dev/null
@@ -1,89 +0,0 @@
-<?php
-
- /**
- * Elgg blog edit/add page
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.com/
- *
- * @uses $vars['object'] Optionally, the blog post to edit
- */
-
- // Set title, form destination
- if (isset($vars['entity'])) {
- $title = sprintf(elgg_echo("blog:editpost"),$object->title);
- $action = "blog/edit";
- $title = $vars['entity']->title;
- $body = $vars['entity']->description;
- $tags = $vars['entity']->tags;
- } else {
- $title = elgg_echo("blog:addpost");
- $action = "blog/add";
- $tags = "";
- $title = "";
- $description = "";
- }
-
- // Just in case we have some cached details
- if (isset($vars['blogtitle'])) {
- $title = $vars['blogtitle'];
- $body = $vars['blogbody'];
- $tags = $vars['blogtags'];
- }
-
-?>
-
- <h2>
- <?php echo $title; ?>
- </h2>
- <form action="<?php echo $vars['url']; ?>action/<?php echo $action; ?>" method="post">
-
- <p>
- <label><?php echo elgg_echo("title"); ?><br />
- <?php
-
- echo elgg_view("input/text", array(
- "internalname" => "blogtitle",
- "value" => $title,
- ));
-
- ?>
- </label>
- </p>
- <p>
- <label><?php echo elgg_echo("blog:text"); ?><br />
- <?php
-
- echo elgg_view("input/longtext",array(
- "internalname" => "blogbody",
- "value" => $body,
- ));
- ?>
- </label>
- </p>
- <p>
- <label><?php echo elgg_echo("tags"); ?><br />
- <?php
-
- echo elgg_view("input/tags", array(
- "internalname" => "blogtags",
- "value" => $tags,
- ));
-
- ?>
- </p>
- <p>
- <?php
-
- if (isset($vars['entity'])) {
- ?><input type="hidden" name="blogpost" value="<?php echo $vars['entity']->getGUID(); ?>" /><?php
- }
-
- ?>
- <input type="submit" value="<?php echo elgg_echo('save'); ?>" />
- </p>
-
- </form> \ No newline at end of file
diff --git a/mod/blog/views/default/blog/notfound.php b/mod/blog/views/default/blog/notfound.php
deleted file mode 100644
index ae716df89..000000000
--- a/mod/blog/views/default/blog/notfound.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
- /**
- * Elgg blog not found page
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.com/
- */
-
-?>
-
- <p>
- <?php
-
- echo elgg_echo("blog:notfound");
-
- ?>
- </p> \ No newline at end of file
diff --git a/mod/blog/views/default/blog/view.php b/mod/blog/views/default/blog/view.php
deleted file mode 100644
index 24d0bde7d..000000000
--- a/mod/blog/views/default/blog/view.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-
- /**
- * Elgg blog view page
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.com/
- *
- * @uses $vars['posts'] An array of posts to view
- */
-
- // If there are any posts to view, view them
- if (is_array($vars['posts']) && sizeof($vars['posts']) > 0) {
-
- foreach($vars['posts'] as $post) {
-
- echo elgg_view_entity($post);
-
- }
-
- }
-
-?> \ No newline at end of file
diff --git a/mod/blog/views/default/object/blog-comment.php b/mod/blog/views/default/object/blog-comment.php
deleted file mode 100644
index 344eb5a9c..000000000
--- a/mod/blog/views/default/object/blog-comment.php
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-
- /**
- * Elgg blog individual comment view
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.com/
- *
- * @uses $vars['entity'] The comment to view
- */
-
-
-?>
-
- <li>
- <div class="blog-comment">
- <p class="blog-comment-text"><?php echo elgg_view("output/longtext",array("value" => $vars['entity']->value)); ?></p>
- <p class="blog-comment-byline">
- <?php
-
- if ($owner = get_entity($vars['entity']->owner_guid)) {
- echo $owner->name;
- }
-
- ?>, <?php echo date("F j, g:i a",$vars['entity']->time_created); ?>
- </p>
- <?php
-
- if ($vars['entity']->canEdit()) {
-?>
- <p class="blog-comment-menu">
- <?php
-
- echo elgg_view("output/confirmlink",array(
- 'href' => $vars['url'] . "action_handler.php?action=blog/comments/delete&comment_id=" . $vars['entity']->id,
- 'text' => elgg_echo('delete'),
- 'confirm' => elgg_echo('deleteconfirm'),
- ));
-
- ?>
- </p>
-<?php
- }
-
- ?>
- </div>
- </li> \ No newline at end of file
diff --git a/mod/blog/views/default/object/blog-comments.php b/mod/blog/views/default/object/blog-comments.php
deleted file mode 100644
index 188214ff1..000000000
--- a/mod/blog/views/default/object/blog-comments.php
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-
- /**
- * Elgg blog aggregate comments view
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.com/
- *
- * @uses $vars['comments'] Array of comments
- */
-
-?>
-
- <div class="blog-comments">
-
-<?php
- if (isset($vars['comments']) && is_array($vars['comments']) && sizeof($vars['comments']) > 0) {
-
- echo "<h3>". elgg_echo("comments") ."</h3><ol>";
- foreach($vars['comments'] as $comment) {
-
- echo elgg_view("object/blog-comment",array('entity' => $comment));
-
- }
- echo "</ol>";
-
- }
-
-?>
- <form action="<?php echo $vars['url']; ?>action/blog/comments/add" method="post">
- <h3>
- <?php echo elgg_echo("blog:comment:add"); ?>
- </h3>
- <p>
- <label><?php echo elgg_echo("blog:comment:text"); ?>
- <?php
-
- echo elgg_view("input/longtext",array('internalname' => 'comment'));
-
- ?>
- </label>
- </p>
- <p>
- <input type="hidden" name="blogpost_guid" value="<?php echo $vars['entity']->getGUID(); ?>" />
- <input type="submit" value="<?php echo elgg_echo("save"); ?>" />
- </p>
- </form>
-
- </div> \ No newline at end of file
diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php
deleted file mode 100644
index e6b6b7129..000000000
--- a/mod/blog/views/default/object/blog.php
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-
- /**
- * Elgg blog individual post view
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @copyright Curverider Ltd 2008
- * @link http://elgg.com/
- *
- * @uses $vars['entity'] Optionally, the blog post to view
- */
-
- if (isset($vars['entity'])) {
-
-?>
-
- <div class="blog-post">
- <h3><a href="<?php echo $vars['entity']->getURL(); ?>"><?php echo $vars['entity']->title; ?></a></h3>
- <p class="strapline">
- <?php
-
- echo sprintf(elgg_echo("blog:strapline"),
- date("F j",$vars['entity']->time_created)
- );
-
- ?>
- </p>
- <p style="float: left">
- <?php
- echo elgg_view("profile/icon",array('entity' => $vars['entity']->getOwnerEntity(), 'size' => 'medium'));
- ?><br />
- <a href="<?php echo $vars['url']; ?>pg/blog/<?php echo $vars['entity']->getOwnerEntity()->username; ?>"><?php echo $vars['entity']->getOwnerEntity()->name; ?></a>
- </p>
- <p style="margin-left: 110px; min-height: 110px">
- <?php
-
- echo nl2br($vars['entity']->description);
-
- ?>
- </p>
- <p style="margin-left: 110px">
- <?php
-
- echo elgg_view('output/tags', array('tags' => $vars['entity']->tags));
-
- ?>
- </p>
- <p style="margin-left: 110px">
- <?php
-
- if ($vars['entity']->canEdit()) {
-
- ?>
- <a href="<?php echo $vars['url']; ?>mod/blog/edit.php?blogpost=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("edit"); ?></a>
- <?php
-
- echo elgg_view("output/confirmlink", array(
- 'href' => $vars['url'] . "action_handler.php?action=blog/delete&blogpost=" . $vars['entity']->getGUID(),
- 'text' => elgg_echo('delete'),
- 'confirm' => elgg_echo('deleteconfirm'),
- ));
-
- // Allow the menu to be extended
- echo elgg_view("editmenu",array('entity' => $vars['entity']));
-
- ?>
- <?php
- }
-
- ?>
- </p>
- </div>
-
-<?php
-
- // If we've been asked to display the full view
- if (isset($vars['full']) && $vars['full'] == true) {
- echo elgg_view('object/blog-comments',array('entity' => $vars['entity'], 'comments' => $vars['entity']->getAnnotations('comment')));
- }
-
- // Display comments if any
- // echo elgg_view('object/blog-comments',array('entity' => $vars['entity'], 'comments' => $vars['comments']));
-
- }
-
-?> \ No newline at end of file