Changeset 13457
- Timestamp:
- 11/16/07 14:07:29 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midgard/data/midgard_admin_sitewizard_creator_host.php
r13068 r13457 211 211 $code_finish->page = $this->root_page->id; 212 212 $code_finish->info = 'inherit'; 213 $code_finish->sitegroup = $this->sitegroup->id; 213 214 $code_finish->value = "<?php \$_MIDCOM->finish(); ?>\n"; 214 215 trunk/midgard/data/midgard_admin_sitewizard_creator_structure.php
r13133 r13457 399 399 $topic->style = $node['style']; 400 400 } 401 402 if (isset($node['nav_noentry']) && $node['nav_noentry'] == true) 403 { 404 $topic->metadata->navnoentry = true; 405 } 401 406 402 407 if (!$topic->create()) … … 448 453 449 454 // Setting styleInherit 450 if (isset($node['style Inherit']) && $node['styleInherit'] == true)455 if (isset($node['style_inherit']) && $node['style_inherit'] == true) 451 456 { 452 457 $this->creation_root_topic->styleInherit = 1; … … 551 556 $this->creation_root_topic->sitegroup = $this->sitegroup->id; 552 557 $this->creation_root_topic->extra = $this->replace($this->structure['root']['title']); 553 $this->creation_root_topic->name = $this->replace($this->structure['root']['name']) ;558 $this->creation_root_topic->name = $this->replace($this->structure['root']['name']) . $this->host->prefix; 554 559 $this->creation_root_topic->component = $this->structure['root']['component']; 555 560 556 if (isset($ node['root']['style']) && !empty($node['root']['style']))561 if (isset($this->structure['root']['style']) && !empty($this->structure['root']['style'])) 557 562 { 558 563 $this->verbose("Setting style for topic " . $this->structure['root']['name'] 559 . "(" . $node['root']['style'] . ")"); 560 $this->creation_root_topic->style = $node['root']['style']; 561 } 562 564 . "(" . $this->structure['root']['style'] . ")"); 565 $this->creation_root_topic->style = $this->structure['root']['style']; 566 } 567 else 568 { 569 $this->verbose("Setting style for topic " . $this->structure['root']['name'] . ": (" . $this->host->style . ")"); 570 571 if (isset($this->structure['root']['use_inherited_style']) && $this->structure['root']['use_inherited_style'] == false) 572 { 573 $this->creation_root_topic->style = $this->get_host_style_name($this->host->style, false); 574 } 575 else 576 { 577 $this->creation_root_topic->style = $this->get_host_style_name($this->host->style); 578 } 579 } 580 581 if (isset($this->structure['root']['nav_noentry']) && $this->structure['root']['nav_noentry'] == true) 582 { 583 $this->creation_root_topic->metadata->navnoentry = true; 584 } 585 563 586 if (!$this->creation_root_topic->create()) 564 587 { … … 571 594 { 572 595 // Setting style parameter 573 if (isset($node['root']['style']) && !empty($node['root']['style'])) 574 { 575 $this->creation_root_topic->parameter('midcom', 'style', $node['root']['style']); 596 if (isset($this->structure['root']['style']) && !empty($this->structure['root']['style'])) 597 { 598 $this->creation_root_topic->parameter('midcom', 'style', $this->structure['root']['style']); 599 } 600 else 601 { 602 if (isset($this->structure['root']['use_inherited_style']) && $this->structure['root']['use_inherited_style'] == false) 603 { 604 $this->creation_root_topic->parameter('midcom', 'style', $this->get_host_style_name($this->host->style, false)); 605 } 606 else 607 { 608 $this->creation_root_topic->parameter('midcom', 'style', $this->get_host_style_name($this->host->style)); 609 } 576 610 } 577 611 … … 589 623 590 624 // Setting styleInherit 591 if (isset($this->structure['root']['style Inherit']) && $this->structure['root']['styleInherit'] == true)625 if (isset($this->structure['root']['style_inherit']) && $this->structure['root']['style_inherit'] == true) 592 626 { 593 627 $this->creation_root_topic->styleInherit = 1; 628 $this->creation_root_topic->update(); 594 629 } 595 630 … … 771 806 } 772 807 808 public function get_host_style_name($style_id, $use_inherited_style = true) 809 { 810 $qb = new midgard_query_builder('midgard_style'); 811 $qb->add_constraint('id', '=', $style_id); 812 $styles = $qb->execute(); 813 814 if (count($styles) > 0) 815 { 816 if (!$use_inherited_style) 817 { 818 $qb = new midgard_query_builder('midgard_style'); 819 $qb->add_constraint('id', '=', $styles[0]->up); 820 $parent_styles = $qb->execute(); 821 822 return $parent_styles[0]->name; 823 } 824 825 return $styles[0]->name; 826 } 827 else 828 { 829 return ''; 830 } 831 } 832 773 833 public function get_host() 774 834 { … … 802 862 $code_init->page = $this->root_page->id; 803 863 $code_init->info = 'inherit'; 864 $code_init->sitegroup = $this->sitegroup->id; 804 865 $code_init->value = "<?php 805 866
