| 1 |
<?php |
<?php |
| 2 |
// $Id: nodefamily.module,v 1.19.2.15 2008/06/08 14:49:48 fago Exp $ |
// $Id: nodefamily.module,v 1.19.2.16 2008/06/09 07:13:18 fago Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 191 |
$node->uid = 0; |
$node->uid = 0; |
| 192 |
} |
} |
| 193 |
} |
} |
|
|
|
| 194 |
if (!$node->nid && nodefamily_content_type_is_max($node->type, $node->uid)) { |
if (!$node->nid && nodefamily_content_type_is_max($node->type, $node->uid)) { |
| 195 |
form_set_error('name', t("You can't create more nodes of this type for this user.")); |
form_set_error('name', t("You can't create more nodes of this type for this user.")); |
|
$form = NULL; |
|
| 196 |
} |
} |
| 197 |
break; |
break; |
| 198 |
|
|
| 199 |
case 'submit': |
case 'submit': |
| 200 |
if ($node->nid && user_access('administer nodes')) { |
if ($node->nid && user_access('administer nodes')) { |
| 201 |
$parents = nodefamily_get_parent_types($node->type); |
$parents = nodefamily_get_parent_types($node->type); |
| 253 |
'#default_value' => nodefamily_content_type_get_max($form['#node_type']->type), |
'#default_value' => nodefamily_content_type_get_max($form['#node_type']->type), |
| 254 |
); |
); |
| 255 |
} |
} |
|
else if (($form['#node_type']) && $form['#node_type']->type .'_node_form' == $form_id) { |
|
|
$node = $form['#node']; |
|
|
if (!$node->nid && !user_access('administer nodes') && nodefamily_content_type_is_max($node->type, $node->uid)) { |
|
|
drupal_set_message(t("You can't create any more nodes of this type."), 'error'); |
|
|
$form = NULL; |
|
|
} |
|
|
} |
|
| 256 |
} |
} |
| 257 |
|
|
| 258 |
function nodefamily_node_settings_validate(&$formelement) { |
function nodefamily_node_settings_validate(&$formelement) { |