|
@@ -2,192 +2,59 @@
|
|
|
/**
|
|
|
* Implements hook_ds_layout_settings_info().
|
|
|
*/
|
|
|
- /*function tripal_ds_ds_layout_settings_info() {
|
|
|
- $export = array();
|
|
|
- //$bundle_name = $bundle;
|
|
|
- $region_fields_right;
|
|
|
- $fields_string;
|
|
|
-
|
|
|
- //build the string for the regions and fields section from the $fields array
|
|
|
- $total_fields = count($fields[1][0]);
|
|
|
- $fields_string = implode(",", $fields[1][0]);
|
|
|
-
|
|
|
- for ($i=0; $i < $total_fields; $i++) {
|
|
|
- //watchdog('debug', '<pre>_ds_layout_settings_info $fields_string: '. print_r($fields[1][0][$i], TRUE) .'</pre>');
|
|
|
- $region_fields_right .= $i ." => ". $fields[1][0][$i].", ";
|
|
|
- $fields_string .= $fields[1][0][$i] ." => 'right', ";
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- $ds_layout = new stdClass();
|
|
|
- $ds_layout->api_version = 1;
|
|
|
- $ds_layout->id = 'TripalEntity|bio_data_78|default';
|
|
|
- $ds_layout->entity_type = 'TripalEntity';
|
|
|
- $ds_layout->bundle = 'bio_data_78';
|
|
|
- $ds_layout->view_mode = 'default';
|
|
|
- $ds_layout->layout = 'tripal_ds_feature';
|
|
|
- $ds_layout->settings = array(
|
|
|
- 'regions' => array(
|
|
|
- 'top' => array(),
|
|
|
- 'left' => array(),
|
|
|
- 'right' => array(
|
|
|
- 0 => 'project_contact',
|
|
|
- 1 => 'rdfs__type',
|
|
|
- 2 => 'sbo__database_cross_reference',
|
|
|
- 3 => 'sbo__relationship',
|
|
|
- 4 => 'schema__description',
|
|
|
- 5 => 'schema__name',
|
|
|
- 6 => 'schema__publication',
|
|
|
- ),
|
|
|
- 'bottom' => array(),
|
|
|
- ),
|
|
|
- 'fields' => array(
|
|
|
- 'project_contact' => 'right',
|
|
|
- 'rdfs__type' => 'right',
|
|
|
- 'sbo__database_cross_reference' => 'right',
|
|
|
- 'sbo__relationship' => 'right',
|
|
|
- 'schema__description' => 'right',
|
|
|
- 'schema__name' => 'right',
|
|
|
- 'schema__publication' => 'right',
|
|
|
- ),
|
|
|
- 'classes' => array(),
|
|
|
- 'wrappers' => array(
|
|
|
- 'top' => 'div',
|
|
|
- 'left' => 'div',
|
|
|
- 'right' => 'div',
|
|
|
- 'bottom' => 'div',
|
|
|
- ),
|
|
|
- 'layout_wrapper' => 'div',
|
|
|
- 'layout_attributes' => '',
|
|
|
- 'layout_attributes_merge' => 1,
|
|
|
- 'layout_link_attribute' => '',
|
|
|
- 'layout_link_custom' => '',
|
|
|
- 'layout_disable_css' => 0,
|
|
|
- );
|
|
|
- $export['TripalEntity|bio_data_78|default'] = $ds_layout;
|
|
|
-
|
|
|
- if($export){
|
|
|
- // Insert the layout.
|
|
|
- db_insert('ds_layout_settings')
|
|
|
- ->fields(array(
|
|
|
- 'id' => $ds_layout->id,
|
|
|
- 'entity_type' => 'TripalEntity',
|
|
|
- 'bundle' => $ds_layout->bundle,
|
|
|
- 'view_mode' => 'default',
|
|
|
- 'layout' => 'tripal_ds_feature',
|
|
|
- ))
|
|
|
- ->execute();
|
|
|
- }
|
|
|
- watchdog('debug', '<pre>_ds_layout_settings_info $$ds_layout->settings: '. print_r($ds_layout->settings, TRUE) .'</pre>');
|
|
|
- if($ds_layout->settings ){
|
|
|
- $record = new stdClass;
|
|
|
- $record->id ='TripalEntity|bio_data_73|default';
|
|
|
- $record->entity_type = 'TripalEntity';
|
|
|
- $record->bundle = ;
|
|
|
- $record->view_mode = 'default';
|
|
|
- $record->settings = $ds_layout->settings;
|
|
|
- drupal_write_record('ds_field_settings', $record);
|
|
|
- }
|
|
|
- return $export;
|
|
|
-}*/
|
|
|
-
|
|
|
-/**
|
|
|
- * Implements hook_ds_layout_settings_info().
|
|
|
- */
|
|
|
-function _ds_layout_settings_info($bundle_name, $fields) {
|
|
|
- $export = array();
|
|
|
- //$bundle_name = $bundle;
|
|
|
- $region_fields_right;
|
|
|
- $fields_string;
|
|
|
-
|
|
|
- //build the string for the regions and fields section from the $fields array
|
|
|
- $total_fields = count($fields[1][0]);
|
|
|
- $fields_string = implode(",", $fields[1][0]);
|
|
|
-
|
|
|
- for ($i=0; $i < $total_fields; $i++) {
|
|
|
- //watchdog('debug', '<pre>_ds_layout_settings_info $fields_string: '. print_r($fields[1][0][$i], TRUE) .'</pre>');
|
|
|
- $region_fields_right .= $i ." => ". $fields[1][0][$i].", ";
|
|
|
- $fields_string .= $fields[1][0][$i] ." => 'right', ";
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- $ds_layout = new stdClass();
|
|
|
- $ds_layout->api_version = 1;
|
|
|
- $ds_layout->id = 'TripalEntity|'.$bundle_name.'|default';
|
|
|
- $ds_layout->entity_type = 'TripalEntity';
|
|
|
- $ds_layout->bundle = $bundle_name;
|
|
|
- $ds_layout->view_mode = 'default';
|
|
|
- $ds_layout->layout = 'tripal_ds_feature';
|
|
|
- $ds_layout->settings = array(
|
|
|
- 'regions' => array(
|
|
|
- 'top' => array(),
|
|
|
- 'left' => array(),
|
|
|
- 'right' => array(
|
|
|
- 0 => 'project_contact',
|
|
|
- 1 => 'rdfs__type',
|
|
|
- 2 => 'sbo__database_cross_reference',
|
|
|
- 3 => 'sbo__relationship',
|
|
|
- 4 => 'schema__description',
|
|
|
- 5 => 'schema__name',
|
|
|
- 6 => 'schema__publication',
|
|
|
- ),
|
|
|
- 'bottom' => array(),
|
|
|
- ),
|
|
|
- 'fields' => array(
|
|
|
- 'project_contact' => 'right',
|
|
|
- 'rdfs__type' => 'right',
|
|
|
- 'sbo__database_cross_reference' => 'right',
|
|
|
- 'sbo__relationship' => 'right',
|
|
|
- 'schema__description' => 'right',
|
|
|
- 'schema__name' => 'right',
|
|
|
- 'schema__publication' => 'right',
|
|
|
- ),
|
|
|
- 'classes' => array(),
|
|
|
- 'wrappers' => array(
|
|
|
- 'top' => 'div',
|
|
|
- 'left' => 'div',
|
|
|
- 'right' => 'div',
|
|
|
- 'bottom' => 'div',
|
|
|
+function _ds_layout_settings_info($bundle_name, $instances) {
|
|
|
+ $export = array();
|
|
|
+ $record = new stdClass;
|
|
|
+ $record->id ='TripalEntity|' . $bundle_name . '|default';
|
|
|
+ $record->entity_type = 'TripalEntity';
|
|
|
+ $record->bundle = $bundle_name;
|
|
|
+ $record->view_mode = 'default';
|
|
|
+ $record->layout = 'tripal_ds_feature';
|
|
|
+ $settings = array(
|
|
|
+ 'regions' => array(
|
|
|
+ 'top' => array(),
|
|
|
+ 'left' => array(),
|
|
|
+ 'right' => array(
|
|
|
+ 0 => 'project_contact',
|
|
|
+ 1 => 'rdfs__type',
|
|
|
+ 2 => 'sbo__database_cross_reference',
|
|
|
+ 3 => 'sbo__relationship',
|
|
|
+ 4 => 'schema__description',
|
|
|
+ 5 => 'schema__name',
|
|
|
+ 6 => 'schema__publication',
|
|
|
),
|
|
|
- 'layout_wrapper' => 'div',
|
|
|
- 'layout_attributes' => '',
|
|
|
- 'layout_attributes_merge' => 1,
|
|
|
- 'layout_link_attribute' => '',
|
|
|
- 'layout_link_custom' => '',
|
|
|
- 'layout_disable_css' => 0,
|
|
|
+ 'bottom' => array(),
|
|
|
+ ),
|
|
|
+ 'fields' => array(
|
|
|
+ 'project_contact' => 'right',
|
|
|
+ 'rdfs__type' => 'right',
|
|
|
+ 'sbo__database_cross_reference' => 'right',
|
|
|
+ 'sbo__relationship' => 'right',
|
|
|
+ 'schema__description' => 'right',
|
|
|
+ 'schema__name' => 'right',
|
|
|
+ 'schema__publication' => 'right',
|
|
|
+ ),
|
|
|
+ 'classes' => array(),
|
|
|
+ 'wrappers' => array(
|
|
|
+ 'top' => 'div',
|
|
|
+ 'left' => 'div',
|
|
|
+ 'right' => 'div',
|
|
|
+ 'bottom' => 'div',
|
|
|
+ ),
|
|
|
+ 'layout_wrapper' => 'div',
|
|
|
+ 'layout_attributes' => '',
|
|
|
+ 'layout_attributes_merge' => 1,
|
|
|
+ 'layout_link_attribute' => '',
|
|
|
+ 'layout_link_custom' => '',
|
|
|
+ 'layout_disable_css' => 0,
|
|
|
);
|
|
|
- $export['TripalEntity|'.$bundle_name.'|default'] = $ds_layout;
|
|
|
-
|
|
|
- module_load_include('inc', 'ds', 'ds.registry');
|
|
|
- _ds_entity_type_update('TripalEntity', $export, 'update');
|
|
|
-
|
|
|
- /*if($export){
|
|
|
- // Insert the layout.
|
|
|
- db_insert('ds_layout_settings')
|
|
|
- ->fields(array(
|
|
|
- 'id' => $ds_layout->id,
|
|
|
- 'entity_type' => 'TripalEntity',
|
|
|
- 'bundle' => $ds_layout->bundle,
|
|
|
- 'view_mode' => 'default',
|
|
|
- 'layout' => 'tripal_ds_feature',
|
|
|
- ))
|
|
|
- ->execute();
|
|
|
- }
|
|
|
- watchdog('debug', '<pre>_ds_layout_settings_info $$ds_layout->settings: '. print_r($ds_layout->settings, TRUE) .'</pre>');
|
|
|
- if($ds_layout->settings ){
|
|
|
- $record = new stdClass;
|
|
|
- $record->id ='TripalEntity|bio_data_73|default';
|
|
|
- $record->entity_type = 'TripalEntity';
|
|
|
- $record->bundle = ;
|
|
|
- $record->view_mode = 'default';
|
|
|
- $record->settings = $ds_layout->settings;
|
|
|
- drupal_write_record('ds_field_settings', $record);
|
|
|
- }*/
|
|
|
- return $export;
|
|
|
+ $record->settings = $settings;
|
|
|
+ drupal_write_record('ds_layout_settings', $record);
|
|
|
}
|
|
|
|
|
|
|
|
|
function tripal_ds_content_type_fields($bundle_name){
|
|
|
+ dpm(debug_backtrace());
|
|
|
$base_fields = array();
|
|
|
$all_fields = array();
|
|
|
$custom_fields = array();
|
|
@@ -228,9 +95,6 @@ function tripal_ds_content_type_fields($bundle_name){
|
|
|
array($custom_fields),
|
|
|
);
|
|
|
|
|
|
- //tripal_ds_ds_layout_settings_info($bundle_name, $all_fields);
|
|
|
- watchdog('debug', '<pre>tripal_ds_content_type_fields $all_fields: '. print_r($all_fields, TRUE) .'</pre>');
|
|
|
-
|
|
|
return $all_fields;
|
|
|
|
|
|
}
|