Changeset 137

Show
Ignore:
Timestamp:
08/17/10 13:50:36 (18 months ago)
Author:
gnum
Message:

Fixes #92, #93. Last changes and tune-ups for restoring posts and comments.

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/actions/unhide_comment.php

    r132 r137  
    44    gatekeeper(); 
    55    action_gatekeeper(); 
     6    global $CONFIG; 
    67 
    78        $id = (int) get_input('comment_id'); 
     
    2122                        register_error(elgg_echo('edufeedr:error:comment_not_unhidden')); 
    2223                } 
    23                 forward($educourse->getURL()); 
     24                forward($CONFIG->wwwroot . 'pg/edufeedr/view_hidden/' . $educourse->getGUID() . '/comments'); 
    2425        } 
    2526 
  • trunk/actions/unhide_post.php

    r132 r137  
    44    gatekeeper(); 
    55    action_gatekeeper(); 
     6    global $CONFIG; 
    67 
    78        $id = (int) get_input('post_id'); 
     
    2122                        register_error(elgg_echo('edufeedr:error:post_not_unhidden')); 
    2223                } 
    23                 forward($educourse->getURL()); 
     24                forward($CONFIG->wwwroot . 'pg/edufeedr/view_hidden/' . $educourse->getGUID() . '/posts'); 
    2425        } 
    2526 
  • trunk/start.php

    r135 r137  
    168168        register_action('edufeedr/hide_post', false, $CONFIG->pluginspath . 'edufeedr/actions/hide_post.php'); 
    169169        register_action('edufeedr/hide_comment', false, $CONFIG->pluginspath . 'edufeedr/actions/hide_comment.php'); 
    170         register_action('edufeedr/unhide_post', false, $CONFIG->pluginspath . 'edufeedr/action/unhide_post.php'); 
    171         register_action('edufeedr/unhide_comment', false, $CONFIG->pluginspath . 'edufeedr/action/unhide_comment.php'); 
     170        register_action('edufeedr/unhide_post', false, $CONFIG->pluginspath . 'edufeedr/actions/unhide_post.php'); 
     171        register_action('edufeedr/unhide_comment', false, $CONFIG->pluginspath . 'edufeedr/actions/unhide_comment.php'); 
    172172?> 
  • trunk/views/default/edufeedr/educourse_hidden.php

    r136 r137  
    1616 
    1717                        if ($posts && is_array($posts)) { 
    18                                 $body .= '<h4 style="padding-top: 15px;font-weight:bold;"><a href="' . $post['link'] . '" target="_blank">' . $post['title'] . '</a></h4>'; 
    19                                 /*translation:%s by %s*/ 
    20                                 $body .= '<em>' . sprintf(elgg_echo('edufeedr:blog:by'), date('d.m.Y G:i', $post['date']), $post['author']) . '</em>'; 
    21                                 /*translation:restore*/ 
    22                                 $body .= '<a href="'.$vars['url'].'action/edufeedr/unhide_post?post_id='.$post['id'].'&educourse='.$vars['entity']->getGUID().'&__elgg_ts='.$ts.'&__elgg_token='.$token.'">' . elgg_echo('edufeedr:action:unhide') . '</a>'; 
     18                                foreach ($posts as $post) { 
     19                                    $body .= '<h4 style="padding-top: 15px;font-weight:bold;"><a href="' . $post['link'] . '" target="_blank">' . $post['title'] . '</a></h4>'; 
     20                                    /*translation:%s by %s*/ 
     21                                    $body .= '<em>' . sprintf(elgg_echo('edufeedr:blog:by'), date('d.m.Y G:i', $post['date']), $post['author']) . '</em>'; 
     22                                    /*translation:restore*/ 
     23                                    $body .= '<a href="'.$vars['url'].'action/edufeedr/unhide_post?post_id='.$post['id'].'&educourse='.$vars['entity']->getGUID().'&__elgg_ts='.$ts.'&__elgg_token='.$token.'">' . elgg_echo('edufeedr:action:unhide') . '</a>'; 
     24                                } 
    2325                        } 
    2426 
     
    2628                        $comments = $es->getHiddenCommentsByCourse($vars['entity']->getGUID()); 
    2729                        if ($comments && is_array($comments)) { 
    28                                 $body .= '<div class="edufeedr_post_comment">'; 
    29                                 $body .= '<h4 style="padding-top:15px;font-weight:bold;"><a href="'.$comment['link'].'">'.$comment['title'].'</a></h4>'; 
    30                                 $body .= '<em>' . date('d.m.Y G:i', $comment['date']) . '</em>'; 
    31                                 /*translation:restore*/ 
    32                                 $body .= '<a href="'.$vars['url'].'action/edufeedr/unhide_comment?comment_id='.$comment['id'].'&educourse='.$vars['entity']->getGUID().'&__elgg_ts='.$ts.'&__elgg_token='.$token.'">' . elgg_echo('edufeedr:action:unhide') . '</a>'; 
    33                                 $body .= '</div>'; 
     30                                foreach($comments as $comment) { 
     31                                    $body .= '<div class="edufeedr_post_comment">'; 
     32                                    $body .= '<h4 style="padding-top:15px;font-weight:bold;"><a href="'.$comment['link'].'" target="_blank">'.$comment['title'].'</a></h4>'; 
     33                                    $body .= '<em>' . date('d.m.Y G:i', $comment['date']) . '</em>'; 
     34                                    /*translation:restore*/ 
     35                                    $body .= '<a href="'.$vars['url'].'action/edufeedr/unhide_comment?comment_id='.$comment['id'].'&educourse='.$vars['entity']->getGUID().'&__elgg_ts='.$ts.'&__elgg_token='.$token.'">' . elgg_echo('edufeedr:action:unhide') . '</a>'; 
     36                                    $body .= '</div>'; 
     37                                } 
    3438 
    3539                        }