Changeset 14800

Show
Ignore:
Timestamp:
02/08/08 09:45:14 (10 months ago)
Author:
juhana
Message:

Minor fix: styles are now set with a starting "/"...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midgard/data/midgard_admin_sitewizard_creator.php

    r13733 r14800  
    9393    protected function get_structure_config_filesystem_xml($path) 
    9494    { 
    95         $raw = file_get_contents($path); 
     95        //$raw = file_get_contents($path); 
    9696    } 
    9797} 
  • trunk/midgard/data/midgard_admin_sitewizard_creator_structure.php

    r13733 r14800  
    103103    } 
    104104     
     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     
    105121    public function get_schemadb() 
    106122    { 
     
    157173    } 
    158174     
    159     public function create_index_article($topic_id, $title = '') 
     175    private function create_index_article($topic_id, $title = '') 
    160176    { 
    161177        $this->verbose("Creating index article for topic ID: " . $topic_id . " Title: " . $title); 
     
    180196    } 
    181197     
    182     public function create_symlinks() 
     198    private function create_symlinks() 
    183199    { 
    184200        if (count($this->symlink_sources) > 0) 
     
    205221            } 
    206222        } 
     223    } 
     224     
     225    private function update_symlinks() 
     226    { 
     227     
    207228    } 
    208229 
     
    533554    } 
    534555 
    535     public function create_topic_structure() 
     556    private function create_topic_structure() 
    536557    { 
    537558        $this->verbose("Starting to create topic structure"); 
     
    571592                if (isset($this->structure['root']['use_inherited_style']) && $this->structure['root']['use_inherited_style'] == false) 
    572593                { 
    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);  
    574595                }            
    575596                else 
    576597                { 
    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); 
    578599                } 
    579600            } 
     
    602623                    if (isset($this->structure['root']['use_inherited_style']) && $this->structure['root']['use_inherited_style'] == false) 
    603624                    { 
    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)); 
    605626                    } 
    606627                    else 
    607628                    { 
    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)); 
    609630                    } 
    610631                } 
     
    663684    } 
    664685 
    665     public function create_group_structure() 
     686    private function update_topic_structure() 
     687    { 
     688     
     689    } 
     690 
     691    private function create_group_structure() 
    666692    { 
    667693        if ($this->creation_root_group != null) 
     
    796822                                    $this->created_groups[$new_subgroup->name] = $new_subgroup; 
    797823                                } 
     824                                 
     825                                 
    798826                            } 
    799827                        } 
     
    804832            }             
    805833        } 
     834    } 
     835     
     836    private function update_group_structure() 
     837    { 
     838     
    806839    } 
    807840     
     
    914947        try  
    915948        { 
    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            } 
    924972        } 
    925973        catch(midgard_admin_sitewizard_exception $e)