Browse code

Version 1.5 initial commit

Benjamin Roth authored on24/06/2024 12:06:17
Showing1 changed files
... ...
@@ -13,28 +13,42 @@ declare(strict_types=1);
13 13
  * @copyright   Oveleon                <https://www.oveleon.de/>
14 14
  */
15 15
 
16
-use Contao\Config;
17 16
 use Contao\CoreBundle\DataContainer\PaletteManipulator;
17
+use Contao\System;
18 18
 
19 19
 // Extend the default palette
20 20
 PaletteManipulator::create()
21
-    ->addField(['avatar'], 'personal_legend', PaletteManipulator::POSITION_APPEND)
21
+    ->addField('avatar', 'personal_legend', PaletteManipulator::POSITION_APPEND)
22
+    ->addField('alias', 'avatar')
22 23
     ->applyToPalette('default', 'tl_member')
23 24
 ;
24 25
 
25 26
 // Add global operations
26 27
 $GLOBALS['TL_DCA']['tl_member']['list']['global_operations']['settings'] = [
27
-    'label'         => &$GLOBALS['TL_LANG']['tl_member']['settings'],
28
-    'href'          => 'do=member_settings',
29
-    'icon'          => 'edit.svg',
30
-    'attributes'    => 'onclick="Backend.getScrollOffset()" accesskey="e"'
28
+    'label' => &$GLOBALS['TL_LANG']['tl_member']['settings'],
29
+    'href' => 'do=member_settings',
30
+    'icon' => 'edit.svg',
31
+    'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
31 32
 ];
32 33
 
33 34
 // Add fields to tl_user
34 35
 $GLOBALS['TL_DCA']['tl_member']['fields']['avatar'] = [
35
-    'label'         => &$GLOBALS['TL_LANG']['tl_member']['avatar'],
36
-    'exclude'       => true,
37
-    'inputType'     => 'fileTree',
38
-    'eval'          => ['feEditable'=>true, 'feViewable'=>true, 'feGroup'=>'personal', 'fieldType'=>'radio', 'filesOnly'=>true, 'isGallery'=>true, 'extensions'=>Config::get('validImageTypes'), 'tl_class'=>'clr'],
39
-    'sql'           => "binary(16) NULL"
36
+    'exclude' => true,
37
+    'inputType' => 'fileTree',
38
+    'eval' => [
39
+        'feEditable' => true,
40
+        'feGroup' => 'personal',
41
+        'fieldType' => 'radio',
42
+        'filesOnly' => true,
43
+        'extensions' => implode(',', System::getContainer()->getParameter('contao.image.valid_extensions')),
44
+        'tl_class' => 'clr'
45
+    ],
46
+    'sql' => "binary(16) NULL"
47
+];
48
+
49
+$GLOBALS['TL_DCA']['tl_member']['fields']['alias'] = [
50
+    'search' => true,
51
+    'inputType' => 'text',
52
+    'eval' => ['rgxp'=>'alias', 'doNotCopy'=>true, 'unique'=>true, 'maxlength'=>255, 'tl_class'=>'w50'],
53
+    'sql' => "varchar(255) BINARY NOT NULL default ''"
40 54
 ];
Browse code

[Change] Drop contao 4.9 support

Sebastian Zoglowek authored on15/01/2023 16:55:51
Showing1 changed files
... ...
@@ -24,17 +24,17 @@ PaletteManipulator::create()
24 24
 
25 25
 // Add global operations
26 26
 $GLOBALS['TL_DCA']['tl_member']['list']['global_operations']['settings'] = [
27
-    'label' => &$GLOBALS['TL_LANG']['tl_member']['settings'],
28
-    'href' => 'do=member_settings',
29
-    'icon' => 'edit.svg',
30
-    'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
27
+    'label'         => &$GLOBALS['TL_LANG']['tl_member']['settings'],
28
+    'href'          => 'do=member_settings',
29
+    'icon'          => 'edit.svg',
30
+    'attributes'    => 'onclick="Backend.getScrollOffset()" accesskey="e"'
31 31
 ];
32 32
 
33 33
 // Add fields to tl_user
