Changeset 127

Show
Ignore:
Timestamp:
01/02/09 17:24:11 (20 months ago)
Author:
kester
Message:

og module upgrade to DRUPAL-5--8-0-RC1

Location:
external/current/sites/all/modules/og
Files:
47 added
1 removed
15 modified

Legend:

Unmodified
Added
Removed
  • external/current/sites/all/modules/og/README.txt

    r42 r127  
    4242INTEGRATION 
    4343--------------------- 
    44 - I recommend enabling the job_queue.module. When you do, group email notifications are sent during cron runs, instead of immediately after a post is submitted. This speeds up posting a lot, for big groups. The delay also helps authors fix typos in their posts before the mail is sent. 
    4544- This module exposes an API for retrieving and managing membership via direct PHP functions [og_save_subscription()] and via XMLRPC. 
     45- Enabling og_notifications provides subscription support for groups and group 
     46posts. The README in the og_notifications directory provides more information. 
    4647 
    4748UNIT TESTING 
  • external/current/sites/all/modules/og/includes/groupcontent.inc

    r42 r127  
    66    'icon' => 'user-multiple.png', 
    77    'path' => drupal_get_path('module', 'og_panels'). '/', 
    8     'description' => t('The welcome message for the group. Specified on group edit form'), 
     8    'description' => t('The welcome message for the group. Specified on group edit form.'), 
    99    'required context' => new panels_required_context(t('Group'), 'group'), 
    1010    'category' => array(t('Organic groups'), -10), 
     
    184184    '#type' => 'textfield', 
    185185    '#title' => t('Number of members'), 
    186     '#description' => t('Maximum number of members that should appear on the list'), 
     186    '#description' => t('Maximum number of members that should appear on the list.'), 
    187187    '#default_value' => isset($conf['num_items']) ? $conf['num_items'] : 10, 
    188188    '#size' => 5, 
  • external/current/sites/all/modules/og/includes/groupcontext.inc

    r42 r127  
    11<?php 
    2 // $Id: groupcontext.inc,v 1.1.2.3 2008/03/22 21:50:52 weitzman Exp $ 
     2// $Id: groupcontext.inc,v 1.1.2.4 2008/05/26 14:03:35 weitzman Exp $ 
    33/** 
    44 * @file contexts/group.inc 
     
    3535      '#type' => 'checkbox', 
    3636      '#default_value' => $conf['external'], 
    37       '#title' => t('Require this context from an external source (such as containing panel page)'), 
     37      '#title' => t('Require this context from an external source (such as containing panel page).'), 
    3838      '#description' => t('If selected, group selection (below) will be ignored'), 
    3939    ); 
  • external/current/sites/all/modules/og/og.info

    r42 r127  
    33package = "Organic groups" 
    44dependencies = views views_rss 
    5 ; Information added by drupal.org packaging script on 2008-05-12 
    6 version = "5.x-7.2" 
    7 project = "og" 
    8 datestamp = "1210629035" 
    9  
  • external/current/sites/all/modules/og/og.install

    r42 r127  
    11<?php 
    2 // $Id: og.install,v 1.21.2.31 2008/05/05 21:27:57 weitzman Exp $ 
     2// $Id: og.install,v 1.21.2.32.2.8 2008/10/09 15:06:14 weitzman Exp $ 
    33 
    44function og_install() { 
     
    1313        register int(1) NOT NULL default 0, 
    1414        directory int(1) NOT NULL default 0, 
    15         notification int(1) NOT NULL default 0, 
    1615        language varchar(12) NOT NULL default '', 
    1716        private int(1) NOT NULL default 0, 
     
    2524        is_admin int(1) NOT NULL DEFAULT 0, 
    2625        uid int(11) NOT NULL, 
    27         mail_type int(11) NULL, 
    28         created int(11) NULL DEFAULT 0, 
    29         changed int(11) NULL DEFAULT 0, 
     26        created int(11) NULL DEFAULT 0, 
     27        changed int(11) NULL DEFAULT 0, 
    3028        PRIMARY KEY  (nid, uid) 
    3129      ) /*!40100 DEFAULT CHARACTER SET utf8 */;"); 
    3230       
    33       db_query("CREATE TABLE {og_uid_global} ( 
    34         uid int(11) NOT NULL, 
    35         og_email int(11) NOT NULL DEFAULT 2, 
    36         PRIMARY KEY  (uid) 
    37       ) /*!40100 DEFAULT CHARACTER SET utf8 */;"); 
    3831      db_query("CREATE TABLE {og_ancestry} ( 
    3932        nid int(11) NOT NULL, 
     
    5346        register smallint NOT NULL default 0, 
    5447        directory smallint NOT NULL default 0, 
    55         notification smallint NOT NULL default 0, 
    5648        language varchar(12) NOT NULL default '', 
    5749        private smallint NOT NULL default 0,   
     
    6557        is_admin smallint NOT NULL DEFAULT 0, 
    6658        uid int NOT NULL, 
    67         mail_type int NULL, 
    68             created int NULL DEFAULT 0, 
    69             changed int NULL DEFAULT 0, 
     59        created int NULL DEFAULT 0, 
     60        changed int NULL DEFAULT 0, 
    7061        PRIMARY KEY  (nid, uid) 
    7162      );"); 
    7263       
    73       db_query("CREATE TABLE {og_uid_global} ( 
    74         uid int NOT NULL, 
    75         og_email int NOT NULL DEFAULT 2, 
    76         PRIMARY KEY (uid) 
    77       );"); 
    78        
    79       db_query(" 
    80       CREATE TABLE {og_ancestry} ( 
     64      db_query("CREATE TABLE {og_ancestry} ( 
    8165       nid int NOT NULL, 
    8266       group_nid int NOT NULL, 
     
    8973   
    9074  // enable standard og blocks. for custom profiles, block may not be included yet. 
    91   if (function_exists('block_rehash')) { 
     75  if (function_exists('_block_rehash')) { 
    9276    _block_rehash(); 
    9377  } 
     
    312296} 
    313297 
    314 // populate the og_uid_global table. we have to choose selective here for backward compatibility.  
    315 // to set everyone up for 'always' notifications, run this after the update: UPDATE og_uid_global SET og_email=1 
     298// populate the og_uid_global table. we have to choose selective here for  
     299// backward compatibility. To set everyone up for 'always' notifications, run 
     300// this after the update: UPDATE og_uid_global SET og_email=1 
     301// og_uid_global is later moved into og_notifications. This update is only 
     302// around to retain schema consistency - the population script has been removed. 
    316303function og_update_13() { 
    317304  switch ($GLOBALS['db_type']) {  
     
    332319      break; 
    333320  } 
    334    
    335   // works for mysql and postgres 
    336   $sql = 'SELECT uid FROM {users} WHERE uid > 0'; 
    337   $result = db_query($sql); 
    338   while ($row = db_fetch_object($result)) { 
    339     $sql = "INSERT INTO {og_uid_global} (uid, og_email) VALUES (%d, %d)"; 
    340     db_query($sql, $row->uid, OG_NOTIFICATION_SELECTIVE); 
    341   } 
     321 
    342322  return array(); 
    343323} 
     
    424404} 
    425405 
     406// Formerly contained og_uid_global code which is no longer required. 
    426407function og_update_19() { 
    427   og_populate_uid_global_table(); 
    428   return array('Populated og_uid_global table'); 
     408  return array(); 
    429409} 
    430410 
     
    464444  $ret = array(); 
    465445  if (variable_get('og_enabled', FALSE) && !module_exists('og_access')) { 
    466     module_enable('og_access'); 
     446    drupal_install_modules(array('og_access')); 
    467447  } 
    468448  // variable_del('og_enabled'); is harmless to leave around, and will help if someone reruns the update. 
     
    497477   return $ret; 
    498478 } 
    499  
    500 // end updates // 
    501  
    502 function og_enable() { 
    503   og_populate_uid_global_table(); 
    504 } 
    505  
    506 // need to populate og_uid_global for existing users on enable 
    507 // this is called from update 13 & 19 & og_enable.  
    508 // TODO: conditionally use subquery 
    509 function og_populate_uid_global_table() { 
    510   $sql = 'SELECT u.uid FROM {users} u LEFT JOIN {og_uid_global} oug ON u.uid=oug.uid WHERE u.uid > 0 AND oug.og_email IS NULL'; 
    511   $result = db_query($sql); 
    512   while ($row = db_fetch_object($result)) { 
    513     $sql = "INSERT INTO {og_uid_global} (uid, og_email) VALUES (%d, %d)"; 
    514     db_query($sql, $row->uid, OG_NOTIFICATION_SELECTIVE); 
    515   } 
    516 } 
     479  
     480 /** 
     481  * Force menu rebuild since subscribe/unsubscribe paths are better protected now. 
     482  */  
     483 function og_update_5702() { 
     484   $ret[] = array('success' => TRUE, 'query' => 'Menu has been rebuilt.'); 
     485   menu_rebuild(); 
     486   return $ret; 
     487 } 
     488  
     489/** 
     490 * Notifications upgrade: Set flag to indicate that this is an upgraded  
     491 * installation. 
     492 */  
     493function og_update_5703() { 
     494  // Remove mail / no mail options from OG group types and move preferences to 
     495  // og_notifications. 
     496  $types = og_get_types('group_post'); 
     497  $mail_types = array(); 
     498  foreach ($types as $type) { 
     499    $variable = 'og_content_type_usage_'. $type; 
     500    $usage = variable_get($variable, ''); 
     501    switch ($usage) { 
     502      case 'group_post_standard_mail': 
     503        $mail_types[$type] = $type; 
     504      case 'group_post_standard_nomail': 
     505        variable_set($variable, 'group_post_standard'); 
     506        break; 
     507      case 'group_post_wiki_mail': 
     508        $mail_types[$type] = $type; 
     509      case 'group_post_wiki_nomail': 
     510        variable_set($variable, 'group_post_wiki'); 
     511        break; 
     512    } 
     513  } 
     514  // Set variable for og_notifications. If it is never enabled, this variable 
     515  // is also deleted in og_uninstall. 
     516  variable_set('og_notifications_content_types', $mail_types); 
     517 
     518  // Vestigial variable. 
     519  variable_del('og_omitted_email_node_types'); 
     520 
     521  // Set update flag for og_notifications. 
     522  variable_set('og_notifications_update_required', 1); 
     523 
     524  return array(); 
     525} 
     526 
     527 // end updates // 
    517528 
    518529function og_uninstall() { 
     
    520531  db_query('DROP TABLE {og}'); 
    521532  db_query('DROP TABLE {og_uid}'); 
    522   db_query('DROP TABLE {og_uid_global}'); 
    523533  db_query('DROP TABLE {og_ancestry}'); 
     534 
     535  // In case og_notifications has never been enabled, the vestigial  
     536  // og_uid_global table will still be around.  
     537  if (variable_get('og_notifications_update_required', FALSE)) { 
     538    db_query('DROP TABLE {og_uid_global}'); 
     539  } 
    524540 
    525541  // Delete variables 
     
    527543    'og_member_pics', 'og_help', 'og_block_cnt_2', 'og_block_cnt_3', 
    528544    'og_audience_checkboxes', 'og_omitted', 'og_content_type_usage', 
    529     'og_audience_required', 'og_omitted_email_node_types', 
     545    'og_audience_required', 
    530546    'og_visibility_directory', 'og_visibility_registration', 
    531547    'og_home_page_view', 'og_email_max', 'og_node_types', 
     
    536552    'og_new_admin_body', 'og_new_admin_subject', 
    537553    'og_new_node_body', 'og_new_node_subject', 
    538     'og_notification', 'og_request_user_body', 'og_request_user_subject', 
     554    'og_request_user_body', 'og_request_user_subject', 
     555    'og_notifications_update_required', 'og_notifications_content_types' 
    539556  ); 
    540557  foreach ($variables as $variable) { 
  • external/current/sites/all/modules/og/og.module

    r42 r127  
    11<?php 
    2 // $Id: og.module,v 1.298.2.185 2008/05/08 19:49:26 weitzman Exp $ 
     2// $Id: og.module,v 1.298.2.197.2.15 2008/11/02 20:30:45 weitzman Exp $ 
    33 
    44// Selective groups states. chosen by the group admin 
     
    1919define('OG_DIRECTORY_CHOOSE_TRUE', 2); 
    2020define('OG_DIRECTORY_CHOOSE_FALSE', 3); 
    21  
    22 // site admin chooses in og_admin_settings() whether new registrants receive group email notifications by default 
    23 define('OG_NOTIFICATION_NEVER', 0); 
    24 define('OG_NOTIFICATION_ALWAYS', 1); 
    25 define('OG_NOTIFICATION_SELECTIVE', 2); 
    2621 
    2722function og_help($section) { 
     
    4136  if ($may_cache) { 
    4237    // anon users should be able to get to the join page 
    43     $items[] = array('path' => 'og/subscribe', 'type' => MENU_CALLBACK, 'callback' => 'og_subscribe', 'access' => TRUE, 'title' => t('Join group')); 
     38    $items[] = array('path' => 'og/subscribe', 'type' => MENU_CALLBACK, 'callback' => 'og_menu_check_node_view', 'access' => TRUE, 'callback arguments' => array('og_subscribe'), 'title' => t('Join group')); 
    4439     
    4540    $items[] = array('path' => 'og/opml', 'type' => MENU_CALLBACK, 'callback' => 'og_opml', 'access' => $access, 'title' => t('OPML')); 
    46     $items[] = array('path' => 'og/unsubscribe', 'type' => MENU_CALLBACK, 'callback' => 'og_unsubscribe', 'access' => $access, 'title' => t('Leave group')); 
     41    $items[] = array('path' => 'og/unsubscribe', 'type' => MENU_CALLBACK, 'callback' => 'og_menu_check_node_view', 'callback arguments' => array('og_unsubscribe'), 'access' => $access, 'title' => t('Leave group')); 
    4742    $items[] = array('path' => 'og/approve', 'type' => MENU_CALLBACK, 'callback' => 'og_approve', 'access' => $access, 'title' => t('Approve membership request')); 
    4843    $items[] = array('path' => 'og/deny', 'type' => MENU_CALLBACK, 'callback' => 'og_deny', 'access' => $access, 'title' => t('Deny membership request')); 
     
    6661      'path' => 'admin/og',  
    6762      'title' => t('Organic groups'), 
    68       'description' => t('Administer the suite of Organic groups modules.'), 
     63      'description' => t('Administer the suite of organic groups modules.'), 
    6964      'position' => 'right', 
    7065      'weight' => -5, 
     
    7873     
    7974    // we get a NOTICE if doing this from within og_theme() so I do it here for now. 
    80     $_SESSION['og_last'] = og_get_group_context(); 
     75    if ($group_node = og_get_group_context()) { 
     76      if ($user->uid || variable_get('cache', CACHE_DISABLED) == CACHE_DISABLED) { 
     77        $_SESSION['og_last'] = og_get_group_context(); 
     78      } 
     79    } 
    8180 
    8281    //membership page and its 'add members' tab 
     
    9291      $items[] = array('path' => "og/users/$gid/add_user", 'callback' => 'drupal_get_form', 'title' => t('Add members'), 'callback arguments' => array('og_add_users', $gid), 'type' => MENU_LOCAL_TASK, 'weight' => 5, 'access' => og_is_node_admin($node)); 
    9392    } 
    94      
    95     // email tab on group node 
     93 
     94    // Broadcast tab on group node. 
    9695    if (arg(0) == 'node' && is_numeric(arg(1))) { 
    9796      $node = node_load(arg(1)); 
    9897      if (og_is_group_type($node->type)) { 
    99         $items[] = array('path' => 'node/'. arg(1). '/email', 'title' => t('E-mail'), 'callback' => 'drupal_get_form', 'callback arguments' => array('og_email_form', arg(1)), 'access' => og_is_node_admin($node), 'type' => MENU_LOCAL_TASK, 'weight' => 7); 
     98        $items[] = array( 
     99          'path' => 'node/'. arg(1) .'/broadcast', 
     100          'title' => t('Broadcast'), 
     101          'callback' => 'drupal_get_form', 
     102          'callback arguments' => array('og_broadcast_form', arg(1)), 
     103          'access' => og_broadcast_access($node), 
     104          'type' => MENU_LOCAL_TASK, 
     105          'weight' => 7 
     106        ); 
    100107      } 
    101108    } 
     
    119126    drupal_access_denied(); 
    120127  } 
     128} 
     129 
     130// check for node access 'view' and then pass along to the real menu callback 
     131// arguments must be in this order: function, $gid, <extra params required by function> 
     132function og_menu_check_node_view() { 
     133  global $user; 
     134 
     135  $args = func_get_args(); 
     136  $function = array_shift($args); 
     137  $gid = $args[0]; 
     138  $node = node_load((int)$gid); 
     139  if (node_access('view', $node)) { 
     140    return call_user_func_array($function, $args); 
     141  } 
     142  else { 
     143    drupal_access_denied(); 
     144  } 
     145   
    121146} 
    122147 
     
    280305 
    281306/** 
    282  * Admins may broadcast email to all their members 
     307 * Admins may broadcast messages to all their members. 
    283308 * 
    284309 * @param $gid 
    285310 *   the nid of a group. 
    286311 */ 
    287  function og_email_form($gid) { 
     312 function og_broadcast_form($gid) { 
    288313  $node = node_load($gid); 
    289   drupal_set_title(t('Send email to %group', array('%group' => $node->title))); 
     314  drupal_set_title(t('Send message to %group', array('%group' => $node->title))); 
    290315   
    291316  $result = db_query(og_list_users_sql(1), $gid); 
    292317  $txt = format_plural(db_num_rows($result), 'the sole member', 'all @count members'); 
    293318  if (!$_POST) { 
    294     drupal_set_message(t('Your email will be sent to !count in this group. Please use this feature sparingly.', array('!count' => l($txt, "og/users/$gid")))); 
    295   } 
    296  
    297   $form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#size' => 70, '#maxlength' => 250, '#description' => t("Enter a subject for your email."), '#required' => true); 
    298   $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#rows' => 5, '#cols' => 90, '#description' => t('Enter a body for your email.'), '#required' => true); 
    299   $form['send'] = array('#type' => 'submit', '#value' => t('Send email')); 
     319    drupal_set_message(t('Your message will be sent to !count in this group.', array('!count' => l($txt, "og/users/$gid")))); 
     320  } 
     321 
     322  $form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#size' => 70, '#maxlength' => 250, '#description' => t("Enter a subject for your message."), '#required' => true); 
     323  $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#rows' => 5, '#cols' => 90, '#description' => t('Enter the body of your message.'), '#required' => true); 
     324  $form['send'] = array('#type' => 'submit', '#value' => t('Send message')); 
    300325  $form['gid'] = array('#type' => 'value', '#value' => $gid); 
    301326  return $form; 
    302327} 
    303328 
    304 function og_email_form_submit($form_id, $form_values) { 
     329function og_broadcast_form_submit($form_id, $form_values) { 
     330  global $user; 
     331 
     332  $sql = og_list_users_sql(1); 
     333  $result = db_query($sql, $form_values['gid']); 
     334  $recipients = array(); 
     335  while ($row = db_fetch_object($result)) { 
     336    $recipients[] = $row->uid; 
     337  } 
     338 
    305339  $node = node_load($form_values[gid]); 
    306  
    307340  $variables = array( 
    308341    '@group' => $node->title, 
     
    312345    '!url_unsubscribe' => url("og/unsubscribe/$node->nid", NULL, NULL, TRUE) 
    313346  ); 
    314    
    315   global $user; 
    316   $from = $user->mail; 
    317   $sql = og_list_users_sql(1); 
    318   $result = db_query($sql, $form_values['gid']); 
    319   while ($row = db_fetch_object($result)) { 
    320      $emails[] = $row->mail; 
    321   } 
    322   foreach ($emails as $mail) { 
    323     drupal_mail('og_mail', trim($mail), $form_values['subject'], _og_user_mail_text('og_admin_email_body', $variables), $from); 
    324   } 
    325   drupal_set_message(format_plural(count($emails), '1 email sent.', '@count emails sent')); 
     347  $message = array( 
     348    'from' => $user, 
     349    'subject' => $form_values['subject'], 
     350    'body' => _og_user_mail_text('og_admin_email_body', $variables) 
     351  ); 
     352 
     353  // Send notifications to each member; Sending an array of recipients implies 
     354  // that this is a bulk message. 
     355  module_invoke_all('og', 'user broadcast', $gid, $recipients, $message); 
     356  drupal_set_message(format_plural(count($recipients), '1 message queued for delivery.', '@count messages queued for delivery.')); 
     357 
    326358  drupal_goto("node/{$form_values[gid]}"); 
    327359} 
     
    330362  global $user; 
    331363 
    332   // warn users who can't receive mail anyway 
    333   if ($txt = user_validate_mail($user->mail)) { 
    334     drupal_set_message($txt, 'error'); 
    335     return ''; 
    336   } 
    337    
    338364  $group = node_load($gid); 
    339365  $bc[] = array('path' => "og", 'title' => t('Groups')); 
     
    362388  } 
    363389 
    364   switch ($user->og_email) { 
    365     // og_email can be NULL when you enable og on an existing site. 
    366     case NULL: 
    367     case OG_NOTIFICATION_SELECTIVE: 
    368       $form['mail_type'] = array('#type' => 'radios', '#title' => t('Email notification'), '#default_value' => $user->og_groups[$group->nid]['mail_type'], '#options' => array(1 => t('enabled'), 0 => t('disabled')), '#description' => t('Do you want to receive an email each time a message is posted to this group?')); 
    369       $submit = TRUE; 
    370       break; 
    371     case OG_NOTIFICATION_ALWAYS: 
    372       $form['mail_type'] = array('#type' => 'item', '#title' => t('Email notification'), '#value' => t('Your <a href="!prof">personal profile</a> is configured to: <em>Always receive email notifications</em>.', array('!prof' => url("user/$user->uid/edit"))));  
    373       break; 
    374     case OG_NOTIFICATION_NEVER: 
    375       $form['mail_type'] = array('#type' => 'item', '#title' => t('Email notification'), '#value' => t('Your <a href="!prof">personal profile</a> is configured to: <em>Never receive email notifications</em>.', array('!prof' => url("user/$user->uid/edit"))));  
    376       break; 
    377   } 
    378   if ($submit) { 
    379     $form['op'] = array('#type' => 'submit', '#value' => t('Submit')); 
    380   } 
    381390  $form['gid'] = array('#type' => 'value', '#value' => $group->nid); 
    382391  return $form; 
     
    397406 * @param $uid user ID of user 
    398407 * @param $args an array with details of this membership. Possible array keys are: 
    399      is_active, is_admin, mail_type, created 
     408     is_active, is_admin, created 
    400409 */ 
    401410function og_save_subscription($gid, $uid, $args = array()) { 
     
    403412  $cnt = db_result(db_query($sql, $gid, $uid)); 
    404413  $time = time(); 
     414   
     415  // Allow other modules to pass their data inside the $args. 
     416  $og_allowed_args = array('is_active', 'is_admin', 'created'); 
     417  $return_args = $args; 
     418  foreach ($args as $key => $value) { 
     419    if (!in_array($key, $og_allowed_args)) { 
     420      unset($args[$key]); 
     421    } 
     422  } 
    405423  if ($cnt == 0) { 
    406424    // this pattern borrowed from user_save() 
     
    411429      $fields[] = db_escape_string($key); 
    412430      $values[] = $value; 
    413       $s[] = "'%s'"; 
     431      $s[] = "'%s'";         
    414432    } 
    415433    db_query('INSERT INTO {og_uid} ('. implode(', ', $fields). ') VALUES (%d, %d, %d, %d, '. implode(', ', $s). ')', $values); 
    416     module_invoke_all('og', 'user insert', $gid, $uid, $args); 
     434    module_invoke_all('og', 'user insert', $gid, $uid, $return_args); 
    417435  } 
    418436  else { 
     
    423441    $cond = implode(', ', $cond); 
    424442    db_query("UPDATE {og_uid} SET $cond WHERE nid = %d AND uid = %d", $gid, $uid); 
    425     module_invoke_all('og', 'user update', $gid, $uid, $args); 
    426   } 
    427 } 
    428  
    429 function og_delete_subscription($gid, $uid){ 
     443    module_invoke_all('og', 'user update', $gid, $uid, $return_args); 
     444  } 
     445} 
     446 
     447function og_delete_subscription($gid, $uid, $args = array()){ 
    430448  $sql = "DELETE FROM {og_uid} WHERE nid = %d AND uid = %d"; 
    431449  db_query($sql, $gid, $uid); 
    432   module_invoke_all('og', 'user delete', $gid, $uid, array()); 
     450  // Allow other modules to pass their data inside the $args. 
     451  module_invoke_all('og', 'user delete', $gid, $uid, $args); 
    433452} 
    434453 
     
    442461    } 
    443462    if (in_array($gid, array_keys($account->og_groups))) { 
    444       drupal_set_message(t("!name already approved to group %group", array('!name' => theme('username', $account), '%group' => $node->title)), 'error'); 
     463      drupal_set_message(t("!name already approved to group %group.", array('!name' => theme('username', $account), '%group' => $node->title)), 'error'); 
    445464      return ''; 
    446465    } 
     
    450469            
    451470      $variables = array( 
    452          '@title' => $node->title, 
    453          '!group_url'=> url("node/$node->nid", NULL, NULL, TRUE) 
    454       );      
    455        
    456       $from = variable_get('site_mail', ini_get('sendmail_from')); 
    457       $account = user_load(array('uid' => $uid)); 
    458       drupal_mail('og_approve', $account->mail, _og_user_mail_text('og_approve_user_subject', $variables), _og_user_mail_text('og_approve_user_body', $variables), $from); 
     471        '@title' => $node->title, 
     472        '!group_url'=> url("node/$node->nid", NULL, NULL, TRUE) 
     473      ); 
     474      $message = array( 
     475        'subject' => _og_user_mail_text('og_approve_user_subject', $variables), 
     476        'body' => _og_user_mail_text('og_approve_user_body', $variables) 
     477      ); 
     478 
     479      module_invoke_all('og', 'user approve', $gid, $uid, $message); 
    459480      drupal_goto("node/$gid"); 
    460481    } 
     
    473494    $variables = array( 
    474495      '@title' => $node->title, 
    475       '!group_url' => url("node/$node->nid", NULL, NULL, TRUE) 
     496      '!group_url'=> url("node/$node->nid", NULL, NULL, TRUE) 
    476497    ); 
    477      
    478     $from = variable_get('site_mail', ini_get('sendmail_from')); 
    479     $account = user_load(array('uid' => $uid)); 
    480     drupal_mail('og_deny', $account->mail, _og_user_mail_text('og_deny_user_subject', $variables), _og_user_mail_text('og_deny_user_body', $variables), $from); 
     498    $message = array( 
     499      'subject' => _og_user_mail_text('og_deny_user_subject', $variables), 
     500      'body' => _og_user_mail_text('og_deny_user_body', $variables) 
     501    ); 
     502 
     503    module_invoke_all('og', 'user deny', $gid, $uid, $message); 
    481504    drupal_goto("node/$gid"); 
    482505  } 
     
    519542   
    520543  og_save_subscription($node->nid, $account->uid, array('is_admin' => 1)); 
    521   drupal_set_message(t('%name was promoted to %ga', array('%name' => $account->name, '%ga' => t('group administrator')))); 
     544  drupal_set_message(t('%name was promoted to %ga.', array('%name' => $account->name, '%ga' => t('group administrator')))); 
    522545   
    523546  $variables = array( 
     
    526549    '@username' => $account->name 
    527550  ); 
    528    
    529   $from = variable_get('site_mail', ini_get('sendmail_from')); 
    530   drupal_mail('og_new_admin', $account->mail, _og_user_mail_text('og_new_admin_subject', $variables), _og_user_mail_text('og_new_admin_body', $variables), $from); 
     551  $message = array( 
     552    'subject' => _og_user_mail_text('og_new_admin_subject', $variables), 
     553    'body' => _og_user_mail_text('og_new_admin_body', $variables) 
     554  ); 
     555 
     556  module_invoke_all('og', 'admin create', $node->nid, $account->uid, $message); 
    531557  return "og/users/$node->nid"; 
    532558} 
     
    564590  $gid = $form_values['gid']; 
    565591  og_save_subscription($gid, $account->uid, array('is_admin' => 0)); 
    566   drupal_set_message(t('%name is no longer a %ga', array('%name' => $account->name, '%ga' => t('group administrator')))); 
     592  drupal_set_message(t('%name is no longer a %ga.', array('%name' => $account->name, '%ga' => t('group administrator')))); 
    567593  return "og/users/$gid"; 
    568594} 
     
    599625  $emails = explode(',', $mails); 
    600626  if (count($emails) > $max) { 
    601     form_set_error('mails', t("You may not specify more than %max email addresses or usernames.", array('%max' => $max))); 
     627    form_set_error('mails', t('You may not specify more than %max email addresses or usernames.', array('%max' => $max))); 
    602628  } 
    603629  elseif (in_array($user->mail, $emails)) { 
    604     form_set_error('mails', t("You may not invite yourself - @self", array('@self' => $user->mail))); 
     630    form_set_error('mails', t('You may not invite yourself - @self', array('@self' => $user->mail))); 
    605631  } 
    606632  else { 
     
    626652    } 
    627653    if (count($bad)) { 
    628       form_set_error('mails', t('invalid email address or username: '). implode(' ', $bad)); 
     654      form_set_error('mails', t('Invalid email address or username:') .' '. implode(' ', $bad)); 
    629655    } 
    630656    else { 
     
    670696  } 
    671697  $node = node_load($gid); 
    672   if ($node->og_selective >= OG_INVITE_ONLY || $node->status == 0) { 
     698  if ($node->og_selective >= OG_INVITE_ONLY || $node->status == 0 || !og_is_group_type($node->type)) { 
    673699    drupal_access_denied(); 
    674700    exit(); 
     
    718744 
    719745/** 
    720  * Create a new membership for a given user to given group and send proper email. Edits to membership should  
     746 * Create a new membership for a given user to given group. Edits to membership should  
    721747 * go through og_save_subscription(). No access control since this is an API function. 
    722748 * 
     
    729755    case OG_MODERATED: 
    730756      og_save_subscription($gid, $account->uid, array('is_active' => 0)); 
     757 
    731758      $sql = og_list_users_sql(1, 1); 
    732759      $res = db_query($sql, $node->nid); 
     760      $admins = array(); 
    733761      while ($row = db_fetch_object($res)) { 
    734         if ($row->mail) { 
    735           $admins[] = $row->mail; 
     762        $admins[] = $row->uid; 
     763      } 
     764 
     765      if (!empty($admins)) { 
     766        // Prepend user's request text with standard cruft. Should be a 
     767        // variable but that's a bit annoying. 
     768        if ($request) { 
     769          $request = t("\n\nPersonal message from @name:\n------------------\n\n@request", array('@name' => $account->name, '@request' => $request)); 
    736770        } 
    737       } 
    738       if ($admins) {         
    739771        $variables = array( 
    740772          '@group' => $node->title, 
     
    743775          '!group_url' => url("og/users/$node->nid", NULL, NULL, TRUE) 
    744776        ); 
    745          
    746         $from = variable_get('site_mail', ini_get('sendmail_from')); 
    747         // prepend user's request text with standard cruft. should be a mail variable but thats a bit annoying 
    748         if ($request) { 
    749           $request = t("\n\nPersonal message from @name:\n------------------\n\n@request", array('@name' => $account->name, '@request' => $request)); 
    750         } 
    751         drupal_mail('og_subscription_request', implode(', ', $admins), _og_user_mail_text('og_request_user_subject', $variables), _og_user_mail_text('og_request_user_body', $variables). $request, $from); 
    752       } 
     777        $message = array( 
     778          'subject' => _og_user_mail_text('og_request_user_subject', $variables), 
     779          'body' => _og_user_mail_text('og_request_user_body', $variables) . $request 
     780        ); 
     781 
     782        // Send notifications to each admin; Sending an array of recipients 
     783        // implies that this is a bulk message. 
     784        module_invoke_all('og', 'user request', $gid, $admins, $message); 
     785      } 
     786 
    753787      $return_value = array('type' => 'approval', 
    754788                            'message' => t('Membership request to the %group group awaits approval by an administrator.', array('%group' => $node->title))); 
     
    758792      og_save_subscription($gid, $account->uid, array('is_active' => 1)); 
    759793      $return_value = array('type' => 'subscribed', 
    760                             'message' => t('You are now a member of the %group', array('%group' => $node->title))); 
     794                            'message' => t('You are now a member of the %group.', array('%group' => $node->title))); 
    761795      break; 
    762796    case OG_CLOSED: 
     
    780814  } 
    781815  $node = node_load($gid); 
    782   if ($uid != $user->uid && !og_is_node_admin($node)) { 
    783     // only admins can remove another member 
     816  $account = user_load(array('uid' => $uid)); 
     817  if (!in_array($gid, array_keys(og_get_subscriptions($account->uid, 0))) || ($uid != $user->uid && !og_is_node_admin($node))) { 
     818    // Ubsubscribee must be a member or awaiting approval 
     819    // Only admins can remove another member. 
    784820    drupal_access_denied(); 
    785821    exit(); 
    786822  } 
    787   if (($node->og_selective == OG_CLOSED && !og_is_node_admin($node)) || $node->uid == $uid){ 
     823  if (!og_is_group_type($node->type) || ($node->og_selective == OG_CLOSED && !og_is_node_admin($node)) || $node->uid == $uid){ 
    788824    // Regular users may not leave from a closed group 
    789825    // Group manager may never leave (TODO: fix), such a link should never be generated 
     
    880916    } 
    881917    else { 
    882       $bad[] = $name; 
     918      $bad[] = check_plain($name); 
    883919      $err = TRUE; 
    884920    } 
    885921  } 
    886922  if ($err) { 
    887     form_set_error('og_names', t('Unrecognized %names: ', array('%names' => format_plural(count($bad), 'name', 'names'))). implode(', ', $bad)); 
     923    form_set_error('og_names', t('Unrecognized %names:', array('%names' => format_plural(count($bad), 'name', 'names'))) .' '. implode(', ', $bad)); 
    888924  } 
    889925} 
     
    901937    og_save_subscription($form_values['gid'], $account->uid, array('is_active' => 1)); 
    902938  } 
    903   drupal_set_message(format_plural(count($accounts), '1 user added to the group', '@count users added to the group')); 
     939  drupal_set_message(format_plural(count($accounts), '1 user added to the group.', '@count users added to the group.')); 
    904940} 
    905941 
     
    912948  // prepend the group manager 
    913949  $i=0; 
    914   $rows[$i][] = array('data' => theme('username', $node). '&nbsp;<em>'. t('manager'). '</em>', 'colspan' => 3); 
     950  $rows[$i][] = array('data' => theme('username', $node). '&nbsp;<em>'. t('Manager'). '</em>', 'colspan' => 3); 
    915951  $i++; 
    916952 
     
    921957      if ($account->uid != $node->uid) { 
    922958        $username = theme('username', $account); 
    923         if  (!$account->is_active)  { $username .= '&nbsp;<em>'.t('(approval needed)'). '</em>'; } 
    924         elseif ($account->is_admin) { $username .= '&nbsp;<em>'.t('administrator'). '</em>'; } 
     959        if  (!$account->is_active)  { $username .= '&nbsp;<em>'. t('(approval needed)'). '</em>'; } 
     960        elseif ($account->is_admin) { $username .= '&nbsp;<em>'. t('Administrator'). '</em>'; } 
    925961        $rows[$i][] = $username; 
    926962        if ($access) { 
    927963          if ($account->is_active) { 
    928             $rows[$i][] = l(t('remove'), "og/unsubscribe/$gid/$account->uid", array(), "destination=og/users/$gid"); 
     964            $rows[$i][] = l(t('Remove'), "og/unsubscribe/$gid/$account->uid", array(), "destination=og/users/$gid"); 
    929965            if ($account->is_admin) { 
    930               $rows[$i][] = l(t('admin: remove'), "og/delete_admin/$gid/$account->uid", array(), 'destination='. $_GET['q']); 
     966              $rows[$i][] = l(t('Admin: Remove'), "og/delete_admin/$gid/$account->uid", array(), 'destination='. $_GET['q']); 
    931967            } 
    932968            else { 
    933               $rows[$i][] = l(t('admin: create'), "og/create_admin/$gid/$account->uid", array(), 'destination='. $_GET['q']); 
     969              $rows[$i][] = l(t('Admin: Create'), "og/create_admin/$gid/$account->uid", array(), 'destination='. $_GET['q']); 
    934970            } 
    935971          } 
    936972          else { 
    937             $rows[$i][] = l(t('approve'), "og/approve/$gid/$account->uid", array(), "destination=og/users/$gid"); 
    938             $rows[$i][] = l(t('deny'), "og/deny/$gid/$account->uid", array(), "destination=og/users/$gid"); 
     973            $rows[$i][] = l(t('Approve'), "og/approve/$gid/$account->uid", array(), "destination=og/users/$gid"); 
     974            $rows[$i][] = l(t('Deny'), "og/deny/$gid/$account->uid", array(), "destination=og/users/$gid"); 
    939975          } 
    940976        } 
     
    956992function og_list_users_faces_page($gid, $column_count = 5, $row_count = 10, $pager_id = 0) { 
    957993  $max_per_page = $row_count * $column_count; 
    958   $sql = og_list_users_sql(0, 0, 'ou.is_admin DESC, u.picture DESC, u.name ASC'); 
     994  $sql = og_list_users_sql(1, 0, 'ou.is_admin DESC, u.picture DESC, u.name ASC'); 
    959995  /* list group admins first, members with pics second, regular members last.  Alphabetize within each of these categories */ 
    960996  $result = pager_query($sql, $max_per_page, $pager_id, NULL, $gid); 
     
    10731109    unset($node->content['body']); 
    10741110    $node->content['og_mission'] = array( 
    1075       '#value' => check_markup($node->body, $node->format, FALSE),  
     1111      '#value' => $node->body, // node_prepare() already ran check_markup()  
    10761112      '#node' => $node, 
    10771113      '#weight' => -3, 
     
    11011137        og_home_empty($node); 
    11021138      } 
    1103       drupal_set_title(filter_xss_admin(views_get_title($view, 'page'))); 
     1139      drupal_set_title(check_plain(views_get_title($view, 'page'))); 
    11041140    }  
    11051141  } 
     
    12701306 
    12711307function og_load_group(&$node) { 
    1272   $sql = 'SELECT selective AS og_selective, description AS og_description, theme AS og_theme, register AS og_register, directory AS og_directory, notification AS og_notification, language AS og_language, private AS og_private FROM {og} WHERE nid = %d'; 
     1308  $sql = 'SELECT selective AS og_selective, description AS og_description, theme AS og_theme, register AS og_register, directory AS og_directory, language AS og_language, private AS og_private FROM {og} WHERE nid = %d'; 
    12731309  $result = db_query($sql, $node->nid); 
    12741310  $node = (object) array_merge((array)$node, (array)db_fetch_array($result)); 
     
    12771313 
    12781314function og_insert_group($node) { 
    1279   $sql = "INSERT INTO {og} (nid, theme, selective, description, register, directory, notification, language, private) VALUES (%d, '%s', %d, '%s', %d, %d, %d, '%s', %d)"; 
    1280   db_query($sql, $node->nid, $node->og_theme, $node->og_selective, $node->og_description, $node->og_register, $node->og_directory, $node->og_notification, $node->og_language, $node->og_private); 
     1315  $sql = "INSERT INTO {og} (nid, theme, selective, description, register, directory, language, private) VALUES (%d, '%s', %d, '%s', %d, %d, '%s', %d)"; 
     1316  db_query($sql, $node->nid, $node->og_theme, $node->og_selective, $node->og_description, $node->og_register, $node->og_directory, $node->og_language, $node->og_private); 
    12811317} 
    12821318 
    12831319function og_update_group($node) { 
    1284   $sql = "UPDATE {og} SET theme = '%s', selective = %d, register = %d, description = '%s', directory = %d, notification = %d, language = '%s', private = %d WHERE nid = %d"; 
    1285   db_query($sql, $node->og_theme, $node->og_selective, $node->og_register, $node->og_description, $node->og_directory, $node->og_notification, $node->og_language, $node->og_private, $node->nid); 
     1320  $sql = "UPDATE {og} SET theme = '%s', selective = %d, register = %d, description = '%s', directory = %d, language = '%s', private = %d WHERE nid = %d"; 
     1321  db_query($sql, $node->og_theme, $node->og_selective, $node->og_register, $node->og_description, $node->og_directory, $node->og_language, $node->og_private, $node->nid); 
    12861322  if (!db_affected_rows()) { 
    12871323    og_insert_group($node);   
     
    13261362      break; 
    13271363    case 'validate': 
    1328       if (og_is_group_type($node->type)) { 
    1329         // Email address is required for contacting the Manager 
    1330         $account = user_load(array('uid' => $node->uid)); 
    1331         if ($account->uid > 0 && empty($account->mail)) { 
    1332           form_set_error('name', t('The group manager, %name, must have an email address in his <a href="!profile">profile</a>.', array('%name' => $account->name, '!profile' => url("user/$node->uid/edit")))); 
     1364      // Ensure that a group is selected if groups are required. needed when author has no groups. In other cases, fapi does the validation 
     1365      if (og_is_group_post_type($node->type) && variable_get('og_audience_required', FALSE) && !user_access('administer nodes')) { 
     1366        if (!isset($node->og_groups)) { 
     1367          form_set_error('title', t('You must !join before posting on this web site.', array('!join' => l(t('join a group'), 'og')))); 
    13331368        } 
    1334          
    1335         // Must be authored in the default input format or else admins might not get their admin perms 
    1336         // If Body field is omitted, there may not yet be a $node->format 
    1337         if (isset($node->format) && $node->format != filter_resolve_format(FILTER_FORMAT_DEFAULT)) { 
    1338           form_set_error('body', t("You must use the default input format when authoring a group node.")); 
    1339         } 
    1340       } 
    1341       else { 
    1342         // Ensure that a group is selected if groups are required. needed when author has no groups. In other cases, fapi does the validation 
    1343         if (og_is_group_post_type($node->type) && variable_get('og_audience_required', FALSE) && !user_access('administer nodes')) { 
    1344           if (!isset($node->og_groups)) { 
    1345             form_set_error('title', t('You must !join before posting on this web site.', array('!join' => l(t('join a group'), 'og')))); 
    1346           } 
    1347         } 
    1348          
    13491369      } 
    13501370      break; 
     
    13831403          '!invite_url' => url("og/invite/$node->nid", NULL, NULL, TRUE) 
    13841404        ); 
    1385  
    1386         // alert the user that they are now the admin of the group   
    1387         $from = variable_get('site_mail', ini_get('sendmail_from')); 
    1388         drupal_mail('og_new_admin', $account->mail, _og_user_mail_text('og_new_admin_subject', $variables), _og_user_mail_text('og_new_admin_body', $variables), $from);       
     1405        $message = array( 
     1406          'subject' => _og_user_mail_text('og_new_admin_subject', $variables), 
     1407          'body' => _og_user_mail_text('og_new_admin_body', $variables) 
     1408        ); 
     1409 
     1410        // Alert the user that they are now the admin of the group. 
     1411        module_invoke_all('og', 'admin new', $gid, $account->uid, $message); 
    13891412      } 
    13901413      else { 
    13911414        og_save_ancestry($node); 
    1392       } 
    1393        
    1394       $skip_notification = FALSE;  
    1395       // Any module that returns TRUE from its hook_og_notify($node) will prevent sending notifications. 
    1396       // og2list and og_subscriptions use this to send own notifications. 
    1397       foreach(module_implements('og_notify') as $module) { 
    1398         if (module_invoke($module,'og_notify',$node)) { 
    1399           $skip_notification = TRUE; 
    1400           break; 
    1401         } 
    1402       } 
    1403       if (!$skip_notification && $node->status && og_is_mail_type($node->type) && $node->og_groups) { 
    1404         if (module_exists('job_queue')) { 
    1405           $description = t('OG: notify group members about node %nid - !link', array('%nid' => $node->nid, '!link' => l($node->title, "node/$node->nid"))); 
    1406           job_queue_add('og_mail', $description, array('node', $node->nid)); 
    1407         } 
    1408         else { 
    1409           og_mail('node', $node); 
    1410         } 
    14111415      } 
    14121416      break; 
     
    14351439          $ret[] = array('key'   => 'group', 
    14361440                         'value' => check_plain($title), 
    1437                          'attributes' => array('domain' => url("node/$gid", NULL, NULL, TRUE))); 
     1441                         'attributes' => array( 
     1442                           'domain' => url("node/$gid", NULL, NULL, TRUE), 
     1443                           'xmlns' => 'http://drupal.org/project/og', 
     1444                          ), 
     1445          ); 
    14381446        } 
    14391447        // to get these modifications to work on 4.7, one needs to patch as per http://drupal.org/node/41703 
     
    15001508 
    15011509  if ($form_id == 'views_edit_view') { 
    1502     $form['page-info']['url']['#description'] .= t("<p>To display a View as a tab on your Organic Groups group home pages, set the url to 'node/\$group/custom' (where <em>custom</em> is whatever you wish). Then open Page >> Menu and check <em>Provide Menu</em> and <em>Provide Menu as Tab</em>; also make the first argument in the View be the <em>OG: Group nid(s)</em> argument. The <em>\$group</em> path element is a placeholder for the group nid and it ensures that the tab <strong>only</strong> appears on OG group nodes.</p>"); 
     1510    $form['page-info']['url']['#description'] .= '<p>'. t("To display a View as a tab on your Organic Groups group home pages, set the url to 'node/\$group/custom' (where <em>custom</em> is whatever you wish). Then open Page >> Menu and check <em>Provide Menu</em> and <em>Provide Menu as Tab</em>; also make the first argument in the View be the <em>OG: Group nid(s)</em> argument. The <em>\$group</em> path element is a placeholder for the group nid and it ensures that the tab <strong>only</strong> appears on OG group nodes.") .'</p>'; 
    15031511  } 
    15041512   
     
    15611569function og_node_delete_group_form(&$form) { 
    15621570  $options[] = t('Do nothing.'); 
    1563   $options[] = t('Delete all group posts which don\'t also belong to another group.'); 
     1571  $options[] = t("Delete all group posts which don't also belong to another group."); 
    15641572  if (user_access('administer nodes')) { 
    15651573    $options[] = t('Move all group posts to the group listed below.'); 
     
    15701578    unset($options[$form['nid']['#value']]); 
    15711579    $form['target'] = array('#type' => 'select', '#title' => t('Target group'), '#default_value' => 0, '#options' => $options, '#weight' => 0, '#description' => t('If you chose <b>Move all group posts</b> above, specify a destination group.')); 
    1572     // register a submit handler 
    1573     $form['#submit']['og_node_delete_confirm_submit'] = array(); 
    1574   } 
     1580  } 
     1581  // register a submit handler 
     1582  $form['#submit']['og_node_delete_confirm_submit'] = array(); 
    15751583  $form['actions']['submit']['#value'] = t('Delete group'); 
    15761584} 
     
    15961604} 
    15971605 
    1598 // submit handler for node delete form. handles deletes to group nodes 
     1606// Submit handler for node delete form. handles deletes to group nodes. 
    15991607function og_node_delete_confirm_submit($form_id, $form_values) { 
    16001608  $deleted_group_nid = $form_values['nid']; 
     
    16061614    unset($node->og_groups[$deleted_group_nid]); 
    16071615    if ($move_children) { 
    1608       // there is an array_unique() in og_save_ancestry which giards against duplicates so don't worry here. 
    1609       $node->og_groups[] = $target_group_nid; 
     1616      // There is an array_unique() in og_save_ancestry() which guards against duplicates so don't worry here. 
     1617      $node->og_groups[$target_group_nid] = $target_group_nid; 
    16101618    } 
    16111619    if ($delete_orphans && count($node->og_groups) == 0) { 
     
    17381746  } 
    17391747   
    1740   // show read only item if we are non-admin, and in simple mode (i.e. non-checkboxes) and at least one group is in querystring 
     1748  // Show read only item if we are non-admin, and in simple mode (i.e. non-checkboxes) and at least one group is in querystring 
    17411749  $simple = !user_access('administer organic groups') && !variable_get('og_audience_checkboxes', TRUE) && count($gids); 
    17421750   
     
    17751783    if (count($groups)) { 
    17761784      foreach ($groups as $gid) { 
    1777         $titles[] = $options[$gid]; 
     1785        $titles[] = check_plain($options[$gid]); 
    17781786        $item_value = implode(', ', $titles); 
    17791787      } 
     
    18091817} 
    18101818 
    1811 function og_comment($comment, $op) { 
    1812   switch ($op) { 
    1813     case 'publish': 
    1814       $comment = (array) $comment; 
    1815       // fall through 
    1816     case 'insert': 
    1817       $skip_notification = FALSE;  
    1818       // Any module that returns true from its hook_og_notify($node) will prevent sending notifications. 
    1819       // og2list uses this to send its own notifications instead for mailing list content. 
    1820       $node = node_load($comment['nid']); 
    1821  
    1822       foreach(module_implements('og_notify') as $module) { 
    1823         if (module_invoke($module, 'og_notify', $node)) { 
    1824           $skip_notification = TRUE; 
    1825           break; 
    1826         } 
    1827       } 
    1828       // remove the perm check after 5.3 is released. 
    1829       if ($comment['status'] == COMMENT_PUBLISHED && !$skip_notification && og_is_mail_type($node->type) && isset($node->og_groups) && !empty($node->og_groups)) { 
    1830         if (module_exists('job_queue')) { 
    1831           $description = t('OG: notify group members about comment %id on !link', array('%id' => $comment['cid'], '!link' => l($node->title, "node/$node->nid", NULL, NULL, 'comment-'. $comment['cid']))); 
    1832           job_queue_add('og_mail', $description, array('comment', $comment['cid'])); 
    1833         } 
    1834         else { 
    1835           og_mail('comment', (object)$comment); 
    1836         } 
    1837       } 
    1838       break; 
    1839   }   
    1840 } 
    1841  
    1842  
    1843 /** 
    1844  * Send this node/comment via email to all email members. Called from og_nodeapi() and og_comment(). 
    1845  * Sometimes called from during cron if job_queue.module is enabled (recommended). 
    1846  * TODO: this function is a bit messy. rethink. 
    1847  * 
    1848  * @param $type 
    1849  *   the object type: node or comment 
    1850  * @param $id 
    1851  *   a node or comment object. if a non object is supplied, a load() operation is performed. 
    1852  * @return 
    1853  *   none 
    1854  */ 
    1855 function og_mail($type, $obj) { 
    1856   if ($type == 'comment') { 
    1857     if (!is_object($obj)) { 
    1858       $obj = _comment_load($obj); 
    1859     } 
    1860     // registered user 
    1861     if ($obj->uid) { 
    1862       $account = user_load(array('uid' => $obj->uid)); 
    1863       $obj->name = $account->name; 
    1864     } 
    1865     else { 
    1866       $obj->name = variable_get('anonymous', 'Anonymous'); 
    1867     } 
    1868     $rendered = check_markup($obj->comment, $obj->format, FALSE); 
    1869      
    1870     $obj->body = $rendered; 
    1871     $obj->teaser = $rendered; 
    1872     $originalurl = url("node/$obj->nid", NULL, "comment-$obj->cid", TRUE); 
    1873     $replyurl = url("comment/reply/$obj->nid/$obj->cid", NULL, NULL, TRUE); 
    1874     $node = node_load($obj->nid); 
    1875     $obj->og_groups = $node->og_groups; 
    1876     $obj->title = $node->title; 
    1877     $obj->msgid = $obj->nid. '-'. $obj->cid. og_msgid_server(); 
    1878     $reply = $obj->nid. '-'; 
    1879     if ($obj->pid) { 
    1880       $reply .= $obj->pid; 
    1881     } 
    1882     else { 
    1883       $reply .= '0'; 
    1884     } 
    1885     $obj->in_reply_to .= $reply. og_msgid_server(); 
    1886     $type_friendly = 'comment'; 
    1887   } 
    1888   else { 
    1889     if (!is_object($obj)) { 
    1890       $obj = node_load($obj); 
    1891     } 
    1892     $account = user_load(array('uid' => $obj->uid)); 
    1893     $obj->name = $account->name; 
    1894     $obj->subject = $obj->title; 
    1895     // These calls to og_node_view() setup the node body and teaser, apply the 
    1896     // appropriate input filters, and handle CCK fields, event fields, etc. 
    1897     $obj->body = og_node_view($obj, FALSE); 
    1898     $obj->teaser = og_node_view($obj, TRUE); 
    1899     $obj->msgid = $obj->nid. '-0'. og_msgid_server(); 
    1900     $originalurl = url("node/$obj->nid", NULL, NULL, TRUE); 
    1901     $replyurl = url("comment/reply/$obj->nid", NULL, 'comment-form', TRUE); 
    1902     $type_friendly = node_get_types('name', $obj); 
    1903   } 
    1904    
    1905   // set email from variables 
    1906   $variables = array( 
    1907     '@user_mail' => $account->mail ? $account->mail : variable_get("site_mail", ini_get("sendmail_from")), 
    1908     '@user_name' => mime_header_encode($obj->name), 
    1909     '@site_mail' => variable_get("site_mail", ini_get("sendmail_from")), 
    1910     '@site_name' => mime_header_encode(variable_get("site_name", 'Drupal')), 
    1911   ); 
    1912   $from_mail = strtr(variable_get("og_email_notification_pattern", '@user_name  <@site_mail>'), $variables);  
    1913  
    1914   $headers = array('X-Mailer' => 'Drupal - og_mail', 'Precedence' => 'list', 'Message-Id' => "<$obj->msgid>"); 
    1915   if ($obj->in_reply_to) { 
    1916     $headers['In-Reply-To'] =  "<$obj->in_reply_to>"; 
    1917   } 
    1918  
    1919   // set email body variables 
    1920   $variables = array( 
    1921     '@site' => variable_get('site_name', 'drupal'),  
    1922     '!read_more' => $obj->readmore ? t('Read more') : t('View original'), 
    1923     '!content_url' => $originalurl, 
    1924     '!reply_url' => $replyurl, 
    1925     '@title' => trim($obj->title), 
    1926     '@subject' => trim($obj->subject), 
    1927     '@node_full' => trim(og_mail_output($obj->body)), 
    1928     '@node_teaser' => trim(og_mail_output($obj->teaser)), 
    1929     '@username' => $obj->name 
    1930   ); 
    1931    
    1932   // Send email to selective subscribers and global subscribers. 
    1933   // We use if() here in case node/comment no longer has any groups (i.e. this function can be called from cron). 
    1934   if (is_array($obj->og_groups) && !empty($obj->og_groups)) { 
    1935     $groups = implode(', ', $obj->og_groups); 
    1936     // tricky query here. mysql returns NULL in the case of NULL != 0 so i rework this for 2 positive statements about og_email field 
    1937     // ORDER BY favors newer groups to help them get ramped up. Thus, they are perceived as active. 
    1938     $sql = "SELECT u.mail, ou.nid AS gid, n.title AS group_name, n.uid AS group_uid, u.name AS group_owner, oug.og_email  
    1939             FROM {og_uid} ou INNER JOIN {users} u ON ou.uid=u.uid  
    1940             INNER JOIN {og_uid_global} oug ON ou.uid=oug.uid  
    1941             INNER JOIN {node} n ON ou.nid=n.nid  
    1942             WHERE ou.nid IN ($groups) AND ( 
    1943               (oug.og_email = %d AND ou.mail_type=1) OR 
    1944               (oug.og_email = %d) 
    1945               ) AND u.status = 1 AND u.mail != '' AND ou.is_active = 1  
    1946               ORDER by u.mail DESC, n.created DESC 
    1947               "; 
    1948     $result = db_query($sql, OG_NOTIFICATION_SELECTIVE, OG_NOTIFICATION_ALWAYS); 
    1949     $last_mail = ''; 
    1950     while ($row = db_fetch_object($result)) { 
    1951       // only notify each user once. we used to do this with GROUP BY but got very hard to assure that all the selected fields came from same record. 
    1952       if ($row->mail == $last_mail) { 
    1953         continue; 
    1954       } 
    1955       $last_mail = $row->mail; 
    1956        
    1957       // TODO: add node_access('view') call here in case node is moderated or other. 
    1958       // Hopefully D6 will avert need to impersonate. 
    1959       // Append these group specific variables. 
    1960       $variables['@group'] = $row->group_name; 
    1961       $variables['!group_url'] = url("og/manage/$row->gid", NULL, NULL, TRUE); 
    1962       $variables['@type'] = $type_friendly; 
    1963  
    1964       $unsubscribe = url("og/manage/$row->gid", NULL, NULL, TRUE); 
    1965       $ownerurl = url("user/$row->group_uid", NULL, NULL, TRUE); 
    1966       $group_home = url("node/$row->gid", NULL, NULL, TRUE); 
    1967       $groupheaders = $headers + array( 
    1968         'List-Id' => mime_header_encode($row->group_name). " <$group_home>",  
    1969         'List-Unsubscribe' => "<$unsubscribe>",  
    1970         'List-Owner' => mime_header_encode($row->group_owner). " <$ownerurl>",  
    1971         "List-Archive" => "<$group_home>" 
    1972       ); 
    1973       drupal_mail('og_mail', $row->mail, _og_user_mail_text('og_new_node_subject', $variables), _og_user_mail_text('og_new_node_body', $variables), $from_mail, $groupheaders); 
    1974     } 
    1975   } 
    1976 } 
    1977  
    19781819/** 
    19791820 * Similar to node_view() but without calling theme('node'). 
    19801821 * 
    19811822 * This is needed to get the proper body or teaser for nodes (e.g. Event, 
    1982  * Location, CCK node types) and to clean up the body for use in email 
    1983  * notifications. 
     1823 * Location, CCK node types) and to clean up the body for use in notifications. 
    19841824 * 
    19851825 * @param $node 
     
    20131853} 
    20141854 
    2015 // 2 functions ripped from mail.inc in project.module package 
    2016 function og_mail_urls($url = 0) { 
    2017   static $urls = array(); 
    2018   if ($url) { 
    2019     $urls[] = strpos($url, '://') ? $url : url($url, NULL, NULL, 1); 
    2020     return count($urls); 
    2021   } 
    2022   return $urls; 
    2023 } 
    2024  
    2025 // takes filtered HTML as input and transforms for email 
    2026 // modified from project.module  
    2027 function og_mail_output($body, $html = TRUE) { 
    2028   static $i = 0; 
    2029  
    2030   if ($html) { 
    2031     $pattern = '@<a +([^ >]+ )*?href *= *"([^>"]+?)"[^>]*>([^<]+?)</a>@ei'; 
    2032     $body = preg_replace($pattern, "'\\3 ['. og_mail_urls('\\2') .']'", $body); 
    2033     $urls = og_mail_urls(); 
    2034     if (count($urls)) { 
    2035       $body .= "\n"; 
    2036       for ($max = count($urls); $i < $max; $i++) { 
    2037         $body .= '['. ($i + 1) .'] '. $urls[$i] ."\n"; 
    2038       } 
    2039     } 
    2040  
    2041     $body = preg_replace('!</?blockquote>!i', '"', $body); 
    2042     $body = preg_replace('!</?(em|i)>!i', '/', $body); 
    2043     $body = preg_replace('!</?(b|strong)>!i', '*', $body); 
    2044     $body = preg_replace("@<br />(?!\n)@i", "\n", $body); 
    2045     $body = preg_replace("@</p.*>(?!\n\n)@i", "\n\n", $body); 
    2046     $body = preg_replace("@</h1>(?!\n\n)@i", " #\n", $body); 
    2047     $body = preg_replace("@</h2>(?!\n\n)@i", " ##\n", $body); 
    2048     $body = preg_replace("@</h3>(?!\n\n)@i", " ###\n", $body); 
    2049     $body = preg_replace("@</h4>(?!\n\n)@i", " ####\n", $body); 
    2050     $body = preg_replace("@</(li|dd)>\n?@i", "\n", $body); 
    2051     $body = preg_replace("@<h1.*>@i", "\n\n# ", $body); 
    2052     $body = preg_replace("@<h2.*>@i", "\n\n## ", $body); 
    2053     $body = preg_replace("@<h3.*>@i", "\n\n### ", $body); 
    2054     $body = preg_replace("@<h4.*>@i", "\n\n#### ", $body); 
    2055     $body = preg_replace("@<li.*>@i", "* ", $body); 
    2056     $body = strip_tags($body); 
    2057     $body = decode_entities($body); 
    2058     $body = wordwrap($body, 72); 
    2059   } 
    2060   else { 
    2061     $body = decode_entities($body); 
    2062   } 
    2063   return $body; 
    2064 } 
    2065  
    2066 /** 
    2067  * Define all OG emails 
     1855/** 
     1856 * Define all OG message strings. 
    20681857 * Modelled after Drupal's user.module 
    20691858 */ 
     
    20791868        return t("@group: '@title' at @site", $variables); 
    20801869      case 'og_new_node_body': 
    2081         return t("@type '@subject' by @username\n\n@node_teaser\n\n!read_more: !content_url\nPost reply: !reply_url\n\n--\nYou are subscribed from the group '@group' at @site.\nTo manage your subscription, visit !group_url", $variables);     
     1870        return t("@type '@subject' by @username\n\n@node_teaser\n\n!read_more: !content_url\nPost reply: !reply_url\n\n--\nYou are subscribed from the group '@group' at @site.\nTo manage your subscription, visit !group_url.", $variables);     
    20821871      case 'og_admin_email_body': 
    2083         return t("@body\n\n--\nThis message was sent by an administrator in the '@group' group at @site. To visit this group, browse to !url_group. To unsubscribe from this group, visit !url_unsubscribe", $variables); 
     1872        return t("@body\n\n--\nThis message was sent by an administrator in the '@group' group at @site. To visit this group, browse to !url_group. To unsubscribe from this group, visit !url_unsubscribe.", $variables); 
    20841873      case 'og_approve_user_subject': 
    20851874        return t("Membership request approved for '@title'", $variables); 
    20861875      case 'og_approve_user_body': 
    2087         return t("You may now post messages in this group located at !group_url", $variables); 
     1876        return t("You may now post messages in this group located at !group_url.", $variables); 
    20881877      case 'og_deny_user_subject': 
    2089         return t("Membership request denied for '@title'", $variables); 
     1878        return t("Membership request denied for '@title'.", $variables); 
    20901879      case 'og_deny_user_body': 
    20911880        return t("Sorry, your membership request was denied.", $variables); 
    20921881      case 'og_invite_user_subject': 
    2093         return t("Invitation to join the group '@group' at @site", $variables); 
     1882        return t("Invitation to join the group '@group' at @site.", $variables); 
    20941883      case 'og_invite_user_body': 
    20951884        return t("Hi. I'm a member of '@group' and I welcome you to join this group as well. Please see the link and message below.\n\n@group\n@description\nJoin: !group_url\n@body", $variables); 
    20961885      case 'og_request_user_subject': 
    2097         return t("Membership request for '@group' from '@username'", $variables);         
     1886        return t("Membership request for '@group' from '@username'.", $variables);         
    20981887      case 'og_request_user_body': 
    20991888        return t("To instantly approve this request, visit !approve_url.\nYou may deny this request or manage members at !group_url.", $variables);        
    21001889      case 'og_new_admin_subject': 
    2101         return t("You are now an administrator for the group '@group'", $variables);         
     1890        return t("You are now an administrator for the group '@group'.", $variables);         
    21021891      case 'og_new_admin_body': 
    21031892        return t("@username, you are now an administrator for the group '@group'.\n\nYou can administer this group by logging in here:\n !group_url", $variables);        
     
    21221911 */ 
    21231912function og_is_node_admin($node) { 
    2124   return node_access('update', $node); 
     1913  global $user; 
     1914  return og_is_group_type($node->type) && (user_access('administer nodes') || !empty($user->og_groups[$node->nid]['is_admin'])); 
    21251915} 
    21261916 
     
    21611951      } 
    21621952      return $form; 
    2163     case 'form': 
    2164       if ($category == 'account' && !empty($account->og_groups)) { 
    2165         $form['og_settings'] = array( 
    2166           '#type' => 'fieldset', 
    2167           '#title' => t('Organic groups settings'), 
    2168           '#collapsible' => TRUE, 
    2169           '#weight' => 4); 
    2170         $options = array(OG_NOTIFICATION_NEVER => t('Never send email notifications. Useful when tracking activity via RSS feed instead.'), 
    2171                          OG_NOTIFICATION_ALWAYS =>  t('Always send email notifications'), 
    2172                          OG_NOTIFICATION_SELECTIVE =>   t('Selectively send email notification based on the checkbox for each of my group\'s <em>My Membership</em> page'), 
    2173                           ); 
    2174                           
    2175         $form['og_settings']['og_email'] = array('#type' => 'radios',  
    2176                                             '#title' => t('Email notifications'),  
    2177                                             '#options' => $options,  
    2178                                             '#default_value' => isset($account->og_email) ? $account->og_email : variable_get('og_notification', 2), 
    2179                                             '#description' => t('When posts are submitted into your groups, you may be notified via email.'), 
    2180                                             ); 
    2181         return $form; 
    2182       } 
    2183       break; 
    21841953    case 'insert': 
    21851954      if (is_array($edit['og_register'])) { 
     
    21921961      } 
    21931962       
    2194       $sql = 'INSERT INTO {og_uid_global} (uid, og_email) VALUES (%d, %d)'; 
    2195       db_query($sql, $account->uid, variable_get('og_notification', OG_NOTIFICATION_ALWAYS)); 
    2196       $account->og_email = NULL; 
    2197       break; 
    2198     case 'update': 
    2199       if (isset($edit['og_email'])) { 
    2200         $sql = 'UPDATE {og_uid_global} SET og_email=%d WHERE uid=%d'; 
    2201         db_query($sql, $edit['og_email'], $account->uid); 
    2202         $account->og_email = NULL; 
    2203       } 
    22041963      break; 
    22051964    case 'delete': 
    2206       // user delete doesn't exist, but it should and will one day. 
    2207       $sql = 'DELETE FROM {og_uid_global} WHERE uid=%d'; 
    2208       db_query($sql, $account->uid); 
    2209  
    22101965      $sql = 'DELETE FROM {og_uid} WHERE uid=%d'; 
    22111966      db_query($sql, $account->uid); 
     
    22131968    case 'load': 
    22141969      $account->og_groups = og_get_subscriptions($account->uid); 
    2215  
    2216       $result = db_query("SELECT og_email FROM {og_uid_global} WHERE uid = %d", $account->uid); 
    2217       if (db_num_rows($result)) { 
    2218         $account->og_email = db_result($result); 
    2219       } 
    22201970      break; 
    22211971    case 'view': 
     
    22512001 */ 
    22522002function og_node_type($op, $info) { 
    2253   $values = variable_get($variable, array()); 
    22542003  switch ($op) { 
    22552004    case 'delete': 
     
    22672016    'group' => t('Group node'), 
    22682017    'omitted' => t('May not be posted into a group.'), 
    2269     'group_post_standard_mail' => t('Standard group post (typically only author may edit). Sends email notifications.'), 
    2270     'group_post_standard_nomail' => t('Standard group post (typically only author may edit). No email notification.'), 
     2018    'group_post_standard' => t('Standard group post (typically only author may edit).') 
    22712019  ); 
    22722020   
    22732021  if (module_exists('og_access')) { 
    2274     $usages['group_post_wiki_mail'] = t('Wiki group post (any group member may edit). Sends email notifications.'); 
    2275     $usages['group_post_wiki_nomail'] = t('Wiki group post (any group member may edit). No email notification.'); 
     2022    $usages['group_post_wiki'] = t('Wiki group post (any group member may edit).'); 
    22762023  } 
    22772024   
     
    22962043} 
    22972044 
    2298 // returns TRUE if node type should generate email notifications when posted to a group. 
    2299 function og_is_mail_type($type) { 
    2300   $usage = variable_get('og_content_type_usage_'. $type, 'omitted'); 
    2301   return strpos($usage, 'mail') && !strpos($usage, 'nomail') ? TRUE : FALSE; 
    2302 } 
    2303  
    23042045// returns TRUE if node type lets all subscribers edit the node. 
    23052046function og_is_wiki_type($type) { 
     
    23362077  header("HTTP/1.1 301 Moved Permanently"); 
    23372078  header('Location: '. url("node/$gid/feed", NULL, NULL, TRUE)); 
     2079} 
     2080 
     2081/** 
     2082 * Check a user's membership in a group. Site admins always return TRUE. 
     2083 */ 
     2084function og_is_group_member($gid, $user) { 
     2085  $groups = array_keys($user->og_groups); 
     2086  return user_access('administer nodes') || in_array($gid, $groups) ? TRUE : FALSE; 
    23382087} 
    23392088 
     
    24222171    // only members can see this block 
    24232172    if (in_array($groupnode->nid, array_keys($user->og_groups))) { 
    2424       $content = t('This group offers a !groupfeed and an !email.', array('!groupfeed' => l(t('RSS feed'), "node/$groupnode->nid/feed"), '!email' => l(t('email subscription'), 'og/manage/'. $groupnode->nid))); 
     2173      $content = t('This group offers a !groupfeed and a !subscription.', array('!groupfeed' => l(t('RSS feed'), "node/$groupnode->nid/feed"), '!subscription' => l(t('subscription option'), 'og/manage/'. $groupnode->nid))); 
    24252174      if (module_exists('views') && module_exists('views_rss')) { 
    24262175        // NOTE: See og.css for styling specific to these lists 
    2427         $content .= t(' Or subscribe to these personalized, sitewide feeds:'); 
     2176        $content .= ' '. t('Or subscribe to these personalized, sitewide feeds:'); 
    24282177        $inline = array('class' => 'links inline');       
    2429         $l1[] = array('title' => t('feed'), 'href' => 'group/myunread/feed'); 
    2430         $l1[] = array('title' => t('page'), 'href' => 'group/myunread'); 
    2431         $links['my_unread'] = t('my unread: '). theme('links', $l1, $inline); 
     2178        $l1[] = array('title' => t('Feed'), 'href' => 'group/myunread/feed'); 
     2179        $l1[] = array('title' => t('Page'), 'href' => 'group/myunread'); 
     2180        $links['my_unread'] = t('My unread:') .' '. theme('links', $l1, $inline); 
    24322181       
    2433         $l2[] = array('title' => t('feed'), 'href' => 'group/mytracker/feed'); 
    2434         $l2[] = array('title' => t('page'), 'href' => 'group/mytracker'); 
    2435         $links['my_group'] = t('my group: '). theme('links', $l2, $inline); 
     2182        $l2[] = array('title' => t('Feed'), 'href' => 'group/mytracker/feed'); 
     2183        $l2[] = array('title' => t('Page'), 'href' => 'group/mytracker'); 
     2184        $links['my_group'] = t('My group:') .' '. theme('links', $l2, $inline); 
    24362185       
    2437         $l3[] = array('title' => t('feed'), 'href' => 'group/tracker/feed'); 
    2438         $l3[] = array('title' => t('page'), 'href' => 'group/tracker'); 
    2439         $links['all_posts'] = array('data' => t('all posts: '). theme('links', $l3, $inline)); 
     2186        $l3[] = array('title' => t('Feed'), 'href' => 'group/tracker/feed'); 
     2187        $l3[] = array('title' => t('Page'), 'href' => 'group/tracker'); 
     2188        $links['all_posts'] = array('data' => t('All posts:') .' '. theme('links', $l3, $inline)); 
    24402189        $content .= theme('item_list', $links); 
    24412190      } 
     
    25112260 *   An HTML list. 
    25122261 **/ 
    2513 function og_block_subscribers_list($gid, $max = 10, $is_admin = array('members', 'admin'), $show_more = TRUE, $show_picture = NULL) { 
     2262function og_block_subscribers_list($gid, $max = 10, $is_admin = array('members', 'admins'), $show_more = TRUE, $show_picture = NULL) { 
    25142263  $placeholders = array_fill(0, count(array_filter($is_admin)), '%d'); 
    25152264  $placeholders = implode(', ', $placeholders); 
     
    25852334    } 
    25862335    $links['subscribers'] = $txt; 
    2587     $links['manager'] =  t('Manager: '). theme('username', $node); 
     2336    $links['manager'] =  t('Manager:') .' '. theme('username', $node); 
    25882337    $subscribe = isset($subscription) ? l(t('My membership'), "og/manage/$node->nid") : og_subscribe_link($node); 
    25892338    if(isset($subscribe)) { 
     
    26962445  return $form; 
    26972446} 
     2447 
    26982448function og_admin_settings() { 
    26992449  drupal_set_title(t('Organic groups configuration')); 
     
    27222472  $form['og_settings']['group_details'] = array('#type' => 'fieldset', '#title' => t('Group details'), '#collapsible' => TRUE, '#collapsed' => TRUE); 
    27232473  // groups directory visibility 
    2724   $options = array(t('New groups don\'t appear in the groups directory. Administrators control the directory exclusively.'), 
     2474  $options = array(t("New groups don't appear in the groups directory. Administrators control the directory exclusively."), 
    27252475              t('New groups always appear in the groups directory.'), 
    27262476              t('Group creator chooses whether her group appears in the directory. Defaults to %in.', array('%in' => t('in directory'))), 
     
    27302480   
    27312481  // groups registration visibility 
    2732   $options = array(t('New groups don\'t appear on the registration form. Administrators control the form exclusively.'), 
     2482  $options = array(t("New groups don't appear on the registration form. Administrators control the form exclusively."), 
    27332483              t('New groups always appear on the registration form.'), 
    27342484              t('Group creator chooses whether her group appears on the registration form. Defaults to %in.', array('%in' => t('on form'))), 
     
    27372487  $form['og_settings']['group_details']['og_visibility_registration'] = array('#type' => 'radios', '#title' => t('Registration form control'), '#default_value' => variable_get('og_visibility_registration', OG_REGISTRATION_CHOOSE_FALSE), '#description' =>t('OG admins always see the checkbox for adding a group to the %dir. Note that changing this setting has no effect on existing posts. Re-save those posts to acquire this new setting.', array('%dir' => t('registration form'))), '#options' => $options); 
    27382488 
    2739   // email notifications default 
    2740   $options = array(OG_NOTIFICATION_SELECTIVE => t('New members are not subscribed to group email notifications by default. A member may choose to enable this from her profile page or her My membership page.'), 
    2741               OG_NOTIFICATION_ALWAYS => t('New members are subscribed to group email notifications by default. A member may choose to disable this from her profile page.'), 
    2742               ); 
    2743   $form['og_settings']['group_details']['og_notification'] = array('#type' => 'radios', '#title' => t('Group email notifications'), '#default_value' => variable_get('og_notification', OG_NOTIFICATION_ALWAYS), '#description' =>t('Should new members automatically be notified via email when new content is posted to their group? Note that changing this setting has no effect on existing members.'), '#options' => $options); 
    2744    
    27452489  // audience checkboxes 
    27462490  $form['og_settings']['group_details']['og_audience_checkboxes'] = array('#type' => 'checkbox', '#title' => t('Audience checkboxes'), '#default_value' => variable_get('og_audience_checkboxes', TRUE), '#description' => t('Show each group that the user is a member of as a checkbox in the Audience section. This enables the member to place her post into multiple groups. If unchecked, simplify the user interface by omitting the checkboxes and assuming user wants to post into the current group. This simplification only applies to new nodes, and not to edits of existing nodes. Group administrators always see checkboxes.')); 
     
    27582502  $form['og_settings']['group_details']['og_member_pics'] = array('#type' => 'checkbox', '#title' => t('Member pictures'), '#default_value' => variable_get('og_member_pics', TRUE), '#description' => t('Should member pictures be shown on the members page, the group members block, and group details block? You must also enable pictures in !user.', array('!user' => l(t('User configuration'), 'admin/user/settings')))); 
    27592503 
    2760   $form['og_settings']['email'] = array('#type' => 'fieldset', '#title' => t('Email settings'), '#collapsible' => TRUE, '#collapsed' => TRUE); 
    2761  
    2762   $form['og_settings']['email']['og_email_notification_pattern'] = array( 
     2504  // Messages fieldset. 
     2505  $form['og_settings']['notifications'] = array( 
     2506    '#type' => 'fieldset', 
     2507    '#title' => t('Messaging & Notifications'), 
     2508    '#collapsible' => TRUE, 
     2509    '#collapsed' => TRUE 
     2510  ); 
     2511  $form['og_settings']['notifications']['og_email_notification_pattern'] = array( 
    27632512    '#type' => 'textfield', 
    27642513    '#title' => t('Format of From: field'), 
     
    27662515    '#description' => t('Specify the format of the "From:" field on outgoing notifications. Available variables: @user_mail, @user_name, @site_mail, @site_name. Note that the @user_mail token reveals the author\'s email address. If the admin email examples above appear blank, you need to set your site email in the Site Configuration panel.'), 
    27672516  ); 
    2768   $form['og_settings']['email']['og_new_node_subject'] = array('#type' => 'textfield', '#title' => t('New content subject'), '#description' => 'Subject of email for new content. Available variables: @group, !group_url, @type, @site, !content_url, !reply_url, @title, @subject, @node_full, @node_teaser, @username. %subject contains the comment title in the case of a comment but the node title in the case of a new post. @title is always the node title.', '#default_value' => _og_user_mail_text('og_new_node_subject')); 
    2769   $form['og_settings']['email']['og_new_node_body'] = array('#type' => 'textarea', '#title' => t('New content body'), '#rows' => 10, '#description' => 'Body of email for new content. Available variables: @group, !group_url, @type, @site, !content_url, !reply_url, @title, @subject, @node_full, @node_teaser, @username. @subject contains the comment title in the case of a comment but the node title in the case of a new post. %title is always the node title.', '#default_value' => _og_user_mail_text('og_new_node_body')); 
    2770   $form['og_settings']['email']['og_admin_email_body'] = array('#type' => 'textarea', '#title' => t('Group admin email body'), '#rows' => 10, '#description' => 'The body of the email sent to users from the group admin. Available variables: @group, @body, @site, !url_group, !url_unsubscribe', '#default_value' => _og_user_mail_text('og_admin_email_body')); 
    2771   $form['og_settings']['email']['og_approve_user_subject'] = array('#type' => 'textfield', '#title' => t('User approved email subject'), '#description' => 'The subject of the email sent to new approved members. Available variables: !group_url, @title', '#default_value' => _og_user_mail_text('og_approve_user_subject')); 
    2772   $form['og_settings']['email']['og_approve_user_body'] = array('#type' => 'textarea', '#title' => t('User approved email body'), '#rows' => 10, '#description' => 'The body of the email sent to new approved members. Available variables: !group_url, @title', '#default_value' => _og_user_mail_text('og_approve_user_body'));    
    2773   $form['og_settings']['email']['og_deny_user_subject'] = array('#type' => 'textfield', '#title' => t('User denied email subject'), '#description' => 'The subject of the email sent to denied users. Available variables: !group_url, @title', '#default_value' => _og_user_mail_text('og_deny_user_subject')); 
    2774   $form['og_settings']['email']['og_deny_user_body'] = array('#type' => 'textarea', '#title' => t('User denied email body'), '#rows' => 10, '#description' => 'The body of the email sent to denied users. Available variables: !group_url, @title', '#default_value' => _og_user_mail_text('og_deny_user_body'));    
    2775   $form['og_settings']['email']['og_invite_user_subject'] = array('#type' => 'textfield', '#title' => t('Invite user email subject'), '#description' => 'The subject of the email sent to users invited to join a group. Available variables: @group, @site, @description, !group_url, @body', '#default_value' => _og_user_mail_text('og_invite_user_subject')); 
    2776   $form['og_settings']['email']['og_invite_user_body'] = array('#type' => 'textarea', '#title' => t('Invite user email body'), '#rows' => 10, '#description' => 'The body of the email sent to users invited to join a group. Available variables: @group, @site, @description, !group_url, @body', '#default_value' => _og_user_mail_text('og_invite_user_body'));    
    2777   $form['og_settings']['email']['og_request_user_subject'] = array('#type' => 'textfield', '#title' => t('Request user email subject'), '#description' => 'The subject of the email sent to a user\'s request to join a group. Available variables: @group, @username, !approve_url, !group_url', '#default_value' => _og_user_mail_text('og_request_user_subject')); 
    2778   $form['og_settings']['email']['og_request_user_body'] = array('#type' => 'textarea', '#title' => t('Request user email body'), '#rows' => 10, '#description' => 'The body of the email sent to a user\'s request to join a group. Available variables: @group, @username, !approve_url, !group_url', '#default_value' => _og_user_mail_text('og_request_user_body')); 
    2779   $form['og_settings']['email']['og_new_admin_subject'] = array('#type' => 'textfield', '#title' => t('New admin user email subject'), '#description' => 'The subject of the email sent to a new admin for a group. Available variables: @group, @username, !group_url', '#default_value' => _og_user_mail_text('og_new_admin_subject')); 
    2780   $form['og_settings']['email']['og_new_admin_body'] = array('#type' => 'textarea', '#title' => t('New admin user email body'), '#rows' => 10, '#description' => 'The body of the email sent to a new admin for a group. Available variables: @group, @username, !group_url, !invite_url', '#default_value' => _og_user_mail_text('og_new_admin_body')); 
     2517  $form['og_settings']['notifications']['og_new_node_subject'] = array( 
     2518    '#type' => 'textfield', 
     2519    '#title' => t('New content subject'), 
     2520    '#description' => t('Subject of notification message for new content. Available variables: @group, !group_url, @type, @site, !content_url, !reply_url, @title, @subject, @node_full, @node_teaser, @username. %subject contains the comment title in the case of a comment but the node title in the case of a new post. @title is always the node title.'), 
     2521    '#default_value' => _og_user_mail_text('og_new_node_subject') 
     2522  ); 
     2523  $form['og_settings']['notifications']['og_new_node_body'] = array( 
     2524    '#type' => 'textarea', 
     2525    '#title' => t('New content body'), 
     2526    '#rows' => 10, 
     2527    '#description' => t('Body of the notification for new content. Available variables: @group, !group_url, @type, @site, !content_url, !reply_url, @title, @subject, @node_full, @node_teaser, @username. @subject contains the comment title in the case of a comment but the node title in the case of a new post. %title is always the node title.'), 
     2528    '#default_value' => _og_user_mail_text('og_new_node_body') 
     2529  ); 
     2530  $form['og_settings']['notifications']['og_admin_email_body'] = array( 
     2531    '#type' => 'textarea', 
     2532    '#title' => t('Group admin notification body'), 
     2533    '#rows' => 10, 
     2534    '#description' => t('The body of the message sent to users from the group admin. Available variables: @group, @body, @site, !url_group, !url_unsubscribe'), 
     2535    '#default_value' => _og_user_mail_text('og_admin_email_body') 
     2536  ); 
     2537  $form['og_settings']['notifications']['og_approve_user_subject'] = array( 
     2538    '#type' => 'textfield', 
     2539    '#title' => t('User approved notification subject'), 
     2540    '#description' => t('The subject of the message sent to new approved members. Available variables: !group_url, @title'), 
     2541    '#default_value' => _og_user_mail_text('og_approve_user_subject') 
     2542  ); 
     2543  $form['og_settings']['notifications']['og_approve_user_body'] = array( 
     2544    '#type' => 'textarea', 
     2545    '#title' => t('User approved notification body'), 
     2546    '#rows' => 10, 
     2547    '#description' => t('The body of the message sent to new approved members. Available variables: !group_url, @title'), 
     2548    '#default_value' => _og_user_mail_text('og_approve_user_body') 
     2549  );    
     2550  $form['og_settings']['notifications']['og_deny_user_subject'] = array( 
     2551    '#type' => 'textfield', 
     2552    '#title' => t('User denied notification subject'), 
     2553    '#description' => t('The subject of the message sent to denied users. Available variables: !group_url, @title'), 
     2554    '#default_value' => _og_user_mail_text('og_deny_user_subject') 
     2555  ); 
     2556  $form['og_settings']['notifications']['og_deny_user_body'] = array( 
     2557    '#type' => 'textarea', 
     2558    '#title' => t('User denied notification body'), 
     2559    '#rows' => 10, 
     2560    '#description' => t('The body of the message sent to denied users. Available variables: !group_url, @title'), 
     2561    '#default_value' => _og_user_mail_text('og_deny_user_body') 
     2562  );    
     2563  $form['og_settings']['notifications']['og_invite_user_subject'] = array( 
     2564    '#type' => 'textfield', 
     2565    '#title' => t('Invite user notification subject'), 
     2566    '#description' => t('The subject of the message sent to users invited to join a group. Available variables: @group, @site, @description, !group_url, @body'), 
     2567    '#default_value' => _og_user_mail_text('og_invite_user_subject') 
     2568  ); 
     2569  $form['og_settings']['notifications']['og_invite_user_body'] = array( 
     2570    '#type' => 'textarea', 
     2571    '#title' => t('Invite user notification body'), 
     2572    '#rows' => 10, 
     2573    '#description' => t('The body of the message sent to users invited to join a group. Available variables: @group, @site, @description, !group_url, @body'), 
     2574    '#default_value' => _og_user_mail_text('og_invite_user_body') 
     2575  );    
     2576  $form['og_settings']['notifications']['og_request_user_subject'] = array( 
     2577    '#type' => 'textfield', 
     2578    '#title' => t('Request user notification subject'), 
     2579    '#description' => t("The subject of the message sent to a user's request to join a group. Available variables: @group, @username, !approve_url, !group_url"), 
     2580    '#default_value' => _og_user_mail_text('og_request_user_subject') 
     2581  ); 
     2582  $form['og_settings']['notifications']['og_request_user_body'] = array( 
     2583    '#type' => 'textarea', 
     2584    '#title' => t('Request user notification body'), 
     2585    '#rows' => 10, 
     2586    '#description' => t("The body of the message sent to a user's request to join a group. Available variables: @group, @username, !approve_url, !group_url"), 
     2587    '#default_value' => _og_user_mail_text('og_request_user_body') 
     2588  ); 
     2589  $form['og_settings']['notifications']['og_new_admin_subject'] = array( 
     2590    '#type' => 'textfield', 
     2591    '#title' => t('New admin user notification subject'), 
     2592    '#description' => t('The subject of the message sent to a new admin for a group. Available variables: @group, @username, !group_url'), 
     2593    '#default_value' => _og_user_mail_text('og_new_admin_subject') 
     2594  ); 
     2595  $form['og_settings']['notifications']['og_new_admin_body'] = array( 
     2596    '#type' => 'textarea', 
     2597    '#title' => t('New admin user notification body'), 
     2598    '#rows' => 10, 
     2599    '#description' => t('The body of the message sent to a new admin for a group. Available variables: @group, @username, !group_url, !invite_url'), 
     2600    '#default_value' => _og_user_mail_text('og_new_admin_body') 
     2601  ); 
    27812602 
    27822603  return system_settings_form($form); 
     
    28282649      'og_xmlrpc_subscribe_user', 
    28292650      array('struct', 'string', 'string', 'int', 'int'), 
    2830       t('Add a user to a group')), 
     2651      t('Add a user to a group.')), 
    28312652    array( 
    28322653      'og.getAllSubscribers', 
     
    28862707  switch ($type) { 
    28872708    case 'node': 
     2709      // Set some defaults. 
     2710      $values['ogname'] = ''; 
     2711      $values['ogname-raw'] = ''; 
     2712      $values['og-id'] = ''; 
     2713 
    28882714      if (is_array($object->og_groups)) { 
    28892715        $gids = array_filter($object->og_groups); 
     
    28952721          break; 
    28962722        } 
    2897         return $values; 
    2898       } 
    2899       break;     
    2900   } 
    2901    
    2902   // No group info found. Return defaults. 
    2903   $values['ogname'] = ''; 
    2904   $values['ogname-raw'] = ''; 
    2905   $values['og-id'] = ''; 
    2906   return $values; 
     2723      } 
     2724      return $values; 
     2725  } 
     2726 
     2727  return; 
    29072728} 
    29082729 
     
    29192740    $query['where'] =  'oga.group_nid = '. $args['og_nid']; 
    29202741    return $query; 
    2921   } 
    2922 } 
    2923  
    2924 // A hook from replies.module. Return TRUE if og is handling the notification to a given recipient on a given reply 
    2925 function og_replies_mine($comment, $recipient) { 
    2926   $node = node_load($comment->nid); 
    2927   // check each group that this node is in 
    2928   foreach ((array)$node->og_groups as $gid) { 
    2929     // check if recipient is an active member 
    2930     if (isset($recipient->og_groups[$gid]) && $recipient->og_groups[$gid]['is_active']) { 
    2931       // check if user is already getting this group notification 
    2932       if ($recipient->og_email || $recipient->og_groups[$gid]['mail_type']) { 
    2933         return TRUE; 
    2934       } 
    2935     } 
    29362742  } 
    29372743} 
     
    29522758        } 
    29532759     
    2954     if (!module_exists('job_queue')) { 
    2955       $requirements['og_modules']  = array( 
    2956         'title' => $t('Organic groups modules'), 
    2957         'value' => $t('Organic groups works best when !job_queue.module is enabled. See the Integration section of the !readme.', array('!job_queue' => l('job_queue.module', 'http://drupal.org/project/job_queue'), '!readme' => og_readme())), 
    2958         'severity' => REQUIREMENT_INFO 
    2959       ); 
    2960     } 
    2961      
    29622760    if (!module_exists('og_access')) { 
    29632761      $requirements['og_access'] = array( 
     
    29942792  return FALSE; 
    29952793} 
     2794 
     2795/** 
     2796 * Access callback: og_notifications (or similar) is required for the broadcast 
     2797 * tab. Override menu item to amend. 
     2798 */ 
     2799function og_broadcast_access($node) { 
     2800  return og_is_node_admin($node) && module_exists('og_notifications'); 
     2801} 
  • external/current/sites/all/modules/og/og_access.info

    r42 r127  
    33package = "Organic groups" 
    44dependencies = og 
    5 ; Information added by drupal.org packaging script on 2008-05-12 
    6 version = "5.x-7.2" 
    7 project = "og" 
    8 datestamp = "1210629035" 
    9  
  • external/current/sites/all/modules/og/og_access.module

    r42 r127  
    11<?php 
    2 // $Id: og_access.module,v 1.1.2.10 2008/05/08 19:49:26 weitzman Exp $ 
     2// $Id: og_access.module,v 1.1.2.11 2008/05/26 14:03:35 weitzman Exp $ 
    33 
    44// visibility states for private groups. site admin chooses in og_access_settings() 
     
    1818    $items[] = array( 
    1919      'path' => 'admin/og/og_access', 
    20       'title' => t('Organic Groups Access configuration'), 
     20      'title' => t('Organic groups access configuration'), 
    2121      'description' => t('Choose whether new groups should be private or public'), 
    2222      'callback' => 'drupal_get_form', 
     
    3131  drupal_add_js(drupal_get_path('module', 'og_access'). '/og_access.js'); // load the form javascript to handle private groups / node visibility conflicts in the og access settings form. 
    3232   
    33   $options = array(t('Visible only within the targeted groups'), t('Visible within the targeted groups and on other pages'), t('Visibility chosen by author/editor using a checkbox on the posting form. '). t('Checkbox defaults to @pub.', array('@pub' => t('Public'))), t('Visibility chosen by author/editor using a checkbox on the posting form. '). t('Checkbox defaults to @pri.', array('@pri' => t('Private')))); 
    34   $form['og_visibility'] = array('#type' => 'radios', '#title' => t('Visibility of posts'), '#default_value' => variable_get('og_visibility', 0), '#description' =>t('Determine how broadly available a given post should be when it is affiliated with a group. OG admins always see the checkbox for making a post @pub. Note that changing this setting has no effect on existing posts. Re-save those posts to acquire this new setting.  If the setting you want is disabled here, check the settings under <em>Private Groups</em> setting below. You cannot set node visibility to always be public if private groups are set to always on and vice versa.', array('@pub' => t('Public'))), '#options' => $options); 
     33  $options = array(t('Visible only within the targeted groups.'), t('Visible within the targeted groups and on other pages.'), t('Visibility chosen by author/editor using a checkbox on the posting form.') .' '. t('Checkbox defaults to @pub.', array('@pub' => t('Public'))), t('Visibility chosen by author/editor using a checkbox on the posting form. '). t('Checkbox defaults to @pri.', array('@pri' => t('Private')))); 
     34  $form['og_visibility'] = array('#type' => 'radios', '#title' => t('Visibility of posts'), '#default_value' => variable_get('og_visibility', 0), '#description' =>t('Determine how broadly available a given post should be when it is affiliated with a group. OG admins always see the checkbox for making a post @pub. Note that changing this setting has no effect on existing posts. Re-save those posts to acquire this new setting. If the setting you want is disabled here, check the settings under <em>Private Groups</em> setting below. You cannot set node visibility to always be public if private groups are set to always on and vice versa.', array('@pub' => t('Public'))), '#options' => $options); 
    3535   
    3636  // private groups control 
     
    4545    '#options' => $options,  
    4646    '#default_value' => variable_get('og_private_groups', OG_PRIVATE_GROUPS_CHOOSE_FALSE),     
    47     '#description' =>t("<p>A private group's group home page cannot be seen by non-members, and new posts created in the group will default to being private.  This setting controls what private groups options can be used when creating a new group or editing an existing group.  If you select one of the <em>group administrator chooses</em> options then it will be up to group admins whether their new groups are private or not, with the default you specify here.<p><p>Note that the privacy of all <em>content</em> in the group is determined as each node is created or edited, according to the <em>Node authoring form / Visibility of Posts</em> setting on this page.  Note also that changing this setting only affects the default for new groups being created, not the privacy of any existing groups!  To change those you must edit the groups and their individual content nodes directly.  If the setting you want is disabled here, check <em>Visibility of Posts</em> above.  You cannot choose to only have private groups if node visibility is set to be always public, and vice versa.</p>"),                               
     47    '#description' => '<p>'. t("A private group's group home page cannot be seen by non-members, and new posts created in the group will default to being private. This setting controls what private groups options can be used when creating a new group or editing an existing group. If you select one of the <em>group administrator chooses</em> options then it will be up to group admins whether their new groups are private or not, with the default you specify here.") .'<p><p>'. t('Note that the privacy of all <em>content</em> in the group is determined as each node is created or edited, according to the <em>Node authoring form / Visibility of Posts</em> setting on this page. Note also that changing this setting only affects the default for new groups being created, not the privacy of any existing groups! To change those you must edit the groups and their individual content nodes directly. If the setting you want is disabled here, check <em>Visibility of Posts</em> above. You cannot choose to only have private groups if node visibility is set to be always public, and vice versa.') .'</p>',                               
    4848  ); 
    4949  return system_settings_form($form); 
     
    8282      $form['og_private'] = array ( 
    8383        '#type' => 'checkbox', 
    84         '#title' => t('private group'),  
     84        '#title' => t('Private group'),  
    8585        '#default_value' => $node->nid ? $node->og_private : $default,  
    86         '#description' => t('Should this group be visible only to its members?  Disabled if the group is set to <em>List in Directory</em> or <em>Membership requests: open</em>')); 
     86        '#description' => t('Should this group be visible only to its members? Disabled if the group is set to <em>List in Directory</em> or <em>Membership requests: open</em>.')); 
    8787        break; 
    8888  } 
     
    258258function og_access_node_access_explain($row) { 
    259259  if ($row->realm == 'og_public') { 
    260     return t('All users may view this node.', array('@op' => $op)); 
     260    return t('All users may view this node.'); 
    261261  } 
    262262  elseif ($row->realm == 'og_subscriber') { 
    263263    $node = node_load((int)$row->gid); 
    264     return t('Members of !group_n may view this node.', array('@op' => $op, '!group_n' => l($node->title, "node/$row->gid"))); 
    265   } 
    266 } 
     264    return t('Members of !group_n may view this node.', array('!group_n' => l($node->title, "node/$row->gid"))); 
     265  } 
     266} 
  • external/current/sites/all/modules/og/og_panels.info

    r42 r127  
    44package = "Organic groups" 
    55dependencies = og panels panels_views 
    6 ; Information added by drupal.org packaging script on 2008-05-12 
    7 version = "5.x-7.2" 
    8 project = "og" 
    9 datestamp = "1210629035" 
    10  
  • external/current/sites/all/modules/og/og_panels.install

    r42 r127  
    11<?php 
    2 // $Id: og_panels.install,v 1.1.2.4 2008/03/17 15:04:28 weitzman Exp $ 
     2// $Id: og_panels.install,v 1.1.2.4.2.1 2008/10/31 12:16:14 weitzman Exp $ 
    33 
    44function og_panels_install() { 
     
    2727        default_page integer NULL, 
    2828        show_blocks integer NULL, 
    29         weight integer(4) NOT NULL DEFAULT 0, 
     29        weight smallint NOT NULL DEFAULT 0, 
    3030        PRIMARY KEY  (did) 
    3131      );"); 
  • external/current/sites/all/modules/og/og_panels.module

    r42 r127  
    11<?php 
    2 // $Id: og_panels.module,v 1.1.2.30 2008/04/20 17:51:10 weitzman Exp $ 
     2// $Id: og_panels.module,v 1.1.2.32.2.1 2008/10/31 12:12:27 weitzman Exp $ 
    33 
    44function og_panels_help($section) { 
     
    77      return t('After enabling this module, visit the new Pages tab on any group. There, group admins may create as many pages as desired for their group. The pages may contain any layout that the site offers and admins may arrange many different types of content as desired. Site admins can restrict the types of content that may be added on the <a href="!settings">og_panels settings</a> page. You might want to make some Views available using <a href="!apv">admin/panels/views</a>. Group admins may designate one page as their group home page.', array('!settings' => url('admin/og/og_panels'), '!apv' => url('admin/panels/views'))); 
    88      case (arg(0) == 'node' && arg(2) == 'og_panels' && !arg(3)): 
    9         return t( 
    10           '<p>Create custom pages for your group. Use custom pages to organize your content in a pretty and informative manner. Your group can group to be a whole website within a web site. Each custom page becomes a tab when viewing your group. One of your custom pages should be designated as your <em>group home page</em>. That page will then display when visitors first arrive at your group.</p> 
    11           <p>Start by clicking the <a href="!url">Add new page</a> tab. Then you will choose a custom layout for your page. Then you will want to <em>edit content</em> for your custom page.</p>', array('!url' => url('node/'. arg(1). '/og_panels/form'))); 
     9        return '<p>'. t('Create custom pages for your group. Use custom pages to organize your content in a pretty and informative manner. Your group can group to be a whole website within a web site. Each custom page becomes a tab when viewing your group. One of your custom pages should be designated as your <em>group home page</em>. That page will then display when visitors first arrive at your group.') .'</p><p>'. t('Start by clicking the <a href="!url">Add new page</a> tab. Then you will choose a custom layout for your page. Then you will want to <em>edit content</em> for your custom page.', array('!url' => url('node/'. arg(1). '/og_panels/form'))) .'</p>'; 
    1210  } 
    1311} 
     
    1715    $items[] = array( 
    1816      'path' => 'admin/og/og_panels', 
    19       'title' => 'Organic groups panels', 
    20       'description' => 'Configure the content that is available to group admins when creating group pages.', 
     17      'title' => t('Organic groups panels'), 
     18      'description' => t('Configure the content that is available to group admins when creating group pages.'), 
    2119      'callback' => 'og_panels_admin_content', 
    2220      'access' => user_access('administer organic groups'), 
     
    152150function og_panels_delete_confirm_submit($form_id, $form_values) { 
    153151  og_panels_delete($form_values['did']); 
    154   drupal_set_message(t('%title has been deleted', array('%title' => $form_values['page_title']))); 
     152  drupal_set_message(t('%title has been deleted.', array('%title' => $form_values['page_title']))); 
    155153} 
    156154 
     
    184182    $item['page_title'] = array('#value' => l($display->page_title, "node/$nid/$display->path")); 
    185183    $item['weight'] = array('#type' => 'weight', '#default_value' => $display->weight); 
    186     $item['edit content'] = array('#value' => l(t('edit content'), "node/$nid/og_panels/$display->did/panel_content", array(), drupal_get_destination())); 
    187     $item['change layout'] = array('#value' => l(t('change layout'), "node/$nid/og_panels/$display->did/panel_layout")); 
    188     $item['edit layout settings'] = array('#value' => l(t('edit layout settings'), "node/$nid/og_panels/$display->did/panel_settings")); 
    189     $item['edit page'] = array('#value' => l(t('edit page'), "node/$nid/og_panels/form/$display->did", array(), drupal_get_destination())); 
    190     $item['delete page'] =  array('#value' => l(t('delete page'), "node/$nid/og_panels/$display->did/delete", array(), drupal_get_destination())); 
     184    $item['edit content'] = array('#value' => l(t('Edit content'), "node/$nid/og_panels/$display->did/panel_content", array(), drupal_get_destination())); 
     185    $item['change layout'] = array('#value' => l(t('Change layout'), "node/$nid/og_panels/$display->did/panel_layout")); 
     186    $item['edit layout settings'] = array('#value' => l(t('Edit layout settings'), "node/$nid/og_panels/$display->did/panel_settings")); 
     187    $item['edit page'] = array('#value' => l(t('Edit page'), "node/$nid/og_panels/form/$display->did", array(), drupal_get_destination())); 
     188    $item['delete page'] =  array('#value' => l(t('Delete page'), "node/$nid/og_panels/$display->did/delete", array(), drupal_get_destination())); 
    191189      
    192190    $form['displays'][$display->did] = $item; 
     
    207205  $form['submit'] = array( 
    208206    '#type' => 'submit',  
    209     '#value' => t('Save Settings'), 
     207    '#value' => t('Save settings'), 
    210208  ); 
    211209 
     
    273271  drupal_set_breadcrumb($bc); 
    274272  // Mark node as read and show feed icon for any group panel page (how to do this better?) 
    275   drupal_add_feed(url("node/$nid/feed"), t('@name at @site', array('@name' => $node->title, '@site' => variable_get('site_name', 'drupal')))); 
    276   node_tag_new($node->nid); 
     273  drupal_add_feed(url("node/$group_node->nid/feed"), t('@name at @site', array('@name' => $group_node->title, '@site' => variable_get('site_name', 'drupal')))); 
     274  node_tag_new($group_node->nid); 
    277275   
    278276   
     
    581579   
    582580    $items['og_subscribers'] = array( 
    583       'title' => t('OG Members'), 
     581      'title' => t('OG members'), 
    584582      'content_types' => 'og_panels_ct_list_subscribers', 
    585583      'single' => TRUE, // only provides a single content type 
     
    604602    if (og_is_picture()) { 
    605603      $items['og_faces'] = array( 
    606         'title' => t('OG Faces'), 
     604        'title' => t('OG faces'), 
    607605        'content_types' => 'og_panels_ct_list_faces', 
    608606        'single' => TRUE, // only provides a single content type 
     
    636634  switch ($delta) { 
    637635    case 2: 
    638       // Provide alternate versions as content items 
     636      // Provide alternate versions of these content items 
    639637      unset($info); 
    640638      break; 
    641     case 'default': 
     639    default: 
    642640      $info['icon'] = 'user-multiple.png'; 
    643641      $info['required context'] = new panels_required_context(t('Group'), 'group'); 
  • external/current/sites/all/modules/og/og_views.inc

    r42 r127  
    11<?php 
    2 // $Id: og_views.inc,v 1.12.2.54 2008/05/08 19:49:26 weitzman Exp $ 
     2// $Id: og_views.inc,v 1.12.2.55.2.4 2008/10/06 07:56:45 karthik Exp $ 
    33/** 
    44 * Implementation of the hook_views_tables() 
     
    3232        ), 
    3333        'count' => array( 
    34           'name' => t('OG: Group: Members Count'), 
     34          'name' => t('OG: Group: Members count'), 
    3535          'handler' => 'og_handler_field_count', 
    3636          'help' => t('Number of members for a group. Excludes memberships which are pending approval.'), 
     
    3939        ), 
    4040        'post_count' => array( 
    41           'name' => t('OG: Group: Post Count'), 
     41          'name' => t('OG: Group: Post count'), 
    4242          'handler' => 'og_handler_post_count', 
    4343          'sortable' => FALSE, 
     
    5353        ), 
    5454        'post_count_new' => array( 
    55           'name' => t('OG: Group: Post Count *New*'), 
     55          'name' => t('OG: Group: Post count *new*'), 
    5656          'handler' => 'og_handler_post_count_new', 
    5757          'sortable' => FALSE, 
     
    6161             '#type' => 'select', 
    6262             '#options' => array( 
    63                'normal' => 'Normal', 
    64                'withmark' => 'With new mark' 
     63               'normal' => t('Normal'), 
     64               'withmark' => t('With new mark') 
    6565              ), 
    6666          ), 
     
    7171        'private' => array( 
    7272          'name' => t('OG: Group: Private'), 
     73          'handler' => 'og_handler_field_private', 
     74          'sortable' => TRUE, 
     75          'help' => t('Displays whether a group is private or public with respect to groups.'), 
    7376        ), 
    7477        'subscribe' => array( 
     
    7982          'notafield' => TRUE, 
    8083          'help' => t('Displays a links for joining a group when a user is not already a member.'), 
    81         ), 
    82         'notification' => array( 
    83           'name' => t('OG: Group: Notification'), 
    84           'handler' => 'og_handler_field_yesempty', 
    85           'help' => t('Displays <em>yes</em> if group automatically sends email notifications to members'), 
    8684        ), 
    8785        'language' => array( 
     
    226224      ), 
    227225      'fields' => array( 
    228         'mail_type' => array( 
    229           'name' => t('OG: Subscription email'), 
    230           'handler' => 'og_handler_field_yesempty', 
    231           'sortable' => false, 
    232           'help' => t('Does member receive email notifications for a group.'), 
    233         ), 
    234226        'managelink' => array( 
    235227          'name' => t('OG: Manage membership link'), 
     
    247239        'currentuidsimple' => array( 
    248240          'field' => 'uid', 
    249           'name' => t('OG: Group in User\'s Groups'), 
     241          'name' => t("OG: Group in user's groups"), 
    250242          'operator' => 'views_handler_operator_eqneq', 
    251243          'list' => 'views_handler_filter_usercurrent', 
     
    332324      ), 
    333325      'help' => t('Filter for the one or more organic groups. Groups should be specified by name, or part of a name. Use the <em>Option</em> field to specify how to match the supplied name.'), 
    334       ) 
     326      ), 
     327    'og_uid' => array( 
     328      'name' => t('OG: User is subscribed to group'),  
     329      'handler' => 'og_views_handler_argument_uid', 
     330      'help' => t("Filter for groups that user is subscribed to.  User is specified by user ID (integer).  This argument exposes a user's group subscriptions to other users. Depending on your site, this may be a violation of their privacy. Use it thoughfully."), 
     331    ), 
    335332    ); 
    336333  return $args; 
     
    363360    case 'title': 
    364361      return db_result(db_query_range('SELECT title FROM {node} WHERE nid = %d', $query, 0, 1));; 
     362  } 
     363} 
     364 
     365/** 
     366 * Custom argument for filtering by groups that a user is subscribed to 
     367 */ 
     368function og_views_handler_argument_uid($op, &$query, $a1, $a2 = null) { 
     369  switch ($op) { 
     370    case 'filter': 
     371      $query->ensure_table('og_uid'); 
     372      $query->add_where("og_uid.uid = %d", $a2); 
     373      break; 
     374    case 'title': 
     375      // This returns the title for this node in the title, breadcrumb, etc. 
     376      return db_result(db_query('SELECT name FROM {users} WHERE uid = %d', $a2)); 
    365377  } 
    366378} 
     
    425437  $view = new stdClass(); 
    426438  $view->name = 'og_mytracker'; 
    427   $view->description = 'Shows all activity in subscribed groups.'; 
     439  $view->description = t('Shows all activity in subscribed groups.'); 
    428440  $view->access = array ( 
    429441  0 => '2', 
     
    431443  $view->view_args_php = ''; 
    432444  $view->page = TRUE; 
    433   $view->page_title = 'Recent posts in my groups'; 
     445  $view->page_title = t('Recent posts in my groups'); 
    434446  $view->page_header = ''; 
    435447  $view->page_header_format = '1'; 
    436448  $view->page_footer = ''; 
    437449  $view->page_footer_format = '1'; 
    438   $view->page_empty = 'There are no posts in your subscribed groups.'; 
     450  $view->page_empty = t('There are no posts in your subscribed groups.'); 
    439451  $view->page_empty_format = '1'; 
    440452  $view->page_type = 'table'; 
     
    443455  $view->nodes_per_page = '25'; 
    444456  $view->menu = TRUE; 
    445   $view->menu_title = 'My recent'; 
     457  $view->menu_title = t('My recent'); 
    446458  $view->menu_tab = TRUE; 
    447459  $view->menu_tab_weight = '0'; 
     
    478490      'tablename' => 'node', 
    479491      'field' => 'title', 
    480       'label' => 'Title', 
     492      'label' => t('Title'), 
    481493      'handler' => 'views_handler_field_nodelink_with_mark', 
    482494      'sortable' => '1', 
     
    486498      'tablename' => 'users', 
    487499      'field' => 'name', 
    488       'label' => 'Author', 
     500      'label' => t('Author'), 
    489501      'sortable' => '1', 
    490502    ), 
     
    492504      'tablename' => 'node_comment_statistics', 
    493505      'field' => 'comment_count', 
    494       'label' => 'Replies', 
     506      'label' => t('Replies'), 
    495507      'handler' => 'views_handler_comments_with_new', 
    496508      'sortable' => '1', 
     
    499511      'tablename' => 'node_comment_statistics', 
    500512      'field' => 'last_comment_timestamp', 
    501       'label' => 'Last Post', 
     513      'label' => t('Last post'), 
    502514      'handler' => 'views_handler_field_since', 
    503515      'sortable' => '1', 
     
    529541  $view = new stdClass(); 
    530542  $view->name = 'og_unread'; 
    531   $view->description = 'Shows unread posts in subscribed groups.'; 
     543  $view->description = t('Shows unread posts in subscribed groups.'); 
    532544  $view->access = array ( 
    533545  0 => '2', 
     
    535547  $view->view_args_php = ''; 
    536548  $view->page = TRUE; 
    537   $view->page_title = 'Unread posts in my groups'; 
     549  $view->page_title = t('Unread posts in my groups'); 
    538550  $view->page_header = ''; 
    539551  $view->page_header_format = '1'; 
    540552  $view->page_footer = ''; 
    541553  $view->page_footer_format = '1'; 
    542   $view->page_empty = 'There are no new posts in your subscribed groups.'; 
     554  $view->page_empty = t('There are no new posts in your subscribed groups.'); 
    543555  $view->page_empty_format = '1'; 
    544556  $view->page_type = 'table'; 
     
    547559  $view->nodes_per_page = '25'; 
    548560  $view->menu = TRUE; 
    549   $view->menu_title = 'My unread'; 
     561  $view->menu_title = t('My unread'); 
    550562  $view->menu_tab = TRUE; 
    551563  $view->menu_tab_weight = '-5'; 
     
    571583      'tablename' => 'og_node_data', 
    572584      'field' => 'title', 
    573       'label' => 'Group', 
     585      'label' => t('Group'), 
    574586    ), 
    575587    array ( 
    576588      'tablename' => 'node', 
    577589      'field' => 'type', 
    578       'label' => 'Type', 
     590      'label' => t('Type'), 
    579591      'sortable' => '1', 
    580592    ), 
     
    582594      'tablename' => 'node', 
    583595      'field' => 'title', 
    584       'label' => 'Title', 
     596      'label' => t('Title'), 
    585597      'handler' => 'views_handler_field_nodelink_with_mark', 
    586598      'sortable' => '1', 
     
    590602      'tablename' => 'users', 
    591603      'field' => 'name', 
    592       'label' => 'Author', 
     604      'label' => t('Author'), 
    593605      'sortable' => '1', 
    594606    ), 
     
    596608      'tablename' => 'node_comment_statistics', 
    597609      'field' => 'comment_count', 
    598       'label' => 'Replies', 
     610      'label' => t('Replies'), 
    599611      'handler' => 'views_handler_comments_with_new', 
    600612      'sortable' => '1', 
     
    603615      'tablename' => 'node_comment_statistics', 
    604616      'field' => 'last_comment_timestamp', 
    605       'label' => 'Last Post', 
     617      'label' => t('Last post'), 
    606618      'handler' => 'views_handler_field_since', 
    607619      'sortable' => '1', 
     
    644656  $view = new stdClass(); 
    645657  $view->name = 'og_ghp_ron'; 
    646   $view->description = 'OG: Group home page - River of news. Default'; 
     658  $view->description = t('OG: Group home page - River of news. Default'); 
    647659  $view->page = TRUE; 
    648660  $view->page_type = 'teaser'; 
     
    699711  $view = new stdClass(); 
    700712  $view->name = 'og_my'; 
    701   $view->description = 'List user\'s subscribed groups and provide link to manage subscription'; 
     713  $view->description = t("List user's subscribed groups and provide link to manage subscription"); 
    702714  $view->access = array ( 
    703715  0 => '2', 
     
    705717  $view->view_args_php = ''; 
    706718  $view->page = TRUE; 
    707   $view->page_title = 'My groups'; 
    708   $view->page_header = strtr('You may edit all your email subscriptions using this convenient page. Also, you might be interested in an <a href="!url" rel="nofollow">OPML feed containing feeds from all your subscribed groups</a>.', array('!url' => url('og/opml'))); 
     719  $view->page_title = t('My groups'); 
     720  $view->page_header = t('You might be interested in an <a href="!url" rel="nofollow">OPML feed containing feeds from all your subscribed groups</a>.', array('!url' => url('og/opml'))); 
    709721  $view->page_header_format = '1'; 
    710722  $view->page_footer = '<?php 
     
    715727?>'; 
    716728  $view->page_footer_format = '2'; 
    717   $view->page_empty = 'No subscribed groups'; 
     729  $view->page_empty = t('No subscribed groups'); 
    718730  $view->page_empty_format = '1'; 
    719731  $view->page_type = 'table'; 
     
    752764      'tablename' => 'node', 
    753765      'field' => 'title', 
    754       'label' => 'Group', 
     766      'label' => t('Group'), 
    755767      'handler' => 'views_handler_field_nodelink', 
    756768      'options' => 'link', 
     
    759771      'tablename' => 'users', 
    760772      'field' => 'name', 
    761       'label' => 'Manager', 
     773      'label' => t('Manager'), 
    762774    ), 
    763775    array ( 
    764776      'tablename' => 'og', 
    765777      'field' => 'count', 
    766       'label' => 'Members', 
    767     ), 
    768     array ( 
    769       'tablename' => 'og_uid', 
    770       'field' => 'mail_type', 
    771       'label' => 'Email', 
     778      'label' => t('Members'), 
    772779    ), 
    773780    array ( 
    774781      'tablename' => 'og_uid', 
    775782      'field' => 'managelink', 
    776       'label' => 'Manage', 
     783      'label' => t('Manage'), 
    777784    ), 
    778785  ); 
     
    814821  $view->view_args_php = ''; 
    815822  $view->page = TRUE; 
    816   $view->page_title = 'Groups directory'; 
     823  $view->page_title = t('Groups directory'); 
    817824  $view->page_header = ''; 
    818825  $view->page_header_format = '2'; 
    819826  $view->page_footer = ''; 
    820827  $view->page_footer_format = '1'; 
    821   $view->page_empty = 'No groups'; 
     828  $view->page_empty = t('No groups'); 
    822829  $view->page_empty_format = '1'; 
    823830  $view->page_type = 'table'; 
     
    826833  $view->nodes_per_page = '90'; 
    827834  $view->menu = TRUE; 
    828   $view->menu_title = 'Groups'; 
     835  $view->menu_title = t('Groups'); 
    829836  $view->menu_tab = TRUE; 
    830837  $view->menu_tab_weight = '-5'; 
     
    850857      'tablename' => 'node', 
    851858      'field' => 'title', 
    852       'label' => 'Group', 
     859      'label' => t('Group'), 
    853860      'handler' => 'views_handler_field_nodelink', 
    854861      'sortable' => '1', 
     
    858865      'tablename' => 'users', 
    859866      'field' => 'name', 
    860       'label' => 'Manager', 
     867      'label' => t('Manager'), 
    861868    ), 
    862869    array ( 
    863870      'tablename' => 'og', 
    864871      'field' => 'count', 
    865       'label' => 'Members', 
     872      'label' => t('Members'), 
    866873    ), 
    867874    array ( 
    868875      'tablename' => 'og', 
    869876      'field' => 'description', 
    870       'label' => 'Description', 
     877      'label' => t('Description'), 
    871878    ), 
    872879    array ( 
    873880      'tablename' => 'og', 
    874881      'field' => 'subscribe', 
    875       'label' => 'Join', 
     882      'label' => t('Join'), 
    876883    ), 
    877884  ); 
     
    910917      'tablename' => 'node', 
    911918      'field' => 'title', 
    912       'label' => 'Search for a group by name', 
     919      'label' => t('Search for a group by name'), 
    913920      'optional' => '1', 
    914921      'is_default' => '0', 
     
    924931  $view = new stdClass(); 
    925932  $view->name = 'og_tracker'; 
    926   $view->description = 'Shows active posts across the whole site'; 
     933  $view->description = t('Shows active posts across the whole site'); 
    927934  $view->access = array ( 
    928935); 
    929936  $view->view_args_php = ''; 
    930937  $view->page = TRUE; 
    931   $view->page_title = 'Recent posts across whole site'; 
     938  $view->page_title = t('Recent posts across whole site'); 
    932939  $view->page_header = ''; 
    933940  $view->page_header_format = '1'; 
     
    941948  $view->nodes_per_page = '25'; 
    942949  $view->menu = TRUE; 
    943   $view->menu_title = 'Recent posts'; 
     950  $view->menu_title = t('Recent posts'); 
    944951  $view->menu_tab = TRUE; 
    945952  $view->menu_tab_weight = '5'; 
     
    961968      'type' => 'uid', 
    962969      'argdefault' => '2', 
    963       'title' => 'Recent posts for %1', 
     970      'title' => t('Recent posts for %1'), 
    964971      'options' => '', 
    965972      'wildcard' => '', 
     
    984991      'tablename' => 'node', 
    985992      'field' => 'title', 
    986       'label' => 'Title', 
     993      'label' => t('Title'), 
    987994      'handler' => 'views_handler_field_nodelink_with_mark', 
    988995      'options' => 'link', 
     
    991998      'tablename' => 'users', 
    992999      'field' => 'name', 
    993       'label' => 'Author', 
     1000      'label' => t('Author'), 
    9941001    ), 
    9951002    array ( 
    9961003      'tablename' => 'node_comment_statistics', 
    9971004      'field' => 'comment_count', 
    998       'label' => 'Replies', 
     1005      'label' => t('Replies'), 
    9991006      'handler' => 'views_handler_comments_with_new', 
    10001007    ), 
     
    10021009      'tablename' => 'og_node_data', 
    10031010      'field' => 'title', 
    1004       'label' => 'Groups', 
     1011      'label' => t('Groups'), 
    10051012    ), 
    10061013    array ( 
    10071014      'tablename' => 'node_comment_statistics', 
    10081015      'field' => 'last_comment_timestamp', 
    1009       'label' => 'Last Post', 
     1016      'label' => t('Last post'), 
    10101017      'handler' => 'views_handler_field_since', 
    10111018    ), 
     
    10291036  $view = new stdClass(); 
    10301037  $view->name = 'og_search'; 
    1031   $view->description = 'Search within a particular group'; 
     1038  $view->description = t('Search within a particular group'); 
    10321039  $view->access = array ( 
    10331040); 
    10341041  $view->view_args_php = ''; 
    10351042  $view->page = TRUE; 
    1036   $view->page_title = 'Search'; 
     1043  $view->page_title = t('Search'); 
    10371044  $view->page_header = ''; 
    10381045  $view->page_header_format = '1'; 
    10391046  $view->page_footer = ''; 
    10401047  $view->page_footer_format = '1'; 
    1041   $view->page_empty = 'No posts found.'; 
     1048  $view->page_empty = t('No posts found.'); 
    10421049  $view->page_empty_format = '1'; 
    10431050  $view->page_type = 'teaser'; 
     
    10571064      'type' => 'gid', 
    10581065      'argdefault' => '1', 
    1059       'title' => 'Search results for %1', 
     1066      'title' => t('Search results for %1'), 
    10601067      'options' => '', 
    10611068      'wildcard' => '', 
     
    10851092      'tablename' => 'temp_search_results', 
    10861093      'field' => 'word', 
    1087       'label' => 'Enter keyword', 
     1094      'label' => t('Enter keyword'), 
    10881095      'optional' => '1', 
    10891096      'is_default' => '0', 
     
    10981105  $view = new stdClass(); 
    10991106  $view->name = 'og_comments_recent'; 
    1100   $view->description = 'Display recent comments block in a group'; 
     1107  $view->description = t('Display recent comments block in a group'); 
    11011108  $view->access = array ( 
    11021109); 
    11031110  $view->view_args_php = ''; 
    11041111  $view->block = TRUE; 
    1105   $view->block_title = 'Recent comments'; 
     1112  $view->block_title = t('Recent comments'); 
    11061113  $view->block_header = ''; 
    11071114  $view->block_header_format = '1'; 
     
    11711178  $view = new stdClass(); 
    11721179  $view->name = 'og_recent_type_term'; 
    1173   $view->description = 'Recent posts for current term filtered by node type and/or taxonomy term'; 
     1180  $view->description = t('Recent posts for current term filtered by node type and/or taxonomy term'); 
    11741181  $view->access = array ( 
    11751182); 
     
    12631270} 
    12641271 
     1272function og_handler_field_private($fieldinfo, $fielddata, $value, $data) { 
     1273  return $value ? t('Private') : t('Public'); 
     1274} 
     1275 
     1276 
    12651277function og_handler_field_language($fieldinfo, $fielddata, $value, $data) { 
    12661278  global $locale; 
  • external/current/sites/all/modules/og/og_workflow_ng.inc

    r42 r127  
    11<?php 
    2 // $Id: og_workflow_ng.inc,v 1.1.2.2 2008/04/14 14:02:14 weitzman Exp $ 
     2// $Id: og_workflow_ng.inc,v 1.1.2.4 2008/07/31 20:08:16 weitzman Exp $ 
    33 
    44/** 
    55 * @file 
    6  * workflow_ng integration for og module 
     6 * workflow_ng integration for og module. 
    77 */ 
    88 
    99/** 
    10  * Implementation of hook_event_info() 
     10 * Implementation of hook_event_info(). 
    1111 */ 
    1212function og_event_info() { 
     
    1717      '#arguments' => og_workflow_ng_events_hook_og_arguments(), 
    1818    ), 
     19    'og_user_approved' => array( 
     20      '#label' => t('User approved to group by admin'), 
     21      '#module' => t('OG'), 
     22      '#description' => t('A pending member is approved by a group administrator.'), 
     23      '#arguments' => og_workflow_ng_events_hook_og_arguments(), 
     24    ), 
    1925    'og_user_delete' => array( 
    2026      '#label' => t('User leaves group'), 
    2127      '#module' => t('OG'), 
    2228      '#arguments' => og_workflow_ng_events_hook_og_arguments(), 
    23     ), 
    24   ); 
     29   ), 
     30 );     
    2531} 
    2632 
    2733/** 
    28  * Describes the arguments available for the og hook 
     34 * Describes the arguments available for the og hook. 
    2935 *  
    3036 * We pass uid and gid to workflow-ng so that the argument handlers can load the full entities. 
     
    4147 
    4248/** 
    43  * handler to get user 
     49 * handler to get user. 
    4450 */ 
    4551function og_workflow_ng_events_argument_og_user($uid, $gid) { 
     
    4854 
    4955/** 
    50  * handler to get node 
     56 * handler to get node. 
    5157 */ 
    5258function og_workflow_ng_events_argument_og_node($uid, $gid) {