Changeset 14462
- Timestamp:
- 01/17/08 13:20:14 (11 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.helper.reflector/reflector.php
r14461 r14462 343 343 function get_create_icon($type) 344 344 { 345 // FIXME make 1. smarter 2. configurable 345 346 switch ($type) 346 347 { … … 401 402 $icon = $obj->get_icon(); 402 403 break; 404 // FIXME make 1. smarter 2. configurable 403 405 case (is_a($obj, 'midgard_person')): 404 406 case (is_a($obj, 'org_openpsa_person')): trunk/midcom/midcom.helper.reflector/reflector_tree.php
r14461 r14462 20 20 class midcom_helper_reflector_tree extends midcom_helper_reflector 21 21 { 22 var $show_sg0_objects = true; 23 var $sg_context = false; 22 24 23 25 function midcom_helper_reflector_tree($src) 24 26 { 27 $this->sg_context = $_MIDGARD['sitegroup']; 25 28 parent::midcom_helper_reflector($src); 26 29 } … … 115 118 } 116 119 117 if ($_MIDGARD['sitegroup']) 118 { 119 $qb->add_constraint('sitegroup', '=', $_MIDGARD['sitegroup']); 120 } 120 $this->_sg_constraints($qb); 121 121 122 122 // Figure out constraint to use to get root level objects … … 146 146 147 147 /** 148 * Sets sitegroup constraints to QB/MC instance 149 */ 150 function _sg_constraints(&$qb) 151 { 152 $sgs_to_show = array( 0 => &$this->sg_context ); 153 if ($this->show_sg0_objects) 154 { 155 $sgs_to_show[] = 0; 156 } 157 $qb->add_constraint('sitegroup', 'IN', $sgs_to_show); 158 } 159 160 /** 148 161 * Get count of "root" objects for the class this reflector was instantiated for 149 162 * … … 520 533 } 521 534 522 if ($_MIDGARD['sitegroup']) 523 { 524 $qb->add_constraint('sitegroup', '=', $_MIDGARD['sitegroup']); 525 } 535 $this->_sg_constraints($qb); 526 536 527 537 // Figure out constraint to use to get child objects
