Fix manage content

This commit is contained in:
Diego Najar 2018-01-22 20:33:53 +01:00
parent 019508bcc3
commit ca6d78009c
3 changed files with 20 additions and 10 deletions

View File

@ -52,7 +52,7 @@ function table($status, $icon='arrow-circle-o-down') {
foreach ($list as $pageKey) {
$page = buildPage($pageKey);
if ($page) {
if ($page->isParent() || $status!='published') {
if (!$page->isChild() || $status!='published') {
echo '<tr>
<td>
<a href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'"><i class="fa fa-'.$icon.'"></i> '
@ -71,7 +71,7 @@ function table($status, $icon='arrow-circle-o-down') {
echo '<tr>
<td class="child-title">
<a href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$child->key().'"><i class="fa fa-circle-thin"></i> '
<a href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$child->key().'"><i class="fa fa-angle-right"></i> '
.($child->title()?$child->title():'<span class="label-empty-title">'.$Language->g('Empty title').'</span> ')
.'</a>
</td>
@ -111,7 +111,7 @@ if ($Url->pageNumber()==1) {
table('scheduled', 'clock-o');
table('static', 'thumb-tack');
}
table('published', 'circle-o');
table('published', 'chevron-right');
echo '
</tbody>

View File

@ -417,12 +417,6 @@ class Page {
return false;
}
// Returns TURE if the page has a parent, FALSE otherwise
public function hasParent()
{
return $this->parentKey()!==false;
}
// Returns the parent method output, if the page doesn't have a parent returns FALSE
public function parentMethod($method)
{
@ -435,24 +429,38 @@ class Page {
return false;
}
// Returns TURE if the page has a parent, FALSE otherwise
public function hasParent()
{
return $this->parentKey()!==false;
}
// Returns TRUE if the page is a child, FALSE otherwise
public function isChild()
{
return $this->parentKey()!==false;
}
// Returns an array with all children's key
public function children()
{
return $this->getValue('children');
}
// Returns an array with all children's key
public function subpages()
{
return $this->children();
}
// Returns TRUE if the page has subpages/children, FALSE otherwise
// Returns TRUE if the page has children
public function hasSubpages()
{
$subpages = $this->subpages();
return !empty($subpages);
}
// Returns TRUE if the page is a parent
public function isParent()
{
return $this->hasSubpages();

View File

@ -609,9 +609,11 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
<input name="password" id="jspassword" type="password" class="uk-width-1-1 uk-form-large" value="<?php echo isset($_POST['password'])?$_POST['password']:'' ?>" placeholder="<?php echo $Language->get('Password') ?>">
</div>
<!--
<div class="uk-form-row">
<input name="email" id="jsemail" type="text" class="uk-width-1-1 uk-form-large" placeholder="<?php echo $Language->get('Email') ?>" autocomplete="off" maxlength="100">
</div>
-->
<div class="uk-form-row">
<button type="submit" class="uk-width-1-1 uk-button uk-button-primary uk-button-large"><?php $Language->p('Install') ?></button>