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

Diff of /contributions/modules/conference_organizing/conference_organizing.module

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

revision 1.7, Fri Sep 7 01:24:56 2007 UTC revision 1.8, Mon Oct 15 01:35:50 2007 UTC
# Line 91  function conference_organizing_menu($may Line 91  function conference_organizing_menu($may
91          'access' => user_access('access content'),          'access' => user_access('access content'),
92          'type' => MENU_CALLBACK,          'type' => MENU_CALLBACK,
93      );      );
94      $items[] = array(  
       'path' => 'groups_directory',  
       'title' => t('Working Groups'),  
       'callback' => 'conference_organizing_groups_directory',  
       'access' => user_access('access content'),  
       'type' => MENU_CALLBACK,  
     );  
95      $items[] = array(      $items[] = array(
96        'path' => 'home',        'path' => 'home',
97        'title' => t('Home'),        'title' => t('Home'),
# Line 297  function conference_organizing_post_conf Line 291  function conference_organizing_post_conf
291  function conference_organizing_form_alter($form_id, &$form) {  function conference_organizing_form_alter($form_id, &$form) {
292    global $user;    global $user;
293    $group = conference_organizing_get_conference_context();    $group = conference_organizing_get_conference_context();
294    
295    switch ($form_id) {    switch ($form_id) {
296      case 'conference_organizing_user_register':      case 'conference_organizing_user_register':
297        conference_organizing_form_alter_user_register($form);        conference_organizing_form_alter_user_register($form);
# Line 382  function conference_organizing_form_alte Line 376  function conference_organizing_form_alte
376        $form['og_settings']['#title'] = t('Subscriptions');        $form['og_settings']['#title'] = t('Subscriptions');
377        break;        break;
378      case 'user_pass_reset':      case 'user_pass_reset':
379        // the user object and the conference they are registering for        if ($account->login) {
380        $account = user_load(array("uid" => arg(2)));          drupal_set_title('Log in for the first time...');
381            // the user object and the conference they are registering for
382        // if user is not blocked          $account = user_load(array("uid" => arg(2)));
383        if ($account->status == 1) {          // if user is not blocked
384          unset($form['help']);          if ($account->status == 1) {
385              unset($form['help']);
386          // set the title of the page to be the conference they are registering for if applicable  
387          if (count($account->og_groups) > 0) {            // set the title of the page to be the conference they are registering for if applicable
388            $group = node_load(array_pop(array_keys($account->og_groups)));            if (count($account->og_groups) > 0) {
389            drupal_set_title('Login: '. $group->title);              $group = node_load(array_pop(array_keys($account->og_groups)));
390          }              drupal_set_title('Login: '. $group->title);
391          // set the instructions to be the body of the page with the url alias of 'instructions'            }
392          $path = drupal_lookup_path('source', 'welcome');            // set the instructions to be the body of the page with the url alias of 'instructions'
393          if ($path) {            $path = drupal_lookup_path('source', 'welcome');
394            $nid = str_replace('node/', '', $path);            if ($path) {
395            $instructions_node = node_load($nid);              $nid = str_replace('node/', '', $path);
396            $instructions = check_markup($instructions_node->body);              $instructions_node = node_load($nid);
397                $instructions = check_markup($instructions_node->body);
398              }
399              $form['message']['#value'] = theme("conference_organizing_one_time_login_page", $instructions, $group->title);
400          }          }
         $form['message']['#value'] = theme("conference_organizing_one_time_login_page", $instructions, $group->title);  
401        }        }
402        break;        break;
403      case 'user_register':      case 'user_register':
# Line 506  function conference_organizing_form_alte Line 502  function conference_organizing_form_alte
502    else {    else {
503      // we're editing... hide group form, lock down title, etc      // we're editing... hide group form, lock down title, etc
504      $form['title']['#disabled'] = TRUE;      $form['title']['#disabled'] = TRUE;
505      unset($form['body_filter']['format'][1]);      //unset($form['body_filter']['format'][1]);
506      unset($form['body_filter']['format'][2]);      //unset($form['body_filter']['format'][2]);
507      unset($form['body_filter']['format'][3]);      //unset($form['body_filter']['format'][3]);
508    }    }
509  }  }
510    
# Line 519  function conference_organizing_form_alte Line 515  function conference_organizing_form_alte
515    // If the parent is set, set it and hide the form field    // If the parent is set, set it and hide the form field
516    if (arg(5) == 'session' && is_numeric(arg(6))) {    if (arg(5) == 'session' && is_numeric(arg(6))) {
517       $form['field_related_session']['nids']['#default_value'][0] = arg(6);       $form['field_related_session']['nids']['#default_value'][0] = arg(6);
518       if (!user_access('administer nodes')) {       $form['field_related_session']['nids']['#attributes'] =  array('style' => 'display: none;');
519         $form['field_related_session']['nids']['#attributes'] =  array('style' => 'display: none;');       $form['field_related_session']['nids']['#title'] = '';
        $form['field_related_session']['nids']['#title'] = '';  
      }  
520    }    }
521    // Ekse hide node relation field if not adding a discussion about conference    // Ekse hide node relation field if not adding a discussion about conference
522    elseif ($form['field_related_session']['nids']['#default_value'][0] == '') {    elseif ($form['field_related_session']['nids']['#default_value'][0] == '') {
# Line 750  function theme_conference_organizing_con Line 744  function theme_conference_organizing_con
744      '#type' => 'tabpage',      '#type' => 'tabpage',
745    );    );
746    
747    // Post conference tab (only shown after conference has ended)  
748    if (conference_organizing_time_until_conference($conference_node->nid) < 0) {    $post_conference .= drupal_render($form['field_post_conference']);
749      $post_conference .= drupal_render($form['field_post_conference']);  
750      $tabs['cod_conference']['post_conference'] = array(
751      $tabs['cod_conference']['post_conference'] = array(      '#title' => t('Post Conference'),
752        '#title' => t('Post Conference'),      '#content' => $post_conference,
753        '#content' => $post_conference,      '#type' => 'tabpage',
754        '#type' => 'tabpage',    );
755      );  
   }  
   else {  
     unset($form['field_post_conference']);  
   }  
   
756    // Logistics tab    // Logistics tab
757    $logistics = drupal_render($form['group_logistics']);    $logistics = drupal_render($form['group_logistics']);
758    $logistics .= drupal_render($form['locations']);    $logistics .= drupal_render($form['locations']);
# Line 1498  function conference_organizing_supress_o Line 1487  function conference_organizing_supress_o
1487    $suppressed_strings = array(    $suppressed_strings = array(
1488      'No public posts in this group',      'No public posts in this group',
1489      'No posts in this group',      'No posts in this group',
1490      'in this group. Please use this feature sparingly.'      'in this group. Please use this feature sparingly.',
1491    );    );
1492    $messages_array = drupal_get_messages('status');    $messages_array = drupal_get_messages('status');
1493    $messages = $messages_array['status'];    $messages = $messages_array['status'];
# Line 1759  function conference_organizing_block_con Line 1748  function conference_organizing_block_con
1748    
1749      // set up location strings      // set up location strings
1750      if ($group->locations[0]['city'] && $group->locations[0]['province']) {      if ($group->locations[0]['city'] && $group->locations[0]['province']) {
1751        $location = '| '. $group->locations[0]['city'] .', '. $group->locations[0]['province'];        if ($group->locations[0]['province'] != 'xx') {
1752            $province = ', '. $group->locations[0]['province'];
1753          }
1754          $location = '| '. $group->locations[0]['city'] . $province;
1755      }      }
1756    
1757      $title = $group->title;      $title = $group->title;
# Line 1768  function conference_organizing_block_con Line 1760  function conference_organizing_block_con
1760      // These links are hardcoded here. TODO: have these links come from the menu system.      // These links are hardcoded here. TODO: have these links come from the menu system.
1761      $links = array();      $links = array();
1762      $links[] = array(      $links[] = array(
1763        'title' => t('Home'),        'title' => t('Conference'),
1764        'href' => 'node/'. $group->nid        'href' => 'node/'. $group->nid
1765      );      );
1766      // if there is logistical information      // if there is logistical information
# Line 1976  function conference_organizing_block_con Line 1968  function conference_organizing_block_con
1968        $output .= theme('conference_organizing_format_attendee', $attendee->users_uid, $attendee->node_data_field_first_name_field_first_name_value, $attendee->node_data_field_last_name_field_last_name_value, $attendee->node_data_field_organization_field_organization_value, $attendee->node_data_field_title_field_title_value, theme('user_picture', user_load(array('uid' => $attendee->users_uid))));        $output .= theme('conference_organizing_format_attendee', $attendee->users_uid, $attendee->node_data_field_first_name_field_first_name_value, $attendee->node_data_field_last_name_field_last_name_value, $attendee->node_data_field_organization_field_organization_value, $attendee->node_data_field_title_field_title_value, theme('user_picture', user_load(array('uid' => $attendee->users_uid))));
1969      }      }
1970      $output = $output == '' ? t('There are currently no attendees.') : $output;      $output = $output == '' ? t('There are currently no attendees.') : $output;
1971      $output .= l(t("View all $members_count attendees"), 'attendees/'. $group->nid, array('class' => 'co-button'));      $output .= l(t("View attendees"), 'attendees/'. $group->nid, array('class' => 'co-button'));
1972      $block['subject'] = t('Who is attending?');      $block['subject'] = t('Who is attending?');
1973      $block['content'] = $output;      $block['content'] = $output;
1974    }    }
# Line 2029  function conference_organizing_block_ses Line 2021  function conference_organizing_block_ses
2021      foreach ($node->field_attending as $attendee) {      foreach ($node->field_attending as $attendee) {
2022        if (is_numeric($attendee['uid'])) {        if (is_numeric($attendee['uid'])) {
2023          if ($count < $toshow) {          if ($count < $toshow) {
2024            $bioid = bio_for_user($attendee['uid']);            $bioid = bio_for_user($attendee['uid']);
2025            if ($bioid) {            if ($bioid) {
2026              $bio = node_load($bioid);              $bio = node_load($bioid);
2027              $output .= theme('conference_organizing_format_attendee', $attendee['uid'], $bio->field_first_name[0]['value'], $bio->field_last_name[0]['value'], $bio->field_organization[0]['value'], $bio->field_title[0]['value'], theme('user_picture', user_load(array('uid' => $bio->users_uid))));              $output .= theme('conference_organizing_format_attendee', $attendee['uid'], $bio->field_first_name[0]['value'], $bio->field_last_name[0]['value'], $bio->field_organization[0]['value'], $bio->field_title[0]['value'], theme('user_picture', user_load(array('uid' => $bio->users_uid))));
# Line 2062  function conference_organizing_block_con Line 2054  function conference_organizing_block_con
2054    // if on the conference node and user is allowed to see attendees    // if on the conference node and user is allowed to see attendees
2055    if (is_object($group) && ($node->type != 'session') && ($group->type == 'webform') && conference_organizing_access('see conference attendees', $group->nid)) {    if (is_object($group) && ($node->type != 'session') && ($group->type == 'webform') && conference_organizing_access('see conference attendees', $group->nid)) {
2056      $view = views_get_view('cod_discussions_block');      $view = views_get_view('cod_discussions_block');
2057      $items = views_build_view('items', &$view, $args = array($group->nid), $use_pager = false, $limit = 0, $page = 0);      $items = views_build_view('items', &$view, $args = array($group->nid), $use_pager = false, $limit = 5, $page = 0);
2058      $items = $items['items'];      $items = $items['items'];
2059      $output = '';      $output = '';
2060      foreach ($items as $item) {      foreach ($items as $item) {
# Line 2128  function conference_organizing_block_use Line 2120  function conference_organizing_block_use
2120    global $user;    global $user;
2121    if (arg(0) == 'user' && is_numeric(arg(1))) {    if (arg(0) == 'user' && is_numeric(arg(1))) {
2122      $account = user_load(array('uid' => arg(1)));      $account = user_load(array('uid' => arg(1)));
2123      $node = node_load(bio_for_user($account->uid));      if (is_numeric(bio_for_user($account->uid))) {
2124          $node = node_load(bio_for_user($account->uid));
2125        }
2126      $title = l(t("!name's Profile", array('!name' => $account->name)), 'user/'. $account->uid);      $title = l(t("!name's Profile", array('!name' => $account->name)), 'user/'. $account->uid);
2127      $info = t('Member for: '). format_interval(time() - $account->created);      $info = t('Member for: '). format_interval(time() - $account->created);
2128      $links = array();      $links = array();
# Line 2976  function theme_conference_organizing_dis Line 2970  function theme_conference_organizing_dis
2970  }  }
2971    
2972  /**  /**
  * Displays page of groups  
  */  
 function theme_conference_organizing_groups_directory($my_groups, $all_groups, $subscribe_link, $create_group_link) {  
   $output .= '<h3>My Groups'. $subscribe_link .'</h3>';  
   $output .= $my_groups;  
   $output .= "<h3><div class='create-group-button'>$create_group_link</div>All Groups</h3>";  
   $output .= $all_groups;  
   return $output;  
 }  
   
 /**  
2973   * Creates a form to add a link   * Creates a form to add a link
2974   * TODO: have this use form_api to generate form   * TODO: have this use form_api to generate form
2975   */   */

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.2