| 1 |
<?php // $Id: conference_organizing.module,v 1.3 2007/07/28 00:37:08 zacker Exp $ |
<?php // $Id: conference_organizing.module,v 1.4 2007/08/02 22:52:16 zacker Exp $ |
| 2 |
|
|
| 3 |
/** |
/** |
| 4 |
* @file |
* @file |
| 469 |
* Refactor's note node creation form |
* Refactor's note node creation form |
| 470 |
*/ |
*/ |
| 471 |
function conference_organizing_form_alter_note_node(&$form) { |
function conference_organizing_form_alter_note_node(&$form) { |
| 472 |
if (!(user_access("administer nodes"))) { |
if (!(user_access('administer nodes'))) { |
| 473 |
unset($form['delete']); |
unset($form['delete']); |
| 474 |
|
$form['body_filter']['format']['#attributes'] = array('style' => 'display: none;'); |
| 475 |
} |
} |
|
$form['body_filter']['format']['#attributes'] = array('style' => 'display: none;'); |
|
| 476 |
// make sure when adding a new node that we've got the parent all lined up |
// make sure when adding a new node that we've got the parent all lined up |
| 477 |
if (arg(1) == 'add') { |
if (arg(1) == 'add') { |
| 478 |
if (is_numeric(arg(3))) { |
if (is_numeric(arg(3))) { |
| 486 |
$form['title']['#disabled'] = TRUE; |
$form['title']['#disabled'] = TRUE; |
| 487 |
} |
} |
| 488 |
// if he node is a session and there aren't notes for the session yet... |
// if he node is a session and there aren't notes for the session yet... |
| 489 |
else if (($node->type == 'session') && node_access('update', $node) && ($node->field_notes_node[0]['nid'] == 0 || !is_object(node_load($node->field_notes_node[0]['nid'])))) { |
else if (($node->type == 'session') && node_access('update', $node) && ($node->field_notes_node[0]['nid'] == 0 || !($node->field_notes_node[0]['nid'] > 0))) { |
| 490 |
drupal_set_title('Create Notes Page For "'. $node->title .'"'); |
drupal_set_title('Create Notes Page For "'. $node->title .'"'); |
| 491 |
$form['parent_session_nid'] = array( |
$form['parent_session_nid'] = array( |
| 492 |
'#type' => 'value', |
'#type' => 'value', |
| 522 |
} |
} |
| 523 |
} |
} |
| 524 |
// Ekse hide node relation field if not adding a discussion about conference |
// Ekse hide node relation field if not adding a discussion about conference |
| 525 |
elseif (!user_access('administer nodes')) { |
elseif ($form['field_related_session']['nids']['#default_value'][0] == '') { |
| 526 |
unset($form['field_related_session']); |
unset($form['field_related_session']); |
| 527 |
} |
} |
| 528 |
} |
} |
| 1285 |
case 'can chat': |
case 'can chat': |
| 1286 |
if ($gid) { |
if ($gid) { |
| 1287 |
$group = node_load($gid); |
$group = node_load($gid); |
| 1288 |
if (conference_organizing_access('group member', $gid) && $group->field_can_chat[0]['value'] == 0) { |
if (conference_organizing_access('group member', $gid) && $group->field_can_chat[0]['value'] == 1) { |
| 1289 |
return TRUE; |
return TRUE; |
| 1290 |
} |
} |
| 1291 |
} |
} |
| 1447 |
// if the node in the param is actually a session use session's group node instead |
// if the node in the param is actually a session use session's group node instead |
| 1448 |
if ($node->type == 'session') { |
if ($node->type == 'session') { |
| 1449 |
if (is_numeric($node->og_groups[0])) { |
if (is_numeric($node->og_groups[0])) { |
| 1450 |
$node = node_load($session->og_groups[0]); |
$node = node_load($node->og_groups[0]); |
| 1451 |
} |
} |
| 1452 |
} |
} |
| 1453 |
} |
} |
| 1454 |
elseif (arg(0) == 'node' && arg(1) == 'add' && is_numeric(arg(3))) { |
elseif (arg(0) == 'node' && arg(1) == 'add' && is_numeric(arg(3))) { |
| 1455 |
$node = node_load(arg(3)); |
$node = node_load(arg(3)); |
| 1456 |
} |
} |
| 1457 |
else { |
elseif (arg(0) != 'user') { |
| 1458 |
$node = og_get_group_context(); |
$node = og_get_group_context(); |
| 1459 |
} |
} |
| 1460 |
if ($node->type == 'webform') { |
if ($node->type == 'webform') { |
| 1723 |
case 10: |
case 10: |
| 1724 |
return conference_organizing_block_user_secondary_nav(); |
return conference_organizing_block_user_secondary_nav(); |
| 1725 |
} |
} |
| 1726 |
|
|
| 1727 |
} |
} |
| 1728 |
} |
} |
| 1729 |
|
|
| 1798 |
'title' => t('Discussions'), |
'title' => t('Discussions'), |
| 1799 |
'href' => 'discussions/'. $group->nid, |
'href' => 'discussions/'. $group->nid, |
| 1800 |
); |
); |
| 1801 |
if ($group->field_can_chat[0]['value'] == 0 && conference_organizing_access('can chat', $group->nid)) { |
if ($group->field_can_chat[0]['value'] == 1 && conference_organizing_access('can chat', $group->nid)) { |
| 1802 |
$links[] = array( |
$links[] = array( |
| 1803 |
'title' => t('Chat'), |
'title' => t('Chat'), |
| 1804 |
'href' => 'chat/'. $group->nid, |
'href' => 'chat/'. $group->nid, |
| 3240 |
$output .= '<td class="timelabel">'. format_date($event->$startfieldtime, 'custom', 'g:i a') .' - '. format_date($event->$endfieldtime, 'custom', 'g:i a') .'</td>'; // Event Time |
$output .= '<td class="timelabel">'. format_date($event->$startfieldtime, 'custom', 'g:i a') .' - '. format_date($event->$endfieldtime, 'custom', 'g:i a') .'</td>'; // Event Time |
| 3241 |
$output .= '<td class="timelabel_spacer"></td>'; |
$output .= '<td class="timelabel_spacer"></td>'; |
| 3242 |
$output .= '<td colspan="'. count($colnames) .'" class="eventlabel">'; |
$output .= '<td colspan="'. count($colnames) .'" class="eventlabel">'; |
| 3243 |
$output .= conference_organizing_attendee_link($event->nid); |
if (arg(0) != 'user') { |
| 3244 |
|
// don't show on user's own schedule page |
| 3245 |
|
$output .= conference_organizing_attendee_link($event->nid); |
| 3246 |
|
} |
| 3247 |
$output .= conference_organizing_display_event($cellfields, $event, $view, _views_get_fields()); |
$output .= conference_organizing_display_event($cellfields, $event, $view, _views_get_fields()); |
| 3248 |
$output .= '</td>'; |
$output .= '</td>'; |
| 3249 |
$count++; |
$count++; |