4 | 7 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,13 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+/* |
|
4 |
+ * This file is part of Contao. |
|
5 |
+ * |
|
6 |
+ * (c) Leo Feyer |
|
7 |
+ * |
|
8 |
+ * @license LGPL-3.0-or-later |
|
9 |
+ */ |
|
10 |
+ |
|
11 |
+use vonRotenberg\MemberfilesBundle\Model\SecureDownloadsModel; |
|
12 |
+ |
|
13 |
+$GLOBALS['TL_MODELS']['tl_member_secureDownloads'] = SecureDownloadsModel::class; |
... | ... |
@@ -3,11 +3,11 @@ |
3 | 3 |
declare(strict_types=1); |
4 | 4 |
|
5 | 5 |
/* |
6 |
- * This file is part of [package name]. |
|
6 |
+ * This file is part of memberfiles bundle. |
|
7 | 7 |
* |
8 |
- * (c) John Doe |
|
8 |
+ * (c) vonRotenberg |
|
9 | 9 |
* |
10 |
- * @license LGPL-3.0-or-later |
|
10 |
+ * @license commercial |
|
11 | 11 |
*/ |
12 | 12 |
|
13 | 13 |
namespace VonRotenberg\MemberfilesBundle\ContaoManager; |
... | ... |
@@ -3,11 +3,11 @@ |
3 | 3 |
declare(strict_types=1); |
4 | 4 |
|
5 | 5 |
/* |
6 |
- * This file is part of [package name]. |
|
6 |
+ * This file is part of memberfiles bundle. |
|
7 | 7 |
* |
8 |
- * (c) John Doe |
|
8 |
+ * (c) vonRotenberg |
|
9 | 9 |
* |
10 |
- * @license LGPL-3.0-or-later |
|
10 |
+ * @license commercial |
|
11 | 11 |
*/ |
12 | 12 |
|
13 | 13 |
namespace VonRotenberg\MemberfilesBundle\DependencyInjection; |
14 | 14 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,42 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+declare(strict_types=1); |
|
4 |
+ |
|
5 |
+/* |
|
6 |
+ * This file is part of memberfiles bundle. |
|
7 |
+ * |
|
8 |
+ * (c) vonRotenberg |
|
9 |
+ * |
|
10 |
+ * @license commercial |
|
11 |
+ */ |
|
12 |
+ |
|
13 |
+namespace VonRotenberg\MemberfilesBundle\EventListener\DataContainer; |
|
14 |
+ |
|
15 |
+use Contao\BackendUser; |
|
16 |
+use Contao\CoreBundle\ServiceAnnotation\Callback; |
|
17 |
+use Contao\System; |
|
18 |
+use Contao\Date; |
|
19 |
+use Contao\Config; |
|
20 |
+ |
|
21 |
+class MemberSecureDownloadsListener { |
|
22 |
+ |
|
23 |
+ /** |
|
24 |
+ * @var BackendUser |
|
25 |
+ */ |
|
26 |
+ protected $User; |
|
27 |
+ public function __construct() |
|
28 |
+ { |
|
29 |
+ $this->User = BackendUser::getInstance(); |
|
30 |
+ } |
|
31 |
+ |
|
32 |
+ /** |
|
33 |
+ * @Callback(table="tl_member_secureDownloads", target="list.sorting.child_record") |
|
34 |
+ */ |
|
35 |
+ public function onChildRecordCallback(array $row) |
|
36 |
+ { |
|
37 |
+ $objSecFile = \SecureDownloadsModel::findByPk($row['id']); |
|
38 |
+ $objFile = $objSecFile->getRelated('uuid'); |
|
39 |
+ |
|
40 |
+ return '<div class="tl_content_left">' . ($objFile !== null ? $objFile->name : '') . ' <span style="color:#b3b3b3;padding-left:3px">[' . Date::parse(Config::get('datimFormat'), $row['ctime']) . ']</span></div>'; |
|
41 |
+ } |
|
42 |
+} |
0 | 43 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,73 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+/* |
|
4 |
+ * This file is part of Contao. |
|
5 |
+ * |
|
6 |
+ * (c) Leo Feyer |
|
7 |
+ * |
|
8 |
+ * @license LGPL-3.0-or-later |
|
9 |
+ */ |
|
10 |
+ |
|
11 |
+namespace vonRotenberg\MemberfilesBundle\Model; |
|
12 |
+ |
|
13 |
+use Contao\Model; |
|
14 |
+use Contao\Model\Collection; |
|
15 |
+ |
|
16 |
+/** |
|
17 |
+ * Reads and writes image sizes |
|
18 |
+ * |
|
19 |
+ * @property string|integer $id |
|
20 |
+ * @property string|integer $tstamp |
|
21 |
+ * @property string $title |
|
22 |
+ * @property string $modal_title |
|
23 |
+ * @property string|integer $delay |
|
24 |
+ * @property string|boolean $show_once |
|
25 |
+ * @property string|integer $start |
|
26 |
+ * @property string|integer $stop |
|
27 |
+ * |
|
28 |
+ * @method static SecureDownloadsModel|null findById($id, array $opt=array()) |
|
29 |
+ * @method static SecureDownloadsModel|null findByPk($id, array $opt=array()) |
|
30 |
+ * @method static SecureDownloadsModel|null findOneBy($col, $val, array $opt=array()) |
|
31 |
+ * @method static SecureDownloadsModel|null findOneByTstamp($val, array $opt=array()) |
|
32 |
+ * @method static SecureDownloadsModel|null findOneByTitle($val, array $opt=array()) |
|
33 |
+ * @method static SecureDownloadsModel|null findOneByModalTitle($val, array $opt=array()) |
|
34 |
+ * @method static SecureDownloadsModel|null findOneByDelay($val, array $opt=array()) |
|
35 |
+ * @method static SecureDownloadsModel|null findOneByShowOnce($val, array $opt=array()) |
|
36 |
+ * @method static SecureDownloadsModel|null findOneByPublished($val, array $opt=array()) |
|
37 |
+ * @method static SecureDownloadsModel|null findOneByStart($val, array $opt=array()) |
|
38 |
+ * @method static SecureDownloadsModel|null findOneByStop($val, array $opt=array()) |
|
39 |
+ * |
|
40 |
+ * @method static Collection|SecureDownloadsModel[]|SecureDownloadsModel|null findByTstamp($val, array $opt=array()) |
|
41 |
+ * @method static Collection|SecureDownloadsModel[]|SecureDownloadsModel|null findByTitle($val, array $opt=array()) |
|
42 |
+ * @method static Collection|SecureDownloadsModel[]|SecureDownloadsModel|null findByModalTitle($val, array $opt=array()) |
|
43 |
+ * @method static Collection|SecureDownloadsModel[]|SecureDownloadsModel|null findByDelay($val, array $opt=array()) |
|
44 |
+ * @method static Collection|SecureDownloadsModel[]|SecureDownloadsModel|null findByShowOnce($val, array $opt=array()) |
|
45 |
+ * @method static Collection|SecureDownloadsModel[]|SecureDownloadsModel|null findByPublished($val, array $opt=array()) |
|
46 |
+ * @method static Collection|SecureDownloadsModel[]|SecureDownloadsModel|null findByStart($val, array $opt=array()) |
|
47 |
+ * @method static Collection|SecureDownloadsModel[]|SecureDownloadsModel|null findByStop($val, array $opt=array()) |
|
48 |
+ * @method static Collection|SecureDownloadsModel[]|SecureDownloadsModel|null findMultipleByIds($val, array $opt=array()) |
|
49 |
+ * @method static Collection|SecureDownloadsModel[]|SecureDownloadsModel|null findBy($col, $val, array $opt=array()) |
|
50 |
+ * @method static Collection|SecureDownloadsModel[]|SecureDownloadsModel|null findAll(array $opt=array()) |
|
51 |
+ * |
|
52 |
+ * @method static integer countById($id, array $opt=array()) |
|
53 |
+ * @method static integer countByTstamp($val, array $opt=array()) |
|
54 |
+ * @method static integer countByTitle($val, array $opt=array()) |
|
55 |
+ * @method static integer countByModalTitle($val, array $opt=array()) |
|
56 |
+ * @method static integer countByDelay($val, array $opt=array()) |
|
57 |
+ * @method static integer countByShowOnce($val, array $opt=array()) |
|
58 |
+ * @method static integer countByPublished($val, array $opt=array()) |
|
59 |
+ * @method static integer countByStart($val, array $opt=array()) |
|
60 |
+ * @method static integer countByStop($val, array $opt=array()) |
|
61 |
+ */ |
|
62 |
+class SecureDownloadsModel extends Model |
|
63 |
+{ |
|
64 |
+ /** |
|
65 |
+ * Table name |
|
66 |
+ * @var string |
|
67 |
+ */ |
|
68 |
+ protected static $strTable = 'tl_member_secureDownloads'; |
|
69 |
+ |
|
70 |
+ |
|
71 |
+} |
|
72 |
+ |
|
73 |
+class_alias(SecureDownloadsModel::class, 'SecureDownloadsModel'); |
... | ... |
@@ -3,11 +3,11 @@ |
3 | 3 |
declare(strict_types=1); |
4 | 4 |
|
5 | 5 |
/* |
6 |
- * This file is part of [package name]. |
|
6 |
+ * This file is part of memberfiles bundle. |
|
7 | 7 |
* |
8 |
- * (c) John Doe |
|
8 |
+ * (c) vonRotenberg |
|
9 | 9 |
* |
10 |
- * @license LGPL-3.0-or-later |
|
10 |
+ * @license commercial |
|
11 | 11 |
*/ |
12 | 12 |
|
13 | 13 |
namespace VonRotenberg\MemberfilesBundle; |
... | ... |
@@ -3,11 +3,11 @@ |
3 | 3 |
declare(strict_types=1); |
4 | 4 |
|
5 | 5 |
/* |
6 |
- * This file is part of [package name]. |
|
6 |
+ * This file is part of memberfiles bundle. |
|
7 | 7 |
* |
8 |
- * (c) John Doe |
|
8 |
+ * (c) vonRotenberg |
|
9 | 9 |
* |
10 |
- * @license LGPL-3.0-or-later |
|
10 |
+ * @license commercial |
|
11 | 11 |
*/ |
12 | 12 |
|
13 | 13 |
namespace Contao\SkeletonBundle\Tests; |