Skip to content

Commit aa4450f

Browse files
committed
first commit
0 parents  commit aa4450f

File tree

205 files changed

+6750
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+6750
-0
lines changed

.gitignore

Whitespace-only changes.

Plugin.php

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<?php namespace October\Test;
2+
3+
use Backend;
4+
use System\Classes\PluginBase;
5+
6+
/**
7+
* Test Plugin Information File
8+
*/
9+
class Plugin extends PluginBase
10+
{
11+
/**
12+
* Returns information about this plugin.
13+
*
14+
* @return array
15+
*/
16+
public function pluginDetails()
17+
{
18+
return [
19+
'name' => 'October Tester',
20+
'description' => 'Used for testing the Relation Controller behavior and others.',
21+
'author' => 'Alexey Bobkov, Samuel Georges',
22+
'icon' => 'icon-child',
23+
'homepage' => 'https://github.com/daftspunk/oc-test-plugin'
24+
];
25+
}
26+
27+
public $require = ['Renatio.SeoManager'];
28+
29+
public function registerNavigation()
30+
{
31+
return [
32+
'test' => [
33+
'label' => 'Playground',
34+
'url' => Backend::url('october/test/people'),
35+
'icon' => 'icon-child',
36+
'order' => 200,
37+
38+
'sideMenu' => [
39+
'people' => [
40+
'label' => 'People',
41+
'icon' => 'icon-database',
42+
'url' => Backend::url('october/test/people'),
43+
],
44+
'posts' => [
45+
'label' => 'Posts',
46+
'icon' => 'icon-database',
47+
'url' => Backend::url('october/test/posts'),
48+
],
49+
'users' => [
50+
'label' => 'Users',
51+
'icon' => 'icon-database',
52+
'url' => Backend::url('october/test/users'),
53+
],
54+
'countries' => [
55+
'label' => 'Countries',
56+
'icon' => 'icon-database',
57+
'url' => Backend::url('october/test/countries'),
58+
],
59+
'reviews' => [
60+
'label' => 'Reviews',
61+
'icon' => 'icon-database',
62+
'url' => Backend::url('october/test/reviews'),
63+
],
64+
'galleries' => [
65+
'label' => 'Galleries',
66+
'icon' => 'icon-database',
67+
'url' => Backend::url('october/test/galleries'),
68+
],
69+
'trees' => [
70+
'label' => 'Trees',
71+
'icon' => 'icon-database',
72+
'url' => Backend::url('october/test/trees'),
73+
],
74+
]
75+
]
76+
];
77+
}
78+
79+
public function registerFormWidgets()
80+
{
81+
return [
82+
'October\Test\FormWidgets\TimeChecker' => [
83+
'code' => 'timecheckertest'
84+
]
85+
];
86+
}
87+
}

config/repeater_fields.yaml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# ===================================
2+
# Used by Grouped Repeater
3+
# ===================================
4+
5+
textarea:
6+
name: Textarea
7+
description: Basic text field
8+
icon: icon-file-text-o
9+
fields:
10+
text_area:
11+
label: Text Content
12+
type: textarea
13+
size: large
14+
15+
quote:
16+
name: Quote
17+
description: Quote item
18+
icon: icon-quote-right
19+
fields:
20+
quote_position:
21+
span: auto
22+
label: Quote Position
23+
type: radio
24+
options:
25+
left: Left
26+
center: Center
27+
right: Right
28+
quote_content:
29+
span: auto
30+
label: Details
31+
type: textarea
32+
33+
image:
34+
name: Image
35+
description: Pick something from the media library
36+
icon: icon-photo
37+
fields:
38+
img_upload:
39+
span: auto
40+
label: Image
41+
type: mediafinder
42+
mode: image
43+
imageHeight: 260
44+
imageWidth: 260
45+
46+
img_position:
47+
span: auto
48+
label: Image Position
49+
type: radio
50+
options:
51+
left: Left
52+
center: Center
53+
right: Right

controllers/Categories.php

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php namespace October\Test\Controllers;
2+
3+
use BackendMenu;
4+
use Backend\Classes\Controller;
5+
6+
/**
7+
* Categories Back-end Controller
8+
*/
9+
class Categories extends Controller
10+
{
11+
public $implement = [
12+
'Backend.Behaviors.FormController',
13+
'Backend.Behaviors.ReorderController',
14+
'Backend.Behaviors.RelationController',
15+
];
16+
17+
public $formConfig = 'config_form.yaml';
18+
public $reorderConfig = 'config_reorder.yaml';
19+
public $relationConfig = 'config_relation.yaml';
20+
21+
public function __construct()
22+
{
23+
parent::__construct();
24+
25+
BackendMenu::setContext('October.Test', 'test', 'trees');
26+
}
27+
}

controllers/Channels.php

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php namespace October\Test\Controllers;
2+
3+
use BackendMenu;
4+
use Backend\Classes\Controller;
5+
6+
/**
7+
* Channels Back-end Controller
8+
*/
9+
class Channels extends Controller
10+
{
11+
public $implement = [
12+
'Backend.Behaviors.FormController',
13+
'Backend.Behaviors.ReorderController'
14+
];
15+
16+
public $formConfig = 'config_form.yaml';
17+
public $reorderConfig = 'config_reorder.yaml';
18+
19+
public function __construct()
20+
{
21+
parent::__construct();
22+
23+
BackendMenu::setContext('October.Test', 'test', 'trees');
24+
}
25+
}