34 34
 $GLOBALS['TL_DCA']['tl_member']['fields']['avatar'] = [
35
-    'label' => &$GLOBALS['TL_LANG']['tl_member']['avatar'],
36
-    'exclude' => true,
37
-    'inputType' => 'fileTree',
38
-    'eval' => ['feEditable'=>true, 'feViewable'=>true, 'feGroup'=>'personal', 'fieldType'=>'radio', 'filesOnly'=>true, 'isGallery'=>true, 'extensions'=>Config::get('validImageTypes'), 'tl_class'=>'clr'],
39
-    'sql' => "binary(16) NULL"
35
+    'label'         => &$GLOBALS['TL_LANG']['tl_member']['avatar'],
36
+    'exclude'       => true,
37
+    'inputType'     => 'fileTree',
38
+    'eval'          => ['feEditable'=>true, 'feViewable'=>true, 'feGroup'=>'personal', 'fieldType'=>'radio', 'filesOnly'=>true, 'isGallery'=>true, 'extensions'=>Config::get('validImageTypes'), 'tl_class'=>'clr'],
39
+    'sql'           => "binary(16) NULL"
40 40
 ];
Browse code

Update comments

Sebastian Zoglowek authored on14/08/2022 16:18:52
Showing1 changed files
... ...
@@ -7,10 +7,10 @@ declare(strict_types=1);
7 7
  *
8 8
  * @package     contao-member-extension-bundle
9 9
  * @license     MIT
10
- * @author      Daniele Sciannimanica   <https://github.com/doishub>
11
- * @author      Fabian Ekert            <https://github.com/eki89>
12
- * @author      Sebastian Zoglowek      <https://github.com/zoglo>
13
- * @copyright   Oveleon                 <https://www.oveleon.de/>
10
+ * @author      Sebastian Zoglowek     <https://github.com/zoglo>
11
+ * @author      Daniele Sciannimanica  <https://github.com/doishub>
12
+ * @author      Fabian Ekert           <https://github.com/eki89>
13
+ * @copyright   Oveleon                <https://www.oveleon.de/>
14 14
  */
15 15
 
16 16
 use Contao\Config;
Browse code

Change bundle structure

Sebastian Zoglowek authored on14/08/2022 15:51:15
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,40 @@
1
+<?php
2
+
3
+declare(strict_types=1);
4
+
5
+/*
6
+ * This file is part of Oveleon ContaoMemberExtension Bundle.
7
+ *
8
+ * @package     contao-member-extension-bundle
9
+ * @license     MIT
10
+ * @author      Daniele Sciannimanica   <https://github.com/doishub>
11
+ * @author      Fabian Ekert            <https://github.com/eki89>
12
+ * @author      Sebastian Zoglowek      <https://github.com/zoglo>
13
+ * @copyright   Oveleon                 <https://www.oveleon.de/>
14
+ */
15
+
16
+use Contao\Config;
17
+use Contao\CoreBundle\DataContainer\PaletteManipulator;
18
+
19
+// Extend the default palette
20
+PaletteManipulator::create()
21
+    ->addField(['avatar'], 'personal_legend', PaletteManipulator::POSITION_APPEND)
22
+    ->applyToPalette('default', 'tl_member')
23
+;
24
+
25
+// Add global operations
26
+$GLOBALS['TL_DCA']['tl_member']['list']['global_operations']['settings'] = [
27
+    'label' => &$GLOBALS['TL_LANG']['tl_member']['settings'],
28
+    'href' => 'do=member_settings',
29
+    'icon' => 'edit.svg',
30
+    'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
31
+];
32
+
33
+// Add fields to tl_user
34
+$GLOBALS['TL_DCA']['tl_member']['fields']['avatar'] = [
35
+    'label' => &$GLOBALS['TL_LANG']['tl_member']['avatar'],
36
+    'exclude' => true,
37
+    'inputType' => 'fileTree',
38
+    'eval' => ['feEditable'=>true, 'feViewable'=>true, 'feGroup'=>'personal', 'fieldType'=>'radio', 'filesOnly'=>true, 'isGallery'=>true, 'extensions'=>Config::get('validImageTypes'), 'tl_class'=>'clr'],
39
+    'sql' => "binary(16) NULL"
40
+];