Updated deprecated $page->modular() method calls to $page->isModule()

This commit is contained in:
Matias Griese
2019-11-15 21:51:47 +02:00
parent ca2762be0a
commit d252286947
4 changed files with 6 additions and 5 deletions

View File

@@ -5,6 +5,7 @@
* Added support for hiding parts of admin by `Deny` permissions (`Flex Users` only)
1. [](#improved)
* Improved `permissions` field to add support for displaying calculated permissions
* Grav 1.7: Updated deprecated `$page->modular()` method calls to `$page->isModule()`
1. [](#bugfix)
* Fixed `permissions` field with nested permissions

View File

@@ -1777,7 +1777,7 @@ class Admin
$header['body_classes'] = 'modular';
}
$name = $page->modular() ? str_replace('modular/', '', $data['name']) : $data['name'];
$name = $page->isModule() ? str_replace('modular/', '', $data['name']) : $data['name'];
$page->name($name . '.md');
// Fire new event to allow plugins to manipulate page frontmatter

View File

@@ -27,7 +27,7 @@
{% for p in pcol %}
{% set description = (not p.page ? "PLUGIN_ADMIN.FOLDER"|tu ~ ' • ' : "PLUGIN_ADMIN.PAGE"|tu ~ ' • ') ~
(p.modular ? "PLUGIN_ADMIN.MODULAR"|tu ~ ' • ' : '') ~
(p.isModule ? "PLUGIN_ADMIN.MODULAR"|tu ~ ' • ' : '') ~
(p.routable ? "PLUGIN_ADMIN.ROUTABLE"|tu ~ ' • ' : "PLUGIN_ADMIN.NON_ROUTABLE"|tu ~ ' • ') ~
(p.visible ? "PLUGIN_ADMIN.VISIBLE"|tu ~ ' • ' : "PLUGIN_ADMIN.NON_VISIBLE"|tu ~ ' • ') ~
(p.published ? "PLUGIN_ADMIN.PUBLISHED"|tu ~ ' • ' : "PLUGIN_ADMIN.NON_PUBLISHED"|tu ~ ' • ') %}
@@ -37,7 +37,7 @@
<li class="page-item" data-nav-id="{{ p.route }}">
<div class="row page-item__row">
<span class="page-item__toggle" {{ p.children(0).count > 0 ? 'data-toggle="children"' : ''}}>
<i class="page-icon fa fa-fw fa-circle-o {{ p.children(0).count > 0 ? 'children-closed' : ''}} {{ p.modular ? 'modular' : (not p.routable ? 'not-routable' : (not p.visible ? 'not-visible' : (not p.page ? 'folder' : ''))) }}"></i>
<i class="page-icon fa fa-fw fa-circle-o {{ p.children(0).count > 0 ? 'children-closed' : ''}} {{ p.isModule ? 'modular' : (not p.routable ? 'not-routable' : (not p.visible ? 'not-visible' : (not p.page ? 'folder' : ''))) }}"></i>
</span>
<div class="page-item__content">
<div class="page-item__content-name">
@@ -110,7 +110,7 @@
{% set title = "PLUGIN_ADMIN.PAGES"|tu %}
{% endif %}
{% set modular = context.modular ? 'modular_' : '' %}
{% set modular = context.isModule ? 'modular_' : '' %}
{% set warn = config.plugins.admin.warnings.delete_page %}
{% set secure_delete = config.plugins.admin.warnings.secure_delete %}
{% set page_lang = context.language %}

View File

@@ -5,7 +5,7 @@
<li class="page-item" data-nav-id="{{ p.route }}">
<div class="row">
<span {{ p.children(0).count > 0 ? 'data-toggle="children"' : ''}} class="hint--bottom">
<i class="page-icon fa fa-fw fa-circle-o {{ p.children(0).count > 0 ? 'children-closed' : ''}} {{ p.modular ? 'modular' : (not p.routable ? 'not-routable' : (not p.visible ? 'not-visible' : (not p.page ? 'folder' : ''))) }}"></i>
<i class="page-icon fa fa-fw fa-circle-o {{ p.children(0).count > 0 ? 'children-closed' : ''}} {{ p.isModule ? 'modular' : (not p.routable ? 'not-routable' : (not p.visible ? 'not-visible' : (not p.page ? 'folder' : ''))) }}"></i>
</span>
<span data-hint="{{ p.header.routes.default ?: p.route }}" class="hint--bottom">