comparison mee.module @ 24:32d8c9f818a8

Fields: Add an hidden variable to choose if a composite should be registered Initially, each MEE association was made to be reusable, which means that a composite atom was registered, was searchable in the library, droppable in another MEE. It turns out that this features wasn't really used in production, and adds a lot of noise in the UI... So we're now checking a variable before registering a composite, and it defaults to off.
author Franck Deroche <defr@ows.fr>
date Mon, 19 Apr 2010 10:51:33 +0000
parents 7bb9f2f3b104
children 4df8f73dc0fe
comparison
equal deleted inserted replaced
23:7bb9f2f3b104 24:32d8c9f818a8
135 // Process the value and generate an atom 135 // Process the value and generate an atom
136 $sas = scald_rendered_to_sas($item['value']); 136 $sas = scald_rendered_to_sas($item['value']);
137 $scald_included = scald_included($sas); 137 $scald_included = scald_included($sas);
138 $sids = array_unique($scald_included); 138 $sids = array_unique($scald_included);
139 139
140 $temp_atom = new stdClass; 140 if (variable_get('mee_register_composites', FALSE)) {
141 $temp_atom->type = 'composite'; 141 $temp_atom = new stdClass;
142 $temp_atom->provider = 'mee'; 142 $temp_atom->type = 'composite';
143 $temp_atom->base_id = $node->nid . ':' . $delta; 143 $temp_atom->provider = 'mee';
144 $temp_atom->publisher = $node->uid; 144 $temp_atom->base_id = $node->nid . ':' . $delta;
145 $temp_atom->title = $node->title . ' - ' . $field['widget']['label'] . ' (#' . $delta . ')'; 145 $temp_atom->publisher = $node->uid;
146 $temp_atom->authors = array(scald_uid_to_aid($node->uid)); 146 $temp_atom->title = $node->title . ' - ' . $field['widget']['label'] . ' (#' . $delta . ')';
147 $temp_atom->relationships = empty($scald_included) ? array() : array('includes' => $scald_included); 147 $temp_atom->authors = array(scald_uid_to_aid($node->uid));
148 148 $temp_atom->relationships = empty($scald_included) ? array() : array('includes' => $scald_included);
149 $sid = scald_register_atom($temp_atom); 149
150 scald_register_atom($temp_atom);
151 }
150 152
151 // Ressource manager associations 153 // Ressource manager associations
152 if (empty($item['ressource_manager'])) { 154 if (empty($item['ressource_manager'])) {
153 _mee_load_ressources($node, $field, $item); 155 _mee_load_ressources($node, $field, $item);
154 } 156 }