changeset 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
files mee.module
diffstat 1 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mee.module	Tue Apr 06 16:01:10 2010 +0000
+++ b/mee.module	Mon Apr 19 10:51:33 2010 +0000
@@ -137,16 +137,18 @@
         $scald_included = scald_included($sas);
         $sids = array_unique($scald_included);
 
-        $temp_atom                = new stdClass;
-        $temp_atom->type          = 'composite';
-        $temp_atom->provider      = 'mee';
-        $temp_atom->base_id       = $node->nid . ':' . $delta;
-        $temp_atom->publisher     = $node->uid;
-        $temp_atom->title         = $node->title . ' - ' . $field['widget']['label'] . ' (#' . $delta . ')';
-        $temp_atom->authors       = array(scald_uid_to_aid($node->uid));
-        $temp_atom->relationships = empty($scald_included) ? array() : array('includes' => $scald_included);
-        
-        $sid = scald_register_atom($temp_atom);
+        if (variable_get('mee_register_composites', FALSE)) {
+          $temp_atom                = new stdClass;
+          $temp_atom->type          = 'composite';
+          $temp_atom->provider      = 'mee';
+          $temp_atom->base_id       = $node->nid . ':' . $delta;
+          $temp_atom->publisher     = $node->uid;
+          $temp_atom->title         = $node->title . ' - ' . $field['widget']['label'] . ' (#' . $delta . ')';
+          $temp_atom->authors       = array(scald_uid_to_aid($node->uid));
+          $temp_atom->relationships = empty($scald_included) ? array() : array('includes' => $scald_included);
+          
+          scald_register_atom($temp_atom);
+        }
         
         // Ressource manager associations
         if (empty($item['ressource_manager'])) {