/[drupal]/contributions/modules/comment_revisions/comment_revisions.module
ViewVC logotype

Diff of /contributions/modules/comment_revisions/comment_revisions.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.3, Fri Jun 13 19:30:24 2008 UTC revision 1.1.2.4, Sat Jun 14 08:26:55 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: comment_revisions.module,v 1.27 2008/06/13 19:16:53 Raiden Exp $  // $Id: comment_revisions.module,v 1.40 2008/06/14 08:23:43 Raiden Exp $
3  /**  /**
4   *  @file   *  @file
5   *  Complete module for comment_revisions   *  Complete module for comment_revisions
# Line 110  function comment_revisions_menu($may_cac Line 110  function comment_revisions_menu($may_cac
110        'access' => user_access('administer GB Comment Revisions'),        'access' => user_access('administer GB Comment Revisions'),
111        'type' => MENU_NORMAL_ITEM        'type' => MENU_NORMAL_ITEM
112      );      );
113    
114        /* If permission is "view revisions" */
115      $items[] = array(      $items[] = array(
116            'path' => 'commentrevision/'.arg(1),            'path' => 'commentrevision/'.arg(1),
117            'title' => t('Revisions'),            'title' => t('Revisions'),
118            'callback' => 'comment_revisions_overview',            'callback' => 'comment_revisions_overview',
119            'callback arguments' => arg(1),            'callback arguments' => arg(1),
120            'access' => user_access('view revisions'),            'access' => user_access('view revisions') || user_access('view own revisions'),
121            'weight' => 2,            'weight' => 2,
122            'type' => MENU_CALLBACK,            'type' => MENU_CALLBACK,
123      );      );
# Line 286  function comment_revisions_link($type, $ Line 288  function comment_revisions_link($type, $
288        'href' => 'commentrevision/'. $post->cid        'href' => 'commentrevision/'. $post->cid
289      );      );
290    }    }
   
   
   
291    return $links;    return $links;
292  }  }
293    
294  /**  /**
295   * creates an overview of revisions for cid   * creates an overview of revisions for cid
296     * with permission "view own revisions"
297     */
298    function comment_revisions_overview_own($cid) {
299      global $user;
300      $creator = $user->uid;
301      echo "ELLO";
302      comment_revisions_overview($cid, $creator);
303    }
304    /**
305     * creates an overview of revisions for cid
306   */   */
307  function comment_revisions_overview($cid) {  function comment_revisions_overview($cid) {
308    global $user;    global $user;
   
309    $creator = FALSE;    $creator = FALSE;
   
310    if(user_access('view own revisions')) {    if(user_access('view own revisions')) {
311      $creator = $user->uid;      $creator = $user->uid;
312    }    }
313    $revisions=  comment_revisions_list($cid);    if(user_access('view revisions')) {
314        $creator = FALSE;
315      }
316      $revisions=  comment_revisions_list($cid, $creator);
317    $actualvid = db_result(db_query("SELECT vid FROM {comment_revisions_actual} WHERE cid=%d",$cid));    $actualvid = db_result(db_query("SELECT vid FROM {comment_revisions_actual} WHERE cid=%d",$cid));
318    $rows = array();    $rows = array();
319    

Legend:
Removed from v.1.1.2.3  
changed lines
  Added in v.1.1.2.4

  ViewVC Help
Powered by ViewVC 1.1.2