Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
geobrowser_drupal_module/mpiwg_geobrowser.install
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
179 lines (174 sloc)
5.21 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mpiwg_geobrowser_install() { | |
$form_state['values']['macro'] = "\$data = array( | |
'bundles' => array( | |
'mpiwg_geobrowser' => (object) array( | |
'type' => 'mpiwg_geobrowser', | |
'name' => 'mpiwg_geobrowser', | |
'base' => 'node_content', | |
'module' => 'node', | |
'description' => '', | |
'help' => '', | |
'has_title' => '1', | |
'title_label' => 'Title', | |
'custom' => '1', | |
'modified' => '1', | |
'locked' => '0', | |
'disabled' => '0', | |
'orig_type' => 'mpiwg_geobrowser', | |
'disabled_changed' => FALSE, | |
'bc_entity_type' => 'node', | |
), | |
), | |
'fields' => array( | |
'body' => array( | |
'entity_types' => array( | |
0 => 'node', | |
), | |
'translatable' => '0', | |
'settings' => array(), | |
'storage' => array( | |
'type' => 'field_sql_storage', | |
'settings' => array(), | |
'module' => 'field_sql_storage', | |
'active' => '1', | |
'details' => array( | |
'sql' => array( | |
'FIELD_LOAD_CURRENT' => array( | |
'field_data_body' => array( | |
'value' => 'body_value', | |
'summary' => 'body_summary', | |
'format' => 'body_format', | |
), | |
), | |
'FIELD_LOAD_REVISION' => array( | |
'field_revision_body' => array( | |
'value' => 'body_value', | |
'summary' => 'body_summary', | |
'format' => 'body_format', | |
), | |
), | |
), | |
), | |
), | |
'foreign keys' => array( | |
'format' => array( | |
'table' => 'filter_format', | |
'columns' => array( | |
'format' => 'format', | |
), | |
), | |
), | |
'indexes' => array( | |
'format' => array( | |
0 => 'format', | |
), | |
), | |
'field_name' => 'body', | |
'type' => 'text_with_summary', | |
'module' => 'text', | |
'active' => '1', | |
'locked' => '0', | |
'cardinality' => '1', | |
'deleted' => '0', | |
'columns' => array( | |
'value' => array( | |
'type' => 'text', | |
'size' => 'big', | |
'not null' => FALSE, | |
), | |
'summary' => array( | |
'type' => 'text', | |
'size' => 'big', | |
'not null' => FALSE, | |
), | |
'format' => array( | |
'type' => 'varchar', | |
'length' => 255, | |
'not null' => FALSE, | |
), | |
), | |
'bundles' => array( | |
'node' => array( | |
0 => 'page', | |
1 => 'article', | |
2 => 'biblio', | |
3 => 'mpiwg_geobrowser', | |
), | |
), | |
), | |
), | |
'instances' => array( | |
'body' => array( | |
0 => array( | |
'label' => 'Body', | |
'widget' => array( | |
'type' => 'text_textarea_with_summary', | |
'settings' => array( | |
'rows' => 20, | |
'summary_rows' => 5, | |
), | |
'weight' => -4, | |
'module' => 'text', | |
), | |
'settings' => array( | |
'display_summary' => TRUE, | |
'text_processing' => 1, | |
'user_register_form' => FALSE, | |
), | |
'display' => array( | |
'default' => array( | |
'label' => 'hidden', | |
'type' => 'text_default', | |
'settings' => array(), | |
'module' => 'text', | |
'weight' => 0, | |
), | |
'teaser' => array( | |
'label' => 'hidden', | |
'type' => 'text_summary_or_trimmed', | |
'settings' => array( | |
'trim_length' => 600, | |
), | |
'module' => 'text', | |
'weight' => 0, | |
), | |
), | |
'required' => FALSE, | |
'description' => '', | |
'field_name' => 'body', | |
'entity_type' => 'node', | |
'bundle' => 'mpiwg_geobrowser', | |
'deleted' => '0', | |
'default_value' => NULL, | |
), | |
), | |
), | |
);"; | |
bundle_copy_import_submit(array(), $form_state); | |
mpiwg_geobrowser_setup_panelizer_defaults(); | |
} | |
function mpiwg_geobrowser_setup_panelizer_defaults() { | |
$transaction = db_transaction(); | |
db_insert('panelizer_defaults') | |
->fields(array( | |
'name' => 'node:mpiwg_geobrowser:default', | |
'title' => 'Default', | |
'panelizer_type' => 'node', | |
'panelizer_key' => 'mpiwg_geobrowser', | |
'no_blocks' => 0, | |
'css_id' => '', | |
'css' => '', | |
'pipeline' => 'ipe', | |
'contexts' => 'a:0:{}', | |
'relationships' => 'a:0:{}', | |
'did' => 3, | |
'access' => 'a:0:{}', | |
'view_mode' => 'page_manager', | |
'css_class' => '', | |
'title_element' => 'H2', | |
'link_to_entity' => 0, | |
'extra' => 'a:0:{}', | |
)) | |
->execute(); | |
} |