created showroom feature

This commit is contained in:
Bachir Soussi Chiadmi 2016-10-25 16:05:07 +02:00
parent 598f3e8292
commit 54399b169a
8 changed files with 263 additions and 0 deletions

View File

@ -0,0 +1,35 @@
<?php
/**
* @file
* showroom.features.field_base.inc
*/
/**
* Implements hook_field_default_field_bases().
*/
function showroom_field_default_field_bases() {
$field_bases = array();
// Exported field_base: 'description_field'.
$field_bases['description_field'] = array(
'active' => 1,
'cardinality' => 1,
'deleted' => 0,
'entity_types' => array(),
'field_name' => 'description_field',
'indexes' => array(
'format' => array(
0 => 'format',
),
),
'locked' => 0,
'module' => 'text',
'settings' => array(
'entity_translation_sync' => FALSE,
),
'translatable' => 1,
'type' => 'text_with_summary',
);
return $field_bases;
}

View File

@ -0,0 +1,95 @@
<?php
/**
* @file
* showroom.features.field_instance.inc
*/
/**
* Implements hook_field_default_field_instances().
*/
function showroom_field_default_field_instances() {
$field_instances = array();
// Exported field_instance: 'taxonomy_term-showroom-description_field'.
$field_instances['taxonomy_term-showroom-description_field'] = array(
'bundle' => 'showroom',
'default_value' => NULL,
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 1,
),
),
'entity_type' => 'taxonomy_term',
'field_name' => 'description_field',
'label' => 'Description',
'required' => FALSE,
'settings' => array(
'display_summary' => 0,
'entity_translation_sync' => FALSE,
'hide_label' => array(
'entity' => 'entity',
'page' => 'page',
),
'text_processing' => 1,
'user_register_form' => FALSE,
),
'widget' => array(
'module' => 'text',
'settings' => array(
'rows' => 20,
'summary_rows' => 5,
),
'type' => 'text_textarea_with_summary',
'weight' => -5,
),
);
// Exported field_instance: 'taxonomy_term-showroom-name_field'.
$field_instances['taxonomy_term-showroom-name_field'] = array(
'bundle' => 'showroom',
'default_value' => NULL,
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'taxonomy_term',
'field_name' => 'name_field',
'label' => 'Nom',
'required' => TRUE,
'settings' => array(
'entity_translation_sync' => FALSE,
'hide_label' => array(
'entity' => 'entity',
'page' => 'page',
),
'text_processing' => 0,
'user_register_form' => FALSE,
),
'widget' => array(
'module' => 'text',
'settings' => array(
'size' => 60,
),
'type' => 'text_textfield',
'weight' => -5,
),
);
// Translatables
// Included for use with string extractors like potx.
t('Description');
t('Nom');
return $field_instances;
}

View File

@ -0,0 +1,14 @@
<?php
/**
* @file
* showroom.features.inc
*/
/**
* Implements hook_ctools_plugin_api().
*/
function showroom_ctools_plugin_api($module = NULL, $api = NULL) {
if ($module == "strongarm" && $api == "strongarm") {
return array("version" => "1");
}
}

View File

@ -0,0 +1,21 @@
<?php
/**
* @file
* showroom.features.taxonomy.inc
*/
/**
* Implements hook_taxonomy_default_vocabularies().
*/
function showroom_taxonomy_default_vocabularies() {
return array(
'showroom' => array(
'name' => 'Showroom',
'machine_name' => 'showroom',
'description' => '',
'hierarchy' => 0,
'module' => 'taxonomy',
'weight' => 0,
),
);
}

View File

@ -0,0 +1,35 @@
<?php
/**
* @file
* showroom.features.user_permission.inc
*/
/**
* Implements hook_user_default_permissions().
*/
function showroom_user_default_permissions() {
$permissions = array();
// Exported permission: 'delete terms in showroom'.
$permissions['delete terms in showroom'] = array(
'name' => 'delete terms in showroom',
'roles' => array(),
'module' => 'taxonomy',
);
// Exported permission: 'edit terms in showroom'.
$permissions['edit terms in showroom'] = array(
'name' => 'edit terms in showroom',
'roles' => array(),
'module' => 'taxonomy',
);
// Exported permission: 'merge showroom terms'.
$permissions['merge showroom terms'] = array(
'name' => 'merge showroom terms',
'roles' => array(),
'module' => 'term_merge',
);
return $permissions;
}

View File

@ -0,0 +1,32 @@
<?php
/**
* @file
* showroom.features.user_role.inc
*/
/**
* Implements hook_user_default_roles().
*/
function showroom_user_default_roles() {
$roles = array();
// Exported role: Translator CN.
$roles['Translator CN'] = array(
'name' => 'Translator CN',
'weight' => 12,
);
// Exported role: Translator EN.
$roles['Translator EN'] = array(
'name' => 'Translator EN',
'weight' => 10,
);
// Exported role: Translator FR.
$roles['Translator FR'] = array(
'name' => 'Translator FR',
'weight' => 11,
);
return $roles;
}

View File

@ -0,0 +1,24 @@
name = Showroom
core = 7.x
package = Materio
dependencies[] = ctools
dependencies[] = features
dependencies[] = materio_content_types
dependencies[] = metatag
dependencies[] = strongarm
dependencies[] = taxonomy
dependencies[] = term_merge
dependencies[] = text
features[ctools][] = strongarm:strongarm:1
features[features_api][] = api:2
features[field_base][] = description_field
features[field_instance][] = taxonomy_term-showroom-description_field
features[field_instance][] = taxonomy_term-showroom-name_field
features[taxonomy][] = showroom
features[user_permission][] = delete terms in showroom
features[user_permission][] = edit terms in showroom
features[user_permission][] = merge showroom terms
features[user_role][] = Translator CN
features[user_role][] = Translator EN
features[user_role][] = Translator FR
project path = sites/all/modules/features

View File

@ -0,0 +1,7 @@
<?php
/**
* @file
* Code for the Showroom feature.
*/
include_once 'showroom.features.inc';