Changeset 14800
- Timestamp:
- 02/08/08 09:45:14 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midgard/data/midgard_admin_sitewizard_creator.php
r13733 r14800 93 93 protected function get_structure_config_filesystem_xml($path) 94 94 { 95 $raw = file_get_contents($path);95 //$raw = file_get_contents($path); 96 96 } 97 97 } trunk/midgard/data/midgard_admin_sitewizard_creator_structure.php
r13733 r14800 103 103 } 104 104 105 private function is_structure_created() 106 { 107 if ($this->root_topic != null) 108 { 109 $qb = new midgard_query_builder('midgard_topic'); 110 $qb->add_constraint('up', '=', $this->root_topic->id); 111 112 if ($qb->count() > 0) 113 { 114 return true; 115 } 116 } 117 118 return false; 119 } 120 105 121 public function get_schemadb() 106 122 { … … 157 173 } 158 174 159 p ublicfunction create_index_article($topic_id, $title = '')175 private function create_index_article($topic_id, $title = '') 160 176 { 161 177 $this->verbose("Creating index article for topic ID: " . $topic_id . " Title: " . $title); … … 180 196 } 181 197 182 p ublicfunction create_symlinks()198 private function create_symlinks() 183 199 { 184 200 if (count($this->symlink_sources) > 0) … … 205 221 } 206 222 } 223 } 224 225 private function update_symlinks() 226 { 227 207 228 } 208 229 … … 533 554 } 534 555 535 p ublicfunction create_topic_structure()556 private function create_topic_structure() 536 557 { 537 558 $this->verbose("Starting to create topic structure"); … … 571 592 if (isset($this->structure['root']['use_inherited_style']) && $this->structure['root']['use_inherited_style'] == false) 572 593 { 573 $this->creation_root_topic->style = $this->get_host_style_name($this->host->style, false);594 $this->creation_root_topic->style = "/" . $this->get_host_style_name($this->host->style, false); 574 595 } 575 596 else 576 597 { 577 $this->creation_root_topic->style = $this->get_host_style_name($this->host->style);598 $this->creation_root_topic->style = "/" . $this->get_host_style_name($this->host->style); 578 599 } 579 600 } … … 602 623 if (isset($this->structure['root']['use_inherited_style']) && $this->structure['root']['use_inherited_style'] == false) 603 624 { 604 $this->creation_root_topic->parameter('midcom', 'style', $this->get_host_style_name($this->host->style, false));625 $this->creation_root_topic->parameter('midcom', 'style', "/" . $this->get_host_style_name($this->host->style, false)); 605 626 } 606 627 else 607 628 { 608 $this->creation_root_topic->parameter('midcom', 'style', $this->get_host_style_name($this->host->style));629 $this->creation_root_topic->parameter('midcom', 'style', "/" . $this->get_host_style_name($this->host->style)); 609 630 } 610 631 } … … 663 684 } 664 685 665 public function create_group_structure() 686 private function update_topic_structure() 687 { 688 689 } 690 691 private function create_group_structure() 666 692 { 667 693 if ($this->creation_root_group != null) … … 796 822 $this->created_groups[$new_subgroup->name] = $new_subgroup; 797 823 } 824 825 798 826 } 799 827 } … … 804 832 } 805 833 } 834 } 835 836 private function update_group_structure() 837 { 838 806 839 } 807 840 … … 914 947 try 915 948 { 916 $this->create_group_structure(); 917 $this->create_topic_structure(); 918 $this->create_symlinks(); 919 $this->create_code_init(); 920 921 $this->verbose("Sitewizard created website structure successfully."); 922 923 return $this->creation_root_topic->guid; 949 if (!$this->is_structure_created()) 950 { 951 $this->create_group_structure(); 952 $this->create_topic_structure(); 953 $this->create_symlinks(); 954 $this->create_code_init(); 955 956 $this->verbose("Sitewizard created website structure successfully."); 957 958 return $this->creation_root_topic->guid; 959 } 960 else 961 { 962 /* 963 $this->update_group_structure(); 964 $this->update_topic_structure(); 965 $this->update_symlinks(); 966 */ 967 968 $this->verbose("Sitewizard updated website structure successfully."); 969 970 return $this->root_topic->guid; 971 } 924 972 } 925 973 catch(midgard_admin_sitewizard_exception $e)
