Translation update done using Pootle.
[phpmyadmin/sankalp_k.git] / themes / svg_gradient.php
bloba5d89c61a489eb55b37cfd77501e4e1c9ff5e1c5
1 <?php
2 header('Content-Type: image/svg+xml');
3 header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');
5 function get_color($get_name, $default)
7 // get color from GET args, only alphanumeric chcracters
8 $opts = array('options' => array('regexp' => '/^[a-z0-9]+$/i'));
9 $color = filter_input(INPUT_GET, $get_name, FILTER_VALIDATE_REGEXP, $opts);
10 if (preg_match('/^[a-f0-9]{6}$/', $color)) {
11 return '#' . $color;
13 return $color ? $color : $default;
16 <?php echo '<?xml version="1.0" ?>' ?>
17 <svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" version="1.0" width="100%" height="100%">
18 <defs>
19 <linearGradient id="linear-gradient" x1="0%" y1="0%" x2="0%" y2="100%">
20 <stop offset="0%" stop-color="<?php echo get_color('from', 'white') ?>" stop-opacity="1" />
21 <stop offset="100%" stop-color="<?php echo get_color('to', 'black') ?>" stop-opacity="1" />
22 </linearGradient>
23 </defs>
24 <rect width="100%" height="100%" style="fill:url(#linear-gradient);" />
25 </svg>