Initial commit

This commit is contained in:
philipp lang 2024-01-29 23:36:43 +01:00
commit b82041937e
10 changed files with 211 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "assets/vendor/adrema-form"]
path = assets/vendor/adrema-form
url = https://git.zoomyboy.de/silva/adrema-form

105
Plugin.php Normal file
View File

@ -0,0 +1,105 @@
<?php
namespace Silva\Adrema;
use Backend;
use Silva\Adrema\Models\Settings;
use System\Classes\PluginBase;
/**
* Plugin Information File
*
* @link https://docs.octobercms.com/3.x/extend/system/plugins.html
*/
class Plugin extends PluginBase
{
/**
* pluginDetails about this plugin.
*/
public function pluginDetails()
{
return [
'name' => 'adrema',
'description' => 'No description provided yet...',
'author' => 'silva',
'icon' => 'icon-leaf'
];
}
/**
* register method, called when the plugin is first registered.
*/
public function register()
{
//
}
/**
* boot method, called right before the request route.
*/
public function boot()
{
//
}
/**
* registerComponents used by the frontend.
*/
public function registerComponents()
{
return []; // Remove this line to activate
return [
'Silva\Adrema\Components\MyComponent' => 'myComponent',
];
}
/**
* registerPermissions used by the backend.
*/
public function registerPermissions()
{
return []; // Remove this line to activate
return [
'silva.adrema.some_permission' => [
'tab' => 'adrema',
'label' => 'Some permission'
],
];
}
/**
* registerPermissions used by the backend.
*/
public function registerSettings()
{
return [
'settings' => [
'label' => 'Adrema',
'description' => 'setting_description',
'category' => 'CATEGORY_CMS',
'icon' => 'icon-cog',
'class' => Settings::class,
]
];
}
/**
* registerNavigation used by the backend.
*/
public function registerNavigation()
{
return []; // Remove this line to activate
return [
'adrema' => [
'label' => 'adrema',
'url' => Backend::url('silva/adrema/mycontroller'),
'icon' => 'icon-leaf',
'permissions' => ['silva.adrema.*'],
'order' => 500,
],
];
}
}

1
assets/vendor/adrema-form vendored Submodule

@ -0,0 +1 @@
Subproject commit f76b46bc9fe159324e58783ff945595b5ba5e488

8
composer.json Normal file
View File

@ -0,0 +1,8 @@
{
"name": "silva/adrema-plugin",
"type": "october-plugin",
"description": "No description provided yet...",
"require": {
"composer/installers": "~1.0"
}
}

7
lang/de.json Normal file
View File

@ -0,0 +1,7 @@
{
"setting_description": "App für DPSG-NaMi",
"url_pattern_comment": "Die Page-URL, auf der einzelne Veranstaltungen angezeigt werden. {slug} wird mit dem Bezeichner der Veranstaltung ersetzt.",
"url_pattern_label": "URL für einzelne Veranstaltungen",
"base_url_label": "Base-URL",
"base_url_comment": "Die Domain (app_url), auf der deine Adrema läuft"
}

25
models/Settings.php Normal file
View File

@ -0,0 +1,25 @@
<?php
namespace Silva\Adrema\Models;
use System\Models\SettingModel;
class Settings extends SettingModel
{
use \October\Rain\Database\Traits\Validation;
/**
* @var string table name
*/
public $settingsCode = 'silva_adrema_settings';
/**
* @var string field file
*/
public $settingsFields = 'fields.yaml';
/**
* @var array<string, string> rules for validation
*/
public $rules = [];
}

View File

@ -0,0 +1,28 @@
# ===================================
# Form Field Definitions
# ===================================
fields:
base_url:
label: base_url_label
comment: base_url_comment
primary_color:
label: primary_color_label
comment: primary_color_comment
type: colorpicker
secondary_color:
label: secondary_color_label
comment: secondary_color_comment
type: colorpicker
font_color:
label: font_color_label
comment: font_color_comment
type: colorpicker
circle_color:
label: circle_color_label
comment: circle_color_comment
type: colorpicker

View File

@ -0,0 +1,32 @@
<?php namespace Silva\Adrema\Updates;
use Schema;
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
/**
* CreateSettingsTable Migration
*
* @link https://docs.octobercms.com/3.x/extend/database/structure.html
*/
return new class extends Migration
{
/**
* up builds the migration
*/
public function up()
{
Schema::create('silva_adrema_settings', function(Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* down reverses the migration
*/
public function down()
{
Schema::dropIfExists('silva_adrema_settings');
}
};

1
updates/version.yaml Normal file
View File

@ -0,0 +1 @@
v1.0.1: First version of adrema