PHP Classes

File: hierarchy.css.php

Recommend this page to a friend!
  Classes of Rubens Takiguti Ribeiro   Hierarchy   hierarchy.css.php   Download  
File: hierarchy.css.php
Role: Auxiliary script
Content type: text/plain
Description: Style
Class: Hierarchy
Display lists of nested arrays
Author: By
Last change:
Date: 16 years ago
Size: 2,062 bytes
 

Contents

Class file image Download
<?php
/**
 * This file is part of Hierarchy Class
 *
 * It provides a dinamic CSS based on class constants.
 * So, if you want to use other names to CSS class names,
 * update hierarchy class contants.
 *
 * @author Rubens Takiguti Ribeiro
 * @date 2008-07-16
 * @version 1.0 2008-12-16
 * @license http://www.gnu.org/licenses/lgpl-3.0.html LGPLv3 (LICENSE.TXT)
 * @copyright Copyright (C) 2008 Rubens Takiguti Ribeiro
 */
require_once(dirname(__FILE__).'/hierarchy.class.php');

$expires = 31536000; // Cache expires in 1 year (60 * 60 * 24 * 365)
$gmt = '%a, %d %b %Y %T %Z';
$line_color = '#303030';

// Get CSS class names
$hierarchy = hierarchy::CSS_HIERARCHY;
$h_left = hierarchy::CSS_LEFT_LINE;
$h_left_bottom = hierarchy::CSS_LEFT_BOTTOM_LINE;
$h_value = hierarchy::CSS_VALUE;
$h_clear = hierarchy::CSS_CLEAR;
$bt_open = hierarchy::CSS_BUTTON_OPEN;

// Print CSS file
header('Content-type: text/css');
header('Content-Disposition: inline; filename=hierarchy.css');
header('Cache-Control: public');
header('Pragma: ');
header('Date: '.gmstrftime($gmt));
header('Last-Modified: '.gmstrftime($gmt));
header('Expires: '.gmstrftime($gmt, time() + $expires));

echo <<<CSS
ul.{$hierarchy},
ul.
{$hierarchy} ul,
ul.
{$hierarchy} li,
ul.
{$hierarchy} li .{$h_left_bottom},
ul.
{$hierarchy} li .{$h_left},
ul.
{$hierarchy} li .{$h_value} {
  clear: both;
  display: block;
  list-style-type: none;
  list-style-image: none;
  margin: 0;
  padding: 0;
}

ul.
{$hierarchy} li .{$h_left_bottom} {
  border-left: 1px solid
{$line_color};
  border-bottom: 1px solid
{$line_color};
  height: .7em;
  width: .7em;
}

ul.
{$hierarchy} li .{$h_left} {
  border-left: 1px solid
{$line_color};
}

ul.
{$hierarchy} li .{$h_value} {
  clear: right;
  margin-top: -.7em;
  padding-left: 1.2em;
}

ul.
{$hierarchy} li .{$h_value} > * {
  margin-top: 0 !important;
}

ul.
{$hierarchy} li .{$h_value} img.{$bt_open} {
  background-color: #FFFFFF;
  border: 0;
  cursor: pointer;
  margin-right: .5em;
}

{$h_clear} {
  clear: both !important;
}
CSS;