Ver Fonte

Fix home mapping on main page, fix htmltitle config

Andy Baugh há 6 anos atrás
pai
commit
d605995078
2 ficheiros alterados com 6 adições e 2 exclusões
  1. 5 2
      index.php
  2. 1 0
      lib/tCMS/Config.inc

+ 5 - 2
index.php

@@ -44,14 +44,17 @@
    <div id="kontent" class="kontained">
    <?php
     // Home should refer to a template.
-    $home = ( array_key_exists( 'home', $config ) && !empty($config['home']) ? $config['home'] : "$docroot/sys/blogroll.inc" );
+    $home = ( array_key_exists( 'home', $config ) && !empty($config['home']) ? $config['home'] : "blog" );
+    $home_map = [ 'blog' => 3, 'microblog' => 2, 'fileshare' => 1 ]; 
     $destinations = [
         $config['home'], "$docroot/sys/fileshare/showfiles.inc", "$docroot/sys/microblog.inc",
         "$docroot/sys/blogroll.inc", "$docroot/sys/fileshare/showpost.inc", "$docroot/sys/fileshare/showcode.inc",
         "$docroot/sys/fileshare/showaudio.inc", "$docroot/sys/fileshare/showvideo.inc", "$docroot/sys/fileshare/showimg.inc",
         "$docroot/sys/fileshare/showdoc.inc",
     ];
-    if ( empty($nav) ) $nav = 0;
+    if ( empty($nav) || $nav == 0 ) {
+        $nav = $home_map[$home];
+    }
     if ( $nav === 1 || $nav > 4 ) {
         $pwd = $post;
         include 'sys/fileshare/sanitize.inc';

+ 1 - 0
lib/tCMS/Config.inc

@@ -25,6 +25,7 @@
             'main'  => [
                 'home'  => [ 'label' => 'Default Home', 'default' => 'blog', 'form_field' => 'select', 'select_opts' => [ 'blog', 'microblog', 'fileshare' ] ],
                 'theme' => [ 'label' => 'tCMS Theme', 'default' => 'default', 'form_field' => 'select', 'select_opts' => [ 'default' ] ],
+                'htmltitle' => [ 'label' => 'Website Title', 'default' => 'Just another tCMS Blog', 'form_field' => 'input', 'field_type' => 'text' ],
                 'microblogtitle' => [ 'label' => 'Microblog Title', 'default' => 'Microblog', 'form_field' => 'input', 'field_type' => 'text' ],
             ],
         ];