+++ /dev/null
-<?php
-/*=====================================================================*\
-|| ###################################################################
-|| # Blue Static ISSO Framework [#]issoversion[#]
-|| # Copyright ©2002-[#]year[#] Blue Static
-|| #
-|| # This program is free software; you can redistribute it and/or modify
-|| # it under the terms of the GNU General Public License as published by
-|| # the Free Software Foundation; version [#]gpl[#] of the License.
-|| #
-|| # This program is distributed in the hope that it will be useful, but
-|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-|| # more details.
-|| #
-|| # You should have received a copy of the GNU General Public License along
-|| # with this program; if not, write to the Free Software Foundation, Inc.,
-|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-|| ###################################################################
-\*=====================================================================*/
-
-/**
-* Globalized Functions
-* functions.php
-*
-* @package ISSO
-*/
-
-/**
-* Globalized Functions
-*
-* This framework is a set of functions that are commonly used in most
-* applications.
-*
-* @author Blue Static
-* @copyright Copyright ©2002 - [#]year[#], Blue Static
-* @version $Revision$
-* @package ISSO
-*
-*/
-class Functions
-{
- /**
- * Framework registry object
- * @var object
- */
- private $registry = null;
-
- /**
- * The path that is used to set cookies
- * @var string
- */
- private $cookiepath = '/';
-
- /**
- * The domain used for cookie setting
- * @var string
- */
- private $cookiedom = '';
-
- /**
- * The time it takes for a cookie to expire
- * @var integer
- */
- private $cookieexp = 900;
-
- /**
- * State of the current background colour during alternation
- * @var string
- */
- public $bgcolour = '';
-
- /**
- * Fields array that is used in this module
- * @var array
- */
- private $fields = array(
- 'cookiepath' => array(REQ_YES, null, true),
- 'cookiedom' => array(REQ_YES, null, true),
- 'cookieexp' => array(REQ_YES, null, true)
- );
-
- // ###################################################################
- /**
- * Constructor
- */
- public function __construct(&$registry)
- {
- $this->registry =& $registry;
- }
-
- // ###################################################################
- /**
- * Sets an ISSO field
- *
- * @param string Field name
- * @param mixed Value of the field
- */
- public function set($name, $value)
- {
- $this->registry->do_set($name, $value, 'functions');
- }
-
- // ###################################################################
- /**
- * Gets an ISSO field
- *
- * @param string Field name
- *
- * @return mixed Value of the field
- */
- public function get($fieldname)
- {
- return $this->registry->do_get($fieldname, 'functions');
- }
-
- // ###################################################################
- /**
- * Sets a cookie with a friendly interface
- *
- * @param string The name of the cookie
- * @param string Value of the cookie
- * @param bool Is the cookie permanent?
- */
- public function cookie($name, $value = '', $sticky = true)
- {
- $this->registry->check_isso_fields(get_class($this));
-
- // expire the cookie
- if (!$value)
- {
- setcookie($name, $value, time() - (2 * $this->cookieexp), $this->cookiepath, $this->cookiedom);
- }
- // set the cookie
- else
- {
- if ($sticky)
- {
- $expire = time() + 60 * 60 * 24 * 365;
- }
- else
- {
- $expire = time() + $this->cookieexp;
- }
-
- setcookie($name, $value, $expire, $this->cookiepath, $this->cookiedom);
- }
- }
-
- // ###################################################################
- /**
- * Alternate between two background colours
- *
- * @param string First CSS class name
- * @param string Second CSS class name
- */
- public function exec_swap_bg($class1 = 'alt1', $class2 = 'alt2')
- {
- static $count;
-
- $this->bgcolour = ($count % 2) ? $class1 : $class2;
- $count++;
- }
-}
-
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
-?>
\ No newline at end of file