initial commit

This commit is contained in:
isUnknown 2026-02-09 08:36:12 +01:00
commit 9439de0603
600 changed files with 124248 additions and 0 deletions

22
.editorconfig Normal file
View file

@ -0,0 +1,22 @@
[*.{css,scss,less,js,json,ts,sass,html,hbs,mustache,phtml,html.twig,md,yml}]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
indent_size = 4
trim_trailing_whitespace = false
[site/templates/**.php]
indent_size = 2
[site/snippets/**.php]
indent_size = 2
[package.json,.{babelrc,editorconfig,eslintrc,lintstagedrc,stylelintrc}]
indent_style = space
indent_size = 2

73
.gitignore vendored Normal file
View file

@ -0,0 +1,73 @@
# System files
# ------------
Icon
.DS_Store
# Temporary files
# ---------------
/media/*
!/media/index.html
# Lock files
# ---------------
.lock
# Editors
# (sensitive workspace files)
# ---------------------------
*.sublime-workspace
/.vscode
/.idea
# -------------SECURITY-------------
# NEVER publish these files via Git!
# -------------SECURITY-------------
# Cache Files
# ---------------
/site/cache/*
!/site/cache/index.html
# Accounts
# ---------------
/site/accounts/*
!/site/accounts/index.html
# Sessions
# ---------------
/site/sessions/*
!/site/sessions/index.html
# License
# ---------------
/site/config/.license
# Content
# ---------------
/content
# Claude settings
# ---------------
/.claude
# Node.js
# ---------------
node_modules/
npm-debug.log*
*.log
# Build
# ---------------
dist/
node_modules/

62
.htaccess Normal file
View file

@ -0,0 +1,62 @@
# Kirby .htaccess
# revision 2020-06-15
# rewrite rules
<IfModule mod_rewrite.c>
# http -> https
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://dataarchitectes.com/$1 [R,L]
# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
RewriteEngine on
# make sure to set the RewriteBase correctly
# if you are running the site in a subfolder;
# otherwise links or the entire site will break.
#
# If your homepage is http://yourdomain.com/mysite,
# set the RewriteBase to:
#
# RewriteBase /mysite
# In some environments it's necessary to
# set the RewriteBase to:
#
# RewriteBase /
# block files and folders beginning with a dot, such as .git
# except for the .well-known folder, which is used for Let's Encrypt and security.txt
RewriteRule (^|/)\.(?!well-known\/) index.php [L]
# block all files in the content folder from being accessed directly
RewriteRule ^content/(.*) index.php [L]
# block all files in the site folder from being accessed directly
RewriteRule ^site/(.*) index.php [L]
# block direct access to Kirby and the Panel sources
RewriteRule ^kirby/(.*) index.php [L]
# make site links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]
</IfModule>
# pass the Authorization header to PHP
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
# compress text file responses
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>

82
README.md Normal file
View file

@ -0,0 +1,82 @@
# Kirby Plainkit
Kirby is a file-based CMS.
Easy to setup. Easy to use. Flexible as hell.
## Trial
You can try Kirby on your local machine or on a test
server as long as you need to make sure it is the right
tool for your next project.
## Buy a license
You can purchase your Kirby license at
<https://getkirby.com/buy>
A Kirby license is valid for a single domain. You can find
Kirby's license agreement here: <https://getkirby.com/license>
## The Plainkit
Kirby's Plainkit is the most minimal setup you can get started with.
It does not include any content, styles or other kinds of decoration,
so it's perfect to use this as a starting point for your own project.
## The Panel
You can find the login for Kirby's admin interface at
http://yourdomain.com/panel. You will be guided through the signup
process for your first user, when you visit the panel
for the first time.
## Installation
Kirby does not require a database, which makes it very easy to
install. Just copy Kirby's files to your server and visit the
URL for your website in the browser.
**Please check if the invisible .htaccess file has been
copied to your server correctly**
### Requirements
Kirby runs on PHP 7.1+, Apache or Nginx.
### Download
You can download the latest version of the Plainkit
from https://github.com/getkirby/plainkit/archive/master.zip
### With Git
If you are familiar with Git, you can clone Kirby's
Plainkit repository from Github.
git clone https://github.com/getkirby/plainkit.git
## Documentation
<https://getkirby.com/docs>
## Issues
If you have a Github account, please report issues
directly on Github: <https://github.com/getkirby/kirby/issues>
Otherwise you can use Kirby's forum: https://forum.getkirby.com
or send us an email: <support@getkirby.com>
## Ideas & Feature Requests
If you have ideas for new features, please submit a ticket in our ideas repository:
<https://github.com/getkirby/kirby/ideas>
## Support
<https://getkirby.com/support>
## Copyright
© 2009-2019 Bastian Allgeier (Bastian Allgeier GmbH)
<https://getkirby.com>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,72 @@
/*! Generated by Font Squirrel (https://www.fontsquirrel.com) on October 19, 2020 */
@font-face {
font-family: 'nimbus_sans_lbold';
src: url('nimbussans-bol.woff2') format('woff2'),
url('nimbussans-bol.woff') format('woff');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'nimbus_sans_lbold_italic';
src: url('nimbussans-bolita.woff2') format('woff2'),
url('nimbussans-bolita.woff') format('woff');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'nimbus_sans_d_otlight';
src: url('nimbussans-light.woff2') format('woff2'),
url('nimbussans-light.woff') format('woff');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'nimbus_sans_lregular';
src: url('nimbussans-reg.woff2') format('woff2'),
url('nimbussans-reg.woff') format('woff');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'nimbus_sans_lregular_italic';
src: url('nimbussans-regita.woff2') format('woff2'),
url('nimbussans-regita.woff') format('woff');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'nimbus_sans_d_otultra_light';
src: url('nimbussans-ultralight.woff2') format('woff2'),
url('nimbussans-ultralight.woff') format('woff');
font-weight: normal;
font-style: normal;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 802 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 853 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 638 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 804 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 KiB

0
assets/images/Icon� Normal file
View file

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 809 B

3
assets/images/circle.svg Normal file
View file

@ -0,0 +1,3 @@
<svg width="10" height="10" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="8.5" cy="8.09998" r="8" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 153 B

BIN
assets/images/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
assets/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

5
assets/images/next.svg Normal file
View file

@ -0,0 +1,5 @@
<svg width="38" height="32" viewBox="0 0 38 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.5 13.75H32V18.75H0.5V13.75Z" fill="black"/>
<path d="M19.3345 28.0845L34.5845 12.8345L38.12 16.37L22.87 31.62L19.3345 28.0845Z" fill="black"/>
<path d="M34.6072 19.8928L18.9999 4.28553L22.5355 0.75L38.1427 16.3573L34.6072 19.8928Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 361 B

5
assets/images/prev.svg Normal file
View file

@ -0,0 +1,5 @@
<svg width="38" height="32" viewBox="0 0 38 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M38.1427 18.62L6.6427 18.62L6.6427 13.62L38.1427 13.62L38.1427 18.62Z" fill="black"/>
<path d="M19.3082 4.28549L4.0582 19.5355L0.522664 16L15.7727 0.749954L19.3082 4.28549Z" fill="black"/>
<path d="M4.03552 12.4772L19.6428 28.0845L16.1072 31.62L0.49999 16.0127L4.03552 12.4772Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 406 B

555
assets/js/main.js Normal file
View file

@ -0,0 +1,555 @@
"use strict";
var view;
window.scrollTo(0, 0);
document.addEventListener('DOMContentLoaded', function () {
window.onpopstate = function () {
window.location.href = window.location.href;
};
var mySwiper;
/* ====================
=======================
VIEW OBJECT
=======================
==================== */
view = {
transTime: 250,
title: document.querySelector('title').textContent,
url: document.querySelector('title').dataset.url,
description: document.querySelector('meta[description]').getAttribute('description'),
device: '',
state: 'grid',
scrollPos: 0,
prevState: {
type: 'none',
url: '',
title: ''
},
header: {
container: document.querySelector('.header'),
logo: document.querySelector('.header__logo'),
logoOriginSize: parseInt(window.getComputedStyle(document.querySelector('.header__logo')).getPropertyValue('font-size')),
logoBtn: document.querySelector('.logoBtn'),
size: 'big',
btns: {
enable: true,
container: document.querySelector('.header__views'),
size: document.querySelectorAll('.views__btn--smaller, .views__btn--bigger'),
smaller: document.querySelector('.views__btn--smaller'),
bigger: document.querySelector('.views__btn--bigger'),
close: document.querySelector('.views__btn--close'),
list: document.querySelector('.views__btn--mobile'),
toClose: function toClose() {
if (window.innerWidth > 800) {
view.header.btns.size.forEach(function (btn) {
btn.classList.add('hide');
setTimeout(function () {
btn.style.display = 'none';
}, view.transTime);
});
} else {
view.header.btns.list.classList.add('hide');
setTimeout(function () {
view.header.btns.list.style.display = 'none';
}, view.transTime);
}
setTimeout(function () {
view.header.btns.close.style.display = 'block';
view.header.btns.close.classList.remove('hide');
}, view.transTime);
},
toSize: function toSize() {
view.header.btns.close.classList.remove('hide');
setTimeout(function () {
view.header.btns.close.style.display = 'none';
view.header.btns.size.forEach(function (btn) {
btn.style.display = 'block';
setTimeout(function () {
btn.classList.remove('hide');
}, 50);
});
}, view.transTime);
},
toMobileSize: function toMobileSize() {
view.header.btns.close.classList.remove('hide');
setTimeout(function () {
view.header.btns.close.style.display = 'none';
view.header.btns.list.style.display = 'block';
if (view.scrollPos !== 0) {
setTimeout(function () {
view.header.btns.list.classList.remove('hide');
}, 50);
}
}, view.transTime);
}
},
reduce: function reduce() {
if (view.header.size === 'big') {
view.header.size = 'normal';
view.header.logo.classList.remove('header__logo--big');
view.header.container.classList.remove('header--big');
setTimeout(function () {
view.grid.container.classList.remove('grid--distant');
}, 100);
setTimeout(function () {
view.header.btns.container.classList.remove('header__views--unvisible');
view.header.size = 'normal';
}, view.transTime);
}
},
toInfo: function toInfo() {
view.header.logo.textContent = 'INFO';
},
toName: function toName() {
view.header.logo.textContent = 'DATA';
}
},
grid: {
container: document.querySelector('.grid'),
blocks: document.querySelectorAll('.block'),
images: document.querySelectorAll('.block__image'),
showBlocks: function showBlocks(block) {
var image = block.querySelector('.block__image');
if (image.complete) {
setTimeout(function () {
block.parentNode.classList.remove('toProject--wait');
setTimeout(function () {
block.classList.remove('hide');
}, view.transTime);
}, 100);
} else {
image.addEventListener('load', function () {
block.parentNode.classList.remove('toProject--wait');
setTimeout(function () {
block.classList.remove('hide');
}, view.transTime);
});
}
},
smaller: function smaller() {
if (view.state === 'grid' && view.header.btns.enable === true) {
if (view.grid.container.classList.contains('grid--0')) {
view.grid.container.classList.remove('grid--full');
view.grid.blocks.forEach(function (block) {
block.querySelector('.block__image').classList.remove('block__image--full');
});
view.grid.container.classList.remove('grid--0');
view.grid.container.classList.add('grid--1');
} else if (view.grid.container.classList.contains('grid--1')) {
view.grid.container.classList.remove('grid--1');
view.grid.container.classList.add('grid--2');
} else if (view.grid.container.classList.contains('grid--2')) {
view.grid.container.classList.remove('grid--2');
view.grid.container.classList.add('grid--3');
} else if (view.grid.container.classList.contains('grid--3')) {
view.grid.container.classList.remove('grid--3');
view.grid.container.classList.add('grid--4');
} else if (view.grid.container.classList.contains('grid--4')) {
view.grid.container.classList.remove('grid--4');
view.grid.container.classList.add('grid--5');
} else if (view.grid.container.classList.contains('grid--5')) {
view.grid.container.classList.remove('grid--5');
view.grid.container.classList.add('list');
view.list.init();
}
}
},
bigger: function bigger() {
if (view.state !== 'project' && view.header.btns.enable === true) {
view.header.btns.enable = false; // if (view.grid.container.classList.contains('grid--0') !== true) {
// view.grid.container.classList.add('hide')
// view.list.container.classList.add('hide')
// }
if (view.grid.container.classList.contains('list')) {
view.list.toGrid();
} else if (view.grid.container.classList.contains('grid--5')) {
view.grid.container.classList.remove('grid--5');
view.grid.container.classList.add('grid--4');
} else if (view.grid.container.classList.contains('grid--4')) {
view.grid.container.classList.remove('grid--4');
view.grid.container.classList.add('grid--3');
} else if (view.grid.container.classList.contains('grid--3')) {
view.grid.container.classList.remove('grid--3');
view.grid.container.classList.add('grid--2');
} else if (view.grid.container.classList.contains('grid--2')) {
view.grid.container.classList.remove('grid--2');
view.grid.container.classList.add('grid--1');
} else if (view.grid.container.classList.contains('grid--1')) {
view.grid.container.classList.remove('grid--1');
view.grid.container.classList.add('grid--0');
view.grid.blocks.forEach(function (block) {
view.grid.container.classList.add('grid--full');
block.querySelector('.block__image').classList.add('block__image--full');
});
}
setTimeout(function () {
view.grid.container.classList.remove('hide');
view.header.btns.enable = true;
}, 100);
}
},
projects: document.querySelectorAll('.toProject')
},
project: {
container: document.querySelector('.project'),
init: function init(link, title, toHide, toFill) {
view.prevState.type = view.state;
view.prevState.url = '';
view.prevState.title = '';
view.state = 'project';
history.pushState(null, title, link);
toHide.classList.add('hide');
fetch(link).then(function (res) {
return res.text();
}).then(function (html) {
var domElement = document.createElement('div');
domElement.classList.add('test-container');
domElement.innerHTML = html;
var projectContent = domElement.querySelector('.projectContainer').innerHTML;
toFill.innerHTML = projectContent;
view.project.swiper.init();
}).then(function () {
document.querySelector('.toProjectDesc').addEventListener('click', function () {
console.log(document.querySelectorAll('.swiper-slide').length - 2);
mySwiper.slideTo(document.querySelectorAll('.swiper-slide').length - 2);
});
setTimeout(function () {
toFill.style.display = 'block';
setTimeout(function () {
view.project.fadeIn(toHide, toFill);
}, 50);
}, view.transTime);
});
},
fadeIn: function fadeIn(toHide, toFill) {
toHide.style.display = 'none';
toFill.style.display = 'block';
toFill.classList.remove('hide');
toHide.removeEventListener('transitionend', view.project.fadeIn());
},
close: function close() {
history.pushState(null, view.title, view.url);
console.log("view.state : ".concat(view.state));
console.log("prevState : ".concat(view.prevState.type));
view.project.container.classList.add('hide');
setTimeout(function () {
view.project.container.style.display = 'none';
if (view.prevState.type === 'list') {
var toShow = window.innerWidth > 800 ? view.list.container : view.list.mobileContainer;
toShow.style.display = 'block';
setTimeout(function () {
toShow.classList.remove('hide');
view.state = 'list';
}, 50);
} else if (view.prevState.type === 'grid' || view.prevState.type === 'agency') {
if (view.grid.container.classList.contains('list')) {
window.innerWidth > 800 ? view.list.container.style.display = 'block' : view.list.mobileContainer.style.display = 'block';
setTimeout(function () {
window.innerWidth > 800 ? view.list.container.classList.remove('hide') : view.list.mobileContainer.classList.remove('hide');
view.state = 'list';
}, 50);
} else {
window.innerWidth > 800 ? view.grid.container.style.display = 'grid' : view.grid.container.style.display = 'block';
setTimeout(function () {
view.grid.container.classList.remove('hide');
view.state = 'grid';
}, 50);
}
} else if (view.prevState.type === 'project') {
view.project.swiper.destroy();
view.project.init(view.prevState.url, view.prevState.title, document.querySelector('.project'), document.querySelector('.project'));
}
}, view.transTime);
},
swiper: {
init: function init() {
mySwiper = new Swiper('.swiper-container', {
// Optional parameters
direction: 'horizontal',
loop: true,
observer: true,
observeSlideChildren: true,
observeParents: true,
speed: 300,
autoplay: {
delay: 2000
},
// Responsive
breakpoints: {
800: {
speed: 500,
autoplay: false
}
},
// Navigation arrows
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev'
},
// Keyboard control
keyboard: {
enabled: true
}
});
},
destroy: function destroy() {
mySwiper.destroy();
}
}
},
agency: {
init: function init(link, title, toHide, toFill) {
view.prevState.type = view.state;
if (view.state === 'grid' || view.state === 'list') {
view.prevState.url = '';
view.prevState.title = '';
} else if (view.state === 'project') {
view.prevState.url = window.location.href;
view.prevState.title = title;
}
view.state = 'agency';
history.pushState(null, title, link);
toHide.classList.add('hide');
fetch(link).then(function (res) {
return res.text();
}).then(function (html) {
var domElement = document.createElement('div');
domElement.classList.add('test-container');
domElement.innerHTML = html;
var pageContent = domElement.querySelector('.wrapper').innerHTML;
setTimeout(function () {
toFill.innerHTML = pageContent;
toFill.style.display = 'block';
setTimeout(function () {
view.project.fadeIn(toHide, toFill);
}, 50);
}, view.transTime);
});
}
},
list: {
container: document.querySelector('.list'),
mobileContainer: document.querySelector('.list--mobile'),
init: function init() {
var list = view.device === 'desktop' ? view.list.container : view.list.mobileContainer;
view.prevState.type = view.state;
view.prevState.url = '';
view.prevState.title = '';
view.state = 'list';
view.grid.container.style.display = 'none';
list.style.display = 'block';
setTimeout(function () {
list.classList.remove('hide');
}, 50);
},
toGrid: function toGrid() {
view.prevState.type = view.state;
view.state = 'grid';
view.grid.container.classList.remove('list');
view.grid.container.classList.add('grid--5');
window.innerWidth > 800 ? view.list.container.style.display = 'none' : view.list.mobileContainer.style.display = 'none';
view.grid.container.style.display = '';
}
}
};
/* ====================
=======================
INTERACTIONS
=======================
==================== */
// =========================================== BLOCK FADE IN ON LOAD
if (window.innerWidth > 800) {
view.device = 'desktop';
} else {
view.device = 'mobile';
}
view.grid.blocks.forEach(function (block) {
view.grid.showBlocks(block);
}); // =========================================== LOGO STRETCHING
view.header.logo.style.fontSize = view.header.logoOriginSize;
var prevScrollPos = 0;
window.addEventListener('scroll', function (event) {
if (window.scrollY * -1.007 + view.header.logoOriginSize >= 40 && view.state !== 'agency' && view.state !== 'project') {
view.header.logo.style.fontSize = "".concat(window.scrollY * -1.007 + view.header.logoOriginSize, "px");
if (!view.header.btns.list.classList.contains('hide')) {
view.header.btns.list.classList.add('hide');
}
} else {
if (view.header.logo.style.fontSize !== '40 px') {
view.header.logo.style.fontSize = '40px';
view.header.btns.list.classList.remove('hide');
}
}
}); // =========================================== VIEW BUTTON
view.header.btns.smaller.addEventListener('click', function () {
view.grid.smaller();
});
view.header.btns.bigger.addEventListener('click', function () {
view.grid.bigger();
}); // =========================================== CLOSE BTN
view.header.btns.close.addEventListener('click', function () {
if (view.header.btns.enable === true) {
if (view.state === 'agency') {
view.header.toName();
}
if (view.state === 'project' || view.prevState.type === 'grid' || view.prevState.type === 'list') {
if (view.scrollPos === 0) {
view.header.logo.style.fontSize = view.header.logoOriginSize + 'px';
setTimeout(function () {
view.header.logo.style.transition = '';
}, 300);
} else {
setTimeout(function () {
window.scrollTo(0, view.scrollPos);
setTimeout(function () {
view.header.logo.style.transition = '';
}, 300);
}, 300);
}
}
view.project.close();
if (view.prevState.type !== 'project') {
if (window.innerWidth > 800) {
view.header.btns.toSize();
} else {
view.header.btns.toMobileSize();
}
}
}
});
view.header.btns.list.addEventListener('click', function () {
if (view.state === 'grid') {
view.state === 'list';
view.header.btns.list.querySelector('h1').textContent = 'images';
view.grid.container.classList.add('list');
view.list.init();
} else {
view.state === 'grid';
view.header.btns.list.querySelector('h1').textContent = 'liste';
view.grid.container.classList.remove('list');
view.list.toGrid();
}
});
document.addEventListener('keydown', function (event) {
if (view.state === 'project' && view.header.btns.enable === true && event.code === 'Escape') {
if (view.header.btns.enable === true) {
if (view.state === 'agency') {
view.header.toName();
}
if (view.state === 'project' || view.prevState.type === 'grid' || view.prevState.type === 'list') {
if (view.scrollPos === 0) {
view.header.logo.style.fontSize = view.header.logoOriginSize + 'px';
setTimeout(function () {
view.header.logo.style.transition = '';
}, 300);
} else {
setTimeout(function () {
window.scrollTo(0, view.scrollPos);
setTimeout(function () {
view.header.logo.style.transition = '';
}, 300);
}, 300);
}
}
view.project.close();
if (view.prevState.type !== 'project') {
if (window.innerWidth > 800) {
view.header.btns.toSize();
} else {
view.header.btns.toMobileSize();
}
}
}
}
});
document.querySelector('.grid, grid--mobile').addEventListener('click', function () {
if (view.header.size === 'big') {
view.header.reduce();
}
});
view.header.logo.addEventListener('mouseenter', function () {
if (view.state !== 'agency') {
view.header.toInfo();
}
});
view.header.logo.addEventListener('mouseleave', function () {
if (view.state !== 'agency') {
view.header.toName();
}
}); // /* ====================
// =======================
// --------- SPA ---------
// =======================
// ==================== */
document.querySelectorAll('.toProject, .list__project, .list__project--mobile').forEach(function (project) {
project.addEventListener('click', function (e) {
view.scrollPos = window.scrollY;
e.preventDefault();
view.header.logo.style.transition = 'font-size .3s ease-in-out';
setTimeout(function () {
view.header.logo.style.fontSize = '2.5rem';
}, 10);
view.header.btns.toClose();
var link = project.getAttribute('href');
var title = project.dataset.title;
var description = project.dataset.description;
if (view.state === 'list') {
window.innerWidth > 800 ? view.project.init(link, title, view.list.container, view.project.container) : view.project.init(link, title, view.list.mobileContainer, view.project.container);
} else {
view.project.init(link, title, view.grid.container, view.project.container);
}
});
}); // =========================================== LOGO BTN AGENCE
view.header.logoBtn.addEventListener('click', function (e) {
e.preventDefault();
view.scrollPos = window.scrollY;
view.header.logo.style.transition = 'font-size .3s ease-in-out';
setTimeout(function () {
view.header.logo.style.fontSize = '2.5rem';
}, 10);
view.header.btns.toClose();
var link = view.header.logoBtn.getAttribute('href');
var title = view.header.logoBtn.dataset.title;
setTimeout(function () {
window.scrollTo(0, 0);
}, 300);
if (view.state === 'list') {
window.innerWidth > 800 ? view.agency.init(link, title, view.list.container, view.project.container) : view.agency.init(link, title, view.list.mobileContainer, view.project.container);
} else if (view.state === 'project') {
view.agency.init(link, title, view.project.container, view.project.container);
} else if (view.state === 'grid') {
view.agency.init(link, title, view.grid.container, view.project.container);
}
});
/* ====================
=======================
END
=======================
==================== */
});

1
assets/style.css Normal file

File diff suppressed because one or more lines are too long

1
assets/svg/bigger.svg Normal file
View file

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 130 130" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g><rect x="0" y="54.167" width="129.167" height="20.833"/><path d="M54.167,0l-0,129.167l20.833,-0l-0,-129.167l-20.833,0Z"/></g></svg>

After

Width:  |  Height:  |  Size: 576 B

1
assets/svg/close.svg Normal file
View file

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 130 130" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g><path d="M113.432,-0l-113.432,113.432l14.731,14.731l113.432,-113.432l-14.731,-14.731Z"/><path d="M-0,14.731l113.432,113.432l14.731,-14.731l-113.432,-113.432l-14.731,14.731Z"/></g></svg>

After

Width:  |  Height:  |  Size: 630 B

1
assets/svg/smaller.svg Normal file
View file

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 130 130" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><rect x="0" y="54.167" width="129.167" height="20.833"/></svg>

After

Width:  |  Height:  |  Size: 504 B

27
composer.json Normal file
View file

@ -0,0 +1,27 @@
{
"name": "getkirby/plainkit",
"description": "Kirby Plainkit",
"type": "project",
"keywords": ["kirby", "cms", "starterkit"],
"homepage": "https://getkirby.com",
"authors": [
{
"name": "Bastian Allgeier",
"email": "bastian@getkirby.com",
"homepage": "https://getkirby.com"
}
],
"support": {
"email": "support@getkirby.com",
"issues": "https://github.com/getkirby/starterkit/issues",
"forum": "https://forum.getkirby.com",
"source": "https://github.com/getkirby/starterkit"
},
"require": {
"php": ">=7.1.0",
"getkirby/cms": "^3.0"
},
"config": {
"optimize-autoloader": true
}
}

5
index.php Normal file
View file

@ -0,0 +1,5 @@
<?php
require 'kirby/bootstrap.php';
echo (new Kirby)->render();

15
kirby/.editorconfig Normal file
View file

@ -0,0 +1,15 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
# PHP PSR-2 Coding Standards
# http://www.php-fig.org/psr/psr-2/
root = true
[*.php]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

58
kirby/.php_cs Normal file
View file

@ -0,0 +1,58 @@
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('dependencies')
->in(__DIR__);
return PhpCsFixer\Config::create()
->setRules([
'@PSR1' => true,
'@PSR2' => true,
'align_multiline_comment' => ['comment_type' => 'phpdocs_like'],
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'cast_spaces' => ['space' => 'none'],
// 'class_keyword_remove' => true, // replaces static::class with 'static' (won't work)
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'combine_nested_dirname' => true,
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => ['space' => 'single'],
'dir_constant' => true,
'function_typehint_space' => true,
'include' => true,
'logical_operators' => true,
'lowercase_cast' => true,
'lowercase_static_reference' => true,
'magic_constant_casing' => true,
'magic_method_casing' => true,
'method_chaining_indentation' => true,
'modernize_types_casting' => true,
'multiline_comment_opening_closing' => true,
'native_function_casing' => true,
'native_function_type_declaration_casing' => true,
'new_with_braces' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => ['use' => 'echo'],
'no_unneeded_control_parentheses' => true,
'no_unused_imports' => true,
'no_useless_return' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha'],
// 'phpdoc_add_missing_param_annotation' => ['only_untyped' => false], // adds params in the wrong order
'phpdoc_align' => ['align' => 'left'],
'phpdoc_indent' => true,
'phpdoc_scalar' => true,
'phpdoc_trim' => true,
'short_scalar_cast' => true,
'single_line_comment_style' => true,
'single_quote' => true,
'ternary_to_null_coalescing' => true,
'whitespace_after_comma_in_array' => true
])
->setRiskyAllowed(true)
->setFinder($finder);

3
kirby/SECURITY.md Normal file
View file

@ -0,0 +1,3 @@
# Security Policy
Please see the [Security Policy on the Kirby website](https://getkirby.com/security) for a list of the currently supported Kirby versions and of past security incidents as well as for information on how to report security vulnerabilities in the Kirby core or in the Panel.

83
kirby/assets/whoops.css Normal file
View file

@ -0,0 +1,83 @@
body {
background: #efefef;
font: normal normal 400 12px/1.5 -apple-system, BlinkMacSystemFont, Segoe UI,
Roboto, Helvetica, Arial, sans-serif;
}
.left-panel {
background: transparent;
}
header {
background-color: #313740;
}
.exc-title-primary {
color: hsl(0, 71%, 55%);
}
.frame.active {
color: hsl(0, 71%, 55%);
box-shadow: inset -5px 0 0 0 #d16464;
}
.frame:not(.active):hover {
background: rgba(203, 215, 229, 0.5);
}
.rightButton {
color: #999;
box-shadow: inset 0 0 0 1px #777;
border-radius: 0;
}
.rightButton:hover {
box-shadow: inset 0 0 0 1px #555;
color: #777;
}
.details-heading {
color: #7e9abf;
font-weight: 500;
}
.frame-code {
background: #000;
}
pre.code-block,
code.code-block,
.frame-args.code-block,
.frame-args.code-block samp {
background: #16171a;
}
.linenums li.current {
background: transparent;
}
.linenums li.current.active {
background: rgba(209, 100, 100, 0.3);
}
pre .atv,
code .atv,
pre .str,
code .str {
color: #a7bd68;
}
pre .tag,
code .tag {
color: #d16464;
}
pre .kwd,
code .kwd {
color: #8abeb7;
}
pre .atn,
code .atn {
color: #de935f;
}

35
kirby/bootstrap.php Normal file
View file

@ -0,0 +1,35 @@
<?php
/**
* Validate the PHP version to already
* stop at older or too recent versions
*/
if (
version_compare(PHP_VERSION, '7.2.0', '>=') === false ||
version_compare(PHP_VERSION, '7.5.0', '<') === false
) {
die(include __DIR__ . '/views/php.php');
}
if (is_file($autoloader = dirname(__DIR__) . '/vendor/autoload.php')) {
/**
* Always prefer a site-wide Composer autoloader
* if it exists, it means that the user has probably
* installed additional packages
*/
include $autoloader;
} elseif (is_file($autoloader = __DIR__ . '/vendor/autoload.php')) {
/**
* Fall back to the local autoloader if that exists
*/
include $autoloader;
} else {
/**
* If neither one exists, don't bother searching;
* it's a custom directory setup and the users need to
* load the autoloader themselves
*/
}

3466
kirby/cacert.pem Normal file

File diff suppressed because it is too large Load diff

53
kirby/composer.json Normal file
View file

@ -0,0 +1,53 @@
{
"name": "getkirby/cms",
"description": "The Kirby 3 core",
"version": "3.4.0",
"license": "proprietary",
"keywords": ["kirby", "cms", "core"],
"homepage": "https://getkirby.com",
"type": "kirby-cms",
"authors": [
{
"name": "Kirby Team",
"email": "support@getkirby.com",
"homepage": "https://getkirby.com"
}
],
"support": {
"email": "support@getkirby.com",
"issues": "https://github.com/getkirby/kirby/issues",
"forum": "https://forum.getkirby.com",
"source": "https://github.com/getkirby/kirby"
},
"require": {
"php": ">=7.2.0 <7.5.0",
"ext-mbstring": "*",
"ext-ctype": "*",
"getkirby/composer-installer": "^1.0",
"mustangostang/spyc": "0.6.3",
"michelf/php-smartypants": "1.8.1",
"claviska/simpleimage": "3.3.4",
"phpmailer/phpmailer": "6.1.6",
"filp/whoops": "2.7.2",
"true/punycode": "2.1.1",
"laminas/laminas-escaper": "2.6.1"
},
"autoload": {
"files": ["config/setup.php"],
"classmap": ["dependencies/"],
"psr-4": {
"Kirby\\": "src/"
}
},
"scripts": {
"analyze": "phpstan analyse",
"build": "./scripts/build",
"fix": "php-cs-fixer fix --config .php_cs",
"post-update-cmd": "curl -o cacert.pem https://curl.haxx.se/ca/cacert.pem",
"test": "phpunit --stderr --coverage-html=tests/coverage",
"zip": "composer archive --format=zip --file=dist"
},
"config": {
"optimize-autoloader": true
}
}

633
kirby/composer.lock generated Normal file
View file

@ -0,0 +1,633 @@
{
"_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": "8ec61411e7f3b3a717572d0847654a96",
"packages": [
{
"name": "claviska/simpleimage",
"version": "3.3.4",
"source": {
"type": "git",
"url": "https://github.com/claviska/SimpleImage.git",
"reference": "3786d80af8e6d05e5e42f0350e5e5da5b92041a0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/claviska/SimpleImage/zipball/3786d80af8e6d05e5e42f0350e5e5da5b92041a0",
"reference": "3786d80af8e6d05e5e42f0350e5e5da5b92041a0",
"shasum": ""
},
"require": {
"ext-gd": "*",
"league/color-extractor": "0.3.*",
"php": ">=5.6.0"
},
"type": "library",
"autoload": {
"psr-0": {
"claviska": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Cory LaViska",
"homepage": "http://www.abeautifulsite.net/",
"role": "Developer"
}
],
"description": "A PHP class that makes working with images as simple as possible.",
"time": "2019-09-26T01:22:02+00:00"
},
{
"name": "filp/whoops",
"version": "2.7.2",
"source": {
"type": "git",
"url": "https://github.com/filp/whoops.git",
"reference": "17d0d3f266c8f925ebd035cd36f83cf802b47d4a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/filp/whoops/zipball/17d0d3f266c8f925ebd035cd36f83cf802b47d4a",
"reference": "17d0d3f266c8f925ebd035cd36f83cf802b47d4a",
"shasum": ""
},
"require": {
"php": "^5.5.9 || ^7.0",
"psr/log": "^1.0.1"
},
"require-dev": {
"mockery/mockery": "^0.9 || ^1.0",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0",
"symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0"
},
"suggest": {
"symfony/var-dumper": "Pretty print complex values better with var-dumper available",
"whoops/soap": "Formats errors as SOAP responses"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.6-dev"
}
},
"autoload": {
"psr-4": {
"Whoops\\": "src/Whoops/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Filipe Dobreira",
"homepage": "https://github.com/filp",
"role": "Developer"
}
],
"description": "php error handling for cool kids",
"homepage": "https://filp.github.io/whoops/",
"keywords": [
"error",
"exception",
"handling",
"library",
"throwable",
"whoops"
],
"time": "2020-05-05T12:28:07+00:00"
},
{
"name": "getkirby/composer-installer",
"version": "1.1.4",
"source": {
"type": "git",
"url": "https://github.com/getkirby/composer-installer.git",
"reference": "2d6b8f5601a31caeeea45623e1643fbb437eb94e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/getkirby/composer-installer/zipball/2d6b8f5601a31caeeea45623e1643fbb437eb94e",
"reference": "2d6b8f5601a31caeeea45623e1643fbb437eb94e",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0"
},
"require-dev": {
"composer/composer": "^1.8",
"phpunit/phpunit": "^7.0"
},
"type": "composer-plugin",
"extra": {
"class": "Kirby\\ComposerInstaller\\Plugin"
},
"autoload": {
"psr-4": {
"Kirby\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Kirby's custom Composer installer for the Kirby CMS and for Kirby plugins",
"homepage": "https://getkirby.com",
"time": "2019-02-11T20:27:36+00:00"
},
{
"name": "laminas/laminas-escaper",
"version": "2.6.1",
"source": {
"type": "git",
"url": "https://github.com/laminas/laminas-escaper.git",
"reference": "25f2a053eadfa92ddacb609dcbbc39362610da70"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/25f2a053eadfa92ddacb609dcbbc39362610da70",
"reference": "25f2a053eadfa92ddacb609dcbbc39362610da70",
"shasum": ""
},
"require": {
"laminas/laminas-zendframework-bridge": "^1.0",
"php": "^5.6 || ^7.0"
},
"replace": {
"zendframework/zend-escaper": "self.version"
},
"require-dev": {
"laminas/laminas-coding-standard": "~1.0.0",
"phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.6.x-dev",
"dev-develop": "2.7.x-dev"
}
},
"autoload": {
"psr-4": {
"Laminas\\Escaper\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"description": "Securely and safely escape HTML, HTML attributes, JavaScript, CSS, and URLs",
"homepage": "https://laminas.dev",
"keywords": [
"escaper",
"laminas"
],
"time": "2019-12-31T16:43:30+00:00"
},
{
"name": "laminas/laminas-zendframework-bridge",
"version": "1.0.4",
"source": {
"type": "git",
"url": "https://github.com/laminas/laminas-zendframework-bridge.git",
"reference": "fcd87520e4943d968557803919523772475e8ea3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/fcd87520e4943d968557803919523772475e8ea3",
"reference": "fcd87520e4943d968557803919523772475e8ea3",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.1",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev",
"dev-develop": "1.1.x-dev"
},
"laminas": {
"module": "Laminas\\ZendFrameworkBridge"
}
},
"autoload": {
"files": [
"src/autoload.php"
],
"psr-4": {
"Laminas\\ZendFrameworkBridge\\": "src//"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"description": "Alias legacy ZF class names to Laminas Project equivalents.",
"keywords": [
"ZendFramework",
"autoloading",
"laminas",
"zf"
],
"time": "2020-05-20T16:45:56+00:00"
},
{
"name": "league/color-extractor",
"version": "0.3.2",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/color-extractor.git",
"reference": "837086ec60f50c84c611c613963e4ad2e2aec806"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/color-extractor/zipball/837086ec60f50c84c611c613963e4ad2e2aec806",
"reference": "837086ec60f50c84c611c613963e4ad2e2aec806",
"shasum": ""
},
"require": {
"ext-gd": "*",
"php": ">=5.4.0"
},
"replace": {
"matthecat/colorextractor": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "~2",
"phpunit/phpunit": "~5"
},
"type": "library",
"autoload": {
"psr-4": {
"": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mathieu Lechat",
"email": "math.lechat@gmail.com",
"homepage": "http://matthecat.com",
"role": "Developer"
}
],
"description": "Extract colors from an image as a human would do.",
"homepage": "https://github.com/thephpleague/color-extractor",
"keywords": [
"color",
"extract",
"human",
"image",
"palette"
],
"time": "2016-12-15T09:30:02+00:00"
},
{
"name": "michelf/php-smartypants",
"version": "1.8.1",
"source": {
"type": "git",
"url": "https://github.com/michelf/php-smartypants.git",
"reference": "47d17c90a4dfd0ccf1f87e25c65e6c8012415aad"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/michelf/php-smartypants/zipball/47d17c90a4dfd0ccf1f87e25c65e6c8012415aad",
"reference": "47d17c90a4dfd0ccf1f87e25c65e6c8012415aad",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"autoload": {
"psr-0": {
"Michelf": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Michel Fortin",
"email": "michel.fortin@michelf.ca",
"homepage": "https://michelf.ca/",
"role": "Developer"
},
{
"name": "John Gruber",
"homepage": "https://daringfireball.net/"
}
],
"description": "PHP SmartyPants",
"homepage": "https://michelf.ca/projects/php-smartypants/",
"keywords": [
"dashes",
"quotes",
"spaces",
"typographer",
"typography"
],
"time": "2016-12-13T01:01:17+00:00"
},
{
"name": "mustangostang/spyc",
"version": "0.6.3",
"source": {
"type": "git",
"url": "git@github.com:mustangostang/spyc.git",
"reference": "4627c838b16550b666d15aeae1e5289dd5b77da0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mustangostang/spyc/zipball/4627c838b16550b666d15aeae1e5289dd5b77da0",
"reference": "4627c838b16550b666d15aeae1e5289dd5b77da0",
"shasum": ""
},
"require": {
"php": ">=5.3.1"
},
"require-dev": {
"phpunit/phpunit": "4.3.*@dev"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "0.5.x-dev"
}
},
"autoload": {
"files": [
"Spyc.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "mustangostang",
"email": "vlad.andersen@gmail.com"
}
],
"description": "A simple YAML loader/dumper class for PHP",
"homepage": "https://github.com/mustangostang/spyc/",
"keywords": [
"spyc",
"yaml",
"yml"
],
"time": "2019-09-10T13:16:29+00:00"
},
{
"name": "phpmailer/phpmailer",
"version": "v6.1.6",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3",
"reference": "c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-filter": "*",
"php": ">=5.5.0"
},
"require-dev": {
"doctrine/annotations": "^1.2",
"friendsofphp/php-cs-fixer": "^2.2",
"phpunit/phpunit": "^4.8 || ^5.7"
},
"suggest": {
"ext-mbstring": "Needed to send email in multibyte encoding charset",
"hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
"league/oauth2-google": "Needed for Google XOAUTH2 authentication",
"psr/log": "For optional PSR-3 debug logging",
"stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication",
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)"
},
"type": "library",
"autoload": {
"psr-4": {
"PHPMailer\\PHPMailer\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-only"
],
"authors": [
{
"name": "Marcus Bointon",
"email": "phpmailer@synchromedia.co.uk"
},
{
"name": "Jim Jagielski",
"email": "jimjag@gmail.com"
},
{
"name": "Andy Prevost",
"email": "codeworxtech@users.sourceforge.net"
},
{
"name": "Brent R. Matzelle"
}
],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"time": "2020-05-27T12:24:03+00:00"
},
{
"name": "psr/log",
"version": "1.1.3",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"time": "2020-03-23T09:12:05+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.17.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "7110338d81ce1cbc3e273136e4574663627037a7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7110338d81ce1cbc3e273136e4574663627037a7",
"reference": "7110338d81ce1cbc3e273136e4574663627037a7",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.17-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"mbstring",
"polyfill",
"portable",
"shim"
],
"time": "2020-06-06T08:46:27+00:00"
},
{
"name": "true/punycode",
"version": "v2.1.1",
"source": {
"type": "git",
"url": "https://github.com/true/php-punycode.git",
"reference": "a4d0c11a36dd7f4e7cd7096076cab6d3378a071e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/true/php-punycode/zipball/a4d0c11a36dd7f4e7cd7096076cab6d3378a071e",
"reference": "a4d0c11a36dd7f4e7cd7096076cab6d3378a071e",
"shasum": ""
},
"require": {
"php": ">=5.3.0",
"symfony/polyfill-mbstring": "^1.3"
},
"require-dev": {
"phpunit/phpunit": "~4.7",
"squizlabs/php_codesniffer": "~2.0"
},
"type": "library",
"autoload": {
"psr-4": {
"TrueBV\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Renan Gonçalves",
"email": "renan.saddam@gmail.com"
}
],
"description": "A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)",
"homepage": "https://github.com/true/php-punycode",
"keywords": [
"idna",
"punycode"
],
"time": "2016-11-16T10:37:54+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=7.2.0 <7.5.0",
"ext-mbstring": "*",
"ext-ctype": "*"
},
"platform-dev": []
}

60
kirby/config/aliases.php Normal file
View file

@ -0,0 +1,60 @@
<?php
return [
// cms classes
'asset' => 'Kirby\Cms\Asset',
'collection' => 'Kirby\Cms\Collection',
'dir' => 'Kirby\Cms\Dir',
'field' => 'Kirby\Cms\Field',
'file' => 'Kirby\Cms\File',
'files' => 'Kirby\Cms\Files',
'html' => 'Kirby\Cms\Html',
'kirby' => 'Kirby\Cms\App',
'page' => 'Kirby\Cms\Page',
'pages' => 'Kirby\Cms\Pages',
'pagination' => 'Kirby\Cms\Pagination',
'r' => 'Kirby\Cms\R',
'response' => 'Kirby\Cms\Response',
's' => 'Kirby\Cms\S',
'site' => 'Kirby\Cms\Site',
'structure' => 'Kirby\Cms\Structure',
'url' => 'Kirby\Cms\Url',
'user' => 'Kirby\Cms\User',
'users' => 'Kirby\Cms\Users',
'visitor' => 'Kirby\Cms\Visitor',
// data handler
'data' => 'Kirby\Data\Data',
'json' => 'Kirby\Data\Json',
'yaml' => 'Kirby\Data\Yaml',
// data classes
'database' => 'Kirby\Database\Database',
'db' => 'Kirby\Database\Db',
// exceptions
'errorpageexception' => 'Kirby\Exception\ErrorPageException',
// http classes
'cookie' => 'Kirby\Http\Cookie',
'header' => 'Kirby\Http\Header',
'remote' => 'Kirby\Http\Remote',
'server' => 'Kirby\Http\Server',
// image classes
'dimensions' => 'Kirby\Image\Dimensions',
// toolkit classes
'a' => 'Kirby\Toolkit\A',
'c' => 'Kirby\Toolkit\Config',
'config' => 'Kirby\Toolkit\Config',
'escape' => 'Kirby\Toolkit\Escape',
'f' => 'Kirby\Toolkit\F',
'i18n' => 'Kirby\Toolkit\I18n',
'mime' => 'Kirby\Toolkit\Mime',
'obj' => 'Kirby\Toolkit\Obj',
'str' => 'Kirby\Toolkit\Str',
'tpl' => 'Kirby\Toolkit\Tpl',
'v' => 'Kirby\Toolkit\V',
'xml' => 'Kirby\Toolkit\Xml'
];

View file

@ -0,0 +1,24 @@
<?php
use Kirby\Exception\PermissionException;
return function () {
$auth = $this->kirby()->auth();
$allowImpersonation = $this->kirby()->option('api.allowImpersonation') ?? false;
// csrf token check
if ($auth->type($allowImpersonation) === 'session' && $auth->csrf() === false) {
throw new PermissionException('Unauthenticated');
}
// get user from session or basic auth
if ($user = $auth->user(null, $allowImpersonation)) {
if ($user->role()->permissions()->for('access', 'panel') === false) {
throw new PermissionException(['key' => 'access.panel']);
}
return $user;
}
throw new PermissionException('Unauthenticated');
};

View file

@ -0,0 +1,72 @@
<?php
/**
* Api Collection Definitions
*/
return [
/**
* Children
*/
'children' => [
'model' => 'page',
'type' => 'Kirby\Cms\Pages',
'view' => 'compact'
],
/**
* Files
*/
'files' => [
'model' => 'file',
'type' => 'Kirby\Cms\Files'
],
/**
* Languages
*/
'languages' => [
'model' => 'language',
'type' => 'Kirby\Cms\Languages'
],
/**
* Pages
*/
'pages' => [
'model' => 'page',
'type' => 'Kirby\Cms\Pages',
'view' => 'compact'
],
/**
* Roles
*/
'roles' => [
'model' => 'role',
'type' => 'Kirby\Cms\Roles',
'view' => 'compact'
],
/**
* Translations
*/
'translations' => [
'model' => 'translation',
'type' => 'Kirby\Cms\Translations',
'view' => 'compact'
],
/**
* Users
*/
'users' => [
'default' => function () {
return $this->users();
},
'model' => 'user',
'type' => 'Kirby\Cms\Users',
'view' => 'compact'
]
];

View file

@ -0,0 +1,20 @@
<?php
/**
* Api Model Definitions
*/
return [
'File' => include __DIR__ . '/models/File.php',
'FileBlueprint' => include __DIR__ . '/models/FileBlueprint.php',
'FileVersion' => include __DIR__ . '/models/FileVersion.php',
'Language' => include __DIR__ . '/models/Language.php',
'Page' => include __DIR__ . '/models/Page.php',
'PageBlueprint' => include __DIR__ . '/models/PageBlueprint.php',
'Role' => include __DIR__ . '/models/Role.php',
'Site' => include __DIR__ . '/models/Site.php',
'SiteBlueprint' => include __DIR__ . '/models/SiteBlueprint.php',
'System' => include __DIR__ . '/models/System.php',
'Translation' => include __DIR__ . '/models/Translation.php',
'User' => include __DIR__ . '/models/User.php',
'UserBlueprint' => include __DIR__ . '/models/UserBlueprint.php',
];

View file

@ -0,0 +1,166 @@
<?php
use Kirby\Cms\File;
use Kirby\Cms\Form;
/**
* File
*/
return [
'fields' => [
'blueprint' => function (File $file) {
return $file->blueprint();
},
'content' => function (File $file) {
return Form::for($file)->values();
},
'dimensions' => function (File $file) {
return $file->dimensions()->toArray();
},
'dragText' => function (File $file) {
return $file->dragText();
},
'exists' => function (File $file) {
return $file->exists();
},
'extension' => function (File $file) {
return $file->extension();
},
'filename' => function (File $file) {
return $file->filename();
},
'id' => function (File $file) {
return $file->id();
},
'link' => function (File $file) {
return $file->panelUrl(true);
},
'mime' => function (File $file) {
return $file->mime();
},
'modified' => function (File $file) {
return $file->modified('c');
},
'name' => function (File $file) {
return $file->name();
},
'next' => function (File $file) {
return $file->next();
},
'nextWithTemplate' => function (File $file) {
$files = $file->templateSiblings()->sortBy('sort', 'asc', 'filename', 'asc');
$index = $files->indexOf($file);
return $files->nth($index + 1);
},
'niceSize' => function (File $file) {
return $file->niceSize();
},
'options' => function (File $file) {
return $file->panelOptions();
},
'panelIcon' => function (File $file) {
return $file->panelIcon();
},
'panelImage' => function (File $file) {
return $file->panelImage();
},
'panelUrl' => function (File $file) {
return $file->panelUrl(true);
},
'prev' => function (File $file) {
return $file->prev();
},
'prevWithTemplate' => function (File $file) {
$files = $file->templateSiblings()->sortBy('sort', 'asc', 'filename', 'asc');
$index = $files->indexOf($file);
return $files->nth($index - 1);
},
'parent' => function (File $file) {
return $file->parent();
},
'parents' => function (File $file) {
return $file->parents()->flip();
},
'size' => function (File $file) {
return $file->size();
},
'template' => function (File $file) {
return $file->template();
},
'thumbs' => function ($file) {
if ($file->isResizable() === false) {
return null;
}
return [
'tiny' => $file->resize(128)->url(),
'small' => $file->resize(256)->url(),
'medium' => $file->resize(512)->url(),
'large' => $file->resize(768)->url(),
'huge' => $file->resize(1024)->url(),
];
},
'type' => function (File $file) {
return $file->type();
},
'url' => function (File $file) {
return $file->url(true);
},
],
'type' => 'Kirby\Cms\File',
'views' => [
'default' => [
'content',
'dimensions',
'exists',
'extension',
'filename',
'id',
'link',
'mime',
'modified',
'name',
'next' => 'compact',
'niceSize',
'parent' => 'compact',
'options',
'prev' => 'compact',
'size',
'template',
'type',
'url'
],
'compact' => [
'filename',
'id',
'link',
'type',
'url',
],
'panel' => [
'blueprint',
'content',
'dimensions',
'extension',
'filename',
'id',
'link',
'mime',
'modified',
'name',
'nextWithTemplate' => 'compact',
'niceSize',
'options',
'panelIcon',
'panelImage',
'parent' => 'compact',
'parents' => ['id', 'slug', 'title'],
'prevWithTemplate' => 'compact',
'template',
'type',
'url'
]
],
];

View file

@ -0,0 +1,26 @@
<?php
use Kirby\Cms\FileBlueprint;
/**
* FileBlueprint
*/
return [
'fields' => [
'name' => function (FileBlueprint $blueprint) {
return $blueprint->name();
},
'options' => function (FileBlueprint $blueprint) {
return $blueprint->options();
},
'tabs' => function (FileBlueprint $blueprint) {
return $blueprint->tabs();
},
'title' => function (FileBlueprint $blueprint) {
return $blueprint->title();
},
],
'type' => 'Kirby\Cms\FileBlueprint',
'views' => [
],
];

View file

@ -0,0 +1,83 @@
<?php
use Kirby\Cms\FileVersion;
/**
* FileVersion
*/
return [
'fields' => [
'dimensions' => function (FileVersion $file) {
return $file->dimensions()->toArray();
},
'exists' => function (FileVersion $file) {
return $file->exists();
},
'extension' => function (FileVersion $file) {
return $file->extension();
},
'filename' => function (FileVersion $file) {
return $file->filename();
},
'id' => function (FileVersion $file) {
return $file->id();
},
'mime' => function (FileVersion $file) {
return $file->mime();
},
'modified' => function (FileVersion $file) {
return $file->modified('c');
},
'name' => function (FileVersion $file) {
return $file->name();
},
'niceSize' => function (FileVersion $file) {
return $file->niceSize();
},
'size' => function (FileVersion $file) {
return $file->size();
},
'type' => function (FileVersion $file) {
return $file->type();
},
'url' => function (FileVersion $file) {
return $file->url(true);
},
],
'type' => 'Kirby\Cms\FileVersion',
'views' => [
'default' => [
'dimensions',
'exists',
'extension',
'filename',
'id',
'mime',
'modified',
'name',
'niceSize',
'size',
'type',
'url'
],
'compact' => [
'filename',
'id',
'type',
'url',
],
'panel' => [
'dimensions',
'extension',
'filename',
'id',
'mime',
'modified',
'name',
'niceSize',
'template',
'type',
'url'
]
],
];

View file

@ -0,0 +1,44 @@
<?php
use Kirby\Cms\Language;
/**
* Language
*/
return [
'fields' => [
'code' => function (Language $language) {
return $language->code();
},
'default' => function (Language $language) {
return $language->isDefault();
},
'direction' => function (Language $language) {
return $language->direction();
},
'locale' => function (Language $language) {
return $language->locale();
},
'name' => function (Language $language) {
return $language->name();
},
'rules' => function (Language $language) {
return $language->rules();
},
'url' => function (Language $language) {
return $language->url();
},
],
'type' => 'Kirby\Cms\Language',
'views' => [
'default' => [
'code',
'default',
'direction',
'locale',
'name',
'rules',
'url'
]
]
];

View file

@ -0,0 +1,157 @@
<?php
use Kirby\Cms\Form;
use Kirby\Cms\Page;
/**
* Page
*/
return [
'fields' => [
'blueprint' => function (Page $page) {
return $page->blueprint();
},
'blueprints' => function (Page $page) {
return $page->blueprints();
},
'children' => function (Page $page) {
return $page->children();
},
'content' => function (Page $page) {
return Form::for($page)->values();
},
'drafts' => function (Page $page) {
return $page->drafts();
},
'errors' => function (Page $page) {
return $page->errors();
},
'files' => function (Page $page) {
return $page->files()->sortBy('sort', 'asc', 'filename', 'asc');
},
'hasChildren' => function (Page $page) {
return $page->hasChildren();
},
'hasDrafts' => function (Page $page) {
return $page->hasDrafts();
},
'hasFiles' => function (Page $page) {
return $page->hasFiles();
},
'id' => function (Page $page) {
return $page->id();
},
'isSortable' => function (Page $page) {
return $page->isSortable();
},
'next' => function (Page $page) {
return $page
->nextAll()
->filterBy('intendedTemplate', $page->intendedTemplate())
->filterBy('status', $page->status())
->filterBy('isReadable', true)
->first();
},
'num' => function (Page $page) {
return $page->num();
},
'options' => function (Page $page) {
return $page->panelOptions(['preview']);
},
'panelIcon' => function (Page $page) {
return $page->panelIcon();
},
'panelImage' => function (Page $page) {
return $page->panelImage();
},
'parent' => function (Page $page) {
return $page->parent();
},
'parents' => function (Page $page) {
return $page->parents()->flip();
},
'prev' => function (Page $page) {
return $page
->prevAll()
->filterBy('intendedTemplate', $page->intendedTemplate())
->filterBy('status', $page->status())
->filterBy('isReadable', true)
->last();
},
'previewUrl' => function (Page $page) {
return $page->previewUrl();
},
'siblings' => function (Page $page) {
if ($page->isDraft() === true) {
return $page->parentModel()->children()->not($page);
} else {
return $page->siblings();
}
},
'slug' => function (Page $page) {
return $page->slug();
},
'status' => function (Page $page) {
return $page->status();
},
'template' => function (Page $page) {
return $page->intendedTemplate()->name();
},
'title' => function (Page $page) {
return $page->title()->value();
},
'url' => function (Page $page) {
return $page->url();
},
],
'type' => 'Kirby\Cms\Page',
'views' => [
'compact' => [
'id',
'title',
'url',
'num'
],
'default' => [
'content',
'id',
'status',
'num',
'options',
'parent' => 'compact',
'slug',
'template',
'title',
'url'
],
'panel' => [
'id',
'blueprint',
'content',
'status',
'options',
'next' => ['id', 'slug', 'title'],
'parents' => ['id', 'slug', 'title'],
'prev' => ['id', 'slug', 'title'],
'previewUrl',
'slug',
'title',
'url'
],
'selector' => [
'id',
'title',
'parent' => [
'id',
'title'
],
'children' => [
'hasChildren',
'id',
'panelIcon',
'panelImage',
'title',
],
]
],
];

View file

@ -0,0 +1,35 @@
<?php
use Kirby\Cms\PageBlueprint;
/**
* PageBlueprint
*/
return [
'fields' => [
'name' => function (PageBlueprint $blueprint) {
return $blueprint->name();
},
'num' => function (PageBlueprint $blueprint) {
return $blueprint->num();
},
'options' => function (PageBlueprint $blueprint) {
return $blueprint->options();
},
'preview' => function (PageBlueprint $blueprint) {
return $blueprint->preview();
},
'status' => function (PageBlueprint $blueprint) {
return $blueprint->status();
},
'tabs' => function (PageBlueprint $blueprint) {
return $blueprint->tabs();
},
'title' => function (PageBlueprint $blueprint) {
return $blueprint->title();
},
],
'type' => 'Kirby\Cms\PageBlueprint',
'views' => [
],
];

View file

@ -0,0 +1,31 @@
<?php
use Kirby\Cms\Role;
/**
* Role
*/
return [
'fields' => [
'description' => function (Role $role) {
return $role->description();
},
'name' => function (Role $role) {
return $role->name();
},
'permissions' => function (Role $role) {
return $role->permissions()->toArray();
},
'title' => function (Role $role) {
return $role->title();
},
],
'type' => 'Kirby\Cms\Role',
'views' => [
'compact' => [
'description',
'name',
'title'
]
]
];

View file

@ -0,0 +1,72 @@
<?php
use Kirby\Cms\Form;
use Kirby\Cms\Site;
/**
* Site
*/
return [
'default' => function () {
return $this->site();
},
'fields' => [
'blueprint' => function (Site $site) {
return $site->blueprint();
},
'children' => function (Site $site) {
return $site->children();
},
'content' => function (Site $site) {
return Form::for($site)->values();
},
'drafts' => function (Site $site) {
return $site->drafts();
},
'files' => function (Site $site) {
return $site->files()->sortBy('sort', 'asc', 'filename', 'asc');
},
'options' => function (Site $site) {
return $site->permissions()->toArray();
},
'previewUrl' => function (Site $site) {
return $site->previewUrl();
},
'title' => function (Site $site) {
return $site->title()->value();
},
'url' => function (Site $site) {
return $site->url();
},
],
'type' => 'Kirby\Cms\Site',
'views' => [
'compact' => [
'title',
'url'
],
'default' => [
'content',
'options',
'title',
'url'
],
'panel' => [
'title',
'blueprint',
'content',
'options',
'previewUrl',
'url'
],
'selector' => [
'title',
'children' => [
'id',
'title',
'panelIcon',
'hasChildren'
],
]
]
];

View file

@ -0,0 +1,26 @@
<?php
use Kirby\Cms\SiteBlueprint;
/**
* SiteBlueprint
*/
return [
'fields' => [
'name' => function (SiteBlueprint $blueprint) {
return $blueprint->name();
},
'options' => function (SiteBlueprint $blueprint) {
return $blueprint->options();
},
'tabs' => function (SiteBlueprint $blueprint) {
return $blueprint->tabs();
},
'title' => function (SiteBlueprint $blueprint) {
return $blueprint->title();
},
],
'type' => 'Kirby\Cms\SiteBlueprint',
'views' => [
],
];

View file

@ -0,0 +1,119 @@
<?php
use Kirby\Cms\System;
use Kirby\Toolkit\Str;
/**
* System
*/
return [
'fields' => [
'ascii' => function () {
return Str::$ascii;
},
'defaultLanguage' => function () {
return $this->kirby()->option('panel.language', 'en');
},
'isOk' => function (System $system) {
return $system->isOk();
},
'isInstallable' => function (System $system) {
return $system->isInstallable();
},
'isInstalled' => function (System $system) {
return $system->isInstalled();
},
'isLocal' => function (System $system) {
return $system->isLocal();
},
'multilang' => function () {
return $this->kirby()->option('languages', false) !== false;
},
'languages' => function () {
return $this->kirby()->languages();
},
'license' => function (System $system) {
return $system->license();
},
'requirements' => function (System $system) {
return $system->toArray();
},
'site' => function () {
try {
return $this->site()->blueprint()->title();
} catch (Throwable $e) {
return $this->site()->title()->value();
}
},
'slugs' => function () {
return Str::$language;
},
'title' => function () {
return $this->site()->title()->value();
},
'translation' => function () {
if ($user = $this->user()) {
$translationCode = $user->language();
} else {
$translationCode = $this->kirby()->option('panel.language', 'en');
}
if ($translation = $this->kirby()->translation($translationCode)) {
return $translation;
} else {
return $this->kirby()->translation('en');
}
},
'kirbytext' => function () {
return $this->kirby()->option('panel.kirbytext') ?? true;
},
'user' => function () {
return $this->user();
},
'version' => function () {
$user = $this->user();
if ($user && $user->role()->permissions()->for('access', 'settings') === true) {
return $this->kirby()->version();
} else {
return null;
}
}
],
'type' => 'Kirby\Cms\System',
'views' => [
'login' => [
'isOk',
'isInstallable',
'isInstalled',
'title',
'translation'
],
'troubleshooting' => [
'isOk',
'isInstallable',
'isInstalled',
'title',
'translation',
'requirements'
],
'panel' => [
'ascii',
'defaultLanguage',
'isOk',
'isInstalled',
'isLocal',
'kirbytext',
'languages',
'license',
'multilang',
'requirements',
'site',
'slugs',
'title',
'translation',
'user' => 'auth',
'version'
]
],
];

View file

@ -0,0 +1,34 @@
<?php
use Kirby\Cms\Translation;
/**
* Translation
*/
return [
'fields' => [
'author' => function (Translation $translation) {
return $translation->author();
},
'data' => function (Translation $translation) {
return $translation->dataWithFallback();
},
'direction' => function (Translation $translation) {
return $translation->direction();
},
'id' => function (Translation $translation) {
return $translation->id();
},
'name' => function (Translation $translation) {
return $translation->name();
},
],
'type' => 'Kirby\Cms\Translation',
'views' => [
'compact' => [
'direction',
'id',
'name'
]
]
];

View file

@ -0,0 +1,108 @@
<?php
use Kirby\Cms\Form;
use Kirby\Cms\User;
/**
* User
*/
return [
'default' => function () {
return $this->user();
},
'fields' => [
'avatar' => function (User $user) {
return $user->avatar() ? $user->avatar()->crop(512) : null;
},
'blueprint' => function (User $user) {
return $user->blueprint();
},
'content' => function (User $user) {
return Form::for($user)->values();
},
'email' => function (User $user) {
return $user->email();
},
'files' => function (User $user) {
return $user->files()->sortBy('sort', 'asc', 'filename', 'asc');
},
'id' => function (User $user) {
return $user->id();
},
'language' => function (User $user) {
return $user->language();
},
'name' => function (User $user) {
return $user->name()->value();
},
'next' => function (User $user) {
return $user->next();
},
'options' => function (User $user) {
return $user->panelOptions();
},
'permissions' => function (User $user) {
return $user->role()->permissions()->toArray();
},
'prev' => function (User $user) {
return $user->prev();
},
'role' => function (User $user) {
return $user->role();
},
'roles' => function (User $user) {
return $user->roles();
},
'username' => function (User $user) {
return $user->username();
}
],
'type' => 'Kirby\Cms\User',
'views' => [
'default' => [
'avatar',
'content',
'email',
'id',
'language',
'name',
'next' => 'compact',
'options',
'prev' => 'compact',
'role',
'username'
],
'compact' => [
'avatar' => 'compact',
'id',
'email',
'language',
'name',
'role' => 'compact',
'username'
],
'auth' => [
'avatar' => 'compact',
'permissions',
'email',
'id',
'name',
'role',
'language'
],
'panel' => [
'avatar' => 'compact',
'blueprint',
'content',
'email',
'id',
'language',
'name',
'next' => ['id', 'name'],
'options',
'prev' => ['id', 'name'],
'role',
'username',
],
]
];

View file

@ -0,0 +1,26 @@
<?php
use Kirby\Cms\UserBlueprint;
/**
* UserBlueprint
*/
return [
'fields' => [
'name' => function (UserBlueprint $blueprint) {
return $blueprint->name();
},
'options' => function (UserBlueprint $blueprint) {
return $blueprint->options();
},
'tabs' => function (UserBlueprint $blueprint) {
return $blueprint->tabs();
},
'title' => function (UserBlueprint $blueprint) {
return $blueprint->title();
},
],
'type' => 'Kirby\Cms\UserBlueprint',
'views' => [
],
];

View file

@ -0,0 +1,26 @@
<?php
/**
* Api Routes Definitions
*/
return function ($kirby) {
$routes = array_merge(
include __DIR__ . '/routes/auth.php',
include __DIR__ . '/routes/pages.php',
include __DIR__ . '/routes/roles.php',
include __DIR__ . '/routes/site.php',
include __DIR__ . '/routes/users.php',
include __DIR__ . '/routes/files.php',
include __DIR__ . '/routes/lock.php',
include __DIR__ . '/routes/system.php',
include __DIR__ . '/routes/translations.php'
);
// only add the language routes if the
// multi language setup is activated
if ($kirby->option('languages', false) !== false) {
$routes = array_merge($routes, include __DIR__ . '/routes/languages.php');
}
return $routes;
};

View file

@ -0,0 +1,55 @@
<?php
use Kirby\Exception\InvalidArgumentException;
use Kirby\Exception\NotFoundException;
/**
* Authentication
*/
return [
[
'pattern' => 'auth',
'method' => 'GET',
'action' => function () {
if ($user = $this->kirby()->auth()->user()) {
return $this->resolve($user)->view('auth');
}
throw new NotFoundException('The user cannot be found');
}
],
[
'pattern' => 'auth/login',
'method' => 'POST',
'auth' => false,
'action' => function () {
$auth = $this->kirby()->auth();
// csrf token check
if ($auth->type() === 'session' && $auth->csrf() === false) {
throw new InvalidArgumentException('Invalid CSRF token');
}
$email = $this->requestBody('email');
$long = $this->requestBody('long');
$password = $this->requestBody('password');
$user = $this->kirby()->auth()->login($email, $password, $long);
return [
'code' => 200,
'status' => 'ok',
'user' => $this->resolve($user)->view('auth')->toArray()
];
}
],
[
'pattern' => 'auth/logout',
'method' => 'POST',
'auth' => false,
'action' => function () {
$this->kirby()->auth()->logout();
return true;
}
],
];

View file

@ -0,0 +1,123 @@
<?php
/**
* Files Routes
*/
return [
[
'pattern' => '(:all)/files/(:any)/sections/(:any)',
'method' => 'GET',
'action' => function (string $path, string $filename, string $sectionName) {
if ($section = $this->file($path, $filename)->blueprint()->section($sectionName)) {
return $section->toResponse();
}
}
],
[
'pattern' => '(:all)/files/(:any)/fields/(:any)/(:all?)',
'method' => 'ALL',
'action' => function (string $parent, string $filename, string $fieldName, string $path = null) {
if ($file = $this->file($parent, $filename)) {
return $this->fieldApi($file, $fieldName, $path);
}
}
],
[
'pattern' => '(:all)/files',
'method' => 'GET',
'action' => function (string $path) {
return $this->parent($path)->files()->sortBy('sort', 'asc', 'filename', 'asc');
}
],
[
'pattern' => '(:all)/files',
'method' => 'POST',
'action' => function (string $path) {
return $this->upload(function ($source, $filename) use ($path) {
return $this->parent($path)->createFile([
'source' => $source,
'template' => $this->requestBody('template'),
'filename' => $filename
]);
});
}
],
[
'pattern' => '(:all)/files/search',
'method' => 'GET|POST',
'action' => function (string $path) {
$files = $this->parent($path)->files();
if ($this->requestMethod() === 'GET') {
return $files->search($this->requestQuery('q'));
} else {
return $files->query($this->requestBody());
}
}
],
[
'pattern' => '(:all)/files/sort',
'method' => 'PATCH',
'action' => function (string $path) {
return $this->parent($path)->files()->changeSort(
$this->requestBody('files'),
$this->requestBody('index')
);
}
],
[
'pattern' => '(:all)/files/(:any)',
'method' => 'GET',
'action' => function (string $path, string $filename) {
return $this->file($path, $filename);
}
],
[
'pattern' => '(:all)/files/(:any)',
'method' => 'PATCH',
'action' => function (string $path, string $filename) {
return $this->file($path, $filename)->update($this->requestBody(), $this->language(), true);
}
],
[
'pattern' => '(:all)/files/(:any)',
'method' => 'POST',
'action' => function (string $path, string $filename) {
return $this->upload(function ($source) use ($path, $filename) {
return $this->file($path, $filename)->replace($source);
});
}
],
[
'pattern' => '(:all)/files/(:any)',
'method' => 'DELETE',
'action' => function (string $path, string $filename) {
return $this->file($path, $filename)->delete();
}
],
[
'pattern' => '(:all)/files/(:any)/name',
'method' => 'PATCH',
'action' => function (string $path, string $filename) {
return $this->file($path, $filename)->changeName($this->requestBody('name'));
}
],
[
'pattern' => 'files/search',
'method' => 'GET|POST',
'action' => function () {
$files = $this
->site()
->index(true)
->filterBy('isReadable', true)
->files();
if ($this->requestMethod() === 'GET') {
return $files->search($this->requestQuery('q'));
} else {
return $files->query($this->requestBody());
}
}
],
];

Some files were not shown because too many files have changed in this diff Show more