validator.php 3.36 KB
Newer Older
Marcello Pivanti's avatar
Marcello Pivanti committed
1
2
3
4
5
6
<?php

/**
 * Art-ER Attrattività, ricerca e territorio dell’Emilia-Romagna
 * OPEN 2.0
 *
7
8
9
 * @see https://www.open2.0.regione.lombardia.it Developers'community
 * @license GPLv3
 * @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
Marcello Pivanti's avatar
Marcello Pivanti committed
10
 *
waltermazza's avatar
waltermazza committed
11
 * @package    arter\amos\notificationmanager\views\email
Marcello Pivanti's avatar
Marcello Pivanti committed
12
13
14
15
 * @category   CategoryName
 * @author     Elite Division S.r.l.
 */

waltermazza's avatar
waltermazza committed
16
17
18
19
use arter\amos\core\interfaces\ModelGrammarInterface;
use arter\amos\notificationmanager\AmosNotify;
use arter\amos\core\helpers\Html;
use arter\amos\cwh\base\ModelContentInterface;
Marcello Pivanti's avatar
Marcello Pivanti committed
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

if(!empty($profile)) {
    $this->params['profile'] = $profile;
}

/** @var ModelGrammarInterface $modelGrammar */
$modelGrammar = $model->getGrammar();
$articleSingular = $modelGrammar->getArticleSingular();
$spaceAfterArticleSingular = (substr($articleSingular, -1) == "'" ? '' : ' ');

?>

<div>

    <div style="box-sizing:border-box;color:#000000;">
        <div style="padding:5px 10px;background-color: #F2F2F2;text-align:center;">
            <h1 style="color:#297A38;font-size:1.5em;margin:0;">
                <?= AmosNotify::t('amosnotify', '#validation_request_email_1') . ' ' . $articleSingular . $spaceAfterArticleSingular . strtolower($modelGrammar->getModelSingularLabel()) ?>
            </h1>
        </div>
    </div>
    <div style="border:1px solid #cccccc;padding:10px;margin-bottom: 10px;background-color: #ffffff;margin-top: 20px;">
        <div>
            <h2 style="font-size:2em;line-height: 1;"><?= Html::a($model->getTitle(), Yii::$app->urlManager->createAbsoluteUrl($model->getFullViewUrl()), ['style' => 'color: #297A38;']) ?></h2>
        </div>
        <div style="box-sizing:border-box;">
            <div style="box-sizing:border-box;padding:0;font-weight:bold;color:#000000;font-weight: normal;">
                <?php
                echo $model->getDescription(false);
                ?>
            </div>
        </div>


        <div style="margin-top:20px; display: flex; padding: 10px;">
            <div
                style="width: 50px; height: 50px; overflow: hidden;-webkit-border-radius: 50%; -moz-border-radius: 50%; border-radius: 50%;float: left;">
                <?php
                $layout = '{publisher}';
                if ($model instanceof ModelContentInterface) {
                    $layout = '{publisher}{publishingRules}{targetAdv}';
                }
                ?>
                <?php
                $user = $model->getCreatedUserProfile()->one();
                if(!is_null($user)){
waltermazza's avatar
waltermazza committed
66
                        echo \arter\amos\admin\widgets\UserCardWidget::widget([
Marcello Pivanti's avatar
Marcello Pivanti committed
67
68
69
70
71
72
73
74
75
                            'model' => $user,
                            'onlyAvatar' => true,
                            'absoluteUrl' => true
                        ]);
                }
                ?>
            </div>

            <div style="margin-left: 20px;">
waltermazza's avatar
waltermazza committed
76
                <?= \arter\amos\core\forms\PublishedByWidget::widget([
Marcello Pivanti's avatar
Marcello Pivanti committed
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
                    'model' => $model,
                    'layout' => $layout,
                ]) ?>
            </div>
        </div>

        <div style="width:100%;margin-top:30px">
            <?= Html::a(AmosNotify::t('amosnotify', '#validation_request_email_link_text'), $url, ['style' => 'color: #297A38;']) ?>
        </div>
        <p>
            <?= AmosNotify::t('amosnotify', '#validation_request_email_footer') ?>
        </p>

    </div>
</div>