forked from wpaam/AAM-Feature-Example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.phtml
51 lines (48 loc) · 2.22 KB
/
ui.phtml
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
<?php
/**
Copyright (C) Vasyl Martyniuk <support@wpaam.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<div class="feature-content-container" id="<?php echo self::FEATURE_ID; ?>_content">
<div class="feature-example-logo"></div>
<p>
This is an example of AAM Feature that registerS UI Tab <b>Feature Example</b>
and AAM Object <b>Login Counter</b> that counts how many times current User or all users in current Role
logged in to the Admin Backend.
</p>
<div class="feature-example-counter">
<?php
$total = $subject->getObject(aam_Control_Object_LoginCounter::UID)->getOption();
$counter = array();
for ($i = 1; $i <= 9; $i++) {
if (($i % 4) === 0) {
$counter[] = '<span class="separator"><span title=",">,</span><hr /></span>';
} else {
$cut = $total % 10;
$total = floor($total / 10);
$counter[] = '<span class="digit"><span title="' . $cut . '">' . $cut . '</span><hr /></span>';
}
}
echo implode('', array_reverse($counter));
?>
</div>
<br class="clear" />
<div class="feature-example-actions">
<a href="#" class="feature-example-action feature-example-message-action">
<span><?php echo __('Email Us', 'aam'); ?></span>
</a>
<a href="http://wpaam.com/forum" target="_blank" class="feature-example-action feature-example-forum-action">
<span><?php echo __('Ask on Forum', 'aam'); ?></span>
</a>
</div>
</div>