Add new api procedures: getDefaultTaskColor(), getDefaultTaskColors() and getColorList()

This commit is contained in:
Frederic Guillot
2015-07-29 18:45:26 -04:00
parent f595fb2786
commit 2d6b6533ac
5 changed files with 259 additions and 11 deletions

View File

@@ -122,6 +122,22 @@ class Color extends Base
return '';
}
/**
* Get color properties
*
* @access public
* @param string $color_id
* @return array
*/
public function getColorProperties($color_id)
{
if (isset($this->default_colors[$color_id])) {
return $this->default_colors[$color_id];
}
return $this->default_colors[$this->getDefaultColor()];
}
/**
* Get available colors
*
@@ -150,6 +166,17 @@ class Color extends Base
return $this->config->get('default_color', 'yellow');
}
/**
* Get the default colors
*
* @access public
* @return array
*/
public function getDefaultColors()
{
return $this->default_colors;
}
/**
* Get Bordercolor from string
*
@@ -159,11 +186,8 @@ class Color extends Base
*/
public function getBorderColor($color_id)
{
if (isset($this->default_colors[$color_id])) {
return $this->default_colors[$color_id]['border'];
}
return $this->default_colors[$this->getDefaultColor()]['border'];
$color = $this->getColorProperties($color_id);
return $color['border'];
}
/**
@@ -175,11 +199,8 @@ class Color extends Base
*/
public function getBackgroundColor($color_id)
{
if (isset($this->default_colors[$color_id])) {
return $this->default_colors[$color_id]['background'];
}
return $this->default_colors[$this->getDefaultColor()]['background'];
$color = $this->getColorProperties($color_id);
return $color['background'];
}
/**