opigno_og_prereq.install in Opigno 7
Module install logic.
File
modules/og_prereq/opigno_og_prereq.installView source
<?php
/**
* @file
* Module install logic.
*/
/**
* Implements hook_install().
*/
function opigno_og_prereq_install() {
$field = field_info_field('course_required_course_ref');
if (empty($field)) {
field_create_field(array(
'active' => 1,
'cardinality' => FIELD_CARDINALITY_UNLIMITED,
'deleted' => 0,
'entity_types' => array(),
'field_name' => 'course_required_course_ref',
'foreign keys' => array(
'node' => array(
'columns' => array(
'target_id' => 'nid',
),
'table' => 'node',
),
),
'indexes' => array(
'target_id' => array(
0 => 'target_id',
),
),
'locked' => 0,
'module' => 'entityreference',
'settings' => array(
'handler' => 'base',
'handler_settings' => array(
'behaviors' => array(
'views-select-list' => array(
'status' => 0,
),
),
'sort' => array(
'type' => 'none',
),
'target_bundles' => array(
'course' => 'course',
),
),
'target_type' => 'node',
),
'translatable' => 1,
'type' => 'entityreference',
));
}
$instance = field_info_instance('node', 'course_required_course_ref', OPIGNO_COURSE_BUNDLE);
if (empty($instance)) {
field_create_instance(array(
'field_name' => 'course_required_course_ref',
'entity_type' => 'node',
'bundle' => OPIGNO_COURSE_BUNDLE,
'label' => "Required course",
'description' => "Makes this course dependent on another one.",
'required' => FALSE,
));
}
}
/**
* Put in this function all the strings that are not in a t() or st() function.
*/
function opigno_og_prereq_install_translations() {
//
// --- FIELDS
// opigno_og_prereq.install
t('Required course');
t('Makes this course dependent on another one.');
}
Functions
Name | Description |
---|---|
opigno_og_prereq_install | Implements hook_install(). |
opigno_og_prereq_install_translations | Put in this function all the strings that are not in a t() or st() function. |