You are here

function uc_product_node_info in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_product/uc_product.module \uc_product_node_info()
  2. 7.3 uc_product/uc_product.module \uc_product_node_info()

Implements hook_node_info().

Creates node types for each product class and other product modules.

7 calls to uc_product_node_info()
UbercartTestHelper::createProductClass in uc_store/uc_store.test
uc_product_classes_features_export_options in uc_product/uc_product.features.inc
Implements hook_features_export_options().
uc_product_classes_features_revert in uc_product/uc_product.features.inc
Implements hook_features_revert().
uc_product_class_delete_confirm_submit in uc_product/uc_product.admin.inc
Form submission handler for uc_product_class_delete_confirm().
uc_product_class_form_submit in uc_product/uc_product.admin.inc
Form submission handler for uc_product_class_form().

... See full list

1 string reference to 'uc_product_node_info'
uc_store_footer in uc_store/uc_store.module
Implements hook_footer().

File

uc_product/uc_product.module, line 335
The product module for Ubercart.

Code

function uc_product_node_info($reset = FALSE) {
  static $types = array();
  $title_label = t('Name');
  $body_label = t('Description');
  if (empty($types) || $reset) {
    $types = array();
    $defaults = module_invoke_all('uc_product_default_classes');
    $types['product'] = isset($defaults['product']) ? $defaults['product'] : array();
    $types['product'] += array(
      'name' => t('Product'),
      'module' => 'uc_product',
      'description' => t('This node displays the representation of a product for sale on the website. It includes all the unique information that can be attributed to a specific model number.'),
      'title_label' => $title_label,
      'body_label' => $body_label,
    );
    $classes = uc_product_class_load(NULL, $reset);
    foreach ($classes as $class) {
      $class = (array) $class;
      $class['module'] = 'uc_product';
      $types[$class['pcid']] = $class + array(
        'title_label' => $title_label,
        'body_label' => $body_label,
      );
    }
  }
  return $types;
}