initial commit

This commit is contained in:
bmen 2019-09-22 16:53:30 +02:00
commit d6a4fc4f76
242 changed files with 23113 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.svn

23
.htaccess Normal file
View File

@ -0,0 +1,23 @@
Options FollowSymLinks
RewriteEngine on
RewriteBase /
# Weiterleitung zu Subdomains
# RewriteRule ^(demo)(.*)$ http://$1.2erlei.de$2 [L]
# Federleicht-# Spezielle Weiterleitungsregeln
RewriteRule ^favicon.ico$ /public/img/favicon.ico [L]
RewriteRule ^robots.txt$ /public/robots.txt [L]
# Federleicht-Verzeichnisse sperren
# Wenn diese Namen als Modul verwendet werden,
# hier loeschen und weiter unten eintragen.
RewriteRule ^(app|cache|config|fl|log|script|test|private)(.*)$ / [R=301]
# Daten auf oeffentliches Verzeichnis umleiten
RewriteRule ^(css|img|js|php)(.*)$ /public/$1$2 [R]
# installierte Module von Federleicht verarbeiten lassen.
RewriteRule ^(user|basecontent|about|coding|design|pages|portfolio)(.*)$ - [C]
RewriteRule ^(.*)$ index.php [L]

45
INSTALL Normal file
View File

@ -0,0 +1,45 @@
Hinweise zur Einrichtung
========================
DATENBANK
Die Datei config/database.ini muss erzeugt werden. config/database.ini.sample
kann dafuer kopiert und angepasst werden.
Derzeit wird keine Datenbank verwendet. Daher ist in der config/database.ini
type=null einzutragen.
SCRIPTSPRACHEN
Fuer den Betrieb der Webseite ist PHP erforderlich. Getestet wurde mit
Version 5.2.
WEBSERVER
Das PHP-Framework nutzt URL-Rewriting. Daher sollte ein Apache-Webserver mit
mod_rewrite verwendet werden.
In die Apachekonfiguration muss aufgenommen werden:
# This Directory contains the upload.cgi-Script
# As it is accessible anyway, make it a cgi-dir...
<Directory /path/to/htdocs/public/cgi>
SetHandler cgi-script
Options +ExecCGI
</Directory>
Dies sollte im entsprechenden VirtualHost-Abschnitt stehen.
Kurzfassung der Anforderungen
=============================
Apache 2
Apache-Modul "mod_rewrite"
<Directory [...]/public/cgi>
config/database.ini
PHP 5.2

View File

@ -0,0 +1,21 @@
<meta name="language" content="de" />
<meta name="robots" content="index, follow" />
<meta name="copyright" content="All rights reserved" />
<link rel="start" href="/" />
<link rel="shortcut icon" href="/public/img/basecontent.ico" />
<link rel="stylesheet" href="/public/css/admin.css" type="text/css" media="screen,projection" />
<!--[if lte IE 6]>
<link rel="stylesheet" href="/public/css/admin_ie.css" type="text/css" media="screen, presentation" />
<![endif]-->
<script type="text/javascript" src="/public/js/basescript.js"></script>
<script type="text/javascript" src="/public/js/bereiche.js"></script>
<script type="text/javascript" src="/public/js/buttons.js"></script>
<script type="text/javascript" src="/public/js/moo.fx.js"></script>
<script type="text/javascript" src="/public/js/moo.fx.pack.js"></script>
<script type="text/javascript" src="/public/js/scriptaculous/prototype.js"></script>
<script type="text/javascript" src="/public/js/scriptaculous/scriptaculous.js"></script>

17
app/elements/bc_info.php Normal file
View File

@ -0,0 +1,17 @@
<?php if (!empty($vars['flash']) ) { ?>
<fieldset id="bc_info" class="bereich_static"><h3>Meldungen</h3>
<div class="formtop"> &nbsp; </div>
<div class="flash"><?php echo( $vars['flash'] ); ?></div>
<div class="fieldbottom"> &nbsp; </div>
<div class="formbottom"> &nbsp; </div>
</fieldset>
<?php } /* end of if */?>
<fieldset id="adminhelp" class="bereich_indiv <?php $vars['model']->get_display('adminhelp'); ?> spalte2"><h3>Hilfe</h3>
<div class="formtop"> &nbsp; </div>
<?php $vars['model']->get_help($vars['cap']['controller'], $vars['cap']['action']); ?>
<div class="fieldbottom"> &nbsp; </div>
<p class="formbuttons"><a href="/public/pdf/handbuch.pdf"><img src="/public/img/admin/button_handbuch.gif" width="69" height="20" alt="Handbuch" /></a></p>
<div class="formbottom"> &nbsp; </div>
</fieldset>

6
app/elements/bc_nav.php Normal file
View File

@ -0,0 +1,6 @@
<p>
<a href="/basecontent/" id="startlink">Startseite</a><span class="separator"> | </span>
<a href="/basecontent/webframe/pages" target="preview">Webseite ansehen</a><span class="separator"> | </span>
<a href="/user/">Benutzerverwaltung</a><span class="separator"> | </span>
<a href="/basecontent/trashcan/">Papierkorb</a>
</p>

View File

@ -0,0 +1,12 @@
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
function startGoogleStatistics() {
if(typeof(urchinTracker) == "undefined") {
window.setTimeout("startGoogleStatistics()", 1000);
} else {
_uacct = "UA-3472659-1";
urchinTracker();
}
}
</script>

View File

@ -0,0 +1,9 @@
<p><b>Haftungsausschluss:</b></p>
<p>Die 2erlei übernimmt keine Garantie dafür, dass die auf dieser Website
bereitgestellten Informationen vollständig, richtig und in jedem Fall aktuell
sind. Dies gilt auch für alle Verbindungen ("Links"), auf die diese Website
direkt oder indirekt verweist. 2erlei Berlin ist für den Inhalt einer Seite,
die mit einem solchen Link erreicht wird, nicht verantwortlich. 2erlei Berlin
behält sich das Recht vor, ohne vorherige Ankündigung Änderungen oder
Ergänzungen der bereitgestellten Informationen vorzunehmen.</p>

17
app/elements/header.php Normal file
View File

@ -0,0 +1,17 @@
<meta content="de" name="language">
<meta content="index, follow" name="robots">
<meta content="All rights reserved" name="copyright">
<meta content="Bastian Menningen, Norman Treiber, Matthias Viehweger" name="author">
<meta content="" name="description">
<meta content="2erlei, basecontent, Agentur, Medienagentur, Medienproduktion, Webseite, CMS, Content Management System, Cooporate Identity, Internetdienstleister, Internetseite, Webdesign, HTML" name="keywords">
<link href="/" rel="start">
<link href="/pages/impressum" rel="copyright">
<link href="/pages/impressum" rel="author">
<link href="/public/img/favicon.ico" rel="shortcut icon">
<link media="screen,projection" href="/public/css/screen.css" type="text/css" rel="stylesheet">
<!--[if IE]>
<link media="screen" href="/public/css/screen_ie.css" type=text/css rel=stylesheet>
<![endif]-->
<link rel="stylesheet" href="/public/css/lightbox.css" type="text/css" media="screen">
<link media="print" href="/css/print.css" type="text/css" rel="stylesheet">

View File

@ -0,0 +1,11 @@
<p><a href="/" class="start">Startseite</a></p>
<?php /*
<!--
<p><a href="/basecontent">Kunden-Login</a></p>
<p><a href="/pages/sitemap" class="sitemap">Sitemap</a></p>
<p><a href="/pages/contact" class="contact">Kontakt</a></p>
-->
<!-- <p><a href="/">Support/ Hilfe</a></p>
<p><a href="/">FAQ/ Frequently asked Questions</a></p> -->
*/ ?>

View File

@ -0,0 +1 @@
<script type="text/javascript" src="/public/js/lightbox/prototype.js"></script> <script type="text/javascript" src="/public/js/lightbox/scriptaculous.js?load=effects"></script> <script type="text/javascript" src="/public/js/lightbox/lightbox.js"></script>

View File

@ -0,0 +1,14 @@
<p>
<?php /*
<a href="/design/" class="design">Form &amp; Farbe</a>
<span class="separator"> | </span>
<a href="/coding/" class="coding">Code &amp; Technik</a>
<span class="separator"> | </span>
<a href="/about/" class="about">&uuml;ber 2erlei</a>
<span class="separator"> | </span>
*/ ?>
<a href="/portfolio/" class="portfolio">&nbsp; Referenzen</a>
<span class="separator"> | </span>
<a href="/pages/contact/" class="contact">Kontakt</a>
</p>

View File

@ -0,0 +1,21 @@
<?php
$aktiv = isset($vars['aktiv'])? $vars['aktiv'] : 'webdesign';
$aktiver_link = 'class="aktiv"';
$web_aktiv = ( $aktiv == 'webdesign' )? $aktiver_link: '';
$drucksachen_aktiv = ( $aktiv == 'drucksachen' )? $aktiver_link: '';
$logo_aktiv = ( $aktiv == 'logo' )? $aktiver_link: '';
$frei_aktiv = ( $aktiv == 'frei' )? $aktiver_link: '';
$foto_aktiv = ( $aktiv == 'foto' )? $aktiver_link: '';
?>
<div id="subnavigation">
<p><a href="/portfolio" <?php echo $web_aktiv; ?>>Web</a></p>
<p><a href="/portfolio/drucksachen" <?php echo $drucksachen_aktiv; ?>>Print</a></p>
<p><a href="/portfolio/logo" <?php echo $logo_aktiv; ?>>Logos</a></p>
<?php /*
<p><a href="/portfolio/frei" <?php echo $frei_aktiv; ?>>freie Arbeiten</a></p>
<p><a href="/portfolio/foto" <?php echo $foto_aktiv; ?>>Fotogalerie</a></p>
*/ ?>
</div>

8
app/elements/unten.php Normal file
View File

@ -0,0 +1,8 @@
<p>
2005 - 2012 &nbsp; 2erlei Konzeption &amp; Gestaltung &nbsp;
<span class="separator">|</span>
<a href="/pages/contact">Kontakt</a>
<span class="separator">|</span>
<a href="/pages/impressum">Impressum</a>
</p>

101
app/helper/bereiche.php Normal file
View File

@ -0,0 +1,101 @@
<?php
/**
* HTML-Helfer für die baseContent-Bereiche
*
* @author Matthias Viehweger <kronn@kronn.de>
* @version 0.2
* @license All Rights Reserved
*/
class bereiche {
var $indent;
var $indent_str = '';
/**
* Konstruktor
*
* @param int $indent
*/
function bereiche($indent=3) {
$this->indent = (int) $indent;
if( $this->indent == 3 ) $this->indent_str = "\t\t\t";
}
/**
* Oberen Abschluss des Bereichs ausgeben
*
* @param string $id ID des Bereichs
* @param string $title Überschrift des Bereichs
*/
function oben($id, $title) {
$html[] = '<fieldset id="'.$id.'"><h3>'.$title.'</h3>';
$html[] = ' <div class="formtop"> &nbsp; </div>';
$this->output($html);
}
/**
* Trennstrich einfügen
*/
function unterbrechung() {
$html[] = ' <div class="fieldbottom"> &nbsp; </div>';
$html[] = ' <div class="fieldstart"> &nbsp; </div>';
$this->output($html);
}
/**
* Buttons ausgeben
*
* @param string $buttons Kommaseparierte Liste der einzufügenden Buttons
*/
function buttons($buttons='') {
$html[] = ' <div class="fieldbottom"> &nbsp; </div>';
if ($buttons != '') {
needs('buttons');
$the_buttons = new buttons();
$html[] = ' <p class="formbuttons">';
$buttons = explode(',', $buttons);
foreach( $buttons as $button ) {
@list($button_method, $button_param) = explode(':', $button);
if ( method_exists($the_buttons, $button_method) ) {
$buttonhtml = $the_buttons->$button_method($button_param);
} else {
$buttonhtml = '';
}
$html[] = ' ' . $buttonhtml;
}
$js = $the_buttons->get_js();
if ( $js != '' ) {
$html[] = $js;
}
$html[] = ' </p>';
}
$this->output($html);
}
/**
* Unteren Abschluss des Bereichs ausgeben
*/
function unten() {
$html[] = ' <div class="formbottom"> &nbsp; </div>';
$html[] = '</fieldset>';
$this->output($html);
}
/**
* Ausgabe des HTML
*
* @param array $html
*/
function output($html) {
foreach( $html as $line ) {
echo $this->indent_str . $line . PHP_EOL;
}
}
}
?>

94
app/helper/buttons.php Normal file
View File

@ -0,0 +1,94 @@
<?php
/**
* HTML-Helfer für die baseContent-Buttons
*
* Alle Buttons sind entsprechend ihrer Funktion über einen deutschen Namen
* verfügbar. Umlaute sind ggf. als ue, oe, ss, ... geschrieben.
*
* @author Matthias Viehweger <kronn@kronn.de>
* @version 0.1
* @license All Rights Reserved
*/
class buttons {
var $javascript = '';
function buttons() {
}
function get_js() {
if ( $this->javascript == '' ) return '';
$js = '';
$js .= '<script type="text/javascript">' . PHP_EOL . '// <[CDATA[' . PHP_EOL;
$js .= $this->javascript;
$js .= '// ]]>' . PHP_EOL . '</script>';
$this->javascript = '';
return $js;
}
function add_js($js) {
$this->javascript .= $js . PHP_EOL;
}
function weiter($next) {
$html = '<a href="#'.$next.'" id="weiter-'.$next.'"><img src="/public/img/admin/button_weiter.gif" alt="weiter" /></a>';
$this->add_js("var field = $('weiter-".$next."'); field.href = \"javascript:Bereiche.toggle('" . $next . "');\";");
return $html;
}
function zurueck($prev) {
$html = '<a href="#'.$prev.'" id="zurueck-'.$prev.'"><img src="/public/img/admin/button_zurueck.gif" alt="zur&uuml;ck" /></a>';
$this->add_js("var field = $('zurueck-".$prev."'); field.href = \"javascript:Bereiche.toggle('" . $prev . "');\";");
return $html;
}
function speichern() {
$html = '<input type="image" src="/public/img/admin/button_speichern.gif" alt="speichern" />';
return $html;
}
function zuordnen() {
$html = '<input type="image" src="/public/img/admin/button_zuordnen.gif" alt="Zuordnen" />';
return $html;
}
function abbrechen($target='/') {
$html = '<a href="'.$target.'" id="abbrechen-button"><img src="/public/img/admin/button_abbrechen.gif" width="69" height="20" alt="Abbrechen" /></a>';
$this->add_js("var field = $('abbrechen-button'); field.href = \"javascript:window.history.back();\";");
return $html;
}
function hinzufuegen($target='/') {
$html = '<a href="'.$target.'"><img src="/public/img/admin/button_hinzufuegen.gif" width="69" height="20" alt="hinzuf&uuml;gen" /></a>';
return $html;
}
function loeschen($target='/') {
$html = '<a href="'.$target.'"><img src="/public/img/admin/button_loeschen.gif" width="69" height="20" alt="l&ouml;schen" /></a>';
return $html;
}
function uebernehmen($target='/') {
$html = '<a href="'.$target.'"><img src="/public/img/admin/button_uebernehmen.gif" width="90" height="20" alt="l&ouml;schen" /></a>';
return $html;
}
/**
* Reine JavaScript-Buttons hinzufügen
*
* @param string $params Die Parameter werden wie folgt erwartet:
* modulname-bereichid-jsname-buttons
*
* Die Buttons werden dabei wie folgt erwartet:
* button1/button2/button3
*/
function js($params) {
list($modul, $bereich, $js_name, $buttons) = explode('-', $params);
$buttons = explode('/', $buttons);
$this->add_js($js_name . ' = new Buttons(\''.$modul.'\', \''.$bereich.'\');');
$this->add_js($js_name . '.write(\''.$js_name.'\', [\''.implode('\',\'', $buttons).'\']);');
}
}
?>

View File

