Initial commit
This commit is contained in:
commit
65e0da7e11
1397 changed files with 596542 additions and 0 deletions
38
site/OFF_plugins/field-engineer/field-engineer.php
Normal file
38
site/OFF_plugins/field-engineer/field-engineer.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
if(class_exists('Panel') && site()->user()) {
|
||||
require_once __DIR__ . DS . 'lib' . DS . 'form.php';
|
||||
require_once __DIR__ . DS . 'lib' . DS . 'field.php';
|
||||
require_once __DIR__ . DS . 'lib' . DS . 'tpl.php';
|
||||
require_once __DIR__ . DS . 'lib' . DS . 'presentation.php';
|
||||
require_once __DIR__ . DS . 'lib' . DS . 'presentation-array.php';
|
||||
require_once __DIR__ . DS . 'lib' . DS . 'outline.php';
|
||||
|
||||
if(c::get('engineer.debug', false)) {
|
||||
c::set('plugin.logic.field', function($field, $page) {
|
||||
return '<p><strong>Field name:</strong> ' . $field->name() . '<br><strong>Panel page</strong>: ' . $page->title() . '</p>';
|
||||
});
|
||||
|
||||
foreach(glob(__DIR__ . DS . 'tests' . DS . 'blueprints' . DS . '*') as $filename) {
|
||||
$parts = pathinfo($filename);
|
||||
$kirby->set('blueprint', $parts['filename'], $filename);
|
||||
}
|
||||
|
||||
class MyPlugin {
|
||||
static function userlist($field) {
|
||||
$kirby = kirby();
|
||||
$site = $kirby->site();
|
||||
$users = $site->users();
|
||||
|
||||
$result = array();
|
||||
|
||||
foreach ($users as $user) {
|
||||
$result[$user->username] = $user->firstName() . ' ' . $user->lastName();
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$kirby->set('field', 'engineer', __DIR__ . DS . 'fields' . DS . 'engineer');
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue