| 1 |
<?php |
<?php |
| 2 |
// $Id: createcontentblock.module,v 1.1.2.7 2008/02/21 20:29:09 douggreen Exp $ |
// $Id: createcontentblock.module,v 1.1.2.6 2007/12/19 00:14:56 douggreen Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 95 |
} |
} |
| 96 |
if (isset($name)) { |
if (isset($name)) { |
| 97 |
$init['options'][$type->type] = $name; |
$init['options'][$type->type] = $name; |
|
asort($init['options']); |
|
| 98 |
} |
} |
| 99 |
} |
} |
| 100 |
} |
} |
| 120 |
} |
} |
| 121 |
if (isset($init['subscribe_nid'])) { |
if (isset($init['subscribe_nid'])) { |
| 122 |
$form['subscribe'] = array( |
$form['subscribe'] = array( |
| 123 |
'#value' => l(t('Subscribe to Add Content to this Group'), 'og/subscribe/'. $init['subscribe_nid'], array(), 'destination=node/'. $init['subscribe']), |
'#value' => l(t('Subscribe to Add Content to this Group'), 'og/subscribe/'. $init['subscribe_nid'], array(), 'destination=node/'. $init['subscribe_nid']), |
| 124 |
); |
); |
| 125 |
} |
} |
| 126 |
$options = array(t('-- Select One --')); |
$options = array(t('-- Select One --')); |
| 145 |
$fragment[] = 'destination='. $form['dest']; |
$fragment[] = 'destination='. $form['dest']; |
| 146 |
} |
} |
| 147 |
if (!empty($form['type'])) { |
if (!empty($form['type'])) { |
| 148 |
|
$type = str_replace('_', '-', $form['type']); |
| 149 |
if (empty($form['gid'])) { |
if (empty($form['gid'])) { |
| 150 |
drupal_goto('node/add/'. $form['type'], implode('&', $fragment)); |
drupal_goto('node/add/'. $type, implode('&', $fragment)); |
| 151 |
} |
} |
| 152 |
else { |
else { |
| 153 |
$fragment[] = 'gids[]='. $form['gid']; |
$fragment[] = 'gids[]='. $form['gid']; |
| 154 |
drupal_goto('node/add/'. $form['type'], implode('&', $fragment)); |
drupal_goto('node/add/'. $type, implode('&', $fragment)); |
| 155 |
} |
} |
| 156 |
} |
} |
| 157 |
elseif (isset($form['gid'])) { |
elseif (isset($form['gid'])) { |
| 158 |
$fragment[] = 'gids[]='. $form['gid']; |
$fragment[] = 'gids[]='. $form['gid']; |
| 159 |
drupal_goto('node/add-og', implode('&', $fragment)); |
drupal_goto('node/add-og', implode('&', $fragment)); |
| 160 |
} |
} |
| 161 |
else { |
else { |
| 162 |
drupal_goto('node/add', implode('&', $fragment)); |
drupal_goto('node/add', implode('&', $fragment)); |
| 163 |
} |
} |