-
Notifications
You must be signed in to change notification settings - Fork 0
/
box.php
62 lines (57 loc) · 1.77 KB
/
box.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
<?php
/*
Name: VZM Copyright Box
Author: Tim Milligan
Description: Adds a customizable copyright box to the skin editor.
Version: 1.3
Class: vzm_copyright
*/
class vzm_copyright extends thesis_box {
protected function translate() {
$this->title = __('Copyright', 'vzm');
}
protected function options() {
global $thesis;
return array(
'name' => array(
'type' => 'text',
'width' => 'medium',
'label' => __('Name', 'vzm')
),
'url' => array(
'type' => 'text',
'label' => __('URL (leave blank for none)', 'vzm'),
'width' => 'medium'
),
'new-window' => array(
'type' => 'checkbox',
'options' => array(
'yes' => __('Open Link in New Window', 'vzm')
)
),
'start_date' => array(
'type' => 'text',
'width' => 'tiny',
'label' => __('Copyright Start Date (leave blank for none)', 'vzm')
),
'class' => array(
'type' => 'text',
'width' => 'medium',
'code' => true,
'label' => $thesis->api->strings['html_class'],
'tooltip' => $thesis->api->strings['class_tooltip'] . $thesis->api->strings['class_note']),
);
}
public function html($args = false) {
extract($args = is_array($args) ? $args : array());
$tab = str_repeat("\t", !empty($depth) ? $depth : 0);
$name = $this->options['name'];
$url = $this->options['url'];
$new_window = $this->options['new-window'];
$start_date = $this->options['start_date'];
$class = $this->options['class'];
echo
$tab .
sprintf(__("<p%s>Copyright © %s%d %s%s%s. All Rights Reserved."), ($class ? ' class="' . $class . '"' : ''), ($start_date ? $start_date . ' – ' : ''), date('Y'), (!empty($url) ? '<a href="' . $url . '"' . ($new_window['yes'] ? ' target="_blank">' : '>') : ''), $name, (!empty($url) ? '</a>' : '')) . "</p>\n";
}
}