You are here

uc_field_attribute.module in Ubercart Field attributes 7

uc_field_attribute.module Ubercart attributes an options based on Drupal core fields

(C)2011 Michael Moritz miiimooo/at/drupal.org http://drupal.org/user/62954

File

uc_field_attribute.module
View source
<?php

/**
 * @file uc_field_attribute.module
 * Ubercart attributes an options based on Drupal core fields
 *
 * (C)2011 Michael Moritz miiimooo/at/drupal.org http://drupal.org/user/62954
 */
function uc_field_attribute_menu() {

  // Menu items for default product class attributes and options.
  $items['admin/store/products/classes/%uc_product_class/field-attribute'] = array(
    'title' => 'Field Attributes',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_field_attribute_form',
      4,
      'class',
    ),
    'access callback' => 'uc_attribute_product_class_access',
    'type' => MENU_LOCAL_TASK,
    'weight' => 1,
    'file' => 'uc_field_attribute.admin.inc',
  );
  return $items;
}

/** Two API placeholder functions to later add additional settings possibly */
function uc_field_attribute_load_settings($bundle_name) {
  $settings = variable_get("uc_field_attribute_{$bundle_name}", array());
  return (object) $settings;
}
function uc_field_attribute_save_settings($bundle_name, $settings) {
  variable_set("uc_field_attribute_{$bundle_name}", (object) $settings);
}
function uc_field_attribute_node_insert($node) {
  if (!array_key_exists($node->type, uc_product_class_load())) {
    return;
  }
  module_load_include('inc', 'uc_field_attribute', 'uc_field_attribute');
  return _uc_field_attribute_nodeapi($node, "insert");
}
function uc_field_attribute_node_update($node) {
  if (!array_key_exists($node->type, uc_product_class_load())) {
    return;
  }
  module_load_include('inc', 'uc_field_attribute', 'uc_field_attribute');
  return _uc_field_attribute_nodeapi($node, "update");
}
function uc_field_attribute_node_delete($node) {
  if (!array_key_exists($node->type, uc_product_class_load())) {
    return;
  }
  module_load_include('inc', 'uc_field_attribute', 'uc_field_attribute');
  return _uc_field_attribute_node_delete($node);
}

Functions

Namesort descending Description
uc_field_attribute_load_settings Two API placeholder functions to later add additional settings possibly
uc_field_attribute_menu @file uc_field_attribute.module Ubercart attributes an options based on Drupal core fields
uc_field_attribute_node_delete
uc_field_attribute_node_insert
uc_field_attribute_node_update
uc_field_attribute_save_settings