]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
new content link uses guid to make supporting groups and users easier
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 29 Dec 2010 13:33:58 +0000 (13:33 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 29 Dec 2010 13:33:58 +0000 (13:33 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7736 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/blog/languages/en.php
mod/blog/lib/blog.php
mod/blog/start.php
mod/blog/views/default/blog/group_module.php
views/default/layout/shells/content/header.php

index d247c01503b8d691d885606f65b01c101023114b..8d0ee7c44b43c5c046c0a2c3d45093afd7b37649 100644 (file)
@@ -49,7 +49,7 @@ $english = array(
        'blog:edit_revision_notice' => '(Old version)',
        'blog:message:deleted_post' => 'Blog post deleted.',
        'blog:error:cannot_delete_post' => 'Cannot delete blog post.',
-       'blog:none' => 'No blogs found',
+       'blog:none' => 'No blog posts',
        'blog:error:missing:title' => 'Please enter a blog title!',
        'blog:error:missing:description' => 'Please enter the body of your blog!',
        'blog:error:cannot_edit_post' => 'This post may not exist or you may not have permissions to edit it.',
index 3a67af1931d565aad9118f4305a7f0910079b24a..c79c863d3fe55fd76a05898acf8f4bea8c841a33 100644 (file)
@@ -256,7 +256,7 @@ function blog_get_page_content_archive($owner_guid, $lower = 0, $upper = 0) {
 }
 
 /**
- * Get page components to edit a blog post.
+ * Get page components to edit/create a blog post.
  *
  * @param string  $page     'edit' or 'new'
  * @param int     $guid     GUID of blog post or container
index 1c0cc8b21ddaad3dea43cf87f328317aba30e7f4..3a0fdc676d1d2a50fd7faef66b3cde1d53b262d9 100644 (file)
@@ -83,11 +83,10 @@ function blog_runonce() {
  *  Friends' blog:   pg/blog/friends/<username>
  *  User's archives: pg/blog/archives/<username>/<time_start>/<time_stop>
  *  Blog post:       pg/blog/read/<guid>/<title>
- *  New post:        pg/blog/new
+ *  New post:        pg/blog/new/<guid>
  *  Edit post:       pg/blog/edit/<guid>/<revision>
  *  Preview post:    pg/blog/preview/<guid>
  *  Group blog:      pg/blog/group/<guid>/owner
- *  Group new post:  pg/blog/group/<guid>/new
  *
  * Title is ignored
  *
@@ -143,19 +142,14 @@ function blog_page_handler($page) {
                        break;
                case 'new':
                        gatekeeper();
-                       $params = blog_get_page_content_edit($page_type);
+                       $params = blog_get_page_content_edit($page_type, $page[1]);
                        break;
                case 'edit':
                        gatekeeper();
                        $params = blog_get_page_content_edit($page_type, $page[1], $page[2]);
                        break;
                case 'group':
-                       if ($page[2] == 'new') {
-                               gatekeeper();
-                               $params = blog_get_page_content_edit($page_type, $page[1]);
-                       } else {
-                               $params = blog_get_page_content_list($page[1]);
-                       }
+                       $params = blog_get_page_content_list($page[1]);
                        break;
                case 'all':
                default:
index b2b98f1f599f96fdab5afea55b2be79f06ad3600..57adff67811c9bf46830836e34c5117293e31d0e 100644 (file)
@@ -30,8 +30,12 @@ $options = array(
 $content = elgg_list_entities($options);
 elgg_pop_context();
 
+if (!$content) {
+       $content = '<p>' . elgg_echo('blog:none') . '</p>';
+}
+
 $new_link = elgg_view('output/url', array(
-       'href' => "pg/blog/group/$group->guid/new",
+       'href' => "pg/blog/new/$group->guid",
        'text' => elgg_echo('blog:write'),
 ));
 $content .= "<span class='elgg-widget-more'>$new_link</span>";
index 768f26337d3b0eb33cd7059f654d9ee33a40d35b..6eae172517fcd036f9544cb697bc43797d344325 100644 (file)
@@ -26,8 +26,8 @@ if ($context) {
                $buttons = $vars['buttons'];
        } else {
                if (isloggedin() && $context) {
-                       $username = get_loggedin_user()->username;
-                       $new_link = elgg_get_array_value('new_link', $vars, "pg/$context/new/$username/");
+                       $guid = get_loggedin_userid();
+                       $new_link = elgg_get_array_value('new_link', $vars, "pg/$context/new/$guid/");
                        $params = array(
                                'href' => $new_link = elgg_normalize_url($new_link),
                                'text' => elgg_echo("$context:new"),