From: Leif Hanson
Date: Thu, 13 Feb 2014 19:00:25 +0000 (+0000)
Subject: HTML Template
X-Git-Tag: v1.0.0~49
X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=55b336879ee39a434f6eebe65ee751ad946aa54b;p=web%2FTroutCreek.git
HTML Template
---
diff --git a/.htaccess b/.htaccess
deleted file mode 100644
index b5b8cd6..0000000
--- a/.htaccess
+++ /dev/null
@@ -1,31 +0,0 @@
-
-Order allow,deny
-Deny from all
-
-
-Order allow,deny
-Deny from all
-
-#ErrorDocument 404 /404.html
-RewriteEngine On
-AddDefaultCharset utf-8
-RewriteBase /www.troutcreek.com/
-#RewriteCond %{HTTP_HOST} !^(.*)\.troutcreek\.com$ [NC]
-#RewriteRule ^(.*)$ http://www.troutcreek.com/$1 [R=301,L]
-RewriteRule ^VisitorGuide/(.*)/$ pdf-download.php?uidpdf=$1&pdf_file=VisitorGuide [L]
-RewriteRule ^.*-([0-9]*)/([0-9]*)/$ index.php?catid=$1&photo_catid=$2 [L]
-# rewrites for the toolbox pages
-RewriteRule ^.*-([0-9]*)/index.php index\.php?%{QUERY_STRING}
-RewriteRule ^.*-([0-9]*)/$ index\.php?catid=$1 [L]
-
-RewriteRule site-map index.php?catid=1&sitemap=1
-
-# short urls
-RewriteCond %{REQUEST_URI} !(^.*-([0-9]*)/$)
-RewriteRule ^([A-Za-z0-9_-]*)/$ index.php?glmPage=$1 [L]
-
-###############
-## Templates ##
-###############
-# View flexy templates as php files
-AddType application/x-httpd-php .tpl
diff --git a/AC_RunActiveContent.js b/AC_RunActiveContent.js
deleted file mode 100644
index 1faba83..0000000
--- a/AC_RunActiveContent.js
+++ /dev/null
@@ -1,126 +0,0 @@
-//v1.0
-//Copyright 2006 Adobe Systems, Inc. All rights reserved.
-function AC_AddExtension(src, ext)
-{
- if (src.indexOf('?') != -1)
- return src.replace(/\?/, ext+'?');
- else
- return src + ext;
-}
-
-function AC_Generateobj(objAttrs, params, embedAttrs)
-{
- var str = '';
- for (var i in params)
- str += ' ';
- str += ' ';
-
- document.write(str);
-}
-
-function AC_FL_RunContent(){
- var ret =
- AC_GetArgs
- ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
- , "application/x-shockwave-flash"
- );
- AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
-}
-
-function AC_SW_RunContent(){
- var ret =
- AC_GetArgs
- ( arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
- , null
- );
- AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
-}
-
-function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
- var ret = new Object();
- ret.embedAttrs = new Object();
- ret.params = new Object();
- ret.objAttrs = new Object();
- for (var i=0; i < args.length; i=i+2){
- var currArg = args[i].toLowerCase();
-
- switch (currArg){
- case "classid":
- break;
- case "pluginspage":
- ret.embedAttrs[args[i]] = args[i+1];
- break;
- case "src":
- case "movie":
- args[i+1] = AC_AddExtension(args[i+1], ext);
- ret.embedAttrs["src"] = args[i+1];
- ret.params[srcParamName] = args[i+1];
- break;
- case "onafterupdate":
- case "onbeforeupdate":
- case "onblur":
- case "oncellchange":
- case "onclick":
- case "ondblClick":
- case "ondrag":
- case "ondragend":
- case "ondragenter":
- case "ondragleave":
- case "ondragover":
- case "ondrop":
- case "onfinish":
- case "onfocus":
- case "onhelp":
- case "onmousedown":
- case "onmouseup":
- case "onmouseover":
- case "onmousemove":
- case "onmouseout":
- case "onkeypress":
- case "onkeydown":
- case "onkeyup":
- case "onload":
- case "onlosecapture":
- case "onpropertychange":
- case "onreadystatechange":
- case "onrowsdelete":
- case "onrowenter":
- case "onrowexit":
- case "onrowsinserted":
- case "onstart":
- case "onscroll":
- case "onbeforeeditfocus":
- case "onactivate":
- case "onbeforedeactivate":
- case "ondeactivate":
- case "type":
- case "codebase":
- ret.objAttrs[args[i]] = args[i+1];
- break;
- case "width":
- case "height":
- case "align":
- case "vspace":
- case "hspace":
- case "class":
- case "title":
- case "accesskey":
- case "name":
- case "id":
- case "tabindex":
- ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
- break;
- default:
- ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
- }
- }
- ret.objAttrs["classid"] = classid;
- if (mimeType) ret.embedAttrs["type"] = mimeType;
- return ret;
-}
diff --git a/Toolkit/.htaccess b/Toolkit/.htaccess
deleted file mode 100644
index 532b751..0000000
--- a/Toolkit/.htaccess
+++ /dev/null
@@ -1,2 +0,0 @@
-#IndexIgnore */*
-#Options All -Indexes
diff --git a/Toolkit/CKImages/Connector.php b/Toolkit/CKImages/Connector.php
deleted file mode 100644
index a70f30d..0000000
--- a/Toolkit/CKImages/Connector.php
+++ /dev/null
@@ -1,360 +0,0 @@
-
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version CVS: $Id: Connector.php,v 1.8 2009/11/15 19:12:23 jamie Exp $
- * @link http://demo.gaslightmedia.com
- */
-
-
-/**
- * Connects the CKImage browser to the server for image manipulation
- *
- * @category CKImages
- * @package Toolkit_CKImages
- * @author Jamie Kahgee
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version Release: @package_version@
- * @link http://demo.gaslightmedia.com
- */
-class Toolkit_CKImages_Connector
-{
- // {{{ setDbh()
-
-
- /**
- * Sets the database handler for the object to use
- *
- * @param PDO $pdo PHP Data Object
- *
- * @return void
- * @access public
- */
- public function setDbh(PDO $pdo)
- {
- $this->dbh = $pdo;
- }
-
- // }}}
-
- // {{{ createFolder()
-
-
- /**
- * Creates a new folder
- *
- * @return void
- * @access public
- */
- public function createFolder()
- {
- // get the folder id
- $folder = $_GET['name'];
- $parent = ctype_digit((string) $_GET['folder']) ? $_GET['folder'] : 1;
-
- if (ctype_digit((string) $_GET['parentFolder'])) {
- $parent = $_GET['parentFolder'];
- }
- // unset unneeded param values
- unset($_GET['command'], $_GET['name'], $_GET['parentFolder']);
-
- try {
- $sql = "
- INSERT INTO ckeditor_folders(name, parent)
- VALUES (:name, :parent)";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(':name', $folder, PDO::PARAM_INT);
- $stmt->bindParam(':parent', $parent, PDO::PARAM_INT);
- $stmt->execute();
- header('Location:' . BASE_URL . 'Toolkit/CKImages/browser.php?' . http_build_query($_GET));
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
-
- // {{{ deleteFile()
-
-
- /**
- * Deletes a file from the image server for client
- *
- * @param Toolkit_Image_Server $is Image Server Object
- *
- * @return void
- * @access public
- */
- public function deleteFile(Toolkit_Image_Server $is)
- {
- // Get offset where target img starts at
- $start = strrpos($_GET['img'], '/') + 1;
- // get the image name
- $img = substr($_GET['img'], $start);
- // unset unneeded param values
- unset($_GET['command'], $_GET['img']);
-
- $is->imageDelete($img);
-
- try {
- $sql = "
- DELETE FROM ckeditor_images
- WHERE name_on_disk = :nod";
-
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(':nod', $img, PDO::PARAM_STR);
- $stmt->execute();
- header('Location:' . BASE_URL . 'Toolkit/CKImages/browser.php?' . http_build_query($_GET));
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
- // {{{ deleteFolder()
-
-
- /**
- * Deletes a folder and any sub folders
- *
- * Moves all containing images to home folder so they are not
- * inadvertently deleted
- *
- * @param Toolkit_Image_Server $is Image Server used to delete photo
- *
- * @return void
- * @access public
- */
- public function deleteFolder(Toolkit_Image_Server $is)
- {
- // get the folder id
- $folder = $_GET['folder'];
- if ($folder == 1) {
- return false;
- }
- // unset unneeded param values
- unset($_GET['command'], $_GET['tgt']);
- $_GET['folder'] = 1;
-
- try {
- $tree = Toolkit_Common::getHierarchicalTreeStructure(
- $this->dbh,
- 'ckeditor_folders',
- 'id',
- 'parent',
- 'id',
- $folder,
- 0,
- false
- );
-
- $sql = "
- UPDATE ckeditor_images
- SET folder = 1
- WHERE folder = :folder";
-
- $imgStmt = $this->dbh->prepare($sql);
-
- $sql = "
- DELETE FROM ckeditor_folders
- WHERE id = :folder";
- $fldrStmt = $this->dbh->prepare($sql);
- while (list($tgt) = each($tree)) {
- $imgStmt->bindParam(':folder', $tgt, PDO::PARAM_INT);
- $imgStmt->execute();
-
- $fldrStmt->bindParam(':folder', $tgt, PDO::PARAM_INT);
- $fldrStmt->execute();
- }
- // These cookies are defined in the libjs/image_selector.js file
- // when the tree is created.
- unset($_COOKIE['glm_image_browser_open'], $_COOKIE['glm_image_browser_selected']);
- header('Location:' . BASE_URL . 'Toolkit/CKImages/browser.php?' . http_build_query($_GET));
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
-
- // {{{ browseImages()
-
-
- /**
- * Creates the browser window
- *
- * @param HTML_Template_Flexy $tEngine Flexy Rendering Engine Object
- * @param Toolkit_Image_Server $is Image Server
- *
- * @return string HTML page to browse images
- * @access public
- */
- public function browseImages(
- HTMl_Template_Flexy $tEngine,
- Toolkit_Image_Server $is
- ) {
- $page = new stdClass();
- $page->originalPath = ORIGINAL;
- $page->imageManager = IMAGE_MANAGER;
-
- $folder = ctype_digit((string) $_GET['folder'])
- ? "&folder={$_GET['folder']}" : '';
- $form = new HTML_QuickForm(
- 'quick_upload',
- 'post',
- BASE_URL . "Toolkit/CKImages/controller.php?CKEditor={$_GET['CKEditor']}&CKEditorFuncNum={$_GET['CKEditorFuncNum']}&langCode={$_GET['langCode']}&command=UploadFile$folder"
- );
- $form->addElement('file', 'upload');
- $page->quickUploadForm = $form->toHtml();
-
- $folders = new Toolkit_CKImages_Folders($this->dbh);
- $page->folders = $folders->getFolders(0);
-
- try {
- $folder = ctype_digit((string) $_GET['folder'])
- ? $_GET['folder'] : 1;
- $sql = "
- SELECT *
- FROM ckeditor_images
- WHERE folder = :folder
- ORDER BY id ASC";
-
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(':folder', $folder, PDO::PARAM_INT);
- $stmt->execute();
-
- $images = $stmt->fetchAll(PDO::FETCH_ASSOC);
-
- foreach ($images as &$i) {
- $dimensions = $is->getImageSize($page->originalPath . $i['name_on_disk']);
- list($i['width'], $i['height'],) = $dimensions;
- }
-
- $page->images = $images;
-
- $tEngine->compile('thumbnails.html');
- $tEngine->outputObject($page);
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
-
- // {{{ handleUpload()
-
-
- /**
- * Handles inserting the upload into the database
- *
- * @param string $imageName image to insert
- * @param array $dimensions dimensions of the image
- *
- * @return object Return description (if any) ...
- * @access protected
- */
- protected function handleUpload($imageName, array $dimensions)
- {
- try {
- $folder = ctype_digit((string) $_GET['folder'])
- ? $_GET['folder'] : 1;
- $sql = "
- INSERT INTO ckeditor_images (file_name, name_on_disk, folder,
- original_width, original_height)
- VALUES (:fname, :nod, :folder, :width, :height)";
-
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(
- ':fname',
- $_FILES['upload']['name'],
- PDO::PARAM_STR
- );
- $stmt->bindParam(':nod', $imageName, PDO::PARAM_STR);
- $stmt->bindValue(':folder', $folder, PDO::PARAM_INT);
- $stmt->bindValue(':width', $dimensions['oWidth'], PDO::PARAM_INT);
- $stmt->bindValue(':height', $dimensions['oHeight'], PDO::PARAM_INT);
-
-
- return $stmt->execute();
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
-
- // {{{ quickUpload()
-
-
- /**
- * send uploaded image to image server
- *
- * @param Toolkit_Image_Server $is Image Server
- *
- * @return void
- * @access public
- */
- public function quickUpload(Toolkit_Image_Server $is)
- {
- ob_start();
- $imageName = $is->imageUpload('upload');
- ob_end_clean();
- if ($imageName) {
- $dimensions = $is->getImageSize(ORIGINAL . $imageName);
- list($i['oWidth'], $i['oHeight'],) = $dimensions;
- $this->handleUpload($imageName, $i);
- }
-
- unset($_GET['command']);
- header('Location:' . BASE_URL . 'Toolkit/CKImages/browser.php?' . http_build_query($_GET));
- }
-
- // }}}
-
- // {{{ uploadFile()
-
-
- /**
- * send uploaded image to image server and select that file to be used
- *
- * @param Toolkit_Image_Server $is Image server object
- *
- * @return void
- * @access public
- */
- public function uploadFile(Toolkit_Image_Server $is)
- {
- ob_start();
- $imageName = $is->imageUpload('upload');
- ob_end_clean();
- $funcNum = ctype_digit((string) $_GET['CKEditorFuncNum'])
- ? $_GET['CKEditorFuncNum'] : 1;
-
- echo '';
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/CKImages/Factory.php b/Toolkit/CKImages/Factory.php
deleted file mode 100644
index a693896..0000000
--- a/Toolkit/CKImages/Factory.php
+++ /dev/null
@@ -1,83 +0,0 @@
-
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version CVS: $Id: Factory.php,v 1.1 2009/09/24 14:43:02 jamie Exp $
- * @link http://demo.gaslightmedia.com
- * @see References to other sections (if any)...
- */
-
-
-/**
- * CKImage Factory
- *
- * @category CKImages
- * @package Toolkit_CKImages
- * @author Jamie Kahgee
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version Release: @package_version@
- * @link http://demo.gaslightmedia.com
- * @see References to other sections (if any)...
- */
-class Toolkit_CKImages_Factory
-{
- // {{{ properties
-
- /**
- * array of instances
- * @var array
- * @access public
- * @static
- */
- public static $instances = array();
-
- // }}}
- // {{{ init()
-
- /**
- * initialize the factory
- *
- * @return void
- * @access public
- * @static
- */
- public static function init()
- {
- }
-
- // }}}
- // {{{ &instance()
-
- /**
- * Get a single instance of an object
- *
- * @param string $class Class name to create
- *
- * @return mixed instantiated object
- * @access public
- * @static
- */
- public static function &instance($class)
- {
- $class = "Toolkit_CKImages_$class";
-
- if (empty(Toolkit_CKImages_Factory::$instances)) {
- Toolkit_CKImages_Factory::$instances[$class] = new $class;
- }
-
- return Toolkit_CKImages_Factory::$instances[$class];
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/CKImages/Folders.php b/Toolkit/CKImages/Folders.php
deleted file mode 100644
index 2858948..0000000
--- a/Toolkit/CKImages/Folders.php
+++ /dev/null
@@ -1,243 +0,0 @@
-
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version CVS: $Id: Folders.php,v 1.6 2009/10/27 14:39:27 jamie Exp $
- * @link http://demo.gaslightmedia.com
- * @see References to other sections (if any)...
- */
-
-/**
- * Handles create a UL list to simulate a folder hierarchy
- *
- * @category CKImages
- * @package Toolkit_CKImages
- * @author Jamie Kahgee
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version Release: @package_version@
- * @link http://demo.gaslightmedia.com
- * @see References to other sections (if any)...
- */
-class Toolkit_CKImages_Folders
-{
- // {{{ properties
-
-
- /**
- * Levels deep we are into the hierarchy
- * @var integer
- * @access private
- */
- private $_lvlsOpen = 0;
-
- /**
- * The previous level we were at
- * @var integer
- * @access private
- */
- private $_prevLvl = 0;
-
- // }}}
-
- // {{{ __construct()
-
- /**
- * Constructor
- *
- * @param PDO $pdo PHP Data Object
- *
- * @return void
- * @access public
- */
- public function __construct(PDO $pdo)
- {
- $this->dbh = $pdo;
- }
-
- // }}}
-
- // {{{ closeFolder()
-
-
- /**
- * Closes a folder level
- *
- * @return string closing ul tag
- * @access protected
- */
- protected function closeFolder()
- {
- return "\n";
- }
-
- // }}}
- // {{{ closeNode()
-
-
- /**
- * Closes a node
- *
- * @return string closing li tag
- * @access protected
- */
- protected function closeNode()
- {
- return "\n\t";
- }
-
- // }}}
- // {{{ createFolder()
-
-
- /**
- * Creates a folder level
- *
- * @return string opening ul tag
- * @access protected
- */
- protected function createFolder()
- {
- return "\n";
- }
-
- // }}}
- // {{{ createLink()
-
-
- /**
- * Creates a folder link so we can browse to each folder
- *
- * @param array $row Folder information
- *
- * @return string anchor link for folder
- * @access protected
- */
- protected function createLink(array $row)
- {
- $format = '%s ';
-
- $link = sprintf(
- $format,
- ($_GET['folder'] == $row['id']) ? 'clicked' : null,
- $_GET['CKEditor'],
- $_GET['CKEditorFuncNum'],
- $_GET['langCode'],
- $row['id'],
- $row['name']
- );
-
- return $link;
- }
-
- // }}}
-
- // {{{ fetchFoldersArray()
-
-
- /**
- * Fetches a tree hierarchy of the folder structure into a linear array
- *
- * @param integer $start node to start at
- *
- * @return array folder structure with levels
- * @access protected
- */
- protected function fetchFoldersArray($start)
- {
- return Toolkit_Common::getHierarchicalTreeStructure(
- $this->dbh,
- 'ckeditor_folders',
- 'id',
- 'parent',
- 'id',
- $start
- );
- }
-
- // }}}
-
- // {{{ getFolders()
-
-
- /**
- * Gets the folders ul list
- *
- * @param integer $parent start at a certain level
- *
- * @return string list of folders
- * @access public
- */
- public function getFolders($parent = 0)
- {
- $folders = $this->fetchFoldersArray($parent);
- try {
- $sql = "
- SELECT *
- FROM ckeditor_folders
- WHERE id = :id";
-
- $stmt = $this->dbh->prepare($sql);
- foreach ($folders as $i => $j) {
- $stmt->bindParam(':id', $i, PDO::PARAM_INT);
- $stmt->execute();
- $row = $stmt->fetch(PDO::FETCH_ASSOC);
-
- if ($j == $this->_prevLvl) {
- $tree .= $this->openNode($row);
- $tree .= $this->createLink($row);
- $this->_prevLvl = $j;
- } elseif ($j > $this->_prevLvl) {
- ++$this->_lvlsOpen;
- $tree .= $this->createFolder();
- $tree .= $this->openNode($row);
- $tree .= $this->createLink($row);
- $this->_prevLvl = $j;
- } elseif ($j < $this->_prevLvl) {
- do {
- $tree .= $this->closeNode();
- $tree .= $this->closeFolder();
- } while (--$this->_lvlsOpen > $j);
- $tree .= $this->closeNode();
- $tree .= $this->openNode($row);
- $tree .= $this->createLink($row);
- $this->_prevLvl = $this->_lvlsOpen;
- }
- }
- $tree .= $this->closeFolder();
- return $tree;
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
-
- // {{{ openNode()
-
-
- /**
- * Opens a branch or leaf node
- *
- * @param array $row Folder information
- *
- * @return string opening li tag
- * @access protected
- */
- protected function openNode(array $row)
- {
- return "\n\t";
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/CKImages/assets/.keepme b/Toolkit/CKImages/assets/.keepme
deleted file mode 100644
index e69de29..0000000
diff --git a/Toolkit/CKImages/browser.php b/Toolkit/CKImages/browser.php
deleted file mode 100644
index 5a30721..0000000
--- a/Toolkit/CKImages/browser.php
+++ /dev/null
@@ -1,35 +0,0 @@
-
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @version CVS: $Id: browser.php,v 1.3 2009/11/15 19:12:23 jamie Exp $
- * @link <>
- * @see References to other sections (if any)...
- */
-
-/**
- * bootstrap
- */
-require_once '../../setup.phtml';
-
-Toolkit_CKImages_Factory::init();
-$connector = Toolkit_CKImages_Factory::instance('Connector');
-$connector->setDbh(Toolkit_Database::getInstance());
-$flexyOpts = $GLOBALS['flexyOptions'];
-$flexyOpts['templateDir'] = BASE . 'Toolkit/CKImages/templates/';
-$flexyOpts['compileDir'] = BASE . 'Toolkit/CKImages/templates/compiled/';
-$tEngine = new HTML_Template_Flexy($flexyOpts);
-$is = new Toolkit_Image_Server;
-
-$connector->browseImages($tEngine, $is);
-?>
diff --git a/Toolkit/CKImages/controller.php b/Toolkit/CKImages/controller.php
deleted file mode 100644
index fa87860..0000000
--- a/Toolkit/CKImages/controller.php
+++ /dev/null
@@ -1,53 +0,0 @@
-
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @version CVS: $Id: connector.php,v 1.3 2009/11/15 19:12:23 jamie Exp $
- * @link <>
- * @see References to other sections (if any)...
- */
-
-/**
- * bootstrap
- */
-require_once '../../setup.phtml';
-
-Toolkit_CKImages_Factory::init();
-$connector = Toolkit_CKImages_Factory::instance('Connector');
-$connector->setDbh(Toolkit_Database::getInstance());
-
-switch ($_GET['command']) {
-case 'CreateFolder' :
- $connector->createFolder();
- break;
-
-case 'DeleteFile' :
- $connector->deleteFile(new Toolkit_Image_Server);
- break;
-
-case 'DeleteFolder' :
- $connector->deleteFolder(new Toolkit_Image_Server);
- break;
-
-case 'Upload' :
- $connector->uploadFile(new Toolkit_Image_Server);
- break;
-
-case 'UploadFile' :
- $connector->quickUpload(new Toolkit_Image_Server);
- break;
-
-default :
- die('not yet implemented');
- $connector->throwError();
- break;
-}
-?>
diff --git a/Toolkit/CKImages/database/Import.php b/Toolkit/CKImages/database/Import.php
deleted file mode 100755
index ca5f7e9..0000000
--- a/Toolkit/CKImages/database/Import.php
+++ /dev/null
@@ -1,138 +0,0 @@
-dbh = $pdo;
- $this->pathToImages = BASE . 'images/ht_images/';
- $this->urlPathToImages = 'http://www.troutcreek.com/images/ht_images/';
- $this->is = new Toolkit_Image_Server();
- }
- // }}}
- // {{{ addFolderToDatabase()
- function addFolderToDatabase($folder, $parent)
- {
- static $stmt;
- if (!$stmt) {
- $sql = "
- INSERT INTO ckeditor_folders
- (name, parent)
- VALUES
- (:name, :parent)
- RETURNING id";
- $stmt = $this->dbh->prepare($sql);
- }
- try {
- $stmt->bindParam(":name", $folder, PDO::PARAM_STR);
- $stmt->bindParam(":parent", $parent, PDO::PARAM_STR);
- $stmt->execute();
- return $stmt->fetchColumn();
- } catch(PDOException $e) {
- Toolkit_Common::handleError($e);
- }
- }
- // }}}
- // {{{ addImageToDatabase()
- function addImageToDatabase($file, $folder)
- {
- static $stmt;
- if (!$stmt) {
- $sql = "
- INSERT INTO ckeditor_images
- (file_name, name_on_disk, original_width, original_height, folder)
- VALUES
- (:file_name, :name_on_disk, :original_width, :original_height, :folder)";
- $stmt = $this->dbh->prepare($sql);
- }
- try {
- $stmt->bindParam(":file_name", $file['file_name'], PDO::PARAM_STR);
- $stmt->bindParam(":name_on_disk", $file['name_on_disk'], PDO::PARAM_STR);
- $stmt->bindParam(":original_width", $file['original_width'], PDO::PARAM_STR);
- $stmt->bindParam(":original_height", $file['original_height'], PDO::PARAM_STR);
- $stmt->bindParam(":folder", $folder, PDO::PARAM_INT);
- $stmt->execute();
- } catch(PDOException $e) {
- Toolkit_Common::handleError($e);
- }
- }// }}}
- // {{{ processFilesArray
- function processFilesArray($files, $parent = 1)
- {
- //echo ''.print_r($files, true).' ';
- foreach ($files as $folderName => $file) {
- if (is_array($file)) {
- $fKey = key($file);
- $folderToAdd = ereg_replace("/$", "", $fKey);
- //echo ''.print_r($folderToAdd, true).' ';
- $folder = $this->addFolderToDatabase($folderToAdd, $parent);
- //echo ''.print_r($folder, true).' ';
- //var_dump($files[$folderName][$fKey]);
- // echo ''.print_r($file[$folderName][$fKey], true).' ';
- $processedFile[] = $this->processFilesArray($files[$folderName][$fKey], $folder);
- } else {
- $processedFile[] = $this->sendToImageServer($file, $parent);
- }
- }
- return $processedFile;
- }
- // }}}
- // {{{ readImageDir()
- function readImageDir($path = '')
- {
- $dirName = $this->pathToImages . ereg_replace("/$", "", $path);
- //var_dump($dirName);echo ' ';
- $d = dir($dirName);
- while (false !== ($entry = $d->read())) {
- if (!ereg("^\.|^CVS", $entry)) {
- $entryPath = $this->pathToImages . $path . $entry;
- //var_dump($entryPath); echo ' ';
- if ($dirCheck = is_dir($entryPath)) {
- $files[$path][] = $this->readImageDir($path . $entry . '/');
- } else if ($fileCheck = is_file($entryPath)) {
- $files[$path][] = $path . $entry;
- }
- }
- }
- return $files;
- }
- // }}}
- //{{{ runImport()
- function runImport()
- {
- $files = $this->readImageDir();
- echo ''.print_r($files, true).' ';
- $processedFiles = $this->processFilesArray($files['']);
- //echo ''.print_r($processedFiles, true).' ';
- }
- //}}}
- // {{{ sendToImageServer()
- function sendToImageServer($file, $folder)
- {
- $file_name = basename($file);
- $size = getImageSize($this->pathToImages . $file);
- try {
- $name_on_disk = $this->is->imageUpload(
- $this->urlPathToImages . '/' . ereg_replace(' ', '%20', $file)
- );
- } catch (Exception $e) {
- Toolkit_Common::handleError($e);
- }
- $image = array(
- 'name_on_disk' => $name_on_disk,
- 'file_name' => $file_name,
- 'original_width' => $size[0],
- 'original_height' => $size[1],
- );
- $this->addImageToDatabase($image, $folder);
- }
- // }}}
-}
-?>
diff --git a/Toolkit/CKImages/database/ckeditorImages.sql b/Toolkit/CKImages/database/ckeditorImages.sql
deleted file mode 100644
index 1f0ae0d..0000000
--- a/Toolkit/CKImages/database/ckeditorImages.sql
+++ /dev/null
@@ -1,27 +0,0 @@
-drop table ckeditor_folders;
-
-create table ckeditor_folders(
-id serial primary key,
-name text not null,
-parent integer default 1 not null
-);
-
-grant all on ckeditor_folders_id_seq to nobody;
-grant all on ckeditor_folders to nobody;
-
-insert into ckeditor_folders(id, name, parent) values(1, 'root', 0);
-
-drop table ckeditor_images;
-
-create table ckeditor_images(
-id serial primary key,
-create_date date default current_date,
-file_name text not null,
-name_on_disk text not null,
-original_width text not null,
-original_height text not null,
-folder integer default 1 references ckeditor_folders (id) on delete set default
-);
-
-grant all on ckeditor_images_id_seq to nobody;
-grant all on ckeditor_images to nobody;
\ No newline at end of file
diff --git a/Toolkit/CKImages/database/importHtImages.php b/Toolkit/CKImages/database/importHtImages.php
deleted file mode 100755
index 4e709ce..0000000
--- a/Toolkit/CKImages/database/importHtImages.php
+++ /dev/null
@@ -1,6 +0,0 @@
-runImport();
-?>
diff --git a/Toolkit/CKImages/libjs/image_selector.js b/Toolkit/CKImages/libjs/image_selector.js
deleted file mode 100644
index fd445c1..0000000
--- a/Toolkit/CKImages/libjs/image_selector.js
+++ /dev/null
@@ -1,128 +0,0 @@
-var IMAGE_SELECTOR =
-{
- parentFolder: null,
-
- init: function()
- {
- tree1 = new tree_component();
- tree1.init($("#folders"), {
- cookies : {
- prefix : "glm_image_browser",
- opts : { path : '/' }
- },
- ui : {
- animation : 500
- }
- });
-
- // Make the tree default to all opened
- $('#folders li.closed')
- .toggleClass('open')
- .toggleClass('closed');
-
- $('#folders a').click(IMAGE_SELECTOR.viewFolder);
-
- // Stop clicks on the LI elements, so the folders branches
- // will not close.
- $('#folders li').click(function(event) {
- event.stopImmediatePropagation();
- });
-
- $('div.thumb a.CKImageUse').click(function() {
- var img = $(this).siblings('img');
- if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){
- var uf = 2;
- }else{
- var uf = 1;
- }
- window.opener.CKEDITOR.tools.callFunction(uf, img.attr('title'));
- window.close();
- });
-
- $('div.thumb a.CKImageDelete').click(function(event) {
- event.preventDefault();
- if (confirm('Are you sure you want to delete this image?')) {
- var img = $(this).siblings('img').attr('title');
- var href = window.location.href.replace(/(.*)browser.php(.*)/, '$1connector.php$2&command=DeleteFile&img=' + img);
-
- window.location.href = href;
- }
- });
-
- $('#imageDialog').dialog({
- bgiframe : true,
- autoOpen : false,
- resizable: false,
- modal : true,
- buttons : {
- Cancel : function() {
- $(this).dialog('close');
- },
- 'Upload Selected File' : function() {
- if ($('#imageDialog form input[type=file]').val()) {
- $('.ui-dialog-buttonpane button').attr('disabled', true);
- $('#imageDialog form').trigger('submit');
- } else {
- alert('You need to select a file first');
- }
- }
- }
- });
-
- $('#upload').click(function() {
- $('#imageDialog').dialog('open');
- });
-
- $('#newFolder').submit(IMAGE_SELECTOR.createFolder);
- $('#folderDialog').dialog({
- bgiframe : true,
- autoOpen : false,
- resizable: false,
- modal : true,
- buttons: {
- Cancel : function() {
- $('#folderName').removeClass('ui-state-error');
- $(this).dialog('close');
- },
- 'Create' : IMAGE_SELECTOR.createFolder
- }
- });
- $('#folderNew').click(function() {
- $('#folderDialog').dialog('open');
- });
- $('#folderDelete').click(function() {
- if (confirm('Are you sure you want to delete this folder?')) {
- var href = window.location.href.replace(/(.*)browser.php(.*)/, '$1connector.php$2&command=DeleteFolder');
-
- window.location.href = href;
- }
- });
- },
-
- createFolder: function(event)
- {
- event.preventDefault();
- // don't submit empty folder
- var folderName = $('#folderName');
- var val = folderName.val();
- if (val == '') {
- alert('You need to type a folder name first');
- return false;
- } else {
- $('.ui-dialog-buttonpane button').attr('disabled', true);
- var href = window.location.href.replace(/(.*)browser.php(.*)/, '$1connector.php$2&command=CreateFolder&name=' + $('#folderName').val());
- if (IMAGE_SELECTOR.parentFolder != null) {
- href += '&parentFolder=' + IMAGE_SELECTOR.parentFolder;
- IMAGE_SELECTOR.parentFolder = null;
- }
- window.location.href = href;
- }
- },
-
- viewFolder: function(event)
- {
- location.href = $(this).attr('href');
- }
-};
-
-$(document).ready(IMAGE_SELECTOR.init);
diff --git a/Toolkit/CKImages/styles.css b/Toolkit/CKImages/styles.css
deleted file mode 100755
index 3787fea..0000000
--- a/Toolkit/CKImages/styles.css
+++ /dev/null
@@ -1,146 +0,0 @@
-body {
- font-family: arial, sans-serif;
- font-size: 11px;
- background: #E3E3C7;
- margin: 0;
- padding: 0;
-}
-#wrapper {
- width: 720px;
- height: 1%;
- overflow: hidden;
- margin: 10px 0px 5px 10px;
-}
-h1 {
- font-size: 24px;
- margin: 0 0 10px 0;
-}
-#toolbar {
- background: #F1F1E3;
- width: 124px;
- border: 1px solid #D5D59D;
- float: left;
- padding: 8px;
- margin-right: 10px;
-}
-#toolbar > ul {
- border-bottom: 1px solid #333;
- padding: 0 0 6px 0;
- margin: 0 0 6px 0;
- }
-#toolbar > ul, #toolbar > ul li {
- list-style: none;
- display: block;
-}
-#toolbar > ul li {
- padding: 2px 2px 2px 26px;
- line-height: 18px;
- border: 1px solid #F1F1E3;
- margin: 0;
- background-position: 2px center;
- background-repeat: no-repeat;
- text-decoration: underline;
- cursor: hand;
- cursor: pointer;
-}
-#toolbar > ul li:hover {
- border: 1px solid #D5D59D;
- text-decoration: none;
-}
-#toolbar #upload {
- background-image: url(http://app.gaslightmedia.com/assets/icons/image_add.png);
-}
-#toolbar #folderNew {
- background-image: url(http://app.gaslightmedia.com/assets/icons/folder_add.png);
-}
-#toolbar #folderDelete {
- background-image: url(http://app.gaslightmedia.com/assets/icons/folder_delete.png);
-}
-.tree ul {
- margin: 0;
- padding-top: 1px;
-}
-.tree li a {
- background-image: url(http://app.gaslightmedia.com/assets/icons/folder.png);
-}
-.tree li.open {
- background: none;
- }
-#pred_1 {
- padding-left: 3px;
- padding-top: 3px;
-}
-.tree li li.open {
- background: transparent url(http://app.gaslightmedia.com/libjs/jsTree/source/images/li.gif) no-repeat scroll 7px 7px;
-}
-/* Main Section */
-#photo-gallery {
- width: 560px;
- height: 1%;
- overflow: hidden;
-}
-.thumb {
- width: 120px;
- height: 150px;
- float: left;
- margin-right: 20px;
- margin-bottom: 20px;
- background: white;
- font-size: 10px;
-}
-.rowTop {
- height: 1%;
- overflow: hidden;
-}
-.thumb img {
- display: block;
- margin: 0px 10px 2px 10px;
- border: 1px dotted #ccc;
- clear: left;
-}
-.CKImageUse {
- display: block;
- background: url(http://app.gaslightmedia.com/assets/icons/accept.png) no-repeat;
- padding-left: 20px;
- line-height: 16px;
- margin: 5px 10px 0px 10px;
- border: 1px solid #fff;
- text-decoration: underline;
-}
-.CKImageUse:link {color: black;}
-.CKImageUse:visited {color: black;}
-.CKImageUse:hover {color: green; text-decoration: none; border: 1px solid white}
-.CKImageUse:actove {color: black;}
-
-.CKImageName {
- display: none;
-}
-.CKImageDelete {
- background: url(http://app.gaslightmedia.com/assets/icons/cross.png) no-repeat;
- width: 16px;
- height: 16px;
- display: block;
- float: right;
- text-indent: -9000px;
- margin: 3px 2px;
- margin-right: 6px;
- }
-.CKImageView {
- background: url(http://app.gaslightmedia.com/assets/icons/image.png) no-repeat;
- width: 16px;
- height: 16px;
- display: block;
- float: left;
- text-indent: -9000px;
- margin: 3px 10px;
-}
-.CKImageProperties {
- margin: 3px;
- float: left;
-}
-.CKImageDate {
- display: none;
-}
-#menuFolder, #menuImage, #column {
- display: none;
-}
\ No newline at end of file
diff --git a/Toolkit/CKImages/templates/compiled/.cvsignore b/Toolkit/CKImages/templates/compiled/.cvsignore
deleted file mode 100644
index 7f1398d..0000000
--- a/Toolkit/CKImages/templates/compiled/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-* */*
diff --git a/Toolkit/CKImages/templates/compiled/.keepme b/Toolkit/CKImages/templates/compiled/.keepme
deleted file mode 100644
index e69de29..0000000
diff --git a/Toolkit/CKImages/templates/thumbnails.html b/Toolkit/CKImages/templates/thumbnails.html
deleted file mode 100755
index e0e6289..0000000
--- a/Toolkit/CKImages/templates/thumbnails.html
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-Thumbnail Images
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {quickUploadForm:h}
-
-
-
diff --git a/Toolkit/Common.php b/Toolkit/Common.php
deleted file mode 100644
index fd7ebf2..0000000
--- a/Toolkit/Common.php
+++ /dev/null
@@ -1,1201 +0,0 @@
-
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @release CVS: $Id: Common.php,v 1.51 2010/01/28 20:15:40 matrix Exp $
- * @link http://demo.gaslightmedia.com
- */
-
-/**
- * Common collection of functions used throughout the GLM Toolkit
- *
- * @category Toolkit
- * @package Toolkit_Common
- * @author Jamie Kahgee
- * @copyright 2008 Gaslight Media
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @link http://demo.gaslightmedia.com
- */
-class Toolkit_Common
-{
- // {{{ properties
-
- /**
- * Who to send email to when a problem occurs on a live site
- *
- * This property doesn't matter for the development servers b/c the
- * script will display the error encountered and terminate immediately.
- * On the live site, a notification will be displayed to the user that
- * an unexpected error has occured and will inform them to try again later.
- * It will then send an email to the admin alerting them of the email.
- *
- * @var string
- * @access protected
- * @see Toolkit_Common::handleError()
- */
- protected static $admin = 'jamie@gaslightmedia.com';
-
- /**
- * Who to set the mail from when emailing errors
- *
- * @var string
- * @access protected
- * @see Toolkit_Common::handleError()
- */
- protected static $from = 'Gaslight Media Toolkit ';
-
- // }}}
-
- // {{{ arrayFlatten()
-
- /**
- * Recursively reduces multi-dimensional arrays to single-dimensional arrays
- *
- * @param array $array The array to flatten.
- * @param int $preserveKeys How to handle array keys
- * 0 = Never
- * 1 = Strings
- * 2 = Always
- * @param array &$newArray The new created from the flattening
- *
- * @return array Single dimensional array.
- * @access public
- */
- public function arrayFlatten($array,
- $preserveKeys = 1,
- &$newArray = Array()
- ) {
- foreach ($array as $key => $child) {
- if (is_array($child)) {
- $newArray =& Toolkit_Common::arrayFlatten(
- $child,
- $preserveKeys,
- $newArray
- );
- } elseif ((int) $preserveKeys + (int) is_string($key) > 1) {
- $newArray[$key] = $child;
- } else {
- $newArray[] = $child;
- }
- }
- return $newArray;
- }
-
- // }}}
-
- // {{{ cleanArray()
-
- /**
- * removes values from an array where the key ends in '_rmv'
- *
- * @param array &$values array to clean
- *
- * @return array array w/ unneeded elements removed
- * @access public
- * @static
- */
- public static function cleanArray(&$values)
- {
- // Get rid of any defined un-needed elements.
- // un-needed elements after the form is submitted are defined
- // by the ending _rmv name.
- foreach ($values as $k => &$v) {
- if (preg_match('/^.+_rmv$/', $k)) {
- unset($values[$k]);
- }
- }
-
- return $values;
- }
-
- // }}}
- // {{{ createEmailBody()
-
- /**
- * Convert the form into an acceptable table to include in email
- *
- * This function can be called from any form class to generate
- * a HTML table that we can use in an email. Elements can be dynamically
- * rendered to meet your needs if you wish.
- *
- * If you wish to have any element(s) rendered differently than what the
- * form already rendered them as, you need to define a public method
- * named "emailRenderElement" in the calling class that will accept an
- * elements name and you can create the rendering template in that class.
- *
- * Example:
- * This example will turn groups like radio buttons or checkboxes
- * from lists like:
- * [ ] element_one [x] element_two [x] element_three
- * ( ) element_one (x) element_two ( ) element_three
- * into lists like:
- * [ ] element_one ( ) element_one
- * [x] element_two (x) element_two
- * [x] element_three ( ) element_three
- *
- * public function &emailRenderElement($e)
- * {
- * switch ($e) {
- * case 'element_one' :
- * case 'element_two' :
- * case 'element_three' :
- * $renderer =& $this->defaultRenderer();
- * $renderer->clearAllTemplates();
- * $renderer->setGroupTemplate('{content}', $e);
- * $renderer->setGroupElementTemplate('{element} ', $e);
- * break;
- *
- * default :
- * $renderer = null;
- * break;
- * }
- *
- * return $renderer;
- * }
- *
- *
- * @param array $newLabels Assoc array of element names and new
- * labels to be used in the email form.
- * eg [$newLabels['element'] => 'Label']
- * @param array $excludeList Any element that needs to be removed
- * from the form when creating the table
- * eg [$list = array(e1, e2, e3, etc..)]
- *
- * @return mixed The table body for the email.
- */
- public function createEmailBody(
- array $newLabels = array(),
- array $excludeList = array()
- ) {
- $this->freeze();
- // Get the values corresponding to the elements present in the form.
- $formData = $this->exportValues();
- // The array keys holds all the names of the elements.
- $elements = array_keys($formData);
- // Remove any unwanted elements from our elements array.
- foreach ($excludeList as $trgt) {
- unset($elements[array_search($trgt, $elements)]);
- }
-
- // Which row we are at.
- $i = 0;
- $table = new HTML_Table(array('class' => 'data'));
- // Auto grow the table, since the forms will by dynamic in size.
- $table->setAutoGrow(true);
- // Get the labels and values of the elements.
- foreach ($elements as $name) {
- $e =& $this->getElement($name);
- // Get the default HTML for each element.
- $html = $e->toHtml();
- // If any elements need to have their html
- // changed for an email, this function in the
- // class should exist and will return a renderer
- // object of how the element should be rendered.
- if (method_exists($this, 'emailRenderElement')) {
- $renderer =& $this->emailRenderElement($name);
- // make sure we have an actual rendering object
- // if the element doesn't need to be altered it should
- // just return null.
- if (is_object($renderer)) {
- $e->accept(&$renderer);
- $html = $renderer->toHtml($name);
- // We have to reset the entire forms html
- // otherwise we'll just keep adding to it everytime
- // we render a new element.
- // This is a bit of a hack to make this work (because
- // the _html element is supposed to be a private
- // property)
- $renderer->_html = null;
- }
- }
- // Get the label for the element.
- $label = array_key_exists($name, $newLabels) ?
- $newLabels[$name] :
- $e->getLabel();
-
- // Make the row and increment the row counter.
- $table->setCellContents($i, 0, $label);
- $table->setCellAttributes($i, 0, array('class' => 'label'));
- $table->setCellAttributes($i, 1, array('class' => 'field'));
- $table->setCellContents($i++, 1, $html);
- }
- return $table->toHtml();;
- }
-
- // }}}
- // {{{ createSQLInsert()
-
- /**
- * Generates a properly formatted sql query to insert data into a table
- *
- * @param string $table Name of the table to insert into
- * @param array $columns Array of column names you want to set in the
- * insert statement and bind names
- *
- *
- * Toolkit_Common::createSQLInsert('member', array('name', 'pos'));
- * will create the sql statement
- * INSERT INTO member (name, pos) VALUES(:name, :pos)
- *
- *
- * @return string Formatted SQL string
- * @access public
- * @static
- */
- public static function createSQLInsert($table, array $columns)
- {
- $params = implode(', ', $columns);
- $bindParams = ':' . implode(', :', $columns);
-
- return "INSERT INTO $table ($params) VALUES ($bindParams)";
- }
-
- // }}}
- // {{{ createSQLUpdate()
-
- /**
- * Generates a properly formatted sql query to update data in a table
- *
- *
- * Toolkit_Common::createSQLUpdate('member',
- * array('name', 'pos'),
- * array('id = :id');
- * will create the sql statement
- * UPDATE member SET name = :name, pos = :pos WHERE id = :id
- *
- *
- * @param string $table Name of the table to update
- * @param array $columns Array of columns names you want to update
- * @param array $constraints Constraints to apply to the table to prevent
- * running the update on every row in the db
- *
- * @return string formatted query string
- * @access public
- * @static
- */
- public static function createSQLUpdate(
- $table,
- array $columns,
- array $constraints = null
- ) {
- $length = count($columns);
- for ($i = 0; $i < $length; ++$i) {
- $bindParams .= "{$columns[$i]} = :{$columns[$i]}";
- if ($i < ($length - 1)) {
- $bindParams .= ', ';
- }
- }
- $sql = "UPDATE $table SET $bindParams";
-
- if (!empty($constraints)) {
- $sql .= ' WHERE ' . implode(' AND ', $constraints);
- }
-
- return $sql;
- }
-
- // }}}
- // {{{ createTables()
-
- /**
- * Read file from parameter and use the PDO parameter to create process file
- *
- * @param PDO $pdo PHP Data Object to use for DB calls
- * @param string $file full path of file to parse
- *
- * @return void
- * @access public
- * @static
- */
- public static function createTables(PDO $pdo, $file)
- {
- $sql = file_get_contents($file);
- // break multiple queries apart by ';'
- $tok = strtok($sql, ';');
- try {
- // while we have valid tokens, execute the query
- // and grab the next token
- while ($tok !== false) {
- $pdo->query($tok);
- $tok = strtok(';');
- }
- } catch (PDOException $e) {
- Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
-
- // {{{ dieGracefully()
-
- /**
- * Gracefully exit from the script when an unrecoverable error is created
- *
- * @param string $msg Message to display to user
- * @param mixed $e Error object
- * @param boolean $moreInfo More debugging info when in development
- *
- * @return void
- * @access public
- */
- public function dieGracefully($msg = null, $e = null, $moreInfo = false)
- {
- if (is_null($e)) {
- if (is_null($msg)) {
- die('There was an error, please try again later!');
- } else {
- die($msg);
- }
- } else {
- echo $msg . ' ';
- echo 'Error Caught. ';
- echo 'Error: ' . $e->getMessage() . ' ';
- if ($moreInfo) {
- echo 'Code: ' . $e->getCode() . ' ';
- echo 'Debug Info: ' . $e->getDebugInfo() . ' ';
- }
- }
- }
-
- // }}}
-
- // {{{ errorException()
-
- /**
- * Stops script on Exception error
- *
- * Stops the script when an Exception is raised inside a
- * try/catch block.
- *
- * When a site is no longer in DEVELOPMENT, ie: its live on ws3.
- * We don't show any error info, but let the user know an unexpected
- * error has occured and then mail the error info the the admin.
- *
- * Example usage:
- *
- * try {
- if ($foo != $bar) {
- throw new Exception ("Foo Doesn't equal Bar");
- }
- * } catch (Exception $e) {
- * return Toolkit_Common::handleError($e);
- * }
- *
- *
- * @param Exception $e Exception Object
- * @param Mail $mail What to use to send mail to admin
- *
- * @return false
- * @access public
- * @static
- */
- public static function errorException(Exception $e, Mail $mail = null)
- {
- if (!is_null($mail)) {
- $subject = 'Exception Error for ' . SITENAME;
- self::mailError($mail, $subject);
- } else {
- echo self::getErrorInfo($e);
- }
-
- return false;
- }
-
- // }}}
- // {{{ errorHTMLQuickFormError()
-
- /**
- * Handles PEAR Errors for our developers
- *
- * When a site is no longer in DEVELOPMENT, ie: its live on ws3.
- * We don't show any error info, but let the user know an unexpected
- * error has occured and then mail the error info the the admin.
- *
- * HTML_QuickForm Example usage:
- *
- * $e =& $this->getElement('elementName');
- * if (PEAR::isError($e)) {
- * return Toolkit_Common::handleError($e);
- * }
- *
- *
- * @param HTML_QuickForm_Error $e QuickFormError Object
- * @param Mail $mail What to use to send mail to admin
- *
- * @return false
- * @access public
- * @since Method available since Release 1.0.1
- * @static
- */
- public static function errorHTMLQuickFormError(
- HTML_QuickForm_Error $e,
- Mail $mail = null
- ) {
- if (!is_null($mail)) {
- $subject = 'PEAR Error for ' . SITENAME;
- self::mailError($mail, $subject);
- } else {
- echo self::getErrorInfo($e);
- }
-
- return false;
- }
-
- // }}}
- // {{{ errorPDOException()
-
- /**
- * Stops script on database error
- *
- * Stops the script when a PDOException is raised inside a
- * try/catch block.
- *
- * When a site is no longer in DEVELOPMENT, ie: its live on ws3.
- * We don't show any error info, but let the user know an unexpected
- * error has occured and then mail the error info the the admin.
- *
- * Example usage:
- *
- * try {
- * $sql = "
- * SELECT *
- * FROM table_name
- * WHERE id = :id";
- *
- * $stmt = $this->dbh->prepare($sql);
- * $stmt->bindParam(':id', $id, PDO::PARAM_INT);
- * return $stmt->execute();
- * } catch (PDOException $e) {
- * return Toolkit_Common::handleError($e);
- * }
- *
- *
- * @param PDOException $e PDO Error Object.
- * @param Mail $mail Mail object used to send admin email
- *
- * @return false
- * @access public
- * @since Method available since Release 1.0.1
- */
- public function errorPDOException(PDOException $e, Mail $mail = null)
- {
- if (!is_null($mail)) {
- $subject = 'SQL Error for ' . SITENAME;
- self::mailError($mail, $subject);
- } else {
- echo self::getErrorInfo($e);
- }
-
- return false;
- }
-
- // }}}
- // {{{ errorPEARError()
-
- /**
- * Handles PEAR Errors for our developers
- *
- * When a site is no longer in DEVELOPMENT, ie: its live on ws3.
- * We don't show any error info, but let the user know an unexpected
- * error has occured and then mail the error info the the admin.
- *
- * @param PEAR_Error $e PEARError Object
- * @param Mail $mail Mail object used to send admin email
- *
- * @return false
- * @access public
- * @since Method available since Release 1.0.1
- */
- public function errorPEARError(PEAR_Error $e, Mail $mail = null)
- {
- if (!is_null($mail)) {
- $subject = 'PEAR Error for ' . SITENAME;
- self::mailError($mail, $subject);
- } else {
- echo self::getErrorInfo($e);
- }
-
- return false;
- }
-
- // }}}
- // {{{ errorRuntimeException()
-
- /**
- * Stops script on runtime error
- *
- * Stops the script when a runtimeException is raised inside a
- * try/catch block.
- *
- * When a site is no longer in DEVELOPMENT, ie: its live on ws3.
- * We don't show any error info, but let the user know an unexpected
- * error has occured and then mail the error info the the admin.
- *
- * @param RuntimeException $e PDO Error Object.
- * @param Mail $mail Mail object used to send admin email
- *
- * @return false
- * @access public
- * @since Method available since Release 1.0.2
- */
- public function errorRuntimeException(
- RuntimeException $e,
- Mail $mail = null
- ) {
- if (!is_null($mail)) {
- $subject = 'Runtime Exception for ' . SITENAME;
- self::mailError($mail, $subject);
- } else {
- echo self::getErrorInfo($e);
- }
-
- return false;
- }
-
- // }}}
- // {{{ errorBadMethodCallException()
-
- /**
- * Stops script on bad method call error
- *
- * Stops the script when a badMethodCallException is raised inside a
- * try/catch block.
- *
- * When a site is no longer in DEVELOPMENT, ie: its live on ws3.
- * We don't show any error info, but let the user know an unexpected
- * error has occured and then mail the error info the the admin.
- *
- * @param BadMethodCallException $e PDO Error Object.
- * @param Mail $mail Mail object used to send admin email
- *
- * @return false
- * @access public
- * @since Method available since Release 1.0.3
- */
- public function errorBadMethodCallException(
- BadMethodCallException $e,
- Mail $mail = null
- ) {
- if (!is_null($mail)) {
- $subject = 'Bad Method Call Exception for ' . SITENAME;
- self::mailError($mail, $subject);
- } else {
- echo self::getErrorInfo($e);
- }
-
- return false;
- }
-
- // }}}
-
- // {{{ filterURI()
-
- /**
- * Filters uri's before they are validated
- *
- * @param string $uri URI to filter
- *
- * @return mixed new uri if missing scheme
- * @access public
- * @static
- */
- public static function filterURI($uri)
- {
- $validProtocol = '/^https?\:\/\/.*/';
- $invalidProtocol = '/^.*?\:\/\/.*/';
- if (empty($uri)) {
- // Empty field, just return
- return $uri;
- } elseif (preg_match($validProtocol, $uri)) {
- // has valid protocol, return unchanged
- // should pass validation.
- return $uri;
- } elseif (!preg_match($invalidProtocol, $uri)) {
- // missing protocol, prepend default
- // http:// protocol and return.
- return "http://$uri";
- } else {
- // has invalid protocol, return unchanged
- // validation should catch this and throw error.
- return $uri;
- }
- }
-
- // }}}
- // {{{ filterPhone()
-
- /**
- * Filters phone numbers before they are validated
- *
- * @param string $phone number to filter
- *
- * @return mixed newly formatted phone number
- * @access public
- * @static
- */
- public static function filterPhone($phone)
- {
- // Ditch anything that is not a number
- $number = preg_replace('/[^0-9]/', '', $phone);
-
- // Invalid Number, validation will catch error
- $len = strlen($number);
- if (($len < 10) || ($len > 11)) {
- return $phone;
- }
-
- // subscriber number
- $sn = substr($number, -4);
- // city code
- $cc = substr($number, -7, 3);
- // area code
- $ac = substr($number, -10, 3);
- if ($len == 11) {
- // country prefix
- $cp = $number[0];
- }
-
- $filteredNumber = "($ac) $cc-$sn";
- if (!is_null($cp)) {
- $filteredNumber = "$cp $filteredNumber";
- }
-
- return $filteredNumber;
- }
-
- // }}}
-
- // {{{ getCities()
-
- /**
- * Get an array of cities from the database
- *
- * @param PDO $dbh Database handler
- * @param integer $state State id the city is in
- * @param integer $county County id the city is in
- * @param integer $region Region id the city is in
- *
- * @return array states
- * @access public
- * @static
- */
- public static function getCities(
- PDO $dbh,
- $state = null,
- $county = null,
- $region = null
- ) {
- $param = array();
- if (ctype_digit((string)$state)) {
- $param[] = 'state_id = ' . $dbh->quote($state);
- }
- if (ctype_digit((string)$county)) {
- $param[] = 'county_id = ' . $dbh->quote($county);
- }
- if (ctype_digit((string)$region)) {
- $param[] = 'region_id = ' . $dbh->quote($region);
- }
-
- try {
- $sql = "
- SELECT *
- FROM city";
-
- if (!empty($params)) {
- $sql .= ' WHERE ' . implode(' AND ', $params);
- }
- $sql .= ' ORDER BY city_name';
-
- $stmt = $dbh->prepare($sql);
- $stmt->execute();
-
- $cities = array();
- while ($row = $stmt->fetch()) {
- $cities[$row['city_id']] = $row['city_name'];
- }
-
- return $cities;
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
- // {{{ getErrorInfo()
-
- /**
- * extract error info from error object
- *
- * @param mixed $obj Error object to get info for
- *
- * @return string formatted error information
- * @access public
- */
- public function getErrorInfo($obj)
- {
- $state = '' . get_class($obj) . ' error: ';
-
- if (method_exists($obj, 'getMessage')) {
- $state .= $obj->getMessage();
- if (method_exists($obj, 'getDebugInfo')) {
- $state .= '; ' . $obj->getDebugInfo();
- }
- }
- if (method_exists($obj, 'getFile')) {
- $state .= ' in ' . $obj->getFile() . ' ';
- }
- if (method_exists($obj, 'getLine')) {
- $state .= ' on line ' . $obj->getLine() . ' ';
- }
- $state .= ' $_SERVER[\'QUERY_STRING\']: ' . $_SERVER['QUERY_STRING'] . "\n";
- $state .= ' $_GET: ' . print_r($_GET, true) . ' ';
- $state .= ' $_POST: ' . print_r($_POST, true) . ' ';
- /*
- if (method_exists($obj, 'getBacktrace')) {
- $backtrace = print_r($obj->getBacktrace(), true);
-
- $state .= "$backtrace ";
- }
- */
-
- return $state;
- }
-
- // }}}
- // {{{ getHierarchicalTreeStructure()
-
- /**
- * Create a hierarchical tree stored in an linear array
- *
- * Produces a representation of a hierarchical tree structure into a
- * linear array so you can iterate straight through to get the tree
- * structure.
- *
- * @param PDO $pdo Database handler
- * @param string $table Name of the source relation
- * @param string $key Name of the key field
- * @param string $parent Name of the parent-key field
- * @param string $order Name of the field to order siblings by
- * @param integer $start Key value of the row to start at
- * @param integer $maxDepth Maximum depth to descend to, or zero
- * for unlimited depth
- * @param boolean $validParent exclude branches that have null
- * parent values
- *
- * @return array Linear array of tree structure
- * @access public
- * @see http://www.postgresql.org/doc/8.3/interactive/tablefunc.html#AEN104085
- */
- public function getHierarchicalTreeStructure(
- PDO $pdo,
- $table = 'bus_category',
- $key = 'id',
- $parent = 'parent',
- $order = 'pos',
- $start = 0,
- $maxDepth = 0,
- $validParent = true
- ) {
- try {
- $tree = array();
-
- $sql = "
- SELECT *
- FROM connectby('$table', '$key', '$parent',
- '$order', '$start', $maxDepth)
- as t(id text, parent text, level int, pos int)";
-
- if ($validParent) {
- $sql .= " WHERE parent is not null";
- }
- foreach ($pdo->query($sql) as $row) {
- $tree[$row['id']] = $row['level'];
- }
-
- return $tree;
- } catch (PDOException $e) {
- return self::handleError($e);
- }
- }
-
- // }}}
- // {{{ getScripts()
-
- /**
- * Gets all scripts for the page
- *
- * @return string HTML markup for scripts
- * @access public
- * @static
- */
- public static function getScripts()
- {
- if ( !isset($GLOBALS['scripts'])
- || !is_array($GLOBALS['scripts'])
- || empty($GLOBALS['scripts'])
- ) {
- return false;
- }
-
- $uniqueScripts = array_unique($GLOBALS['scripts']);
- // Get the main jquery file
- $jquery = GLM_APP_BASE_URL . 'libjs/jquery-1.3.2.min.js';
- $key = array_search($jquery, $uniqueScripts);
- // If it exists, remove it from its current location
- // and put at front of array.
- if ($key !== false) {
- unset($uniqueScripts[$key]);
- array_unshift($uniqueScripts, $jquery);
- }
- $format = '';
-
- $ret = '';
- foreach ($uniqueScripts as $v) {
- $ret .= sprintf($format, $v) . "\n";
- }
-
- return $ret;
- }
-
- // }}}
- // {{{ getStates()
-
-
- /**
- * Get an array of states from the database
- *
- * @param PDO $dbh Database handler
- * @param boolean $unionStatesOnly If we want to only retrieve
- * the 50 US states
- *
- * @return array states
- * @access public
- * @static
- */
- public static function getStates(PDO $dbh, $unionStatesOnly = false)
- {
- if ($unionStatesOnly) {
- // Just grab the 50 states of the union
- $where = "WHERE us_state = :bool";
- }
-
- try {
- $sql = "
- SELECT *
- FROM state
- $where
- ORDER BY state_name";
-
- $stmt = $dbh->prepare($sql);
- if ($unionStatesOnly) {
- $stmt->bindValue(':bool', 1, PDO::PARAM_BOOL);
- }
- $stmt->execute();
-
- $states = array();
- while ($row = $stmt->fetch()) {
- $states[$row['state_id']] = $row['state_name'];
- }
-
- return $states;
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
- // {{{ getStyleSheets()
-
- /**
- * Gets all style sheets for the page
- *
- * @return string HTML markup for stylesheets
- * @access public
- * @static
- */
- public static function getStyleSheets()
- {
- if ( !isset($GLOBALS['styleSheets'])
- || !is_array($GLOBALS['styleSheets'])
- || empty($GLOBALS['styleSheets'])
- ) {
- return false;
- }
-
- $uniqueStyleSheets = array_unique($GLOBALS['styleSheets']);
- $format = ' ';
-
- $ret = '';
- foreach ($uniqueStyleSheets as $v) {
- $ret .= sprintf($format, $v) . "\n";
- }
-
- return $ret;
- }
-
- // }}}
- // {{{ getTableMetaData()
-
- /**
- * Gets the meta data of the calling classes table columns
- *
- * The table used when retrieving the meta data is defined
- * in the class property $tableName. The class or parent class
- * must also have a $tableMetaData property
- *
- * @param PDO $pdo Database Handler
- * @param string $tableName The name of the table to get the meta data for.
- * @param array $clauses Only retrieve meta data for certain column types
- *
- * @return array metadata for table
- * @access protected
- */
- public function getTableMetaData(
- PDO $pdo,
- $tableName,
- array $clauses = null
- ) {
- if (is_array($clauses)) {
- while ($c = current($clauses)) {
- $ands .= " data_type = '{$c}'";
- if (false !== next($clauses)) {
- $ands .= " OR ";
- }
- }
- $ands = " AND ($ands)";
- }
- try {
- $sql = "
- SELECT column_name, data_type
- FROM information_schema.columns
- WHERE table_name = :tname
- $ands";
- $stmt = $pdo->prepare($sql);
- $stmt->bindParam(':tname', $tableName, PDO::PARAM_STR);
-
- $stmt->execute();
-
- $metaData = array();
- while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
- $metaData[$row['column_name']] = $row['data_type'];
- }
-
- return $metaData;
- } catch (PDOException $e) {
- return self::handleError($e);
- }
- }
-
- // }}}
-
- // {{{ handleError()
-
- /**
- * Handles various script error
- *
- * @param Object $e Error Object
- * @param boolean $developmentServer If we are on a development server
- *
- * @return false
- * @access public
- * @static
- */
- public static function handleError($e, $developmentServer = DEVELOPMENT)
- {
- $errorType = str_replace('_', '', get_class($e));
- $errorType = "error$errorType";
-
- if (method_exists(__CLASS__, $errorType)) {
- if (!$developmentServer) {
- // Tell the user we encountered an Error.
- include_once BASE . "404.html";
-
- $mail = Mail::factory('mail');
- self::$errorType($e, $mail);
- exit();
- } else {
- return self::$errorType($e, $mail);
- }
- } else {
- echo 'The system has encountered an un-recoverable error!
';
- }
- }
-
- // }}}
-
- // {{{ mailError()
-
- /**
- * Mails the error to the site admin
- *
- * @param Mail $mail Mail object to use
- * @param string $subject Subject of email
- *
- * @return void
- * @access public
- * @static
- */
- public static function mailError(Mail $mail, $subject)
- {
- $msg = '' . self::getErrorInfo($e) . '
';
-
- $htmlMsg = "$msg";
- $crlf = "\n";
- $mimeMail = new Mail_mime($crlf);
- $mimeMail->setFrom(self::$from);
- $mimeMail->setSubject($subject);
- $mimeMail->setHTMLBody($htmlMsg);
- $mimeMail->setTXTBody($msg);
-
- $body = $mimeMail->get();
- $headers = $mimeMail->headers();
-
- $mail->send(self::$admin, $headers, $body);
- }
-
- // }}}
- // {{{ multiDimArrayLocate()
-
- /**
- * Locates an array value in a multi-dimensional array
- *
- * @param array $array The Array which holds the value you need.
- * @param mixed $text The value that you are looking for.
- *
- * @return mixed The search result.
- */
- public function multiDimArrayLocate($array, $text)
- {
- if (!is_array($array)) {
- return;
- }
-
- foreach ($array as $k => $v) {
- if (is_array($v)) {
- $temp[$k] = self::multiDimArrayLocate($v, $text);
- if ($temp[$k]) {
- $arrayResult[$k] = $temp[$k];
- }
- } else {
- if ($v == $text) {
- $arrayResult[$k] = $v;
- }
- }
- }
- return $arrayResult;
- }
-
- // }}}
-
- // {{{ processQuery()
-
- /**
- * Performs the sql insert statement
- *
- * If using a Postgresql driver for the PDO, metadata is used when
- * binding parameters to the prepared statement.
- *
- * @param object $dbh Database handler object
- * @param string $tableName table used in query
- * @param string $sql sql query string
- * @param array $values associative array of key/value pairs that will
- * be used to bind to the sql query string
- *
- * @return boolean result of the execute statement on the database
- * @access public
- * @static
- */
- public static function processQuery(
- PDO $dbh,
- $tableName,
- $sql,
- array $values = null
- ) {
- $dbType = $dbh->getAttribute(PDO::ATTR_DRIVER_NAME);
- if ($dbType == 'pgsql') {
- $md = Toolkit_Common::getTableMetaData($dbh, $tableName);
- }
- $stmt = $dbh->prepare($sql);
- foreach ($values as $k => &$v) {
- if ($dbType == 'pgsql') {
- $metaData = $md[$k];
- if ($metaData == 'integer') {
- $dataType = PDO::PARAM_INT;
- } elseif ($metaData == 'boolean') {
- $dataType = PDO::PARAM_BOOL;
- } else {
- $dataType = PDO::PARAM_STR;
- }
- // for empty values that are not actually a zero (0), we
- // want to insert null's.
- // as empty values '', are not considered unique
- if ( empty($v)
- && $dataType !== PDO::PARAM_BOOL
- && $dataType !== PDO::PARAM_INT
- ) {
- $v = null;
- $dataType = PDO::PARAM_NULL;
- }
- $stmt->bindParam(":$k", $v, $dataType);
- } else {
- $stmt->bindParam(":$k", $v);
- }
- }
-
- return $stmt->execute();
- }
-
- // }}}
-
- // {{{ recursiveArraySearch()
-
- /**
- * Recursive multi-dimensional array search
- *
- * @param string $n Needle
- * @param array $h Haystack
- *
- * @return mixed search result - false if not found
- * @access public
- * @static
- */
- public static function recursiveArraySearch($n, array $h)
- {
- foreach ($h as $i => $j) {
- $curr = $i;
- if ($n === $j
- || (is_array($j) && self::recursiveArraySearch($n, $j) !== false)
- ) {
- return $curr;
- }
- }
-
- return false;
- }
-
- // }}}
-
- // {{{ show()
-
- /**
- * Renders the calling class to the screen
- *
- * @access public
- * @return string calls the toHTML function of calling class
- */
- public function show()
- {
- echo $this->toHTML();
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/Contacts/BrochureRequest.php b/Toolkit/Contacts/BrochureRequest.php
deleted file mode 100755
index c8eb6b7..0000000
--- a/Toolkit/Contacts/BrochureRequest.php
+++ /dev/null
@@ -1,139 +0,0 @@
-
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version CVS: $Id: BrochureRequest.php,v 1.5 2010/01/28 16:34:53 jamie Exp $
- * @link <>
- * @see References to other sections (if any)...
- */
-
-/**
- * Short description for class
- *
- * Long description (if any) ...
- *
- * @category Contacts
- * @package Toolkit_Contacts
- * @author Jamie Kahgee
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version Release: @package_version@
- * @link <>
- * @see References to other sections (if any)...
- */
-class Toolkit_Contacts_BrochureRequest
-{
- // {{{ Class Properties
- /**
- * the name of the brochure download file
- * @var unknown
- * @access protected
- */
- protected $pdfFile;
-
- /**
- * template for brochure
- * @var string
- * @access protected
- */
- protected $template = 'brochurePage.html';
-
- /**
- * name of the brochure
- * @var unknown
- * @access protected
- */
- protected $brochureName;
- // }}}
- // {{{ __construct()
- /**
- * Class constructor
- *
- * @param object $pdo PHP Data Object
- *
- * @return void
- * @access public
- */
- function __construct(PDO $pdo)
- {
- $this->brochureName = SITENAME.' Brochure';
- $this->dbh = $pdo;
- }
- // }}}
- // {{{ show()
- /**
- * call toHtml
- *
- * @return void
- * @access public
- */
- function show()
- {
- echo $this->toHtml();
- }
- // }}}
- // {{{ toHtml()
- /**
- * create HTML output
- *
- * @return object html
- * @access public
- */
- function toHtml()
- {
- $options = $GLOBALS['flexyOptions'];
- $options['templateDir'] = BASE.'Toolkit/Contacts/templates';
- $options['compileDir'] = BASE.'Toolkit/Contacts/templates/compiled';
- $tpl = new HTML_Template_Flexy($options);
-
- $page = new StdClass;
- $page->brochure = $this->brochureName;
-
- // set the pdf form
- $pdfForm = new Toolkit_Contacts_PdfForm(
- 'pdf_form',
- 'post',
- null,
- null,
- null,
- true
- );
-
- $page->pdfForm = $pdfForm->toHtml();
-
- // set the contact form
- $contactForm = new Toolkit_Contacts_ContactUs(
- $this->dbh,
- 'contact',
- 'post',
- null,
- null,
- null,
- true
- );
-
- $contactForm->subject = 'Brochure Request from demo site';
- $contactForm->configureForm();
- $contactForm->useCaptcha(true);
- $page->contactForm = $contactForm->toHtml();
-
- if ($pdfForm->sent) {
- $page->contactForm = '';
- } elseif ($contactForm->sent) {
- $page->pdfForm = '';
- }
-
- $tpl->compile($this->template);
- return $tpl->bufferedOutputObject($page);
- }
- // }}}
-}
-?>
diff --git a/Toolkit/Contacts/ContactUs.php b/Toolkit/Contacts/ContactUs.php
deleted file mode 100755
index 2502b46..0000000
--- a/Toolkit/Contacts/ContactUs.php
+++ /dev/null
@@ -1,1242 +0,0 @@
-
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version CVS: $Id: ContactUs.php,v 1.30 2010/01/28 16:33:01 jamie Exp $
- * @link http://demo.gaslightmedia.com
- */
-
-/**
- * Error codes for Toolkit_Contacts_ContactUs
- *
- * Codes are mapped to textual messaged by errorMessage() method,
- * if you add a new code be sure to add a new message for it to errorMessage()
- *
- * @see Toolkit_Contacts_ContactUs::errorMessage()
- */
-define('FORM_OK', 1);
-define('FORM_ERROR', -1);
-define('NO_RECORD', -2);
-define('INVALID_DB', -3);
-define('MISSING_CONSTANT', -4);
-define('MISSING_CONTACT_TYPE', -5);
-
-/**
- * GLM Contact Us form
- *
- * This form handles rendering and processing the contact us form.
- * Controls the email functionality of the form, whether the client
- * has a contact DB to store contact records and how to insert/update
- * submitted form values.
- *
- * @category Contacts
- * @package Toolkit_Contacts
- * @author Jamie Kahgee
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @link http://demo.gaslightmedia.com
- * @see Toolkit_FormBuilder
- */
-class Toolkit_Contacts_ContactUs
- extends Toolkit_FormBuilder implements Toolkit_Form
-{
- // {{{ properties
-
- /**
- * Table in Database which holds the contact data
- *
- * @var string
- * @access public
- */
- public $tableName = 'contact';
-
- /**
- * Table meta data
- *
- * This is used when inserting/updating data for the records
- * so the PDO's can use explicit data types for the parameters.
- *
- * @var array
- * @access public
- */
- public $tableMetaData = array();
-
- /**
- * Contact type to be inserted into the DB as when the form is submitted
- *
- * This property is only valid when the [hasContactDB] property is set
- * to true.
- *
- * N.B.
- * If you subclass this class out to other forms that are
- * inserted into the contact db, be sure to make each one of their
- * contactType properties unique. We don't check for duplicates.
- *
- * @var string
- * @access protected
- */
- protected $contactType = '1';
-
- /**
- * Who to send the email to when the contact form is submitted
- *
- * If you leave this blank, its value will get set to the OWNER_EMAIL
- * in the constructor.
- *
- * If you ***DO NOT*** want any emails to go out when the form is submitted
- * then set the value to false. Do not set it to 0 for false, because the
- * check uses a strict type check to determine if the value is actually
- * false. This is what allows for the empty value as an option, which sets
- * the value to OWNER_EMAIL and won't override the $email property if
- * this class gets subclassed and the value for this property gets set in
- * the properties of the subclass and not in the constructor after this
- * constructor function is called.
- *
- * tongue twister...I know.
- *
- * protected $email = false;
- *
- *
- * @var string
- * @access protected
- */
- protected $email;
-
- /**
- * From header in the owner email
- *
- * This just sets the From header in the owner email
- * SITENAME
- *
- * It gets set to the constant SITENAME in the constructor if you leave
- * empty here, but you can set it to something different here to override
- * that if you desire.
- *
- * @var string
- * @access protected
- */
- protected $siteName;
-
- /**
- * Email subject and header in email
- *
- * It gets set in the constructor if you leave empty here, but you
- * can set it to something different here to override that if you desire.
- *
- * @var string
- * @access protected
- */
- public $subject;
-
- /**
- * Whether the site has a contact DB to store contact records
- *
- * If this value is set to false, an email will still be sent to the
- * addressed specified in the email property.
- *
- * @var boolean
- * @access protected
- */
- protected $hasContactDB = true;
-
- /**
- * The interests from the contact db
- *
- * @var array
- * @access protected
- */
- protected $inquiries = array();
-
- /**
- * Message to display if the form is successfully submitted
- *
- * @var string
- * @access protected
- */
- protected $successMsg = '
-
-
- Thank you for the reservation request!
-
';
-
- /**
- * Extra rules for processesing
- *
- * This registers the Zip validation rules (and any others listed) for
- * QuickForm.
- *
- * Zip validation checks both US and Canadian Zip codes
- *
- * @var array
- * @access protected
- * @see app.gaslightmedia.com/glmPEAR/HTML/QuickForm/Rules/Zip.php
- */
- protected $registeredRules = array(
- 'zip',
- 'phone',
- array(
- 'checkEmail',
- 'callback',
- 'email',
- 'Validate'
- ),
- );
-
- /**
- * Options for flexy templating engine
- *
- * Pulls the preset options from the setup.phtml file
- * overwrites the templateDir and compileDir to match this classes needs
- *
- * @var array
- * @access protected
- */
- protected $flexyOptions;
-
- // }}}
- // {{{ __construct()
-
- /**
- * Class constructor
- *
- * @param object $pdo PHP Data Object
- * @param string $formName Form's name.
- * @param string $method (optional)Form's method defaults to 'POST'
- * @param string $action (optional)Form's action
- * @param string $target (optional)Form's target defaults to '_self'
- * @param mixed $attributes (optional)Extra attributes for
';
- }
- return true;
- }
- return false;
- }
-
-
- // }}}
-}
-?>
diff --git a/Toolkit/Contacts/TellAFriend.php b/Toolkit/Contacts/TellAFriend.php
deleted file mode 100755
index 046f93d..0000000
--- a/Toolkit/Contacts/TellAFriend.php
+++ /dev/null
@@ -1,610 +0,0 @@
-
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version CVS: $Id: TellAFriend.php,v 1.8 2010/01/28 16:33:53 jamie Exp $
- * @link http://demo.gaslightmedia.com
- */
-
-/**
- * Error codes for Toolkit_Contacts_ContactUs
- *
- * Codes are mapped to textual messaged by errorMessage() method,
- * if you add a new code be sure to add a new message for it to errorMessage()
- *
- * @see Toolkit_Contacts_TellAFriend::errorMessage()
- */
-define('FORM_OK', 1);
-define('FORM_ERROR', -1);
-define('NO_RECORD', -2);
-define('INVALID_DB', -3);
-define('MISSING_CONSTANT', -4);
-
-/**
- * GLM Tell a Friend form
- *
- * This form handles rendering and processing the contact us form.
- * Controls the email functionality of the form, whether the client
- * has a contact DB to store contact records and how to insert/update
- * submitted form values.
- *
- * @category Contacts
- * @package Toolkit_Contacts
- * @author Jamie Kahgee
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @link <>
- * @see Toolkit_FormBuilder
- */
-class Toolkit_Contacts_TellAFriend extends Toolkit_FormBuilder
-{
- // {{{ properties
-
- /**
- * Table in Database which holds the contact data
- *
- * @var string
- * @access public
- */
- public $tableName = 'contact';
-
- /**
- * Table meta data
- *
- * This is used when inserting/updating data for the records
- * so the PDO's can use explicit data types for the parameters.
- *
- * @var array
- * @access public
- */
- public $tableMetaData;
-
- /**
- * Used in the email template for the client info string at the bottom
- *
- * @var string
- * @access protected
- */
- protected $clientInfo = array(
- 'name' => 'Gaslight Media',
- 'address' => '120 E. Lake St.',
- 'city' => 'Petoskey',
- 'state' => 'MI',
- 'zip' => '49770',
- 'phone' => '231.487.0697',
- );
-
- /**
- * Who to send the email to when the contact form is submitted
- *
- * If you leave this blank, its value will get set to the OWNER_EMAIL
- * in the constructor.
- *
- * If you ***DO NOT*** want any emails to go out when the form is submitted
- * then set the value to false. Do not set it to 0 for false, because the
- * check uses a strict type check to determine if the value is actually
- * false. This is what allows for the empty value as an option, which sets
- * the value to OWNER_EMAIL and won't override the $email property if
- * this class gets subclassed and the value for this property gets set in
- * the properties of the subclass and not in the constructor after this
- * constructor function is called.
- *
- * tongue twister...I know.
- *
- * protected $email = false;
- *
- *
- * @var unknown
- * @access protected
- */
- protected $email;
-
- /**
- * From header in the owner email
- *
- * This just sets the From header in the owner email
- * SITENAME
- *
- * It gets set to the constant SITENAME in the constructor if you leave
- * empty here, but you can set it to something different here to override
- * that if you desire.
- *
- * @var unknown
- * @access protected
- */
- protected $siteName = 'Demo Gaslight Media';
-
- /**
- * Email subject and header in email
- *
- * It gets set in the constructor if you leave empty here, but you
- * can set it to something different here to override that if you desire.
- *
- * @var string
- * @access protected
- */
- protected $subject = 'Tell a Friend';
-
- /**
- * Whether the site has a contact DB to store contact records
- *
- * If this value is set to false, an email will still be sent to the
- * addressed specified in the email property.
- *
- * @var boolean
- * @access protected
- */
- protected $hasContactDB = false;
-
- /**
- * The interests from the contact db
- *
- * @var array
- * @access protected
- */
- protected $inquiries = array();
-
- /**
- * Message to display if the form is successfully submitted
- *
- * @var string
- * @access protected
- */
- protected $successMsg = '
-
- Thank You, your message is sent.
-
';
-
- /**
- * Extra rules for processesing
- *
- * This registers the Zip validation rules (and any others listed) for
- * QuickForm.
- *
- * Zip validation checks both US and Canadian Zip codes
- *
- * @var array
- * @access protected
- * @see app.gaslightmedia.com/glmPEAR/HTML/QuickForm/Rules/Zip.php
- */
- protected $registeredRules = array();
-
- /**
- * Options for flexy templating engine
- *
- * Pulls the preset options from the setup.phtml file
- * overwrites the templateDir and compileDir to match this classes needs
- *
- * @var array
- * @access protected
- */
- protected $flexyOptions;
-
- // }}}
- // {{{ __construct()
-
- /**
- * Class constructor
- *
- * @param string $formName Form's name.
- * @param string $method (optional)Form's method defaults to 'POST'
- * @param string $action (optional)Form's action
- * @param string $target (optional)Form's target defaults to '_self'
- * @param mixed $attributes (optional)Extra attributes for tag
- * @param bool $trackSubmit (optional)Whether to track if the form was
- * submitted by adding a special hidden field
- *
- * @access public
- */
- public function __construct(
- $formName,
- $method = 'post',
- $action = '',
- $target = '',
- $attributes = null,
- $trackSubmit = false
- ) {
- // Make sure these end cases are never met.
- // These are more for the development phase.
- if ($this->email === false && $this->hasContactDB === false) {
- PEAR::raiseError(
- null,
- NO_RECORD,
- PEAR_ERROR_CALLBACK,
- array(&$this, 'error')
- );
- }
- if (!is_bool($this->hasContactDB)) {
- PEAR::raiseError(
- null,
- INVALID_DB,
- PEAR_ERROR_CALLBACK,
- array(&$this, 'error')
- );
- }
- // we haven't defined the FROM_NEWS_EMAIL constant and
- // the email will default to relying on it.
- if ( !defined('FROM_NEWS_EMAIL')
- && (empty($this->email) && $this->email !== false)
- ) {
- PEAR::raiseError(
- 'You need to define the FROM_NEWS_EMAIL
- constant for this form to work correctly',
- MISSING_CONSTANT,
- PEAR_ERROR_CALLBACK,
- array(&$this, 'error')
- );
- }
-
- parent::__construct(
- $formName,
- $method,
- $action,
- $target,
- $attributes,
- $trackSubmit
- );
-
- if ($this->email !== false && empty($this->email)) {
- // Set to false to turn off email function.
- $this->email = OWNER_EMAIL;
- }
- if (empty($this->siteName)) {
- $this->siteName = SITENAME;
- }
- if (empty($this->subject)) {
- $this->subject = "Your Pdf request from website " . SITENAME;
- }
-
- /**
- * Where are the flexy templates stored at for this class.
- */
- define('TEMPLATES_DIR', BASE . 'Toolkit/Contacts/templates');
-
- /**
- * Where are the compiled flexy templates stored at for this class.
- */
- define('COMPILED_DIR', BASE . 'Toolkit/Contacts/templates/compiled');
- $oldUmask = umask(0);
- if (!is_dir(TEMPLATES_DIR)) {
- mkdir(TEMPLATES_DIR, 0770, true);
- }
- if (!is_dir(COMPILED_DIR)) {
- mkdir(COMPILED_DIR, 0770, true);
- }
- umask($oldUmask);
-
- $this->flexyOptions = $GLOBALS['flexyOptions'];
- $this->flexyOptions['templateDir'] = TEMPLATES_DIR;
- $this->flexyOptions['compileDir'] = COMPILED_DIR;
- $this->flexyOptions['charset'] = 'utf-8';
- $this->flexyOptions['nonHTML'] = true;
-
- $var = basename(__FILE__, '.php');
-
- $callbackUrl = ($_SERVER['HTTPS'] == 'on') ?
- BASE_SECURE_URL : BASE_URL;
-
- $this->captchaOptions = array(
- 'width' => 100,
- 'height' => 50,
- 'callback' => "{$callbackUrl}Toolkit/qfcaptcha.php?var=$var",
- 'sessionVar' => $var,
- 'imageOptions' => array(
- 'font_size' => 16,
- 'font_path' => GLM_APP_BASE . 'glmPEAR/Image/Canvas/Fonts/',
- 'font_file' => 'times.ttf',
- 'background_color' => '#cccccc',
- 'obfuscation' => false,
- 'angle' => true,
- ),
- );
-
- $this->configureElements();
- $this->configureRules();
- $this->configureFilters();
- $this->configureDefaults();
- $this->configureConstants();
- }
-
- // }}}
- // {{{ configureConstats()
-
- /**
- * Constant variables for the form
- *
- * These values won't get overridden by POST or GET vars
- *
- * @return void
- * @access protected
- */
- protected function configureConstants()
- {
- $constants = array(
- 'user_agent' => $_SERVER['HTTP_USER_AGENT'],
- 'remote_addr' => $_SERVER['REMOTE_ADDR'],
- );
- $this->setupConstants($constants);
- }
-
- // }}}
- // {{{ configureDefaults()
-
- /**
- * Initializes default form values
- *
- * @return void
- * @access protected
- */
- protected function configureDefaults()
- {
- $defaults = array(
- );
-
- $this->setupDefaults($defaults);
- }
-
- // }}}
- // {{{ configureElements()
-
- /**
- * Form element definitions
- *
- * @return void
- * @access protected
- */
- protected function configureElements()
- {
- // All Elements are created here. This includes group element definitions.
- $elements[] = array('type' => 'hidden', 'req' => false, 'name' => 'user_agent');
- $elements[] = array('type' => 'hidden', 'req' => false, 'name' => 'remote_addr');
- $elements[] = array('type' => 'text', 'req' => true, 'name' => 'fname', 'display' => 'Friends Name:');
- $elements[] = array('type' => 'text', 'req' => true, 'name' => 'femail', 'display' => 'Friends Email:');
-
- $elements[] = array('type' => 'text', 'req' => true, 'name' => 'yname', 'display' => 'Your Name:');
- $elements[] = array('type' => 'text', 'req' => true, 'name' => 'yemail', 'display' => 'Your Email:');
-
- $elements[] = array('type' => 'CAPTCHA_Image', 'req' => false, 'name' => 'captcha_question', 'display' => null, 'opts' => $this->captchaOptions);
- $elements[] = array('type' => 'text', 'req' => true, 'name' => 'captcha_rmv', 'display' => 'Enter the letters you see');
- $elements[] = array('type' => 'submit', 'req' => false, 'name' => 'submit_rmv', 'display' => 'Send Email');
-
- $this->setupElements($elements);
- }
-
- // }}}
- // {{{ configureRules()
-
- /**
- * Form rule definitions
- *
- * Adds validation rules for the given fields
- *
- * @return void
- * @access protected
- */
- protected function configureRules()
- {
- // Form Rules
- $rules[] = array('element' => 'email', 'message' => 'ERROR: Invalid Email Format!', 'type' => 'email', 'format' => null, 'validation' => $this->validationType, 'reset' => true, 'force' => false);
-
- $rules[] = array('element' => 'captcha_rmv', 'message' => 'ERROR: What you entered didn\'t match!', 'type' => 'CAPTCHA', 'format' => $this->captchaQuestion, 'validation' => $this->validationType, 'reset' => true, 'force' => false);
-
- $this->setupRules($rules);
- }
-
- // }}}
- // {{{ configureFilters()
-
- /**
- * Form filter definitions
- *
- * Applies a data filter for the given fields when the form is submitted
- *
- * @return void
- * @access protected
- */
- protected function configureFilters()
- {
- $filters[] = array('element' => '__ALL__', 'filter' => 'trim');
- }
-
- // }}}
- // {{{ emailFriend()
-
- /**
- * Emails the owner the submitted data from the submitted form
- *
- * Uses a flexy template to render a nice looking html email.
- * Emails the link for pdf to person filling out form.
- *
- * @return boolean result of the mailing
- * @access protected
- */
- protected function emailFriend()
- {
- $template = new HTML_Template_Flexy($this->flexyOptions);
- $page = new stdClass();
-
- $page->email_from = FROM_NEWS_EMAIL;
- $page->fname = $this->getSubmitValue('fname');
- $page->yname = $this->getSubmitValue('yname');
- $page->subject = $this->subject;
-
- $template->compile('friendEmail.html');
- $htmlMsg = $template->bufferedOutputObject($page);
-
- $crlf = "\n";
- $mimeMail = new Mail_mime($crlf);
- $mimeMail->setFrom("{$this->siteName} <{$page->email_from}>");
- $mimeMail->setSubject($this->subject);
- $mimeMail->setHTMLBody($htmlMsg);
-
- $mail =& Mail::factory('mail');
- $setting = array(
- 'text_charset'=>'utf-8',
- 'html_charset'=>'utf-8',
- );
- $body = $mimeMail->get($setting);
- $headers = $mimeMail->headers(array('Reply-To'=>$this->getSubmitValue('femail')), true);
-
- $res = $mail->send($this->getSubmitValue('femail'), $headers, $body);
- if (PEAR::isError($res)) {
- return Toolkit_Common::handleError($res);
- } else {
- return $res;
- }
- }
-
- // }}}
- // {{{ error()
-
- /**
- * Display errors with the form to the user
- *
- * @param object $error PEAR Error Object
- *
- * @return void
- * @access public
- */
- public function error($error)
- {
- // make the variables static so that is only has to do the defining
- // on the first call.
- static $errorMessages;
- static $className;
-
- // define the various error messages
- if (!isset($errorMessages)) {
- $className = get_class($this);
- $errorMessages = array(
- FORM_OK => 'No error',
- FORM_ERROR => 'Unknown error',
- NO_RECORD => 'Setting both properties (email and hasContactDB) to false in the ' . $className . ' class will result in no email record being sent and no record being inserted into the database. There will be no record that this form was ever filled out.',
- INVALID_DB => 'Please set the property hasContactDB to a boolean value in the class ' . $className . ' before continuing',
- MISSING_CONSTANT => 'You have failed to set a CONSTANT for the class ' . $className . ' to function properly',
- );
- }
-
- if (!is_null($error->message)) {
- $message = $error->message;
- } elseif (isset($errorMessages[$error->code])) {
- $message = $errorMessages[$error->code];
- } else {
- $message = $errorMessages[$error->code];
- $message = $errorMessages[FORM_ERROR];
- }
-
- echo "{$message}
";
- }
-
- // }}}
- // {{{ processData()
-
- /**
- * Handles how to process the form when submitted
- *
- * @param array $values Form submitted values
- *
- * @return array Result of Insert / Update function
- * @access protected
- */
- protected function processData($values)
- {
- // Form data used for the insert/update sql queries and
- // the form email.
- $e = array(
- 'mail_ok',
- 'user_agent',
- 'remote_addr'
- );
- $this->setFormData($e);
-
-
- // If no contact db, return true so we can send owner email.
- if (!$this->hasContactDB) {
- return true;
- }
-
- // Get rid of any defined un-needed elements.
- // un-needed elements after the form is submitted are defined
- // by the ending _rmv name.
- foreach ($values as $k => &$v) {
- if (preg_match('/^.+_rmv$/', $k)) {
- unset($values[$k]);
- }
- }
- }
-
- // }}}
- // {{{ setupRenderers()
-
- /**
- * Custom rendering templates for special fields on the form
- *
- * @return void
- * @access protected
- */
- protected function setupRenderers()
- {
- parent::setupRenderers();
- $renderer =& $this->defaultRenderer();
- $required = '* ';
- $error = '{error}
';
-
- $renderer->setElementTemplate(''.$required.'{label}'.$error.'{element} ', 'comments');
- $renderer->setElementTemplate(''.$required.'{label}'.$error.'{element} ', 'submit_rmv');
-
- $renderer->setElementTemplate('{element} ', 'captcha_question');
- $renderer->setElementTemplate(''.$required.'{label} '.$error.'{element} ', 'captcha_rmv');
- }
-
- // }}}
- // {{{ toHTML()
-
- /**
- * Handles how to display the current step the user is at in the form
- *
- * destroying and resetting the captcha value dis-allows someone from
- * re-sending a form on a previous captcha.
- *
- * @return string form HTML state
- * @access public
- */
- public function toHTML()
- {
- $GLOBALS['styleSheets'][] = BASE_URL . 'contactform.css';
- $this->setupRenderers();
- if ($this->validate()) {
- $this->captchaQuestion->destroy();
- $this->cleanForm();
-
- if ($this->process(array(&$this, 'processData'), $this->mergeFiles)) {
- $this->freeze();
- $ret = $this->emailFriend();
- $output = $this->successMsg;
- }
- $this->sent = true;
- } elseif ($this->isSubmitted()) {
- $this->captchaQuestion->destroy();
- $this->captchaAnswer->setValue('');
- $output = $this->errorMsg;
- $output .= parent::toHTML();
- } else {
- $this->captchaQuestion->destroy();
- $this->captchaAnswer->setValue('');
- $output = parent::toHTML();
- }
- return $output;
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/Contacts/assets/.keepme b/Toolkit/Contacts/assets/.keepme
deleted file mode 100644
index e69de29..0000000
diff --git a/Toolkit/Contacts/database-table-modifiers.sql b/Toolkit/Contacts/database-table-modifiers.sql
deleted file mode 100644
index b539d26..0000000
--- a/Toolkit/Contacts/database-table-modifiers.sql
+++ /dev/null
@@ -1,46 +0,0 @@
-CREATE SEQUENCE contact_id_seq
- INCREMENT BY 1
- NO MAXVALUE
- NO MINVALUE
- CACHE 1;
-
-ALTER TABLE contact ALTER COLUMN id SET DEFAULT nextval('contact_id_seq'::regclass);
-
-ALTER TABLE ONLY contact
- ADD CONSTRAINT contact_pkey PRIMARY KEY (id);
-
-CREATE INDEX contact_create_date_indx ON contact USING btree (create_date);
-
-CREATE INDEX contact_email_indx ON contact USING btree (email);
-
-CREATE INDEX contact_fname_indx ON contact USING btree (fname);
-
-CREATE UNIQUE INDEX contact_id_indx ON contact USING btree (id);
-
-CREATE INDEX contact_lname_indx ON contact USING btree (lname);
-
-CREATE UNIQUE INDEX news_response_id_indx ON contact USING btree (id);
-
-CREATE UNIQUE INDEX query_db_id_indx ON contact USING btree (id);
-
-CREATE SEQUENCE contact_inq_id_seq
- INCREMENT BY 1
- NO MAXVALUE
- NO MINVALUE
- CACHE 1;
-
-ALTER TABLE contact_inq ALTER COLUMN id SET DEFAULT nextval('contact_inq_id_seq'::regclass);
-
-ALTER TABLE ONLY inq_group
- ADD CONSTRAINT inq_group_pkey PRIMARY KEY (id);
-
-CREATE SEQUENCE inq_group_id_seq
- INCREMENT BY 1
- NO MAXVALUE
- NO MINVALUE
- CACHE 1;
-
-ALTER TABLE inq_group ALTER COLUMN id SET DEFAULT nextval('inq_group_id_seq'::regclass);
-
-ALTER TABLE ONLY inq_group
- ADD CONSTRAINT inq_group_pkey PRIMARY KEY (id);
diff --git a/Toolkit/Contacts/database-tables.sql b/Toolkit/Contacts/database-tables.sql
deleted file mode 100644
index 1b71879..0000000
--- a/Toolkit/Contacts/database-tables.sql
+++ /dev/null
@@ -1,45 +0,0 @@
-CREATE TABLE contact (
- id integer NOT NULL,
- create_date date DEFAULT CURRENT_DATE,
- fname text,
- lname text,
- company text,
- address text,
- address2 text,
- city text,
- state text,
- zip text,
- country text,
- phone text,
- fax text,
- email text,
- user_agent text,
- remote_addr text,
- interest text,
- mail_ok boolean DEFAULT false,
- visitorguide boolean DEFAULT false,
- uidpdf text,
- visitorguide_download boolean DEFAULT false,
- email_verified boolean DEFAULT true,
- contact_type text,
- discover text,
- member_ok boolean DEFAULT false,
- staff boolean DEFAULT false,
- comments text,
- password text,
- verify_password text
-);
-
-CREATE TABLE inq_group (
- id integer NOT NULL,
- name text
-);
-
-CREATE TABLE contact_inq (
- id integer NOT NULL,
- header text,
- pos integer,
- description text,
- image text,
- groupid integer
-);
diff --git a/Toolkit/Contacts/templates/brochurePage.html b/Toolkit/Contacts/templates/brochurePage.html
deleted file mode 100755
index b90d3d5..0000000
--- a/Toolkit/Contacts/templates/brochurePage.html
+++ /dev/null
@@ -1,9 +0,0 @@
-
-DOWNLOAD:
-
We will email you a link to the PDF version of the {brochure}.
-
-
- {pdfForm:h}
-
-ORDER BY MAIL:
-{contactForm:h}
diff --git a/Toolkit/Contacts/templates/compiled/.cvsignore b/Toolkit/Contacts/templates/compiled/.cvsignore
deleted file mode 100644
index 65fb5e5..0000000
--- a/Toolkit/Contacts/templates/compiled/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-* *.*
diff --git a/Toolkit/Contacts/templates/compiled/.keepme b/Toolkit/Contacts/templates/compiled/.keepme
deleted file mode 100644
index e69de29..0000000
diff --git a/Toolkit/Contacts/templates/currentTables/Element.tpl b/Toolkit/Contacts/templates/currentTables/Element.tpl
deleted file mode 100755
index 595457b..0000000
--- a/Toolkit/Contacts/templates/currentTables/Element.tpl
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
- *
-
- {label}
-
-
-
- {error}
-
- {element}
-
-
diff --git a/Toolkit/Contacts/templates/currentTables/Form.tpl b/Toolkit/Contacts/templates/currentTables/Form.tpl
deleted file mode 100755
index f59286a..0000000
--- a/Toolkit/Contacts/templates/currentTables/Form.tpl
+++ /dev/null
@@ -1,7 +0,0 @@
-
diff --git a/Toolkit/Contacts/templates/currentTables/Group.tpl b/Toolkit/Contacts/templates/currentTables/Group.tpl
deleted file mode 100755
index cdd24cf..0000000
--- a/Toolkit/Contacts/templates/currentTables/Group.tpl
+++ /dev/null
@@ -1,5 +0,0 @@
-
diff --git a/Toolkit/Contacts/templates/currentTables/GroupElement.tpl b/Toolkit/Contacts/templates/currentTables/GroupElement.tpl
deleted file mode 100755
index 1a4ba27..0000000
--- a/Toolkit/Contacts/templates/currentTables/GroupElement.tpl
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
- {element}
-
- *
-
- {label}
-
-
diff --git a/Toolkit/Contacts/templates/currentTables/Header.tpl b/Toolkit/Contacts/templates/currentTables/Header.tpl
deleted file mode 100755
index 64ac244..0000000
--- a/Toolkit/Contacts/templates/currentTables/Header.tpl
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- {header}
-
-
diff --git a/Toolkit/Contacts/templates/currentTables/RequiredNote.tpl b/Toolkit/Contacts/templates/currentTables/RequiredNote.tpl
deleted file mode 100755
index dad5d0b..0000000
--- a/Toolkit/Contacts/templates/currentTables/RequiredNote.tpl
+++ /dev/null
@@ -1 +0,0 @@
-* = Required Fields
diff --git a/Toolkit/Contacts/templates/direct-list.html b/Toolkit/Contacts/templates/direct-list.html
deleted file mode 100755
index eefc842..0000000
--- a/Toolkit/Contacts/templates/direct-list.html
+++ /dev/null
@@ -1,29 +0,0 @@
-Your Trip Planner List
-Below is the list of businesses you have added to your Trip Planner. The form below will be sent to each individual business listing that has an email address listed with their business listing. For those businesses with no email address, we have included their phone numbers for you to call directly and request additional information.
-Request Information by Phone from:
-These business listings have no current email address on file. To receive additional information please call the phone numbers listed next to each business name.
-
-
- Name
- Phone
-
-
- {foreach:memberDirectNoEmail,member}
-
- {member[memberName]}
- {member[memberPhone]}
- Remove
-
- {end:}
-
-Request Information by Email from:
-This list of businesses will receive the following information form directly to their email account.
-
-Plan Your Trip Information Request Form
diff --git a/Toolkit/Contacts/templates/emailOwner.tpl b/Toolkit/Contacts/templates/emailOwner.tpl
deleted file mode 100755
index e574342..0000000
--- a/Toolkit/Contacts/templates/emailOwner.tpl
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
- {title:h}
-
-
-
-
-
- {subject:h}
-
-
-
-
- From {fname:h} {lname:h}
-
-
-
-
-
-
- {foreach:formData,v}
-
-
-
- {v[label]:h}
-
-
- {if:v[nowrap]}
-
- {v[element]:h}
-
- {else:}
-
- {v[element]:h}
-
- {end:}
-
- {end:}
-
-
-
-
-
-
-
-
-
- To ensure the delivery of these e-mails to your inbox, please add {email_from:h} to your e-mail Address Book or Safe List.
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Toolkit/Contacts/templates/friendEmail.html b/Toolkit/Contacts/templates/friendEmail.html
deleted file mode 100644
index 358ded6..0000000
--- a/Toolkit/Contacts/templates/friendEmail.html
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
- Dear {fname}
- Your friend {yname} has been to demo.gaslightmedia.com , and thought you might be interested in it.
- Message here.
-
-
-
diff --git a/Toolkit/Contacts/templates/pdfDownloadEmail.html b/Toolkit/Contacts/templates/pdfDownloadEmail.html
deleted file mode 100755
index 6f01198..0000000
--- a/Toolkit/Contacts/templates/pdfDownloadEmail.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
- {title:h}
-
-
-
- {subject:h}
- Thank you for requesting the {pdfName} Link. Here is the link to the Adobe PDF version:
-
- Brochure ({pdfFileSize})
- Thank you for your interest in {client_info[name]:h}'!
- Sincerely,
- {client_info[name]:h}
- {client_info[url]:h}
-
-
-
diff --git a/Toolkit/Coupons/Category.php b/Toolkit/Coupons/Category.php
deleted file mode 100644
index db77db9..0000000
--- a/Toolkit/Coupons/Category.php
+++ /dev/null
@@ -1,99 +0,0 @@
-_name = $name;
- }
-
- private function _getTableData()
- {
- $classData = get_object_vars($this);
- $dataKeys = array_keys($classData);
- $dataValues = array_values($classData);
- $func = create_function('$v', 'return substr($v, 1);');
- $newKeys = array_map($func, $dataKeys);
-
- return array_combine($newKeys, $dataValues);
- }
-
- public function setName($name)
- {
- $this->_name = $name;
- }
-
- public function getName()
- {
- return $this->_name;
- }
-
- public function insert(PDO $dbh)
- {
- $classData = $this->_getTableData();
- unset($classData['id']);
-
- $sql = Toolkit_Common::createSQLInsert(
- 'coupon_category',
- array_keys($classData)
- );
-
- try {
- $dbh->beginTransaction();
- Toolkit_Common::processQuery(
- $dbh,
- 'coupon_category',
- $sql,
- $classData
- );
-
- $sql = "
- SELECT id
- FROM coupon_category
- ORDER BY id DESC LIMIT 1";
-
- $row = $dbh->query($sql, PDO::FETCH_ASSOC)->fetch();
-
- $dbh->commit();
-
- $this->_id = $row['id'];
- return $this->_id;
- } catch (PDOException $e) {
- $dbh->rollback();
- return Toolkit_Common::handleError($e);
- }
- }
-
- public function update(PDO $dbh)
- {
- date_default_timezone_set('America/New_York');
-$d = new Date();
-$d->setDate('10-17-2008');
-print_r($d);
-die;
- $classData = $this->_getTableData();
- $id = $classData['id'];
- unset($classData['id']);
-
- $sql = Toolkit_Common::createSQLUpdate(
- 'coupon_category',
- array_keys($classData),
- array('id = :id')
- );
-
- try {
- $classData['id'] = $id;
- return Toolkit_Common::processQuery(
- $dbh,
- 'coupon_category',
- $sql,
- $classData
- );
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-}
-?>
diff --git a/Toolkit/Coupons/Coupon.php b/Toolkit/Coupons/Coupon.php
deleted file mode 100644
index 423dc1f..0000000
--- a/Toolkit/Coupons/Coupon.php
+++ /dev/null
@@ -1,50 +0,0 @@
-title = $title;
- }
-
- public function setDescription($description)
- {
- $this->description = $description;
- }
-
- public function setImage($image)
- {
- $this->image = $image;
- }
-
- public function setExpiration(Date $expiration)
- {
- $this->expiration = $expiration;
- }
-
- public function getTitle()
- {
- return $this->title;
- }
-
- public function getDescription()
- {
- return $this->description;
- }
-
- public function getImage()
- {
- return $this->image;
- }
-
- public function getExpiration()
- {
- return $this->expiration;
- }
-}
-?>
diff --git a/Toolkit/Coupons/Database/application.sql b/Toolkit/Coupons/Database/application.sql
deleted file mode 100644
index e09edc2..0000000
--- a/Toolkit/Coupons/Database/application.sql
+++ /dev/null
@@ -1,13 +0,0 @@
---
--- Tables
---
-\i ./tables/coupon_category.sql
-\i ./tables/coupons.sql
-
---
--- Procedures
---
-
---
--- Modules
---
diff --git a/Toolkit/Coupons/Database/tables/coupon_category.sql b/Toolkit/Coupons/Database/tables/coupon_category.sql
deleted file mode 100644
index 3800073..0000000
--- a/Toolkit/Coupons/Database/tables/coupon_category.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-CREATE TABLE coupon_category
-(id INTEGER NOT NULL,
- name TEXT NOT NULL,
- PRIMARY KEY (id));
-
-GRANT ALL ON coupon_category_id_seq TO nobody;
-GRANT ALL ON coupon_category TO nobody;
diff --git a/Toolkit/Coupons/Database/tables/coupons.sql b/Toolkit/Coupons/Database/tables/coupons.sql
deleted file mode 100644
index 9d32c1f..0000000
--- a/Toolkit/Coupons/Database/tables/coupons.sql
+++ /dev/null
@@ -1,22 +0,0 @@
-CREATE TABLE coupons
-(id INTEGER NOT NULL,
- title TEXT,
- description TEXT,
- url TEXT,
- sdate DATE NOT NULL,
- edate DATE NOT NULL,
- expiration DATE NOT NULL,
- category INTEGER
- REFERENCES coupon_category (id)
- ON UPDATE CASCADE
- ON DELETE CASCADE,
- active BOOLEAN NOT NULL DEFAULT FALSE,
- member INTEGER
- REFERENCES member (member_id)
- ON UPDATE CASCADE
- ON DELETE CASCADE,
- image TEXT,
- PRIMARY KEY (id));
-
-GRANT ALL ON coupons_id_seq TO nobody;
-GRANT ALL ON coupons TO nobody;
diff --git a/Toolkit/Coupons/ICoupon.php b/Toolkit/Coupons/ICoupon.php
deleted file mode 100644
index 570e210..0000000
--- a/Toolkit/Coupons/ICoupon.php
+++ /dev/null
@@ -1,7 +0,0 @@
-
diff --git a/Toolkit/Coupons/IFactory.php b/Toolkit/Coupons/IFactory.php
deleted file mode 100644
index def769d..0000000
--- a/Toolkit/Coupons/IFactory.php
+++ /dev/null
@@ -1,6 +0,0 @@
-
diff --git a/Toolkit/Coupons/MemberCoupon.php b/Toolkit/Coupons/MemberCoupon.php
deleted file mode 100644
index 8450017..0000000
--- a/Toolkit/Coupons/MemberCoupon.php
+++ /dev/null
@@ -1,101 +0,0 @@
-title = $data['title'];
- $this->image = $data['image'];
- if (isset($data['description'])) {
- $this->description = $data['description'];
- }
- if (isset($data['expiration'])) {
- $this->expiration = $data['expiration'];
- }
- }
-
- public function setCategory ($category)
- {
- settype($category, 'integer');
-
- $this->category = $category;
- }
-
- public function getCategory()
- {
- return $this->category;
- }
-
- public function insert(PDO $dbh)
- {
- $classData = get_object_vars($this);
- $classData['expiration'] = $this->expiration->format('%m-%d-%Y');
- unset($classData['id']);
-
- $sql = Toolkit_Common::createSQLInsert(
- 'coupons',
- array_keys($classData)
- );
-
- try {
- $dbh->beginTransaction();
- Toolkit_Common::processQuery(
- $dbh,
- 'coupons',
- $sql,
- $classData
- );
-
- $sql = "
- SELECT id
- FROM coupons
- ORDER BY id DESC LIMIT 1";
-
- $row = $dbh->query($sql, PDO::FETCH_ASSOC)->fetch();
-
- $dbh->commit();
-
- $this->id = $row['id'];
- return $this->id;
- } catch (PDOException $e) {
- $dbh->rollback();
- return Toolkit_Common::handleError($e);
- }
- }
-
- public function update(PDO $dbh)
- {
- $classData = get_object_vars($this);
- $classData['expiration'] = $this->expiration->format('%m-%d-%Y');
- $id = $classData['id'];
- unset($classData['id']);
-
- $sql = Toolkit_Common::createSQLUpdate(
- 'coupons',
- array_keys($classData),
- array('id = :id')
- );
-
- try {
- $classData['id'] = $id;
- return Toolkit_Common::processQuery(
- $dbh,
- 'coupons',
- $sql,
- $classData
- );
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-}
-?>
diff --git a/Toolkit/Coupons/MemberFactory.php b/Toolkit/Coupons/MemberFactory.php
deleted file mode 100644
index 4bb9241..0000000
--- a/Toolkit/Coupons/MemberFactory.php
+++ /dev/null
@@ -1,9 +0,0 @@
-
diff --git a/Toolkit/DataGridBuilder.php b/Toolkit/DataGridBuilder.php
deleted file mode 100644
index 0666dcf..0000000
--- a/Toolkit/DataGridBuilder.php
+++ /dev/null
@@ -1,285 +0,0 @@
-
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @link http://demo.gaslightmedia.com
- */
-
-/**
- * Create Datagrids for displaying data
- *
- * This abstract class handles all the base functionality of creating
- * handeling all the details associated w/ a regular dataGrid.
- * 1. Creation
- * 2. Sorting (via column headers or sortform)
- * 3. Pagenation
- *
- * @category Structures
- * @package Toolkit_DataGridBuilder
- * @author Jamie Kahgee
- * @copyright 2008 Gaslight Media
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @Release CVS: $Id: DataGridBuilder.php,v 1.13 2009/09/16 00:07:44 jamie Exp $
- * @link http://demo.gaslightmedia.com
- * @see Toolkit_SortForm, Structures_DataGrid
- */
-abstract class Toolkit_DataGridBuilder extends Structures_DataGrid
-{
- // {{{ properties
-
- /**
- * Options to pass to DataGrid
- *
- * @var array
- * @access protected
- */
- protected $options;
-
- /**
- * Rendering options for DataGrid
- *
- * @var array
- * @access protected
- */
- protected $rendererOptions = array(
- 'sortIconASC' => '⇑',
- 'sortIconDESC' => '⇓',
- 'evenRowAttributes' => 'class="even"',
- 'oddRowAttributes' => 'class="odd"',
- 'sortingResetsPaging' => false,
- );
-
- /**
- * Rendering options for DataGrid paging element
- *
- * @var array
- * @access protected
- */
- protected $pagerOptions = array(
- 'nextImg' => 'Next',
- 'prevImg' => 'Previous',
- 'separator' => '',
- 'spacesBeforeSeparator' => 0,
- 'spacesAfterSeparator' => 0,
- 'containerClass' => 'paging',
- );
-
- /**
- * SQL query used to obtain the DataGrid
- *
- * @var unknown
- * @access protected
- */
- protected $sql;
-
- /**
- * How many records must exist in the Datagrid before the sort form shows up
- *
- * @var integer
- * @access protected
- */
- protected $sortableAfter = 10;
-
- /**
- * The HTML table id of the DataGrid
- *
- * @var string
- * @access protected
- */
- protected $tableId = 'dataGrid';
-
- /**
- * The HTML class name of the DataGrid
- *
- * @var string
- * @access protected
- */
- protected $tableClass = 'dataGrid';
-
- /**
- * The HTML id of the DataGrid sorting form (when present)
- *
- * @var string
- * @access protected
- */
- protected $sortFormId = 'gridSorter';
-
- /**
- * Message to display to users if no records were found
- *
- * @var String
- * @access Protected
- * @see Toolkit_DataGridBuilder::setNoRecordMessage()
- */
- protected $noRecMessage = 'No Records';
-
- // }}}
- // {{{ __construct()
-
- /**
- * DataGrid constructor
- *
- * Instantiates a DataGrid and sets up when to make the grid sortable
- *
- * @param PDO $pdo PDO object used in the datagrid
- * @param integer $limit The number of records to display per page.
- * @param integer $page The current page view. In most cases,
- * this is useless. Note: if you specify
- * this, the "page"GET variable will be ignored.
- * @param string $rendererType The type of renderer to use. You may
- * prefer to use the $type argument of
- * render, fill or getOutput.
- *
- * @return void
- * @access public
- */
- public function __construct(
- PDO $pdo,
- $limit = null,
- $page = null,
- $rendererType = null
- ) {
- parent::__construct($limit, $page, $rendererType);
-
- $this->options = array('dbc' => $pdo);
- if (!is_null($limit)) {
- $this->sortableAfter = $limit;
- }
- }
-
- // }}}
-
- // {{{ configureColumns()
-
- /**
- * configure retrieved columns
- *
- * Tells the DataGrid how to render the retrieved columns
- *
- * @return void
- * @access protected
- */
- abstract protected function configureColumns();
-
- // }}}
-
- // {{{ setNoRecordMessage()
-
- /**
- * The message to display if no results were found from the sql query
- *
- * @param string $msg No result message.
- *
- * @return void
- * @access public
- */
- public function setNoRecordMessage($msg)
- {
- $this->noRecMessage = $msg;
- }
-
- // }}}
- // {{{ setQuery()
-
- /**
- * Sets the sql query to use in the DataGrid to get the results
- *
- * @param string $sql The SQL query
- *
- * @return void
- * @access public
- */
- public function setQuery($sql)
- {
- $this->sql = $sql;
- }
-
- // }}}
- // {{{ show()
-
- /**
- * Displays the DataGrid results
- *
- * @return void
- * @access public
- */
- public function show()
- {
- echo $this->toHTML();
- }
-
- // }}}
-
- // {{{ toHTML()
-
- /**
- * returns a HTML table of the datagrid
- *
- * @return string
- * @access public
- */
- public function toHTML()
- {
- $this->configureColumns();
-
- try {
- $bind = $this->bind($this->sql, $this->options, 'PDO');
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
-
- if (PEAR::isError($bind)) {
- return Toolkit_Common::handleError($bind);
- } elseif (($recCount = $this->getRecordCount()) > 0) {
- $this->setRendererOptions($this->rendererOptions);
- $renderer =& $this->getRenderer();
- // Allows us to turn off the id name for the table,
- // when we subclass this class out.
- if ($this->tableId) {
- $renderer->setTableAttribute('id', $this->tableId);
- }
- // Allows us to turn off the class name for the table,
- // when we subclass this class out.
- if ($this->tableClass) {
- $renderer->setTableAttribute('class', $this->tableClass);
- }
- $gridBody = $this->getOutput();
-
- if (PEAR::isError($gridBody)) {
- return Toolkit_Common::handleError($gridBody);
- }
-
- $gridPager = $this->getOutput(
- DATAGRID_RENDER_PAGER,
- array('pagerOptions' => $this->pagerOptions)
- );
- if (PEAR::isError($gridPager)) {
- return Toolkit_Common::handleError($gridPager);
- }
-
- if ($recCount > $this->sortableAfter) {
- $form = new Toolkit_SortForm($this->sortFormId);
- $options = array('directionStyle' => 'radio');
- $this->fill($form, $options, DATAGRID_RENDER_SORTFORM);
- // Datagrid never ads a submit button.
- $form->addElement('submit', null, 'Submit');
- $gridSorter = $form->toHTML();
- }
-
- return $gridPager . $gridSorter . $gridBody . $gridPager;
- } else {
- return "{$this->noRecMessage} ";
- }
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/Database.php b/Toolkit/Database.php
deleted file mode 100644
index 1bab552..0000000
--- a/Toolkit/Database.php
+++ /dev/null
@@ -1,123 +0,0 @@
-
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version CVS: $Id: Database.php,v 1.4 2009/11/15 19:06:21 jamie Exp $
- * @link http://demo.gaslightmedia.com
- */
-
-/**
- * Database Singleton class
- *
- * @category Database
- * @package Toolkit_Database
- * @author Jamie Kahgee
- * @copyright 2008 Gaslight Media
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @link http://demo.gaslightmedia.com
- */
-class Toolkit_Database
-{
- // {{{ properties
-
- /**
- * Database handler object
- *
- * @var PDO
- * @access private
- */
- private $_dbh;
-
- /**
- * Class instance
- *
- * @var Toolkit_Database
- * @access private
- */
- private static $_instance;
-
- // }}}
- // {{{ __construct()
-
- /**
- * Class constructor
- *
- * Make the database handler connection for the class
- *
- * @access private
- */
- private function __construct()
- {
- try {
- $dsn = 'pgsql:' . CONN_STR;
- // Keep the fetch mode set to FETCH_BOTH, we use
- // associative arrays throughout our apps, but some PEAR lib
- // apps require numerical indicies to work correctly.
- // i.e. (DataGrids working w/ PDO's)
- $driverOptions = array(
- PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_BOTH,
- );
- $this->_dbh = new PDO($dsn, null, null, $driverOptions);
- $this->_dbh->setAttribute(
- PDO::ATTR_ERRMODE,
- PDO::ERRMODE_EXCEPTION
- );
- $this->_dbh->query("SET DATESTYLE TO 'SQL,US'");
- } catch (PDOException $e) {
- Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
- // {{{ __clone()
-
- /**
- * Clone magic method
- *
- * Don't allow cloning of instances of this class
- * which could potentially duplicate system resources
- * and make extra DB connections
- *
- * @return void
- * @access private
- */
- private function __clone()
- {
- // Do nothing so we don't create duplicate resources
- }
-
- // }}}
-
- // {{{ getInstance()
-
- /**
- * Get an instance of this class
- *
- * If this object hasn't been instantiated once already
- * then create the object and return the dbh.
- * Otherwise just return the already instantiated dbh.
- *
- * @return PDO $_instance database handler instance
- * @access public
- * @static
- */
- public static function getInstance()
- {
- if (!(self::$_instance instanceof self)) {
- self::$_instance = new self();
- }
-
- return self::$_instance->_dbh;
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/FlexyDataGridBuilder.php b/Toolkit/FlexyDataGridBuilder.php
deleted file mode 100644
index d41e241..0000000
--- a/Toolkit/FlexyDataGridBuilder.php
+++ /dev/null
@@ -1,222 +0,0 @@
-
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version CVS: $Id: FlexyDataGridBuilder.php,v 1.13 2009/12/29 14:27:55 jamie Exp $
- * @link <>
- */
-
-/**
- * Create Flexy templating Datagrids for displaying data
- *
- * This abstract class handles all the base functionality of creating
- * handeling all the details associated w/ a Flexy template datagrid
- * 1. Creation
- * 2. Sorting (via column headers or sortform)
- * 3. Pagenation
- *
- * @category Structures
- * @package Toolkit_FlexyDataGridBuilder
- * @author Jamie Kahgee
- * @copyright 2008 Gaslight Media
- * @license http://www.gaslightmedia.com/Gaslightmedia Gaslightmedia
- * @link http://pear.php.net/package/Structures_DataGrid/docs
- * @see Structures_DataGrid_Renderer_Flexy, HTML_Template_Flexy
- */
-abstract class Toolkit_FlexyDataGridBuilder extends Toolkit_DataGridBuilder
-{
- // {{{ properties
-
- /**
- * Name of the table which we will be dealing with
- *
- * @var string
- * @access protected
- */
- protected $tableName;
-
- /**
- * The name of the template that renders this datagrid
- *
- * @var string
- * @access protected
- */
- protected $template;
-
- /**
- * Output an object as $t to the template
- *
- * converts array keys to objects usable in a template form.
- *
- *
- * $this->ctrlObj['url'] = BASE_URL;
- *
- *
- *
- *
- *
- *
- * @var array
- * @access protected
- */
- protected $ctrlObj = array();
-
- /**
- * Rendering options for DataGrid
- *
- * @var array
- * @access protected
- */
- protected $rendererOptions = array(
- 'sortIconASC' => '⇑',
- 'sortIconDESC' => '⇓',
- 'sortingResetsPaging' => false,
- );
-
- /**
- * The HTML id of the DataGrid
- *
- * @var string
- * @access protected
- */
- protected $gridId = 'dataGrid';
-
- /**
- * The HTML class of the DataGrid
- *
- * @var string
- * @access protected
- */
- protected $gridClass = 'dataGrid';
-
- // }}}
- // {{{ __construct()
-
- /**
- * Constructor
- *
- * Builds the DataGrid class.
- *
- * @param PDO $pdo PDO object used in the datagrid
- * @param integer $limit The number of records to display per page.
- * @param integer $page The current page view. In most cases,
- * this is useless. Note: if you specify
- * this, the "page"GET variable will be ignored.
- * @param string $rendererType The type of renderer to use. You may
- * prefer to use the $type argument of
- * render, fill or getOutput.
- *
- * @return void
- * @access public
- */
- public function __construct(
- PDO $pdo,
- $limit = null,
- $page = null,
- $rendererType = null
- ) {
- $this->dbh = $pdo;
- if (ctype_digit($_GET['setPerPage'])) {
- $limit = $_GET['setPerPage'];
- }
-
- parent::__construct($pdo, $limit, $page, $rendererType);
-
- // If all records show on one page, then hide sort form.
- if (!is_null($limit)) {
- $this->sortableAfter = $limit;
- }
- }
-
- // }}}
-
- // {{{ show()
-
- /**
- * Displays the DataGrid results
- *
- * @param Structures_DataGrid_Renderer_Flexy $renderer Rendering engine used to render DG
- *
- * @return void
- * @access public
- */
- public function show(Structures_DataGrid_Renderer_Flexy $renderer)
- {
- echo $this->toHtml($renderer);
- }
-
- // }}}
-
- // {{{ toHtml()
-
- /**
- * Returns the DataGrid
- *
- * @param Structures_DataGrid_Renderer_Flexy $renderer Rendering engine used to render DG
- *
- * @return string html templated datagrid results
- * @access public
- */
- public function toHtml(
- Structures_DataGrid_Renderer_Flexy $renderer,
- $template = null
- ) {
- $this->configureColumns();
-
- try {
- $bind = $this->bind($this->sql, $this->options, 'PDO');
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
-
- if (PEAR::isError($bind)) {
- return Toolkit_Common::handleError($bind);
- }
-
- if (method_exists($this, 'setControlObject')) {
- $this->setControlObject();
- foreach ($this->ctrlObj as $k => $v) {
- $renderer->$k = $v;
- }
- }
-
- $renderer->setOptions($this->rendererOptions);
- $renderer->setOptions(array('pagerOptions' => $this->pagerOptions));
-
- $this->attachRenderer($renderer);
- $tEngine = $renderer->getContainer();
-
- $pathToTemplate = $tEngine->options['templateDir'][0];
-
- if ( !is_null($template)
- && file_exists("$pathToTemplate/$template")
- ) {
- $tEngine->compile($template);
- } elseif (isset($this->template)
- && file_exists($pathToTemplate . $this->template)
- ) {
- $tEngine->compile($this->template);
- } else {
- throw new RuntimeException('Template not available');
- }
-
- // Get the entire datagrid body.
- $gridBody = $this->getOutput();
- if (PEAR::isError($gridBody)) {
- return Tolkit_Common::handleError($gridBody);
- }
-
- return $gridSorter . $gridBody;
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/Form.php b/Toolkit/Form.php
deleted file mode 100644
index c9e8d2e..0000000
--- a/Toolkit/Form.php
+++ /dev/null
@@ -1,144 +0,0 @@
-
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version CVS: $Id: Form.php,v 1.6 2009/08/31 17:43:48 jamie Exp $
- * @link http://demo.gaslightmedia.com/
- */
-
-/**
- * Minimum form object method definitions
- *
- * Each form must at least define some elements and setup the rules for
- * that form. They must also create a method which handless extracting
- * the form object into an html string suitable to be displayed onto a
- * page.
- *
- * @category Form
- * @package Toolkit_Form
- * @author Jamie Kahgee
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @link http://demo.gaslightmedia.com/
- */
-interface Toolkit_Form
-{
- // {{{ configureElements()
-
- /**
- * Defines all elements to be used in a form
- *
- * Creates an array of elements and passes them off to the setupElements
- * function wich adds each element to the form object.
- *
- *
- * public function configureElements()
- * {
- * $e = array();
- *
- * $e[] = array(
- * 'type' => 'text',
- * 'req' => false
- * 'name' => 'text_field',
- * 'display' => 'Text Label',
- * );
- * $e[] = array(
- * 'type' => 'checkbox',
- * 'req' => false
- * 'name' => 'checkbox_field',
- * 'display' => 'Checkbox Label',
- * );
- *
- * // ... More Element Definitions
- *
- * $this->setupElements($e);
- * }
- *
- *
- * @access public
- * @return void
- */
- //public function configureElements();
-
- // }}}
- // {{{ configureForm()
-
- /**
- * Calls all the configuration methods to configure a form for use
- *
- * @access public
- * @return void
- */
- //public function configureForm();
-
- // }}}
- // {{{ configureRules()
-
- /**
- * Defines all element rules to be used for validation in the form
- *
- * At the bare minimum, this function needs to be called to setup the
- * form rules, even if no extra rules are defined. Because it still
- * creates all the required rules that are defined w/ each element.
- *
- *
- * public function configureRules()
- * {
- * $r = array();
- *
- * $r[] = array(
- * 'element' => 'text_field',
- * 'message' => 'ERROR: 10 characters max!',
- * 'type' => 'maxlength',
- * 'format' => 10,
- * 'validation' => $this->validationType,
- * 'reset' => true,
- * 'force' => false,
- * );
- * $r[] = array(
- * 'element' => 'text_field',
- * 'message' => 'ERROR: Numric characters only!',
- * 'type' => 'numeric',
- * 'format' => null,
- * 'validation' => $this->validationType,
- * 'reset' => true,
- * 'force' => false,
- * );
- *
- * // ... More Rule Definitions
- *
- * $this->setupRules($r);
- * }
- *
- *
- * @access public
- * @return void
- */
- public function configureRules();
-
- // }}}
- // {{{ toHtml()
-
- /**
- * Get an html string that contains the form
- *
- * Check if the form needs to be validated (ie. it was submitted)
- * Check if submitted data needs to be processed
- *
- * @access public
- * @return string an html string that contains the entire form
- */
- public function toHtml();
-
- // }}}
-}
-?>
diff --git a/Toolkit/FormBuilder.php b/Toolkit/FormBuilder.php
deleted file mode 100644
index 20bfbaf..0000000
--- a/Toolkit/FormBuilder.php
+++ /dev/null
@@ -1,1197 +0,0 @@
-
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version CVS: $Id: FormBuilder.php,v 1.39 2010/01/30 17:05:35 jamie Exp $
- * @link http://demo.gaslightmedia.com
- */
-
-/**
- * Allow the inclusion of the Element Grid plugin for QuickForms
- */
-require_once 'HTML/QuickForm/ElementGrid.php';
-
-/**
- * Handle QuickForm CAPTCHA's
- */
-require_once 'HTML/QuickForm/CAPTCHA/Image.php';
-
-/**
- * Require PEAR QuickForm class
- */
-require_once 'HTML/QuickForm.php';
-
-require_once 'HTML/QuickForm/Rule/Zip.php';
-require_once 'HTML/QuickForm/Rule/Phone.php';
-require_once 'HTML/QuickForm/Rule/Banwords.php';
-require_once 'HTML/QuickForm/Rule/State.php';
-
-/**
- * Base functionality for creating HTML_Quickforms
- *
- * @category Forms
- * @package Toolkit_FormBuilder
- * @author Jamie Kahgee
- * @copyright 2008 Gaslight Media
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @link http://demo.gaslightmedia.com
- */
-abstract class Toolkit_FormBuilder extends HTML_QuickForm
-{
- // {{{ properties
-
- /**
- * Global form captcha question element
- *
- * @var object
- * @access protected
- */
- protected $captchaQuestion;
-
- /**
- * Global form captcha answer from user
- *
- * @var object
- * @access protected
- */
- protected $captchaAnswer;
-
- /**
- * Form submitted data used when emailing form results
- *
- * @var array
- * @access protected
- */
- protected $formData = array();
-
- /**
- * Automatically create validation rules for any date elements
- *
- * This will only work if the date element is in m-d-Y format
- *
- * @var boolean
- * @access protected
- */
- protected $autoValidateDateElements = true;
-
- /**
- * How do we want to validate the form
- *
- * Possible options are [server, client]
- *
- * @var string
- * @access protected
- */
- protected $validationType = 'server';
-
- /**
- * What do you want the error msg to be if the form doesn't validate
- *
- * @var string
- * @access protected
- */
- protected $errorMsg
- = '
- Warning: The form was not sent, please review the errors below.
-
';
-
- /**
- * What do you want the success msg to be if the form validates successfully
- *
- * @var string
- * @access protected
- */
- protected $successMsg
- = '
- The information below has been successfully submitted.
-
';
-
- /**
- * Whether uploaded files should be processed too (if present)
- *
- * @var string
- * @access protected
- */
- protected $mergeFiles = true;
-
- /**
- * Include a captcha on the form or not
- *
- * @var boolean
- * @access protected
- */
- protected $useCaptcha;
-
- /**
- * The default templates to inject into the form renderer
- *
- * @var string
- * @access protected
- */
- protected $template;
-
- /**
- * The default rules to register for validating
- *
- * We have to register these rules, or any others we want, before
- * we are able to use them in our forms.
- *
- * These rules can be removed in subclasses before the rules are configured
- * if you want to omit any of them from validating input - just remember
- * to not call them in your configured rules!
- *
- * Phone: validates input against US and CA style phone #'s
- *
- * $rules[] = array('element' => 'phone',
- * 'message' => 'ERROR: Invalid Phone Format!',
- * 'type' => 'phone',
- * 'format' => null,
- * 'validation' => $this->validationType,
- * 'reset' => true,
- * 'force' => false);
- *
- *
- * Zip: Validates input against US and CA zip codes, if DB check is
- * set to true, validate zip codes against all the zip codes in the
- * DB.
- *
- * $rules[] = array('element' => 'zip',
- * 'message' => 'ERROR: Invalid Zip!',
- * 'type' => 'zip',
- * 'format' => array('requireDBCheck' => true),
- * 'validation' => $this->validationType,
- * 'reset' => true,
- * 'force' => false);
- *
- *
- * Banwords: Make sure each each doesn't contain a banned word. Checking
- * against a DB of banned words.
- *
- * State: Validate input against US and CA region / province codes. If DB
- * check is set to true, validate region / province against all the
- * regions / provinces in the DB.
- *
- * $rules[] = array('element' => 'state_id',
- * 'message' => 'ERROR: Invalid State / Province!',
- * 'type' => 'state',
- * 'format' => array('requireDBCheck' => true),
- * 'validation' => $this->validationType,
- * 'reset' => true,
- * 'force' => false);
- *
- *
- * @var array
- * @access protected
- * @see app.gaslightmedia.com/glmPEAR/HTML/QuickForm/Rule/Zip.php
- * @see app.gaslightmedia.com/glmPEAR/HTML/QuickForm/Rule/Phone.php
- * @see app.gaslightmedia.com/glmPEAR/HTML/QuickForm/Rule/Banwords.php
- * @see app.gaslightmedia.com/glmPEAR/HTML/QuickForm/Rule/State.php
- */
- protected $registeredRules = array('phone', 'zip', 'state');
-
- // }}}
- // {{{ __construct()
-
- /**
- * Class constructor
- *
- * @param string $formName Form's name.
- * @param string $method (optional)Form's method defaults to 'POST'
- * @param string $action (optional)Form's action
- * @param string $target (optional)Form's target defaults to '_self'
- * @param mixed $attributes (optional)Extra attributes for tag
- * @param bool $trackSubmit (optional)Whether to track if the form was
- * submitted by adding a special hidden field
- *
- * @access public
- * @link http://pear.php.net/package/HTML_QuickForm/docs/latest/HTML_QuickForm/HTML_QuickForm.html
- * @see HTML_QuickForm
- * @todo Remove assigning the dbh the global dbh and setup a PDO
- * to be passed in from a parameter - this will allow for easier
- * PHPUnit testing
- */
- public function __construct(
- $formName,
- $method = 'post',
- $action = '',
- $target = '',
- $attributes = null,
- $trackSubmit = false
- ) {
- // T_VARIABLE error when passing this server
- // var in on the constructors params.
- $action = empty($action) ? $_SERVER['REQUEST_URI'] : $action;
- parent::__construct(
- $formName,
- $method,
- $action,
- $target,
- $attributes,
- $trackSubmit
- );
- $this->template = BASE . 'Toolkit/Forms/templates/tables/';
- $this->dbh = Toolkit_Database::getInstance();
-
- $GLOBALS['styleSheets'][] = BASE_URL . 'contactform.css';
-
- $GLOBALS['scripts'][]
- = GLM_APP_BASE_URL . 'libjs/contactform-1.1.js';
- }
-
- // }}}
-
- // {{{ addCharLimit()
-
- /**
- * adds a maxlength character limitation to an element
- *
- * @param string $element The name of the element to add
- * the char limit to
- * @param integer $limit The number of characters allowed
- *
- * @return void
- * @access public
- */
- public function addCharLimit($element, $limit)
- {
- $this->addRule(
- $element,
- "ERROR: $limit characters max!",
- 'maxlength',
- $limit,
- 'server'
- );
- // Add a maxlength attribute to the field on the form
- // which will help prevent users from sending over 100 chars
- // to the server in the first place.
- if ($this->getElementType($element) == 'text') {
- $e =& $this->getElement($element);
- $e->setMaxLength($limit);
- }
- }
-
- // }}}
- // {{{ apiVersion()
-
- /**
- * Returns the current FormBuilder API version
- *
- * @since 1.10
- * @access public
- * @return float
- */
- public function version()
- {
- return 1.1;
- }
-
- // }}}
-
- // {{{ checkDateInput()
-
- /**
- * Checks the validation of a m-d-Y date
- *
- * This function will only be called if the autoValidateDateElements
- * property is set to true.
- *
- * @param array $value Date element from form.
- *
- * @return boolean
- * @access public
- * @see Toolkit_FormBuilder->autoValidateDateElements
- */
- public function checkDateInput($value)
- {
- if ( empty($value['m'])
- || empty($value['d'])
- || empty($value['Y'])
- ) {
- return false;
- }
- return checkdate($value['m'], $value['d'], $value['Y']);
- }
-
- // }}}
- // {{{ cleanElements()
-
- /**
- * Removes elements from form
- *
- * Loops through elements and if any names end in '_rmv' they are removed
- * from the form object.
- *
- * Dynamically finds all elements on a form and removes any that
- * end in '_rmv'. This can be really usefull if you want to display
- * from results after the form was successfully submitted and validated,
- * but don't need to display any extra form elements initially displayed
- * on the form (like email confirmation fields, or static instruction
- * elements).
- *
- * @param array $elements Form elements.
- *
- * @return void
- * @access protected
- */
- protected function cleanElements($elements)
- {
- if (is_array($elements)) {
- foreach ($elements as $e) {
- if ($e['type'] == 'group') {
- $this->cleanGroup($e['name']);
- } elseif (preg_match('/^.+_rmv$/', $e['name'])) {
- $this->removeElement($e['name']);
- }
- }
- }
- }
-
- // }}}
- // {{{ cleanForm()
-
- /**
- * Removes elements from form
- *
- * Dynamically finds all elements on a form and removes any that
- * end in '_rmv'. This can be really usefull if you want to display
- * from results after the form was successfully submitted and validated,
- * but don't need to display any extra form elements initially displayed
- * on the form (like email confirmation fields, or static instruction
- * elements).
- *
- * @return void
- * @access protected
- */
- protected function cleanForm()
- {
- $formArray = $this->toArray();
- if (array_key_exists('sections', $formArray)) {
- foreach ($formArray['sections'] as $k) {
- if (preg_match('/^.+_rmv$/', $k['name'])) {
- $this->removeElement($k['name']);
- }
- $this->cleanElements($k['elements']);
- }
- } else {
- $this->cleanElements($formArray['elements']);
- }
- }
-
- // }}}
- // {{{ cleanGroup()
-
- /**
- * Removes any elements from a group that have names that end in '_rmv'
- *
- * @param string $name The name of the group element
- *
- * @return void
- * @access protected
- */
- protected function cleanGroup($name)
- {
- $e =& $this->getElement($name);
- $g =& $e->getElements();
- $i = 0;
- while ($name = $e->getElementName($i++)) {
- if (preg_match('/^.+_rmv/', $name)) {
- unset($g[($i - 1)]);
- }
- }
- }
-
- // }}}
- // {{{ createGridElement()
-
- /**
- * Creates a grid element for the form
- *
- * Written so this can be overridden easily in subclasses later if needed!
- *
- * @param string $elementType QuickForm ElementGrid element definition
- *
- * @return mixed ElementGrid element.
- * @access protected
- */
- protected function &createGridElement($elementType)
- {
- $args = func_get_args();
- return call_user_func_array(array($this, 'createElement'), $args);
-
- }
-
- // }}}
-
- // {{{ prepElement()
-
- /**
- * Make sure all the element array indexes are set
- *
- * @param array &$e Element to prep
- *
- * @return void
- * @access protected
- */
- protected function prepElement(&$e)
- {
- if (!isset($e['opts'])) {
- $e['opts'] = '';
- }
- if (!isset($e['att'])) {
- $e['att'] = '';
- }
- if (!isset($e['val'])) {
- $e['val'] = '';
- }
- if (!isset($e['display'])) {
- $e['display'] = '';
- }
- if (!isset($e['label'])) {
- $e['label'] = '';
- }
- if (!isset($e['noCharLimit'])) {
- $e['noCharLimit'] = false;
- }
- }
-
- // }}}
-
- // {{{ registerRules()
-
- /**
- * Registers custom form rules you can use when validating
- *
- * If the registeredRule token is an array, any QF rule can be
- * registered. This is useful if you want to register rules
- * from outside classes
- * e.g. (Validate, Validate_US, Validate_CA, etc...).
- *
- * This will set up a rule called 'checkEmail' which uses the
- * Validate::email() function.
- * you can still pass in parameters to this rule if you pass them in
- * via the 'format' option when you are defining your rules.
- *
- * class exampleClass
- * {
- * $registeredRules = array(
- * array(
- * 'checkEmail',
- * 'callback',
- * 'email',
- * 'Validate'
- * )
- * );
- *
- * // ... Rest of your class code
- *
- * public function configureRules()
- * {
- * $r = array();
- *
- * $r[] = array(
- * 'element' => 'process_email',
- * 'message' => 'ERROR: Invalid email format!',
- * 'type' => 'checkEmail',
- * 'format' => array('use_rfc822' => true),
- * 'validation' => $this->validationType,
- * 'reset' => false,
- * 'force' => false
- * );
- *
- * $this->setupRules($r);
- * }
- *
- * // ... Rest of your class code
- * }
- *
- *
- * If the registeredRule is a string, the corresponding rule in the
- * glmPEAR/HTML/QuickForm/Rule/ directory will be registered with
- * the form.
- *
- * This will set up the 'phone' rule already defined in the
- * glmPEAR/HTML/QuickForm/Rule directory which validates both
- * US and Canadian phone numbers
- *
- * class exampleClass
- * {
- * $registeredRules = array('phone');
- *
- * // ... Rest of your class code
- *
- * public function configureRules()
- * {
- * $r = array();
- *
- * $r[] = array(
- * 'element' => 'phone',
- * 'message' => 'ERROR: Invalid number (xxx) xxx-xxxx!',
- * 'type' => 'phone',
- * 'format' => null,
- * 'validation' => $this->validationType,
- * 'reset' => false,
- * 'force' => false
- * );
- *
- * $this->setupRules($r);
- * }
- *
- * // ... Rest of your class code
- * }
- *
- *
- * @return void
- * @access protected
- */
- protected function registerRules()
- {
- if (is_array($this->registeredRules)) {
- foreach ($this->registeredRules as $r) {
- if (is_array($r)) {
- call_user_func_array(array(&$this, 'registerRule'), $r);
- } else {
- // Don't nedd to register rules more than once
- if (!$this->isRuleRegistered($r)) {
- $this->registerRule($r, null, "HTML_QuickForm_Rule_$r");
- }
- }
- }
- }
- }
-
- // }}}
-
- // {{{ setAutoValidateDateElements()
-
- /**
- * Set if we need to auto validate the Date Elements
- *
- * @param boolean $validate true/false to auto validate date elements
- *
- * @return void
- * @access public
- */
- public function setAutoValidateDateElements($validate)
- {
- $this->autoValidateDateElements = $validate;
- }
-
- // }}}
- // {{{ setFormData()
-
- /**
- * Sets the submitted values from the form
- *
- * Set these values into an internal variable so they will be accessible
- * anywhere we need them in the form.
- *
- * @param array $exclude (optional) Any element names you don't want
- * included. Since this is primarily used in
- * emailing, this is helpful to exclude any data
- * we don't want before the array is generated.
- *
- * @return void
- * @access protected
- */
- protected function setFormData(array $exclude = array())
- {
- $values = $this->getSubmitValues();
- foreach ($values as $k => $v) {
- if ($this->elementExists($k)) {
- $e =& $this->getElement($k);
- if (!in_array($e->getName(), $exclude)) {
- switch ($e->getType()) {
- case 'date' :
- list($m, $d, $y) = array_values($e->getValue());
- // If all the date fields are empty, then don't add
- // the output to the formData.
- if (!(empty($m[0]) && empty($d[0]) && empty($y[0]))) {
- $this->formData[$e->getName()]['label']
- = $e->getLabel();
-
- $oldDate = $e->getValue();
- $newDate = Toolkit_Common::arrayFlatten(
- $oldDate,
- 0,
- $newDate
- );
-
- $this->formData[$e->getName()]['element']
- = implode(' / ', $newDate);
- unset($oldDate, $newDate);
- }
- break;
-
- case 'group':
- $e->freeze();
- $this->formData[$e->getName()]['label'] = $e->getLabel();
- $this->formData[$e->getName()]['element'] = $e->toHtml();
- break;
-
- case 'select' :
- $this->formData[$e->getName()]['label'] = $e->getLabel();
-
- $values = $e->getValue();
- foreach ($values as $v) {
- $this->formData[$e->getName()]['element'] .= $v;
- }
- break;
-
- default :
- $this->formData[$e->getName()]['label'] = $e->getLabel();
- $this->formData[$e->getName()]['element'] = $e->getValue();
- break;
- }
- }
- }
- }
- }
-
- // }}}
- // {{{ setupConstants()
-
- /**
- * Sets the form constant values
- *
- * @param array $constants Associative array of form constant values.
- *
- * @return void
- * @access protected
- */
- protected function setupConstants($constants)
- {
- $this->setConstants($constants);
- }
-
- // }}}
- // {{{ setupDefaults()
-
- /**
- * Sets the form default values
- *
- * @param array $defaults Associative array of form default values.
- *
- * @return void
- * @access protected
- */
- protected function setupDefaults($defaults)
- {
- $this->setDefaults($defaults);
- }
-
- // }}}
- // {{{ setupElements()
-
- /**
- * Sets up all the elements to the form
- *
- * Takes a multi-dimensional array of form elements and uses them
- * to set up the form objects elements
- *
- * @param array $elements Multi-Dimensional array of form elements.
- *
- * @return void
- * @access protected
- */
- protected function setupElements($elements)
- {
- if (!is_array($elements)) {
- return;
- }
- foreach ($elements as &$e) {
- $this->prepElement($e);
- switch ($e['type']) {
- case 'group' :
- if (is_array($e['group']) && !empty($e['group'])) {
- // Special rendering for grouped elements.
- unset($field);
- foreach ($e['group'] as $g) {
- $this->prepElement($g);
- $field[] =& HTML_QuickForm::createElement(
- $g['type'],
- $g['name'],
- $g['display'],
- $g['opts'],
- $g['att'],
- $g['val']
- );
- }
- $source =& $this->addGroup(
- $field,
- $e['name'],
- $e['label'],
- $e['seperator'],
- $e['appendName']
- );
- }
- break;
-
- case 'elementGrid' :
- $source =& $this->addElement(
- $e['type'],
- $e['name'],
- $e['display'],
- $e['opts'],
- $e['att'],
- $e['val']
- );
- unset($columnNames);
-
- // Loop through the rows (r) and columns (c)
- // to add each of the elements to our grid.
- foreach ($e['group'] as $k => $r) {
- unset($set, $rowTitle);
- foreach ($r as $c) {
- $columnNames[$c['display']] = $c['display'];
-
- $set[] =& $this->createGridElement(
- $c['type'],
- $c['name'],
- null,
- $c['opts'],
- $c['att']
- );
- }
- $rowTitle = is_int($k) ? ' ' : $k;
- $source->addRow(&$set, $rowTitle);
- }
-
- $source->setColumnNames($columnNames);
- break;
-
- default :
- // Render all elements except groups
- try {
- $source =& $this->addElement(
- $e['type'],
- $e['name'],
- $e['display'],
- $e['opts'],
- $e['att'],
- $e['val']
- );
-
- if (PEAR::isError($source)) {
- throw new Exception ('PEAR QuickForm Element Error');
- }
- } catch (HTML_QuickForm_Error $e) {
- Toolkit_Common::dieGracefully(null, $e);
- } catch (Exception $e) {
- Toolkit_Common::handleError($e);
- }
-
- if ($e['type'] == 'advmultiselect') {
- $source->setLabel($e['labels']);
- }
- if ($e['name'] == 'categories') {
- $res = $source->loadArray($this->categories);
- if (PEAR::isError($res)) {
- Toolkit_Common::dieGracefully(null, $res);
- }
- }
- if ($e['type'] == 'header') {
- $this->formHeaders[$e['display']] = $e;
- }
-
- if ($e['name'] == 'captcha_rmv') {
- $this->captchaAnswer =& $source;
- }
-
- if ($e['name'] == 'captcha_question') {
- $this->captchaQuestion =& $source;
- }
- break;
- }
- }
- $this->formElements = $elements;
- }
-
- // }}}
- // {{{ setupFilters()
-
- /**
- * Sets any filters needed for the form elements when submitting
- *
- * @param array $filters Element filters.
- *
- * @return void
- * @access protected
- */
- protected function setupFilters($filters)
- {
- foreach ($filters as $f) {
- $res = $this->applyFilter($f['element'], $f['filter']);
-
- if (PEAR::isError($res)) {
- Toolkit_Common::handleError($res);
- }
- }
- }
-
- // }}}
- // {{{ setupRules()
-
- /**
- * Apply rules to the form
- *
- * 100 & 1000 char length limitations are automatically assigned to
- * text/textarea elements to help reduce load limitations on the server.
- * -request per Chuck in a conference call on (5/22/2009 @ 12:15pm)
- *
- * Applies rules that are defined in child classes to the form elements
- * group rules can be kind of tricky, since you can't apply a rule
- * directly to an element inside of a rule you have to define
- * the rule inside a nest of array's and then add a group rule.
- * the array will contain all the elements inside the group you wish
- * to apply rules to.
- *
- * You can assign as many rules as you would like to individual elements,
- * and you aren't required to make the array associative, although it is
- * easier to see whats going on.
- *
- * see: http://pear.activeventure.com/package/package.html.html-quickform.html-quickform.addgrouprule.html
- * for another example.
- *
- * // Define the rules for each element in the group.
- * $num_rule = array(
- * 'ERROR: Must contain a valid decimal number!',
- * 'numeric'
- * );
- * // Collect together the rules for each element.
- * $lat_rules = array('lat' => array($num_rule));
- * $lon_rules = array('lon' => array($num_rule));
- * $r[] = array(
- * 'element' => 'latitude',
- * 'message' => 'ERROR:',
- * 'type' => 'group',
- * 'format' => $lat_rules,
- * 'validation' => $this->validationType,
- * 'reset' => false,
- * 'force' => false
- * );
- *
- *
- * To make a group required but not require every element in the group
- * you can use the addGroupRule function again
- * for example: say you have a group of checkboxes and you only only
- * require 1 be checked. a simple group rule such as the following
- * will handle this.
- * N.B. notice the extra "howMany" index.
- *
- * $r[] = array(
- * 'element' => 'element_name',
- * 'message' => 'ERROR: Error to display!',
- * 'type' => 'required',
- * 'format' => null,
- * 'howMany' => 1,
- * 'validation'=> $this->validationType,
- * 'reset' => true,
- * 'force' => false,
- * );
- *
- *
- * @param array $rules Multi-Dimensional array of rules for form elements.
- *
- * @return void
- * @access protected
- */
- protected function setupRules(array $rules = null)
- {
- $this->registerRules();
- $preRegisteredRules = $this->getRegisteredRules();
- if (is_array($this->formElements)) {
- foreach ($this->formElements as $e) {
- // Put length limitations on text and textarea fields
- if ($e['type'] == 'text' && !$e['noCharLimit']) {
- $this->addCharLimit($e['name'], 100);
- } elseif ($e['type'] == 'textarea' && !$e['noCharLimit']) {
- $this->addCharLimit($e['name'], 1000);
- } elseif ($e['type'] == 'group') {
- // We need to apply these same limitations to the
- // text and textarea fields inside of groups
- $r = array();
- if (is_array($e['group'])) {
- foreach ($e['group'] as $i) {
- // Loop through group elements and if they are
- // text/textarea fields then put the field into
- // a rule array that we will assign to the group
- if ($i['type'] == 'text') {
- $r[$i['name']][] = array(
- 'ERROR: 100 characters max!',
- 'maxlength'
- );
- } elseif ($i['type'] == 'textarea') {
- $r[$i['name']][] = array(
- 'ERROR: 1000 characters max!',
- 'maxlength'
- );
- }
- }
- }
- if (!empty($r)) {
- $this->addGroupRule($e['name'], $r);
- }
- }
- if ($this->validationType == 'client') {
- $label = $e['display'];
- }
- if ($e['req']) {
- if ($e['type'] == 'group') {
- foreach ($e['group'] as $ge) {
- if ($ge['req']) {
- $rule[$ge['name']][] = array(
- 'ERROR: You must complete this field!',
- 'required',
- null,
- $this->validationType);
- }
- }
- $this->addGroupRule($e['name'], $rule);
- unset($rule);
- } elseif ($e['type'] == 'date') {
- if (!empty($e['error'])) {
- // Custom error message for the date element.
- $error = $e['error'];
- } else {
- // Default error message for the date element.
- $error = 'ERROR: You must enter a date!';
- }
- $this->addGroupRule(
- $e['name'],
- $error,
- 'required',
- 3,
- $this->validationType
- );
- if ($this->autoValidateDateElements) {
- $this->addRule(
- $e['name'],
- 'ERROR: Date is invalid!',
- 'callback',
- array(&$this, 'checkDateInput')
- );
- }
- } else {
- $this->addRule(
- $e['name'],
- "$label ERROR: You must complete this field!",
- 'required',
- null,
- $this->validationType
- );
- }
- }
- }
- }
- if (is_array($rules)) {
- foreach ($rules as $r) {
- if (!is_array($r['element'])) {
- $group = ($this->getElementType($r['element']) == 'group');
- }
- if ($group) {
- $this->addGroupRule(
- $r['element'],
- $r['message'],
- $r['type'],
- $r['format'],
- $r['howMany'],
- $r['validation'],
- $r['reset']
- );
- } elseif (in_array($r['type'], $preRegisteredRules)) {
- $this->addRule(
- $r['element'],
- $r['message'],
- $r['type'],
- $r['format'],
- $r['validation'],
- $r['reset'],
- $r['force']
- );
- }
- }
- }
- }
-
- // }}}
- // {{{ setupRenderers()
-
- /**
- * Sets up renderers for form objects
- *
- * Uses the default form renderer to allow templates to be injected
- * into the form object before displaying on a page. This allows
- * changing the face of the form w/ out any backend adjustment.
- *
- * Files that can be created for templates are
- *
- * Examples:
- * # Element.tpl
- *
- *
- *
- *
- * *
- *
- * {label}
- *
- *
- *
- * {error}
- *
- * {element}
- *
- *
- *
- *
- * # Form.tpl
- *
- *
- *
- *
- * # GroupElement.tpl
- *
- *
- *
- * {element}
- *
- * *
- *
- * {label}
- *
- *
- *
- *
- * # Group.tpl
- *
- *
- *
- * {content}
- *
- *
- *
- *
- * # Header.tpl
- *
- *
- *
- * {header}
- *
- *
- *
- *
- * # RequiredNote.tpl
- *
- * * Denotes required field
- *
- *
- * @param array $groups any groups that need to be rendered
- * via the groupElementTemplate and groupTemplate
- *
- * @return void
- * @access protected
- */
- protected function setupRenderers(array $groups = array())
- {
- if (is_dir($this->template)) {
- if ($dh = opendir($this->template)) {
- while (($file = readdir($dh)) !== false) {
- // Ignore current dir and parent dir.
- if ($file != '..' && $file != '.' && $file != 'CVS') {
- $baseName = reset(explode('.', $file));
- // Ignores swp files.
- if (!empty($baseName)) {
- $method = "set{$baseName}Template";
- $template = file_get_contents($this->template . $file);
- $renderer =& $this->defaultRenderer();
- if ( $method != 'setGroupTemplate'
- && $method != 'setGroupElementTemplate'
- ) {
- if (method_exists($renderer, $method)) {
- $renderer->$method($template);
- }
- } else {
- // apply the templates to any defined groups
- foreach ($groups as $k) {
- $renderer->$method($template, $k);
- }
- }
- }
- }
- }
- closedir($dh);
- }
- }
- }
-
- // }}}
- // {{{ useCaptcha()
-
- /**
- * Set if we need to use a captcha in this form or not
- *
- * @param boolean $useCaptcha true/false to use a captcha with the form
- *
- * @return void
- * @access public
- */
- public function useCaptcha($useCaptcha)
- {
- $this->useClueTip();
- $this->useCaptcha = $useCaptcha;
- }
-
- // }}}
- // {{{ useClueTip()
-
- /**
- * Set if we need to use the JS cluetip
- *
- * @param boolean $useCaptcha include cluetip resources or not
- *
- * @return void
- * @access public
- */
- public function useClueTip()
- {
- $GLOBALS['styleSheets'][]
- = GLM_APP_BASE_URL . 'libjs/cluetip/jquery.cluetip.css';
- $GLOBALS['scripts'][]
- = GLM_APP_BASE_URL . 'libjs/cluetip/jquery.cluetip.js';
- $GLOBALS['scripts'][]
- = GLM_APP_BASE_URL . 'libjs/cluetip/lib/jquery.hoverIntent.js';
- $GLOBALS['scripts'][]
- = GLM_APP_BASE_URL . 'libjs/cluetip/lib/jquery.bgiframe.min.js';
- }
-
- // }}}
- // {{{ show()
-
- /**
- * Shows the form
- *
- * @return void
- * @access public
- */
- public function show()
- {
- Toolkit_Common::show();
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/Forms/Rules/Date.php b/Toolkit/Forms/Rules/Date.php
deleted file mode 100644
index 8b899a3..0000000
--- a/Toolkit/Forms/Rules/Date.php
+++ /dev/null
@@ -1,64 +0,0 @@
- '%m-%d-%Y') is the default
- *
- * @param string $value the date array to validate
- * @param array $options options used to dictate validation of the date
-
- * @return bool if the string could correctly be validated as a date.
- * @access public
- * @see Validate::date()
- */
- function validate($value, array $options)
- {
- $month = !isset($options['group'])
- ? $value['m']
- : $value[$options['group']]['m'];
- $day = !isset($options['group'])
- ? $value['d']
- : $value[$options['group']]['d'];
- $year = !isset($options['group'])
- ? $value['Y']
- : $value[$options['group']]['Y'];
-
- if (isset($options['allowEmpty'])
- && $options['allowEmpty']
- && empty($month)
- && empty($day)
- && empty($year)
- ) {
- return true;
- }
-
- unset($options['group'], $options['allowEmpty']);
-
- $day = str_pad($day, 2, '0', STR_PAD_LEFT);
- $month = str_pad($month, 2, '0', STR_PAD_LEFT);
-
- return Validate::date("$month-$day-$year", $options);
- }
-
- function getValidationScript($options = null)
- {
- return array('', true);
- }
-}
-
-HTML_QuickForm::registerRule(
- 'Date',
- 'rule',
- 'Toolkit_Forms_Rules_Date',
- BASE . 'Toolkit/Forms/Rules/Date.php'
-);
-?>
diff --git a/Toolkit/Forms/templates/tables/Element.tpl b/Toolkit/Forms/templates/tables/Element.tpl
deleted file mode 100644
index 595457b..0000000
--- a/Toolkit/Forms/templates/tables/Element.tpl
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
- *
-
- {label}
-
-
-
- {error}
-
- {element}
-
-
diff --git a/Toolkit/Forms/templates/tables/Form.tpl b/Toolkit/Forms/templates/tables/Form.tpl
deleted file mode 100644
index 09f344b..0000000
--- a/Toolkit/Forms/templates/tables/Form.tpl
+++ /dev/null
@@ -1,7 +0,0 @@
-
diff --git a/Toolkit/Forms/templates/tables/Group.tpl b/Toolkit/Forms/templates/tables/Group.tpl
deleted file mode 100644
index cdd24cf..0000000
--- a/Toolkit/Forms/templates/tables/Group.tpl
+++ /dev/null
@@ -1,5 +0,0 @@
-
diff --git a/Toolkit/Forms/templates/tables/GroupElement.tpl b/Toolkit/Forms/templates/tables/GroupElement.tpl
deleted file mode 100644
index 1a4ba27..0000000
--- a/Toolkit/Forms/templates/tables/GroupElement.tpl
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
- {element}
-
- *
-
- {label}
-
-
diff --git a/Toolkit/Forms/templates/tables/Header.tpl b/Toolkit/Forms/templates/tables/Header.tpl
deleted file mode 100644
index 64ac244..0000000
--- a/Toolkit/Forms/templates/tables/Header.tpl
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- {header}
-
-
diff --git a/Toolkit/Forms/templates/tables/RequiredNote.tpl b/Toolkit/Forms/templates/tables/RequiredNote.tpl
deleted file mode 100644
index 525ef33..0000000
--- a/Toolkit/Forms/templates/tables/RequiredNote.tpl
+++ /dev/null
@@ -1 +0,0 @@
-* Denotes required field
diff --git a/Toolkit/INavigation.php b/Toolkit/INavigation.php
deleted file mode 100644
index 9e8f4cf..0000000
--- a/Toolkit/INavigation.php
+++ /dev/null
@@ -1,12 +0,0 @@
-
diff --git a/Toolkit/Image/Server.php b/Toolkit/Image/Server.php
deleted file mode 100755
index 7056ef4..0000000
--- a/Toolkit/Image/Server.php
+++ /dev/null
@@ -1,370 +0,0 @@
-
- * @copyright 2008 Steve Sutton
- * @license Gaslight Media
- * @version CVS: $Id: Server.php,v 1.15 2009/09/29 18:37:48 matrix Exp $
- * @link http://demo.gaslightmedia.com
- */
-
-/**
- * Description for define
- */
-define('IS_VALIDATE_SECRET', 'Glm0IS1secreT');
-
-/**
- * Description for define
- */
-define('IS_SUBMIT_URL', 'is0.gaslightmedia.com/submit.phtml');
-
-/**
- * Toolkit_Image_Server
- *
- * Class for implementation of the image server process Chuck has
- * setup for is0.gaslightmedia.com
- * Uses Curl PHP Library to upload images to the server
- *
- * @category Images
- * @package Toolkit_Image
- * @author Steve Sutton
- * @copyright 2008 Steve Sutton
- * @license Gaslight Media
- * @link http://demo.gaslightmedia.com
- */
-class Toolkit_Image_Server
-{
- // {{{ properties
-
- /**
- * OwnerID for the Image Server User
- * @var string
- * @access protected
- */
- protected $OwnerID;
-
- /**
- * Owner Password
- * @var string
- * @access protected
- */
- protected $OwnerPW;
-
- /**
- * DOMDocument Object
- * @var unknown
- * @access protected
- */
- protected $xml;
-
- // }}}
-
- // {{{ __construct()
-
- /**
- * __construct
- *
- * @return void
- * @access public
- */
- function __construct()
- {
- $this->OwnerID = IS_OWNER_ID;
- $this->OwnerPW = IS_OWNER_PW;
- }
-
- // }}}
-
- // {{{ buildImageServerXML()
-
- /**
- * buildImageServerXML
- *
- * Create the xml for the FileServerRequest
- *
- * @param string $fileName File to upload or delete
- * @param unknown $type Upload or Delete
- *
- * @return string xml content
- * @access public
- */
- function buildImageServerXML($fileName, $type)
- {
- $xml = new DOMDocument('1.0');
- $xml->formatOutput = true;
- $FileServerRequest = $xml->createElement('FileServerRequest');
- $FileServerRequest->setAttribute('version', '1.0');
- // AccessRequest part
- $AccessRequest = $xml->createElement('AccessRequest');
- $Owner = $xml->createElement('Owner');
- $OwnerID = $xml->createElement('OwnerID', $this->OwnerID);
- $OwnerPW = $xml->createElement('OwnerPW', $this->OwnerPW);
- $Owner->appendChild($OwnerID);
- $Owner->appendChild($OwnerPW);
- $AccessRequest->appendChild($Owner);
- $FileServerRequest->appendChild($AccessRequest);
- // file part
- $File = $xml->createElement('File');
- switch ($type) {
- case "Upload":
- $FileAction = $xml->createElement('FileAction', 'Submit');
- $DeliveryMethod = $xml->createElement('DeliveryMethod', 'Submit');
- $FieldName = $xml->createElement('FieldName', 'file_upload');
- $File->appendChild($FileAction);
- $File->appendChild($DeliveryMethod);
- $File->appendChild($FieldName);
- $FileServerRequest->appendChild($File);
- $size = filesize($_FILES[$fileName]['tmp_name']);
- $validStr = md5($this->OwnerID.$this->OwnerPW.IS_VALIDATE_SECRET);
- break;
- case "URL":
- $FileAction = $xml->createElement('FileAction', 'Submit');
- $DeliveryMethod = $xml->createElement('DeliveryMethod', 'URL');
- $Src = $xml->createElement('Src', $fileName);
- $File->appendChild($FileAction);
- $File->appendChild($DeliveryMethod);
- $File->appendChild($Src);
- $FileServerRequest->appendChild($File);
- $size = strlen($fileName);
- $validStr = md5($this->OwnerID.$this->OwnerPW.IS_VALIDATE_SECRET);
- break;
- case "Delete":
- $FileAction = $xml->createElement('FileAction', 'Delete');
- $File->appendChild($FileAction);
- $FileName = $xml->createElement('FileName', $fileName);
- $File->appendChild($FileName);
- $FileServerRequest->appendChild($File);
- $validStr = md5($this->OwnerID.$this->OwnerPW.IS_VALIDATE_SECRET);
- break;
- }
- // validation part
- $Validation = $xml->createElement('Validation', $validStr);
- $FileServerRequest->appendChild($Validation);
- $xml->appendChild($FileServerRequest);
- return $xml->saveXML($xml);
- }
-
- // }}}
-
- // {{{ imageDelete()
-
- /**
- * imageDelete
- *
- * Delete an image from the image server
- *
- * @param unknown $name Image name
- *
- * @return unknown image name
- * @access public
- */
- function imageDelete($name)
- {
- if ($name) {
- $request = $this->buildImageServerXML($name, 'Delete');
- $ch = curl_init();
- $fileData = array(
- 'request' => $request
- );
- $curlOptions = array(
- CURLOPT_URL => IS_SUBMIT_URL,
- CURLOPT_HEADER => 0,
- CURLOPT_RETURNTRANSFER => 1,
- CURLOPT_POSTFIELDS => $fileData
- );
- curl_setopt_array($ch, $curlOptions);
-
- $response = curl_exec($ch);
- curl_close($ch);
- $xmlDoc = new DOMDocument;
- $response = str_replace("", "", $response);
- $xmlDoc->loadXML($response);
- $SuccessCode = $this->xmlPathContent(
- $xmlDoc,
- '/FileServerResponse/ReplyStatus/SuccessCode'
- );
- $Message = $this->xmlPathContent(
- $xmlDoc,
- '/FileServerResponse/ReplyStatus/Message'
- );
- $Owner = $this->xmlPathContent(
- $xmlDoc,
- '/FileServerResponse/File/Owner'
- );
- $StoredName = $this->xmlPathContent(
- $xmlDoc,
- '/FileServerResponse/File/StoredName'
- );
- $StoredSize = $this->xmlPathContent(
- $xmlDoc,
- '/FileServerResponse/File/StoredSize'
- );
- $MediaType = $this->xmlPathContent(
- $xmlDoc,
- '/FileServerResponse/File/MediaType'
- );
- return $Message;
- }
- }
-
- // }}}
- // {{{ imageUpload()
-
- /**
- * imageUpload
- *
- * Upload image to server
- *
- * @param string $name Form field name of image
- *
- * @return string Image name
- * @access public
- */
- function imageUpload($name)
- {
- $fileType = null;
- if (preg_match("/^http/", $name)) {
- $fileType = 'URL';
- } elseif (is_array($_FILES[$name])) {
- $fileType = 'Upload';
- }
- if ($fileType) {
- $request = $this->buildImageServerXML($name, $fileType);
- $ch = curl_init();
- if ($fileType == "URL") {
- $fileData = array(
- 'request' => $request
- );
- } else {
- $fileData = array(
- 'request' => $request,
- 'file_upload' => '@'.$_FILES[$name]['tmp_name'],
- 'file_upload_name' => $_FILES[$name]['name']
- );
- }
- $curlOptions = array(
- CURLOPT_URL => IS_SUBMIT_URL,
- CURLOPT_HEADER => 0,
- CURLOPT_RETURNTRANSFER => 1,
- CURLOPT_POSTFIELDS => $fileData
- );
- curl_setopt_array($ch, $curlOptions);
-
- $response = curl_exec($ch);
- curl_close($ch);
- $xmlDoc = new DOMDocument;
- $response = str_replace("", "", $response);
- $xmlDoc->loadXML($response);
- $SuccessCode = $this->xmlPathContent(
- $xmlDoc,
- '/FileServerResponse/ReplyStatus/SuccessCode'
- );
- $Message = $this->xmlPathContent(
- $xmlDoc,
- '/FileServerResponse/ReplyStatus/Message'
- );
- $Owner = $this->xmlPathContent(
- $xmlDoc,
- '/FileServerResponse/File/Owner'
- );
- $StoredName = $this->xmlPathContent(
- $xmlDoc,
- '/FileServerResponse/File/StoredName'
- );
- $StoredSize = $this->xmlPathContent(
- $xmlDoc,
- '/FileServerResponse/File/StoredSize'
- );
- $MediaType = $this->xmlPathContent(
- $xmlDoc,
- '/FileServerResponse/File/MediaType'
- );
- if ($SuccessCode != 0) {
- //throw new Exception('Image Server Error said:'.$response);
- throw new PEAR_Exception('Image Server Error said:'.$response);
- exit;
- }
- return $StoredName;
- }
- }
-
- // }}}
-
- // {{{ getImageSize()
-
- /**
- * getImageSize
- *
- * Return image data on an image from image server
- *
- * @param string $image Full URI to image
- * http://is0/userId/imageStyle/imageName
- * Must be a full URI including an authority.
- * No relative URIs, the // are mandatory
- *
- * @return array Image data 0 => width, 1 => height, 2 => html
- * @access public
- * @throws PEAR Error
- */
- function getImageSize($image)
- {
- $options = array('allowed_schemes' => array('http'));
- if (!Validate::uri($image, $options)) {
- throw new PEAR_Exception('Invalid URI for the image');
- exit;
- }
-
- $ch = curl_init();
- $curlOptions = array(
- CURLOPT_URL => "{$image}/info",
- CURLOPT_HEADER => 0,
- CURLOPT_RETURNTRANSFER => 1,
- CURLOPT_POSTFIELDS => $fileData
- );
- curl_setopt_array($ch, $curlOptions);
-
- $response = curl_exec($ch);
- curl_close($ch);
- $wPattern = "/(.*)<\/width>/";
- preg_match($wPattern, $response, $matches);
- $width = $matches[1];
- $hPattern = "/(.*)<\/height>/";
- preg_match($hPattern, $response, $matches);
- $height = $matches[1];
- $html = "width=\"{$width}\" height=\"{$height}\"";
- return array($width, $height, $html);
- }
-
- // }}}
-
- // {{{ xmlPathContent()
-
- /**
- * xmlPathContent
- *
- * Grab the content given XPath Query
- *
- * @param unknown $dom DOMDocument nodelist
- * @param unknown $content query for XPath
- *
- * @return object string of node
- * @access public
- */
- function xmlPathContent($dom, $content)
- {
- $xPath = new DOMXPath($dom);
- $nodelist = $xPath->query($content);
- foreach ($nodelist as $entry) {
- return $entry->nodeValue;
- }
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/Logger.php b/Toolkit/Logger.php
deleted file mode 100644
index 8b4b26f..0000000
--- a/Toolkit/Logger.php
+++ /dev/null
@@ -1,117 +0,0 @@
-
- * @copyright 2010 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @version CVS: $Id: Logger.php,v 1.3 2010/01/29 11:48:47 jamie Exp $
- * @link <>
- * @see Log
- */
-
-/**
- * Logging class used to handle system logs
- */
-require_once 'Log.php';
-
-/**
- * Error handling logger for system
- *
- * @category Logger
- * @package Toolkit_Logger
- * @author Jamie Kahgee
- * @copyright 2010 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @version Release: @package_version@
- * @link <>
- * @see Log
- */
-class Toolkit_Logger
-{
-
- /**
- * Gets a concrete log subclass based on constant parameters set for server
- *
- * Define parameters in server setup block of bootstrap file
- *
- * @return Log concrete Log subclass
- * @access public
- * @static
- */
- public static function &getLogger()
- {
- $errorLogName = (ERROR_LOG_NAME != '') ? constant(ERROR_LOG_NAME) : '';
-
- $logger =& Log::singleton(
- ERROR_LOG_TYPE,
- $errorLogName,
- ERROR_LOG_IDENT,
- $GLOBALS['ERROR_LOG_CONF'],
- constant(ERROR_LOG_LEVEL)
- );
-
- return $logger;
- }
-
- /**
- * User-defined error handler function
- *
- * handles errors in script. E_ERROR, E_WARNING, E_NOTICE are automatically
- * logged when they occur. Fatal errors (E_ERROR) have a 404 page shown to
- * user so script doesn't halt.
- *
- * @param int $errno Level of the error rasied
- * @param string $errstr Error message
- * @param string $errfile Filename that the error was raised in
- * @param int $errline Line number the error was raised at
- * @param Log $logger Logger to user for error loggin
- *
- * @return boolean false, allows the normal error handler to continue
- * @access public
- * @static
- */
- public static function errorHandler(
- $errno,
- $errstr,
- $errfile,
- $errline,
- $logger = null
- ) {
- if (!($logger instanceof Log)) {
- $logger =& self::getLogger();
- }
-
- switch ($errno) {
- case E_ERROR :
- case E_USER_ERROR :
- $logger->emerg($errstr. ' in ' . $errfile . ' at line ' . $errline, PEAR_LOG_EMERG);
- include BASE . '404.html';
- exit(1);
- break;
-
- case E_WARNING :
- CASE E_USER_WARNING :
- $logger->warning($errstr. ' in ' . $errfile . ' at line ' . $errline, PEAR_LOG_WARNING);
- break;
-
- case E_NOTICE :
- case E_USER_NOTICE :
- $logger->notice($errstr. ' in ' . $errfile . ' at line ' . $errline, PEAR_LOG_NOTICE);
- break;
-
- default :
- $logger->info($errstr. ' in ' . $errfile . ' at line ' . $errline, PEAR_LOG_INFO);
- break;
- }
-
- // return FALSE and let the normal error handler continue
- return false;
- }
-}
-?>
diff --git a/Toolkit/Navigation.php b/Toolkit/Navigation.php
deleted file mode 100644
index 0946b5e..0000000
--- a/Toolkit/Navigation.php
+++ /dev/null
@@ -1,58 +0,0 @@
-menu->setMenu($navStructure);
- $this->menu->setMenuType($type);
-
- $this->setCurrentIndex();
- $this->setNavTemplates();
-
- $this->menu->render($this->rEngine);
- return $this->rEngine->toHtml();
- }
-
- // }}}
- // {{{ setNavTemplates()
-
- abstract protected function setNavTemplates();
-
- // }}}
-}
-?>
diff --git a/Toolkit/Page.php b/Toolkit/Page.php
deleted file mode 100755
index abd3b3c..0000000
--- a/Toolkit/Page.php
+++ /dev/null
@@ -1,587 +0,0 @@
-
- * @copyright 2009 Gaslight Media
- * @license http://demo.gaslightmedia.com Gaslight Media
- * @version CVS: $Id: Page.php,v 1.61 2010/02/02 17:15:32 jamie Exp $
- * @link http://demo.gaslightmedia.com
- */
-
-/**
- * Page for Error Doc
- */
-define("ERROR_DOCUMENT", "404.html");
-
-/**
- * The home page template
- */
-define("HOME_TEMPLATE", "template.html");
-
-/**
- * inside page template
- */
-define("INSIDE_TEMPLATE", "template.html");
-
-/**
- * Template for the error doc
- */
-define("ERROR_DOCUMENT_TEMPLATE", "404-template.html");
-
-/**
- * page title default
- */
-define("PAGE_TITLE", "Gaslight Media Demo Site");
-
-
-/**
- * Toolkit_Page
- *
- * A class Object for use with merging into the flexy template for output.
- * Sets up the $page object used for merging with the flexy template
- * to output the toolbox and members admin content
- *
- * @category Toolkit
- * @package Toolkit_Page
- * @author Steve Sutton
- * @copyright 2009 Gaslight Media
- * @license http://demo.gaslightmedia.com Gaslight Media
- * @link http://demo.gaslightmedia.com
- */
-class Toolkit_Page
-{
- // {{{ Properties
-
- /**
- * used on img src and style href tags
- * @var $baseURL
- * @access public
- */
- public $baseURL;
-
- /**
- * meta tag description element
- * @var $metaTags
- * @access public
- */
- public $metaTags;
-
- /**
- * Array of scripts with absolute paths
- * @var $scripts array
- * @access public
- */
- public $scripts = array();
-
- /**
- * Array of style sheet with absolute paths
- * @var $styles array
- * @access public
- */
- public $styles = array();
-
- /**
- * title tag node
- * @var $title
- * @access public
- */
- public $title;
-
- /**
- * The main content of website
- * @var $toolboxContent
- * @access public
- */
- public $toolboxContent;
-
- // }}}
- // {{{ __construct()
-
- /**
- * __construct
- *
- * @param object $toolbox An instance of a valid GLM_TOOLBOX Object
- *
- * @return void
- * @access public
- */
- public function __construct(GLM_TEMPLATE $toolbox)
- {
- // determine the base url to use (for images and stylesheet urls)
- $this->baseURL
- = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')
- ? BASE_SECURE_URL
- : BASE_URL;
-
- if (isset($_GET['member_id']) && ctype_digit($_GET['member_id'])) {
- // Member profile pages can't have search page title tags
- $this->title = SITENAME;
- } else {
- // set the title of the page
- $this->title = $toolbox->title()
- ? $toolbox->title() . SITENAME
- : SITENAME;
- }
-
- // set the metaTags
- $this->metaTags = $toolbox->meta_tags();
-
- // determine the base url to use (for GLM_APP_BASE_URL)
- $this->glmAppBaseURL
- = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')
- ? BASE_SECURE_URL
- : GLM_APP_BASE_URL;
-
- // used in class
- $this->toolbox = $toolbox;
- $this->sitemapURL = $this->baseURL . 'site-map';
-
- // get top parent id if needed
- $topParent = $toolbox->get_top_parent($toolbox->catid);
-
- // true if on home page
- $this->isHomePage = (HOME_ID == $toolbox->catid);
-
- // pageTitle
- $this->pageTitle = $toolbox->get_catheader($topParent, $toolbox->DB);
- $this->pageTitleUrl = $toolbox->get_seo_url($topParent);
- $this->homePageUrl = $toolbox->get_seo_url(HOME_ID);
- $this->reservationUrl = 'http://reservations.troutcreek.com/irm/AccessType.ASP';
-
- $this->ownersSection = 'http://reservations.troutcreek.com/irm/AccessID.asp?AccessType=Owner';
-
-
- $this->specialsUrl = $toolbox->get_seo_url(4);
- $this->signUpUrl = $toolbox->get_seo_url(304);
- $this->videoUrl = $toolbox->get_seo_url(202);
-
- // Resources needed for every page.
- $GLOBALS['styleSheets'][] = $this->baseURL . 'styles.css';
- $GLOBALS['scripts'][]
- = $this->glmAppBaseURL . 'libjs/jquery-1.3.2.min.js';
- $GLOBALS['scripts'][] =
- $this->baseURL . 'libjs/external.js';
-
- // bread crumb navigation
- //$this->breadCrumbs = $toolbox->get_bread_crumbs($toolbox->catid);
-
- // main nav
- $this->mainNav = $toolbox->get_main_nav($topParent);
-
- // sideNav
- if ($toolbox->catid != HOME_ID) {
- $this->sideNav = $toolbox->get_side_nav($topParent);
- } else {
- $this->sideNav = '';
- }
-
- // check if define for HOME_EVENTS is set
- if (defined("HOME_EVENTS") && HOME_EVENTS && $toolbox->catid == HOME_ID) {
- $this->events($toolbox);
- }
-
- // check if define for HOME_HEADLINES is set
- if ( defined("HOME_HEADLINES")
- && HOME_HEADLINES
- && $this->isHomePage
- ) {
- $this->headlines($toolbox);
- }
-
- // check if define for HOME_NEWS is set
- if (defined("HOME_NEWS") && HOME_NEWS) {
- $this->news($toolbox);
- }
-
- // check if define for WEATHER is set
- if (defined("WEATHER") && WEATHER) {
- $this->hasWeather = true;
- $this->weather();
- }
-
- // check if define for GOOGLE_SEARCH is set
- if (defined("GOOGLE_SEARCH") && GOOGLE_SEARCH) {
- $this->googleSearch();
- }
-
- // check if define for BANNERS is set
- if (defined("BANNERS") && BANNERS) {
- $this->banners(&$toolbox);
- }
-
- if ( defined("ROTATING_IMAGES")
- && ROTATING_IMAGES
- && in_array($toolbox->catid, array(1))
- ) {
- $this->_rotatingImages();
- }
- }
-
- // }}}
-
- // {{{ _rotatingImages()
-
- private function _rotatingImages()
- {
- $nodesIterator = new Toolkit_RotatingImages_NodesIterator();
- $nodesIterator->findAll(Toolkit_Database::getInstance());
- $is = new Toolkit_Image_Server();
- $decorator = new Toolkit_RotatingImages_LiveDecorator();
- foreach ($nodesIterator as $v) {
- if ($v->getActive()) {
- if ($v instanceof Toolkit_RotatingImages_Anchor) {
- $nodeDecorator
- = new Toolkit_RotatingImages_AnchorDecorator($v);
- $decorator->add($nodeDecorator);
- } elseif ($v instanceof Toolkit_RotatingImages_Image) {
- $nodeDecorator
- = new Toolkit_RotatingImages_ImageDecorator($v);
- $decorator->add($nodeDecorator);
- }
- }
- }
-
- $this->rotatingImages = $decorator->getRotatingJavascript(
- Toolkit_Database::getInstance()
- );
- $this->rotatingImages .= $decorator->toHtml($is);
- }
-
- // }}}
-
- // {{{ banners()
-
- /**
- * Add Banner module
- *
- * @param unknown &$toolbox Toolbox object
- *
- * @return void
- * @access public
- */
- public function banners(&$toolbox)
- {
- $dbh = Toolkit_Database::getInstance();
- $banners =& Toolkit_Banners_BannersIterator::create('Bottom');
- if (defined('MEMBER_DB') && MEMBER_DB) {
- $categoriesIterator = Toolkit_Members_CategoriesIterator::create();
- $banners->fetchAllAvailable(
- $dbh,
- $categoriesIterator,
- $toolbox->catid
- );
- } else {
- $banners->fetchAllAssignedToPage($dbh, $toolbox->catid);
- }
-
- $availableBanners = $banners->getAvailable();
-
- // Are there any banners even available
- if (count($availableBanners)) {
- $decorators = Toolkit_Banners_RotatingBannersDecorator::create();
- foreach ($availableBanners as $i) {
- $decorator = Toolkit_Banners_HorizontalDecorator::create($i);
- $decorators->add($decorator);
- }
-
- $this->hasBanner = count($decorators->getIterator());
- $this->bannerAds = $decorators->toHtml(
- $dbh,
- new Toolkit_Image_Server(),
- $toolbox->catid
- );
- }
- }
-
- // }}}
-
- // {{{ createErrorDocument()
-
- /**
- * Create the error document page
- *
- * @return void
- * @access public
- */
- function createErrorDocument()
- {
- $this->baseURL = BASE_URL;
- $this->homeURL = $this->toolbox->get_seo_url(HOME_ID);;
- // Initiate HTML_Template_Flexy.
- $template = new HTML_Template_Flexy($GLOBALS['flexyOptions']);
-
- // Create a template object for the 404 content part
- $errorDocumentTemplate = new HTML_Template_Flexy($GLOBALS['flexyOptions']);
- $errorDocumentTemplate->compile(ERROR_DOCUMENT_TEMPLATE);
- $errorDocumentContents = $errorDocumentTemplate->bufferedOutputObject($this);
-
- // set defaults
- $this->toolboxContent = $errorDocumentContents;
- $this->title = '404 Not Found - '.PAGE_TITLE;
- $this->hasHeadlines = false;
- $this->hasAreaEvents = false;
- $this->hasNews = false;
- $this->sideNav = null;
- $this->mainNav = $this->toolbox->get_main_nav();
- $this->hasWeather = false;
- $this->isHomePage = false;
- $this->sitemapURL = false;
-
- // compile the flexy template
- $template->compile(INSIDE_TEMPLATE);
-
- // Merge compiled template with the object.
- $fileContents = $template->bufferedOutputObject($this);
- file_put_contents(BASE.ERROR_DOCUMENT, $fileContents);
- }
-
- // }}}
-
- // {{{ events()
-
- /**
- * Add Event module
- *
- * @param object $toolbox Toolbox object
- *
- * @return void
- * @access public
- */
- public function events($toolbox)
- {
- $events = new Toolkit_Events_Display(
- Toolkit_Database::getInstance()
- );
- $this->events = $events->getHomeEvents();
- $this->hasEvents = !empty($this->events);
- $this->eventsUrl = $toolbox->get_seo_url(EVENT_PAGE);
- $GLOBALS['scripts'][]
- = $this->glmAppBaseURL . 'libjs/plugins/cycle/2.73/jquery.cycle.all.min.js';
- $GLOBALS['scripts'][]
- = $this->baseURL . 'Toolkit/Events/libjs/eventRotate.js';
- $GLOBALS['styleSheets'][]
- = $this->baseURL . 'event.css';
- }
-
- // }}}
-
- // {{{ generateSiteMap()
-
- /**
- * Generate the site map page
- *
- * @return string HTML sitemap string
- * @access public
- */
- function generateSiteMap()
- {
- $WHERE = '';
- if (defined(MEMBERS_CATEGORY) && defined(MEMBERS_DB)) {
- $WHERE = "AND id != ".MEMBERS_CATEGORY;
- }
- $sql = "
- SELECT *
- FROM bus_category
- WHERE active = 't'
- $WHERE
- ORDER BY parent, pos";
-
- $data = $this->toolbox->DB->db_auto_get_data($sql);
- if (is_array($data)) {
- foreach ($data as $key => $val) {
- $threads[] = array(
- "id" => $val['id'],
- 'category' => strip_tags($val['category']),
- 'type' => $val['type'],
- 'parent' => $val['parent'],
- 'closed' => false);
- }
- }
- if (is_array($threads)) {
- $myThread = new Toolkit_SiteMap($this->toolbox);
- //sort threads by parent
- $converted = $myThread->sortChilds($threads);
- //print the threads
- $out .= $myThread->convertToThread($converted, $converted[0]);
- }
- return '
- '.$out.'
-
';
- }
-
- // }}}
-
- // {{{ getToolboxName($id)
-
- /**
- * grab the navigation name for the id
- *
- * @param integer $id id for bus_category table
- *
- * @return string page nav name
- * @access public
- */
- function getToolboxName($id)
- {
- return $this->toolbox->get_catheader($id, $this->toolbox->DB);
- }
-
- // }}}
- // {{{ getToolboxUrl($id)
-
- /**
- * grab the navigation url for the id
- *
- * @param integer $id id for bus_category table
- *
- * @return string url
- * @access public
- */
- function getToolboxUrl($id)
- {
- return $this->toolbox->get_seo_url($id);
- }
-
- // }}}
-
- // {{{ googleSearch()
-
- /**
- * Add Google Search module
- *
- * @return void
- * @access public
- */
- public function googleSearch()
- {
- $this->gSearchOn = false;
- $this->isHomePage = false;
- if (isset($_REQUEST['query']) && $_REQUEST['query']) {
- $this->gSearchOn = true;
- $query = urlencode($_REQUEST['query']);
- $GLOBALS['styleSheets'][] = BASE_URL.'gsearch.css';
- $GLOBALS['scripts'][]
- = 'http://www.google.com/uds/api?file=uds.js&v=1.0&key='.GSEARCH_API;
- $GLOBALS['scripts'][] = BASE_URL . 'libjs/gsearch.php?query='.$query;
- }
- }
-
- // }}}
-
- // {{{ headlines()
-
- /**
- * grab the home page headlines
- *
- * @param object $toolbox Toolbox object
- *
- * @return void
- * @access public
- */
- public function headlines($toolbox)
- {
- $dbh = Toolkit_Database::getInstance();
- // get headlines aka 'Quick Links'
- $this->headlines = array();
- $sql = "
- SELECT id,intro,feature_intro,description,image
- FROM bus_category
- WHERE featured = 't'
- AND active = 't'
- ORDER BY parent,pos;";
- $res = $dbh->query($sql);
- $rowNumber = $colNumber = 1;
- while ($row = $res->fetch(PDO::FETCH_ASSOC)) { // $data as $row ){
- $this->headlines[$rowNumber][$colNumber] = array(
- 'col' => ($colNumber == 1) ? 'one': 'two',
- 'href' => $this->toolbox->get_seo_url($row['id']),
- 'img' => ($row['image']) ? MIDSIZED . $row['image']: '',
- 'header' => $row['feature_intro'],
- 'descr' => GLM_TOOLBOX::make_teaser($row['description'], 50, true));
- ++$colNumber;
- if ($colNumber > 2) {
- $colNumber = 1;
- ++$rowNumber;
- }
- }
- // boolean for if toolbox has headlines
- $this->hasHeadlines = !empty($this->headlines);
- }
-
- // }}}
-
- // {{{ isPhotoGalleryPage()
-
- /**
- * Check if this page has photo gallery in it
- *
- * @return boolean If this page has a photo gallery assigned to it
- * @access public
- */
- function isPhotoGalleryPage()
- {
- $sql = "
- SELECT photocat_id
- FROM photo_category_bus
- WHERE buscat_id = {$this->toolbox->catid}";
- if ($pData = $this->toolbox->DB->select($sql)) {
- return true;
- }
- return false;
- }
- // }}}
-
- // {{{ news()
-
- /**
- * grab the home page newsletter/press info
- *
- * @param object $toolbox Toolbox object
- *
- * @return void
- * @access public
- */
- public function news($toolbox)
- {
- if (HOME_ID == $toolbox->catid) {
- $this->news = $toolbox->get_news();
- $this->hasNews = (!empty($this->news));
- } else {
- $this->hasNews = false;
- }
- }
-
- // }}}
-
- // {{{ weather()
-
- /**
- * Add Weather module
- *
- * @return void
- * @access public
- */
- public function weather()
- {
- $weather = new Toolkit_Weather();
- if (PEAR::isError($weather->currentCond)) {
- return false;
- }
- $this->weather = $weather->currentCond['weather'];
- $this->tempF = $weather->currentCond['temp_f'];
- $this->iconUrlName = $weather->currentCond['icon_url_name'];
- $this->location = $weather->currentCond['location'];
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/Photos/Display.php b/Toolkit/Photos/Display.php
deleted file mode 100755
index 0159542..0000000
--- a/Toolkit/Photos/Display.php
+++ /dev/null
@@ -1,255 +0,0 @@
-
- * @copyright 2009 Gaslight Media
- * @license Gaslight Media
- * @version CVS: $Id: Display.php,v 1.8 2010/01/15 01:13:01 jamie Exp $
- * @link <>
- */
-
-/**
- * Toolkit_Photos_Display
- *
- * Display the Photo Gallery assoc to a toolbox page
- *
- * @category Photos
- * @package Toolkit_Photos
- * @author Steve Sutton
- * @copyright 2009 Gaslight Media
- * @license Gaslight Media
- * @link <>
- */
-class Toolkit_Photos_Display
-{
- // {{{ Properties
-
- /**
- * Options for Flexy Templates
- * @var array
- * @access protected
- */
- protected $flexyOptions = array(
- 'templateDir' => '/templates',
- 'compileDir' => '/templates/compiled',
- 'forceCompile' => false,
- 'allowPHP' => true,
- );
-
- /**
- * page name for form action and links
- * @var unknown
- * @access protected
- */
- protected $pageName;
-
- /**
- * Photo Table Name
- * @var string
- * @access protected
- */
- protected $photoTable = 'photo';
-
- /**
- * Photo Category Table Name
- * @var string
- * @access protected
- */
- protected $categoryTable = 'photo_category';
-
- /**
- * rowCount
- *
- * @var float
- * @access protected
- */
- protected $rowCount = 3;
- // }}}
- // {{{ __construct()
-
- /**
- * __construct()
- *
- * @return void
- * @access public
- */
- function __construct()
- {
- // assign the global dbh to $this->dbh;
- $this->dbh = Toolkit_Database::getInstance();
- // set paths for templates
- $this->flexyOptions['templateDir'] = dirname(__FILE__)
- .$this->flexyOptions['templateDir'];
- $this->flexyOptions['compileDir'] = dirname(__FILE__)
- .$this->flexyOptions['compileDir'];
- // the main display page for events to link to
- $this->pageName = BASE_URL.'index.php?catid='.$_REQUEST['catid'];
- }
-
- // }}}
- // {{{ listPhotoCategories()
-
- /**
- * listPhotoCategories()
- *
- * Display Photo Categories
- *
- * @return mixed Return description (if any) ...
- * @access public
- */
- function listPhotoCategories()
- {
- $sql = "
- SELECT pc.*
- FROM photo_category pc, photo_category_bus pcb
- WHERE pcb.photocat_id = pc.id
- AND pcb.buscat_id = {$_REQUEST['catid']}
- AND pc.id IN (
- SELECT distinct(catid)
- FROM photo)
- ORDER BY pcb.pos;";
- try {
- $data = $this->dbh->query($sql)->fetchAll();
- if (is_array($data)) {
- $i = 0;
- foreach ($data as &$row) {
- unset($row['image']);
- // use the first one from its photos
- $sql = "
- SELECT image
- FROM photo
- WHERE catid = {$row['id']}
- AND image != ''";
- try {
- $row2 = $this->dbh->query($sql)->fetch();
- $data[$i]['image'] = $row2['image'];
- } catch(PDOException $e) {
- Toolkit_Common::handleError($e);
- }
- ++$i;
- }
- $template = new HTML_Template_Flexy($this->flexyOptions);
- $page = new stdClass;
- $page->appbase = GLM_APP_BASE_URL;
- $page->page = BASE_URL.'index.php?catid='.$_REQUEST['catid'].'&photo_catid=';
- $page->cats = $data;
- $page->imgPath = PHOTO_SMALL_URL;
- $template->compile('photoCats.html');
- return $template->bufferedOutputObject($page);
- } else {
- return '';
- }
- } catch(PDOException $e) {
- Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
- // {{{ listPhotos()
-
- /**
- * listPhotos()
- *
- * Display Photos
- *
- * @return mixed Return description (if any) ...
- * @access public
- */
- function listPhotos()
- {
- // where clauses
- if ($_REQUEST['photo_catid']) {
- // grab photo album name for display
- try {
- $sql = "
- SELECT category
- FROM photo_category
- WHERE id = :id";
- $stmt1 = $this->dbh->prepare($sql);
- $stmt1->bindParam(":id", $_REQUEST['photo_catid'], PDO::PARAM_INT);
- $stmt1->execute();
- $albumName = $stmt1->fetchColumn();
- } catch(PDOException $e) {
- Toolkit_Common::handleError($e);
- }
- $where[] = "catid = {$_REQUEST['photo_catid']}";
- }
- // query
- $sql = "
- SELECT *
- FROM {$this->photoTable}";
- if (is_array($where)) {
- $sql .= " WHERE ".implode(" AND ", $where);
- }
- $sql .= " ORDER BY pos";
- try {
- $data = $this->dbh->query($sql)->fetchAll();
- $count = 1;
- $trueCount = 1;
- $num = count($data);
- foreach ($data as &$row) {
- if ($count == 1) {
- $row['firstInRow'] = true;
- } else {
- $row['firstInRow'] = false;
- }
- if ($count == $this->rowCount || $trueCount == $num) {
- $row['lastInRow'] = true;
- $count = 0;
- } else {
- $row['lastInRow'] = false;
- }
- ++$count;
- ++$trueCount;
- }
- if (is_array($data)) {
- $template = new HTML_Template_Flexy($this->flexyOptions);
- $page = new stdClass;
- $page->album = ($albumName) ? $albumName: 'Photo Gallery';
- $page->appbase = GLM_APP_BASE_URL;
- $page->photos = $data;
- $page->imgPath = PHOTO_SMALL_URL;
- $page->orgPath = PHOTO_LARGE_URL;
- $template->compile('photos.html');
- return $template->bufferedOutputObject($page);
- } else {
- return '';
- }
- } catch(PDOException $e) {
- Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
- // {{{ toHTML()
-
- /**
- * toHTML()
- *
- * call to listPhotos function for display of Photos
- *
- * @return void
- * @access public
- */
- function toHTML()
- {
- $GLOBALS['scripts'][] = GLM_APP_BASE_URL . 'gallery/thickbox-3.1.1.js';
- $GLOBALS['styleSheets'][] = GLM_APP_BASE_URL . 'gallery/gallery.css';
- $GLOBALS['styleSheets'][] = GLM_APP_BASE_URL . 'gallery/thickbox.css';
-
- if (is_array($_REQUEST['photo_catid'])) {
- return $this->listPhotoCategories();
- } elseif ($_REQUEST['photo_catid']) {
- return $this->listPhotos();
- }
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/Photos/assets/.keepme b/Toolkit/Photos/assets/.keepme
deleted file mode 100644
index e69de29..0000000
diff --git a/Toolkit/Photos/templates/compiled/.cvsignore b/Toolkit/Photos/templates/compiled/.cvsignore
deleted file mode 100755
index 65fb5e5..0000000
--- a/Toolkit/Photos/templates/compiled/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-* *.*
diff --git a/Toolkit/Photos/templates/compiled/.keepme b/Toolkit/Photos/templates/compiled/.keepme
deleted file mode 100644
index e69de29..0000000
diff --git a/Toolkit/Photos/templates/compiled/photoCats.html.en.php b/Toolkit/Photos/templates/compiled/photoCats.html.en.php
deleted file mode 100755
index db6cfd2..0000000
--- a/Toolkit/Photos/templates/compiled/photoCats.html.en.php
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
Click an image to enter a Photo Album
- options['strict'] || (is_array($t->cats) || is_object($t->cats))) foreach($t->cats as $photo) {?>
-
-
-
-
diff --git a/Toolkit/Photos/templates/compiled/photoCats.html.gettext.serial b/Toolkit/Photos/templates/compiled/photoCats.html.gettext.serial
deleted file mode 100644
index febccfc..0000000
--- a/Toolkit/Photos/templates/compiled/photoCats.html.gettext.serial
+++ /dev/null
@@ -1 +0,0 @@
-a:1:{i:0;s:37:"Click an image to enter a Photo Album";}
\ No newline at end of file
diff --git a/Toolkit/Photos/templates/compiled/photos.html.en.php b/Toolkit/Photos/templates/compiled/photos.html.en.php
deleted file mode 100755
index 75b0fd7..0000000
--- a/Toolkit/Photos/templates/compiled/photos.html.en.php
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
album);?>
- options['strict'] || (is_array($t->photos) || is_object($t->photos))) foreach($t->photos as $photo) {?>
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Toolkit/Photos/templates/photoCats.html b/Toolkit/Photos/templates/photoCats.html
deleted file mode 100755
index e877442..0000000
--- a/Toolkit/Photos/templates/photoCats.html
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
Click an image to enter a Photo Album
-
-
{photo[category]}
-
-
-
diff --git a/Toolkit/Photos/templates/photos.html b/Toolkit/Photos/templates/photos.html
deleted file mode 100755
index fdd861d..0000000
--- a/Toolkit/Photos/templates/photos.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
{album}
- {foreach:photos,photo}
- {if:photo[firstInRow]}
-
- {end:}
-
-
-
{photo[title]}
-
- {if:photo[lastInRow]}
-
- {end:}
- {end:}
-
diff --git a/Toolkit/RotatingImages.php b/Toolkit/RotatingImages.php
deleted file mode 100644
index 612a3e3..0000000
--- a/Toolkit/RotatingImages.php
+++ /dev/null
@@ -1,125 +0,0 @@
- 'rotatingImages.php?action=list',
- 'Add Image' => 'rotatingImages.php?action=edit'
- );
-
- ob_start();
- GLM_TOOLBOX::html_nav_table($subNav, 1);
- return ob_get_clean();
- }
-
- // }}}
-
- // {{{ getFlexyOptions()
- public static function getFlexyOptions()
- {
- $options = $GLOBALS['flexyOptions'];
- $options['templateDir']
- = dirname(__FILE__) . '/RotatingImages/templates';
- $options['compileDir']
- = dirname(__FILE__) . '/RotatingImages/templates/compiled';
-
- return $options;
- }
-
- // }}}
-
- // {{{ toHtml()
- public function toHtml(PDO $dbh, Config_Container $rotatingImagesRoot)
- {
- switch ($_GET['action']) {
- case 'del' :
- if (ctype_digit($_GET['id'])) {
- $is = new Toolkit_Image_Server();
- $image = Toolkit_RotatingImages_Image::find($dbh, $_GET['id']);
- $image->delete($dbh, $is);
- }
- header('Location: ' . BASE_URL . 'admin/rotatingImages.php');
- exit();
- break;
-
- case 'edit' :
- $GLOBALS['styleSheets'][]
- = BASE_URL . '/Toolkit/RotatingImages/styles.css';
- $form = new Toolkit_RotatingImages_EditImageForm(
- 'GLM_RotatingImages'
- );
- $form->configureForm($dbh);
- $ret = $form->toHtml($dbh, new Toolkit_Image_Server());
- break;
-
- case 'list' :
- default :
- $GLOBALS['styleSheets'][]
- = BASE_URL . 'Toolkit/RotatingImages/styles.css';
- $GLOBALS['styleSheets'][]
- = GLM_APP_BASE_URL . 'libjs/jqueryui/1.7.1/themes/base/ui.core.css';
- $GLOBALS['styleSheets'][]
- = GLM_APP_BASE_URL . 'libjs/jqueryui/1.7.1/themes/base/ui.theme.css';
-
- $GLOBALS['scripts'][]
- = GLM_APP_BASE_URL . 'libjs/jqueryui/1.7.1/ui/ui.core.js';
- $GLOBALS['scripts'][]
- = GLM_APP_BASE_URL . 'libjs/jqueryui/1.7.1/ui/ui.sortable.js';
- $GLOBALS['scripts'][]
- = BASE_URL . 'Toolkit/RotatingImages/libjs/sortable.js';
-
- $tEngine = new HTML_Template_Flexy(
- Toolkit_RotatingImages::getFlexyOptions()
- );
-
- $tEngine->compile('instructions.html');
- $ret = $tEngine->bufferedOutputObject(new stdClass());
-
- //
- // Settings Form
- //
- $settings
- = new Toolkit_RotatingImages_TransitionSettingsForm('settings');
- $settings->configureForm($dbh, $rotatingImagesRoot);
- $ret .= $settings->toHtml($dbh);
-
- //
- // Preview
- //
- $preview = new Toolkit_RotatingImages_TransitionPreview();
- $ret .= $preview->getPreview($dbh);
-
- $activeREngine = new Structures_DataGrid_Renderer_Flexy();
- $activeREngine->setContainer($tEngine);
- //
- // Active images datagrid
- //
- $activeDG = new Toolkit_RotatingImages_ActiveImagesDataGrid(
- Toolkit_Database::getInstance()
- );
- $activeDG->setQuery();
- $activeDG->setDefaultSort(array('pos' => 'ASC'));
- $ret .= $activeDG->toHtml($activeREngine, 'imagesDataGrid.html');
-
- $inactiveREngine = new Structures_DataGrid_Renderer_Flexy();
- $inactiveREngine->setContainer($tEngine);
- //
- // In-active images datagrid
- //
- $disabledDG = new Toolkit_RotatingImages_InactiveImagesDataGrid(
- Toolkit_Database::getInstance()
- );
- $disabledDG->setQuery();
- $disabledDG->setDefaultSort(array('pos' => 'ASC'));
- $ret .=$disabledDG->toHtml($inactiveREngine, 'imagesDataGrid.html');
- break;
- }
-
- return $ret;
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/RotatingImages/ActiveImagesDataGrid.php b/Toolkit/RotatingImages/ActiveImagesDataGrid.php
deleted file mode 100644
index aaddf57..0000000
--- a/Toolkit/RotatingImages/ActiveImagesDataGrid.php
+++ /dev/null
@@ -1,30 +0,0 @@
-ctrlObj['tableId'] = 'active';
-// $this->ctrlObj['noRecMessage'] = 'No Active Images';
- $this->ctrlObj['gridName'] = 'Active Images';
- }
-
- // }}}
- // {{{ setQuery()
-
- public function setQuery()
- {
- $sql = "
- SELECT *
- FROM rotating_images
- WHERE active = true";
-
- parent::setQuery($sql);
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/RotatingImages/Anchor.php b/Toolkit/RotatingImages/Anchor.php
deleted file mode 100644
index 11353d6..0000000
--- a/Toolkit/RotatingImages/Anchor.php
+++ /dev/null
@@ -1,149 +0,0 @@
-active = $active;
- // anchor attributes
- $this->href = $href;
- $this->external = $external;
-
- // image attributes
- $this->src = $src;
- $this->alt = $alt;
- $this->title = $title;
-
- $this->id = $id;
- }
-
- // }}}
- // {{{ find()
-
- public static function find(PDO $dbh, $id)
- {
- if (!ctype_digit((string) $id)) {
- throw new Exception(
- '$id must be an integer.'
- );
- }
-
- $sql = "
- SELECT *
- FROM rotating_images
- WHERE id = :id";
-
- try {
- $stmt = $dbh->prepare($sql);
- $stmt->bindParam(':id', $id, PDO::PARAM_INT);
- $stmt->execute();
- $row = $stmt->fetch(PDO::FETCH_ASSOC);
-
- return new self(
- $row['active'],
- $row['url'],
- $row['external'],
- $row['image'],
- null,
- null,
- $id
- );
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
- // {{{ getHref()
-
- public function getHref()
- {
- return $this->href;
- }
-
- // }}}
- // {{{ setHref()
-
- public function setHref($href)
- {
- $this->href = $href;
- }
-
- // }}}
- // {{{ getTarget()
-
- public function getTarget()
- {
- return $this->external ? '_blank' : '_self';
- }
-
- // }}}
- // {{{ getExternal()
-
- public function getExternal()
- {
- return $this->external;
- }
-
- // }}}
- // {{{ setExternal()
-
- public function setExternal($external)
- {
- $this->external = $external;
- }
-
- // }}}
-
- // {{{ insert()
- public function insert(PDO $dbh)
- {
- $sql = "SELECT InsertAnchor(:image, :active, :url, :external)";
- $stmt = $dbh->prepare($sql);
- $stmt->bindParam(':image', $this->src, PDO::PARAM_STR);
- $stmt->bindParam(':active', $this->active, PDO::PARAM_BOOL);
- $stmt->bindParam(':url', $this->href, PDO::PARAM_BOOL);
- $stmt->bindParam(':external', $this->external, PDO::PARAM_BOOL);
- return $stmt->execute();
- }
-
- // }}}
- // {{{ update()
- public function update(PDO $dbh)
- {
- $sql = "
- UPDATE rotating_images
- SET image = :image,
- active = :active,
- url = :href,
- external = :external
- WHERE id = :id";
-
- $stmt = $dbh->prepare($sql);
- $stmt->bindParam(':image', $this->src, PDO::PARAM_STR);
- $stmt->bindParam(':active', $this->active, PDO::PARAM_BOOL);
- $stmt->bindParam(':href', $this->href, PDO::PARAM_BOOL);
- $stmt->bindParam(':external', $this->external, PDO::PARAM_BOOL);
- $stmt->bindParam(':id', $this->id, PDO::PARAM_INT);
- return $stmt->execute();
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/RotatingImages/AnchorDecorator.php b/Toolkit/RotatingImages/AnchorDecorator.php
deleted file mode 100644
index a20442d..0000000
--- a/Toolkit/RotatingImages/AnchorDecorator.php
+++ /dev/null
@@ -1,91 +0,0 @@
-
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @version CVS: $Id: AnchorDecorator.php,v 1.1.1.1 2010/01/08 14:36:10 jamie Exp $
- * @link <>
- */
-
-
-/**
- * Decorator for horizontal banners
- *
- * @category RotatingImages
- * @package Toolkit_RotatingImages
- * @author Jamie Kahgee
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @link <>
- */
-class Toolkit_RotatingImages_AnchorDecorator
- extends Toolkit_RotatingImages_Decorator
-{
- // {{{ __construct()
-
-
- /**
- * constructor
- *
- * create a shallow copy of the node passed in so we can manipulate
- * it all we want and not worry about affecting the original object
- *
- * @param Toolkit_RotatingImages_Anchor $node node to be decorated
- *
- * @return void
- * @access protected
- */
- public function __construct(Toolkit_RotatingImages_Anchor $node)
- {
- // Clone the node object so we keep original properties the same
- $copiedNode = clone $node;
-
- $this->node = $copiedNode;
- }
-
- // }}}
- // {{{ toHtml()
-
-
- /**
- * Convert the anchor to a HTML string
- *
- * @param Toolkit_Image_Server $is Image server
- *
- * @return string HTML output of the anchor
- * @access public
- */
- public function toHtml(Toolkit_Image_Server $is)
- {
- $properties
- = $is->getImageSize(ROTATING_IMAGE_RESIZED . $this->node->getSrc());
-
- $imgFormat = ' ';
- $anchorSource = sprintf(
- $imgFormat,
- $this->node->getAlt(),
- $this->node->getTitle(),
- $properties[0],
- $properties[1],
- ROTATING_IMAGE_RESIZED . $this->node->getSrc()
- );
-
- $anchorFormat = '%s ';
- return sprintf(
- $anchorFormat,
- $this->node->getHref(),
- $this->node->getTarget(),
- $anchorSource
- );
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/RotatingImages/Database/application.sql b/Toolkit/RotatingImages/Database/application.sql
deleted file mode 100644
index 202b0fa..0000000
--- a/Toolkit/RotatingImages/Database/application.sql
+++ /dev/null
@@ -1,15 +0,0 @@
---
--- Tables
---
-\i ./tables/rotating_images.sql
-\i ./tables/rotating_images_transitions.sql
-
---
--- Procedures
---
-\i ./procedures/insertImage.sql
-\i ./procedures/insertAnchor.sql
-
---
--- Modules
---
diff --git a/Toolkit/RotatingImages/Database/procedures/insertAnchor.sql b/Toolkit/RotatingImages/Database/procedures/insertAnchor.sql
deleted file mode 100644
index 7bd59db..0000000
--- a/Toolkit/RotatingImages/Database/procedures/insertAnchor.sql
+++ /dev/null
@@ -1,32 +0,0 @@
---DROP LANGUALGE plpgsql;
-CREATE LANGUAGE plpgsql;
-
-CREATE OR REPLACE FUNCTION InsertAnchor(IN new_image TEXT, IN new_active BOOLEAN, IN new_url TEXT, IN new_external BOOLEAN) RETURNS TEXT AS $$
- DECLARE
- new_pos INTEGER;
- BEGIN
- SELECT (max(pos) + 1) INTO new_pos
- FROM rotating_images
- WHERE active = true;
-
- -- make sure we have a pos to set
- IF new_pos > 0 THEN
- -- do nothing
- ELSE
- new_pos := 1;
- END IF;
-
- IF new_active THEN
- INSERT INTO rotating_images (image, active, url, external, pos)
- VALUES (new_image, new_active, new_url, new_external, new_pos);
-
- RETURN 'created active anchor ' || $1::TEXT;
- ELSE
- INSERT INTO rotating_images (image, active, url, external, pos)
- VALUES (new_image, new_active, new_url, new_external, NULL);
-
- RETURN 'created disabled anchor ' || $1::TEXT;
- END IF;
- END;
-$$
-LANGUAGE plpgsql;
diff --git a/Toolkit/RotatingImages/Database/procedures/insertImage.sql b/Toolkit/RotatingImages/Database/procedures/insertImage.sql
deleted file mode 100644
index d8aff46..0000000
--- a/Toolkit/RotatingImages/Database/procedures/insertImage.sql
+++ /dev/null
@@ -1,32 +0,0 @@
---DROP LANGUALGE plpgsql;
-CREATE LANGUAGE plpgsql;
-
-CREATE OR REPLACE FUNCTION InsertImage (IN new_image TEXT, IN new_active BOOLEAN) RETURNS TEXT AS $$
- DECLARE
- new_pos INTEGER;
- BEGIN
- SELECT (max(pos) + 1) INTO new_pos
- FROM rotating_images
- WHERE active = true;
-
- -- make sure we have a pos to set
- IF new_pos > 0 THEN
- -- do nothing
- ELSE
- new_pos := 1;
- END IF;
-
- IF new_active THEN
- INSERT INTO rotating_images (image, active, pos)
- VALUES (new_image, new_active, new_pos);
-
- RETURN 'created active image ' || $1::TEXT;
- ELSE
- INSERT INTO rotating_images (image, active, pos)
- VALUES (new_image, new_active, NULL);
-
- RETURN 'created disabled image ' || $1::TEXT;
- END IF;
- END;
-$$
-LANGUAGE plpgsql;
diff --git a/Toolkit/RotatingImages/Database/tables/rotating_images.sql b/Toolkit/RotatingImages/Database/tables/rotating_images.sql
deleted file mode 100644
index f1d6766..0000000
--- a/Toolkit/RotatingImages/Database/tables/rotating_images.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-CREATE TABLE rotating_images
-(id SERIAL,
- image TEXT NOT NULL UNIQUE,
- url TEXT,
- external BOOLEAN NOT NULL DEFAULT FALSE,
- active BOOLEAN NOT NULL DEFAULT FALSE,
- pos INTEGER UNIQUE,
- PRIMARY KEY (id));
-
-GRANT ALL ON rotating_images_id_seq TO nobody;
-GRANT ALL ON rotating_images TO nobody;
diff --git a/Toolkit/RotatingImages/Database/tables/rotating_images_transitions.sql b/Toolkit/RotatingImages/Database/tables/rotating_images_transitions.sql
deleted file mode 100644
index 3813a26..0000000
--- a/Toolkit/RotatingImages/Database/tables/rotating_images_transitions.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-CREATE TABLE rotating_images_transitions
-(timeout INTEGER NOT NULL DEFAULT 10,
- transition TEXT NOT NULL DEFAULT 'fade');
-
-INSERT INTO rotating_images_transitions VALUES (10, 'fade');
-
-GRANT ALL ON rotating_images_transitions TO nobody;
diff --git a/Toolkit/RotatingImages/Decorator.php b/Toolkit/RotatingImages/Decorator.php
deleted file mode 100644
index 29ebdad..0000000
--- a/Toolkit/RotatingImages/Decorator.php
+++ /dev/null
@@ -1,56 +0,0 @@
-
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @version CVS: $Id: Decorator.php,v 1.1.1.1 2010/01/08 14:36:10 jamie Exp $
- * @link <>
- */
-
-
-/**
- * Base class for decorators
- *
- * @category RotatingImages
- * @package Toolkit_RotatingImages
- * @author Jamie Kahgee
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @link <>
- */
-abstract class Toolkit_RotatingImages_Decorator
-{
- // {{{ properties
-
-
- /**
- * Image object that will be decorated
- * @var Toolkit_RotatingImages_Image
- * @access protected
- */
- protected $node;
-
- // }}}
- // {{{ getNode()
-
- /**
- * Get the node we are decorating
- *
- * @return Toolkit_RotatingImages_Node object
- * @access public
- */
- public function getNode()
- {
- return $this->node;
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/RotatingImages/EditImageForm.php b/Toolkit/RotatingImages/EditImageForm.php
deleted file mode 100644
index 16925b2..0000000
--- a/Toolkit/RotatingImages/EditImageForm.php
+++ /dev/null
@@ -1,509 +0,0 @@
-
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version CVS: $Id: EditImageForm.php,v 1.1.1.1 2010/01/08 14:36:10 jamie Exp $
- * @link http://demo.gaslightmedia.com
- */
-
-/**
- * Rotating Images Application
- *
- * Manages the creation and editing form for manipulating images in the db.
- *
- * @category RotatingImages
- * @package Toolkit_RotatingImages
- * @author Jamie Kahgee
- * @copyright 2008 Gaslight Media
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @link http://demo.gaslightmedia.com
- */
-class Toolkit_RotatingImages_EditImageForm extends Toolkit_FormBuilder
-{
- // {{{ properties
-
- /**
- * What do you want the success msg to be if the form validates successfully
- *
- * @var string
- * @access protected
- */
- protected $successMsg
- = 'Image successfully updated.
';
-
- /**
- * The default rules to register for validating
- *
- * We have to register these rules, or any others we want, before
- * we are able to use them in our forms.
- *
- * @var string
- * @access protected
- */
- protected $registeredRules = array(
- array(
- 'checkURI',
- 'callback',
- 'uri',
- 'Validate'
- )
- );
-
- // }}}
- // {{{ __construct()
-
- /**
- * Constructor
- *
- * @param PDO $pdo Database handler
- * @param string $formName Form's name.
- * @param string $method (optional)Form's method defaults to 'POST'
- * @param string $action (optional)Form's action
- * @param string $target (optional)Form's target defaults to '_self'
- * @param mixed $attributes (optional)Extra attributes for tag
- * @param bool $trackSubmit (optional)Whether to track if the form was
- * submitted by adding a special hidden field
- *
- * @access public
- */
- public function __construct(
- $formName,
- $method = 'post',
- $action = '',
- $target = '',
- $attributes = null,
- $trackSubmit = false
- ) {
- parent::__construct(
- $formName,
- $method,
- $action,
- $target,
- $attributes,
- $trackSubmit
- );
-
- $this->template = BASE . 'Toolkit/RotatingImages/templates/currentTables/';
- }
-
- // }}}
-
- // {{{ configureConstants()
-
- /**
- * Configure form constants
- *
- * @return void
- * @access public
- */
- public function configureConstants()
- {
- $c = array();
-
- // If we are adding a new banner
- if (!ctype_digit($_GET['id'])) {
- $c['current_image_rmv'] = 'Image not yet uploaded';
- }
-
- // If the form has been submitted and a new image was uploaded
- $currImg = $this->getSubmitValue('image');
- if ($this->isSubmitted() && !empty($currImg)) {
- $img = ' ';
- $c['current_image_rmv'] = sprintf(
- $img,
- ROTATING_IMAGE_THUMB,
- $currImg
- );
- }
-
- $this->setupConstants($c);
- }
-
- // }}}
- // {{{ configureDefaults()
-
- /**
- * Configure the initial default values for the form
- *
- * @param PDO $dbh Database handler
- *
- * @return void
- * @access protected
- */
- public function configureDefaults(PDO $dbh)
- {
- if (ctype_digit($_GET['id'])) {
- $node = Toolkit_RotatingImages_Anchor::find($dbh, $_GET['id']);
- if ($node) {
- $img = ' ';
- $d = array(
- 'active' => (int) $node->getActive(),
- 'image'=> $node->getSrc(),
- 'current_image_rmv' => sprintf(
- $img,
- ROTATING_IMAGE_THUMB,
- $node->getSrc()
- ),
- 'external' => (int) $node->getExternal(),
- 'url' => $node->getHref(),
- );
- }
- } else {
- $d = array(
- 'external' => false,
- );
- }
-
- $this->setupDefaults($d);
- }
-
- // }}}
- // {{{ configureElements()
-
- /**
- * Configure how the form elements should look
- *
- * @return void
- * @access public
- */
- public function configureElements()
- {
- $e = array();
-
- // All Grouped Elements are created here.
-
- // All Elements are created here. This includes group element definitions.
- $e[] = array(
- 'type' => 'advcheckbox',
- 'req' => false,
- 'name' => 'active',
- 'display' => 'Active',
- 'val' => array(0, 1)
- );
- $e[] = array(
- 'type' => 'hidden',
- 'req' => false,
- 'name' => 'image'
- );
- $e[] = array(
- 'type' => 'text',
- 'req' => false,
- 'name' => 'url',
- 'display' => 'URL',
- 'opts' => array('class' => 'text')
- );
- $e[] = array(
- 'type' => 'advcheckbox',
- 'req' => false,
- 'name' => 'external',
- 'display' => 'External Link',
- 'val' => array(0, 1)
- );
- $e[] = array(
- 'type' => 'file',
- 'req' => false,
- 'name' => 'file_rmv',
- 'display' => 'Image'
- );
- $e[] = array(
- 'type' => 'static',
- 'req' => false,
- 'name' => 'current_image_rmv',
- 'display' => 'Current Image'
- );
- $e[] = array(
- 'type' => 'submit',
- 'req' => false,
- 'name' => 'submit_rmv',
- 'display' => 'Submit Image',
- 'opts' => array('id' => 'submit')
- );
- if (ctype_digit($_GET['id'])) {
- $e[] = array(
- 'type' => 'submit',
- 'req' => false,
- 'name' => 'delete_rmv',
- 'display' => 'Delete Image',
- 'opts' => array('id' => 'delete')
- );
- }
-
- $this->setupElements($e);
- }
-
- // }}}
- // {{{ configureFilters()
-
- /**
- * Configure how the form elements should act when being submitted
- *
- * @return void
- * @access protected
- */
- public function configureFilters()
- {
- $f = array();
- $f[] = array(
- 'element' => '__ALL__',
- 'filter' => 'trim'
- );
- $f[] = array(
- 'element' => 'url',
- 'filter' => array('Toolkit_Common', 'filterURI')
- );
-
- $this->setupFilters($f);
- }
-
- // }}}
- // {{{ configureForm()
-
- /**
- * Configure a form so we can use it
- *
- * @return void
- * @access public
- */
- public function configureForm(PDO $dbh)
- {
- $this->configureElements();
- $this->configureFilters();
- $this->configureRules();
- $this->configureDefaults($dbh);
- $this->configureConstants();
- }
-
- // }}}
- // {{{ configureRules()
-
- /**
- * Configure how the form elements should act
- *
- * @return void
- * @access public
- */
- public function configureRules()
- {
- $r = array();
-
- $mimeTypes = array(
- 'image/jpe',
- 'image/jpeg',
- 'image/jpg',
- 'image/jfif',
- 'image/pjpeg',
- 'image/pjp',
- 'image/gif',
- 'image/png',
- );
-
- $r[] = array(
- 'element' => 'url',
- 'message' => 'ERROR: Invalid URL format (http, https only)',
- 'type' => 'checkURI',
- 'format' => array(
- 'allowed_schemes' => array('http', 'https'),
- 'strict' => true
- ),
- 'validation' => $this->validationType,
- 'reset' => false,
- 'force' => false
- );
- $uploadedImage = $this->getSubmitValue('image');
- if (empty($uploadedImage)) {
- $r[] = array(
- 'element' => 'file_rmv',
- 'message' => 'ERROR: Must upload an image!',
- 'type' => 'uploadedfile',
- 'format' => null,
- 'validation' => $this->validationType,
- 'reset' => false,
- 'force' => false
- );
- }
- if (is_uploaded_file($_FILES['file_rmv']['tmp_name'])) {
- $r[] = array(
- 'element' => 'file_rmv',
- 'message' => 'ERROR: Incorrect File Type (.gif, .png, .jpg) only!',
- 'type' => 'mimetype',
- 'format' => $mimeTypes,
- 'validation' => $this->validationType,
- 'reset' => false,
- 'force' => false
- );
- }
-
- $this->setupRules($r);
- }
-
- // }}}
-
- // {{{ processData()
-
- /**
- * Determine how the form should be handled (insert new data or update old)
- *
- * @param PDO $dbh Database handler
- * @param array $values Submitted form values
- *
- * @return boolean Result of insert or update function
- * @access protected
- */
- private function _processData(PDO $dbh, $values)
- {
- if (ctype_digit($_GET['id'])) {
- // Editing a banner
- $node = Toolkit_RotatingImages_Anchor::find($dbh, $_GET['id']);
- $node->setActive((bool) $values['active']);
- $node->setSrc($values['image']);
- $node->setHref($values['url']);
- $node->setExternal($values['external']);
-
- return $node->update($dbh);
- } else {
- // Creating a new image
- $node = new Toolkit_RotatingImages_Anchor(
- $values['active'],
- $values['url'],
- $values['external'],
- $values['image']
- );
-
- return $node->insert($dbh);
- }
- }
-
- // }}}
-
- // {{{ sendImageToImageServer()
-
- /**
- * Send an image to the image server
- *
- * Sets the image name in the submit values, so when saving
- * the image, we keep the image that was uploaded.
- *
- * Injects the thumbnail image of this uploaded image into
- * the form, this way if validation fails, the thumbnail will
- * be shown on the form so the user knows they don't have to
- * re-upload the image.
- *
- * @param Toolkit_Image_Server $is Image server
- * @param string $file key of upload in $_FILES superarray
- *
- * @return void
- * @access protected
- */
- protected function sendImageToImageServer(
- Toolkit_Image_Server $is,
- $file
- ) {
- $oldImage =& $this->getSubmitValue('image');
- if (!empty($oldImage)) {
- $is->imageDelete($oldImage);
- }
-
- $imgTag = ' ';
- $name = $is->imageUpload($file);
-
- $htmlImg = sprintf($imgTag, ROTATING_IMAGE_THUMB, $name);
-
- $currImg =& $this->getElement('current_image_rmv');
- $currImg->setValue($htmlImg);
-
- $fileName =& $this->getElement('image');
- $fileName->setValue($name);
- $this->_submitValues['image'] = $name;
- }
-
- // }}}
- // {{{ setupRenderers()
- // @codeCoverageIgnoreStart
-
- /**
- * Custom rendering templates for special fields on the form
- *
- * @return void
- * @access protected
- */
- protected function setupRenderers()
- {
- parent::setupRenderers();
- $renderer =& $this->defaultRenderer();
- $required = ' * ';
- $error = ' {error}
';
- $renderer->setElementTemplate(''.$required.'{label}'.$error.'{element} ', 'submit_rmv');
- $renderer->setElementTemplate(''.$required.'{label}'.$error.'{element} ', 'delete_rmv');
-
- }
-
- // @codeCoverageIgnoreEnd
- // }}}
-
- // {{{ toHtml()
-
- /**
- * Call the rendering function to get the form in a string
- *
- * @param PDO $dbh Database handler
- * @param Toolkit_Image_Server $is Image Server
- *
- * @return string $output The Form to be rendered or success msg.
- * @access protected
- */
- public function toHtml(PDO $dbh, Toolkit_Image_Server $is)
- {
- // Handle Deleting banner.
- if ( $this->isSubmitted()
- && ctype_digit($_GET['id'])
- ) {
- if ($this->getSubmitValue('delete_rmv')) {
- $node = Toolkit_RotatingImages_Image::find(
- $dbh,
- $_GET['id']
- );
- if ($banner) {
- if ($banner->delete($dbh, $is, $_GET['id'])) {
- return 'Banner successfully deleted.';
- }
- } else {
- // the banner has already been deleted or doesn't exist.
- return "The banner has already been deleted or doesn't exists.";
- }
- }
- }
-
- $this->setupRenderers();
- $uploadedNewImg = ( $this->isSubmitted()
- && is_uploaded_file($_FILES['file_rmv']['tmp_name'])
- );
- if ($uploadedNewImg) {
- $this->sendImageToImageServer($is, 'file_rmv');
- }
- if ($this->validate()) {
- $this->cleanForm();
-
- if ($this->_processData($dbh, $this->getSubmitValues())) {
- $this->freeze();
- $output = $this->successMsg;
- }
- } else if ($this->isSubmitted()) {
- $output = $this->errorMsg;
- $output .= parent::toHTML();
- } else {
- $output = parent::toHTML();
- }
- return $output;
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/RotatingImages/IDecoratorsIterator.php b/Toolkit/RotatingImages/IDecoratorsIterator.php
deleted file mode 100644
index cdd5a48..0000000
--- a/Toolkit/RotatingImages/IDecoratorsIterator.php
+++ /dev/null
@@ -1,50 +0,0 @@
-
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @version CVS: $Id: IDecoratorsIterator.php,v 1.1.1.1 2010/01/08 14:36:10 jamie Exp $
- * @link <>
- */
-
-/**
- * Decorators collection
- *
- * @category RotatingImages
- * @package Toolkit_RotatingImages
- * @author Jamie Kahgee
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @link <>
- */
-interface Toolkit_RotatingImages_IDecoratorsIterator
-{
-
- /**
- * Add a new decorator to the collection
- *
- * @param Toolkit_RotatingImages_Decorator $d decorator
- *
- * @return void
- * @access public
- */
- public function add(Toolkit_RotatingImages_Decorator $d);
-
- /**
- * Return an HTML version of the decorator
- *
- * @param Toolkit_Image_Server $is Image server
- *
- * @return html version of banners
- * @access public
- */
- public function toHtml(Toolkit_Image_Server $is);
-}
-?>
diff --git a/Toolkit/RotatingImages/IImagesDataGrid.php b/Toolkit/RotatingImages/IImagesDataGrid.php
deleted file mode 100644
index cddc09f..0000000
--- a/Toolkit/RotatingImages/IImagesDataGrid.php
+++ /dev/null
@@ -1,12 +0,0 @@
-
diff --git a/Toolkit/RotatingImages/Image.php b/Toolkit/RotatingImages/Image.php
deleted file mode 100644
index a8eb874..0000000
--- a/Toolkit/RotatingImages/Image.php
+++ /dev/null
@@ -1,141 +0,0 @@
-active = (bool) $active;
- $this->src = $src;
- $this->alt = $alt;
- $this->title = $title;
- $this->id = $id;
- }
-
- // }}}
- // {{{ getSrc()
- public function getSrc()
- {
- return $this->src;
- }
-
- // }}}
- // {{{ setSrc()
- public function setSrc($src)
- {
- $this->src = $src;
- }
-
- // }}}
- // {{{ getAlt()
- public function getAlt()
- {
- return $this->alt;
- }
-
- // }}}
- // {{{ getTitle()
- public function getTitle()
- {
- return $this->title;
- }
-
- // }}}
- // {{{ insert()
- public function insert(PDO $dbh)
- {
- $sql = "SELECT InsertImage(:image, :active)";
- $stmt = $dbh->prepare($sql);
- $stmt->bindParam(':image', $this->src, PDO::PARAM_STR);
- $stmt->bindParam(':active', $this->active, PDO::PARAM_BOOL);
- return $stmt->execute();
- }
-
- // }}}
- // {{{ update()
- public function update(PDO $dbh)
- {
- $sql = "
- UPDATE rotating_images
- SET image = :image, active = :active
- WHERE id = :id";
-
- try {
- $stmt = $dbh->prepare($sql);
- $stmt->bindParam(':image', $this->src, PDO::PARAM_STR);
- $stmt->bindParam(':active', $this->active, PDO::PARAM_BOOL);
- $stmt->bindParam(':id', $this->id, PDO::PARAM_INT);
- return $stmt->execute();
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
- // {{{ find()
- public static function find(PDO $dbh, $id)
- {
- if (!ctype_digit((string) $id)) {
- throw new Exception(
- '$id must be an integer.'
- );
- }
-
- $sql = "
- SELECT *
- FROM rotating_images
- WHERE id = :id";
-
- try {
- $stmt = $dbh->prepare($sql);
- $stmt->bindParam(':id', $id, PDO::PARAM_INT);
- $stmt->execute();
- $row = $stmt->fetch(PDO::FETCH_ASSOC);
-
- return new self(
- $row['active'],
- $row['image'],
- null,
- null,
- $id
- );
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
- // {{{ delete()
- public function delete(PDO $dbh, Toolkit_Image_Server $is)
- {
- try {
- $is->imageDelete($this->src);
-
- $sql = "
- DELETE FROM rotating_images
- WHERE id = :id";
-
- $stmt = $dbh->prepare($sql);
- $stmt->bindParam(':id', $this->id, PDO::PARAM_INT);
-
- return $stmt->execute();
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/RotatingImages/ImageDecorator.php b/Toolkit/RotatingImages/ImageDecorator.php
deleted file mode 100644
index 6241740..0000000
--- a/Toolkit/RotatingImages/ImageDecorator.php
+++ /dev/null
@@ -1,83 +0,0 @@
-
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @version CVS: $Id: ImageDecorator.php,v 1.1.1.1 2010/01/08 14:36:09 jamie Exp $
- * @link <>
- */
-
-
-/**
- * Decorator for horizontal banners
- *
- * @category RotatingImages
- * @package Toolkit_RotatingImages
- * @author Jamie Kahgee
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @link <>
- */
-class Toolkit_RotatingImages_ImageDecorator
- extends Toolkit_RotatingImages_Decorator
-{
- // {{{ __construct()
-
-
- /**
- * constructor
- *
- * create a shallow copy of the node passed in so we can manipulate
- * it all we want and not worry about affecting the original object
- *
- * @param Toolkit_RotatingImages_Node $node node to be decorated
- *
- * @return void
- * @access protected
- */
- public function __construct(Toolkit_RotatingImages_Image $node)
- {
- // Clone the node object so we keep original properties the same
- $copiedNode = clone $node;
-
- $this->node = $copiedNode;
- }
-
- // }}}
- // {{{ toHtml()
-
-
- /**
- * Convert the image to a HTML string
- *
- * @param Toolkit_Image_Server $is Image server
- *
- * @return string HTML output of the image
- * @access public
- */
- public function toHtml(Toolkit_Image_Server $is)
- {
- $properties
- = $is->getImageSize(ROTATING_IMAGE_RESIZED . $this->node->getSrc());
-
- $format = ' ';
- return sprintf(
- $format,
- $this->node->getAlt(),
- $this->node->getTitle(),
- $properties[0],
- $properties[1],
- ROTATING_IMAGE_RESIZED . $this->node->getSrc()
- );
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/RotatingImages/ImageThumbnailDecorator.php b/Toolkit/RotatingImages/ImageThumbnailDecorator.php
deleted file mode 100644
index 5f2fd0b..0000000
--- a/Toolkit/RotatingImages/ImageThumbnailDecorator.php
+++ /dev/null
@@ -1,81 +0,0 @@
-
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @version CVS: $Id: ImageThumbnailDecorator.php,v 1.1.1.1 2010/01/08 14:36:10 jamie Exp $
- * @link <>
- */
-
-
-/**
- * Decorator for horizontal banners
- *
- * @category RotatingImages
- * @package Toolkit_RotatingImages
- * @author Jamie Kahgee
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @link <>
- */
-class Toolkit_RotatingImages_ImageThumbnailDecorator
- extends Toolkit_RotatingImages_Decorator
-{
- // {{{ __construct()
-
-
- /**
- * constructor
- *
- * create a shallow copy of the node passed in so we can manipulate
- * it all we want and not worry about affecting the original object
- *
- * @param Toolkit_RotatingImages_Node $node node to be decorated
- *
- * @return void
- * @access protected
- */
- public function __construct(Toolkit_RotatingImages_Image $node)
- {
- // Clone the node object so we keep original properties the same
- $copiedNode = clone $node;
-
- $this->node = $copiedNode;
- }
-
- // }}}
- // {{{ toHtml()
-
-
- /**
- * Convert the image to a HTML string
- *
- * @param Toolkit_Image_Server $is Image server
- *
- * @return string HTML output of the image
- * @access public
- */
- public function toHtml(Toolkit_Image_Server $is)
- {
- $properties
- = $is->getImageSize(ROTATING_IMAGE_THUMB . $this->node->getSrc());
-
- $format = ' ';
- return sprintf(
- $format,
- $properties[0],
- $properties[1],
- ROTATING_IMAGE_THUMB . $this->node->getSrc()
- );
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/RotatingImages/ImagesDataGrid.php b/Toolkit/RotatingImages/ImagesDataGrid.php
deleted file mode 100644
index 78959d4..0000000
--- a/Toolkit/RotatingImages/ImagesDataGrid.php
+++ /dev/null
@@ -1,139 +0,0 @@
-addColumn($id);
-
- $delete =& new Structures_DataGrid_Column(
- 'Delete',
- null,
- null,
- array('class' => 'delLink'),
- null,
- array(&$this, 'renderDeleteLink')
- );
- $this->addColumn($delete);
-
- $edit =& new Structures_DataGrid_Column(
- 'Edit',
- null,
- null,
- array('class' => 'editLink'),
- null,
- array(&$this, 'renderEditLink')
- );
- $this->addColumn($edit);
-
- $url =& new Structures_DataGrid_Column(
- 'URL',
- 'url',
- 'url'
- );
- $this->addColumn($url);
-
- $image =& new Structures_DataGrid_Column(
- 'Image',
- null,
- null,
- array('class' => 'image'),
- null,
- array(&$this, 'renderImage')
- );
- $this->addColumn($image);
- }
-
- // }}}
- // {{{ renderEditLink()
-
- /**
- * Render the edit link for an image
- *
- * @param array $data DB record
- *
- * @return mixed Link to edit a banner
- * @access public
- */
- public function renderEditLink($data)
- {
- extract($data['record']);
- $imgFormat = ' Edit Image';
- $img = sprintf(
- $imgFormat,
- GLM_APP_BASE_URL . 'assets/icons/image_edit.png'
- );
-
- $linkFormat = '%s ';
- return sprintf(
- $linkFormat,
- BASE_URL . 'admin/rotatingImages.php',
- "action=edit&id=$id",
- $img
- );
- }
-
- // }}}
- // {{{ renderDeleteLink()
-
- /**
- * Render the delete link for an image
- *
- * @param array $data DB record
- *
- * @return mixed Link to edit a banner
- * @access public
- */
- public function renderDeleteLink($data)
- {
- extract($data['record']);
- $imgFormat = ' Delete Image';
- $img = sprintf(
- $imgFormat,
- GLM_APP_BASE_URL . 'assets/icons/image_delete.png'
- );
-
- $linkFormat = '%s ';
- return sprintf(
- $linkFormat,
- BASE_URL . 'admin/rotatingImages.php',
- "action=del&id=$id",
- $img);
- }
-
- // }}}
- // {{{ renderImage()
-
- /**
- * Render the delete link for an image
- *
- * @param array $data DB record
- *
- * @return mixed Link to edit a banner
- * @access public
- */
- public function renderImage($data)
- {
- extract($data['record']);
- $imgFormat = ' ';
- return sprintf(
- $imgFormat,
- ROTATING_IMAGE_THUMB . $image
- );
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/RotatingImages/InactiveImagesDataGrid.php b/Toolkit/RotatingImages/InactiveImagesDataGrid.php
deleted file mode 100644
index a035cbe..0000000
--- a/Toolkit/RotatingImages/InactiveImagesDataGrid.php
+++ /dev/null
@@ -1,30 +0,0 @@
-ctrlObj['tableId'] = 'disabled';
-// $this->ctrlObj['noRecMessage'] = 'No Disabled Images';
- $this->ctrlObj['gridName'] = 'Disabled Images';
- }
-
- // }}}
- // {{{ setQuery()
-
- public function setQuery()
- {
- $sql = "
- SELECT *
- FROM rotating_images
- WHERE active = false";
-
- parent::setQuery($sql);
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/RotatingImages/LiveDecorator.php b/Toolkit/RotatingImages/LiveDecorator.php
deleted file mode 100644
index f8f816b..0000000
--- a/Toolkit/RotatingImages/LiveDecorator.php
+++ /dev/null
@@ -1,192 +0,0 @@
-
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @version CVS: $Id: LiveDecorator.php,v 1.4 2010/01/25 20:22:04 jamie Exp $
- * @link <>
- */
-
-
-/**
- * Collection of banner decorators to rotate
- *
- * @category RotatingImages
- * @package Toolkit_RotatingImages
- * @author Jamie Kahgee
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @link <>
- */
-class Toolkit_RotatingImages_LiveDecorator
- implements IteratorAggregate, Toolkit_RotatingImages_IDecoratorsIterator
-{
- // {{{ properties
-
-
- /**
- * Banner decorators
- * @var array
- * @access private
- */
- private $_decorators;
-
- private $_loaded = false;
-
- // }}}
- // {{{ __construct()
-
- /**
- * constructor
- *
- * @return void
- * @access protected
- */
- public function __construct()
- {
- $this->_decorators = array();
- }
-
- // }}}
- // {{{ getIterator()
-
-
- /**
- * Set the external iterator
- *
- * @return object An instance of an object implementing Iterator or Traversable
- * @access public
- */
- public function getIterator()
- {
- return new ArrayIterator($this->_decorators);
- }
-
- // }}}
- // {{{ getTotal()
-
-
- /**
- * Gets the total number of decorators we have added
- *
- * @return array number of decorators in collection
- * @access public
- */
- public function getTotal()
- {
- return count($this->_decorators);
- }
-
- // }}}
- // {{{ add()
-
-
- /**
- * Adds a decorator to the collection
- *
- * @param Toolkit_RotatingImages_Decorator $d Decorator object
- *
- * @return void
- * @access public
- */
- public function add(Toolkit_RotatingImages_Decorator $d)
- {
- $this->_decorators[] = $d;
- }
-
- // }}}
- // {{{ toHtml()
-
-
- /**
- * Converts all decorator objects collection into an HTML string
- *
- * Adds the appropriate scripts to the page so we can use JS to
- * rotate through the banners
- *
- * @param Toolkit_Image_Server $is Image Server
- *
- * @return string HTML version of the static banners available
- * @access public
- */
- public function toHtml(Toolkit_Image_Server $is)
- {
- if (!$this->_loaded) {
- throw new LogicException(
- 'call getRotatingJavascript() before accessing'
- );
- }
-
- $GLOBALS['scripts'][] = GLM_APP_BASE_URL . 'libjs/plugins/cycle/2.73/jquery.cycle.all.min.js';
- $GLOBALS['scripts'][] = BASE_URL . 'Toolkit/RotatingImages/libjs/fade.js';
- $GLOBALS['styleSheets'][] = BASE_URL . 'Toolkit/RotatingImages/styles.css';
-
- $images = '';
- foreach ($this->_decorators as $i) {
- switch (get_class($i)) {
- case 'Toolkit_RotatingImages_ImageThumbnailDecorator' :
- case 'Toolkit_RotatingImages_ImageDecorator' :
- $images .= $i->toHtml($is);
- break;
-
- case 'Toolkit_RotatingImages_AnchorDecorator' :
- $images .= $i->toHtml($is);
- break;
-
- default :
- break;
- }
- }
-
- if (!empty($images)) {
- $ret = '';
- $ret .= '
';
- $ret .= "
";
- $ret .= '
';
- $ret .= '
';
-
- return $ret;
- } else {
- return '';
- }
- }
-
- // }}}
-
- // {{{ getRotatingJavascript()
-
- public function getRotatingJavascript($dbh)
- {
- $this->_loaded = true;
-
- try {
- $sql = "
- SELECT *, timeout * 1000 AS jstimeout
- FROM rotating_images_transitions";
- $row = $dbh->query($sql, PDO::FETCH_ASSOC)->fetch();
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
-
- $js = "";
-
- return $js;
- }
-
- // }}}
-}
diff --git a/Toolkit/RotatingImages/Node.php b/Toolkit/RotatingImages/Node.php
deleted file mode 100644
index 4b9f1e6..0000000
--- a/Toolkit/RotatingImages/Node.php
+++ /dev/null
@@ -1,53 +0,0 @@
-active = $active;
- }
-
- // }}}
- // {{{ getActive()
-
- public function getActive()
- {
- return $this->active;
- }
-
- // }}}
- // {{{ getId()
-
- public function getId()
- {
- return $this->id;
- }
-
- // }}}
- // {{{ insert()
- abstract public function insert(PDO $dbh);
- // }}}
- // {{{ update()
- abstract public function update(PDO $dbh);
- // }}}
- // {{{ find()
- abstract public static function find(PDO $dbh, $id);
- // }}}
- // {{{ delete()
- abstract public function delete(PDO $dbh, Toolkit_Image_Server $is);
-
- // }}}
-}
-?>
diff --git a/Toolkit/RotatingImages/NodesIterator.php b/Toolkit/RotatingImages/NodesIterator.php
deleted file mode 100644
index 291542c..0000000
--- a/Toolkit/RotatingImages/NodesIterator.php
+++ /dev/null
@@ -1,65 +0,0 @@
-_nodes = array();
- }
-
- public function getIterator()
- {
- return new ArrayIterator($this->_nodes);
- }
-
- public function addImage(Toolkit_RotatingImages_Node $node)
- {
- $this->_nodes[] = $node;
- }
-
- public function getNode($key)
- {
- if (!count($this->_nodes)) {
- return false;
- }
-
- if (!ctype_digit((string)$key)) {
- throw new InvalidArgumentException(
- '$key must be an integer.'
- );
- }
-
- return $this->_nodes[$key];
- }
-
- public function getTotal()
- {
- return count($this->_nodes);
- }
-
- public function findAll(PDO $dbh)
- {
- $this->_nodes = array();
-
- try {
- $sql = "
- SELECT *
- FROM rotating_images
- ORDER BY active DESC, pos, id";
-
- foreach ($dbh->query($sql) as $row) {
- if (!empty($row['url'])) {
- $this->_nodes[]
- = Toolkit_RotatingImages_Anchor::find($dbh, $row['id']);
- } else {
- $this->_nodes[]
- = Toolkit_RotatingImages_Image::find($dbh, $row['id']);
- }
- }
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-}
-?>
diff --git a/Toolkit/RotatingImages/PreviewDecorator.php b/Toolkit/RotatingImages/PreviewDecorator.php
deleted file mode 100644
index e8d0e38..0000000
--- a/Toolkit/RotatingImages/PreviewDecorator.php
+++ /dev/null
@@ -1,142 +0,0 @@
-
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @version CVS: $Id: PreviewDecorator.php,v 1.3 2010/01/25 20:22:04 jamie Exp $
- * @link <>
- */
-
-
-/**
- * Collection of banner decorators to rotate
- *
- * @category RotatingImages
- * @package Toolkit_RotatingImages
- * @author Jamie Kahgee
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com/ Gaslightmedia
- * @link <>
- */
-class Toolkit_RotatingImages_PreviewDecorator
- implements IteratorAggregate, Toolkit_RotatingImages_IDecoratorsIterator
-{
- // {{{ properties
-
-
- /**
- * Banner decorators
- * @var array
- * @access private
- */
- private $_decorators;
-
- // }}}
- // {{{ __construct()
-
- /**
- * constructor
- *
- * @return void
- * @access protected
- */
- public function __construct()
- {
- $this->_decorators = array();
- }
-
- // }}}
- // {{{ getIterator()
-
-
- /**
- * Set the external iterator
- *
- * @return object An instance of an object implementing Iterator or Traversable
- * @access public
- */
- public function getIterator()
- {
- return new ArrayIterator($this->_decorators);
- }
-
- // }}}
- // {{{ getTotal()
-
-
- /**
- * Gets the total number of decorators we have added
- *
- * @return array number of decorators in collection
- * @access public
- */
- public function getTotal()
- {
- return count($this->_decorators);
- }
-
- // }}}
- // {{{ add()
-
-
- /**
- * Adds a decorator to the collection
- *
- * @param Toolkit_RotatingImages_Decorator $d Decorator object
- *
- * @return void
- * @access public
- */
- public function add(Toolkit_RotatingImages_Decorator $d)
- {
- $this->_decorators[] = $d;
- }
-
- // }}}
- // {{{ toHtml()
-
-
- /**
- * Converts all decorator objects collection into an HTML string
- *
- * Adds the appropriate scripts to the page so we can use JS to
- * rotate through the banners
- *
- * @param Toolkit_Image_Server $is Image Server
- *
- * @return string HTML version of the static banners available
- * @access public
- */
- public function toHtml(Toolkit_Image_Server $is)
- {
- $GLOBALS['scripts'][] = GLM_APP_BASE_URL . 'libjs/plugins/cycle/2.73/jquery.cycle.all.min.js';
- $GLOBALS['scripts'][] = BASE_URL . 'Toolkit/RotatingImages/libjs/fade.js';
-
- foreach ($this->_decorators as $i) {
- switch (get_class($i)) {
- case 'Toolkit_RotatingImages_ImageThumbnailDecorator' :
- case 'Toolkit_RotatingImages_ImageDecorator' :
- $images .= $i->toHtml($is);
- break;
-
- case 'Toolkit_RotatingImages_AnchorDecorator' :
- $images .= $i->toHtml($is);
- break;
-
- default :
- break;
- }
- }
-
- return "$images
\n";
- }
-
- // }}}
-}
diff --git a/Toolkit/RotatingImages/TransitionPreview.php b/Toolkit/RotatingImages/TransitionPreview.php
deleted file mode 100644
index 3df93a6..0000000
--- a/Toolkit/RotatingImages/TransitionPreview.php
+++ /dev/null
@@ -1,41 +0,0 @@
-query($sql, PDO::FETCH_ASSOC)->fetchAll();
- } catch (PDOException $e) {
- Toolkit_Common::handleError($e);
- }
-
- $is = new Toolkit_Image_Server();
- $fadingDecorator = new Toolkit_RotatingImages_PreviewDecorator();
- foreach ($images as $v) {
- $image = new Toolkit_RotatingImages_Image(
- $v['active'],
- $v['image']
- );
- $thumbnailDecorator
- = new Toolkit_RotatingImages_ImageThumbnailDecorator($image);
-
- $fadingDecorator->add($thumbnailDecorator);
- }
-
- return $fadingDecorator->toHtml($is);
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/RotatingImages/TransitionSettingsForm.php b/Toolkit/RotatingImages/TransitionSettingsForm.php
deleted file mode 100644
index 0cd49c8..0000000
--- a/Toolkit/RotatingImages/TransitionSettingsForm.php
+++ /dev/null
@@ -1,245 +0,0 @@
-
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version CVS: $Id: TransitionSettingsForm.php,v 1.3 2010/01/25 20:22:04 jamie Exp $
- * @link http://demo.gaslightmedia.com
- */
-
-/**
- * Rotating Images Application
- *
- * Manages the creation and editing form for manipulating banners in the db.
- *
- * @category RotatingImages
- * @package Toolkit_RotatingImages
- * @author Jamie Kahgee
- * @copyright 2008 Gaslight Media
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @link http://demo.gaslightmedia.com
- */
-class Toolkit_RotatingImages_TransitionSettingsForm
- extends Toolkit_FormBuilder
-{
- // {{{ properties
-
- /**
- * What do you want the success msg to be if the form validates successfully
- *
- * @var string
- * @access protected
- */
- protected $successMsg
- = 'Settings successfully updated.
';
-
- /**
- * The default rules to register for validating
- *
- * We have to register these rules, or any others we want, before
- * we are able to use them in our forms.
- *
- * @var string
- * @access protected
- */
- protected $registeredRules = array();
-
- // }}}
-
- // {{{ configureDefaults()
-
- /**
- * Configure the initial default values for the form
- *
- * @param PDO $dbh Database handler
- *
- * @return void
- * @access protected
- */
- public function configureDefaults(PDO $dbh)
- {
- $sql = "
- SELECT *
- FROM rotating_images_transitions";
-
- $d = $dbh->query($sql, PDO::FETCH_ASSOC)->fetch();
-
- $this->setupDefaults($d);
- }
-
- // }}}
- // {{{ configureElements()
-
- /**
- * Configure how the form elements should look
- *
- * @param PDO $dbh Database handler
- * @param Config_Container $c Configuration object
- *
- * @return void
- * @access public
- */
- public function configureElements(PDO $dbh, Config_Container $c)
- {
- $e = array();
-
- $rotationTime =& $c->getItem('section', 'rotation time')
- ->getItem('directive', 'timeout')
- ->getContent();
- $timeout = array_combine(
- array_values($rotationTime),
- array_values($rotationTime)
- );
- $timeout = array_change_key_case($timeout);
-
- $animationType =& $c->getItem('section', 'animation type')
- ->getItem('directive', 'transition')
- ->getContent();
- $transition = array_combine(
- array_values($animationType),
- array_values($animationType)
- );
-// $transition = array_change_key_case($transition);
-
- // All Grouped Elements are created here.
-
- // All Elements are created here. This includes group element definitions.
- $e[] = array(
- 'type' => 'select',
- 'req' => false,
- 'name' => 'timeout',
- 'display' => 'Seconds between transition',
- 'opts' => array('' => '-- Select --') + $timeout,
- 'att' => array('id' => 'timeout')
- );
- $e[] = array(
- 'type' => 'select',
- 'req' => false,
- 'name' => 'transition',
- 'display' => 'Transition effect',
- 'opts' => array('' => '-- Select --') + $transition,
- 'att' => array('id' => 'transition')
- );
- $e[] = array(
- 'type' => 'submit',
- 'req' => false,
- 'name' => 'submit',
- 'display' => 'Apply Transition',
- 'opts' => array('id' => 'submit')
- );
-
- $this->setupElements($e);
- }
-
- // }}}
- // {{{ configureForm()
-
- /**
- * Configure a form so we can use it
- *
- * @param PDO $pdo Database handler
- * @param Config_Container $c Application configuration settings
- *
- * @return void
- * @access public
- */
- public function configureForm(PDO $pdo, Config_Container $c)
- {
- $this->configureElements($pdo, $c);
- $this->configureDefaults($pdo);
- }
-
- // }}}
-
- // {{{ processData()
-
- /**
- * Update transition values
- *
- * @param PDO $dbh Database handler
- *
- * @return boolean Result of update
- * @access protected
- */
- private function _processData(PDO $dbh)
- {
- try {
- $sql = "
- UPDATE rotating_images_transitions
- SET timeout = :timeout,
- transition = :transition";
-
- $stmt = $dbh->prepare($sql);
- $stmt->bindParam(
- ':timeout',
- $this->_submitValues['timeout'],
- PDO::PARAM_INT
- );
- $stmt->bindParam(
- ':transition',
- $this->_submitValues['transition'],
- PDO::PARAM_INT
- );
-
- return $stmt->execute();
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
-
- // {{{ setupRenderers()
- // @codeCoverageIgnoreStart
-
- /**
- * Custom rendering templates for special fields on the form
- *
- * @return void
- * @access protected
- */
- protected function setupRenderers()
- {
- parent::setupRenderers();
- $renderer =& $this->defaultRenderer();
- $renderer->setFormTemplate('');
- $renderer->setElementTemplate(''.$required.'{label}'.$error.'{element} ', 'submit');
- }
-
- // @codeCoverageIgnoreEnd
- // }}}
-
- // {{{ toHtml()
-
- /**
- * Call the rendering function to get the form in a string
- *
- * @return string $output The Form to be rendered or success msg.
- * @access protected
- */
- public function toHtml(PDO $pdo)
- {
- $GLOBALS['styleSheets'][] = BASE_URL . 'form.css';
-
- $this->setupRenderers();
- $output = '';
- if ($this->validate()) {
- if ($this->_processData($pdo)) {
- $output = $this->successMsg;
- }
- }
- $output .= parent::toHTML();
-
- return $output;
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/RotatingImages/ajax.php b/Toolkit/RotatingImages/ajax.php
deleted file mode 100644
index 9164e62..0000000
--- a/Toolkit/RotatingImages/ajax.php
+++ /dev/null
@@ -1,37 +0,0 @@
-beginTransaction();
- $sql = "
- UPDATE rotating_images
- SET active = false, pos = null";
-
- $dbh->query($sql);
-
- $sql = "
- UPDATE rotating_images
- SET active = true, pos = :pos
- WHERE id = :id";
- $stmt = $dbh->prepare($sql);
- $i = 1;
- foreach ($_POST['image'] as $v) {
- $stmt->bindParam(':pos', $i, PDO::PARAM_INT);
- $stmt->bindParam(':id', $v, PDO::PARAM_INT);
- $stmt->execute();
- ++$i;
- }
- return $dbh->commit();
-} catch (PDOException $e) {
- $dbh->rollback();
- return Toolkit_Common::handleError($e);
-}
-?>
diff --git a/Toolkit/RotatingImages/assets/.keepme b/Toolkit/RotatingImages/assets/.keepme
deleted file mode 100644
index e69de29..0000000
diff --git a/Toolkit/RotatingImages/config.ini b/Toolkit/RotatingImages/config.ini
deleted file mode 100644
index b267c90..0000000
--- a/Toolkit/RotatingImages/config.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-[conf]
-; Application Name
-applicationName = "Rotating Images"
-
-; time between the fades in milliseconds
-[rotation time]
-timeout[] = 1
-timeout[] = 2
-timeout[] = 3
-timeout[] = 4
-timeout[] = 5
-timeout[] = 10
-timeout[] = 15
-timeout[] = 20
-timeout[] = 25
-timeout[] = 30
-
-; type of animation 'fade' or 'slide'
-[animation type]
-transition[] = "blindX"
-transition[] = "blindY"
-transition[] = "blindZ"
-transition[] = "cover"
-transition[] = "curtainX"
-transition[] = "curtainY"
-transition[] = "fade"
-transition[] = "fadeZoom"
-transition[] = "growX"
-transition[] = "growY"
-transition[] = "scrollUp"
-transition[] = "scrollDown"
-transition[] = "scrollLeft"
-transition[] = "scrollRight"
-transition[] = "scrollHorz"
-transition[] = "scrollVert"
-transition[] = "slideX"
-transition[] = "slideY"
-transition[] = "turnUp"
-transition[] = "turnDown"
-transition[] = "turnLeft"
-transition[] = "turnRight"
-transition[] = "uncover"
-transition[] = "wipe"
-transition[] = "zoom"
diff --git a/Toolkit/RotatingImages/libjs/fade.js b/Toolkit/RotatingImages/libjs/fade.js
deleted file mode 100644
index 7e06993..0000000
--- a/Toolkit/RotatingImages/libjs/fade.js
+++ /dev/null
@@ -1,53 +0,0 @@
-var fade =
-{
- timeout: null,
- animationtype: null,
- container: '#rotatingImagesPreview',
- height: '75px',
-
- init: function()
- {
- setTimeout(function() {
- $('#form-success-top').fadeOut('slow');
- }, 4000);
-
- // Get the dom nodes
- fade.timeout = $('#timeout');
- fade.animationtype = $('#transition');
-
- $('#submit').attr("disabled", "disabled");
-
- // Bind events
- fade.timeout
- .change(fade.update)
- .change(fade.activateSubmit);
- fade.animationtype
- .change(fade.update)
- .change(fade.activateSubmit);
-
- // Start the innerfade
- $(fade.container).cycle({
- timeout: fade.timeout.val() * 1000,
- fx: fade.animationtype.val(),
- height: fade.height
- });
- },
-
- activateSubmit: function()
- {
- $('#submit').removeAttr('disabled');
- },
-
- update: function()
- {
- $(fade.container).cycle('stop');
- // reassign the cycle with new settings.
- $(fade.container).cycle({
- timeout: fade.timeout.val() * 1000,
- fx: fade.animationtype.val(),
- height: fade.height
- });
- }
-};
-
-$(document).ready(fade.init);
diff --git a/Toolkit/RotatingImages/libjs/sortable.js b/Toolkit/RotatingImages/libjs/sortable.js
deleted file mode 100644
index 9adfd46..0000000
--- a/Toolkit/RotatingImages/libjs/sortable.js
+++ /dev/null
@@ -1,52 +0,0 @@
-var RISortable =
-{
- init: function()
- {
- $('#active, #disabled').sortable({
- connectWith: 'ul',
- revert: true,
- cancel: '.ui-state-disabled',
- distance: 15,
- forcePlaceholderSize: true,
- placeholder: 'ui-state-highlight',
- cursor: 'move',
- receive: RISortable.receive,
- remove: RISortable.remove,
- stop: RISortable.stop,
- opacity: 0.6
- });
- $('.dataGrid').disableSelection();
- },
-
- receive: function(event, ui)
- {
- if ($(this).children('.ui-state-disabled').is('li')) {
- $(this).children('.ui-state-disabled').remove();
- }
- },
-
- remove: function(event, ui)
- {
- if ($(this).children().length == 0) {
- $(this).html('Drag image here to add ');
- }
- },
-
- stop: function(event, ui)
- {
- var order = $('#active').sortable('serialize');
-
- $.post('../Toolkit/RotatingImages/ajax.php', order+'&action=updateOrder');
-
- $(fade.container).empty();
- $('#active img.thumbnail').each(function() {
- var copy = $(this).clone();
- copy.removeAttr('class')
- .removeAttr('alt');
- copy.appendTo(fade.container);
- });
- fade.update();
- }
-};
-
-$(document).ready(RISortable.init);
diff --git a/Toolkit/RotatingImages/styles.css b/Toolkit/RotatingImages/styles.css
deleted file mode 100644
index fa468ea..0000000
--- a/Toolkit/RotatingImages/styles.css
+++ /dev/null
@@ -1,106 +0,0 @@
-ul.dataGrid {
- list-style-type: none;
- margin: 0;
- padding: 0;
-}
-ul.dataGrid li {
- margin: 0 5px 5px 5px;
- padding: 5px;
-}
-.ui-state-default {
- width: 500px;
- height: 120px;
- clear: left;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- padding: 10px !important;
- border: 1px solid #999 !important }
-h2 {
- clear: left;
-}
-.thumbnail {
- float: left;
- -webkit-box-shadow: 2px 2px 5px #ccc;
- -moz-box-shadow: 2px 2px 5px #ccc;
-}
-.ui-state-default {
- }
-.info {
- border: 1px solid #ccc;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- -moz-box-shadow: 2px 2px 5px #ccc;
- -webkit-box-shadow: 2px 2px 5px #ccc;
- background: #eee;
-
- margin: 0 10px;
- float: right;
- width: 250px;
- padding: 10px;
- height: 80px;
-}
-.info img {
- border: 0;
-}
-.info a {
- text-decoration: underline !important;
-}
-.info a:hover {
- color: black;
- font-weight: bold;
- text-decoration: none !important;
-}
-.webform {
- width: 250px;
-}
-h2 {
- margin-top: 0;
- padding-top: 1em;
-}
-#instructions {
- width: 500px;
- clear: left;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- padding: 10px !important;
- border: 1px solid #D5DFC3;
- background: #F3FFDF;
- margin-top: 6px;
-}
-
-/* Slideshow */
-#transition-settings {
- float: left;
- margin: 0 10px 0 0;
- display: block;
- width: 300px;
-}
-#rotatingImagesPreview {
- float: left;
-}
-#rotatingImagesLive {
- color: orange;
- font-weight: bold;
- height: 1%;
- overflow: hidden;
-}
-#rotatingImagesLive #images {
- overflow: hidden;
-}
-#rotatingImagesLive #images img {
- border-bottom: 5px solid #f7941d;
-}
-#if-prev,
-#if-next {
- text-decoration: underline;
- cursor: hand;
- cursor: pointer;
- color: orange;
-}
-#if-prev:hover,
-#if-next:hover {
- color: black;
-}
diff --git a/Toolkit/RotatingImages/templates/compiled/.cvsignore b/Toolkit/RotatingImages/templates/compiled/.cvsignore
deleted file mode 100644
index c8487fd..0000000
--- a/Toolkit/RotatingImages/templates/compiled/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*
-*/*
diff --git a/Toolkit/RotatingImages/templates/compiled/.keepme b/Toolkit/RotatingImages/templates/compiled/.keepme
deleted file mode 100644
index e69de29..0000000
diff --git a/Toolkit/RotatingImages/templates/currentTables/Element.tpl b/Toolkit/RotatingImages/templates/currentTables/Element.tpl
deleted file mode 100755
index 595457b..0000000
--- a/Toolkit/RotatingImages/templates/currentTables/Element.tpl
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
- *
-
- {label}
-
-
-
- {error}
-
- {element}
-
-
diff --git a/Toolkit/RotatingImages/templates/currentTables/Form.tpl b/Toolkit/RotatingImages/templates/currentTables/Form.tpl
deleted file mode 100755
index f59286a..0000000
--- a/Toolkit/RotatingImages/templates/currentTables/Form.tpl
+++ /dev/null
@@ -1,7 +0,0 @@
-
diff --git a/Toolkit/RotatingImages/templates/currentTables/Group.tpl b/Toolkit/RotatingImages/templates/currentTables/Group.tpl
deleted file mode 100755
index cdd24cf..0000000
--- a/Toolkit/RotatingImages/templates/currentTables/Group.tpl
+++ /dev/null
@@ -1,5 +0,0 @@
-
diff --git a/Toolkit/RotatingImages/templates/currentTables/GroupElement.tpl b/Toolkit/RotatingImages/templates/currentTables/GroupElement.tpl
deleted file mode 100755
index 1a4ba27..0000000
--- a/Toolkit/RotatingImages/templates/currentTables/GroupElement.tpl
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
- {element}
-
- *
-
- {label}
-
-
diff --git a/Toolkit/RotatingImages/templates/currentTables/Header.tpl b/Toolkit/RotatingImages/templates/currentTables/Header.tpl
deleted file mode 100755
index 64ac244..0000000
--- a/Toolkit/RotatingImages/templates/currentTables/Header.tpl
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- {header}
-
-
diff --git a/Toolkit/RotatingImages/templates/currentTables/RequiredNote.tpl b/Toolkit/RotatingImages/templates/currentTables/RequiredNote.tpl
deleted file mode 100755
index dad5d0b..0000000
--- a/Toolkit/RotatingImages/templates/currentTables/RequiredNote.tpl
+++ /dev/null
@@ -1 +0,0 @@
-* = Required Fields
diff --git a/Toolkit/RotatingImages/templates/imagesDataGrid.html b/Toolkit/RotatingImages/templates/imagesDataGrid.html
deleted file mode 100644
index eddba01..0000000
--- a/Toolkit/RotatingImages/templates/imagesDataGrid.html
+++ /dev/null
@@ -1,32 +0,0 @@
-{gridName:h}
-
- {if:numberedSet}
- {foreach:recordSet,row}
-
-
- {row[Image]:h}
-
-
- {row[Delete]:h}
-
-
- {row[Edit]:h}
-
- {if:row[url]}
-
Link:
{row[url]:h}
- {end:}
-
-
- {end:}
- {else:}
-
- Drag image here to add
-
- {end:}
-
diff --git a/Toolkit/RotatingImages/templates/instructions.html b/Toolkit/RotatingImages/templates/instructions.html
deleted file mode 100644
index 6d5fd58..0000000
--- a/Toolkit/RotatingImages/templates/instructions.html
+++ /dev/null
@@ -1,7 +0,0 @@
-
-Instructions
-Recommended image size is
-Width: 545 pixels
-Height: 253 pixels
-
-Slideshow Settings
diff --git a/Toolkit/ShortURL.php b/Toolkit/ShortURL.php
deleted file mode 100755
index 14c622a..0000000
--- a/Toolkit/ShortURL.php
+++ /dev/null
@@ -1,160 +0,0 @@
-
- * @copyright 2009 Gaslight Media
- * @license Gaslight Media
- * @version CVS: $Id: ShortURL.php,v 1.3 2009/06/24 01:30:02 matrix Exp $
- * @link <>
- */
-
-/**
- * Toolkit_ShortURL
- *
- * Integration of Toolbox with creation of ShortURL
- * the url rewrite happens with one line of code in .htaccess
- * RewriteRule ^([A-Za-z0-9_-]*)$ index.php?page=$1 [L]
- * index page checks for $_GET['page'] and then calls
- * getShortUrlId to get the page's catid. If not found it
- * defaults to HOME_ID
- *
- * @category Toolkit
- * @package Toolkit_ShortURL
- * @author Steve Sutton
- * @copyright 2009 Gaslight Media
- * @license Gaslight Media
- * @version Release: @package_version@
- * @link <>
- */
-class Toolkit_ShortURL
-{
- // {{{ Class Properties
- /**
- * PDO Global object
- * @var string
- * @access protected
- */
- public $dbh;
- // }}}
-
- // {{{ __construct()
-
- /**
- * __construct()
- *
- * @param object &$dbh from setup.phtml
- *
- * @return void
- * @access public
- */
- function __construct(&$dbh)
- {
- $this->dbh = $dbh;
- }
-
- // }}}
- // {{{ getShortUrl()
-
- /**
- * getShortUrl()
- *
- * grab the shorturl from bus_category table
- * else return false
- *
- * @param string $id bus_category id
- *
- * @return mixed ShortURL from bus_category
- * @access public
- */
- function getShortUrl($id)
- {
- $sql = "
- SELECT short_url
- FROM bus_category
- WHERE id = :id";
- try {
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $id, PDO::PARAM_INT);
- $stmt->execute();
- return $stmt->fetchColumn();
- } catch(PDOException $e) {
- Toolkit_Common::handleError($e);
- }
- return false;
- }
-
- // }}}
- // {{{ getShortUrlId()
-
- /**
- * getShortUrlId()
- *
- * grab the id from bus_category table
- * else return false
- *
- * @param string $short_url bus_category short_url
- *
- * @return mixed catid for page or HOME_ID if not found
- * @access public
- */
- function getShortUrlId($short_url)
- {
- $sql = "
- SELECT id
- FROM bus_category
- WHERE short_url = :short_url";
- try {
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":short_url", $short_url, PDO::PARAM_STR);
- $stmt->execute();
- return $stmt->fetchColumn();
- } catch(PDOException $e) {
- Toolkit_Common::handleError($e);
- }
- return HOME_ID;
- }
-
- // }}}
- // {{{ isValidUrlName()
- /**
- * check the short url nam eto make sure it doesn't match any file names in the root
- *
- * @param mixed $url requested short url name
- *
- * @access public
- * @return string
- */
- public function isValidUrlName($url)
- {
- if (is_dir(BASE)) {
- if (file_exists(BASE . $url)) {
- return false;
- }
- if (file_exists(BASE . $url.'.php')) {
- return false;
- }
- if (file_exists(BASE . $url.'.css')) {
- return false;
- }
- if (file_exists(BASE . $url.'.html')) {
- return false;
- }
- if (file_exists(BASE . $url.'.js')) {
- return false;
- }
- return true;
- } else {
- throw new Exception('Main Web root dir define BASE not set');
- }
- }
- // }}}
-}
-?>
diff --git a/Toolkit/SiteMap.php b/Toolkit/SiteMap.php
deleted file mode 100755
index 1b84c68..0000000
--- a/Toolkit/SiteMap.php
+++ /dev/null
@@ -1,156 +0,0 @@
-
- * @copyright 2009 Gaslight Media
- * @license Gaslight Media
- * @version CVS: $Id: SiteMap.php,v 1.6 2009/06/17 23:01:20 jamie Exp $
- * @link <>
- */
-
-/**
- * Toolkit_SiteMap
- *
- * Generate a sitemap for the site
- * need to remove members only pages and other pages you
- * don't want viewed by public
- *
- * @category Toolkit
- * @package Toolkit_SiteMap
- * @author Steve Sutton
- * @copyright 2009 Gaslight Media
- * @license Gaslight Media
- * @link <>
- */
-class Toolkit_SiteMap
-{
- // {{{ Properties
- /**
- * Description for var
- * @var string
- * @access public
- */
- var $beginLevel = "";
-
- /**
- * Description for var
- * @var string
- * @access public
- */
- var $endLevel = " ";
-
- /**
- * Description for var
- * @var string
- * @access public
- */
- var $beginItem = "";
-
- /**
- * Description for var
- * @var string
- * @access public
- */
- var $endItem = " ";
-
- /**
- * Description for var
- * @var string
- * @access public
- */
- var $wholeThread;
-
- /**
- * Description for var
- * @var string
- * @access public
- */
- var $search = "";
-
- /**
- * Description for var
- * @var unknown
- * @access public
- */
- var $DB;
- // }}}
- // {{{ __construct()
- /**
- * __construct
- *
- * Must be given a GLM_TEMPLATE object
- *
- * @param mixed $toolbox GLM_TEMPLATE Object
- *
- * @return void
- * @access public
- */
- function __construct(GLM_TEMPLATE $toolbox)
- {
- $this->toolbox =& $toolbox;
- $this->DB =& $toolbox->DB;
- }
- // }}}
- // {{{ sortChilds()
- /**
- * sortChilds
- *
- * Sort by Parent
- *
- * @param unknown $threads Array
- *
- * @return array Return array
- * @access public
- */
- function sortChilds($threads)
- {
- while (list($var, $value) = each($threads)) {
- $childs[$value['parent']][$value['id']] = $value;
- }
- return $childs;
- }
- // }}}
- // {{{ convertToThread()
- /**
- * convertToThread
- *
- * outputs the array with the correct styles and code applied
- *
- * @param unknown $threads Thread array
- * @param unknown $thread Start with thread[0] will work it way down
- *
- * @return wholeThread
- * @access public
- **/
- function convertToThread($threads, $thread)
- {
- static $p,$level_counter;
- if (!$level_counter) {
- $level_counter = 1;
- }
- $this->wholeThread .= $this->beginLevel;
- while (list($parent, $value) = each($thread)) {
- $this->wholeThread .= $this->beginItem;
- $page = $value['url'];
- $this->wholeThread .= '';
- $this->wholeThread .= $value["category"]
- . " ";
- if ($threads[$parent]) {
- ++$level_counter;
- $this->convertToThread($threads, $threads[$parent]);
- --$level_counter;
- }
- $this->wholeThread .= $this->endItem ."\n";
- }
- $this->wholeThread .= $this->endLevel;
- return $this->wholeThread;
- }
- // }}}
-}
-?>
diff --git a/Toolkit/SortForm.php b/Toolkit/SortForm.php
deleted file mode 100644
index c5a1fc8..0000000
--- a/Toolkit/SortForm.php
+++ /dev/null
@@ -1,67 +0,0 @@
-
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version CVS: $Id: SortForm.php,v 1.6 2010/01/18 02:09:05 jamie Exp $
- * @link http://demo.gaslightmedia.com
- */
-
-/**
- * Creates a sortform to be used w/ datagrid DataGrids
- *
- * @category HTML
- * @package Toolkit_SortForm
- * @author Jamie Kahgee
- * @copyright 2008 Gaslight Media
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @link http://demo.gaslightmedia.com
- */
-class Toolkit_SortForm extends Toolkit_FormBuilder
-{
- // {{{ properties
-
- /**
- * The default rules to register for validating
- *
- * @var string
- * @access protected
- */
- protected $registeredRules = array();
-
- // }}}
- // {{{ toHTML()
-
- /**
- * Render the form to a string
- *
- * Handle the rendering and validation of the form when displayed
- * and submitted.
- *
- * @return string html form
- * @access public
- */
- public function toHTML()
- {
- $this->setupRenderers();
- if ($this->validate()) {
- $output = parent::toHTML();
- } else if ($this->isSubmitted()) {
- $output = $this->errorMsg;
- $output .= parent::toHTML();
- } else {
- $output = parent::toHTML();
- }
- return $output;
- }
-
- // }}}
-}
-?>
diff --git a/Toolkit/Toolbox/Admin/EditPage.php b/Toolkit/Toolbox/Admin/EditPage.php
deleted file mode 100644
index f29a0f9..0000000
--- a/Toolkit/Toolbox/Admin/EditPage.php
+++ /dev/null
@@ -1,1044 +0,0 @@
-
- * @release CVS: $Id: EditPage.php,v 1.16 2010/01/09 18:59:45 jamie Exp $:
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @link http://demo.gaslightmedia.com
- */
-
-/**
- * Edit Toolbox page
- *
- * Handles form to insert/edit a toolbox page
- *
- * @category Toolbox
- * @package Toolkit_Toolbox
- * @author Jamie Kahgee
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @link http://demo.gaslightmedia.com
- */
-class Toolkit_Toolbox_Admin_EditPage
- extends Toolkit_FormBuilder implements Toolkit_Form
-{
- // {{{ properties
-
- /**
- * Primary database table we need to interact with
- * @var string
- * @access protected
- */
- public $tableName = 'bus_category';
-
- /**
- * How many levels deep do you want to show in the parent select list
- *
- * 0 = Show All Levels
- *
- * @var integer
- * @access protected
- */
- protected $maxDepth = 0;
-
- /**
- * Don't need to register any rules for this form.
- * @var array
- * @access protected
- */
- protected $registeredRules = array();
-
- // }}}
- // {{{ __construct()
-
- /**
- * Class constructor
- *
- * Sets the database handler this class will use via the PDO passed in
- * from the parameters. Sets up the flexyOptions from the default options
- * defined in the setup.phtml file, updates where the templates directory
- * and compiled templates directory are located.
- *
- * @param PDO $pdo PHP Data Object used to set the database
- * handler
- * @param string $formName Form's name.
- * @param string $method (optional) Form's method defaults to 'POST'
- * @param string $action (optional) Form's action
- * @param string $target (optional) Form's target defaults to '_self'
- * @param mixed $attributes (optional) Extra attributes for tag
- * @param bool $trackSubmit (optional) Whether to track if the form was
- * submitted by adding a special hidden field
- *
- * @access public
- * @see Toolkit_FormBuilder, HTML_QuickForm
- */
- public function __construct(
- PDO $pdo,
- $formName,
- $method = 'post',
- $action = '',
- $target = '',
- $attributes = null,
- $trackSubmit = false
- ) {
- parent::__construct(
- $formName,
- $method,
- $action,
- $target,
- $attributes,
- $trackSubmit
- );
-
- $this->dbh = $pdo;
-
- $this->flexyOptions = $GLOBALS['flexyOptions'];
- $this->flexyOptions['templateDir'] = TEMPLATES_DIR;
- $this->flexyOptions['compileDir'] = COMPILED_DIR;
- }
-
- // }}}
-
- // {{{ configureDefaults()
-
- /**
- * Initializes default form values
- *
- * @return void
- * @access public
- */
- public function configureDefaults()
- {
- if (is_numeric($_GET['id'])) {
- try {
- $sql = "
- SELECT *
- FROM {$this->tableName}
- WHERE id = :id";
-
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(':id', $_GET['id'], PDO::PARAM_INT);
- $stmt->execute();
- $d = $stmt->fetch();
- $i = ' ';
-
- $d['current_image'] = sprintf($i, THUMB . $d['image']);
-
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- } else {
- $d = array(
- 'template' => 1,
- );
- }
- $this->setupDefaults($d);
- }
-
- // }}}
- // {{{ configureElements()
-
- /**
- * Form element definitions
- *
- * @param Config_Container $c Configuration object
- *
- * @return void
- * @access public
- */
- public function configureElements(Config_Container $c)
- {
- $e = array();
-
- // get reference to [listing type] section of config file
- $pluralType = $c->getItem('section', 'listing type')
- ->getItem('directive', 'plural')
- ->getContent();
-
- // Grouped Elements are defined here.
- $submitBtns = array();
-
- $submitBtns[] = array(
- 'type' => 'submit',
- 'req' => false,
- 'name' => 'update_rmv',
- 'display' => 'Update'
- );
- $submitBtns[] = array(
- 'type' => 'submit',
- 'req' => false,
- 'name' => 'cancel_rmv',
- 'display' => 'Cancel'
- );
- $submitBtns[] = array(
- 'type' => 'submit',
- 'req' => false,
- 'name' => 'delete_rmv',
- 'display' => 'Delete'
- );
-
- $templates = array();
-
- $options = range(1, 6);
- foreach ($options as $i) {
- $img = " ";
-
- $templates[] = array(
- 'type' => 'radio',
- 'req' => false,
- 'name' => 'template',
- 'display' => "Template $i $img",
- 'att' => $i,
- 'opts' => $i,
- );
- }
-
- // All Elements are created here.
- // This includes group element definitions.
- $res = $this->getConstant('MEMBERS_DB');
- $isErr = PEAR::isError($res);
- if ($isErr) {
- Toolkit_Common::handleError($e);
- }
- if ($res && !$isErr) {
- $e[] = array(
- 'type' => 'header',
- 'req' => false,
- 'name' => 'memberDbHdr',
- 'display' => $pluralType,
- );
- $e[] = array(
- 'type' => 'static',
- 'req' => false,
- 'name' => 'pageCategories'
- );
- // Note that we call to populate this select list at the
- // bottom of this function after the element is made
- // so we load attributes (classes) into each option as needed.
- $e[] = array(
- 'type' => 'select',
- 'req' => false,
- 'name' => 'memberCat',
- 'display' => 'Member Categories',
- 'opts' => array('' => '-- None --'),
- 'att' => array(
- 'multiple' => 'multiple',
- 'size' => 7
- )
- );
- $e[] = array(
- 'type' => 'advcheckbox',
- 'req' => false,
- 'name' => 'no_search_form',
- 'display' => 'Search Box',
- 'val' => array(0, 1)
- );
- }
- $e[] = array(
- 'type' => 'header',
- 'req' => false,
- 'name' => 'pageAttributesHdr',
- 'display' => 'Page Attributes'
- );
- $e[] = array(
- 'type' => 'text',
- 'req' => false,
- 'name' => 'category',
- 'display' => 'Navigation Name'
- );
- $e[] = array(
- 'type' => 'select',
- 'req' => false,
- 'name' => 'parent',
- 'display' => 'Parent Page',
- 'opts' => array('0' => '-- No Parent --'),
- );
- $e[] = array(
- 'type' => 'text',
- 'req' => false,
- 'name' => 'keyword',
- 'display' => 'Keyword'
- );
- $e[] = array(
- 'type' => 'advcheckbox',
- 'req' => false,
- 'name' => 'section_links',
- 'display' => 'Search',
- 'opts' => 'Create a list of links to the paragraph headlines',
- 'val' => array(0, 1)
- );
- $res = $this->getConstant('HOME_HEADLINES');
- $isErr = PEAR::isError($res);
- if ($isErr) {
- Toolkit_Common::handleError($e);
- }
- if ($res && !$isErr) {
- $e[] = array(
- 'type' => 'header',
- 'req' => false,
- 'name' => 'homePageHeadlinesHdr',
- 'display' => 'Headlines'
- );
- $e[] = array(
- 'type' => 'advcheckbox',
- 'req' => false,
- 'name' => 'featured',
- 'display' => 'Home Page Headlines',
- 'val' => array(0, 1)
- );
- $e[] = array(
- 'type' => 'text',
- 'req' => false,
- 'name' => 'feature_intro',
- 'display' => 'Headline Intro'
- );
- }
- $e[] = array(
- 'type' => 'header',
- 'req' => false,
- 'name' => 'pageBodyHdr',
- 'display' => 'Page Body'
- );
- $e[] = array(
- 'type' => 'text',
- 'req' => false,
- 'name' => 'intro',
- 'display' => 'Page Title'
- );
- $e[] = array(
- 'type' => 'textarea',
- 'req' => false,
- 'name' => 'description',
- 'display' => 'Description',
- 'opts' => array(
- 'cols' => 70,
- 'rows' => 25
- ),
- );
- if ($this->hasUploadedImage()) {
- $e[] = array(
- 'type' => 'static',
- 'req' => false,
- 'name' => 'current_image',
- 'display' => 'Current Image'
- );
- $e[] = array(
- 'type' => 'text',
- 'req' => false,
- 'name' => 'imagename',
- 'display' => 'Image Caption'
- );
- $e[] = array(
- 'type' => 'checkbox',
- 'req' => false,
- 'name' => 'remove_image',
- 'display' => 'Delete Image'
- );
- }
- $e[] = array(
- 'type' => 'file',
- 'req' => false,
- 'name' => 'image',
- 'display' => 'New Image'
- );
- $e[] = array(
- 'type' => 'group',
- 'req' => false,
- 'name' => 'page_layout',
- 'group' => $templates,
- 'label' => 'Template',
- 'seperator' => '',
- 'appendName' => false
- );
-
- // If we are editing a page, show three submit buttons
- // otherwise, just show one insert button.
- if (is_numeric($_GET['id'])) {
- $e[] = array(
- 'type' => 'group',
- 'req' => false,
- 'name' => 'submit_buttons',
- 'group' => $submitBtns,
- 'label' => '',
- 'seperator' => '',
- 'appendName' => false,
- );
- } else {
- $e[] = array(
- 'type' => 'submit',
- 'req' => false,
- 'name' => 'insert_rmv',
- 'display' => 'Insert'
- );
- }
-
- $this->setupElements($e);
- // Load the member categories after the elements have been created
- // so we can get more control how the options are rendered
- // ie (adding classes to them)
- $res = $this->getConstant('MEMBERS_DB');
- $isErr = PEAR::isError($res);
- if ($isErr) {
- Toolkit_Common::handleError($e);
- }
- if ($res && !$isErr) {
- $this->loadMemberCategories();
- }
- // Do the same for the pages
- $this->loadParentPages();
- }
-
- // }}}
- // {{{ configureFilters()
-
- /**
- * Form filter definitions
- *
- * Applies a data filter for the given fields when the form is submitted
- *
- * @return void
- * @access public
- */
- public function configureFilters()
- {
- $f = array();
-
- $f[] = array(
- 'element' => '__ALL__',
- 'filter' => 'trim'
- );
-
- $this->setupFilters($f);
- }
-
- // }}}
- // {{{ configureForm()
-
- /**
- * Bundle all form configuration calls into one function call
- *
- * @param Config_Container $c Configuration object
- *
- * @return void
- * @access public
- */
- public function configureForm(Config_Container $c)
- {
- $this->configureElements($c);
- $this->configureRules();
- $this->configureFilters();
- $this->configureDefaults();
- }
-
- // }}}
- // {{{ configureRules()
-
- /**
- * Form rule definitions
- *
- * Adds validation rules for the given fields
- *
- * @return void
- * @access public
- */
- public function configureRules()
- {
- $r = array();
- // Form Rules
-
- $this->setupRules($r);
- }
-
- // }}}
-
- // {{{ getCurrentParent()
-
- /**
- * Gets the parent id of a page
- *
- * @param integer $id page id
- *
- * @return integer parent id
- * @access protected
- */
- protected function getCurrentParent($id)
- {
- try {
- $sql = "
- SELECT parent
- FROM {$this->tableName}
- WHERE id = :id";
-
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(':id', $id, PDO::PARAM_INT);
- $stmt->execute();
- $stmt->bindColumn('parent', $parent);
- $stmt->fetch();
-
- return $parent;
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
- // {{{ getNewParentPosition()
-
- /**
- * Gets the position to use for a page
- *
- * If we are inserting a new page we need to get the position to insert
- * the new page at. Or if we are updating an existing page and reassigning
- * it to a new parent, we need to get the new position to insert
- * the page at.
- *
- * @param integer $parent page id of the new parent page
- *
- * @return integer new position to use
- * @access protected
- */
- protected function getNewParentPosition($parent)
- {
- try {
- $sql = "
- SELECT count(*) + 1 AS newparent
- FROM {$this->tableName}
- WHERE parent = :parent
- AND id != :home_id";
-
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(':parent', $parent, PDO::PARAM_INT);
- $stmt->bindValue(':home_id', HOME_ID, PDO::PARAM_INT);
- $stmt->execute();
- $stmt->bindColumn('newparent', $newParent);
- $stmt->fetch();
-
- if ($parent == 0) {
- ++$newParent;
- }
-
- return $newParent;
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
- // {{{ getTableName()
-
- /**
- * Gets the primary table name
- *
- * @return string table name
- * @access public
- */
- public function getTableName()
- {
- return $this->tableName;
- }
-
- // }}}
- // {{{ getConstant()
-
- /**
- * fetch a defined constant value
- *
- * @param string $constant constant name
- *
- * @return mixed constant value
- * @acess protected
- */
- protected function getConstant($constant)
- {
- if (!defined($constant)) {
- return PEAR::raiseError('calling undefined constant');
- } else {
- return constant($constant);
- }
- }
-
- // }}}
-
- // {{{ hasUploadedImage()
-
- /**
- * Check to see if page we are editing has an uploaded image
- *
- * @return boolean If page has a previously uploaded image
- * @access protected
- */
- protected function hasUploadedImage()
- {
- if (!is_numeric($_GET['id'])) {
- return false;
- }
- try {
- $sql = "
- SELECT *
- FROM {$this->tableName}
- WHERE id = :id";
-
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(':id', $_GET['id'], PDO::PARAM_INT);
- $stmt->execute();
- $stmt->bindColumn('image', $image);
- $row = $stmt->fetch();
- return !is_null($image);
- //return !(is_null($image) || empty($image));
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
-
- // {{{ loadMemberCategories()
-
- /**
- * Loads member categories into the select list
- *
- * Gets an array structure of the member categories in a linear tree order
- * Then walk through the array and load each category into the select list
- *
- * @return void
- * @access public
- */
- public function loadMemberCategories()
- {
- try {
- // Get a tree list of categories in linear order with
- // category keys in the values and their level in the tree
- // in the value
- $c = Toolkit_Common::getHierarchicalTreeStructure(
- $this->dbh,
- 'category',
- 'category_id',
- 'parent_id'
- );
-
- // Get all the data about each category
- $sql = "
- SELECT *
- FROM category
- WHERE category_id = ?";
-
- $stmt = $this->dbh->prepare($sql);
- // Get the member categories select list element
- $e =& $this->getElement('memberCat');
- foreach ($c as $i => $j) {
- $stmt->execute(array($i));
- $row = $stmt->fetch();
- // the class level is always 1 less than what is reported
- // from our $c array
- $x = $j - 1;
- // Add the option data to the select list.
- $e->addOption($row['name'], $i, array('class' => "level-$x"));
- }
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
- // {{{ loadParentPages()
-
- /**
- * Load option elements into the parent select list
- *
- * These options are loaded via this seperate function vs inline w/ the
- * element definition b/c we need a little more control defining
- * the class names for each option so they will render nice when a user
- * is looking at the list.
- *
- * @return void
- * @throws PDOException throws exception on sql error
- * @access public
- */
- public function loadParentPages()
- {
- try {
- // Get a tree list of categories in linear order with
- // category keys in the values and their level in the tree
- // in the value
- $c = Toolkit_Common::getHierarchicalTreeStructure(
- $this->dbh,
- 'bus_category',
- 'id',
- 'parent',
- 'pos',
- 0,
- $this->maxDepth
- );
-
- // unset the home page, this is never an option to have children
- // underneath it.
- unset($c[HOME_ID]);
-
- // If we are editing a page, then we don't want that page
- // to show up as an option in the select list.
- if (is_numeric($_GET['id'])) {
- reset($c);
- // Get us to the point in the array were this page is located
- while (key($c) != $_GET['id'] && current($c) !== false) {
- next($c);
- }
- // Make sure we didn't traverse off the end of the array
- if (current($c) !== false) {
- // get the starting level we are currently at
- $sl = current($c);
- // remove this page (the one we're editing) from the
- // array and advance the internal array pointer
- unset($c[key($c)]);
- // now we need to make sure all sub pages beneath this
- // page are also not being shown
-
- // while we don't traverse off the end of the array
- while (current($c) !== false) {
- // get the current sub level we are at
- $csl = current($c);
- // if the current sub-level is the same as the
- // starting level, that means we have traversed through
- // all the sub-pages and can break out of the loop
- if ($csl == $sl) {
- break;
- } else {
- // we are still in a sub-level page, so unset
- // this page so it doesn't show, and advance
- // the internal array pointer
- unset($c[key($c)]);
- }
- }
- }
- }
-
- // Get all the data about each category
- $sql = "
- SELECT *
- FROM bus_category
- WHERE id = ?";
-
- $stmt = $this->dbh->prepare($sql);
- // Get the member categories select list element
- $e =& $this->getElement('parent');
- foreach ($c as $i => $j) {
- $stmt->execute(array($i));
- $row = $stmt->fetch();
- // the class level is always 1 less than what is reported
- // from our $c array
- $x = $j - 1;
- // Add the option data to the select list.
- $e->addOption($row['category'], $i, array('class' => "level-$x"));
- }
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
-
- // {{{ insertPage()
-
- /**
- * Create a new page in the site by inserting values into the DB
- *
- * @param array $values Submitted form values
- *
- * @return boolean Result of insertion
- * @access protected
- */
- protected function insertPage($values)
- {
- // Get the member categories if they exists so we don't try and
- // insert them into the wrong table.
- $memberCats = $values['memberCat'];
- unset($values['memberCat']);
-
- // Get the value of the new position this page will be set to.
- $values['pos'] = $this->getNewParentPosition($values['parent']);
-
- // a non empty file size indicates to use an image has been uploaded.
- if (!empty($values['image']['size'])) {
- $values['image'] = $this->uploadImage('image');
- if ($values['image'] === false) {
- return PEAR::raiseError('Invalid image response');
- }
- } else {
- unset($values['image']);
- }
-
- $sql = Toolkit_Common::createSQLInsert(
- $this->tableName,
- array_keys($values)
- );
-
- try {
- $this->dbh->beginTransaction();
- Toolkit_Common::processQuery(
- $this->dbh,
- $this->tableName,
- $sql,
- $values
- );
-
- // If we are trying to associate member categories
- // with the toolbox page then insert them here.
- if (is_array($memberCats) && !empty($memberCats)) {
- // Need to get the last id inserted into the table.
- $sql = "
- SELECT id
- FROM {$this->tableName}
- ORDER BY id DESC
- LIMIT 1";
-
- $row = $this->dbh->query($sql)->fetch();
- $sql = Toolkit_Common::createSQLInsert(
- 'bus_cat_member',
- array('catid', 'memb_type')
- );
-
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(':catid', $row['id'], PDO::PARAM_INT);
- // zip through all the member categories selected
- // and insert them into the table.
- foreach ($memberCats as $i) {
- if (is_numeric($i)) {
- $stmt->bindParam(':memb_type', $i, PDO::PARAM_INT);
- $stmt->execute();
- }
- }
- }
-
- return $this->dbh->commit();
- } catch (PDOException $e) {
- $this->dbh->rollback();
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
-
- // {{{ processData()
-
- /**
- * Clean unneeded form elements out of the submitted values array
- *
- * @param array $values QuickForm submitted elements
- *
- * @return boolean Result of insert/update functions
- * @access public
- */
- public function processData($values)
- {
- foreach ($values as $k => $v) {
- switch ($k) {
- case 'MAX_FILE_SIZE' :
- unset($values[$k]);
- break;
-
- default :
- if (substr($k, -4) == '_rmv') {
- unset($values[$k]);
- }
- break;
- }
- }
-
- $function = is_numeric($_GET['id']) ? 'updatePage' : 'insertPage';
- return $this->$function($values);
- }
-
- // }}}
-
- // {{{ removeImage()
- // @codeCoverageIgnoreStart
-
- /**
- * Deletes an image from the file server
- *
- * @param string $fileName Name of the image to delete
- *
- * @return void
- * @access protected
- */
- protected function removeImage($fileName)
- {
- $is = new Toolkit_Image_Server();
- $is->imageDelete($fileName);
- }
-
- // @codeCoverageIgnoreEnd
- // }}}
-
- // {{{ setMaxDepth()
-
- /**
- * Sets the max depth level that the parent page select list will show
- *
- * @param integer $md New max depth
- *
- * @return void
- * @access public
- */
- public function setMaxDepth($md)
- {
- $this->maxDepth = $md;
- }
-
- // }}}
- // {{{ setupRenderers()
-
- /**
- * Custom rendering templates for special fields on the form
- *
- * @return void
- * @access protected
- */
- protected function setupRenderers()
- {
- parent::setupRenderers();
- $renderer =& $this->defaultRenderer();
- $required = ' * ';
- $error = ' {error}
';
-
- $renderer->setElementTemplate("\n\t\n\t\t$required{label}$error{element} \n\t ", 'submit_buttons');
- $renderer->setElementTemplate("\n\t\n\t\t$required{label}$error{element} \n\t ", 'insert_rmv');
-
- $renderer->setGroupTemplate("\n\t\n\t\t\n\t\t\t{content} \n\t\t \n\t
", 'page_layout');
- $renderer->setGroupElementTemplate("\n\t\n\t\t{label} {element} \n\t ", 'page_layout');
- }
-
- // }}}
-
- // {{{ toHtml()
-
- /**
- * Handles how to display the current step the user is at in the form
- *
- * @return string rendered html form
- * @access public
- */
- public function toHtml()
- {
- $validated = $this->validate();
- $this->setupRenderers();
- if ($validated) {
- $this->cleanForm();
-
- $r = $this->process(
- array(&$this, 'processData'),
- $this->mergeFiles
- );
- if (PEAR::isError($r)) {
- return Toolkit_Common::handleError($r);
- } else {
- $this->freeze();
- $output = $this->successMsg;
- }
- } elseif ($this->isSubmitted()) {
- $output = $this->errorMsg;
- $output .= parent::toHTML();
- } else {
- $output = parent::toHTML();
- }
- return $output;
- }
-
- // }}}
-
- // {{{ updatePage()
-
- /**
- * Update an existing page in the site by updating values in the DB
- *
- * @param array $values Submitted form values
- *
- * @return boolean Result of insertion
- * @access protected
- */
- protected function updatePage($values)
- {
- // Make sure we are dealing w/ a valid page
- if (!is_numeric($_GET['id'])) {
- return PEAR::raiseError('Invalid page id');
- }
-
- // Handle user deleting the page image.
- if (array_key_exists('remove_image', $values)) {
- $this->removeImage($values['imagename']);
-
- // unset value so its not included in the update sql query
- unset($values['remove_image']);
- // set image and imagename to null to overwrite value in db.
- // if we are not uploading a new image.
- if (empty($values['image']['size'])) {
- $values['image'] = $values['imagename'] = null;
- }
- }
-
- // a non empty file size indicates to use an image has been uploaded.
- if (!empty($values['image']['size'])) {
- $values['image'] = $is->imageUpload('image');
- if ($values['image'] === false) {
- return PEAR::raiseError('Invalid image response');
- }
- } elseif (!is_null($values['image'])) {
- unset($values['image']);
- }
-
- // Get the parent id this page is currently set to in the DB.
- $curPar = $this->getCurrentParent($_GET['id']);
- // parents will be different if we are reassining to a new parent
- if ($curPar != $values['parent']) {
- // Get an updated position for the new parent page.
- $values['pos'] = $this->getNewParentPosition($values['parent']);
- }
-
- try {
- $sql = Toolkit_Common::createSQLUpdate(
- $this->tableName,
- array_keys($values),
- array('id = :id')
- );
-
- $values['id'] = $_GET['id'];
- return Toolkit_Common::processQuery(
- $this->dbh,
- $this->tableName,
- $sql,
- $values
- );
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
- // {{{ uploadImage()
- // @codeCoverageIgnoreStart
-
- /**
- * Uploads an image to the image server
- *
- * @param string $key name of the file upload key to find the image in the
- * $_FILES array
- *
- * @return mixed file name on success, false on error
- * @access protected
- */
- protected function uploadImage($key)
- {
- $is = new Toolkit_Image_Server();
- return $is->imageUpload($key);
- }
-
- // @codeCoverageIgnoreEnd
- // }}}
-}
-?>
diff --git a/Toolkit/Toolbox/Admin/EditParagraph.php b/Toolkit/Toolbox/Admin/EditParagraph.php
deleted file mode 100644
index b6e3d79..0000000
--- a/Toolkit/Toolbox/Admin/EditParagraph.php
+++ /dev/null
@@ -1,692 +0,0 @@
-
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @version CVS: $Id: EditParagraph.php,v 1.4 2009/10/27 14:46:32 jamie Exp $
- * @link http://demo.gaslightmedia.com
- */
-
-/**
- * Short description for class
- *
- * Long description (if any) ...
- *
- * @category CategoryName
- * @package Toolkit_Toolbox
- * @author Jamie Kahgee
- * @copyright 2009 Jamie Kahgee
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @link http://demo.gaslightmedia.com
- */
-class Toolkit_Toolbox_Admin_EditParagraph extends Toolkit_FormBuilder
-{
- // {{{ properties
-
-
- /**
- * Description for protected
- * @var string
- * @access protected
- */
- protected $tableName = 'bus';
-
- // }}}
- // {{{ __construct()
-
- /**
- * Class constructor
- *
- * @param string $formName Form's name.
- * @param PDO $pdo PHP Data Object used for DB calls
- * @param string $method (optional)Form's method defaults to 'POST'
- * @param string $action (optional)Form's action
- * @param string $target (optional)Form's target defaults to '_self'
- * @param mixed $attributes (optional)Extra attributes for tag
- * @param bool $trackSubmit (optional)Whether to track if the form was
- * submitted by adding a special hidden field
- *
- * @access public
- * @link http://pear.php.net/package/HTML_QuickForm/docs/latest/HTML_QuickForm/HTML_QuickForm.html
- * @see HTML_QuickForm
- * @todo Remove assigning the dbh the global dbh and setup a PDO
- * to be passed in from a parameter - this will allow for easier
- * PHPUnit testing
- */
- public function __construct(
- $formName,
- PDO $pdo,
- $method = 'post',
- $action = '',
- $target = '',
- $attributes = null,
- $trackSubmit = false
- ) {
- parent::__construct(
- $formName,
- $method,
- $action,
- $target,
- $attributes,
- $trackSubmit
- );
- $this->dbh = $pdo;
- $this->flexyOptions = $GLOBALS['flexyOptions'];
- $this->flexyOptions['templateDir'] = TEMPLATES_DIR;
- $this->flexyOptions['compileDir'] = COMPILED_DIR;
- }
-
- // }}}
-
- // {{{ createTables()
-
- /**
- * Read file from parameter and use the PDO parameter to create process file
- *
- * @param object $pdo Database handler
- * @param string $file full path of file to parse
- *
- * @return void
- * @access public
- * @static
- */
- static public function createTables(PDO $pdo, $file)
- {
- $sql = file_get_contents($file);
- $tok = strtok($sql, ';');
- while ($tok !== false) {
- $pdo->query($tok);
- $tok = strtok(';');
- }
- }
-
- // }}}
- // {{{ configureDefaults()
-
- /**
- * Initializes default form values
- *
- * @return void
- * @access public
- */
- public function configureDefaults()
- {
- if (is_numeric($_GET['id'])) {
- try {
- $sql = "
- SELECT *
- FROM {$this->tableName}
- WHERE id = :id";
-
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(':id', $_GET['id'], PDO::PARAM_INT);
- $stmt->execute();
- $d = $stmt->fetch();
- $i = ' ';
-
- $d['current_image'] = sprintf($i, THUMB . $d['image']);
-
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- } else {
- $d = array(
- 'template' => 1,
- );
- }
- $this->setupDefaults($d);
- }
-
- // }}}
- // {{{ configureElements()
-
- /**
- * Form element definitions
- *
- * @return void
- * @access public
- */
- public function configureElements()
- {
- $e = array();
- // Grouped Elements are defined here.
- $submitBtns = array();
-
- $submitBtns[] = array(
- 'type' => 'submit',
- 'req' => false,
- 'name' => 'update_rmv',
- 'display' => 'Update'
- );
- $submitBtns[] = array(
- 'type' => 'submit',
- 'req' => false,
- 'name' => 'cancel_rmv',
- 'display' => 'Cancel'
- );
- $submitBtns[] = array(
- 'type' => 'submit',
- 'req' => false,
- 'name' => 'delete_rmv',
- 'display' => 'Delete'
- );
-
- // All Elements are created here.
- // This includes group element definitions.
- $e[] = array(
- 'type' => 'header',
- 'req' => false,
- 'name' => 'paragraphAttributesHdr',
- 'display' => 'Paragraph Attributes'
- );
- $e[] = array(
- 'type' => 'select',
- 'req' => false,
- 'name' => 'page',
- 'display' => 'Page',
- 'opts' => array(),
- );
- $e[] = array(
- 'type' => 'text',
- 'req' => false,
- 'name' => 'intro',
- 'display' => 'Paragraph Title'
- );
- $e[] = array(
- 'type' => 'textarea',
- 'req' => false,
- 'name' => 'description',
- 'display' => 'Description',
- 'opts' => array(
- 'cols' => 70,
- 'rows' => 25
- ),
- );
- if ($this->hasUploadedImage()) {
- $e[] = array(
- 'type' => 'static',
- 'req' => false,
- 'name' => 'current_image',
- 'display' => 'Current Image'
- );
- $e[] = array(
- 'type' => 'text',
- 'req' => false,
- 'name' => 'imagename',
- 'display' => 'Image Caption'
- );
- $e[] = array(
- 'type' => 'checkbox',
- 'req' => false,
- 'name' => 'remove_image',
- 'display' => 'Delete Image'
- );
- }
- $e[] = array(
- 'type' => 'file',
- 'req' => false,
- 'name' => 'image',
- 'display' => 'New Image'
- );
-
- // If we are editing a page, show three submit buttons
- // otherwise, just show one insert button.
- if (is_numeric($_GET['id'])) {
- $e[] = array(
- 'type' => 'group',
- 'req' => false,
- 'name' => 'submit_buttons',
- 'group' => $submitBtns,
- 'label' => '',
- 'seperator' => '',
- 'appendName' => false,
- );
- } else {
- $e[] = array(
- 'type' => 'submit',
- 'req' => false,
- 'name' => 'insert_rmv',
- 'display' => 'Insert'
- );
- }
-
- $this->setupElements($e);
- // Do the same for the pages
- $this->loadParagraphPages();
- }
-
- // }}}
- // {{{ configureFilters()
-
- /**
- * Form filter definitions
- *
- * Applies a data filter for the given fields when the form is submitted
- *
- * @return void
- * @access public
- */
- public function configureFilters()
- {
- $f = array();
-
- $f[] = array(
- 'element' => '__ALL__',
- 'filter' => 'trim'
- );
-
- $this->setupFilters($f);
- }
-
- // }}}
- // {{{ configureForm()
-
- /**
- * Bundle all form configuration calls into one function call
- *
- * @return void
- * @access public
- */
- public function configureForm()
- {
- $this->configureElements();
- $this->configureRules();
- $this->configureFilters();
- $this->configureDefaults();
- }
-
- // }}}
- // {{{ configureRules()
-
- /**
- * Form rule definitions
- *
- * Adds validation rules for the given fields
- *
- * @return void
- * @access public
- */
- public function configureRules()
- {
- $r = array();
- // Form Rules
-
- $this->setupRules($r);
- }
-
- // }}}
- // {{{ getTableName()
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @return string Return description (if any) ...
- * @access public
- */
- public function getTableName()
- {
- return $this->tableName;
- }
-
- // }}}
-
- // {{{ hasUploadedImage()
-
- /**
- * Check to see if page we are editing has an uploaded image
- *
- * @return boolean If page has a previously uploaded image
- * @access protected
- */
- protected function hasUploadedImage()
- {
- if (!is_numeric($_GET['id'])) {
- return false;
- }
- try {
- $sql = "
- SELECT *
- FROM {$this->tableName}
- WHERE id = :id";
-
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(':id', $_GET['id'], PDO::PARAM_INT);
- $stmt->execute();
- $stmt->bindColumn('image', $image);
- $row = $stmt->fetch();
- return !is_null($image);
- //return !(is_null($image) || empty($image));
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
-
- // {{{ loadParagraphPages()
-
- /**
- * Load option elements into the parent select list
- *
- * These options are loaded via this seperate function vs inline w/ the
- * element definition b/c we need a little more control defining
- * the class names for each option so they will render nice when a user
- * is looking at the list.
- *
- * @return void
- * @throws PDOException throws exception on sql error
- * @access public
- */
- public function loadParagraphPages()
- {
- try {
- // Get a tree list of categories in linear order with
- // category keys in the values and their level in the tree
- // in the value
- $c = Toolkit_Common::getHierarchicalTreeStructure(
- $this->dbh,
- 'bus_category',
- 'id',
- 'parent',
- 'pos',
- 1,
- $this->maxDepth
- );
-
- // Get all the data about each category
- $sql = "
- SELECT *
- FROM bus_category
- WHERE id = ?";
-
- $stmt = $this->dbh->prepare($sql);
- // Get the member categories select list element
- $e =& $this->getElement('page');
- foreach ($c as $i => $j) {
- $stmt->execute(array($i));
- $row = $stmt->fetch();
- // the class level is always 1 less than what is reported
- // from our $c array
- $x = $j - 1;
- // Add the option data to the select list.
- $e->addOption($row['category'], $i, array('class' => "level-$x"));
- }
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
-
- // {{{ insertPage()
-
- /**
- * Create a new page in the site by inserting values into the DB
- *
- * @param array $values Submitted form values
- *
- * @return boolean Result of insertion
- * @access protected
- */
- protected function insertPage($values)
- {
- // Get the member categories if they exists so we don't try and
- // insert them into the wrong table.
- $memberCats = $values['memberCat'];
- unset($values['memberCat']);
-
- // Get the value of the new position this page will be set to.
- $values['pos'] = $this->getNewParentPosition($values['parent']);
-
- // a non empty file size indicates to use an image has been uploaded.
- if (!empty($values['image']['size'])) {
- $values['image'] = $this->uploadImage('image');
- if ($values['image'] === false) {
- return PEAR::raiseError('Invalid image response');
- }
- } else {
- unset($values['image']);
- }
-
- $sql = Toolkit_Common::createSQLInsert(
- $this->tableName,
- array_keys($values)
- );
-
- try {
- $this->dbh->beginTransaction();
- Toolkit_Common::processQuery(
- $this->dbh,
- $this->tableName,
- $sql,
- $values
- );
-
- // If we are trying to associate member categories
- // with the toolbox page then insert them here.
- if (is_array($memberCats) && !empty($memberCats)) {
- // Need to get the last id inserted into the table.
- $sql = "
- SELECT id
- FROM {$this->tableName}
- ORDER BY id DESC
- LIMIT 1";
-
- $row = $this->dbh->query($sql)->fetch();
- $sql = Toolkit_Common::createSQLInsert(
- 'bus_cat_member',
- array('catid', 'memb_type')
- );
-
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(':catid', $row['id'], PDO::PARAM_INT);
- // zip through all the member categories selected
- // and insert them into the table.
- foreach ($memberCats as $i) {
- if (is_numeric($i)) {
- $stmt->bindParam(':memb_type', $i, PDO::PARAM_INT);
- $stmt->execute();
- }
- }
- }
-
- return $this->dbh->commit();
- } catch (PDOException $e) {
- $this->dbh->rollback();
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
-
- // {{{ processData()
-
- /**
- * Clean unneeded form elements out of the submitted values array
- *
- * @param array $values QuickForm submitted elements
- *
- * @return boolean Result of insert/update functions
- * @access public
- */
- public function processData($values)
- {
- foreach ($values as $k => $v) {
- switch ($k) {
- case 'MAX_FILE_SIZE' :
- unset($values[$k]);
- break;
-
- default :
- if (substr($k, -4) == '_rmv') {
- unset($values[$k]);
- }
- break;
- }
- }
-
- $function = is_numeric($_GET['id']) ? 'updatePage' : 'insertPage';
- return $this->$function($values);
- }
-
- // }}}
- // {{{ removeImage()
- // @codeCoverageIgnoreStart
-
- /**
- * Deletes an image from the file server
- *
- * @param string $fileName Name of the image to delete
- *
- * @return void
- * @access protected
- */
- protected function removeImage($fileName)
- {
- $is = new Toolkit_Image_Server();
- $is->imageDelete($fileName);
- }
-
- // @codeCoverageIgnoreEnd
- // }}}
-
- // {{{ setMaxDepth()
-
- /**
- * Sets the max depth level that the parent page select list will show
- *
- * @param integer $md New max depth
- *
- * @return void
- * @access public
- */
- public function setMaxDepth($md)
- {
- $this->maxDepth = $md;
- }
-
- // }}}
- // {{{ setupRenderers()
-
- /**
- * Custom rendering templates for special fields on the form
- *
- * @return void
- * @access protected
- */
- protected function setupRenderers()
- {
- parent::setupRenderers();
- $renderer =& $this->defaultRenderer();
- $required = ' * ';
- $error = ' {error}
';
-
- $renderer->setElementTemplate("\n\t\n\t\t$required{label}$error{element} \n\t ", 'submit_buttons');
- $renderer->setElementTemplate("\n\t\n\t\t$required{label}$error{element} \n\t ", 'insert_rmv');
-
- $renderer->setGroupTemplate("\n\t\n\t\t\n\t\t\t{content} \n\t\t \n\t
", 'page_layout');
- $renderer->setGroupElementTemplate("\n\t\n\t\t{label} {element} \n\t ", 'page_layout');
- }
-
- // }}}
-
- // {{{ updatePage()
-
- /**
- * Update an existing page in the site by updating values in the DB
- *
- * @param array $values Submitted form values
- *
- * @return boolean Result of insertion
- * @access protected
- */
- protected function updatePage($values)
- {
- // Make sure we are dealing w/ a valid page
- if (!is_numeric($_GET['id'])) {
- return PEAR::raiseError('Invalid page id');
- }
-
- // Handle user deleting the page image.
- if (array_key_exists('remove_image', $values)) {
- $this->removeImage($values['imagename']);
-
- // unset value so its not included in the update sql query
- unset($values['remove_image']);
- // set image and imagename to null to overwrite value in db.
- // if we are not uploading a new image.
- if (empty($values['image']['size'])) {
- $values['image'] = $values['imagename'] = null;
- }
- }
-
- // a non empty file size indicates to use an image has been uploaded.
- if (!empty($values['image']['size'])) {
- $values['image'] = $is->imageUpload('image');
- if ($values['image'] === false) {
- return PEAR::raiseError('Invalid image response');
- }
- } elseif (!is_null($values['image'])) {
- unset($values['image']);
- }
-
- // Get the parent id this page is currently set to in the DB.
- $curPar = $this->getCurrentParent($_GET['id']);
- // parents will be different if we are reassining to a new parent
- if ($curPar != $values['parent']) {
- // Get an updated position for the new parent page.
- $values['pos'] = $this->getNewParentPosition($values['parent']);
- }
-
- try {
- $sql = Toolkit_Common::createSQLUpdate(
- $this->tableName,
- array_keys($values),
- array('id = :id')
- );
-
- $values['id'] = $_GET['id'];
- return Toolkit_Common::processQuery(
- $this->dbh,
- $this->tableName,
- $sql,
- $values
- );
- } catch (PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- }
-
- // }}}
- // {{{ uploadImage()
- // @codeCoverageIgnoreStart
-
- /**
- * Uploads an image to the image server
- *
- * @param string $key name of the file upload key to find the image in the
- * $_FILES array
- *
- * @return mixed file name on success, false on error
- * @access protected
- */
- protected function uploadImage($key)
- {
- $is = new Toolkit_Image_Server();
- return $is->imageUpload($key);
- }
-
- // @codeCoverageIgnoreEnd
- // }}}
-}
-?>
diff --git a/Toolkit/Toolbox/Admin/toolbox.sql b/Toolkit/Toolbox/Admin/toolbox.sql
deleted file mode 100644
index 5fc4cdb..0000000
--- a/Toolkit/Toolbox/Admin/toolbox.sql
+++ /dev/null
@@ -1,33 +0,0 @@
-CREATE TABLE bus_category (
-id SERIAL PRIMARY KEY,
-parent INTEGER,
-category TEXT,
-intro TEXT,
-description TEXT,
-image TEXT,
-imagename TEXT,
-active BOOLEAN DEFAULT FALSE,
-pos INTEGER,
-keyword TEXT,
-template INTEGER,
-featured BOOLEAN DEFAULT FALSE,
-no_search_form BOOLEAN DEFAULT FALSE,
-feature_intro TEXT,
-section_links BOOLEAN DEFAULT FALSE
-);
-
-CREATE TABLE bus (
-id SERIAL PRIMARY KEY,
-name TEXT,
-description TEXT,
-image TEXT,
-imagename TEXT,
-back_to_top BOOLEAN DEFAULT FALSE
-);
-
-CREATE TABLE bus_category_bus (
-id SERIAL PRIMARY KEY,
-busid INTEGER,
-catid INTEGER,
-pos INTEGER
-);
diff --git a/Toolkit/Toolbox/assets/.keepme b/Toolkit/Toolbox/assets/.keepme
deleted file mode 100644
index e69de29..0000000
diff --git a/Toolkit/Tree.php b/Toolkit/Tree.php
deleted file mode 100644
index 5af1553..0000000
--- a/Toolkit/Tree.php
+++ /dev/null
@@ -1,145 +0,0 @@
-
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @release CVS: $Id: Tree.php,v 1.4 2009/06/18 14:12:50 jamie Exp $
- * @link http://demo.gaslightmedia.com
- */
-
-/**
- * Create tree structures of database entries
- *
- * Base class used to setup tree objects that will render
- * database structures into iterable PHP objects.
- *
- * @category Toolkit
- * @package Toolkit_Tree
- * @author Jamie Kahgee
- * @copyright 2008 Gaslight Media
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @link http://demo.gaslightmedia.com
- */
-abstract class Toolkit_Tree
-{
- // {{{ properties
-
- /**
- * Database ID of tuple
- *
- * @var int
- * @access public
- */
- public $catid = 0;
-
- /**
- * Name of object
- *
- * @var string
- * @access public
- */
- public $category;
-
- /**
- * Children of object
- *
- * @var array
- * @access public
- */
- public $children = array();
-
- /**
- * Parent of this category
- *
- * @var array
- * @access public
- */
- public $parentId;
-
- /**
- * Database connection handle
- *
- * @var PDO Object
- * @access protected
- */
- protected $dbh;
-
- // }}}
- // {{{ __construct()
-
- /**
- * Setup the objects properties and call to setup children
- *
- * @param integer $catid ID of the Database object
- * @param string $name Name of the Database object
- * @param PDO $dbh Database handler object
- * @param integer $parentId Id of parent node
- *
- * @author Jamie Kahgee
- * @access public
- */
- public function __construct($catid, $name, PDO $dbh, $parentId = 0)
- {
- $this->parentId = $parentId;
- $this->catid = $catid;
- $this->category = $name;
- $this->dbh = $dbh;
- $this->addChildren();
- }
-
- // }}}
- // {{{ __get()
-
- /**
- * utilized for reading data from inaccessible members
- *
- * @param string $name property name
- *
- * @return mixed void
- * @access public
- */
- public function __get($name)
- {
- return $this->$name;
- }
-
- // }}}
- // {{{ __set()
-
-
- /**
- * Run when writing data to inaccessible members
- *
- * @param string $name property
- * @param string $value new value
- *
- * @return void
- * @access public
- */
- public function __set($name, $value)
- {
- $this->$name = $value;
- }
-
- // }}}
- // {{{ addChildren()
-
- /**
- * Attaches children to tree object
- *
- * @author Jamie Kahgee
- * @return void
- * @access protected
- */
- abstract protected function addChildren();
-
- // }}}
-}
-?>
diff --git a/Toolkit/Weather.php b/Toolkit/Weather.php
deleted file mode 100755
index 60a9d09..0000000
--- a/Toolkit/Weather.php
+++ /dev/null
@@ -1,203 +0,0 @@
-
- * @copyright 2008 Gaslight Media
- * @license http://www.gaslightmedia.com/license.txt The Gaslight License
- * @version CVS: $Id: Weather.php,v 1.6 2009/09/16 11:20:51 jamie Exp $
- * @link <>
- */
-
-/**
- * Weather class for Gaslight Media
- *
- * You can get the stationId for weather at
- * http://www.weather.gov/xml/current_obs/seek.php?state=mi
- * Uses NOAA for getting the rss feed for weather
- *
- * @category Toolkit
- * @package Toolkit_Weather
- * @author Steve Sutton
- * @copyright 2008 Gaslight Media
- * @license http://www.gaslightmedia.com/license.txt The Gaslight License
- * @link <>
- */
-class Toolkit_Weather
-{
- //{{{ __Class Properties
-
-
- /**
- * The xml file used for caching the feed
- * @var $_weatherFile string
- * @access private
- */
- private $_weatherFile;
-
- /**
- * Station identifier for the feed
- * @link http://www.weather.gov/xml/current_obs/seek.php?state=mi
- *
- * @var $_stationId string
- * @access private
- */
- private $_stationId = 'KPLN';
-
-
- /**
- * XMLReader object for parsing feed
- * @var $_xml object
- * @access private
- */
- private $_xml;
-
- /**
- * Description for private
- * @var $_assoc array
- * @access private
- */
- private $_assoc;
-
- /**
- * Storage array for the current conditions
- * @var $currendCond array
- * @access public
- */
- public $currentCond;
-
- /**
- * Boolean if the file exists or not
- * @var $_cacheFileExist boolean
- * @access private
- */
- private $_cacheFileExist = false;
-
- //}}}
- //{{{ __construct()
-
- /**
- * Class Constructer
- *
- * @return void
- * @access public
- */
- function __construct()
- {
- $currentErrorMask = ini_get('error_reporting');
- error_reporting(0);
- $this->_weatherFile = BASE.'weather-feed.xml';
- $this->interval = 25; // interval in minutes for page cache
- $this->fetchWeather();
- $this->setCurrentCond();
- error_reporting($currentErrorMask);
- }
-
- //}}}
- //{{{ fetchWeather()
-
-
- /**
- * fetchWeather
- *
- * THis will use curl to grab the weather feed using
- * the $_weatherFile as destination
- * and the $_stationId for the xml file name
- *
- * @return void
- * @access public
- */
- function fetchWeather()
- {
- if (is_file($this->_weatherFile)) {
- $time2hoursago = mktime(
- date('H'),
- date('i') - $this->interval,
- date('s'),
- date('m'),
- date('d'),
- date('Y')
- );
- $file_time = filemtime($this->_weatherFile);
- if ($file_time < $time2hoursago) {
- $this->grabFeedUrl();
- }
- if (is_file($this->_weatherFile)) {
- $this->_cacheFileExist = true;
- }
- } else {
- $this->grabFeedUrl();
- if (is_file($this->_weatherFile)) {
- $this->_cacheFileExist = true;
- }
- }
- }
-
- //}}}
- // {{{ grabFeedUrl()
-
-
- /**
- * grabFeedUrl
- *
- * @return void
- * @access public
- */
- function grabFeedUrl()
- {
- // the NOAA xml feed url to be used
- // from the _stationId
- $feed_url = 'http://www.weather.gov/xml/current_obs/'
- .$this->_stationId.'.xml';
- // Curl Options used for connection
- $curlOptions = array(
- CURLOPT_URL => $feed_url,
- CURLOPT_HEADER => 0,
- CURLOPT_RETURNTRANSFER => 1,
- CURLOPT_TIMEOUT => 15,
- CURLOPT_CONNECTTIMEOUT => 5,
- CURLOPT_FAILONERROR => 1,
- );
- // start curl object
- $ch = curl_init();
- // set options
- curl_setopt_array($ch, $curlOptions);
- // assign the response to a string variable
- $response = curl_exec($ch);
- // grab the connection info to check for http_code = 200
- $info = curl_getinfo($ch);
- curl_close($ch);
- if ($info['http_code'] == '200') {
- file_put_contents($this->_weatherFile, $response);
- } else {
- @touch($this->_weatherFile);
- }
- }
-
-
- // }}}
- //{{{ setCurrentCond()
-
- /**
- * Set currentCond
- *
- * Set the currentCond clas var up with variables from the xml file
- * from the weather feed
- *
- * @return void
- * @access public
- */
- function setCurrentCond()
- {
- $xml = new XML_Unserializer();
- $xml->unserialize($this->_weatherFile, true);
- $this->currentCond = $xml->getUnserializedData();
- }
-
- //}}}
-}
-?>
diff --git a/Toolkit/qfcaptcha.php b/Toolkit/qfcaptcha.php
deleted file mode 100755
index f4bf079..0000000
--- a/Toolkit/qfcaptcha.php
+++ /dev/null
@@ -1,39 +0,0 @@
-
- * @copyright 2006-2008 by Philippe Jausions / 11abacus
- * @license http://www.opensource.org/licenses/bsd-license.php New BSD
- * @version CVS: $Id: qfcaptcha.php,v 1.2 2009/10/01 16:00:02 jamie Exp $
- * @filesource
- * @link http://pear.php.net/package/HTML_QuickForm_CAPTCHA
- * @see qfcaptcha_form_image.php
- * @see qfcaptcha_form_random.php
- */
-
-// Require the class before opening the session
-// so the instance unserialize properly
-require_once '../setup.phtml';
-require_once 'Text/CAPTCHA.php';
-require_once 'Text/CAPTCHA/Driver/Image.php';
-
-HTTP_Session2::useCookies(false);
-HTTP_Session2::start();
-
-header('Content-Type: image/jpeg');
-
-$sessionVar = (empty($_REQUEST['var']))
- ? '_HTML_QuickForm_CAPTCHA'
- : $_REQUEST['var'];
-
-// Force a new CAPTCHA for each one displayed
-$_SESSION[$sessionVar]->setPhrase();
-
-echo $_SESSION[$sessionVar]->getCAPTCHAAsJPEG();
-?>
diff --git a/admin/.htaccess b/admin/.htaccess
deleted file mode 100644
index 38dcd05..0000000
--- a/admin/.htaccess
+++ /dev/null
@@ -1 +0,0 @@
-RewriteEngine Off
diff --git a/admin/Contact/class_html.phtml b/admin/Contact/class_html.phtml
deleted file mode 100755
index 5ec2f5e..0000000
--- a/admin/Contact/class_html.phtml
+++ /dev/null
@@ -1,352 +0,0 @@
-
-** Filename......: html_mime_mail.class
-** Last changed..: 28/01/01
-** Notes.........: Based upon mime_mail.class
-** by Tobias Ratschiller
-** and Sascha Schumann .
-** See http://www.heyes-computing.net/scripts/
-** for full tar/zip if you haven't got one.
-***************************************/
-
-class html_mime_mail{
-
- var $mime;
- var $html;
- var $body;
- var $do_html;
- var $multipart;
- var $html_text;
- var $html_images;
- var $headers;
- var $parts;
- var $charset;
- var $charsetlist;
-
-/***************************************
-** Constructor function. Sets the headers
-** if supplied.
-***************************************/
-
- function html_mime_mail($headers = ''){
-
- $this->html_images = array();
- $this->headers = array();
- $this->parts = array();
- $this->charsetlist = array('iso' => 'us-ascii',
- 'big5' => 'big5',
- 'gb' => 'gb2312');
-
- $this->charset = 'us-ascii';
-
- if($headers == '') return TRUE;
- if(is_string($headers)) $headers = explode("\n", trim($headers));
- for($i=0; $iheaders[] = $headers[$i][$j];
- if($headers[$i] != '') $this->headers[] = $headers[$i];
- }
- }
-
-/***************************************
-** Accessor function to set the body text.
-** Body text is used if it's not an html
-** mail being sent.
-***************************************/
-
- function set_body($text = ''){
- if(is_string($text)){
- $this->body = $text;
- return TRUE;
- }
- return FALSE;
- }
-
-/***************************************
-** Accessor function to return the mime
-** class variable. Purely for debug.
-***************************************/
-
- function get_mime(){
- if(!isset($this->mime)) $this->mime = '';
- return $this->mime;
- }
-
-/***************************************
-** Function to set a header. Shouldn't
-** really be necessary as you could use
-** the constructor and send functions,
-** it's here nonetheless. Takes any number
-** of arguments, which can be either
-** strings or arrays full of strings.
-** this function is php4 only and will
-** return false otherwise. Will return
-** true upon finishing.
-***************************************/
-
- function add_header(){
- if((int)phpversion() < 4) return FALSE;
- $args = func_get_args();
- for($i=0; $iheaders[] = $args[$i][$j];
- if($args[$i] != '') $this->headers[] = $args[$i];
- }
- return TRUE;
- }
-
-/***************************************
-** Accessor function to set the content charset.
-** Matt add 2000/10/19
-***************************************/
- function set_charset($charset = '', $raw = FALSE){
-
- if($raw == TRUE){
- $this->charset = $charset;
- return TRUE;
- }
-
- if(is_string($charset)){
- while(list($k,$v) = each($this->charsetlist)){
- if($k == $charset){
- $this->charset = $v;
- return TRUE;
- }
- }
- }
- return FALSE;
- }
-
-/***************************************
-** Adds a html part to the mail.
-** Also replaces image names with
-** content-id's.
-***************************************/
- function add_html($html, $text){
- $this->do_html = 1;
- $this->html = $html;
- $this->html_text = $text;
- if(is_array($this->html_images) AND count($this->html_images) > 0){
- for($i=0; $ihtml_images); $i++) $this->html = ereg_replace($this->html_images[$i]['name'], 'cid:'.$this->html_images[$i]['cid'], $this->html);
- }
- }
-
-/***************************************
-** Builds html part of email.
-***************************************/
- function build_html($orig_boundary){
- $sec_boundary = '=_'.md5(uniqid(time()));
- $thr_boundary = '=_'.md5(uniqid(time()));
-
- if(count($this->html_images) == 0){
- $this->multipart.= '--'.$orig_boundary."\n";
- $this->multipart.= 'Content-Type: multipart/alternative;'.chr(10).chr(9).'boundary="'.$sec_boundary."\"\n\n\n";
-
- $this->multipart.= '--'.$sec_boundary."\n";
- $this->multipart.= 'Content-Type: text/plain; charset="'.$this->charset.'"'."\n";
- $this->multipart.= 'Content-Transfer-Encoding: base64'."\n\n";
- $this->multipart.= chunk_split(base64_encode($this->html_text))."\n\n";
-
- $this->multipart.= '--'.$sec_boundary."\n";
- $this->multipart.= 'Content-Type: text/html; charset="'.$this->charset.'"'."\n";
- $this->multipart.= 'Content-Transfer-Encoding: base64'."\n\n";
- $this->multipart.= chunk_split(base64_encode($this->html))."\n\n";
- $this->multipart.= '--'.$sec_boundary."--\n\n";
- }else{
- $this->multipart.= '--'.$orig_boundary."\n";
- $this->multipart.= 'Content-Type: multipart/related;'.chr(10).chr(9).'boundary="'.$sec_boundary."\"\n\n\n";
-
- $this->multipart.= '--'.$sec_boundary."\n";
- $this->multipart.= 'Content-Type: multipart/alternative;'.chr(10).chr(9).'boundary="'.$thr_boundary."\"\n\n\n";
-
- $this->multipart.= '--'.$thr_boundary."\n";
- $this->multipart.= 'Content-Type: text/plain; charset="'.$this->charset.'"'."\n";
- $this->multipart.= 'Content-Transfer-Encoding: base64'."\n\n";
- $this->multipart.= chunk_split(base64_encode($this->html_text))."\n\n";
-
- $this->multipart.= '--'.$thr_boundary."\n";
- $this->multipart.= 'Content-Type: text/html'."\n";
- $this->multipart.= 'Content-Transfer-Encoding: base64'."\n\n";
- $this->multipart.= chunk_split(base64_encode($this->html))."\n\n";
- $this->multipart.= '--'.$thr_boundary."--\n\n";
-
- for($i=0; $ihtml_images); $i++){
- $this->multipart.= '--'.$sec_boundary."\n";
- $this->build_html_image($i);
- }
-
- $this->multipart.= "--".$sec_boundary."--\n\n";
- }
- }
-/***************************************
-** Adds an image to the list of embedded
-** images.
-***************************************/
- function add_html_image($file, $name = '', $c_type='application/octet-stream'){
- $this->html_images[] = array( 'body' => $file,
- 'name' => $name,
- 'c_type' => $c_type,
- 'cid' => md5(uniqid(time())) );
- }
-
-
-/***************************************
-** Adds a file to the list of attachments.
-***************************************/
- function add_attachment($file, $name = '', $c_type='application/octet-stream'){
- $this->parts[] = array( 'body' => $file,
- 'name' => $name,
- 'c_type' => $c_type );
- }
-
-/***************************************
-** Builds an embedded image part of an
-** html mail.
-***************************************/
- function build_html_image($i){
- $this->multipart.= 'Content-Type: '.$this->html_images[$i]['c_type'];
-
- if($this->html_images[$i]['name'] != '') $this->multipart .= '; name="'.$this->html_images[$i]['name']."\"\n";
- else $this->multipart .= "\n";
-
- $this->multipart.= 'Content-Transfer-Encoding: base64'."\n";
- $this->multipart.= 'Content-ID: <'.$this->html_images[$i]['cid'].">\n\n";
- $this->multipart.= chunk_split(base64_encode($this->html_images[$i]['body']))."\n";
- }
-
-/***************************************
-** Builds a single part of a multipart
-** message.
-***************************************/
- function build_part($i){
- $message_part = '';
- $message_part.= 'Content-Type: '.$this->parts[$i]['c_type'];
- if($this->parts[$i]['name'] != '')
- $message_part .= '; name="'.$this->parts[$i]['name']."\"\n";
- else
- $message_part .= "\n";
-
- // Determine content encoding.
- if($this->parts[$i]['c_type'] == 'text/plain'){
- $message_part.= 'Content-Transfer-Encoding: base64'."\n\n";
- $message_part.= chunk_split(base64_encode($this->parts[$i]['body']))."\n";
- }elseif($this->parts[$i]['c_type'] == 'message/rfc822'){
- $message_part.= 'Content-Transfer-Encoding: 7bit'."\n\n";
- $message_part.= $this->parts[$i]['body']."\n";
- }else{
- $message_part.= 'Content-Transfer-Encoding: base64'."\n";
- $message_part.= 'Content-Disposition: attachment; filename="'.$this->parts[$i]['name']."\"\n\n";
- $message_part.= chunk_split(base64_encode($this->parts[$i]['body']))."\n";
- }
-
- return $message_part;
- }
-
-/***************************************
-** Builds the multipart message from the
-** list ($this->_parts).
-***************************************/
- function build_message(){
- $boundary = '=_'.md5(uniqid(time()));
-
- $this->headers[] = 'MIME-Version: 1.0';
- $this->headers[] = 'Content-Type: multipart/mixed;'.chr(10).chr(9).'boundary="'.$boundary.'"';
- $this->multipart = "This is a MIME encoded message.\n\n";
-
- if(isset($this->do_html) AND $this->do_html == 1) $this->build_html($boundary);
- if(isset($this->body) AND $this->body != '') $this->parts[] = array('body' => $this->body, 'name' => '', 'c_type' => 'text/plain');
-
- for($i=(count($this->parts)-1); $i>=0; $i--){
- $this->multipart.= '--'.$boundary."\n".$this->build_part($i);
- }
-
- $this->mime = $this->multipart."--".$boundary."--\n";
- }
-
-/***************************************
-** Sends the mail.
-***************************************/
- function send($to_name, $to_addr, $from_name, $from_addr, $subject = '', $headers = ''){
-
- if($to_name != '') $to = '"'.$to_name.'" <'.$to_addr.'>';
- else $to = $to_addr;
-
- if($from_name != '') $from = '"'.$from_name.'" <'.$from_addr.'>';
- else $from = $from_addr;
-
- if(is_string($headers)) $headers = explode("\n", trim($headers));
- for($i=0; $imime, 'From: '.$from."\n".implode("\n", $this->headers)."\n".implode("\n", $xtra_headers));
- }
-
-/***************************************
-** Use this method to deliver using direct
-** smtp connection. Relies upon Manuel Lemos'
-** smtp mail delivery class available at:
-** http://phpclasses.upperdesign.com
-**
-** void smtp_send( string *Name* of smtp object,
-** string From address,
-** array To addresses,
-** string Subject,
-** array Extra headers)
-***************************************/
- function smtp_send($smtp_obj, $from_addr, $to_addr, $subject, $xtra_headers = ''){
- global $$smtp_obj;
- $smtp_obj = $$smtp_obj;
-
- $headers = $this->headers;
- $headers[] = 'From: '.$from_addr;
- $headers[] = 'Subject: '.$subject;
- if(is_array($xtra_headers)) for(reset($xtra_headers); list(,$header) = each($xtra_headers); ) $headers[] = $header;
-
- // the following: sendmessage(string from address, array to addresses, array headers, string body)
- $smtp_obj->sendmessage($from_addr, $to_addr, $headers, $this->mime);
- }
-
-/***************************************
-** Use this method to return the email
-** in message/rfc822 format. Useful for
-** adding an email to another email as
-** an attachment. there's a commented
-** out example in example.php.
-**
-** string get_rfc822(string To name,
-** string To email,
-** string From name,
-** string From email,
-** [string Subject,
-** string Extra headers])
-***************************************/
- function get_rfc822($to_name, $to_addr, $from_name, $from_addr, $subject = '', $headers = ''){
-
- // Make up the date header as according to RFC822
- $date = 'Date: '.date('D, d M y H:i:s');
-
- if($to_name != '') $to = 'To: "'.$to_name.'" <'.$to_addr.'>';
- else $to = $to_addr;
-
- if($from_name != '') $from = 'From: "'.$from_name.'" <'.$from_addr.'>';
- else $from = $from_addr;
-
- if(is_string($subject)) $subject = 'Subject: '.$subject;
-
- if(is_string($headers)) $headers = explode("\n", trim($headers));
- for($i=0; $iheaders)."\n".implode("\n", $xtra_headers)."\n\n".$this->mime;
- }
-
-
-} // End of class.
-?>
diff --git a/admin/Contact/contact_inquiry.phtml b/admin/Contact/contact_inquiry.phtml
deleted file mode 100644
index 802e435..0000000
--- a/admin/Contact/contact_inquiry.phtml
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-footer();
-?>
diff --git a/admin/Contact/contact_setup.inc b/admin/Contact/contact_setup.inc
deleted file mode 100755
index bf131cc..0000000
--- a/admin/Contact/contact_setup.inc
+++ /dev/null
@@ -1,273 +0,0 @@
-
-//$Id: contact_setup.inc,v 1.1.1.1 2008/07/08 15:02:13 jmeek Exp $
-if(!defined("ENTRIES_PER_PAGE"))
-{
- define("ENTRIES_PER_PAGE",10); // Entries per Page in list_contact.phtml
-}
-define("CUSTOMER_TABLE","customer"); // name of customer table
-define("CONTACT_TABLE","contact"); // name of contact table
-define("TABLE",CONTACT_TABLE); // which table to use
-define("DATEFORMAT","US"); // date format (for edit_contact.phmtl)
-define("NEWSLETTER_PROTOTYPE","newsletter_template.html");
-/*
- setup the following in the setup.phtml (in root directory) file.
-defines:
-HTML_EMAIL = ON or OFF
-PRODUCTION_MODE = ON ,r OFF
- */
-/*
- define("NEWSLETTER",1); //bool- does the contact database mail out a newsletter?
- define("NEWSLETTRE_TYPE","TEXT"); // can be text or html(with images)
- */
-
-$unit_size2[6] = "5 bedroom & loft, 3.5 bathroom (sleeps 12)";
-$unit_size2[0] = "3 bedroom & loft, 2 bathroom (sleeps 8-10)";
-$unit_size2[1] = "2 bedroom & loft, 2 bathroom (sleeps 6-8)";
-$unit_size2[2] = "2 bedroom, 2 bathroom + (sleeps 4-6)";
-$unit_size2[3] = "2 bedroom, 2 bathroom (sleeps 4-6)";
-$unit_size2[4] = "2 bedroom, 1 bathroom (sleeps 4-6)";
-$unit_size2[5] = "1 bedroom, 1 bathroom (sleeps 2-4)";
-
-$referred_by2[0] = "AAA";
-$referred_by2[1] = "Big Fore";
-$referred_by2[2] = "Chamber/Visitors Bureau";
-$referred_by2[3] = "Detroit Free Press";
-$referred_by2[4] = "Friends/Relatives";
-$referred_by2[5] = "Great Rentals Web Site";
-$referred_by2[6] = "Internet";
-$referred_by2[7] = "Nubs Nob";
-$referred_by2[8] = "Other";
-$referred_by2[9] = "Past Guest";
-
-$int_qs = "select * from contact_inq order by pos;";
-
-if( $data = db_auto_get_data($int_qs,CONN_STR) )
-{
- foreach( $data as $row )
- {
- $interest2[$row['id']] = $row['header'];
- }
-}
-/*
-$interest2[0] = "Golf Trip";
-$interest2[1] = "Big 4 Golf Package";
-$interest2[2] = "Ski Trip";
-$interest2[3] = "Family vacation";
-$interest2[4] = "Family Reunion";
-$interest2[5] = "Romantic Getaway";
-$interest2[6] = "Honeymoon/Anniversary";
-$interest2[7] = "Soccer Weekend";
-$interest2[8] = "Wedding Group";
-$interest2[9] = "Biking";
-$interest2[10] = "Fishing";
-$interest2[11] = "Tennis";
-$interest2[12] = "Business";
-$interest2[13] = "Fall Color Tour";
-$interest2[14] = "Morel Mushrooms";
-$interest2[15] = "Spring/Fall Relaxing vacation";
-$interest2[16] = "Empty Nester Getaway";
-$interest2[17] = "Real Estate";
-$interest2[18] = "Senior Packages";
-$interest2[19] = "Scrapbooking";
-*/
-
-if(!function_exists("template_read"))
-{
- function template_read($template)
- {
- $fp = fopen($template, "r");
- $contents = fread($fp,filesize($template));
- fclose($fp);
- if($contents)
- {
- return $contents;
- }
- else
- {
- return "";
- }
- }
-}
-
-if(!function_exists("explode_template"))
-{
- function explode_template($template,$data)
- {
- $template = template_read($template);
- $output = template_replacement($template,$data);
- $output = wordwrap($output, 72);
- return($output);
-
- }
-}
-
-if(!function_exists("template_replacement"))
-{
- function template_replacement($template,$fieldarr)
- {
- if(is_array($fieldarr))
- {
- foreach($fieldarr as $key=>$value)
- {
- $template = str_replace( "", $value, $template );
- }
- }
-
- return $template;
- }
-}
-if(!function_exists("add_image"))
-{
- function add_image($image,$align,$url)
- {
- if($image != "")
- {
- $output .= '';
- }
- return($output);
- }
-}
-// Navigation array
-$nav = array(
- "Add Contact" => "edit_contact.phtml",
- "Saved Reports" => "list_query.phtml",
- "Compose Email" => "edit_autoresponse.phtml?id=1",
- "List Contacts" => "list_contact.phtml",
- "Contact Inquiry Fields" => "contact_inquiry.phtml",
- "Report Builder" => "index.phtml",
- "Preview Email" => "view_newsletter.phtml",);
-
-
-function interest($field)
-{
- global $interest2;
- if( !is_array( $interest2 ) )
- {
- return( false );
- }
- echo "";
-}
-
-// default query on create_date
-$c_date_from = contact_date_entry("","","","fc_month","fc_day","fc_year");
-$c_date_to = contact_date_entry("","","","tc_month","tc_day","tc_year");
-/* The following is for setting up the defines and arrays that are needed
- * based on which table ( customer or contact ) in use
- * formats for arrays
- * $DB_fields[] = array( name =>"{FIELD NAME}", title => "{FIELD TITLE}", type => "{FIELD TYPE}")
- * $fields["{FIELD_NAME}"] = "{FIELD TITLE}";
- *
- * must have these defines
- * ID - The primary key
- * SEQUENCE - sequence name
- * WHERE - where clause
- */
-if(TABLE==CUSTOMER_TABLE)
-{
- define("ID","cust_id");
- define("MAILOK","mail_ok");
- define("SEQUENCE","custkey");
- define("WHERE","fname != '-Guest-'");
- // $DB_fields are used for edit and updating contacts
- $DB_fields[] = array( name => "cust_id", title => "cust_id", type => "hide");
- $DB_fields[] = array( name => "purch_date",title => "Last Purchase Date", type => "static");
- $DB_fields[] = array( name => "access_date",title => "Last Access Date",type => "static");
- $DB_fields[] = array( name => "create_date",title => "Create Date",type => "static");
- $DB_fields[] = array( name => "fname", title => "First Name", type => "text");
- $DB_fields[] = array( name => "lname", title => "Last Name", type => "text");
- $DB_fields[] = array( name => "add1", title => "Address 1", type => "text");
- $DB_fields[] = array( name => "add2", title => "Address 2", type => "text");
- $DB_fields[] = array( name => "city", title => "City", type => "text");
- $DB_fields[] = array( name => "state", title => "State", type => "text");
- $DB_fields[] = array( name => "zip", title => "Zip", type => "text");
- $DB_fields[] = array( name => "email", title => "Email", type => "text");
- $DB_fields[] = array( name => "phone", title => "Phone", type => "text");
- $DB_fields[] = array( name => "fax", title => "Fax", type => "text");
- $DB_fields[] = array( name => "org", title => "Org", type => "text");
- $DB_fields[] = array( name => "referred_by",title => "Refered By", type => "text");
- $DB_fields[] = array( name => "mail_ok", title => "Mail Ok?", type => "radio");
- // $fields are used for building the query page
- foreach($DB_fields as $key=>$value){
- if($value['type'] == "text")
- $fields[$value['name']] = $value['title'];
- }
- // date query fields
- $p_date_from = contact_date_entry("","","","fp_month","fp_day","fp_year");
- $p_date_to = contact_date_entry("","","","tp_month","tp_day","tp_year");
- $a_date_from = contact_date_entry("","","","fa_month","fa_day","fa_year");
- $a_date_to = contact_date_entry("","","","ta_month","ta_day","ta_year");
-}
-else
-{
- define("ID","id");
- define("MAILOK","mail_ok");
- define("SEQUENCE","contact_id_seq");
- define("WHERE",ID." IS NOT NULL");
- // $DB_fields are used for edit and updating contacts
- $DB_fields[] = array( name => "id", title => "id", type => "hide");
- $DB_fields[] = array( name => "create_date",title => "Create Date",type => "static");
- $DB_fields[] = array( name => "fname", title => "First Name", type => "text");
- $DB_fields[] = array( name => "lname", title => "Last Name", type => "text");
- $DB_fields[] = array( name => "address", title => "Address", type => "text");
- $DB_fields[] = array( name => "city", title => "City", type => "text");
- $DB_fields[] = array( name => "state", title => "State", type => "text");
- $DB_fields[] = array( name => "zip", title => "Zip", type => "text");
- $DB_fields[] = array( name => "phone", title => "Phone", type => "text");
- $DB_fields[] = array( name => "email", title => "Email", type => "text");
- $DB_fields[] = array( name => "arrive_date",title => "Arrival Date",type => "date");
- $DB_fields[] = array( name => "depart_date",title => "Departure Date",type => "date");
- $DB_fields[] = array( name => "unit_size", title => "Unit Size", type => "array_drop",drop=>$unit_size2);
- $DB_fields[] = array( name => "referred_by",title => "Referred By",type => "array_drop",drop=>$referred_by2);
- $DB_fields[] = array( name => "other", title => "Referred By Other",type => "text");
- $DB_fields[] = array( name => "interest", title => "Interest", type=> "interest");
- $DB_fields[] = array( name => "questions", title => "Additional Questions",type => "desc");
- $DB_fields[] = array( name => "mail_ok", title => "Mail Ok?", type => "radio");
- $cType = array(
- ''=>'',
- 1 => 'Reservation Request',
- 2 => 'E-News'
- );
- $DB_fields[] = array("name" => "contact_type", "title" => "Contact Type", "type" => "drop", "drop" => $cType);
- //$DB_fields[] = array( name => "contestant",title => "Contestant?", type => "radio");
-
- // $fields are used for building the query page
- foreach($DB_fields as $key=>$value){
- if ($value['type'] == "text" || $value['type'] == "array_drop") {
- $fields[$value['name']] = $value['title'];
- } elseif ( $value['type'] == "drop") {
- $dropdowns[$value['name']] = array('title' => $value['title'], 'drop' => $value['drop']);
- }
- }
- $fields["questions"] = "Questions";
- $p_date_from = contact_date_entry("","","","fp_month","fp_day","fp_year");
- $p_date_to = contact_date_entry("","","","tp_month","tp_day","tp_year");
- $a_date_from = contact_date_entry("","","","fa_month","fa_day","fa_year");
- $a_date_to = contact_date_entry("","","","ta_month","ta_day","ta_year");
-}
-?>
diff --git a/admin/Contact/convert-inq.php b/admin/Contact/convert-inq.php
deleted file mode 100644
index 49607ef..0000000
--- a/admin/Contact/convert-inq.php
+++ /dev/null
@@ -1,85 +0,0 @@
-db_exec( $intQuery ) )
-{
- while( $iRow = pg_fetch_object( $iRes ) )
- {
- $tKey = array_search( $iRow->header, $interest );
- $intArray["$tKey"] = (string)$iRow->id;
- $intArray["$iRow->header"] = (string)$iRow->id;
- }
-}
-//echo '';
-//print_r( $intArray );
-//echo ' ';
-$query = "select id,interest from contact where interest != '' and interest is not null order by id;";
-$DB->db_exec("BEGIN WORK;");
-if( $res = $DB->db_exec( $query ) )
-{
- while( $row = pg_fetch_object( $res ) )
- {
- unset( $mArr );
- unset( $fkey );
- unset( $match );
- $mArr = explode( ':',ereg_replace(":$","",$row->interest) );
- if( is_array( $mArr ) )
- {
- foreach( $mArr as $key => $val )
- {
- $val = trim( $val );
- $fkey = array_search( $val, $interest, true );
- if( is_numeric( $val ) && $interest[$val] )
- {
- echo 'matched '.$interest[$val].'
';
- $mArr[$key] = $intArray[$val];
- }
- elseif( $fkey == '0' )
- {
- echo 'matched -> null val '.$interest[$fkey].'
';
- $mArr[$key] = $intArray[$interest[$fkey]];
- }
- elseif( $fkey !== false )
- {
- echo 'matched '.$interest[$fkey].'
';
- $mArr[$key] = $intArray[$fkey];
- }
- else
- {
- echo 'not matched ';
- var_dump( $val );
- var_dump( $interest[0] );
- echo '
';
- }
- }
- }
- $newQuery = "update contact set interest = ':".implode(":",$mArr).":' where id = ".$row->id;
- $DB->db_exec($newQuery);
- echo $newQuery;
- //$dObj[] = $row;
- }
-}
-$DB->db_exec("ABORT WORK;");
-?>
diff --git a/admin/Contact/del_query.phtml b/admin/Contact/del_query.phtml
deleted file mode 100755
index f9b7fab..0000000
--- a/admin/Contact/del_query.phtml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-Query is Deleted
-Close This
-Window
diff --git a/admin/Contact/download.phtml b/admin/Contact/download.phtml
deleted file mode 100755
index 545b033..0000000
--- a/admin/Contact/download.phtml
+++ /dev/null
@@ -1,108 +0,0 @@
-
-/*****************************************************************************
-* File download
-* Author: Steve Sutton
-*
-* pass $query_string
-*
-*****************************************************************************/
-//$Id: download.phtml,v 1.1.1.1 2008/07/08 15:02:13 jmeek Exp $
-include("../../setup.phtml");
-include("contact_setup.inc");
-if(!$dbd = db_connect())
- die("Warning: FATAL! No Connection to DB_SERVER");
-
-$delimiter = str_replace("comma",",",$delimiter);
-$delimiter = str_replace("tab","\t",$delimiter);
-$delimiter = str_replace("csv",",",$delimiter);
-$delimiter = str_replace("pipe","|",$delimiter);
-
-if($query_string) {
- /* Remove the old reports if they exsists */
- if(is_file("report.csv"))
- unlink("report.csv");
- if(is_file("report.tar.gz"))
- unlink("report.tar.gz");
- if(is_file("report.zip"))
- unlink("report.zip");
-
- if(!$fp = fopen("report.csv","w"))
- html_error("Cant open report",0);
- $query_string = stripslashes($query_string);
- $query_string = str_replace("SELECT ".ID.",","SELECT ",$query_string);
-
- if(!$res = pg_Exec($dbd,$query_string))
- echo "failed to ->".$query_string;
- if(pg_numrows($res)>0) {
- for($i=0;$i&1",$result_array,$result);
- if($result != 0){
- echo $result_array[0];
- exit;
- }
- chmod("report.tar.gz",0660);
- }
-
- if($file == "zip") {
- $output = "report.zip";
- exec("zip report report.csv 2>&1",$result_array,$result);
- if($result != 0){
- echo $result_array[0];
- exit;
- }
- chmod("report.zip",0660);
- }
- if($file == "rpt") {
- $output = "report.csv";
- chmod("report.csv",0660);
- }
-if(ini_get('zlib.output_compression'))
-{
- ini_set('zlib.output_compression', 'Off');
-}
- header("Content-Type: application/force-download\n");
- /* Correction for the stupid MSIE thing */
- if(strstr(getenv('HTTP_USER_AGENT'), 'MSIE'))
- {
- header("Content-Disposition: inline; filename=\"$output\"");
- }
- else
- {
- header("Content-Disposition: attachment; filename=\"$output\"");
- }
- //header("Location: $output");
- $fn=fopen($output , "r");
- fpassthru($fn);
- @fclose($fn);
- exit();
-}
-else {
- header("Location: list_contact.phtml");
-}
-?>
diff --git a/admin/Contact/edit_autoresponse.phtml b/admin/Contact/edit_autoresponse.phtml
deleted file mode 100755
index 3a6ff5e..0000000
--- a/admin/Contact/edit_autoresponse.phtml
+++ /dev/null
@@ -1,255 +0,0 @@
-
-include("../../setup.phtml");
-include("contact_setup.inc");
-
-$id = $_GET['id'];
-
-top("AutoReponse for Newsletter", HELP_BASE."response.phtml?key=edit+section");
-
-
-html_nav_table($nav,3);
-if(!$dbd = db_connect(CONN_STR)) html_error(DB_ERROR_MSG, 1);
-
-$qs = "SET DATESTYLE TO 'SQL, NONEUROPEAN'";
-
-if(!db_exec($dbd, $qs))
- html_error(DB_ERROR_MSG, 1);
-
-$qs = "SELECT *
- FROM news_response
- WHERE id = $id";
-
-if(!$res = db_exec($dbd, $qs)) html_error(DB_ERROR_MSG,1);
-?>
-
-
-
-
-
-
-echo '';
-for($i = 0; $i < db_numrows($res); $i++) {
- $row = db_fetch_array($res,$i, PGSQL_ASSOC);
-
- if(!$row[id])
- html_error(DB_ERROR_MSG,1);
-
- foreach($row as $key=>$value) {
- switch($key) {
-
- case "id":
- echo " ";
- break;
-
- case "subject":
- echo "Subject: ";
- text_box("subject",$value);
- echo " ";
- break;
-
- case "coupon_link":
- echo "Coupon Link Address: \n";
- text_box("coupon_link",$value);
- break;
-
- case "response":
- echo "Response: ";
- echo ''.htmlspecialchars($value).' ';
- echo " ";
- echo " NOTE: Insert COUPON IMAGE1 IMAGE2 IMAGE3 etc. in the body of
- your text where you want the images to appear. ";
- break;
-
- case "image":
- case "image2":
- case "image3":
- case "coupon":
- break;
-
- default:
- break;
- }
- }
-}
-
- if ($row["coupon"] != "")
- {
- echo ""
- ." "
- .""
- ." "
- .""
- ." "
- .""
- ."$FT1 This is the current coupon attached to this newsletter."
- ."To change the coupon, select a new one by clicking the browse button below."
- ."To delete the coupon without uploading a new one, select "
- ."Yes below and click the Update Category button . In addition,
- if you'd like readers to be able to click the coupon to go to a site, enter
- the address into "Coupon Link Address"."
- ."
"
- .""
- .""
- ."$TDFT Delete Coupon? Yes "
- ." "
- ."$TDFT No "
- ." "
- ."
"
- ." ";
- }
-
-?>
-
- Coupon:
-
-
-
-
-
-
-
-
-
-
- if ($row["image"] != "")
- {
- echo ""
- ." "
- .""
- ." "
- .""
- ." "
- .""
- ."$FT1 This is the current image attached to this newsletter."
- ."To change the image, select a new one by clicking the browse button below."
- ."To delete the image without uploading a new one, select "
- ."Yes below and click the Update Category button ."
- ."
"
- .""
- .""
- ."$TDFT Delete Item Image? Yes "
- ." "
- ."$TDFT No "
- ." "
- ."
"
- ." ";
- }
-
-?>
-
- IMAGE1:
-
-
-
-
- Image1 Link:
-
-
-
- if ($row["image2"] != "")
- {
- echo ""
- ." "
- .""
- ." "
- .""
- ." "
- .""
- ."$FT1 This is the second image attached to this newsletter."
- ."To change the image, select a new one by clicking the browse button below."
- ."To delete the image without uploading a new one, select "
- ."Yes below and click the Update Category button ."
- ."
"
- .""
- .""
- ."$TDFT Delete Item Image? Yes "
- ." "
- ."$TDFT No "
- ." "
- ."
"
- ." ";
- }
-
-?>
-
- IMAGE2:
-
-
-
-
- Image2 Link:
-
-
-
- if ($row["image3"] != "")
- {
- echo ""
- ." "
- .""
- ." "
- .""
- ." "
- .""
- ."$FT1 This is the third image attached to this newsletter."
- ."To change the image, select a new one by clicking the browse button below."
- ."To delete the image without uploading a new one, select "
- ."Yes below and click the Update Category button ."
- ."
"
- .""
- .""
- ."$TDFT Delete Item Image? Yes "
- ." "
- ."$TDFT No "
- ." "
- ."
"
- ." ";
- }
-
-?>
-
- IMAGE3:
-
-
-
-
- Image3 Link:
-
-
-
-
-
-
-
-
-footer();
-?>
-
-
diff --git a/admin/Contact/edit_contact.phtml b/admin/Contact/edit_contact.phtml
deleted file mode 100755
index fd77c21..0000000
--- a/admin/Contact/edit_contact.phtml
+++ /dev/null
@@ -1,204 +0,0 @@
-
-//$Id: edit_contact.phtml,v 1.1.1.1 2008/07/08 15:02:13 jmeek Exp $
-include("../../setup.phtml");
-include("contact_setup.inc");
-
-if(!$dbd = db_connect()) html_error(DB_ERROR_MSG, 1);
-
-if($id) { // If there's $id then editing
- $qs = "SET DATESTYLE TO 'SQL,".DATEFORMAT."';";
- $qs .= "SELECT ";
- for($i=0;$i0){
- $row = db_fetch_array($res,0, PGSQL_ASSOC);
- }
- else{
- die("No such record");
- }
-}
-else { // else new entry
- // Grab the array of name from $DB_fields and stick it into $row
- // Any default values must be placed inside this loop
- $row = array();
- for($i=0;$i
-
-
-
-echo '';
-echo " ";
-
-foreach($DB_fields as $key=>$value) {
- if($value[type] == "text") {
- ?>
-
-
-
-
- }
- elseif($value[type] == "date") {
- ?>
- (MM/DD/YYYY)
-
-
-
- }
- elseif($value[type] == "static") {
- ?>
-
-
-
-
- }
- elseif($value[type] == "interest") {
- ?>
-
-
-
-
- }
- elseif($value[type] == "img") {
- ?>
-
-
- echo " ";
- if($row[$value[name]] != "") {
- echo "Current Image: ";
- echo "
-
-
-
- Delete this image:
-
- Yes
- No
-
- ";
- }
- echo "New $value[title]: ";
- echo " ";
- echo " ";
- }
- elseif($value[type] == "file") {
- ?>
-
-
- echo " ";
- if($row[$value[name]] != "") {
- echo "Current File: ";
- echo "".$row[$value[name]]."
-
-
-
- Delete this File:
-
- Yes
- No
-
- ";
- }
- echo "New $value[title]: ";
- echo " ";
- echo " ";
- }
- if($value[type] == "desc") {
- if($value[name] == "description") {
- echo " ";
- echo "Description and Images ";
- }
- echo "$value[title]: ";
- echo ''.htmlspecialchars($row[$value['name']]).' ';
- echo " ";
- }
- elseif($value[type] == "hide") {
- echo " ";
- }
- elseif($value[type] == "radio") {
- echo "$value[title]: ";
- echo " Yes";
- echo " No ";
- echo " ";
- }
- elseif ( $value['type'] == 'drop' )
- {
- echo ''.$value[title].' ';
- echo '';
- unset($value['drop']['']);
- $val = explode(":",ereg_replace("^:|:$","",trim($row[$value['name']])));
- $date_entry = GLM_TOOLBOX::build_picklist($value['name'].'[]',$value['drop'],$val, 'multiple', 0, null, 5);
- echo $date_entry.' ';
- echo ' ';
- }
- elseif($value[type] == "array_drop"){
- echo "$value[title]: ";
- echo "";
- if(is_array($value[drop])){
- echo '';
- echo '-- select '.$value[name].' -- ';
- foreach($value[drop] as $dkey=>$dval){
- echo ''.$dval.' ';
- }
- echo ' ';
- }
- echo " ";
- }
-}
-
-if(isset($id)) {
-?>
-
-
-
-
-
-
-}
-else {
- form_footer("Insert","",2);
-}
-echo "
- ";
-
-footer();
-?>
diff --git a/admin/Contact/edit_inquiry.phtml b/admin/Contact/edit_inquiry.phtml
deleted file mode 100644
index 663dec2..0000000
--- a/admin/Contact/edit_inquiry.phtml
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
- break;
-
- case "Add Item":
- ?>
-
-
- break;
-
-}
-footer();
-?>
diff --git a/admin/Contact/form.js b/admin/Contact/form.js
deleted file mode 100755
index 0bbabf0..0000000
--- a/admin/Contact/form.js
+++ /dev/null
@@ -1,42 +0,0 @@
-function reshow(object) {
- artist = object.options[object.selectedIndex].text;
- for (var i = document.track.names.length;i > 0;i--)
- document.track.names.options[0] = null;
- reloading = true;
- showlinks();
- document.track.names.options[0].selected = true;
- return false;
-}
-
-function load(object) {
- alert('Just testing: ' + object.options[object.selectedIndex].value);
- //window.location.href = object.options[object.selectedIndex].value;
- return false;
-}
-
-function showlinks() {
- if (artist == 'Chris Rea') {
- opt('cr/one.zip','The Road To Hell');
- opt('cr/two.zip','Let\'s Dance');
- }
-
- if (artist == 'Annie Lennox') {
- opt('al/why.zip','Why');
- opt('al/wobg.zip','Walking on Broken Glass');
- }
-
- if (artist == 'Dina Carrol') {
- opt('dc/track1.zip','Escaping');
- opt('dc/track2.zip','Only Human');
- }
-}
-
-function opt(href,text) {
- if (reloading) {
- var optionName = new Option(text, href, false, false)
- var length = document.track.names.length;
- document.track.names.options[length] = optionName;
- }
- else
- document.write('',text,'<\/OPTION>');
-}
diff --git a/admin/Contact/help/contact.phtml b/admin/Contact/help/contact.phtml
deleted file mode 100755
index bdec6d7..0000000
--- a/admin/Contact/help/contact.phtml
+++ /dev/null
@@ -1,146 +0,0 @@
-
-
-Help
-
-
-
-Contact Help
-
-
-switch ($key) {
- case "search":
- ?>
-Contact Database Search
-
-
-In this page you will start to build your query to the contact database.
-
-
-Search:
-
-
-Search records for:
-
-Here is where you will enter any keywords to use in the search. You must
-enter in something in the "Search records for" box. You may use more than one
-word (ie.) Sam Field.
-HINT: To help search use wildcards!
-? optional space
-* optional spaces
-+ at least one space
-. will match anything
-
-NOTE: Leaving this fields blank will select all
-contacts. You can leave this blank and choose "Mail OK" true to get all
-contacts that allow emails.
-Search Where in fields:
-Tells the database to Search "Anywhere", "Beginning", or "Ending" of the
-fields to be searched.
-In Fields:
-Select from "In Fields" box. This determines what fields to look in for
-this search.
-HINT
-If you want to select more than one field to search in hold down the 'Ctrl' key while clicking on the selection to select or
-deselect it from the list.
-HINT
-You can use the "All" and "None" buttons to help you save time. This will
-select all or none of the fields in the boxes.
-Search Type:
-Select the type of search you want (ie.) an "Exact string" search will return
-only those fields which match the "Search records" for string exactly as compared
-to "Or" which will return any field that match any words you place into "Search
-records for"
-Case Sensitivity:
-This will turn "On" and "Off" the case sensitivity.
-(ie.)If you leave it "Off" and enter "bob" it will return anything like
-"bob","BOB","Bob","BOb","boB",or "BoB" turned "On" will match only "bob".
-
-
-Output of records
-
-Output Fields:
-Select from "Output Fields" box. This determines what fields will be in the
-output of this search.
-HINT
-You can use the "All" and "None" buttons to help you save time. This will
-select all or none of the fields in the boxes.
-HINT
-If you want to select more than
-one Output field hold down the 'Ctrl' key while clicking on the selection to select or
-deselect it from the list.
-File Output:
-Select from here if you wish to download a file with the results of this
-search. The file will built "On the Fly" so you can download it.
-NOTE: The text file is output as report.doc. This
-is only a text file.
-
-Delimiter:
-This determines what separates the fields in your file.
-
-
- break;
-
- case "List":
- ?>
-List Contacts
-
-This page is for listing the results of your query. You can download files if
-you have selected a file type or edit and delete the contact found.
-
-[Edit]
-Link to contact edit page.
-
-[Delete]
-Link to Delete Contact.
-
-Download Files
-If you see this then there is a file you can download.
-Click on the file and you can download it.
-
- break;
-
- case "Edit":
- ?>
-Edit a Contact
-
-This page is for editing and modifying an existing Contact in the database.
-When editing is complete, click on the "Submit Query" button. The database will
-be updated, and you will be directed back to the "List Contacts" page.
-
-
-
-
-Submit Query
-
-When you have made the changes you want to the Contact,
-you can click "Submit Query." This will update the information about the
-Contact in the database.
-
-
- break;
-
- case "Add":
- ?>
-Add an Contact
-
-This page is for Adding Contacts in the database.
-When form is complete, click on the "Submit Query" button. The database will
-be updated, and you will be directed back to the "List Contacts" page.
-
-
-
-Submit Query
-
-When you have made the changes you want to the Contact,
-you can click "Submit Query." This will update the information about the
-Contact in the database.
-
-
- break;
-
-}
-?>
-
-
-
-
diff --git a/admin/Contact/index.phtml b/admin/Contact/index.phtml
deleted file mode 100755
index df11aad..0000000
--- a/admin/Contact/index.phtml
+++ /dev/null
@@ -1,374 +0,0 @@
-
-
-
-
-footer();
-?>
diff --git a/admin/Contact/list_contact.phtml b/admin/Contact/list_contact.phtml
deleted file mode 100755
index 65f23a9..0000000
--- a/admin/Contact/list_contact.phtml
+++ /dev/null
@@ -1,261 +0,0 @@
-
-
-
-
-html_nav_table($nav,3);
-if(NEWSLETTER){
- if(NEWSLETTER_TYPE == "TEXT"){
- ?>
-
- }
- elseif(NEWSLETTER_TYPE == "HTML"){
- ?>
-
- }
-$mquery = "SELECT subject FROM news_response";
-$mres = db_exec($dbd,$mquery);
-$mailout = pg_result($mres,0,'subject');
-?>
-
-
-
-
-
-
-
-
-
-
-}?>
-
- Functions:
- Contact Info
-
-
-$totalqs = substr_replace($qs," count(*) as total FROM ",strpos($qs,"SELECT")+7,strpos($qs,"FROM")-3);
-if(strpos($totalqs,"ORDER BY")!=0)
- $totalqs = substr_replace($totalqs,"",strpos($totalqs,"ORDER"));
-if(!$totalres = db_exec($dbd,$totalqs))
- html_error(DB_ERROR_MSG.__LINE__.$totalqs,1);
-if(count($totalres)==0)
- $totalnum = 0;
-else
- $totalnum = pg_result($totalres,0,"total");
-$qs .= " LIMIT ".ENTRIES_PER_PAGE." OFFSET ".$start;
-$res = db_exec($dbd,"SET DATESTYLE TO 'SQL,US';".$qs);
-?>
-
- Result(s)
-
-
-if(!$res) html_error(DB_ERROR_MSG.__LINE__.$qs,1);
-// What page are you on?
-if($start==0)
- $page == 1;
-else
- $page = ($start / ENTRIES_PER_PAGE) + 1;
-$totalpages = floor($totalnum / ENTRIES_PER_PAGE);
-$totalpages++;
-
-$result_string = "";
-$num = db_numrows($res);
-if(!$start)
- $start = 0;
-$begin = 0;
-$ending = $num;
-if($totalnum > ENTRIES_PER_PAGE && ( $page != $totalpages ) )
- {
- $end = ENTRIES_PER_PAGE + $start;
- }
-else
- {
- $end = $totalnum;
- }
-$last = $start - ENTRIES_PER_PAGE;
-if(!$query_string)
- {
- $query_string = $qs;
- $query_string = str_replace(" LIMIT ".ENTRIES_PER_PAGE." OFFSET ".$start,"",$query_string);
- }
-$stuff = "query_string=".urlencode($query_string)."&file=".$file."&delimiter=".$delimiter."&csv=".$csv;
-if(($start - ENTRIES_PER_PAGE) < 0)
- $prev = "PREV";
-else
- $prev = "PREV ";
-if($end < $totalnum)
- $next = "NEXT ";
-else
- $next = "NEXT";
- ?>
-
-
-
- if($num!=0)
- echo $prev."-".($start+1)."-to-".$end."-".$next;
- ?>
-
-
-
-if(count($res)>0)
- {
- for($i=$begin;$i<$ending;$i++)
- {
- if(!$row = db_fetch_array($res,$i,PGSQL_ASSOC))
- html_error(DB_ERROR_MSG.__LINE__,1);;
- for($b=1;$b
- >
-
- [Edit]
-
- [Delete]
-
-
-
- foreach($fields as $key) {
- if($key != "id" && $key != "cust_id"
- && $key != "userid" && $key != "usernum"
- && $key != "usergroup" && $key != "passwd")
- echo $row[$key]." ";
- }
- ?>
-
-
-
- }
- }
- ?>
-
-if(isset($file) && $file != "" && db_numrows($res) > 0) {
-?>
-
- Download files
-
-
-
-
-
-
-
-
-
-
-
-}
-echo '
';
-html_nav_table($nav,3);
-footer();
-?>
diff --git a/admin/Contact/list_query.phtml b/admin/Contact/list_query.phtml
deleted file mode 100755
index c85b26b..0000000
--- a/admin/Contact/list_query.phtml
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
- Functions:
-
-
- Queries in database
-
-
-
-if(!$dbd = db_connect()) html_error(DB_ERROR_MSG,0);
-
-$qs = "SELECT id,query_name
- FROM query_db";
-
-if(!$res = db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
-
-for($i=0;$i
-
-
-
- [Recall]
-
- [Delete]
- }?>
-
-
-
-}?>
-
-
-footer();
-?>
diff --git a/admin/Contact/mailout.phtml b/admin/Contact/mailout.phtml
deleted file mode 100755
index a6a4025..0000000
--- a/admin/Contact/mailout.phtml
+++ /dev/null
@@ -1,189 +0,0 @@
-
-
-Mailing out The Newsletter (Retail)
-
-
-0)
- {
- for($a=0;$a0) {
- // write the temp.to file
- $mail = implode("\n",$mail);
- $fp = fopen($ToFilename,"w");
- fputs($fp,$mail,strlen($mail));
- fclose($fp);
-}
-else {
- $mail = "";
-}
-
-
-if($mail != "") {
- // I am changing this to a two part mime type email
- // html and text
- // using class_html
- $responseqs = "SELECT *
- FROM news_response
- WHERE id = 1";
- if(!$resres = db_exec($dbd,$responseqs))
- html_error(DB_ERROR_MSG.$responseqs,0);
-
- $responserow = db_fetch_array($resres,0,PGSQL_ASSOC);
- unset($data);
- /*
- ob_start();
- require(BASE."bottomlinks.inc");
- $data['bottomlinks'] = ob_get_contents();
- ob_end_clean();
- */
-
- $subject = trim($responserow['subject']);
- $data['subject'] = &$subject;
- $data['url'] = URL_BASE;
- $message = $responserow['response'];
- // html part of email
- //$data['response'] = stripslashes(nl2br($message));
- $message = str_replace("COUPON","",$message);
- $message = str_replace("IMAGE1","",$message);
- $message = str_replace("IMAGE2","",$message);
- $message = str_replace("IMAGE3","",$message);
- $data['response'] = $message;
-
- $data['image'] = add_image($responserow["image"],"right",$responserow['image_link']);
- $data['image2'] = add_image($responserow["image2"],"left",$responserow['image2_link']);
- $data['image3'] = add_image($responserow["image3"],"right",$responserow['image3_link']);
- $data['coupon'] = add_image($responserow["coupon"],"right",$responserow['coupon_link']);
- $data['url'] = URL_BASE;
- $data['year'] = date("Y");
- $data['bailout'] = " ------------------------------------------------------------------- ";
- $data['bailout'] .= "You are receiving this message because you have expressed an interest in ";
- $data['bailout'] .= "receiving specials and information from ".SITENAME.". If you do not ";
- $data['bailout'] .= "wish to receive future items of this nature, please reply to this e-mail ";
- $data['bailout'] .= "with the word \"CANCEL\" on the subject line. You will then be removed ";
- $data['bailout'] .= "from future mailings. ";
- $data['bailout'] .= " ".SITENAME." ";
- $data['bailout'] .= "------------------------------------------------------------------- ";
- $html = explode_template(NEWSLETTER_PROTOTYPE,$data);
-
- // text part of email
- $text = strip_tags($message);
- $text .= "\n\n-------------------------------------------------------------------\n";
- $text .= "You are receiving this message because you have expressed an interest in\n";
- $text .= "receiving specials and information from ".SITENAME.". If you do not\n";
- $text .= "wish to receive future items of this nature, please reply to this e-mail\n";
- $text .= "with the word \"CANCEL\" on the subject line. You will then be removed \n";
- $text .= "from future mailings.\n";
- $text .= "-------------------------------------------------------------------\n";
-
- // Write the temp.header file
- $glm_headers = "NotifyAddr: ".OWNER_EMAIL."\n"
- . "ProcessName: ".SITENAME."\n"
- . "From: info@troutcreek.com\n"
- . "ReportInterval: 2\n"
- . "BlockSive: 20\n"
- . "ProductionMode: ".PRODUCTION_MODE."\n";
-
- $fp = fopen($HeadFilename,"w");
- fputs($fp,$glm_headers,strlen($glm_headers));
- fclose($fp);
-
- $headers = "From: TroutCreekNews \n".
- "Return-To: ".OWNER_EMAIL."\n".
- "To: ".OWNER_EMAIL."\n".
- "Subject: $subject\n".
- "Reply-to: ".REPLY_TO."\n".
- "Mime-Version: 1.0\n".
- "Content-Type: multipart/alternative; boundary=ContentBoundry\n\n";
- $fp = fopen($BodyFilename,"w");
- if(HTML_EMAIL=="ON"){
- $body_html = '--ContentBoundry
-Content-Type: text/plain; charset="utf-8"
-'.$text.'
---ContentBoundry
-Content-Type: text/html; charset="utf-8"
-
-'.$html.'
-
---ContentBoundry--';
- fputs($fp,$headers,strlen($headers));
- fputs($fp,$body_html,strlen($body_html));
- }
- else{
- fputs($fp,$headers,strlen($headers));
- fputs($fp,$text,strlen($text));
- }
- fclose($fp);
- // write the temp.ready file and your done!
- $fp = fopen($ReadyFilename,"w");
- fclose($fp);
-?>
-
-
- Mail the current
-
-
-
-
-
-
-
-
- You will recieve notification on the mailing task by email at =OWNER_EMAIL?>.
-
-
-
- }
- else {
-?>
-
-
- Newsletter Not Sent!
-
-
-
- }
-
-?>
-
-
diff --git a/admin/Contact/main.css b/admin/Contact/main.css
deleted file mode 100755
index fef38df..0000000
--- a/admin/Contact/main.css
+++ /dev/null
@@ -1,23 +0,0 @@
-body {
- background-color: #FFFFFF;
-}
-
-.navlink {
- font-size: 80%;
- font-family: arial;
-}
-
-td {
- font-size: 80%;
- font-family: arial,helvetica;
-}
-
-.theader {
- font-size: 120%;
- font-family: arial,helvetica;
- color: #FFFFFF;
-}
-
-.theadertd {
- background-color: #000080;
-}
diff --git a/admin/Contact/msg.js b/admin/Contact/msg.js
deleted file mode 100755
index 8ed837d..0000000
--- a/admin/Contact/msg.js
+++ /dev/null
@@ -1,29 +0,0 @@
-function glm_confirm(o) {
- var p = o.msg.split("\n");
- var k = 0;
- for(i = 0;i < p.length;i++) {
- if(k > p[i].length)
- continue;
- else
- k = p[i].length;
- }
-
- var bound = "";
- for(i = 0; i < k; i++) {
- bound = bound+'_';
- }
- var str = bound+"\n\n"+o.msg+"\n\n"+bound+"\n\nAre You Sure?";
- if(confirm(str)) {
- if(o.popup == '1') {
- var nw = new Object();
- nw.url = o.url;
- nw.name = o.popup.name;
- nw.width = o.width;
- nw.height = o.height;
- glm_open(nw);
- }
- else {
- location.replace(o.url);
- }
- }
-}
diff --git a/admin/Contact/newsletter_template.html b/admin/Contact/newsletter_template.html
deleted file mode 100755
index 0383410..0000000
--- a/admin/Contact/newsletter_template.html
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-Trout Creek Condominiums Newsletter
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 4749 Pleasantview ~
- Harbor Springs, MI 49740 ~
-
1-231-526-2148 ~
- 1-800-748-0245 ~
-
info@troutcreek.com
-
-
-
-
-
diff --git a/admin/Contact/notes/ChangeLog b/admin/Contact/notes/ChangeLog
deleted file mode 100755
index fc6c567..0000000
--- a/admin/Contact/notes/ChangeLog
+++ /dev/null
@@ -1,327 +0,0 @@
-2002-05-07 13:47 matrix
-
- * contact_setup.inc, del_query.phtml, download.phtml,
- edit_contact.phtml, form.js, index.phtml, list_contact.phtml,
- list_query.phtml, mailout.phtml, main.css, msg.js,
- query_contact.phtml, query_db.phtml, query_save.phtml,
- update_contact.phtml, verify.js, wm.js, help/contact.phtml,
- notes/ChangeLog, notes/Contact, notes/adm2.sql, notes/contact.sql,
- notes/guest.sql: "version 2.4"
-
-2002-05-07 13:45 matrix
-
- * contact.sql, contact_setup.inc, edit_contact.phtml,
- list_contact.phtml, update_contact.phtml, notes/ChangeLog,
- notes/contact.sql, notes/Contact: adding ChangeLog file and moving
- sql file into notes. I have also set the insert part of
- update_contact.phtml to use nextval to generate the PRIMEKEY so
- this will work with previous version of th shop which don't have
- the default set on cust_id
-
-2002-05-07 11:14 matrix
-
- * contact.sql, contact_setup.inc, del_query.phtml, download.phtml,
- edit_contact.phtml, form.js, index.phtml, list_contact.phtml,
- list_query.phtml, mailout.phtml, main.css, msg.js,
- query_contact.phtml, query_db.phtml, query_save.phtml,
- update_contact.phtml, verify.js, wm.js, help/contact.phtml,
- notes/adm2.sql, notes/guest.sql: testing out both contact and
- customer table use
-
-2002-05-07 10:08 matrix
-
- * form.js, msg.js, verify.js, wm.js: "putting javascript files in
- dir"
-
-2002-05-07 09:57 matrix
-
- * index.phtml: "all versions now 2.0"
-
-2002-05-07 09:57 matrix
-
- * index.phtml: new file
-
-2002-05-07 09:44 matrix
-
- * admin_constants.inc, contact.phtml, contact.sql,
- contact_setup.inc, contact_test.sql, del_query.phtml,
- download.phtml, edit_contact.phtml, index.html, list_contact.phtml,
- list_cust_form.phtml, list_customers.phtml, list_query.phtml,
- mailout.phtml, main.css, path.phtml, query_contact.phtml,
- query_db.phtml, query_save.phtml, shopping_cart_setup.inc,
- update_contact.phtml, help/contact.phtml, notes/adm2.sql,
- notes/guest.sql: "merging final changes into one app"
-
-2002-03-14 11:23 matrix
-
- * download.phtml: removed offending dot
-
-2002-03-12 10:32 matrix
-
- * contact_setup.inc: file contact_setup.inc was initially added on
- branch glm-Contact-2-0.
-
-2002-03-12 10:32 matrix
-
- * download.phtml: file download.phtml was initially added on branch
- glm-Contact-2-0.
-
-2002-03-12 10:32 matrix
-
- * contact.phtml, contact_setup.inc, del_query.phtml,
- download.phtml, edit_contact.phtml, list_contact.phtml,
- list_query.phtml, mailout.phtml, query_contact.phtml,
- query_db.phtml, update_contact.phtml: make it customer and ocntact
-
-2002-03-12 09:36 matrix
-
- * list_cust_form.phtml, list_customers.phtml, path.phtml,
- shopping_cart_setup.inc: updates
-
-2002-03-12 09:34 matrix
-
- * contact.phtml, del_query.phtml, edit_contact.phtml,
- list_contact.phtml, list_query.phtml, query_contact.phtml,
- query_db.phtml, update_contact.phtml: prepare for merging
-
-2001-12-17 10:13 matrix
-
- * list_contact.phtml, mailout.phtml: added ID
-
-2001-12-17 10:02 matrix
-
- * list_contact.phtml, mailout.phtml: mail can't be sent by url
-
-2001-11-27 16:50 matrix
-
- * contact.phtml, del_query.phtml, edit_contact.phtml,
- list_contact.phtml, list_query.phtml, query_contact.phtml,
- query_db.phtml, query_save.phtml, update_contact.phtml: needed to
- update adding contacts to customer table as there is no default
- value for cust_id
-
-2001-11-21 14:07 matrix
-
- * contact.phtml, del_query.phtml, edit_contact.phtml,
- list_contact.phtml, list_query.phtml, path.phtml,
- query_contact.phtml, query_db.phtml, update_contact.phtml: using
- setup.phtml not path.phtml
-
-2001-11-07 14:30 matrix
-
- * list_contact.phtml: removed echo
-
-2001-11-07 14:27 matrix
-
- * contact.phtml, del_query.phtml, edit_contact.phtml,
- list_query.phtml, mailout.phtml, path.phtml, query_contact.phtml,
- query_db.phtml, update_contact.phtml: updatng now using setup.phtml
-
-2001-11-07 14:24 matrix
-
- * list_contact.phtml: correcting email out code
-
-2001-10-15 15:19 matrix
-
- * contact.phtml, query_contact.phtml: adding date search
-
-2001-10-11 14:44 matrix
-
- * list_contact.phtml: updating
-
-2001-10-11 14:34 matrix
-
- * mailout.phtml: file mailout.phtml was initially added on branch
- glm-Contact-2-0.
-
-2001-10-11 14:32 matrix
-
- * list_contact.phtml, mailout.phtml: added autoresponder
-
-2001-09-25 10:14 matrix
-
- * path.phtml: changed the path so we use one file
-
-2001-09-25 10:13 matrix
-
- * contact.phtml: tr tag
-
-2001-07-02 14:29 matrix
-
- * path.phtml: symplified the path files now this referes to the
- main one in admin
-
-2001-06-22 08:55 matrix
-
- * contact.phtml, contact.sql, edit_contact.phtml,
- update_contact.phtml: adding field referred_by
-
-2001-06-19 08:50 matrix
-
- * list_contact.phtml: no real change
-
-2001-06-19 08:49 matrix
-
- * update_contact.phtml, edit_contact.phtml: modified for mailok
-
-2001-06-19 08:45 matrix
-
- * list_contact.phtml: modified for errors on recalls
-
-2001-06-19 08:45 matrix
-
- * edit_contact.phtml, update_contact.phtml: modified for mailok
-
-2001-06-18 10:08 matrix
-
- * query_db.phtml: shop_query_db
-
-2001-06-18 10:08 matrix
-
- * help/helpbg.gif: file helpbg.gif was initially added on branch
- glm-Contact-shop-1-0.
-
-2001-06-18 10:08 matrix
-
- * help/: closewindow.gif, contact.phtml, helpbg.gif: added images
- to help folder
-
-2001-06-18 10:08 matrix
-
- * help/closewindow.gif: file closewindow.gif was initially added on
- branch glm-Contact-shop-1-0.
-
-2001-06-18 10:05 matrix
-
- * query_contact.phtml: shop_query_db
-
-2001-06-18 10:04 matrix
-
- * list_query.phtml: added nav links
-
-2001-06-18 10:03 matrix
-
- * list_query.phtml: new shop query db
-
-2001-06-11 13:14 matrix
-
- * list_contact.phtml: error correction
-
-2001-06-11 10:51 matrix
-
- * list_contact.phtml: if there are no queries insert current
-
-2001-06-11 10:31 matrix
-
- * list_contact.phtml: if there are no contacts html_error
-
-2001-06-11 10:18 matrix
-
- * list_query.phtml: added nav to top of page
-
-2001-06-11 10:15 matrix
-
- * help/contact.phtml: corrected paths to help images
-
-2001-06-08 09:17 matrix
-
- * contact.sql: changing query table name to keep from messing up
- other application
-
-2001-06-08 09:16 matrix
-
- * help/contact.phtml: updateing help file
-
-2001-06-08 09:12 matrix
-
- * contact.phtml: changed radio buttons on mail_ok to drop down
-
-2001-06-08 08:50 matrix
-
- * list_contact.phtml: modified
-
-2001-06-08 08:46 matrix
-
- * contact.phtml: made the mail_ok a drop down
-
-2001-06-07 14:54 matrix
-
- * contact.phtml, list_contact.phtml, query_contact.phtml: updated
- per gloriebe contactdb
-
-2001-06-07 14:06 matrix
-
- * query_contact.phtml, help/contact.phtml: made changes for ereg
- wildcards
-
-2001-06-06 15:51 matrix
-
- * contact.phtml, contact.sql, edit_contact.phtml,
- list_contact.phtml, query_contact.phtml, query_save.phtml,
- update_contact.phtml: shop version
-
-2001-06-06 15:42 matrix
-
- * main.css: added file
-
-2001-06-06 15:40 matrix
-
- * report.rpt: "removed"
-
-2001-06-06 15:00 matrix
-
- * contact.phtml, list_contact.phtml, query_contact.phtml,
- update_contact.phtml, help/contact.phtml: worked out some bugs
-
-2001-06-06 13:41 matrix
-
- * help/contact.phtml: changed path on images
-
-2001-06-06 13:38 matrix
-
- * main.css: adding needed files
-
-2001-06-06 13:38 matrix
-
- * main.css: file main.css was initially added on branch
- glm-Contact-2-0.
-
-2001-06-05 11:17 matrix
-
- * path.phtml: changed path to help
-
-2001-06-05 11:13 matrix
-
- * path.phtml: changed path to help
-
-2001-06-05 10:45 matrix
-
- * path.phtml: added path file
-
-2001-06-05 10:38 matrix
-
- * contact.phtml, list_contact.phtml, query_contact.phtml: added
- pipe and csv delimiter
-
-2001-05-31 12:43 matrix
-
- * contact.phtml, contact.sql, contact_test.sql, del_query.phtml,
- edit_contact.phtml, list_contact.phtml, list_query.phtml,
- query_contact.phtml, query_db.phtml, query_save.phtml,
- update_contact.phtml, help/contact.phtml: combining the contact
- databases
-
-2001-04-04 13:42 matrix
-
- * admin_constants.inc, index.html, list_cust_form.phtml,
- list_customers.phtml, path.phtml, report.rpt,
- shopping_cart_setup.inc, notes/adm2.sql, notes/guest.sql: Initial
- revision
-
-2001-04-04 13:42 matrix
-
- * admin_constants.inc, index.html, list_cust_form.phtml,
- list_customers.phtml, path.phtml, report.rpt,
- shopping_cart_setup.inc, notes/adm2.sql, notes/guest.sql: imported
- sources
-
diff --git a/admin/Contact/notes/Contact b/admin/Contact/notes/Contact
deleted file mode 100755
index 937f46f..0000000
--- a/admin/Contact/notes/Contact
+++ /dev/null
@@ -1,4 +0,0 @@
-All application setup stuff will be in contact_setup.phtml
-1) right now if you add to the $fields array you'll still have to change
- edit_contact.phtml and update_contact.phtml
-2) contact.sql - contains the query to build the contact table and query_db table
diff --git a/admin/Contact/notes/contact.sql b/admin/Contact/notes/contact.sql
deleted file mode 100755
index 6da74a0..0000000
--- a/admin/Contact/notes/contact.sql
+++ /dev/null
@@ -1,56 +0,0 @@
-\connect - postgres
-
-CREATE TABLE "contact" (
- "id" SERIAL,
- "create_date" date,
- "fname" character varying(8104),
- "lname" character varying(8104),
- "address" character varying(8104),
- "city" character varying(8104),
- "state" character varying(8104),
- "zip" character varying(8104),
- "country" character varying(8104),
- "phone" character varying(8104),
- "fax" character varying(8104),
- "email" character varying(8104),
- "user_agent" character varying(8104),
- "remote_addr" character varying(8104),
- "mail_ok" boolean
-);
-
-REVOKE ALL on "contact" from PUBLIC;
-GRANT ALL on "contact" to "nobody";
-GRANT ALL on "contact" to "postgres";
-
-REVOKE ALL on "contact_id_seq" from PUBLIC;
-GRANT ALL on "contact_id_seq" to "nobody";
-GRANT ALL on "contact_id_seq" to "postgres";
-
-CREATE TABLE "query_db" (
- "id" SERIAL,
- "query_name" character varying(8000),
- "query" character varying(8000),
- "file" character varying(100),
- "delimiter" character varying(100)
-);
-
-REVOKE ALL on "query_db" from PUBLIC;
-GRANT ALL on "query_db" to "nobody";
-GRANT ALL on "query_db" to "postgres";
-
-REVOKE ALL on "query_db_id_seq" from PUBLIC;
-GRANT ALL on "query_db_id_seq" to "nobody";
-GRANT ALL on "query_db_id_seq" to "postgres";
-
-CREATE TABLE "news_response" (
- "id" SERIAL,
- "subject" text,
- "response" text,
- "mailout" date
-);
-
-REVOKE ALL on "news_response" from PUBLIC;
-GRANT ALL on "news_response" to "postgres";
-GRANT ALL on "news_response" to "nobody";
-
-INSERT INTO news_response (subject,response) values ('subject','response');
diff --git a/admin/Contact/preview.phtml b/admin/Contact/preview.phtml
deleted file mode 100755
index 642daf0..0000000
--- a/admin/Contact/preview.phtml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-include("../../setup.phtml");
-include("contact_setup.inc");
-unset($data);
-/*
-ob_start();
-require(BASE."bottomlinks.inc");
-$data['bottomlinks'] = ob_get_contents();
-ob_end_clean();
-*/
-
-$query = "SELECT * FROM news_response WHERE id = 1";
-$res = db_auto_get_data($query, CONN_STR);
-$data['url'] = URL_BASE;
-$data['subject'] = $res[0]["subject"];
-$response = $res[0]["response"];
-$response = str_replace("COUPON","",$response);
-$response = str_replace("IMAGE1","",$response);
-$response = str_replace("IMAGE2","",$response);
-$response = str_replace("IMAGE3","",$response);
-$data['response'] = $response;
-$data['coupon'] = add_image($res[0]["coupon"],"right",$res[0]["coupon_link"]);
-$data['image'] = add_image($res[0]["image"],"right",$res[0]["image_link"]);
-$data['image2'] = add_image($res[0]["image2"],"left",$res[0]["image2_link"]);
-$data['image3'] = add_image($res[0]["image3"],"right",$res[0]["image3_link"]);
-$data['year'] = date("Y");
-$data['bailout'] = " ------------------------------------------------------------------- ";
-$data['bailout'] .= "You are receiving this message because you have expressed an interest in ";
-$data['bailout'] .= "receiving specials and information from ".SITENAME.". If you do not ";
-$data['bailout'] .= "wish to receive future items of this nature, please reply to this e-mail ";
-$data['bailout'] .= "with the word \"CANCEL\" on the subject line. You will then be removed ";
-$data['bailout'] .= "from future mailings. ";
-$data['bailout'] .= " ".SITENAME." ";
-$data['bailout'] .= "------------------------------------------------------------------- ";
-$page = explode_template(NEWSLETTER_PROTOTYPE,$data);
-echo $page;
-?>
diff --git a/admin/Contact/query_contact.phtml b/admin/Contact/query_contact.phtml
deleted file mode 100755
index 6d5b2ff..0000000
--- a/admin/Contact/query_contact.phtml
+++ /dev/null
@@ -1,416 +0,0 @@
-$value){
- if($value == ""){
- unset($array[$counter]);
- }
- $counter++;
- }
- }
-}
-$sess_vars = $HTTP_POST_VARS;
-if(!isset($query_no)) {
- /* The fields array is sent as a string
- split it out using : as delimiter */
- $fvalue = ereg_replace("^:","",$fvalue);
- $fields = split(":",$fvalue);
- $rfvalue = ereg_replace("^:","",$rfvalue);
- $return_fields = split(":",$rfvalue);
- $dates = ereg_replace("^:","",$rdvalue);
- $dates = split(":",$dates);
- clean_array($return_fields);
- clean_array($dates);
- if(!isset($search)) {
- header("Location: index.phtml");
- }
- /* Chop off whitespaces spaces */
- $search = chop(trim($search));
- if( !$search && ( count( $fields ) == 1 && $fields[0] == '' ) )
- {
- $ALL = TRUE;
- }
-
- function getKeywords($keywords) {
- /* Replace the whitespace with a , */
- $keywords = ereg_replace(" ",",",$keywords);
-
- while(ereg(",,",$keywords)) {
- /* Replace the ,, with a , */
- $keywords = ereg_replace(",,",",",$keywords);
- }
- $seperated = explode(",",$keywords);
- /* Return exploded string */
- return $seperated;
- }
-
- switch($search_type) {
- case "1":
- $keywords = $search;
- $compare = "OR";
- break;
-
- case "2":
- $keywords = getKeywords($search);
- $compare = "AND";
- break;
-
- case "3":
- $keywords = getKeywords($search);
- $compare = "OR";
- break;
-
- case "4":
- $keywords = getKeywords($search);
- $compare = "AND";
- $NOT = TRUE;
- break;
-
- default:
- echo "not valid";
- break;
- }
-
- if(is_array($keywords)) {
- for($rip=0;$rip0){
- $rf = implode(",",$return_fields);
- $query_string .= ", $rf";
- }
- if(count($dates)>0){
- $rd = implode(",",$dates);
- $query_string .= ", $rd";
- }
- if(!$ALL) {
- $query_string .= "\nFROM\t".TABLE." \nWHERE\t".WHERE."\nAND\t";
- for($b=0;$b $drop_val ) {
- if( is_array( $_POST[$drop_key] ) ) {
- foreach( $_POST[$drop_key] as $mdrop_key => $mdrop_val ){
- if( $mdrop_val != '' ){
- $dstring[] = " $drop_key $operator ':".$mdrop_val.":'";
- }
- }
- }elseif( !is_array( $_POST[$drop_key] ) ) {
- if( $_POST[$drop_key] != '' ){
- $dstring[] = " $drop_key = '".$_POST[$drop_key]."'";
- }
- }
- }
- if( is_array($dstring) ) {
- $query_string .= ' and ('.implode(" $compare ",$dstring).' ) ';
- }
- }
- if($mail_ok == "1") {
- $query_string .= " AND mail_ok = 't'";
- }
- if($mail_ok == "0") {
- $query_string .= " AND mail_ok = 'f'";
- }
-
- if($contestant == "1") {
- $query_string .= " AND contestant = 't'";
- }
- if($contestant == "0") {
- $query_string .= " AND contestant = 'f'";
- }
-
- if(is_array($unit)){
- $query_string .= " AND (";
- foreach($unit as $ukey=>$uval){
- $unit_qs[] = " unit_size = $uval";
- }
- $query_string .= implode(" OR ",$unit_qs);
- $query_string .= " )";
- }
-
- if(is_array($referred)){
- $query_string .= " AND (";
- foreach($referred as $rkey=>$rval){
- $referred_qs[] = " referred_by = $rval";
- }
- $query_string .= implode(" OR ",$referred_qs);
- $query_string .= " )";
- }
-
- if( is_array( $cols ) )
- {
- foreach( $cols as $ikey => $ival )
- {
- $query_string .= " AND interest $operator ':$ival:'";
- }
- }
-
- if(isset($fp_month)) {
- $fp_str = mktime(0,0,0,$fp_month,$fp_day,$fp_year);
- $tp_str = mktime(0,0,0,$tp_month,$tp_day,$tp_year);
- $fa_str = mktime(0,0,0,$fa_month,$fa_day,$fa_year);
- $ta_str = mktime(0,0,0,$ta_month,$ta_day,$ta_year);
-
- if($fp_str<$tp_str) {
- $fp_date = $fp_month."/".$fp_day."/".$fp_year;
- $tp_date = $tp_month."/".$tp_day."/".$tp_year;
- $query_string .= " AND arrive_date >= '$fp_date'
- AND arrive_date < '$tp_date'";
- }
- if($fa_str<$ta_str) {
- $fa_date = $fa_month."/".$fa_day."/".$fa_year;
- $ta_date = $ta_month."/".$ta_day."/".$ta_year;
- $query_string .= " AND depart_date >= '$fa_date'
- AND depart_date < '$ta_date'";
- }
- if($fp_str>$tp_str) {
- $fp_date = $fp_month."/".$fp_day."/".$fp_year;
- $tp_date = $tp_month."/".$tp_day."/".$tp_year;
- $query_string .= " AND arrive_date < '$tp_date'";
- }
- if($fa_str>$ta_str) {
- $fa_date = $fa_month."/".$fa_day."/".$fa_year;
- $ta_date = $ta_month."/".$ta_day."/".$ta_year;
- $query_string .= " AND depart_date < '$ta_date'";
- }
- }
- if(isset($fc_month)) {
- $fc_str = mktime(0,0,0,$fc_month,$fc_day,$fc_year);
- $tc_str = mktime(0,0,0,$tc_month,$tc_day,$tc_year);
-
- if($fc_str<$tc_str) {
- $fc_date = $fc_month."/".$fc_day."/".$fc_year;
- $tc_date = $tc_month."/".$tc_day."/".$tc_year;
- $query_string .= " AND create_date >= '$fc_date'
- AND create_date < '$tc_date'";
- }
- if($fc_str>$tc_str) {
- $fc_date = $fc_month."/".$fc_day."/".$fc_year;
- $tc_date = $tc_month."/".$tc_day."/".$tc_year;
- $query_string .= " AND create_date < '$tc_date'";
- }
- }
-}
-else {
- if(!$dbd = db_connect()) html_error(DB_ERROR_MSG,0);
-
- $qs = "SELECT query_name,query,delimiter,file
- FROM query_db
- WHERE id = $query_no";
-
- if(!$res = db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
- $row = db_fetch_array($res,0,PGSQL_ASSOC);
- $query_name = $row[query_name];
- $query_string = $row[query];
- $file = $row[file];
- $delimiter = $row[delimiter];
-}
-
-/* Thought the customer would like to see what's in the query */
-$showq = str_replace("SELECT","Return\n",$query_string);
-$showq = str_replace( "\nFROM\t".TABLE." \nWHERE\t".WHERE."\nAND\t",
-" \nfrom the contact database \nwhere ",$showq);
-$showq = str_replace( "\nFROM\t".TABLE." \nWHERE\t".WHERE."\n",
-" \nfrom the contact database",$showq);
-$showq = str_replace("fname","first name",$showq);
-$showq = str_replace("cust_id,","",$showq);
-$showq = str_replace("lname","last name",$showq);
-$showq = str_replace("!~*","does not contain",$showq);
-$showq = str_replace("!~","does not contain",$showq);
-$showq = str_replace("~*","contains",$showq);
-$showq = str_replace("~","is in",$showq);
-$showq = str_replace("does not contain '^"," does not start with ",$showq);
-$showq = str_replace("contains '^"," starts with ",$showq);
-$showq = str_replace("is in '^"," starts with ",$showq);
-$showq = str_replace("$"," in the ending ",$showq);
-$showq = str_replace("OR","or",$showq);
-$showq = str_replace("AND","and",$showq);
-$showq = str_replace("'","",$showq);
-if(!$ALL) {
- if($case == "OFF") {
- $showq .= "\n(case insensitive match)";
- } else {
- $showq .= "\n(case sensitive match)";
- }
-}
-if(isset($file) && $file != "") {
- $showq .= "\noutput 1 file in ";
- if($file == "rpt") {
- $showq .= "text";
- }elseif($file == "gz") {
- $showq .= "tar ball";
- }else {
- $showq .= "zip";
- }
- if($delimiter == "csv")
- $showq .= " format using ".$delimiter;
- else
- $showq .= " format using ".$delimiter." as delimiter";
-}
-$showq .= ".";
-
-
-$query = addslashes($query_string);
-
-top("QUERY BUILDER PAGE","");
-html_nav_table($nav,3);
-?>
-
-
-
-
-
-
-/* Save the query with (current) as query_name */
-if(!$dbd = db_connect()) html_error("Cant connect",0);
-
-$qs = "SELECT id
- FROM query_db
- WHERE query_name = '(current)'";
-
-if(!$res = @db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,0);
-
-if(!$row = @db_fetch_array($res,0,PGSQL_ASSOC)) {
- $qs = "INSERT
- INTO query_db
- (query_name,query,file,delimiter)
- VALUES ('(current)','$query','$file','$delimiter')";
-}
-else {
- $qs = "UPDATE query_db
- SET query = '$query',
- file = '$file',
- delimiter = '$delimiter'
- WHERE id = $row[id]";
-}
-@db_close($dbd);
-
-if(!db_auto_exec($qs)) html_error(DB_ERROR_MSG.$qs,0);
-
-footer();
-?>
diff --git a/admin/Contact/query_db.phtml b/admin/Contact/query_db.phtml
deleted file mode 100755
index 5b78f31..0000000
--- a/admin/Contact/query_db.phtml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-Query is saved as
-Close This
-Window
diff --git a/admin/Contact/query_save.phtml b/admin/Contact/query_save.phtml
deleted file mode 100755
index 36eee7c..0000000
--- a/admin/Contact/query_save.phtml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-//$Id: query_save.phtml,v 1.1.1.1 2008/07/08 15:02:13 jmeek Exp $
-?>
-
-
-
-
-
diff --git a/admin/Contact/update_autoresponse.phtml b/admin/Contact/update_autoresponse.phtml
deleted file mode 100755
index e14be93..0000000
--- a/admin/Contact/update_autoresponse.phtml
+++ /dev/null
@@ -1,224 +0,0 @@
-".$qs,1);
-
-
- break;
-
- case "Insert":
- $dbd = db_connect();
-
- if(!$dbd) html_error(DB_ERROR_MSG,1);
-
- $qs = "INSERT INTO news_response
- (subject,response)
- VALUES
- ('$subject','$response')";
-
- if(!db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,1);
-
-
- break;
-
- case "Cancel":
- break;
-
- default:
- html_error("incorrect value for Command",1);
- break;
- }
- $location = "view_newsletter.phtml?id=$id";
-
-header("Location: $location");
-?>
diff --git a/admin/Contact/update_contact.phtml b/admin/Contact/update_contact.phtml
deleted file mode 100755
index 38f5495..0000000
--- a/admin/Contact/update_contact.phtml
+++ /dev/null
@@ -1,262 +0,0 @@
-
diff --git a/admin/Contact/update_inquiry.phtml b/admin/Contact/update_inquiry.phtml
deleted file mode 100644
index f36fd94..0000000
--- a/admin/Contact/update_inquiry.phtml
+++ /dev/null
@@ -1,174 +0,0 @@
-= $newpos
- ORDER BY pos";
-
- if(!$res = db_exec($conn,$qs))
- {
- html_error(DB_ERROR_MSG.$qs,0);
- }
-
- $counter = ($newpos + 1);
- for($i=0;$i $pos
- AND pos <= $newpos
- ORDER BY pos";
-
- if(!$res = db_exec($conn,$qs))
- {
- html_error(DB_ERROR_MSG.$qs,0);
- }
-
- $counter = ($pos);
- for($i=0;$i $oldpos
- ORDER BY pos";
-
- $res2 = db_exec($conn,$qs);
- $oldcatid_counter = $oldpos;
- for($i=0;$i
diff --git a/admin/Contact/verify.js b/admin/Contact/verify.js
deleted file mode 100755
index a254639..0000000
--- a/admin/Contact/verify.js
+++ /dev/null
@@ -1,72 +0,0 @@
-function isblank(s) {
- for(var i = 0; i < s.length; i++) {
- var c = s.charAt(i);
- if((c != ' ') && (c != '\n') && (c != '\t'))
- return(false);
- }
- return(true);
-}
-
-function verify(f) {
- var msg;
- var empty_fields = "";
- var errors = "";
-
- for(var i = 0; i < f.length; i++) {
- var e = f.elements[i];
- if(((e.type == "text") || (e.type == "textarea")) && !e.optional) {
- if((e.value == null) || (e.value == "") || isblank(e.value)) {
- empty_fields += "\n " + e.r;
- continue;
- }
-
- if(e.d) {
- if(isNaN(Date.parse(e.value)))
- errors += "- The field " +e.r+" must be formated like 01/17/2001\n";
- }
- if(e.numeric || (e.min != null) || (e.max != null)) {
- if(e.i) {
- var v = parseInt(e.value);
- if(v != e.value) {
- errors += "- The field " +e.r + " must be a ";
- errors += "number with no decimal\n";
- continue;
- }
- }
- else
- var v = parseFloat(e.value);
- if(isNaN(v) ||
- ((e.min != null) && (v < e.min)) ||
- ((e.max != null) && (v > e.max))) {
-
- errors += "- The field " + e.r + " must be a number";
- if(e.min != null)
- errors += " that is greater than " + e.min;
- if(e.max != null && e.min != null)
- errors += " and less than " + e.max;
- else if (e.max != null)
- errors += " that is less than " + e.max;
- errors += ".\n";
- }
- }
- }
- }
-
- if(!empty_fields && !errors)
- return(true);
-
- msg = "_____________________________________________________\n\n";
- msg +="The form was not submitted because of the following error(s).\n";
- msg +="Please correct these error(s) and re-submit.\n";
- msg +="_____________________________________________________\n\n";
-
- if(empty_fields) {
- msg += "- The following required field(s) are empty:"
- + empty_fields + "\n";
- if(errors)
- msg += "\n";
- }
- msg += errors;
- alert(msg);
- return(false);
-}
diff --git a/admin/Contact/view_newsletter.phtml b/admin/Contact/view_newsletter.phtml
deleted file mode 100755
index eb75510..0000000
--- a/admin/Contact/view_newsletter.phtml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-html_nav_table($nav,3);
-
-echo'
-
-
-
-
-
-';
-
-footer();
-?>
-
-
-
diff --git a/admin/Contact/wm.js b/admin/Contact/wm.js
deleted file mode 100755
index 7a7323e..0000000
--- a/admin/Contact/wm.js
+++ /dev/null
@@ -1,13 +0,0 @@
-function glm_open(o) {
- var x = (screen.width/2) - (o.width/2);
- var y = (screen.height/2) - (o.height/2);
- var args = "width="+o.width+",height="+o.height+",screenX="+x+",screenY="+y+",top="+y+",left="+x;
- if(o.scroll == true)
- args += ",scrollbars=1";
- //args += "\'";
- //alert(args);
- pow=window.open(o.url,o.name,args);
- //confirm(args);
- if (pow.opener == null)
- pow.opener = self;
-}
diff --git a/admin/Photos/edit-default.php b/admin/Photos/edit-default.php
deleted file mode 100644
index 44d2417..0000000
--- a/admin/Photos/edit-default.php
+++ /dev/null
@@ -1,35 +0,0 @@
-db_exec($query)) {
- die('error updating');
- } else {
- echo 'Updated ';
- }
-}
-$query = "select * from photo_default where id = 1;";
-echo '
-
-
-
-
diff --git a/admin/Photos/edit_display.phtml b/admin/Photos/edit_display.phtml
deleted file mode 100644
index ee77926..0000000
--- a/admin/Photos/edit_display.phtml
+++ /dev/null
@@ -1,20 +0,0 @@
-';
-echo '';
-echo ' ';
-footer();
-?>
diff --git a/admin/Photos/edit_photo.phtml b/admin/Photos/edit_photo.phtml
deleted file mode 100644
index 6f61e33..0000000
--- a/admin/Photos/edit_photo.phtml
+++ /dev/null
@@ -1,139 +0,0 @@
- "edit_photo.phtml?catid=$catid",
- "List Photos" => "list_photo.phtml?catid=$catid"
- );
-GLM_TOOLBOX::html_nav_table($lnav, 2);
-if (isset($id)) {
- $qs = "select id,title,catid,description,image,pos from photo where id = $id";
- if (!$res = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG, 1);
- }
- $row = $DB->db_fetch_array($res, $i, PGSQL_ASSOC);
- if (!$row['id']) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG, 0);
- }
-} else {
- $row = array(
- 'title' => '',
- 'catid' => $catid,
- 'description' => '',
- 'image' => '');
-}
-function catid_select($catid)
-{
- $DB =& $GLOBALS['DB'];
- $qs = "
- SELECT id, category
- FROM photo_category";
- if (!$res2 = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG, 0);
- }
- $select = '';
- for($x = 0; $x < $DB->db_numrows($res2); ++$x) {
- $row = $DB->db_fetch_array($res2, $x, PGSQL_ASSOC);
- if (!$row['id']) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG, 0);
- }
- $select .= '
-
-
-
-echo ' ';
-GLM_TOOLBOX::footer();
-?>
diff --git a/admin/Photos/edit_photo_category.phtml b/admin/Photos/edit_photo_category.phtml
deleted file mode 100755
index 6283ab7..0000000
--- a/admin/Photos/edit_photo_category.phtml
+++ /dev/null
@@ -1,149 +0,0 @@
-db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG,1);
- }
- $row = $DB->db_fetch_array($res,0, PGSQL_ASSOC);
- $qs2 = "select * from photo_category_bus where photocat_id = $id;";
- $res2 = $DB->db_exec($qs2);
- if( pg_numrows( $res2 ) > 0 ) {
- for( $i =0; $i < pg_numrows( $res2 ); $i++ ) {
- $parent[] = pg_result( $res2, $i, 'buscat_id' );
- }
- }
-} else {
- $row = array( "category" => "");
-}
-
-?>
-
-
-
-echo '';
-echo '
- Page to display on:
- '.parent_select($parent).'
- ';
-foreach ($row as $key=>$value) {
- switch ($key) {
-
- case "id":
- echo " ";
- break;
-
- case "pos":
- echo " ";
- break;
-
- case "category":
-
- echo 'Album Name:
-
- ';
- break;
-
- case "intro":
- echo "Intro: ";
- GLM_TOOLBOX::text_area("intro",$value);
- echo " ";
- break;
-
- case "description":
- echo "Description: ";
- GLM_TOOLBOX::text_area("description",$value);
- echo " ";
- break;
-
- case "image":
- if($value != "") {
- echo "
- ";
- echo "Current Image:
-
-
-
-
- Delete this image:
-
-
- Yes
- No
-
- ";
- }
- echo "New Image: \n";
- echo " ";
- break;
-
- default:
- GLM_TOOLBOX::html_error("Incorrect Value -> ".$key,1);
- break;
- }
-}
-if(isset($id)) {
- $qs = "SELECT count(*) as count
- FROM photo
- WHERE catid = $id";
-
- if(!$res = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,0);
- }
-
- $row = $DB->db_fetch_array($res,0,PGSQL_ASSOC);
- ?>
-
-
-
-
-
-
-';
-GLM_TOOLBOX::footer();
-?>
diff --git a/admin/Photos/export-images-is0.php b/admin/Photos/export-images-is0.php
deleted file mode 100755
index ea8ac3b..0000000
--- a/admin/Photos/export-images-is0.php
+++ /dev/null
@@ -1,54 +0,0 @@
-setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
-$sql = "
- SELECT id,image
- FROM photo
- WHERE image != ''
- AND image not like 'is%'
- ORDER BY id";
-try {
- $stmt = $db->query($sql);
- $data = $stmt->fetchAll(PDO::FETCH_ASSOC);
- echo '';
- print_r($data);
- echo ' ';
-} catch(PDOException $e) {
- die($e->getMessage());
-}
-$IServer = new Toolkit_Image_Server();
-if (is_array($data)) {
- $prep2 = "
- UPDATE photo
- SET image = :image
- WHERE id = :id";
- $stmt3 = $db->prepare($prep2);
-
- foreach ($data as &$row) {
- $row['image'] = trim($row['image']);
- var_dump(OLDORG.$row['image']);
- if (!ereg("^is", $row['image'])) {
- try {
- $image_URL = OLDORG.$row['image'];
- $image = $IServer->imageUpload($image_URL);
- if ($image) {
- try {
- $stmt3->bindParam(":image", $image, PDO::PARAM_STR);
- $stmt3->bindParam(":id", $row['id'], PDO::PARAM_INT);
- $stmt3->execute();
- } catch(PDOException $e) {
- die($e->getMessage());
- }
- }
- echo ' Image Name Returned: ';
- var_dump($image);
- } catch(PDOException $e) {
- die($e->getMessage());
- }
- }
- }
-}
-?>
diff --git a/admin/Photos/index.php b/admin/Photos/index.php
deleted file mode 100644
index 07352ec..0000000
--- a/admin/Photos/index.php
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/admin/Photos/list_photo.phtml b/admin/Photos/list_photo.phtml
deleted file mode 100755
index b295116..0000000
--- a/admin/Photos/list_photo.phtml
+++ /dev/null
@@ -1,82 +0,0 @@
- "edit_photo.phtml?catid=$catid",
- "List Photos" => "list_photo.phtml?catid=$catid",
- "List Albums" => "list_photo_category.phtml"
-);
-GLM_TOOLBOX::html_nav_table($lnav, 5);
-$query = "select * from photo_category_bus;";
-if ($res2 = $DB->db_exec($query)) {
- while ($row2 = pg_fetch_array($res2)) {
- $data2[$row2['photocat_id']] = $row2['buscat_id'];
- }
-}
-$qs2 = "
- SELECT id,title,pos
- FROM photo
- WHERE catid = $catid
-ORDER BY pos";
-$res = $DB->db_exec($qs2);
-if (!$res) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG, 1);
-}
-echo '';
-echo get_cat_name($data2[$catid]);
-echo '
';
-echo '
-';
-?>
-
- Function
- Title
-
-db_numrows($res); $i++) {
- $row = $DB->db_fetch_array($res, $i, PGSQL_ASSOC);
- if (!$row['id']) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG, 1);
- }
- if (!$row['id']) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG, 1);
- }
- ?>
-
-
- [Edit/Delete]
- db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,0);
- }
- $max_data = $DB->db_fetch_array($maxresult,0,PGSQL_ASSOC);
- $maxpos = $max_data['maxpos'];
- $pos = "";
- for ($newpos=1;$newpos<=$maxpos;$newpos++) {
- $string = "Command=Move&id=$row[id]&catid=$catid&newpos=$newpos";
- $pos .= "
-
-
-
-
-
-';
-GLM_TOOLBOX::footer();
-?>
diff --git a/admin/Photos/list_photo_category.phtml b/admin/Photos/list_photo_category.phtml
deleted file mode 100755
index 560b284..0000000
--- a/admin/Photos/list_photo_category.phtml
+++ /dev/null
@@ -1,96 +0,0 @@
-db_exec($sql)) {
- while ($row2 = pg_fetch_array($res2)) {
- $data2[$row2['buscat_id']][] = $row2['photocat_id'];
- }
-}
-GLM_TOOLBOX::top("Photo Albums (List Categories)", HELP_BASE."photocat.phtml?key=list");
-$lnav["Add A New Album"] = "edit_photo_category.phtml";
-GLM_TOOLBOX::html_nav_table($lnav, 7);
-echo '
-';
-?>
-
- Function
- Gallery Name
-
-
- $row3) {
- $qs = "select pc.id,pc.category,pcb.pos
- from photo_category pc left outer join photo_category_bus pcb on (pcb.photocat_id = pc.id)
- where pcb.buscat_id = ".$buscat." order by pcb.pos;";
- if (!$res = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 1);
- }
- echo '
-
- Toggle Exp/Col
- '.get_cat_name($buscat).'
-
- ';
- for ($i = 0; $i < $DB->db_numrows( $res ); $i++) {
- $row = $DB->db_fetch_array($res, $i, PGSQL_ASSOC);
- if (!$row['id']) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG, 1);
- }
- ?>
-
-
- [Edit]
- [List Photos]
- db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 0);
- }
- $max_data = $DB->db_fetch_array($maxresult, 0, PGSQL_ASSOC);
- $maxpos = $max_data['maxpos'];
- $pos = '';
- for ($newpos = 1; $newpos <= $maxpos; $newpos++) {
- $string = "Command=Move&id=$row[id]&newpos=$newpos&oldpos=".$row['pos']."&&buscat_id=$buscat";
- $pos .= "
-
-
-
-
-
-';
-GLM_TOOLBOX::footer();
-?>
diff --git a/admin/Photos/photo-setup.inc b/admin/Photos/photo-setup.inc
deleted file mode 100644
index d228853..0000000
--- a/admin/Photos/photo-setup.inc
+++ /dev/null
@@ -1,304 +0,0 @@
-
- * @copyright 2009 Gaslight Media
- * @license Gaslight Media
- * @version CVS: $Id: photo-setup.inc,v 1.6 2009/10/16 15:09:11 matrix Exp $
- * @link <>
- */
-
-/**
- * Description for define
- */
-define("LEVELS_DEEP", 5);
-// create a global database object
-$DB = new GLM_DB();
-
-/**
- * $GLOBALS['DB']
- * @global mixed $GLOBALS['DB']
- * @name $DB
- */
-$GLOBALS['DB'] = $DB;
-// {{{ get_cat_name()
-/**
- * get_cat_name
- * get the name of the category and the parent up to 4 levels
- *
- * @param mixed $id id for table bus_category
- *
- * @access public
- * @return void
- */
-function get_cat_name($id)
-{
- $DB =& $GLOBALS['DB'];
- if (is_numeric($id) && $id != 0) {
- $query = "
- SELECT category,parent
- FROM bus_category
- WHERE id = $id;";
- $res = $DB->db_exec($query);
- $category = pg_result($res, 0, 'category');
- $parent = pg_result($res, 0, 'parent');
- $cats[] = strip_tags($category);
- if ($parent != '0') {
- $query = "
- SELECT category,parent
- FROM bus_category
- WHERE id = $parent;";
- $res = $DB->db_exec( $query);
- $category = pg_result($res, 0, 'category');
- $parent = pg_result($res, 0, 'parent');
- $cats[] = strip_tags($category);
- if ($parent != '0') {
- $query = "
- SELECT category,parent
- FROM bus_category
- WHERE id = $parent;";
- $res = $DB->db_exec( $query);
- $category = pg_result($res, 0, 'category');
- $parent = pg_result($res, 0, 'parent');
- $cats[] = strip_tags($category);
- if ($parent != '0') {
- $query = "
- SELECT category,parent
- FROM bus_category
- WHERE id = $parent;";
- $res = $DB->db_exec( $query);
- $category = pg_result($res, 0, 'category');
- $parent = pg_result($res, 0, 'parent');
- $cats[] = strip_tags($category);
- }
- }
- }
- $cats = array_reverse($cats);
- return implode(" > ", $cats);
- } else {
- return false;
- }
-}
-// }}}
-// {{{ photo_process_image()
-/**
- * photo_process_image function for image processing
- *
- * @param mixed $image The variable of the image being post from the form
- * @param mixed $image_name The variable_name of the image being post
- * @access public
- * @return void
- */
-function photo_process_image($image, $image_name)
-{
- $image_upload_array = GLM_TOOLBOX::img_upload($image, $image_name, PHOTO_LARGE_DIR);
- GLM_TOOLBOX::img_resize(PHOTO_LARGE_DIR.$image_upload_array[0],
- PHOTO_LARGE_DIR.$image_upload_array[0], PHOTO_LARGE_SIZE);
- GLM_TOOLBOX::img_resize(PHOTO_LARGE_DIR.$image_upload_array[0],
- PHOTO_SMALL_DIR.$image_upload_array[0], PHOTO_SMALL_SIZE);
- $image_name = $image_upload_array[0];
- return $image_name;
-}
-// }}}
-// {{{ sort_by_parent()
-/**
- * sort_by_parent
- *
- * @param mixed $data
- * @access public
- * @return void
- */
-function sort_by_parent($data)
-{
- if (!is_array($data)) {
- return false;
- }
- foreach($data as $key=>$value) {
- $data_new[$value["parent"]][$value["id"]] = $value;
- }
- return $data_new;
-}
-// }}}
-// {{{ convertParent()
-/**
- * convertParent
- *
- * @param mixed $threads
- * @param mixed $thread
- * @access public
- * @return void
- */
-function convertParent($threads,$thread)
-{
- static $select,$count;
- if (!$count) {
- $count = 0;
- }
- $bgcolor[] = '#ccc';
- $bgcolor[] = '#ddd';
- if (is_array($thread)) {
- foreach($thread as $parent=>$value) {
- $color = $bgcolor[$count];
- $select[$value["id"]]["color"] = $color;
- $select[$value["id"]]["category"] = $value["category"];
- $select[$value["id"]]["count"] = $count;
-
- if (isset($threads[$parent])) {
- $count++;
- convertParent($threads, $threads[$parent]);
- }
- }
- }
- $count--;
- return $select;
-}
-// }}}
-// {{{ parent_select()
-/**
- * parent select
- *
- * This function does both the bus and bus category page parent select drop down
- * boxes. The backcount var is used to lock the list to a certain level set up
- * with define of LEVELS_DEEP. Count varl starts at one and is generated in the
- * function convertParent so we'll need to subtract one for proper results.
- * To unset backcount properly we'll need to check if count goes under or
- * equals that of backcount. Then unset($backcount) cause if backcount is not
- * empty then category won't get added to list.
- *
- * @return string
- */
-function parent_select($catid)
-{
- // select catid portion
- $qs = "
- SELECT id,category,parent
- FROM bus_category
- ORDER BY parent,pos";
-
- $res = $GLOBALS['DB']->db_exec( $qs);
- while ($row = pg_fetch_array($res)) {
- $data[] = $row;
- }
- $data1 = sort_by_parent($data);
- $select = '';
- //$select .= '--No Page-- ';
- $parts = convertParent($data1,$data1[0]);
- if (is_array($parts)) {
- foreach($parts as $key=>$value) {
- if (isset($backcount) && $value['count'] <= $backcount) {
- unset($backcount);
- }
- if ($key == $id && $sel_name = "parent") {
- $backcount = $value['count'];
- }
-
- if ((!isset($backcount) && ($value['count'] < (LEVELS_DEEP - 1)) || $sel_name == "catid[]")) {
- $bkg = $value["color"];
- $indent = (int)$value["count"] * 10;
- $cc = (int)$value["count"] * 2;
- $paddman = str_repeat(" ",$cc);
- $select .= 'db_exec("BEGIN WORK;")) {
- die('end'.__LINE__);
- }
- $query = "
- SELECT *
- FROM photo_category_bus
- WHERE photocat_id = $photo_id
- AND buscat_id NOT IN (".implode(',',$bus_id).");";
- if (!$res = $GLOBALS['DB']->db_exec( $query)) {
- die('end'.$query.__LINE__);
- }
- while ($row = pg_fetch_object($res)) {
- $query = "
- DELETE FROM photo_category_bus
- WHERE id = ".$row->id.";
- UPDATE photo_category_bus
- SET pos = pos - 1
- WHERE pos > ".$row->pos."
- AND buscat_id = ".$row->buscat_id.";";
- if (!$res = $GLOBALS['DB']->db_exec( $query)) {
- die('end'.$query.__LINE__);
- }
- }
- foreach($bus_id as $busId) {
- unset($maxpos);
- $query = "
- SELECT max(pos) AS maxpos
- FROM photo_category_bus
- WHERE buscat_id = $busId";
- if (!$res = $GLOBALS['DB']->db_exec( $query)) {
- die('end'.$query.__LINE__);
- }
- $maxpos = pg_result($res, 0, 'maxpos');
- if (!$maxpos) {
- $maxpos = 1;
- } else {
- $maxpos++;
- }
- $query = "
- SELECT count(id) AS count
- FROM photo_category_bus
- WHERE photocat_id = $photo_id
- AND buscat_id = $busId;";
- if (!$res = $GLOBALS['DB']->db_exec( $query)) {
- die('end'.$query.__LINE__);
- }
- $count = pg_result($res, 0 , 'count');
- if ($count == 0) {
- $query = "
- INSERT INTO photo_category_bus
- (photocat_id,buscat_id,pos)
- VALUES
- ($photo_id,$busId,$maxpos);";
- if (!$GLOBALS['DB']->db_exec( $query)) {
- die('end'.$query.__LINE__);
- }
- }
- }
- // ending transaction
- if (!$GLOBALS['DB']->db_exec("COMMIT WORK;")) {
- die('end'.__LINE__);
- }
- $query = "";
-}// }}}
-?>
diff --git a/admin/Photos/photo.sql b/admin/Photos/photo.sql
deleted file mode 100755
index f7742e3..0000000
--- a/admin/Photos/photo.sql
+++ /dev/null
@@ -1,139 +0,0 @@
-\connect - postgres
-SET client_encoding = 'SQL_ASCII';
-SET check_function_bodies = false;
-CREATE TABLE "photo_category" (
- "id" SERIAL PRIMARY KEY,
- "category" text,
- "image" text,
- "pos" integer
-);
-
-REVOKE ALL on "photo_category" from PUBLIC;
-GRANT ALL on "photo_category" to "nobody";
-GRANT ALL on "photo_category" to "postgres";
-
-REVOKE ALL on "photo_category_id_seq" from PUBLIC;
-GRANT ALL on "photo_category_id_seq" to "nobody";
-GRANT ALL on "photo_category_id_seq" to "postgres";
-
-CREATE TABLE "photo" (
- "id" SERIAL PRIMARY KEY,
- "title" text,
- "description" text,
- "image" text,
- "catid" integer,
- "pos" integer,
- FOREIGN KEY (catid) REFERENCES photo_category(id) ON DELETE CASCADE
-);
-
-REVOKE ALL on "photo" from PUBLIC;
-GRANT ALL on "photo" to "nobody";
-GRANT ALL on "photo" to "postgres";
-
-REVOKE ALL on "photo_id_seq" from PUBLIC;
-GRANT ALL on "photo_id_seq" to "nobody";
-GRANT ALL on "photo_id_seq" to "postgres";
-
-CREATE TABLE photo_category_bus (
- "id" SERIAL PRIMARY KEY,
- "photocat_id" int,
- "buscat_id" int,
- "pos" integer,
- FOREIGN KEY (photocat_id) REFERENCES photo_category(id) ON DELETE CASCADE,
- FOREIGN KEY (buscat_id) REFERENCES bus_category(id) ON DELETE CASCADE
-)
-
-REVOKE ALL on "photo_category_bus" from PUBLIC;
-GRANT ALL on "photo_category_bus" to "nobody";
-GRANT ALL on "photo_category_bus" to "postgres";
-
-REVOKE ALL on "photo_category_bus_id_seq" from PUBLIC;
-GRANT ALL on "photo_category_bus_id_seq" to "nobody";
-GRANT ALL on "photo_category_bus_id_seq" to "postgres";
---
--- TOC entry 3 (OID 12966596)
--- Name: photo_config; Type: TABLE; Schema: public; Owner: matrix
---
-
-CREATE TABLE photo_default (
- id serial NOT NULL,
- header text,
- description text
-);
-
-
---
--- TOC entry 4 (OID 12966596)
--- Name: photo_config; Type: ACL; Schema: public; Owner: matrix
---
-
-REVOKE ALL ON TABLE photo_default FROM PUBLIC;
-GRANT ALL ON TABLE photo_default TO nobody;
-
-
---
--- TOC entry 5 (OID 12966599)
--- Name: photo_config_pkey; Type: CONSTRAINT; Schema: public; Owner: matrix
---
-
-ALTER TABLE ONLY photo_default
- ADD CONSTRAINT photo_default_pkey PRIMARY KEY (id);
-
-insert into photo_default (header,description) values ('Photo Gallery','Instructions on how to use this gallery. This text will be managed from the administration area shortly.');
---
--- TOC entry 3 (OID 13410626)
--- Name: photo_category_bus; Type: TABLE; Schema: public; Owner: postgres
---
-
-CREATE TABLE photo_category_bus (
- id serial NOT NULL,
- photocat_id integer,
- buscat_id integer,
- pos integer
-);
-
-
---
--- TOC entry 4 (OID 13410626)
--- Name: photo_category_bus; Type: ACL; Schema: public; Owner: postgres
---
-
-REVOKE ALL ON TABLE photo_category_bus FROM PUBLIC;
-GRANT ALL ON TABLE photo_category_bus TO nobody;
-
-
---
--- TOC entry 5 (OID 13410626)
--- Name: photo_category_bus_id_seq; Type: ACL; Schema: public; Owner: postgres
---
-
-REVOKE ALL ON TABLE photo_category_bus_id_seq FROM PUBLIC;
-GRANT ALL ON TABLE photo_category_bus_id_seq TO nobody;
-
-
---
--- TOC entry 6 (OID 13410629)
--- Name: photo_category_bus_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
---
-
-ALTER TABLE ONLY photo_category_bus
- ADD CONSTRAINT photo_category_bus_pkey PRIMARY KEY (id);
-
-
---
--- TOC entry 7 (OID 13410631)
--- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
---
-
-ALTER TABLE ONLY photo_category_bus
- ADD CONSTRAINT "$1" FOREIGN KEY (photocat_id) REFERENCES photo_category(id) ON DELETE CASCADE;
-
-
---
--- TOC entry 8 (OID 13410635)
--- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
---
-
-ALTER TABLE ONLY photo_category_bus
- ADD CONSTRAINT "$2" FOREIGN KEY (buscat_id) REFERENCES bus_category(id) ON DELETE CASCADE;
-
diff --git a/admin/Photos/photo_config.sql b/admin/Photos/photo_config.sql
deleted file mode 100755
index 2ad98e8..0000000
--- a/admin/Photos/photo_config.sql
+++ /dev/null
@@ -1,97 +0,0 @@
---
--- PostgreSQL database dump
---
-
-SET client_encoding = 'SQL_ASCII';
-SET check_function_bodies = false;
-
-SET SESSION AUTHORIZATION 'matrix';
-
-SET search_path = public, pg_catalog;
-
---
--- TOC entry 3 (OID 12966596)
--- Name: photo_config; Type: TABLE; Schema: public; Owner: matrix
---
-
-CREATE TABLE photo_config (
- id serial NOT NULL,
- category integer
-);
-
-
---
--- TOC entry 4 (OID 12966596)
--- Name: photo_config; Type: ACL; Schema: public; Owner: matrix
---
-
-REVOKE ALL ON TABLE photo_config FROM PUBLIC;
-GRANT ALL ON TABLE photo_config TO nobody;
-
-
---
--- TOC entry 5 (OID 12966599)
--- Name: photo_config_pkey; Type: CONSTRAINT; Schema: public; Owner: matrix
---
-
-ALTER TABLE ONLY photo_config
- ADD CONSTRAINT photo_config_pkey PRIMARY KEY (id);
-
---
--- TOC entry 3 (OID 13410626)
--- Name: photo_category_bus; Type: TABLE; Schema: public; Owner: postgres
---
-
-CREATE TABLE photo_category_bus (
- id serial NOT NULL,
- photocat_id integer,
- buscat_id integer
-);
-
-
---
--- TOC entry 4 (OID 13410626)
--- Name: photo_category_bus; Type: ACL; Schema: public; Owner: postgres
---
-
-REVOKE ALL ON TABLE photo_category_bus FROM PUBLIC;
-GRANT ALL ON TABLE photo_category_bus TO nobody;
-
-
---
--- TOC entry 5 (OID 13410626)
--- Name: photo_category_bus_id_seq; Type: ACL; Schema: public; Owner: postgres
---
-
-REVOKE ALL ON TABLE photo_category_bus_id_seq FROM PUBLIC;
-GRANT ALL ON TABLE photo_category_bus_id_seq TO nobody;
-
-
---
--- TOC entry 6 (OID 13410629)
--- Name: photo_category_bus_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
---
-
-ALTER TABLE ONLY photo_category_bus
- ADD CONSTRAINT photo_category_bus_pkey PRIMARY KEY (id);
-
-
---
--- TOC entry 7 (OID 13410631)
--- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
---
-
-ALTER TABLE ONLY photo_category_bus
- ADD CONSTRAINT "$1" FOREIGN KEY (photocat_id) REFERENCES photo_category(id) ON DELETE CASCADE;
-
-
---
--- TOC entry 8 (OID 13410635)
--- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
---
-
-ALTER TABLE ONLY photo_category_bus
- ADD CONSTRAINT "$2" FOREIGN KEY (buscat_id) REFERENCES bus_category(id) ON DELETE CASCADE;
-
-
-
diff --git a/admin/Photos/update_display.php b/admin/Photos/update_display.php
deleted file mode 100644
index 71db4da..0000000
--- a/admin/Photos/update_display.php
+++ /dev/null
@@ -1,10 +0,0 @@
-
diff --git a/admin/Photos/update_photo.phtml b/admin/Photos/update_photo.phtml
deleted file mode 100644
index 684033b..0000000
--- a/admin/Photos/update_photo.phtml
+++ /dev/null
@@ -1,276 +0,0 @@
-
- * @copyright 2009 Gaslight Media
- * @license Gaslight Media
- * @version CVS: $Id: update_photo.phtml,v 1.4 2009/05/13 16:50:53 matrix Exp $
- * @link <>
- */
-
-/**
- * Description for require_once
- */
-require_once "../../setup.phtml";
-
-/**
- * Description for require_once
- */
-require_once 'photo-setup.inc';
-
-if ($_POST || $_REQUEST['Command'] == "Move") {
- switch ($Command) {
- case "Move":
- $qs = "
- SELECT pos,id
- FROM photo
- WHERE id = $id";
-
- if (!$result = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 0);
- }
-
- $data = $DB->db_fetch_array($result, 0, PGSQL_ASSOC);
- $pos = $data['pos'];
-
- if ($newpos < $pos) {
- $qs = "
- SELECT id,pos
- FROM photo
- WHERE pos < $pos
- AND pos >= $newpos
- AND catid = $catid
- ORDER BY pos";
-
- if (!$res = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 0);
- }
-
- $counter = ($newpos + 1);
- for ($i = 0; $i < $DB->db_numrows($res); $i++) {
- $res_data = $DB->db_fetch_array($res, $i, PGSQL_ASSOC);
- $res_id = $res_data['id'];
- $res_pos = $res_data['pos'];
- $qs = "
- UPDATE photo
- SET pos = $counter
- WHERE id = $res_id";
-
- if (!$DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 0);
- }
- $counter++;
- }
- } else {
- $qs = "
- SELECT pos,id
- FROM photo
- WHERE pos > $pos
- AND pos <= $newpos
- AND catid = $catid
- ORDER BY pos";
-
- if (!$res = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 0);
- }
-
- $counter = ($pos);
- for ($i = 0; $i < $DB->db_numrows($res); $i++) {
- $res_data = $DB->db_fetch_array($res, $i, PGSQL_ASSOC);
- $res_id = $res_data['id'];
- $res_pos = $res_data['pos'];
- $qs = "
- UPDATE photo
- SET pos = $counter
- WHERE id = $res_id";
-
- if (!$DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 0);
- }
- $counter++;
- }
- }
- $qs = "
- UPDATE photo
- SET pos = $newpos
- WHERE id = $id";
-
- if (!$DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 0);
- }
-
- $location = "list_photo.phtml?catid=$catid";
- break;
-
- case "Update":
- if ($image != "none" && $image != '') {
-
- /**
- * include the Toolkit_Image_Server class
- */
- include_once BASE.'Toolkit/Image/Server.php';
- $imServer = new Toolkit_Image_Server();
- if ($oldimage) {
- $imServer->imageDelete($oldimage);
- }
- $image_name = GLM_TOOLBOX::process_image('image');
- } else {
- $image_name = $oldimage;
- }
-
- if ($delete == "1") {
- $image_name = "";
-
- /**
- * include the Toolkit_Image_Server class
- */
- include_once BASE.'Toolkit/Image/Server.php';
- $imServer = new Toolkit_Image_Server();
- $imServer->imageDelete($_REQUEST['oldimage']);
- }
-
- if ($catid != $oldcatid) {
-
- $qs = "
- SELECT MAX(pos) as maxpos
- FROM photo
- WHERE catid = $catid";
-
- $res = $DB->db_exec($qs);
- $row = $DB->db_fetch_array($res, 0, PGSQL_ASSOC);
- $pos = $row['maxpos'];
- ++$pos;
-
- $qs = "
- SELECT pos, id
- FROM photo
- WHERE catid = $oldcatid
- AND pos > $oldpos
- ORDER BY pos";
-
- $res2 = $DB->db_exec($qs);
- $oldcatid_counter = $oldpos;
- for ($i = 0; $i < $DB->db_numrows($res2); ++$i) {
- $row2 = $DB->db_fetch_array($res2, $i, PGSQL_ASSOC);
- $qs = "
- UPDATE photo
- SET pos = $oldcatid_counter
- WHERE id = {$row2['id']}";
-
- $DB->db_exec($qs);
- ++$oldcatid_counter;
- }
-
- } else {
- $pos = $oldpos;
- }
-
- $qs = "
- UPDATE photo
- SET title = '$title',
- catid = $catid,
- image = '$image_name',
- description = '$description',
- pos = $pos
- WHERE id = $id";
-
- if (!$DB->db_auto_exec($qs)) {
- html_error("failed ->".$qs, 1);
- }
-
- $location = "list_photo.phtml?catid=$catid";
- break;
-
- case "Insert":
- if ($image != "none") {
- $image_name = GLM_TOOLBOX::process_image('image');
- } else {
- $image_name = "";
- }
-
- $qs = "
- SELECT MAX(pos) as maxpos
- FROM photo
- WHERE catid = $catid";
-
- $res = $DB->db_exec($qs);
- $row = $DB->db_fetch_array($res, 0, PGSQL_ASSOC);
- $nextpos = $row['maxpos'];
- $nextpos++;
-
- $qs = "
- INSERT INTO photo
- (description,title,catid,image,pos)
- VALUES
- ('$description','$title',$catid,'$image_name',$nextpos)";
-
- if (!$DB->db_auto_exec($qs)) {
- GLM_TOOLBOX::html_error("failed ->".$qs, 1);
- }
-
- $location = "list_photo.phtml?catid=$catid";
-
- break;
-
- case "Delete":
- $qs = "
- DELETE FROM photo
- WHERE id = $id";
-
- if (!$DB->db_auto_exec($qs)) {
- GLM_TOOLBOX::html_error("failed ->".$qs, 1);
- }
- if ($oldimage) {
-
- /**
- * include the Toolkit_Image_Server class
- */
- include_once BASE.'Toolkit/Image/Server.php';
- $imServer = new Toolkit_Image_Server();
- $imServer->imageDelete($oldimage);
- }
-
- $qs = "
- SELECT pos,id
- FROM photo
- WHERE catid = $oldcatid
- AND pos > $oldpos
- ORDER BY pos";
-
- $res2 = $DB->db_exec($qs);
- $oldcatid_counter = $oldpos;
- for ($i = 0; $i < $DB->db_numrows($res2); $i++) {
- $row2 = $DB->db_fetch_array($res2, $i, PGSQL_ASSOC);
- $qs = "
- UPDATE photo
- SET pos = $oldcatid_counter
- WHERE id = {$row2['id']}";
-
- if (!$DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG, 0);
- }
- $oldcatid_counter++;
- }
- $location = "list_photo.phtml?catid=$catid";
-
- break;
-
- case "Cancel":
- $location = "list_photo.phtml?catid=$catid";
- break;
-
- default:
- GLM_TOOLBOX::html_error("incorrect value for Command", 1);
- break;
- }
- header("Location: $location");
-}
-?>
diff --git a/admin/Photos/update_photo_category.phtml b/admin/Photos/update_photo_category.phtml
deleted file mode 100644
index 3c6a454..0000000
--- a/admin/Photos/update_photo_category.phtml
+++ /dev/null
@@ -1,121 +0,0 @@
-db_exec('BEGIN WORK;');
-
- if( $newpos > $oldpos )
- {
- $query = "update photo_category_bus
- set pos = pos - 1
- where pos > $oldpos
- and buscat_id = ".$_GET['buscat_id']."
- and pos <= $newpos";
- $DB->db_exec($query);
- }
- elseif( $newpos < $oldpos )
- {
- $query = "update photo_category_bus
- set pos = pos + 1
- where pos >= $newpos
- and buscat_id = ".$_GET['buscat_id']."
- and pos < $oldpos";
- $DB->db_exec($query);
- }
- $query = "update photo_category_bus set pos = $newpos where photocat_id = ".$_GET['id']."
- and buscat_id = ".$_GET['buscat_id'].";";
- // echo ''.$query.'
';
- $DB->db_exec($query);
- $DB->db_exec('COMMIT WORK;');
- //exit();
- $location = "list_photo_category.phtml?catid=$catid";
- break;
-
- case "Update":
- $DB->db_exec('BEGIN WORK;');
- $qs = "UPDATE photo_category SET
- category = '$category'
- WHERE id = $id";
- if(!$DB->db_exec($qs)) {
- html_error("failed ->".$qs,1);
- }
- update_photo_bus($id, $parent);
- $location = "list_photo_category.phtml";
- $DB->db_exec('COMMIT WORK');
- break;
-
- case "Insert":
- $DB->db_exec('BEGIN WORK');
- $qs = "INSERT INTO photo_category
- (category)
- VALUES
- ('$category')";
- if(!$res = $DB->db_exec($qs))
- {
- html_error("failed ->".$qs,1);
- }
- if( is_array( $parent ) )
- {
- $qs = "
- SELECT id
- FROM photo_category
- order by id DESC limit 1";
- $res = $DB->db_exec($qs);
- $res = $DB->db_fetch_array($res, 0, PGSQL_ASSOC);
- update_photo_bus( $res['id'], $parent);
- }
- $DB->db_exec('COMMIT WORK');
- $location = "list_photo_category.phtml";
- break;
-
- case "Delete":
- $DB->db_exec('BEGIN WORK');
- $qs = "SELECT *
- FROM photo
- WHERE catid = $id";
- $res = $DB->db_exec($qs);
- if($DB->db_numrows($res) >0)
- {
- html_error("Sorry but you have items in there\n
- Delete these record before the Categories\n",1);
- }
- $query = "select * from photo_category_bus where photocat_id = $id;";
- if( !$res = $DB->db_exec($query ) )
- {
- die('end'.$query.__LINE__);
- }
- while( $row = pg_fetch_object( $res ) )
- {
- $query = "delete from photo_category_bus where id = ".$row->id.";
- update photo_category_bus set pos = pos - 1 where pos > ".$row->pos." and buscat_id = ".$row->buscat_id.";";
- if( !$res = $DB->db_exec($query ) )
- {
- die('end'.$query.__LINE__);
- }
- }
- $qs2 = "DELETE FROM photo_category
- WHERE id = $id";
- if(!$DB->db_exec($qs2))
- {
- html_error(DB_ERROR_MSG.$qs2,1);
- }
- $DB->db_exec('COMMIT WORK');
- //exit();
- $location = "list_photo_category.phtml";
- break;
-
- case "Cancel":
- $location = "list_photo_category.phtml";
- break;
-
- default:
- html_error("incorrect value for Command",1);
- break;
- }
-
- header("Location: $location");
-}
-?>
diff --git a/admin/Toolbox/ShortUrlCheck.php b/admin/Toolbox/ShortUrlCheck.php
deleted file mode 100644
index bc6158e..0000000
--- a/admin/Toolbox/ShortUrlCheck.php
+++ /dev/null
@@ -1,17 +0,0 @@
-isValidUrlName($_GET['url'])) {
- echo 'true';
- } else {
- echo 'false';
- }
- } catch(Exception $e) {
- die($e->getMessage);
- }
-}
-?>
diff --git a/admin/Toolbox/business.sql b/admin/Toolbox/business.sql
deleted file mode 100644
index b68fbc3..0000000
--- a/admin/Toolbox/business.sql
+++ /dev/null
@@ -1,86 +0,0 @@
-CREATE TABLE bus (
- id serial NOT NULL,
- name text,
- description text,
- image text,
- imagename text,
- back_to_top bool
-);
-
-CREATE TABLE bus_category (
- id serial NOT NULL,
- parent integer,
- category text,
- intro text,
- description text,
- image text,
- imagename text,
- active boolean,
- pos integer,
- keyword text,
- "template" integer,
- no_search_form bool,
- include_member_map boolean not null default false,
- featured bool,
- feature_intro text,
- section_links bool,
- title text,
- meta_descr text,
- short_url text,
- region integer
-);
-
-CREATE TABLE bus_category_bus (
- id serial NOT NULL,
- busid integer,
- catid integer,
- pos integer
-);
-
-CREATE UNIQUE INDEX bus_id_indx ON bus USING btree (id);
-CREATE UNIQUE INDEX bus_category_id_indx ON bus_category USING btree (id);
-CREATE INDEX bus_category_parent_indx ON bus_category USING btree (parent);
-CREATE INDEX bus_category_pos_indx ON bus_category USING btree (pos);
-CREATE INDEX bus_category_keyword_indx ON bus_category USING btree (keyword);
-CREATE INDEX bus_category_template_indx ON bus_category USING btree ("template");
-CREATE UNIQUE INDEX bus_category_bus_id_indx ON bus_category_bus USING btree (id);
-CREATE INDEX bus_category_bus_busid_indx ON bus_category_bus USING btree (busid);
-CREATE INDEX bus_category_bus_catid_indx ON bus_category_bus USING btree (catid);
-ALTER TABLE ONLY bus_category
- ADD CONSTRAINT bus_category_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY bus
- ADD CONSTRAINT bus_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY bus_category_bus
- ADD CONSTRAINT bus_category_bus_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY bus_category_bus ADD CONSTRAINT "$1" FOREIGN KEY (catid) REFERENCES bus_category(id) ON DELETE CASCADE;
-ALTER TABLE ONLY bus_category_bus ADD CONSTRAINT "$2" FOREIGN KEY (busid) REFERENCES bus(id) ON DELETE CASCADE;
-GRANT ALL on "bus" to "nobody";
-GRANT ALL on "bus" to "postgres";
-GRANT ALL on "bus_id_seq" to "nobody";
-GRANT ALL on "bus_id_seq" to "postgres";
-GRANT ALL on "bus_category" to "nobody";
-GRANT ALL on "bus_category" to "postgres";
-GRANT ALL on "bus_category_id_seq" to "nobody";
-GRANT ALL on "bus_category_id_seq" to "postgres";
-GRANT ALL on "bus_category_bus" to "nobody";
-GRANT ALL on "bus_category_bus" to "postgres";
-GRANT ALL on "bus_category_bus_id_seq" to "nobody";
-GRANT ALL on "bus_category_bus_id_seq" to "postgres";
-
-INSERT INTO bus_category (id,category,parent,pos,active) VALUES (nextval('bus_category_id_seq'),'Home',0,1,'t');
-
-CREATE TABLE files (
- id serial NOT NULL,
- filename text,
- bytes integer,
- "type" text,
- urltext text,
- bus_id integer,
- pos integer default 1
-);
-GRANT ALL ON TABLE files TO nobody;
-GRANT ALL ON TABLE files_id_seq TO nobody;
-ALTER TABLE ONLY files
- ADD CONSTRAINT files_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY files
- ADD CONSTRAINT "$1" FOREIGN KEY (bus_id) REFERENCES bus(id) ON DELETE CASCADE;
diff --git a/admin/Toolbox/cktoolbox.js b/admin/Toolbox/cktoolbox.js
deleted file mode 100644
index 92f2229..0000000
--- a/admin/Toolbox/cktoolbox.js
+++ /dev/null
@@ -1,23 +0,0 @@
-var CkToolbox =
-{
- init: function()
- {
- if ($('#description').is('textarea')) {
- // Only try to replace the textarea if the
- // CKEditor is compatible w/ the browser.
- if (CKEDITOR.env.isCompatible) {
- CKEDITOR.replace('description',
- {
- toolbar : 'Default',
- width : 570,
- height : 400,
- filebrowserImageBrowseUrl : '../../Toolkit/CKImages/browser.php?folder=1',
- filebrowserImageUploadUrl : '../../Toolkit/CKImages/controller.php?command=Upload',
- filebrowserImageWindowWidth : '760',
- filebrowserImageWindowHeight : '500'
- });
- }
- }
- }
-};
-$(document).ready(CkToolbox.init);
diff --git a/admin/Toolbox/collapse.png b/admin/Toolbox/collapse.png
deleted file mode 100755
index d10e051..0000000
Binary files a/admin/Toolbox/collapse.png and /dev/null differ
diff --git a/admin/Toolbox/convert_files.php b/admin/Toolbox/convert_files.php
deleted file mode 100644
index 4cd2e95..0000000
--- a/admin/Toolbox/convert_files.php
+++ /dev/null
@@ -1,68 +0,0 @@
- 1 )
- {
- $query .= $i;
- }
- $query .= ",file";
- if( $i > 1 )
- {
- $query .= $i;
- }
- $query .= "name from bus where file";
- if( $i > 1 )
- {
- $query .= $i;
- }
- $query .= " != '' order by id;";
- echo 'Query is :'.$query.'
';
- $res = $DB->db_exec( $query );
- while( $row = pg_fetch_array( $res ) )
- {
- $data[] = $row;
- }
-}
-echo '';
-print_r( $data );
-echo ' ';
-//exit();
-$res = $DB->db_exec( "BEGIN WORK" );
-if( is_array( $data ) )
-{
- foreach( $data as $row )
- {
- $id = $row['0'];
- $filename = $row['1'];
- $urltext = $row['2'];
- echo ''.UP_BASE.$filename.'
';
- if (file_exists(UP_BASE . $filename)) {
- $iFile = stat( UP_BASE.$filename );
- echo ''.print_r($iFile, true).' ';
- if ($iFile) {
- // echo 'File: '.UP_BASE.$filename.'
';
- $query = "insert into files
- (filename,bytes,urltext,bus_id)
- values
- ('$filename','".$iFile['size']."','$urltext','$id');";
- echo ''.$query.'
';
- if(! $res = $DB->db_exec( $query ) )
- {
- die( pg_errormessage( $res ) );
- }
- }
- }
- }
-}
-$res = $DB->db_exec( "COMMIT WORK" );
-/*
-echo '';
-print_r( $data );
-echo ' ';
-*/
-?>
diff --git a/admin/Toolbox/edit_bus.phtml b/admin/Toolbox/edit_bus.phtml
deleted file mode 100755
index 34307b0..0000000
--- a/admin/Toolbox/edit_bus.phtml
+++ /dev/null
@@ -1,318 +0,0 @@
-db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,1);
- }
- $row = $DB->db_fetch_array($res,0, PGSQL_ASSOC);
- if(!$row[id]) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,1);
- }
-} else {
- $row = array (
- "name" => "",
- "catid" => $catid,
- "address" => "",
- "city" => "",
- "state" => "",
- "zip" => "",
- "phone" => "",
- "fax" => "",
- "email" => "",
- "url" => "",
- "description" => "",
- "image" => "",
- );
-}
-
-GLM_TOOLBOX::top2("Updatable Paragraphs (Add/Edit)", HELP_BASE."bus.phtml?key=edit","ToolboxUserGuide_2.0");
-
-$toolbox_nav["Add New Paragraph"] = "edit_bus.phtml?catid=$catid";
-unset($toolbox_nav["Add A New Page"]);
-GLM_TOOLBOX::html_nav_table($toolbox_nav, 6);
-
-$qs = "SELECT id,category
-FROM bus_category
-ORDER BY parent,pos";
-
-if(!$altcats = $DB->db_exec($qs))
-GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,0);
-
-?>
-
-
-';
-} else {
- echo '
-
- ';
-}
-echo '';
-
-echo "Pages: ";
-if(isset($id) && $id != "") {
- $qs = "SELECT bc.id as catid, bcb.id as id,bc.category,bcb.pos
- FROM bus_category bc,bus_category_bus bcb,bus b
- WHERE bcb.busid = $id
- AND bcb.catid = bc.id
- AND b.id = bcb.busid
- ORDER BY bc.category";
-
- if(!$altres = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,0);
- }
-
- for($rel=0;$rel<$DB->db_numrows($altres);$rel++) {
- $altrow = $DB->db_fetch_array($altres,$rel,PGSQL_ASSOC);
- if( is_array( $oldalt ) ){
- $oldalt[$rel] = array_merge_recursive($altrow,$oldalt);
- } else {
- $oldalt[$rel] = $altrow;
- }
- }
- }
- ?>
- Page:
-
-
- db_numrows($altcats);$i++) {
- $altrow = $DB->db_fetch_array($altcats,$i,PGSQL_ASSOC);
- for($a=0;$a
-
-
-
-
-
- ";
-
-foreach($fields as $key=>$value) {
- if($value['type'] == "text") {
- ?>
-
-
-
- ';
- echo ''.$value["name"].' ';
- } elseif($value['type'] == "img") {
- ?>
-
- ";
- if($row[$value['name']] != "") {
- echo "Current Image: ";
- echo "
-
-
-
- Delete this image:
-
- Yes
- No
-
- ";
- }
- echo "New $value[title]: ";
- echo " ";
- echo " ";
- } elseif ($value['type'] == "file") {
- ?>
-
-
- echo " ";
- if($row[$value['name']] != "") {
- echo "Current File: ";
- echo "".$row[$value['name']]."
-
-
-
- Delete this File:
-
- Yes
- No
-
- ";
- }
- echo "New $value[title]: ";
- echo " ";
- echo " ";
- }
- if($value['type'] == "desc") {
- echo "$value[title]: ";
- echo ''.$row[$value['name']].' ';
- echo " ";
- } elseif($value['type'] == "hide") {
- echo " ";
- } elseif($value['type'] == "bool") {
- echo "$value[title]: ";
- echo ' Yes ';
- echo " ";
- }
-}
-echo '
- File Uploads
-
- ';
-if( is_numeric( $id ) ) {
- echo '
-
- Current Files:
-
- To reposition the files use the drop down numbers to reposition them.
- this updates the position of the files but any changes in filenames or updated files are not saved.
- Make sure to reposition before making any other changes to files.
-
-
-
-
-
-
- ';
-echo '
-
-
-
- ';
-}
-echo '
-
-
- New File Upload:
-
-
-
- Name for link:
-
-
- ';
-echo ' ';
-if(isset($id)) {
- ?>
-
-
-
-
-
-
-
-
-
-';
-if( $id ) {
- echo '
-
- ';
-}
-
-GLM_TOOLBOX::footer();
-?>
-
diff --git a/admin/Toolbox/edit_bus_category.phtml b/admin/Toolbox/edit_bus_category.phtml
deleted file mode 100755
index e7908ea..0000000
--- a/admin/Toolbox/edit_bus_category.phtml
+++ /dev/null
@@ -1,377 +0,0 @@
-db_exec($sql)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG,1);
- }
- $row = $DB->db_fetch_array($res,0, PGSQL_ASSOC);
- if (!$row[id]){
- GLM_TOOLBOX::html_error(DB_ERROR_MSG,1);
- }
-} else {
- if (is_array($select_part)) {
- foreach ($select_part as $fieldrow) {
- $row[$fieldrow] = ($fieldrow == 'template') ? "1": "";
- }
- }
-}
-if (defined("MEMBERS_DB") && MEMBERS_DB == 1) {
- $memb_types_all = get_memb_all_types(&$DB);
- if ($memb_data = get_memb_types(&$DB)) {
- $member_sel = '';
- $member_sel .= ' ';
- foreach($memb_data as $memb_id => $memb_name) {
- $member_sel .= ''.$memb_name.' ';
- }
- $member_sel .= ' ';
- }
- if ($id) {
- $query = "select * from bus_cat_member where catid = $id;";
- if ($bcmData = $DB->db_auto_get_data($query)) {
- foreach($bcmData as $bcmRow) {
- $bus_cat_member_text .= '';
- $bus_cat_member_text .= '
Delete ';
- $bus_cat_member_text .= $memb_types_all[$bcmRow['memb_type']];
- $bus_cat_member_text .= '
';
- $bus_cat_member_text .= '
';
- }
- }
- }
-}
-echo '';
-echo '';
-echo '';
-echo '';
- echo ''.$output.' ';
- echo '';
- break;
- // }}}
- // {{{ case "feature_intro":
- case "feature_intro":
- break;
- // }}}
- // {{{ case "parent":
- case "parent":
- echo "
-
- Parent Page: ";
- $output = parent_select($value,$id);
- echo "".$output." ";
- echo " ";
- break;
- // }}}
- // {{{ case "category":
- case "category":
- echo "Navigation Name: ";
- GLM_TOOLBOX::text_box("category",$value);
- echo " ";
- break;
- // }}}
- // {{{ case "imagename":
- case "imagename":
- echo "Image Caption: ";
- GLM_TOOLBOX::text_box("imagename",$value);
- echo " ";
- break;
- // }}}
- // {{{ case "intro":
- case "intro":
- echo "Page Title: ";
- GLM_TOOLBOX::text_box("intro",$value);
- echo " ";
- break;
- // }}}
- // {{{ case "image":
- case "image":
- echo "Current Image: ";
- echo "
- ";
- if ($value != "") {
- echo "
-
-
- Delete this image:
-
- Yes
- No
-
- ";
- }
- echo "
- New Image: ";
- break;
- // }}}
- // {{{ case "description":
- case "description":
- echo "Description: ";
- echo ''.$value.' ';
- echo " ";
- break;
- // }}}
- // {{{ case "keyword":
- case "keyword":
- echo "Keyword: ";
- GLM_TOOLBOX::text_box("keyword",$value);
- echo " ";
- break;
- // }}}
- // {{{ case "short_url":
- case "short_url":
- echo '
- Short URL:
- '.BASE_URL.' /
- NOTE: Short URL\'s Must not contain any spaces or non alpha characters.
- Only a-z 0-9 _(underscore) -(dash) allowed.
-
- ';
- break;
- // }}}
- // {{{ case "template":
- case "template":
- echo "Templates: ";
- echo '
-
-
- ';
- break;
- // }}}
- // {{{ case "title":
- case "title":
- if ((GLM_HOST_ID == 'PRODUCTION' && $_SERVER['PHP_AUTH_USER'] == 'MediaAdmin')
- || GLM_HOST != 'PRODUCTION') {
- echo "Title Tag: ";
- GLM_TOOLBOX::text_box("title", $value);
- echo " ";
- } else {
- echo ' ';
- }
- break;
- // }}}
- // {{{ case "meta_descr":
- case "meta_descr":
- if ((GLM_HOST_ID == 'PRODUCTION' && $_SERVER['PHP_AUTH_USER'] == 'MediaAdmin')
- || GLM_HOST != 'PRODUCTION') {
- echo '
- Meta Description:
-
- '.htmlspecialchars($value).'
-
- ';
- } else {
- echo ' ';
- }
- break;
- // }}}
- // {{{ case "region":
- case "region":
- $regionsArray[''] = '-- Counties --';
- $sql = "
- SELECT *
- FROM region
- ORDER BY region_name";
- try {
- $stmt = $dbh->query($sql);
- while ($regionRow = $stmt->fetch(PDO::FETCH_ASSOC)) {
- if (!is_numeric($regionRow['region_name'])) {
- $regionsArray[$regionRow['region_id']] = $regionRow['region_name'];
- }
- }
- } catch(PDOException $e) {
- Toolkit_Common::handleError($e);
- }
- echo "Counties: ";
- echo ''.GLM_TOOLBOX::build_picklist('region', $regionsArray, $value).' ';
- echo " ";
- break;
- // }}}
- // {{{ default:
- default:
- GLM_TOOLBOX::html_error("Incorrect Value -> ".$key,1);
- break;
- // }}}
- }
-}
-echo '';
-if (defined("MEMBERS_DB") && MEMBERS_DB == 1) {
- echo '';
-}
-if (isset($id)) {
- $qs = "SELECT count(*) as count
- FROM bus_category_bus
- WHERE catid = $id";
-
- if (!$res = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,0);
- }
-
- $row = $DB->db_fetch_array($res,0,PGSQL_ASSOC);
- echo '
-
-
- ';
- if (defined("CAT_LOCK") && !CAT_LOCK && !check_lock($id)) {
- echo '
-
- ';
- }
- echo ' ';
-} else {
- GLM_TOOLBOX::form_footer("Insert", "", 2);
-}
-echo "
";
-GLM_TOOLBOX::footer();
-?>
diff --git a/admin/Toolbox/expand.png b/admin/Toolbox/expand.png
deleted file mode 100755
index 38dcfc0..0000000
Binary files a/admin/Toolbox/expand.png and /dev/null differ
diff --git a/admin/Toolbox/export-images-is0.php b/admin/Toolbox/export-images-is0.php
deleted file mode 100755
index 8cce484..0000000
--- a/admin/Toolbox/export-images-is0.php
+++ /dev/null
@@ -1,92 +0,0 @@
-setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
-$sql = "
-SELECT id,image
-FROM bus_category
-WHERE image != ''
-ORDER BY id";
-//$sql .= " LIMIT 1 OFFSET 0";
-$pre1 = "
-SELECT id,image
-FROM bus
-WHERE image != ''";
-//$pre1 .= " LIMIT 1 OFFSET 0";
-try {
- $stmt = $db->query($sql);
- $data = $stmt->fetchAll(PDO::FETCH_ASSOC);
- $stmt2 = $db->query($pre1);
- $data2 = $stmt2->fetchAll(PDO::FETCH_ASSOC);
- echo '';
- print_r($data);
- print_r($data2);
- echo ' ';
-} catch(PDOException $e) {
- die($e->getMessage());
-}
-$db->beginTransaction();
-$IServer = new Toolkit_Image_Server();
-if (is_array($data)) {
- $prep2 = "
- UPDATE bus_category
- SET image = :image
- WHERE id = :id";
- $stmt3 = $db->prepare($prep2);
-
- foreach ($data as &$row) {
- try {
- $image_URL = OLDORG.$row['image'];
- $image = $IServer->imageUpload($image_URL);
- } catch(Exception $e) {
- die($e->getMessage());
- }
- if ($image) {
- try {
- $stmt3->bindParam(":image", $image, PDO::PARAM_STR);
- $stmt3->bindParam(":id", $row['id'], PDO::PARAM_INT);
- $stmt3->execute();
- } catch(PDOException $e) {
- die($e->getMessage());
- }
- }
- echo ' Image Name Returned: ';
- var_dump($image);
- }
-}
-if (is_array($data2)) {
- $prep3 = "
- UPDATE bus
- SET image = :image
- WHERE id = :id";
- $stmt4 = $db->prepare($prep3);
- foreach ($data2 as &$row2) {
- echo ''.print_r($row2, true).' ';
- if (preg_match("/^is/",$row2['image'])) {
- continue;
- }
- try {
- $image_URL = OLDORG.$row2['image'];
- echo ''.print_r($image_URL, true).' ';
- $image = $IServer->imageUpload($image_URL);
- } catch(Exception $e) {
- die($e->getMessage());
- }
- if ($image) {
- try {
- $stmt4->bindParam(":image", $image, PDO::PARAM_STR);
- $stmt4->bindParam(":id", $row2['id'], PDO::PARAM_INT);
- $stmt4->execute();
- } catch(PDOException $e) {
- die($e->getMessage());
- }
- }
- echo ' Image Name Returned: ';
- var_dump($image);
- }
-}
-$db->commit();
-//$db->rollBack();
-?>
diff --git a/admin/Toolbox/file-repos-xml.php b/admin/Toolbox/file-repos-xml.php
deleted file mode 100644
index 1d947bf..0000000
--- a/admin/Toolbox/file-repos-xml.php
+++ /dev/null
@@ -1,29 +0,0 @@
-db_exec( "BEGIN WORK;" );
-if( $_GET['oldpos'] < $_GET['newpos'] )
-{
- $query = "update files
- set pos = pos - 1
- where bus_id = ".$_GET['busid']."
- and pos > ".$_GET['oldpos']."
- and pos <= ".$_GET['newpos']." ";
- $DB->db_exec( $query );
- $DB->db_exec( "update files set pos = ".$_GET['newpos']." where id = ".$_GET['id'] );
-}
-else
-{
- $query = "update files
- set pos = pos + 1
- where bus_id = ".$_GET['busid']."
- and pos >= ".$_GET['newpos']."
- and pos < ".$_GET['oldpos']." ";
- $DB->db_exec( $query );
- $DB->db_exec( "update files set pos = ".$_GET['newpos']." where id = ".$_GET['id'] );
-}
-$DB->db_exec( "COMMIT WORK;" );
-?>
diff --git a/admin/Toolbox/file-xml.php b/admin/Toolbox/file-xml.php
deleted file mode 100644
index f54c5f8..0000000
--- a/admin/Toolbox/file-xml.php
+++ /dev/null
@@ -1,60 +0,0 @@
-db_auto_get_data( $query ) )
-{
- $total = count( $file_data );
- for( $i = 1; $i <= $total; $i++ )
- {
- $poses[$i] = $i;
- }
- foreach( $file_data as $file_row )
- {
- $filename = ($file_row['urltext']) ? $file_row['urltext']: $file_row['filename'];
- $out .= '
- ';
- }
-}
-echo $out;
-?>
diff --git a/admin/Toolbox/file_load.js b/admin/Toolbox/file_load.js
deleted file mode 100644
index 6192717..0000000
--- a/admin/Toolbox/file_load.js
+++ /dev/null
@@ -1,5 +0,0 @@
-function add_file()
-{
- var myForm = document.getElementById('myForm');
- var newFile = document.createElement('fileUpload');
-}
diff --git a/admin/Toolbox/files.sql b/admin/Toolbox/files.sql
deleted file mode 100644
index fd1df25..0000000
--- a/admin/Toolbox/files.sql
+++ /dev/null
@@ -1,63 +0,0 @@
---
--- PostgreSQL database dump
---
-
-SET client_encoding = 'SQL_ASCII';
-SET check_function_bodies = false;
-
-SET SESSION AUTHORIZATION 'postgres';
-
-SET search_path = public, pg_catalog;
-
---
--- TOC entry 3 (OID 15572607)
--- Name: files; Type: TABLE; Schema: public; Owner: postgres
---
-
-CREATE TABLE files (
- id serial NOT NULL,
- filename text,
- bytes integer,
- "type" text,
- urltext text,
- bus_id integer,
- pos integer DEFAULT 1
-);
-
-
---
--- TOC entry 4 (OID 15572607)
--- Name: files; Type: ACL; Schema: public; Owner: postgres
---
-
-REVOKE ALL ON TABLE files FROM PUBLIC;
-GRANT ALL ON TABLE files TO nobody;
-
-
---
--- TOC entry 5 (OID 15572607)
--- Name: files_id_seq; Type: ACL; Schema: public; Owner: postgres
---
-
-REVOKE ALL ON TABLE files_id_seq FROM PUBLIC;
-GRANT ALL ON TABLE files_id_seq TO nobody;
-
-
---
--- TOC entry 6 (OID 15572613)
--- Name: files_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
---
-
-ALTER TABLE ONLY files
- ADD CONSTRAINT files_pkey PRIMARY KEY (id);
-
-
---
--- TOC entry 7 (OID 15572619)
--- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
---
-
-ALTER TABLE ONLY files
- ADD CONSTRAINT "$1" FOREIGN KEY (bus_id) REFERENCES bus(id) ON DELETE CASCADE;
-
-
diff --git a/admin/Toolbox/htmlarea.css b/admin/Toolbox/htmlarea.css
deleted file mode 100644
index 23bdf7d..0000000
--- a/admin/Toolbox/htmlarea.css
+++ /dev/null
@@ -1,180 +0,0 @@
-.htmlarea { background: #fff; }
-
-.htmlarea .toolbar {
- cursor: default;
- background: ButtonFace;
- padding: 1px 1px 2px 1px;
- border: 1px solid;
- border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
-}
-.htmlarea .toolbar table { font-family: tahoma,verdana,sans-serif; font-size: 11px; }
-.htmlarea .toolbar img { border: none; }
-.htmlarea .toolbar .label { padding: 0px 3px; }
-
-.htmlarea .toolbar .button {
- background: ButtonFace;
- color: ButtonText;
- border: 1px solid ButtonFace;
- padding: 1px;
- margin: 0px;
-}
-.htmlarea .toolbar .buttonHover {
- border: 1px solid;
- border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
-}
-.htmlarea .toolbar .buttonActive, .htmlarea .toolbar .buttonPressed {
- padding: 2px 0px 0px 2px;
- border: 1px solid;
- border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
-}
-.htmlarea .toolbar .buttonPressed {
- background: ButtonHighlight;
-}
-.htmlarea .toolbar .indicator {
- padding: 0px 3px;
- overflow: hidden;
- width: 20px;
- text-align: center;
- cursor: default;
- border: 1px solid ButtonShadow;
-}
-
-.htmlarea .toolbar .buttonDisabled { background-color: #aaa; }
-
-.htmlarea .toolbar .buttonDisabled img {
- filter: alpha(opacity = 25);
- -moz-opacity: 25%;
-}
-
-.htmlarea .toolbar .separator {
- position: relative;
- margin: 3px;
- border-left: 1px solid ButtonShadow;
- border-right: 1px solid ButtonHighlight;
- width: 0px;
- height: 16px;
- padding: 0px;
-}
-
-.htmlarea .toolbar .space { width: 5px; }
-
-.htmlarea .toolbar select { font: 11px Tahoma,Verdana,sans-serif; }
-
-.htmlarea .toolbar select,
-.htmlarea .toolbar select:hover,
-.htmlarea .toolbar select:active { background: FieldFace; color: ButtonText; }
-
-.htmlarea .statusBar {
- border: 1px solid;
- border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
- padding: 2px 4px;
- background-color: ButtonFace;
- color: ButtonText;
- font: 11px Tahoma,Verdana,sans-serif;
-}
-
-.htmlarea .statusBar .statusBarTree a {
- padding: 2px 5px;
- color: #00f;
-}
-
-.htmlarea .statusBar .statusBarTree a:visited { color: #00f; }
-.htmlarea .statusBar .statusBarTree a:hover {
- background-color: Highlight;
- color: HighlightText;
- padding: 1px 4px;
- border: 1px solid HighlightText;
-}
-
-
-/* Hidden DIV popup dialogs (PopupDiv) */
-
-.dialog {
- color: ButtonText;
- background: ButtonFace;
-}
-
-.dialog .content { padding: 2px; }
-
-.dialog, .dialog button, .dialog input, .dialog select, .dialog textarea, .dialog table {
- font: 11px Tahoma,Verdana,sans-serif;
-}
-
-.dialog table { border-collapse: collapse; }
-
-.dialog .title {
- background: #008;
- color: #ff8;
- border-bottom: 1px solid #000;
- padding: 1px 0px 2px 5px;
- font-size: 12px;
- font-weight: bold;
- cursor: default;
-}
-
-.dialog .title .button {
- float: right;
- border: 1px solid #66a;
- padding: 0px 1px 0px 2px;
- margin-right: 1px;
- color: #fff;
- text-align: center;
-}
-
-.dialog .title .button-hilite { border-color: #88f; background: #44c; }
-
-.dialog button {
- width: 5em;
- padding: 0px;
-}
-
-.dialog .buttonColor {
- padding: 1px;
- cursor: default;
- border: 1px solid;
- border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
-}
-
-.dialog .buttonColor-hilite {
- border-color: #000;
-}
-
-.dialog .buttonColor .chooser, .dialog .buttonColor .nocolor {
- height: 0.6em;
- border: 1px solid;
- padding: 0px 1em;
- border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
-}
-
-.dialog .buttonColor .nocolor { padding: 0px; }
-.dialog .buttonColor .nocolor-hilite { background-color: #fff; color: #f00; }
-
-.dialog .label { text-align: right; width: 6em; }
-.dialog .value input { width: 100%; }
-.dialog .buttons { text-align: right; padding: 2px 4px 0px 4px; }
-
-.dialog legend { font-weight: bold; }
-.dialog fieldset table { margin: 2px 0px; }
-
-.popupdiv {
- border: 2px solid;
- border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
-}
-
-.popupwin {
- padding: 0px;
- margin: 0px;
-}
-
-.popupwin .title {
- background: #fff;
- color: #000;
- font-weight: bold;
- font-size: 120%;
- padding: 3px 10px;
- margin-bottom: 10px;
- border-bottom: 1px solid black;
- letter-spacing: 2px;
-}
-
-form { margin: 0px; border: none; }
diff --git a/admin/Toolbox/images/collapse.png b/admin/Toolbox/images/collapse.png
deleted file mode 100755
index d10e051..0000000
Binary files a/admin/Toolbox/images/collapse.png and /dev/null differ
diff --git a/admin/Toolbox/images/expand.png b/admin/Toolbox/images/expand.png
deleted file mode 100755
index 38dcfc0..0000000
Binary files a/admin/Toolbox/images/expand.png and /dev/null differ
diff --git a/admin/Toolbox/index.phtml b/admin/Toolbox/index.phtml
deleted file mode 100755
index 550afb8..0000000
--- a/admin/Toolbox/index.phtml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-header("Location: list_bus_category.phtml");
-?>
diff --git a/admin/Toolbox/jake-handler.js b/admin/Toolbox/jake-handler.js
deleted file mode 100644
index efd60c1..0000000
--- a/admin/Toolbox/jake-handler.js
+++ /dev/null
@@ -1,49 +0,0 @@
-function getHTTPObject()
-{
- var http = false;
-
- if (window.XMLHttpRequest) { // Mozilla, Safari,...
- http = new XMLHttpRequest();
- if (http.overrideMimeType) {
- http.overrideMimeType('text/html');
- }
- } else if (window.ActiveXObject) { // IE
- try {
- http = new ActiveXObject("Msxml2.XMLHTTP");
- } catch (e) {
- try {
- http = new ActiveXObject("Microsoft.XMLHTTP");
- } catch (e) {}
- }
- }
- return http;
-}
-function get_files( id )
-{
- var http = getHTTPObject(); // We create the HTTP Object
- var url = "file-xml.php?id=" + id + "&ms=";
- http.open("GET", url + "&ms=" + new Date().getTime(),true);
- http.onreadystatechange = function()
- {
- if(http.readyState == 4)
- {
- document.getElementById('file-uploads').innerHTML = http.responseText;
- }
- }
- http.send(null);
-}
-function update_file_pos( busid, id, oldpos, newpos )
-{
- var http = getHTTPObject(); // We create the HTTP Object
- var url = "file-repos-xml.php?busid=" + busid + "&id=" + id + "&oldpos=" + oldpos + "&newpos=" + newpos;
- http.open("GET", url + "&ms=" + new Date().getTime(),true);
- http.onreadystatechange = function()
- {
- if(http.readyState == 4)
- {
- document.getElementById('file-uploads-data').innerHTML = http.responseText;
- get_files( busid );
- }
- }
- http.send(null);
-}
diff --git a/admin/Toolbox/list_bus.phtml b/admin/Toolbox/list_bus.phtml
deleted file mode 100755
index d3f3974..0000000
--- a/admin/Toolbox/list_bus.phtml
+++ /dev/null
@@ -1,80 +0,0 @@
-db_exec($qs))
-{
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,1);
-}
-$catrow = $DB->db_fetch_array($catres,0,PGSQL_ASSOC);
-$qs = "SELECT b.id,b.name,bcb.pos
- FROM bus b,bus_category_bus bcb
- WHERE bcb.catid = $catid
- AND b.id = bcb.busid
- AND bcb.catid = $catid
- ORDER BY bcb.pos";
-if(!$res = $DB->db_exec($qs))
-{
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,1);
-}
-GLM_TOOLBOX::top("$catrow[category] Paragraphs", HELP_BASE."bus.phtml?key=list","ToolboxUserGuide_2.0");
-$toolbox_nav["Add New Paragraph"] = "edit_bus.phtml?catid=$catid";
-unset($toolbox_nav["Add A New Page"]);
-GLM_TOOLBOX::html_nav_table($toolbox_nav, 6);
-echo '
-
-
- Function
- Records
- ';
-for($i = 0; $i < $DB->db_numrows($res); $i++)
-{
- $row = $DB->db_fetch_array($res,$i, PGSQL_ASSOC);
- echo '
-
- [Edit] ';
- $qs = "SELECT MAX(bus_category_bus.pos) as maxpos
- FROM bus LEFT OUTER JOIN bus_category_bus ON (bus.id = bus_category_bus.busid)
- WHERE bus_category_bus.catid = $catid;";
- if(!$maxresult = $DB->db_exec($qs))
- {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,0);
- }
- $max_data = $DB->db_fetch_array($maxresult,0,PGSQL_ASSOC);
- $maxpos = $max_data[maxpos];
- $qs = "SELECT bcb.id
- FROM bus_category_bus bcb,bus b
- WHERE bcb.catid = $catid
- AND b.id = bcb.busid
- AND b.id = $row[id]
- AND bcb.busid = b.id
- ";
-
- if(!$idres = $DB->db_exec($qs))
- {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,0);
- }
- $idrow = $DB->db_fetch_array($idres,0,PGSQL_ASSOC);
- $pos = '';
- for($newpos=1;$newpos<=$maxpos;$newpos++)
- {
- $string = "Command=Move&id=$idrow[id]&newpos=$newpos&catid=$catid";
- $pos .= "
- '.$row["name"].'
- ';
-}
-echo '
- ';
-GLM_TOOLBOX::footer();
-?>
diff --git a/admin/Toolbox/list_bus_category.phtml b/admin/Toolbox/list_bus_category.phtml
deleted file mode 100755
index 49a8e18..0000000
--- a/admin/Toolbox/list_bus_category.phtml
+++ /dev/null
@@ -1,178 +0,0 @@
-';
-if(isset($active)) {
- if($active=="t") {
- $nd = "f";
- } else {
- $nd = "y";
- }
- $query = "UPDATE bus_category SET active = '$nd' WHERE id = $id";
- $DB->db_exec($query);
- GLM_TOOLBOX::create_sitemap();
- $toolbox->cache->clean('Nav');
- $toolbox->cache->clean('MainNav');
-}
-$toolbox_nav["Edit Positions"] = "list_bus_category.phtml?show_pos=1";
-$toolbox_nav["Expand All"] = "list_bus_category.phtml?expand_all=1";
-$toolbox_nav["Collapse All"] = "list_bus_category.phtml?collaspe_all=1";
-GLM_TOOLBOX::html_nav_table($toolbox_nav, 6);
-echo '
-
-
-
-
-
-
-
-
-
-
-';
-include_once("threads.phtml");
-if( !isset( $cat_search ) || $cat_search == '' ) {
- $qs = "SELECT id,parent,pos,category,active,keyword
- FROM bus_category
- WHERE parent is not null
- ORDER BY pos;";
-
- if(!$res = $DB->db_exec($qs)) {
- echo "Failure".$qs;
- }
- for($i=0;$i';
- if($data['active'] == "t") {
- $active .= " ";
- } else {
- $active .= " ";
- }
- } elseif($data['id']==HOME_ID) {
- $active = " ";
- }
- if($show_pos && !in_array($id,$category_locks)) {
- $qs = "SELECT MAX(pos) as maxpos
- FROM bus_category
- WHERE parent = $parent";
-
- if(!$maxresult = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,0);
- }
- $max_data = $DB->db_fetch_array($maxresult,0,PGSQL_ASSOC);
- $maxpos = $max_data['maxpos'];
- $pos = '';
- $starting = 1;//( $parent == 0 ) ? 14: 1;
- for($newpos=$starting;$newpos<=$maxpos;$newpos++) {
- $string = "Command=Move&id=$id&parent=$parent&newpos=$newpos";
- $pos .= "get_seo_url( $id );
- $threads[] = array("ID" => $id,"content" => $category,"pos" => $pos,"parent" =>
- $parent,"active" => $active,"closed" => $close,'seo_url'=>$url);
-}
-//$links = array( "beginLevel" => "", "beginLevel2" => "", "beginItem" => "", "beginItem2" => " ", "endItem" => " ");
- if($DB->db_numrows($res) != 0) {
- $myThread = new toolbox_thread();
- $converted = $myThread->sortChilds($threads); //sort threads by parent
- print $myThread->convertToThread($converted, $converted[0]); //print the threads
- }
- } else {
- $toolbox =& new GLM_TEMPLATE( NULL );
- $query = "select * from bus_category where category ilike '%$cat_search%';";
- //echo $query;
- $res = $DB->db_exec( $query );
- if( pg_numrows( $res ) > 0 ) {
- echo '';
- } else {
- echo 'Nothing found!';
- }
-}
-echo '
-
-
-
-';
-GLM_TOOLBOX::footer();
-?>
diff --git a/admin/Toolbox/member-code-line.php b/admin/Toolbox/member-code-line.php
deleted file mode 100644
index 6d4a5f2..0000000
--- a/admin/Toolbox/member-code-line.php
+++ /dev/null
@@ -1,16 +0,0 @@
-pgsql_select( $query ) ){
- $out = '';
- $out .= '
Delete ';
- $out .= $data[0]['class_code'].' '.$data[0]['name'];
- $out .= '
';
- $out .= '
';
- }
-}
-echo $out;
-?>
diff --git a/admin/Toolbox/member-code-query.php b/admin/Toolbox/member-code-query.php
deleted file mode 100644
index 744b82a..0000000
--- a/admin/Toolbox/member-code-query.php
+++ /dev/null
@@ -1,36 +0,0 @@
-pgsql_select( $query ) ){
- $out = '';
- $out .= '';
- foreach( $data as $row ){
- $out .= ''.$row['name'].' ';
- $query = "select *
- from category
- where parent_id = ".$row['category_id']."
- order by name";
- if( $data2 = $DB->pgsql_select( $query ) ){
- foreach( $data2 as $row2 ){
- $out .= ''.$row2['name'].' ';
- $query = "select *
- from category
- where parent_id = ".$row2['category_id']."
- order by name";
- if( $data3 = $DB->pgsql_select( $query ) ){
- foreach( $data3 as $row3 ){
- $out .= ''.$row3['name'].' ';
- }
- }
- }
- }
- }
- $out .= ' Add
';
-}
-echo $out;
-?>
diff --git a/admin/Toolbox/member-toolbox.js b/admin/Toolbox/member-toolbox.js
deleted file mode 100644
index e090c19..0000000
--- a/admin/Toolbox/member-toolbox.js
+++ /dev/null
@@ -1,37 +0,0 @@
-var MemberToolbox =
-{
- init: function()
- {
- if ($("#add-member-area")) {
- $.ajax({
- url: "member-code-query.php",
- data: "Option=category",
- cache: false,
- success: function(html, textStatus) {
- $("#add-member-area").html(html);
- $("#add-code").click(function() {
- MemberToolbox.addCodes();
- return false;
- });
- }
- });
- }
- },
-
- addCodes: function()
- {
- var category_id = $("#newCategory").val();
- $.ajax({
- url: "member-code-line.php",
- cache: false,
- data: "category_id=" + category_id,
- success: function(html, textStatus) {
- $("#list-members-info").append(html);
- }
- });
-
- return false;
- }
-};
-
-$(document).ready(MemberToolbox.init);
diff --git a/admin/Toolbox/member-toolbox.php b/admin/Toolbox/member-toolbox.php
deleted file mode 100644
index 6ef4db9..0000000
--- a/admin/Toolbox/member-toolbox.php
+++ /dev/null
@@ -1,173 +0,0 @@
-';
- $member_sel .= ' ';
- foreach( $memb_data as $memb_id => $memb_name )
- {
- $member_sel .= ''.$memb_name.' ';
- }
- $member_sel .= ' ';
- }
- if( $memb_sub_types = get_memb_sub_types( &$DB ) )
- {
- foreach( $memb_sub_types as $parent => $memb_sub_value )
- {
- $member_sub_sel[$parent] = '';
- $member_sub_sel[$parent] .= ' ';
- foreach( $memb_sub_value as $id => $name )
- {
- $member_sub_sel[$parent] .= ''.$name.' ';
- }
- $member_sub_sel[$parent] .= ' ';
- }
- }
-}
-?>
-var addMemberLink = document.getElementById('add-member');
-var addMemberDiv = document.getElementById('add-member-area');
-var addMemberList = document.getElementById('list-members-info');
-function removeElement( elem )
-{
- var rem = document.getElementById( elem );
- rem.innerHTML = '';
-}
-function attachEventListener(target, eventType, functionRef, capture)
-{
- if (typeof target.addEventListener != "undefined")
- {
- target.addEventListener(eventType, functionRef, capture);
- }
- else if (typeof target.attachEvent != "undefined")
- {
- target.attachEvent("on" + eventType, functionRef);
- }
- else
- {
- eventType = "on" + eventType;
-
- if (typeof target[eventType] == "function")
- {
- var oldListener = target[eventType];
-
- target[eventType] = function()
- {
- oldListener();
-
- return functionRef();
- }
- }
- else
- {
- target[eventType] = functionRef;
- }
- }
-
- return true;
-}
-function addLoadListener(fn)
-{
- if (typeof window.addEventListener != 'undefined')
- {
- window.addEventListener('load', fn, false);
- }
- else if (typeof document.addEventListener != 'undefined')
- {
- document.addEventListener('load', fn, false);
- }
- else if (typeof window.attachEvent != 'undefined')
- {
- window.attachEvent('onload', fn);
- }
- else
- {
- var oldfn = window.onload;
- if (typeof window.onload != 'function')
- {
- window.onload = fn;
- }
- else
- {
- window.onload = function()
- {
- oldfn();
- fn();
- };
- }
- }
-}
-function myLink()
-{
- attachEventListener(addMemberLink,"click",addMyMember,false);
-}
-function addMyMember()
-{
- addMemberDiv.innerHTML = '';
- addMemberDiv.innerHTML += 'Add ';
- var addType = document.getElementById('add-member-type');
- attachEventListener(addType,"click",myAddType,false);
- var addMemberType = document.getElementById('memb_type');
- attachEventListener(addMemberType,"change",myAddSubType,false);
-}
-function myAddSubType(){
- var sub_sel_hmtl = new Array();
- $html )
- {
- ?>
- sub_sel_hmtl[] = '';
-
- var memb_type = document.getElementById('memb_type');
- var memType = memb_type.options[memb_type.selectedIndex].value
- if( !isNaN( memType ) )
- {
- var subPart = document.getElementById('sub-part');
- subPart.innerHTML = sub_sel_hmtl[memType];
- }
-}
-function myAddType()
-{
- try{
- var membTypes = document.getElementById('memb_sub');
- if( membTypes.value ){
- var hideMemIdName = 'hideMember_' + membTypes.value;
- var hideMemName = 'hideMember_' + membTypes.value;
- addMemberList.innerHTML += ''
- + membTypes.options[membTypes.selectedIndex].text
- + '
'
- + '
Delete ';
- }
- else{
- var membTypes = document.getElementById('memb_type');
- if( membTypes.value ){
- var hideMemIdName = 'hideMember_' + membTypes.value;
- var hideMemName = 'hideMember_' + membTypes.value;
- addMemberList.innerHTML += ''
- + membTypes.options[membTypes.selectedIndex].text
- + '
'
- + '
Delete ';
- }
- }
- }
- catch(err){
- var membTypes = document.getElementById('memb_type');
- if( membTypes.value ){
- var hideMemIdName = 'hideMember_' + membTypes.value;
- var hideMemName = 'hideMember_' + membTypes.value;
- addMemberList.innerHTML += ''
- + membTypes.options[membTypes.selectedIndex].text
- + '
'
- + '
Delete ';
- }
- }
- addMemberDiv.innerHTML = 'Add Member Link ';
- var addMemberLink = document.getElementById('add-member');
- attachEventListener(addMemberLink,"click",addMyMember,false);
-}
-addLoadListener(myLink);
diff --git a/admin/Toolbox/threads.phtml b/admin/Toolbox/threads.phtml
deleted file mode 100755
index 762cce9..0000000
--- a/admin/Toolbox/threads.phtml
+++ /dev/null
@@ -1,62 +0,0 @@
-';
- var $beginLevel2 = '';
- var $beginItem = '';
- var $beginItem2 = ' ';
- var $endItem = ' ';
- var $wholeThread;
-
- function __construct($code="") {
- if(!empty($code)) {
- $this->beginLevel = $code['beginLevel'];
- $this->beginLevel2 = $code['beginLevel2'];
- $this->endLevel = $code['endLevel'];
- $this->beginItem = $code['beginItem'];
- $this->beginItem2 = $code['beginItem2'];
- $this->endItem = $code['endItem'];
- }
- }
-
- function sortChilds($threads) {
- while(list($var, $value) = each($threads))
- $childs[$value[parent]][$value[ID]] = $value;
- return $childs;
- }
-
- function convertToThread($threads, $thread) {
- static $count;
- if( !$count ) {
- $this->wholeThread .= $this->beginLevel2;
- } else {
- $this->wholeThread .= $this->beginLevel;
- }
- while(list($parent, $value) = each($thread)) {
- if( $threads[$parent] && $value['closed'] ) {
- $this->wholeThread .= $this->beginItem2;
- $this->wholeThread .= ' ';
- } elseif( $threads[$parent] && !$value['closed'] ) {
- $this->wholeThread .= $this->beginItem2;
- $this->wholeThread .= ' ';
- } else {
- $this->wholeThread .= $this->beginItem;
- }
- $count++;
- $this->wholeThread .= " [Edit] "
- ."[Paragraphs] "
- ."[Preview] "
- .$value[pos]
- ."".$value[active];
- $this->wholeThread .= $value['content'] . " " . $this->endItem ."\n";
- if( $threads[$parent] && !$value['closed'] ) {
- $this->convertToThread($threads, $threads[$parent]);
- }
- }
- $this->wholeThread .= $this->endLevel;
- return $this->wholeThread;
- }
-}
-?>
diff --git a/admin/Toolbox/toolbox_setup.inc b/admin/Toolbox/toolbox_setup.inc
deleted file mode 100755
index 3d019a4..0000000
--- a/admin/Toolbox/toolbox_setup.inc
+++ /dev/null
@@ -1,435 +0,0 @@
-
- * @copyright 2009 Gaslight Media
- * @license Gaslight Media
- * @version CVS: $Id: toolbox_setup.inc,v 1.5 2009/09/09 13:44:33 matrix Exp $
- * @link <>
- */
-// {{{ INCLUDES
-/**
- * Main site config file
- */
-include_once '../../setup.phtml';
-
-/**
- * GLM_DB class
- */
-include_once BASE.'classes/class_db.inc';
-
-/**
- * GLM_TOOLBOX class
- */
-include_once BASE.'classes/class_toolbox.inc';
-
-/**
- * GLM_TEMPLATE class
- */
-include_once BASE.'classes/class_template.inc';
-// }}}
-$DB =& new GLM_DB();
-$toolbox =& new GLM_TEMPLATE(1);
-// {{{ DEFINES
-if (!defined("DELUXE_TOOLBOX")) {
-
- /**
- * Description for define
- */
- define("DELUXE_TOOLBOX",0);
-}
-if (!defined("TOOLBOX_FLAGS")) {
-
- /**
- * Description for define
- */
- define("TOOLBOX_FLAGS",1);
-}
-if (!defined("LEVELS_DEEP"))
-{
-
- /**
- * Description for define
- */
- define("LEVELS_DEEP",5);
-}
-if (!defined("MEMBERS_DB")) {
-
- /**
- * Description for define
- */
- define("MEMBERS_DB",false);
-}
-if (!defined("HOME_ID")) {
-
- /**
- * Description for define
- */
- define("HOME_ID",1);
-}
-if (!defined("CAT_LOCK")) {
-
- /**
- * Description for define
- */
- define("CAT_LOCK",0);
-}
-if (!defined("MULTIPLE_CAT")) {
-
- /**
- * Description for define
- */
- define("MULTIPLE_CAT",0);
-}
-// }}}
-$category_locks = array();//range(1,13);
-// {{{ $fields = array();
-// $fields array used for the bus table edit page
-$fields[] = array(
- "name" => "id",
- "title" => "id",
- "type" => "hide"
-);
-$fields[] = array(
- "name" => "name",
- "title" => "Paragraph Title",
- "type" => "text"
-);
-$fields[] = array(
- "name" => "description",
- "title" => "Description",
- "type" => "desc"
-);
-$fields[] = array(
- "name" => "imagename",
- "title"=> "Image Caption",
- "type" => "text"
-);
-$fields[] = array(
- "name" => "image",
- "title" => "Image",
- "type" => "img"
-);
-$fields[] = array(
- "name" => "back_to_top",
- "title" => "Insert 'Back to Top' link",
- "type" => "bool"
-);
-// }}}
-// {{{ update_member_bus_cat()
-/**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param object &$DB Parameter description (if any) ...
- * @return boolean Return description (if any) ...
- */
-function update_member_bus_cat(&$DB)
-{
- if (!is_numeric($_REQUEST['id'])) {
- return false;
- }
- $query = "select * from bus_cat_member where catid = ".$_REQUEST['id'];
- if ($bcm_data = $DB->pgsql_select($query)) {
- foreach ($bcm_data as $bcm_row) {
- if (is_array($_REQUEST['member_cats']) && !in_array($bcm_row['memb_type'], $_REQUEST['member_cats'])) {
- // delete this one by the bus_cat_member id
- $DB->pgsql_delete('bus_cat_member', array('id'=>$bcm_row['id']));
- } elseif (is_array($_REQUEST['member_cats'])) {
- $key = array_search($bcm_row['memb_type'], $_REQUEST['member_cats']);
- unset($_REQUEST['member_cats'][$key]);
- }
- }
- }
- if (is_array($_REQUEST['member_cats'])) {
- foreach ($_REQUEST['member_cats'] as $row) {
- $data = array('catid'=>$_REQUEST['id'],'memb_type'=>$row);
- $DB->pgsql_insert('bus_cat_member', $data, 'id', 'bus_cat_member_id_seq') ;
- }
- }else{
- // if there's no member_cats array then delete any that are in bus_cat_member table
- $DB->pgsql_delete('bus_cat_member', array('catid'=>$_REQUEST['id'])) ;
- }
-}
-// }}}
-// {{{ get_sub()
-/**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param unknown $catid Parameter description (if any) ...
- * @param object $DB Parameter description (if any) ...
- * @return array Return description (if any) ...
- */
-function get_sub($catid, $DB) {
- static $string,$count;
- if (!isset($count)) {
- $count = 0;
- }
- $string[$count] = $catid;
- $count++;
- $query = "SELECT id
- FROM bus_category
- WHERE parent = $catid
- ORDER BY pos";
- if ($data = $DB->db_auto_get_data($query)){
- foreach($data as $key=>$value){
- $id = $value['id'];
- $string = get_sub($id, $DB) ;
- }
- return $string;
- }else{
- return $string;
- }
-}
-// }}}
-// {{{ get_prop_types()
-/**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param object &$DB Parameter description (if any) ...
- * @return array Return description (if any) ...
- */
-function get_prop_types(&$DB) {
- static $prop_types;
- if (!is_array($prop_types)) {
- $query = "select * from prop_type order by name;";
- if ($data = $DB->db_auto_get_data($query)) {
- foreach ($data as $row) {
- $prop_types[$row['id']] = $row['name'];
- }
- }
- }
- return $prop_types;
-}
-// }}}
-// {{{ get_memb_sub_types()
-/**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param object &$DB Parameter description (if any) ...
- * @return array Return description (if any) ...
- */
-function get_memb_sub_types(&$DB) {
- static $memb_sub_types;
- if (!is_array($memb_sub_types)) {
- $query = "select category_id,name,parent_id from category where parent_id != 0 order by parent_id,pos";
- if ($data = $DB->pgsql_select($query)) {
- foreach ($data as $row) {
- $memb_sub_types[$row['parent_id']][$row['category_id']] = $row['name'];
- }
- }
- }
- return $memb_sub_types;
-}
-// }}}
-// {{{ get_memb_types()
-/**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param object &$DB Parameter description (if any) ...
- * @return array Return description (if any) ...
- */
-function get_memb_types(&$DB) {
- static $memb_types;
- if (!is_array($memb_types)) {
- $query = "select * from category where parent_id = 0 order by pos;";
- if ($data = $DB->db_auto_get_data($query)) {
- foreach ($data as $row) {
- $memb_types[$row['category_id']] = $row['name'];
- }
- }
- }
- return $memb_types;
-}
-// }}}
-// {{{ get_memb_all_types()
-/**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param object &$DB Parameter description (if any) ...
- * @return array Return description (if any) ...
- */
-function get_memb_all_types(&$DB) {
- static $memb_types;
- if (!is_array($memb_types)) {
- $query = "select * from category order by parent_id,pos;";
- if ($data = $DB->db_auto_get_data($query)) {
- foreach ($data as $row) {
- $memb_types[$row['category_id']] = $row['class_code'].' '.$row['name'];
- }
- }
- }
- return $memb_types;
-}
-// }}}
-// {{{ check_lock()
-/**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param mixed $id Parameter description (if any) ...
- * @return boolean Return description (if any) ...
- */
-function check_lock($id){
- if (isset($id) && $id != '' && is_numeric($id)) {
- if (file_exists(BASE.'static/'.$id.'.phtml') || $id == HOME_ID) {
- return true;
- }else{
- return false;
- }
- }else{
- return false;
- }
-
-}
-// }}}
-// {{{ sort_by_parent()
-/**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param array $data Parameter description (if any) ...
- * @return mixed Return description (if any) ...
- */
-function sort_by_parent($data) {
- if (!is_array($data))
- return false;
- foreach($data as $key=>$value) {
- $data_new[$value["parent"]][$value["id"]] = $value;
- }
- return $data_new;
-}
-// }}}
-// {{{ convertParent()
-/**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param array $threads Parameter description (if any) ...
- * @param array $thread Parameter description (if any) ...
- * @return array Return description (if any) ...
- */
-function convertParent($threads,$thread) {
- static $select,$count;
- $count = (!isset($count)) ? 0: $count;
- $bgcolor[] = '#6d6d6d';
- $bgcolor[] = '#7a7a7a';
- $bgcolor[] = '#8a8a8a';
- $bgcolor[] = '#979797';
- $bgcolor[] = '#adadad';
- $bgcolor[] = '#c1c1c1';
- if (is_array($thread)) {
- foreach($thread as $parent=>$value) {
- $color = $bgcolor[$count];
- $select[$value['id']]['color'] = $color;
- $select[$value['id']]['category'] = $value['category'];
- $select[$value['id']]['count'] = $count;
-
- if (isset($threads[$parent])) {
- $count++;
- convertParent($threads, $threads[$parent]);
- }
- }
- }
- $count--;
- return $select;
-}
-// }}}
-// {{{ parent_select()
-/**
- parent select
-
- This function does both the bus and bus category page parent select drop down boxes.
- the backcount var is used to lock the list to a certain level set up with define of LEVELS_DEEP.
- count varl starts at one and is generated in the function convertParent so we'll need to subtract one for proper results.
- to unset backcount properly we'll need to check if count goes under or equals that of backcount.
- then unset($backcount) cause if backcount is not empty then category won't get added to list.
-
- */
-function parent_select($catid,$id,$sel_name = "parent"){
- global $DB;
- // select catid portion
- $qs = "SELECT id,category,parent
- FROM bus_category
- ORDER BY parent,pos";
-
- $data = $DB->db_auto_get_data($qs,CONN_STR);
- $data1 = sort_by_parent($data);
- $select = "";
- if ($sel_name == "parent") {
- $select .= "--No Parent--";
- }
- $parts = convertParent($data1,$data1[0]);
- if (is_array($parts)){
- foreach($parts as $key=>$value){
- if (isset($backcount) && $value['count'] <= $backcount) {
- unset($backcount);
- }
- if ($key == $id && $sel_name = "parent") {
- $backcount = $value['count'];
- }
- if ($key == HOME_ID && $sel_name == "parent") {
- continue;
- }
- if ((!isset($backcount) && ($value['count'] < (LEVELS_DEEP - 1)) || $sel_name == "catid[]")) {
- $bkg = $value["color"];
- $indent = (int)$value["count"] * 10;
- $cc = (int)$value["count"] * 2;
- $paddman = str_repeat(" ",$cc);
- $select .= ' db_auto_get_data($qs,CONN_STR);
- $category = $res2['category'];
- }else{
- $category = "No Parent";
- }
-
- $select = $category." ";
- }
- if ((($id==HOME_ID || in_array($id,$GLOBALS['category_locks'])) && $catid == 0)&& strstr($_SERVER['PHP_SELF'],"edit_bus_category") && ($catid!='' && $id!='')){
- $select = 'No Parent ';
- }
- return $select;
-}
-// }}}
-$toolbox_nav['Toolbox Home'] = 'list_bus_category.phtml';
-if (!CAT_LOCK) {
- $toolbox_nav["Add A New Page"] = "edit_bus_category.phtml";
-}
-?>
diff --git a/admin/Toolbox/update_bus.phtml b/admin/Toolbox/update_bus.phtml
deleted file mode 100755
index d7cf243..0000000
--- a/admin/Toolbox/update_bus.phtml
+++ /dev/null
@@ -1,604 +0,0 @@
-db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 0);
- }
- $data = $DB->db_fetch_array($result, 0, PGSQL_ASSOC);
- $pos = $data['pos'];
- if ($newpos < $pos) {
- $qs = "
- SELECT id,pos
- FROM bus_category_bus
- WHERE pos < $pos
- AND pos >= $newpos
- AND catid = $catid
- ORDER BY pos";
- if (!$res = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 0);
- }
- $counter = ($newpos + 1);
- for ($i = 0; $i < $DB->db_numrows($res); $i++) {
- $res_data = $DB->db_fetch_array($res, $i, PGSQL_ASSOC);
- $res_id = $res_data['id'];
- $res_pos = $res_data['pos'];
- $qs = "
- UPDATE bus_category_bus
- SET pos = $counter
- WHERE id = $res_id";
-
- if (!$DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,0);
- }
- $counter++;
- }
- } else {
- $qs = "
- SELECT pos,id
- FROM bus_category_bus
- WHERE pos > $pos
- AND pos <= $newpos
- AND catid = $catid
- ORDER BY pos";
- if (!$res = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 0);
- }
- $counter = ($pos);
- for ($i = 0; $i < $DB->db_numrows($res); $i++) {
- $res_data = $DB->db_fetch_array($res, $i, PGSQL_ASSOC);
- $res_id = $res_data['id'];
- $res_pos = $res_data['pos'];
- $qs = "
- UPDATE bus_category_bus
- SET pos = $counter
- WHERE id = $res_id";
- if (!$DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 0);
- }
- $counter++;
- }
- }
- $qs = "
- UPDATE bus_category_bus
- SET pos = $newpos
- WHERE id = $id";
- if (!$DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 0);
- }
- $location = "list_bus.phtml?catid=$catid";
- // cach_Toolbox_paragraphs-$ID
- $toolbox->cache->remove('paragraphs-' . $catid, 'Toolbox');
- break;// }}}
-
- /*
- * Update the Paragraph
- */
- case "Update":// {{{
- $DB->db_exec("BEGIN WORK");
- if (is_array($_POST['delete'])) {
- foreach ($_POST['delete'] as $d_row_id) {
- $query = "
- SELECT filename
- FROM files
- WHERE id = ".$d_row_id;
- $file_res = $DB->db_exec($query);
- $filename = pg_result($file_res, 0, 'filename');
- $query = "
- DELETE FROM files
- WHERE id = ".$d_row_id;
- $DB->db_exec($query);
- @unlink(UP_BASE.$filename);
- unset($_FILES['file_new']['name']);
- // remember files have to be repositioned when there are deleted
- // get the position number of file then reposition all the ones with a greater pos
- $query = "
- UPDATE files SET
- pos = pos - 1
- WHERE pos > ".$_POST['filename_poshide'.$d_row_id]."
- AND bus_id = ".$_POST['id'];
- $DB->db_exec($query);
- }
- }
- if (is_array($_FILES['file_new']['name'])) {
- foreach ($_FILES['file_new']['name'] as $fileId => $fileName) {
- if ($_FILES['file_new']['name'][$fileId]) {
- @unlink(UP_BASE.$_POST['oldfile'][$fileId]);
- $update_file_name = GLM_TOOLBOX::file_upload($_FILES['file_new']['tmp_name'][$fileId], $_FILES['file_new']['name'][$fileId], UP_BASE);
- $query = "
- UPDATE files SET
- filename = '$update_file_name'
- WHERE id = $fileId;";
- $DB->db_exec($query);
- }
- }
- }
- if ($_POST['filename_urltext']) {
- foreach ($_POST['filename_urltext'] as $fileId => $fileUrlText) {
- $query = "
- UPDATE files SET
- urltext = '$fileUrlText'
- WHERE id = $fileId;";
- $DB->db_exec($query);
- }
- }
- if (is_array($_FILES['file']) && $_FILES['file']['name'] != '') {
- $res = $DB->db_exec("select max(pos) as maxpos from files where bus_id = ".$_POST['id']);
- $maxpos = pg_result($res, 0, 'maxpos');
- $maxpos = ($maxpos) ? ++$maxpos : 1;
- $new_file_name = GLM_TOOLBOX::file_upload($_FILES['file']['tmp_name'], $_FILES['file']['name'], UP_BASE);
- $query = "
- INSERT INTO files
- (filename,bytes,type,urltext,bus_id,pos)
- VALUES
- ('$new_file_name',".$_FILES['file']['size'].",'".$_FILES['file']['type']."',
- '".$_POST['filename']."',".$_POST['id'].",$maxpos);";
- $DB->db_exec($query);
- }
- $oldcatid = ereg_replace("^:","",$oldcatid);
- $oldcatid = split(":",$oldcatid);
- if ($category) {
- $category = ereg_replace("^:","",$category);
- $catid = split(":",$category);
- }
- $array_counter = 0;
- if (is_array($catid)) {
- $query = "
- SELECT catid,pos
- FROM bus_category_bus
- WHERE busid = $id";
- $res = $DB->db_exec($query);
- $oldpos = pg_result($res,0,'pos');
- while ($row = pg_fetch_array($res)) {
- // do this only if ald catid is being removed
- if (!in_array($row['catid'],$catid)) {
- $query = "
- UPDATE bus_category_bus SET
- pos = pos - 1
- WHERE catid = ".$row['catid']."
- AND pos >= $oldpos";
- $DB->db_exec($query);
- $query = "
- DELETE FROM bus_category_bus
- WHERE catid = ".$row['catid']."
- aNd busid = $id";
- $DB->db_exec($query);
- }
- }
- foreach ($catid as $key=>$value) {
- // do this only if ald catid is being removed
- if (!in_array($value,$oldcatid)) {
- $qs = "SELECT count(*) as maxpos
- FROM bus_category_bus
- WHERE catid = $value";
- if (!$res = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,1);
- }
- $row = $DB->db_fetch_array($res,0,PGSQL_ASSOC);
- $pos = ($row['maxpos'] == 0) ? (int)0 : (int)$row['maxpos'] ;
- $pos++;
- $qs = "
- INSERT
- INTO bus_category_bus
- (busid,catid,pos)
- VALUES
- ($id,$value,$pos)";
- if (!$DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,1);
- }
- }
- }
- }
- $fields = array_reverse($fields);
- $qs = "UPDATE ".TABLE." SET ";
- for ($i=0;$iimageDelete($oldy);
- }
- }
- $delete = ${"delete".$tmpimg};
- if ($delete==1) {
- $image_tmp_name = "";
- if ($oldy) {
- require_once BASE.'Toolkit/Image/Server.php';
- $imServer = new Toolkit_Image_Server();
- $imServer->imageDelete($oldy);
- }
- }
- $qs .= $fields[$i][name]." = '".$image_tmp_name."'";
- if ($i != $LAST) {
- $qs .= ",";
- }
- } elseif ($fields[$i][type]=="seperator") {
- //empty
- } elseif ($fields[$i][type]=="file") {
- $tmpfile = $fields[$i]['name'];
- $file_tmp = $$tmpfile;
- $oldy = ${"old".$tmpfile};
- $file_tmp_name = ${$tmpfile."_name"};
- if ($file_tmp == "none" || $file_tmp == "") {
- $file_tmp_name = $oldy;
- } else {
- $file_tmp_name = GLM_TOOLBOX::file_upload($file_tmp,$file_tmp_name,UP_BASE);
- }
-
- $delete = ${"delete".$tmpfile};
- if ($delete==1) {
- $file_tmp_name = "";
- @unlink(UP_BASE.$oldy);
- }
- $qs .= $fields[$i][name]." = '".$file_tmp_name."'";
- if ($i != $LAST) {
- $qs .= ",";
- }
- } elseif ($fields[$i]['type']=="bool") {
- $value = ($_REQUEST[$fields[$i]['name']]) ? 't' : 'f';
- $qs .= $fields[$i]['name']." = '$value'";
- if ($i != $LAST) {
- $qs .= ",";
- }
- } elseif ($fields[$i][type]=="static") {
- // do nothing
- } elseif ($fields[$i][type]=="password") {
- if (($password && $password2) && ($password == $password2)) {
- $qs .= $fields[$i][name]." = '".$$fields[$i][name]."'";
- if ($i != $LAST) {
- $qs .= ",";
- }
- }
- } else {
- $qs .= $fields[$i][name]." = '".$$fields[$i][name]."'";
- if ($i != $LAST) {
- $qs .= ",";
- }
- }
- } else {
- $qs = substr($qs,0,strlen($qs)-1);
- $qs .= " WHERE ".$fields[$i][name]." = ".$$fields[$i][name];
- }
- }
- $fields = array_reverse($fields);
- if (!$DB->db_exec($qs)) {
- $ERRORS .= pg_errormessage($dbd).$qs;
- }
- $location = "list_bus.phtml?catid=".$catid[0]."&".SID;
- // cach_Toolbox_paragraphs-$ID
- $toolbox->cache->remove('paragraphs-' . $oldcatid[0], 'Toolbox');
- $toolbox->cache->remove('paragraphs-' . $catid[0], 'Toolbox');
- $DB->db_exec("COMMIT WORK");
- break;// }}}
-
- /*
- * Insert a new paragraph at last position + 1
- */
- case "Insert":// {{{
- if (is_array($_FILES['file']) && $_FILES['file']['name'] != '') {
- $new_file_name = GLM_TOOLBOX::file_upload($_FILES['file']['tmp_name'], $_FILES['file']['name'], UP_BASE);
- }
- if ($category) {
- $category = ereg_replace("^:", "", $category);
- $catid = split(":", $category);
- }
- $tmp = "";
- $tmp_value = "";
- for ($i = 0; $i < count($fields); $i++) {
- if ($fields[$i]['name'] != ID) {
- if ($fields[$i]['type']!="static" && $fields[$i]['type']!="seperator") {
- $tmp .= $fields[$i]['name'];
- $tmp .= ",";
- }
- }
- }
- for ($i=0;$idb_exec("BEGIN WORK")) {
- die(pg_errormessage($dbd).$qs);
- }
- if ($tmp_blank || $_FILES['file']['name']) {
- $qs = "
- INSERT INTO ".TABLE."
- (".ID.", $tmp)
- VALUES
- (nextval('".SEQUENCE."'), $tmp_value)";
- if (!$res = $DB->db_exec($qs)) {
- die(pg_errormessage($dbd).$qs);
- }
- if ($new_file_name) {
- $query = "
- INSERT INTO files
- (filename,bytes,type,urltext,bus_id)
- VALUES
- ('$new_file_name',".$_FILES['file']['size'].",'".$_FILES['file']['type']."',
- '".$_POST['filename']."',currval('bus_id_seq'));";
- $DB->db_exec($query);
- }
- if (is_array($catid)) {
- foreach ($catid as $key => $value) {
- $qs = "
- SELECT count(*) as maxpos
- FROM bus_category_bus
- WHERE catid = $value";
- if (!$res = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 1);
- }
- $row2 = $DB->db_fetch_array($res, 0, PGSQL_ASSOC);
- if (!$pos = $row2[maxpos]) {
- $pos = 1;
- } else {
- $pos++;
- }
- $qs = "
- INSERT
- INTO bus_category_bus
- (busid,catid,pos)
- VALUES
- (currval('bus_id_seq'),$value,$pos)";
- if (!$DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 1);
- }
- }
- if (!$res = $DB->db_exec("COMMIT WORK")) {
- die(pg_errormessage($dbd).$qs);
- }
- } else {
- $qs = "
- SELECT count(*) as maxpos
- FROM bus_category_bus
- WHERE catid = $catid";
- if (!$res = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 1);
- }
- $row2 = $DB->db_fetch_array($res, 0, PGSQL_ASSOC);
- if (!$pos = $row2[maxpos]) {
- $pos = 1;
- } else {
- $pos++;
- }
- $qs = "
- INSERT
- INTO bus_category_bus
- (busid,catid,pos)
- VALUES
- ($row[id],$catid,$pos)";
-
- if (!$DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 1);
- }
- if (!$res = $DB->db_exec("COMMIT WORK")) {
- die(pg_errormessage($dbd).$qs);
- }
- }
- }
- $location = "list_bus.phtml?catid=".$catid[0]."&".SID;
- // cach_Toolbox_paragraphs-$ID
- $toolbox->cache->remove('paragraphs-' . $catid[0], 'Toolbox');
- break;// }}}
-
- /*
- * Delete a paragraph
- * reposition all other paragraphs
- * delete images and files for this
- * paragraph
- */
- case "Delete":// {{{
- $oldcatid = ereg_replace("^:", "", $oldcatid);
- $oldcatid = split(":", $oldcatid);
- require_once BASE.'Toolkit/Image/Server.php';
- $imServer = new Toolkit_Image_Server();
- if ($oldimage) {
- $imServer->imageDelete($oldimage);
- }
- if ($oldimage2) {
- $imServer->imageDelete($oldimage2);
- }
- if ($oldimage3) {
- $imServer->imageDelete($oldimage3);
- }
- $query = "
- SELECT *
- FROM files
- WHERE bus_id = $id;";
- if ($fRes = $DB->db_exec($query)) {
- while ($fRow = pg_fetch_array($fRes)) {
- if (is_file(UP_BASE.$fRow['filename'])) {
- unlink(UP_BASE.$fRow['filename']);
- }
- }
- }
- foreach ($oldcatid as $key=>$value) {
- if ($value) {
- $qs = "
- SELECT id,pos
- FROM bus_category_bus
- WHERE busid = $id
- AND catid = $value";
- if (!$res = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 1);
- }
- $row = $DB->db_fetch_array($res, 0, PGSQL_ASSOC);
- $qs = "
- SELECT id
- FROM bus_category_bus
- WHERE pos > $row[pos]
- AND catid = $value
- ORDER BY pos";
- if (!$res2 = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 1);
- }
- $counter = $row[pos];
- for ($i = 0; $i < $DB->db_numrows($res2); $i++) {
- $row2 = $DB->db_fetch_array($res2, $i, PGSQL_ASSOC);
-
- $qs = "
- UPDATE bus_category_bus
- SET pos = $counter
- WHERE id = $row2[id]";
-
- if (!$DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 1);
- }
- $counter++;
- }
- }
- }
- $qs = "
- DELETE FROM bus
- WHERE id = $id";
- if (!$DB->db_auto_exec($qs)) {
- GLM_TOOLBOX::html_error("failed ->".$qs, 1);
- }
- $location = "list_bus.phtml?catid=".$oldcatid[0]."&".SID;
- // cach_Toolbox_paragraphs-$ID
- $toolbox->cache->remove('paragraphs-' . $oldcatid[0], 'Toolbox');
- break;// }}}
-
- /*
- * Cancel Paragraph edit
- */
- case "Cancel":// {{{
- $oldcatid = ereg_replace("^:","",$oldcatid);
- $oldcatid = split(":",$oldcatid);
- $catid = ereg_replace("^:","",$oldcatid);
- $catid = split(":",$oldcatid);
- $location = "list_bus.phtml?catid=".$oldcatid[0]."&".SID;
- break;// }}}
-
- default:// {{{
- GLM_TOOLBOX::html_error("incorrect value for Command",1);
- break;// }}}
-
- }
-}
-/*
- * Redirect to the list paragraph page
- */
-header("Location: $location");
-?>
diff --git a/admin/Toolbox/update_bus_category.phtml b/admin/Toolbox/update_bus_category.phtml
deleted file mode 100755
index 89df1c8..0000000
--- a/admin/Toolbox/update_bus_category.phtml
+++ /dev/null
@@ -1,316 +0,0 @@
-db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,0);
- }
- $data = $DB->db_fetch_array($result,0,PGSQL_ASSOC);
- $pos = $data['pos'];
- if ($newpos < $pos) {
- $qs = "
- SELECT id,pos
- FROM bus_category
- WHERE pos < $pos
- AND pos >= $newpos
- AND parent = $parent
- ORDER BY pos";
- if (!$res = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,0);
- }
- $counter = ($newpos + 1);
- for ($i=0;$i<$DB->db_numrows($res);$i++) {
- $res_data = $DB->db_fetch_array($res,$i,PGSQL_ASSOC);
- $res_id = $res_data['id'];
- $res_pos = $res_data['pos'];
- $qs = "
- UPDATE bus_category
- SET pos = $counter
- WHERE id = $res_id";
- if (!$DB->db_exec($qs))
- {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,0);
- }
- $counter++;
- }
- } else {
- $qs = "
- SELECT pos,id
- FROM bus_category
- WHERE pos > $pos
- AND pos <= $newpos
- AND parent = $parent
- ORDER BY pos";
- if (!$res = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,0);
- }
- $counter = ($pos);
- for ($i=0;$i<$DB->db_numrows($res);$i++) {
- $res_data = $DB->db_fetch_array($res,$i,PGSQL_ASSOC);
- $res_id = $res_data['id'];
- $res_pos = $res_data['pos'];
- $qs = "
- UPDATE bus_category
- SET pos = $counter
- WHERE id = $res_id";
- if (!$DB->db_exec($qs))
- {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,0);
- }
- $counter++;
- }
- }
- $qs = "
- UPDATE bus_category
- SET pos = $newpos
- WHERE id = $id";
- if (!$DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,0);
- }
- $toolbox->cache->clean('Nav');
- break;// }}}
- // {{{ case "Update":
-
- /*
- * Update the Page
- */
- case "Update":
- if ($image != "none" && $image != "") {
- require_once BASE.'Toolkit/Image/Server.php';
- $imServer = new Toolkit_Image_Server();
- if ($oldimage) {
- $imServer->imageDelete($oldimage);
- }
- $image_name = GLM_TOOLBOX::process_image('image');
- } else {
- $image_name = $oldimage;
- }
- if ($delete == "1") {
- $image_name = "";
- require_once BASE.'Toolkit/Image/Server.php';
- $imServer = new Toolkit_Image_Server();
- $imServer->imageDelete($_REQUEST['oldimage']);
- }
- if ($parent != $oldparent) {
- $qs = "
- SELECT MAX(pos) as maxpos
- FROM bus_category
- WHERE parent = $parent";
- $res = $DB->db_exec($qs);
- $row = $DB->db_fetch_array($res,0,PGSQL_ASSOC);
- $pos = $row[maxpos];
- $pos++;
- $qs = "
- SELECT pos,id
- FROM bus_category
- WHERE parent = $oldparent
- AND pos > $oldpos
- ORDER BY pos";
- $res2 = $DB->db_exec($qs);
- $oldparent_counter = $oldpos;
- for ($i=0;$i<$DB->db_numrows($res2);$i++) {
- $row2 = $DB->db_fetch_array($res2,$i,PGSQL_ASSOC);
- $qs = "
- UPDATE bus_category
- SET pos = $oldparent_counter
- WHERE id = $row2[id]";
- $DB->db_exec($qs);
- $oldparent_counter++;
- }
- } else {
- $pos = $oldpos;
- }
- $template = ($template) ? $template : 1;
- $featured = ($featured == 't') ? $featured : 'f';
- $include_member_map = ($include_member_map == 't') ? $include_member_map : 'f';
- $no_search_form = ($no_search_form == 't') ? $no_search_form : 'f';
- $section_links = ($section_links == 't') ? $section_links : 'f';
- $region = (is_numeric($region)) ? $region : 'NULL';
-
- //$res2 = $DB->db_exec("BEGIN WORK;");
- $qs = "
- UPDATE bus_category SET
- category = '$category',
- featured = '$featured',
- include_member_map = '$include_member_map',
- no_search_form = '$no_search_form',
- meta_descr = '$meta_descr',
- title = '$title',
- section_links = '$section_links',
- parent = $parent,
- pos = $pos,
- intro = '$intro',
- feature_intro = '$feature_intro',
- description = '$description',
- image = '$image_name',
- imagename = '$imagename',
- keyword = '$keyword',
- template = $template,
- short_url = '$short_url',
- region = $region
- WHERE id = $id";
- if (!$DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error("failed ->".$qs,1);
- }
- if (defined("MEMBERS_DB") && MEMBERS_DB) {
- update_member_bus_cat(&$DB);
- }
- //$DB->db_exec("COMMIT WORK;");
- break;// }}}
- // {{{ case "Insert":
-
- /*
- * Insert a new Page at last position + 1
- */
- case "Insert":
- $parent = ($parent) ? $parent : 0;
- if ($image != "none" && $image != "") {
- $image_name = GLM_TOOLBOX::process_image('image');
- } else {
- $image_name = $oldimage;
- }
- $qs = "
- SELECT MAX(pos) as maxpos
- FROM bus_category
- WHERE parent = $parent";
- $res = $DB->db_exec($qs);
- $row = $DB->db_fetch_array($res,0,PGSQL_ASSOC);
- $nextpos = $row[maxpos];
- $nextpos++;
- $template = ($template) ? $template : 1;
- $parent = ($parent) ? $parent : 0;
- $featured = ($featured == 't') ? $featured : 'f';
- $no_search_form = ($no_search_form == 't') ? $no_search_form : 'f';
- $include_member_map = ($include_member_map == 't') ? $include_member_map : 'f';
- $section_links = ($section_links == 't') ? $section_links : 'f';
- $region = (is_numeric($region)) ? $region : 'NULL';
-
- $res2 = $DB->db_exec("BEGIN WORK;");
- $qs = "
- INSERT INTO bus_category
- (section_links,include_member_map, no_search_form,featured,feature_intro,template,keyword,
- category,parent,intro,description,image,imagename,pos,meta_descr,
- short_url,title,region)
- VALUES
- ('$section_links','$include_member_map','$no_search_form','$featured','$feature_intro',$template,'$keyword',
- '$category',$parent,'$intro','$description','$image_name','$imagename',$nextpos,'$meta_descr',
- '$short_url','$title',$region)";
- if (!$res1 = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error("failed ->".$qs,1);
- }
- if (defined("MEMBERS_DB") && MEMBERS_DB && is_array($_REQUEST['member_cats'])) {
- foreach ($_REQUEST['member_cats'] as $memb_catid) {
- $query = "
- INSERT INTO bus_cat_member
- (catid, memb_type)
- VALUES
- (currval('bus_category_id_seq'), $memb_catid);";
- if (!$DB->db_exec($query)) {
- die($query.__LINE__);
- }
- }
- }
- $DB->db_exec("COMMIT WORK;");
- $toolbox->cache->clean('Nav');
- break;// }}}
- // {{{ case "Delete"
- /*
- * Delete a Page
- * reposition all other Pages
- * delete images
- * Page
- */
- case "Delete":
- $DB->db_exec("BEGIN WORK");
- $qs = "
- SELECT count(*) as count
- FROM bus_category_bus
- WHERE catid = $id";
- $res = $DB->db_exec($qs);
- $row = $DB->db_fetch_array($res,0,PGSQL_ASSOC);
- if ($row['count'] >0) {
- GLM_TOOLBOX::html_error("Sorry but you have items in there\n
- Delete these records first\n",1);
- }
- $qs = "
- SELECT parent
- FROM bus_category
- WHERE parent = $id";
- $res = $DB->db_exec($qs);
- if ($DB->db_numrows($res) >0) {
- GLM_TOOLBOX::html_error("Sorry but you have Categories in there\n
- Delete these Categories first\n",1);
- }
- $qs = "
- SELECT pos,id
- FROM bus_category
- WHERE parent = $oldparent
- AND pos > $oldpos
- ORDER BY pos";
- $res2 = $DB->db_exec($qs);
- $oldparent_counter = $oldpos;
- for ($i=0;$i<$DB->db_numrows($res2);$i++) {
- $row2 = $DB->db_fetch_array($res2,$i,PGSQL_ASSOC);
- $qs = "
- UPDATE bus_category
- SET pos = $oldparent_counter
- WHERE id = $row2[id]";
- $DB->db_exec($qs);
- $oldparent_counter++;
- }
- $qs2 = "
- DELETE
- FROM bus_category
- WHERE id = $id";
- $DB->db_exec($qs2);
- if (!$DB->db_auto_exec($qs2)) html_error(DB_ERROR_MSG.$qs2,1);
- if ($oldimage) {
- require_once BASE.'Toolkit/Image/Server.php';
- $imServer = new Toolkit_Image_Server();
- $imServer->imageDelete($oldimage);
- }
- $DB->db_exec("COMMIT WORK");
- // remove the cache for this paragraphs
- // cach_Toolbox_paragraphs-$ID
- $toolbox->cache->remove('paragraphs-' . $id, 'Toolbox');
- $toolbox->cache->clean('Nav');
- break;// }}}
- // {{{ case "Cancel":
-
- /*
- * Cancel Page edit
- */
- case "Cancel":
- break;// }}}
- // {{{ default
- default:
- GLM_TOOLBOX::html_error("incorrect value for Command",1);
- break;// }}}
- }
-}
-// remove the cache for this paragraphs
-// cach_Toolbox_page-$ID
-$toolbox->cache->clean('MainNav');
-$toolbox->cache->remove('page-' . $id, 'Toolbox');
-$toolbox->cache->remove('paragraphs-' . $id, 'Toolbox');
-//GLM_TOOLBOX::create_sitemap();
-header("Location: ".BASE_URL."admin/Toolbox/list_bus_category.phtml?".SID);
-?>
diff --git a/admin/Toolbox/updatetoolset.php b/admin/Toolbox/updatetoolset.php
deleted file mode 100755
index 7863b18..0000000
--- a/admin/Toolbox/updatetoolset.php
+++ /dev/null
@@ -1,32 +0,0 @@
-db_connect();
- $DB->db_exec( "BEGIN WORK" );
-
- echo 'replacing newlines with <br> in bus_category ';
- $DB->db_exec( "update bus_category set description = replace(description,'\\n',' ')" );
- echo 'replacing newlines with <br> in bus ';
- $DB->db_exec( "update bus set description = replace(description,'\\n',' ')" );
- $DB->db_exec( "update bus set description2 = replace(description2,'\\n',' ')" );
- $DB->db_exec( "update bus set description3 = replace(description3,'\\n',' ')" );
-
- echo 'replacing newlines with <br> in news ';
- $DB->db_exec( "update news set description = replace(description,'\\n',' ')" );
- echo 'replacing newlines with <br> in news_block ';
- $DB->db_exec( "update news_block set description2 = replace(description2,'\\n',' ')" );
-
- $DB->db_exec( "COMMIT WORK" );
- /**
- update media_category set description = replace(description,'http://devsys.gaslightmedia.com/www.upnorth.net/','http://www.upnorth.net/');
- update bus_category set description = replace(description,'http://devsys.gaslightmedia.com/www.upnorth.net/','http://www.upnorth.net/');
- */
-?>
diff --git a/admin/Toolbox/upgradefiles2.php b/admin/Toolbox/upgradefiles2.php
deleted file mode 100644
index c2cd054..0000000
--- a/admin/Toolbox/upgradefiles2.php
+++ /dev/null
@@ -1,31 +0,0 @@
-db_exec( "BEGIN WORK;" );
-echo 'BEGIN WORK
';
-$query = "select id,bus_id from files order by bus_id,filename;";
-echo ''.$query.'
';
-if( $data = $DB->db_auto_get_data( $query ) )
-{
- $bus_id = null;
- $pos = 1;
- foreach( $data as $row )
- {
- if( $row['bus_id'] == $bus_id )
- {
- $pos++;
- }
- else
- {
- $pos = 1;
- $bus_id = $row['bus_id'];
- }
- $query2 = "update files set pos = $pos where id = ".$row['id'].";";
- echo ''.$query2.'
';
- $DB->db_exec( $query2 );
- }
-}
-$DB->db_exec( "COMMIT WORK;" );
-echo 'COMMIT WORK
';
-?>
diff --git a/admin/form.js b/admin/form.js
deleted file mode 100644
index 0bbabf0..0000000
--- a/admin/form.js
+++ /dev/null
@@ -1,42 +0,0 @@
-function reshow(object) {
- artist = object.options[object.selectedIndex].text;
- for (var i = document.track.names.length;i > 0;i--)
- document.track.names.options[0] = null;
- reloading = true;
- showlinks();
- document.track.names.options[0].selected = true;
- return false;
-}
-
-function load(object) {
- alert('Just testing: ' + object.options[object.selectedIndex].value);
- //window.location.href = object.options[object.selectedIndex].value;
- return false;
-}
-
-function showlinks() {
- if (artist == 'Chris Rea') {
- opt('cr/one.zip','The Road To Hell');
- opt('cr/two.zip','Let\'s Dance');
- }
-
- if (artist == 'Annie Lennox') {
- opt('al/why.zip','Why');
- opt('al/wobg.zip','Walking on Broken Glass');
- }
-
- if (artist == 'Dina Carrol') {
- opt('dc/track1.zip','Escaping');
- opt('dc/track2.zip','Only Human');
- }
-}
-
-function opt(href,text) {
- if (reloading) {
- var optionName = new Option(text, href, false, false)
- var length = document.track.names.length;
- document.track.names.options[length] = optionName;
- }
- else
- document.write('',text,'<\/OPTION>');
-}
diff --git a/admin/index.phtml b/admin/index.phtml
deleted file mode 100644
index c398566..0000000
--- a/admin/index.phtml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
- Administration
-
-
-
-
-
-Admin Requires Frames Capable Browser
-You can get a Standard Compliant browser from:
-
-
-
-
diff --git a/admin/main.css b/admin/main.css
deleted file mode 100644
index de72596..0000000
--- a/admin/main.css
+++ /dev/null
@@ -1,204 +0,0 @@
-body {
- padding-left: 50px;
- font-family: arial, helvetica, sans-serif;
- font-size: 12px;
- }
-.clearer {
- height:1px;
- overflow:hidden;
- margin-top:-1px;
- clear:left;
-}
-h1 {font-size: 18px; color: #777;}
-form {margin: 0; padding: 0;}
-/* TOOLBOX NAV */
-ul#toolbox {list-style-position:inside;list-style-type:circle;}
-ul#toolbox li {list-style-type:circle}
-ul#toolbox li.toolboxArrow {list-style-type:none;padding-left:0;margin-left:-7px;}
-* html ul#toolbox li.toolboxArrow {margin-left:-20px;} /*style for IE*/
-/* APP Nav*/
-ul.admin_nav
-{
-margin: 0;
-list-style-type: none;
-padding: 5px 0;
-}
-ul.admin_nav li { display: inline; }
-ul.admin_nav li a
-{
-border-top: 1px solid #eee;
-border-right: 1px solid #ccc;
-border-bottom: 1px solid #ccc;
-border-left: 1px solid #eee;
-text-decoration: none;
-background-color: #ddd;
-color: #000;
-padding: 2px 6px;
-margin: 0 1px;
-font-weight: bold;
-font-size: 12px;
-}
-#admin-list-table {clear:left;width:500px;}
-#admin-list-table td {
- border: 2px solid #ccc;
- border-collapse: collapse;
- background: #eee;
- padding: 4px;}
-/*#admin-list-table img {border: 0; text-align: center; margin: 0 auto; display: block;}*/
-#admin-list-table a:link {color: #666;}
-#admin-list-table a:visited {color: #666;}
-#admin-list-table a:active {color: #666;}
-#admin-list-table a:hover {color: #000;}
-
-/*event-edit-table */
-#admin-edit-table {
- clear:left;
- font-family: arial, helvetica, sans-serif;
- border: 2px solid #ccc;
- border-collapse: collapse;
- font-size: 12px;
- }
-#admin-edit-table td {
- border: 2px solid #ccc;
- border-collapse: collapse;
- background: #eee; padding: 4px;}
-#admin-list-table table td {border:none;padding:0;margin:0;}
-#admin-edit-table table td {border:none;padding:0;margin:0;}
-#admin-edit-table select,
-#admin-edit-table input,
-#admin-edit-table option {font-size: 12px;}
-#glm-manual {position:absolute;right:200px;top:10px;width:300px;}
-#glm-manual a {padding:5px 2px;width:149px;background-color:#DDDDDD;color:#000;}
-div.fileupload { border:1px solid black;float:left;margin:5px; padding:5px;background-color:white; color:black; }
-div.fileupload p { margin:0; padding:0;float:left; }
-div.fileupload span { background-color:#c0c0c0; }
-.level-0 {
- font-weight: bold;
- padding-left: 0;
- background-color: #ccc;
-}
-.level-1 {
- padding-left: 20px;
- background-color: #ddd;
- }
-.level-2 {padding-left: 40px;}
-.level-3 {padding-left: 60px;}
-.level-4 {padding-left: 80px;}
-.level-5 {padding-left: 100px;}
-.level-6 {padding-left: 120px;}
-table.banners,
-table.banners tr {
- border: 1px solid #17186A;
- border-collapse: collapse;
-}
-table.banners {
- border: none;
- border: 1px solid #17186A;
- width: 100%;
- margin: 5px 2px;
-}
-table.banners td.status {
- text-align: center;
-}
-table.banners a img {
- border: none;
-}
-table.banners thead th {
- text-align: center;
- background: #1D58A5;
- border: 1px solid #17186A;
- color: #FFF;
- padding: 2px 6px;
-}
-table.banners thead a {
- color: #FFF;
-}
-table.banners tbody tr td {
- padding: 5px 5px;
-}
-table.banners tbody tr:hover {
- background: #E3E3E3;
-}
-table.banners a:hover {
- text-decoration: none;
-}
-.pager {
- text-align: center;
- background: #F6F6F6;
- border-color: #DDD;
- border-style: solid;
- border-width: 1px 0;
- margin: 1.0em 0;
- padding: 8px 0;
- text-align: center;
- width: 100%;
- font-size: 12px;
-
-}
-.pager b {
- border: 1px solid #CCC;
- border: 1px solid #17186A;
- background: #FFF;
- padding: 5px 7px;
-}
-.pager a {
- background: #FFF;
- border: 1px solid #CCC;
- padding: 5px 7px;
- text-decoration: none;
- color: #000;
-}
-.pager a:hover {
- border: 1px solid #999;
- border: 1px solid #17186A;
-}
-#form-wrap legend {
- color: #fff;
- background: #1D58A5;
- border: 1px solid #17186A;
- padding: 2px 6px;
-}
-#form-wrap p {margin:1px;}
-#form-wrap label {
- float: none;
- margin-right: 0;
- display: inline;
- clear: left;
-}
-
-
-/* Banner Reporting */
-
-#bannerInfo, #reportResult {
- margin: 10px;
- border: 1px solid #bbb;
- border-right: 1px solid #444;
- border-bottom: 1px solid #444;
- padding: 20px;
- width: 400px;
- background: #efefef;
- font-size: 12px;
-}
-#bannerInfo h3, #reportResult h3 {
- margin: 0;
-}
-#bannerInfo p {
- margin-bottom: 0;
-}
-
-#bannerInfo table, #reportResult table,
-#bannerInfo th, #reportResult th,
-#bannerInfo tr, #reportResult tr,
-#bannerInfo td, #reportResult td {
- margin: 5px;
- padding: 5px;
- border-collapse: collapse;
- font-size: 12px;
-}
-#bannerInfo td {
- padding: 5px;
-}
-
-/* Report Result */
-
-
diff --git a/admin/msg.js b/admin/msg.js
deleted file mode 100644
index 8ed837d..0000000
--- a/admin/msg.js
+++ /dev/null
@@ -1,29 +0,0 @@
-function glm_confirm(o) {
- var p = o.msg.split("\n");
- var k = 0;
- for(i = 0;i < p.length;i++) {
- if(k > p[i].length)
- continue;
- else
- k = p[i].length;
- }
-
- var bound = "";
- for(i = 0; i < k; i++) {
- bound = bound+'_';
- }
- var str = bound+"\n\n"+o.msg+"\n\n"+bound+"\n\nAre You Sure?";
- if(confirm(str)) {
- if(o.popup == '1') {
- var nw = new Object();
- nw.url = o.url;
- nw.name = o.popup.name;
- nw.width = o.width;
- nw.height = o.height;
- glm_open(nw);
- }
- else {
- location.replace(o.url);
- }
- }
-}
diff --git a/admin/nav.phtml b/admin/nav.phtml
deleted file mode 100644
index a4f4929..0000000
--- a/admin/nav.phtml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-Admin Navigation
-
-
-
-
-
-parseConfig(
- BASE . 'Toolkit/Members/config.ini',
- 'IniFile'
-);
-$pluralType
- = $memberRoot->getItem('section', 'listing type')
- ->getItem('directive', 'plural')
- ->getContent();
-
-*/
-$rotatingImagesRoot =& $conf->parseConfig(
- BASE . 'Toolkit/RotatingImages/config.ini',
- 'IniFile'
-);
-
-// get reference to [conf] section of config file
-$rotatingImagesName
- = $rotatingImagesRoot->getItem('section', 'conf')
- ->getItem('directive', 'applicationName')
- ->getContent();
-
-$nav['Home'] = 'admin/splash.phtml';
-$nav['Toolbox'] = 'admin/Toolbox/';
-$nav['Contact'] = 'admin/Contact/';
-$nav[$rotatingImagesName] = 'admin/rotatingImages.php';
-$nav['Photos'] = 'admin/Photos/';
-$nav['Server Statistics'] = 'admin/logs/';
-
-foreach ($nav as $name => $url) {
- echo '
- '.$name.'
- ';
-}
-?>
-
-
-
-
-
diff --git a/admin/rotatingImages.php b/admin/rotatingImages.php
deleted file mode 100644
index c914295..0000000
--- a/admin/rotatingImages.php
+++ /dev/null
@@ -1,29 +0,0 @@
-parseConfig(
- BASE . 'Toolkit/RotatingImages/config.ini',
- 'IniFile'
-);
-
-// get reference to [conf] section of config file
-$rotatingImagesName
- = $rotatingImagesRoot->getItem('section', 'conf')
- ->getItem('directive', 'applicationName')
- ->getContent();
-
-$ri = new Toolkit_RotatingImages();
-$nav = $ri->createNav();
-$rotatingImages = $ri->toHtml(
- Toolkit_Database::getInstance(),
- $rotatingImagesRoot
-);
-
-GLM_TOOLBOX::top($rotatingImagesName, '');
-echo $nav;
-echo $rotatingImages;
-
-GLM_TOOLBOX::footer();
-?>
diff --git a/admin/splash.phtml b/admin/splash.phtml
deleted file mode 100644
index 3034a7d..0000000
--- a/admin/splash.phtml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-include("../setup.phtml");
-?>
-
-
-
- ">
-Welcome to GLM Toolbox
-
-
-
-
-
Welcome To The =SITENAME?> Administration Area
-
Please Choose The Area You Wish To Update.
-
">
-
-
-
-
-
diff --git a/admin/template1.gif b/admin/template1.gif
deleted file mode 100644
index 327d943..0000000
Binary files a/admin/template1.gif and /dev/null differ
diff --git a/admin/template2.gif b/admin/template2.gif
deleted file mode 100644
index edf3d8b..0000000
Binary files a/admin/template2.gif and /dev/null differ
diff --git a/admin/template3.gif b/admin/template3.gif
deleted file mode 100644
index 16e2107..0000000
Binary files a/admin/template3.gif and /dev/null differ
diff --git a/admin/template4.gif b/admin/template4.gif
deleted file mode 100644
index 32174dd..0000000
Binary files a/admin/template4.gif and /dev/null differ
diff --git a/admin/template5.gif b/admin/template5.gif
deleted file mode 100644
index 6c36b50..0000000
Binary files a/admin/template5.gif and /dev/null differ
diff --git a/admin/template6.gif b/admin/template6.gif
deleted file mode 100644
index 28d140e..0000000
Binary files a/admin/template6.gif and /dev/null differ
diff --git a/admin/verify.js b/admin/verify.js
deleted file mode 100644
index 54ebd72..0000000
--- a/admin/verify.js
+++ /dev/null
@@ -1,107 +0,0 @@
-function isblank(s) {
- for(var i = 0; i < s.length; i++) {
- var c = s.charAt(i);
- if((c != ' ') && (c != '\n') && (c != '\t'))
- return(false);
- }
- return(true);
-}
-
-function verify(f) {
- var msg;
- var empty_fields = "";
- var errors = "";
-
- for(var i = 0; i < f.length; i++) {
- var e = f.elements[i];
- if(((e.type == "text") || (e.type == "password") ||(e.type == "textarea")) && !e.optional) {
- if((e.value == null) || (e.value == "") || isblank(e.value)) {
- empty_fields += "\n " + e.r;
- continue;
- }
-
- if(e.d) {
- if(isNaN(Date.parse(e.value)))
- errors += "- The field " +e.r+" must be formated like 01/17/2001\n";
- }
- if(e.numeric || (e.min != null) || (e.max != null)) {
- if(e.i) {
- var v = parseInt(e.value);
- if(v != e.value) {
- errors += "- The field " +e.r + " must be a ";
- errors += "number with no decimal\n";
- continue;
- }
- }
- else
- var v = parseFloat(e.value);
- if(isNaN(v) ||
- ((e.min != null) && (v < e.min)) ||
- ((e.max != null) && (v > e.max))) {
-
- errors += "- The field " + e.r + " must be a number";
- if(e.min != null)
- errors += " that is greater than " + e.min;
- if(e.max != null && e.min != null)
- errors += " and less than " + e.max;
- else if (e.max != null)
- errors += " that is less than " + e.max;
- errors += ".\n";
- }
- }
- }
- if (e.options && !e.optional)
- {
- if((e.value == null) || (e.value == "") || isblank(e.value))
- {
- empty_fields += "\n " + e.r;
- continue;
- }
- }
- }
-
- if(!empty_fields && !errors)
- return(true);
-
- msg = "_____________________________________________________\n\n";
- msg +="The form was not submitted because of the following error(s).\n";
- msg +="Please correct these error(s) and re-submit.\n";
- msg +="_____________________________________________________\n\n";
-
- if(empty_fields) {
- msg += "- The following required field(s) are empty:"
- + empty_fields + "\n";
- if(errors)
- msg += "\n";
- }
- msg += errors;
- alert(msg);
- return(false);
-}
-var chkDot = true;
-var usEmail = true;
-function validEmail(eAddr)
-{
- var lenSuffix = (usEmail) ? 4: 3;
- var goodAddr = false;
- var ndxAt = ndxDot = 0;
- ndxAt = eAddr.indexOf("@");
- ndxDot = eAddr.indexOf(".");
- ndxDot2 = eAddr.lastIndexOf(".");
-
- if ( (ndxDot < 0) || (ndxAt < 0) )
- return(goodAddr);//alert("Your email address lacks '.' or '@'.\n\nThe format is 'you@dom.suf'");
- else if (chkDot && (ndxDot < ndxAt) )
- chkDot =!( confirm("You entered a 'dot' before the '@'\n Are you sure that is right?"));
- else if ( (ndxDot2 - 3) <= ndxAt)
- return(goodAddr);//alert("You may be missing your domain name.\n\nThe format is 'you@dom.suf'");
- else if ( eAddr.length < (ndxDot2 + lenSuffix) )
- usEmail =!( confirm("You have fewer than 3 characters as a domain suffix.\nAre you sure that is right?"));
- else
- goodAddr = true;
-
-
- return (goodAddr);
-}
-
-
diff --git a/admin/wm.js b/admin/wm.js
deleted file mode 100644
index 7a7323e..0000000
--- a/admin/wm.js
+++ /dev/null
@@ -1,13 +0,0 @@
-function glm_open(o) {
- var x = (screen.width/2) - (o.width/2);
- var y = (screen.height/2) - (o.height/2);
- var args = "width="+o.width+",height="+o.height+",screenX="+x+",screenY="+y+",top="+y+",left="+x;
- if(o.scroll == true)
- args += ",scrollbars=1";
- //args += "\'";
- //alert(args);
- pow=window.open(o.url,o.name,args);
- //confirm(args);
- if (pow.opener == null)
- pow.opener = self;
-}
diff --git a/assets/TMP_slideshow_1.jpg b/assets/TMP_slideshow_1.jpg
new file mode 100755
index 0000000..31ebe62
Binary files /dev/null and b/assets/TMP_slideshow_1.jpg differ
diff --git a/assets/bg_body.jpg b/assets/bg_body.jpg
deleted file mode 100755
index fa985f1..0000000
Binary files a/assets/bg_body.jpg and /dev/null differ
diff --git a/assets/bg_footer.jpg b/assets/bg_footer.jpg
deleted file mode 100755
index 860ef58..0000000
Binary files a/assets/bg_footer.jpg and /dev/null differ
diff --git a/assets/bg_header.jpg b/assets/bg_header.jpg
deleted file mode 100755
index 20f1af9..0000000
Binary files a/assets/bg_header.jpg and /dev/null differ
diff --git a/assets/bg_matrix.gif b/assets/bg_matrix.gif
deleted file mode 100755
index ca72ff9..0000000
Binary files a/assets/bg_matrix.gif and /dev/null differ
diff --git a/assets/bg_matrix.jpg b/assets/bg_matrix.jpg
deleted file mode 100755
index 2e179d8..0000000
Binary files a/assets/bg_matrix.jpg and /dev/null differ
diff --git a/assets/btn_blue.jpg b/assets/btn_blue.jpg
new file mode 100755
index 0000000..afc5502
Binary files /dev/null and b/assets/btn_blue.jpg differ
diff --git a/assets/btn_green.jpg b/assets/btn_green.jpg
new file mode 100755
index 0000000..56e632f
Binary files /dev/null and b/assets/btn_green.jpg differ
diff --git a/assets/btn_yellow.jpg b/assets/btn_yellow.jpg
new file mode 100755
index 0000000..fc81aeb
Binary files /dev/null and b/assets/btn_yellow.jpg differ
diff --git a/assets/bullet.gif b/assets/bullet.gif
new file mode 100755
index 0000000..7d89e02
Binary files /dev/null and b/assets/bullet.gif differ
diff --git a/assets/fb.jpg b/assets/fb.jpg
new file mode 100755
index 0000000..7e99d5c
Binary files /dev/null and b/assets/fb.jpg differ
diff --git a/assets/flash1/trout_creek1.flv b/assets/flash1/trout_creek1.flv
deleted file mode 100644
index 8c24fce..0000000
Binary files a/assets/flash1/trout_creek1.flv and /dev/null differ
diff --git a/assets/flash1/trout_creek1.swf b/assets/flash1/trout_creek1.swf
deleted file mode 100644
index a8a8274..0000000
Binary files a/assets/flash1/trout_creek1.swf and /dev/null differ
diff --git a/assets/flash1/trout_creek2.swf b/assets/flash1/trout_creek2.swf
deleted file mode 100755
index 903fcff..0000000
Binary files a/assets/flash1/trout_creek2.swf and /dev/null differ
diff --git a/assets/header-pieces.jpg b/assets/header-pieces.jpg
deleted file mode 100755
index bc8f5be..0000000
Binary files a/assets/header-pieces.jpg and /dev/null differ
diff --git a/assets/logo.gif b/assets/logo.gif
new file mode 100755
index 0000000..c2c19df
Binary files /dev/null and b/assets/logo.gif differ
diff --git a/assets/newsletter/blog.jpg b/assets/newsletter/blog.jpg
deleted file mode 100644
index ccd3eb4..0000000
Binary files a/assets/newsletter/blog.jpg and /dev/null differ
diff --git a/assets/newsletter/enews.jpg b/assets/newsletter/enews.jpg
deleted file mode 100644
index 7a76761..0000000
Binary files a/assets/newsletter/enews.jpg and /dev/null differ
diff --git a/assets/newsletter/facebook.jpg b/assets/newsletter/facebook.jpg
deleted file mode 100644
index 83ebeec..0000000
Binary files a/assets/newsletter/facebook.jpg and /dev/null differ
diff --git a/assets/newsletter/leaves-flake.jpg b/assets/newsletter/leaves-flake.jpg
deleted file mode 100644
index cda03cd..0000000
Binary files a/assets/newsletter/leaves-flake.jpg and /dev/null differ
diff --git a/assets/newsletter/reservation.jpg b/assets/newsletter/reservation.jpg
deleted file mode 100644
index 648a728..0000000
Binary files a/assets/newsletter/reservation.jpg and /dev/null differ
diff --git a/assets/newsletter/specials.jpg b/assets/newsletter/specials.jpg
deleted file mode 100644
index a868f09..0000000
Binary files a/assets/newsletter/specials.jpg and /dev/null differ
diff --git a/assets/newsletter/top.jpg b/assets/newsletter/top.jpg
deleted file mode 100644
index 91c0c48..0000000
Binary files a/assets/newsletter/top.jpg and /dev/null differ
diff --git a/assets/newsletter/video.jpg b/assets/newsletter/video.jpg
deleted file mode 100644
index b0d5c71..0000000
Binary files a/assets/newsletter/video.jpg and /dev/null differ
diff --git a/assets/newsletter/what'snew.jpg b/assets/newsletter/what'snew.jpg
deleted file mode 100644
index dec2fed..0000000
Binary files a/assets/newsletter/what'snew.jpg and /dev/null differ
diff --git a/assets/res_bg.jpg b/assets/res_bg.jpg
new file mode 100755
index 0000000..46174d7
Binary files /dev/null and b/assets/res_bg.jpg differ
diff --git a/assets/rotating/01.jpg b/assets/rotating/01.jpg
deleted file mode 100755
index 834606e..0000000
Binary files a/assets/rotating/01.jpg and /dev/null differ
diff --git a/assets/rotating/02.jpg b/assets/rotating/02.jpg
deleted file mode 100755
index 4ffd82f..0000000
Binary files a/assets/rotating/02.jpg and /dev/null differ
diff --git a/assets/rotating/03.jpg b/assets/rotating/03.jpg
deleted file mode 100755
index f8c1e3f..0000000
Binary files a/assets/rotating/03.jpg and /dev/null differ
diff --git a/assets/rotating/04.jpg b/assets/rotating/04.jpg
deleted file mode 100755
index 51736a0..0000000
Binary files a/assets/rotating/04.jpg and /dev/null differ
diff --git a/assets/rotating/05.jpg b/assets/rotating/05.jpg
deleted file mode 100755
index bc6ef9e..0000000
Binary files a/assets/rotating/05.jpg and /dev/null differ
diff --git a/assets/rotating/06.jpg b/assets/rotating/06.jpg
deleted file mode 100755
index 69a4038..0000000
Binary files a/assets/rotating/06.jpg and /dev/null differ
diff --git a/assets/shadow-h.jpg b/assets/shadow-h.jpg
deleted file mode 100755
index cd74f66..0000000
Binary files a/assets/shadow-h.jpg and /dev/null differ
diff --git a/assets/shadow.jpg b/assets/shadow.jpg
deleted file mode 100755
index 2614896..0000000
Binary files a/assets/shadow.jpg and /dev/null differ
diff --git a/assets/shadowbot-h.jpg b/assets/shadowbot-h.jpg
deleted file mode 100755
index e1f2915..0000000
Binary files a/assets/shadowbot-h.jpg and /dev/null differ
diff --git a/assets/shadowbot.jpg b/assets/shadowbot.jpg
deleted file mode 100755
index 36ea953..0000000
Binary files a/assets/shadowbot.jpg and /dev/null differ
diff --git a/assets/shadowtop-h.jpg b/assets/shadowtop-h.jpg
deleted file mode 100755
index 6bc2abd..0000000
Binary files a/assets/shadowtop-h.jpg and /dev/null differ
diff --git a/assets/shadowtop.jpg b/assets/shadowtop.jpg
deleted file mode 100755
index 228ae5a..0000000
Binary files a/assets/shadowtop.jpg and /dev/null differ
diff --git a/assets/temp_newsphoto.jpg b/assets/temp_newsphoto.jpg
deleted file mode 100755
index c86d644..0000000
Binary files a/assets/temp_newsphoto.jpg and /dev/null differ
diff --git a/assets/temp_photo.jpg b/assets/temp_photo.jpg
deleted file mode 100755
index 4e3e295..0000000
Binary files a/assets/temp_photo.jpg and /dev/null differ
diff --git a/assets/video_bg.jpg b/assets/video_bg.jpg
new file mode 100755
index 0000000..2c96c6e
Binary files /dev/null and b/assets/video_bg.jpg differ
diff --git a/assets/video_overlay.png b/assets/video_overlay.png
new file mode 100755
index 0000000..5b4ac99
Binary files /dev/null and b/assets/video_overlay.png differ
diff --git a/cache/.cvsignore b/cache/.cvsignore
deleted file mode 100644
index 65fb5e5..0000000
--- a/cache/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-* *.*
diff --git a/cache/.keepme b/cache/.keepme
deleted file mode 100644
index e69de29..0000000
diff --git a/classes/class_db.inc b/classes/class_db.inc
deleted file mode 100755
index babc4a6..0000000
--- a/classes/class_db.inc
+++ /dev/null
@@ -1,755 +0,0 @@
-
- * @copyright 2009 Gaslight Media
- * @license Gaslight Media
- * @version CVS: $Id: class_db.inc,v 1.6 2009/11/10 20:13:30 jamie Exp $
- * @link <>
- */
-
-/**
- * Short description for class
- *
- * Long description (if any) ...
- *
- * @category Classes
- * @package GLM_DB
- * @author Steve Sutton
- * @copyright 2009 Gaslight Media
- * @license Gaslight Media
- * @version Release: @package_version@
- * @link <>
- */
-class GLM_DB
-{
- // {{{ Properties
-
- /**
- * host
- * string host database host server name
- *
- * @var mixed
- * @access public
- */
- protected $host;
- /**
- * dbname
- * string dbname name of the database
- *
- * @var mixed
- * @access public
- */
- protected $dbname;
- /**
- * user
- * string user The user to connect as
- *
- * @var mixed
- * @access public
- */
- protected $user;
- /**
- * password
- * string password The users password if any
- *
- * @var mixed
- * @access public
- */
- protected $password;
- /**
- * dbd
- * string dbd Database connection result ID#
- *
- * @var mixed
- * @access public
- */
- protected $dbd;
- /**
- * conn
- * string conn string postgres connection string default = CONN_STR
- *
- * @var mixed
- * @access public
- */
- protected $conn;
- /**
- * trans
- * boolean trans bool if true a transaction is in process
- *
- * @var mixed
- * @access public
- */
- protected $trans;
- /**
- * Result
- *
- * @var mixed
- * @access public
- */
- protected $Result;
-
- /**
- * Description for public
- * @var unknown
- * @access public
- */
- public $dbh;
- // }}}
- // {{{ GLM_DB()
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param unknown $conn Parameter description (if any) ...
- *
- * @return void
- * @access public
- */
- function GLM_DB($conn = CONN_STR)
- {
- $this->dbh = Toolkit_Database::getInstance();
- $this->host = "";
- $this->dbname = "";
- $this->user = "nobody";
- $this->password = "";
- $this->conn = $conn;
- $this->trans = 0;
- $this->dbd = "";
- }
-
- // }}}
- // {{{ db_auto_array()
-
- /** db_auto_get_array
- *
- * The auto function for retrieving an array based soley on a query
- * string. This function makes the connection, does the exec, fetches
- * the array, closes the connection, frees memory used by the result,
- * and then returns the array
- *
- * {@source }
- * @param $qs SQL query string
- * @param $i row number
- * @param $type PGSQL_ASSOC or PGSQL_BOTH or PSQL_NUM
- *
- * @returns array - Returns an associative array of key-value pairs
- * @access public
- */
-
- function db_auto_array($qs, $i, $type)
- {
- if (!$this->dbd) {
- $this->dbd =& $this->db_connect();
- }
- $res = $this->db_exec($qs);
- if (!$res) {
- return 0;
- }
- if ($this->db_numrows($res) == 0) {
- return 0;
- }
-
- $row = $this->db_fetch_array($res, $i, $type);
-
- if(!$this->db_freeresult($res)) {
- return 0;
- }
-
- return $row;
- }
-
- // }}}
- // {{{ db_auto_exec()
-
- /** db_auto_exec
- *
- * The auto function for executing a query.
- * This function makes the connection, does the exec, fetches
- * the array, closes the connection, frees memory used by the result,
- * and then returns success (not a valid result index)
- *
- * {@source }
- * @param $qs SQL query string
- * @returns int - Returns 1 for success 0 for failure
- * @access public
- */
-
- function db_auto_exec($qs)
- {
- $this->db_connect();
- if (!$this->dbd) {
- return 0;
- }
- if (!$this->db_exec( $qs)) {
- return 0;
- } else {
- return 1;
- }
- }
-
- // }}}
- // {{{ db_auto_get_data()
-
- /** db_auto_get_data
- *
- * The auto function for retrieving an array based soley on a query
- * string. This function makes the connection, does the exec, fetches
- * the array, closes the connection, frees memory used by the result,
- * and then returns the array.
- *
- * {@source }
- * @param string $qs SQL query string
- *
- * @returns mixed
- * @access public
- */
- function db_auto_get_data($qs)
- {
- if ($this->dbh) {
- return $this->dbh->query($qs)->fetchAll(PDO::FETCH_ASSOC);
- }
- if (!$this->dbd) {
- $this->db_connect();
- }
- if (!( $res = $this->db_exec( $qs))) {
- return false;
- }
- $totalrows = pg_NumRows( $res);
- for ($i = 0 ; $i < $totalrows ; $i++) {
- $data[$i] = $this->db_fetch_array ($res, $i, PGSQL_ASSOC);
- }
- if (isset( $data) && $data != "") {
- return $data;
- } else {
- return 0;
- }
- }
-
- // }}}
- // {{{ db_close()
-
- /** db_close
- *
- * Closes the connection to database specified by the handle dbd
- * returns a boolean for success
- *
- * {@source }
- * @returns bool - Returns 1 on success 0 if dbd is not a valid connection
- * @access public
- */
-
- function db_close()
- {
- switch (DB_TYPE) {
- case "postgres":
- pg_close($this->dbd);
- break;
- default:
- return false;
- }
- }
-
- // }}}
- // {{{ db_connect()
-
- /**
- * db_connect
- *
- * Creates a connection to database specified $conn_str,
- * and returns a boolean for success.
- *
- * @uses GLM_DB::$dbd
- * @uses GLM_DB::$conn
- * @uses GLM_DB::$dbname
- * @uses GLM_DB::$host
- * @uses GLM_DB::$user
- * @uses GLM_DB::$password
- * {@source }
- * @returns int
- * @access public
- */
-
- function db_connect()
- {
- if (isset( $this->dbd) && $this->dbd != "") {
- return $this->dbd;
- }
- switch (DB_TYPE) {
- case "postgres":
- if ($this->host == '' && $this->dbname == '') {
- $conn = $this->conn;// CONN_STR;
- } else {
- $conn .= ($this->host != '') ? 'host='.$this->host.' ' : '';
- $conn .= ($this->dbname != '') ? 'dbname='.$this->dbname.' ' : '';
- $conn .= ($this->user != '') ? 'user='.$this->user." " : '';
- $conn .= ($this->password != '') ? "password=".$this->password : '';
- }
- if (!$this->dbd = pg_connect($conn)) {
- echo pg_errormessage($conn);
- }
- break;
-
- default:
- return 0;
- break;
- }
- return $this->dbd;
- }
-
- // }}}
- // {{{ db_exec()
-
- /** db_exec
- *
- * Execute an SQL query, * returning a valid result index or zero(0) on
- * failure.
- *
- * {@source }
- * @param $qs -- SQL query string
- * @returns int Returns a valid result index on success 0 on failure
- * @access public
- */
- function db_exec($qs)
- {
- if (!$this->dbd) {
- $this->dbd = $this->db_connect();
- }
- switch (DB_TYPE) {
- case "postgres":
- if(!$ret = pg_exec($this->dbd, $qs)) {
- echo "".$qs." ";
- }
- break;
- default:
- return false;
- }
- return $ret;
- }
-
- // }}}
- // {{{ db_fetch_array()
-
- /** db_fetch_array
- *
- * Stores the data in associative indices, using the field names as
- * keys.
- *
- * {@source }
- * @param $res -- valid database result index
- * @param $i -- row number
- * @param $type -- PGSQL_ASSOC,PGSQL_BOTH,PGSQL_NUM
- * @returns array Returns an associative array of key-value pairs
- * @access public
- */
-
- function db_fetch_array($res, $i, $type)
- {
- switch (DB_TYPE) {
- case "postgres":
- $row = pg_fetch_array($res, $i, $type);
- break;
-
- default:
- return false;
- }
- return $row;
- }
-
- // }}}
- // {{{ db_freeresult()
-
- /** db_freeresult
- *
- * Free result memory.
- *
- * {@source }
- * @param $res -- valid database result index
- * @returns bool - Returns 1 for success 0 for failure
- * @access public
- */
-
- function db_freeresult($res)
- {
- switch (DB_TYPE) {
- case "postgres":
- $ret = pg_freeresult($res);
- break;
-
- default:
- return false;
- }
- return $ret;
- }
-
- // }}}
- // {{{ db_numrows()
-
- /** db_numrows
- *
- * Determine number of rows in a result index
- *
- * {@source }
- * @param $res -- valid database result index
- * @returns int - Returns number of rows
- * @access public
- */
-
- function db_numrows($res)
- {
- switch (DB_TYPE) {
- case "postgres":
- $ret = pg_numrows($res);
- break;
-
- default:
- return -1;
- }
- return $ret;
- }
-
- // }}}
- // {{{ delete()
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param unknown $table Parameter description (if any) ...
- * @param unknown $condition Parameter description (if any) ...
- * @return unknown Return description (if any) ...
- * @access public
- */
- function delete($table, $condition)
- {
- return $this->pgsql_delete($table, $condition);
- }
-
- // }}}
- // {{{ insert()
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param unknown $table Parameter description (if any) ...
- * @param unknown $data Parameter description (if any) ...
- * @param unknown $primary_key Parameter description (if any) ...
- * @param unknown $sequence Parameter description (if any) ...
- * @return unknown Return description (if any) ...
- * @access public
- */
- function insert($table, $data, $primary_key, $sequence)
- {
- return $this->pgsql_insert($table, $data, $primary_key, $sequence);
- }
-
- // }}}
- // {{{ pgsql_convert()
-
- /**
- * pgsql_convert
- *
- * converts an array (like _POST) and verifies field types to use in insert or update of postgres table
- *
- * @param mixed $table
- * @param mixed $data
- * @access public
- * @return string
- */
- function pgsql_convert($table, $data)
- {
- $query = "select a.attname, format_type(a.atttypid, a.atttypmod)
- from pg_class c, pg_attribute a
- where c.relname = '$table'
- and a.attnum > 0 and a.attrelid = c.oid
- order by a.attnum";
- if ($mData = $this->db_auto_get_data($query)) {
- foreach ($mData as $mRow) {
- $meta_data[$mRow['attname']] = $mRow['format_type'];
- }
- }
- if (is_array($data)) {
- foreach ($data as $field => $val) {
- if ($meta_data[$field]) {
- switch ($meta_data[$field]) {
- case "integer":
- case "double precision":
- if ($val == '') {
- $proc_data[$field] = 'NULL';
- } elseif (is_numeric( $val)) {
- $proc_data[$field] = $val;
- } else{
- die('value for field (int)'.$field.' is not a number');
- }
- break;
- case "boolean":
- if ($val == '') {
- $proc_data[$field] = 'NULL';
- } elseif ($val == 'f' || $val == 't') {
- $proc_data[$field] = "'".$val."'";
- } else{
- die('value for field (boolean)'.$field.' is not a boolean');
- }
- break;
- case "text":
- // maybe check to see that the text is being slashed if not then prepare it for postgres
- $text = addslashes( stripslashes( trim( $val)));
- $proc_data[$field] = "'$text'";
- break;
- case "date":
- if (preg_match( "/([0-9]{1,2})[\/-]?([0-9]{1,2})[\/-]?([0-9]{2,4})|/", $val)) {
- $proc_data[$field] = "'".$val."'";
- } else{
- die('value for field (date)'.$field.' is not a date');
- }
- break;
- default:
- die('need case for this name:'.$field.' type: '.$meta_data[$field]);
- break;
- }
- } else{
- die('Error no field named '.$field.' exist in '.$table);
- }
- }
- } else{
- return false;
- }
- return $proc_data;
- }
-
- // }}}
- // {{{ pgsql_delete()
-
- /**
- * pgsql_delete
- *
- * @param mixed $table
- * @param mixed $condition
- * @access public
- * @return string
- */
- function pgsql_delete($table, $condition)
- {
- reset($condition);
- $cKey = key($condition);
- $query = "delete from $table where ";
- $query .= $cKey;
- $query .= " = ".$condition[$cKey];
- return $this->db_exec( $query);
- }
-
- // }}}
- // {{{ pgsql_insert()
-
- /**
- * pgsql_insert
- *
- * @param mixed $table
- * @param mixed $data
- * @param mixed $primary_key
- * @param mixed $sequence
- * @access public
- * @return string
- */
- function pgsql_insert($table, $data, $primary_key, $sequence)
- {
- $converted = $this->pgsql_convert($table, $data);
- if ($res = $this->db_exec("select nextval('$sequence') as $primary_key")) {
- $insert_data = $this->db_fetch_array( $res, 0, PGSQL_ASSOC);
- $insert_id = $insert_data[$primary_key];
- } else {
- die('returned no insert_id');
- }
- $query = "INSERT INTO $table ($primary_key,".implode(",",array_keys( $converted)).") values ($insert_id,".implode(",",array_values( $converted)).")";
- if ($res = $this->db_exec($query)) {
- $this->insert_id = $insert_id;
- return $insert_id;
- } else {
- echo $query;
- die('error');
- }
- }
-
- // }}}
- // {{{ pgsql_select()
-
- /**
- * pgsql_select
- *
- * @param mixed $query
- * @access public
- * @return string
- */
- function pgsql_select($query)
- {
- return $this->db_auto_get_data( $query);
- }
-
- // }}}
- // {{{ pgsql_update()
-
- /**
- * pgsql_update
- *
- * @param mixed $table
- * @param mixed $data
- * @param mixed $condition
- * @access public
- * @return string
- */
- function pgsql_update($table, $data, $condition)
- {
- $converted = $this->pgsql_convert($table, $data);
- foreach ($converted as $key => $value) {
- $q_parts[] = "$key = $value";
- }
- reset($condition);
- $cKey = key($condition);
- if (is_array($converted)) {
- $query = "update $table set ";
- if (is_array($q_parts)) {
- $query .= implode(",",$q_parts);
- }
- $query .= " where ";
- $query .= $cKey;
- $query .= " = ".$condition[$cKey];
- }
- $this->db_exec($query);
- }
-
- // }}}
- // {{{ select()
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param unknown $query Parameter description (if any) ...
- * @return unknown Return description (if any) ...
- * @access public
- */
- function select($query)
- {
- return $this->db_auto_get_data($query);
- }
-
- // }}}
- // {{{ trans_end()
-
- /** trans_end
- *
- * Commit the postgres transaction
- *
- * {@source }
- * @returns bool true if successful
- * @access public
- */
- function trans_end()
- {
- if (!$this->trans) {
- if(!$this->db_exec("COMMIT WORK;")) {
- return false;
- } else{
- return true;
- }
- } else{
- return false;
- }
- }
-
- // }}}
- // {{{ trans_exec()
-
- /** trans_exec
- *
- * exec a postgres query in a
- * postgres transaction
- *
- * {@source }
- * @param string query
- * @access public
- */
- function trans_exec($query)
- {
- if ($query != "") {
- if(!$ret = $this->db_exec($query)) {
- $this->db_exec("ABORT WORK;");
- return false;
- } else {
- return $ret;
- }
- } else {
- return false;
- }
- }
-
- // }}}
- // {{{ trans_start()
-
- /** trans_start
- *
- * Start a postgres transaction
- *
- * {@source }
- * @returns bool true if sucessful
- * @access public
- */
- function trans_start()
- {
- if (!$this->trans) {
- if (!$this->dbd = $this->db_connect()) {
- $this->trans = false;
- return false;
- } else {
- $this->db_exec("BEGIN WORK;");
- $this->trans = true;
- return true;
- }
- } else {
- return true;
- }
- }
-
- // }}}
- // {{{ update()
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param unknown $table Parameter description (if any) ...
- * @param unknown $data Parameter description (if any) ...
- * @param unknown $condition Parameter description (if any) ...
- * @return unknown Return description (if any) ...
- * @access public
- */
- function update($table, $data, $condition)
- {
- return $this->pgsql_update($table, $data, $condition);
- }
-
- // }}}
-}
-?>
diff --git a/classes/class_template.inc b/classes/class_template.inc
deleted file mode 100644
index ee71a56..0000000
--- a/classes/class_template.inc
+++ /dev/null
@@ -1,2915 +0,0 @@
-
- * $Id: class_template.inc,v 1.41 2010/01/29 15:27:58 jamie Exp $
- * NOTE: for the search engine freindly url's use .htaccess file.
- * need to make sure .htaccess is enabled or this work work
- * to turn off seo url's set define SEO_URL to 0 in setup file
- * NOTE: make sure you redo the www.domain.com lines in the .htaccess file
- * need to set it up before testing with it.
- *
- *
- * For the page title and meta tags make a $title and $meta vars depending on
- * weather or not it is the home page.
- *
- *
- * @package Toolbox Library
- * @subpackage Template Library
- * @category Template
- * @author Steve Sutton
- * @copyright 2007
- * @version $Revision: 1.41 $
- * @since $Date: 2010/01/29 15:27:58 $
- * @todo update the phpdocs for all classes
- * @todo add title for all the navigation links if and only if they have page title
- * @todo some tutorial in the docs for how to set things up.
- */
-class GLM_TEMPLATE
-{
- // {{{ properties
-
- /**
- * The category id for the page
- * @var integer
- * @access public
- */
- public $catid;
-
- /**
- * The postgres database handler
- * @var object
- * @access public
- */
- public $DB;
-
- /**
- * The starting style for the header
- *
- * class="content" should not be used anymore
- *
- * @var string
- * @access protected
- */
- protected $header_begin = '';
-
- /**
- * The ending style for the header
- * @var string header_end
- * @access protected
- */
- protected $header_end = ' ';
-
- /**
- * The starting style for the sub header
- * @var string
- * @access protected
- */
- protected $subheader_begin = '';
-
- /**
- * The ending style for the sub header
- * @var string
- * @access protected
- */
- protected $subheader_end = ' ';
-
- /**
- * The starting position for images
- *
- * @var string
- * @access protected
- */
- protected $img_align = 'left';
-
- /**
- * Whether to alternate the images or not
- *
- * for alternating images set to 1 else leave alone
- *
- * @var string
- * @access protected
- */
- protected $img_alternate = 1;
-
- /**
- * The path to the image directory
- * @var string
- * @access protected
- */
- protected $img_size;
-
- /**
- * The category array
- * @var array
- * @access protected
- */
- protected $data;
-
- /**
- * The items array
- * @var array
- * @access protected
- */
- protected $items;
-
- /**
- * @var string type The type
- */
- protected $type;
-
- /**
- * Used for menu generation
- * @var string whole_thread The thread string
- */
- protected $whole_thread = null;
-
- /**
- * Used for menu generation
- * @var integer thread_count The thread count
- */
- protected $thread_count = 1;
-
- /**
- * @var array $pages
- * @access protected
- */
- protected $pages;
-
- /**
- * adds active = 't' to queries only if ACTIVE_FLAG is set to true
- * @var string
- * @access protected
- */
- protected $active_query;
-
- /**
- * determines page layout
- * @var integer
- * @access protected
- */
- protected $template;
-
- /**
- * Page extension for php pages .php or .phtml
- * @var string
- * @access protected
- */
- protected $php_ext = '.php';
-
- // }}}
- // {{{ __construct()
-
- /**
- * GLM_TEMPLATE
- *
- * @param mixed $catid current page category id
- * @param mixed $DB Object passed from GLM_DB if done
- * @access public
- * @return string
- */
- function __construct($catid, $DB = NULL)
- {
- // set the cache option from $GLOBALS
- $this->cacheOptions = $GLOBALS['cacheOptions'];
- // redo the cachDir
- $this->cacheOptions['cacheDir'] = BASE . 'cache/';
- // create a new instance of Cache_Lite
- $this->cache =& new Cache_Lite($this->cacheOptions);
- $this->catid = $this->get_catid($catid);
- // using a reference to $DB (should be started on setup.phtml
- $this->set_DB(&$DB);
- // switching to $GLOBALS['dbh']
- $this->dbh = Toolkit_Database::getInstance();
- // used for cvb's
- $this->Member = $this->set_member();
- // img_size are RESIZED, MIDSIZED, THUMB do not use ORIGINAL
- $this->img_size = RESIZED;
-
- $this->set_body_tag();
- // Uses the PAGE array set in setup.phtml
- $this->set_pages(&$GLOBALS['PAGES']);
- // tell if page is active, deleted or inactive
- $this->page_status($catid);
- // set active query string
- $this->set_active_query();
- }
-
- // }}}
-
- // {{{ build_picklist()
-
- /**
- * build_picklist:
- * @param string $fieldname:
- * @param array $data:
- * @param mixed $selected:
- * @param string $type = "standard":
- * @param boolean $auto = 0:
- * @param integer $width = NULL :
- *
- * @uses GLM_TOOLBOX::build_picklist()
- *
- * @return string
- * @access public
- */
- function build_picklist( $fieldname, $data, $selected, $type = "standard",$auto = 0,$width = NULL )
- {
- return GLM_TOOLBOX::build_picklist( $fieldname, $data, $selected, $type = "standard",$auto = 0,$width = NULL );
- }
-
- // }}}
-
- // {{{ clean_text()
-
- /**
- * clean_text:get rid of single br or p br tags left from htmlarea when textarea is empty.
- * @param string $output:
- *
- * @return string text cleaned
- * @access public
- **/
- function clean_text($output)
- {
- $output = str_replace(" "," ",$output);
- $output = str_replace("
","",$output);
- return $output;
- }
-
- // }}}
- // {{{ convert_to_thread()
-
- /**
- * convert_to_thread:
- *
- * @param array $threads:
- * @param array $thread:
- * @uses GLM_TEMPLATE::$thread_count
- * @uses GLM_TEMPLATE::$whole_thread
- * @uses GLM_TEMPLATE::get_seo_url()
- * @uses GLM_TEMPLATE::convert_to_thread()
- *
- * @return string
- * @access public
- */
- function convert_to_thread($threads, $thread)
- {
- foreach($thread as $parent=>$value) {
- $this->whole_thread .= str_repeat(".",$this->thread_count);
- $this->whole_thread .= "|".htmlentities($value['category'],ENT_QUOTES,'UTF-8');
- $url = $this->get_seo_url( $value['id'] );
- $this->whole_thread .= "|$url";
- $this->whole_thread .= "\n";
- if ($threads[$parent]) {
- $this->thread_count++;
- GLM_TEMPLATE::convert_to_thread($threads, $threads[$parent]);
- }
- }
- $this->thread_count--;
- return $this->whole_thread;
- }
-
- // }}}
-
- // {{{ has_children()
-
- /**
- * has_children: return true or false if this category has sub categories under it.
- *
- * @param integer $catid:
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return string
- * @access public
- */
- function has_children($catid)
- {
- // returns number of children that $catid has
- $qs = "
- SELECT count(*)
- FROM bus_category
- WHERE parent = $catid {$this-> active_query}";
- $row=$this->DB->db_auto_get_data($qs);
- return $row[0]['count'];
- }
-
- // }}}
- // {{{ has_subs()
-
- /**
- * has_subs:
- * @param integer $catid:
- * @param object $DB:
- *
- * @uses GLM_TEMPLATE::$active_query
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return string
- * @access public
- */
- function has_subs($catid, &$DB)
- {
- $sql = "
- SELECT id
- FROM bus_category
- WHERE parent = $catid {$this->active_query}
- ORDER BY pos";
- $data = $DB->db_auto_get_data($sql);
- return is_array($data);
- }
-
- // }}}
-
- // {{{ get_all()
-
- /**
- * get_all:Does the query and set_data calls boths arrays
- *
- * @uses GLM_TEMPLATE::set_data()
- * @uses GLM_TEMPLATE::$data
- * @uses GLM_TEMPLATE::$items
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return void
- * @access public
- **/
- function get_all($type = NULL)
- {
- $catid = $this->catid;
- if ($type == 1 || !$type) {
- $cat_query = "
- SELECT *
- FROM bus_category
- WHERE id = $catid
- ORDER BY pos";
- try {
- $res = $this->set_data($this->dbh->query($cat_query)->fetchAll());
- $this->data = $res[0];
- } catch(PDOException $e) {
- echo ''.print_r($e, true).' ';
- die($e->getMessage());
- }
- }
- //$this->img_size = MIDSIZED;
- //$this->img_size = RESIZED;
- if ($type == 2 || !$type) {
- $item_query = "
- SELECT b.*
- FROM bus b
- LEFT OUTER JOIN bus_category_bus bcb ON (bcb.busid = b.id)
- WHERE bcb.catid = $catid
- ORDER BY bcb.pos";
- try {
- $this->items = $this->set_data($this->dbh->query($item_query)->fetchAll());
- } catch(PDOException $e) {
- echo ''.print_r($e, true).' ';
- die($e->getMessage());
- }
- $file_query = "
- SELECT *
- FROM files
- WHERE bus_id IN ( SELECT bus_id FROM bus_category_bus
- WHERE catid = ".$this->catid." )
- ORDER BY bus_id,pos;";
- try {
- $file_data = $this->DB->db_auto_get_data($file_query);
- } catch(PDOException $e) {
- echo ''.print_r($e, true).' ';
- die($e->getMessage());
- }
- if (is_array($file_data)) {
- foreach ($file_data as $file_row) {
- $this->item_files[$file_row['bus_id']][] = GLM_TEMPLATE::set_file( $file_row['filename'],$file_row['urltext'] );
- }
- }
- }
- }
-
- // }}}
- // {{{ get_ancestors()
-
- /**
- * get_ancestors:get the ancestors for this category
- *
- * @param integer $catid: catid
- * @param integer $count: starting counter
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return array
- * @access public
- */
- function get_ancestors($catid, $count)
- {
- if ($count == 0 ) {
- unset ($this->ancestors);
- }
-
- if ($catid) {
- $query = "
- SELECT id,category,parent
- FROM bus_category
- WHERE id = ".$catid."
- ".$this->active_query;
-
- $res = $this->DB->db_auto_get_data($query);
- $id = $res[0]['id'];
- $parent = $res[0]['parent'];
- $category = $res[0]['category'];
- $this->ancestors[$count]['id'] = $id;
- $this->ancestors[$count]['label'] = $category;
-
- $url = $this->get_seo_url( $id );
- $this->ancestors[$count]['link'] = $url;
- GLM_TEMPLATE::get_ancestors($parent,$count+1);
-
- return array_reverse($this->ancestors);
- }
- }
-
- // }}}
- // {{{ get_base_url()
-
- /**
- * get_base_url: generate the base of the url for the given category id
- * @param integer $id :
- *
- * @return string
- * @access public
- */
- function get_base_url($id)
- {
- if ($this->pages[$id]) {
- $page = $this->pages[$id];
- } else {
- $page = $this->pages['default'];
- }
- if ($GLOBALS['GLM_SERVER_ID'] == 'ws1.gaslightmedia.com' &&
- $this->catid == 1) {
- $page = '';
- }
- return $page;
- }
-
- // }}}
- // {{{ get_bottom_banner()
-
- function get_bottom_banner(){
- $banner = new BANNER_ADS();
- $banner->get_banners();
- $out = $banner->show_banners();
- return $out;
- }
-
- // }}}
- // {{{ get_bottom_nav()
-
- /**
- * get_bottom_nav: generate a top level only bottom navigation for the pages.
- *
- * @param integer $parent=0:
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return string
- * @access public
- */
- function get_bottom_nav($parent=0)
- {
- $out = '';
- $query = "select id,category,intro from bus_category where id != 1 and parent = $parent ".$this->active_query." order by pos asc";
- $row = $this->DB->db_auto_get_data( $query );
- $url = $this->get_seo_url( HOME_ID );
- $links[] = 'Home ';
- if (!is_array( $row ) ) {
- return false;
- } else {
- $out .= '';
- for ($i = 0; $i < sizeof($row); $i++) {
- $category = htmlentities(strip_tags($row[$i]['category']),ENT_QUOTES,'UTF-8');
- $url = $this->get_seo_url( $row[$i]['id'] );
- $links[] = '
'.$category." \n";
- }
- if (is_array($links)) {
- $out .= implode(" | ",$links);
- }
- $out .= '
';
- return $out;
- }
- }
-
- // }}}
- // {{{ get_bread_crumbs()
-
- /**
- * get_bread_crumbs
- *
- * @param mixed $catid
- * @access public
- * @return string
- */
- function get_bread_crumbs($catid)
- {
- $string = $this->get_ancestors($catid, 0);
- $isMemberProfilePage = ( isset($_GET['member_id'])
- && ctype_digit($_GET['member_id']));
- if (is_array($string)) {
- // adjust end if we have a profile page so we can last search
- // page as link.
- $end = $isMemberProfilePage ? count($string) : count($string) - 1;
- if ($this->catid != HOME_ID) {
- $outarray[] = 'Home ';
- }
- for($i = 0; $i < $end; ++$i) {
- $outarray[] = ''.$string[$i]["label"].' ';
- }
- if ( isset($_GET['photo_catid'])
- && defined('PHOTO_GALLERY')
- && PHOTO_GALLERY
- && ctype_digit($_GET['photo_catid'])
- ) {
- // user is now in a photo gallery albumn.
- // need to update the breadcrumbs for this.
- $currPageUri = $this->get_seo_url($catid);
- $currPageLabel = $this->get_catheader($catid, &$this->DB);
-
- $outarray[] = ''.$currPageLabel.' ';
-
- $sql = "
- SELECT category
- FROM photo_category
- WHERE id = :id";
-
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(':id', $_GET['photo_catid'], PDO::PARAM_INT);
- $stmt->execute();
- $stmt->bindColumn('category', $photoCategory);
- $stmt->fetch();
-
- $outarray[] = $photoCategory;
- } else {
- if (!$isMemberProfilePage) {
- $outarray[] = $this->get_catheader($catid, &$this->DB);
- } else {
- // Is a member profile page, attach member name to end
- // of breadcrumbs
- $sql = "
- SELECT member_name
- FROM member
- WHERE member_id = :mid";
-
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(':mid', $_GET['member_id'], PDO::PARAM_INT);
- $stmt->execute();
- $stmt->bindColumn('member_name', $memberName);
- $stmt->fetch();
-
- $outarray[] = $memberName;
- }
- }
- $out = '';
- if (is_array($outarray) && count($outarray) > 1) {
- $out .= implode(" > ", $outarray);
- }
- if ($out) {
- $return = ''.$out.'
';
- }
- }
- return $return;
- }
-
- // }}}
- // {{{ get_category()
-
- /**
- * get_category: grab just category contents
- * @param integer $catid: id of bus_category
- * @param object $DB:
- * @param boolean $showimg=1: weather or not to show category image
- * @uses DELUXE_TOOLBOX
- * @uses HOME_PAGE_EVENTS
- * @uses GLM_TEMPLATE::clean_text()
- * @uses GLM_TEMPLATE::get_home_events()
- *
- * @return string $output
- * @access public
- **/
- function get_category($showimg = 1, $showdiv = 1)
- {
- if ($pageContent = $this->cache->get('page-'.$this->catid, 'Toolbox')) {
- $sql = "
- SELECT intro
- FROM bus_category
- WHERE id = :id";
- try {
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $this->catid, PDO::PARAM_INT);
- $stmt->execute();
- $this->data['intro'] = $this->set_header($stmt->fetchColumn());
- } catch(PDOException $e) {
- Toolkit_Common::handleError($e);
- }
- return $pageContent;
- } else {
- if (DELUXE_TOOLBOX) {
- $this->get_template("cat");
- }
- if (!$this->data) {
- $this->get_all(1);
- }
- $data = $this->data;
- // Setup the section_links boolean var so section links only
- // show up on correct pages.
- $this->section_links = ($data['section_links'] == 't');
- if ( !$data["image"]
- && !$data["description"]
- && !$data["intro"] &&
- ($this->catid != 1 && HOME_PAGE_EVENTS != true)
- ) {
- return false;
- }
-
- $output = '';
- if ($showdiv == 1) {
- $output .= '';
- }
-
- if ($this->catid == 1 && HOME_PAGE_EVENTS ) {
- $output .= $this->get_home_events();
- }
-
- if ($data["image"] || $data["description"] || $data["intro"]) {
- // $output .= $data["intro"] . ' ';
- if ($showimg == 1) {
- $output .= $data["image"] . ' ';
- }
- $output .= $data["description"] . ' ';
- }
-
- if ($showdiv == 1) {
- $output .= '
';
- }
- $output = GLM_TEMPLATE::clean_text($output);
- $this->cache->save($output, 'page-'.$this->catid, 'Toolbox');
- return $output;
- }
-
- }
-
- // }}}
- // {{{ get_category_name()
-
- /**
- * getCategoryName:
- * used mostly for getting category name for search engine friendly url's
- *
- * @param integer $id:
- * @param string $table:
- * @param object &$DB :
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return void
- * @access public
- */
- function get_category_name( $id, $table,&$DB )
- {
- if (!is_numeric($id)) {
- return false;
- }
- if ($table == "class_category") {
- $category = "name";
- } else {
- $category = "category";
- }
- $query = "
- SELECT {$category}
- FROM {$table}
- WHERE id = :id";
- try {
- $stmt = $this->dbh->prepare($query);
- $stmt->bindParam(":id", $id, PDO::PARAM_INT);
- $stmt->execute();
- $data = $stmt->fetchAll();;
- } catch(PDOException $e) {
- echo ''.print_r($e, true).' ';
- die($e->getMessage());
- }
- if (is_array($data)) {
-
- $add = '-'.$id;
- if ($data[0]['category']) {
- $category = $data[0]['category'].$add;
- } elseif ($data[0]['name']) {
- $category = $data[0]['name'].$add;
- } else {
- $category = $add;
- }
- return htmlspecialchars($category);
- }
- }
-
- // }}}
- // {{{ get_catheader()
-
- /**
- * get_catheader:output the category name.
- *
- * @param integer $catid: The catid for the page
- * @param object $DB: db obj
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return void
- * @access public
- */
- function get_catheader($catid,$DB)
- {
- $query = "SELECT category FROM bus_category WHERE id = $catid";
- $data = $DB->db_auto_get_data($query);
- if ($data[0]['category']!="") {
- $header = strip_tags($data[0]['category']);
- } else {
- $header = '';
- }
- return $header;
- }
-
- // }}}
- // {{{ get_catid()
-
- /**
- * get_catid: setting catid for class
- *
- * We should be using the $_POST or $_GET globals here
- *
- * @return int catid
- * @access public
- **/
- function get_catid($catid)
- {
- if (is_numeric($_GET['catid'])) {
- return $_GET['catid'];
- } elseif (is_numeric($_POST['catid'])) {
- return $_POST['catid'];
- } else {
- return $this->catid = $catid;
- }
- }
-
- // }}}
- // {{{ get_catintro()
-
- /**
- * get_catintro: return the category page name.
- *
- * @param integer $catid: The catid for the page
- * @param object $DB: db obj
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return void
- * @access public
- */
- function get_catintro($catid)
- {
- $query = "SELECT intro FROM bus_category WHERE id = $catid";
- $data = $this->DB->db_auto_get_data($query);
- if ($data[0]['intro']!="") {
- $header = strip_tags($data[0]['intro']);
- } else {
- $header = '';
- }
- return $header;
- }
-
- // }}}
- // {{{ get_distance_from_traverse()
-
- function get_distance_from_traverse( $zipcode ){
- if (is_numeric( $zipcode ) ){
- // zipcode for search is 49684
- $tlat = (float)44.77329;
- $tlon = (float)-85.70123;
- $zipDB =& new GLM_DB();
- $zipDB->host = 'ds1';
- $zipDB->dbname = 'zip';
- $zipDB->pgsql_select( "BEGIN WORK;" );
- $query = "
- SELECT lat, lon, city, state_name
- FROM zip
- WHERE zipcode = '$zipcode'
- order by city_type desc limit 1 offset 0;";
- if ($data = $zipDB->pgsql_select( $query ) ){
- $lat = (float)$data[0]['lat'];
- $lon = (float)$data[0]['lon'];
- $city = $data[0]['city'];
- $state = $data[0]['state_name'];
- }
-
- $temp = "(pow(sin( ( ( $tlat * pi()/180.0 ) - ( $lat * pi()/180.0 )) /2.0),2) + cos( ( $lat * pi()/180.0 )) * cos( ( $tlat * pi()/180.0 ) ) * pow(sin( ( ( $tlon * pi()/180.0 ) - ( $lon * pi()/180.0 )) /2.0),2))";
- $query = "select ceil(3956 * 2 * atan2(sqrt($temp ),sqrt(1- ($temp) ))) as distance";
- if ($zip_data = $zipDB->pgsql_select( $query ) ){
- $zipDB->pgsql_select( "ABORT WORK;" );
- $zdata['remote_addr'] = $_SERVER['REMOTE_ADDR'];
- $zdata['zipcode'] = $zipcode;
- $zdata['city'] = $city;
- $zdata['state'] = $state;
- $this->DB->pgsql_insert( 'zip_dist_form', $zdata, 'zip_dist_form_id', 'zip_dist_form_zip_dist_form_id_seq', true );
- return $zip_data[0]['distance'];
- }
- }
- }
-
- // }}}
- // {{{ get_event_date()
-
- /**
- * get_event_date: make the event date human readable
- * @param string $sdate: start date
- * @param string $edate: end date
- * @param string $dateType: dateType Postgres,etc
- *
- * @return string
- * @access public
- */
- function get_event_date($sdate,$edate,$dateType)
- {
- switch($dateType) {
- case "Postgres":
- if (preg_match("/([0-9]{1,2})[/-]([0-9]{1,2})[/-]([0-9]{4})/",$sdate,$spt)) {
- $mon = $spt[1];
- $day = $spt[2];
- $yr = $spt[3];
- }
-
- if (preg_match("/([0-9]{1,2})[/-]([0-9]{1,2})[/-]([0-9]{4})/",$edate,$ept)) {
- $mon2 = $ept[1];
- $day2 = $ept[2];
- $yr2 = $ept[3];
- }
- break;
-
- case "timestamp":
- $mon = date("m",$sdate);
- $day = date("d",$sdate);
- $yr = date("Y",$sdate);
- $mon2 = date("m",$edate);
- $day2 = date("d",$edate);
- $yr2 = date("Y",$edate);
- break;
-
- }
-
- $start = mktime(0,0,0,$mon,$day,$yr);
- $end = mktime(0,0,0,$mon2,$day2,$yr2);
- if ($day == $day2 && $mon == $mon2 && $yr == $yr2) {
- $dateparam = "M j, Y";
- $date_begin = date($dateparam, $start) ;
- $date_end = "";
- } elseif ($day == $day2 AND $mon == $mon2 AND $yr != $yr2) {
- $dateparam1 = "M j, Y -";
- $dateparam2 = "Y";
- $date_begin = date($dateparam1, $start);
- $date_end = date($dateparam2, $end);
- } elseif ($day != $day2 AND $mon == $mon2 AND $yr == $yr2) {
- $dateparam1 = "M j -";
- $dateparam2 = "j, Y";
- $date_begin = date($dateparam1, $start);
- $date_end = date($dateparam2, $end);
- } elseif ($day != $day2 AND $mon == $mon2 AND $yr != $yr2) {
- $dateparam1 = "M j, Y -";
- $dateparam2 = "M j, Y";
- $date_begin = date($dateparam1, $start);
- $date_end = date($dateparam2, $end);
- } elseif ($yr == $yr2) {
- $dateparam1 = "M j -";
- $dateparam2 = "M j, Y";
- $date_begin = date($dateparam1, $start);
- $date_end = date($dateparam2, $end);
- } else {
- $dateparam1 = "M j, Y -";
- $dateparam2 = "M j, Y";
- $date_begin = date($dateparam1, $start);
- $date_end = date($dateparam2, $end);
- }
-
- return $date_begin." ".$date_end;
- }
-
- // }}}
- // {{{ get_headlines()
- function get_headlines(){
- $headlines = array();
- $query = "
- SELECT id,intro,feature_intro,description,image
- FROM bus_category
- WHERE featured = 't'
- AND active = 't'
- ORDER BY parent,pos;";
- if( $data = $this->DB->pgsql_select( $query ) ){
- foreach( $data as $row ){
- $headlines[] = array(
- 'href' => $this->get_seo_url($row['id']),
- 'img' => ($row['image']) ? THUMB . $row['image']: '',
- 'header' => $row['feature_intro'],
- 'descr' => GLM_TOOLBOX::make_teaser($row['description'], 150, true));
- }
- }
- return $headlines;
- }// }}}
- // {{{ get_home_events()
- /**
- * get_home_events: get events flaged as home events
- * @param object $DB: DB reference to DB obj
- *
- * @uses GLM_TEMPLATE::get_event_date()
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return void
- * @access public
- **/
- public function get_home_events($limit = 3)
- {
- $query = "
- SELECT id, header, descr, bdate, edate, img,
- to_char(bdate, 'Mon - DDth') AS sdate
- FROM event
- WHERE visable='t'
- AND edate >= current_date
- AND home='t'
- ORDER BY bdate asc, edate asc";
- $data = $this->DB->db_auto_get_data($query);
- if(is_array($data)) {
- foreach($data as $key => $value) {
- $id = $value['id'];
- $header = $value['header'];
- $title = strip_tags(addslashes($header));
- $descr = GLM_TOOLBOX::make_teaser($value['descr'], 250, true);
- $sdate = strtotime($value['bdate']);
- $edate = strtotime($value['edate']);
- $month = date('n',$sdate);
- $year = date('Y',$sdate);
- $dates = GLM_TEMPLATE::get_event_date($sdate,$edate,"timestamp");
- $href = BASE_URL.'index.php?catid='.EVENT_PAGE."&month={$month}&year={$year}&eventid={$id}";
- $area_events[] = array(
- 'href' => $href,
- 'bdate' => $value['sdate'],
- 'dates' => $dates,
- 'header' => $header,
- 'descr' => $descr,
- );
- }
- return $area_events;
- } else {
- return null;
- }
- }// }}}
- // {{{ get_hotspecials()
-
- function get_hotspecials(){
- $query = "
- SELECT id, intro, feature_intro
- FROM bus_category
- WHERE featured = 't'
- order by parent, pos;";
- if ($data = $this->DB->pgsql_select( $query ) ){
- $out = '
-
Hot specials ';
- foreach ($data as $row) {
- $intro = htmlspecialchars(strip_tags($row['intro']));
- $intro_text = '
'.htmlspecialchars(strip_tags($row['feature_intro'] ) ).'
';
- $out .= '
';
- }
- $out .= '
';
- }
- return $out;
- }
-
- // }}}
- // {{{ get_main_nav(
-
- function get_main_nav($topParent)
- {
- if ($navContent = $this->cache->get($topParent, 'MainNav')) {
- return $navContent;
- } else {
- $query = "select id,category
- from bus_category
- where parent = 0
- and active = 't'
- order by pos";
- if ($data = $this->DB->pgsql_select( $query ) ){
- $out = '';
- }
- $this->cache->save($out, $topParent, 'MainNav');
- return $out;
- }
- }
-
- // }}}
- // {{{ get_menu_array()
-
-
- /**
- * get_menu_array: like get_menu_string but returns an array
- *
- * @uses GLM_TEMPLATE::sort_childs()
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return string
- * @access public
- */
- function get_menu_array()
- {
- $query = "
- SELECT id, parent, category
- FROM bus_category
- WHERE id != 0 {$this->active_query}
- order by parent, pos";
- $data = $this->DB->db_auto_get_data($query);
- $newdata = GLM_TEMPLATE::sort_childs($data);
- return $newdata;
- }
-
- // }}}
- // {{{ get_main_cats()
-
- /**
- * get_main_cats
- *
- * @access public
- * @return string
- */
- function get_main_cats()
- {
- static $main_cats_array;
- if (!is_array($main_cats_array)) {
- $query = "
- SELECT id, category
- FROM bus_category
- WHERE parent = 0
- order by pos;";
- if ($data = $this->DB->db_auto_get_data( $query ) ) {
- foreach ($data as $row) {
- $main_cats_array[$row['id']] = htmlentities(strip_tags($row['category']),ENT_QUOTES,'UTF-8');
- }
- }
- }
- return $main_cats_array;
- }
-
- // }}}
- // {{{ get_menu_string()
-
- /**
- * get_menu_string:get categories for the phplayermenu
- *
- * @uses GLM_TEMPLATE::sort_childs()
- * @uses GLM_TEMPLATE::convert_to_thread()
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return string
- * @access public
- **/
- function get_menu_string()
- {
- $query = "
- SELECT id, parent, category
- FROM bus_category
- WHERE id != 0 {$this->active_query}
- ORDER BY parent, pos";
- $data = $this->DB->db_auto_get_data($query);
- $newdata = GLM_TEMPLATE::sort_childs($data);
- $string = GLM_TEMPLATE::convert_to_thread($newdata,$newdata[0]);
- return $string;
- }
-
- // }}}
- // {{{ get_id_from_name()
-
- /**
- * getIdFromName:
- *
- * @param string $name:
- * @param string $table:
- * @param object $DB:
- * @uses GLM_DB::db_auto_get_data()
- *
- * @deprecated Don't use this! THIS IS A WARNING (this funcion will be gone next time)
- * @return string
- * @access public
- */
- function get_id_from_name( $name, $table, &$DB)
- {
- if ($name == "") {
- return 0;
- }
- if (is_numeric($name)) {
- return $name;
- }
- $pattern = "/(.*)/$/";
- if (preg_match($pattern, $name, $tmp)) {
- $name = $tmp[1];
- }
- $category = "category";
- $pattern = "/-([0-9]*)$/";
- if (preg_match($pattern, $name, $tmp)) {
- $id = $tmp[1];
- return $id;
- }
- // should already be returning id at this point
- // putting the _id on the end of all url's as
- // the other way is very inifiecent for the database.
- $name = str_replace( "-"," ",$name );
- $query = "select id from $table where trim(lower(replace(replace(replace(replace(replace(replace($category,'\'',''),'/',''),'-',' '),'#',''),'&',''),'?',''))) = '".trim(strtolower($name))."'";
- $data = $DB->db_auto_get_data($query);
- if (is_array($data)) {
- foreach ($data as $key => $val) {
- $catid = $val['id'];
- }
- return $catid;
- } else {
- return 0;
- }
- }
-
- // }}}
- // {{{ get_id_from_path_info()
-
- /**
- * get_id_from_path_info: takes the path_info and gets a catid from bus_category table
- * NOTE: not used.
- *
- * @deprecated using .htaccess file for this when using seo url's
- * @return int catid
- * @access public
- **/
- function get_id_from_path_info()
- {
- return false;
- }
-
- // }}}
- // {{{ get_image_path()
-
- /**
- * get_image_path: get image path from the size used
- *
- * @uses MIDSIZED_PATH
- * @uses RESIZED_PATH
- * @uses THUMB_PATH
- *
- * @return path for images
- * @access public
- **/
- function get_image_path()
- {
- if (strstr($this->img_size, 'midsized/')) {
- return MIDSIZED_PATH;
- }
- if (strstr($this->img_size,'resized/')) {
- return RESIZED_PATH;
- }
- if (strstr($this->img_size,'thumb/')) {
- return THUMB_PATH;
- }
- }
-
- // }}}
- // {{{ get_listings()
-
- /**
- * template_parser:This function creates data
- * and items arrays and does the output for the page.
- *
- * @uses DELUXE_TOOLBOX
- * @uses GLM_TEMPLATE::$items
- * @uses GLM_TEMPLATE::get_template()
- * @uses GLM_TEMPLATE::get_all()
- * @uses GLM_TEMPLATE::load_static_page()
- * @uses GLM_TEMPLATE::clean_text()
- * @uses GLM_TEMPLATE::$item_files
- *
- * @return void
- * @access public
- */
- function get_listings()
- {
- if ($paragraphContent = $this->cache->get('paragraphs-'.$this->catid, 'Toolbox')) {
- return $paragraphContent;
- } else {
- // grab category and items into data and items respectfully
- if (DELUXE_TOOLBOX ) {
- $this->get_template( "list" );
- }
-
- if (!is_array($this->items)) {
- $this->get_all(2);
- }
-
- $output = '';
- // load any static category page from the static directory
- // hard codded content would have $catid.phtml page for it
- //$output .= $this->load_static_page();
- if (is_array($this->items)) {
- $anchors = array();
- foreach($this->items as $key=>$val) {
- // building array with links to each paragraph
- $name = trim(strip_tags($val["name"]));
- if ($name && $this->section_links) {
- $anchors[] = ''.strip_tags($val["name"]).' ';
- }
- // items can be moved around as needed
- $output .= ''."\n";
- $output .= $val["name"];
- $output .= $val["image"];
- $output .= $val["address"];
- $output .= $val["description"];
- $output .= $val["contactname"];
- $output .= $val["email"];
- $output .= $val["phone"];
- $output .= $val["fax"];
- $output .= $val["url"];
- if ( isset($this->item_files[$val['id']])
- && is_array($this->item_files[$val['id']])
- ) {
- $output .= implode('', $this->item_files[$val['id']]);
- }
- if ($val['back_to_top'] == 't') {
- $output .= '
Back to Top ';
- }
- $output .= "
"."\n";
- }
- // assign array of links to $this->sectionAnchors
- $this->sectionAnchors = $anchors;
- }
- $output = GLM_TEMPLATE::clean_text($output);
- $this->cache->save($output, 'paragraphs-'.$this->catid, 'Toolbox');
- return $output;
- }
- }
-
- // }}}
- // {{{ get_page()
-
- /**
- * get_page: replacing template_parser with get_page function
- *
- * @uses GLM_TEMPLATE::get_category() For building the main page section
- * @uses GLM_TEMPLATE::get_listings() For building out the paragraph sections
- *
- * @return string $out NEED to echo results of this function
- * @access public
- */
- function get_page($showimg = 1, $showdiv = 1)
- {
- if (isset($_REQUEST['sitemap']) && $_REQUEST['sitemap'] == 1) {
- return $this->get_sitemap();
- } elseif ( isset($_REQUEST['zipcode'])
- && is_numeric($_REQUEST['zipcode'])
- ) {
- $this->distance = ''.$this->get_distance_from_traverse($_REQUEST['zipcode']).' miles from '.$_REQUEST['zipcode'].'
';
- }
-
- if ($this->page_status != 'Good') {
- return 'Sorry this page is Down! ';
- }
-
- if ( defined('GOOGLE_SEARCH')
- && GOOGLE_SEARCH
- && isset($_REQUEST['query'])
- && $_REQUEST['query']
- ) {
- $out = '
';
- } elseif ( isset($_REQUEST['member_id'])
- && is_numeric($_REQUEST['member_id'])
- && !$this->Member->memberSections[$this->catid]
- ) {
- $out = $this->load_static_page();
- } elseif ( defined('MEMBERS_DB')
- && MEMBERS_DB
- && isset($this->Member->memberSections)
- && $this->Member->memberSections[$this->catid]
- ) {
- $GLOBALS['scripts'][]
- = BASE_URL . 'Toolkit/Members/libjs/travel-list.js';
- $out = $this->get_bread_crumbs($this->catid);
- if ( !isset($_REQUEST['member_id'])
- && !isset($_REQUEST['search'])
- && !isset($_REQUEST['start'])
- ) {
- $out .= $this->get_category($showimg,0);
- $pageHeader = $this->data['intro'];
- $out .= '';
- $out .= $pageHeader;
- // $out .= $category;
- $out .= '
';
- }
-
- // application configuration
- $conf = new Config;
- $root =& $conf->parseConfig(
- BASE . 'Toolkit/Members/config.ini',
- 'IniFile'
- );
-
- if (isset($_GET['member_id']) && is_numeric($_GET['member_id'])) {
- try {
- $profile = new Toolkit_Members_ProfilePage(
- Toolkit_Database::getInstance(),
- new Toolkit_Image_Server(),
- $_GET['member_id']
- );
- $profile->setCatId($this->catid);
- $profile->setConfig($root);
- $flexy = new HTML_Template_Flexy(
- Toolkit_Members::getFlexyOptions()
- );
- $cache = new Cache_Lite(Toolkit_Members::getCacheOptions());
- $out .= $profile->toHtml($flexy, $cache, MEMBER_RESIZED);
- } catch (PEAR_Exception $e) {
- return Toolkit_Common::handleError($e);
- }
- } elseif ( isset($_GET['search'])
- || $this->Member->hideUserSearchForm()
- ) {
- if ($this->Member->includeMemberMap()) {
- $googleMap = new Toolkit_Members_Map();
- $out .= $googleMap->toHtml();
- }
-
- $searchQuery = new Toolkit_Members_SearchQueryGenerator(
- true,
- $root
- );
- $sql = $searchQuery->getQuery($this->dbh);
- $searchList = new Toolkit_Members_SearchList(
- $this->dbh,
- 50,
- null,
- null,
- true
- );
-
- $searchList->setConfig($root);
- $searchList->setQuery($sql);
- $searchList->setDefaultSort(array('member_name' => 'ASC'));
- // rendering engine to use
- $rEngine = new Structures_DataGrid_Renderer_Flexy();
- // template options to use for template engine
- $tplOpts = Toolkit_Members::getFlexyOptions();
- // templating engine to use
- $tEngine = new HTML_Template_Flexy($tplOpts);
- $rEngine->setContainer($tEngine);
-
- $out .= $searchList->toHtml($rEngine);
- } else {
- if ($this->Member->includeMemberMap()) {
- $googleMap = new Toolkit_Members_Map();
- $out .= $googleMap->toHtml();
- }
-
- $action = BASE_URL . "index.php?catid={$this->catid}";
- $form = new Toolkit_Members_UserSearchForm(
- 'SearchForm',
- 'get',
- $action,
- null,
- null,
- true
- );
- $res = $form->setCatId($this->catid);
- if (!PEAR::isError($res)) {
- $form->setPageMemberCategories($this->dbh);
- $form->configureForm($this->dbh, $root);
- $out .= $form->toHtml(Toolkit_Members::getFlexyOptions());
- } else {
- return Toolkit_Common::handleError($res);
- }
- }
-
- if ( !isset($_REQUEST['member_id'])
- && !isset($_REQUEST['search'])
- && !isset($_REQUEST['start'])
- ) {
- $out .= $this->load_static_page();
- $out .= $this->get_listings();
- }
-
- if (PHOTO_GALLERY) {
- $out .= $this->photo_module();
- }
- } else {
- $breadCrumbs = $this->get_bread_crumbs($this->catid);
- $category = $this->get_category($showimg, 0);
- $pageHeader = $this->data['intro'];
- $static = $this->load_static_page();
- $listings = $this->get_listings();
- // generation of the section links to each paragraph
- if (is_array($this->sectionAnchors)) {
- $links = '
- ';
- foreach ($this->sectionAnchors as $anchors) {
- $links .= ''.$anchors.'
- ';
- }
- $links .= '
- ';
- }
- $out = $breadCrumbs;
- $out .= '';
- $out .= $pageHeader;
- $out .= $links;
- $out .= $category;
- $out .= '
';
- $out .= $static;
- $out .= $listings;
- if (PHOTO_GALLERY) {
- $out .= $this->photo_module();
- }
- }
- return $out;
- }
-
- // }}}
- // {{{ get_page_header_image()
-
- function get_page_header_image(){
- $headers[5] = 'accommodations';
- $headers[21] = 'arts';
- $headers[22] = 'beaches';
- $headers[16] = 'golf';
- $headers[20] = 'guest';
- $headers[4] = 'outdoor';
- $headers[43] = 'reservations';
- $headers[3] = 'things';
- $headers[18] = 'winaries';
- $headers[7] = 'meeting';
- $headers[8] = 'tour';
- $headers[9] = 'media';
- $headers[33] = 'events';
- $this->header_images = $headers;
- $top_parent = $this->get_top_parent($this->catid);
- if ($top_parent && $this->catid != HOME_ID) {
- if ($_SERVER['HTTPS'] == "on") {
- $base_url = BASE_SECURE_URL;
- } else {
- $base_url = BASE_URL;
- }
-
- if ($_SERVER['HTTPS'] != "on") {
- return( '
-
-' );
- } else {
- return false;
- }
- } else {
- return false;
- }
- }
-
- // }}}
- // {{{ get_parent()
-
- /**
- * get_parent: get parent for this category
- *
- * @param integer $catid: id
- * @param object $DB: database obj
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return int $parent
- * @access public
- **/
- function get_parent($catid,&$DB)
- {
- $query = "
- SELECT parent
- FROM bus_category
- WHERE id = $catid
- ORDER BY pos";
- $data = $DB->db_auto_get_data($query);
- return $data[0]["parent"];
- }
-
- // }}}
- // {{{ get_parent_id ()
-
- function get_parent_id($id)
- {
- if (is_numeric($id)) {
- $query = "select parent from bus_category where id = $id";
- if ($data = $this->DB->pgsql_select($query)) {
- return $data[0]['parent'];
- }
- }
- }
-
- // }}}
- // {{{ get_seo_url()
-
- /**
- * get_seo_url:
- * grab category part of the search engine friendly url
- * looks at define for seo_url to see weather to use the seach engine friendly url's or not
- *
- * @param integer $id:
- * @param boolean $slash = 1 : to put a slash on end or not
- * @uses BASE_URL
- * @uses SEO_URL
- * @uses HOME_ID
- * @uses GLM_TEMPLATE::$php_ext
- * @uses GLM_TEMPLATE::set_name_url()
- * @uses GLM_TEMPLATE::get_category_name()
- * @uses GLM_TEMPLATE::get_base_url()
- *
- * @return string $url for page.
- * @access public
- **/
- function get_seo_url($id, $slash = 1)
- {
- if ($id == HOME_ID &&
- $GLOBALS['GLM_SERVER_ID'] != 'devsys.gaslightmedia.com') {
- return BASE_URL;
- } elseif ($id == HOME_ID &&
- $GLOBALS['GLM_SERVER_ID'] == 'devsys.gaslightmedia.com') {
- return BASE_URL.'index.php';
- }
- if ( isset($this->category_toolbox)
- && is_array($this->category_toolbox)
- && in_array($id, $this->category_toolbox)
- ) {
- $category_id = array_search($id, $this->category_toolbox);
- $url = BASE_URL.'member.php?category_id='.$category_id;
- return $url;
- }
- if (in_array($id, array(
- MEMBERS_PROFILE_FORM_PAGE,
- MEMBERS_COUPONS_PAGE,
- MEMBERS_EVENTS_PAGE,
- MEMBERS_REPORTS_PAGE
- ))) {
- switch ($id) {
- case MEMBERS_PROFILE_FORM_PAGE :
- return $baseurl . 'memberdb/index.php?Option=Member&Action=Edit';
- break;
- case MEMBERS_COUPONS_PAGE :
- return $baseurl . 'memberdb/index.php?Option=Coupons&Action=List';
- break;
- case MEMBERS_EVENTS_PAGE :
- return $baseurl . 'memberdb/index.php?Option=Events&Action=List';
- break;
- case MEMBERS_REPORTS_PAGE :
- return $baseurl . 'memberdb/index.php?Option=Reports&Action=List';
- break;
- }
- }
- if (SEO_URL) {
- if ($id == 142) {
- $base_url = BASE_SECURE_URL;
- } else {
- $base_url = BASE_URL;
- }
- $url = $base_url;
- if (defined("SHORT_URLS") && SHORT_URLS) {
- static $ShortURL;
- if (!$ShortURL) {
- $ShortURL = new Toolkit_ShortURL($this->dbh);
- }
- $short_url = $ShortURL->getShortUrl($id);
- if ($short_url) {
- return $base_url.$short_url . '/';
- }
- }
- $url .= GLM_TEMPLATE::set_name_url(GLM_TEMPLATE::get_category_name($id, "bus_category", $this->DB));
- $url = htmlspecialchars(strip_tags($url));
- if ($slash) {
- $url .= '/';
- }
- } else {
- $url = $this->get_base_url($id);
- if ($url) {
- if ($id == 142) {
- $url = BASE_SECURE_URL.$url;
- }else{
- $url = BASE_URL.$url;
- }
- $url .= $this->php_ext.'?catid='.$id;
- } else {
- $url = BASE_URL;
- }
- }
-
- return $url;
- }
-
- // }}}
- // {{{ get_side_nav()
-
- function get_side_nav($parent = 0)
- {
- if ($navContent = $this->cache->get($this->catid, 'Nav')) {
- return $navContent;
- } else {
- $qs = "
- SELECT id, category, intro
- FROM bus_category
- WHERE parent = :parent {$this->active_query}
- ORDER BY pos";
- try {
- $stmt = $this->dbh->prepare($qs);
- $stmt->bindParam(":parent", $parent, PDO::PARAM_INT);
- $stmt->execute();
- $data = $stmt->fetchAll(PDO::FETCH_ASSOC);
- } catch(PDOException $e) {
- return Toolkit_Common::handleError($e);
- }
- if (!is_array($data)) {
- return false;
- } else {
- $return = '';
- foreach ($data as $key => $row) {
- $url = $this->get_seo_url($row['id']);
- $title = strip_tags(addslashes($row['intro']));
- $return .= 'catid == $row['id']) {
- $return .= ' id="current"';
- }
- $return .= '>' .
- htmlentities($row['category'],ENT_QUOTES,'UTF-8')." ";
- $hasSubs = $this->has_subs($row['id'], $this->DB);
- $isSubId = $this->is_sub_id($this->catid, $row['id'], $this->DB);
- $isPage = $this->catid == $row['id'];
-
- if ($hasSubs && ($isSubId || $isPage)) {
- $ret2 = $this->get_side_nav($row['id']);
- $return .= $ret2;
- }
- $return .= ' ';
- }
- $main_cats = $this->get_main_cats();
- if ($return) {
- if ($main_cats[$parent]) {
- $return = '
- ';
- $this->cache->save($return, $this->catid, 'Nav');
- return $return;
- } else {
- $return = "\n\n";
- return $return;
- }
- } else {
- return false;
- }
- }
- }
- }
-
- // }}}
- // {{{ get_sitemap()
-
- function get_sitemap(){
- // sitemap.inc goes here
- // maybe make a sitemap class
- }
-
- // }}}
- // {{{ get_sub_nav()
-
- /**
- * get_sub_nav:
- * @param integer $catid:
- * @param object $DB:
- *
- * @uses GLM_TEMPLATE::get_parent()
- * @uses GLM_TEMPLATE::get_seo_url()
- * @uses GLM_TEMPLATE::is_sub_id()
- * @uses GLM_TEMPLATE::get_sub_nav()
- * @uses GLM_TEMPLATE::has_subs()
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return string
- * @access public
- **/
- function get_sub_nav($catid,&$DB)
- {
- $parentid = GLM_TEMPLATE::get_parent($catid,&$DB);
- //echo $parentid.' ';
- $query = "SELECT id,category,intro FROM bus_category WHERE parent = $parentid ".$this->active_query." ORDER BY pos";
- $data = $DB->db_auto_get_data($query);
- if (is_array($data)) {
- $output = '';
- $counter = 1;
- foreach($data as $key=>$val) {
- $url = $this->get_seo_url( $val['id'] );
- $title = strip_tags(addslashes($val['intro']));
- if (GLM_TEMPLATE::is_sub_id($catid,$parentid,&$DB) && (GLM_TEMPLATE::is_sub_id($catid,$val['id'],&$DB) || $val['id'] == $catid) ) {
- $output .= '
';
- } else {
- $output .= ' ';
- }
- $output .= $val["category"];
- $output .= ' ';
- if (GLM_TEMPLATE::is_sub_id($catid,$val['id'],&$DB) && GLM_TEMPLATE::has_subs($val['id'],&$DB)) {
- $output .= GLM_TEMPLATE::get_sub_nav($val["id"],&$DB,$catid);
- }
- }
- $output .= '
';
- $output = GLM_TEMPLATE::clean_text($output);
- echo $output;
- }
- return false;
- }
-
- // }}}
- // {{{ get_template()
-
- /**
- * get_template: get the template type of the bus_category
- * @param mixed $type : 'cat' or 'list'
- *
- * @uses GLM_DB::db_auto_get_data()
- * @uses GLM_TEMLATE::img_align()
- * @uses GLM_TEMLATE::img_alternate()
- * @uses GLM_TEMLATE::$template
- *
- * @return void
- * @access public
- */
- function get_template($type)
- {
- $query = "select template from bus_category where id = ".$this->catid;
- $data = $this->DB->db_auto_get_data($query);
- switch ($type) {
- case "cat" :
- switch ($data[0]['template']) {
- case "5" :
- case "4" :
- case "2" :
- $this->img_align = "left";
- break;
-
- default:
- $this->img_align = "right";
- break;
- }
- break;
-
- case "list" :
- switch( $data[0]['template'] ) {
- case "6" :
- case "2" :
- $this->img_align = "left";
- $this->img_alternate = 0;
- break;
-
- case "5" :
- case "1" :
- $this->img_align = "right";
- $this->img_alternate = 0;
- break;
-
- case "4" :
- $this->img_align = "right";
- $this->img_alternate = 1;
- break;
-
- case "3":
- $this->img_align = "left";
- $this->img_alternate = 1;
- break;
-
- default:
- break;
- }
- break;
- }
- return $this->template = $data[0]['template'];
- }
-
- // }}}
- // {{{ get_top_parent()
-
- /**
- * get_top_parent:Get the highest level parent id (not 0 )for the category.
- *
- * NOTICE: This is ment to get the top level parent not the parent of the id given.
- *
- * @param integer $id: The catid for the page.
- * @param object $DB: obj
- * @uses GLM_TEMPLATE::get_top_parent()
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return int $parent
- * @access public
- */
- function get_top_parent($id)
- {
- if ($id == 0 ){
- return 0;
- }
- $qs = "select parent from bus_category where id = $id";
- $parentrow = $this->DB->db_auto_get_data( $qs );
- if ($parentrow[0]['parent'] == 0 ){
- return $id;
- } else {
- return $this->get_top_parent( $parentrow[0]['parent'] );
- }
- }
-
- // }}}
-
- // {{{ is_sub_id()
-
- /**
- * is_sub_id:Check to see if catid is sub of category
- *
- * @param integer $catid: the catid looking at
- * @param integer $category: to see if it is in category
- * @param object $DB: Db object reference
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return bool
- * @access public
- */
- function is_sub_id($catid,$category,&$DB)
- {
- if (!is_numeric($catid)) {
- return false;
- }
-
- if ($category == $catid)
- {
- return true;
- }
-
- $query = "select id,parent from bus_category where id = $catid";
- $data = $DB->db_auto_get_data($query);
- $parent = $data[0]['parent'];
- if ($parent == 0) {
- return false;
- } else {
- return GLM_TEMPLATE::is_sub_id($parent,$category,&$DB);
- }
- }
-
- // }}}
-
- // {{{ keyword_replace()
-
- /**
- * keyword_replace:
- *
- * @param string $string:
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return string
- * @access public
- */
- function keyword_replace($string)
- {
- //return $string;
- if ($search = strstr($string,"{")) {
- if (preg_match("/\{([A-Z0-9\&\-\,\'\" ]*)\}/i",$string,$needle)) {
- if ($needle[0] != "") {
- $qs = "
- SELECT id, category
- FROM bus_category
- WHERE trim(keyword) = '".trim($needle[1])."'";
-
- $keyres = $this->DB->db_auto_get_data($qs);
- $parent = $this->get_top_parent($keyres[0]['id'],&$this->DB);
- $url = $this->get_seo_url( $keyres[0]['id'] );
- $replacement = "".htmlspecialchars($keyres[0]['category'])." ";
- $string = str_replace($needle[0],$replacement,$string);
- }
- } else {
- return $string;
- }
- if ($search = strstr($string,"{")) {
- return $this->keyword_replace($string);
- }
- }
- return $string;
- }
-
- // }}}
-
- // {{{ load_static_page()
-
- /**
- * load_static_page:using object buffer include the page $catid.phtml from static dir
- and return it as string
- *
- * @return string $text
- * @access public
- **/
- function load_static_page()
- {
- if (file_exists(BASE."static/".$this->catid.".phtml")) {
- ob_start();
- include BASE . "static/".$this->catid.".phtml";
- $text = ob_get_contents();
- ob_end_clean();
- return $text;
- }
- }
-
- // }}}
-
- // {{{ make_ul_menu()
-
- /**
- * make_ul_menu: create url list of categories
- *
- * @param integer $parent parent to start from
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return string
- * @access public
- */
- function make_ul_menu($parent = 0)
- {
- $qs = "
- SELECT id, category, intro
- FROM bus_category
- WHERE parent = $parent
- AND id <> ".MEMBERS_ONLY_CATEGORY."
- {$this->active_query}
- order by pos";
- $data = $this->DB->db_auto_get_data($qs);
-
- if (!is_array($data)) {
- return false;
- } else {
- $return = '';
- foreach ( $data as $key => $row ) {
- $url = $this->get_seo_url( $row['id'] );
- $title = strip_tags(addslashes($row['intro']));
- $return .= "\tcatid == $row['id']) {
- $return .= ' id="current"';
- }
- $return .= '>' . htmlentities($row['category'], ENT_QUOTES, 'UTF-8') . ' ';
- $hasSubs = $this->has_subs($row['id'], $this->DB);
- $isSubId = $this->is_sub_id($this->catid, $row['id'], $this->DB);
- $isPage = $this->catid == $row['id'];
- if ($hasSubs && ($isSubId || $isPage)) {
- $ret2 = $this->make_ul_menu($row['id']);
- $return .= $ret2;
- }
- $return .= " \n";
- }
- $main_cats = $this->get_main_cats();
- if ( (isset($parent) && $parent != 0)
- || ( isset($main_cats)
- && isset($main_cats[$parent])
- && $main_cats[$parent]
- )
- ) {
- return "\n";
- } else {
- return "\n";
- }
- }
- }
-
- // }}}
- // {{{ meta_tags()
-
- /**
- * meta_tags: create the meta description content for this page.
- * this is taken from the category description.
- * this should be only done for all but the home page.
- * $meta = ( $catid != 1 ) ? $toolbox->meta_tags() : '';
- *
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return string
- * @access public
- */
- function meta_tags()
- {
- $query = "
- SELECT meta_descr,description
- FROM bus_category
- WHERE id = :id";
- try {
- $stmt = $this->dbh->prepare($query);
- $stmt->bindParam(":id", $this->catid, PDO::PARAM_INT);
- $stmt->execute();
- $data = $stmt->fetch();;
- } catch(PDOException $e) {
- echo ''.print_r($e, true).' ';
- die($e->getMessage());
- }
- if ($data['meta_descr']) {
- $description = htmlentities(trim(strip_tags($data['meta_descr'])), ENT_QUOTES, 'UTF-8');
- } else {
- $description = htmlentities(substr(trim(strip_tags($data['description'])), 0, 250),ENT_QUOTES,'UTF-8');
- }
- return $description;
- }
-
- // }}}
-
- // {{{ page_status()
-
- /**
- * page_status
- *
- * tell if page is active, deleted or inactive
- * this will redirect to the index.php page if the
- * id has been deleted or not active
- * it will display message about page not found.
- *
- * @param mixed $id
- * @access public
- * @return string
- */
- function page_status($id) {
- if ($id == 9999) {
- $this->page_status = 'Good';
- return true;
- }
-
- if (empty($id)) {
- return false;
- }
- if ($id == HOME_ID) {
- $this->page_status = 'Good';
- }
- $query = "
- SELECT id, active
- FROM bus_category
- WHERE id = :id";
- try {
- $stmt = $this->dbh->prepare($query);
- $stmt->bindParam(":id", $id, PDO::PARAM_INT);
- $stmt->execute();
- $data = $stmt->fetch();
- //echo ''.print_r($data, true).' ';
- } catch(PDOException $e) {
- echo ''.print_r($e, true).' ';
- die($e->getMessage());
- }
-
- if (is_array($data)) {
- if (!$data['active'] &&
- !strstr($_SERVER['HTTP_REFERER'], 'admin/')) {
- // page was deleted and no longer avail.
- // give 404 redirect and go back to index page
- header('HTTP/1.1 404 Not Found');
- $this->page_status = 'Bad';
- } else {
- $this->page_status = 'Good';
- }
- } else {
- // page was deleted and no longer avail.
- // give 301 redirect and go back to index page
- header('HTTP/1.1 301 Moved Permanently');
- header('Location: '.BASE_URL);
- exit();
- }
- }
-
- // }}}
- // {{{ photo_module()
-
- /**
- * photo_module
- * Load the photo gallery into page
- *
- * @access public
- * @return string
- */
- function photo_module()
- {
- $query = "
- SELECT photocat_id
- FROM photo_category_bus
- WHERE buscat_id = $this->catid;";
- $out = '';
- if ($pData = $this->DB->db_auto_get_data($query)) {
- if (count($pData) > 1) {
- foreach ($pData as $pKey => $pVal) {
- $photocatid[] = $pVal['photocat_id'];
- }
- $SINGLE_GALLERY = false;
- } else {
- $SINGLE_GALLERY = true;
- $photocatid = $pData[0]['photocat_id'];
- }
- if (is_numeric($photocatid) || is_array($photocatid)) {
- if (!$_REQUEST['photo_catid']) {
- $_REQUEST['photo_catid'] = $photocatid;
- }
- $photoApp = new Toolkit_Photos_Display();
- $out = $photoApp->toHTML();
- }
- }
- return $out;
- }
-
- // }}}
- // {{{ print_ancestors()
-
- /**
- * print_ancestors:print out the ancestors
- * @param integer $catid: the id to start at.
- *
- * @return string
- * @access public
- */
- function print_ancestors($catid)
- {
- return $this->get_bread_crumbs($catid);
- }
-
- // }}}
-
- // {{{ set_active_query()
-
- /**
- * set_active_query: some toolboxes have an active flag some do not
- * so this is to allow both with and without a flag.
- *
- * @uses ACTIVE_FLAG
- *
- * @return void
- * @access public
- **/
- function set_active_query()
- {
- if (ACTIVE_FLAG) {
- $this->active_query = " and active = 't'";
- }
- return $this->active_query;
- }
-
- // }}}
- // {{{ set_address()
-
- /**
- * set_address:set_address
- * {$address} {$city},{$state} {$zip}
- * @param array $data: data contain the address info for display.
- *
- * @return string $address
- * @access public
- **/
- function set_address($data)
- {
- $address = "";
- if ($data["address"]) {
- $address .= $data["address"];
- }
- if ($data["city"] && $data["state"] && $data["zip"]) {
- $address .= ' '.$data["city"].', '.$data["state"].' '.$data["zip"];
- } elseif ($data["city"] && $data["state"]) {
- $address .= ' '.$data["city"].', '.$data["state"];
- } elseif ($data["city"]) {
- $address .= ' '.$data["city"];
- }
-
- if ($address != "") {
- return ''.$address.'
';
- }
- }
-
- // }}}
- // {{{ set_body_tag()
-
- function set_body_tag()
- {
- if ($this->catid != HOME_ID) {
- $this->body_tag = ' id="inside"';
- }
- if (isset($_REQUEST['query']) && $_REQUEST['query']) {
- switch (GLM_HOST_ID) {
- case "devsy.gaslightmedia.com":
- case "DEVELOPMENT":
- $apikey = "ABQIAAAA4LuqJozzD0jiTLPhI0tT7xQUAAYHl_Rab4aEI5hGyHxlqR-rKxQMGKAdHLOEIFLI9wcDJjjSkJ7qng";
- break;
-
- case "ws1.gaslightmedia.com":
- case "PRODUCTION":
- $apikey = "ABQIAAAAWqyv9sBAgUBdsdOdgo7LsRQRzeqzQXKdvmJb4FZzpdF0AtrabhSiNxG27kD8OcNt7Ae6sNRUH1VXCA";
- break;
-
- default :
- break;
- }
- $this->body_tag .= ' onload="OnLoad();"';
- $this->scripts .= '
- ';
- $this->scripts .= ' ';
- $this->scripts .= '';
- }
- }
-
- // }}}
- // {{{ set_catid()
-
- /**
- * set_catid:Set the class catid var
- * @param integer $catid: $catid
- *
- * @deprecated using get_catid
- * @return void
- * @access public
- **/
- function set_catid($catid)
- {
- if (is_numeric($catid)) {
- $this->catid = $catid;
- } else {
- $this->catid = 1;
- }
- }
-
- // }}}
- // {{{ set_contact()
-
- /**
- * set_contact:Set the contact string
- * Contact Name: {$text}
- *
- * @param string $text: The text as string
- * @param string $email: email if givin
- *
- * @return string $text
- * @access public
- **/
- function set_contact($text, $email)
- {
- if ($email != "") {
- $text = "";
- } else {
- $text = 'Contact Name: '.$text.'
';
- }
- return $text;
- }
-
- // }}}
- // {{{ set_DB()
-
- /**
- * set_DB: set the DB up to be that of the global one if it exists
- *
- * @param object $DB : the DB object
- * @uses GLM_DB
- *
- * @return void
- * @access public
- **/
- function set_DB($DB) {
- if (isset($DB)) {
- $this->DB =& $DB;
- } else {
- $this->DB =& new GLM_DB();
- }
- }
-
- // }}}
- // {{{ set_data()
-
- /**
- * call all class methods to set tho data elements
- *
- * This is hightly dependant on the three tables of bus bus_category and bus_category_bus
- * set_data:Calls each function of the class
- * based on the key af the array $data[0][$key]
- * @todo Really need to look at enhancing this function for different datasetups.
- * @param array $data: The input array from db query
- * @uses GLM_TEMPLATE::$img_size
- * @uses GLM_TEMPLATE::$img_align
- * @uses GLM_TEMPLATE::$img_alternate
- * @uses GLM_TEMPLATE::set_text()
- * @uses GLM_TEMPLATE::set_header()
- * @uses GLM_TEMPLATE::set_subheader()
- * @uses GLM_TEMPLATE::set_url()
- * @uses GLM_TEMPLATE::set_address()
- * @uses GLM_TEMPLATE::set_img()
- * @uses GLM_TEMPLATE::set_email()
- * @uses GLM_TEMPLATE::set_phone()
- *
- * @return array data The finished array
- * @access public
- **/
- function set_data($data)
- {
- if (is_array($data)) {
- foreach ($data as $k => $val) {
- foreach ($val as $key => $value) {
- if ( strstr($key, "image")
- && !strstr($key, "name")
- && $value != ""
- ) {
- $titletag = $data[$k]['category'] ?
- $data[$k]['category'] :
- $data[$k]['name'];
-
- //$data[$k][$key."_name"] = $value;
- $data[$k][$key] = $this->set_img(
- $value,
- $this->img_size,
- $this->img_align,
- $titletag,
- $data[$k][$key."name"]
- );
-
- if (!strstr($key, "name")) {
- if ( $this->img_align == "right"
- && $this->img_alternate
- ) {
- $this->img_align = "left";
- } elseif ($this->img_alternate) {
- $this->img_align = "right";
- }
- }
- } elseif ( strstr($key, "file")
- && strstr($key, "name")
- && $value != ""
- ) {
- } elseif ( strstr($key,"url")
- && strstr($key,"name")
- && $value != ""
- ) {
- } elseif (strstr($key,"descr") && $value != "") {
- $data[$k][$key] = GLM_TEMPLATE::set_text($value);
- } elseif (isset($data[$k]['email'])
- && $key == "contactname"
- && $value != ""
- ) {
- $data[$k][$key] = GLM_TEMPLATE::set_contact(
- $value,
- $data[$k]['email']
- );
- } elseif ($key == "name" && $value != "") {
- $data[$k][$key] = GLM_TEMPLATE::set_subheader($value);
- } elseif (strstr( $key, "header" ) && $value != "") {
- $data[$k][$key] = GLM_TEMPLATE::set_subheader($value);
- } elseif ($key == "intro" && $value != "") {
- $data[$k][$key] = GLM_TEMPLATE::set_header($value);
- } elseif ($key == "category" && $value != "") {
- $data[$k][$key] = GLM_TEMPLATE::set_header($value);
- } elseif ($key == "url" && $value != "") {
- $data[$k][$key] = GLM_TEMPLATE::set_url($value,
- $data[$k]["urlname"]);
- } elseif ($key == "email" && $value != "") {
- $data[$k][$key] = GLM_TEMPLATE::set_email($value,
- $data[$k]["contactname"]);
- } elseif ($key == "phone" && $value != "") {
- $data[$k][$key] = GLM_TEMPLATE::set_phone($value);
- } elseif ($key == "fax" && $value != "") {
- $data[$k][$key] = GLM_TEMPLATE::set_fax($value);
- } elseif (strstr($key, "file") && $value != "") {
- $data[$k][$key] = GLM_TEMPLATE::set_file(
- $value,
- $data[$k][$key.'name']
- );
- } elseif ($key == "address") {
- $data[$k][$key] = GLM_TEMPLATE::set_address($data[$k]);
- } elseif ($key == "id") {
- $data[$k][$key] = $value;
- } else {
- $data[$k][$key] = GLM_TEMPLATE::set_text($value);
- }
- }
- }
- return $data;
- }
- return false;
- }
-
- // }}}
- // {{{ set_email()
-
- /**
- * set_email:Set the email string
- * Contact: {$text}
- * @param string $email: The email as string
- * @param string $contact: The contactname this is used as the link text
- *
- * @return string $text
- * @access public
- **/
- function set_email($email, $contact)
- {
- if ($email != "") {
- if ($contact != "") {
- $email = 'Contact: '.htmlspecialchars($contact).'
';
- } else {
- $email = 'Email: '.htmlspecialchars($email).'
';
- }
- }
- return $email;
- }
-
- // }}}
- // {{{ set_fax()
-
- /**
- * set_fax:Set the fax string
- * Fax: {$text}
- * @param string $text: The text as string
- *
- * @return string $text
- * @access public
- **/
- function set_fax($text)
- {
- if ($text != "") {
- $text = 'Fax: '.htmlspecialchars($text).'
';
- }
- return $text;
- }
-
- // }}}
- // {{{ set_file()
-
- /**
- * set_file:Set the file string
- * Contact Name: {$text}
- * @param string $text: The text as string
- * @param string $name: The file name displayed
- * @uses URL_BASE
- *
- * @return string $text
- * @access public
- **/
- function set_file($text, $name)
- {
- if ($text != "") {
- $outtext = '';
- if ($name) {
- $outtext .= htmlspecialchars($name);
- } else {
- $outtext .= htmlspecialchars($text);
- }
- $outtext .= ' ';
- if (preg_match("/[.]([A-Z0-9]{3}$)/i", $text, $tmp)) {
- // don't output second link
- //$outtext .= 'Click here to Download ';
- }
- $outtext .= '
';
- }
- return $outtext;
- }
-
- // }}}
- // {{{ set_header()
-
- /**
- * set_header:Set the header string
- * @param string $text: The text as string
- * @uses GLM_TEMPLATE::header_begin()
- * @uses GLM_TEMPLATE::header_end()
- *
- * @return string $text
- * @access public
- **/
- function set_header($text)
- {
- if ($text != "") {
- $text = $this->header_begin.htmlspecialchars($text).$this->header_end;
- }
- return $text;
- }
-
- // }}}
- // {{{ set_img()
-
- /**
- * set_img:Set the image string
- *
- *
- *
- *
- *
- * @param string $image: The image
- * @param string $size: The path
- * @param string $align: The alignment
- * @param string $name: The image_name (displayed under image)
- * @param string $alt_title text for use in alt and title tags
- * @param string $caption Text for image caption if given
- * @uses GLM_TEMPLATE::get_image_path()
- *
- * @return void
- * @access public
- **/
- function set_img($image, $size, $align, $alt_title = NULL, $caption = NULL)
- {
- if ($image != "") {
- if ($caption != '') {
- $caption = str_replace('&','&',$caption);
- $titletag = 'title="'.htmlspecialchars(strip_tags($caption)).'"';
- $titletag .= ' alt="'.htmlspecialchars(strip_tags($image)).'"';
- } elseif ($alt_title != '') {
- $alt_title = str_replace('&','&',$alt_title);
- $titletag = 'title="'.htmlspecialchars(strip_tags($alt_title)).'"';
- $titletag .= ' alt="'.htmlspecialchars(strip_tags($image)).'"';
- } else {
- $titletag = 'title="'.htmlspecialchars(strip_tags($image)).'"';
- $titletag .= ' alt="'.htmlspecialchars(strip_tags($image)).'"';
- }
-
- if ($align != "") {
- $img_align = 'class="image'.$align.'"';
- }
- $path = $this->get_image_path();
- if (is_file($path.$image)) {
- $image_size = getimagesize($path.$image);
- $img_attr = $image_size[3];
- } else {
- $imServer = new Toolkit_Image_Server();
- $image_size = $imServer->getImageSize($size.$image);
- //$image_size[0] = $ret['width'];
- //$image_size[1] = $ret['height'];
- }
- $img = '';
- $img .= '
';
- if ($caption) {
- $img .= '
';
- }
- $img .= '
';
- return $img;
- }
- }
-
- // }}}
- // {{{ set_member()
-
- /**
- * set_member
- *
- * @access public
- * @return string
- */
- function set_member()
- {
- if (MEMBERS_DB && $this->catid) {
- $member =& new Toolkit_Members_Display($this->dbh);
- try {
- $res = $member->setCatId($this->catid);
- } catch (InvalidArgumentException $e) {
- return Toolkit_Common::handleError($e);
- }
- $member->setMemberSections();
- return $member;
- }
- }
-
- // }}}
- // {{{ set_name_url()
-
- /**
- * setNameUrl:
- * @param string $name :
- *
- * @return string
- * @access public
- */
- function set_name_url( $name )
- {
- $name = str_replace(" ","-",$name);
- $name = preg_replace("/[\/#&?'\"]|amp;/","",strip_tags( strtolower( trim( $name ) ) ) );
- return htmlspecialchars( $name );
- }
-
- // }}}
- // {{{ set_pages()
-
- /**
- * set_pages: grab the globals for the pages an use this for
- * the pages array for the class
- *
- * @return void
- * @access public
- **/
- function set_pages($pages)
- {
- $this->pages[1] = 'index';
- }
-
- // }}}
- // {{{ set_phone()
-
- /**
- * set_phone:Set the phone string
- * Phone: {$text}
- * @param string $text: The text as string
- *
- * @return string $text
- * @access public
- **/
- function set_phone($text)
- {
- if ($text != "") {
- $text = 'Phone: '.$text.'
';
- }
- return $text;
- }
-
- // }}}
- // {{{ set_subheader()
-
- /**
- * set_subheader:Set the subheader string
- * @param string $text: The text as string
- * @uses GLM_TEMPLATE::subheader_begin()
- * @uses GLM_TEMPLATE::subheader_end()
- *
- *
- * @return string $text
- * @access public
- **/
- function set_subheader($text)
- {
- if ($text != "") {
- $text = $this->subheader_begin.htmlspecialchars($text).$this->subheader_end;
- }
- return $text;
- }
-
- // }}}
- // {{{ set_text()
-
- /**
- * set_text:Set the contact string
- * {$text}
- * @param string $text: The text as string
- *
- * @return string $text
- * @access public
- **/
- function set_text($text)
- {
- if ("" == str_replace(" ", "", trim($text))) {
- return false;
- }
- if ($text != "") {
- $text = $this->keyword_replace($text);
- $text = $text;
- }
- return $text;
- }
-
- // }}}
- // {{{ set_toolbox_to_category_array()
-
- function set_toolbox_to_category_array(){
- $category_toolbox[1] = 70;// Places to Stay
- $category_toolbox[20] = 71;// Things to Do
- $category_toolbox[19] = 72;// Food & Spirits
- $category_toolbox[24] = 73;// Camping
- $category_toolbox[40] = 74;// Travel Services
- $category_toolbox[25] = 75;// Attractions
- $category_toolbox[41] = 76;// Golf
- $category_toolbox[42] = 77;// Real Estate
- $category_toolbox[43] = 78;// Shopping
- $category_toolbox[44] = 79;// Recreation
- $this->category_toolbox = $category_toolbox;
- }
-
- // }}}
- // {{{ set_url()
-
- /**
- * set_url:Set the url string
- *
- * {$text}
- *
- *
- * @param string $url: The url
- * @param string $text: The text as string
- *
- * @return string $text
- * @access public
- **/
- function set_url($url, $text)
- {
- if ($url != "") {
- if (!$text) {
- $text = $url;
- }
- if (strtolower(substr($url, 0, 7) ) == "https://") {
- $url = ''.htmlspecialchars($text).'
';
- } else {
- $url = ''.htmlspecialchars($text).'
';
- }
- }
- return $url;
- }
-
- // }}}
- // {{{ show_catheader()
-
- /**
- * show_catheader:
- *
- * @param integer $catid:
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return string
- * @access public
- **/
- function show_catheader($catid)
- {
- $query = "SELECT category FROM bus_category WHERE id = $catid";
- $data = $this->DB->db_auto_get_data($query);
- if ($data[0][category]!="") {
- $header = $data[0][category];
- } else {
- $header = ' ';
- }
- echo $header;
- }
-
- // }}}
- // {{{ show_catimg()
-
- /**
- * show_catimg:output the category image.
- *
- * @param integer $catid: The catid for the page.
- * @uses GLM_TEMPLATE::MIDSIZED
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return void
- * @access public
- */
- function show_catimg($catid)
- {
- $query = "SELECT image FROM bus_category WHERE id = $catid";
- $data = $this->DB->db_auto_get_data($query);
- if ($data[0]["image"]!="") {
- $img = ' ';
- } else {
- $img = ' ';
- }
- echo $img;
- echo ' ';
- }
-
- // }}}
- // {{{ sort_childs()
-
- /**
- * sort_childs:
- * @param array $threads:
- *
- * @return string
- * @access public
- */
- function sort_childs($threads)
- {
- foreach($threads as $var=>$value) {
- $childs[$value["parent"]][$value["id"]] = $value;
- }
- return $childs;
- }
-
- // }}}
- // {{{ sub_nav()
-
- /**
- * sub_nav:Create a sub navigation 4 across
- *
- * @param integer $catid: The catid for the page
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return void
- * @access public
- */
- function sub_nav($catid)
- {
- $newcatid = $this->get_parent_id($catid);
- if ($newcatid != 0) {
- $catid = $newcatid;
- }
- $query1 = "SELECT category FROM bus_category WHERE id = $catid";
- $data1 = $this->DB->db_auto_get_data( $query1 );
- $out = ' ';
-
- $query = "SELECT id,category,intro FROM bus_category WHERE parent = $catid ".$this->active_query." ORDER BY pos";
- $data = $this->DB->db_auto_get_data($query);
- if (is_array($data)) {
- $counter = 1;
- foreach ($data as $key => $val) {
- $url = $this->get_seo_url($val['id']);
- $title = strip_tags(addslashes($val['intro']));
- //GLM_TEMPLATE::set_name_url( GLM_TEMPLATE::get_category_Name( $val['id'],"bus_category",$this->DB ) );
- $out .= '
';
- $out .= $val["category"];
- $out .= ' ';
- }
- }
- $out .= '
';
- return $out;
- }
-
- // }}}
-
- // {{{ title()
-
- /**
- * title: create the title for the page.
- * this should be only done for all but the home page.
- * $title = ( $catid != 1 ) ? $toolbox->title() : '';
- *
- * @uses GLM_DB::db_auto_get_data()
- *
- * @return string
- * @access public
- */
- function title()
- {
- $query = "
- SELECT category,intro,title
- FROM bus_category
- WHERE id = :id";
- try {
- $stmt = $this->dbh->prepare($query);
- $stmt->bindParam(":id", $this->catid, PDO::PARAM_INT);
- $stmt->execute();
- $data = $stmt->fetchAll();;
- } catch(PDOException $e) {
- echo ''.print_r($e, true).' ';
- die($e->getMessage());
- }
-
- if ($data[0]['title']) {
- $title = strip_tags($data[0]['title']);
- } else if ($data[0]['intro']) {
- $title = strip_tags($data[0]['intro']);
- } else {
- $title = strip_tags($data[0]['category']);
- }
- return htmlentities($title.' - ',ENT_QUOTES,'UTF-8');
- }
-
- // }}}
-
- // {{{ valid_email()
-
- /** valid email
- *
- * Checks for a valid format and good (mx check)
- * email address.
- * @deprecated using GLM_TOOLBOX::valid_email()
- * @uses GLM_TOOLBOX::valid_email()
- *
- * @param string email the email address as string.
- * @return boolean
- */
- function valid_email( $email )
- {
- return GLM_TOOLBOX::valid_email( $email );
- }
-
- // }}}
-}
-?>
diff --git a/classes/class_threads.inc b/classes/class_threads.inc
deleted file mode 100644
index 9e7f2c0..0000000
--- a/classes/class_threads.inc
+++ /dev/null
@@ -1,86 +0,0 @@
-";
- var $beginLevel2 = "";
- var $beginItem = "";
- var $beginItem2 = " ";
- var $endItem = " ";
- var $wholeThread;
- var $select_value;
- var $bg_style = array();
- function Thread( $code = "", $select_value = "" ) {
- if( !empty( $code ) ) {
- $this->beginLevel = $code['beginLevel'];
- $this->beginLevel2 = $code['beginLevel2'];
- $this->endLevel = $code['endLevel'];
- $this->beginItem = $code['beginItem'];
- $this->beginItem2 = $code['beginItem2'];
- $this->endItem = $code['endItem'];
- }
- if( $select_value ){
- $this->select_value = $select_value;
- }
- $this->bg_style[0] = 'background-color:#77A94C;color:#000;';
- $this->bg_style[1] = 'background-color:#9FCF74;color:#000;';
- $this->bg_style[2] = 'background-color:#C8EFA4;color:#000;';
- $this->bg_style[3] = 'background-color:#E6FFCF;color:#000;';
- $this->bg_style[4] = 'background-color:#ffffff;color:#000;';
- }
- function sortChilds( $threads ) {
- while( list( $var, $value ) = each( $threads ) ){
- $childs[$value['parent']][$value['ID']] = $value;
- }
- return $childs;
- }
- function convertToThread( $threads, $thread ){
- static $count;
- if( !$count ){
- $this->wholeThread .= $this->beginLevel2;
- }
- else{
- $this->wholeThread .= $this->beginLevel;
- }
- while( list( $parent, $value ) = each( $thread ) ){
- if( $threads[$parent] ){
- $this->wholeThread .= $this->beginItem2;
- }
- else{
- $this->wholeThread .= $this->beginItem;
- }
- $count++;
- $this->wholeThread .= $value['content'].$this->endItem."\n";
- if( $threads[$parent] && !$value['closed'] ){
- $this->convertToThread($threads, $threads[$parent]);
- }
- $count--;
- }
- $this->wholeThread .= $this->endLevel;
- return $this->wholeThread;
- }
- function convertToSelect( $threads, $thread ){
- static $count;
- $count = ( $count <= 0 ) ? 0 : $count;
- while( list( $parent, $value ) = each( $thread ) ){
- $count++;
- $this->wholeThread .= 'select_value == $value['value'] ){
- $this->wholeThread .= ' selected';
- }
- $this->wholeThread .= ' style="'.$this->bg_style[$count].'"';
- $this->wholeThread .= '>';
- if( $count != 0 ){
- $this->wholeThread .= str_repeat( " ", $count );
- }
- $this->wholeThread .= htmlspecialchars( $value['text'] );
- $this->wholeThread .= ' '."\n";
- if( $threads[$parent] && !$value['closed'] ){
- $this->convertToSelect( $threads, $threads[$parent] );
- }
- $count--;
- }
- $this->wholeThread .= $this->endLevel;
- return $this->wholeThread;
- }
-}
-?>
diff --git a/classes/class_toolbox.inc b/classes/class_toolbox.inc
deleted file mode 100755
index 5ab6f1c..0000000
--- a/classes/class_toolbox.inc
+++ /dev/null
@@ -1,1665 +0,0 @@
-
- * These classes and any code is not licensed for anyone but gaslight to use
- *
- *
- * @category Toolbox
- * @package GLM_TOOLBOX
- * @author Steve Sutton
- * @copyright 2005-2008 Gaslight Media
- * @license http://app.gaslightmedia.com/license.php Gaslight Media
- * @link http://www.gaslightmedia.com www.gaslightmedia.com
- * @since $Date: 2010/01/15 19:50:07 $
- */
-/**
- * Toolbox Class :)
- *
- * NOTICE
- * Im going to be moving all functions from the setup.phtml
- * file and putting it into this
- * class. This is so we can eventially move
- * everything to one siteinfo.inc file.
- * matrix@devsys Does this work?
- *
- * @todo move all functions from setup.phtml into here
- */
-define('GLM_TOOLBOX', true);
-
-/**
- * Short description for class
- *
- * Long description (if any) ...
- *
- * @category Toolbox
- * @package GLM_TOOLBOX
- * @author Steve Sutton
- * @copyright 2005-2008 Gaslight Media
- * @license http://app.gaslightmedia.com/license.php Gaslight Media
- * @link http://www.gaslightmedia.com www.gaslightmedia.com
- * @see References to other sections (if any)...
- */
-class GLM_TOOLBOX
-{
- /** @var array php_version */
- var $php_version;
- /** @var boolean true if php is version < 4.2 */
- var $php_old_pg;
- // {{{ __construct()
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @return void
- * @access public
- */
- function __construct()
- {
- $this->php_version = $this->php_version_check();
- $this->php_old_pg = $this->php_old_pg();
- }// }}}
- // {{{ CC_date_entry($month, $year, $month_name, $year_name)
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param string $month Parameter description (if any) ...
- * @param string $year Parameter description (if any) ...
- * @param string $month_name Parameter description (if any) ...
- * @param string $year_name Parameter description (if any) ...
- *
- * @return string Return description (if any) ...
- * @access public
- */
- function CC_date_entry($month, $year, $month_name, $year_name)
- {
- $cur_date = getdate();
- if ($month == "") {
- $month = $cur_date['mon'];
- }
- if ($year == "") {
- $year = $cur_date['year'];
- }
- $date = '';
- for ($i = 1; $i < 13; $i++) {
- $date .= '';
- }
- $date .= ' ';
- $date .= '';
- for ($i = $year; $i < $year + 15; $i++) {
- $date .= '';
- }
- $date .= ' ';
- return $date;
- } // }}}
- // {{{ CreditVal($Num, $Name = '', $Accepted='')
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param unknown $Num Parameter description (if any) ...
- * @param string $Name Parameter description (if any) ...
- * @param string $Accepted Parameter description (if any) ...
- *
- * @return boolean Return description (if any) ...
- * @access public
- */
- function CreditVal($Num, $Name = '', $Accepted='')
- {
- $Name = strtolower($Name);
- $Accepted = strtolower($Accepted);
- $GoodCard = 1;
- $Num = ereg_replace("[^[:digit:]]", "", $Num);
- switch ($Name) {
-
- case "mastercard" :
- $GoodCard = ereg("^5[1-5].{14}$", $Num);
- break;
-
- case "visa" :
- $GoodCard = ereg("^4.{15}$|^4.{12}$", $Num);
- break;
-
- case "americanexpress" :
- $GoodCard = ereg("^3[47].{13}$", $Num);
- break;
-
- case "discover" :
- $GoodCard = ereg("^6011.{12}$", $Num);
- break;
-
- case "dinerscard" :
- $GoodCard = ereg("^30[0-5].{11}$|^3[68].{12}$", $Num);
- break;
-
- default:
- if (ereg("^5[1-5].{14}$", $Num)) {
- $Name = "mastercard";
- }
- if (ereg("^4.{15}$|^4.{12}$", $Num)) {
- $Name = "visa";
- }
- if (ereg("^3[47].{13}$", $Num)) {
- $Name = "americanexpress";
- }
- if (ereg("^6011.{12}$", $Num)) {
- $Name = "discover";
- }
- if (ereg("^30[0-5].{11}$|^3[68].{12}$", $Num)) {
- $Name ="dinerscard";
- }
- break;
- }
-
- // If there's a limit on card types we accept, check for it here.
- if ($Accepted) {
- $type_verified = false;
- $brands = explode(",", $Accepted);
- foreach ($brands as $brand) {
- if ($Name == $brand) {
- $type_verified = true;
- }
- }
- if (!$type_verified) {
- return false;
- }
- }
- $Num = strrev($Num);
- $Total = 0;
- for ($x=0; $x $title) {
- $out .= '
- ';
- }
- return $out;
- }// }}}
- // {{{ build_picklist($fieldname, $data, $selected, $type = "standard",$auto = 0,$width = null)
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param string $fieldname Parameter description (if any) ...
- * @param array $data Parameter description (if any) ...
- * @param unknown $selected Parameter description (if any) ...
- * @param string $type Parameter description (if any) ...
- * @param integer $auto Parameter description (if any) ...
- * @param string $width Parameter description (if any) ...
- *
- * @return string Return description (if any) ...
- * @access public
- */
- function build_picklist($fieldname, $data, $selected, $type = "standard",$auto = 0,$width = null)
- {
- if (!is_array($selected)) {
- $sel[0] = $selected;
- } else {
- $sel = $selected;
- }
- if ($auto == 1) {
- $autosubmit = "onChange=\"form.submit()\"";
- }
- if ($width) {
- $autosubmit .= "style=\"width:".$width."px;\"";
- }
- switch($type) {
- case "multiple":
- $str = "\n";
- while (list($key, $val) = each($data)) {
- if (in_array($key, $sel)) {
- $select = " selected ";
- } else {
- $select = "";
- }
- $str .= " $val\n";
- }
- break;
- case "simple":
- $str = "\n";
- for ($i = 0; $i < count($data); $i++) {
- $select = (in_array($data[$i], $sel)) ? " selected ":"";
- $str .= " ".$data[$i]."\n";
- }
- break;
-
- case "standard":
- default:
- $str = "\n";
- while (list($key, $val) = each($data)) {
- $select = (in_array($key, $sel)) ? " selected ":"";
- $str .= " $val\n";
- }
- break;
- }
- $str .= " \n";
- return $str;
- }// }}}
- // {{{ build_radios($name, $data)
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param string $name Parameter description (if any) ...
- * @param array $data Parameter description (if any) ...
- *
- * @return mixed Return description (if any) ...
- * @access public
- */
- function build_radios($name, $data)
- {
- if (!is_array($selected)) {
- $sel[0] = $selected;
- } else {
- $sel = $selected;
- }
- if (!is_array($data)) {
- return false;
- }
- $count = 1;
- foreach ($data as $field => $title) {
- $out .= '
- ';
- $count++;
- }
- return $out;
- }// }}}
- // {{{ calendar_entry_input($name, $value, $icon_path)
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param string $name Parameter description (if any) ...
- * @param unknown $value Parameter description (if any) ...
- * @param string $icon_path Parameter description (if any) ...
- *
- * @return string Return description (if any) ...
- * @access public
- */
- function calendar_entry_input($name, $value, $icon_path)
- {
- $out = '
-
-
- ';
- return $out;
- }// }}}
- // {{{ calendar_entry_javascript($name, $value)
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param string $name Parameter description (if any) ...
- * @param string $value Parameter description (if any) ...
- *
- * @return string Return description (if any) ...
- * @access public
- */
- function calendar_entry_javascript($name, $value)
- {
- $out .= '
- ';
- return $out;
- }// }}}
- // {{{ contact_date_entry($month,$day,$year,$month_name,$day_name,$year_name)
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param string $month Month
- * @param string $day Day
- * @param string $year Year
- * @param string $month_name id and name value of month
- * @param string $day_name id and name value of day
- * @param string $year_name id and name value of year
- * @param string $onChange must be onChange="javzascript;"
- *
- * @return string Return description (if any) ...
- * @access public
- */
- function contact_date_entry($month,$day,$year,$month_name,$day_name,$year_name,$onChange = null)
- {
- $cur_date = getdate();
-
- if ($month == "") {
- $month = $cur_date['mon'];
- }
- if ($day == "") {
- $day = $cur_date['mday'];
- }
- if ($year == "") {
- $year = $cur_date['year'];
- }
- $date = '';
- for ($i=1;$i<13;$i++) {
- $date .= '';
- }
- $date .= ' ';
- $date .= '';
- for ($i=1;$i<32;$i++) {
- $date .= '';
- }
- $date .= ' ';
- $date .= '';
- $ystart = $cur_date['year'] - 10;
- for ($i=$ystart;$i<=$year;$i++) {
- $date .= '';
- }
- $date .= ' ';
- return $date;
- }// }}}
- // {{{ cp1252_to_utf8($str)
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param unknown $str Parameter description (if any) ...
- *
- * @return array Return description (if any) ...
- * @access public
- */
- function cp1252_to_utf8($str)
- {
- $cp1252_map = array(
- "\xc2\x80" => "\xe2\x82\xac", /* EURO SIGN */
- "\xc2\x82" => "\xe2\x80\x9a", /* SINGLE LOW-9 QUOTATION MARK */
- "\xc2\x83" => "\xc6\x92", /* LATIN SMALL LETTER F WITH HOOK */
- "\xc2\x84" => "\xe2\x80\x9e", /* DOUBLE LOW-9 QUOTATION MARK */
- "\xc2\x85" => "\xe2\x80\xa6", /* HORIZONTAL ELLIPSIS */
- "\xc2\x86" => "\xe2\x80\xa0", /* DAGGER */
- "\xc2\x87" => "\xe2\x80\xa1", /* DOUBLE DAGGER */
- "\xc2\x88" => "\xcb\x86", /* MODIFIER LETTER CIRCUMFLEX ACCENT */
- "\xc2\x89" => "\xe2\x80\xb0", /* PER MILLE SIGN */
- "\xc2\x8a" => "\xc5\xa0", /* LATIN CAPITAL LETTER S WITH CARON */
- "\xc2\x8b" => "\xe2\x80\xb9", /* SINGLE LEFT-POINTING ANGLE QUOTATION */
- "\xc2\x8c" => "\xc5\x92", /* LATIN CAPITAL LIGATURE OE */
- "\xc2\x8e" => "\xc5\xbd", /* LATIN CAPITAL LETTER Z WITH CARON */
- "\xc2\x91" => "\xe2\x80\x98", /* LEFT SINGLE QUOTATION MARK */
- "\xc2\x92" => "\xe2\x80\x99", /* RIGHT SINGLE QUOTATION MARK */
- "\xc2\x93" => "\xe2\x80\x9c", /* LEFT DOUBLE QUOTATION MARK */
- "\xc2\x94" => "\xe2\x80\x9d", /* RIGHT DOUBLE QUOTATION MARK */
- "\xc2\x95" => "\xe2\x80\xa2", /* BULLET */
- "\xc2\x96" => "\xe2\x80\x93", /* EN DASH */
- "\xc2\x97" => "\xe2\x80\x94", /* EM DASH */
-
- "\xc2\x98" => "\xcb\x9c", /* SMALL TILDE */
- "\xc2\x99" => "\xe2\x84\xa2", /* TRADE MARK SIGN */
- "\xc2\x9a" => "\xc5\xa1", /* LATIN SMALL LETTER S WITH CARON */
- "\xc2\x9b" => "\xe2\x80\xba", /* SINGLE RIGHT-POINTING ANGLE QUOTATION*/
- "\xc2\x9c" => "\xc5\x93", /* LATIN SMALL LIGATURE OE */
- "\xc2\x9e" => "\xc5\xbe", /* LATIN SMALL LETTER Z WITH CARON */
- "\xc2\x9f" => "\xc5\xb8" /* LATIN CAPITAL LETTER Y WITH DIAERESIS*/
- );
- return strtr(utf8_encode($str), $cp1252_map);
- }// }}}
- // {{{ create_href($options)
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param array $options Parameter description (if any) ...
- *
- * @return mixed Return description (if any) ...
- * @access public
- */
- function create_href($options)
- {
- if (!is_array($options)) {
- return false;
- } else {
- $id = ($options['id'] && $options['id'] != '')
- ? ' id="'.$options["id"].'"': '';
- $title = ($options['title'] && $options['title'] != '')
- ? ' title="'.$options["title"].'"': '';
- $class = ($options['class'] && $options['class'] != '')
- ? ' class="'.$options["class"].'"': '';
- $text = ($options['text'] && $options['text'] != '')
- ? strip_tags($options["text"]) : '';
- $onClick = ($options['onClick'] && $options['onClick'] != '')
- ? ' onClick="'.$options["onClick"].'"': '';
- $onMouseover = ($options['onMouseover'] && $options['onMouseover'] != '')
- ? ' onMouseover="'.$options["onMouseover"].'"': '';
- $onMouseout = ($options['onMouseout'] && $options['onMouseout'] != '')
- ? ' onMouseout="'.$options["onMouseout"].'"': '';
- $out = ''.$text.' ';
- return $out;
- }
- }// }}}
- // {{{ create_page_links($totalnum,$num,$start=0,$params,$page_length=ENTRIES_PER_PAGE)
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param mixed $totalnum Parameter description (if any) ...
- * @param unknown $num Parameter description (if any) ...
- * @param number $start Parameter description (if any) ...
- * @param unknown $params Parameter description (if any) ...
- * @param number $page_length Parameter description (if any) ...
- *
- * @return string Return description (if any) ...
- * @access public
- */
- function create_page_links($totalnum,$num,$start=0,$params=null,
- $page_length=ENTRIES_PER_PAGE)
- {
- // FIND out which page we're on.
- if ($totalnum!=0) {
- $total_pages = floor($totalnum / $page_length); // total pages = the total result divided by page length rounded down
- $total_pages++; // then add one
- if ($start == 0) { // if start is 0 then page is one {
- $page = 1;
- } else {
- $page = ($start / $page_length) + 1;
- }
- }
-
- if ($totalnum > $page_length && ($page != $totalpages)) {
- $end = $page_length + $start;
- } else {
- $end = $totalnum;
- }
- $last = $start - $page_length;
- if (($start - $page_length) < 0) {
- $prev = "";
- } else {
- $prev = "[PREVIOUS PAGE ]";
- }
- if ($end < $totalnum) {
- $next = "[NEXT PAGE ]";
- } else {
- $next = "";
- }
- $starting = $start + 1;
- $last_c = $start + $num;
- $links = 'Showing: '.$starting.' to '
- .$last_c.' of '.$totalnum.'
'.$prev. ' '
- .$next.'
';
- return $links;
- }// }}}
- // {{{ create_sitemap()
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @return void
- * @access public
- */
- function create_sitemap()
- {
- $page = new Toolkit_Page(new GLM_TEMPLATE(9999));
- // 404 pages must not contain any links (including css)
- //$page->createErrorDocument();
- }// }}}
- // {{{ date_entry($month,$day,$year,$month_name,$day_name,$year_name)
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param string $month Month
- * @param string $day Day
- * @param string $year Year
- * @param string $month_name id and name value of month
- * @param string $day_name id and name value of day
- * @param string $year_name id and name value of year
- * @param string $onChange must be onChange="javzascript;"
- *
- * @return string Return description (if any) ...
- * @access public
- */
- function date_entry($month,$day,$year,$month_name,$day_name,$year_name,$onChange = null)
- {
- $cur_date = getdate();
- if ($month == "") {
- $month = $cur_date['mon'];
- }
- if ($day == "") {
- $day = $cur_date['mday'];
- }
- if ($year == "") {
- $year = $cur_date['year'];
- }
- $date = '';
- for ($i=1;$i<13;$i++) {
- $date .= '';
- }
- $date .= ' ';
- $date .= '';
- for ($i=1;$i<32;$i++) {
- $date .= '';
- }
- $date .= ' ';
- $date .= '';
- for ($i=2000;$i<2023;$i++) {
- $date .= '';
- }
- $date .= ' ';
- return $date;
- } // }}}
- // {{{ explode_template($template,$data)
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param boolean $template Parameter description (if any) ...
- * @param unknown $data Parameter description (if any) ...
- *
- * @return boolean Return description (if any) ...
- * @access public
- */
- function explode_template($template,$data)
- {
- $template = GLM_TOOLBOX::template_read($template);
- $output = GLM_TOOLBOX::template_replacement($template, $data);
- return $output;
-
- }// }}}
- // {{{ file_upload($form_field, $file_name, $destination_path, $restricted = false)
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @param unknown $form_field Parameter description (if any) ...
- * @param string $file_name Parameter description (if any) ...
- * @param string $destination_path Parameter description (if any) ...
- * @param boolean $restricted Parameter description (if any) ...
- *
- * @return array Return description (if any) ...
- * @access public
- */
- function file_upload($form_field, $file_name, $destination_path, $restricted = false)
- {
- $file_name_in_use = false;
- $file_name = ereg_replace("[!@#$%^&()+={};:\'\"\/ ]", "-", $file_name);
- if ($restricted) {
- $size = getImageSize($form_field);
- if (!in_array($size[2], array(1, 2, 3))) {
- echo ''
- .'The file you uploaded was of an incorect type, please only upload .gif,.png or .jpg files'
- .' '
- .'
'
- ."Hit your browser's back button to continue"
- .'';
- $error[0] = "ERROR";
- return $error;
- }
- }
- if (file_exists($destination_path.$file_name)) {
- $file_name_in_use = true;
- }
- if ($file_name_in_use == true) {
- $new_file_name = mktime().$file_name;
- $new_file_location = $destination_path.$new_file_name;
- copy($form_field, $new_file_location);
- $file_upload = $new_file_name;
- $file_upload_array = array($new_file_name, $new_file_location);
- } else {
- $new_file_name = $file_name;
- $new_file_location = $destination_path.$new_file_name;
- copy($form_field, $new_file_location);
- $file_upload = $new_file_name;
- $file_upload_array = array($new_file_name, $new_file_location);
- }
- if (is_file($new_file_location)) {
- chmod($new_file_location, 0666);
- }
- if ($restricted) {
- return $file_upload_array;
- } else {
- return $file_upload;
- }
- }// }}}
- // {{{ footer()
-
-
- /**
- * Short description for function
- *
- * Long description (if any) ...
- *
- * @return void
- * @access public
- */
- function footer()
- {
- $out = '
-