forked from mapasculturais/mapasculturais
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.php
177 lines (164 loc) · 10.6 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?php
$this->layout = 'panel';
$subsite = $app->getCurrentSubsite();
$posini = 0;
$posfin = 0;
$msg = "";
$button = "";
?>
<div class="panel-main-content">
<?php $this->part('panel/highlighted-message') ?>
<?php if($subsite && $subsite->canUser('modify')):?>
<p class="highlighted-message" style="margin-top:-2em;">
<?php printf(\MapasCulturais\i::__('Você é administrador deste subsite. Clique %saqui%s para configurar.'), '<a href="' . $subsite->singleUrl . '">', '</a>'); ?>
</p>
<?php endif; ?>
<section id="user-stats" class="clearfix">
<?php if($app->isEnabled('events')): ?>
<div>
<div>
<div class="clearfix">
<span class="alignleft"><?php $this->dict('entities: Events') ?></span>
<div class="icon icon-event alignright"></div>
</div>
<div class="clearfix">
<a class="user-stats-value hltip" href="<?php echo $app->createUrl('panel', 'events') ?>" title="<?php \MapasCulturais\i::esc_attr_e("Ver Meus eventos");?>"><?php echo $count->events; ?></a>
<span class="user-stats-value hltip">|</span>
<a class="user-stats-value hltip" href="<?php echo $app->createUrl('panel', 'events') ?>#tab=permitido" title="<?php \MapasCulturais\i::esc_attr_e("Ver Eventos Cedidos");?>"><?php echo count($app->user->hasControlEvents);?></a>
<a class="icon icon-add alignright hltip" href="<?php echo $app->createUrl('event', 'create'); ?>" title="<?php \MapasCulturais\i::esc_attr_e("Adicionar eventos");?>"></a>
</div>
</div>
</div>
<?php endif; ?>
<?php if($app->isEnabled('agents')): ?>
<div>
<div>
<div class="clearfix">
<span class="alignleft"><?php $this->dict('entities: Agents') ?></span>
<div class="icon icon-agent alignright"></div>
</div>
<div class="clearfix">
<a class="user-stats-value hltip" href="<?php echo $app->createUrl('panel', 'agents') ?>" title="<?php \MapasCulturais\i::esc_attr_e("Ver meus agentes");?>"><?php echo $count->agents; ?></a>
<span class="user-stats-value hltip">|</span>
<a class="user-stats-value hltip" href="<?php echo $app->createUrl('panel', 'agents') ?>#tab=permitido" title="<?php \MapasCulturais\i::esc_attr_e("Ver Agentes Cedidos");?>"><?php echo count($app->user->hasControlAgents);?></a>
<a class="icon icon-add alignright hltip" href="<?php echo $app->createUrl('agent', 'create'); ?>" title="<?php \MapasCulturais\i::esc_attr_e("Adicionar agentes");?>"></a>
</div>
</div>
</div>
<?php endif; ?>
<?php if($app->isEnabled('spaces')): ?>
<div>
<div>
<div class="clearfix">
<span class="alignleft"><?php $this->dict('entities: Spaces') ?></span>
<div class="icon icon-space alignright"></div>
</div>
<div class="clearfix">
<a class="user-stats-value hltip" href="<?php echo $app->createUrl('panel', 'spaces') ?>" title="<?php \MapasCulturais\i::esc_attr_e("Ver");?> <?php $this->dict('entities: My spaces')?>"><?php echo $count->spaces; ?></a>
<span class="user-stats-value hltip">|</span>
<a class="user-stats-value hltip" href="<?php echo $app->createUrl('panel', 'spaces') ?>#tab=permitido" title="<?php \MapasCulturais\i::esc_attr_e("Ver Espaços Cedidos");?>"><?php echo count($app->user->hasControlSpaces);?></a>
<a class="icon icon-add alignright hltip" href="<?php echo $app->createUrl('space', 'create'); ?>" title="<?php \MapasCulturais\i::esc_attr_e("Adicionar");?> <?php $this->dict('entities: spaces') ?>"></a>
</div>
</div>
</div>
<?php endif; ?>
<?php if($app->isEnabled('projects')): ?>
<div>
<div>
<div class="clearfix">
<span class="alignleft"><?php $this->dict('entities: Projects') ?></span>
<div class="icon icon-project alignright"></div>
</div>
<div class="clearfix">
<a class="user-stats-value hltip" href="<?php echo $app->createUrl('panel', 'projects') ?>" title="<?php \MapasCulturais\i::esc_attr_e("Ver meus projetos");?>"><?php echo $count->projects; ?></a>
<span class="user-stats-value hltip">|</span>
<a class="user-stats-value hltip" href="<?php echo $app->createUrl('panel', 'projects') ?>#tab=permitido" title="<?php \MapasCulturais\i::esc_attr_e("Ver Projetos Cedidos");?>"><?php echo count($app->user->hasControlProjects);?></a>
<a class="icon icon-add alignright hltip" href="<?php echo $app->createUrl('project', 'create'); ?>" title="<?php \MapasCulturais\i::esc_attr_e("Adicionar projetos");?>"></a>
</div>
</div>
</div>
<?php endif; ?>
<?php if($app->isEnabled('opportunities')): ?>
<div>
<div>
<div class="clearfix">
<span class="alignleft"><?php $this->dict('entities: Opportunities') ?></span>
<div class="icon icon-opportunity alignright"></div>
</div>
<div class="clearfix">
<a class="user-stats-value hltip" href="<?php echo $app->createUrl('panel', 'opportunities') ?>" title="<?php \MapasCulturais\i::esc_attr_e("Ver minhas oportunidades");?>"><?php echo $count->opportunities; ?></a>
<span class="user-stats-value hltip">|</span>
<a class="user-stats-value hltip" href="<?php echo $app->createUrl('panel', 'opportunities') ?>#tab=permitido" title="<?php \MapasCulturais\i::esc_attr_e("Ver Oportunidades Cedidas");?>"><?php echo count($app->user->hasControlOpportunities);?></a>
</div>
</div>
</div>
<?php endif; ?>
<?php if($app->isEnabled('subsite') && $app->user->is('saasAdmin')): ?>
<div>
<div>
<div class="clearfix">
<span class="alignleft"><?php \MapasCulturais\i::_e('Subsite'); ?></span>
<div class="icon icon-subsite alignright"></div>
</div>
<div class="clearfix">
<a class="user-stats-value hltip" href="<?php echo $app->createUrl('panel', 'subsite') ?>" title="<?php \MapasCulturais\i::esc_attr_e('Ver meus subsites'); ?>"><?php echo $count->subsite; ?></a>
<a class="icon icon-add alignright hltip" href="<?php echo $app->createUrl('subsite', 'create'); ?>" title="<?php \MapasCulturais\i::esc_attr_e('Adicionar subsite'); ?>"></a>
</div>
</div>
</div>
<?php endif; ?>
<?php if($app->isEnabled('seals') && $app->user->is('admin')): ?>
<div>
<div>
<div class="clearfix">
<span class="alignleft"><?php \MapasCulturais\i::_e('Selos'); ?></span>
<div class="icon icon-seal alignright"></div>
</div>
<div class="clearfix">
<a class="user-stats-value hltip" href="<?php echo $app->createUrl('panel', 'seals') ?>" title="<?php \MapasCulturais\i::esc_attr_e("Ver meus selos");?>"><?php echo $count->seals; ?></a>
<span class="user-stats-value hltip">|</span>
<a class="user-stats-value hltip" href="<?php echo $app->createUrl('panel', 'seals') ?>#tab=permitido" title="<?php \MapasCulturais\i::esc_attr_e("Ver Selos Cedidos");?>"><?php echo count($app->user->hasControlSeals);?></a>
<a class="icon icon-add alignright hltip" href="<?php echo $app->createUrl('seal', 'create'); ?>" title="<?php \MapasCulturais\i::esc_attr_e("Adicionar selos");?>"></a>
</div>
</div>
</div>
<?php endif; ?>
</section>
<?php if($app->user->notifications): ?>
<section id="activities">
<header>
<h2><?php \MapasCulturais\i::_e("Atividades");?></h2>
</header>
<?php foreach ($app->user->notifications as $notification): ?>
<?php $posini = strpos($notification->message,"<a"); ?>
<?php $msg = $notification->message;?>
<div class="activity clearfix">
<p>
<span class="small"><?php \MapasCulturais\i::_e("Em");?> <?php echo $notification->createTimestamp->format('d/m/Y - H:i') ?></span><br/>
<?php echo $msg; ?>
</p>
<?php if ($notification->request): ?>
<div>
<?php if($notification->request->canUser('approve')): ?><a class="btn btn-small btn-success" href="<?php echo $notification->approveUrl ?>"><?php \MapasCulturais\i::_e("aceitar");?></a><?php endif; ?>
<?php if($notification->request->canUser('reject')): ?>
<?php if($notification->request->requesterUser->equals($app->user)): ?>
<a class="btn btn-small btn-default" href="<?php echo $notification->rejectUrl ?>"><?php \MapasCulturais\i::_e("cancelar");?></a>
<a class="btn btn-small btn-success" href="<?php echo $notification->deleteUrl ?>"><?php \MapasCulturais\i::_e("ok");?></a>
<?php else: ?>
<a class="btn btn-small btn-danger" href="<?php echo $notification->rejectUrl ?>"><?php \MapasCulturais\i::_e("rejeitar");?></a>
<?php endif ;?>
<?php endif; ?>
</div>
<?php else: ?>
<div>
<?php if($button):?>
<?php echo $button;?>
<?php endif;?>
<a class="btn btn-small btn-success" href="<?php echo $notification->deleteUrl ?>"><?php \MapasCulturais\i::_e("ok");?></a>
</div>
<?php endif ?>
</div>
<?php endforeach; ?>
</section>
<?php endif; ?>
</div>