PHP Classes

File: ajxSaveCSS.php

Recommend this page to a friend!
  Classes of Alec Sherman   PHP CSS Editor Maker   ajxSaveCSS.php   Download  
File: ajxSaveCSS.php
Role: Auxiliary script
Content type: text/plain
Description: creates CSS file
Class: PHP CSS Editor Maker
Visual editor for CSS theme files using templates
Author: By
Last change: changed Listing Priority
Date: 2 years ago
Size: 2,910 bytes
 

Contents

Class file image Download
<?PHP
function wzGetPost($fncPostVariable, $fncDefault = '') {
   
$fncResult = isset($_POST[$fncPostVariable]) ? $_POST[$fncPostVariable] : '';
    if (
$fncResult == ''):
       
$fncResult = $fncDefault;
    endif;
// $fncResult == ''
   
return $fncResult ;
}
// end of wzGetPost

$pgFileName = wzGetPost('fileName');
$pgGradientLeft = wzGetPost('--gradient-left');
$pgGradientRight = wzGetPost('--gradient-right');
$pgColor1 = wzGetPost('--btn-color');
$pgColor2 = wzGetPost('--btn-border-color');
$pgColor3 = wzGetPost('--btn-hover');
$pgColor4 = wzGetPost('--href-link');
$pgColor5 = wzGetPost('--active-label');
$pgColor6 = wzGetPost('--light-theme-focus');
$pgColor7 = wzGetPost('--dark-theme-focus');
$pgColor8 = wzGetPost('--bg-second-color');

$pgHtm =<<<htmVAR
/*
MIT License

Copyright 2021 Wizards Toolkit

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----------------------------------------------------------------
This file was created using Wizards Toolkit CSS Maker
https://WizardsToolkit.com
Wizards Toolkit is a low-code development library for PHP, SQL and JavaScript

This file to be used with these files in this order:
materialize.min.css
{this file}
wtkLight.css or wtkDark.css
wtkGlobal.css
*/
:root {
    --gradient-left:
$pgGradientLeft;
    --gradient-right:
$pgGradientRight;
    --gradient-color: linear-gradient(to right, var(--gradient-left), var(--gradient-right));
    --btn-color:
$pgColor1;
    --btn-border-color:
$pgColor2;
    --btn-hover:
$pgColor3;
    --href-link:
$pgColor4;
    --active-label:
$pgColor5;
    --light-theme-focus:
$pgColor6;
    --dark-theme-focus:
$pgColor7;
    --bg-second-color:
$pgColor8;
}
htmVAR;

$pgCssName = 'wtk' . $pgFileName . '.css';
$pgFile = fopen($pgCssName, 'w');
fwrite($pgFile, $pgHtm);
fclose($pgFile);

echo
'{"result":"ok"}';
exit;
// no display needed, handled via JS and main.htm
?>