Repository navigation
Expand file tree
/
Copy pathColorModel.php
More file actions
109 lines (100 loc) · 2.57 KB
/
Copy pathColorModel.php
File metadata and controls
109 lines (100 loc) · 2.57 KB
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
<?php
namespace Kanboard\Plugin\Greenwing;
use Kanboard\Model\ColorModel as BaseColorModel;
use Kanboard\Core\Base;
class ColorModel extends BaseColorModel
{
/**
* Default colors
*
* @access protected
* @var array
*/
protected $default_colors =
array(
'yellow' => array(
'name' => 'Yellow'
),
'blue' => array(
'name' => 'Blue'
),
'green' => array(
'name' => 'Green'
),
'purple' => array(
'name' => 'Purple'
),
'red' => array(
'name' => 'Red'
),
'orange' => array(
'name' => 'Orange'
),
'grey' => array(
'name' => 'Grey'
),
'brown' => array(
'name' => 'Brown'
),
'deep_orange' => array(
'name' => 'Deep Orange'
),
'dark_grey' => array(
'name' => 'Dark Grey'
),
'pink' => array(
'name' => 'Pink'
),
'teal' => array(
'name' => 'Teal'
),
'cyan' => array(
'name' => 'Cyan'
),
'lime' => array(
'name' => 'Lime'
),
'light_green' => array(
'name' => 'Light Green'
),
'amber' => array(
'name' => 'Amber'
)
);
/**
* Get available colors
*
* @access public
* @param bool $prepend
* @return array
*/
public function getList($prepend = false, $defaultLanguage = false)
{
$listing = $prepend ? array('' => t('All colors')) : array();
foreach ($this->default_colors as $color_id => $color) {
if ($defaultLanguage) {
$listing[$color_id] = $color['name'];
} else {
$listing[$color_id] = t($color['name']);
}
}
$this->hook->reference('model:color:get-list', $listing);
return $listing;
}
/**
* Get CSS stylesheet of all colors
*
* @access public
* @return string
*/
public function getCss()
{
$buffer = '';
foreach ($this->default_colors as $color => $values) {
$buffer .= '.task-board.color-'.$color.', .task-summary-container.color-'.$color.', .color-picker-square.color-'.$color.', .task-board-category.color-'.$color.', .table-list-category.color-'.$color.', .task-tag.color-'.$color;
$buffer .= 'td.color-'.$color;
$buffer .= '.table-list-row.color-'.$color;
}
return $buffer;
}
}