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

Diff of /contributions/modules/nodefamily/nodefamily.module

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

revision 1.19.2.16, Mon Jun 9 07:13:18 2008 UTC revision 1.19.2.17, Wed Jun 11 09:24:34 2008 UTC
# Line 1  Line 1 
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
# Line 191  function nodefamily_nodeapi(&$node, $op, Line 191  function nodefamily_nodeapi(&$node, $op,
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);
# Line 254  function nodefamily_form_alter($form_id, Line 253  function nodefamily_form_alter($form_id,
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) {

Legend:
Removed from v.1.19.2.16  
changed lines
  Added in v.1.19.2.17

  ViewVC Help
Powered by ViewVC 1.1.2