Changeset 13133
- Timestamp:
- 10/29/07 08:56:28 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midgard/data/midgard_admin_sitewizard_creator_structure.php
r13068 r13133 37 37 38 38 private $midcom_path = ''; 39 40 private $symlink_sources = array(); 41 42 private $symlink_targets = array(); 39 43 40 44 public function __construct($parent_link = null) … … 174 178 175 179 return false; 180 } 181 182 public function create_symlinks() 183 { 184 if (count($this->symlink_sources) > 0) 185 { 186 foreach($this->symlink_sources as $source_id => $guid) 187 { 188 if (array_key_exists($source_id, $this->symlink_targets)) 189 { 190 $this->verbose("Creating symlink GUID: " . $guid); 191 192 $targets = $this->symlink_targets[$source_id]; 193 194 foreach($targets as $target) 195 { 196 $target->parameter($target->component, 'symlink_topic', $guid); 197 198 if (!$target->update()) 199 { 200 throw new midgard_admin_sitewizard_exception("Failed create symlink GUID: " 201 . $guid . " Reason: " . mgd_errstr()); 202 } 203 } 204 } 205 } 206 } 176 207 } 177 208 … … 398 429 } 399 430 431 // Creating index article 400 432 if (isset($node['create_index']) && $node['create_index'] == true) 401 433 { 402 434 $this->create_index_article($topic->id, $this->replace($node['title'])); 435 } 436 437 // Adding symlink source 438 if (isset($node['symlink_source_id'])) 439 { 440 $this->symlink_sources[$node['symlink_source_id']] = $topic->guid; 441 } 442 443 // Adding symlink target 444 if (isset($node['symlink_target_id'])) 445 { 446 $this->symlink_targets[$node['symlink_target_id']][] = $topic; 447 } 448 449 // Setting styleInherit 450 if (isset($node['styleInherit']) && $node['styleInherit'] == true) 451 { 452 $this->creation_root_topic->styleInherit = 1; 453 } 454 455 // Setting style 456 if (isset($node['style'])) 457 { 458 $this->creation_root_topic->style = $node['style']; 403 459 } 404 460 } … … 530 586 { 531 587 $this->set_privileges($this->structure['root'], $this->creation_root_topic); 588 } 589 590 // Setting styleInherit 591 if (isset($this->structure['root']['styleInherit']) && $this->structure['root']['styleInherit'] == true) 592 { 593 $this->creation_root_topic->styleInherit = 1; 532 594 } 533 595 … … 793 855 $this->create_group_structure(); 794 856 $this->create_topic_structure(); 857 $this->create_symlinks(); 795 858 $this->create_code_init(); 796 859