@ -0,0 +1,861 @@
<?php
/**
* MiniXML - PHP class library for generating and parsing XML.
*
* @package miniXML
* @author Patrick Deegan, Psychogenic.com
* @license GPL
*/
/*
#define("MINIXML_COMPLETE_REGEX",'/<\s*([^\s>]+)([^>]+)?>(.*?)<\s*\/\\1\s*>\s*([^<]+)?(.*)|\s*<!--(.+?)-->\s*|^\s*<\s*([^\s>]+)([^>]*)\/\s*>\s*([^<>]+)?|<!\[CDATA\s*\[(.*?)\]\]\s*>|<!DOCTYPE\s*([^\[]*)\[(.*?)\]\s*>|<!ENTITY\s*([^"\'>]+)\s*(["\'])([^\14]+)\14\s*>|^([^<]+)(.*)/smi');
*/
define("MINIXML_COMPLETE_REGEX",'/^\s*<\s*([^\s>]+)(\s+[^>]+)?>(.*?)<\s*\/\1\s*>\s*([^<]+)?(.*)|^\s*<!--(.+?)-->\s*(.*)|^\s*<\s*([^\s>]+)([^>]+)\/\s*>\s*(.*)|^\s*<!\[CDATA\s*\[(.*?)\]\]\s*>\s*(.*)|^\s*<!DOCTYPE\s*([^\[]*)\[(.*?)\]\s*>\s*(.*)|^\s*<!ENTITY\s*([^"\'>]+)\s*(["\'])([^\17]+)\17\s*>\s*(.*)|^([^<]+)(.*)/smi');
/*
#define("MINIXML_SIMPLE_REGEX",
# // 1 2 3 4 5 6 7 8 9 #10 11
#'/\s*<\s*([^\s>]+)([^>]+)?>(.*?)<\s*\/\\1\s*>\s*([^<]+)?(.*)|\s*<!--(.+?)-->\s*|\s*<\s*([^\s>]+)([^>]*)\/\s*>\s*([^<>]+)?|^([^<]+)(.*)/smi');
*/
define("MINIXML_SIMPLE_REGEX",'/^\s*<\s*([^\s>]+)(\s+[^>]+)?>(.*?)<\s*\/\1\s*>\s*([^<]+)?(.*)|^\s*<!--(.+?)-->\s*(.*)|^\s*<\s*([^\s>]+)([^>]+)\/\s*>\s*(.*)|^([^<]+)(.*)/smi');
require_once(MINIXML_CLASSDIR . "/element.inc.php");
/***************************************************************************************************
****************************************************************************************************
*****
***** MiniXMLDoc
*****
****************************************************************************************************
***************************************************************************************************/
/* MiniXMLDoc class
**
** The MiniXMLDoc class is the programmer's handle to MiniXML functionality.
**
** A MiniXMLDoc instance is created in every program that uses MiniXML.
** With the MiniXMLDoc object, you can access the root MiniXMLElement,
** find/fetch/create elements and read in or output XML strings.
**/
class MiniXMLDoc {
var $xxmlDoc;
var $xuseSimpleRegex;
var $xRegexIndex;
/* MiniXMLDoc [XMLSTRING]
** Constructor, create and init a MiniXMLDoc object.
**
** If the optional XMLSTRING is passed, the document will be initialised with
** a call to fromString using the XMLSTRING.
**
*/
function MiniXMLDoc ($string=NULL)
{
/* Set up the root element - note that it's name get's translated to a
** <? xml version="1.0" ?> string.
*/
$this->xxmlDoc = new MiniXMLElement("PSYCHOGENIC_ROOT_ELEMENT");
$this->xuseSimpleRegex = MINIXML_USE_SIMPLE;
if (! is_null($string))
{
$this->fromString($string);
}
}
function init ()
{
$this->xxmlDoc = new MiniXMLElement("PSYCHOGENIC_ROOT_ELEMENT");
}
/* getRoot
** Returns a reference the this document's root element
** (an instance of MiniXMLElement)
*/
function &getRoot ()
{
return $this->xxmlDoc;
}
/* setRoot NEWROOT
** Set the document root to the NEWROOT MiniXMLElement object.
**/
function setRoot (&$root)
{
if ($this->isElement($root))
{
$this->xxmlDoc = $root;
} else {
return _MiniXMLError("MiniXMLDoc::setRoot(): Trying to set non-MiniXMLElement as root");
}
}
/* isElement ELEMENT
** Returns a true value if ELEMENT is an instance of MiniXMLElement,
** false otherwise.
*/
function isElement (&$testme)
{
if (is_null($testme))
{
return 0;
}
return method_exists($testme, 'MiniXMLElement');
}
/* isNode NODE
** Returns a true value if NODE is an instance of MiniXMLNode,
** false otherwise.
*/
function isNode (&$testme)
{
if (is_null($testme))
{
return 0;
}
return method_exists($testme, 'MiniXMLNode');
}
/* createElement NAME [VALUE]
** Creates a new MiniXMLElement with name NAME.
** This element is an orphan (has no assigned parent)
** and will be lost unless it is appended (MiniXMLElement::appendChild())
** to an element at some point.
**
** If the optional VALUE (string or numeric) parameter is passed,
** the new element's text/numeric content will be set using VALUE.
**
** Returns a reference to the newly created element (use the =& operator)
*/
function &createElement ($name=NULL, $value=NULL)
{
$newElement = new MiniXMLElement($name);
if (! is_null($value))
{
if (is_numeric($value))
{
$newElement->numeric($value);
} elseif (is_string($value))
{
$newElement->text($value);
}
}
return $newElement;
}
/* getElement NAME
** Searches the document for an element with name NAME.
**
** Returns a reference to the first MiniXMLElement with name NAME,
** if found, NULL otherwise.
**
** NOTE: The search is performed like this, returning the first
** element that matches:
**
** - Check the Root Element's immediate children (in order) for a match.
** - Ask each immediate child (in order) to MiniXMLElement::getElement()
** (each child will then proceed similarly, checking all it's immediate
** children in order and then asking them to getElement())
*/
function &getElement ($name)
{
$element = $this->xxmlDoc->getElement($name);
if (MINIXML_DEBUG > 0)
{
_MiniXMLLog("MiniXMLDoc::getElement(): Returning element $element");
}
return $element;
}
/* getElementByPath PATH
** Attempts to return a reference to the (first) element at PATH
** where PATH is the path in the structure from the root element to
** the requested element.
**
** For example, in the document represented by:
**
** <partRateRequest>
** <vendor>
** <accessid user="myusername" password="mypassword" />
** </vendor>
** <partList>
** <partNum>
** DA42
** </partNum>
** <partNum>
** D99983FFF
** </partNum>
** <partNum>
** ss-839uent
** </partNum>
** </partList>
** </partRateRequest>
**
** $accessid =& $xmlDocument->getElementByPath('partRateRequest/vendor/accessid');
**
** Will return what you expect (the accessid element with attributes user = "myusername"
** and password = "mypassword").
**
** BUT be careful:
** $accessid =& $xmlDocument->getElementByPath('partRateRequest/partList/partNum');
**
** will return the partNum element with the value "DA42". Other partNums are
** inaccessible by getElementByPath() - Use MiniXMLElement::getAllChildren() instead.
**
** Returns the MiniXMLElement reference if found, NULL otherwise.
*/
function &getElementByPath ($path)
{
$element = $this->xxmlDoc->getElementByPath($path);
if (MINIXML_DEBUG > 0)
{
_MiniXMLLog("Returning element $element");
}
return $element;
}
function fromFile ($filename)
{
$modified = stat($filename);
if (! is_array($modified))
{
_MiniXMLError("Can't stat '$filename'");
return NULL;
}
if (MINIXML_USEFROMFILECACHING > 0)
{
$tmpName = MINIXML_FROMFILECACHEDIR . '/' . 'minixml-' . md5($filename);
if (MINIXML_DEBUG > 0)
{
_MiniXMLLog("Trying to open cach file $tmpName (for '$filename')");
}
$cacheFileStat = stat($tmpName);
if (is_array($cacheFileStat) && $cacheFileStat[9] > $modified[9])
{
$fp = @fopen($tmpName,"r");
if ($fp)
{
if (MINIXML_DEBUG > 0)
{
_MiniXMLLog("Reading file '$filename' from object cache instead ($tmpName)");
}
$tmpFileSize = filesize($tmpName);
$tmpFileContents = fread($fp, $tmpFileSize);
$serializedObj = unserialize($tmpFileContents);
$sRoot =& $serializedObj->getRoot();
if ($sRoot)
{
if (MINIXML_DEBUG > 0)
{
_MiniXMLLog("Restoring object from cache file $tmpName");
}
$this->setRoot($sRoot);
/* Return immediately, such that we don't refresh the cache */
return $this->xxmlDoc->numChildren();
} /* end if we got a root element from unserialized object */
} /* end if we sucessfully opened the file */
} /* end if cache file exists and is more recent */
}
ob_start();
readfile($filename);
$filecontents = ob_get_contents();
ob_end_clean();
$retVal = $this->fromString($filecontents);
if (MINIXML_USEFROMFILECACHING > 0)
{
$this->saveToCache($filename);
}
return $retVal;
}
function saveToCache ($filename)
{
$tmpName = MINIXML_FROMFILECACHEDIR . '/' . 'minixml-' . md5($filename);
$fp = @fopen($tmpName, "w");
if (MINIXML_DEBUG > 0)
{
_MiniXMLLog("Saving object to cache as '$tmpName'");
}
if ($fp)
{
$serialized = serialize($this);
fwrite($fp, $serialized);
fclose($fp);
} else {
_MiniXMLError("Could not open $tmpName for write in MiniXMLDoc::saveToCache()");
}
}
/* fromString XMLSTRING
**
** Initialise the MiniXMLDoc (and it's root MiniXMLElement) using the
** XML string XMLSTRING.
**
** Returns the number of immediate children the root MiniXMLElement now
** has.
*/
function fromString (&$XMLString)
{
$useSimpleFlag = $this->xuseSimpleRegex;
if ($this->xuseSimpleRegex || ! preg_match('/<!DOCTYPE|<!ENTITY|<!\[CDATA/smi', $XMLString))
{
$this->xuseSimpleRegex = 1;
$this->xRegexIndex = array(
'biname' => 1,
'biattr' => 2,
'biencl' => 3,
'biendtxt' => 4,
'birest' => 5,
'comment' => 6,
'uname' => 8,
'uattr' => 9,
'plaintxt' => 11,
'plainrest' => 12
);
$regex = MINIXML_SIMPLE_REGEX;
} else {
$this->xRegexIndex = array(
'biname' => 1,
'biattr' => 2,
'biencl' => 3,
'biendtxt' => 4,
'birest' => 5,
'comment' => 6,
'uname' => 8,
'uattr' => 9,
'cdata' => 11,
'doctypedef' => 13,
'doctypecont' => 14,
'entityname' => 16,
'entitydef' => 18,
'plaintxt' => 20,
'plainrest' => 21
);
$regex = MINIXML_COMPLETE_REGEX;
}
$this->fromSubString($this->xxmlDoc, $XMLString, $regex);
$this->xuseSimpleRegex = $useSimpleFlag;
return $this->xxmlDoc->numChildren();
}
function fromArray (&$init, $params=NULL)
{
$this->init();
if (! is_array($init) )
{
return _MiniXMLError("MiniXMLDoc::fromArray(): Must Pass an ARRAY to initialize from");
}
if (! is_array($params) )
{
$params = array();
}
if ( $params["attributes"] && is_array($params["attributes"]) )
{
$attribs = array();
foreach ($params["attributes"] as $attribName => $value)
{
if (! (array_key_exists($attribName, $attribs) && is_array($attribs[$attribName]) ) )
{
$attribs[$attribName] = array();
}
if (is_array($value))
{
foreach ($value as $v)
{
if (array_key_exists($v, $attribs[$attribName]))
{
$attribs[$attribName][$v]++;
} else {
$attribs[$attribName][$v] = 1;
}
}
} else {
if (array_key_exists($value,$attribs[$attribName]))
{
$attribs[$attribName][$value]++;
} else {
$attribs[$attribName][$value] = 1;
}
}
}
// completely replace old attributes by our optimized array
$params["attributes"] = $attribs;
} else {
$params["attributes"] = array();
}
foreach ($init as $keyname => $value)
{
$sub = $this->_fromArray_getExtractSub($value);
$this->$sub($keyname, $value, $this->xxmlDoc, $params);
}
return $this->xxmlDoc->numChildren();
}
function _fromArray_getExtractSub ($v)
{
// is it a string, a numerical array or an associative array?
$sub = "_fromArray_extract";
if (is_array($v))
{
if (_MiniXML_NumKeyArray($v))
{
// All numeric - assume it is a "straight" array
$sub .= "ARRAY";
} else {
$sub .= "AssociativeARRAY";
}
} else {
$sub .= "STRING";
}
return $sub;
}
function _fromArray_extractAssociativeARRAY ($name, &$value, &$parent, &$params)
{
$thisElement =& $parent->createChild($name);
foreach ($value as $key => $val)
{
$sub = $this->_fromArray_getExtractSub($val);
$this->$sub($key, $val, $thisElement, $params);
}
return;
}
function _fromArray_extractARRAY ($name, &$value, &$parent, &$params)
{
foreach ($value as $val)
{
$sub = $this->_fromArray_getExtractSub($val);
$this->$sub($name, $val, $parent, $params);
}
return;
}
function _fromArray_extractSTRING ($name, $value="", &$parent, &$params)
{
$pname = $parent->name();
if (
( array_key_exists($pname, $params['attributes']) && is_array($params['attributes'][$pname])
&& array_key_exists($name, $params['attributes'][$pname]) && $params['attributes'][$pname][$name])
|| (
array_key_exists('-all', $params['attributes']) && is_array($params['attributes']['-all'])
&& array_key_exists($name, $params['attributes']['-all']) && $params['attributes']['-all'][$name])
)
{
$parent->attribute($name, $value);
} elseif ($name == '-content') {
$parent->text($value);
} else {
$parent->createChild($name, $value);
}
return;
}
function time ($msg)
{
error_log("\nMiniXML msg '$msg', time: ". time() . "\n");
}
// fromSubString PARENTMINIXMLELEMENT XMLSUBSTRING
// private method, called recursively to parse the XMLString in little sub-chunks.
function fromSubString (&$parentElement, &$XMLString, &$regex)
{
//$this->time('fromSubStr');
if (is_null($parentElement) || empty($XMLString) || preg_match('/^\s*$/', $XMLString))
{
return;
}
if (MINIXML_DEBUG > 0)
{
_MiniXMLLog("Called fromSubString() with parent '" . $parentElement->name() . "'\n");
}
$matches = array();
if (preg_match_all( $regex, $XMLString, $matches))
{
// $this->time('a match');
$mcp = $matches;
$numMatches = count($mcp[0]);
for($i=0; $i < $numMatches; $i++)
{
if (MINIXML_DEBUG > 1)
{
_MiniXMLLog ("Got $numMatches CHECKING: ". $mcp[0][$i] . "\n");
}
$uname = $mcp[$this->xRegexIndex['uname']][$i];
$comment = $mcp[$this->xRegexIndex['comment']][$i];
if ($this->xuseSimpleRegex)
{
$cdata = NULL;
$doctypecont = NULL;
$entityname = NULL;
$tailEndIndexes = array(5, 7, 10, 12);
} else {
$cdata = $mcp[$this->xRegexIndex['cdata']][$i];
$doctypecont = $mcp[$this->xRegexIndex['doctypecont']][$i];
$entityname = $mcp[$this->xRegexIndex['entityname']][$i];
$tailEndIndexes = array(5, 7, 10, 12, 15, 19, 21);
}
$plaintext = $mcp[$this->xRegexIndex['plaintxt']][$i];
// check all the 'tailend' (i.e. rest of string) matches for more content
$moreContent = '';
$idx = 0;
while (empty($moreContent) && ($idx < count($tailEndIndexes)))
{
if (! empty($mcp[$tailEndIndexes[$idx]][$i]))
{
$moreContent = $mcp[$tailEndIndexes[$idx]][$i];
}
$idx++;
}
if ($uname)
{
// _MiniXMLLog ("Got UNARY $uname");
$newElement =& $parentElement->createChild($uname);
$this->_extractAttributesFromString($newElement, $mcp[$this->xRegexIndex['uattr']][$i]);
} elseif ($comment) {
//_MiniXMLLog ("Got comment $comment");
$parentElement->comment($comment);
} elseif ($cdata) {
//_MiniXMLLog ("Got cdata $cdata");
$newElement = new MiniXMLElementCData($cdata);
$parentElement->appendChild($newElement);
} elseif ($doctypecont) {
//_MiniXMLLog ("Got doctype $doctypedef '" . $mcp[11][$i] . "'");
$newElement = new MiniXMLElementDocType($mcp[$this->xRegexIndex['doctypedef']][$i]);
$appendedChild =& $parentElement->appendChild($newElement);
$this->fromSubString($appendedChild, $doctypecont, $regex);
} elseif ($entityname ) {
//_MiniXMLLog ("Got entity $entityname");
$newElement = new MiniXMLElementEntity ($entityname, $mcp[$this->xRegexIndex['entitydef']][$i]);
$parentElement->appendChild($newElement);
} elseif ($plaintext) {
if (! preg_match('/^\s+$/', $plaintext))
{
$parentElement->createNode($plaintext);
}
} elseif($mcp[$this->xRegexIndex['biname']]) {
// _MiniXMLLog("Got BIN NAME: " . $mcp[$this->xRegexIndex['biname']][$i]);
$nencl = $mcp[$this->xRegexIndex['biencl']][$i];
$finaltxt = $mcp[$this->xRegexIndex['biendtxt']][$i];
$newElement =& $parentElement->createChild($mcp[$this->xRegexIndex['biname']][$i]);
$this->_extractAttributesFromString($newElement, $mcp[$this->xRegexIndex['biattr']][$i]);
$plaintxtMatches = array();
if (preg_match("/^\s*([^\s<][^<]*)/", $nencl, $plaintxtMatches))
{
$txt = $plaintxtMatches[1];
$newElement->createNode($txt);
$nencl = preg_replace("/^\s*([^<]+)/", "", $nencl);
}
if ($nencl && !preg_match('/^\s*$/', $nencl))
{
$this->fromSubString($newElement, $nencl, $regex);
}
if ($finaltxt)
{
$parentElement->createNode($finaltxt);
}
} /* end switch over type of match */
if (! empty($moreContent))
{
$this->fromSubString($parentElement, $moreContent, $regex);
}
} /* end loop over all matches */
} /* end if there was a match */
} /* end method fromSubString */
/* toString [DEPTH]
** Converts this MiniXMLDoc object to a string and returns it.
**
** The optional DEPTH may be passed to set the space offset for the
** first element.
**
** If the optional DEPTH is set to MINIXML_NOWHITESPACES.
** When it is, no \n or whitespaces will be inserted in the xml string
** (ie it will all be on a single line with no spaces between the tags.
**
** Returns a string of XML representing the document.
*/
function toString ($depth=0)
{
$retString = $this->xxmlDoc->toString($depth);
if ($depth == MINIXML_NOWHITESPACES)
{
$xmlhead = "<?xml version=\"1.0\"\\1?>";
} else {
$xmlhead = "<?xml version=\"1.0\"\\1?>\n ";
}
$search = array("/<PSYCHOGENIC_ROOT_ELEMENT([^>]*)>\s*/smi",
"/<\/PSYCHOGENIC_ROOT_ELEMENT>/smi");
$replace = array($xmlhead,
"");
$retString = preg_replace($search, $replace, $retString);
if (MINIXML_DEBUG > 0)
{
_MiniXMLLog("MiniXML::toString() Returning XML:\n$retString\n\n");
}
return $retString;
}
/* toArray
**
** Transforms the XML structure currently represented by the MiniXML Document object
** into an array.
**
** More docs to come - for the moment, use var_dump($miniXMLDoc->toArray()) to see
** what's going on :)
*/
function & toArray ()
{
$retVal = $this->xxmlDoc->toStructure();
if (is_array($retVal))
{
return $retVal;
}
$retArray = array(
'-content' => $retVal,
);
return $retArray;
}
/* getValue()
** Utility function, call the root MiniXMLElement's getValue()
*/
function getValue ()
{
return $this->xxmlDoc->getValue();
}
/* dump
** Debugging aid, dump returns a nicely formatted dump of the current structure of the
** MiniXMLDoc object.
*/
function dump ()
{
return serialize($this);
}
// _extractAttributesFromString
// private method for extracting and setting the attributs from a
// ' a="b" c = "d"' string
function _extractAttributesFromString (&$element, &$attrString)
{
if (! $attrString)
{
return NULL;
}
$count = 0;
$attribs = array();
// Set the attribs
preg_match_all('/([^\s]+)\s*=\s*([\'"])([^\2]*?)\2/sm', $attrString, $attribs);
for ($i = 0; $i < count($attribs[0]); $i++)
{
$attrname = $attribs[1][$i];
$attrval = $attribs[3][$i];
if ($attrname)
{
$element->attribute($attrname, $attrval, '');
$count++;
}
}
return $count;
}
/* Destructor to keep things clean -- patch by Ilya */
function __destruct()
{
$this->xxmlDoc = null;
}
}
/***************************************************************************************************
****************************************************************************************************
*****
***** MiniXML
*****
****************************************************************************************************
***************************************************************************************************/
/* class MiniXML (MiniXMLDoc)
**
** Avoid using me - I involve needless overhead.
**
** Utility class - this is just an name aliase for the
** MiniXMLDoc class as I keep repeating the mistake of
** trying to create
**
** $xml = new MiniXML();
**
*/
class MiniXML extends MiniXMLDoc {
function MiniXML ()
{
$this->MiniXMLDoc();
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,289 @@
<?php
/**
* MiniXML - PHP class library for generating and parsing XML.
*
* @package miniXML
* @author Patrick Deegan, Psychogenic.com
* @license GPL
*/
require_once(MINIXML_CLASSDIR . "/treecomp.inc.php");
/***************************************************************************************************
****************************************************************************************************
*****
***** MiniXMLNode
*****
****************************************************************************************************
***************************************************************************************************/
/* class MiniXMLNode
** MiniXMLNodes are used as atomic containers for numerical and text data
** and act as leaves in the XML tree.
**
** They have no name or children.
**
** They always exist as children of MiniXMLElements.
** For example,
** <B>this text is bold</B>
** Would be represented as a MiniXMLElement named 'B' with a single
** child, a MiniXMLNode object which contains the string 'this text
** is bold'.
**
** a MiniXMLNode has
** - a parent
** - data (text OR numeric)
*/
class MiniXMLNode extends MiniXMLTreeComponent {
var $xtext;
var $xnumeric;
/* MiniXMLNode [CONTENTS]
** Constructor. Creates a new MiniXMLNode object.
**
*/
function MiniXMLNode ($value=NULL, $escapeEntities=NULL)
{
$this->MiniXMLTreeComponent();
$this->xtext = NULL;
$this->xnumeric = NULL;
/* If we were passed a value, save it as the
** appropriate type
*/
if (! is_null($value))
{
if (is_numeric($value))
{
if (MINIXML_DEBUG > 0)
{
_MiniXMLLog("Setting numeric value of node to '$value'");
}
$this->xnumeric = $value;
} else {
if (MINIXML_IGNOREWHITESPACES > 0)
{
$value = trim($value);
$value = rtrim($value);
}
if (! is_null($escapeEntities))
{
if ($escapeEntities)
{
$value = htmlentities($value);
}
} elseif (MINIXML_AUTOESCAPE_ENTITIES > 0) {
$value = htmlentities($value);
}
if (MINIXML_DEBUG > 0)
{
_MiniXMLLog("Setting text value of node to '$value'");
}
$this->xtext = $value;
} /* end if value numeric */
} /* end if value passed */
} /* end MiniXMLNode constructor */
/* getValue
**
** Returns the text or numeric value of this Node.
*/
function getValue ()
{
$retStr = NULL;
if (! is_null($this->xtext) )
{
$retStr = $this->xtext;
} elseif (! is_null($this->xnumeric))
{
$retStr = "$this->xnumeric";
}
if (MINIXML_DEBUG > 0)
{
_MiniXMLLog("MiniXMLNode::getValue returning '$retStr'");
}
return $retStr;
}
/* text [SETTO [SETTOALT]]
**
** The text() method is used to get or set text data for this node.
**
** If SETTO is passed, the node's content is set to the SETTO string.
**
** If the optional SETTOALT is passed and SETTO is false, the
** node's value is set to SETTOALT.
**
** Returns this node's text, if set or NULL
**
*/
function text ($setToPrimary = NULL, $setToAlternate=NULL)
{
$setTo = ($setToPrimary ? $setToPrimary : $setToAlternate);
if (! is_null($setTo))
{
if (! is_null($this->xnumeric) )
{
return _MiniXMLError("MiniXMLNode::text() Can't set text for element with numeric set.");
} elseif (! is_string($setTo) && ! is_numeric($setTo) ) {
return _MiniXMLError("MiniXMLNode::text() Must pass a STRING value to set text for element ('$setTo').");
}
if (MINIXML_IGNOREWHITESPACES > 0)
{
$setTo = trim($setTo);
$setTo = rtrim($setTo);
}
if (MINIXML_AUTOESCAPE_ENTITIES > 0)
{
$setTo = htmlentities($setTo);
}
if (MINIXML_DEBUG > 0)
{
_MiniXMLLog("Setting text value of node to '$setTo'");
}
$this->xtext = $setTo;
}
return $this->xtext;
}
/* numeric [SETTO [SETTOALT]]
**
** The numeric() method is used to get or set numerical data for this node.
**
** If SETTO is passed, the node's content is set to the SETTO string.
**
** If the optional SETTOALT is passed and SETTO is NULL, the
** node's value is set to SETTOALT.
**
** Returns this node's text, if set or NULL
**
*/
function numeric ($setToPrim = NULL, $setToAlt = NULL)
{
$setTo = is_null($setToPrim) ? $setToAlt : $setToPrim;
if (! is_null($setTo))
{
if (! is_null($this->xtext)) {
return _MiniXMLError("MiniXMLElement::numeric() Can't set numeric for element with text.");
} elseif (! is_numeric($setTo))
{
return _MiniXMLError("MiniXMLElement::numeric() Must pass a NUMERIC value to set numeric for element.");
}
if (MINIXML_DEBUG > 0)
{
_MiniXMLLog("Setting numeric value of node to '$setTo'");
}
$this->xnumeric = $setTo;
}
return $this->xnumeric;
}
/* toString [DEPTH]
**
** Returns this node's contents as a string.
**
**
** Note: Nodes have only a single value, no children. It is
** therefore pointless to use the same toString() method split as
** in the MiniXMLElement class.
**
*/
function toString ($depth=0)
{
if ($depth == MINIXML_NOWHITESPACES)
{
return $this->toStringNoWhiteSpaces();
}
if (MINIXML_DEBUG > 0)
{
_MiniXMLLog("MiniXMLNode::toString() call with depth $depth");
}
$spaces = $this->_spaceStr($depth);
$retStr = $spaces;
if (! is_null($this->xtext) )
{
/* a text element */
$retStr .= $this->xtext;
} elseif (! is_null($this->xnumeric)) {
/* a numeric element */
$retStr .= $this->xnumeric;
}
/* indent all parts of the string correctly */
$retStr = preg_replace("/\n\s*/sm", "\n$spaces", $retStr);
return $retStr;
}
function toStringWithWhiteSpaces ($depth=0)
{
return $this->toString($depth);
}
function toStringNoWhiteSpaces ()
{
if (MINIXML_DEBUG > 0)
{
_MiniXMLLog("MiniXMLNode::toStringNoWhiteSpaces() call with depth $depth");
}
if (! is_null($this->xtext) )
{
/* a text element */
$retStr = $this->xtext;
} elseif (! is_null($this->xnumeric)) {
/* a numeric element */
$retStr = $this->xnumeric;
}
return $retStr;
}
} /* end class definition */
?>

View File

@ -0,0 +1,139 @@
<?php
/**
* MiniXML - PHP class library for generating and parsing XML.
*
* @package miniXML
* @author Patrick Deegan, Psychogenic.com
* @license GPL
*/
/***************************************************************************************************
****************************************************************************************************
*****
***** MiniXMLTreeComponent
*****
****************************************************************************************************
***************************************************************************************************/
/* MiniXMLTreeComponent class
** This class is only to be used as a base class
** for others.
**
** It presents the minimal interface we can expect
** from any component in the XML hierarchy.
**
** All methods of this base class
** simply return NULL except a little default functionality
** included in the parent() method.
**
** Warning: This class is not to be instatiated.
** Derive and override.
**
*/
class MiniXMLTreeComponent {
var $xparent;
/* MiniXMLTreeComponent
** Constructor. Creates a new MiniXMLTreeComponent object.
**
*/
function MiniXMLTreeComponent ()
{
$this->xparent = NULL;
} /* end MiniXMLTreeComponent constructor */
/* Get set function for the element name
*/
function name ($setTo=NULL)
{
return NULL;
}
/* Function to fetch an element */
function & getElement ($name)
{
return NULL;
}
/* Function that returns the value of this
component and its children */
function getValue ()
{
return NULL;
}
/* parent NEWPARENT
**
** The parent() method is used to get/set the element's parent.
**
** If the NEWPARENT parameter is passed, sets the parent to NEWPARENT
** (NEWPARENT must be an instance of a class derived from MiniXMLTreeComponent)
**
** Returns a reference to the parent MiniXMLTreeComponent if set, NULL otherwise.
*/
function &parent (&$setParent)
{
if (! is_null($setParent))
{
/* Parents can only be MiniXMLElement objects */
if (! method_exists($setParent, 'MiniXMLTreeComponent'))
{
return _MiniXMLError("MiniXMLTreeComponent::parent(): Must pass an instance derived from "
. "MiniXMLTreeComponent to set.");
}
$this->xparent = $setParent;
}
return $this->xparent;
}
/* Return a stringified version of the XML representing
this component and all sub-components */
function toString ($depth=0)
{
return NULL;
}
/* dump
** Debugging aid, dump returns a nicely formatted dump of the current structure of the
** MiniXMLTreeComponent-derived object.
*/
function dump ()
{
return var_dump($this);
}
/* helper class that everybody loves */
function _spaceStr ($numSpaces)
{
$retStr = '';
if ($numSpaces < 0)
{
return $retStr;
}
for($i = 0; $i < $numSpaces; $i++)
{
$retStr .= ' ';
}
return $retStr;
}
/* Destructor to keep things clean -- patch by Ilya */
function __destruct()
{
$this->xparent = null;
}
} /* end class definition */
?>

287
app/helper/error.php Normal file
View File

@ -0,0 +1,287 @@
<?php
/**
* Fehlerbehandlung
*
* Eine generelle Klasse zur Fehlerhandlung, zum Analysieren und
* zum Debuggen.
*
* @package errorHandler
* @author Matthias Viehweger <kronn@kronn.de>
* @version 0.1.4
* @copyright GPL
*/
/**
* Klasse zur Fehlerbehandlung
*/
class errorHandler {
var $object = '';
var $method = '';
var $is_silent = FALSE;
var $messages;
function errorHandler($object='Objekt', $method='Methode') {
$this->object = $object;
$this->method = $method;
$this->messages = array();
}
/**
* Wrapperfunktion um Ausgabe zu steuern
*
* Die Ausgabe der Funktionsaufrufe wird abhängig von der Instanzvariablen
* is_silent in eine Variable umgeleitet oder direkt ausgegeben.
*
* @param string $output
*/
function output($output) {
if ( $this->is_silent ) {
$this->messages[] = $output;
} else {
echo $output;
}
}
/**
* Zwischenspeicher ausgeben
*/
function flush_output_cache() {
$msgs = $this->messages;
foreach( $msgs as $key=>$msg ) {
echo $msg;
unset($this->messages[$key]);
}
}
/**
* HTML-Ausgabe unterbinden
*/
function silent() {
$this->is_silent = TRUE;
}
/**
* Ausgabe von Meldungen ermöglichen
*/
function verbose() {
$this->is_silent = FALSE;
}
/**
* Eine Variable ausgeben
*
* Der Inhalt der &uuml;bergebenen Variable wird ausgegeben und
* ein ggf. zus&auml;tzlich &uuml;bergebener Infotext wird davorgeschrieben.
*
* Wenn die Variable ein Objekt ist, werden Informationen &uuml;ber die
* zugrundeliegende Klasse zur&uuml;ckgegeben.
*
* @param mixed $var
* @param string $text optional, Standardwert ist "Variableninhalte"
*/
function sv($var, $text='Variableninhalte') {
if ( !isset($var) ) return;
$html = '<pre style="overflow:auto">';
if ( is_object($var) ) {
$object = ( $text == 'Variableninhalte' )? 'Objekt': 'Objekt '.$text;
$html .= '<b>'.$this->object . ' - ' . $this->method . ' - '.$object.'</b>'."\n";
$html .= "\tDas ".$object." ist Instanz der Klasse <i>".get_class($var)."</i>\n";
$html .= '<blockquote><b>' . $object . ' - Variablen</b>'."\n";
#$html .= var_export( get_class_vars(get_class($var)), TRUE );
$html .= var_export( get_object_vars($var), TRUE );
$html .= "\n";
$html .= '<b>' .$object. ' - Methoden</b>'."\n";
$methods = get_class_methods($var);
sort($methods);
foreach( $methods as $method ) {
$html .= " - ".$method."\n";
}
$html .= '</blockquote>'."\n";
} else {
$var = ( is_string($var) )? htmlspecialchars($var): $var;
$html .= '<b>'.$this->object . ' - ' . $this->method . ' - '.$text.'</b>'."\n";
$html .= var_export( $var, TRUE );
}
$html .='</pre>';
$this->output($html);
}
/**
* einfache Textausgabe
*/
function say($text) {
$html = '<pre><i>'.$text.'</i></pre>';
$this->output($html);
}
/**
* Variable analysieren und inklusive einiger Eigenschaften ausgeben
*/
function analyze($var, $text = 'Variableninhalte') {
$this->sv($var, $text);
if (is_bool($var)) $props[] = 'boolean';
if (is_null($var)) $props[] = 'null';
if (is_string($var)) $props[] = 'string';
if (is_numeric($var)) $props[] = 'numeric';
if (is_float($var)) $props[] = 'float';
if (is_object($var)) $props[] = 'object';
if (is_array($var)) $props[] = 'array';
$html .= '<blockquote><pre><b>Eigenschaften:</b> ';
$html .= implode(', ', $props);
$html .= '</pre></blockquote>';
$this->output($html);
}
/**
* Eine Variable ausgeben und Skript beenden
*
* @param mixed $var
* @param string $text optionaler Parameter.
*/
function svaq($var, $text = 'Variableninhalte') {
$this->sv($var, $text);
$this->stop();
}
/**
* SQL ausgeben
*/
function sql($var, $text = 'SQL') {
$var = preg_replace('@ (BETWEEN|AND|OR) @', ' $1 '."\n", preg_replace('@(SELECT|INNER|WHERE|FROM|LIMIT|GROUP|HAVING) @',"\n".'$1 ', $var));
$this->sv($var, $text);
}
/**
* Superglobale $_FILES ausgeben
*/
function files() {
$this->sv($_FILES, 'Superglobale $_FILES - enth&auml;lt Uploaddaten');
}
/**
* Superglobale $_POST ausgeben
*/
function post() {
$this->sv($_POST, 'Superglobale $_POST - enth&auml;lt Formulardaten');
}
/**
* Superglobale $GLOBALS ausgeben
*/
function globals() {
$this->sv($GLOBALS, 'Superglobale $GLOBALS - enth&auml;lt alle Variablen');
}
/**
* Superglobale $_SESSION ausgeben
*/
function session() {
$this->sv($_SESSION, 'Superglobale $_SESSION - enth&auml;lt Sessiondaten');
}
/**
* Superglobale $_COOKIE ausgeben
*/
function cookies() {
$this->sv($_COOKIE, 'Superglobale $_COOKIE - enth&auml;lt Cookiedaten');
}
/**
* Zeitmessungen
*
* Eine Beispielfunktion für die Zeiterfassung ist beigefügt, sie muss im Bedarfsfall an den Anfang der
* index.php geschrieben werden.
*
* Die Einbindung des ErrorHandler und der Aufruf der Funktion timer sollte direkt nach der Ermittlung der
* Endzeit (höhö) geschehen. Je nach Anwendungsfall kann dies in vollständig in der index.php geschehen.
*
* Man sollte sicherstellen, dass die Genauigkeit des float-Datentyps richtig eingestellt ist. Mit der Standard-
* Einstellung "precision = 12" ist man nur bis 0.01 Sekunden genau.
* In der php.ini sollte man also
* precision = 16
* einstellen
*
* @param float $start Startzeit als Microtime
* @param float $end Endzeit (höhö) als Microtime
* @param int $interval Aktualisierungsintervall in Sekunden
*/
function timer($start, $end, $interval) {
/*
ini_set('precision', '16');
function getmicrotime() {
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$start = getmicrotime();
# Code
$end = getmicrotime();
*/
if ( $interval > 0 ) {
$interval = $interval * 1000;
} elseif ($interval == 0) {
unset($_SESSION['test']);
return;
}
if ( !isset($_SESSION['test']['time']) ) $_SESSION['test']['time'] = 0;
if ( !isset($_SESSION['test']['count']) ) $_SESSION['test']['count'] = 0;
$time = $this->_format_number($end - $start);
$_SESSION['test']['time'] += $time;
$avg = $this->_format_number($_SESSION['test']['time'] / ++$_SESSION['test']['count']);
$html .= '<pre>';
$html .= 'Zeit f&uuml;r aktuellen Durchlauf: '.$time.' Sekunden (Nr. '.$_SESSION['test']['count'].")\n";
$html .= 'Durchschnittliche Zeit: '.$avg." Sekunden";
$html .= '</pre>';
$html .= '
<script type="text/javascript">
// <[CDATA[
function addEvent(elm, evType, fn, useCapture) {
if (elm.addEventListener) {
elm.addEventListener(evType, fn, useCapture);
return true;
} else if (elm.attachEvent) {
var r = elm.attachEvent("on" + evType, fn);
return r;
} else {
elm["on" + evType] = fn;
}
}
function reloadtimer() {
window.setTimeout("window.location.reload()", '.$interval.');
}';
if ( $interval > 0 ) {
$html .= ' addEvent(window, "load", reloadtimer, false);';
}
$html .= '
// ]]>
</script>';
$this->output($html);
}
/**
* Skript anhalten
*/
function stop() {
exit();
}
function _format_number($number) {
return str_pad(substr(round($number, 5), 0, 7), 7, '0');
}
}
?>

354
app/helper/html.php Normal file
View File

@ -0,0 +1,354 @@
<?php
/**
* HTML-Klasse
*
* @package federleicht
* @subpacke helper
* @version 0.3
*/
class html {
protected $data = array();
protected $eol = PHP_EOL;
protected $output_xhtml = true;
/**
* Konstruktor
*
* @todo Information ueber Einrueckung oder ein Ausgabe-Objekt uebergeben?
* @todo Datenobjekt direkt statt der Referenz auf den View uebergeben.
* @param view &$view
* @param boolean $eol
* @param boolean $output_xhtml
*/
public function __construct(&$view = null, $eol=true, $output_xhtml=true) {
if ( $view instanceof view ) {
$this->set_data( $view->get_data_object() );
}
$this->eol = ( $eol )? PHP_EOL: '';
$this->output_xhtml = (boolean) $output_xhtml;
}
/**
* Datenquelle setzen
*
* @param mixed $data
*/
public function set_data($data) {
$this->data = $data;
}
/**
* HTML ausgeben
*
* @param string $html
*/
protected function output($html) {
if ( $this->output_xhtml === false ) {
$html = str_replace(' />', '>', $html);
}
echo $html . $this->eol;
}
/**
* Formulartag erzeugen
*
* @param string $action
* @param string $id
* @param string $target
* @param string $method
* @param string $charset
*/
public function form_tag($action, $id='', $target='', $method='post', $charset='UTF-8') {
$action = ( $action[0] == '/' )? $action: '/'.$action;
$id = ( $id != '' )? ' id="'.$id.'" name="'.$id.'" ': '';
$target = ( $target != '' )? ' target="'.$target.'" ': '';
$html = '<form action="'.$action.'" method="'.$method.'" '. $id . $target .'accept-charset="'.$charset.'">';
$this->output($html);
}
/**
* Formulartag schließen
*/
public function form_end() {
$html = '</form>';
$this->output($html);
}
/**
* Dropdown erzeugen
*
* Es wird ein HTML-Dropdown erzeugt. Die einzelnen Dropdownelemente werden
* als kommaseparierte Liste in folgendem Format übergeben:
* 1=eins,2=zwei,3=drei
*
* Dies führt zu einem Dropdown mit drei Elementen. Es wird der Text nach dem
* Gleichheitszeichen zur Darstellung verwendet, hier also
* 'eins', 'zwei', 'drei'.
* Die übergebenen Werte sind dabei der Text vor dem Gleichheitszeichen:
* 1, 2, 3.
*
* Das Dropdown hat die ID, die im ersten Parameter übergeben wird und
* verwendet diesen auch zur Datenübergabe als Array-Schlüssel.
*
* Wenn bereits Daten geladen wurden, wird versucht, den entsprechenden
* Wert als vorausgewählt darzustellen.
*
* Das HTML wird ausgegeben.
*
* @param string $field Eindeutiger Bezeichner für das Datenfeld.
* @param string $options Dropdownelemente im Format value=description, kommasepariert
* @param string $label Beschriftung des Dropdowns
*/
public function get_dropdown($field, $options, $label='') {
if ( is_string($options) ) {
$options = $this->string_to_array($options);
}
$html = '';
if ( $label != '') $html .= $this->get_label($field, $label);
$html .= '<select name="fl['.$field.']" id="'.$field.'" size="1" class="dropdown">'."\n";
foreach( $options as $option ) {
$id = $this->get_value('id', $option);
$name = $this->get_value('name', $option);
$selected = ( $this->get_value($field, $this->data) == $id )? ' selected="selected"': '';
$html .= "\t<option value=\"".$id.'"'.$selected.'>'.$name."</option>\n";
}
$html .= '</select>';
$this->output($html);
}
/**
* Dropdown-String zu Array machen
*
* @param string $string
* @return array
*/
protected function string_to_array($string) {
$array = array();
foreach( explode(',', $string) as $keyvaluepair ) {
if ( strpos( $keyvaluepair, '=' ) === false ) {
$id = $name = $keyvaluepair;
} else {
list($id, $name) = explode('=', $keyvaluepair, 2);
}
$array[] = array(
'id'=>$id,
'name'=>$name
);
}
return $array;
}
/**
* Dropdown-Array zu String machen
*
* @param array $data
* @return string
*/
protected function array_to_string($data) {
foreach( $data as $value) {
$string[] = $value['id'].'='.$value['name'];
}
$string = implode(',', $string);
return $string;
}
/**
* Radiobuttons ausgeben
*
* Radiobuttons werden direkt ausgegeben.
* Wrapperfunktion für echo html::return_radios()
*/
public function get_radios($field, $options, $tag='p') {
$html = $this->return_radios($field, $options, $tag);
$this->output($html);
}
/**
* Radiobuttons erzeugen
*
* @todo Dokumentation erstellen
*/
public function return_radios($field, $options, $tag='p') {
$options = explode(',', $options);
$html = '';
foreach( $options as $option ) {
$option = explode('=', $option);
$option[1] = ( isset($option[1]) )? $option[1]: $option[0];
$value = $this->get_value('1', $option);
$selected = ( $this->get_value($field, $this->data) == $option[0] )? ' checked="checked"': '';
$html .= "\n\t\t\t".'<'.$tag.'><input name="fl['.$field.']" id="'.$field.'-'.$option[0].'" type="radio" class="radio" value="'.$option[0].'"'.$selected.' />' .$this->get_label($field.'-'.$option[0], $value) . '</'.$tag.'>';
}
return $html;
}
/**
* Inputfeld erzeugen
*
* Das erzeugte HTML wird direkt ausgegeben.
*
* @param string $field ID des Formularfelds
* @param string $label zu verwendendes Label
* @param array $options Optionen als assoziatives Array:
* - type: von text abweichender Typ
* - size: Länge (inkl. Maximallänge) einstellen
*/
public function get_input($field, $label='', $options=array() ) {
if ( !empty($options) ) {
$type = ( isset($options['type']) AND !empty($options['type']) )?
'type="'.$options['type'].'"':
'type="text"';
$options = ( isset($options['size']) AND !empty($options['size']) )?
'maxlength="'.$options['size'].'" size="'.$options['size'].'" ':
'';
} else {
$type = 'type="text"';
$options = '';
}
$html = '';
if ( $label != '' AND !is_numeric($label) ) {
$html .= $this->get_label($field, $label);
}
$name = ( $type == 'type="file"' )?
$field:
'fl['.$field.']';
$value = $this->get_value($field, $this->data);
$html .= '<input name="'.$name.'" id="'.$field.'" class="text" '.$type.' '.$options.'value="'.$value.'" />';
$this->output($html);
}
/**
* Verstecktes Inputfeld erzeugen
*
* @param string $field
* @param string $value
*/
public function get_hidden($field, $value) {
$html = '<input name="fl['.$field.']" id="'.$field.'" type="hidden" value="'.$value.'" />';
$this->output($html);
}
/**
* Button erzeugen
*
* @param string $name ID und name des Buttons
* @param string $label optional: Beschriftung
* @param string $type optional: von "submit" abweichender Typ
*/
public function get_button($name, $label='', $type='submit') {
$label = ( $label === '' )? $name: $label;
$html = '<input id="'.$name.'" type="'.$type.'" value="'.$label.'" />';
$this->output($html);
}
/**
* Checkbox erzeugen
*
* @param string $field ID des Formularfelds
* @param string $label zu verwendendes Label
* @return string
*/
public function get_checkbox($field, $label='') {
$html = '';
$data = $this->get_value($field, $this->data);
$checked = ( $data == $field OR $data == 1 )?
' checked="checked"':
'';
$html .= '<input name="fl['.$field.']" id="'.$field.'" class="checkbox" type="checkbox" value="'.$field.'"'.$checked .' /> ';
if ( $label != '' AND !is_numeric($label) ) {
$html .= '<label for="'.$field.'" class="checkbox">'.$label.'</label>';
}
$this->output($html);
}
/**
* Textarea erzeugen
*
* Es wird ein mehrzeiliges Eingabefeld erzeugt.
*
* @param string $field
* @param string $label
* @param array $options Hash mit Optionen:
* - rows: Anzahl der Zeilen
* - cols: Anzahl der Spalten
*/
public function get_textarea($field, $label='', $options = array() ) {
$html = '';
$rows = ( isset($options['rows']) AND !empty($options['rows']) )? $options['rows']: 5;
$cols = ( isset($options['cols']) AND !empty($options['cols']) )? $options['cols']: 30;
$value = $this->get_value($field, $this->data);
if ( $label != '' ) $html .= $this->get_label($field, $label);
$html .= '<textarea name="fl['.$field.']" id="'.$field.'" rows="'.$rows.'" cols="'.$cols.'">'.$value.'</textarea>';
$this->output($html);
}
/**
* Formularvorgabewert oder -beschriftung holen
*
* @param string $field
* @param mixed $source
* @param string $default
* @return string
*/
protected function get_value($field, $source, $default = '') {
if ( $source instanceof view_data ) {
$source->set_raw_output(false);
$source->set_default($default);
$value = $source->get($field, 'string');
$source->set_default('');
return $value;
} elseif ( $source instanceof data_wrapper ) {
return $source->is_set($field) ? $source->get($field): $default;
}
if ( !is_array($source) AND !($source instanceof ArrayAccess) ) {
$source = (array) $source;
}
return isset($source[$field]) ? $source[$field]: $default;
}
/**
* Label erzeugen
*
* @param string $id
* @param string @value
* @return string
*/
public function get_label( $id, $value ) {
$label = '<label for="'.$id.'">'.$value.'</label>';
return $label;
}
}

333
app/helper/mail.php Normal file
View File

@ -0,0 +1,333 @@
<?php
/**
* e_mail
*
* A small class to handle mail-creation an -sending
* It supports text and html-mails (and both) and
* can handle attachments.
*
* e_mail::parse_template can process mail-templates and
* substitude templatetags with given data.
*
* @author Matthias Viehweger <matthias.viehweger@kronn.de>
* @version 0.3
* @license MIT-License
*/
class e_mail {
/**
* variables
*/
var $text = FALSE;
var $html = FALSE;
var $attachments = FALSE;
var $config;
/**
* storage for error-messages
*/
var $error;
/**
* data-parts of e-mail
*/
var $message_header;
var $message_body;
/**
* contructor
*/
function e_mail() {
ini_set('track_errors', '1');
}
/**
* set configuration
*
* @param string $to
* @param string $from
* @param string $topic
* @param string $replyto [optional]
*/
function set_config($to, $from, $topic, $replyto='') {
$this->config = array(
'to'=>$to,
'from'=>$from,
'topic'=>$topic
);
if ( $replyto != '' ) $this->config['replyto'] = $replyto;
}
/**
* get last error-message
*/
function get_error() {
return array_pop($this->error);
}
/**
* check wether it has to be a mime-mail or not
*
* @return boolean
*/
function must_be_mime() {
$must_be_mime = FALSE;
if ( $this->html != FALSE
OR $this->attachments != FALSE) {
$must_be_mime = TRUE;
}
return $must_be_mime;
}
/**
* set text-part
*/
function set_text($txt) {
$this->text = (string) $txt;
}
/**
* set html-part
*/
function set_html($html) {
$this->html = (string) $html;
}
/**
* add an attachment
*
* @param string $filename
* @param string $mime [optional]
* @return boolean
*/
function add_attachment($filename, $mime='') {
if ( empty($filename) ) {
$this->error[] = 'No Filename provided';
return FALSE;
}
if ( !is_file($filename) ) {
$this->error[] = $filename . ' not found.';
return FALSE;
}
if ( $mime == '') {
// trying to find the mime-type
if ( function_exists('mime_content_type') ) {
$mime = mime_content_type($filename);
} else {
$this->error[] = 'No mime-type provided and unable to guess it.';
return FALSE;
}
}
// saving the data
$file = array(
'name'=>$filename,
'mime'=>$mime
);
if ( $this->attachments === FALSE ) {
$this->attachments = array();
}
$this->attachments[] = $file;
return TRUE;
}
/**
* unset vars
*/
function clean_vars() {
$this->text = FALSE;
$this->html = FALSE;
$this->attachments = FALSE;
}
/**
* parse template
*
* The template is filled with data. For every key in the
* data-array, a substitution is attempted.
*
* {NAME} will be replaced with $data['name']
*
* All remaining templatetags will be removed.
*
* The resulting string will be returned.
*
* @param string $template
* @param array $data
* @return string
*/
function parse_template($template, $data) {
$content = $template;
// substitute templatetags
foreach( $data as $key => $value) {
$content = str_replace('{'.strtoupper($key).'}', $value, $content);
}
// discard unused templatetags
$content = preg_replace('/{[-_a-z]*}/i', '', $content);
return $content;
}
/**
* composition of mail-headers and body
*
* the e-mail-composition consists of the following steps:
*
* - Check wether (or not) a mime-mail is necessary, if yes:
* - check if attachments have to be handled, if yes:
* - set header to multipart/mixed
* - generate and add outer boundary
* - set header to multipart/alternative and generate boundary
* - plaintext-part generate if none set.
* - compose body
* - mark end of body
* - check if attachments have to be handled, if yes:
* - add attachments and boundaries
* - mark end of mail
*
* - always:
* - save header in message_header
* - save body in message_body
* - clean temporary variables
*/
function compose_message() {
$headers[] = 'From: '.$this->config['from'];
if ( isset($this->config['replyto']) ) $headers[] = 'Reply-To: '.$this->config['replyto'];
if ( $this->must_be_mime() ) {
$headers[] = 'MIME-Version: 1.0';
$boundary = md5(uniqid(date('d.m.Y \u\m H:i',mktime() )));
if ( $this->attachments != FALSE ) {
//tell e-mail client this e-mail contains more than one part
$headers[] = 'Content-Type: multipart/mixed; boundary="main'.$boundary."\"\r\n";
$headers[] = '--main'.$boundary;
}
//tell e-mail client this e-mail contains alternate versions
$headers[] = 'Content-Type: multipart/alternative; boundary="sub'.$boundary."\"\r\n";
//plain text part of message
if ( empty($this->text) ) {
$this->text = strip_tags($this->html);
}
$body = '--sub'.$boundary."\r\n" .
"Content-Type: text/plain; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
$body .= chunk_split(base64_encode($this->text));
//html part of message
$body .= "\r\n\r\n".'--sub'.$boundary."\r\n" .
"Content-Type: text/html; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
$body .= chunk_split(base64_encode($this->html));
//end of message
$body .= "\r\n".'--sub'.$boundary."--\r\n\r\n.";
if ($this->attachments != FALSE ) {
//attachments of message
$files = $this->attachments;
foreach ( $files as $file ) {
$body .= "\r\n--main".$boundary."\r\n".
"Content-Type: " . $file['mime']. "\r\n" .
"Content-Transfer-Encoding: base64\r\n" .
"Content-Disposition:attachment\r\n\r\n";
$body .= chunk_split(base64_encode( file_get_contents($file['name']) ));
}
$body .= '--main'.$boundary."--\r\n\r\n.";
}
} else {
$body = $this->text;
}
$this->message_body = $body;
$this->message_header = implode("\r\n", $headers);
$this->clean_vars();
}
/**
* send mail
*/
function send_mail() {
if ( empty($this->message_body)
OR empty($this->message_header)
OR empty($this->config)
) {
$this->error[] = 'Unvollständige Daten';
return FALSE;
}
$mailed = @mail(
$this->config['to'],
$this->config['topic'],
$this->message_body,
$this->message_header
) OR $this->error[] = $php_errormsg;
return $mailed;
}
/**
* send an email
*
* @param array $data Array with the following keys:
* - text messagebody as text/plain
* - html messagebody as text/html
* - css CSS for the HTML-part
* @param array $config Array with the following keys:
* - mailfrom
* - replyto
* - mailtopic
* - mailreceipient
*/
function compose_and_send($data, $config) {
$headers = 'From: '.$config['mailfrom']."\r\n";
$headers .= 'Reply-To: '.$config['replyto']."\r\n";
$headers .= 'MIME-Version: 1.0'."\r\n";
$boundary = md5(uniqid(date('d.m.Y \u\m H:i',mktime() )));
//tell e-mail client this e-mail contains//alternate versions
$headers .= 'Content-Type: multipart/alternative; boundary="'.$boundary."\"\r\n\r\n";
$content = $data['text'];
$htmlcontent = '<html><head><title>'.$config['mailtopic'].'</title>'."\n".'<style>'."\n";
$htmlcontent .= $data['css'];
$htmlcontent .= '</style>'."\n".'</head><body><div id="mailwrapper">'."\n";
$htmlcontent .= $data['html'];
$htmlcontent .= "\n".'</div></body></html>';
//plain text part of message
$body = '--'.$boundary."\r\n" .
"Content-Type: text/plain; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
$body .= chunk_split(base64_encode($content));
//html part of message
$body .= "\r\n\r\n".'--'.$boundary."\r\n" .
"Content-Type: text/html; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
$body .= chunk_split(base64_encode($htmlcontent));
//end of message
$body .= "\r\n".'--'.$boundary."--\r\n\r\n.";
$mailed = ( mail($config['mailreceipient'], $config['mailtopic'], $body, $headers) )? TRUE: FALSE;
return($mailed);
}
}
?>

132
app/helper/minixml.php Normal file
View File

@ -0,0 +1,132 @@
<?php
/**
* MiniXML - PHP class library for generating and parsing XML.
*
* @package miniXML
* @author Patrick Deegan, Psychogenic.com
* @license GPL
*/
/*
CONFIGURATION
Please see the http://minixml.psychogenic.com website for details on these configuration
options.
*/
/* All config options can be set to 0 (off) or 1 (on) */
define("MINIXML_CASESENSITIVE", 0); /* Set to 1 to use case sensitive element name comparisons */
define("MINIXML_AUTOESCAPE_ENTITIES", 1); /* Set to 1 to autoescape stuff like > and < and & in text, 0 to turn it off */
define("MINIXML_AUTOSETPARENT", 0); /* Set to 1 to automatically register parents elements with children */
define("MINIXML_AVOIDLOOPS", 0); /* Set to 1 to set the default behavior of 'avoidLoops' to ON, 0 otherwise */
define("MINIXML_IGNOREWHITESPACES", 1); /* Set to 1 to eliminate leading and trailing whitespaces from strings */
/* Lower/upper case attribute names. Choose UPPER or LOWER or neither - not both... UPPER takes precedence */
define("MINIXML_UPPERCASEATTRIBUTES", 0); /* Set to 1 to UPPERCASE all attributes, 0 otherwise */
define("MINIXML_LOWERCASEATTRIBUTES", 0); /* Set to 1 to lowercase all attributes, 0 otherwise */
/* fromFile cache.
** If you are using lots of $xmlDoc->fromFile('path/to/file.xml') calls, it is possible to use
** a caching mechanism. This cache will read the file, store a serialized version of the resulting
** object and read in the serialize object on subsequent calls.
**
** If the original XML file is updated, the cache will automatically be refreshed.
**
** To use caching, set MINIXML_USEFROMFILECACHING to 1 and set the
** MINIXML_FROMFILECACHEDIR to a suitable directory in which the cache files will
** be stored (eg, "/tmp")
**/
define("MINIXML_USEFROMFILECACHING", 0);
define("MINIXML_FROMFILECACHEDIR", "/tmp");
define("MINIXML_DEBUG", 0); /* Set Debug to 1 for more verbose output, 0 otherwise */
/***************************************** end Configuration ***************************************/
define("MINIXML_USE_SIMPLE", 0);
define("MINIXML_VERSION", "1.3.0"); /* Version information */
define("MINIXML_NOWHITESPACES", -999); /* Flag that may be passed to the toString() methods */
$MiniXMLLocation = dirname(__FILE__);
define("MINIXML_CLASSDIR", "$MiniXMLLocation/classes");
require_once(MINIXML_CLASSDIR . "/doc.inc.php");
/***************************************************************************************************
****************************************************************************************************
*****
***** Global Helper functions
*****
****************************************************************************************************
***************************************************************************************************/
function _MiniXMLLog ($message)
{
error_log("MiniXML LOG MESSAGE:\n$message\n");
}
function _MiniXMLError ($message)
{
error_log("MiniXML ERROR:\n$message\n");
return NULL;
}
function _MiniXML_NumKeyArray (&$v)
{
if (! is_array($v))
{
return NULL;
}
$arrayKeys = array_keys($v);
$numKeys = count($arrayKeys);
$totalNumeric = 0;
for($i=0; $i<$numKeys; $i++)
{
if (is_numeric($arrayKeys[$i]) && $arrayKeys[$i] == $i)
{
$totalNumeric++;
} else {
return 0;
}
}
if ($totalNumeric == $numKeys)
{
// All numeric - assume it is a "straight" array
return 1;
} else {
return 0;
}
}
?>

238
app/helper/validation.php Normal file
View File

@ -0,0 +1,238 @@
<?php
/**
* Validierungs-Plugin
*
* @package federleicht
* @subpackage plugin
*/
/**
* Validierungsklasse
*/
class validation {
/**
* Instanzvariablen
*/
var $error_msg;
var $rules;
/**
* Konstruktor
*/
function validation() {
}
/**
* Fehlermeldungen aus Datenbank holen
*/
function get_errormsg($datamodel) {
$result = $datamodel->retrieve('language', '*', "tld = '".LANG."'");
foreach( $result as $key => $value) {
if ( substr($key, 0, 6) != 'error_' ) continue;
$id = substr($key, 6);
if ( !$this->rule_exists($id) ) $this->create_rule($id);
$this->update_rule($id, FALSE, $value);
}
}
/**
* Prüfausdruck hinzufügen
*
* Prüfausdruck wird zur Liste hinzugefügt. Der Rückgabewert zeigt an,
* ob das erfolgreich war.
*
* @param string $id ID des zu überprüfenden Datenfeldes
* @param string $type Art der Überprüfung. Gültige Werte sind
* - string
* - number
* - email
* - regexp
* @param string $rule zusätzliche Überprüfungsregel
* mögliche Werte sind
* - optional
* - multiline
* - [eine Mengenangabe nach RegEx-Syntax]
* - [ein regulärer Ausdruck]
* @return boolean
*/
function set_rule($id, $type, $rule='') {
if ( !is_string($id) ) $id = (string) $id;
if ( !is_string($type) ) $type = (string) $type;
if ( !is_string($rule) ) $rule = (string) $rule;
$start = '/^';
$end = '$/';
switch ($type) {
case 'string':
$regexp = '[- _a-zA-ZäüößÄÖÜ]';
break;
case 'number':
$regexp = '[- 0-9]';
break;
case 'email':
$regexp = '([A-Za-z0-9](([\w.-][^._-]*){0,61})[A-Za-z0-9])@([A-Za-z0-9]([A-Za-z0-9-]{0,61})?[A-Za-z0-9]\.)+([A-Za-z]{2,6})';
break;
case 'regex':
case 'regexp':
$regexp = $rule;
$start = '';
$end = '';
$rule = '';
break;
default:
$regexp = '.';
break;
}
if ( preg_match('/(\{[,0-9]+\}|[*+?]{1,2})/', $rule) ) {
$count = $rule;
} elseif ( $type != 'regexp' AND $type != 'regex' ) {
$rule .= ' ';
$pieces = explode(' ', $rule);
if ( in_array('optional', $pieces) ) {
$count = '*';
} else {
$count = '+';
}
if ( in_array('multiline', $pieces) ) $end = $end . 'm';
} else {
$count = '';
}
if ( !$this->rule_exists($id) ) $this->create_rule($id);
$this->update_rule($id, $start . $regexp . $count . $end, FALSE);
return TRUE;
}
/**
* Fehlermeldung zu einer Prüfregel hinzufügen
*
* @param string $id ID des zu überprüfenden Datenfeldes
* @param string $msg Fehlermeldung, falls die Prüfung Eingabefehler
* feststellt
* @return boolean
*/
function set_msg($id, $msg) {
if ( !is_string($id) ) $id = (string) $id;
if ( !is_string($msg) ) $msg = (string) $msg;
if ( !$this->rule_exists($id) ) $this->create_rule($id);
$this->update_rule($id, FALSE, $msg);
return TRUE;
}
/**
* Formulardaten validieren
*
* Die Formulardaten werden anhand regulärer Ausdrücke auf Plausibilität
* geprüft.
*
* @param array &$data Referenz auf Formulardaten
* @return array
*/
function validate_form(&$data) {
if ( !is_array($data) ) return FALSE;
$rules = $this->get_rules();
if ( empty($rules) ) return FALSE;
$errors = array();
foreach( $rules as $field=>$rule ) {
if ( !preg_match($rule['regexp'], $data[$field]) ) {
# unset($data['field']);
$errors[] = $rule['error'];
}
}
return $errors;
}
/**
* Javascript mit Regeln für die Formulardatenvalidierung zurückgeben
*
* Es wird eine JS mit den Regeln für die Validierung der Formulardaten
* zurückgegeben.
* Außerdem wird der HTML-Code für das Einbinden des allgemeinen
* Validierungsskripts angefügt.
*
* @return string
*/
function get_js() {
$form_variables = $this->get_rules();
if ( empty($form_variables) ) return FALSE;
$js = "var validationSet = {\n";
$entries = array();
foreach ($form_variables as $name => $properties) {
$entries[] = "\t'".$name."': { 'regexp': ".$properties['regexp'].", 'error': ' ".addslashes($properties['error'])."'}";
}
$js .= implode(",\n", $entries) . "\n";
$js .= "}\n";
$html = '<script type="text/javascript">'."\n".'// <[CDATA['."\n";
$html .= $js;
$html .= '// ]]>'."\n".'</script>'."\n";
$html .= '<script type="text/javascript" src="/public/js/validation.js"></script>'."\n";
return $html;
}
################### Verwaltungsfunktionen ###########################
/**
* Prüfen, ob Regel existiert
*
* @param string $id
* @return boolean
*/
function rule_exists($id) {
return ( isset($this->rules[$id]) );
}
/**
* Regelarray erzeugen
*
* @param string $id
*/
function create_rule($id) {
if ( $this->rule_exists($id) ) return;
$this->rules[$id] = array(
'regexp'=>'/.*/',
'error'=>'Error in '.$id
);
}
/**
* Regel aktualisieren
*/
function update_rule($id, $regex=FALSE, $msg=FALSE) {
if ( !$this->rule_exists($id) ) return;
if ( $regex !== FALSE ) $this->rules[$id]['regexp'] = $regex;
if ( $msg !== FALSE ) $this->rules[$id]['error'] = $msg;
}
/**
* Regel entfernen
*/
function remove_rule($id) {
if ( !$this->rule_exists($id) ) return;
unset ($this->rules[$id]);
}
/**
* Regeln als Array zurückgeben
*/
function get_rules() {
return $this->rules;
}
############### Ende der Verwaltungsfunktionen ######################
}
?>

View File

@ -0,0 +1,37 @@
<?php
/**
* about Controller
*
* @package baseContent
* @subpacke about
*/
class about_controller extends fl_controller {
/* Eigenschaften */
var $defaultAction = 'company';
var $from = '';
var $layout = 'default';
#
function company() {
$this->data['title'] = 'Über 2erlei';
}
function pressemitteilungen() {
$this->data['title'] = 'Pressemitteilungen';
}
function partner() {
$this->data['title'] = 'Partner';
}
function jobs() {
$this->data['title'] = 'Jobs';
}
function common() {
$bild = ( $this->cap['action'] == 'defaultAction' )? $this->defaultAction: $this->cap['action'];
$this->data['kopfbild'] = $bild;
return TRUE;
}
}
?>

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<hilfe for="about">
</hilfe>

View File

@ -0,0 +1,36 @@
<!-- Kommentar, um IE zu Quirksmode zu bringen -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>2erlei Medienagentur</title>
<?php $this->get_element('header'); ?>
</head>
<body class="about"><div id="wrapper">
<div id="kopf">
<h1><a href="/"><img src="/public/img/logo.gif" width="149" height="108" alt="2erlei Medienagentur"></a></h1>
<div id="kundennavi">
<?php $this->get_element('kundennavi'); ?>
</div>
<img class="kopfbild" width="519" height="156" alt="" src="/public/img/kopf_start.jpg">
<div id="navigation">
<?php $this->get_element('navigation'); ?>
</div>
</div>
<div id="content">
<?php $this->get_sub_view(); ?>
</div>
<div id="unten">
<?php $this->get_element('unten'); ?>
<p class="print-info">Dieser Text ist/Diese Inhalte sind unter der Adresse <a style="font-weight: bold" href="http://www.2erlei.de/">http://www.2erlei.de/</a> zu erreichen.</p>
</div>
</div><?php $this->get_element('google_analytics'); ?>
<?php $this->get_element('lightbox'); ?></body>
</html>

View File

@ -0,0 +1,10 @@
<?php
/**
* about-model
*
* @package baseContent
* @subpackage about
*/
class app_about_model extends fl_model {
}
?>

View File

@ -0,0 +1,17 @@
<?php
/**
* Modul: about
*
* @package baseContent
* @subpackage about
* @author Matthias Viehweger <kronn@kronn.de>
* @version 0.1.7
* @license All Rights Reserved
*/
/**
* Allgemeines zum Modul
*/
class about_modul extends fl_modul {
}
?>

View File

@ -0,0 +1,10 @@
<?php
/**
* about-view
*
* @package baseContent
* @subpackage about
*/
class about_view extends fl_view {
}
?>

View File

@ -0,0 +1,27 @@
<div id="subnavigation">
<p><a href="/about" class="aktiv">Unternehmen</a></p>
<p><a href="/about/pressemitteilungen">Presse</a></p>
<p><a href="/about/partner">Partner</a></p>
<p><a href="/about/jobs">Jobs</a></p>
</div>
<div id="inhalt">
<h2>2erlei das Unternehmen</h2>
<p class="first">Wir sind jung, dynamisch, flexibel und in ein Netzwerk von Kompetenzen integriert. Unsere qualitativ hochwertige Tätigkeit hat ihren Schwerpunkt in den Bereichen Design und Webapplikationen.</p>
<p>Die kompetenten Mitarbeiter von 2erlei verbindet das Ziel, die Effiziens- und Umsatzsteigerung unserer Kunden zu fördern und zu steigern. Dass wir darin erfolgreich sind, können unsere zufriedenen Auftraggeber bestätigen.</p>
<p>Unsere Philosophie gründet auf Zusammenarbeit und Vernetzung. Wir klären mit Ihnen ab, welche Funktionen Sie benötigen. Darauf bauend erstellen wir ein System, das sich genau Ihren Bedürfnissen anpasst.<br>Das Fundament bildet unser baseContent, das wir parallel zu anderen Systemen ständig weiter entwickeln und mit ihnen vernetzen können. Durch diese Strategie der Schnittstellen bekommen Sie exakt die Kompetenzen zugespielt, die Sie benötigen. Überflüssige Ressource-Apparatur entfällt.</p>
<p>Wir verstehen es, komplexe Systeme übersichtlich und benutzerfreundlich zu gestalten.</p>
<p>&nbsp;</p>
</div>
<div id="info_spalte">
<h3>baseContent Demo</h3>
<p><a href="http://demo.2erlei.de" target="_blank"><img src="/public/img/info/demo.jpg" width="192" height="90" alt="Demo 2erlei"></a></p>
<p><b>Benutzername:</b> demo</p>
<p><b>Passwort:</b> demo</p>
</div>

View File

@ -0,0 +1,34 @@
<div id="subnavigation">
<p><a href="/about">Unternehmen</a></p>
<p><a href="/about/pressemitteilungen">Presse</a></p>
<p><a href="/about/partner">Partner</a></p>
<p><a href="/about/jobs" class="aktiv">Jobs</a></p>
</div>
<div id="inhalt">
<h2>Jobangebote</h2>
<h3>Wir suchen:</h3>
<h5>Programmierer/in: <span class="separator">PHP und MySQL-Datenbanken</span></h5>
<p>Wir suchen eine Programmiererin oder Programmierer für projektbezogenes Arbeiten.</p>
<p><b>Tätigkeitsfeld:</b></p>
<p>Die 2erlei GbR ist ein junges aufstrebendes Unternehmen, das sich auf die Programmierung von Content Management Systemen spezialisiert hat.
Design für Druck und digitale Medien ist unser zweites Standbein.
Unser CMS haben wir komplett selbst entwickelt und bieten unseren Kunden spezielle Lösungen an,
die im Design sowie in der Struktur an den Kunden angepasst werden.</p>
<p><b>Anforderungen:</b></p>
<ul>
<li>sicherer Umgang mit objektiorientiertes PHP, mySQL, Ruby, CSS, HTML, Javascript, Linux Know-How für Webserver Administration</li>
<li>Seriösität, Integrität und Zuverlässigkeit sind unbedingte Voraussetzung wie eine ergebnisorientierte und umsichtige Arbeitsweise</li>
<li>Englisch in Wort und Schrift da Internationale Projekte zu absolvieren sind.</li>
<li>mind. 1jährige Berufserfahrung im Entwicklerumfeld</li>
</ul>
<br />
<p>Bewerbungen an <a href="mailto:jobs@2erlei.de">jobs@2erlei.de</a>.</p>
</div>
<div id="info_spalte">
<p><a href="/pages/contact"><img src="/public/img/info/contact.jpg" width="192" height="90" alt="Kontakt"></a></p>
<p><a href="/public/pdf/Jobangebot_php_entwicklung_april07.pdf"><img src="/public/img/info/jobangebot.jpg" width="192" height="90" alt="Jobangebot PDF"></a></p>
</div>

View File

@ -0,0 +1,51 @@
<div id="subnavigation">
<p><a href="/about">Unternehmen</a></p>
<p><a href="/about/pressemitteilungen">Presse</a></p>
<p><a href="/about/partner" class="aktiv">Partner</a></p>
<p><a href="/about/jobs">Jobs</a></p>
</div>
<div id="inhalt">
<h2>2erlei und ihre Partner</h2>
<div class="zeile">
<div class="thumbnail"><img src="/public/img/excerpt_nanologika.gif" width="189" height="125" alt="nanoLogika Logo"></div>
<div class="text">
<h4>nanoLogika</h4>
<h5>Produzent für komplexe Produktkonfiguratoren</h5>
<p>Am Mooskissen 25<br>D-14532 Kleinmachnow<br><a href="http://www.nanologika.de" target="_blank">http://www.nanologika.de</a></p>
</div>
</div>
<div class="zeile">
<div class="thumbnail"><img src="/public/img/excerpt_travelclips.gif" width="189" height="125" alt="travelClips Logo"></div>
<div class="text">
<h4>Travel Clips Videoproduktion</h4>
<h5>Videoproduktion speziell Kurz- und Werbeclips</h5>
<p>Franz-Mehring Platz 1<br>D-10243 Berlin<br><a href="http://www.travel-clips.de" target="_blank">http://www.travel-clips.de</a></p>
</div>
</div>
<div class="zeile">
<div class="thumbnail"><img src="/public/img/excerpt_giata.gif" width="189" height="125" alt="GIATA Logo"></div>
<div class="text">
<h4>GIATA mbH</h4>
<h5>Contentlieferant in der Tourismusbranche</h5>
<p>Schlesischestr. 26<br>D-10997 Berlin<br><a href="http://www.giata.de/" target="_blank">http://www.giata.de</a></p>
</div>
</div>
<div class="zeile">
<div class="thumbnail"><img src="/public/img/excerpt_1und1.gif" width="189" height="65" alt="1und1 Logo"></div>
<div class="text">
<h4>1&1 Internet AG</h4>
<h5>Hosting und Telekomunikation</h5>
<p>Elgendorfer Straße 57<br>D-56410 Montabaur<br><a href="http://1und1.de" target="_blank">http://1und1.de</a></p>
</div>
</div>
</div>

View File

@ -0,0 +1,25 @@
<div id="subnavigation">
<p><a href="/about">Unternehmen</a></p>
<p><a href="/about/pressemitteilungen" class="aktiv">Presse</a></p>
<p><a href="/about/partner">Partner</a></p>
<p><a href="/about/jobs">Jobs</a></p>
</div>
<div id="inhalt">
<h2>Pressemitteilungen</h2>
<div class="zeile">
<div class="thumbnail">&nbsp;</div>
<div class="text">
<h4>12. April 2007</h4>
<h5>neues Videoportal online: myHotelVideo</h5>
<p>Ein weiteres interessantes Webprojekt ist heute online gegangen. myHotelVideo ist eine Reise- und Informationsplattform, wo jeder sein eigenes Hotelvideo hochladen und die Videos anderer anschauen kann.<br><a href="http://myhotelvideo.com" target="_blank">http://www.myhotelvideo.com</a></p>
</div>
</div>
</div>
<div id="info_spalte">
<p><a href="/pages/contact"><img src="/public/img/info/contact.jpg" width="192" height="90" alt="Kontakt"></a></p>
</div>

View File

@ -0,0 +1,237 @@
<?php
/**
* Basecontent Controller
*
* Der Basecontent Controller &uuml;bernimmt allgemeine Aufgaben
* f&uuml;r das CMS.
*
* @package baseContent
* @subpacke basecontent
*/
class basecontent_controller extends fl_controller {
/* Eigenschaften */
var $defaultAction = 'show';
var $from = '';
var $layout = 'admin';
#
function show() {
$this->check_login('basecontent/');
$this->data['title'] = 'Administration';
}
/**
* Papierkorb
*
* @todo Parameter für Aktionen einbauen
* @todo Datenvorbereitung durch das Model
* @todo relevante Module in Konfigurationsdatei auslagern
* @todo nach erotikdatenbank portieren
*/
function trashcan($param) {
$this->check_login('basecontent/trashcan/');
$this->data['title'] = 'Papierkorb';
/* module auflisten, die status 2 haben können
$modules = array(
'Firmen'=>'company_LANG',
'Firmenarten'=>'company_cat_LANG',
'Lokalbereiche'=>'localarea',
'L&auml;nder'=>'localarea_cat_LANG',
'Profile'=>'profiles_LANG',
'Sprachen'=>'language'
);
*/
$modules = array(
'Accounts'=>'account'
);
// Daten sammeln
$trashcan_data = $this->model->get_trashcan_data($modules);
$this->data += $trashcan_data;
}
function login($from) {
$this->data['title'] = 'Anmelden';
$this->data['from'] = (string) $from;
$this->layout = 'loginout';
}
/**
* Anzeige der Fehlermeldung "Nicht berechtigt"
*/
function notallowed() {
$this->data['title'] = 'Keine Berechtigung';
}
function auth() {
$fl = $_POST['fl'];
if ( isset($_SESSION['username']) OR $this->model->login($fl) ) {
$_SESSION['username'] = $fl['username'];
$_SESSION['IP'] = $_SERVER['REMOTE_ADDR'];
$result = $this->datamodel->retrieve('user', 'level', 'name = "'.$_SESSION['username'].'"');
$_SESSION['userlevel'] = $result['level'];
$this->flash('Willkommen, '.$_SESSION['username'].'!');
$this->logaction( $_SESSION['username'].' hat sich eingeloggt' );
if ( empty($fl['from']) ) {
$this->data = array('title'=>'Administrationsbereich');
$this->goToTarget('basecontent/');
} else {
$this->goToTarget($fl['from']);
}
} else {
$this->flash('Falscher Benutzername oder falsches Passwort angegeben.');
$this->data['from'] = $fl['from'];
$this->data['title'] = 'Einloggen';
$this->layout = 'loginout';
$this->view = 'login';
}
}
function logout() {
$this->check_login('basecontent/');
$this->layout = 'loginout';
$this->logaction($_SESSION['username'].' hat sich ausgeloggt');
$this->data['title'] = 'Ausgeloggt';
// datenbank aufraeumen
//$this->clean_db();
session_destroy();
}
function options($action) {
$this->check_login('basecontent/options/');
$this->data['title'] = 'Einstellungen bearbeiten';
if( $action == 'save') {
$fl = $_POST['fl'];
$failures = 0;
$result = array();
foreach( $fl as $key => $value ) {
$temp = explode('_', $key);
$data['optionname'] = strtoupper($temp[1]);
$data['value'] = $value;
$module = $temp[0].'_options';
$optionresult = $this->datamodel->retrieve( $module , 'id', "optionname = '".$data['optionname']."'", '', '1');
$id = $optionresult['id'];
if ( $this->datamodel->update($module, $data, $id) ) {
$result[] = ucwords( $temp[1] ) . ' aktualisiert: ' . $data['value'];
} else {
$result[] = 'Option ' . ucwords( $temp[1] ) . ' konnte nicht aktualisiert werden.';
$failures++;
}
}
$msg = ( $failures == 0 ) ?
'Optionen wurden aktualisiert':
implode("\n", $result);
$this->flash($msg);
$this->data['title'] = 'Administration';
$this->goToTarget('basecontent/');
}
}
function protocol($type) {
$this->layout = 'admin';
$this->check_login('basecontent/protocol/'.$type);
$logfile = "Auflistung der Benutzeraktionen\r\n\r\n";
switch ($type) {
case 'screen':
$array = $this->datamodel->retrieve('basecontent', '*', '', 'id DESC', '30');
foreach ( $array as $row ) {
$logfile .= $row['id'].": ".$row['name']." (".$row['ip'].") - ".$row['date']." - ".$row['action']."\r\n";
}
$this->data['logfile'] = $logfile;
$this->data['title'] = "Logfile ausgeben";
$this->logaction('Logfile am Bildschirm ausgegeben. (30 Aktionen)');
$this->layout = 'viewprotocol';
break;
case 'textfile':
$array = $this->datamodel->retrieve('basecontent', '*', '', 'id ASC');
foreach ( $array as $row ) {
$logfile .= $row['id'].": ".$row['name']." (".$row['ip'].") - ".$row['date']." - ".$row['action']."\r\n";
}
$logfile .= "\r\nEnde der Logfileausgabe";
$logfile = html_entity_decode($logfile);
header("Content-length: ".strlen($logfile));
header("Content-type: text/plain");
header("Content-Disposition: attachment; filename=aktionen.log");
echo $logfile;
$this->flash('Logfile als Datei heruntergeladen');
exit();
break;
}
}
function support() {
$this->check_login('basecontent/support');
// Eine mail an info@2erlei mit "Seitenname, IP, Uhrzeit, username, ggf. Protokoll" abschicken
$user = $this->datamodel->retrieve('user', 'email', "name = '".$_SESSION['username']."'", '', '1');
$result = $this->datamodel->retrieve(ADMINMODULE.'_options', '*', "optionname='SEITENTITEL'");
$sitetitle = $result['value'];
$array = $this->datamodel->retrieve('basecontent', '*', '', 'id DESC', '30');
foreach ( $array as $row ) {
$logfile .= $row['id'].": ".$row['name']." (".$row['ip'].") - ".$row['date']." - ".$row['action']."\r\n";
}
unset($array);
$config['mailreceipient'] = 'info@2erlei.de';
$config['mailtopic'] = '['.$sitetitle.'] Supportanfrage';
$config['mailfrom'] = 'supportbutton@'.$_SERVER['HTTP_HOST'];
$config['replyto'] = $user['email'];
$content = 'Es wurde eine Supportanfrage abgegeben.'."\n";
$content .= "\n".'Seitentitel:'."\t". $sitetitle;
$content .= "\n".'IP:' . "\t\t" . $_SESSION['IP'];
$content .= "\n".'Uhrzeit:' . "\t" . date('Y-m-d H:i:s', mktime() );
$content .= "\n".'Benutzer:' . "\t". $_SESSION['username'];
$content .= "\n".'Protokoll:'."\n". $logfile;
$content .= "\n\n".'Ende der Supportanfrage';
$content .= "\n-- \nbaseContent";
if ( mail($config['mailreceipient'], $config['mailtopic'], $content, "From: {$config['mailfrom']}\r\n"."Reply-To: {$config['replyto']}") ) {
$notify['mailed'] = TRUE;
$notify['status'] = "2erlei wurde per e-mail über Ihren Supportwunsch informiert.";
} else {
$notify['mailed'] = FALSE;
$notify['status'] = "</p><h4>Fehler</h4><p>Auf diesem Server ist kein Mailversand m&ouml;glich. Bitte richten Sie Ihre Supportanfrage telefonisch an 2erlei. ";
}
$this->flash($notify['status']);
$this->goToTarget('basecontent/');
}
function webframe($page='') {
$this->layout = 'default';
$this->goToTarget($page);
/*
$this->data['title'] = 'Webseiten-Ansicht';
if ( $page == 'top' ) {
echo file_get_contents($this->modulepath . 'basecontent/de/frame_top.php');
}
*/
}
function common() {
return $this->factory->get_helper('bereiche');
}
}
?>

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<hilfe for="basecontent">
<login>
<p>hallo</p>
</login>
<logout></logout>
<options>
<p>Hier werden die Grundeinstellungen für Ihren Internetauftritt vorgenommen.</p>
<p>Wählen Sie einen Reiter für die Einstellung, die Sie vornehmen möchten.</p>
<div rel="optionen"><h4>OPTIONEN EINSTELLEN</h4>
<p><b>Seitentitel</b><br />
Der Seitentitel erstreckt sich durch Ihren kompletten Internetauftritt und ist an mehreren Stellen, wie z.B. oben in der Fensterleiste im Browser, zu sehen.</p>
</div>
</options>
<protocol>
<p>Alle Änderungen und Aktionen, die im baseContent vorgenommen werden, sind in diesem Protokoll zusammengefasst und können jederzeit eingesehen werden.</p>
<p>Sie können genau verfolgen, wer, was und wann gemacht hat. Neben dem Benutzernamen wird die Aktion, das Datum und die Uhrzeit protokolliert.</p>
</protocol>
<show>
<p><b>Willkommen im Projectmanager der 2erlei-GbR!</b><br /><br /><b>*(ftp):</b> Mit Klick auf dem Link gelangt Ihr über euren Browser direkt zu dem Verzeichniss auf dem "Friedrich".<br />Wenn euer Browser das nicht unterstützen sollte, stehen hier die URL und Zugangsdaten:</p>
<ul>
<li>URL: ftp://nd.2erlei.de</li>
<li>BN: "Projekt- oder Firmenname"</li>
<li>PW: 2erleiProjekt</li>
</ul>
<p><br /><b>Mindmap:</b> Bitte stehts die aktuelle Mindmap herunterladen, editieren und anschließend über ein FTP Programm wieder hochladen!<br />Es besteht die Gefahr des Datenverlustes!!!
</p>
</show>
<!-- Entschuldige, ich musste im "Skeleton" die Hilfe eintragen.
<show>
<p>Hier finden Sie zukünftig die baseContent-interne Hilfe.</p>
</show>
-->
</hilfe>

View File

@ -0,0 +1,61 @@
<?php
/**
* allgemeines Admintemplate
*
* @package baseContent
* @subpackage basecontent
*/
echo'<?xml version="1.0" encoding="iso-8859-1" ?>'."\n"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
<head>
<title><?php echo $this->get_field('title') ?> - <?php $this->get_siteTitle() ?></title>
<?php $this->get_element('admin_head'); ?>
</head>
<body><div id="wrapper">
<div id="kopf">
<h1><img src="/public/img/admin/basecontent.gif" width="468" height="54" alt="baseContent" /></h1>
<p id="logout"><a href="/basecontent/logout/">&raquo; <?php $this->get_username(); ?> Logout</a></p>
<div id="bc_nav">
<?php $this->get_element('bc_nav', array('section'=>'localarea')); ?>
</div>
<div id="bc_intern">
<ul>
<li><a href="/basecontent/options/">Einstellungen</a></li>
<li><a href="/basecontent/protocol/">Protokoll</a></li>
<li><a href="/basecontent/support/">Support</a></li>
</ul>
</div>
<h2><?php $this->get_siteTitle(); ?></h2>
<?php $this->get_breadcrumbs($this->cap, $this->get_field('title')); ?>
</div>
<div id="navigation">
<h2><a href="/basecontent/">baseContent</a></h2>
<ul>
<li>&nbsp;</li>
</ul>
</div>
<div id="content">
<?php $this->get_sub_view(); ?>
<div id="spalte2">
<h2>baseContent info</h2>
<?php $this->get_element('bc_info', array('cap'=>$this->cap, 'flash'=>$this->render_flash(), 'model'=>$this) ); ?>
</div>
</div>
<div id="unten">
<p> &nbsp; &nbsp; </p>
<p class="print-info">Diese Inhalte sind unter der Adresse <a style="font-weight:bold;" href="<?php echo ($this->current_url() ); ?>"><?php echo ($this->current_url() ); ?></a> zu erreichen.</p>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,54 @@
<!-- 2erlei.de -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title><?php echo $this->get_field('title') ?> - <?php $this->get_siteTitle() ?></title>
<?php $this->get_element('admin_head'); ?>
</head>
<body><div id="wrapper" class="login">
<div id="kopf">
<h1><img src="/public/img/admin/basecontent.gif" width="468" height="54" alt="baseContent"></h1>
<div id="bc_nav">
<p>
<a href="/">zur Startseite</a>
</p>
</div>
<div id="bc_intern">
</div>
<h2><?php $this->get_siteTitle(); ?></h2>
</div>
<div id="navigation">
</div>
<div id="content">
<?php $this->get_sub_view(); ?>
<div id="spalte2">
<h2>baseContent info</h2>
<?php
$flash = $this->render_flash();
if (!empty($flash) ) { ?>
<fieldset id="bc_info" class="bereich_static"><h3>Meldungen</h3>
<div class="formtop"> &nbsp; </div>
<div class="flash"><?php echo( $flash ); ?></div>
<div class="fieldbottom"> &nbsp; </div>
<div class="formbottom"> &nbsp; </div>
</fieldset>
<?php } /* end of if */?>
</div>
</div>
<div id="unten">
<p> &nbsp; </p>
<p class="print-info">Diese Inhalte sind unter der Adresse <a style="font-weight:bold;" href="<?php echo ($this->current_url() ); ?>"><?php echo ($this->current_url() ); ?></a> zu erreichen.</p>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,54 @@
<?php
/**
* Admintemplate zur Protokollausgabe
*
* @package baseContent
* @subpackage basecontent
*/
echo'<?xml version="1.0" encoding="iso-8859-1" ?>'."\n"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
<head>
<title><?php echo $this->get_field('title') ?> - <?php $this->get_siteTitle() ?></title>
<?php $this->get_element('admin_head'); ?>
</head>
<body><div id="wrapper">
<div id="kopf">
<h1><img src="/public/img/admin/basecontent.gif" width="468" height="54" alt="baseContent" /></h1>
<p id="logout"><a href="/basecontent/logout/">&raquo; <?php $this->get_username(); ?> Logout</a></p>
<div id="bc_nav">
<?php $this->get_element('bc_nav', array('section'=>'basecontent')); ?>
</div>
<div id="bc_intern">
<ul>
<li><a href="/basecontent/options/">Einstellungen</a></li>
<li><a href="/basecontent/protocol/">Protokoll</a></li>
<li><a href="/basecontent/support/">Support</a></li>
</ul>
</div>
<h2><?php $this->get_siteTitle(); ?></h2>
</div>
<div id="logfile">
<h2>Protokoll</h2>
<pre>
<?php echo $this->get_field('logfile'); ?>
</pre>
<p>Ende der Logfileausgabe<br />(Es wurden nur die 30 letzten Aktionen angezeigt.)</p>
</div>
<div id="unten">
<p> &nbsp; &nbsp; </p>
<p class="print-info">Diese Inhalte sind unter der Adresse <a style="font-weight:bold;" href="<?php echo ($this->current_url() ); ?>"><?php echo ($this->current_url() ); ?></a> zu erreichen.</p>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,19 @@
<?php
/**
* Admintemplate, Frameset f&uuml;r "webseitenmodus"
*
* @package baseContent
* @subpackage basecontent
*/
echo'<?xml version="1.0" encoding="iso-8859-1" ?>'."\n"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
<head>
<title><?php echo $this->get_field('title') ?> - <?php $this->get_siteTitle() ?></title>
<link rel="shortcut icon" href="/public/img/basecontent.ico" />
</head>
<frameset rows="90,*" frameborder="0">
<frame src="/basecontent/webframe/top" name="adminframe" scrolling="no" noresize="noresize" frameborder="0" framespacing="0" border="0" />
<frame src="/" name="siteframe" noresize="noresize" frameborder="0" framespacing="0" border="0" />
</frameset>
</html>

View File

@ -0,0 +1,61 @@
<?php
/**
* basecontent-model
*
* Enthält die Basisfunktionen von basecontent.
*
* Klasse basecontent_model
*
* @package baseContent
* @subpackage basecontent
*/
class app_basecontent_model extends fl_model {
function login($fl) {
if ( isset($fl['username'], $fl['password'])
AND $this->login_right( addslashes($fl['username']), addslashes($fl['password']) )
AND !isset($_SESSION['username'])
) {
return TRUE;
} elseif ( $this->login_right( addslashes($fl['username']), addslashes($fl['password']) ) == 0) {
return FALSE;
}
if($_SESSION['IP'] != $_SERVER['REMOTE_ADDR'])
die('Falsche Sessiondaten, bitte erneut einloggen.');
}
function login_right($user, $pass) {
$result = $this->datamodel->retrieve('user','COUNT(*) as anzahl',"name = '".$user."' AND password = MD5('".$pass."')");
return $result['anzahl'];
}
function get_trashcan_data($modules) {
$trashcan_data = array();
foreach( $modules as $name => $module ) {
$controller = str_replace('_LANG', '', $module);
$controller = str_replace('_', '', $controller);
$module = str_replace('LANG', LANG, $module);
$sql = 'SELECT * FROM fl_'.$module.' WHERE status = 2;';
$data[$module] = $this->datamodel->_query_db($sql);
if ( isset($data[$module]['id']) ) {
$tmp = $data[$module];
unset($data);
$data[$module][] = $tmp;
}
$data[$module]['title'] = $name;
$data[$module]['controller'] = $controller;
if ( count( $data[$module] ) <= 2 ) continue;
$trashcan_data += $data;
}
return $trashcan_data;
}
}
?>

View File

@ -0,0 +1,67 @@
<?php
/**
* Modul: basecontent
*
* @package baseContent
* @subpackage basecontent
* @author Matthias Viehweger <kronn@kronn.de>
* @version 0.1.7
* @license All Rights Reserved
*/
/**
* Modul zentral registrieren
*/
$installed_modules[] = 'basecontent';
/**
* Allgemeines zum Modul
*/
class basecontent_modul extends fl_modul {
function get_options($modules) {
echo '<fieldset class="moduloptionen"><legend>allgemeine Optionen</legend>
<p><label for="seitentitel">Seitentitel</label><input type="text" class="text" name="fl[basecontent_seitentitel]" id="seitentitel" size="60" value="' . $this->_get_option('basecontent','seitentitel', 'value') . '" /></p>
<p><label for="defaultsection">Startbereich</label><select id="defaultsection" name="fl[basecontent_defaultsection]" size="1" class="dropdown">'."\n";
$modules = array('pages', 'basecontent');
foreach ( $modules as $module ) {
echo ' <option value="'.$module.'"' . ( ( $this->_get_option('basecontent', 'defaultsection', 'value') == $module )? ' selected="selected"' :'' ).'>'. ucwords($module) .'</option>'."\n";
}
echo '
</select></p>
<p><label for="option-adminhelp">Hilfe anzeigen</label>'.$this->get_dropdown('adminhelp', 'sichtbar=anzeigen,unsichtbar=verstecken').'</p>
</fieldset>'."\n";
}
function get_dropdown($field, $options) {
$options = explode(',', $options);
$aktuell = $this->_get_option('basecontent', $field);
$html = '';
$html .= "\n\t\t\t".'<select name="fl[basecontent_'.$field.']" id="option-'.$field.'" size="1" class="dropdown">'."\n";
foreach( $options as $option ) {
$option = explode('=', $option);
$option[1] = ( isset($option[1]) )? $option[1]: $option[0];
$selected = ( $aktuell == $option[0] )? ' selected="selected"': '';
$html .= "\t\t\t\t".'<option value="'.$option[0].'"'.$selected.'>'.$option[1].'</option>'."\n";
}
$html .= "\t\t\t".'</select>';
return $html;
}
function get_name() {
return FALSE;
}
function get_starttext() {
echo '';
}
function prepare() {
$this->factory->get_helper('minixml');
}
}
?>

View File

@ -0,0 +1,56 @@
<?php
/**
* basecontent-view
*
* Enthält verschiedene Templatetags
* für die Basisfunktionen von basecontent.
*
* Klasse basecontent_view
*
* @package baseContent
* @subpackage basecontent
*/
class basecontent_view extends fl_view {
function get_target() {
echo $this->data['from'];
}
function get_subtitle() {
echo $this->get_field('subtitle');
}
function get_content() {
echo $this->get_field('content');
}
function get_html_content() {
$textile = new Textile();
$html = $textile->process( $this->data['content'] );
echo $html;
}
function get_all_options() {
$federleicht = get_fl();
$modules = &$federleicht->modules;
foreach( $modules as $module) {
require_once($this->modulepath.$module.'/modul.php');
$temp_module_object = new $module($federleicht);
$temp_module_object->get_options($modules);
unset($temp_module_object);
}
}
function get_all_starttexts() {
$federleicht = get_fl();
$modules = &$federleicht->modules;
foreach( $modules as $module) {
require_once($this->modulepath.$module.'/modul.php');
$temp_module_object = new $module($federleicht);
$temp_module_object->get_starttext();
unset($temp_module_object);
}
}
}
?>

View File

@ -0,0 +1,23 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
<head>
<title><?php echo $this->get_field('title') ?> - <?php $this->get_siteTitle() ?></title>
<?php $this->get_element('admin_head'); ?>
<style type="text/css" media="screen,projection">
body, html {height:63px; }
#kopf { height:63px; }
</style>
</head>
<body class="framesite"><div id="wrapper">
<div id="kopf">
<h1><img src="/public/img/admin/basecontent.gif" width="468" height="54" alt="baseContent" /></h1>
<p id="logout"><a href="/basecontent/logout/" target="_top">&raquo; Logout</a></p>
<div id="bc_nav">
<?php $this->get_element('bc_nav'); ?>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,27 @@
<?php
/**
* Seitentemplate: login
*
* @package baseContent
* @subpackage basecontent
*/
?>
<h2><span id="actiontitle"><?php echo $this->get_field('title'); ?></span></h2>
<form name="adminform" action="/basecontent/auth/" method="post">
<fieldset class="sichtbar"><h3> &nbsp; </h3>
<div class="formtop"> &nbsp; </div>
<input type="hidden" class="hidden" name="fl[from]" value="<?php $this->get_target(); ?>" />
<p><label for="username">Benutzername:</label><input tabindex="1" id="username" name="fl[username]" type="text" class="text" size="20" maxlength="20" value="" /></p>
<p><label for="password">Passwort:</label><input tabindex="2" id="password" name="fl[password]" type="password" class="text" size="20" value="" /></p>
<div class="fieldbottom"> &nbsp;</div>
<p class="formbuttons"><a tabindex="3" onclick="document.adminform.submit()" onkeypress="document.adminform.submit()"><img src="/public/img/admin/button_einloggen.gif" width="69" height="20" alt="Einloggen"></a></p>
<p class="hidden"><input type="submit" value="Einloggen" class="knopf" /></p>
<div class="formbottom"> &nbsp; </div>
</fieldset>
</form>
<script type="text/javascript">
// <![CDATA[
$('username').focus();
// ]]>
</script>

View File

@ -0,0 +1,17 @@
<?php
/**
* Seitentemplate: logout
*
* @package baseContent
* @subpackage basecontent
*/
?>
<h2>Logout erfolgreich</h2>
<fieldset class="sichtbar"><h3> &nbsp; </h3>
<div class="formtop"> &nbsp; </div>
<p>Der Logoutvorgang wurde erfolgreich abgeschlossen.</p>
<p>Aus Sicherheitsgr&uuml;nden kann es empfehlenswert sein, dieses Browserfenster zu schliessen. Dies gilt insbesonderen, wenn Sie diese Seite an einem &ouml;ffentlichen Computer (z. B. Internetcaf&eacute;) genutzt haben. </p>
<p>Zur <a href="/">Startseite</a></p>
<div class="fieldbottom"> &nbsp; </div>
<div class="formbottom"> &nbsp; </div>
</fieldset>

View File

@ -0,0 +1,9 @@
<?php
$b = new bereiche();
?>
<h2>Fehlende Berechtigung</h2>
<?php $b->oben('optionen', ' &nbsp; '); ?>
<p>Leider haben Sie keine ausreichende Rechte, um auf die gewünschte Funktion zugreifen zu können.</p>
<p>Bitte wenden Sie sich an einen Administrator, um weitere Informationen zu erhalten.</p>
<?php $b->buttons('abbrechen'); ?>
<?php $b->unten(); ?>

View File

@ -0,0 +1,10 @@
<?php
$b = new bereiche();
?>
<h2>Einstellungen <span id="actiontitle">bearbeiten</span></h2>
<form action="/basecontent/options/save" method="post">
<?php $b->oben('optionen', 'Optionen einstellen'); ?>
<?php $this->get_all_options(); ?>
<?php $b->buttons('speichern'); ?>
<?php $b->unten(); ?>
</form>

View File

@ -0,0 +1,21 @@
<?php
/**
* Seitentemplate: Protokoll
*
* @package baseContent
* @subpackage basecontent
*/
?>
<h2>Protokoll <span id="actiontitle">(Übersicht)</span></h2>
<fieldset id="protocol"><h3> &nbsp; </h3>
<div class="formtop"> &nbsp; </div>
<p>Sie k&ouml;nnen das Protokoll</p>
<ul>
<li><a href="/basecontent/protocol/textfile">als Textdatei herunterladen.</a></li>
<li><a href="/basecontent/protocol/screen">am Bildschirm ausgeben.</a></li>
</ul>
<p><br />Die Textdatei k&ouml;nnen Sie in einem beliebigen Texteditor &ouml;ffnen.</p>
<div class="fieldbottom"> &nbsp; </div>
<div class="formbottom"> &nbsp; </div>
</fieldset>

View File

@ -0,0 +1,60 @@
<?php $this->functions->needs('bereiche'); $bereiche = new bereiche(); ?>
<script type="text/javascript">
// <[CDATA[
$('startlink').className = 'aktiv';
// ]]>
</script>
<h2>wichtigsten Links der 2erlei-GbR</h2>
<?php $bereiche->oben('hauptbereich', 'allgemeine Links'); ?>
<ul>
<li><a href="http://calendar.google.com" target="_blank">2erlei - Kalender</a></li>
<li><a href="http://adressen.2erlei.de" target="_blank">2erlei - Adressen</a></li>
<li><a href="http://www.google.com/analytics/" target="_blank">2erlei - Webseiten Statistik</a></li>
<li><a href="http://dev.2erlei.de/wiki" target="_blank">2erlei Wiki</a></li>
<li><a href="http://dev.2erlei.de/collaboa/projects" target="_blank">2erlei - Ticketsystem für alle Projekte</a></li>
<li><a href="http://nd.2erlei.de" target="_blank">neues Deutschland - Friedrich (http)</a></li>
<li><a href="http://kronn.projectpath.com/" target="_blank">baseContent - Projektplanung</a></li>
<li><a href="http://arbeitszeit.2erlei.de/" target="_blank">Arbeitszeiten</a></li>
<!-- <li><a href="http://2erlei.homelinux.com:8888" target="_blank">2erlei - Bastians Computer</a> (<span style="color:red;">online</span>)</li>-->
</ul>
<?php $bereiche->buttons('weiter:kunden'); ?>
<?php $bereiche->unten(); ?>
<?php $bereiche->oben('kunden', 'Links von Kunden und Projekten'); ?>
<ul>
<li><a href="ftp://myhotelvideo@nd.2erlei.de/Freemind" target="_blank">myhotelvideo - Mindmap *(ftp)</a></li>
<li><a href="http://hotelvideo.projectpath.com/login" target="_blank">myhotelvideo - Projektplanung</a></li>
<li><a href="http://myhotelvideo.2erlei.de" target="_blank">myhotelvideo - Testserver</a></li>
<li><a href="ftp://myhotelvideo@nd.2erlei.de" target="_blank">myhotelvideo - Datenarchiv *(ftp)</a></li>
</ul>
<?php $bereiche->unterbrechung(); ?>
<ul>
<li><a href="http://maputa.com/basecontent/" target="_blank">maputa - basecontent</a></li>
<li><a href="ftp://maputa@nd.2erlei.de" target="_blank">maputa - Datenarchiv *(ftp)</a></li>
</ul>
<?php $bereiche->unterbrechung(); ?>
<ul>
<li><a href="http://2erlei.seework.com" target="_blank">cosmos-escorts - Projektplanung</a></li>
<li><a href="http://cosmos-escorts.com/basecontent/" target="_blank">cosmos-escorts - basecontent</a></li>
<li><a href="ftp://varimex-ag@nd.2erlei.de" target="_blank">varimex-ag - Datenarchiv *(ftp)</a></li>
</ul>
<?php $bereiche->buttons('zurueck:hauptbereich,weiter:bisher'); ?>
<?php $bereiche->unten(); ?>
<?php $bereiche->oben('bisher', 'bisherige Links'); ?>
<ul>
<li><a href="/basecontent/webframe/">Webseite</a></li>
<li><a href="/basecontent/options/">Einstellungen</a></li>
<li><a href="/basecontent/protocol/">Protokoll</a></li>
<li><a href="/basecontent/support/">Support</a></li>
</ul>
<?php $bereiche->buttons('zurueck:kunden'); ?>
<?php $bereiche->unten(); ?>

View File

@ -0,0 +1,46 @@
<h2>Papierkorb <span id="actiontitle">(Übersicht)</span></h2>
<?php
$moduldaten = $this->data;
unset($moduldaten['title']);
unset($moduldaten['controller']);
$this->functions->needs('bereiche');
$bereiche = new bereiche(2);
if ( count($moduldaten) == 0 ) {
$bereiche->oben('modulliste', 'Papierkorb');
?>
<p>Hier werden die gelöschten Datensätze aufgelistet.</p>
<p>Derzeit sind keine Datensätze als gelöscht markiert. </p>
<?php
$bereiche->buttons();
$bereiche->unten();
} else {
foreach( $moduldaten as $modul ) {
$bereiche->oben("modul_".strtolower($modul['controller']), $modul['title']); ?>
<ul>
<?php
$controller = $modul['controller'];
unset($modul['title'], $modul['controller']);
foreach ( $modul as $datensatz ) {
if ( isset($datensatz['name']) ) {
$bezeichnung = $datensatz['name'];
} elseif ( isset($datensatz['firmenname']) ) {
$bezeichnung = $datensatz['firmenname'];
} else {
$bezeichnung = 'Datensatz Nr. ' . $datensatz['id'];
}
?>
<li><a href="/<?php echo $controller; ?>/draft/<?php echo $datensatz['id']; ?>"><?php echo $bezeichnung; ?></a></li>
<?php } // inner endforeach ?>
</ul>
<?php
$bereiche->buttons();
$bereiche->unten();
} // outer endforeach
}
?>

View File

@ -0,0 +1,33 @@
<?php
/**
* Coding-Controller
*
* @package baseContent
* @subpacke coding
*/
class coding_controller extends fl_controller {
/* Eigenschaften */
var $defaultAction = 'basecontent';
var $from = '';
var $layout = 'default';
#
function basecontent() {
$this->data['title'] = 'baseContent';
}
function html() {
$this->data['title'] = 'HTML/CSS';
}
function mysql() {
$this->data['title'] = 'MySQL-Datenbanken';
}
function common() {
$bild = ( $this->cap['action'] == 'defaultAction' )? $this->defaultAction: $this->cap['action'];
$this->data['kopfbild'] = $bild;
return TRUE;
}
}
?>

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<hilfe for="coding">
</hilfe>

View File

@ -0,0 +1,36 @@
<!-- Kommentar, um IE zu Quirksmode zu bringen -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>2erlei Medienagentur</title>
<?php $this->get_element('header'); ?>
</head>
<body class="coding"><div id="wrapper">
<div id="kopf">
<h1><a href="/"><img src="/public/img/logo.gif" width="149" height="108" alt="2erlei Medienagentur"></a></h1>
<div id="kundennavi">
<?php $this->get_element('kundennavi'); ?>
</div>
<img class="kopfbild" width="519" height="156" alt="" src="/public/img/kopf_start.jpg">
<div id="navigation">
<?php $this->get_element('navigation'); ?>
</div>
</div>
<div id="content">
<?php $this->get_sub_view(); ?>
</div>
<div id="unten">
<?php $this->get_element('unten'); ?>
<p class="print-info">Dieser Text ist/Diese Inhalte sind unter der Adresse <a style="font-weight: bold" href="http://www.2erlei.de/">http://www.2erlei.de/</a> zu erreichen.</p>
</div>
</div><?php $this->get_element('google_analytics'); ?>
</body>
</html>

View File

@ -0,0 +1,10 @@
<?php
/**
* coding-model
*
* @package baseContent
* @subpackage coding
*/
class app_coding_model extends fl_model {
}
?>

View File

@ -0,0 +1,17 @@
<?php
/**
* Modul: coding
*
* @package baseContent
* @subpackage coding
* @author Matthias Viehweger <kronn@kronn.de>
* @version 0.1.7
* @license All Rights Reserved
*/
/**
* Allgemeines zum Modul
*/
class coding_modul extends fl_modul {
}
?>

View File

@ -0,0 +1,10 @@
<?php
/**
* coding-view
*
* @package baseContent
* @subpackage coding
*/
class coding_view extends fl_view {
}
?>

View File

@ -0,0 +1,22 @@
<div id="subnavigation">
<p><a href="/coding" class="aktiv">baseContent</a></p>
<p><a href="/coding/html">HTML</a></p>
<p><a href="/coding/mysql">MySQL</a></p>
</div>
<div id="inhalt">
<h2>baseContent</h2>
<h3>Unser baseContent bietet ihnen eine gute und effiziente Basis für ihre Präsenz im Internet.</h3>
<p>Sie baut auf dem Prinzip eines einfach zu handhabenen Content Management Systems, womit sie direkt Einfluss auf die Gestaltung Ihres Internetauftritts nehmen können.</p>
<p>baseContent ist selbstadministrierbar ohne das sie Programmierkenntnisse oder weitere Software, als Ihren gewöhnlichen Internetbrowser, benötigen.</p>
<p>Selbstadministration bedeutet, dass sie selbstständig Texte und Bilder einfügen können, die automatisch in die Webseite eingebunden werden.</p>
<p>Sie konzentrieren sich auf ihre Inhalte und 2erlei macht den Rest.</p>
</div>
<div id="info_spalte">
<h3>Hier Das Passende</h3>
<p><a href="/design/web"><img src="/public/img/info/webdesign.jpg" width="192" height="90" alt="Webdesign"></a></p>
<p><a href="/coding/html"><img src="/public/img/info/html.jpg" width="192" height="90" alt="HTML"></a></p>
<p><a href="/coding/hosting"><img src="/public/img/info/hosting.jpg" width="192" height="90" alt="Hosting"></a></p>
</div>

View File

@ -0,0 +1,39 @@
<h2 class="image"><img src="/public/img/header_hosting.gif" width="558" height="36" alt="Hosting"></h2>
<p class="image"><img src="/public/img/teaser_basecontent.gif" width="549" height="99" alt="Ihr persönliches CMS für Ihr individuelles Unternehmen"></p>
<p id="subnavigation">
<a href="/coding/basecontent">baseContent</a>
<span class="separator">|</span>
<a href="/coding/html">statisches HTML</a>
<span class="separator">|</span>
<a href="/coding/mysql">MySQL-Datenbanken</a>
<span class="separator">|</span>
<a href="/coding/hosting" class="aktiv">Hosting</a>
</p>
<div id="excerpt_img">
<img src="/public/img/excerpt_basecontent.gif" width="189" height="216" alt="baseContent Teaser">
</div>
<div id="inhalt">
<h3>Hosting</h3>
<p class="first">Wir hosten und betreuen Ihre Internetseite</p>
<p>Unsere Server werden von unseren kompetenten Administratoren rund um die Uhr überwacht.</p>
<p>Bei der Technik arbeiten wir mit einer der größten und renommiertesten Hostinganbietern, der 1&1 Internet AG zusammen.</p>
<p>Ihr Internetauftritt ist bei uns in sicheren Händen und wird von uns mit größtmöglichen Sicherheitsstandards vor Missbrauch geschützt.</p>
<p>Sie können sich in Ihrem Unternehmen auf das wesentliche konzentrieren, ohne viele Verträge abzuschließen und 2erlei macht den Rest.</p>
</div>
<div id="info_spalte">
<h3>Hier Das Passende</h3>
<p><a href="/coding/basecontent"><img src="/public/img/info/basecontent.jpg" width="192" height="90" alt="baseContent"></a></p>
<p><a href="/design/web"><img src="/public/img/info/webdesign.jpg" width="192" height="90" alt="Webdesign"></a></p>
<p><a href="/coding/html"><img src="/public/img/info/html.jpg" width="192" height="90" alt="HTML"></a></p>
</div>

View File

@ -0,0 +1,24 @@
<div id="subnavigation">
<p><a href="/coding">baseContent</a></p>
<p><a href="/coding/html" class="aktiv">HTML</a></p>
<p><a href="/coding/mysql">MySQL</a></p>
</div>
<div id="inhalt">
<h2>statisches HTML</h2>
<h3>Die Struktur und Aufbau einer Internetseite optmiert für alle gängigen Browser</h3>
<p>Wir setzen Ihr Design in eine "lebendige" Internetseite um.</p>
<p>Die Programmierung erfolgt nach den neusten Webstandards und unter Berücksichtigung der Barrierefreiheit.</p>
<p>Die Inhalte werden mit HTML strukturiert.<br> Die Anordnung und Darstellung wird über ein CSS (cascading stylesheet) gesteuert.</p>
<p>Die Inhalte werden mit XHTML für die Ausgabe strukturiert. Die Anordnung und Darstellung wird
über ein CSS (cascading stylesheet) gesteuert. Die Daten liegen in einer Datenbank. Die in
der Datenbank befindlichen Daten, werden mit Hilfe von PHP verarbeitet und in ein XHTML-
Format konvertiert. </p>
</div>
<div id="info_spalte">
<h3>Hier Das Passende</h3>
<p><a href="/coding/basecontent"><img src="/public/img/info/basecontent.jpg" width="192" height="90" alt="baseContent"></a></p>
<p><a href="/design/web"><img src="/public/img/info/webdesign.jpg" width="192" height="90" alt="Webdesign"></a></p>
<p><a href="/coding/hosting"><img src="/public/img/info/hosting.jpg" width="192" height="90" alt="Hosting"></a></p>
</div>

View File

@ -0,0 +1,25 @@
<div id="subnavigation">
<p><a href="/coding">baseContent</a></p>
<p><a href="/coding/html">HTML</a></p>
<p><a href="/coding/mysql" class="aktiv">MySQL</a></p>
</div>
<div id="inhalt">
<h2>MySQL-Datenbanken</h2>
<h3>Die Inhalte sicher und getrennt von der Struktur in einer Datenbank.</h3>
<p>Ihre Inhalte wie Text oder Bilder können getrennt vom Programmcode in einer Datenbank gespeichert und verwaltet werden.<br>Damit Ihre Inhalte geschützt und übersichtlich verwaltet werden.</p>
<p>Auch erst mit einer Datenbank sind vernünfitge Volltextsuchen auf der Internetseite möglich.</p>
<p>Die Daten bzw. Inhalte werden getrennt von dem Programmcode und der Darstellung in
einer geschützten MySQL-Datenbank gespeichert. Über die Administrationsoberfläche (CMS)
können sie bearbeitet und organisiert werden.</p>
</div>
<div id="info_spalte">
<h3>Hier Das Passende</h3>
<p><a href="/coding/basecontent"><img src="/public/img/info/basecontent.jpg" width="192" height="90" alt="baseContent"></a></p>
<p><a href="/coding/html"><img src="/public/img/info/html.jpg" width="192" height="90" alt="HTML"></a></p>
<p><a href="/design/web"><img src="/public/img/info/webdesign.jpg" width="192" height="90" alt="Webdesign"></a></p>
</div>

View File

@ -0,0 +1,36 @@
<!-- Kommentar, um IE zu Quirksmode zu bringen -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>2erlei</title>
<?php $this->get_element('header'); ?>
</head>
<body class="<?php echo $this->cap['action']; ?>"><div id="wrapper">
<div id="kopf">
<h1><a href="http://www.2erlei.de"><img src="/public/img/logo.gif" width="149" height="108" alt="2erlei Medienagentur"></a></h1>
<div id="kundennavi">
<?php $this->get_element('kundennavi'); ?>
</div>
<img class="kopfbild" width="519" height="156" alt="" src="/public/img/kopf_start.jpg">
<div id="navigation">
<?php $this->get_element('navigation'); ?>
</div>
</div>
<div id="content">
<?php $this->get_sub_view(); ?>
</div>
<div id="unten">
<?php $this->get_element('unten'); ?>
<p class="print-info">Dieser Text ist/Diese Inhalte sind unter der Adresse <a style="font-weight: bold" href="http://www.2erlei.de/">http://www.2erlei.de/</a> zu erreichen.</p>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,33 @@
<?php
/**
* Design Controller
*
* @package baseContent
* @subpacke design
*/
class design_controller extends fl_controller {
/* Eigenschaften */
var $defaultAction = 'web';
var $from = '';
var $layout = 'default';
#
function web() {
$this->data['title'] = 'Webdesign';
}
function druck() {
$this->data['title'] = 'Drucksachen';
}
function corporate() {
$this->data['title'] = 'Corporate Identity';
}
function common() {
$bild = ( $this->cap['action'] == 'defaultAction' )? $this->defaultAction: $this->cap['action'];
$this->data['kopfbild'] = $bild;
return TRUE;
}
}
?>

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<hilfe for="design">
</hilfe>

View File

@ -0,0 +1,37 @@
<!-- Kommentar, um IE zu Quirksmode zu bringen -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>2erlei Medienagentur</title>
<?php $this->get_element('header'); ?>
</head>
<body class="design"><div id="wrapper">
<div id="kopf">
<h1><a href="/"><img src="/public/img/logo.gif" width="149" height="108" alt="2erlei Medienagentur"></a></h1>
<div id="kundennavi">
<?php $this->get_element('kundennavi'); ?>
</div>
<img class="kopfbild" width="519" height="156" alt="" src="/public/img/kopf_start.jpg">
<div id="navigation">
<?php $this->get_element('navigation'); ?>
</div>
</div>
<div id="content">
<?php $this->get_sub_view(); ?>
</div>
<div id="unten">
<?php $this->get_element('unten'); ?>
<p class="print-info">Dieser Text ist/Diese Inhalte sind unter der Adresse <a style="font-weight: bold" href="http://www.2erlei.de/">http://www.2erlei.de/</a> zu erreichen.</p>
</div>
</div><?php $this->get_element('google_analytics'); ?>
<?php $this->get_element('lightbox'); ?>
</body>
</html>

View File

@ -0,0 +1,10 @@
<?php
/**
* design-model
*
* @package baseContent
* @subpackage design
*/
class app_design_model extends fl_model {
}
?>

View File

@ -0,0 +1,17 @@
<?php
/**
* Modul: design
*
* @package baseContent
* @subpackage design
* @author Matthias Viehweger <kronn@kronn.de>
* @version 0.1.7
* @license All Rights Reserved
*/
/**
* Allgemeines zum Modul
*/
class design_modul extends fl_modul {
}
?>

View File

@ -0,0 +1,10 @@
<?php
/**
* design-view
*
* @package baseContent
* @subpackage design
*/
class design_view extends fl_view {
}
?>

View File

@ -0,0 +1 @@
<div id="subnavigation"> <p><a href="/design">Webdesign</a></p> <p><a href="/design/druck">Drucksachen</a></p> <p><a href="/design/corporate" class="aktiv">CI</a></p> </div> <div id="inhalt"> <h2>Corporate Identity</h2> <h3>Geben Sie Ihren Kunden Orientierung und Sicherheit mit einer unverwechselbaren Indentität.</h3> <p>Ausgangspunkt</p> <p>Für ein Unternehmen wird es immer notwendiger, aufgrund der Unübersichtlichkeit der Leistungsangebote auf dem Markt, sich von Ihrer Konkurrenz abzuheben.</p> <p>Hersteller müssen durch die immer größer werdende Produktvielfalt darum kämpfen, in das Sortiment des Handels aufgenommen zu werden. Vorteile hat der, der ein gutes und unverwechselbares Image genießt.</p> <p>Entwicklung</p> <p>Die Entwicklung einer Corporate Identity ist kompliziert und stellt hohe Anforderungen eine vernetzte Struktur in einem übersichtlichen Design zu vereinen. Daher greifen viele Unternehmen anfangs Einzelaspekte auf, vor allem das Design für die Kommunikation. Dies kann aber nicht dem strategischen Aspekt gerecht werden, zu einem ganzeinheitlichen Design zu gelangen. Daher muss man genau die Unternehmensstruktur, unter Berücksichtigung der angestrebten Ziele, analysieren. Aufgrund der Analyse lässt sich das Unternehmen, mit den zur Verfügung stehenden Instrumenten, in ein einheitliches, sinngemäßes und wieder erkennbares Design zusammenfassen.</p> <p>Die Planung für den späteren Kostenaufwand für die Produktion ist von entscheidender Bedeutung, damit auch das einheitliche Design bewart bleibt.</p> <p>Die Hausfarbe</p > <p>Die Hausfarbe ist eines der wichtigsten Instrumente, weil es ein unmittelbar einprägendes Erkennungs- und Unterscheidungsmerkmal für Unternehmen darstellt. Wir stehen Ihnen beratend zur Seite, dass die Farbe auch ohne hohen Kostenaufwand überall einsetzbar wird. Gerade im Druckbereich wird es zu einem wichtigen Thema, in wie weit sich diese Farbe und auf welchen Untergrund drucken lässt.</p> <p>Logo</p> <p>Von einem Unternehmenszeichen, auch Logo genannt, werden viele Eigenschaften erwartet:</p> <p>- Aufmerksamkeit, Signalwirkung<br /> - langlebig und zeitlos<br /> - ästhetisch und eigenständige Aussage<br /> - Integration auf vielfältigsten Vorlagen<br /> - Informations- und Erinnerungswert</p> <p>Die Hausfarbe sollte in dem Logo auftauchen und prägend wirken.</p> <p>Schriften</p> <p>Innovative Firmen zeigen ebenfalls Fortschritt, wenn sie keine klassisch konservativen Schriften verwenden. Von der Schrift muss zu erwarten sein, dass sie möglichst zeitlos ist und keinem aktuellen Modetrend folgt.<p> <p>Gestaltungsraster</p> <p>Der Empfänger registriert als erstes das Objekt als ganzes. Die Details untersteichen den individuellen Karakter des Unternehmens. Das definierte Raster gewährleistet ein gleichbleibenes Design, das auf keinen Fall gebrochen werden sollte. Da kommen wir wieder zu dem Thema, dass möglichst alle Aspekte in der Analyse berücksichtigt werden sollten.</p> <p>Ergebnis</p> <p>Diese Instrumente müssen nach dem strategischen Ziel entsprechend eingesetzt werden.</p> <p>Die Leitidee nennt den Sinn des Unternehmens und vermittelt eine Vision, wie es aktuelle und künftige Probleme lösen oder dazu beitragen will. <p>Die Leitsätze sind Kernaussagen bestimmen das Verhältnis des Unternehmens zu zentralen Bezugsgruppen wie Mitarbeiter, Kunden, Aktionäre, Medien. Die Leitsätze formulieren die spezifische Kompetenz des Unternehmens, seine Leistungsfähigkeit und die Wettbewerbsvorteile.</p> <p>Das Motto</p> <p>Leitidee und Leitsätze sind meist zu lang, um sie sich merken zu können. Ein Motto bringt daher das Leitbild auf den Punkt: Es ist kurz, prägnant und leicht zu merken.</p> <p>Das Motto fasst alles in einem kurzen, prägnanten Slogan zusammen.</p> </div> <div id="info_spalte"> <h3>Hier Das Passende</h3> <p><a href="/design/druck"><img src="/public/img/info/druck.jpg" width="192" height="90" alt="Drucksachen"></a></p> <p><a href="/design/photo"><img src="/public/img/info/photo.jpg" width="192" height="90" alt="Fotografie"></a></p> <p><a href="/design/web"><img src="/public/img/info/webdesign.jpg" width="192" height="90" alt="Webdesign"></a></p> </div>

View File

@ -0,0 +1,21 @@
<div id="subnavigation">
<p><a href="/design">Webdesign</a></p>
<p><a href="/design/druck" class="aktiv">Drucksachen</a></p>
<p><a href="/design/corporate">CI</a></p>
</div>
<div id="inhalt">
<h2>Drucksachen</h2>
<h3> Design ist der Prozess</h3>
<p> Die Aufgaben eines Designs können verschiedener Ziele unterliegen. Design kann Emotionen hervorrufen, komplexe Systeme erklärend unterstützen und viel mehr.</p>
<p>Design bedeutet mehr als nur Formgebung und Styling: Gutes Design ist ein komplexer Prozess, in dem unterschiedliche und oft widersprüchliche Anforderungen erfüllt werden müssen, damit Objekte in der gewünschten Art und Weise funktionieren.</p>
<p>Wir gestalten Ihnen alles mit unserer geballten Kompetenz und Leidenschaft, von Produktvorstellung über Bewerbungsmappe, von der Internetseite bis hin zu einer komplexen Werbekampagne.</p>
</div>
<div id="info_spalte">
<h3>Hier Das Passende</h3>
<p><a href="/design/corporate"><img src="/public/img/info/corporate.jpg" width="192" height="90" alt="Corporate Identity"></a></p>
<p><a href="/design/photo"><img src="/public/img/info/photo.jpg" width="192" height="90" alt="Fotografie"></a></p>
</div>

View File

@ -0,0 +1,35 @@
<h2 class="image"><img src="/public/img/header_photo.gif" width="558" height="36" alt="Fotografie"></h2>
<p class="image"><img src="/public/img/teaser_web.gif" width="549" height="99" alt="Die Form folgt der Funktion, unsere Gestaltung ihren Bedürfnissen"></p>
<p id="subnavigation">
<a href="/design/web" >Webdesign</a>
<span class="separator">|</span>
<a href="/design/druck" >Drucksachen</a>
<span class="separator">|</span>
<a href="/design/corporate">Corporate Identity</a>
<span class="separator">|</span>
<a href="/design/photo" class="aktiv">Fotografie</a>
</p>
<div id="excerpt_img">
<img src="/public/img/excerpt_basecontent.gif" width="189" height="216" alt="baseContent Teaser">
</div>
<div id="inhalt">
<h3>Fotografie</h3>
<p class="first">Unser Netzwerk von Fotografen runden Ihr Produkt ab.</p>
<p>Wir bieten nicht nur einen Textcontent für Ihre Webseite zur Erstellen, sondern auch den bildlichen Content zu liefern.</p>
<p>Ob Sie schon vorhandene Fotos optimiert haben möchten oder sogar noch gar keine besitzen, da kommen wir ins Spiel. Wir optimieren Ihre Bilder oder wir schicken einer unser kompetenten Fotografen bei Ihnen vorbei.</p>
<p>Komplette Internetseite aus einer Hand.</p>
</div>
<div id="info_spalte">
<h3>Hier Das Passende</h3>
<p><a href="/design/web"><img src="/public/img/info/webdesign.jpg" width="192" height="90" alt="Webdesign"></a></p>
<p><a href="/coding/basecontent"><img src="/public/img/info/basecontent.jpg" width="192" height="90" alt="baseContent"></a></p>
<p><a href="/design/druck"><img src="/public/img/info/druck.jpg" width="192" height="90" alt="Drucksachen"></a></p>
</div>

View File

@ -0,0 +1,21 @@
<div id="subnavigation">
<p><a href="/design" class="aktiv">Webdesign</a></p>
<p><a href="/design/druck">Drucksachen</a></p>
<p><a href="/design/corporate">CI</a></p>
</div>
<div id="inhalt">
<h2>Webdesign</h2>
<h3>Heben Sie sich mit einem individuellen Design von Ihrer Konkurrenz ab.</h3>
<p>Wir gestalten Ihnen eine individuelle Webseite, die neben dem Design vor allem eine größtmögliche Nutzerfreundlichkeit umfasst.</p>
<p>Aufbau und Navigation werden in einer übersichtlichen Struktur angeordnet.</p>
<p>Wir sind bestrebt, ein Design für Sie zu entwerfen, das alle diese Aspekte umfasst und zu einer vernünftigen Usability führt. Das Ihre User schnell und direkt informiert werden, was Sie tun und was Sie anbieten.</p>
<p>Die Wirtschaftlichkeit einer Seite kann von entscheidender Bedeutung sein, um der Konkurrenz einen Schritt voraus zu sein. Zwischen potentieller Kunde und Unternehmen steht in vielen Fällen die Internetseite.</p>
</div>
<div id="info_spalte">
<h3>Hier Das Passende</h3>
<p><a href="/coding/basecontent"><img src="/public/img/info/basecontent.jpg" width="192" height="90" alt="baseContent"></a></p>
<p><a href="/coding/html"><img src="/public/img/info/html.jpg" width="192" height="90" alt="HTML"></a></p>
<p><a href="/design/photo"><img src="/public/img/info/photo.jpg" width="192" height="90" alt="Fotografie"></a></p>
</div>

View File

@ -0,0 +1,74 @@
<?php
/**
* Pages Controller
*
* @package baseContent
* @subpacke pages
*/
class pages_controller extends fl_controller {
/* Eigenschaften */
var $defaultAction = 'start';
var $layout = 'common/default';
#
function start() {
$this->data['title'] = 'Willkommen';
}
function contact($action) {
$this->data['title'] = 'Kontakt';
$val = $this->factory->get_helper('validation');
$val->set_rule('name', 'string');
$val->set_msg('name', 'Bitte geben Sie Ihren Namen an.');
$val->set_rule('firma', '', '*');
$val->set_msg('firma', 'Bitte geben Sie den Namen Ihrer Firma an oder lassen Sie das entsprechende Feld frei.');
$val->set_rule('mail', 'email');
$val->set_msg('mail', 'Bitte geben Sie Ihre E-Mail-Adresse an.');
$val->set_rule('telefon', 'number', '*');
$val->set_msg('telefon', 'Bitte geben Sie Ihre Telefonnummer an oder lassen Sie das entsprechende Feld frei.');
$val->set_rule('thema', 'string');
$val->set_msg('thema', 'Bitte wählen Sie ein Thema aus.');
if ( $action == 'send' ) {
$data = ( isset($_POST['fl']) )? $_POST['fl']: $this->goToTarget('pages/contact/');
$errors = $val->validate_form($data);
if ( count($errors) == 0 ) {
$sent = $this->model->send_contact($data);
$msg = ( $sent === TRUE )?
'Danke! Ihre Anfrage wurde an uns abgeschickt.':
'[Systemfehler] e-mail wurde nicht verschickt. <br>' . $sent;
$type = ( $sent === TRUE )?
'okay':
'error';
$this->flash($msg, $type);
#$this->goToTarget('pages/thankyou');
} else {
$this->data += $data;
$msg = implode('<br>', $errors );
$this->flash($msg, 'error');
}
}
$this->data['system']['validator'] = $val;
}
function thankyou() {
$this->data['title'] = 'Vielen Dank!';
}
function impressum() {
$this->data['title'] = 'Impressum';
}
function sitemap() {
$this->data['title'] = 'Sitemap';
}
}
?>

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<hilfe for="basecontent">
</hilfe>

View File

@ -0,0 +1,35 @@
<!-- Kommentar, um IE zu Quirksmode zu bringen -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>2erlei Medienagentur</title>
<?php $this->get_element('header'); ?>
</head>
<body class="<?php echo $this->cap['action']; ?>"><div id="wrapper">
<div id="kopf">
<h1><a href="http://www.2erlei.de"><img src="/public/img/logo.gif" width="149" height="108" alt="2erlei Medienagentur"></a></h1>
<div id="kundennavi">
<?php $this->get_element('kundennavi'); ?>
</div>
<img class="kopfbild" width="519" height="156" alt="" src="/public/img/kopf_start.jpg">
<div id="navigation">
<?php $this->get_element('navigation'); ?>
</div>
</div>
<div id="content">
<?php $this->get_sub_view(); ?>
</div>
<div id="unten">
<?php $this->get_element('unten'); ?>
<p class="print-info">Dieser Text ist/Diese Inhalte sind unter der Adresse <a style="font-weight: bold" href="http://www.2erlei.de/">http://www.2erlei.de/</a> zu erreichen.</p>
</div>
</div><?php $this->get_element('google_analytics'); ?></body>
</html>

View File

@ -0,0 +1,39 @@
<?php
/**
* pages-model
*
* @package baseContent
* @subpackage pages
*/
class app_pages_model extends fl_model {
/**
* Kontaktformular in mail verpacken und absenden
*
* Die Daten des Kontaktfomulars werden per e-mail verschickt.
*
* @param array $data
* @return mixed
*/
function send_contact($data) {
$this->functions->needs('mail');
$m = new e_mail();
$to = 'info@2erlei.de';
$from = 'kontaktformular@2erlei.de';
$topic = '[2erlei] Kontaktformular';
$template = file_get_contents( ABSPATH . 'app/modules/pages/views/contact.tpl');
$data['time'] = date('d.m.Y \u\m H:i', mktime());
$text = $m->parse_template($template, $data);
$m->set_config($to, $from, $topic);
$m->set_text($text);
$m->compose_message();
$send_contact = $m->send_mail();
if (!$send_contact) $send_contact = $m->get_error();
return $send_contact;
}
}
?>

View File

@ -0,0 +1,17 @@
<?php
/**
* Modul: pages
*
* @package baseContent
* @subpackage pages
* @author Matthias Viehweger <kronn@kronn.de>
* @version 0.1.7
* @license All Rights Reserved
*/
/**
* Allgemeines zum Modul
*/
class pages_modul extends fl_modul {
}
?>

View File

@ -0,0 +1,10 @@
<?php
/**
* pages-view
*
* @package baseContent
* @subpackage pages
*/
class pages_view extends fl_view {
}
?>

View File

@ -0,0 +1,19 @@
<script type="text/javascript" src="/public/js/basescript.js"></script>
<?php echo $this->data['system']['validator']->get_js(); ?>
<?php $html = $this->factory->get_helper('html'); $html->set_data($this->data); ?>
<div id="subnavigation"> &nbsp; </div>
<div id="inhalt">
<h2>Kontaktformular</h2>
<div style="float:none; "><?php echo $this->render_flash(); ?></div>
<form action="/pages/contact/send" method="post"><fieldset>
<p><?php $html->get_input('name', 'Ihr Name*:'); ?></p>
<p><?php $html->get_input('firma', 'Firma:'); ?></p>
<p><?php $html->get_input('mail', 'Ihre E-Mail*:'); ?></p>
<p><?php $html->get_input('telefon', 'Rückrufnummer:'); ?></p>
<p><?php $html->get_dropdown('thema', '=Bitte Thema auswählen,Angebot=Anfrage für ein Angebot,Design=Frage zu Design,Technik=Frage zu Code&Technik,Jobs=Jobangebote,Allgemein=Allgemeine Anfrage'); ?></p>
<p><?php $html->get_textarea('message', 'Ihr Anliegen:'); ?></p>
<p><input type="submit" value="Absenden"></p>
</fieldset></form>
</div>

View File

@ -0,0 +1,9 @@
Name: {NAME}
Firma: {FIRMA}
e-mail: {MAIL}
Telefon: {TELEFON}
Thema: {THEMA}
{MESSAGE}
Das Kontaktformular wurde am {TIME} abgeschickt.

View File

@ -0,0 +1,26 @@
<div id="subnavigation"> &nbsp; </div>
<div id="inhalt">
<h2>Die Unternehmung</h2>
<h3>2erlei - Konzeption und Gestaltung</h3>
<p>Admiralstr. 20<br>D-10999 Berlin<br>T+ 49 (0)176 / 25 33 10 83</p>
<p>*Norman Treiber<br>&nbsp;Mediengestalter digital &amp; print</p>
<p>*Bastian Menningen<br>&nbsp;Administration und Projektleitung</p>
<p><br />2erlei - Konzeption und Gestaltung Berlin 2005-2012</p>
<?php $this->get_element('haftungsausschluss'); ?>
</div>
<!--
<div id="info_spalte">
<p><a href="contact"><img src="/public/img/info/contact.jpg" width="192" height="90" alt="Kontakt"></a></p>
<p><a href="/about"><img src="/public/img/info/unternehmen.jpg" width="192" height="90" alt="Unternehmen"></a></p>
</div>
-->

View File

@ -0,0 +1,50 @@
<div id="subnavigation"> &nbsp; </div>
<div id="inhalt">
<h2>Sitemap</h2>
<h5>Startseite</h5>
<p><a href="/">&gt; Startseite</a></p>
<h5>Form &amp; Farbe</h5>
<p><a href="/design/web">&gt; Webdesign</a></p>
<p><a href="/design/druck">&gt; Drucksachen</a></p>
<p><a href="/design/corporate">&gt; Corporate Identity</a></p>
<h5>Code &amp; Technik</h5>
<p><a href="/coding/basecontent">&gt; baseContent</a></p>
<p><a href="/coding/html">&gt; statisches HTML</a></p>
<p><a href="/coding/mysql">&gt; MySQL-Datenbanken</a></p>
<h5>Referenzen</h5>
<p><a href="/portfolio">&gt; Portfolio - Webdesign</a></p>
<p><a href="/portfolio/logo">&gt; Portfolio - Logos/ Bildmarken</a></p>
<p><a href="/portfolio/druck">&gt; Portfolio - Drucksachen</a></p>
<h5>über 2erlei</h5>
<p><a href="/about">&gt; das Unternehmen</a></p>
<p><a href="/about/partner">&gt; Partner</a></p>
<p><a href="/about/jobs">&gt; Jobs</a></p>
<h5>Kontakt</h5>
<p><a href="/pages/contact">&gt; Kontaktformular</a></p>
<h5>Impressum</h5>
<p><a href="/pages/impressum">&gt; Unternehmen &amp; Partner</a></p>
</div>

View File

@ -0,0 +1,18 @@
<div id="subnavigation">&nbsp;</div>
<div id="inhalt">
<h2>Herzlich Willkommen</h2>
<h3>Die 2erlei - Konzeption und Gestaltung ist ein junges und dynamische Unternehmen.</h3>
<p>Unsere qualitativ hochwertige Tätigkeit hat ihren Schwerpunkt in den Bereichen Design und Webapplikationen.</p>
<p>Die Philosophie von 2erlei gründet auf Zusammenarbeit und Vernetzung.</p>
<p>Wir sind gerade dabei unseren kompletten Internetauftritt umzustruktieren und es auf das neue Design umzustellen.</p>
<p>Gerne können Sie sich unsere <a href="/portfolio">Referenzen</a> anschauen und mit uns <a href="/pages/contact/">Kontakt</a> aufnehmen.
<!--
<p>Wir erstellen Ihren Auftritt übersichtlich, benutzerfreundlich und kreieren Ihnen ein Design, das Aufmerksamkeit und positive Assoziationen weckt.</p>
<p>Mit baseConent, unserem Content Management, können wir ganze Webseiten organisieren, vernetzen und direkte Verbindungen zu anderen Systemen aufbauen.<br>Das erspart Ihnen Kosten und Arbeit.</p>
<p>Unser Motto:<br>Machen Sie nur 1x, was Sie auch nur 1 x machen müssen.</p>
-->
</div>

View File

@ -0,0 +1,22 @@
<h2 class="image"><img src="/public/img/header_contact.gif" width="558" height="36" alt="Kontakt"></h2>
<p class="image"><img src="/public/img/teaser_basecontent.gif" width="549" height="99" alt="Ihr persönliches CMS für Ihr individuelles Unternehmen"></p>
<p id="subnavigation"> &nbsp; </p>
<div id="excerpt_img">
<img src="/public/img/excerpt_contact.gif">
</div>
<div id="inhalt">
<h3>Vielen Dank!</h3>
<div style="float:none; "><?php echo $this->render_flash(); ?></div>
<p>Wir bearbeiten eingehende Anfragen üblicherweise innerhalb von 24 Stunden.</p>
</div>
<div id="info_spalte">
<h3>2erlei MedienProduktion</h3>
<p><a href="/coding/basecontent"><img src="/public/img/info/basecontent.jpg" width="192" height="90" alt="baseContent"></a></p>
<p><a href="/about"><img src="/public/img/info/unternehmen.jpg" width="192" height="90" alt="Unternehmen"></a></p>
<p><a href="/design/web"><img src="/public/img/info/webdesign.jpg" width="192" height="90" alt="Webdesign"></a></p>
</div>

View File

@ -0,0 +1,45 @@
<?php
/**
* portfolio Controller
*
* @package baseContent
* @subpacke about
*/
class portfolio_controller extends fl_controller {
var $defaultAction = 'webdesign';
var $layout = 'common/default';
var $page = 1;
function webdesign() {
$this->data['title'] = 'Webdesign';
$this->data['referenzen'] = $this->model->get_projects('web', $this->page);
$this->data['page_navigator'] = $this->model->get_project_pages(
'web', 'portfolio/webdesign', $this->page
);
}
function logo() {
$this->data['title'] = 'Logos/ Bildmarken';
$this->data['referenzen'] = $this->model->get_projects('logo', $this->page);
$this->data['page_navigator'] = $this->model->get_project_pages(
'logo', 'portfolio/logo', $this->page
);
}
function drucksachen() {
$this->data['title'] = 'Drucksachen';
$this->data['referenzen'] = $this->model->get_projects('print', $this->page);
$this->data['page_navigator'] = $this->model->get_project_pages(
'print', 'portfolio/drucksachen', $this->page
);
}
function common($params) {
list($page) = $this->parse_params($params, 'int');
$this->page = ( $page < 1 )? 1: $page;
$this->data['page'] = $this->page;
return true;
}
}
?>

View File

@ -0,0 +1,17 @@
<?php
/**
* Webdesign-Referezen
*/
class webdesign_data extends fl_data_structures_data {
public function get_link() {
$lightbox = ( $this->has_local_url() )? ' rel="lightbox"': ' target="_blank"';
$link = '<a href="'. $this->get('url') .'"'.$lightbox.'><img src="/public/img/web/teaserbilder/excerpt_'. $this->get('shortname') .'.gif" width="189" height="125" alt="'. $this->get('title') .'"></a>';
return $link;
}
private function has_local_url() {
$url = $this->get('url');
return ( $url[0] == '/' );
}
}

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<hilfe for="about">
</hilfe>

View File

@ -0,0 +1,36 @@
<!-- Kommentar, um IE zu Quirksmode zu bringen -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>2erlei Medienagentur</title>
<?php $this->get_element('header'); ?>
</head>
<body class="portfolio"><div id="wrapper">
<div id="kopf">
<h1><a href="/"><img src="/public/img/logo.gif" width="149" height="108" alt="2erlei Medienagentur"></a></h1>
<div id="kundennavi">
<?php $this->get_element('kundennavi'); ?>
</div>
<img class="kopfbild" width="519" height="156" alt="" src="/public/img/kopf_start.jpg">
<div id="navigation">
<?php $this->get_element('navigation'); ?>
</div>
</div>
<div id="content">
<?php $this->get_sub_view(); ?>
</div>
<div id="unten">
<?php $this->get_element('unten'); ?>
<p class="print-info">Dieser Text ist/Diese Inhalte sind unter der Adresse <a style="font-weight: bold" href="http://www.2erlei.de/">http://www.2erlei.de/</a> zu erreichen.</p>
</div>
</div><?php $this->get_element('google_analytics'); ?>
<?php $this->get_element('lightbox'); ?></body>
</html>

View File

@ -0,0 +1,302 @@
<?php
/**
* portfolio-model
*
* @package baseContent
* @subpackage portfolio
*/
class app_portfolio_model extends fl_model {
private $projects_per_page = 7;
/**
* Projekte seitenweise ausgeben
*
* @param string $type
* @param int $page
* @return LimitIterator
*/
public function get_projects($type, $page) {
$method_name = "get_{$type}_projects";
$projects = new ArrayIterator(
$this->$method_name()
);
$offset = ( $this->projects_per_page * ($page-1) );
$project_count = count($projects);
$offset = ( $project_count < $offset )?
0: $offset;
$paged_projects = new LimitIterator(
$projects, $offset, $this->projects_per_page
);
return $paged_projects;
}
/**
* Seitenlinks zurückgeben
*
* @param string $type
* @param string $link
* @param int $page
* @return string
*/
public function get_project_pages($type, $link, $page) {
$method_name = "get_{$type}_projects";
$projects = $this->$method_name();
$previous = ( $page > 1 )? $page - 1: 1;
$last = ceil( count($projects) / $this->projects_per_page);
$next = ( $page+1 <= $last )? $page + 1: $last;
$pages = range(1, $last);
$separator = ' <span class="separator"> | </span> ';
$html = '';
$html .= '<p class="page_navigator">';
$html .= '<a href="/'.$link.'/'.$previous.'">&laquo;</a> ';
$html .= $separator;
foreach ( range(1, $last) as $p ) {
$pstr = ( $page == $p )? '<b>'.$p.'</b>': $p;
$html .= '<a href="/'.$link.'/'.$p.'">'.$pstr.'</a>';
$html .= $separator;
}
$html .= '<a href="/'.$link.'/'.$next.'">&raquo;</a>';
$html .= '</p>';
return $html;
}
public function get_web_projects() {
$projects = array();
$projects[] = array(
'title'=>'Die Deutsche Bibliothek',
'url'=>'http://www.ddb.de',
'assgiment'=>'Templatedesign',
'client'=>'3-point concepts GmbH',
'shortname'=>'ddb',
'url_text'=>'Webseite besuchen'
);
$projects[] = array(
'title'=>'Dietrich Bonhoeffer',
'url'=>'http://handschriften.staatsbibliothek-berlin.de/bonhoeffer/',
'assgiment'=>'Bildbearbeitung',
'client'=>'3-point concepts GmbH',
'shortname'=>'bonhoeffer',
'url_text'=>'Webseite besuchen'
);
$projects[] = array(
'title'=>'Deutscher Bibliotheksverband',
'url'=>'http://www.bibliotheksportal.de',
'assgiment'=>'Templatedesign/ Icongestaltung',
'client'=>'3-point concepts GmbH',
'shortname'=>'knb',
'url_text'=>'Webseite besuchen'
);
$projects[] = array(
'title'=>'CME-Springer',
'url'=>'http://www.cme-springer.de',
'assgiment'=>'Screendesign',
'client'=>'BSMO GmbH',
'shortname'=>'cme-springer',
'url_text'=>'Webseite besuchen'
);
$projects[] = array(
'title'=>'Jobcenter-Medizin',
'url'=>'http://www.jobcenter-medizin.de',
'assgiment'=>'Screendesign',
'client'=>'BSMO GmbH',
'shortname'=>'jobcenter-medizin',
'url_text'=>'Webseite besuchen'
);
$projects[] = array(
'url'=>'http://www.berlincitypoker.de',
'shortname'=>'poker',
'title'=>'Berlin City Poker',
'client'=>'André K.',
'assignment'=>'Kommunikationskonzept / Screendesign',
'url_text'=>'Webseite besuchen'
);
$projects[] = array(
'url'=>'http://www.viveo150.de',
'shortname'=>'viveo',
'title'=>'Viveo',
'client'=>'Schütz &amp; co Werbeagentur',
'assignment'=>'Navigationskonzept / Screendesign',
'url_text'=>'Webseite besuchen'
);
$projects[] = array(
'url'=>'http://weigend.com',
'shortname'=>'weigend',
'title'=>'Andreas S. Weigend',
'client'=>'3-point concepts',
'assignment'=>'Navigationskonzept / Screendesign',
'url_text'=>'Webseite besuchen'
);
$projects[] = array(
'url'=>'/public/img/web/sideshow/landingpage_03.jpg',
'shortname'=>'jamba',
'title'=>'Landingpage &quot;Rock&quot;',
'client'=>'Jamba GmbH',
'assignment'=>'Kommunikationskonzept / Screendesign',
'url_text'=>' Screenshot'
);
$projects[] = array(
'url'=>'http://nugg.ad',
'shortname'=>'nuggad',
'title'=>'nugg.ad',
'client'=>'3-point concepts',
'assignment'=>'Navigationskonzept / Screendesign',
'url_text'=>'Webseite besuchen'
);
$projects[] = array(
'url'=>'http://www.bpb.de/methodik/ZOAUGM,0,0,WahlOMat_Archiv.html',
'shortname'=>'walomat',
'title'=>'Wal-O-Mat',
'client'=>'3-point concepts',
'assignment'=>'Screendesign',
'url_text'=>'Webseite besuchen'
);
$projects[] = array(
'url'=>'http://www.bildungslueckenfueller.de/',
'shortname'=>'bildung',
'title'=>'Bildungslückenfüller',
'client'=>'3-point concepts',
'assignment'=>'Navigationskonzept / Screendesign',
'url_text'=>'Webseite besuchen'
);
$projects[] = array(
'url'=>'http://www.efors.eu/',
'shortname'=>'efors',
'title'=>'Efors Onlinemagazin',
'client'=>'Work-Out',
'assignment'=>'Navigationskonzept / Screendesign',
'url_text'=>'Webseite besuchen'
);
$web_projects = array();
foreach( $projects as $project ) {
$web_projects[] = $this->factory->get_structure('portfolio/webdesign', $project);
}
return $web_projects;
}
public function get_print_projects() {
$projects = array();
$projects[] = array(
'shortname'=>'dao',
'title'=>'DAO',
'client'=>'DAO - Kampfkunstschule',
'assignment'=>'Drucksachen'
);
$projects[] = array(
'shortname'=>'nanologika',
'title'=>'nanoLogika',
'client'=>'nanoLogika',
'assignment'=>'Drucksachen'
);
$projects[] = array(
'shortname'=>'corpuscare',
'title'=>'corpuscare',
'client'=>'corpuscare',
'assignment'=>'Drucksachen'
);
$projects[] = array(
'shortname'=>'poker',
'title'=>'Berlin City Poker',
'client'=>'Berlin City Poker',
'assignment'=>'Drucksachen'
);
$projects[] = array(
'shortname'=>'nobilis',
'title'=>'Nobilis',
'client'=>'Nobilis',
'assignment'=>'Corporate Identity'
);
/**
$projects[] = array(
'shortname'=>'giata',
'title'=>'GIATA Videoaufsteller',
'client'=>'GIATA mbH',
'assignment'=>'Drucksachen'
);
*/
$projects[] = array(
'shortname'=>'rampenlicht',
'title'=>'Rampenlicht',
'client'=>'Rampenlicht',
'assignment'=>'Visitenkarten'
);
$print_projects = array();
foreach( $projects as $project ) {
$print_projects[] = $this->factory->get_structure('data', $project);
}
return $print_projects;
}
public function get_logo_projects() {
$projects = array();
$projects[] = array(
'shortname'=>'myhotelvideo',
'title'=>'MyHotelVideo',
'client'=>'GIATA mbH'
);
$projects[] = array(
'shortname'=>'nanologika',
'title'=>'nanoLogika',
'client'=>'nanoLogika'
);
$projects[] = array(
'shortname'=>'travelclips',
'title'=>'travelClips',
'client'=>'travelClips'
);
$projects[] = array(
'shortname'=>'corpuscare',
'title'=>'corpusCare',
'client'=>'corpusCare'
);
$projects[] = array(
'shortname'=>'nobilis',
'title'=>'Nobilis',
'client'=>'Nobilis'
);
$logo_projects = array();
foreach( $projects as $project ) {
$logo_projects[] = $this->factory->get_structure('data', $project);
}
return $logo_projects;
}
}

View File

@ -0,0 +1,17 @@
<?php
/**
* Modul: portfolio
*
* @package baseContent
* @subpackage portfolio
* @author Matthias Viehweger <kronn@kronn.de>
* @version 0.1.7
* @license All Rights Reserved
*/
/**
* Allgemeines zum Modul
*/
class portfolio_modul extends fl_modul {
}
?>

View File

@ -0,0 +1,10 @@
<?php
/**
* portfolio-view
*
* @package baseContent
* @subpackage portfolio
*/
class portfolio_view extends fl_view {
}
?>

View File

@ -0,0 +1,20 @@
<?php $this->get_element('subnavigation_portfolio', array('aktiv'=>'drucksachen')); ?>
<div id="inhalt">
<h2>Drucksachen</h2>
<?php $this->say('page_navigator', 'string', null, true); ?>
<?php foreach( $this->get('referenzen') as $projekt ) { ?>
<div class="referenz">
<div class="thumbnail"><a href="/public/img/print/sideshow/print_<?php $projekt->say('shortname'); ?>.png" rel="lightbox"><img class="referenz_bild" src="/public/img/print/teaserbilder/excerpt_<?php $projekt->say('shortname'); ?>.gif" width="189" height="125" alt="<?php $projekt->say('title'); ?>"></a></div>
<div class="description">
<h3><?php $projekt->say('title'); ?></h3>
<p><b>Kunde:</b> <?php $projekt->say('client'); ?></p>
<p><b>Auftrag:</b> <?php $projekt->say('assignment'); ?></p>
</div>
</div>
<?php } // end foreach ?>
<?php $this->say('page_navigator', 'string', null, true); ?>
</div>

View File

@ -0,0 +1,21 @@
<?php $this->get_element('subnavigation_portfolio', array('aktiv'=>'logo')); ?>
<div id="inhalt">
<h2>Logos/ Bildmarken</h2>
<?php $this->say('page_navigator', 'string', null, true); ?>
<?php foreach( $this->get('referenzen') as $projekt ) { ?>
<div class="referenz">
<div class="thumbnail"><a href="/public/img/logo/sideshow/logo_<?php $projekt->say('shortname'); ?>.png" rel="lightbox"><img class="referenz_bild" src="/public/img/logo/teaserbilder/excerpt_<?php $projekt->say('shortname'); ?>.gif" width="189" height="125" alt="<?php $projekt->say('title'); ?>"></a></div>
<div class="description">
<h3><?php $projekt->say('title'); ?></h3>
<p><b>Kunde:</b> <?php $projekt->say('client'); ?></p>
<p><b>Auftrag:</b> Logoentwicklung</p>
</div>
</div>
<?php } // end foreach ?>
<?php $this->say('page_navigator', 'string', null, true); ?>
</div>

View File

@ -0,0 +1,22 @@
<?php $this->get_element('subnavigation_portfolio', array('aktiv'=>'webdesign')); ?>
<div id="inhalt">
<h2>Webseiten-Projekte</h2>
<?php $this->say('page_navigator', 'string', null, true); ?>
<?php foreach( $this->get('referenzen') as $projekt ) { ?>
<div class="referenz">
<div class="thumbnail"><?php $projekt->say('link'); ?></div>
<div class="description">
<h3><?php $projekt->say('title'); ?></h3>
<p><b>Kunde:</b> <?php $projekt->say('client'); ?></p>
<p><b>Auftrag:</b> <?php $projekt->say('assignment'); ?></p>
<p><a href="<?php $projekt->say('url'); ?>" class="symbol"><?php $projekt->say('url_text'); ?></a></p>
</div>
</div>
<?php } // end foreach ?>
<?php $this->say('page_navigator', 'string', null, true); ?>
</div>

View File

@ -0,0 +1,182 @@
<?php
/**
* User Controller
*
* Der User-Controller enth&auml;lt alle Funktionen zur Benutzerverwaltung
*
* @package baseContent
* @subpackage user
*/
class user_controller extends fl_controller {
var $defaultAction = 'admin';
var $from = '';
var $layout = 'admin';
function admin() {
$this->check_login('user/');
$this->data['title'] = 'Benutzer-Administration';
}
function add($param='') {
$this->check_login('user/add/');
$this->data['title'] = "Neuen Benutzer anlegen";
if ( $param == 'save') {
$data = ( isset( $_POST['fl'] ))? $_POST['fl']: $this->goToTarget('user/add/');
$this->functions->needs('validation');
$val = new validation();
$val->set_rule('mail', 'email');
$val->set_msg('mail', 'Bitten geben Sie eine gültige e-mail-Adresse an.');
$errors = $val->validate_form($data);
if( $this->model->doesnt_exist($data['name']) == FALSE ) {
$errors[] = 'Der Username ist bereits vergeben, bitte verwenden Sie einen anderen Namen.';
}
if ( !isset($data['password1']) OR ( empty($data['password1']) AND empty($data['password2']) ) ) {
$data['password1'] = $data['password2'] = $this->model->generate_PW();
}
if ( $data['password1'] != $data['password2'] ) {
$errors[] = 'Es wurden zwei verschiedene Passwörter eingetragen';
}
if ( count($errors) == 0 ) {
$created = $this->model->create_user($data);
$msg = ( $created == TRUE )?
'Benutzer '.$data['name'].' wurde angelegt':
'Fehler beim Anlegen des neuen Benutzers';
$this->flash($msg);
if ( $created == TRUE ) {
$sent = $this->model->notify_user($data['name'], $data['password1']);
$msg = ( $sent == TRUE )?
'Benutzer ' . $data['name'] . ' wurde per mail an ' . $data['mail'] . ' informiert.':
'Fehler beim versenden der mail: ' . $sent;
$this->flash($msg);
}
} else {
$this->data += $data;
$msg = implode( '<br>', $errors );
$this->flash($msg);
}
}
}
function edit($params) {
@list($user, $action) = explode('/', $params);
if ( !isset($user) OR !is_numeric($user) ) $this->goToTarget('user/');
$this->check_login('user/edit/'.$user);
if ( isset($action) AND $action == 'save' ) {
$data = ( isset( $_POST['fl'] ))? $_POST['fl']: $this->goToTarget('user/');
$this->functions->needs('validation');
$val = new validation();
$val->set_rule('email', 'email');
$val->set_msg('email', 'Bitten geben Sie eine gültige e-mail-Adresse an.');
$errors = $val->validate_form($data);
if ( $data['password1'] == '' ) {
unset($data['password1'], $data['password2']);
} else {
if ( $data['password1'] != $data['password2'] ) {
$errors[] = 'Es wurden zwei verschiedene Passwörter eingetragen';
}
}
if ( count($errors) == 0 ) {
$updated = $this->model->update_user($data, $user);
$msg = ( $updated == TRUE )?
'Benutzer '.$user.' wurde aktualisiert':
'Fehler beim Aktialisieren des Benutzers ('.$user.')' ;
$this->flash($msg);
$this->goToTarget('user/');
} else {
$this->data += $data;
$msg = implode( '<br>', $errors );
$this->flash($msg);
}
} else { /* Formular anzeigen */
$result = $this->datamodel->retrieve('user', '*', 'id="'.$user.'"', '' ,'1');
unset($result['password']);
$this->data += $result;
$this->data['title'] = "Benutzer ".$result['name']." bearbeiten";
}
}
function del($user) {
$user_number = (int) $user;
$this->check_login('user/del/'.$user);
$this->data['title'] = "Benutzeraccount löschen";
if ( $user_number > 0 AND $user_number == $user ) {
$user = $user_number;
}
$this->data = $this->model->get_data('user', $user, 'name');
if ( $this->data['name'] != $_SESSION['username'] ) {
$this->flash('Sie k&ouml;nnen nur Ihren eigenen Benutzeraccount l&ouml;schen.');
$this->goToTarget('user/');
} else {
$this->data['title'] = 'Benutzer "'.$this->data['name'].'" l&ouml;schen';
if ( is_string($user) ) {
$this->flash('Warnung: Der Benutzeraccount wird endg&uuml;ltig gel&ouml;scht, wenn sie den unten stehenden L&ouml;schknopf bet&auml;tigen.');
} elseif ( is_numeric($user) OR empty($user) ) {
$result = ( $this->datamodel->del('user', $user) )? 'Benutzeraccount von '.$_SESSION['username'].' gel&ouml;scht.': 'Fehler beim L&ouml;schen des Benutzeraccounts '.$_SESSION['username'];
$this->flash($result);
$this->logaction($result);
$this->goToTarget(ADMINMODULE.'/logout/');
}
}
}
/**
* Neuen Benutzer per e-mail informieren
*
* Ein neu angelegter Benutzer erh&auml;lt eine e-mail mit den Zugangsdaten.
* Wenn die mail nicht abgeschickt werden kann, werden die Zugangsdaten
* auf dem Bildschirm ausgegeben.
*
* @param array $data Array aus Username, Passwort und e-mail-Adresse
* @return array erfolgreicher mailversand und Statusmeldung.
*/
function _notifyUser($data) {
$content = "F&uuml;r Sie wurde ein Benutzerkonto f&uuml;r die Administration der Internetseite \"http://".$_SERVER['HTTP_HOST']."\" eingerichtet.\n\nIhre Zugangsdaten lauten:\nBenutzername:\t".$data['name']."\nPasswort:\t".$data['password']."\n\nBitte &auml;ndern Sie das Passwort bei Ihrer ersten Anmeldung auf \"http://".$_SERVER['HTTP_HOST']."/user/\".";
$result = $this->datamodel->retrieve(ADMINMODULE.'_options', '*', "optionname='SEITENTITEL'", '', '1');
$seitentitel = $result['value'];
$config[mailreceipient] = $data['email'];
$config[mailtopic] = '['.$seitentitel.'] Benutzerkonto angelegt';
$config[mailfrom] = 'usermanagement@'.$_SERVER['HTTP_HOST'];
if ( mail($config['mailreceipient'],$config['mailtopic'],$content, "From: {$config[mailfrom]}") ) {
$notify['mailed'] = TRUE;
$notify['status'] = "Benutzer wurde per e-mail informiert.";
} else {
$notify['mailed'] = FALSE;
$notify['status'] = "</p><h4>Fehler</h4><p>Auf diesem Server ist kein Mailversand m&ouml;glich. Bitte teilen Sie dem neuangelegten Benutzer die folgende Nachricht mit:</p><p>".nl2br($content);
}
return $notify;
}
function common() {
if ( isset($_SESSION['username']) ) {
$this->data += $this->datamodel->retrieve('user', 'id AS my_id, email AS my_email, name AS my_name, level AS my_level', "name = '" . $_SESSION['username'] . "'", '', '1');
}
$this->functions->needs('bereiche');
return TRUE;
}
}
?>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<hilfe for="user">
<common><p>In der Benutzerverwaltung können Sie Ihren eigenen Benutzerdaten bearbeiten, einen neuen Benutzer anlegen und Ihren Benutzerzugang löschen.</p></common>
<add></add>
<del></del>
<edit></edit>
<index></index>
</hilfe>

View File

@ -0,0 +1,61 @@
<?php
/**
* allgemeines Admintemplate
*
* @package baseContent
* @subpackage user
*/
echo'<?xml version="1.0" encoding="iso-8859-1" ?>'."\n"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
<head>
<title><?php echo $this->get_field('title') ?> - <?php $this->get_siteTitle() ?></title>
<?php $this->get_element('admin_head'); ?>
</head>
<body><div id="wrapper">
<div id="kopf">
<h1><img src="/public/img/admin/basecontent.gif" width="468" height="54" alt="baseContent" /></h1>
<p id="logout"><a href="/basecontent/logout/">&raquo; <?php $this->get_username(); ?> Logout</a></p>
<div id="bc_nav">
<?php $this->get_element('bc_nav'); ?>
</div>
<div id="bc_intern">
<ul>
<li><a href="/basecontent/options/">Einstellungen</a></li>
<li><a href="/basecontent/protocol/">Protokoll</a></li>
<li><a href="/basecontent/support/">Support</a></li>
</ul>
</div>
<h2><?php $this->get_siteTitle(); ?></h2>
<?php $this->get_breadcrumbs($this->cap, $this->get_field('title')); ?>
</div>
<div id="navigation">
<h2><a href="/basecontent/">baseContent</a></h2>
<h3><a href="/user/">Benutzer</a></h3>
<?php $this->get_combined_list('user', 'id=%name%', '/user/edit/', 'level > '.$this->get_field('my_level') ); ?>
</div>
<div id="content">
<?php $this->get_sub_view(); ?>
<div id="spalte2">
<h2>baseContent info</h2>
<?php $this->get_element('bc_info', array('cap'=>$this->cap, 'flash'=>$this->render_flash(), 'model'=>$this) ); ?>
</div>
</div>
<div id="unten">
<p> &nbsp; &nbsp; </p>
<p class="print-info">Diese Inhalte sind unter der Adresse <a style="font-weight:bold;" href="<?php echo ($this->current_url() ); ?>"><?php echo ($this->current_url() ); ?></a> zu erreichen.</p>
</div>
</div>
</body>
</html>

113
app/modules/user/model.php Normal file
View File

@ -0,0 +1,113 @@
<?php
/**
* user-model
*
* Enthält die Basisfunktionen von user.
*
* Klasse user_model
*
* @package baseContent
* @subpackage user
*/
class app_user_model extends fl_model {
/**
* Prüfung, ob bereits ein Benutzer mit diesem Namen existiert
*
* @param string $name
* @return bool
*/
function doesnt_exist($name) {
$result = $this->datamodel->retrieve('user', 'COUNT(*) AS anzahl', "name = '".$name."'");
$doesnt_exist = ( $result['anzahl'] == 0 )? TRUE: FALSE;
return $doesnt_exist;
}
/**
* Ein zuf&auml;lliges Passwort generieren
*
* Ausgehend von der Systemzeit wird ein 6 Zeichen langer String erzeugt,
* der als vor&uuml;bergehendes Passwort verwendet werden kann.
*
* @return string zuf&auml;lliges Passwort
*/
function generate_PW() {
$pass = substr(md5(uniqid(microtime())), 0, 6);
return $pass;
}
/**
* Neues Benutzerprofil anlegen
*
* @param array $data
* @return bool
*/
function create_user($data) {
$db_data = array(
'name'=>$data['name'],
'email'=>$data['mail'],
'password'=>md5($data['password1'])
);
$create_user = ( $this->datamodel->create('user', $db_data) )? TRUE: FALSE;
return $create_user;
}
/**
* Benutzerdaten speichern
*
* Die Benutzerdaten werden gespeichert. Wenn ein Password angegeben wurde,
* wird es MD5-Codiert.
*
* @param array $data
* @param int $user
* @return bool
*/
function update_user($data, $user) {
$db_data = $data;
if ( isset($data['password1']) ) $db_data['password'] = md5($data['password1']);
unset($db_data['password1'], $db_data['password2']);
$update_user = ( $this->datamodel->update('user', $db_data, $user) )? TRUE: FALSE;
return $update_user;
}
/**
* Benutzerdaten per mail verschicken
*
* @param string $name Benutzername
* @param string $password
* @return mixed
*/
function notify_user($name, $password='') {
$result = $this->datamodel->retrieve('user', 'email', "name = '".$name."'", '', '1');
$mailadresse = $result['email'];
unset($result);
$result = $this->datamodel->retrieve('basecontent_options', 'value', 'optionname="SEITENTITEL"', '', '1');
$seitentitel = $result['value'];
$data['name'] = $name;
$data['password'] = ( $password == '' )? 'Das Passwort wurde nicht verändert.': $password;
$this->functions->needs('mail');
$m = new e_mail();
$to = $mailadresse;
$from = 'basecontent@'.$_SERVER['HTTP_HOST'];
$topic = '['.$seitentitel.'] Benutzeraccount freigeschaltet';
$template = file_get_contents( $this->modulepath . 'user/views/notify.tpl');
$text = $m->parse_template($template, $data);
$m->set_config($to, $from, $topic);
$m->set_text($text);
$m->compose_message();
$notify_user = $m->send_mail();
if (!$notify_user) $notify_user = $m->get_error();
return $notify_user;
}
}
?>

View File

@ -0,0 +1,34 @@
<?php
/**
* Modul: User
*
* @package baseContent
* @subpackage user
* @author Matthias Viehweger <kronn@kronn.de>
* @version 0.1.6
* @license All Rights Reserved
*/
/**
* Modul zentral registrieren
*/
$installed_modules[] = 'user';
/**
* Allgemeines zum Modul
*/
class user_modul extends fl_modul {
function get_options() {
echo '';
}
function get_name() {
return FALSE;
}
function get_starttext() {
echo '';
}
}
?>

Some files were not shown because too many files have changed in this diff Show More