Set default home page

This commit is contained in:
dignajar 2015-07-26 00:37:51 -03:00
parent 435f658ef7
commit bce32b615e
3 changed files with 34 additions and 1 deletions

View File

@ -51,3 +51,22 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
// ============================================================================ // ============================================================================
// Main // Main
// ============================================================================ // ============================================================================
// Default home page
$_homePageList = array(''=>$Language->g('Show blog'));
foreach($pagesParents as $parentKey=>$pageList)
{
foreach($pageList as $Page)
{
if($parentKey!==NO_PARENT_CHAR) {
$parentTitle = $pages[$Page->parentKey()]->title().'->';
}
else {
$parentTitle = '';
}
if($Page->published()) {
$_homePageList[$Page->key()] = $Language->g('Page').': '.$parentTitle.$Page->title();
}
}
}

View File

@ -63,6 +63,18 @@
<div class="forms-desc"><?php $Language->p('number-of-posts-to-show-per-page') ?></div> <div class="forms-desc"><?php $Language->p('number-of-posts-to-show-per-page') ?></div>
</label> </label>
<label for="homepage">
<?php $Language->p('Default home page') ?>
<select name="homepage" class="width-50">
<?php
$htmlOptions = $_homePageList;
foreach($htmlOptions as $value=>$text) {
echo '<option value="'.$value.'"'.( ($Site->homepage()===$value)?' selected="selected"':'').'>'.$text.'</option>';
}
?>
</select>
</label>
<label> <label>
<?php $Language->p('Site URL') ?> <?php $Language->p('Site URL') ?>
<input type="text" name="url" class="width-50" value="<?php echo $Site->url() ?>"> <input type="text" name="url" class="width-50" value="<?php echo $Site->url() ?>">

View File

@ -126,5 +126,7 @@
"delete": "Delete", "delete": "Delete",
"delete-the-user-and-all-its-posts":"Delete the user and all its posts", "delete-the-user-and-all-its-posts":"Delete the user and all its posts",
"delete-the-user-and-associate-its-posts-to-admin-user": "Delete the user and associate its posts to admin user", "delete-the-user-and-associate-its-posts-to-admin-user": "Delete the user and associate its posts to admin user",
"read-more": "Read more" "read-more": "Read more",
"show-blog": "Show blog",
"default-home-page": "Default home page"
} }