Changeset 16721
- Timestamp:
- 06/26/08 11:40:43 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.helper.datamanager2/type/tags.php
r14806 r16721 20 20 class midcom_helper_datamanager2_type_tags extends midcom_helper_datamanager2_type_text 21 21 { 22 /** 23 * Automatically use this context for all tags that lack one 24 */ 25 var $auto_context = null; 26 22 27 /** 23 28 * This event handler is called after construction, so passing references to $this to the … … 46 51 function convert_to_storage() 47 52 { 53 48 54 $tag_array = net_nemein_tag_handler::string2tag_array($this->value); 55 $this->auto_context = trim($this->auto_context); 56 if (!empty($this->auto_context)) 57 { 58 $new_tag_array = array(); 59 foreach ($tag_array as $tagname => $url) 60 { 61 $context = net_nemein_tag_handler::resolve_context($tagname); 62 if (empty($context)) 63 { 64 $tagname = "{$this->auto_context}:{$tagname}"; 65 } 66 $new_tag_array[$tagname] = $url; 67 } 68 unset($tagname, $url); 69 $tag_array = $new_tag_array; 70 unset($new_tag_array); 71 } 49 72 $status = net_nemein_tag_handler::tag_object($this->storage->object, $tag_array); 50 73 if (!$status)
