Browse Source

Improve subpages nav

pull/674/head
danpros 1 year ago
parent
commit
ee831b5cb1
2 changed files with 7 additions and 7 deletions
  1. +6
    -6
      system/admin/views/edit-page.html.php
  2. +1
    -1
      system/includes/functions.php

+ 6
- 6
system/admin/views/edit-page.html.php View File

@ -118,13 +118,13 @@ $images = get_gallery();
<input type="submit" name="submit" class="btn btn-primary submit" value="<?php echo i18n('Save_category');?>"/> <input type="submit" name="submit" class="btn btn-primary submit" value="<?php echo i18n('Save_category');?>"/>
<?php } else {?> <?php } else {?>
<input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/> <input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/>
<?php $count = count(get_static_sub_post($oldmd)); ?>
<?php if (stripos($dir . '/', '/draft/') !== false) { ?>
<input type="submit" name="publishdraft" class="btn btn-primary submit" value="<?php echo i18n('Publish_draft');?>"/> <input type="submit" name="updatedraft" class="btn btn-primary draft" value="<?php echo i18n('Update_draft');?>"/> <?php if ($count == 0 && $type != 'is_page'):?><a class="btn btn-danger" href="<?php echo $delete ?>"><?php echo i18n('Delete');?></a><?php endif;?>
<?php } else { ?>
<?php $count = count(get_static_sub_post($oldmd)); ?>
<?php if (stripos($dir . '/', '/draft/') !== false) { ?>
<input type="submit" name="publishdraft" class="btn btn-primary submit" value="<?php echo i18n('Publish_draft');?>"/> <input type="submit" name="updatedraft" class="btn btn-primary draft" value="<?php echo i18n('Update_draft');?>"/> <?php if ($count == 0 && $type != 'is_page'):?><a class="btn btn-danger" href="<?php echo $delete ?>"><?php echo i18n('Delete');?></a><?php endif;?>
<?php } else { ?>
<input type="submit" name="submit" class="btn btn-primary submit" value="<?php echo i18n('Save');?>"/> <input type="submit" name="revertpage" class="btn btn-primary revert" value="<?php echo i18n('Revert_to_draft');?>"/> <?php if ($count == 0 && $type != 'is_page'):?><a class="btn btn-danger" href="<?php echo $delete ?>"><?php echo i18n('Delete');?></a><?php endif;?> <input type="submit" name="submit" class="btn btn-primary submit" value="<?php echo i18n('Save');?>"/> <input type="submit" name="revertpage" class="btn btn-primary revert" value="<?php echo i18n('Revert_to_draft');?>"/> <?php if ($count == 0 && $type != 'is_page'):?><a class="btn btn-danger" href="<?php echo $delete ?>"><?php echo i18n('Delete');?></a><?php endif;?>
<?php } ?>
<?php } ?>
<?php } ?> <?php } ?>
</div> </div>
<div class="col-sm-6"> <div class="col-sm-6">


+ 1
- 1
system/includes/functions.php View File

@ -1168,7 +1168,7 @@ function get_static_post($static = null)
// Return static page. // Return static page.
function get_static_sub_post($static, $sub_static = null) function get_static_sub_post($static, $sub_static = null)
{ {
$sub_pages = get_static_subpages($static);
$sub_pages = array_values(get_static_subpages($static));
$tmp = array(); $tmp = array();


Loading…
Cancel
Save