controllers/Countries.php

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php namespace October\Test\Controllers;
2+
3+
use BackendMenu;
4+
use Backend\Classes\Controller;
5+
6+
/**
7+
* Countries Back-end Controller
8+
*/
9+
class Countries extends Controller
10+
{
11+
public $implement = [
12+
'Backend.Behaviors.FormController',
13+
'Backend.Behaviors.ListController'
14+
];
15+
16+
public $formConfig = 'config_form.yaml';
17+
public $listConfig = 'config_list.yaml';
18+
19+
public function __construct()
20+
{
21+
parent::__construct();
22+
23+
BackendMenu::setContext('October.Test', 'test', 'countries');
24+
}
25+
}

controllers/Galleries.php

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php namespace October\Test\Controllers;
2+
3+
use BackendMenu;
4+
use Backend\Classes\Controller;
5+
6+
/**
7+
* Galleries Back-end Controller
8+
*/
9+
class Galleries extends Controller
10+
{
11+
public $implement = [
12+
'Backend.Behaviors.FormController',
13+
'Backend.Behaviors.ListController',
14+
'Backend.Behaviors.RelationController',
15+
];
16+
17+
public $formConfig = 'config_form.yaml';
18+
public $listConfig = 'config_list.yaml';
19+
public $relationConfig = 'config_relation.yaml';
20+
21+
public function __construct()
22+
{
23+
parent::__construct();
24+
25+
BackendMenu::setContext('October.Test', 'test', 'galleries');
26+
}
27+
}

controllers/Members.php

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php namespace October\Test\Controllers;
2+
3+
use BackendMenu;
4+
use Backend\Classes\Controller;
5+
6+
/**
7+
* Members Back-end Controller
8+
*/
9+
class Members extends Controller
10+
{
11+
public $implement = [
12+
'Backend.Behaviors.FormController',
13+
];
14+
15+
public $formConfig = 'config_form.yaml';
16+
17+
public function __construct()
18+
{
19+
parent::__construct();
20+
21+
BackendMenu::setContext('October.Test', 'test', 'trees');
22+
}
23+
}

controllers/People.php

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php namespace October\Test\Controllers;
2+
3+
use BackendMenu;
4+
use Backend\Classes\Controller;
5+
use October\Test\Models\Phone;
6+
7+
/**
8+
* People Back-end Controller
9+
*/
10+
class People extends Controller
11+
{
12+
public $implement = [
13+
'Backend.Behaviors.FormController',
14+
'Backend.Behaviors.ListController',
15+
'Backend.Behaviors.RelationController',
16+
];
17+
18+
public $formConfig = 'config_form.yaml';
19+
public $listConfig = 'config_list.yaml';
20+
public $relationConfig = 'config_relation.yaml';
21+
22+
public function __construct()
23+
{
24+
parent::__construct();
25+
26+
BackendMenu::setContext('October.Test', 'test', 'people');
27+
}
28+
29+
public function formExtendModel($model)
30+
{
31+
/*
32+
* Init proxy field model if we are creating the model
33+
* and the context is proxy fields.
34+
*/
35+
if ($this->formGetContext() === 'proxyfields' && !$model->phone) {
36+
$model->phone = new Phone;
37+
}
38+
39+
return $model;
40+
}
41+
}

controllers/Phones.php

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php namespace October\Test\Controllers;
2+
3+
use BackendMenu;
4+
use Backend\Classes\Controller;
5+
6+
/**
7+
* Phones Back-end Controller
8+
*/
9+
class Phones extends Controller
10+
{
11+
public $implement = [
12+
'Backend.Behaviors.FormController',
13+
'Backend.Behaviors.ListController',
14+
'Backend.Behaviors.RelationController',
15+
];
16+
17+
public $formConfig = 'config_form.yaml';
18+
public $listConfig = 'config_list.yaml';
19+
public $relationConfig = 'config_relation.yaml';
20+
21+
public function __construct()
22+
{
23+
parent::__construct();
24+
25+
BackendMenu::setContext('October.Test', 'test', 'people');
26+
}
27+
}

controllers/Plugins.php

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php namespace October\Test\Controllers;
2+
3+
use BackendMenu;
4+
use Backend\Classes\Controller;
5+
use October\Test\Models\Meta;
6+
7+
/**
8+
* Plugins Back-end Controller
9+
*/
10+
class Plugins extends Controller
11+
{
12+
public $implement = [
13+
'Backend.Behaviors.FormController',
14+
'Backend.Behaviors.ListController'
15+
];
16+
17+
public $formConfig = 'config_form.yaml';
18+
public $listConfig = 'config_list.yaml';
19+
20+
public function __construct()
21+
{
22+
parent::__construct();
23+
24+
BackendMenu::setContext('October.Test', 'test', 'reviews');
25+
}
26+
27+
public function formExtendFields($form)
28+
{
29+
$config = $this->makeConfig('$/october/test/models/meta/fields.yaml');
30+
31+
foreach ($config->fields as $field => $options) {
32+
$form->addTabFields([
33+
'meta['.$field.']' => $options + ['tab' => 'Meta']
34+
]);
35+
}
36+
}
37+
38+
public function formExtendModel($model)
39+
{
40+
if (!$model->meta) {
41+
$model->meta = new Meta;
42+
}
43+
44+
return $model;
45+
}
46+
}

0 commit comments

Comments
 (0)