feat(demo): add story 1 — Sorano: Rock and Time
@@ -0,0 +1 @@
|
|||||||
|
/* @copyright Copyright (c) 2015 - 2023 Trilby Media, LLC. All rights reserved. */
|
||||||
@@ -3,8 +3,16 @@ state: enabled
|
|||||||
title: Mischa
|
title: Mischa
|
||||||
email: mischa@gorinskat.nl
|
email: mischa@gorinskat.nl
|
||||||
fullname: Mischa
|
fullname: Mischa
|
||||||
hashed_password: $2y$10$koiWKjhhipph4uTbm7fWjOj79uwxfE/mYSXGKANrAvUrSqezY3xL2
|
hashed_password: $2y$10$gAhnWvgzquwC0Vg5vwSJee22eO5kLxphS4RiqMZv9nf61kX.96XW6
|
||||||
language: en
|
language: en
|
||||||
|
modified: 1781874349
|
||||||
|
admin_next:
|
||||||
|
preferences:
|
||||||
|
pluginsViewMode: cards
|
||||||
|
colorMode: dark
|
||||||
|
accentHue: 271
|
||||||
|
accentSaturation: 91
|
||||||
|
fontFamily: inter
|
||||||
access:
|
access:
|
||||||
admin:
|
admin:
|
||||||
login: true
|
login: true
|
||||||
|
|||||||
@@ -1,118 +0,0 @@
|
|||||||
name: Daily Entry
|
|
||||||
extends@: default
|
|
||||||
|
|
||||||
form:
|
|
||||||
fields:
|
|
||||||
tabs:
|
|
||||||
type: tabs
|
|
||||||
active: 1
|
|
||||||
fields:
|
|
||||||
content:
|
|
||||||
type: tab
|
|
||||||
title: Entry
|
|
||||||
|
|
||||||
fields:
|
|
||||||
header.title:
|
|
||||||
type: text
|
|
||||||
label: Title
|
|
||||||
validate:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
header.date:
|
|
||||||
type: datetime
|
|
||||||
label: Date
|
|
||||||
format: 'Y-m-d H:i'
|
|
||||||
validate:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
content:
|
|
||||||
type: markdown
|
|
||||||
label: Content
|
|
||||||
validate:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
header.hero_image:
|
|
||||||
type: text
|
|
||||||
label: 'Hero Image Filename'
|
|
||||||
help: 'Filename of the main photo for this entry (e.g. photo.jpg). Upload photos via the Media tab.'
|
|
||||||
|
|
||||||
location:
|
|
||||||
type: tab
|
|
||||||
title: Location
|
|
||||||
|
|
||||||
fields:
|
|
||||||
header.location_city:
|
|
||||||
type: text
|
|
||||||
label: City
|
|
||||||
placeholder: 'e.g. Kyoto'
|
|
||||||
|
|
||||||
header.location_country:
|
|
||||||
type: text
|
|
||||||
label: Country
|
|
||||||
placeholder: 'e.g. Japan'
|
|
||||||
|
|
||||||
header.lat:
|
|
||||||
type: number
|
|
||||||
label: Latitude
|
|
||||||
help: 'GPS latitude (for map)'
|
|
||||||
placeholder: '48.8566'
|
|
||||||
step: any
|
|
||||||
|
|
||||||
header.lng:
|
|
||||||
type: number
|
|
||||||
label: Longitude
|
|
||||||
help: 'GPS longitude (for map)'
|
|
||||||
placeholder: '2.3522'
|
|
||||||
step: any
|
|
||||||
|
|
||||||
weather:
|
|
||||||
type: tab
|
|
||||||
title: Weather
|
|
||||||
|
|
||||||
fields:
|
|
||||||
header.weather_temp_c:
|
|
||||||
type: number
|
|
||||||
label: 'Temperature (°C)'
|
|
||||||
help: 'Auto-filled from post form. Edit if needed.'
|
|
||||||
step: 1
|
|
||||||
|
|
||||||
header.weather_desc:
|
|
||||||
type: select
|
|
||||||
label: 'Weather Condition'
|
|
||||||
options:
|
|
||||||
Sunny: '☀️ Sunny'
|
|
||||||
'Partly cloudy': '⛅ Partly cloudy'
|
|
||||||
Cloudy: '☁️ Cloudy'
|
|
||||||
Foggy: '🌫️ Foggy'
|
|
||||||
Drizzle: '🌦️ Drizzle'
|
|
||||||
Rain: '🌧️ Rain'
|
|
||||||
Snow: '❄️ Snow'
|
|
||||||
Thunderstorm: '⛈️ Thunderstorm'
|
|
||||||
|
|
||||||
publishing:
|
|
||||||
type: tab
|
|
||||||
title: Publishing
|
|
||||||
|
|
||||||
fields:
|
|
||||||
header.published:
|
|
||||||
type: toggle
|
|
||||||
label: Published
|
|
||||||
highlight: 1
|
|
||||||
default: 1
|
|
||||||
options:
|
|
||||||
1: 'Yes'
|
|
||||||
0: 'No'
|
|
||||||
validate:
|
|
||||||
type: bool
|
|
||||||
|
|
||||||
header.publish_date:
|
|
||||||
type: datetime
|
|
||||||
label: 'Publish Date'
|
|
||||||
help: 'Schedule future publication (leave blank to publish immediately)'
|
|
||||||
format: 'Y-m-d H:i'
|
|
||||||
|
|
||||||
header.unpublish_date:
|
|
||||||
type: datetime
|
|
||||||
label: 'Unpublish Date'
|
|
||||||
help: 'Automatically unpublish at this date/time'
|
|
||||||
format: 'Y-m-d H:i'
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
ui:
|
||||||
|
defaults:
|
||||||
|
colorMode: ''
|
||||||
|
accentHue: 271
|
||||||
|
accentSaturation: 91
|
||||||
|
fontFamily: inter
|
||||||
|
fontSize: normal
|
||||||
|
editorMode: normal
|
||||||
|
editorStickyToolbar: true
|
||||||
|
editorFixedHeight: 0
|
||||||
|
adminLanguage: en-US
|
||||||
|
pagesPerPage: 20
|
||||||
|
pagesViewMode: tree
|
||||||
|
usersViewMode: cards
|
||||||
|
groupsViewMode: cards
|
||||||
|
pluginsViewMode: cards
|
||||||
|
themesViewMode: cards
|
||||||
|
settings:
|
||||||
|
autoSaveEnabled: false
|
||||||
|
autoSaveToolbarUndo: true
|
||||||
|
autoSaveBatchWindowMs: 0
|
||||||
|
collabEnabled: false
|
||||||
|
menubarLinks: { }
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
popularity:
|
||||||
|
salt: 671ae9ab4f792c7dc860dbe8be288f2fdebdb3b4615f3c0f43211ecb95aaeeb3
|
||||||
|
auth:
|
||||||
|
jwt_secret: 61a84160bdd430768c82c4fe153e151a7a6f68f993c3779a5f36d32ee9293653
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// Auto-generated private secret. Do NOT commit to version control.
|
||||||
|
// Used for CSRF nonce signing and admin rate-limit hashing. Regenerate by
|
||||||
|
// deleting this file; the next request will write a new value.
|
||||||
|
|
||||||
|
return 'lsUHWFkCwvGZrL';
|
||||||
@@ -1 +1 @@
|
|||||||
{ }
|
salt: HlC0NrX9QsYq1S
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ wrapped_site: false
|
|||||||
reverse_proxy_setup: false
|
reverse_proxy_setup: false
|
||||||
force_ssl: false
|
force_ssl: false
|
||||||
force_lowercase_urls: true
|
force_lowercase_urls: true
|
||||||
custom_base_url: 'http://100.96.115.96:8081'
|
custom_base_url: ''
|
||||||
username_regex: '^[a-z0-9_-]{3,16}$'
|
username_regex: '^[a-z0-9_-]{3,16}$'
|
||||||
pwd_regex: '(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}'
|
pwd_regex: '(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}'
|
||||||
intl_enabled: true
|
intl_enabled: true
|
||||||
|
|||||||
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 155 KiB |
|
After Width: | Height: | Size: 140 KiB |
@@ -0,0 +1,43 @@
|
|||||||
|
---
|
||||||
|
title: 'Sorano: Rock and Time'
|
||||||
|
date: '2026-09-03'
|
||||||
|
location_name: Sorano
|
||||||
|
location_country: Italy
|
||||||
|
lat: 42.683
|
||||||
|
lng: 11.715
|
||||||
|
hero_image: hero.jpg
|
||||||
|
hero_alt: Medieval town of Sorano clinging to pale tufa cliffs at dusk
|
||||||
|
published: true
|
||||||
|
---
|
||||||
|
|
||||||
|
The road from Orbetello climbs inland through scrubland and heat. For most of the afternoon there is nothing on the horizon except sky and the occasional electricity pylon. Then, at the top of a ridge, Sorano appears — and the word "appears" does not quite cover it. The town has been carved from a cliff of tufa, a pale volcanic rock so soft you can score it with a fingernail. The buildings are the cliff and the cliff is the buildings.
|
||||||
|
|
||||||
|
[scrolly-section image="hero.jpg" alt="Medieval town of Sorano seen from the approach road, perched on pale tufa cliffs" caption="Sorano — tufa cliff town, Grosseto province"]
|
||||||
|
The approach by bike gives you an unusually long time to study it. The descent into the valley and the climb back up take perhaps forty minutes, and the town is visible for most of that time, doing nothing, requiring nothing.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Close up the rock is extraordinary. Hundreds of tomb niches cut into the cliff face — Etruscan graves, most of them open to the sky now, their contents long removed. The people who built this town chose to live surrounded by the evidence of their own mortality. This seems either very brave or very sensible.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
The gate into the old town is fifteenth century and narrow enough that loaded bikes don't fit without turning sideways. Inside, the air is noticeably cooler and the alleys are steep, paved with the same pale tufa, worn smooth by centuries of feet.
|
||||||
|
[/scrolly-section]
|
||||||
|
|
||||||
|
We found a wall to lean the bikes against and sat looking south over the valley we had come from. The light was going amber. Below us, the road we had ridden was already in shadow.
|
||||||
|
|
||||||
|
[chapter-break image="photo-1.jpg" title="After Dark" number="II" alt="Narrow medieval alley in Sorano at dusk, pale stone walls glowing warm" /]
|
||||||
|
|
||||||
|
[pull-quote image="photo-1.jpg" alt="Stone alley in Sorano lit by a single lantern at night"]
|
||||||
|
A town built on rock, carved from rock, returning slowly to rock. Two thousand years of human effort and the cliff remains indifferent.
|
||||||
|
[/pull-quote]
|
||||||
|
|
||||||
|
[scrolly-section image="photo-2.jpg" alt="View south from the tufa cliff walls of Sorano at dusk" caption="Val di Fiora, from the old walls"]
|
||||||
|
One restaurant was open. The menu was four items. We had the pasta with wild boar and the pasta with truffles and a carafe of local wine that cost six euros and was excellent.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
The owner sat at the next table watching a football match on his phone without headphones. Nobody minded. The town outside was completely quiet.
|
||||||
|
[/scrolly-section]
|
||||||
|
|
||||||
|
We were in bed before nine. Sorano at night is absolutely silent. It has been this quiet, in approximately this configuration, for a very long time.
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: 'Trip Map'
|
||||||
|
template: map
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: 'Trip Stats'
|
||||||
|
template: stats
|
||||||
|
---
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
title: Stories
|
||||||
|
template: stories
|
||||||
|
published: true
|
||||||
|
---
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
title: "Rolling through Val d'Orcia"
|
||||||
|
template: entry
|
||||||
|
date: '2025-09-05 08:00'
|
||||||
|
lat: 43.078
|
||||||
|
lng: 11.676
|
||||||
|
location_city: Pienza
|
||||||
|
location_country: Italy
|
||||||
|
weather_temp_c: 24
|
||||||
|
weather_desc: Sunny
|
||||||
|
published: true
|
||||||
|
---
|
||||||
|
Cypress trees lining dirt roads, heat already rising. The Val d'Orcia is everything they say it is.
|
||||||
|
After Width: | Height: | Size: 278 KiB |
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
title: "Siena at dusk"
|
||||||
|
template: entry
|
||||||
|
date: '2025-09-05 19:00'
|
||||||
|
lat: 43.318
|
||||||
|
lng: 11.335
|
||||||
|
location_city: Siena
|
||||||
|
location_country: Italy
|
||||||
|
weather_temp_c: 21
|
||||||
|
weather_desc: Clear
|
||||||
|
published: true
|
||||||
|
---
|
||||||
|
Rolled in just before sunset. The Piazza del Campo was still warm from the day's heat.
|
||||||
|
After Width: | Height: | Size: 115 KiB |
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
title: "Towers of San Gimignano"
|
||||||
|
template: entry
|
||||||
|
date: '2025-09-06 12:00'
|
||||||
|
lat: 43.546
|
||||||
|
lng: 11.321
|
||||||
|
location_city: 'San Gimignano'
|
||||||
|
location_country: Italy
|
||||||
|
weather_temp_c: 26
|
||||||
|
weather_desc: Hot and sunny
|
||||||
|
published: true
|
||||||
|
---
|
||||||
|
Ate lunch in the shadow of the medieval towers. Legs tired, gelato mandatory.
|
||||||
|
After Width: | Height: | Size: 172 KiB |
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
title: "Into Florence"
|
||||||
|
template: entry
|
||||||
|
date: '2025-09-06 18:00'
|
||||||
|
lat: 43.767
|
||||||
|
lng: 11.253
|
||||||
|
location_city: Florence
|
||||||
|
location_country: Italy
|
||||||
|
weather_temp_c: 28
|
||||||
|
weather_desc: Warm
|
||||||
|
published: true
|
||||||
|
---
|
||||||
|
City traffic after days of gravel roads. Dodged trams and found the hotel.
|
||||||
|
After Width: | Height: | Size: 121 KiB |
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
title: "Tyrrhenian coast"
|
||||||
|
template: entry
|
||||||
|
date: '2025-09-08 09:00'
|
||||||
|
lat: 43.553
|
||||||
|
lng: 10.313
|
||||||
|
location_city: Livorno
|
||||||
|
location_country: Italy
|
||||||
|
weather_temp_c: 23
|
||||||
|
weather_desc: Sea breeze
|
||||||
|
published: true
|
||||||
|
---
|
||||||
|
The sea appeared suddenly between two hills. Eight days of riding ends here.
|
||||||
|
After Width: | Height: | Size: 155 KiB |
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: 'Trip Map'
|
||||||
|
template: map
|
||||||
|
---
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: 'Trip Stats'
|
||||||
|
template: stats
|
||||||
|
---
|
||||||
|
After Width: | Height: | Size: 221 KiB |
|
After Width: | Height: | Size: 152 KiB |
@@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
title: The Val d'Orcia at Dawn
|
||||||
|
date: '2025-09-05'
|
||||||
|
location_name: Val d'Orcia
|
||||||
|
location_country: Italy
|
||||||
|
lat: 43.078
|
||||||
|
lng: 11.676
|
||||||
|
hero_image: hero.jpg
|
||||||
|
hero_alt: Cypress-lined dirt road at first light, Tuscany
|
||||||
|
published: true
|
||||||
|
---
|
||||||
|
We left camp before the heat arrived. At six in the morning the Val d'Orcia belongs entirely to the light — long shadows, pale gold, not a car on the white roads. The kind of silence that has texture.
|
||||||
|
|
||||||
|
[snap-gallery images="hero.jpg,photo.jpg" captions="First light on the valley floor,The hills fold endlessly east" alts="Wide valley at dawn with golden light,Rolling green hills under morning sky" /]
|
||||||
|
|
||||||
|
We stopped twice before nine. Once for a puncture, once because the view demanded it.
|
||||||
|
|
||||||
|
[chapter-break image="hero.jpg" title="The Hour Before Heat" alt="Hazy hillside shimmering in early morning warmth" /]
|
||||||
|
|
||||||
|
By ten the temperature had shifted. The colours changed too — softer, more diffuse, the sky turning white at the edges. We dropped into the lower valley and the road surface changed from gravel to packed earth, then back again.
|
||||||
|
|
||||||
|
[snap-gallery images="photo.jpg,hero.jpg" captions="The texture of Tuscan gravel — coarser than it looks,The road ahead disappears into the heat" alts="Close-up of pale gravel surface,Road vanishing into bright haze" /]
|
||||||
|
|
||||||
|
[pull-quote]
|
||||||
|
The best hours of a cycling day are the ones nobody sees. Four in the morning to ten. Then it belongs to the sun.
|
||||||
|
[/pull-quote]
|
||||||
|
|
||||||
|
We made Pienza by noon. It was already thirty degrees and the ice cream queue was six deep.
|
||||||
|
After Width: | Height: | Size: 204 KiB |
|
After Width: | Height: | Size: 119 KiB |
@@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
title: The Long Climb to Montalcino
|
||||||
|
date: '2025-09-06'
|
||||||
|
location_name: Montalcino
|
||||||
|
location_country: Italy
|
||||||
|
lat: 43.058
|
||||||
|
lng: 11.489
|
||||||
|
hero_image: hero.jpg
|
||||||
|
hero_alt: Hairpin road climbing through olive groves towards a hilltop town
|
||||||
|
published: true
|
||||||
|
---
|
||||||
|
The profile showed fourteen kilometres at an average of six percent. In practice it was steeper at the bottom and gentler at the top, which is the worst possible arrangement. We started climbing at two in the afternoon, which was also the worst possible decision.
|
||||||
|
|
||||||
|
[scrolly-section image="hero.jpg" alt="Empty road rising steeply through olive groves" caption="SP55 — 14km, 840m elevation gain"]
|
||||||
|
The first kilometre is the most honest. You find out immediately whether your legs have anything to say.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
By the halfway point the olive groves had given way to scrub oak and the road had narrowed to a single lane. No cars had passed in forty minutes. The silence was absolute except for breathing.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Then, at the last bend before the top, the town appeared. Just the outline of it — a tower, a wall, rooftops. It was enough.
|
||||||
|
[/scrolly-section]
|
||||||
|
|
||||||
|
[chapter-break image="photo.jpg" title="Montalcino" number="II" alt="Medieval town gate with stone archway" /]
|
||||||
|
|
||||||
|
[pull-quote image="photo.jpg" alt="Rows of Brunello vines descending from hilltop town"]
|
||||||
|
From the top you could see the whole valley we had spent two days riding through. It looked completely flat from up here.
|
||||||
|
[/pull-quote]
|
||||||
|
|
||||||
|
We found a bar in the main piazza. The owner brought two glasses of water without being asked. Then two more. Then a small plate of bread and oil that nobody ordered. We sat there for an hour.
|
||||||
|
|
||||||
|
[scrolly-section image="photo.jpg" alt="Shaded medieval piazza with stone buildings" caption="Piazza del Popolo, Montalcino"]
|
||||||
|
The piazza at five in the afternoon is a different place from the piazza at noon. People have returned from wherever they go during the heat.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
A wine shop with barrels in the window and a handwritten list on a chalkboard. We looked at it for a long time and bought nothing. The prices were very reasonable and this felt suspicious.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
A cat on a warm stone wall, watching traffic that did not exist. It had clearly been watching this traffic for years.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
The fortress walls turn amber just before sunset. You could photograph this from a hundred different angles and it would look the same in all of them: very good.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
The descent back to the valley takes twenty minutes. The climb took two and a half hours. This ratio never stops feeling wrong.
|
||||||
|
[/scrolly-section]
|
||||||
|
|
||||||
|
We found the agriturismo by following a handwritten sign nailed to a cypress tree. It was exactly what it promised to be.
|
||||||
|
After Width: | Height: | Size: 126 KiB |
|
After Width: | Height: | Size: 136 KiB |
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
title: One Evening in Siena
|
||||||
|
date: '2025-09-05'
|
||||||
|
location_name: Siena
|
||||||
|
location_country: Italy
|
||||||
|
lat: 43.318
|
||||||
|
lng: 11.330
|
||||||
|
hero_image: hero.jpg
|
||||||
|
hero_alt: The Piazza del Campo at dusk, terracotta rooftops fading to blue
|
||||||
|
published: true
|
||||||
|
---
|
||||||
|
[pull-quote]
|
||||||
|
Siena is not a city that tries to impress you. It has been here for a thousand years and intends to be here for a thousand more. You fit around it.
|
||||||
|
[/pull-quote]
|
||||||
|
|
||||||
|
We rolled in at half past six, legs finished, panniers heavier than they started. The Campo appeared without warning at the end of a narrow street and we both stopped pedalling at exactly the same moment.
|
||||||
|
|
||||||
|
[scrolly-section image="hero.jpg" alt="Piazza del Campo seen from the upper rim, sloping shell-shaped square"]
|
||||||
|
The square fills from the edges inward as evening comes. First the locals — people who have been here before and know which bench faces west. Then the tourists, then the pigeons, then the shadows.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
A busker with a cello at the top of the slope. A couple arguing quietly in a language I couldn't place. Three children running in a circle for reasons nobody questioned. The ordinary business of a city at the end of a summer day.
|
||||||
|
[/scrolly-section]
|
||||||
|
|
||||||
|
[snap-gallery images="hero.jpg,photo.jpg" captions="The Campo at the moment the light goes warm,A doorway on Via di Città — every doorway in Siena looks like this" alts="Wide shot of Campo at golden hour,Ornate stone doorway with iron lantern" /]
|
||||||
|
|
||||||
|
We found a place to eat down three flights of stairs in a basement that appeared to have no ventilation and no menu. It was perfect. The relief of sitting down after eight hours on a bike is a specific physical sensation that is difficult to describe to anyone who has not experienced it.
|
||||||
|
|
||||||
|
[pull-quote image="photo.jpg" alt="Sunset view over Siena rooftops from high vantage point"]
|
||||||
|
Cycling makes you earn every place you arrive at. Siena earned.
|
||||||
|
[/pull-quote]
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
title: Stories
|
||||||
|
template: stories
|
||||||
|
published: true
|
||||||
|
---
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
title: 'Italy 2026 (Demo)'
|
||||||
|
template: trip
|
||||||
|
date: '2026-09-01'
|
||||||
|
date_start: '2026-09-01'
|
||||||
|
date_end: '2026-09-08'
|
||||||
|
cover_image: ''
|
||||||
|
---
|
||||||
@@ -0,0 +1,155 @@
|
|||||||
|
---
|
||||||
|
title: Typography
|
||||||
|
---
|
||||||
|
|
||||||
|
! Details on the full capabilities of Spectre.css can be found in the [Official Spectre Documentation](https://picturepan2.github.io/spectre/elements.html)
|
||||||
|
|
||||||
|
The [Quark theme](https://github.com/getgrav/grav-theme-quark) is the new default theme for Grav built with [Spectre.css](https://picturepan2.github.io/spectre/) the lightweight, responsive and modern CSS framework. Spectre provides basic styles for typography, elements, and a responsive layout system that utilizes best practices and consistent language design.
|
||||||
|
|
||||||
|
### Headings
|
||||||
|
|
||||||
|
# H1 Heading `40px`
|
||||||
|
|
||||||
|
## H2 Heading `32px`
|
||||||
|
|
||||||
|
### H3 Heading `28px`
|
||||||
|
|
||||||
|
#### H4 Heading `24px`
|
||||||
|
|
||||||
|
##### H5 Heading `20px`
|
||||||
|
|
||||||
|
###### H6 Heading `16px`
|
||||||
|
|
||||||
|
```html
|
||||||
|
# H1 Heading
|
||||||
|
# H1 Heading `40px`</small>`
|
||||||
|
|
||||||
|
<span class="h1">H1 Heading</span>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Paragraphs
|
||||||
|
|
||||||
|
Lorem ipsum dolor sit amet, consectetur [adipiscing elit. Praesent risus leo, dictum in vehicula sit amet](#), feugiat tempus tellus. Duis quis sodales risus. Etiam euismod ornare consequat.
|
||||||
|
|
||||||
|
Climb leg rub face on everything give attitude nap all day for under the bed. Chase mice attack feet but rub face on everything hopped up on goofballs.
|
||||||
|
|
||||||
|
### Markdown Semantic Text Elements
|
||||||
|
|
||||||
|
**Bold** `**Bold**`
|
||||||
|
|
||||||
|
_Italic_ `_Italic_`
|
||||||
|
|
||||||
|
~~Deleted~~ `~~Deleted~~`
|
||||||
|
|
||||||
|
`Inline Code` `` `Inline Code` ``
|
||||||
|
|
||||||
|
### HTML Semantic Text Elements
|
||||||
|
|
||||||
|
<abbr>I18N</abbr> `<abbr>`
|
||||||
|
|
||||||
|
<cite>Citation</cite> `<cite>`
|
||||||
|
|
||||||
|
<kbd>Ctrl + S</kbd> `<kbd>`
|
||||||
|
|
||||||
|
Text<sup>Superscripted</sup> `<sup>`
|
||||||
|
|
||||||
|
Text<sub>Subscripted</sub> `<sub>`
|
||||||
|
|
||||||
|
<u>Underlined</u> `<u>`
|
||||||
|
|
||||||
|
<mark>Highlighted</mark> `<mark>`
|
||||||
|
|
||||||
|
<time>20:14</time> `<time>`
|
||||||
|
|
||||||
|
<var>x = y + 2</var> `<var>`
|
||||||
|
|
||||||
|
### Blockquote
|
||||||
|
|
||||||
|
> The advance of technology is based on making it fit in so that you don't really even notice it,
|
||||||
|
> so it's part of everyday life.
|
||||||
|
>
|
||||||
|
> <cite>- Bill Gates</cite>
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
> The advance of technology is based on making it fit in so that you don't really even notice it,
|
||||||
|
> so it's part of everyday life.
|
||||||
|
>
|
||||||
|
> <cite>- Bill Gates</cite>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Unordered List
|
||||||
|
|
||||||
|
* list item 1
|
||||||
|
* list item 2
|
||||||
|
* list item 2.1
|
||||||
|
* list item 2.2
|
||||||
|
* list item 2.3
|
||||||
|
* list item 3
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
* list item 1
|
||||||
|
* list item 2
|
||||||
|
* list item 2.1
|
||||||
|
* list item 2.2
|
||||||
|
* list item 2.3
|
||||||
|
* list item 3
|
||||||
|
```
|
||||||
|
|
||||||
|
### Ordered List
|
||||||
|
|
||||||
|
1. list item 1
|
||||||
|
1. list item 2
|
||||||
|
1. list item 2.1
|
||||||
|
1. list item 2.2
|
||||||
|
1. list item 2.3
|
||||||
|
1. list item 3
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
1. list item 1
|
||||||
|
1. list item 2
|
||||||
|
1. list item 2.1
|
||||||
|
1. list item 2.2
|
||||||
|
1. list item 2.3
|
||||||
|
1. list item 3
|
||||||
|
```
|
||||||
|
|
||||||
|
### Table
|
||||||
|
|
||||||
|
| Name | Genre | Release date |
|
||||||
|
| :-------------------------- | :---------------------------: | -------------------: |
|
||||||
|
| The Shawshank Redemption | Crime, Drama | 14 October 1994 |
|
||||||
|
| The Godfather | Crime, Drama | 24 March 1972 |
|
||||||
|
| Schindler's List | Biography, Drama, History | 4 February 1994 |
|
||||||
|
| Se7en | Crime, Drama, Mystery | 22 September 1995 |
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
| Name | Genre | Release date |
|
||||||
|
| :-------------------------- | :---------------------------: | -------------------: |
|
||||||
|
| The Shawshank Redemption | Crime, Drama | 14 October 1994 |
|
||||||
|
| The Godfather | Crime, Drama | 24 March 1972 |
|
||||||
|
| Schindler's List | Biography, Drama, History | 4 February 1994 |
|
||||||
|
| Se7en | Crime, Drama, Mystery | 22 September 1995 |
|
||||||
|
```
|
||||||
|
|
||||||
|
### Notices
|
||||||
|
|
||||||
|
The notices styles are actually provided by the `markdown-notices` plugin but are useful enough to include here:
|
||||||
|
|
||||||
|
! This is a warning notification
|
||||||
|
|
||||||
|
!! This is a error notification
|
||||||
|
|
||||||
|
!!! This is a default notification
|
||||||
|
|
||||||
|
!!!! This is a success notification
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
! This is a warning notification
|
||||||
|
|
||||||
|
!! This is a error notification
|
||||||
|
|
||||||
|
!!! This is a default notification
|
||||||
|
|
||||||
|
!!!! This is a success notification
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* @copyright Copyright (c) 2015 - 2023 Trilby Media, LLC. All rights reserved. */
|
||||||
@@ -0,0 +1,237 @@
|
|||||||
|
# v3.3.0
|
||||||
|
## 09/14/2023
|
||||||
|
|
||||||
|
1. [](#improved)
|
||||||
|
- Added support multiple slug_fields to form unique slug, either as comma separated list or as array. Many thanks to walkload for the [pull request](https://github.com/bleutzinn/grav-plugin-add-page-by-form/pull/65)
|
||||||
|
|
||||||
|
# v3.2.0
|
||||||
|
## 02/17/2023
|
||||||
|
|
||||||
|
1. [](#bugfix)
|
||||||
|
- Fixed a problem when `pagefrontmatter.content` was set (issue [#63](https://github.com/bleutzinn/grav-plugin-add-page-by-form/issues/63))
|
||||||
|
1. [](#bugfix)
|
||||||
|
- Fixed incorrect handling of using `pageconfig.parent: /` (issue [#59](https://github.com/bleutzinn/grav-plugin-add-page-by-form/issues/59))
|
||||||
|
1. [](#improved)
|
||||||
|
- Added composer
|
||||||
|
|
||||||
|
# v3.1.0
|
||||||
|
## 12/13/2022
|
||||||
|
|
||||||
|
1. [](#improved)
|
||||||
|
- Tested with PHP version 8 (8.1.10)
|
||||||
|
- Fixed some incorrect variable types in PHPDoc Comments
|
||||||
|
1. [](#bugfix)
|
||||||
|
- Changed the declaration of the function `sanitize` to "static". [#62](https://github.com/bleutzinn/grav-plugin-add-page-by-form/issues/62)). Thanks to masetto for raising this issue.
|
||||||
|
|
||||||
|
# v3.0.4
|
||||||
|
## 03/28/2022
|
||||||
|
|
||||||
|
1. [](#bugfix)
|
||||||
|
- A title containing diacritic characters prevented a form submit (issues [#56](https://github.com/bleutzinn/grav-plugin-add-page-by-form/issues/56) and [#60](https://github.com/bleutzinn/grav-plugin-add-page-by-form/issues/60)). Thanks goes to davay for the pull request.
|
||||||
|
|
||||||
|
# v3.0.3
|
||||||
|
## 05/29/2020
|
||||||
|
|
||||||
|
1. [](#bugfix)
|
||||||
|
- Fixed not handling overwrite_mode setting properly, issue [#54](https://github.com/bleutzinn/grav-plugin-add-page-by-form/issues/54), thanks to mooomooo for reporting and testing
|
||||||
|
|
||||||
|
# v3.0.2
|
||||||
|
## 05/17/2020
|
||||||
|
|
||||||
|
1. [](#improved)
|
||||||
|
- Yet another release. This time just to synchronize the versioning number in 'bleuprints.yaml' and this Changelog. For interesting changes see v3.0.0.
|
||||||
|
|
||||||
|
# v3.0.1
|
||||||
|
## 05/17/2020
|
||||||
|
|
||||||
|
1. [](#improved)
|
||||||
|
- Removed a newline between the version number and the date in this Changelog file in an attempt to restore the correct display of this file in the Grav repository
|
||||||
|
|
||||||
|
# v3.0.0
|
||||||
|
## 05/03/2020
|
||||||
|
|
||||||
|
1. [](#new)
|
||||||
|
- New 'overwrite_mode' option 'edit' allows for editing a page. Note: yet undocumented.
|
||||||
|
- Removing upload files is now handled
|
||||||
|
1. [](#bugfix)
|
||||||
|
- Switched to Laravel str_slug function to remedy problems with hyphens on some Windows systems
|
||||||
|
1. [](#improved)
|
||||||
|
* (Possibly breaking change:) Changed uploaded files data structure from numeric array to associative array
|
||||||
|
* (Possibly breaking change:) Changed default setting of 'physical_template_name' to 'true'
|
||||||
|
* Minimum Grav version is set to 1.6
|
||||||
|
|
||||||
|
# v2.4.1
|
||||||
|
## 04/12/2020
|
||||||
|
|
||||||
|
1. [](#bugfix)
|
||||||
|
* Fixed a bug ([issue #52](https://github.com/bleutzinn/grav-plugin-add-page-by-form/issues/52)) where an empty value for the 'slug' variable would delete folder(s). Thanks to [anton-mellit](https://github.com/anton-mellit) for reporting this.
|
||||||
|
|
||||||
|
# v2.4.0
|
||||||
|
## 01/28/2020
|
||||||
|
|
||||||
|
1. [](#new)
|
||||||
|
* Added a new config variable 'physical_template_name' to make using the new page template name as the new page's file name optional.
|
||||||
|
1. [](#improved)
|
||||||
|
* Removed the Changelog entry that was included in [https://github.com/bleutzinn/grav-plugin-add-page-by-form/pull/47](PR #47) from this file as it was not in the Grav Changelog format and prevented changes showing up correctly in the Grav Plugins download section.
|
||||||
|
|
||||||
|
# v2.3.5
|
||||||
|
## 01/25/2020
|
||||||
|
|
||||||
|
1. [](#new)
|
||||||
|
* Add option to suppress loading of simpleMDE assets (reduces overhead if its known it will not be used)
|
||||||
|
|
||||||
|
# v2.3.4
|
||||||
|
## 01/20/2020
|
||||||
|
|
||||||
|
1. [](#bugfix)
|
||||||
|
* Prepared a new release to mainly consolidate the fix "Use moveTo method not native copy to move uploaded files to final destination" and to bring this changelog format back in line with Grav requirements. Thanks to Dave Nichols (pd-giz-dave).
|
||||||
|
1. [](#improved)
|
||||||
|
* Also included the ability to use the new page template name as the new page's folder name. Thanks to Dave Nichols (pd-giz-dave).
|
||||||
|
|
||||||
|
# v2.3.3
|
||||||
|
## 12/05/2019
|
||||||
|
|
||||||
|
1. [](#bugfix)
|
||||||
|
* Fixed inconsistancies in version numbering which prevented the addition of the latest updates in the Grav Plugin repository.
|
||||||
|
|
||||||
|
# v2.3.2
|
||||||
|
## 11/24/2019
|
||||||
|
|
||||||
|
1. [](#bugfix)
|
||||||
|
* Prepared a new release to fix a bug in version numbering. The letter "v" appears to be case sensitive. The versions 2.3.0 and 2.3.1 were tagged with a capital "V" as V2.3.0 and V2.3.1 respectively. Previous versions were tagged using a lowercase "v". This difference causes the Grav Repository to think these are two different plugins.
|
||||||
|
|
||||||
|
# v2.3.1
|
||||||
|
## 10/10/2019
|
||||||
|
|
||||||
|
1. [](#bugfix)
|
||||||
|
* Fixed a subsequent failure to save file uploads to new page folder (form field File with `destination: @self`) introduced with Grav version 1.6.11 ([issue #44](https://github.com/bleutzinn/grav-plugin-add-page-by-form/issues/44)). Thanks goes to mahagr for tips and to tranduyhung for the fix itself.
|
||||||
|
|
||||||
|
# v2.3.0
|
||||||
|
## 06/06/2019
|
||||||
|
|
||||||
|
1. [](#bugfix)
|
||||||
|
* Fixed the failure to save file uploads to new page folder (form field File with `destination: @self`) introduced with Grav version 1.6 ([issue #40](https://github.com/bleutzinn/grav-plugin-add-page-by-form/issues/40))
|
||||||
|
|
||||||
|
# v2.2.0
|
||||||
|
## 04/15/2018
|
||||||
|
|
||||||
|
1. [](#new)
|
||||||
|
* Added support for `process.redirect: @self-admin` ([issue #13](https://github.com/bleutzinn/grav-plugin-add-page-by-form/issues/31))
|
||||||
|
1. [](#improved)
|
||||||
|
* Fixed a problem with uploading files
|
||||||
|
|
||||||
|
# v2.1.0
|
||||||
|
## 09/18/2017
|
||||||
|
|
||||||
|
1. [](#new)
|
||||||
|
* Added support for taxonomy types and tags
|
||||||
|
|
||||||
|
# v2.0.0
|
||||||
|
## 06/18/2017
|
||||||
|
|
||||||
|
1. [](#new)
|
||||||
|
* Added support for multiple textarea editors ([issue #21](https://github.com/bleutzinn/grav-plugin-add-page-by-form/issues/21))
|
||||||
|
* Added support for `process.redirect: @self` ([issue #23](https://github.com/bleutzinn/grav-plugin-add-page-by-form/issues/23))
|
||||||
|
* Added the `overwrite_mode` configuration frontmatter variable
|
||||||
|
* Added the `subroute` configuration frontmatter variable
|
||||||
|
* Added the `slug_field` configuration frontmatter variable
|
||||||
|
* Added filename sanitizing of uploaded files
|
||||||
|
1. [](#improved)
|
||||||
|
* In the form page frontmatter configuration variables are separated from variables which main purpose it is to get passed on to the new page
|
||||||
|
* Uploaded file properties are now included in the new page frontmatter
|
||||||
|
* Improved safe slug generator
|
||||||
|
* Removed "use editor" option from `blueprints.yaml` (to allow [issue #21](https://github.com/bleutzinn/grav-plugin-add-page-by-form/issues/21))
|
||||||
|
* Extended `blueprints.yaml` to set "fallback" configuration values
|
||||||
|
1. [](#bugfix)
|
||||||
|
* Fixed an issue with form pages outside the web root ([issue #20](https://github.com/bleutzinn/grav-plugin-add-page-by-form/issues/20))
|
||||||
|
* Fixed a problem that prevented having different destinations for file uploads
|
||||||
|
|
||||||
|
# v1.4.2
|
||||||
|
## 03/22/2017
|
||||||
|
|
||||||
|
1. [](#new)
|
||||||
|
* Cleaned up code for release.
|
||||||
|
|
||||||
|
# v1.4.1
|
||||||
|
## 02/16/2017
|
||||||
|
|
||||||
|
1. [](#improved)
|
||||||
|
* Simplified YAML frontmatter formatting as suggested in
|
||||||
|
https://github.com/getgrav/grav/issues/1287#issuecomment-279965492
|
||||||
|
|
||||||
|
# v1.4.0
|
||||||
|
## 02/12/2017
|
||||||
|
|
||||||
|
1. [](#new)
|
||||||
|
* Added the ability to include the File field in the form. When `destination` is `@self` uploaded files are stored in the new page folder.
|
||||||
|
|
||||||
|
# v1.3.2
|
||||||
|
## 01/31/2017
|
||||||
|
|
||||||
|
1. [](#improved)
|
||||||
|
* Removed the spyc.php class dependency; the page creation and YAML frontmatter handling is now done "the Grav way".
|
||||||
|
|
||||||
|
# v1.3.1
|
||||||
|
## 01/15/2017
|
||||||
|
|
||||||
|
1. [](#improved)
|
||||||
|
* Added jQuery as an asset.
|
||||||
|
|
||||||
|
# v1.3.0
|
||||||
|
## 12/31/2016
|
||||||
|
|
||||||
|
1. [](#new)
|
||||||
|
* Added the SimpleMDE Markdown Editor.
|
||||||
|
|
||||||
|
# v1.2.2
|
||||||
|
## 12/29/2016
|
||||||
|
|
||||||
|
1. [](#improved)
|
||||||
|
* Removed note about the (previous) test release in the ReadMe.
|
||||||
|
|
||||||
|
# v1.2.1
|
||||||
|
## 12/29/2016
|
||||||
|
|
||||||
|
1. [](#improved)
|
||||||
|
* Improved the usage explanation in the ReadMe.
|
||||||
|
* Removed debug messages.
|
||||||
|
|
||||||
|
# v1.2.0
|
||||||
|
## 12/23/2016
|
||||||
|
|
||||||
|
1. [](#improved)
|
||||||
|
* Improved new page route handling.
|
||||||
|
|
||||||
|
# v1.1.1
|
||||||
|
## 11/17/2016
|
||||||
|
|
||||||
|
1. [](#improved)
|
||||||
|
* Removed dependency of PECL YAML function yaml_emit() in favor of using vendor/spyc.php class.
|
||||||
|
|
||||||
|
# v1.1.0
|
||||||
|
## 11/16/2016
|
||||||
|
|
||||||
|
1. [](#new)
|
||||||
|
* Settings in the pagefrontmatter block in the form page frontmatter now are merged with values from form fields. Form field values ovverride the pagefrontmatter settings.
|
||||||
|
|
||||||
|
# v1.0.0
|
||||||
|
## 11/15/2016
|
||||||
|
|
||||||
|
1. [](#new)
|
||||||
|
* Added an extra form field: 'author'
|
||||||
|
* Added copying an (optional) frontmatter block from the form page frontmatter to the newly added page's frontmatter
|
||||||
|
|
||||||
|
# v0.2.0
|
||||||
|
## 11/13/2016
|
||||||
|
|
||||||
|
1. [](#new)
|
||||||
|
* Plugin name changed to Add Page By Form (add-page-by-form)
|
||||||
|
* Added timestamp as date in page header (date format is taken from plugin config)
|
||||||
|
* Pages with identical titles are saved by adding a incremental number to the page slug (e.g. 'my-page\_2', 'my-page\_2', etc.)
|
||||||
|
* Added error handling
|
||||||
|
|
||||||
|
# v0.1.0
|
||||||
|
## 11/08/2016
|
||||||
|
|
||||||
|
1. [](#new)
|
||||||
|
* ChangeLog started...
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2016 Ron Wardenier
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -0,0 +1,444 @@
|
|||||||
|
# Add Page By Form Plugin
|
||||||
|
|
||||||
|
The **Add Page By Form** Plugin is for [Grav CMS](http://github.com/getgrav/grav). It allows users to add a new page by filling in a form.
|
||||||
|
|
||||||
|
This plugin uses the possibilities of [custom frontmatter](https://learn.getgrav.org/content/headers#custom-page-headers). By setting your own variables in the form page frontmatter a priori and optionally letting users override these variable values by filling in corresponding form fields you can transport these data into the new page frontmatter.
|
||||||
|
|
||||||
|
The passing on of both the default settings and form field values entered by the end user to the new page frontmatter makes for an extremely configurable solution.
|
||||||
|
By mixing default settings and configuring the page form you can to a large extent control the appearence and behaviour of the newly added page by using the frontmatter variables present in the new page in a Twig template.
|
||||||
|
|
||||||
|
For example, a new page can act as a new blog post simply by setting the appropriate template variable in the form page definition (with the AntiMatter theme, this is `template: item`). That template value is inserted in the new page frontmatter and, so, will be used by Grav to display the new page.
|
||||||
|
|
||||||
|
|
||||||
|
## Security Warning
|
||||||
|
|
||||||
|
Allowing anonymous visitors to create pages is a potential website security risk. It is **strongly advised** to use the [Grav Login Plugin](https://github.com/getgrav/grav-plugin-login) or the [Private Grav Plugin](https://github.com/Diyzzuf/grav-plugin-private) **to restrict the page creation to logged in users only**.
|
||||||
|
|
||||||
|
This plugin itself does not provide any security measures. Please take this in consideration before using this plugin.
|
||||||
|
|
||||||
|
|
||||||
|
## Installation and Configuration
|
||||||
|
|
||||||
|
Typically the plugin should be installed via [GPM](http://learn.getgrav.org/advanced/grav-gpm) (Grav Package Manager):
|
||||||
|
|
||||||
|
```
|
||||||
|
$ bin/gpm install add-page-by-form
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively it can be installed via the [Admin Plugin](http://learn.getgrav.org/admin-panel/plugins).
|
||||||
|
|
||||||
|
Another option is to manualy install the plugin by [downloading](https://github.com/bleutzinn/grav-plugin-add-page-by-form/archive/master.zip) the plugin as a zip file. Copy the zip file to your `/user/plugins` directory, unzip it there and rename the folder to `add-page-by-form`.
|
||||||
|
|
||||||
|
### Configuration Defaults
|
||||||
|
|
||||||
|
Here is the default configuration in the configuration file `add-page-by-form.yaml` plus an explanation of the settings:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
enabled: true
|
||||||
|
date_display_format: 'd-m-Y g:ia'
|
||||||
|
default_title: 'My New Page'
|
||||||
|
default_content: 'No content.'
|
||||||
|
overwrite_mode: false
|
||||||
|
include_username: false
|
||||||
|
auto_taxonomy_types: false
|
||||||
|
use_editor_class: true
|
||||||
|
physical_template_name: true
|
||||||
|
```
|
||||||
|
- `enabled` determines whether the plugin is active or not;
|
||||||
|
- `date_display_format` sets a default date and time format;
|
||||||
|
- `default_title` will be used as a fallback for the new page title when no other value is set;
|
||||||
|
|
||||||
|
- `default_content` will be used as the page content for the new page when no other value is set;
|
||||||
|
- `include_username` sets whether or not the username of the currently logged in frontend user is included in the new page frontmatter;
|
||||||
|
- `overwrite_mode` determines how to act when a page with the same name or slug already exists;
|
||||||
|
- `auto_taxonomy_types` saves any new taxonomy types that were input by the user to the site configuration file `site.yaml`;
|
||||||
|
- `use_editor_class` determines whether or not to change a textarea field into a Markdown editor when the texture field includes the class "editor" (`classes: editor`);
|
||||||
|
- `physical_template_name` should normally not be used. For more information see the description in the section 'pageconfig' block variables.
|
||||||
|
|
||||||
|
|
||||||
|
### Customizing the default configuration
|
||||||
|
|
||||||
|
To keep your custom configuration when updating the plugin you need to use a configuration file which is stored in the `user/config/plugins` folder.
|
||||||
|
|
||||||
|
Simply edit the plugin options in the Admin panel and the changes will be saved to the configuration file in that location. If you don't use the Admin panel, copy the `add-page-by-form.yaml` default file to your `user/config/plugins` folder and use that copy to change configuration settings.
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Using this plugin requires:
|
||||||
|
|
||||||
|
- a normal page containing a Grav Form with a unique name that starts with "add_page";
|
||||||
|
- optionally, but required for usefulness, one or two blocks of extra page frontmatter variables in that page being:
|
||||||
|
- a 'pageconfig' block with variables that are used in the new page creation process;
|
||||||
|
- a 'pagefrontmatter' block with variables that are passed on to the new page frontmatter and can be processed by Twig along the way.
|
||||||
|
|
||||||
|
### Modifying frontmatter variables
|
||||||
|
|
||||||
|
Every frontmatter variable value can be changed by the user when an input field with the same name as the variable is included in the form.
|
||||||
|
|
||||||
|
The basic method of modifying is overriding or replacing an initial value. An extreme case of overriding a variable which is quite uncommon but illustrates the process well:
|
||||||
|
|
||||||
|
1. `overwrite_mode` is set in `add-page-by-form.yaml`
|
||||||
|
2. and can be changed in the Plugin configuration in the Admin Panel
|
||||||
|
3. can be set in the `pageconfig` block
|
||||||
|
4. and finally may be changed again by the end user when the form contains an `overwrite_mode` field.
|
||||||
|
|
||||||
|
### Page Headers / Frontmatter
|
||||||
|
This plugin makes extensive use of [Custom Page Headers](https://learn.getgrav.org/content/headers#custom-page-headers). Unfortunately the Grav documentation mixes the terms "frontmatter", "page headers" and simply "headers". This may be confusing at first. They [all](https://learn.getgrav.org/content/headers) refer to the optional top part of a Grav page which contains data in [YAML syntax](https://learn.getgrav.org/advanced/yaml).
|
||||||
|
|
||||||
|
|
||||||
|
## Form page Frontmatter
|
||||||
|
|
||||||
|
The frontmatter in the form page and the way it is handled by the plugin is where the flexibility of this plugin originates.
|
||||||
|
|
||||||
|
The form page frontmatter is divided into three sections or blocks:
|
||||||
|
|
||||||
|
1. So called 'root level' variables are intended to act upon the form page itself. They are not passed on to the new page;
|
||||||
|
2. the `pageconfig` block contains variables that are used by the plugin in the new page creation process and do get passed on to the new page frontmatter;
|
||||||
|
3. the `pagefrontmatter` block holds all other variables that must be passed on to the new page frontmatter.
|
||||||
|
|
||||||
|
### Root level variables
|
||||||
|
|
||||||
|
In the examples above the root level configuration options are:
|
||||||
|
|
||||||
|
- `title` sets the title of the page containing the form;
|
||||||
|
- `template: form` activates the form on this page (not required when the form page is named `form.md`);
|
||||||
|
- `form` defines the form.
|
||||||
|
|
||||||
|
From version 2, the use of `parent` in the, what is now called, root level block is deprecated. It is however still supported for backwards compatibility.
|
||||||
|
|
||||||
|
### 'pageconfig' block variables
|
||||||
|
|
||||||
|
In the optional pageconfig block you can set these, and only these, variables (other variables will be ignored):
|
||||||
|
|
||||||
|
- `parent` sets the parent page for the new page. This variable may be an absolute route (for example `parent: /user_contributions`) or a relative route (e.g. `parent: articles`. In case of an absolute route this route starts from the pages root. A relative route is regarded to start from the form page, so the new page will be a child page of the form page. The form page is also used as the parent page when the set parent page does not exist;
|
||||||
|
- `subroute` defines a route from the (initial) parent value. If one or more folders in the route do not exist they will be created;
|
||||||
|
- `slug_field` tells the plugin what field or fields to use as the new page's slug or folder name. Multiple form field names may be specified either using a comma separated string or as an array. When `slug_field` is missing the plugin tries to use the value of `title`;
|
||||||
|
- `overwrite_mode: true|false|edit` (default `false`) tells the plugin what to do when a page with the same name already exists. With `overwrite_mode: true` the existing page is overwritten. Any additional (media) files besides the page itself which are stored in the existing page folder are deleted as well. With `overwite_mode: false` the new page slug gets a sequential number attached at the end (for example "my-new-page-1" in case "my-new-page" exists).
|
||||||
|
Using `overwite_mode: edit` allows for the page being saved to it's existing folder respecting any already present uploaded files;
|
||||||
|
- `include_username: true|false` (default `false`) determines whether or not to include the username of a logged in frontend user in the new page frontmatter;
|
||||||
|
- `physical_template_name: true|false` (default `true`) does or does not cause the plugin to use the template name of the new page as that new page's filesystem filename. Defaults to "default" when no template is set in the 'pagefrontmatter' block. When set to `true` to avoid future confusion the frontmatter variable `template` is removed from the new page frontmatter.
|
||||||
|
|
||||||
|
#### A note on parent and subroute
|
||||||
|
|
||||||
|
Together the variables `parent` and `subroute` define the new page's destination. Or, in other words, together they set the path or route of the new page filesystem folder in the page structure.
|
||||||
|
|
||||||
|
The difference between parent and subroute worded in another way:
|
||||||
|
|
||||||
|
- Parent: works on a page level; when there is no page at the parent route, the form page is used as the parent;
|
||||||
|
- Subroute: works on a folder level; a subroute may consist of empty folders and if a folder in the subroute does not exist it gets created.
|
||||||
|
|
||||||
|
### 'pagefrontmatter' block variables
|
||||||
|
|
||||||
|
The content of the optional `pagefrontmatter` block will be included in the new page frontmatter.
|
||||||
|
|
||||||
|
|
||||||
|
## Form usage
|
||||||
|
|
||||||
|
The form page needs to use a [simple single form](https://learn.getgrav.org/forms/forms#create-a-simple-single-form).
|
||||||
|
|
||||||
|
Two examples are included at the end of this ReadMe file.
|
||||||
|
|
||||||
|
### Mandatory fields and values
|
||||||
|
|
||||||
|
#### Form Name
|
||||||
|
It is always a good thing to give each form a unique name, especially when multiple forms are used.
|
||||||
|
|
||||||
|
To pre fill form fields with default values the Form name must include the string "add_page". Valid names are for example `add_page.blogpost`, `add_page_profile`.
|
||||||
|
|
||||||
|
###Form Actions
|
||||||
|
|
||||||
|
**Custom Form processing** ( Important ! )
|
||||||
|
|
||||||
|
To let the plugin process the form after a Submit a custom process action must be set like so:
|
||||||
|
|
||||||
|
```
|
||||||
|
process:
|
||||||
|
-
|
||||||
|
add_page: true
|
||||||
|
```
|
||||||
|
|
||||||
|
**Redirect to the new page**
|
||||||
|
|
||||||
|
|
||||||
|
To show the new page to the user set the `redirect` action to the custom value `@self` or `@self-admin`.
|
||||||
|
|
||||||
|
When using `redirect: '@self'` the page will be shown as a regular web page, for example:
|
||||||
|
|
||||||
|
```
|
||||||
|
process:
|
||||||
|
-
|
||||||
|
add_page: true
|
||||||
|
-
|
||||||
|
redirect: '@self'
|
||||||
|
```
|
||||||
|
|
||||||
|
To open the new page in the Admin panel use `redirect: '@self-admin'`.
|
||||||
|
Note that this plugin does not handle the admin user authentication. If the Admin plugin is not installed or is inactive redirection occurs as if `@self` was used.
|
||||||
|
|
||||||
|
> Tip: using `@self-admin` is a very convenient way to learn how to use this plugin as it is easy to view and examine the source of the resulting new page including it's frontmatter in the Admin panel.
|
||||||
|
|
||||||
|
### Using a Markdown editor in textarea fields
|
||||||
|
When a `textarea` field is given the class `editor` it will use the [SimpleMDE Markdown Editor](https://simplemde.com).
|
||||||
|
|
||||||
|
|
||||||
|
## Value overrides
|
||||||
|
|
||||||
|
The variables which are defined and given a value in the `pageconfig` and `pagefrontmatter` blocks may be 'overridden' or in other words replaced by form input fields. In that respect these variables can be seen to hold a set of default values.
|
||||||
|
|
||||||
|
There is only one exception to the default variable override behaviour and that is the handling of `taxonomy` types. Extra taxonomy types and values (for example tags) which are entered via form fields are added to the new page taxonomy.
|
||||||
|
|
||||||
|
To override a default value by user input is simply a matter of including a form field by the same name in the page form.
|
||||||
|
For example in the example 2 - _create a new blog post_, the default title is set to "My new Blog post". The form contains a form field of type text with `name: title`. Thus the user is prompted to enter a title for the new page in the form but does not need to do so because filling in the title field is not mandatory. If the user enters a title that value is used as the title for the new page. If he or she does not, the default title "My new Blog post" will be used.
|
||||||
|
|
||||||
|
|
||||||
|
## Setting taxonomy categories and tags
|
||||||
|
|
||||||
|
The Add Blog Post example shows how to let the user add extra tags via the form.
|
||||||
|
Extra categories may be added in the same way.
|
||||||
|
|
||||||
|
|
||||||
|
## Handling extra taxonomy types
|
||||||
|
|
||||||
|
By default Grav 'knows' two taxonomy types, `category` and `tag`. Extra taxonomy types may be defined and added just like with any other variables you can include a form field. The new type is then added to the list of taxonomy types instead of replacing the existing types.
|
||||||
|
|
||||||
|
This can be done in the `pagefrontmatter` block. For example, to define a new taxonomy type named 'department':
|
||||||
|
|
||||||
|
```
|
||||||
|
pagefrontmatter:
|
||||||
|
taxonomy:
|
||||||
|
- department
|
||||||
|
```
|
||||||
|
And/or in the form:
|
||||||
|
|
||||||
|
```
|
||||||
|
form:
|
||||||
|
name: my_form
|
||||||
|
fields:
|
||||||
|
-
|
||||||
|
name: taxonomy
|
||||||
|
label: Taxonomy type
|
||||||
|
type: text
|
||||||
|
```
|
||||||
|
|
||||||
|
This is a feature which calls for a solid look-before-you-leap approach because of it's side effects. Using a new taxonomy type requires it to be included in the list of known taxonomy types. This list is in the site configuration file `site.yaml`.
|
||||||
|
|
||||||
|
By setting the plugin configuration option `auto_taxonomy_types: true` new types get automatically saved and can then be used in a collection.
|
||||||
|
|
||||||
|
The side effect and possibly downside is that every modification of the site configuration file causes Grav to rebuild the cache, so this may not be desirable with larger sites.
|
||||||
|
Use with caution!
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
The least error prone way to test and play with the examples is to set up a fresh Grav site and using it's default theme Antimatter.
|
||||||
|
|
||||||
|
### Form page example 1: create a normal page
|
||||||
|
|
||||||
|
The goal of this example is to show how to let a user create a new page where uploaded images and files are saved along the page (in the same folder). After the user clicked Submit he or she will be shown the new page.
|
||||||
|
|
||||||
|
Suppose this minimal Grav website structure in `user/pages/`:
|
||||||
|
|
||||||
|
```
|
||||||
|
03.submit-assignment/
|
||||||
|
default.md
|
||||||
|
04.assignments/
|
||||||
|
cmpt363-e100/
|
||||||
|
default.md
|
||||||
|
drafts/
|
||||||
|
modular.md
|
||||||
|
reviewed/
|
||||||
|
modular.md
|
||||||
|
```
|
||||||
|
|
||||||
|
BTW both modular pages are not required but are mentioned as they could be used to display a collection of draft and reviewed assignments.
|
||||||
|
|
||||||
|
Then the 'Submit assignment for review' page (with slug `submit-assignment`) full content (both frontmatter and content) could look like:
|
||||||
|
|
||||||
|
```
|
||||||
|
---
|
||||||
|
routable: true
|
||||||
|
title: 'Submit assignment for review'
|
||||||
|
template: form
|
||||||
|
visible: true
|
||||||
|
pageconfig:
|
||||||
|
parent: /submitted-assignments/cmpt363-e100/drafts
|
||||||
|
pagefrontmatter:
|
||||||
|
visible: true
|
||||||
|
status: draft
|
||||||
|
template: default
|
||||||
|
course:
|
||||||
|
assignment: 'CMPT363 E100'
|
||||||
|
instructor:
|
||||||
|
name: 'Jane Doe'
|
||||||
|
form:
|
||||||
|
name: addpage-assignment-cmpt363-e100
|
||||||
|
fields:
|
||||||
|
-
|
||||||
|
name: name
|
||||||
|
label: Name
|
||||||
|
type: text
|
||||||
|
validate:
|
||||||
|
required: true
|
||||||
|
-
|
||||||
|
name: title
|
||||||
|
label: Title
|
||||||
|
type: text
|
||||||
|
validate:
|
||||||
|
required: true
|
||||||
|
-
|
||||||
|
name: content
|
||||||
|
label: 'Assignment text'
|
||||||
|
type: textarea
|
||||||
|
size: long
|
||||||
|
classes: editor
|
||||||
|
validate:
|
||||||
|
required: true
|
||||||
|
-
|
||||||
|
name: attachments
|
||||||
|
label: 'Attachment (PDF only)'
|
||||||
|
type: file
|
||||||
|
multiple: true
|
||||||
|
accept:
|
||||||
|
- application/pdf
|
||||||
|
validate:
|
||||||
|
required: false
|
||||||
|
-
|
||||||
|
name: honeypot
|
||||||
|
type: honeypot
|
||||||
|
buttons:
|
||||||
|
-
|
||||||
|
type: submit
|
||||||
|
value: Submit
|
||||||
|
process:
|
||||||
|
-
|
||||||
|
addpage: null
|
||||||
|
-
|
||||||
|
redirect: '@self'
|
||||||
|
---
|
||||||
|
|
||||||
|
Please write your assignment and attach any images and/or files.
|
||||||
|
```
|
||||||
|
|
||||||
|
Supposing the user has not changed the pre filled title field, has entered his name "Paul Walker", has entered a simple "q.e.d." as the assignment content and uploaded one PDF document, then the full new page will be:
|
||||||
|
|
||||||
|
```
|
||||||
|
---
|
||||||
|
visible: true
|
||||||
|
status: draft
|
||||||
|
course:
|
||||||
|
assignment: 'CMPT363 E100'
|
||||||
|
instructor:
|
||||||
|
name: 'Jane Doe'
|
||||||
|
name: 'Paul Walker'
|
||||||
|
title: 'CMPT363 E100'
|
||||||
|
attachments:
|
||||||
|
/Users/rwgc/devroot/repos/grav-test/htdocs/user/pages/assignments/cmpt363-e100/drafts/cmpt363-e100-1/scrum-guide-sept-2013.pdf
|
||||||
|
name: scrum-guide-sept-2013.pdf
|
||||||
|
type: application/pdf
|
||||||
|
size: 273 KB
|
||||||
|
path: /Users/rwgc/devroot/repos/grav-test/htdocs/user/pages/assignments/cmpt363-e100/drafts/cmpt363-e100-1/scrum-guide-sept-2013.pdf
|
||||||
|
---
|
||||||
|
|
||||||
|
q.e.d.
|
||||||
|
```
|
||||||
|
|
||||||
|
On the file system level the file structure will be:
|
||||||
|
|
||||||
|
```
|
||||||
|
01.home/
|
||||||
|
default.md
|
||||||
|
02.add-new-article/
|
||||||
|
default.md
|
||||||
|
03.assignments/
|
||||||
|
cmpt363-e100/
|
||||||
|
default.md
|
||||||
|
drafts/
|
||||||
|
cmpt363-e100-1/
|
||||||
|
default.md
|
||||||
|
scrum-guide-sept-2013.pdf
|
||||||
|
modular.md
|
||||||
|
reviewed/
|
||||||
|
modular.md
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Form page example 2: create a blog post
|
||||||
|
|
||||||
|
In this example the user can add a blog post. To ensure the new page will be treated as a blog post simply set the `template` variable to be used by the new page to `item`. BTW the active theme must include the corresponding template `item.html.twig`. This is why it is best to start with Grav's default theme Antimatter.
|
||||||
|
|
||||||
|
```
|
||||||
|
---
|
||||||
|
title: 'Add Blog Post'
|
||||||
|
template: form
|
||||||
|
pageconfig:
|
||||||
|
parent: '/blog'
|
||||||
|
include_username: true
|
||||||
|
overwrite_mode: true
|
||||||
|
pagefrontmatter:
|
||||||
|
template: item
|
||||||
|
title: My new Blog post
|
||||||
|
taxonomy:
|
||||||
|
category: blog
|
||||||
|
tag: [journal, guest]
|
||||||
|
form:
|
||||||
|
name: add_page.blogpost
|
||||||
|
fields:
|
||||||
|
-
|
||||||
|
name: author
|
||||||
|
label: 'Author'
|
||||||
|
type: text
|
||||||
|
-
|
||||||
|
name: title
|
||||||
|
label: 'Post Title'
|
||||||
|
type: text
|
||||||
|
-
|
||||||
|
name: taxonomy.tag
|
||||||
|
label: 'Tags (comma separated)'
|
||||||
|
type: text
|
||||||
|
-
|
||||||
|
name: content
|
||||||
|
label: 'Post Content'
|
||||||
|
type: textarea
|
||||||
|
size: long
|
||||||
|
classes: editor
|
||||||
|
-
|
||||||
|
name: images
|
||||||
|
label: 'Images to upload'
|
||||||
|
type: file
|
||||||
|
multiple: true
|
||||||
|
accept:
|
||||||
|
- 'image/*'
|
||||||
|
-
|
||||||
|
name: honeypot
|
||||||
|
type: honeypot
|
||||||
|
buttons:
|
||||||
|
-
|
||||||
|
type: submit
|
||||||
|
value: Submit
|
||||||
|
process:
|
||||||
|
-
|
||||||
|
add_page: true
|
||||||
|
-
|
||||||
|
redirect: '/blog'
|
||||||
|
---
|
||||||
|
|
||||||
|
## New Blog Post
|
||||||
|
|
||||||
|
Write your blog post:
|
||||||
|
```
|
||||||
|
After the form has been submitted the user is taken to the blog main page where the new post should show up.
|
||||||
|
|
||||||
|
|
||||||
|
## Issues
|
||||||
|
|
||||||
|
|
||||||
|
### Grav Form issue
|
||||||
|
|
||||||
|
The form on the form page is a standard Grav form. Please note that the Grav Form Plugin currently (latest test using version 4.0.1) has an issue which prevents the form to be submitted when a form field of type `file` is set to `required: true`(see issue [#106](https://github.com/getgrav/grav-plugin-form/issues/106)).
|
||||||
|
|
||||||
|
|
||||||
|
## Credits
|
||||||
|
|
||||||
|
- Team Grav and everyone who contributes to Grav;
|
||||||
|
- Wes Cossick for [SimpleMDE Markdown Editor](https://simplemde.com);
|
||||||
|
- All [contributors](https://github.com/bleutzinn/grav-plugin-add-page-by-form/graphs/contributors) who've helped me out on things.
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
enabled: true
|
||||||
|
date_display_format: 'd-m-Y H:i'
|
||||||
|
default_title: 'My New Page'
|
||||||
|
default_content: 'No content.'
|
||||||
|
overwrite_mode: false
|
||||||
|
include_username: false
|
||||||
|
auto_taxonomy_types: false
|
||||||
|
use_editor_class: true
|
||||||
|
physical_template_name: true
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
.editor-toolbar a.active, .editor-toolbar a:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror, .CodeMirror-scroll {
|
||||||
|
min-height: 70px;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
$(function () {
|
||||||
|
$(".editor").each(function(){
|
||||||
|
var simplemde = new SimpleMDE({
|
||||||
|
element: this,
|
||||||
|
forceSync: true,
|
||||||
|
hideIcons: ["side-by-side", "fullscreen"],
|
||||||
|
spellChecker: false,
|
||||||
|
toolbar: ["bold", "italic", "heading", "|",
|
||||||
|
"quote", "unordered-list", "ordered-list", "|",
|
||||||
|
"link", "table", "|",
|
||||||
|
"undo", "redo", "|",
|
||||||
|
"preview", "guide"
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
name: Add Page By Form
|
||||||
|
version: 3.3.0
|
||||||
|
description: Adds a page by means of a form
|
||||||
|
icon: plus-square-o
|
||||||
|
author:
|
||||||
|
name: Ron Wardenier
|
||||||
|
email: ron@wardenier.com
|
||||||
|
homepage: https://github.com/bleutzinn/grav-plugin-add-page-by-form
|
||||||
|
keywords: grav, plugin, page, form, frontmatter
|
||||||
|
bugs: https://github.com/bleutzinn/grav-plugin-add-page-by-form/issues
|
||||||
|
docs: https://github.com/bleutzinn/grav-plugin-add-page-by-form/blob/master/README.md
|
||||||
|
license: MIT
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- { name: grav, version: '>=1.6.0' }
|
||||||
|
|
||||||
|
form:
|
||||||
|
validation: strict
|
||||||
|
fields:
|
||||||
|
enabled:
|
||||||
|
type: toggle
|
||||||
|
label: Plugin status
|
||||||
|
highlight: 1
|
||||||
|
default: 0
|
||||||
|
options:
|
||||||
|
1: Enabled
|
||||||
|
0: Disabled
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
default_title:
|
||||||
|
type: text
|
||||||
|
size: large
|
||||||
|
label: Default Page Title
|
||||||
|
help: Will be used for the new page folder name when no other value is set
|
||||||
|
default_content:
|
||||||
|
type: text
|
||||||
|
size: large
|
||||||
|
label: Default Page Content
|
||||||
|
help: Will be used as the page content for the new page when no other value is set
|
||||||
|
include_username:
|
||||||
|
type: toggle
|
||||||
|
label: Include username
|
||||||
|
help: Include the logged in user username in the new page frontmatter
|
||||||
|
highlight: 0
|
||||||
|
default: 0
|
||||||
|
options:
|
||||||
|
1: Enabled
|
||||||
|
0: Disabled
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
overwrite_mode:
|
||||||
|
type: select
|
||||||
|
label: Overwrite mode
|
||||||
|
help: Overwrite existing page
|
||||||
|
highlight: 0
|
||||||
|
default: false
|
||||||
|
options:
|
||||||
|
0: Disabled
|
||||||
|
1: Enabled
|
||||||
|
edit: Edit
|
||||||
|
auto_taxonomy_types:
|
||||||
|
type: toggle
|
||||||
|
label: Add new taxonomy types
|
||||||
|
help: Automatically add new taxonomy types to site configuration. May have performance impact on large sites.
|
||||||
|
highlight: 0
|
||||||
|
default: 0
|
||||||
|
options:
|
||||||
|
1: Enabled
|
||||||
|
0: Disabled
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
use_editor_class:
|
||||||
|
type: toggle
|
||||||
|
label: Use the editor class
|
||||||
|
help: When set, adding class=editor to a textarea provides the simpleMDE editor on that area
|
||||||
|
highlight: 1
|
||||||
|
default: 1
|
||||||
|
options:
|
||||||
|
1: Enabled
|
||||||
|
0: Disabled
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
date_display_format:
|
||||||
|
type: select
|
||||||
|
size: medium
|
||||||
|
classes: fancy
|
||||||
|
label: Date Format
|
||||||
|
default: 'd-m-Y H:i'
|
||||||
|
options:
|
||||||
|
'F jS Y': "February 1st 2014"
|
||||||
|
'l jS of F': "Saturday 1st of February"
|
||||||
|
'D, m M Y': "Sat, 01 Feb 2014"
|
||||||
|
'd-m-y': "01-02-14"
|
||||||
|
'd-m-Y': "01-02-2014"
|
||||||
|
'jS M Y': "1st Feb 2014"
|
||||||
|
'F Y': "Feb 2014"
|
||||||
|
'Y-m-d': "2014-02-01"
|
||||||
|
'd-m-Y H:i': "01-02-2014 09:30"
|
||||||
|
physical_template_name:
|
||||||
|
type: toggle
|
||||||
|
label: Physical template name
|
||||||
|
help: Use the template name in the filename of the new page
|
||||||
|
highlight: 1
|
||||||
|
default: 1
|
||||||
|
options:
|
||||||
|
1: Enabled
|
||||||
|
0: Disabled
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"name": "bleutzinn/grav-plugin-add-page-by-form",
|
||||||
|
"type": "grav-plugin",
|
||||||
|
"description": "Adds a page by means of a form",
|
||||||
|
"keywords": ["grav", "plugin", "page", "form", "frontmatter"],
|
||||||
|
"homepage": "https://github.com/bleutzinn/grav-plugin-add-page-by-form",
|
||||||
|
"license": "MIT",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Ron Wardenier",
|
||||||
|
"email": "bleutzinn@rwgc.nl",
|
||||||
|
"role": "Developer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/bleutzinn/grav-plugin-add-page-by-form/issues",
|
||||||
|
"docs": "https://github.com/bleutzinn/grav-plugin-add-page-by-form/blob/master/README.md"
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.1.3"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Grav\\Plugin\\AddPageByFormPlugin\\": "classes/"
|
||||||
|
},
|
||||||
|
"classmap": [
|
||||||
|
"add-page-by-form.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"platform": {
|
||||||
|
"php": "7.1.3"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"_readme": [
|
||||||
|
"This file locks the dependencies of your project to a known state",
|
||||||
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
|
"This file is @generated automatically"
|
||||||
|
],
|
||||||
|
"content-hash": "3d1383f8c010e20d78cbeeba97140c36",
|
||||||
|
"packages": [],
|
||||||
|
"packages-dev": [],
|
||||||
|
"aliases": [],
|
||||||
|
"minimum-stability": "stable",
|
||||||
|
"stability-flags": [],
|
||||||
|
"prefer-stable": false,
|
||||||
|
"prefer-lowest": false,
|
||||||
|
"platform": {
|
||||||
|
"php": ">=7.1.3"
|
||||||
|
},
|
||||||
|
"platform-dev": [],
|
||||||
|
"platform-overrides": {
|
||||||
|
"php": "7.1.3"
|
||||||
|
},
|
||||||
|
"plugin-api-version": "2.2.0"
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// autoload.php @generated by Composer
|
||||||
|
|
||||||
|
require_once __DIR__ . '/composer/autoload_real.php';
|
||||||
|
|
||||||
|
return ComposerAutoloaderInit0206cd2f5513395c6d5551a767d5c39f::getLoader();
|
||||||
@@ -0,0 +1,572 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Composer.
|
||||||
|
*
|
||||||
|
* (c) Nils Adermann <naderman@naderman.de>
|
||||||
|
* Jordi Boggiano <j.boggiano@seld.be>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Composer\Autoload;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
||||||
|
*
|
||||||
|
* $loader = new \Composer\Autoload\ClassLoader();
|
||||||
|
*
|
||||||
|
* // register classes with namespaces
|
||||||
|
* $loader->add('Symfony\Component', __DIR__.'/component');
|
||||||
|
* $loader->add('Symfony', __DIR__.'/framework');
|
||||||
|
*
|
||||||
|
* // activate the autoloader
|
||||||
|
* $loader->register();
|
||||||
|
*
|
||||||
|
* // to enable searching the include path (eg. for PEAR packages)
|
||||||
|
* $loader->setUseIncludePath(true);
|
||||||
|
*
|
||||||
|
* In this example, if you try to use a class in the Symfony\Component
|
||||||
|
* namespace or one of its children (Symfony\Component\Console for instance),
|
||||||
|
* the autoloader will first look for the class under the component/
|
||||||
|
* directory, and it will then fallback to the framework/ directory if not
|
||||||
|
* found before giving up.
|
||||||
|
*
|
||||||
|
* This class is loosely based on the Symfony UniversalClassLoader.
|
||||||
|
*
|
||||||
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
|
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||||
|
* @see https://www.php-fig.org/psr/psr-0/
|
||||||
|
* @see https://www.php-fig.org/psr/psr-4/
|
||||||
|
*/
|
||||||
|
class ClassLoader
|
||||||
|
{
|
||||||
|
/** @var ?string */
|
||||||
|
private $vendorDir;
|
||||||
|
|
||||||
|
// PSR-4
|
||||||
|
/**
|
||||||
|
* @var array[]
|
||||||
|
* @psalm-var array<string, array<string, int>>
|
||||||
|
*/
|
||||||
|
private $prefixLengthsPsr4 = array();
|
||||||
|
/**
|
||||||
|
* @var array[]
|
||||||
|
* @psalm-var array<string, array<int, string>>
|
||||||
|
*/
|
||||||
|
private $prefixDirsPsr4 = array();
|
||||||
|
/**
|
||||||
|
* @var array[]
|
||||||
|
* @psalm-var array<string, string>
|
||||||
|
*/
|
||||||
|
private $fallbackDirsPsr4 = array();
|
||||||
|
|
||||||
|
// PSR-0
|
||||||
|
/**
|
||||||
|
* @var array[]
|
||||||
|
* @psalm-var array<string, array<string, string[]>>
|
||||||
|
*/
|
||||||
|
private $prefixesPsr0 = array();
|
||||||
|
/**
|
||||||
|
* @var array[]
|
||||||
|
* @psalm-var array<string, string>
|
||||||
|
*/
|
||||||
|
private $fallbackDirsPsr0 = array();
|
||||||
|
|
||||||
|
/** @var bool */
|
||||||
|
private $useIncludePath = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string[]
|
||||||
|
* @psalm-var array<string, string>
|
||||||
|
*/
|
||||||
|
private $classMap = array();
|
||||||
|
|
||||||
|
/** @var bool */
|
||||||
|
private $classMapAuthoritative = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var bool[]
|
||||||
|
* @psalm-var array<string, bool>
|
||||||
|
*/
|
||||||
|
private $missingClasses = array();
|
||||||
|
|
||||||
|
/** @var ?string */
|
||||||
|
private $apcuPrefix;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var self[]
|
||||||
|
*/
|
||||||
|
private static $registeredLoaders = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ?string $vendorDir
|
||||||
|
*/
|
||||||
|
public function __construct($vendorDir = null)
|
||||||
|
{
|
||||||
|
$this->vendorDir = $vendorDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string[]
|
||||||
|
*/
|
||||||
|
public function getPrefixes()
|
||||||
|
{
|
||||||
|
if (!empty($this->prefixesPsr0)) {
|
||||||
|
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
||||||
|
}
|
||||||
|
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array[]
|
||||||
|
* @psalm-return array<string, array<int, string>>
|
||||||
|
*/
|
||||||
|
public function getPrefixesPsr4()
|
||||||
|
{
|
||||||
|
return $this->prefixDirsPsr4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array[]
|
||||||
|
* @psalm-return array<string, string>
|
||||||
|
*/
|
||||||
|
public function getFallbackDirs()
|
||||||
|
{
|
||||||
|
return $this->fallbackDirsPsr0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array[]
|
||||||
|
* @psalm-return array<string, string>
|
||||||
|
*/
|
||||||
|
public function getFallbackDirsPsr4()
|
||||||
|
{
|
||||||
|
return $this->fallbackDirsPsr4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string[] Array of classname => path
|
||||||
|
* @psalm-return array<string, string>
|
||||||
|
*/
|
||||||
|
public function getClassMap()
|
||||||
|
{
|
||||||
|
return $this->classMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string[] $classMap Class to filename map
|
||||||
|
* @psalm-param array<string, string> $classMap
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function addClassMap(array $classMap)
|
||||||
|
{
|
||||||
|
if ($this->classMap) {
|
||||||
|
$this->classMap = array_merge($this->classMap, $classMap);
|
||||||
|
} else {
|
||||||
|
$this->classMap = $classMap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a set of PSR-0 directories for a given prefix, either
|
||||||
|
* appending or prepending to the ones previously set for this prefix.
|
||||||
|
*
|
||||||
|
* @param string $prefix The prefix
|
||||||
|
* @param string[]|string $paths The PSR-0 root directories
|
||||||
|
* @param bool $prepend Whether to prepend the directories
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function add($prefix, $paths, $prepend = false)
|
||||||
|
{
|
||||||
|
if (!$prefix) {
|
||||||
|
if ($prepend) {
|
||||||
|
$this->fallbackDirsPsr0 = array_merge(
|
||||||
|
(array) $paths,
|
||||||
|
$this->fallbackDirsPsr0
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$this->fallbackDirsPsr0 = array_merge(
|
||||||
|
$this->fallbackDirsPsr0,
|
||||||
|
(array) $paths
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$first = $prefix[0];
|
||||||
|
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||||
|
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($prepend) {
|
||||||
|
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||||
|
(array) $paths,
|
||||||
|
$this->prefixesPsr0[$first][$prefix]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||||
|
$this->prefixesPsr0[$first][$prefix],
|
||||||
|
(array) $paths
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a set of PSR-4 directories for a given namespace, either
|
||||||
|
* appending or prepending to the ones previously set for this namespace.
|
||||||
|
*
|
||||||
|
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||||
|
* @param string[]|string $paths The PSR-4 base directories
|
||||||
|
* @param bool $prepend Whether to prepend the directories
|
||||||
|
*
|
||||||
|
* @throws \InvalidArgumentException
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function addPsr4($prefix, $paths, $prepend = false)
|
||||||
|
{
|
||||||
|
if (!$prefix) {
|
||||||
|
// Register directories for the root namespace.
|
||||||
|
if ($prepend) {
|
||||||
|
$this->fallbackDirsPsr4 = array_merge(
|
||||||
|
(array) $paths,
|
||||||
|
$this->fallbackDirsPsr4
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$this->fallbackDirsPsr4 = array_merge(
|
||||||
|
$this->fallbackDirsPsr4,
|
||||||
|
(array) $paths
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||||
|
// Register directories for a new namespace.
|
||||||
|
$length = strlen($prefix);
|
||||||
|
if ('\\' !== $prefix[$length - 1]) {
|
||||||
|
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||||
|
}
|
||||||
|
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||||
|
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||||
|
} elseif ($prepend) {
|
||||||
|
// Prepend directories for an already registered namespace.
|
||||||
|
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||||
|
(array) $paths,
|
||||||
|
$this->prefixDirsPsr4[$prefix]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// Append directories for an already registered namespace.
|
||||||
|
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||||
|
$this->prefixDirsPsr4[$prefix],
|
||||||
|
(array) $paths
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a set of PSR-0 directories for a given prefix,
|
||||||
|
* replacing any others previously set for this prefix.
|
||||||
|
*
|
||||||
|
* @param string $prefix The prefix
|
||||||
|
* @param string[]|string $paths The PSR-0 base directories
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function set($prefix, $paths)
|
||||||
|
{
|
||||||
|
if (!$prefix) {
|
||||||
|
$this->fallbackDirsPsr0 = (array) $paths;
|
||||||
|
} else {
|
||||||
|
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a set of PSR-4 directories for a given namespace,
|
||||||
|
* replacing any others previously set for this namespace.
|
||||||
|
*
|
||||||
|
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||||
|
* @param string[]|string $paths The PSR-4 base directories
|
||||||
|
*
|
||||||
|
* @throws \InvalidArgumentException
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setPsr4($prefix, $paths)
|
||||||
|
{
|
||||||
|
if (!$prefix) {
|
||||||
|
$this->fallbackDirsPsr4 = (array) $paths;
|
||||||
|
} else {
|
||||||
|
$length = strlen($prefix);
|
||||||
|
if ('\\' !== $prefix[$length - 1]) {
|
||||||
|
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||||
|
}
|
||||||
|
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||||
|
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turns on searching the include path for class files.
|
||||||
|
*
|
||||||
|
* @param bool $useIncludePath
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setUseIncludePath($useIncludePath)
|
||||||
|
{
|
||||||
|
$this->useIncludePath = $useIncludePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Can be used to check if the autoloader uses the include path to check
|
||||||
|
* for classes.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function getUseIncludePath()
|
||||||
|
{
|
||||||
|
return $this->useIncludePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turns off searching the prefix and fallback directories for classes
|
||||||
|
* that have not been registered with the class map.
|
||||||
|
*
|
||||||
|
* @param bool $classMapAuthoritative
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||||
|
{
|
||||||
|
$this->classMapAuthoritative = $classMapAuthoritative;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Should class lookup fail if not found in the current class map?
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isClassMapAuthoritative()
|
||||||
|
{
|
||||||
|
return $this->classMapAuthoritative;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||||
|
*
|
||||||
|
* @param string|null $apcuPrefix
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setApcuPrefix($apcuPrefix)
|
||||||
|
{
|
||||||
|
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The APCu prefix in use, or null if APCu caching is not enabled.
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
|
public function getApcuPrefix()
|
||||||
|
{
|
||||||
|
return $this->apcuPrefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers this instance as an autoloader.
|
||||||
|
*
|
||||||
|
* @param bool $prepend Whether to prepend the autoloader or not
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function register($prepend = false)
|
||||||
|
{
|
||||||
|
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||||
|
|
||||||
|
if (null === $this->vendorDir) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($prepend) {
|
||||||
|
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
||||||
|
} else {
|
||||||
|
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||||
|
self::$registeredLoaders[$this->vendorDir] = $this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unregisters this instance as an autoloader.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function unregister()
|
||||||
|
{
|
||||||
|
spl_autoload_unregister(array($this, 'loadClass'));
|
||||||
|
|
||||||
|
if (null !== $this->vendorDir) {
|
||||||
|
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads the given class or interface.
|
||||||
|
*
|
||||||
|
* @param string $class The name of the class
|
||||||
|
* @return true|null True if loaded, null otherwise
|
||||||
|
*/
|
||||||
|
public function loadClass($class)
|
||||||
|
{
|
||||||
|
if ($file = $this->findFile($class)) {
|
||||||
|
includeFile($file);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds the path to the file where the class is defined.
|
||||||
|
*
|
||||||
|
* @param string $class The name of the class
|
||||||
|
*
|
||||||
|
* @return string|false The path if found, false otherwise
|
||||||
|
*/
|
||||||
|
public function findFile($class)
|
||||||
|
{
|
||||||
|
// class map lookup
|
||||||
|
if (isset($this->classMap[$class])) {
|
||||||
|
return $this->classMap[$class];
|
||||||
|
}
|
||||||
|
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (null !== $this->apcuPrefix) {
|
||||||
|
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
||||||
|
if ($hit) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$file = $this->findFileWithExtension($class, '.php');
|
||||||
|
|
||||||
|
// Search for Hack files if we are running on HHVM
|
||||||
|
if (false === $file && defined('HHVM_VERSION')) {
|
||||||
|
$file = $this->findFileWithExtension($class, '.hh');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null !== $this->apcuPrefix) {
|
||||||
|
apcu_add($this->apcuPrefix.$class, $file);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (false === $file) {
|
||||||
|
// Remember that this class does not exist.
|
||||||
|
$this->missingClasses[$class] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the currently registered loaders indexed by their corresponding vendor directories.
|
||||||
|
*
|
||||||
|
* @return self[]
|
||||||
|
*/
|
||||||
|
public static function getRegisteredLoaders()
|
||||||
|
{
|
||||||
|
return self::$registeredLoaders;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $class
|
||||||
|
* @param string $ext
|
||||||
|
* @return string|false
|
||||||
|
*/
|
||||||
|
private function findFileWithExtension($class, $ext)
|
||||||
|
{
|
||||||
|
// PSR-4 lookup
|
||||||
|
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
||||||
|
|
||||||
|
$first = $class[0];
|
||||||
|
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||||
|
$subPath = $class;
|
||||||
|
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
||||||
|
$subPath = substr($subPath, 0, $lastPos);
|
||||||
|
$search = $subPath . '\\';
|
||||||
|
if (isset($this->prefixDirsPsr4[$search])) {
|
||||||
|
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
||||||
|
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||||
|
if (file_exists($file = $dir . $pathEnd)) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PSR-4 fallback dirs
|
||||||
|
foreach ($this->fallbackDirsPsr4 as $dir) {
|
||||||
|
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PSR-0 lookup
|
||||||
|
if (false !== $pos = strrpos($class, '\\')) {
|
||||||
|
// namespaced class name
|
||||||
|
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
||||||
|
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
||||||
|
} else {
|
||||||
|
// PEAR-like class name
|
||||||
|
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($this->prefixesPsr0[$first])) {
|
||||||
|
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
||||||
|
if (0 === strpos($class, $prefix)) {
|
||||||
|
foreach ($dirs as $dir) {
|
||||||
|
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PSR-0 fallback dirs
|
||||||
|
foreach ($this->fallbackDirsPsr0 as $dir) {
|
||||||
|
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PSR-0 include paths.
|
||||||
|
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scope isolated include.
|
||||||
|
*
|
||||||
|
* Prevents access to $this/self from included files.
|
||||||
|
*
|
||||||
|
* @param string $file
|
||||||
|
* @return void
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
function includeFile($file)
|
||||||
|
{
|
||||||
|
include $file;
|
||||||
|
}
|
||||||
@@ -0,0 +1,350 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Composer.
|
||||||
|
*
|
||||||
|
* (c) Nils Adermann <naderman@naderman.de>
|
||||||
|
* Jordi Boggiano <j.boggiano@seld.be>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Composer;
|
||||||
|
|
||||||
|
use Composer\Autoload\ClassLoader;
|
||||||
|
use Composer\Semver\VersionParser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is copied in every Composer installed project and available to all
|
||||||
|
*
|
||||||
|
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
||||||
|
*
|
||||||
|
* To require its presence, you can require `composer-runtime-api ^2.0`
|
||||||
|
*/
|
||||||
|
class InstalledVersions
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var mixed[]|null
|
||||||
|
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
|
||||||
|
*/
|
||||||
|
private static $installed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var bool|null
|
||||||
|
*/
|
||||||
|
private static $canGetVendors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array[]
|
||||||
|
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
||||||
|
*/
|
||||||
|
private static $installedByVendor = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
||||||
|
*
|
||||||
|
* @return string[]
|
||||||
|
* @psalm-return list<string>
|
||||||
|
*/
|
||||||
|
public static function getInstalledPackages()
|
||||||
|
{
|
||||||
|
$packages = array();
|
||||||
|
foreach (self::getInstalled() as $installed) {
|
||||||
|
$packages[] = array_keys($installed['versions']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (1 === \count($packages)) {
|
||||||
|
return $packages[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a list of all package names with a specific type e.g. 'library'
|
||||||
|
*
|
||||||
|
* @param string $type
|
||||||
|
* @return string[]
|
||||||
|
* @psalm-return list<string>
|
||||||
|
*/
|
||||||
|
public static function getInstalledPackagesByType($type)
|
||||||
|
{
|
||||||
|
$packagesByType = array();
|
||||||
|
|
||||||
|
foreach (self::getInstalled() as $installed) {
|
||||||
|
foreach ($installed['versions'] as $name => $package) {
|
||||||
|
if (isset($package['type']) && $package['type'] === $type) {
|
||||||
|
$packagesByType[] = $name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $packagesByType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the given package is installed
|
||||||
|
*
|
||||||
|
* This also returns true if the package name is provided or replaced by another package
|
||||||
|
*
|
||||||
|
* @param string $packageName
|
||||||
|
* @param bool $includeDevRequirements
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function isInstalled($packageName, $includeDevRequirements = true)
|
||||||
|
{
|
||||||
|
foreach (self::getInstalled() as $installed) {
|
||||||
|
if (isset($installed['versions'][$packageName])) {
|
||||||
|
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the given package satisfies a version constraint
|
||||||
|
*
|
||||||
|
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
||||||
|
*
|
||||||
|
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
||||||
|
*
|
||||||
|
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
||||||
|
* @param string $packageName
|
||||||
|
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||||
|
{
|
||||||
|
$constraint = $parser->parseConstraints($constraint);
|
||||||
|
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||||
|
|
||||||
|
return $provided->matches($constraint);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a version constraint representing all the range(s) which are installed for a given package
|
||||||
|
*
|
||||||
|
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
||||||
|
* whether a given version of a package is installed, and not just whether it exists
|
||||||
|
*
|
||||||
|
* @param string $packageName
|
||||||
|
* @return string Version constraint usable with composer/semver
|
||||||
|
*/
|
||||||
|
public static function getVersionRanges($packageName)
|
||||||
|
{
|
||||||
|
foreach (self::getInstalled() as $installed) {
|
||||||
|
if (!isset($installed['versions'][$packageName])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$ranges = array();
|
||||||
|
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||||
|
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||||
|
}
|
||||||
|
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||||
|
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||||
|
}
|
||||||
|
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||||
|
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||||
|
}
|
||||||
|
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||||
|
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return implode(' || ', $ranges);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $packageName
|
||||||
|
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||||
|
*/
|
||||||
|
public static function getVersion($packageName)
|
||||||
|
{
|
||||||
|
foreach (self::getInstalled() as $installed) {
|
||||||
|
if (!isset($installed['versions'][$packageName])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $installed['versions'][$packageName]['version'];
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $packageName
|
||||||
|
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||||
|
*/
|
||||||
|
public static function getPrettyVersion($packageName)
|
||||||
|
{
|
||||||
|
foreach (self::getInstalled() as $installed) {
|
||||||
|
if (!isset($installed['versions'][$packageName])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $installed['versions'][$packageName]['pretty_version'];
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $packageName
|
||||||
|
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
||||||
|
*/
|
||||||
|
public static function getReference($packageName)
|
||||||
|
{
|
||||||
|
foreach (self::getInstalled() as $installed) {
|
||||||
|
if (!isset($installed['versions'][$packageName])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $installed['versions'][$packageName]['reference'];
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $packageName
|
||||||
|
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
||||||
|
*/
|
||||||
|
public static function getInstallPath($packageName)
|
||||||
|
{
|
||||||
|
foreach (self::getInstalled() as $installed) {
|
||||||
|
if (!isset($installed['versions'][$packageName])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
|
||||||
|
*/
|
||||||
|
public static function getRootPackage()
|
||||||
|
{
|
||||||
|
$installed = self::getInstalled();
|
||||||
|
|
||||||
|
return $installed[0]['root'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the raw installed.php data for custom implementations
|
||||||
|
*
|
||||||
|
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
||||||
|
* @return array[]
|
||||||
|
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
|
||||||
|
*/
|
||||||
|
public static function getRawData()
|
||||||
|
{
|
||||||
|
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
||||||
|
|
||||||
|
if (null === self::$installed) {
|
||||||
|
// only require the installed.php file if this file is loaded from its dumped location,
|
||||||
|
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||||
|
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||||
|
self::$installed = include __DIR__ . '/installed.php';
|
||||||
|
} else {
|
||||||
|
self::$installed = array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return self::$installed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
||||||
|
*
|
||||||
|
* @return array[]
|
||||||
|
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
||||||
|
*/
|
||||||
|
public static function getAllRawData()
|
||||||
|
{
|
||||||
|
return self::getInstalled();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lets you reload the static array from another file
|
||||||
|
*
|
||||||
|
* This is only useful for complex integrations in which a project needs to use
|
||||||
|
* this class but then also needs to execute another project's autoloader in process,
|
||||||
|
* and wants to ensure both projects have access to their version of installed.php.
|
||||||
|
*
|
||||||
|
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
||||||
|
* the data it needs from this class, then call reload() with
|
||||||
|
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
||||||
|
* the project in which it runs can then also use this class safely, without
|
||||||
|
* interference between PHPUnit's dependencies and the project's dependencies.
|
||||||
|
*
|
||||||
|
* @param array[] $data A vendor/composer/installed.php data set
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
|
||||||
|
*/
|
||||||
|
public static function reload($data)
|
||||||
|
{
|
||||||
|
self::$installed = $data;
|
||||||
|
self::$installedByVendor = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array[]
|
||||||
|
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
||||||
|
*/
|
||||||
|
private static function getInstalled()
|
||||||
|
{
|
||||||
|
if (null === self::$canGetVendors) {
|
||||||
|
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||||
|
}
|
||||||
|
|
||||||
|
$installed = array();
|
||||||
|
|
||||||
|
if (self::$canGetVendors) {
|
||||||
|
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||||
|
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||||
|
$installed[] = self::$installedByVendor[$vendorDir];
|
||||||
|
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||||
|
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
||||||
|
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||||
|
self::$installed = $installed[count($installed) - 1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null === self::$installed) {
|
||||||
|
// only require the installed.php file if this file is loaded from its dumped location,
|
||||||
|
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||||
|
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||||
|
self::$installed = require __DIR__ . '/installed.php';
|
||||||
|
} else {
|
||||||
|
self::$installed = array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$installed[] = self::$installed;
|
||||||
|
|
||||||
|
return $installed;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is furnished
|
||||||
|
to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// autoload_classmap.php @generated by Composer
|
||||||
|
|
||||||
|
$vendorDir = dirname(dirname(__FILE__));
|
||||||
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
||||||
|
'Grav\\Plugin\\AddPageByFormPlugin' => $baseDir . '/add-page-by-form.php',
|
||||||
|
);
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// autoload_namespaces.php @generated by Composer
|
||||||
|
|
||||||
|
$vendorDir = dirname(dirname(__FILE__));
|
||||||
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
|
return array(
|
||||||
|
);
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// autoload_psr4.php @generated by Composer
|
||||||
|
|
||||||
|
$vendorDir = dirname(dirname(__FILE__));
|
||||||
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'Grav\\Plugin\\AddPageByFormPlugin\\' => array($baseDir . '/classes'),
|
||||||
|
);
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// autoload_real.php @generated by Composer
|
||||||
|
|
||||||
|
class ComposerAutoloaderInit0206cd2f5513395c6d5551a767d5c39f
|
||||||
|
{
|
||||||
|
private static $loader;
|
||||||
|
|
||||||
|
public static function loadClassLoader($class)
|
||||||
|
{
|
||||||
|
if ('Composer\Autoload\ClassLoader' === $class) {
|
||||||
|
require __DIR__ . '/ClassLoader.php';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Composer\Autoload\ClassLoader
|
||||||
|
*/
|
||||||
|
public static function getLoader()
|
||||||
|
{
|
||||||
|
if (null !== self::$loader) {
|
||||||
|
return self::$loader;
|
||||||
|
}
|
||||||
|
|
||||||
|
require __DIR__ . '/platform_check.php';
|
||||||
|
|
||||||
|
spl_autoload_register(array('ComposerAutoloaderInit0206cd2f5513395c6d5551a767d5c39f', 'loadClassLoader'), true, true);
|
||||||
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||||
|
spl_autoload_unregister(array('ComposerAutoloaderInit0206cd2f5513395c6d5551a767d5c39f', 'loadClassLoader'));
|
||||||
|
|
||||||
|
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||||
|
if ($useStaticLoader) {
|
||||||
|
require __DIR__ . '/autoload_static.php';
|
||||||
|
|
||||||
|
call_user_func(\Composer\Autoload\ComposerStaticInit0206cd2f5513395c6d5551a767d5c39f::getInitializer($loader));
|
||||||
|
} else {
|
||||||
|
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||||
|
foreach ($map as $namespace => $path) {
|
||||||
|
$loader->set($namespace, $path);
|
||||||
|
}
|
||||||
|
|
||||||
|
$map = require __DIR__ . '/autoload_psr4.php';
|
||||||
|
foreach ($map as $namespace => $path) {
|
||||||
|
$loader->setPsr4($namespace, $path);
|
||||||
|
}
|
||||||
|
|
||||||
|
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||||
|
if ($classMap) {
|
||||||
|
$loader->addClassMap($classMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$loader->register(true);
|
||||||
|
|
||||||
|
return $loader;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// autoload_static.php @generated by Composer
|
||||||
|
|
||||||
|
namespace Composer\Autoload;
|
||||||
|
|
||||||
|
class ComposerStaticInit0206cd2f5513395c6d5551a767d5c39f
|
||||||
|
{
|
||||||
|
public static $prefixLengthsPsr4 = array (
|
||||||
|
'G' =>
|
||||||
|
array (
|
||||||
|
'Grav\\Plugin\\AddPageByFormPlugin\\' => 32,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
public static $prefixDirsPsr4 = array (
|
||||||
|
'Grav\\Plugin\\AddPageByFormPlugin\\' =>
|
||||||
|
array (
|
||||||
|
0 => __DIR__ . '/../..' . '/classes',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
public static $classMap = array (
|
||||||
|
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
||||||
|
'Grav\\Plugin\\AddPageByFormPlugin' => __DIR__ . '/../..' . '/add-page-by-form.php',
|
||||||
|
);
|
||||||
|
|
||||||
|
public static function getInitializer(ClassLoader $loader)
|
||||||
|
{
|
||||||
|
return \Closure::bind(function () use ($loader) {
|
||||||
|
$loader->prefixLengthsPsr4 = ComposerStaticInit0206cd2f5513395c6d5551a767d5c39f::$prefixLengthsPsr4;
|
||||||
|
$loader->prefixDirsPsr4 = ComposerStaticInit0206cd2f5513395c6d5551a767d5c39f::$prefixDirsPsr4;
|
||||||
|
$loader->classMap = ComposerStaticInit0206cd2f5513395c6d5551a767d5c39f::$classMap;
|
||||||
|
|
||||||
|
}, null, ClassLoader::class);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"packages": [],
|
||||||
|
"dev": false,
|
||||||
|
"dev-package-names": []
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?php return array(
|
||||||
|
'root' => array(
|
||||||
|
'pretty_version' => '1.0.0+no-version-set',
|
||||||
|
'version' => '1.0.0.0',
|
||||||
|
'type' => 'grav-plugin',
|
||||||
|
'install_path' => __DIR__ . '/../../',
|
||||||
|
'aliases' => array(),
|
||||||
|
'reference' => NULL,
|
||||||
|
'name' => 'bleutzinn/grav-plugin-add-page-by-form',
|
||||||
|
'dev' => false,
|
||||||
|
),
|
||||||
|
'versions' => array(
|
||||||
|
'bleutzinn/grav-plugin-add-page-by-form' => array(
|
||||||
|
'pretty_version' => '1.0.0+no-version-set',
|
||||||
|
'version' => '1.0.0.0',
|
||||||
|
'type' => 'grav-plugin',
|
||||||
|
'install_path' => __DIR__ . '/../../',
|
||||||
|
'aliases' => array(),
|
||||||
|
'reference' => NULL,
|
||||||
|
'dev_requirement' => false,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// platform_check.php @generated by Composer
|
||||||
|
|
||||||
|
$issues = array();
|
||||||
|
|
||||||
|
if (!(PHP_VERSION_ID >= 70103)) {
|
||||||
|
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.3". You are running ' . PHP_VERSION . '.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($issues) {
|
||||||
|
if (!headers_sent()) {
|
||||||
|
header('HTTP/1.1 500 Internal Server Error');
|
||||||
|
}
|
||||||
|
if (!ini_get('display_errors')) {
|
||||||
|
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||||
|
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
|
||||||
|
} elseif (!headers_sent()) {
|
||||||
|
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
trigger_error(
|
||||||
|
'Composer detected issues in your platform: ' . implode(' ', $issues),
|
||||||
|
E_USER_ERROR
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# Linguist Normalizer
|
||||||
|
*.yaml linguistic-language=PHP
|
||||||
|
*.twig linguistic-language=PHP
|
||||||
|
**/gulpfile.babel.js linguist-vendored
|
||||||
|
**/webpack.conf.js linguist-vendored
|
||||||
|
**/js/*.js linguist-vendored
|
||||||
|
**/js/*.json linguist-vendored
|
||||||
|
**/css-compiled/*.css linguist-vendored
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||||
|
patreon: # Replace with a single Patreon username
|
||||||
|
open_collective: grav
|
||||||
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
custom: # Replace with a single custom sponsorship URL
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Please read the <a href="https://github.com/getgrav/grav/blob/develop/CONTRIBUTING.md" target="_blank">Contributing Guidelines of the Grav Project</a>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2017 Grav
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
# Grav Standard Administration Panel Plugin
|
||||||
|
|
||||||
|
This **admin plugin** for [Grav](https://github.com/getgrav/grav) is an HTML user interface that provides a convenient way to configure Grav and easily create and modify pages. This will remain a totally optional plugin, and is not in any way required or needed to use Grav effectively. In fact, the admin provides an intentionally limited view to ensure it remains easy to use and not overwhelming. I'm sure power users will still prefer to work with the configuration files directly.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
# Features
|
||||||
|
|
||||||
|
* User login with automatic password encryption
|
||||||
|
* Forgot password functionality
|
||||||
|
* Logged-in-user management
|
||||||
|
* One click Grav core updates
|
||||||
|
* Dashboard with maintenance status, site activity and latest page updates
|
||||||
|
* Notifications system for latest news, blogs, and announcements
|
||||||
|
* Ajax-powered backup capability
|
||||||
|
* Ajax-powered clear-cache capability
|
||||||
|
* System configuration management
|
||||||
|
* Site configuration management
|
||||||
|
* Normal and Expert modes which allow editing via forms or YAML
|
||||||
|
* Page listing with filtering and search
|
||||||
|
* Page creation, editing, moving, copying, and deleting
|
||||||
|
* Powerful syntax highlighting code editor with instant Grav-powered preview
|
||||||
|
* Editor features, hot keys, toolbar, and distraction-free fullscreen mode
|
||||||
|
* Drag-n-drop upload of page media files including drag-n-drop placement in the editor
|
||||||
|
* One click theme and plugin updates
|
||||||
|
* Plugin manager that allows listing and configuration of installed plugins
|
||||||
|
* Theme manager that allows listing and configuration of installed themes
|
||||||
|
* GPM-powered installation of new plugins and themes
|
||||||
|
|
||||||
|
# Support
|
||||||
|
|
||||||
|
#### Support
|
||||||
|
|
||||||
|
We have tested internally, but we hope to use this public beta phase to identify, isolate, and fix issues related to the plugin to ensure it is as solid and reliable as possible.
|
||||||
|
|
||||||
|
For **live chatting**, please use the dedicated [Discord Chat Room](https://getgrav.org/discord) for discussions directly related to Grav.
|
||||||
|
|
||||||
|
For **bugs, features, improvements**, please ensure you [create issues in the admin plugin GitHub repository](https://github.com/getgrav/grav-plugin-admin).
|
||||||
|
|
||||||
|
# Installation
|
||||||
|
|
||||||
|
First ensure you are running the latest **Grav 1.6.7 or later**. This is required for the admin plugin to run properly (`-f` forces a refresh of the GPM index).
|
||||||
|
|
||||||
|
```
|
||||||
|
$ bin/gpm selfupgrade -f
|
||||||
|
```
|
||||||
|
|
||||||
|
The admin plugin actually requires the help of 3 other plugins, so to get the admin plugin to work you first need to install **admin**, **login**, **forms**, and **email** plugins. These are available via GPM, and because the plugin has dependencies you just need to proceed and install the admin plugin, and agree when prompted to install the others:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ bin/gpm install admin
|
||||||
|
```
|
||||||
|
|
||||||
|
### Manual Installation
|
||||||
|
|
||||||
|
Manual installation is not the recommended method of installation, however, it is still possible to install the admin plugin manually. Basically, you need to download each of the following plugins individually:
|
||||||
|
|
||||||
|
* [admin](https://github.com/getgrav/grav-plugin-admin/archive/develop.zip)
|
||||||
|
* [login](https://github.com/getgrav/grav-plugin-login/archive/develop.zip)
|
||||||
|
* [form](https://github.com/getgrav/grav-plugin-form/archive/develop.zip)
|
||||||
|
* [email](https://github.com/getgrav/grav-plugin-email/archive/develop.zip)
|
||||||
|
|
||||||
|
Extract each archive file into your `user/plugins` folder, then ensure the folders are renamed to just `admin/`, `login/`, `form/`, and `email/`. Then proceed with the **Usage instructions below**.
|
||||||
|
|
||||||
|
# Usage
|
||||||
|
|
||||||
|
### Create User with CLI
|
||||||
|
|
||||||
|
After this you need to create a user account with admin privileges:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ bin/plugin login new-user
|
||||||
|
```
|
||||||
|
|
||||||
|
### Create User Manually
|
||||||
|
|
||||||
|
Alternatively, you can create a user account manually, in a file called `user/accounts/admin.yaml`. This **filename** is actually the **username** that you will use to login. The contents will contain the other information for the user.
|
||||||
|
|
||||||
|
```
|
||||||
|
password: 'password'
|
||||||
|
email: 'youremail@mail.com'
|
||||||
|
fullname: 'Johnny Appleseed'
|
||||||
|
title: 'Site Administrator'
|
||||||
|
access:
|
||||||
|
admin:
|
||||||
|
login: true
|
||||||
|
super: true
|
||||||
|
```
|
||||||
|
|
||||||
|
Of course you should edit your `email`, `password`, `fullname`, and `title` to suit your needs.
|
||||||
|
|
||||||
|
> You can use any password when you manually put it in this `.yaml` file. However, when you change your password in the admin, it must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters.
|
||||||
|
|
||||||
|
# Accessing the Admin
|
||||||
|
|
||||||
|
By default, you can access the admin by pointing your browser to `http://yoursite.com/admin`. You can simply log in with the `username` and `password` set in the YAML file you configured earlier.
|
||||||
|
|
||||||
|
> After logging in, your **plaintext password** will be removed and replaced by an **encrypted** one.
|
||||||
|
|
||||||
|
# Standard Free & Paid Pro Versions
|
||||||
|
|
||||||
|
If you have been following the [blog](https://getgrav.org/blog), [Twitter](https://twitter.com/getgrav), [Discord chat](https://getgrav.org/discord), etc., you probably already know now that our intention is to provide two versions of this plugin.
|
||||||
|
|
||||||
|
The **standard free version**, is very powerful, and has more functionality than most commercial flat-file CMS systems.
|
||||||
|
|
||||||
|
We also intend to release in the near future a more feature-rich **pro version** that will include enhanced functionality, as well as some additional nice-to-have capabilities. This pro version will be a **paid** plugin the price of which is not yet 100% finalized.
|
||||||
|
|
||||||
|
# Admin Events
|
||||||
|
|
||||||
|
## General events
|
||||||
|
|
||||||
|
- onAdminRegisterPermissions - (admin)
|
||||||
|
- onAdminThemeInitialized
|
||||||
|
- onAdminPage - (page)
|
||||||
|
- onAdminMenu
|
||||||
|
- onAdminTwigTemplatePaths - (paths)
|
||||||
|
|
||||||
|
## Page specific events
|
||||||
|
|
||||||
|
- onAdminDashboard
|
||||||
|
- onAdminTools - (tools)
|
||||||
|
- onAdminLogFiles - (logs)
|
||||||
|
- onAdminGenerateReports - (reports)
|
||||||
|
|
||||||
|
## Tasks
|
||||||
|
|
||||||
|
- onAdminControllerInit - (controller)
|
||||||
|
- onAdminTaskExecute - (controller, method)
|
||||||
|
|
||||||
|
## Editing
|
||||||
|
|
||||||
|
- onAdminData
|
||||||
|
- onAdminSave - (object)
|
||||||
|
- onAdminAfterSave - (object)
|
||||||
|
|
||||||
|
## Pages
|
||||||
|
|
||||||
|
- onAdminPageTypes - (types)
|
||||||
|
- onAdminModularPageTypes
|
||||||
|
- onAdminSave - (page)
|
||||||
|
- onAdminAfterSaveAs - (path)
|
||||||
|
- onAdminAfterSave - (page)
|
||||||
|
- onAdminAfterDelete - (page)
|
||||||
|
- onAdminAfterAddMedia - (page)
|
||||||
|
- onAdminAfterDelMedia - (page)
|
||||||
|
- onAdminCreatePageFrontmatter - (header, data)
|
||||||
|
|
||||||
|
|
||||||
|
# Running Tests
|
||||||
|
|
||||||
|
First install the dev dependencies by running `composer update` from the Grav root.
|
||||||
|
Then `composer test` will run the Unit Tests, which should be always executed successfully on any site.
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# Upgrading to Admin 1.10
|
||||||
|
|
||||||
|
Twig:
|
||||||
|
|
||||||
|
* **Admin link**: When linking to another admin page, use `{{ admin_route('/config/site') }}` instead of any other method, such as `{{ base_url_relative }}/config/site` (fixes multi-language issues)
|
||||||
|
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
enabled: false
|
||||||
|
route: '/admin'
|
||||||
|
cache_enabled: true
|
||||||
|
theme: grav
|
||||||
|
logo_text: ''
|
||||||
|
body_classes: ''
|
||||||
|
content_padding: true
|
||||||
|
twofa_enabled: true
|
||||||
|
sidebar:
|
||||||
|
activate: tab
|
||||||
|
hover_delay: 100
|
||||||
|
size: auto
|
||||||
|
dashboard:
|
||||||
|
days_of_stats: 7
|
||||||
|
widgets_display:
|
||||||
|
dashboard-maintenance: true
|
||||||
|
dashboard-statistics: true
|
||||||
|
dashboard-notifications: true
|
||||||
|
dashboard-feed: true
|
||||||
|
dashboard-pages: true
|
||||||
|
pages:
|
||||||
|
show_parents: both
|
||||||
|
show_modular: true
|
||||||
|
session:
|
||||||
|
timeout: 1800
|
||||||
|
keep_alive: true
|
||||||
|
edit_mode: normal
|
||||||
|
frontend_preview_target: inline
|
||||||
|
show_github_msg: true
|
||||||
|
admin_icons: line-awesome
|
||||||
|
enable_auto_updates_check: true
|
||||||
|
notifications:
|
||||||
|
feed: true
|
||||||
|
dashboard: true
|
||||||
|
plugins: true
|
||||||
|
themes: true
|
||||||
|
popularity:
|
||||||
|
enabled: true
|
||||||
|
ignore: ['/test*','/modular']
|
||||||
|
history:
|
||||||
|
daily: 30
|
||||||
|
monthly: 12
|
||||||
|
visitors: 20
|
||||||
|
whitelabel:
|
||||||
|
quicktray_recompile: false
|
||||||
|
codemirror_theme: paper
|
||||||
|
codemirror_fontsize: md
|
||||||
|
codemirror_md_font: sans
|
||||||
|
logo_custom:
|
||||||
|
logo_login:
|
||||||
|
color_scheme:
|
||||||
|
accents:
|
||||||
|
primary-accent: button
|
||||||
|
secondary-accent: notice
|
||||||
|
tertiary-accent: critical
|
||||||
|
colors:
|
||||||
|
logo-bg: '#323640'
|
||||||
|
logo-link: '#FFFFFF'
|
||||||
|
nav-bg: '#3D424E'
|
||||||
|
nav-text: '#B7B9BD'
|
||||||
|
nav-link: '#ffffff'
|
||||||
|
nav-selected-bg: '#323640'
|
||||||
|
nav-selected-link: '#ffffff'
|
||||||
|
nav-hover-bg: '#434753'
|
||||||
|
nav-hover-link: '#ffffff'
|
||||||
|
toolbar-bg: '#ffffff'
|
||||||
|
toolbar-text: '#3D424E'
|
||||||
|
page-bg: '#F6F6F6'
|
||||||
|
page-text: '#6f7b8a'
|
||||||
|
page-link: '#0090D9'
|
||||||
|
content-bg: '#ffffff'
|
||||||
|
content-text: '#6f7b8a'
|
||||||
|
content-link: '#0090D9'
|
||||||
|
content-link2: '#da4b46'
|
||||||
|
content-header: '#414147'
|
||||||
|
content-tabs-bg: '#e6e6e6'
|
||||||
|
content-tabs-text: '#808080'
|
||||||
|
button-bg: '#0090D9'
|
||||||
|
button-text: '#ffffff'
|
||||||
|
notice-bg: '#06A599'
|
||||||
|
notice-text: '#ffffff'
|
||||||
|
update-bg: '#77559D'
|
||||||
|
update-text: '#ffffff'
|
||||||
|
critical-bg: '#F45857'
|
||||||
|
critical-text: '#ffffff'
|
||||||
|
After Width: | Height: | Size: 236 KiB |
@@ -0,0 +1,792 @@
|
|||||||
|
name: Admin Panel
|
||||||
|
slug: admin
|
||||||
|
type: plugin
|
||||||
|
testing: true
|
||||||
|
version: 1.11.0-beta.5
|
||||||
|
description: Adds an advanced administration panel to manage your site
|
||||||
|
icon: empire
|
||||||
|
author:
|
||||||
|
name: Team Grav
|
||||||
|
email: devs@getgrav.org
|
||||||
|
url: https://getgrav.org
|
||||||
|
homepage: https://github.com/getgrav/grav-plugin-admin
|
||||||
|
keywords: admin, plugin, manager, panel
|
||||||
|
bugs: https://github.com/getgrav/grav-plugin-admin/issues
|
||||||
|
docs: https://github.com/getgrav/grav-plugin-admin/blob/develop/README.md
|
||||||
|
license: MIT
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- { name: grav, version: '>=1.8.0-beta.1' }
|
||||||
|
- { name: form, version: '>=6.0.1' }
|
||||||
|
- { name: login, version: '>=3.7.8' }
|
||||||
|
- { name: email, version: '>=3.1.6' }
|
||||||
|
- { name: flex-objects, version: '>=1.4.0-beta.1' }
|
||||||
|
|
||||||
|
form:
|
||||||
|
validation: loose
|
||||||
|
fields:
|
||||||
|
admin_tabs:
|
||||||
|
type: tabs
|
||||||
|
fields:
|
||||||
|
config_tab:
|
||||||
|
type: tab
|
||||||
|
title: PLUGIN_ADMIN.CONFIGURATION
|
||||||
|
|
||||||
|
fields:
|
||||||
|
|
||||||
|
Basics:
|
||||||
|
type: section
|
||||||
|
title: PLUGIN_ADMIN.BASICS
|
||||||
|
underline: false
|
||||||
|
|
||||||
|
enabled:
|
||||||
|
type: hidden
|
||||||
|
label: PLUGIN_ADMIN.PLUGIN_STATUS
|
||||||
|
highlight: 1
|
||||||
|
default: 0
|
||||||
|
options:
|
||||||
|
1: PLUGIN_ADMIN.ENABLED
|
||||||
|
0: PLUGIN_ADMIN.DISABLED
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
|
||||||
|
cache_enabled:
|
||||||
|
type: toggle
|
||||||
|
label: PLUGIN_ADMIN.ADMIN_CACHING
|
||||||
|
help: PLUGIN_ADMIN.ADMIN_CACHING_HELP
|
||||||
|
highlight: 1
|
||||||
|
options:
|
||||||
|
1: PLUGIN_ADMIN.YES
|
||||||
|
0: PLUGIN_ADMIN.NO
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
|
||||||
|
twofa_enabled:
|
||||||
|
type: toggle
|
||||||
|
label: PLUGIN_LOGIN.2FA_TITLE
|
||||||
|
help: PLUGIN_LOGIN.2FA_ENABLED_HELP
|
||||||
|
default: 1
|
||||||
|
highlight: 1
|
||||||
|
options:
|
||||||
|
1: PLUGIN_ADMIN.YES
|
||||||
|
0: PLUGIN_ADMIN.NO
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
|
||||||
|
route:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.ADMIN_PATH
|
||||||
|
size: medium
|
||||||
|
placeholder: ADMIN_PATH_PLACEHOLDER
|
||||||
|
help: ADMIN_PATH_HELP
|
||||||
|
|
||||||
|
logo_text:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.LOGO_TEXT
|
||||||
|
size: medium
|
||||||
|
placeholder: "Grav"
|
||||||
|
help: PLUGIN_ADMIN.LOGO_TEXT_HELP
|
||||||
|
|
||||||
|
content_padding:
|
||||||
|
type: toggle
|
||||||
|
label: PLUGIN_ADMIN.CONTENT_PADDING
|
||||||
|
help: PLUGIN_ADMIN.CONTENT_PADDING_HELP
|
||||||
|
highlight: 1
|
||||||
|
options:
|
||||||
|
1: PLUGIN_ADMIN.YES
|
||||||
|
0: PLUGIN_ADMIN.NO
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
|
||||||
|
body_classes:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.BODY_CLASSES
|
||||||
|
size: medium
|
||||||
|
help: PLUGIN_ADMIN.BODY_CLASSES_HELP
|
||||||
|
|
||||||
|
sidebar.activate:
|
||||||
|
type: select
|
||||||
|
label: PLUGIN_ADMIN.SIDEBAR_ACTIVATION
|
||||||
|
help: PLUGIN_ADMIN.SIDEBAR_ACTIVATION_HELP
|
||||||
|
size: small
|
||||||
|
default: tab
|
||||||
|
options:
|
||||||
|
tab: PLUGIN_ADMIN.SIDEBAR_ACTIVATION_TAB
|
||||||
|
hover: PLUGIN_ADMIN.SIDEBAR_ACTIVATION_HOVER
|
||||||
|
|
||||||
|
sidebar.hover_delay:
|
||||||
|
type: text
|
||||||
|
size: x-small
|
||||||
|
append: PLUGIN_ADMIN.SIDEBAR_HOVER_DELAY_APPEND
|
||||||
|
label: PLUGIN_ADMIN.SIDEBAR_HOVER_DELAY
|
||||||
|
default: 500
|
||||||
|
validate:
|
||||||
|
type: number
|
||||||
|
min: 1
|
||||||
|
|
||||||
|
|
||||||
|
sidebar.size:
|
||||||
|
type: select
|
||||||
|
label: PLUGIN_ADMIN.SIDEBAR_SIZE
|
||||||
|
help: PLUGIN_ADMIN.SIDEBAR_SIZE_HELP
|
||||||
|
size: medium
|
||||||
|
default: auto
|
||||||
|
options:
|
||||||
|
auto: PLUGIN_ADMIN.SIDEBAR_SIZE_AUTO
|
||||||
|
small: PLUGIN_ADMIN.SIDEBAR_SIZE_SMALL
|
||||||
|
|
||||||
|
theme:
|
||||||
|
type: hidden
|
||||||
|
label: PLUGIN_ADMIN.THEME
|
||||||
|
default: grav
|
||||||
|
|
||||||
|
edit_mode:
|
||||||
|
type: select
|
||||||
|
label: PLUGIN_ADMIN.EDIT_MODE
|
||||||
|
size: small
|
||||||
|
default: normal
|
||||||
|
options:
|
||||||
|
normal: PLUGIN_ADMIN.NORMAL
|
||||||
|
expert: PLUGIN_ADMIN.EXPERT
|
||||||
|
help: PLUGIN_ADMIN.EDIT_MODE_HELP
|
||||||
|
|
||||||
|
frontend_preview_target:
|
||||||
|
type: select
|
||||||
|
label: PLUGIN_ADMIN.FRONTEND_PREVIEW_TARGET
|
||||||
|
size: medium
|
||||||
|
default: inline
|
||||||
|
options:
|
||||||
|
inline: PLUGIN_ADMIN.FRONTEND_PREVIEW_TARGET_INLINE
|
||||||
|
_blank: PLUGIN_ADMIN.FRONTEND_PREVIEW_TARGET_NEW
|
||||||
|
_self: PLUGIN_ADMIN.FRONTEND_PREVIEW_TARGET_CURRENT
|
||||||
|
|
||||||
|
pages.show_parents:
|
||||||
|
type: select
|
||||||
|
size: medium
|
||||||
|
label: PLUGIN_ADMIN.PARENT_DROPDOWN
|
||||||
|
highlight: 1
|
||||||
|
options:
|
||||||
|
both: PLUGIN_ADMIN.PARENT_DROPDOWN_BOTH
|
||||||
|
folder: PLUGIN_ADMIN.PARENT_DROPDOWN_FOLDER
|
||||||
|
fullpath: PLUGIN_ADMIN.PARENT_DROPDOWN_FULLPATH
|
||||||
|
|
||||||
|
pages.parents_levels:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.PARENTS_LEVELS
|
||||||
|
size: small
|
||||||
|
help: PLUGIN_ADMIN.PARENTS_LEVELS_HELP
|
||||||
|
|
||||||
|
pages.show_modular:
|
||||||
|
type: toggle
|
||||||
|
label: PLUGIN_ADMIN.MODULAR_PARENTS
|
||||||
|
highlight: 1
|
||||||
|
default: 1
|
||||||
|
options:
|
||||||
|
1: PLUGIN_ADMIN.ENABLED
|
||||||
|
0: PLUGIN_ADMIN.DISABLED
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
help: PLUGIN_ADMIN.MODULAR_PARENTS_HELP
|
||||||
|
|
||||||
|
show_beta_msg:
|
||||||
|
type: hidden
|
||||||
|
|
||||||
|
show_github_msg:
|
||||||
|
type: toggle
|
||||||
|
label: PLUGIN_ADMIN.SHOW_GITHUB_LINK
|
||||||
|
highlight: 1
|
||||||
|
default: 1
|
||||||
|
options:
|
||||||
|
1: PLUGIN_ADMIN.ENABLED
|
||||||
|
0: PLUGIN_ADMIN.DISABLED
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
help: PLUGIN_ADMIN.SHOW_GITHUB_LINK_HELP
|
||||||
|
|
||||||
|
enable_auto_updates_check:
|
||||||
|
type: toggle
|
||||||
|
label: PLUGIN_ADMIN.AUTO_UPDATES
|
||||||
|
highlight: 1
|
||||||
|
default: 1
|
||||||
|
options:
|
||||||
|
1: PLUGIN_ADMIN.ENABLED
|
||||||
|
0: PLUGIN_ADMIN.DISABLED
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
help: PLUGIN_ADMIN.AUTO_UPDATES_HELP
|
||||||
|
|
||||||
|
session.timeout:
|
||||||
|
type: text
|
||||||
|
size: small
|
||||||
|
label: PLUGIN_ADMIN.TIMEOUT
|
||||||
|
append: GRAV.NICETIME.SECOND_PLURAL
|
||||||
|
help: PLUGIN_ADMIN.TIMEOUT_HELP
|
||||||
|
validate:
|
||||||
|
type: number
|
||||||
|
min: 1
|
||||||
|
|
||||||
|
session.keep_alive:
|
||||||
|
type: toggle
|
||||||
|
label: Keep Alive Ping
|
||||||
|
help: "Periodically pings to keep your admin session alive. Turn OFF to allow the session to expire while idle (useful for testing timeouts)."
|
||||||
|
highlight: 1
|
||||||
|
default: 1
|
||||||
|
options:
|
||||||
|
1: PLUGIN_ADMIN.ENABLED
|
||||||
|
0: PLUGIN_ADMIN.DISABLED
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
|
||||||
|
hide_page_types:
|
||||||
|
type: select
|
||||||
|
size: large
|
||||||
|
label: PLUGIN_ADMIN.HIDE_PAGE_TYPES
|
||||||
|
classes: fancy
|
||||||
|
multiple: true
|
||||||
|
array: true
|
||||||
|
selectize:
|
||||||
|
create: true
|
||||||
|
data-options@: ['\Grav\Plugin\AdminPlugin::pagesTypes', true]
|
||||||
|
|
||||||
|
hide_modular_page_types:
|
||||||
|
type: select
|
||||||
|
size: large
|
||||||
|
label: PLUGIN_ADMIN.HIDE_MODULAR_PAGE_TYPES
|
||||||
|
classes: fancy
|
||||||
|
multiple: true
|
||||||
|
array: true
|
||||||
|
selectize:
|
||||||
|
create: true
|
||||||
|
data-options@: ['\Grav\Plugin\AdminPlugin::pagesModularTypes', true]
|
||||||
|
|
||||||
|
Dashboard:
|
||||||
|
type: section
|
||||||
|
title: PLUGIN_ADMIN.DASHBOARD
|
||||||
|
underline: true
|
||||||
|
|
||||||
|
widgets_display:
|
||||||
|
type: widgets
|
||||||
|
label: PLUGIN_ADMIN.WIDGETS_DISPLAY
|
||||||
|
validate:
|
||||||
|
type: array
|
||||||
|
|
||||||
|
Notifications:
|
||||||
|
type: section
|
||||||
|
title: PLUGIN_ADMIN.NOTIFICATIONS
|
||||||
|
underline: true
|
||||||
|
|
||||||
|
notifications.feed:
|
||||||
|
type: toggle
|
||||||
|
label: PLUGIN_ADMIN.FEED_NOTIFICATIONS
|
||||||
|
highlight: 1
|
||||||
|
default: 1
|
||||||
|
options:
|
||||||
|
1: PLUGIN_ADMIN.ENABLED
|
||||||
|
0: PLUGIN_ADMIN.DISABLED
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
help: PLUGIN_ADMIN.FEED_NOTIFICATIONS_HELP
|
||||||
|
|
||||||
|
notifications.dashboard:
|
||||||
|
type: toggle
|
||||||
|
label: PLUGIN_ADMIN.DASHBOARD_NOTIFICATIONS
|
||||||
|
highlight: 1
|
||||||
|
default: 1
|
||||||
|
options:
|
||||||
|
1: PLUGIN_ADMIN.ENABLED
|
||||||
|
0: PLUGIN_ADMIN.DISABLED
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
help: PLUGIN_ADMIN.DASHBOARD_NOTIFICATIONS_HELP
|
||||||
|
|
||||||
|
notifications.plugins:
|
||||||
|
type: toggle
|
||||||
|
label: PLUGIN_ADMIN.PLUGINS_NOTIFICATIONS
|
||||||
|
highlight: 1
|
||||||
|
default: 1
|
||||||
|
options:
|
||||||
|
1: PLUGIN_ADMIN.ENABLED
|
||||||
|
0: PLUGIN_ADMIN.DISABLED
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
help: PLUGIN_ADMIN.PLUGINS_NOTIFICATIONS_HELP
|
||||||
|
|
||||||
|
notifications.themes:
|
||||||
|
type: toggle
|
||||||
|
label: PLUGIN_ADMIN.THEMES_NOTIFICATIONS
|
||||||
|
highlight: 1
|
||||||
|
default: 1
|
||||||
|
options:
|
||||||
|
1: PLUGIN_ADMIN.ENABLED
|
||||||
|
0: PLUGIN_ADMIN.DISABLED
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
help: PLUGIN_ADMIN.THEMES_NOTIFICATIONS_HELP
|
||||||
|
|
||||||
|
customization_tab:
|
||||||
|
type: tab
|
||||||
|
title: PLUGIN_ADMIN.CUSTOMIZATION
|
||||||
|
|
||||||
|
fields:
|
||||||
|
whitelabel.logos:
|
||||||
|
type: section
|
||||||
|
underline: true
|
||||||
|
title: PLUGIN_ADMIN.LOGOS
|
||||||
|
|
||||||
|
whitelabel.logo_login:
|
||||||
|
type: file
|
||||||
|
label: PLUGIN_ADMIN.LOGIN_SCREEN_CUSTOM_LOGO_LABEL
|
||||||
|
destination: 'user://assets'
|
||||||
|
accept:
|
||||||
|
- image/*
|
||||||
|
|
||||||
|
whitelabel.logo_custom:
|
||||||
|
type: file
|
||||||
|
label: PLUGIN_ADMIN.TOP_LEFT_CUSTOM_LOGO_LABEL
|
||||||
|
destination: 'user://assets'
|
||||||
|
accept:
|
||||||
|
- image/*
|
||||||
|
|
||||||
|
codemirror_section:
|
||||||
|
type: section
|
||||||
|
underline: true
|
||||||
|
title: PLUGIN_ADMIN.CODEMIRROR
|
||||||
|
|
||||||
|
whitelabel.codemirror_theme:
|
||||||
|
type: select
|
||||||
|
label: PLUGIN_ADMIN.CODEMIRROR_THEME
|
||||||
|
default: paper
|
||||||
|
markdown: true
|
||||||
|
data-options@: '\Grav\Plugin\AdminPlugin::themeOptions'
|
||||||
|
description: PLUGIN_ADMIN.CODEMIRROR_THEME_DESC
|
||||||
|
|
||||||
|
whitelabel.codemirror_fontsize:
|
||||||
|
type: select
|
||||||
|
label: PLUGIN_ADMIN.CODEMIRROR_FONTSIZE
|
||||||
|
default: md
|
||||||
|
options:
|
||||||
|
sm: PLUGIN_ADMIN.CODEMIRROR_FONTSIZE_SM
|
||||||
|
md: PLUGIN_ADMIN.CODEMIRROR_FONTSIZE_MD
|
||||||
|
lg: PLUGIN_ADMIN.CODEMIRROR_FONTSIZE_LG
|
||||||
|
|
||||||
|
whitelabel.codemirror_md_font:
|
||||||
|
type: select
|
||||||
|
label: PLUGIN_ADMIN.CODEMIRROR_MD_FONT
|
||||||
|
default: sans
|
||||||
|
options:
|
||||||
|
sans: PLUGIN_ADMIN.CODEMIRROR_MD_FONT_SANS
|
||||||
|
mono: PLUGIN_ADMIN.CODEMIRROR_MD_FONT_MONO
|
||||||
|
|
||||||
|
customization_section:
|
||||||
|
type: section
|
||||||
|
underline: true
|
||||||
|
title: PLUGIN_ADMIN.CUSTOMIZATION
|
||||||
|
|
||||||
|
whitelabel.quicktray_recompile:
|
||||||
|
type: toggle
|
||||||
|
label: PLUGIN_ADMIN.QUICKTRAY_RECOMPILE
|
||||||
|
help: PLUGIN_ADMIN.QUICKTRAY_RECOMPILE_HELP
|
||||||
|
highlight: 0
|
||||||
|
default: 0
|
||||||
|
options:
|
||||||
|
1: PLUGIN_ADMIN.ENABLED
|
||||||
|
0: PLUGIN_ADMIN.DISABLED
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
whitelabel.color_scheme.name:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.COLOR_SCHEME_NAME
|
||||||
|
help: PLUGIN_ADMIN.COLOR_SCHEME_NAME_HELP
|
||||||
|
placeholder: PLUGIN_ADMIN.COLOR_SCHEME_NAME_PLACEHOLDER
|
||||||
|
|
||||||
|
themes-preview:
|
||||||
|
type: themepreview
|
||||||
|
ignore: true;
|
||||||
|
label: PLUGIN_ADMIN.PRESETS
|
||||||
|
style: vertical
|
||||||
|
|
||||||
|
colorschemes:
|
||||||
|
type: colorscheme
|
||||||
|
label: PLUGIN_ADMIN.COLOR_SCHEME_LABEL
|
||||||
|
style: vertical
|
||||||
|
help: PLUGIN_ADMIN.COLOR_SCHEME_HELP
|
||||||
|
|
||||||
|
fields:
|
||||||
|
whitelabel.color_scheme.colors.logo-bg:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#1e333e'
|
||||||
|
help: PLUGIN_ADMIN.LOGO_BG_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.logo-link:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#ffffff'
|
||||||
|
help: PLUGIN_ADMIN.LOGO_LINK_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.nav-bg:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#253a47'
|
||||||
|
help: PLUGIN_ADMIN.NAV_BG_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.nav-text:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#afc7d5'
|
||||||
|
help: PLUGIN_ADMIN.NAV_TEXT_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.nav-link:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#d1dee7'
|
||||||
|
help: PLUGIN_ADMIN.NAV_LINK_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.nav-selected-bg:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#2d4d5b'
|
||||||
|
help: PLUGIN_ADMIN.NAV_SELECTED_BG_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.nav-selected-link:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#ffffff'
|
||||||
|
help: PLUGIN_ADMIN.NAV_SELECTED_LINK_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.nav-hover-bg:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#1e333e'
|
||||||
|
help: PLUGIN_ADMIN.NAV_HOVER_BG_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.nav-hover-link:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#ffffff'
|
||||||
|
help: PLUGIN_ADMIN.NAV_HOVER_LINK_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.toolbar-bg:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#349886'
|
||||||
|
help: PLUGIN_ADMIN.TOOLBAR_BG_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.toolbar-text:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#ffffff'
|
||||||
|
help: PLUGIN_ADMIN.TOOLBAR_TEXT_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.page-bg:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#314d5b'
|
||||||
|
help: PLUGIN_ADMIN.PAGE_BG_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.page-text:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#81a5b5'
|
||||||
|
help: PLUGIN_ADMIN.PAGE_TEXT_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.page-link:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#aad9ed'
|
||||||
|
help: PLUGIN_ADMIN.PAGE_LINK_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.content-bg:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#eeeeee'
|
||||||
|
help: PLUGIN_ADMIN.CONTENT_BG_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.content-text:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#737c81'
|
||||||
|
help: PLUGIN_ADMIN.CONTENT_TEXT_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.content-link:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#0082ba'
|
||||||
|
help: PLUGIN_ADMIN.CONTENT_LINK_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.content-link2:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#da4b46'
|
||||||
|
help: PLUGIN_ADMIN.CONTENT_LINK2_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.content-header:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#314d5b'
|
||||||
|
help: PLUGIN_ADMIN.CONTENT_HEADER_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.content-tabs-bg:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#223a47'
|
||||||
|
help: PLUGIN_ADMIN.CONTENT_TABS_BG_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.content-tabs-text:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#d1dee7'
|
||||||
|
help: PLUGIN_ADMIN.CONTENT_TABS_TEXT_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.content-highlight:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#ffffd7'
|
||||||
|
help: PLUGIN_ADMIN.CONTENT_HIGHLIGHT_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.button-bg:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#41bea8'
|
||||||
|
help: PLUGIN_ADMIN.BUTTON_BG_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.button-text:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#ffffff'
|
||||||
|
help: PLUGIN_ADMIN.BUTTON_TEXT_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.notice-bg:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#00a6cf'
|
||||||
|
help: PLUGIN_ADMIN.NOTICE_BG_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.notice-text:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#ffffff'
|
||||||
|
help: PLUGIN_ADMIN.NOTICE_TEXT_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.update-bg:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#8f5aad'
|
||||||
|
help: PLUGIN_ADMIN.UPDATES_BG_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.update-text:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#ffffff'
|
||||||
|
help: PLUGIN_ADMIN.UPDATES_TEXT_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.critical-bg:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#da4b46'
|
||||||
|
help: PLUGIN_ADMIN.CRITICAL_BG_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.colors.critical-text:
|
||||||
|
type: colorscheme.color
|
||||||
|
default: '#ffffff'
|
||||||
|
help: PLUGIN_ADMIN.CRITICAL_TEXT_HELP
|
||||||
|
|
||||||
|
whitelabel.color_scheme.accents.primary-accent:
|
||||||
|
type: select
|
||||||
|
size: medium
|
||||||
|
classes: fancy
|
||||||
|
label: PLUGIN_ADMIN.PRIMARY_ACCENT_LABEL
|
||||||
|
help: PLUGIN_ADMIN.PRIMARY_ACCENT_HELP
|
||||||
|
options:
|
||||||
|
button: PLUGIN_ADMIN.BUTTON_COLORS
|
||||||
|
content: PLUGIN_ADMIN.CONTENT_COLORS
|
||||||
|
tabs: PLUGIN_ADMIN.TABS_COLORS
|
||||||
|
critical: PLUGIN_ADMIN.CRITICAL_COLORS
|
||||||
|
logo: PLUGIN_ADMIN.LOGO_COLORS
|
||||||
|
nav: PLUGIN_ADMIN.NAV_COLORS
|
||||||
|
notice: PLUGIN_ADMIN.NOTICE_COLORS
|
||||||
|
page: PLUGIN_ADMIN.PAGE_COLORS
|
||||||
|
toolbar: PLUGIN_ADMIN.TOOLBAR_COLORS
|
||||||
|
update: PLUGIN_ADMIN.UPDATE_COLORS
|
||||||
|
|
||||||
|
whitelabel.color_scheme.accents.secondary-accent:
|
||||||
|
type: select
|
||||||
|
size: medium
|
||||||
|
classes: fancy
|
||||||
|
label: PLUGIN_ADMIN.SECONDARY_ACCENT_LABEL
|
||||||
|
help: PLUGIN_ADMIN.SECONDARY_ACCENT_HELP
|
||||||
|
options:
|
||||||
|
button: PLUGIN_ADMIN.BUTTON_COLORS
|
||||||
|
content: PLUGIN_ADMIN.CONTENT_COLORS
|
||||||
|
tabs: PLUGIN_ADMIN.TABS_COLORS
|
||||||
|
critical: PLUGIN_ADMIN.CRITICAL_COLORS
|
||||||
|
logo: PLUGIN_ADMIN.LOGO_COLORS
|
||||||
|
nav: PLUGIN_ADMIN.NAV_COLORS
|
||||||
|
notice: PLUGIN_ADMIN.NOTICE_COLORS
|
||||||
|
page: PLUGIN_ADMIN.PAGE_COLORS
|
||||||
|
toolbar: PLUGIN_ADMIN.TOOLBAR_COLORS
|
||||||
|
update: PLUGIN_ADMIN.UPDATE_COLORS
|
||||||
|
|
||||||
|
whitelabel.color_scheme.accents.tertiary-accent:
|
||||||
|
type: select
|
||||||
|
size: medium
|
||||||
|
classes: fancy
|
||||||
|
label: PLUGIN_ADMIN.TERTIARY_ACCENT_LABEL
|
||||||
|
help: PLUGIN_ADMIN.TERTIARY_ACCENT_HELP
|
||||||
|
options:
|
||||||
|
button: PLUGIN_ADMIN.BUTTON_COLORS
|
||||||
|
content: PLUGIN_ADMIN.CONTENT_COLORS
|
||||||
|
tabs: PLUGIN_ADMIN.TABS_COLORS
|
||||||
|
critical: PLUGIN_ADMIN.CRITICAL_COLORS
|
||||||
|
logo: PLUGIN_ADMIN.LOGO_COLORS
|
||||||
|
nav: PLUGIN_ADMIN.NAV_COLORS
|
||||||
|
notice: PLUGIN_ADMIN.NOTICE_COLORS
|
||||||
|
page: PLUGIN_ADMIN.PAGE_COLORS
|
||||||
|
toolbar: PLUGIN_ADMIN.TOOLBAR_COLORS
|
||||||
|
update: PLUGIN_ADMIN.UPDATE_COLORS
|
||||||
|
|
||||||
|
whitelabel.custom_footer:
|
||||||
|
type: textarea
|
||||||
|
rows: 2
|
||||||
|
label: PLUGIN_ADMIN.CUSTOM_FOOTER
|
||||||
|
help: PLUGIN_ADMIN.CUSTOM_FOOTER_HELP
|
||||||
|
placeholder: PLUGIN_ADMIN.CUSTOM_FOOTER_PLACEHOLDER
|
||||||
|
|
||||||
|
|
||||||
|
whitelabel.custom_css:
|
||||||
|
label: PLUGIN_ADMIN.CUSTOM_CSS_LABEL
|
||||||
|
placeholder: PLUGIN_ADMIN.CUSTOM_CSS_PLACEHOLDER
|
||||||
|
help: PLUGIN_ADMIN.CUSTOM_CSS_HELP
|
||||||
|
type: editor
|
||||||
|
codemirror:
|
||||||
|
mode: 'css'
|
||||||
|
indentUnit: 2
|
||||||
|
indentWithTabs: true
|
||||||
|
lineNumbers: true
|
||||||
|
styleActiveLine: true
|
||||||
|
|
||||||
|
whitelabel.custom_presets:
|
||||||
|
label: PLUGIN_ADMIN.CUSTOM_PRESETS
|
||||||
|
help: PLUGIN_ADMIN.CUSTOM_PRESETS_HELP
|
||||||
|
placeholder: PLUGIN_ADMIN.CUSTOM_PRESETS_PLACEHOLDER
|
||||||
|
type: editor
|
||||||
|
codemirror:
|
||||||
|
mode: 'yaml'
|
||||||
|
indentUnit: 2
|
||||||
|
indentWithTabs: false
|
||||||
|
lineNumbers: true
|
||||||
|
styleActiveLine: true
|
||||||
|
gutters: ['CodeMirror-lint-markers']
|
||||||
|
lint: true
|
||||||
|
|
||||||
|
extras_tab:
|
||||||
|
type: tab
|
||||||
|
title: PLUGIN_ADMIN.EXTRAS
|
||||||
|
|
||||||
|
fields:
|
||||||
|
|
||||||
|
Popularity:
|
||||||
|
type: section
|
||||||
|
title: PLUGIN_ADMIN.POPULARITY
|
||||||
|
underline: true
|
||||||
|
|
||||||
|
popularity.enabled:
|
||||||
|
type: toggle
|
||||||
|
label: PLUGIN_ADMIN.VISITOR_TRACKING
|
||||||
|
highlight: 1
|
||||||
|
default: 1
|
||||||
|
options:
|
||||||
|
1: PLUGIN_ADMIN.ENABLED
|
||||||
|
0: PLUGIN_ADMIN.DISABLED
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
help: PLUGIN_ADMIN.VISITOR_TRACKING_HELP
|
||||||
|
|
||||||
|
dashboard.days_of_stats:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.DAYS_OF_STATS
|
||||||
|
append: days
|
||||||
|
size: x-small
|
||||||
|
default: 7
|
||||||
|
help: PLUGIN_ADMIN.DAYS_OF_STATS_HELP
|
||||||
|
validate:
|
||||||
|
type: int
|
||||||
|
|
||||||
|
popularity.ignore:
|
||||||
|
type: array
|
||||||
|
label: PLUGIN_ADMIN.IGNORE_URLS
|
||||||
|
size: large
|
||||||
|
help: PLUGIN_ADMIN.IGNORE_URLS_HELP
|
||||||
|
default: ['/test*','/modular']
|
||||||
|
value_only: true
|
||||||
|
placeholder_value: /ignore-this-route
|
||||||
|
|
||||||
|
popularity.history.daily:
|
||||||
|
type: hidden
|
||||||
|
label: PLUGIN_ADMIN.DAILY_HISTORY
|
||||||
|
default: 30
|
||||||
|
|
||||||
|
popularity.history.monthly:
|
||||||
|
type: hidden
|
||||||
|
label: PLUGIN_ADMIN.MONTHLY_HISTORY
|
||||||
|
default: 12
|
||||||
|
|
||||||
|
popularity.history.visitors:
|
||||||
|
type: hidden
|
||||||
|
label: PLUGIN_ADMIN.VISITORS_HISTORY
|
||||||
|
default: 20
|
||||||
|
|
||||||
|
MediaResize:
|
||||||
|
type: section
|
||||||
|
title: PLUGIN_ADMIN.MEDIA_RESIZE
|
||||||
|
underline: true
|
||||||
|
|
||||||
|
MediaResizeNote:
|
||||||
|
type: spacer
|
||||||
|
text: PLUGIN_ADMIN.PAGEMEDIA_RESIZER
|
||||||
|
markdown: true
|
||||||
|
|
||||||
|
pagemedia.resize_width:
|
||||||
|
type: number
|
||||||
|
size: x-small
|
||||||
|
append: PLUGIN_ADMIN.PIXELS
|
||||||
|
label: PLUGIN_ADMIN.RESIZE_WIDTH
|
||||||
|
default: 0
|
||||||
|
validate:
|
||||||
|
type: number
|
||||||
|
help: PLUGIN_ADMIN.RESIZE_WIDTH_HELP
|
||||||
|
|
||||||
|
pagemedia.resize_height:
|
||||||
|
type: number
|
||||||
|
size: x-small
|
||||||
|
append: PLUGIN_ADMIN.PIXELS
|
||||||
|
label: PLUGIN_ADMIN.RESIZE_HEIGHT
|
||||||
|
default: 0
|
||||||
|
validate:
|
||||||
|
type: number
|
||||||
|
help: PLUGIN_ADMIN.RESIZE_HEIGHT_HELP
|
||||||
|
|
||||||
|
pagemedia.res_min_width:
|
||||||
|
type: number
|
||||||
|
size: x-small
|
||||||
|
append: PLUGIN_ADMIN.PIXELS
|
||||||
|
label: PLUGIN_ADMIN.RES_MIN_WIDTH
|
||||||
|
default: 0
|
||||||
|
validate:
|
||||||
|
type: number
|
||||||
|
help: PLUGIN_ADMIN.RES_MIN_WIDTH_HELP
|
||||||
|
|
||||||
|
pagemedia.res_min_height:
|
||||||
|
type: number
|
||||||
|
size: x-small
|
||||||
|
append: PLUGIN_ADMIN.PIXELS
|
||||||
|
label: PLUGIN_ADMIN.RES_MIN_HEIGHT
|
||||||
|
default: 0
|
||||||
|
validate:
|
||||||
|
type: number
|
||||||
|
help: PLUGIN_ADMIN.RES_MIN_HEIGHT_HELP
|
||||||
|
|
||||||
|
pagemedia.res_max_width:
|
||||||
|
type: number
|
||||||
|
size: x-small
|
||||||
|
append: PLUGIN_ADMIN.PIXELS
|
||||||
|
label: PLUGIN_ADMIN.RES_MAX_WIDTH
|
||||||
|
default: 0
|
||||||
|
validate:
|
||||||
|
type: number
|
||||||
|
help: PLUGIN_ADMIN.RES_MAX_WIDTH_HELP
|
||||||
|
|
||||||
|
pagemedia.res_max_height:
|
||||||
|
type: number
|
||||||
|
size: x-small
|
||||||
|
append: PLUGIN_ADMIN.PIXELS
|
||||||
|
label: PLUGIN_ADMIN.RES_MAX_HEIGHT
|
||||||
|
default: 0
|
||||||
|
validate:
|
||||||
|
type: number
|
||||||
|
help: PLUGIN_ADMIN.RES_MAX_HEIGHT_HELP
|
||||||
|
|
||||||
|
pagemedia.resize_quality:
|
||||||
|
type: number
|
||||||
|
size: x-small
|
||||||
|
append: 0...1
|
||||||
|
label: PLUGIN_ADMIN.RESIZE_QUALITY
|
||||||
|
default: 0.8
|
||||||
|
validate:
|
||||||
|
type: number
|
||||||
|
step: 0.01
|
||||||
|
help: PLUGIN_ADMIN.RESIZE_QUALITY_HELP
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
rules:
|
||||||
|
slug:
|
||||||
|
pattern: '[a-zA-Zа-яA-Я0-9_\-]+'
|
||||||
|
min: 1
|
||||||
|
max: 200
|
||||||
|
|
||||||
|
form:
|
||||||
|
validation: loose
|
||||||
|
fields:
|
||||||
|
|
||||||
|
section:
|
||||||
|
type: section
|
||||||
|
title: PLUGIN_ADMIN.COPY_PAGE
|
||||||
|
|
||||||
|
title:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.PAGE_TITLE
|
||||||
|
help: PLUGIN_ADMIN.PAGE_TITLE_HELP
|
||||||
|
validate:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
folder:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.FOLDER_NAME
|
||||||
|
help: PLUGIN_ADMIN.FOLDER_NAME_HELP
|
||||||
|
validate:
|
||||||
|
rule: slug
|
||||||
|
required: true
|
||||||
|
|
||||||
|
header.published:
|
||||||
|
id: move-header-published
|
||||||
|
type: toggle
|
||||||
|
label: PLUGIN_ADMIN.PUBLISHED
|
||||||
|
help: PLUGIN_ADMIN.PUBLISHED_HELP
|
||||||
|
highlight: ''
|
||||||
|
default: ''
|
||||||
|
size: medium
|
||||||
|
options:
|
||||||
|
'': PLUGIN_ADMIN.AUTO
|
||||||
|
1: PLUGIN_ADMIN.YES
|
||||||
|
0: PLUGIN_ADMIN.NO
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
rules:
|
||||||
|
slug:
|
||||||
|
pattern: '[a-zA-Zа-яA-Я0-9_\-]+'
|
||||||
|
min: 1
|
||||||
|
max: 200
|
||||||
|
|
||||||
|
form:
|
||||||
|
validation: loose
|
||||||
|
fields:
|
||||||
|
|
||||||
|
section:
|
||||||
|
type: section
|
||||||
|
title: PLUGIN_ADMIN.ADD_MODULE_CONTENT
|
||||||
|
|
||||||
|
title:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.PAGE_TITLE
|
||||||
|
validate:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
folder:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.FOLDER_NAME
|
||||||
|
validate:
|
||||||
|
rule: slug
|
||||||
|
required: true
|
||||||
|
|
||||||
|
route:
|
||||||
|
type: parents
|
||||||
|
label: PLUGIN_ADMIN.PAGE
|
||||||
|
classes: fancy
|
||||||
|
validate:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
name:
|
||||||
|
type: select
|
||||||
|
classes: fancy
|
||||||
|
label: PLUGIN_ADMIN.MODULE_TEMPLATE
|
||||||
|
help: PLUGIN_ADMIN.PAGE_FILE_HELP
|
||||||
|
default: default
|
||||||
|
data-options@: '\Grav\Plugin\AdminPlugin::pagesModularTypes'
|
||||||
|
validate:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
modular:
|
||||||
|
type: hidden
|
||||||
|
default: 1
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
|
||||||
|
blueprint:
|
||||||
|
type: blueprint
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
rules:
|
||||||
|
slug:
|
||||||
|
pattern: '[a-zA-Zа-яA-Я0-9_\-]+'
|
||||||
|
min: 1
|
||||||
|
max: 200
|
||||||
|
|
||||||
|
form:
|
||||||
|
validation: loose
|
||||||
|
fields:
|
||||||
|
|
||||||
|
tabs:
|
||||||
|
type: tabs
|
||||||
|
active: 1
|
||||||
|
|
||||||
|
fields:
|
||||||
|
content:
|
||||||
|
type: tab
|
||||||
|
title: PLUGIN_ADMIN.CONTENT
|
||||||
|
|
||||||
|
fields:
|
||||||
|
xss_check:
|
||||||
|
type: xss
|
||||||
|
|
||||||
|
frontmatter:
|
||||||
|
classes: frontmatter
|
||||||
|
type: editor
|
||||||
|
label: PLUGIN_ADMIN.FRONTMATTER
|
||||||
|
autofocus: true
|
||||||
|
codemirror:
|
||||||
|
mode: 'yaml'
|
||||||
|
indentUnit: 4
|
||||||
|
autofocus: true
|
||||||
|
indentWithTabs: false
|
||||||
|
lineNumbers: true
|
||||||
|
styleActiveLine: true
|
||||||
|
gutters: ['CodeMirror-lint-markers']
|
||||||
|
lint: true
|
||||||
|
|
||||||
|
content:
|
||||||
|
type: markdown
|
||||||
|
|
||||||
|
header.media_order:
|
||||||
|
type: pagemedia
|
||||||
|
label: PLUGIN_ADMIN.PAGE_MEDIA
|
||||||
|
|
||||||
|
options:
|
||||||
|
type: tab
|
||||||
|
title: PLUGIN_ADMIN.OPTIONS
|
||||||
|
|
||||||
|
fields:
|
||||||
|
|
||||||
|
columns:
|
||||||
|
type: columns
|
||||||
|
|
||||||
|
fields:
|
||||||
|
column1:
|
||||||
|
type: column
|
||||||
|
|
||||||
|
fields:
|
||||||
|
|
||||||
|
ordering:
|
||||||
|
type: toggle
|
||||||
|
label: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX
|
||||||
|
help: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX_HELP
|
||||||
|
highlight: 1
|
||||||
|
options:
|
||||||
|
1: PLUGIN_ADMIN.ENABLED
|
||||||
|
0: PLUGIN_ADMIN.DISABLED
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
|
||||||
|
folder:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.FILENAME
|
||||||
|
validate:
|
||||||
|
rule: slug
|
||||||
|
required: true
|
||||||
|
|
||||||
|
route:
|
||||||
|
type: parents
|
||||||
|
label: PLUGIN_ADMIN.PARENT
|
||||||
|
classes: fancy
|
||||||
|
validate:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
name:
|
||||||
|
type: select
|
||||||
|
classes: fancy
|
||||||
|
label: PLUGIN_ADMIN.MODULE_TEMPLATE
|
||||||
|
default: default
|
||||||
|
data-options@: '\Grav\Plugin\AdminPlugin::pagesModularTypes'
|
||||||
|
validate:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
column2:
|
||||||
|
type: column
|
||||||
|
|
||||||
|
fields:
|
||||||
|
order:
|
||||||
|
type: order
|
||||||
|
label: PLUGIN_ADMIN.ORDERING
|
||||||
|
|
||||||
|
blueprint:
|
||||||
|
type: blueprint
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
form:
|
||||||
|
validation: loose
|
||||||
|
fields:
|
||||||
|
route:
|
||||||
|
type: hidden
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
rules:
|
||||||
|
slug:
|
||||||
|
pattern: '[a-zA-Zа-яA-Я0-9_\-]+'
|
||||||
|
min: 1
|
||||||
|
max: 200
|
||||||
|
|
||||||
|
form:
|
||||||
|
validation: loose
|
||||||
|
fields:
|
||||||
|
|
||||||
|
section:
|
||||||
|
type: section
|
||||||
|
title: PLUGIN_ADMIN.ADD_PAGE
|
||||||
|
|
||||||
|
title:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.PAGE_TITLE
|
||||||
|
help: PLUGIN_ADMIN.PAGE_TITLE_HELP
|
||||||
|
validate:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
folder:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.FOLDER_NAME
|
||||||
|
help: PLUGIN_ADMIN.FOLDER_NAME_HELP
|
||||||
|
validate:
|
||||||
|
rule: slug
|
||||||
|
required: true
|
||||||
|
|
||||||
|
route:
|
||||||
|
type: parents
|
||||||
|
label: PLUGIN_ADMIN.PARENT_PAGE
|
||||||
|
classes: fancy
|
||||||
|
validate:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
name:
|
||||||
|
type: select
|
||||||
|
classes: fancy
|
||||||
|
label: PLUGIN_ADMIN.PAGE_FILE
|
||||||
|
help: PLUGIN_ADMIN.PAGE_FILE_HELP
|
||||||
|
data-options@: '\Grav\Plugin\AdminPlugin::pagesTypes'
|
||||||
|
data-default@: '\Grav\Plugin\Admin\Admin::getLastPageName'
|
||||||
|
validate:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
visible:
|
||||||
|
type: toggle
|
||||||
|
label: PLUGIN_ADMIN.VISIBLE
|
||||||
|
help: PLUGIN_ADMIN.VISIBLE_HELP
|
||||||
|
highlight: ''
|
||||||
|
default: ''
|
||||||
|
options:
|
||||||
|
'': PLUGIN_ADMIN.AUTO
|
||||||
|
1: PLUGIN_ADMIN.YES
|
||||||
|
0: PLUGIN_ADMIN.NO
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
required: true
|
||||||
|
|
||||||
|
blueprint:
|
||||||
|
type: blueprint
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
rules:
|
||||||
|
slug:
|
||||||
|
pattern: '[a-zA-Zа-яA-Я0-9_\-]+'
|
||||||
|
min: 1
|
||||||
|
max: 200
|
||||||
|
|
||||||
|
form:
|
||||||
|
validation: loose
|
||||||
|
fields:
|
||||||
|
|
||||||
|
section:
|
||||||
|
type: section
|
||||||
|
title: PLUGIN_ADMIN.ADD_FOLDER
|
||||||
|
|
||||||
|
folder:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.FOLDER_NAME
|
||||||
|
help: PLUGIN_ADMIN.FOLDER_NAME_HELP
|
||||||
|
validate:
|
||||||
|
rule: slug
|
||||||
|
required: true
|
||||||
|
|
||||||
|
route:
|
||||||
|
type: parents
|
||||||
|
label: PLUGIN_ADMIN.PARENT_PAGE
|
||||||
|
classes: fancy
|
||||||
|
validate:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
blueprint:
|
||||||
|
type: blueprint
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
rules:
|
||||||
|
slug:
|
||||||
|
pattern: '[a-zA-Zа-яA-Я0-9_\-]+'
|
||||||
|
min: 1
|
||||||
|
max: 200
|
||||||
|
|
||||||
|
form:
|
||||||
|
validation: loose
|
||||||
|
fields:
|
||||||
|
|
||||||
|
tabs:
|
||||||
|
type: tabs
|
||||||
|
active: 1
|
||||||
|
|
||||||
|
fields:
|
||||||
|
content:
|
||||||
|
type: tab
|
||||||
|
title: PLUGIN_ADMIN.CONTENT
|
||||||
|
|
||||||
|
fields:
|
||||||
|
xss_check:
|
||||||
|
type: xss
|
||||||
|
|
||||||
|
frontmatter:
|
||||||
|
classes: frontmatter
|
||||||
|
type: editor
|
||||||
|
label: PLUGIN_ADMIN.FRONTMATTER
|
||||||
|
autofocus: true
|
||||||
|
codemirror:
|
||||||
|
mode: 'yaml'
|
||||||
|
indentUnit: 4
|
||||||
|
autofocus: true
|
||||||
|
indentWithTabs: false
|
||||||
|
lineNumbers: true
|
||||||
|
styleActiveLine: true
|
||||||
|
gutters: ['CodeMirror-lint-markers']
|
||||||
|
lint: true
|
||||||
|
|
||||||
|
content:
|
||||||
|
type: codemirror
|
||||||
|
|
||||||
|
header.media_order:
|
||||||
|
type: pagemedia
|
||||||
|
label: PLUGIN_ADMIN.PAGE_MEDIA
|
||||||
|
|
||||||
|
options:
|
||||||
|
type: tab
|
||||||
|
title: PLUGIN_ADMIN.OPTIONS
|
||||||
|
|
||||||
|
fields:
|
||||||
|
|
||||||
|
columns:
|
||||||
|
type: columns
|
||||||
|
|
||||||
|
fields:
|
||||||
|
column1:
|
||||||
|
type: column
|
||||||
|
|
||||||
|
fields:
|
||||||
|
|
||||||
|
ordering:
|
||||||
|
type: toggle
|
||||||
|
label: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX
|
||||||
|
help: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX_HELP
|
||||||
|
highlight: 1
|
||||||
|
options:
|
||||||
|
1: PLUGIN_ADMIN.ENABLED
|
||||||
|
0: PLUGIN_ADMIN.DISABLED
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
|
||||||
|
folder:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.FOLDER_NAME
|
||||||
|
help: PLUGIN_ADMIN.FOLDER_NAME_HELP
|
||||||
|
validate:
|
||||||
|
rule: slug
|
||||||
|
required: true
|
||||||
|
|
||||||
|
route:
|
||||||
|
type: parents
|
||||||
|
label: PLUGIN_ADMIN.PARENT
|
||||||
|
classes: fancy
|
||||||
|
|
||||||
|
name:
|
||||||
|
type: select
|
||||||
|
classes: fancy
|
||||||
|
label: PLUGIN_ADMIN.DISPLAY_TEMPLATE
|
||||||
|
help: PLUGIN_ADMIN.DISPLAY_TEMPLATE_HELP
|
||||||
|
default: default
|
||||||
|
data-options@: '\Grav\Plugin\AdminPlugin::pagesTypes'
|
||||||
|
validate:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
column2:
|
||||||
|
type: column
|
||||||
|
|
||||||
|
fields:
|
||||||
|
order:
|
||||||
|
type: order
|
||||||
|
label: PLUGIN_ADMIN.ORDERING
|
||||||
|
|
||||||
|
blueprint:
|
||||||
|
type: blueprint
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
rules:
|
||||||
|
slug:
|
||||||
|
pattern: '[a-zA-Zа-яA-Я0-9_\-]+'
|
||||||
|
min: 1
|
||||||
|
max: 200
|
||||||
|
|
||||||
|
form:
|
||||||
|
validation: loose
|
||||||
|
fields:
|
||||||
|
|
||||||
|
tabs:
|
||||||
|
type: tabs
|
||||||
|
active: 1
|
||||||
|
|
||||||
|
fields:
|
||||||
|
content:
|
||||||
|
type: tab
|
||||||
|
title: PLUGIN_ADMIN.CONTENT
|
||||||
|
|
||||||
|
fields:
|
||||||
|
frontmatter:
|
||||||
|
classes: frontmatter
|
||||||
|
type: editor
|
||||||
|
label: PLUGIN_ADMIN.FRONTMATTER
|
||||||
|
autofocus: true
|
||||||
|
codemirror:
|
||||||
|
mode: 'yaml'
|
||||||
|
indentUnit: 4
|
||||||
|
autofocus: true
|
||||||
|
indentWithTabs: false
|
||||||
|
lineNumbers: true
|
||||||
|
styleActiveLine: true
|
||||||
|
gutters: ['CodeMirror-lint-markers']
|
||||||
|
lint: true
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
title: PLUGIN_ADMIN.MEDIA
|
||||||
|
form:
|
||||||
|
validation: loose
|
||||||
|
fields:
|
||||||
|
'types':
|
||||||
|
name: medias
|
||||||
|
type: list
|
||||||
|
label: PLUGIN_ADMIN.MEDIA_TYPES
|
||||||
|
style: vertical
|
||||||
|
key: extension
|
||||||
|
controls: both
|
||||||
|
collapsed: true
|
||||||
|
|
||||||
|
fields:
|
||||||
|
.extension:
|
||||||
|
type: key
|
||||||
|
label: PLUGIN_ADMIN.FILE_EXTENSION
|
||||||
|
.type:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.TYPE
|
||||||
|
.thumb:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.THUMB
|
||||||
|
.mime:
|
||||||
|
type: text
|
||||||
|
label: PLUGIN_ADMIN.MIME_TYPE
|
||||||
|
validate:
|
||||||
|
type: lower
|
||||||
|
.image:
|
||||||
|
type: textarea
|
||||||
|
yaml: true
|
||||||
|
label: PLUGIN_ADMIN.IMAGE_OPTIONS
|
||||||
|
validate:
|
||||||
|
type: yaml
|
||||||
|
|
||||||
|
|
||||||