CMS  Version 3.9
color_palettes.inc
Go to the documentation of this file.
1 <?php
2 Fakoli::using("svg_charts");
3 $menu_item = "Color Palettes";
4 
5 $palettes = Query::create('ColorPalette', "ORDER BY name")->execute();
6 
8 for($i = 1; $i < 16; ++$i)
9 {
10  $colorsTemplate .= "<span class='swatch' style='background-color: {data_series_$i}' title='{data_series_$i}'></span>";
11 }
12 
13 $table = new DataListView($palettes, "color_palettes");
14 $table->column("Palette Name", "<a href='color_palette_form?palette_id={palette_id}'>{name}</a>")
15  ->column("Background", "<span class='swatch' style='background-color: {background}'></span> {background}", false, "text-align: center")
16  ->column("Stroke", "<span class='swatch' style='background-color: {stroke}'></span> {stroke}", false, "text-align: center")
17  ->column("Button", "<span class='swatch' style='background-color: {stroke}'></span> {stroke}", false, "text-align: center")
18  ->column("Data Series Colors", $colorsTemplate, false, "text-align: center");
19 
20 $table->paginate = false;
21 $table->sortable = false;
22 $table->filter = false;
23 $table->emptyMessage = "No color palettes have been created";
24 
25 $script .= $table->writeScript();
26 $table->drawView();
27 ?>
28 <br/>
29 <a class='button' href='color_palette_form'>Add a Color Palette</a>
$colorsTemplate
$palettes
$menu_item
for($i=1; $i< 16;++$i) $table
$script
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition: core.inc:116