PHP Classes

File: sample.php

Recommend this page to a friend!
  Classes of Gerry Danen   Theme Roller   sample.php   Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: Sample usage
Class: Theme Roller
Generate CSS stylesheets with color palette themes
Author: By
Last change: Updated
Date: 8 years ago
Size: 2,122 bytes
 

Contents

Class file image Download
<?php
// chosen theme is stored in a session variable
session_start();

require_once
'generalFunctions.inc.php';
require_once
'themeRoller.class.php';
require_once
'buildUrl.inc.php'; // prepares $themeCSS and set session variable

require_once 'themeContent.php'; // this does the same thing as theme.php, except that certain vars are now exposed

$options = ThemeRoller::themeOptionSelect();
$chosenTheme = $_SESSION['theme']['choice'];

echo <<<EOX
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="/favicon.ico">
    <title>ThemeRoller: Danen-Dev</title>
    <link rel="stylesheet" type="text/css" href="
$themeCSS"/>
</head>
<body>
<p class="taCenter bold under">A note outside the panel-body div.</p>
<div class="panel-body">
    <h1>ThemeRoller Demo</h1>
    <p id="introText">ThemeRoller provides a simple way to manage CSS themes without the need for a pre-processor.</p>
    <p>The theme.php file calls on themeContent.php, which can be modified to add additional colours, selectors, and
        rules.</p>
    <div style="margin: 6px;padding: 8px 12px;" class="reverse-panel-body">
        <h2>Theme Palette Code:
$chosenTheme (this div uses reverse-panel-body)</h2>
       
$paletteListSelectedTheme
    </div>
    <form action="sample.php" method="get" class="rollerSpecial">
        <label for="themename">Select a theme colour:</label>
        <select name="themename" id="themename" style="width: 200px;">
           
$options
        </select>
        <button type="submit"> Go</button>
    </form>
    <p class="taRight"><a style="padding:2px 4px;background-color:#FFF;" href="sample2.php?
$queryParameters">Load sample 2</a></p>
    <div style="margin: 6px 6px 16px 6px;padding: 8px 12px 18px 12px;" class="grnDark yelLightBackground">
        <h2>Palette</h2>
       
$paletteList
    </div>
    <div style="margin: 6px;padding: 8px 12px;" class="themeColorDark themeColorLightBackground">
        <h2>CSS generated and used</h2>
        <pre class="themeColorDark themeColorLightBackground">
$rollerCSS</pre>
    </div>
    <br>
</div>
</body>
</html>
EOX;