commit 53e75bb473ab232afd3cca39f5d4c9015c031e94 Author: Kai Blaschke Date: Wed Dec 13 17:41:48 2017 +0100 Initialer Commit diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..d3fecdd --- /dev/null +++ b/.htaccess @@ -0,0 +1,7 @@ +RewriteEngine On + +RewriteRule ^loesung/abschnitt-(.+?).html index.php?show=loesung&katalog=$1 [QSA] +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteCond %{REQUEST_FILENAME} !-l +RewriteRule ^(.+?).html index.php?show=$1 [QSA] diff --git a/antworten.inc.php b/antworten.inc.php new file mode 100644 index 0000000..ab2f83e --- /dev/null +++ b/antworten.inc.php @@ -0,0 +1,127 @@ + + * + * The included 'THW Thema' templates, logos and the Q&A catalog are protected + * by copyright laws, and must not be used without the written permission + * of the + * + * Bundesanstalt Technisches Hilfswerk + * Provinzialstrae 93 + * D-53127 Bonn + * Germany + * E-Mail: redaktion@thw.de + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* + + Auflsungen zu allen Fragen + +*/ + + +$tpl->addVars('navAntworten', 'current'); + +$katalog = -1; +if (isset($_REQUEST['katalog'])) { + $katalog = intval($_REQUEST['katalog']); +} + +$abschnitte = getTopics(); +foreach ($abschnitte as $nr => $description) { + $tpl->addVars(Array( + 'abschnittNr' => $nr, + 'abschnittName' => htmlspecialchars($description), + 'navAntwortenAbschnitt' => ($katalog == $nr) ? 'current':'' + )); + + $tpl->parseBlock('page-body', 'NavAntworten', 'Sublinks', TRUE); +} + +if (isset($_SESSION['zufallsfragen']) || isset($_SESSION['bogen'])) { + if (isset($_GET['clear']) && intval($_GET['clear']) == '1') { + unset($_SESSION['bogen']); + unset($_SESSION['zufallsfragen']); + unset($_SESSION['frage_nr']); + unset($_SESSION['fragen_cnt']); + unset($_SESSION['zufallstats']); + unset($_SESSION['bogen']); + } + else { + $tpl->addTemplates(Array('content' => 'aufloesung-error')); + return; + } +} + +if ($katalog > 0) { + + $stmt = $GLOBALS['db']->prepare('SELECT `Nr`,`Beschreibung` FROM `abschnitte` WHERE `Nr` = ? AND `Jahr` = ?'); + $stmt->bind_param('ii', $katalog, $_SESSION['jahr']); + $stmt->execute(); + $stmt->bind_result($nr, $description); + + addBreadcrumb($_REQUEST['show'].'&katalog=' . $nr, $description); + + $tpl->addTemplates(Array( + 'content' => 'aufloesung-antworten' + )); + + $tpl->addVars(Array( + 'abschnittNr' => $nr, + 'abschnittName' => htmlspecialchars($description) + )); + $stmt->close(); + + $stmt = $GLOBALS['db']->prepare('SELECT * FROM `fragen` WHERE `Abschnitt` = ? AND `Jahr` = ? ORDER BY Abschnitt,Nr ASC'); + $stmt->bind_param('ii', $katalog, $_SESSION['jahr']); + $stmt->execute(); + $questions = $stmt->get_result(); + + $I = 1; + + while ($question = $questions->fetch_array(MYSQLI_ASSOC)) { + ShowAnswer($question); + $tpl->parseBlock('content', 'Antworten', 'Row', TRUE, TRUE); + if ($I%10==0) { + $tpl->parseBlock('content', 'Antworten', 'Topline', TRUE); + } + $I++; + } + $questions->close(); + $stmt->close(); +} +else { + + $tpl->addTemplates('content', 'aufloesung-abschnitte'); + + $stmt = $GLOBALS['db']->prepare('SELECT `Nr`,`Beschreibung` FROM `abschnitte` WHERE `Jahr` = ? ORDER BY Nr ASC'); + $stmt->bind_param('i', $_SESSION['jahr']); + $stmt->execute(); + $stmt->bind_result($nr, $description); + + while ($stmt->fetch()) { + $tpl->addVars(Array( + 'abschnittNr' => $nr, + 'abschnittName' => $description + )); + + $tpl->parseBlock('content', 'Abschnitte', 'Row', TRUE); + } + +} +?> diff --git a/barrierefreiheit.inc.php b/barrierefreiheit.inc.php new file mode 100644 index 0000000..d58d267 --- /dev/null +++ b/barrierefreiheit.inc.php @@ -0,0 +1,15 @@ +addVars('extraStyleSheet', ''); +} + +if (isset($_POST['barrierefrei'])) { + setcookie("stylesheet", "barrierefrei", time()+60*60*24*365); +} + +$tpl->addTemplates(Array("content" => "barrierefreiheit")); + +?> \ No newline at end of file diff --git a/class.template.inc.php b/class.template.inc.php new file mode 100644 index 0000000..a549228 --- /dev/null +++ b/class.template.inc.php @@ -0,0 +1,551 @@ + + * + * The included "THW Thema" templates, logos and the Q&A catalog are protected + * by copyright laws, and must not be used without the written permission + * of the + * + * Bundesanstalt Technisches Hilfswerk + * Provinzialstrae 93 + * D-53127 Bonn + * Germany + * E-Mail: redaktion@thw.de + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/************************************************************ +* Template class +* +* This class is capable of replacing variables with text, +* including other templates, and it can parse dynamic blocks +* which can be nested inside other blocks. +* +* Predefined variables: +* +* {templatePath} Contains the template path +* {templateLang} Contains the country code, if set +* +* If you don't need them, remove them immediately after +* creating the class instance or setting a new template path. +* +* $id: class Template v1.0 / Kai Blaschke $ +* +**************************************************************/ + + +class Template { + +// ************************************************************ +// Member variables + + var $TPLFILES = array(); // Contains all template filenames + var $TPLDATA = array(); // Contains all template data + var $LOADED = array(); // Already loaded templates are + // stored as $LOADED[HANDLE]=>TRUE + var $PARSEVARS = array(); // Array of variable/value pairs + // to be replaced in templates + var $HANDLES = array(); // Handles which contain parsed templates + + var $BLOCKS = array(); // Array with dynamic block data + var $H_BLOCKS = array(); // Parsed block data + + // Filename: $TPLDIR/filename[.$LANG].tpl + var $TPLDIR; // Path to template files + var $LANG; // Country code (en, de, fr, ...) + var $TPLEXT; // Filename extension (default is .tpl) + + +// ************************************************************ +// Global settings + + var $RPLBRACES = TRUE; // Safely replaces curly braces with HTML + // entities in variable values if + // set to TRUE. + var $WIN32 = FALSE; // Set to "TRUE" on Win32 systems, if + // you encounter problems with paths. + var $DIEONERR = TRUE; // If set to TRUE, die() is called in error + + + + +// ************************************************************ +// Constructor + + function Template($tpldir, $lang = "", $tplext = "tpl") + { + $this->setPath($tpldir); + $this->LANG = strtolower($lang); + $this->TPLEXT = $tplext; + + $this->addVars("templateLang", $this->LANG); + } + +// ************************************************************ +// Sets or changes the template search path + + function setPath($path) + { + if ($this->WIN32) { + if (ord(substr($path, -1)) != 92) $path .= chr(92); + } else { + if (ord(substr($path, -1)) != 47) $path .= chr(47); + } + + if (is_dir($path)) { + $this->TPLDIR = $path; + + // Add a path variable for use in templates + $this->addVars("templatePath", $path); + + return TRUE; + } else { + echo "[TEMPLATE ENGINE] The specified template path " + ."'".$path."' is invalid!
"; + + $this->TPLDIR = ""; + + if ($this->DIEONERR == TRUE) die(); + return FALSE; + } + } + +// ************************************************************ +// Get dynamic blocks recursively to enable nested blocks + + function getDynamicBlocks($tplFilename, $contents) + { + preg_match_all("/(\{\|([a-zA-Z0-9]+)\})(.*?)\\1/s", + $contents, $blocks); + + if (empty($blocks[0])) return; + + // Go through all blocks and save them in $this->BLOCKS + for ($I=0; $IgetDynamicBlocks($tplFilename, $blockparts[3][$J]); + + // Replace block data with placeholders + $blockparts[3][$J] = + preg_replace("/(\{\|([a-zA-Z0-9]+)\})(.*?)\\1/s", + "\\1", $blockparts[3][$J]); + + // Save block data + $this->BLOCKS[$tplFilename][$blocks[2][$I]][$blockparts[2][$J]] + = $blockparts[3][$J]; + + } + } + } + +// ************************************************************ +// Loads a template, runs some checks and extracts dynamic blocks + + function loadTemplate($tplFilename) + { + // Template already loaded? + if (isset($this->LOADED[$tplFilename])) return TRUE; + + // Has the path been set? + if (empty($this->TPLDIR)) { + echo "[TEMPLATE ENGINE] Template path not set or invalid!
"; + + if ($this->DIEONERR == TRUE) die(); + return FALSE; + } + + // Is a user-defined county code set? + if (!empty($this->LANG)) { + // Yes. Try to find template with the specified CC + if (file_exists($this->TPLDIR.$this->TPLFILES[$tplFilename]."." + .$this->LANG.".".$this->TPLEXT)) { + $filename = $this->TPLDIR.$this->TPLFILES[$tplFilename].".". + $this->LANG.".".$this->TPLEXT; + } else { + // Otherwise, use template filename without CC + if (file_exists($this->TPLDIR.$this->TPLFILES[$tplFilename]."." + .$this->TPLEXT)) { + $filename = $this->TPLDIR.$this->TPLFILES[$tplFilename]."." + .$this->TPLEXT; + } else { + echo "[TEMPLATE ENGINE] Can't find template " + ."'".$tplFilename."'!
"; + + if ($this->DIEONERR == TRUE) die(); + return FALSE; + } + } + } else { + // No. Use template filename without CC + if (file_exists($this->TPLDIR.$this->TPLFILES[$tplFilename]."." + .$this->TPLEXT)) { + $filename = $this->TPLDIR.$this->TPLFILES[$tplFilename]."." + .$this->TPLEXT; + } else { + echo "[TEMPLATE ENGINE] Can't find template " + ."'".$tplFilename."'!
"; + + if ($this->DIEONERR == TRUE) die(); + return FALSE; + } + } + + // Load template file + $contents = implode("", (@file($filename))); + + if (!$contents || empty($contents)) { + echo "[TEMPLATE ENGINE] Can't load template '" + .$tplFilename."'!
"; + + if ($this->DIEONERR == TRUE) die(); + return FALSE; + } + + // Parse dynamic blocks recursively + $this->getDynamicBlocks($tplFilename, $contents); + + // Replace all block data with placeholders + $contents = preg_replace("/(\{\|([a-zA-Z0-9]+)\})(.*?)\\1/s", "\\1", + $contents); + + $this->TPLDATA[$tplFilename] = $contents; + $this->LOADED[$tplFilename] = 1; + + return TRUE; + + } + +// ************************************************************ +// Parses a template and loads it if neccessary. +// The result is assigned or concatenated to the specified handle. + + function parse($handle = "", + $file = "", + $append = FALSE, + $delunused = FALSE) + { + // Check if all prerequisites are met + if (empty($handle) || empty($file)) + return FALSE; + + if (!isset($this->TPLFILES[$file])) + return FALSE; + + if (!isset($this->LOADED[$file])&&!$this->loadTemplate($file)) + return FALSE; + + $templateCopy = $this->TPLDATA[$file]; + + // Reset array pointers + reset($this->HANDLES); + reset($this->PARSEVARS); + + // Replace blocks + if (isset($this->H_BLOCKS[$file])) { + reset($this->H_BLOCKS[$file]); + + while (list($varname, $value) = each($this->H_BLOCKS[$file])) + $templateCopy = preg_replace("/\{\|".$varname."\}/i", + $value, $templateCopy); + } + + // Replace variables + while (list($varname, $value) = each($this->PARSEVARS)) + $templateCopy = preg_replace("/\{".$varname."\}/i", + $value, $templateCopy); + + // Replace {~name} placeholders with already parsed handle of + // the same name + while (list($varname, $value) = each($this->HANDLES)) + $templateCopy = preg_replace("/\{\~".$varname."\}/i", + $value, $templateCopy); + + // Delete unused variables and placeholders + if ($delunused) + $templateCopy = preg_replace("/\{[~|\|]?(\w*?)\}/", "", + $templateCopy); + + // Assign to handle + if ($append && isset($this->HANDLES[$handle])) { + $this->HANDLES[$handle] .= $templateCopy; + } else { + $this->HANDLES[$handle] = $templateCopy; + } + + return TRUE; + } + +// ************************************************************ +// Parses multiple templates. +// $list is an associative array of the type "handle"=>"template". +// Note that concatenation is not possible. Use the parse() method instead. + + function multiParse($list) + { + if (!is_array($list)) return FALSE; + + while (list($handle, $file) = each($list)) + if (!$this->parse($handle, $file)) return FALSE; + + return TRUE; + } + +// ************************************************************ +// Parses a template and prints the result. + + function printParse($handle = "", $file = "", $append = FALSE) + { + if ($this->parse($handle, $file, $append)) { + $this->printHandle($handle); + return TRUE; + } + + return FALSE; + } + +// ************************************************************ +// Parses a block and replaces or appends the result to the block handle. +// +// Note: First argument is the template file name containing the blocks, +// not a handle name! +// +// Note: This function has no effect on any template handle. +// Parsed block data is inserted into the template handle in the +// parse() method. + + function parseBlock($file = "", + $block = "", + $blockpart = "", + $append = FALSE, + $delunused = FALSE) + { + if (empty($file) || empty($block) || empty($blockpart)) + return FALSE; + + if (!isset($this->TPLFILES[$file])) + return FALSE; + + if (!isset($this->LOADED[$file])&&!$this->loadTemplate($file)) + return FALSE; + + $blockCopy = $this->BLOCKS[$file][$block][$blockpart]; + + // Reset array pointers + reset($this->H_BLOCKS); + reset($this->PARSEVARS); + + // Replace blocks + if (isset($this->H_BLOCKS[$file])) { + reset($this->H_BLOCKS[$file]); + + while (list($varname, $value) = each($this->H_BLOCKS[$file])) + $blockCopy = preg_replace("/\{\|".$varname."\}/i", + $value, $blockCopy); + } + + // Replace variables + while (list($varname, $value) = each($this->PARSEVARS)) + $blockCopy = preg_replace("/\{".$varname."\}/i", + $value, $blockCopy); + + // Replace {~name} placeholders with already parsed handle of + // the same name + while (list($varname, $value) = each($this->HANDLES)) + $blockCopy = preg_replace("/\{\~".$varname."\}/i", + $value, $blockCopy); + + // Delete unused variables and placeholders + if ($delunused) + $blockCopy = preg_replace("/\{[~|]?(\w*?)\}/", "", $blockCopy); + + // Assign to handle + if ($append && isset($this->H_BLOCKS[$file][$block])) { + $this->H_BLOCKS[$file][$block] .= $blockCopy; + } else { + $this->H_BLOCKS[$file][$block] = $blockCopy; + } + + return TRUE; + } + +// ************************************************************ +// Deletes all block handles + + function clearBlockHandles() + { + if (!empty($this->H_BLOCKS)) { + reset($this->H_BLOCKS); + while (list($ref, $val) = each($this->H_BLOCKS)) + unset($this->H_BLOCKS[$ref]); + } + } + +// ************************************************************ +// Deletes the specified block handle + + function delBlockHandle($file, $block) + { + if (!empty($file) && !empty($block)) + if (isset($this->H_BLOCKS[$file][$block])) + unset($this->H_BLOCKS[$file][$block]); + } + +// ************************************************************ +// Adds one or more templates +// You can pass one associative array with $handle=>$filename pairs, +// or two strings ($handle, $filename) to this function. + + function addTemplates($tplList, $tplFilename = "") + { + if (is_array($tplList)) { + reset($tplList); + while (list($handle, $filename) = each($tplList)) { + // Add handle to list + $this->TPLFILES[$handle] = $filename; + // Delete loaded flag if set + unset($this->LOADED[$handle]); + } + } else { + $this->TPLFILES[$tplList] = $tplFilename; + unset($this->LOADED[$tplList]); + } + } + +// ************************************************************ +// Deletes all template handles + + function clearHandles() + { + if (!empty($this->HANDLES)) { + reset($this->HANDLES); + while (list($ref, $val) = each($this->HANDLES)) + unset($this->HANDLES[$ref]); + } + } + +// ************************************************************ +// Deletes the specified template handle + + function delHandle($handleName = "") + { + if (!empty($handleName)) + if (isset($this->HANDLES[$handleName])) + unset($this->HANDLES[$handleName]); + } + +// ************************************************************ +// Returns the contents of the specified template handle + + function getHandle($handleName = "") + { + if (empty($handleName)) + return FALSE; + + if (isset($this->HANDLES[$handleName])) + return $this->HANDLES[$handleName]; + + return FALSE; + } + +// ************************************************************ +// Prints a parsed template handle + + function printHandle($handleName = "") + { + if (empty($handleName)) return FALSE; + + // Remove all remaining placeholders + $this->HANDLES[$handleName] = preg_replace("/\{[~|\|]?(\w*?)\}/", + "", $this->HANDLES[$handleName]); + + if (isset($this->HANDLES[$handleName])) { + echo $this->HANDLES[$handleName]; + return TRUE; + } + + return FALSE; + } + +// ************************************************************ +// Deletes all variables set with the addVars() method + + function clearVars() + { + if (!empty($this->PARSEVARS)) { + reset($this->PARSEVARS); + while (list($ref, $val) = each ($this->PARSEVARS)) + unset($this->PARSEVARS[$ref]); + } + } + +// ************************************************************ +// Adds one or more variables. +// You can pass one associative array with $varname=>$value pairs +// or two strings ($varname, $value) to this function. + + function addVars($varList, $varValue = "") + { + if (is_array($varList)) { + reset($varList); + while (list($varname, $value) = each($varList)) { + // Replace curly braces + if ($this->RPLBRACES == TRUE) { + $value = preg_replace(Array("/(\{)/", "/(\})/"), + Array("{", "}"), + $value); + } + + // Add/replace variable + if (!preg_match("/[^0-9a-z\-\_]/i", $varname)) + $this->PARSEVARS[$varname] = $value; + } + } else { + // Replace curly braces + if ($this->RPLBRACES == TRUE) { + $varValue = preg_replace(Array("/(\{)/", "/(\})/"), + Array("{", "}"), + $varValue); + } + + // Add/replace variable + if (!preg_match("/[^0-9a-z\-\_]/i", $varList)) + $this->PARSEVARS[$varList] = $varValue; + } + } + +// ************************************************************ +// Returns a value set by the addVars() method + + function getVar($varName = "") + { + if (empty($varName)) return FALSE; + if (isset($this->PARSEVARS[$varName])) + return $this->PARSEVARS[$varName]; + return FALSE; + } + +// ************************************************************ + +} // End of class 'Template' + +?> \ No newline at end of file diff --git a/db.php b/db.php new file mode 100644 index 0000000..9d3eece --- /dev/null +++ b/db.php @@ -0,0 +1,61 @@ + + * + * The included "THW Thema" templates, logos and the Q&A catalog are protected + * by copyright laws, and must not be used without the written permission + * of the + * + * Bundesanstalt Technisches Hilfswerk + * Provinzialstraße 93 + * D-53127 Bonn + * Germany + * E-Mail: redaktion@thw.de + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +$GLOBALS['db'] = new mysqli("localhost", "DBUSER", "DBPASSWD", "DBDATABASE"); + +if ($GLOBALS['db']->connect_error) { + header("HTTP/1.0 500 Internal Server Error"); + readfile('templates/db-error.html'); + die(); +} + +function callBindParamArray($stmt, $bindArguments = null) { + if ($bindArguments === null) { + return; + } + + $args = array(); + foreach($bindArguments as $k => &$arg){ + $args[$k] = &$arg; + } + + call_user_func_array(array($stmt, "bind_param"), $args); +} + +function getSingleResult($query, $bindArguments = null) { + $stmt = $GLOBALS['db']->prepare($query); + callBindParamArray($stmt, $bindArguments); + $stmt->execute(); + $stmt->bind_result($retVal); + $stmt->fetch(); + $stmt->close(); + + return $retVal; +} \ No newline at end of file diff --git a/downloads/.directory b/downloads/.directory new file mode 100644 index 0000000..e69de29 diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..135b5e9 Binary files /dev/null and b/favicon.ico differ diff --git a/functions.inc.php b/functions.inc.php new file mode 100644 index 0000000..aa76f05 --- /dev/null +++ b/functions.inc.php @@ -0,0 +1,284 @@ + + * + * The included 'THW Thema' templates, logos and the Q&A catalog are protected + * by copyright laws, and must not be used without the written permission + * of the + * + * Bundesanstalt Technisches Hilfswerk + * Provinzialstrae 93 + * D-53127 Bonn + * Germany + * E-Mail: redaktion@thw.de + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * Holt eine Einzelne Frage aus der DB + * + * @param $id Die Frage-ID + * + * @return array Die Frage + */ +function getQuestionById($id) { + $stmt = $GLOBALS['db']->prepare('SELECT * FROM fragen WHERE ID=?'); + $stmt->bind_param('i', $id); + $stmt->execute(); + $result = $stmt->get_result(); + + $question = $result->fetch_array(MYSQLI_ASSOC); + + return $question; +} + +/** + * Holt eine Liste aller Abschnitte im aktuellen Jahr + * + * @return array + */ +function getTopics() { + $stmt = $GLOBALS['db']->prepare('SELECT `Nr`,`Beschreibung` FROM `abschnitte` WHERE `Jahr` = ? ORDER BY `Nr` ASC'); + $stmt->bind_param('i', $_SESSION['jahr']); + $stmt->execute(); + $stmt->bind_result($nr, $description); + + $topics = array(); + while ($stmt->fetch()) { + $topics[$nr] = $description; + } + $stmt->close(); + + return $topics; +} + +/****************************************************************************** + * + * Kopfzeile mit Informationen ber Fragennummer und Lernabschnitt + * +/******************************************************************************/ + +function questionHeader($id, $nr, $questionCount) +{ + $section = getSingleResult('SELECT Abschnitt FROM fragen WHERE ID=? AND Jahr=?', + array('ii', $id, $_SESSION['jahr'])); + + $sectionName = getSingleResult('SELECT Beschreibung FROM abschnitte WHERE Nr=? AND Jahr=?', + array('ii', $section, $_SESSION['jahr'])); + + $GLOBALS['tpl']->addVars(Array( + 'aktuelleFrage' => $nr, + 'fragenCnt' => $questionCount, + 'abschnittNr' => $section, + 'abschnitt' => $sectionName + )); + + $GLOBALS['tpl']->parseBlock('content', 'Kopf', 'Content'); +} + +/****************************************************************************** + * + * Eine einzelne Frage mit Kopfzeile ausgeben + * +/******************************************************************************/ + +function SingleQuestion($id, $Nr, $questionCount) +{ + questionHeader($id, $Nr, $questionCount); + showQuestion($id); +} + +/****************************************************************************** + * + * Fragengenerator + * Erzeugt eine Tabelle mit Frage, Antworten und Formularinformationen + * zur bergebenen Fragen-ID + * +/******************************************************************************/ + +function showQuestion($id) +{ + // Frage aus DB holen + $stmt = $GLOBALS['db']->prepare('SELECT * FROM fragen WHERE ID=?'); + $stmt->bind_param('i', $id); + $stmt->execute(); + $result = $stmt->get_result(); + + $question = $result->fetch_array(MYSQLI_ASSOC); + + $GLOBALS['tpl']->addVars(Array( + 'frageID' => $id, + 'frageNr' => $question['Nr'], + 'abschnittNr' => $question['Abschnitt'], + 'frageText' => $question['Frage'], + 'Antwort1' => $question['Antwort1'], + 'Antwort2' => $question['Antwort2'], + 'Antwort3' => $question['Antwort3'] + )); + + if ($question['Antwort3'] == '') { + $GLOBALS['tpl']->addVars('rowCnt', '2'); + $GLOBALS['tpl']->delBlockHandle('content', 'ThreeRows'); + } + else { + $GLOBALS['tpl']->addVars('rowCnt', '3'); + $GLOBALS['tpl']->parseBlock('content', 'ThreeRows', 'Row', TRUE); + } + + $result->close(); + $stmt->close(); +} + +/****************************************************************************** + * + * Auswertung + * Erzeugt eine Tabelle mit Frage, Antworten und Markiert richtige/falsche + * Antworten farblich (grn=richtig, rot=falsch) + * +/******************************************************************************/ + +function Answer($id, $answer, $showStatus = TRUE) +{ + // Frage aus DB holen + $question = getQuestionById($id); + + // Einzelne Antworten aus Flag in Array splitten + $solution = array( 1 => ( $question['Loesung'] & 0x1), + 2 => (($question['Loesung'] & 0x2) >> 1), + 3 => (($question['Loesung'] & 0x4) >> 2)); + + $correct = (($solution[1] == (isset($answer[$id][1]) ? $answer[$id][1] : 0)) + && ($solution[2] == (isset($answer[$id][2]) ? $answer[$id][2] : 0)) + && ($solution[3] == (isset($answer[$id][3]) ? $answer[$id][3] : 0))); + + // Aufrumen + $GLOBALS['tpl']->delHandle('antwortStatus'); + $GLOBALS['tpl']->delHandle('antwort1Loesung'); + $GLOBALS['tpl']->delHandle('antwort2Loesung'); + $GLOBALS['tpl']->delHandle('antwort3Loesung'); + + $GLOBALS['tpl']->delBlockHandle('content', 'A1L'); + $GLOBALS['tpl']->delBlockHandle('content', 'A2L'); + $GLOBALS['tpl']->delBlockHandle('content', 'A3L'); + + if ($showStatus) { + if ($correct) + $GLOBALS['tpl']->parseBlock('content', 'Status', 'Richtig'); + else + $GLOBALS['tpl']->parseBlock('content', 'Status', 'Falsch'); + } else { + if ($correct) + $GLOBALS['tpl']->parseBlock('content', 'BogenStatus', 'Richtig'); + else + $GLOBALS['tpl']->parseBlock('content', 'BogenStatus', 'Falsch'); + } + + $GLOBALS['tpl']->addVars(Array( + 'abschnittNr' => $question['Abschnitt'], + 'frageNr' => $question['Nr'], + 'frageText' => $question['Frage'], + 'antwort1Status' => $solution[1] ? 'korrekt' : 'falsch', + 'antwort2Status' => $solution[2] ? 'korrekt' : 'falsch', + 'antwort3Status' => $solution[3] ? 'korrekt' : 'falsch', + 'Antwort1' => $question['Antwort1'], + 'Antwort2' => $question['Antwort2'], + 'Antwort3' => $question['Antwort3'] + )); + + if ($question['Antwort3'] == '') { + $GLOBALS['tpl']->addVars('rowCnt', '2'); + $GLOBALS['tpl']->delBlockHandle('content', 'ThreeRows'); + } + else { + $GLOBALS['tpl']->addVars('rowCnt', '3'); + $GLOBALS['tpl']->parseBlock('content', 'ThreeRows', 'Row'); + } + + if (isset($answer[$id][1]) && $answer[$id][1] === '1') $GLOBALS['tpl']->parseBlock('content', 'A1L', 'Haken'); + if (isset($answer[$id][2]) && $answer[$id][2] === '1') $GLOBALS['tpl']->parseBlock('content', 'A2L', 'Haken'); + if (isset($answer[$id][3]) && $answer[$id][3] === '1') $GLOBALS['tpl']->parseBlock('content', 'A3L', 'Haken'); + + // Anhngen per default + $GLOBALS['tpl']->parse('content', 'antwort', TRUE, TRUE); + + return $correct; + +} + +/****************************************************************************** + * + * Antwort + * Zeigt die Frage und die zugehrigen korrekten Antworten an + * Antworten sind farblich gekennzeichnet (grn=richtig, rot=falsch) + * +/******************************************************************************/ + +function addBreadcrumb($params, $title) +{ + $GLOBALS['tpl']->addVars(Array( + 'page' => htmlspecialchars($params), + 'pageTitle' => htmlspecialchars($title) + )); + $GLOBALS['tpl']->parseBlock('page-body', 'Breadcrumb', 'Link', TRUE); +} + +function ShowAnswer(&$frage) +{ + + + // Einzelne Antworten aus Flag in Array splitten + $loesung = array( 1 => ( $frage['Loesung'] & 0x1), + 2 => (($frage['Loesung'] & 0x2) >> 1), + 3 => (($frage['Loesung'] & 0x4) >> 2)); + + // Aufrumen + $GLOBALS['tpl']->delHandle('antwortStatus'); + $GLOBALS['tpl']->delHandle('antwort1Loesung'); + $GLOBALS['tpl']->delHandle('antwort2Loesung'); + $GLOBALS['tpl']->delHandle('antwort3Loesung'); + + $GLOBALS['tpl']->addVars(Array( + 'abschnittNr' => $frage['Abschnitt'], + 'frageNr' => $frage['Nr'], + 'frageText' => $frage['Frage'], + 'antwort1Status' => $loesung[1]?'korrekt':'falsch', + 'antwort2Status' => $loesung[2]?'korrekt':'falsch', + 'antwort3Status' => $loesung[3]?'korrekt':'falsch', + 'Antwort1' => $frage['Antwort1'], + 'Antwort2' => $frage['Antwort2'], + 'Antwort3' => $frage['Antwort3'] + )); + + $GLOBALS['tpl']->delBlockHandle('content', 'A1L'); + $GLOBALS['tpl']->delBlockHandle('content', 'A2L'); + $GLOBALS['tpl']->delBlockHandle('content', 'A3L'); + + if ($loesung[1]) $GLOBALS['tpl']->parseBlock('content', 'A1L', 'Haken'); + if ($loesung[2]) $GLOBALS['tpl']->parseBlock('content', 'A2L', 'Haken'); + if ($loesung[3]) $GLOBALS['tpl']->parseBlock('content', 'A3L', 'Haken'); + + if ($frage['Antwort3'] == '') { + $GLOBALS['tpl']->addVars('rowCnt', '2'); + $GLOBALS['tpl']->delBlockHandle('content', 'ThreeRows'); + } + else { + $GLOBALS['tpl']->addVars('rowCnt', '3'); + $GLOBALS['tpl']->parseBlock('content', 'ThreeRows', 'Row'); + } +} + +?> diff --git a/home.inc.php b/home.inc.php new file mode 100644 index 0000000..b97da9a --- /dev/null +++ b/home.inc.php @@ -0,0 +1,61 @@ + + * + * The included 'THW Thema' templates, logos and the Q&A catalog are protected + * by copyright laws, and must not be used without the written permission + * of the + * + * Bundesanstalt Technisches Hilfswerk + * Provinzialstrae 93 + * D-53127 Bonn + * Germany + * E-Mail: redaktion@thw.de + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +function getStats() { + $stmt = $GLOBALS['db']->prepare('SELECT fragen,richtig,falsch,boegen,bestanden,durchgefallen FROM statistik'); + $stmt->execute(); + $stmt->bind_result( + $fragen, + $richtig, + $falsch, + $boegen, + $bestanden, + $durchgefallen + ); + + $stmt->fetch(); + + $GLOBALS['tpl']->addVars(Array( + 'statsFragen' => sprintf('%0.d', $fragen), + 'statsFragenRichtig' => sprintf('%0.d (%0.2f %%)', $richtig, ($fragen > 0 ? $richtig / $fragen * 100 : 0)), + 'statsFragenFalsch' => sprintf('%0.d (%0.2f %%)', $falsch, ($fragen > 0 ? $falsch / $fragen * 100 : 0)), + 'statsBoegen' => sprintf('%0.d', $boegen), + 'statsBoegenRichtig' => sprintf('%0.d (%0.2f %%)', $bestanden, ($boegen > 0 ? $bestanden / $boegen * 100 : 0)), + 'statsBoegenFalsch' => sprintf('%0.d (%0.2f %%)', $durchgefallen, ($boegen > 0 ? $durchgefallen / $boegen * 100 : 0)) + )); + + +} + +getStats(); +$GLOBALS['tpl']->addTemplates(Array( + 'content' => 'home' +)); +?> \ No newline at end of file diff --git a/img/Logo.gif b/img/Logo.gif new file mode 100644 index 0000000..5475280 Binary files /dev/null and b/img/Logo.gif differ diff --git a/img/banner.gif b/img/banner.gif new file mode 100644 index 0000000..7b10d49 Binary files /dev/null and b/img/banner.gif differ diff --git a/img/bg.gif b/img/bg.gif new file mode 100644 index 0000000..c9b9546 Binary files /dev/null and b/img/bg.gif differ diff --git a/img/clear.gif b/img/clear.gif new file mode 100644 index 0000000..9ed1269 Binary files /dev/null and b/img/clear.gif differ diff --git a/img/default.gif b/img/default.gif new file mode 100644 index 0000000..9ed1269 Binary files /dev/null and b/img/default.gif differ diff --git a/img/error.gif b/img/error.gif new file mode 100644 index 0000000..bf26923 Binary files /dev/null and b/img/error.gif differ diff --git a/img/falsch.gif b/img/falsch.gif new file mode 100644 index 0000000..2e60344 Binary files /dev/null and b/img/falsch.gif differ diff --git a/img/haken.gif b/img/haken.gif new file mode 100644 index 0000000..ca6f498 Binary files /dev/null and b/img/haken.gif differ diff --git a/img/oben.gif b/img/oben.gif new file mode 100644 index 0000000..70f4c11 Binary files /dev/null and b/img/oben.gif differ diff --git a/img/offline_download.png b/img/offline_download.png new file mode 100644 index 0000000..f4fea16 Binary files /dev/null and b/img/offline_download.png differ diff --git a/img/og_thumbnail.png b/img/og_thumbnail.png new file mode 100644 index 0000000..e320e6f Binary files /dev/null and b/img/og_thumbnail.png differ diff --git a/img/pfeil.gif b/img/pfeil.gif new file mode 100644 index 0000000..50b7b23 Binary files /dev/null and b/img/pfeil.gif differ diff --git a/img/richtig.gif b/img/richtig.gif new file mode 100644 index 0000000..70a54f4 Binary files /dev/null and b/img/richtig.gif differ diff --git a/img/thw.gif b/img/thw.gif new file mode 100644 index 0000000..ffe4fb3 Binary files /dev/null and b/img/thw.gif differ diff --git a/img/thwlogo.gif b/img/thwlogo.gif new file mode 100644 index 0000000..967c5ca Binary files /dev/null and b/img/thwlogo.gif differ diff --git a/img/todestag2007.png b/img/todestag2007.png new file mode 100644 index 0000000..5d90bd3 Binary files /dev/null and b/img/todestag2007.png differ diff --git a/index.php b/index.php new file mode 100644 index 0000000..97088b4 --- /dev/null +++ b/index.php @@ -0,0 +1,110 @@ + + * + * The included 'THW Thema' templates, logos and the Q&A catalog are protected + * by copyright laws, and must not be used without the written permission + * of the + * + * Bundesanstalt Technisches Hilfswerk + * Provinzialstrae 93 + * D-53127 Bonn + * Germany + * E-Mail: redaktion@thw.de + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + + require_once 'db.php'; + require_once 'class.template.inc.php'; + require_once 'functions.inc.php'; + require_once 'init.inc.php'; + + if (!isset($_REQUEST['show'])) { + $_REQUEST['show'] = 'home'; + } + + switch ($_REQUEST['show']) { + case 'fragen': + addBreadcrumb($_REQUEST['show'], 'Zufallsfragen beantworten'); + include ('zufallsfragen.inc.php'); + break; + + case 'bogen': + addBreadcrumb($_REQUEST['show'], 'Prfungsbogen ben'); + include ('pruefbogen.inc.php'); + break; + + case 'loesung': + addBreadcrumb($_REQUEST['show'], 'Antworten anzeigen'); + include ('antworten.inc.php'); + break; + + case 'ordnung': + addBreadcrumb($_REQUEST['show'], 'Prfungsordnung'); + $tpl->addVars('navOrdnung', 'current'); + $tpl->addTemplates(Array('content' => 'ordnung')); + break; + + case 'stats': + $tpl->addVars(Array( + // Statistik Zufallsfragen + 'fragenBisher' => $_SESSION['stats']['Fragen_Bisher'], + 'fragenRichtig' => $_SESSION['stats']['Fragen_Richtig'], + 'fragenFalsch' => $_SESSION['stats']['Fragen_Falsch'], + 'fragenQuote' => (($_SESSION['stats']['Fragen_Bisher']>0)?(preg_replace('/\./is', ',', number_format($_SESSION['stats']['Fragen_Richtig']/$_SESSION['stats']['Fragen_Bisher']*100,2))):('0')) . '%', + + // Statistik Prfungsbgen + 'boegenBisher' => $_SESSION['stats']['Boegen_Bisher'], + 'boegenRichtig' => $_SESSION['stats']['Boegen_Bestanden'], + 'boegenFalsch' => $_SESSION['stats']['Boegen_Durchgefallen'], + 'boegenQuote' => (($_SESSION['stats']['Boegen_Bisher']>0)?(preg_replace('/\./is', ',', number_format($_SESSION['stats']['Boegen_Bestanden']/$_SESSION['stats']['Boegen_Bisher']*100,2))):('0')) . '%' + )); + addBreadcrumb($_REQUEST['show'], 'Statistiken'); + $tpl->addVars('navStats', 'current'); + $tpl->addTemplates(Array('content' => 'stats')); + break; + + case "barrierefreiheit": + addBreadcrumb($_REQUEST["show"], "Barrierefreiheit"); + include "barrierefreiheit.inc.php"; + break; + + case 'impressum': + addBreadcrumb($_REQUEST['show'], 'Impressum'); + $tpl->addTemplates(Array('content' => 'impressum')); + break; + + case 'datenschutz': + addBreadcrumb($_REQUEST['show'], 'Datenschutzhinweis'); + $tpl->addTemplates(Array('content' => 'datenschutz')); + break; + + case "downloads": + addBreadcrumb($_REQUEST["show"], "Offline-Version"); + $tpl->addVars("navOffline", "current"); + $tpl->addTemplates(Array("content" => "offline")); + break; + + default: + $title = ''; + include('home.inc.php'); + } + + $tpl->parse('pageContent', 'content'); + $tpl->printParse('pageMain', 'page-body'); + +?> \ No newline at end of file diff --git a/init.inc.php b/init.inc.php new file mode 100644 index 0000000..5574197 --- /dev/null +++ b/init.inc.php @@ -0,0 +1,91 @@ + + * + * The included 'THW Thema' templates, logos and the Q&A catalog are protected + * by copyright laws, and must not be used without the written permission + * of the + * + * Bundesanstalt Technisches Hilfswerk + * Provinzialstrae 93 + * D-53127 Bonn + * Germany + * E-Mail: redaktion@thw.de + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +header('Content-Type: text/html; charset=utf-8'); + +$GLOBALS['tpl'] = new Template('./templates/'); +$tpl =& $GLOBALS['tpl']; + +$tpl->addTemplates(Array( + 'page-body' => 'page-body', + 'top-line' => 'top-line' +)); + +session_start(); + +if (isset($_REQUEST['resetstats']) && intval($_REQUEST['resetstats']) == '1') { + unset($_SESSION['stats']); +} + +if (!isset($_SESSION['stats'])) { + + $_SESSION['stats'] = array('Fragen_Bisher' => '0', + 'Fragen_Richtig' => '0', + 'Fragen_Falsch' => '0', + 'Boegen_Bisher' => '0', + 'Boegen_Bestanden' => '0', + 'Boegen_Durchgefallen' => '0' ); +} + +if (isset($_REQUEST['jahr'])) { + $_SESSION['jahr'] = intval($_REQUEST['jahr']); +} elseif (!isset($_SESSION['jahr'])) { + $_SESSION['jahr'] = 2015; +} + +srand(microtime()*(double)10000); + +if ((isset($_COOKIE['stylesheet']) && $_COOKIE['stylesheet'] == 'barrierefrei') + || isset($_POST['barrierefrei']) + || (isset($_GET['style']) && $_GET['style'] == 'rg')) { + $tpl->addVars('extraStyleSheet', ''); +} else { + +} + +if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') { + $protocol = 'https'; + // HSTS Policy aktivieren + header('Strict-Transport-Security: max-age=31536000; includeSubDomains;'); +} else { + $protocol = 'http'; +} + +$tpl->addVars(Array( + // Globale Variablen + 'scriptName' => $_SERVER['SCRIPT_NAME'], + 'catalogYear' => $_SESSION['jahr'], + 'baseUrl' => $protocol . '://thw-theorie.de/' +)); + + +$tpl->parse('topLine', 'top-line'); + +?> \ No newline at end of file diff --git a/pruefbogen.inc.php b/pruefbogen.inc.php new file mode 100644 index 0000000..a471e73 --- /dev/null +++ b/pruefbogen.inc.php @@ -0,0 +1,216 @@ + + * + * The included 'THW Thema' templates, logos and the Q&A catalog are protected + * by copyright laws, and must not be used without the written permission + * of the + * + * Bundesanstalt Technisches Hilfswerk + * Provinzialstrae 93 + * D-53127 Bonn + * Germany + * E-Mail: redaktion@thw.de + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* +* +* Vollstndiger Prfungsbogen mit zuflligen Fragen +* +*/ + +$tpl->parseBlock('page-body', 'NavBogen', 'Sublinks'); +$tpl->addVars('navBogen', 'current'); + +if (isset($_REQUEST['create']) && $_REQUEST['create'] == '1') { + // Neuen Bogen erstellen + unset($_SESSION['bogen']); + + // Werte initialisieren + $_SESSION['bogen']['StartTime'] = time(); + $_SESSION['bogen']['Fragen'] = Array(); + + // Anz. Abschnitte und Fragen aus der DB holen + $sectionCount = getSingleResult('SELECT COUNT(*) FROM abschnitte WHERE Jahr = ?', array('i', $_SESSION['jahr'])); + + $stmt = $GLOBALS['db']->prepare('SELECT ID, Abschnitt FROM fragen WHERE Jahr = ? ORDER BY Abschnitt, Nr ASC'); + $stmt->bind_param('i', $_SESSION['jahr']); + $stmt->execute(); + $stmt->bind_result($questionId, $questionSection); + + // Fragen in Array bertragen + while ($stmt->fetch()) { + $fragen[$questionId] = $questionSection; + } + $stmt->close(); + + // Gesamtanzahl Fragen + $count_ab = array_count_values($fragen); + + // Eine Frage pro Themengebiet aus der DB holen + for ($i = 1; $i <= $sectionCount; $i++) { + $nr = rand(1, $count_ab[$i]); + $id = getSingleResult('SELECT ID FROM fragen WHERE Nr = ? AND Abschnitt = ? AND Jahr = ?', + array('iii', $nr, $i, $_SESSION['jahr'])); + + array_push($_SESSION['bogen']['Fragen'], (int)$id); + + // Frage entfernen + unset($fragen[$id]); + } + + // Restliche Fragen zufllig auffllen + // Dazu verbliebene Keys von $fragen als Values in neues Array $fragen2 kopieren, + // da shuffle() die Keys verwirft! + $fragen2 = Array(); + foreach ($fragen As $key => $value) { + array_push($fragen2, $key); + } + shuffle($fragen2); + for ($i = 0; $i < 40 - $sectionCount; $i++) { + array_push($_SESSION['bogen']['Fragen'], array_shift($fragen2)); + } + + // Fragen erneut mischen + shuffle($_SESSION['bogen']['Fragen']); + +} + +if (isset($_SESSION['bogen'])) { + if (isset($_POST['antwort'])) { + // Fragen beantwortet + $richtig = 0; + $falsch = 0; + $fragen_cnt = count($_SESSION['bogen']['Fragen']); + $zeit = time()-$_SESSION['bogen']['StartTime']; + + for ($i = 0; $i < $fragen_cnt; $i++) { + $id = $_SESSION['bogen']['Fragen'][$i]; + $solutionBitmask = getSingleResult('SELECT `Loesung` FROM `fragen` WHERE `ID` = ?', + array('i', $id)); + + $loesung = array( 1 => ( $solutionBitmask & 0x1), + 2 => (($solutionBitmask & 0x2) >> 1), + 3 => (($solutionBitmask & 0x4) >> 2)); + + if (isset($_POST['antwort'][$id])) { + $korrekt = (($loesung[1] == (isset($_POST['antwort'][$id][1]) ? $_POST['antwort'][$id][1] : 0)) + && ($loesung[2] == (isset($_POST['antwort'][$id][2]) ? $_POST['antwort'][$id][2] : 0)) + && ($loesung[3] == (isset($_POST['antwort'][$id][3]) ? $_POST['antwort'][$id][3] : 0))); + } else{ + $korrekt = false; + } + + if ($korrekt) { + $_SESSION["stats"]['Fragen_Richtig']++; + $richtig++; + } else { + $_SESSION["stats"]['Fragen_Falsch']++; + $falsch++; + } + $_SESSION["stats"]['Fragen_Bisher']++; + } + + $_SESSION["stats"]['Boegen_Bisher']++; + + if (($richtig / $fragen_cnt) >= 0.8) + $_SESSION["stats"]['Boegen_Bestanden']++; + else + $_SESSION["stats"]['Boegen_Durchgefallen']++; + + $GLOBALS['db']->query('UPDATE statistik SET fragen=fragen+' . $fragen_cnt + .',richtig=richtig+' . $richtig + .',falsch=falsch+' . $falsch + .',boegen=boegen+1' + .',bestanden=bestanden+' . (($richtig / $fragen_cnt) >= 0.8?1:0) + .',durchgefallen=durchgefallen+' . (($richtig / $fragen_cnt) < 0.8?1:0)); + + $tpl->addTemplates('content', 'bogen-ende'); + + $tpl->addVars(Array( + 'anzFragen' => count($_SESSION['bogen']['Fragen']), + 'zeit' => sprintf('%02d:%02d\'%02d', $zeit / 3600, ($zeit/60)%60, $zeit%60), + 'fragenRichtig' => $richtig, + 'fragenRichtigQuote' => sprintf('%.2f %%', $richtig / $fragen_cnt * 100), + 'fragenFalsch' => $falsch, + 'fragenFalschQuote' => sprintf('%.2f %%', $falsch / $fragen_cnt * 100) + )); + + if (($richtig / $fragen_cnt) >= 0.8) + $tpl->parseBlock('content', 'Bestanden', 'Ja'); + else + $tpl->parseBlock('content', 'Bestanden', 'Nein'); + + for ($i=0; $i0 && $i%10==0) { + // 'Nach oben'-Zeile an Handle anhngen + $tpl->parseBlock('content', 'Aufloesung', 'Topline', TRUE); + } + Answer($_SESSION['bogen']['Fragen'][$i], $_POST['antwort'], FALSE); + $tpl->parseBlock('content', 'Aufloesung', 'Antwort', TRUE, TRUE); + } + + unset($_SESSION['bogen']); + } + else { + // Fragen anzeigen + $tpl->addTemplates(Array( + 'content' => 'bogen-fragen' + )); + + $tpl->addVars(Array( + 'zeit' => date('G:i', $_SESSION['bogen']['StartTime']) + )); + + for ($i=0; $i0 && $i%10==0) { + $tpl->parseBlock('content', 'Bogen', 'Topline', TRUE); + } + + // Frage aus DB holen + $question = getQuestionById($_SESSION['bogen']['Fragen'][$i]); + + $tpl->addVars(Array( + 'frageIndex' => $i + 1, + 'frageID' => $question['ID'], + 'frageNr' => $question['Nr'], + 'abschnittNr' => $question['Abschnitt'], + 'frageText' => $question['Frage'], + 'Antwort1' => $question['Antwort1'], + 'Antwort2' => $question['Antwort2'], + 'Antwort3' => $question['Antwort3'] + )); + + if ($question['Antwort3'] == '') { + $tpl->addVars('rowCnt', '2'); + $tpl->delBlockHandle('content', 'ThreeRows'); + } + else { + $tpl->addVars('rowCnt', '3'); + $tpl->parseBlock('content', 'ThreeRows', 'Row'); + } + + $tpl->parseBlock('content', 'Bogen', 'Frage', TRUE, TRUE); + } + + } +} +else { + $tpl->addVars('navBogenNeu', 'current'); + $tpl->addTemplates(Array('content' => 'bogen-start')); +} diff --git a/rg-styles.css b/rg-styles.css new file mode 100644 index 0000000..2fa57ae --- /dev/null +++ b/rg-styles.css @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2001 Kai Blaschke + * + * The included "THW Thema" templates, logos and the Q&A catalog are protected + * by copyright laws, and must not be used without the written permission + * of the + * + * Bundesanstalt Technisches Hilfswerk + * Provinzialstrae 93 + * D-53127 Bonn + * Germany + * E-Mail: redaktion@thw.de + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +.korrekt { padding-left: 22px; background-image: url(img/richtig.gif); background-position: left center; background-repeat: no-repeat; color: #00A000; } +.falsch { padding-left: 22px; background-image: url(img/falsch.gif); background-position: left center; background-repeat: no-repeat; color: #400000; } +.fragebkg tr td.korrekt { background-color: white; color: #00A000;} +.fragebkg tr td.falsch { background-color: white; color: #400000; } diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..15bf958 --- /dev/null +++ b/robots.txt @@ -0,0 +1,8 @@ +User-agent: * +Disallow: + +User-agent: WebReaper +Disallow: / + +User-agent: Slurp +Crawl-delay: 180 diff --git a/socialshareprivacy/2-klick-logo_min.jpg b/socialshareprivacy/2-klick-logo_min.jpg new file mode 100644 index 0000000..bb2e5a5 Binary files /dev/null and b/socialshareprivacy/2-klick-logo_min.jpg differ diff --git a/socialshareprivacy/dimensions.gif b/socialshareprivacy/dimensions.gif new file mode 100644 index 0000000..762340a Binary files /dev/null and b/socialshareprivacy/dimensions.gif differ diff --git a/socialshareprivacy/index.html b/socialshareprivacy/index.html new file mode 100644 index 0000000..6a6d2c7 --- /dev/null +++ b/socialshareprivacy/index.html @@ -0,0 +1,731 @@ + + + + Dokumentation – heise „socialSharePrivacy“–Plug-In + + + + + + +

jQuery Plug-In socialshareprivacy – Dokumentation

+ +

Download des jQuery-Plug-Ins:

+

+ jquery.socialshareprivacy.zip
+ jquery.socialshareprivacy.tar.gz +

+ + + +
    +
  1. +

    Change-Log

    +
      +
    1. +

      Version 1.3

      +
        +
      • + Erste Fassung, die auch mehrmals auf einer Seite verwendet werden kann. Damit in den verschiedenen Instanzen unterschiedliche URIs verwendet werden können, wird der per Option uri gesetzen Funktion ein Kontext-DOM-Knoten übergeben, über den man eine URI ermitteln kann. Beispiele für die Verwendung haben wir in der Dokumentation bei den Beispiel-Einbindungen ergänzt. +
      • +
      • + Korrektur für IE < 9: Das per css_path angegebene Stylesheet wurde mit jQuery-Versionen != 1.4.2 nicht eingebaut. +
      • +
      +
    2. +
    3. +

      Version 1.2

      +
        +
      • + JS: Facebook App-ID entfernt, da diese nicht mehr nötig ist, um den Like/Recommend-Button zu nutzen. +
      • +
      +
    4. +
    5. +

      Version 1.1

      +
        +
      • + CSS: Bei diversen Elementen haben wir mehr Angaben hinzugefügt, um die Nacharbeiten, bei der Integration in eigene Seiten, geringer zu halten. Vor allem haben wir margin-, padding-, width- und height-Angaben hinzugefügt. +
      • +
      • + Die Doku wurde um einen Beispiele- und diesen Change-Log-Bereich erweitert. +
      • +
      • + Das Plug-In wurde inhaltlich etwas umgestellt und einige Code-Abkürzungen vorgenommen. +
      • +
      • + JS-Bug Korrektur: Es gab einen Fehler, wenn es in der Seite ein canonical-Attribut gab, das aber einen leeren Wert hatte. +
      • +
      • + JS-Bug Korrektur: Bei den Optionen von Google+ gab es eine Angabe, die später im Script nie abgefragt wurde. +
      • +
      • + JS-Bug Korrektur: Die Perma-Option von Google+ wurde nur angezeigt, wenn auch die Perma-Option von Twitter aktiviert war. +
      • +
      • + Twitter: Wenn aktiviert war das iFrame zu groß und überlagerte darunter liegende Links. <iframe ...style="width:130px; height:25px;"></iframe> ergänzt. +
      • +
      • Allgemein: Wenn die Option css_path leer ist, wird kein <link>-Tag mit leerem href in die Seite eingebaut.
      • +
      • Allgemein: Die von den Buttons verwendete URI kann jetzt über die Option uri gesteuert werden. Es ist sowohl ein fester Wert, wie auch eine Function möglich. Default ist die enthaltene Funktion getURI
      • +
      • Neue Features: +
          +
        • Facebook: Die Beschriftungsvarianten des Buttons "Empfehlen" und "Gefällt mir" kann über die neue Option "action" gesteuert werden. Werte sind "recommend" (default) und "like".
        • +
        • Twitter: Parameter "language" (default "en") jetzt auch für Twitter.
        • +
        +
      • +
      +
    6. +
    7. +

      Version 1.0

      +
        +
      • Erstes öffentliches Release
      • +
      +
    8. +
    +
  2. + +
  3. +

    Dateien

    +

    Zu unserem Plug-In gehören folgende Dateien:

    +
      +
    • index.html (die Doku, die Sie gerade lesen)
    • +
    • dimensions.gif (Infografik für diese Doku)
    • +
    • 2-klick-logo_min.jpg (Logo klein)
    • +
    • jquery.socialshareprivacy.js
    • +
    • jquery.socialshareprivacy.min.js
    • +
    • socialshareprivacy/socialshareprivacy.css
    • +
    • socialshareprivacy/images/dummy_facebook.png
    • +
    • socialshareprivacy/images/dummy_facebook_en.png
    • +
    • socialshareprivacy/images/dummy_gplus.png
    • +
    • socialshareprivacy/images/dummy_twitter.png
    • +
    • socialshareprivacy/images/settings.png
    • +
    • socialshareprivacy/images/socialshareprivacy_info.png
    • +
    • socialshareprivacy/images/socialshareprivacy_on_off.png
    • +
    • socialshareprivacy/images/2-klick-logo.jpg
    • +
    +
  4. +
  5. +

    Voraussetzungen und Einschränkungen

    +

    + Technische Voraussetzungen sind jQuery und aktiviertes JavaScript im Browser. Bei uns getestet mit jQuery 1.4.
    + Das Plug-In kann derzeit innerhalb einer HTML-Seite nur einmal verwendet werden. +

    +

    + Wenn Sie Vorschläge zur Verbesserung haben, wenden Sie sich gerne per Mail an 2klick@heise.de. +

    +

    + Das dauerhafte Aktivieren der Services funktioniert im Internet Explorer erst ab Version 8, da die Vorgängerversionen kein JSON unterstützen. Daher fehlt im IE <= 7 diese Funktion. Der Rest des Plug-Ins ist davon nicht betroffen. +

    +

    + Für Facebook ist zwingend eine eigene App-ID notwendig, siehe dazu Hinweis zur Facebook App-ID. +

    +
  6. +
  7. +

    Ausmaße

    + Ausmaße des Plug-Ins +

    + Das Plug-In benötigt insgesamt etwa 600 Pixel in der Breite (wenn alle Services aktiviert sind) und ca. 290 Pixel in der Höhe, wobei dies natürlich auch von der Länge der angegebenen MouseOver-Texte abhängt. +

    +
  8. +
      +
    1. +

      Einbindung

      +
      +<head>
      +  …
      +  <script type="text/javascript" src="jquery.js"></script> 
      +  <script type="text/javascript" src="jquery.socialshareprivacy.js"></script>
      +  <script type="text/javascript">
      +    jQuery(document).ready(function($){
      +      if($('#socialshareprivacy').length > 0){
      +        $('#socialshareprivacy').socialSharePrivacy(); 
      +      }
      +    });
      +  </script>
      +  …
      +</head>
      +<body>
      +  …
      +  <div id="socialshareprivacy"></div>
      +  …
      +</body>
      +
      +
    2. +
    3. +

      Erklärung des Codes

      + +
      +<script type="text/javascript" src="jquery.js"></script> 
      +<script type="text/javascript" src="jquery.socialshareprivacy.js"></script>
      +
      +

      + Die erste Zeile bindet das JavaScript-Framework „JQuery“ (http://jquery.com/) ein, die zweite Zeile unser Plug-In. jQuery liegt unserem Paket nicht bei, Sie müssen es erst noch selbst von der eben genannten Website herunterladen. +

      + +
      +<script type="text/javascript">
      +  jQuery(document).ready(function($){
      +    if($('#socialshareprivacy').length > 0){
      +      $('#socialshareprivacy').socialSharePrivacy(); 
      +    }
      +  });
      +</script>
      +
      +

      + In diesem <script>-Block wird die Plug-In Funktion an ein frei wählbares, leeres HTML-Element in der Seite gehängt, in diesem Fall das Element mit der id socialshareprivacy.
      + Damit das Anhängen des Plug-Ins nur dann geschieht, wenn das Element auch wirklich vorhanden ist, haben wir noch die Kontrollfunktion if, die das Anhängen umschließt und die nötige Bedingung prüft. +

      + +
      +<body>
      +  …
      +  <div id="socialshareprivacy"></div>
      +  …
      +</body>
      +
      +

      + Irgendwo im <body>-Bereich der Website platziert man das leere HTML-Element mit der gewünschten id, die identisch zur verwendeten id im vorhergehenden <script>-Block sein muss. +

      +
    4. +
    +
  9. +
  10. +

    Optionen

    +

    + Zur Einbindung stehen diverse Optionen zur Verfügung. Im Folgenden sind erstmal die allgemeinen Optionen aufgeführt und anschließend die Optionen nach den einzelnen Services (Facebook, Twitter, Google+) aufgelistet.
    + Beispiel für einen Aufruf mit Optionen: +

    +
    +$('#socialshareprivacy').socialSharePrivacy({
    +  services : {
    +    facebook : {
    +      'perma_option': 'off'
    +    }, 
    +    twitter : {
    +        'status' : 'off'
    +    },
    +    gplus : {
    +      'display_name' : 'Google Plus'
    +    }
    +  },
    +  'cookie_domain' : 'heise.de'
    +});
    +
    +
      +
    1. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      allgemeine Optionen
      OptionStandardwertBeschreibung
      info_linkhttp://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.htmlLink zu detaillierter Datenschutz-Info, in unserem Fall ein heise-Artikel.
      txt_helpTextMouseOver-Text des i-Icons
      settings_permaDauerhaft aktivieren und Datenüber­tragung zustimmen:Überschrift des Einstellungsmenüs
      cookie_path/Pfad der Gültigkeit des Cookies
      cookie_domaindocument.location.hostDomain für die das Cookie gültig ist
      cookie_expires365Dauer die das Cookie gültig ist in Tagen
      css_pathsocialshareprivacy/socialshareprivacy.cssPfad zur CSS-Datei, wenn leer wird kein Stylesheet eingebaut
      urigetURIDie URI, die von den Buttons weitergegeben werden soll. Möglich ist ein fester Wert (z.B. "http://www.heise.de") oder eine Funktion (siehe function getURI() im Plug-In-Quellcode)
      +
    2. +
    3. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Optionen: Facebook
      OptionStandardwertBeschreibung
      statusonDer User hat Facebook zur Auswahl
      app_identfallen (seit Version 1.2)Facebook App-ID; Sie ist nötig um den Empfehlen-Button von Facebook nutzen zu können. Ist sie nicht angegeben, wird dem User Facebook trotz 'status' : 'on' nicht angeboten. In der JavaScript-Konsole wird dem Entwickler ein entsprechender Hinweis ausgegeben.
      dummy_imgsocialshareprivacy/images/dummy_facebook.pngPfad zur statischen Grafik
      txt_infoTextMouseOver-Text des Empfehlen-Buttons
      txt_fb_offnicht mit Facebook verbundenText-Entsprechung der Schalter-Grafik im ausgeschalteten Zustand, in der Regel nicht sichtbar für den User
      txt_fb_onmit Facebook verbundenText-Entsprechung der Schalter-Grafik im eingeschalteten Zustand, in der Regel nicht sichtbar für den User
      perma_optiononDer User hat die Option sich Facebook dauerhaft einblenden zu lassen (mittels Cookie)
      display_nameFacebookSchreibweise des Service in den Optionen
      referrer_track Wird ans Ende der URL gehängt, kann zum Tracken des Referrers genutzt werden
      languagede_DESpracheinstellung
      actionrecommendBeschriftung des Buttons: Empfehlen (recommend) oder Gefällt mir (like)
      +
    4. +
    5. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Optionen: Twitter
      OptionStandardwertBeschreibung
      statusonDer User hat Twitter zur Auswahl
      dummy_imgsocialshareprivacy/images/dummy_twitter.pngPfad zur statischen Grafik
      txt_infoTextMouseOver-Text des Tweet-Buttons
      txt_twitter_offnicht mit Twitter verbundenText-Entsprechung der Schalter-Grafik im ausgeschalteten Zustand, in der Regel nicht sichtbar für den User
      txt_twitter_onmit Twitter verbundenText-Entsprechung der Schalter-Grafik im eingeschalteten Zustand, in der Regel nicht sichtbar für den User
      perma_optiononDer User hat die Option sich Twitter dauerhaft einblenden zu lassen (mittels Cookie)
      display_nameTwitterSchreibweise des Service in den Optionen
      referrer_track Wird ans Ende der URL gehängt, kann zum Tracken des Referrers genutzt werden
      tweet_textgetTweetText + Die Funktion prüft ob es die Meta-Angabe DC.title gibt und verwendet diese. Gibt es außerdem noch DC.creator wird diese etwas abgesetzt (" - ") hinten angehängt. Ist DC.title nicht vorhanden wird das <title>-Tag der Seite verwendet.
      + Diese Option kann mit einem eigenen Text (typeof == string) überschrieben werden oder mit einer eigenen Funktion (typeof == function), die den Text generiert.
      + Der übergebene Texte wird immer auf 120 Zeichen gekürzt und beim letzten Leerzeichen mit … ersetzt. +
      languageenSpracheinstellung (Default: "en" ja, uns gefällt Tweet besser als Twittern)
      +
    6. +
    7. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Optionen: Google+
      OptionStandardwertBeschreibung
      statusonDer User hat Google+ zur Auswahl
      dummy_imgsocialshareprivacy/images/dummy_gplus.pngPfad zur statischen Grafik
      txt_infoTextMouseOver-Text des „+1“-Buttons
      txt_gplus_offnicht mit Google+ verbundenText-Entsprechung der Schalter-Grafik im ausgeschalteten Zustand, in der Regel nicht sichtbar für den User
      txt_gplus_onmit Google+ verbundenText-Entsprechung der Schalter-Grafik im eingeschalteten Zustand, in der Regel nicht sichtbar für den User
      perma_optiononDer User hat die Option sich Google+ dauerhaft einblenden zu lassen (mittels Cookie)
      display_nameGoogle+Schreibweise des Service in den Optionen
      referrer_track Wird ans Ende der URL gehängt, kann zum Tracken des Referrers genutzt werden
      languagedeSpracheinstellung
      +
    8. +
    +
  11. +
  12. +

    Beispiel-Einbindungen

    +

    + Im Folgenden sehen Sie ein paar beispielhafte Einbindungen von gängigen Konfigurationen. +

    +
      +
    • +

      Nur Facebook einbinden

      +
      +$('#socialshareprivacy').socialSharePrivacy({
      +    services : {
      +        twitter : {
      +            'status' : 'off'
      +        },
      +        gplus : {
      +            'status' : 'off'
      +        }
      +    }
      +});
      +
      +
    • +
    • +

      Keine Option zum dauerhaften Aktivieren anbieten

      +
      +$('#socialshareprivacy').socialSharePrivacy({
      +    services : {
      +        facebook : {
      +            'perma_option'  : 'off'
      +        }, 
      +        twitter : {
      +            'perma_option' : 'off'
      +        },
      +        gplus : {
      +            'perma_option' : 'off'
      +        }
      +    }
      +});
      +
      +
    • +
    • +

      Nur Google+ anbieten und eigenen Pfad für die CSS-Datei angeben.

      +
      +$('#socialshareprivacy').socialSharePrivacy({
      +    services : {
      +        facebook : {
      +            'status' : 'off'
      +        }, 
      +        twitter : {
      +            'status' : 'off'
      +        }
      +    },
      +    'css_path' : '/style/plugins/socialshareprivacy.css'
      +});
      +
      +
    • +
    • +

      Mehrere 2-Klick-Buttonleisten auf einer Seite

      +

      Variante 1: Ein Aufruf des Plug-Ins mit einem entsprechenden Selektor

      +
      +<div class="anriss">
      +    <h3><a href="http://www.heise.de">heise</a></h3>
      +    <p>lorem ipsum</p>
      +    <div class="social"></div>
      +</div>
      +
      +<div class="anriss">
      +    <h3><a href="http://www.heise.de/security/">heise security</a></h3>
      +    <p>dolor sit amet</p>
      +    <div class="social"></div>
      +</div>
      +
      +<script>
      +$(".social").socialSharePrivacy({
      +    uri : function(context) {
      +        return $(context).parents(".anriss").find("h3 a").attr("href");
      +    }
      +});
      +</script>
      +
      +

      Variante 2: Mehrfacher Aufruf des Plug-Ins

      +
      +<div>
      +    <h3><a href="http://www.heise.de">heise</a></h3>
      +    <p>lorem ipsum</p>
      +    <div id="one"></div>
      +</div>
      +<script>
      +$("#one").socialSharePrivacy({
      +    uri : "http://www.heise.de"
      +});
      +</script>
      +
      +<div>
      +    <h3><a href="http://www.heise.de/security/">heise security</a></h3>
      +    <p>dolor sit amet</p>
      +    <div id="two"></div>
      +</div>
      +<script>
      +$("#two").socialSharePrivacy({
      +    uri : "http://www.heise.de/security/"
      +});
      +</script>
      +
      + +
    • +
    +
  13. +
  14. +

    URL

    +

    + Die URL, die den Services übergeben wird, kann über eine Option gesteuert werden.
    Standardmäßig wird eine Funktion innerhalb des Plug-Ins verwendet, die die URL der aktuellen Seite aus document.location.href ermittelt, ist jedoch eine kanonische URL hinterlegt (<link rel="canonical">), wird diese genommen. +

    +
  15. +
  16. +

    Einstellungen merken

    +

    + Bevor das Cookie abgefragt wird, wie die Einstellungen des Users sind, wird erstmal geprüft, wie das Plug-In konfiguriert ist. Ist das Plug-In eventuell nachträglich umgestellt worden hat der User dadurch keine Nachteile.
    + Wurde für alle Services die Merken-Funktion ausgeschaltet ('perma_option' : 'off') wird auch das Einstellungsmenü nicht mehr angezeigt. +

    +
  17. +
  18. +

    Lizenz

    +

    + Dieses Plug-In ist unter der MIT License (http://www.opensource.org/licenses/mit-license.php) veröffentlicht und darf gerne für private, wie auch kommerzielle Zwecke genutzt werden. +

    +
  19. +
  20. + +

    + Unserem Plug-In liegt auch das von uns verwendete Logo bei, das Sie gerne zur Bewerbung dieser Aktion verwenden dürfen. + Logo 2 Klicks für mehr Datenschutz +

    +
  21. +
+ + diff --git a/socialshareprivacy/jquery.js b/socialshareprivacy/jquery.js new file mode 100644 index 0000000..16f890d --- /dev/null +++ b/socialshareprivacy/jquery.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?88`vPU88@8l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0]88`vPU88@8gWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-Wit88`vPU88.8(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/socialshareprivacy/jquery.socialshareprivacy.js b/socialshareprivacy/jquery.socialshareprivacy.js new file mode 100644 index 0000000..fded522 --- /dev/null +++ b/socialshareprivacy/jquery.socialshareprivacy.js @@ -0,0 +1,377 @@ +/* + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * http://www.heise.de/extras/socialshareprivacy/ + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html + * + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Spread the word, link to us if you can. + */ +(function ($) { + + "use strict"; + + /* + * helper functions + */ + + // abbreviate at last blank before length and add "\u2026" (horizontal ellipsis) + function abbreviateText(text, length) { + var abbreviated = decodeURIComponent(text); + if (abbreviated.length <= length) { + return text; + } + + var lastWhitespaceIndex = abbreviated.substring(0, length - 1).lastIndexOf(' '); + abbreviated = encodeURIComponent(abbreviated.substring(0, lastWhitespaceIndex)) + "\u2026"; + + return abbreviated; + } + + // returns content of tags or '' if empty/non existant + function getMeta(name) { + var metaContent = $('meta[name="' + name + '"]').attr('content'); + return metaContent || ''; + } + + // create tweet text from content of and + // fallback to content of tag + function getTweetText() { + var title = getMeta('DC.title'); + var creator = getMeta('DC.creator'); + + if (title.length > 0 && creator.length > 0) { + title += ' - ' + creator; + } else { + title = $('title').text(); + } + + return encodeURIComponent(title); + } + + // build URI from rel="canonical" or document.location + function getURI() { + var uri = document.location.href; + var canonical = $("link[rel=canonical]").attr("href"); + + if (canonical && canonical.length > 0) { + if (canonical.indexOf("http") < 0) { + canonical = document.location.protocol + "//" + document.location.host + canonical; + } + uri = canonical; + } + + return uri; + } + + function cookieSet(name, value, days, path, domain) { + var expires = new Date(); + expires.setTime(expires.getTime() + (days * 24 * 60 * 60 * 1000)); + document.cookie = name + '=' + value + '; expires=' + expires.toUTCString() + '; path=' + path + '; domain=' + domain; + } + function cookieDel(name, value, path, domain) { + var expires = new Date(); + expires.setTime(expires.getTime() - 100); + document.cookie = name + '=' + value + '; expires=' + expires.toUTCString() + '; path=' + path + '; domain=' + domain; + } + + // extend jquery with our plugin function + $.fn.socialSharePrivacy = function (settings) { + var defaults = { + 'services' : { + 'facebook' : { + 'status' : 'on', + 'dummy_img' : 'socialshareprivacy/images/dummy_facebook.png', + 'txt_info' : '2 Klicks für mehr Datenschutz: Erst wenn Sie hier klicken, wird der Button aktiv und Sie können Ihre Empfehlung an Facebook senden. Schon beim Aktivieren werden Daten an Dritte übertragen – siehe <em>i</em>.', + 'txt_fb_off' : 'nicht mit Facebook verbunden', + 'txt_fb_on' : 'mit Facebook verbunden', + 'perma_option' : 'on', + 'display_name' : 'Facebook', + 'referrer_track' : '', + 'language' : 'de_DE', + 'action' : 'recommend' + }, + 'twitter' : { + 'status' : 'on', + 'dummy_img' : 'socialshareprivacy/images/dummy_twitter.png', + 'txt_info' : '2 Klicks für mehr Datenschutz: Erst wenn Sie hier klicken, wird der Button aktiv und Sie können Ihre Empfehlung an Twitter senden. Schon beim Aktivieren werden Daten an Dritte übertragen – siehe <em>i</em>.', + 'txt_twitter_off' : 'nicht mit Twitter verbunden', + 'txt_twitter_on' : 'mit Twitter verbunden', + 'perma_option' : 'on', + 'display_name' : 'Twitter', + 'referrer_track' : '', + 'tweet_text' : getTweetText, + 'language' : 'en' + }, + 'gplus' : { + 'status' : 'on', + 'dummy_img' : 'socialshareprivacy/images/dummy_gplus.png', + 'txt_info' : '2 Klicks für mehr Datenschutz: Erst wenn Sie hier klicken, wird der Button aktiv und Sie können Ihre Empfehlung an Google+ senden. Schon beim Aktivieren werden Daten an Dritte übertragen – siehe <em>i</em>.', + 'txt_gplus_off' : 'nicht mit Google+ verbunden', + 'txt_gplus_on' : 'mit Google+ verbunden', + 'perma_option' : 'on', + 'display_name' : 'Google+', + 'referrer_track' : '', + 'language' : 'de' + } + }, + 'info_link' : 'http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html', + 'txt_help' : 'Wenn Sie diese Felder durch einen Klick aktivieren, werden Informationen an Facebook, Twitter oder Google in die USA übertragen und unter Umständen auch dort gespeichert. Näheres erfahren Sie durch einen Klick auf das <em>i</em>.', + 'settings_perma' : 'Dauerhaft aktivieren und Datenüber­tragung zustimmen:', + 'cookie_path' : '/', + 'cookie_domain' : document.location.host, + 'cookie_expires' : '365', + 'css_path' : 'socialshareprivacy/socialshareprivacy.css', + 'uri' : getURI + }; + + // Standardwerte des Plug-Ings mit den vom User angegebenen Optionen ueberschreiben + var options = $.extend(true, defaults, settings); + + var facebook_on = (options.services.facebook.status === 'on'); + var twitter_on = (options.services.twitter.status === 'on'); + var gplus_on = (options.services.gplus.status === 'on'); + + // check if at least one service is "on" + if (!facebook_on && !twitter_on && !gplus_on) { + return; + } + + // insert stylesheet into document and prepend target element + if (options.css_path.length > 0) { + // IE fix (noetig fuer IE < 9 - wird hier aber fuer alle IE gemacht) + if (document.createStyleSheet) { + document.createStyleSheet(options.css_path); + } else { + $('head').append('<link rel="stylesheet" type="text/css" href="' + options.css_path + '" />'); + } + } + + return this.each(function () { + + $(this).prepend('<ul class="social_share_privacy_area"></ul>'); + var context = $('.social_share_privacy_area', this); + + // canonical uri that will be shared + var uri = options.uri; + if (typeof uri === 'function') { + uri = uri(context); + } + + // + // Facebook + // + if (facebook_on) { + var fb_enc_uri = encodeURIComponent(uri + options.services.facebook.referrer_track); + var fb_code = '<iframe src="http://www.facebook.com/plugins/like.php?locale=' + options.services.facebook.language + '&href=' + fb_enc_uri + '&send=false&layout=button_count&width=120&show_faces=false&action=' + options.services.facebook.action + '&colorscheme=light&font&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:145px; height:21px;" allowTransparency="true"></iframe>'; + var fb_dummy_btn = '<img src="' + options.services.facebook.dummy_img + '" alt="Facebook "Like"-Dummy" class="fb_like_privacy_dummy" />'; + + context.append('<li class="facebook help_info"><span class="info">' + options.services.facebook.txt_info + '</span><span class="switch off">' + options.services.facebook.txt_fb_off + '</span><div class="fb_like dummy_btn">' + fb_dummy_btn + '</div></li>'); + + var $container_fb = $('li.facebook', context); + + $('li.facebook div.fb_like img.fb_like_privacy_dummy,li.facebook span.switch', context).live('click', function () { + if ($container_fb.find('span.switch').hasClass('off')) { + $container_fb.addClass('info_off'); + $container_fb.find('span.switch').addClass('on').removeClass('off').html(options.services.facebook.txt_fb_on); + $container_fb.find('img.fb_like_privacy_dummy').replaceWith(fb_code); + } else { + $container_fb.removeClass('info_off'); + $container_fb.find('span.switch').addClass('off').removeClass('on').html(options.services.facebook.txt_fb_off); + $container_fb.find('.fb_like').html(fb_dummy_btn); + } + }); + } + + // + // Twitter + // + if (twitter_on) { + var text = options.services.twitter.tweet_text; + if (typeof text === 'function') { + text = text(); + } + // 120 is the max character count left after twitters automatic url shortening with t.co + text = abbreviateText(text, '120'); + + var twitter_enc_uri = encodeURIComponent(uri + options.services.twitter.referrer_track); + var twitter_count_url = encodeURIComponent(uri); + var twitter_code = '<iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?url=' + twitter_enc_uri + '&counturl=' + twitter_count_url + '&text=' + text + '&count=horizontal&lang=' + options.services.twitter.language + '" style="width:130px; height:25px;"></iframe>'; + var twitter_dummy_btn = '<img src="' + options.services.twitter.dummy_img + '" alt=""Tweet this"-Dummy" class="tweet_this_dummy" />'; + + context.append('<li class="twitter help_info"><span class="info">' + options.services.twitter.txt_info + '</span><span class="switch off">' + options.services.twitter.txt_twitter_off + '</span><div class="tweet dummy_btn">' + twitter_dummy_btn + '</div></li>'); + + var $container_tw = $('li.twitter', context); + + $('li.twitter div.tweet img,li.twitter span.switch', context).live('click', function () { + if ($container_tw.find('span.switch').hasClass('off')) { + $container_tw.addClass('info_off'); + $container_tw.find('span.switch').addClass('on').removeClass('off').html(options.services.twitter.txt_twitter_on); + $container_tw.find('img.tweet_this_dummy').replaceWith(twitter_code); + } else { + $container_tw.removeClass('info_off'); + $container_tw.find('span.switch').addClass('off').removeClass('on').html(options.services.twitter.txt_twitter_off); + $container_tw.find('.tweet').html(twitter_dummy_btn); + } + }); + } + + // + // Google+ + // + if (gplus_on) { + // fuer G+ wird die URL nicht encoded, da das zu einem Fehler fuehrt + var gplus_uri = uri + options.services.gplus.referrer_track; + + // we use the Google+ "asynchronous" code, standard code is flaky if inserted into dom after load + var gplus_code = '<div class="g-plusone" data-size="medium" data-href="' + gplus_uri + '"></div><script type="text/javascript">window.___gcfg = {lang: "' + options.services.gplus.language + '"}; (function() { var po = document.createElement("script"); po.type = "text/javascript"; po.async = true; po.src = "https://apis.google.com/js/plusone.js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s); })(); </script>'; + var gplus_dummy_btn = '<img src="' + options.services.gplus.dummy_img + '" alt=""Google+1"-Dummy" class="gplus_one_dummy" />'; + + context.append('<li class="gplus help_info"><span class="info">' + options.services.gplus.txt_info + '</span><span class="switch off">' + options.services.gplus.txt_gplus_off + '</span><div class="gplusone dummy_btn">' + gplus_dummy_btn + '</div></li>'); + + var $container_gplus = $('li.gplus', context); + + $('li.gplus div.gplusone img,li.gplus span.switch', context).live('click', function () { + if ($container_gplus.find('span.switch').hasClass('off')) { + $container_gplus.addClass('info_off'); + $container_gplus.find('span.switch').addClass('on').removeClass('off').html(options.services.gplus.txt_gplus_on); + $container_gplus.find('img.gplus_one_dummy').replaceWith(gplus_code); + } else { + $container_gplus.removeClass('info_off'); + $container_gplus.find('span.switch').addClass('off').removeClass('on').html(options.services.gplus.txt_gplus_off); + $container_gplus.find('.gplusone').html(gplus_dummy_btn); + } + }); + } + + // + // Der Info/Settings-Bereich wird eingebunden + // + context.append('<li class="settings_info"><div class="settings_info_menu off perma_option_off"><a href="' + options.info_link + '"><span class="help_info icon"><span class="info">' + options.txt_help + '</span></span></a></div></li>'); + + // Info-Overlays mit leichter Verzoegerung einblenden + $('.help_info:not(.info_off)', context).live('mouseenter', function () { + var $info_wrapper = $(this); + var timeout_id = window.setTimeout(function () { $($info_wrapper).addClass('display'); }, 500); + $(this).data('timeout_id', timeout_id); + }); + $('.help_info', context).live('mouseleave', function () { + var timeout_id = $(this).data('timeout_id'); + window.clearTimeout(timeout_id); + if ($(this).hasClass('display')) { + $(this).removeClass('display'); + } + }); + + var facebook_perma = (options.services.facebook.perma_option === 'on'); + var twitter_perma = (options.services.twitter.perma_option === 'on'); + var gplus_perma = (options.services.gplus.perma_option === 'on'); + + // Menue zum dauerhaften Einblenden der aktiven Dienste via Cookie einbinden + // Die IE7 wird hier ausgenommen, da er kein JSON kann und die Cookies hier ueber JSON-Struktur abgebildet werden + if (((facebook_on && facebook_perma) + || (twitter_on && twitter_perma) + || (gplus_on && gplus_perma)) + && (!$.browser.msie || ($.browser.msie && $.browser.version > 7.0))) { + + // Cookies abrufen + var cookie_list = document.cookie.split(';'); + var cookies = '{'; + var i = 0; + for (; i < cookie_list.length; i += 1) { + var foo = cookie_list[i].split('='); + cookies += '"' + $.trim(foo[0]) + '":"' + $.trim(foo[1]) + '"'; + if (i < cookie_list.length - 1) { + cookies += ','; + } + } + cookies += '}'; + cookies = JSON.parse(cookies); + + // Container definieren + var $container_settings_info = $('li.settings_info', context); + + // Klasse entfernen, die das i-Icon alleine formatiert, da Perma-Optionen eingeblendet werden + $container_settings_info.find('.settings_info_menu').removeClass('perma_option_off'); + + // Perma-Optionen-Icon (.settings) und Formular (noch versteckt) einbinden + $container_settings_info.find('.settings_info_menu').append('<span class="settings">Einstellungen</span><form><fieldset><legend>' + options.settings_perma + '</legend></fieldset></form>'); + + + // Die Dienste mit <input> und <label>, sowie checked-Status laut Cookie, schreiben + var checked = ' checked="checked"'; + if (facebook_on && facebook_perma) { + var perma_status_facebook = cookies.socialSharePrivacy_facebook === 'perma_on' ? checked : ''; + $container_settings_info.find('form fieldset').append( + '<input type="checkbox" name="perma_status_facebook" id="perma_status_facebook"' + + perma_status_facebook + ' /><label for="perma_status_facebook">' + + options.services.facebook.display_name + '</label>' + ); + } + + if (twitter_on && twitter_perma) { + var perma_status_twitter = cookies.socialSharePrivacy_twitter === 'perma_on' ? checked : ''; + $container_settings_info.find('form fieldset').append( + '<input type="checkbox" name="perma_status_twitter" id="perma_status_twitter"' + + perma_status_twitter + ' /><label for="perma_status_twitter">' + + options.services.twitter.display_name + '</label>' + ); + } + + if (gplus_on && gplus_perma) { + var perma_status_gplus = cookies.socialSharePrivacy_gplus === 'perma_on' ? checked : ''; + $container_settings_info.find('form fieldset').append( + '<input type="checkbox" name="perma_status_gplus" id="perma_status_gplus"' + + perma_status_gplus + ' /><label for="perma_status_gplus">' + + options.services.gplus.display_name + '</label>' + ); + } + + // Cursor auf Pointer setzen fuer das Zahnrad + $container_settings_info.find('span.settings').css('cursor', 'pointer'); + + // Einstellungs-Menue bei mouseover ein-/ausblenden + $($container_settings_info.find('span.settings'), context).live('mouseenter', function () { + var timeout_id = window.setTimeout(function () { $container_settings_info.find('.settings_info_menu').removeClass('off').addClass('on'); }, 500); + $(this).data('timeout_id', timeout_id); + }); + $($container_settings_info, context).live('mouseleave', function () { + var timeout_id = $(this).data('timeout_id'); + window.clearTimeout(timeout_id); + $container_settings_info.find('.settings_info_menu').removeClass('on').addClass('off'); + }); + + // Klick-Interaktion auf <input> um Dienste dauerhaft ein- oder auszuschalten (Cookie wird gesetzt oder geloescht) + $($container_settings_info.find('fieldset input')).live('click', function (event) { + var click = event.target.id; + var service = click.substr(click.lastIndexOf('_') + 1, click.length); + var cookie_name = 'socialSharePrivacy_' + service; + + if ($('#' + event.target.id + ':checked').length) { + cookieSet(cookie_name, 'perma_on', options.cookie_expires, options.cookie_path, options.cookie_domain); + $('form fieldset label[for=' + click + ']', context).addClass('checked'); + } else { + cookieDel(cookie_name, 'perma_on', options.cookie_path, options.cookie_domain); + $('form fieldset label[for=' + click + ']', context).removeClass('checked'); + } + }); + + // Dienste automatisch einbinden, wenn entsprechendes Cookie vorhanden ist + if (facebook_on && facebook_perma && cookies.socialSharePrivacy_facebook === 'perma_on') { + $('li.facebook span.switch', context).click(); + } + if (twitter_on && twitter_perma && cookies.socialSharePrivacy_twitter === 'perma_on') { + $('li.twitter span.switch', context).click(); + } + if (gplus_on && gplus_perma && cookies.socialSharePrivacy_gplus === 'perma_on') { + $('li.gplus span.switch', context).click(); + } + } + }); // this.each(function () + }; // $.fn.socialSharePrivacy = function (settings) { +}(jQuery)); + diff --git a/socialshareprivacy/jquery.socialshareprivacy.min.js b/socialshareprivacy/jquery.socialshareprivacy.min.js new file mode 100644 index 0000000..eba59b7 --- /dev/null +++ b/socialshareprivacy/jquery.socialshareprivacy.min.js @@ -0,0 +1,33 @@ +/* + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * http://www.heise.de/extras/socialshareprivacy/ + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html + * + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Spread the word, link to us if you can. + */ +(function(b){function x(b,a){var f=decodeURIComponent(b);if(f.length<=a)return b;var j=f.substring(0,a-1).lastIndexOf(" ");return f=encodeURIComponent(f.substring(0,j))+"\u2026"}function p(c){return b('meta[name="'+c+'"]').attr("content")||""}function r(){var c=p("DC.title"),a=p("DC.creator");c.length>0&&a.length>0?c+=" - "+a:c=b("title").text();return encodeURIComponent(c)}function s(){var c=document.location.href,a=b("link[rel=canonical]").attr("href");a&&a.length>0&&(a.indexOf("http")<0&&(a=document.location.protocol+ +"//"+document.location.host+a),c=a);return c}b.fn.socialSharePrivacy=function(c){var a=b.extend(!0,{services:{facebook:{status:"on",dummy_img:"socialshareprivacy/images/dummy_facebook.png",txt_info:"2 Klicks für mehr Datenschutz: Erst wenn Sie hier klicken, wird der Button aktiv und Sie können Ihre Empfehlung an Facebook senden. Schon beim Aktivieren werden Daten an Dritte übertragen – siehe <em>i</em>.",txt_fb_off:"nicht mit Facebook verbunden",txt_fb_on:"mit Facebook verbunden", +perma_option:"on",display_name:"Facebook",referrer_track:"",language:"de_DE",action:"recommend"},twitter:{status:"on",dummy_img:"socialshareprivacy/images/dummy_twitter.png",txt_info:"2 Klicks für mehr Datenschutz: Erst wenn Sie hier klicken, wird der Button aktiv und Sie können Ihre Empfehlung an Twitter senden. Schon beim Aktivieren werden Daten an Dritte übertragen – siehe <em>i</em>.",txt_twitter_off:"nicht mit Twitter verbunden",txt_twitter_on:"mit Twitter verbunden",perma_option:"on", +display_name:"Twitter",referrer_track:"",tweet_text:r,language:"en"},gplus:{status:"on",dummy_img:"socialshareprivacy/images/dummy_gplus.png",txt_info:"2 Klicks für mehr Datenschutz: Erst wenn Sie hier klicken, wird der Button aktiv und Sie können Ihre Empfehlung an Google+ senden. Schon beim Aktivieren werden Daten an Dritte übertragen – siehe <em>i</em>.",txt_gplus_off:"nicht mit Google+ verbunden",txt_gplus_on:"mit Google+ verbunden",perma_option:"on",display_name:"Google+", +referrer_track:"",language:"de"}},info_link:"http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html",txt_help:"Wenn Sie diese Felder durch einen Klick aktivieren, werden Informationen an Facebook, Twitter oder Google in die USA übertragen und unter Umständen auch dort gespeichert. Näheres erfahren Sie durch einen Klick auf das <em>i</em>.",settings_perma:"Dauerhaft aktivieren und Datenüber­tragung zustimmen:",cookie_path:"/",cookie_domain:document.location.host, +cookie_expires:"365",css_path:"socialshareprivacy/socialshareprivacy.css",uri:s},c),f=a.services.facebook.status==="on",j=a.services.twitter.status==="on",n=a.services.gplus.status==="on";if(f||j||n)return a.css_path.length>0&&(document.createStyleSheet?document.createStyleSheet(a.css_path):b("head").append('<link rel="stylesheet" type="text/css" href="'+a.css_path+'" />')),this.each(function(){b(this).prepend('<ul class="social_share_privacy_area"></ul>');var d=b(".social_share_privacy_area",this), +c=a.uri;typeof c==="function"&&(c=c(d));if(f){var g=encodeURIComponent(c+a.services.facebook.referrer_track),p='<iframe src="http://www.facebook.com/plugins/like.php?locale='+a.services.facebook.language+"&href="+g+"&send=false&layout=button_count&width=120&show_faces=false&action="+a.services.facebook.action+'&colorscheme=light&font&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:145px; height:21px;" allowTransparency="true"></iframe>', +t='<img src="'+a.services.facebook.dummy_img+'" alt="Facebook "Like"-Dummy" class="fb_like_privacy_dummy" />';d.append('<li class="facebook help_info"><span class="info">'+a.services.facebook.txt_info+'</span><span class="switch off">'+a.services.facebook.txt_fb_off+'</span><div class="fb_like dummy_btn">'+t+"</div></li>");var k=b("li.facebook",d);b("li.facebook div.fb_like img.fb_like_privacy_dummy,li.facebook span.switch",d).live("click",function(){k.find("span.switch").hasClass("off")? +(k.addClass("info_off"),k.find("span.switch").addClass("on").removeClass("off").html(a.services.facebook.txt_fb_on),k.find("img.fb_like_privacy_dummy").replaceWith(p)):(k.removeClass("info_off"),k.find("span.switch").addClass("off").removeClass("on").html(a.services.facebook.txt_fb_off),k.find(".fb_like").html(t))})}if(j){g=a.services.twitter.tweet_text;typeof g==="function"&&(g=g());var g=x(g,"120"),o=encodeURIComponent(c+a.services.twitter.referrer_track),e=encodeURIComponent(c),r='<iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?url='+ +o+"&counturl="+e+"&text="+g+"&count=horizontal&lang="+a.services.twitter.language+'" style="width:130px; height:25px;"></iframe>',u='<img src="'+a.services.twitter.dummy_img+'" alt=""Tweet this"-Dummy" class="tweet_this_dummy" />';d.append('<li class="twitter help_info"><span class="info">'+a.services.twitter.txt_info+'</span><span class="switch off">'+a.services.twitter.txt_twitter_off+'</span><div class="tweet dummy_btn">'+u+"</div></li>");var l=b("li.twitter",d);b("li.twitter div.tweet img,li.twitter span.switch", +d).live("click",function(){l.find("span.switch").hasClass("off")?(l.addClass("info_off"),l.find("span.switch").addClass("on").removeClass("off").html(a.services.twitter.txt_twitter_on),l.find("img.tweet_this_dummy").replaceWith(r)):(l.removeClass("info_off"),l.find("span.switch").addClass("off").removeClass("on").html(a.services.twitter.txt_twitter_off),l.find(".tweet").html(u))})}if(n){var s='<div class="g-plusone" data-size="medium" data-href="'+(c+a.services.gplus.referrer_track)+'"></div><script type="text/javascript">window.___gcfg = {lang: "'+ +a.services.gplus.language+'"}; (function() { var po = document.createElement("script"); po.type = "text/javascript"; po.async = true; po.src = "https://apis.google.com/js/plusone.js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s); })(); <\/script>',v='<img src="'+a.services.gplus.dummy_img+'" alt=""Google+1"-Dummy" class="gplus_one_dummy" />';d.append('<li class="gplus help_info"><span class="info">'+a.services.gplus.txt_info+'</span><span class="switch off">'+ +a.services.gplus.txt_gplus_off+'</span><div class="gplusone dummy_btn">'+v+"</div></li>");var m=b("li.gplus",d);b("li.gplus div.gplusone img,li.gplus span.switch",d).live("click",function(){m.find("span.switch").hasClass("off")?(m.addClass("info_off"),m.find("span.switch").addClass("on").removeClass("off").html(a.services.gplus.txt_gplus_on),m.find("img.gplus_one_dummy").replaceWith(s)):(m.removeClass("info_off"),m.find("span.switch").addClass("off").removeClass("on").html(a.services.gplus.txt_gplus_off), +m.find(".gplusone").html(v))})}d.append('<li class="settings_info"><div class="settings_info_menu off perma_option_off"><a href="'+a.info_link+'"><span class="help_info icon"><span class="info">'+a.txt_help+"</span></span></a></div></li>");b(".help_info:not(.info_off)",d).live("mouseenter",function(){var a=b(this),c=window.setTimeout(function(){b(a).addClass("display")},500);b(this).data("timeout_id",c)});b(".help_info",d).live("mouseleave",function(){var a=b(this).data("timeout_id");window.clearTimeout(a); +b(this).hasClass("display")&&b(this).removeClass("display")});c=a.services.facebook.perma_option==="on";g=a.services.twitter.perma_option==="on";o=a.services.gplus.perma_option==="on";if((f&&c||j&&g||n&&o)&&(!b.browser.msie||b.browser.msie&&b.browser.version>7)){for(var i=document.cookie.split(";"),e="{",q=0;q<i.length;q+=1){var w=i[q].split("=");e+='"'+b.trim(w[0])+'":"'+b.trim(w[1])+'"';q<i.length-1&&(e+=",")}e+="}";var e=JSON.parse(e),h=b("li.settings_info",d);h.find(".settings_info_menu").removeClass("perma_option_off"); +h.find(".settings_info_menu").append('<span class="settings">Einstellungen</span><form><fieldset><legend>'+a.settings_perma+"</legend></fieldset></form>");f&&c&&(i=e.socialSharePrivacy_facebook==="perma_on"?' checked="checked"':"",h.find("form fieldset").append('<input type="checkbox" name="perma_status_facebook" id="perma_status_facebook"'+i+' /><label for="perma_status_facebook">'+a.services.facebook.display_name+"</label>"));j&&g&&(i=e.socialSharePrivacy_twitter==="perma_on"?' checked="checked"': +"",h.find("form fieldset").append('<input type="checkbox" name="perma_status_twitter" id="perma_status_twitter"'+i+' /><label for="perma_status_twitter">'+a.services.twitter.display_name+"</label>"));n&&o&&(i=e.socialSharePrivacy_gplus==="perma_on"?' checked="checked"':"",h.find("form fieldset").append('<input type="checkbox" name="perma_status_gplus" id="perma_status_gplus"'+i+' /><label for="perma_status_gplus">'+a.services.gplus.display_name+"</label>"));h.find("span.settings").css("cursor","pointer"); +b(h.find("span.settings"),d).live("mouseenter",function(){var a=window.setTimeout(function(){h.find(".settings_info_menu").removeClass("off").addClass("on")},500);b(this).data("timeout_id",a)});b(h,d).live("mouseleave",function(){var a=b(this).data("timeout_id");window.clearTimeout(a);h.find(".settings_info_menu").removeClass("on").addClass("off")});b(h.find("fieldset input")).live("click",function(c){var e=c.target.id,g="socialSharePrivacy_"+e.substr(e.lastIndexOf("_")+1,e.length);if(b("#"+c.target.id+ +":checked").length){var c=a.cookie_expires,h=a.cookie_path,f=a.cookie_domain,i=new Date;i.setTime(i.getTime()+c*864E5);document.cookie=g+"=perma_on; expires="+i.toUTCString()+"; path="+h+"; domain="+f;b("form fieldset label[for="+e+"]",d).addClass("checked")}else c=a.cookie_path,h=a.cookie_domain,f=new Date,f.setTime(f.getTime()-100),document.cookie=g+"=perma_on; expires="+f.toUTCString()+"; path="+c+"; domain="+h,b("form fieldset label[for="+e+"]",d).removeClass("checked")});f&&c&&e.socialSharePrivacy_facebook=== +"perma_on"&&b("li.facebook span.switch",d).click();j&&g&&e.socialSharePrivacy_twitter==="perma_on"&&b("li.twitter span.switch",d).click();n&&o&&e.socialSharePrivacy_gplus==="perma_on"&&b("li.gplus span.switch",d).click()}})}})(jQuery); diff --git a/socialshareprivacy/socialshareprivacy/images/2-klick-logo.jpg b/socialshareprivacy/socialshareprivacy/images/2-klick-logo.jpg new file mode 100644 index 0000000..a6d0c71 Binary files /dev/null and b/socialshareprivacy/socialshareprivacy/images/2-klick-logo.jpg differ diff --git a/socialshareprivacy/socialshareprivacy/images/dummy_facebook.png b/socialshareprivacy/socialshareprivacy/images/dummy_facebook.png new file mode 100644 index 0000000..3e5b651 Binary files /dev/null and b/socialshareprivacy/socialshareprivacy/images/dummy_facebook.png differ diff --git a/socialshareprivacy/socialshareprivacy/images/dummy_facebook_en.png b/socialshareprivacy/socialshareprivacy/images/dummy_facebook_en.png new file mode 100644 index 0000000..ec8344c Binary files /dev/null and b/socialshareprivacy/socialshareprivacy/images/dummy_facebook_en.png differ diff --git a/socialshareprivacy/socialshareprivacy/images/dummy_gplus.png b/socialshareprivacy/socialshareprivacy/images/dummy_gplus.png new file mode 100644 index 0000000..504dca7 Binary files /dev/null and b/socialshareprivacy/socialshareprivacy/images/dummy_gplus.png differ diff --git a/socialshareprivacy/socialshareprivacy/images/dummy_twitter.png b/socialshareprivacy/socialshareprivacy/images/dummy_twitter.png new file mode 100644 index 0000000..bfca32d Binary files /dev/null and b/socialshareprivacy/socialshareprivacy/images/dummy_twitter.png differ diff --git a/socialshareprivacy/socialshareprivacy/images/settings.png b/socialshareprivacy/socialshareprivacy/images/settings.png new file mode 100644 index 0000000..3016b7b Binary files /dev/null and b/socialshareprivacy/socialshareprivacy/images/settings.png differ diff --git a/socialshareprivacy/socialshareprivacy/images/socialshareprivacy_info.png b/socialshareprivacy/socialshareprivacy/images/socialshareprivacy_info.png new file mode 100644 index 0000000..6d70570 Binary files /dev/null and b/socialshareprivacy/socialshareprivacy/images/socialshareprivacy_info.png differ diff --git a/socialshareprivacy/socialshareprivacy/images/socialshareprivacy_on_off.png b/socialshareprivacy/socialshareprivacy/images/socialshareprivacy_on_off.png new file mode 100644 index 0000000..8e9e725 Binary files /dev/null and b/socialshareprivacy/socialshareprivacy/images/socialshareprivacy_on_off.png differ diff --git a/socialshareprivacy/socialshareprivacy/socialshareprivacy.css b/socialshareprivacy/socialshareprivacy/socialshareprivacy.css new file mode 100644 index 0000000..b401bdb --- /dev/null +++ b/socialshareprivacy/socialshareprivacy/socialshareprivacy.css @@ -0,0 +1,226 @@ +.social_share_privacy_area { + clear: both; + margin: 20px 0 !important; + list-style-type: none; + padding: 0 !important; + width: auto; + height: 25px; + display: block; +} +.social_share_privacy_area li { + margin: 0 !important; + padding: 0 !important; + height: 21px; + float: left; +} +.social_share_privacy_area li .dummy_btn { + float: left; + margin: 0 0 0 10px; + cursor: pointer; + padding: 0; + height: inherit; +} +.social_share_privacy_area li div iframe { + overflow: hidden; + height: inherit; + width: inherit; +} +/* Facebook begin */ +.social_share_privacy_area .facebook { + width: 180px; + display: inline-block; +} +.social_share_privacy_area .facebook .fb_like iframe { + width: 145px; +} +/* Facebook end */ +/* Twitter begin */ +.social_share_privacy_area .twitter { + width: 148px; +} +.social_share_privacy_area li div.tweet { + width: 115px; +} +/* Twitter end */ +/* Google+ begin */ +.social_share_privacy_area .gplus { + width: 123px; +} +.social_share_privacy_area li div.gplusone { + width: 90px; +} +/* Google+ end */ +/* Switch begin */ +.social_share_privacy_area li .switch { + display: inline-block; + text-indent: -9999em; + background: transparent url(images/socialshareprivacy_on_off.png) no-repeat 0 0 scroll; + width: 23px; + height: 12px; + overflow: hidden; + float: left; + margin: 4px 0 0; + padding: 0; + cursor: pointer; +} +.social_share_privacy_area li .switch.on { + background-position: 0 -12px; +} +/* Switch end */ +/* Tooltips begin */ +.social_share_privacy_area li.help_info { + position: relative; +} +.social_share_privacy_area li.help_info .info, +.social_share_privacy_area li .help_info.icon .info { + display: none; + position: absolute; + bottom: 40px; + left: 0; + width: 290px; + padding: 10px 15px; + margin: 0; + font-size: 12px; + line-height: 16px; + font-weight: bold; + border: 1px solid #ccc; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: 0 3px 4px #999; + -webkit-box-shadow: 0 3px 4px #999; + box-shadow: 0 3px 4px #999; + background-color: #fdfbec; + color: #000; + z-index: 500; +} +.social_share_privacy_area li.gplus.help_info .info { + left: -60px; +} +.social_share_privacy_area li .help_info.icon .info { + left: -243px; + width: 350px; +} +.social_share_privacy_area li.help_info.display .info, +.social_share_privacy_area li .help_info.icon.display .info { + display: block; +} +.social_share_privacy_area li.help_info.info_off.display .info { + display: none; +} +.social_share_privacy_area li .help_info.icon { + background: #fff url(images/socialshareprivacy_info.png) no-repeat center center scroll; + width: 25px; + height: 20px; + position: relative; + display: inline-block; + vertical-align: top; + border: 2px solid #e7e3e3; + border-right-width: 0; + -moz-border-radius: 5px 0 0 5px; + -webkit-border-radius: 5px 0 0 5px; + border-radius: 5px 0 0 5px; + margin: 0; + padding: 0; +} +.social_share_privacy_area li.settings_info .settings_info_menu.on .help_info.icon { + border-top-width: 0; + border-left-width: 0; +} +.social_share_privacy_area li.settings_info .settings_info_menu.perma_option_off .help_info.icon { + border-right-width: 2px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} +/* Tooltips end */ +/* Settings/Info begin */ +.social_share_privacy_area li.settings_info { + position: relative; + top: -2px; +} +.social_share_privacy_area li.settings_info a { + text-decoration: none; + margin: 0 !important; +} +.social_share_privacy_area li.settings_info .settings_info_menu { + background-color: #f3f4f5; + border: 2px solid #e7e3e3; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + -moz-box-shadow: 2px 2px 3px #c1c1c1; + -webkit-box-shadow: 2px 2px 3px #c1c1c1; + box-shadow: 3px 3px 3px #c1c1c1; + left: 0; + position: absolute; + top: 0; + width: 135px; + z-index: 1000; + margin: 0; + padding: 0; +} +.social_share_privacy_area li.settings_info .settings_info_menu.off { + border-width: 0; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; + background-color: transparent; +} +.social_share_privacy_area li.settings_info .settings_info_menu.off form { + display: none; + margin: 0; + padding: 0; +} +.social_share_privacy_area li.settings_info .settings_info_menu .settings { + text-indent: -9999em; + display: inline-block; + background: #fff url(images/settings.png) no-repeat center center scroll; + width: 25px; + height: 20px; + border: 2px solid #e7e3e3; + -moz-border-radius: 0 5px 5px 0; + -webkit-border-radius: 0 5px 5px 0; + border-radius: 0 5px 5px 0; + border-left: 1px solid #ddd; + margin: 0; + padding: 0; +} +.social_share_privacy_area li.settings_info .settings_info_menu.on .settings { + border-top-width: 0; +} +.social_share_privacy_area li.settings_info .settings_info_menu form fieldset { + border-width: 0; + margin: 0; + padding: 0 10px 10px; +} +.social_share_privacy_area li.settings_info .settings_info_menu form fieldset legend { + font-size: 11px; + font-weight: bold; + line-height: 14px; + margin: 0; + padding: 10px 0; + width: 115px; +} +.social_share_privacy_area li.settings_info .settings_info_menu form fieldset input { + clear: both; + float: left; + margin: 4px 10px 4px 0; + padding: 0; +} +.social_share_privacy_area li.settings_info .settings_info_menu form fieldset label { + display: inline-block; + float: left; + font-size: 12px; + font-weight: bold; + line-height: 24px; + -moz-transition: color .5s ease-in; + -webkit-transition: color .5s ease-in; + transition: color .5s ease-in; + margin: 0; + padding: 0; +} +.social_share_privacy_area li.settings_info .settings_info_menu form fieldset label.checked { + color: #090; +} +/* Settings/Info end */ \ No newline at end of file diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..6f9a0d4 --- /dev/null +++ b/styles.css @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2001 Kai Blaschke <webmaster@thw-theorie.de> + * + * The included "THW Thema" templates, logos and the Q&A catalog are protected + * by copyright laws, and must not be used without the written permission + * of the + * + * Bundesanstalt Technisches Hilfswerk + * Provinzialstrae 93 + * D-53127 Bonn + * Germany + * E-Mail: redaktion@thw.de + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +html, body { height: 100%; } +body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 100%; margin: 0px; padding: 0px;background-color: white; color: black; background-image:url(img/bg.gif); background-color: transparent; background-position: top left; background-repeat: repeat-y; display: block; } +img { border: none; } +acronym { border-bottom: 1px dashed #00F; cursor: help; } +.contentspalte a { text-decoration:underline; color:#000000;} +.contentspalte a:hover { text-decoration:underline; color:#3A428C;} +.korrekt { background-color: transparent; color: #008000; } +.falsch { background-color: transparent; color: #800000; } +.fragebkg { background-color: #A0A0A0; color: white; max-width: 1000px; width:100%; margin-bottom: 1em; margin-top: 1em; } +.fragebkg tr td { background-color: white; color: black; } +.fragebkg tr td.korrekt { background-color: white; color: #008000;} +.fragebkg tr td.falsch { background-color: white; color: #800000; } +.nav { font-size: 70%; margin-bottom: 40px; line-height: 1.4em; } +.nav ul { margin: 0px; padding: 0px; list-style-type: none; } +.nav li { margin: 0px; padding: 0px; } +.nav a { text-decoration: none; color: #fff; display: block; } +.nav a:hover { text-decoration: none; color: #fff; background-image: url('img/pfeil.gif'); background-repeat: no-repeat; background-position: top left; } +.nav ul a { background-color: #003399; border-bottom: 1px solid #001689; border-top: 1px solid #1443A1; width: 172px; padding: 4px 4px 4px 20px; } +.nav ul ul a { background-color: #436EB2; border-bottom: 1px solid #001689; border-top: 1px solid #6288BE; width: 164px; padding: 4px 4px 4px 28px; } +.nav ul ul ul a { background-color: #6288BE; border-bottom: 1px solid #001689; border-top: 1px solid #85A4CC; width: 156px; padding: 4px 4px 4px 36px; } +ul#navlist li a#current { background-image: url('img/pfeil.gif'); background-repeat: no-repeat; background-position: top left; } +#service { font-size:70%; color:#000000; padding-right:12px; width:100%; height:20px; text-align:right;} +#service a { text-decoration:none; color:#000000; } +#service a:hover { text-decoration:underline; color:#000000; } +#breadcrumb { font-size:69%; color:#FFFFFF; background-color:#003399; padding-top:3px; padding-bottom:2px; padding-left:20px; } +#breadcrumb a { text-decoration:none; color:#FFFFFF; } +#breadcrumb a:hover { text-decoration:underline; } +table.layout { width:100%; } +table.layout td.randlinks { width:12px; height:20px; } +table.layout td.navspalte { background-color:#FFFFFF; width:196px; height:20px; } +table.layout td.navvor { border-bottom:solid 1px #001272; height:20px; } +table.identitaet { width:100%; } +table.identitaet td.thema { border-bottom:solid 1px #6288BE; width:360px; height:78px; } +table.identitaet td.logo { background-color:#003399; border-bottom:solid 1px #6288BE; width:100%; height:78px; text-align:right; } +.content { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:80%; padding-top:20px; padding-right:12px; padding-left:20px; width:100%; } +.contentspalte { padding-right:20px; padding-bottom:20px; width:100%; } +.contentspalte .rubrik { font-weight:normal; font-size:80%; color:#003399; border-top:solid 1px #003399; margin-bottom:2px; text-align:right; } +.contentspalte h1 { font-style:normal; font-size:125%; color:#000000; margin-top:0px; margin-bottom:13px; } +.contentspalte h2 { font-size:100%; color:#000000; margin-top:16px; margin-bottom:14px; font-weight: bold; } +.contentspalte h3 { font-style:normal; font-size:125%; color:#000000; margin-top:0px; margin-bottom:16px; } +.contentspalte p { margin-top:0px; margin-bottom:14px; padding-top:0px; line-height: 1.4em; } +.contentspalte .textblau { color:#003399; } +.contentspalte .seitenueberschrift { font-weight:bold; font-size:125%; color:#000000; border-bottom:solid 1px #003399; margin-bottom:11px; padding-bottom:2px; text-align:left; } +.contentspalte .caption { padding-top: 0px; padding-bottom: 8px;} +.contentspalte .autor { margin-left:1px; font-style: italic; } +.contentspalte .topspacer4px { margin-top:15px; } +.contentspalte ul { margin-top:0px; margin-bottom:13px; margin-left:24px; padding-top:0px; padding-bottom:0px; } +.contentspalte ul li { margin: 0; padding: 0px 0px 0px 6px;} +.contentspalte ol { margin-top:0px; margin-bottom:13px; margin-left:30px; padding-top:0px; padding-bottom:0px; } +.contentspalte ol li { margin: 0; padding: 0;} +.contentspalte ul.seitenanfang { border-bottom:1px solid #003399; list-style-type: none; margin: 24px 0px 16px 0px; padding: .5em 0 .5em 0px; clear: both;} +.contentspalte ul.seitenanfang li a { text-decoration:none; text-align:center; display: block; margin: 0; padding: 0;} +.contentspalte ul.seitenanfang .left { float: left; padding:0;} +.contentspalte ul.seitenanfang .right { float: right;} +.only-print { display: none } +.fragenr { font-size: 1.5em; font-weight: bold; margin-bottom: 0.5em } + +@media print { + html, body { font-size: 80%; } + td.randlinks, + td.navspalte, + .nav, + .navvor, + table.identitaet, + #breadcrumb, + #service, + ul.seitenanfang, + input, + .no-print { display: none; } + .only-print { display: initial } + + table.fragebkg { + page-break-inside: avoid; + margin-bottom: 0.5em; + margin-top: 0.5em; + max-width: none; + border-collapse: collapse; + } + table.fragebkg td { + border: 1px solid black; + } + + .korrekt, + .falsch, + .fragebkg tr td.korrekt, + .fragebkg tr td.falsch { color: black; } + + .print-checkbox { + width: 0.4cm; + height: 0.4cm; + border: 1px solid black; + } + + acronym { border-bottom: none; } + .contentspalte h1 { font-size: 2em; } +} \ No newline at end of file diff --git a/templates/aufloesung-abschnitte.tpl b/templates/aufloesung-abschnitte.tpl new file mode 100644 index 0000000..eb88e1c --- /dev/null +++ b/templates/aufloesung-abschnitte.tpl @@ -0,0 +1,14 @@ +<div class="rubrik"><span> </span></div> +<h1>Auflösungen</h1> +<p><b>Themenabschnitt wählen</b></p> +<p>Wählen Sie bitte einen Themenabschnitt, um die Fragen in diesem Abschnitt +inklusive Auflösungen anzeigen zu lassen.</p> + +<table cellspacing="5" cellpadding="2" border="0"> +{|Abschnitte}{|Abschnitte*Row} + <tr> + <td valign="top" align="right">{abschnittNr}.</td> + <td valign="top"><a href="loesung/abschnitt-{abschnittNr}.html">{abschnittName}</a></td> + </tr> +{|Abschnitte*Row}{|Abschnitte} +</table> \ No newline at end of file diff --git a/templates/aufloesung-antworten.tpl b/templates/aufloesung-antworten.tpl new file mode 100644 index 0000000..6762dd2 --- /dev/null +++ b/templates/aufloesung-antworten.tpl @@ -0,0 +1,45 @@ +<div class="rubrik"><span> </span></div> +<h1>Auflösungen</h1> +<p class="no-print">« <a href="{scriptName}?show=loesung" title="Zurück zur Auswahl">Zurück +zur Themenabschnittsauswahl</a></p> +<p><b>{abschnittName}</b></p> + +{|Antworten} +{|Antworten*Row} +<table class="fragebkg" cellspacing="1" cellpadding="4" border="0" width="100%"> + <colgroup> + <col width="5%"> + <col width="30%"> + <col width="55%"> + <col width="5%"> + <col width="5%"> + </colgroup> + <tr> + <td rowspan="{rowCnt}" valign="top"><b>{abschnittNr}.{frageNr}</b></td> + <td rowspan="{rowCnt}" valign="top">{frageText}</td> + <td ><font class="{antwort1Status}">{Antwort1}</font></td> + <td align="center">A</td> + <td align="center">{|A1L}{|A1L*Haken}<img src="img/haken.gif" width="16" height="16" alt="X">{|A1L*Haken}{|A1L} </td> + </tr> + <tr> + <td><font class="{antwort2Status}">{Antwort2}</font></td> + <td align="center">B</td> + <td align="center">{|A2L}{|A2L*Haken}<img src="img/haken.gif" width="16" height="16" alt="X">{|A2L*Haken}{|A2L} </td> + </tr> +{|ThreeRows}{|ThreeRows*Row} + <tr> + <td><font class="{antwort3Status}">{Antwort3}</font></td> + <td align="center">C</td> + <td align="center">{|A3L}{|A3L*Haken}<img src="img/haken.gif" width="16" height="16" alt="X">{|A3L*Haken}{|A3L} </td> + </tr> +{|ThreeRows*Row}{|ThreeRows} +</table> +{|Antworten*Row} +{|Antworten*Topline} +<ul class="seitenanfang"> +<li class="left"> </li> +<li class="right"><a href="#top" title="Nach Oben" alt="Nach Oben"> +<img src="img/oben.gif" alt="Oben" border="0" title="Oben"/></a></li> +</ul> +{|Antworten*Topline} +{|Antworten} \ No newline at end of file diff --git a/templates/aufloesung-error.tpl b/templates/aufloesung-error.tpl new file mode 100644 index 0000000..1236f1b --- /dev/null +++ b/templates/aufloesung-error.tpl @@ -0,0 +1,10 @@ +<div class="rubrik"><span> </span></div> +<h1>Auflösungen</h1> +<h2>Auflösungen anzeigen?</h2> +<p>Sie sind gerade dabei, Zufallsfragen oder einen Prüfbogen zu beantworten. Um die Auflösungen +anzuzeigen, müssen Sie die Prüfungen zuerst beenden. Klicken Sie auf "Auflösungen anzeigen", +um den aktuellen Fragenkatalog bzw. den aktuellen Prüfbogen zu löschen. Sie können nach +dem Einsehen der Auflösungen eine neue Prüfung beginnen.</p> +<p align="center"><input type="button" +onClick="location.href='{scriptName}?show=loesung&clear=1';" +value="Auflösungen anzeigen"></p> \ No newline at end of file diff --git a/templates/barrierefreiheit.tpl b/templates/barrierefreiheit.tpl new file mode 100644 index 0000000..49eba80 --- /dev/null +++ b/templates/barrierefreiheit.tpl @@ -0,0 +1,42 @@ +<div class="rubrik"><span> </span></div> +<h1>Barrierfreier Zugang</h1> +<h2>Zugangshilfe für Besucher mit Rot-Grün-Sehschwäche</h2> + +<p>Um allen Besuchern dieser Seite die Möglichkeit zu geben, die Theoriefragen zu +erlernen, gibt es die Möglichkeit, auf einen alternativen Seitenstil zu wechseln, +der richtige und falsche Antworten mit einem höheren Farbkontrast, sowie helfenden +Symbolen darstellt.</p> +<p>Um diese Funktion nutzen zu können, klicken Sie bitte auf die Schaltfläche +mit dem gewünschten Seitenstil. Ein Beispiel, wie Auflösungen und Antworten +angezeigt werden, finden Sie darunter. Die Einstellung wird per Cookie in Ihrem +Browser gespeichert, so dass die Umschaltung nur einmal durchgeführt werden muss, +solange Sie den selben PC benutzen.</p> + +<form action="barrierefreiheit.html" method="post"> +<p> +<input type="submit" name="normal" value="Normaler Stil" /> +<input type="submit" name="barrierefrei" value="Kontrastreicher Stil" /> +</p> +</form> + +<table class="fragebkg" cellspacing="1" cellpadding="4" border="0" width="100%"> + <colgroup> + <col width="5%"> + <col width="30%"> + <col width="55%"> + <col width="5%"> + <col width="5%"> + </colgroup> + <tr> + <td rowspan="2" valign="top"><b>0.0</b></td> + <td rowspan="2" valign="top">Hier steht normalerweise der Fragetext</td> + <td ><font class="korrekt">Dies ist eine korrekte Antwort</font></td> + <td align="center">A</td> + <td align="center"><img src="img/haken.gif" width="16" height="16" alt="X"> </td> + </tr> + <tr> + <td><font class="falsch">Dies ist eine falsche Antwort</font></td> + <td align="center">B</td> + <td align="center"> </td> + </tr> +</table> diff --git a/templates/bogen-ende.tpl b/templates/bogen-ende.tpl new file mode 100644 index 0000000..0e7b01a --- /dev/null +++ b/templates/bogen-ende.tpl @@ -0,0 +1,105 @@ +<div class="rubrik"><span> </span></div> +<h1>Prüfungsbogen üben</h1> +<h2>Fragenbogen beantwortet</h2> +<p>Sie haben alle Fragen des Prüfungsbogens beantwortet. Hier sehen Sie nun + eine Zusammenfassung über richtig bzw. falsch beantwortete Fragen und ob + Sie mit der Fehlerquote die Prüfung bestanden hätten.</p> +<div height="10"></div> + +<form name="neu" action="{scriptName}?show=bogen" method="post"> +<input type="hidden" name="create" value="1" /> +</form> + +<table class="fragebkg" cellspacing="1" cellpadding="4" border="0" width="100%"> + <tr> + <td>Insgesamt beantwortete Fragen:</td> + <td><b>{anzFragen}</b></td> + </tr> + <tr> + <td>Benötigte Zeit:</td> + <td><b>{zeit}</b></td> + </tr> + <tr> + <td><font class="korrekt">Richtig beantwortete Fragen:</font></td> + <td><b>{fragenRichtig}</b></td> + </tr> + <tr> + <td style="padding-left: 20px">Prozentualer Anteil:</td> + <td><b>{fragenRichtigQuote}</b></td> + </tr> + <tr> + <td><font class="falsch">Falsch beantwortete Fragen:</font></td> + <td><b>{fragenFalsch}</b></td> + </tr> + <tr> + <td style="padding-left: 20px">Prozentualer Anteil:</td> + <td><b>{fragenFalschQuote}</b></td> + </tr> + <tr> + <td colspan="2" align="center">Mit dieser Fehlerqoute hätten Sie die Prüfung + {|Bestanden}{|Bestanden*Ja}<font class="korrekt">bestanden</font>{|Bestanden*Ja}{|Bestanden*Nein}<font class="falsch">nicht bestanden</font>{|Bestanden*Nein}{|Bestanden}.</td> + </tr> +</table> +<table cellspacing="0" cellpadding="4" border="0"> + <tr> + <td align="center"><input type="button" value="Neuer Fragenbogen" onClick="neu.submit();" /></td> + </tr> +</table> + +<div> </div> + +<h2>Auflösung</h2> +<p>Hier sehen Sie nocheinmal sämtliche Fragen aufgeführt. Die +farblichen Kennzeichnungen entsprechen den richtigen bzw. falschen Antworten. +Die Häkchen dahinter entsprechen Ihren Antworten. So können Sie +schnell und übersichtlich vergleichen, wo Sie Fehler gemacht haben und +noch üben müssen.</p> +<p>Die mit <img src="img/richtig.gif" width="20" height="20" alt="Richtig" /> +gekennzeichneten Fragen haben Sie korrekt beantwortet, die mit +<img src="img/falsch.gif" width="20" height="20" alt="Falsch" /> +gekennzeichneten haben Sie falsch beantwortet.</p> + +{|Aufloesung} +{|Aufloesung*Antwort} +<div> </div> +<table class="fragebkg" cellspacing="1" cellpadding="4" border="0" width="100%"> + <colgroup> + <col width="5%"> + <col width="30%"> + <col width="55%"> + <col width="5%"> + <col width="5%"> + </colgroup> + <tr> + <td rowspan="{rowCnt}" valign="top"><b>{abschnittNr}.{frageNr}</b>{|BogenStatus} + {|BogenStatus*BR}<br /><br />{|BogenStatus*BR} + {|BogenStatus*Richtig}<img src="img/richtig.gif" width="20" height="20" alt="Richtig" />{|BogenStatus*Richtig} + {|BogenStatus*Falsch}<img src="img/falsch.gif" width="20" height="20" alt="Falsch" />{|BogenStatus*Falsch} + {|BogenStatus}</td> + <td rowspan="{rowCnt}" valign="top">{frageText}</td> + <td ><font class="{antwort1Status}">{Antwort1}</font></td> + <td align="center">A</td> + <td align="center">{|A1L}{|A1L*Haken}<img src="img/haken.gif" width="16" height="16" alt="X">{|A1L*Haken}{|A1L} </td> + </tr> + <tr> + <td><font class="{antwort2Status}">{Antwort2}</font></td> + <td align="center">B</td> + <td align="center">{|A2L}{|A2L*Haken}<img src="img/haken.gif" width="16" height="16" alt="X">{|A2L*Haken}{|A2L} </td> + </tr> +{|ThreeRows}{|ThreeRows*Row} + <tr> + <td><font class="{antwort3Status}">{Antwort3}</font></td> + <td align="center">C</td> + <td align="center">{|A3L}{|A3L*Haken}<img src="img/haken.gif" width="16" height="16" alt="X">{|A3L*Haken}{|A3L} </td> + </tr> +{|ThreeRows*Row}{|ThreeRows} +</table> +{|Aufloesung*Antwort} +{|Aufloesung*Topline} +<ul id="seitenanfang"> +<li class="left"> </li> +<li class="right"><a href="#top" title="Nach Oben" alt="Nach Oben"> +<img src="img/oben.gif" alt="Oben" border="0" title="Oben"/></a></li> +</ul> +{|Aufloesung*Topline} +{|Aufloesung} \ No newline at end of file diff --git a/templates/bogen-fragen.tpl b/templates/bogen-fragen.tpl new file mode 100644 index 0000000..d7806d3 --- /dev/null +++ b/templates/bogen-fragen.tpl @@ -0,0 +1,61 @@ +<h1>Prüfungsbogen üben</h1> +<p><strong>Beantworten Sie alle 40 Fragen innerhalb der Prüfungszeit.</strong></p> +<p class="no-print">Sie haben mit diesem Fragebogen um {zeit} Uhr begonnen.</p> + +<form name="neu" action="{scriptName}" method="post"> +<input type="hidden" name="show" value="bogen" /> +<input type="hidden" name="create" value="1" /> +</form> + +<form action="{scriptName}" method="post"> +<input type="hidden" name="show" value="bogen" /> + +{|Bogen} +{|Bogen*Frage} +<table class="fragebkg" cellspacing="1" cellpadding="4"> + <colgroup> + <col width="7%"> + <col width="30%"> + <col width="55%"> + <col width="4%"> + <col width="4%"> + </colgroup> + <tr> + <td rowspan="{rowCnt}" valign="top"><div class="fragenr only-print">{frageIndex}</div><span class="no-print" style="font-weight:bold">{abschnittNr}.{frageNr}</span></td> + <td rowspan="{rowCnt}" valign="top">{frageText}</td> + <td>{Antwort1}</td> + <td align="center">A</td> + <td align="center"><input type="checkbox" name="antwort[{frageID}][1]" value="1" /><div class="print-checkbox"></div></td> + </tr> + <tr> + <td>{Antwort2}</td> + <td align="center">B</td> + <td align="center"><input type="checkbox" name="antwort[{frageID}][2]" value="1" /><div class="print-checkbox"></div></td> + </tr> +{|ThreeRows}{|ThreeRows*Row} + <tr> + <td>{Antwort3}</td> + <td align="center">C</td> + <td align="center"><input type="checkbox" name="antwort[{frageID}][3]" value="1" /><div class="print-checkbox"></div></td> + </tr> +{|ThreeRows*Row}{|ThreeRows} +</table> +{|Bogen*Frage} +{|Bogen*Topline} +<ul class="seitenanfang"> +<li class="left"> </li> +<li class="right"><a href="#top" title="Nach Oben" alt="Nach Oben"> +<img src="img/oben.gif" alt="Oben" border="0" title="Oben"/></a></li> +</ul> +{|Bogen*Topline} +{|Bogen} + +<table cellspacing="0" cellpadding="4" border="0" width="100%"> + <tr> + <td align="left"><input type="button" value="Neuer Fragenbogen" onClick="neu.submit()"></td> + <td align="right"><input type="submit" value="Fertig"></td> + </tr> +</table> +</form> +<div class="only-print">Dieser THW-Prüfungsbogen wurde auf http://www.thw-theorie.de/ erstellt.<br/> +Stand des Fragenkatalogs: {catalogYear}</div> \ No newline at end of file diff --git a/templates/bogen-start.tpl b/templates/bogen-start.tpl new file mode 100644 index 0000000..dec60f7 --- /dev/null +++ b/templates/bogen-start.tpl @@ -0,0 +1,31 @@ +<div class="rubrik"><span> </span></div> +<h1>Prüfungsbogen üben</h1> +<h2>Einen vollständigen Prüfungsbogen beantworten</h2> +<p>In diesem Bereich können Sie sich einen vollständigen + Prüfungsbogen mit 40 Fragen erzeugen lassen, und diesen dann + bearbeiten. Weiterhin wird die Zeit gemessen, die Sie benötigt haben, + um den Bogen auszufüllen. Diese sollte möglichst unter 10 Minuten + liegen.</p> +<p>Alle 40 Fragen werden aus dem Curriculum "Grundausbildung der Helfer + des THW" entnommen. Es kommt auf dem Bogen zumindest eine Frage je + Lernabschnitt vor, die verbleibenden 29 werden aus den übrigen Fragen + zufällig ausgewählt, so dass das statistische Verhältnis + dem Verhältnis der Anzahl der Fragen in den jeweiligen Lernabschnitten + entspricht.</p> +<p>Bei den meisten Fragen stehen 3 Antworten zur Auswahl (bei wenigen nur 2). + Es ist mindestens eine Antwort anzukreuzen, bei einigen Fragen müssen + auch mehrere Antworten angekreuzt werden. Die Aufgabe gilt als richtig + gelöst, wenn <b>alle</b> zutreffenden Antworten angekreuzt sind.</p> +<p>Klicken Sie auf die Schaltfläche "Prüfungsbogen + erstellen", um sich einen neuen Bogen erstellen zu lassen.</p> + +<div> </div> +<form action="{scriptName}" method="post"> +<input type="hidden" name="show" value="bogen" /> +<input type="hidden" name="create" value="1" /> +<table cellspacing="4" cellpadding="2" border="0" width="100%"> + <tr> + <td align="center"><input type="submit" value="Prüfungsbogen erstellen" /></td> + </tr> +</table> +</form> \ No newline at end of file diff --git a/templates/datenschutz.tpl b/templates/datenschutz.tpl new file mode 100644 index 0000000..1018613 --- /dev/null +++ b/templates/datenschutz.tpl @@ -0,0 +1,45 @@ +<h1>Datenschutzhinweis</h1> + +<h2>Personenbezogene Daten</h2> +<p>Die Nutzung dieses Webangebots ist grundsätzlich ohne Bekanntgabe +personenbezogener Informationen möglich.<br/> +Wenn Sie uns eine E-Mail senden, so wird der Inhalt und Ihre E-Mail-Adresse +ausschließlich für die Korrespondenz mit Ihnen verwendet.</p> +<p>Die Website erhebt für die Dauer Ihres Besuchs statistische Daten, +die Sie über den Menüpunkt "Gesamtstatistik" anzeigen können. +Diese Daten werden automatisch gelöscht, wenn 30 Minuten kein Zugriff mit +der zugeordneten Sitzungs-ID erfolgt.</p> + +<h2>Nutzung von Cookies</h2> +<p>Cookies sind kleine Textfragmente, die in Ihrem Browser für eine +bestimmte Zeit gespeichert und mit jedem Seitenaufruf an den Server, +der die Cookies gesendet hat, zurückgesendet werden. Diese Website +verwendet Cookies mit folgenden Zwecken und Speicherzeiten:</p> +<ul> +<li>Eine eindeutige Sitzungs-ID, die Ihren Browser für die Zeit des +Seitenbesuchs eindeutig identifiziert. Diese ID wird verwendet, um +Ihre persönlichen Statistiken für diesen Besuch anzeigen zu können. +Mit Schließen der Seite (Tab oder Browser) wird der Cookie gelöscht.</li> +<li>Sofern Sie die Option für den barrierefreien Zugang umgestellt haben, +wird diese Einstellung in einem Cookie für ein Jahr in Ihrem Browser +gespeichert. Hierdurch ist jedoch keine Wiedererkennung bei einem +späteren Besuch möglich.</li> +</ul> +<p>Ohne Cookies ist die Nutzung dieser Website nur eingeschränkt möglich.</p> + +<h2>Erhebung statistischer Daten</h2> +<p>Zusätzlich zu den persönlichen Statistikdaten werden richtig oder +falsch beantwortete Fragen und bestandene sowie nicht bestandene +Fragebögen gezählt. Diese Daten sind nicht auf einzelne Seitenbesuche +zurückzuführen.</p> + +<p>Bei jedem Zugriff auf den Server werden Daten für statistische +und Sicherungszwecke gespeichert. Wir erfassen hier lediglich für +eine begrenzte Zeit die IP-Adresse Ihres Internet Service Providers, +Datum und Uhrzeit sowie die Website, die Sie bei uns besuchen. Diese +Daten werden ausschließlich zur Verbesserung unseres Internetdienstes +genutzt und nicht auf Sie zurückführbar ausgewertet. Wir behalten uns +jedoch das Recht vor, im Falle von schweren Verstößen gegen unsere +Nutzungsbedingungen und bei unzulässigen Zugriffen bzw. Zugriffsversuchen +auf unsere Server unter Zuhilfenahme einzelner Datensätze eine +Herleitung zu personenbezogenen Daten zu veranlassen.</p> \ No newline at end of file diff --git a/templates/db-error.html b/templates/db-error.html new file mode 100644 index 0000000..ee3164b --- /dev/null +++ b/templates/db-error.html @@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de"> +<head> + <title>THW Basisausbildung: Die Theorieprüung - Datenbank-Fehler + + + + + + + + + + + + + + +
+ + + + +
+ Die Datenbankverbindung konnte nicht hergestellt werden. + Falls dieser Fehler über einen längeren Zeitraum auftritt, senden Sie bitte eine + eMail an den Webmaster. +
+ + \ No newline at end of file diff --git a/templates/home.tpl b/templates/home.tpl new file mode 100644 index 0000000..8f51a42 --- /dev/null +++ b/templates/home.tpl @@ -0,0 +1,102 @@ +
 
+

Die + THW-Theorieprüfung

+

Herzlich willkommen!

+ +

Auf diesen Seiten haben angehende THW-Helfer die Möglichkeit, alle + theoretischen Fragen des schriftlichen Teils der Grundausbildungs-Prüfung zu lernen und zu üben.

+ + + +
+
Neuigkeiten
+ +

Aktualisierte Fragen

+

Die Änderungen aus dem zweiten Änderungsdienst der DV 2-220 vom Dezember 2014 sind in den Fragenkatalog + eingeflossen. Konkret haben sich nur die Fragen 12, 19 und 42 aus dem ersten Themenabschnitt und + kleinere Passagen der Prüfungsordnung gändert.

+

Zusätzlich zu den aktualisierten Daten lassen sich die Zufallsfragen jetzt bequem mit der Tastatur beantworten. + Die Antworten A-C können mit den Zahlentasten 1-3 aus- oder abgewählt werden, und die Leer- oder Eingabetaste + sendet das Formular ab.

+

Die Offline-Version ist ebenfalls aktualisiert, und beinhaltet auch die technischen Änderungen der Online-Version. + Das Datenupdate-Paket installiert die neuen Datenbanken und die geänderten Skriptdateien.

+

(26.02.2015, Kai Blaschke)

+ +

Verbesserungen in der Benutzbarkeit

+

Neben einigen internen Änderungen habe ich das Darstellung der Website auf Bildschirmen mit höherer Auflösung sowie + die Druckausgabe ein wenig überarbeitet. Konkret ist die Schrift nun etwas größer, und + der Seiteninhalt streckt sich nicht mehr auf die gesamte Bildschirmbreite.

+

Die Druckansicht beinhaltet jetzt nur noch + den eigentlichen Seiteninhalt, reduziert auf die nötigen Elemente und für einen S/W-Ausdruck optimierte Farben. + Insbesondere die Prüfungsbögen lassen sich jetzt so drucken, dass diese auch für eine schriftliche Übung + verwendet werden können. Ein einzelner Frageblock wird auch nicht mehr auf zwei Seiten verteilt.

+

(24.09.2014, Kai Blaschke)

+ +

Fragenkatalog 2014: Überarbeitete Fragen und Antworten

+

Die Änderungen aus dem ersten Änderungsdienst sind nun in der Online-Version enthalten. Der + Fragenkatalog entspricht jetzt der Version 2.1 (Stand März 2014) der Prüfungsvorschrift.

+

Update: Die Offline-Version ist nun auch + aktualisiert, und enthält nun auf vielfachen Wunsch wieder den optional wählbaren + Fragenkatalog 2007.

+

(06.05.2014, Kai Blaschke)

+ +

Zugangshilfe für Besucher mit Rot-Grün-Sehschwäche

+

Da einige Besucher mit Rot-Grün-Sehschwäche große Probleme hatten, + die farblichen Hervorhebungen zu unterscheiden, und somit beim + Beantworten der Fragen nicht erkennen konnten, welche Antworten tatsächlich + richtig oder falsch waren, habe ich einen zusätzlichen Seitenstil hinzugefügt. + Der Stil verstärkt den Farbkontrast, und versieht die entsprechenden Texte mit einem + zusätzlichen X-/Haken-Symbol mit einer größeren Farbfläche. Der Stil kann einfach + über die Seite "Barrierefreiheit" + oben rechts im Service-Menü umgeschaltet werden.

+

(27.05.2009, Kai Blaschke)

+ +
 
+
Seiten-Statistiken
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Fragen bisher beantwortet:{statsFragen}
  Davon richtig:{statsFragenRichtig}
  Davon falsch:{statsFragenFalsch}
Prüfungsbögen bisher beantwortet:{statsBoegen}
  Davon bestanden:{statsBoegenRichtig}
  Davon durchgefallen:{statsBoegenFalsch}
\ No newline at end of file diff --git a/templates/impressum.tpl b/templates/impressum.tpl new file mode 100644 index 0000000..e658155 --- /dev/null +++ b/templates/impressum.tpl @@ -0,0 +1,37 @@ +

Impressum

+

Verantwortlich für den Inhalt dieser Seite nach § 6 TDG / § 6 MDStV:

+ +
 
+ +

Kai Blaschke
+Herderstraße 42
+42327 Wuppertal
+E-Mail: webmaster@thw-theorie.de
+Telefon: 0202 / 980 56 30

+Ortsverband Solingen
+FGr Wasserschaden / Pumpen

+ +

Ich bin nicht für den Inhalt und/oder die Gestaltung der Homepage des Ortsverbandes +Solingen verantwortlich. Wenden Sie sich dazu bitte per E-Mail an die Öffentlichkeitsarbeit +des OV Solingen: OeffArbeit@thw-solingen.de.

+ +
 
+

Sonstige Hinweise

+ +

Linksetzung auf diese Homepage
+Um einen Link auf diese Internetseite setzen zu dürfen, bedarf es keiner gesonderten +Genehmigung. Da das World Wide Web auf dem Prinzip der gegenseitigen Verlinkung +aufbaut, wäre ein Verlinkungsverbot kontraproduktiv und außerdem vor +Gericht nicht durchsetzbar.

+ +

Diese Homepage ist ein privates Projekt. Der verwendete Fragenkatalog entspricht +dem offiziellen Prüfungsfragenkatalog der Bundesanstalt THW. Ich stelle diese +Informationen kostenlos zur freien Verfügung ins Internet, und bin somit +nach BGB nicht für Fehler und Falschangaben haftbar zu machen, die zu +negativen Konsequenzen für den Besucher führen könnten. +Sollte Ihnen auffallen, dass eine Frage hier nicht korrekt wiedergegeben ist, +kontaktieren Sie mich bitte per E-Mail!

+ diff --git a/templates/offline.tpl b/templates/offline.tpl new file mode 100644 index 0000000..c8d8855 --- /dev/null +++ b/templates/offline.tpl @@ -0,0 +1,44 @@ +
 
+

Offline-Version

+

Jetzt können Sie die Theoriefragen auch ohne Internetverbindung lernen!

+ +

Aufgrund vieler Nachfragen nach einer Offline-Version dieser Seite können Sie hier +ein Installationsprogramm beziehen, mit dem Sie diese Website auf Ihrem PC installieren und benutzen können. +Da in dem Paket alles Nötige enthalten ist, um die Seite auf Ihrem PC anzuzeigen, +benötigen Sie zur Benutzung keine aktive Internetverbindung.

+ +

Wichtiger Hinweis: Das Installationsprogramm sowie der Inhalt der Offline-Version wird +leider immer wieder von diversen Antiviren-Programmen als Malware erkannt, da das Programm +einen eigenen Webserver enthält (Lighttpd) und die Setup-Software (NSIS) +aufgrund ihrer sehr geringen Größe gerne für Malware-Installationen genutzt wird. +Ich kann versichern, dass das Programm keine schädlichen Inhalte enthält, nachlädt oder +"nach Hause telefoniert".

+ +

Offline-Version jetzt herunterladen
Update herunterladen (200 KB)

+

Datenstand Update und Vollversion: 16.05.2014, Kataloge 2007 und 2014

+ +

Systemvoraussetzungen

+

Die Offline-Version läuft unter allen Windows-Betriebssystemen ab Windows 2000.

+ +

Installationshinweise

+

Das Installationsprogramm installiert alle nötigen Komponenten automatisch, +Sie werden lediglich nach einem Zielorder gefragt. Einige Personal Firewalls +schlagen möglicherweise Alarm, dass ein Serverdienst das TCP-Port 9999 öffnen +möchte - erlauben Sie dies, sonst wird das Programm nicht funktionieren.

+ +

Das Update funktioniert nur, wenn Sie bereits die vollständige Version von +THW Theorie installiert haben. Die hier angebotene vollständige Version ist +immer auf dem aktuellen Stand, wenn Sie also eine Neuinstallation vornehmen, +benötigen Sie lediglich das Komplettpaket.

+ +

Die Software bestehe aus einem sog. "Serverprozess", der in einer DOS-Box läuft, +sowie einem Browserfenster, in dem die Adresse "http://localhost:9999" geöffnet ist. +Um das Programm zu beenden, schließen Sie einfach beide Fenster. Zum Starten +verwenden Sie bitte den entsprechenden Eintrag im Startmenü.

+ +

Diese Software wird als "AS-IS" ausgeliefert. Das bedeutet, dass ich, +Kai Blaschke, als Autor des Programms keinerlei Garantie für eine korrekte und +fehlerfreie Funktionsweise übernehme. Auch wenn ich alle möglichen Vorkehrungen +getroffen habe, um Schäden und Datenverluste auszuschließen, erfolgt der Betrieb der +Software auf eigene Gefahr und Verantwortung.

\ No newline at end of file diff --git a/templates/ordnung.tpl b/templates/ordnung.tpl new file mode 100644 index 0000000..05afa3b --- /dev/null +++ b/templates/ordnung.tpl @@ -0,0 +1,527 @@ +
 
+

THW Dienstvorschrift 2-220 - Prüfungsvorschrift Grundausbildung

+

Stand: August 2013

+ +

+

+

+ + + + + + + + + + + + + + + +   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 1. + + Prüfungszweck +
+   + +

Die Abschlussprüfung der Grundausbildung dient zur Feststellung der erworbenen + Kompetenzen, Kenntnisse und Fertigkeiten der Helfer/innen (He) gemäß den Vorgaben + der Curricula Grundausbildung und Angepasste Grundausbildung.

+ +

Die Prüfer/innen für die Grundausbildung stellen den Ausbildungs- und Lernerfolg fest.

+
+ {~topLine} +
+   +
+ 2. + + Personal bei der Abschlussprüfung +
+   + +

Im Folgenden wird das benötigte Personal für die Abschlussprüfung Grundausbildung + mit seinen Aufgaben beschrieben.

+ +

2.1. Prüfungsleiter/in

+ +

Der/die Prüfungsleiter/in handelt im Auftrag des/der Landesbeauftragten (LB) und ist für + die ordnungsgemäße Abwicklung der Prüfung, die Einhaltung der Unfallverhütungs- und + Arbeitsschutzvorschriften sowie den allgemeinen Sicherheits- und Gesundheitsschutz + auf dem Prüfungsgelände verantwortlich.

+ +

Er/Sie ist gegenüber allen bei der Prüfung eingesetzten Kräften weisungsbefugt. Prüfungsleiter/innen dürfen + He ihres eigenen OV nicht prüfen.

+ +

In jedem Geschäftsführerbereich (GFB) sind mindestens zwei Prüfungsleiter/innen zu + berufen. Die Tätigkeit als Prüfungsleiter/in Grundausbildung wird als Zusatzfunktion + wahrgenommen. Die Voraussetzungen für die Ausübung dieser Tätigkeit sind in der + entsprechenden Funktionsbeschreibung in der Stärke und Ausstattungsnachweisung + (StAN) OV in der jeweils gültigen Fassung geregelt.

+ +

2.2. Prüfer/in

+ +

In jedem Ortsverband ist mindestens ein/eine Prüfer/in Grundausbildung vorzusehen. + Die Tätigkeit als Prüfer/in Grundausbildung wird als Zusatzfunktion wahrgenommen. Die + Voraussetzungen für die Ausübung dieser Tätigkeit sind in der entsprechenden Funkti- + onsbeschreibung in der StAN OV in der jeweils gültigen Fassung geregelt. + +

2.2.1. Prüfer/in Theorie

+ +

Der/die Prüfer/in Theorie ist für den ordnungsgemäßen Ablauf der schriftlichen Prüfung + zuständig.

+ +

Er/Sie gibt die Frage- und Auswertungsbögen aus, achtet auf Einhaltung der maximal + zulässigen Bearbeitungszeit, sammelt alle ausgegebenen Unterlagen ein und händigt + diese der Prüfungskommission aus.

+ +

2.2.2. Prüfer/in Praxis

+ +

Der/die Prüfer/in Praxis ist für die praktische Prüfung und Bewertung der Prüflinge an + seiner/ihrer Station zuständig. Er/Sie ist für den ordnungsgemäßen Ablauf der Prüfung, + die Einhaltung der Unfallverhütungsvorschriften und die allgemeine Sicherheit und Ordnung an der Station + verantwortlich.

+ +

2.2.3. Berechtigte Person für die Abnahme Leistungsabzeichen Stufe Gold

+ +

Siehe 2.5 in der Richtlinie für die Abnahme des Leistungsabzeichens + der + THW-Jugend in der jeweils gültigen Fassung

+ +

2.3. Stationshelfer/in

+ +

Der/die Stationshelfer/in unterstützt den/die Prüfer/in Praxis bei der Durchführung der + praktischen Prüfung an der Station. Er/Sie unterstützt den Prüfling auf dessen Anforderung durch allgemeine + Hilfestellung bei der Durchführung von Aufgaben, die durch den + Prüfling alleine nicht gelöst werden können. Er/Sie darf dabei nicht in den zu prüfenden + Arbeitsablauf eingreifen.

+ +

2.4. Prüfungskommission

+ +

Zur Durchführung der Prüfung wird durch die Dienststelle des/der Landesbeauftragten + (LB-Dst) bzw. die beauftragte Geschäftsstelle (GSt) eine Prüfungskommission eingesetzt. +

+ +

Die Prüfungskommission besteht aus dem/der Prüfungsleiter/in und mindestens zwei + weiteren Prüfenden.

+ +

Bei Unstimmigkeiten und Unklarheiten während der Prüfung tritt die Prüfungskommission zur + Entscheidungsfindung zusammen. Soweit die Prüfungskommission zu keiner + Mehrheitsentscheidung findet, gibt die Stimme des/der Prüfungsleiters/in den Ausschlag.

+ +

Die Prüfungskommission teilt die Prüfenden für die schriftliche Prüfung und die praktische Prüfung ein. + Findet eine kombinierte Abschlussprüfung Grundausbildung und Abnahme des Leistungsabzeichens der Stufe Gold + statt, teilt die Prüfungskommission auch hier die abnahmeberechtigten Personen ein.

+
+ 3. + + Zulassung zur Abschlussprüfung +
+   + +

Der/die He ist zur Prüfung zuzulassen, wenn er/sie gemäß den Vorgaben des Curriculums Grundausbildung + ausgebildet wurde und der Leistungsstand eine erfolgreiche Teilnahme an der Abschlussprüfung erwarten + lässt.

+ +

Der/die He muss das 16. Lebensjahr vollendet haben. Der Statuswechsel vom/von + der Junghelfer/-in zum/zur He erfolgt automatisch mit dem vollendeten 18. Lebensjahr.

+ +

Die Entscheidung über die Zulassung zur Abschlussprüfung trifft der/die Ausbildungsbeauftragte des/der He im + Einvernehmen mit dem/der stv. Ortsbeauftragten. Er/Sie meldet den/die He bei der GSt zur Prüfung an.

+ +

Soweit vorhanden, ist bereits mit der Anmeldung der Nachweis der Erste-Hilfe-Ausbildung (acht Doppelstunden) + vorzulegen. Der Nachweis darf nicht älter als zwei Jahre sein. Ist dies nicht möglich, so muss der Nachweis + der Prüfungskommission spätestens vor Beginn der praktischen Prüfung vorgelegt werden, ansonsten darf der + Prüfling nicht an der praktischen Prüfung teilnehmen.

+ +
+ {~topLine} +
+   + +   +
+ 4. + + Durchführung der Abschlussprüfung +
+   + +

4.1. Organisation

+ +

Die Durchführung der Prüfung liegt in der Organisationshoheit des/der LB. Die Aufgaben können ganz oder + teilweise an die GSt oder den/die Prüfungsleiter/in delegiert werden.

+ +

Durch den/die LB bzw. die beauftragte GSt müssen

+
    +
  • der/die Prüfungsleiter/in,
  • +
  • die Prüfer/innen (einschließlich Reserve),
  • +
  • die Prüfungsaufgaben für die Prüfungsteile[1], in Abstimmung mit + dem/der Prüfungsleiter/in +
  • +
+

rechtzeitig festgelegt werden.

+ +

Für die organisatorische Vorbereitung zur Durchführung der Prüfung ist der ausrichtende OV zuständig.

+ +

Dieser hat insbesondere sicherzustellen, dass das gemäß Liste[2] + bereitzustellende Material und Gerät sowie weitere zusätzliche Schutzausstattung für Prüfer/Prüferinnen und + Stationshelfer/Stationshelferinnen vollzählig, einsatzbereit und stationsbezogen gegliedert vorhanden ist. + Es ist nur geprüftes Material zu verwenden.

+ +

Weiterhin hat er sicherzustellen, dass genügend Fläche für die praktische Prüfung sowie folgend aufgeführte + Räumlichkeiten zur Verfügung stehen:

+
    +
  • ein Raum für die Prüfungskommission,
  • +
  • ein Raum für die schriftliche Prüfung, der auch als Bereitstellungs- und Verpflegungsraum genutzt werden + kann. +
  • +
+

Der ausrichtende OV hat zu gewährleisten, dass für die praktische Prüfung jedem/jeder Prüfer/in Praxis + ein/eine Stationshelfer/in zur Verfügung steht.

+ +

Sind diese Voraussetzungen nicht erfüllt, ist der/die Prüfungsleiter/in gehalten, bis zu deren Regulierung + die Prüfung auszusetzen oder gegebenenfalls die Prüfung abzubrechen.

+ +

Alle Prüflinge und Prüfenden haben die vollständige Einsatzkleidung (Multifunktionsanzug) und zusätzliche + persönliche Schutzausstattung (Helm, Einsatzschuhe, Schutzhandschuhe[3] + ) mitzuführen. Unvollständige Einsatzbekleidung und persönliche Schutzausstattung führt bei Prüflingen zum + Ausschluss vom praktischen Prüfungsteil.

+ +

Prüfungsleiter/innen und Prüfer/innen müssen sich ihrer Vorbildfunktion gegenüber den Prüflingen bewusst + sein.

+ +

Junghelfer/innen können bei der Teilnahme an der Abschlussprüfung zur Grundausbildung alternativ auch die + persönliche Schutzausstattung der Jugend (Jugendanzug, Einsatzschuhe, Helm und Schutzhandschuhe[4]) tragen.

+ +

4.2. Prüfungsablauf

+ +

Die Prüfung besteht aus einem schriftlichen und einem praktischen Teil, die unabhängig voneinander bewertet + werden. He, die mit der Prüfung eine Angepasste Grundausbildung abschließen wollen, müssen nur den + schriftlichen Prüfungsteil absolvieren.

+ +

Aus dem Katalog der Fragen und Aufgaben dieser Dienstvorschrift werden die Prüfungsaufgaben zusammengestellt. + Diese umfassen eine Themenauswahl aus allen Lernabschnitten[5] für alle + Prüfungsteile. Diese sind in ihren Aufgaben festgelegt und dürfen nicht abgeändert werden.

+ +

4.3. Belehrung der Prüfungsteilnehmenden

+ +

Vor Beginn der Prüfung sind die Prüflinge durch den/die Prüfungsleiter/in darauf hinzuweisen, dass bei + Abbruch der Prüfung durch den Prüfling oder bei Ausschluss wegen Täuschungsversuches die Prüfung als nicht + bestanden gewertet wird.

+ +

Des Weiteren sind alle He nochmals über die Notwendigkeit in der Anwendung der aktuellen Hygienevorschriften + und Arbeitsschutzregeln zu unterweisen.

+ +

Wenn ein/eine He eine Lese-/Rechtschreibschwäche (Legasthenie) hat, ist ihm/ihr die Möglichkeit zu geben, + dieses dem/der Prüfungsleiter/in in einem Einzelgespräch mitzuteilen. Zum Ablauf des schriftlichen + Prüfungsteils, s. 4.4.1.

+ +

Abschließend sind alle Prüflinge zu fragen, ob sie sich in der Lage fühlen, an der bevorstehenden Prüfung + teilzunehmen.

+ +

4.4. Schriftliche Prüfung

+ +

4.4.1. Durchführung und Bewertung

+ +

Der schriftliche Teil besteht aus der Beantwortung von insgesamt 40 Fragen. Bei einzelnen Fragen können auch + mehrere Antworten richtig sein (Mehrfachauswahl).

+ +

Die Prüfungsdauer beträgt 30 Minuten und erfolgt unter Aufsicht des/der Prüfers/in Theorie.

+ +

Der schriftliche Prüfungsteil gilt als bestanden, wenn mindestens 80 % (32 von 40 Fragen) richtig beantwortet + wurden. Eine Frage mit mehreren Antwortmöglichkeiten gilt nur dann als richtig beantwortet, wenn alle + richtigen Antworten angekreuzt wurden.

+ +

Bei He mit einer Lese-/Rechtschreibschwäche wird die Prüfung der vorgegebenen Fragen in mündlicher Form, + unter Ausschluss der übrigen Prüfungsteilnehmenden, durchgeführt. Hierbei müssen zwei Prüfer/innen anwesend + sein (Vier-Augen-Prinzip).

+ +

Nach Auswertung der Fragebögen ist dem Prüfling auf Wunsch Einsicht in die Unterlagen zu gewähren. Falsch + beantwortete Fragen sind mit einem Mitglied der Prüfungskommission zu besprechen.

+ +

4.4.2. Ermittlung der Ergebnisse

+ +

Der Prüfling beantwortet auf dem Auswertungsbogen die Fragen des zugehörigen Fragebogens. Der/die + Prüfungsleiter/in oder ein Mitglied der Prüfungskommission wertet unter Verwendung des jeweiligen + Lösungsbogens die Antworten aus.

+ +

4.5. Praktische Prüfung

+ +

4.5.1. Durchführung und Bewertung

+ +

Die praktische Prüfung umfasst 24 Aufgaben, die an verschiedenen Stationen geprüft werden. Der Mehrfachaufbau + von Stationen ist zulässig. Die Prüflinge haben die gestellten Aufgaben einzeln zu lösen.

+ +

Abhängig von der Anzahl der Prüflinge ist jede Station mit mindestens einem/einer Prüfer/in Praxis und + einem/einer Stationshelfer/in zu besetzen. Der/die Prüfer/in hat die vorgegebene Prüfungsaufgabe den + einzelnen Prüfungsteilnehmenden vorzulesen.

+ +

Die praktische Prüfung gilt als bestanden, wenn mindestens 80 % (19 von 24 Aufgaben) gelöst wurden. Die + jeweiligen Bewertungs- (definierte Mindestpunktzahl) und Zeitvorgaben der Einzelaufgaben müssen erfüllt + sein. Enthalten die Aufgaben Pflichtfelder (in den Prüfungsaufgaben als ☐ Kästchen-Fragen markiert) + müssen diese alle richtig gelöst worden sein.

+ +

Nachdem alle Aufgaben geprüft worden sind, hat ein Mitglied der Prüfungskommission auf Wunsch des Prüflings + alle nicht bestandenen Aufgaben zu besprechen.

+ +

4.5.2. Ermittlung der Ergebnisse

+ +

Im praktischen Prüfungsteil werden dem Prüfling auf den einzelnen Stationen praktische Aufgaben gestellt, + deren Lösungen anhand der Stationsprüfbögen durch den/die Prüfer/in Praxis bewertet werden.

+ +

4.6. Kombinationsprüfung Grundausbildung und Leistungsabzeichen Gold

+ +

Siehe 3.4 in der Richtlinie für die Abnahme des Leistungsabzeichens + der THW-Jugend in der jeweils gültigen Fassung.

+ +

4.7. Ausschluss von der Abschlussprüfung

+ +

Bei vom/von der He zu verantwortenden Pflichtverletzungen während der jeweiligen Prüfungsteile, insbesondere + bei Täuschungsversuchen, ist der Prüfling durch die entsprechenden Prüfer/innen zunächst vom Fortgang der + Prüfung auszuschließen und der Prüfungskommission mit schriftlichem Vermerk zu überstellen. Die Entscheidung + über den endgültigen Ausschluss trifft die Prüfungskommission. Hierzu ist ein Bericht zu erstellen und den + Prüfungsunterlagen beizufügen.

+ +

4.8. Bekanntgabe der Prüfungsergebnisse

+ +

Im Anschluss an die Prüfung gibt der/die Prüfungsleiter/in den Prüflingen das Ergebnis einzeln bekannt. + Prüflingen, die nicht bestanden haben, ist das Ergebnis in Einzelgesprächen mitzuteilen und auf Wunsch zu + erläutern.

+ +

Dem Prüfling wird am Prüfungstag eine Urkunde über die bestandene Abschlussprüfung ausgehändigt. Hierzu ist + ein dem Anlass entsprechender, würdiger Rahmen zu wählen.

+ +

4.9. Wiederholung der Abschlussprüfung

+ +

Die Abschlussprüfung kann in allen Teilen vollständig wiederholt werden. Der nicht bestandene Prüfungsteil + soll möglichst innerhalb einer Frist von drei Monaten wiederholt werden.

+ +

Nachprüfungen am Prüfungstag sind nicht zulässig.

+ +

Es ist nur eine Wiederholungsprüfung zulässig. Wenn auch die Wiederholung nicht zum Erfolg führt, muss bei + ordnungsgemäß durchgeführter Ausbildung die Eignung des/der Helfer/in zum Einsatzdienst verneint werden. In + der Folge wird ihm/ihr die Einsatzbefähigung nicht zugesprochen.

+ +

4.10. Aufbewahrung der Prüfungsunterlagen

+ +

Der Auswertungsbogen wird in die Akte des/der He im OV übernommen.

+ +

Das Bestehen der Abschlussprüfung ist entsprechend in THWin einzutragen.

+ +

Folgende Prüfungsunterlagen sind vom/von der Prüfungsleiter/in unmittelbar nach der Abschlussprüfung unter + Verschluss zu nehmen und dem/der Vertreter/in der LB-Dst bzw. der beauftragten GSt zu übergeben:

+
    +
  • Fragebögen und Lösungsbögen,
  • +
  • Stationsprüfbögen der praktischen Prüfung,
  • +
  • Formblatt "Ergebnis der Abschlussprüfung"[6]
  • +
+

Die Prüfungsunterlagen sind in der LB-Dst bzw. in der beauftragten GSt in geeigneter Form zwei Jahre + aufzubewahren.

+ +

Fußnoten:
+ 1: Bei gleichzeitiger Durchführung der kombinierten Prüfung sind auch die + zusätzlichen Prüfungsteile für die Abnahme des Leistungsabzeichens der Stufe Gold festzulegen.
+ 2: Siehe Anlage 6.6.5. DV 2-220 PvGA
+ 3: THW Einsatzhandschuhe und THW Arbeitshandschuhe aus Leder mit Stulpe
+ 4: THW Einsatzhandschuhe und THW Arbeitshandschuhe aus Leder mit Stulpe
+ 5: Beim schriftlichen Prüfungsteil zur Angepassten Grundausbildung erfolgt die + Auswahl der Fragen aus den relevanten Lernabschnitten.
+ 6: Siehe Anlage 6.6.3. DV 2-220 PvGA
+
+

+
+ {~topLine} +
+   + +   +
+ 5. + + Schlussbestimmung +
+   + +

Die THW Dienstvorschrift 2-220 Prüfungsvorschrift Grundausbildung (THW DV 2-220 PvGA) nebst Anlagen tritt zum + 01.10.2013 bis auf weiteres in Kraft.

+ +

Alle Vorgängerversionen der Prüfungsvorschrift Basisausbildung im THW werden hiermit außer Kraft gesetzt.

+ +

Ab dem 01.04.2014 ist ausschließlich nach dieser Dienstvorschrift die Abschlussprüfung zur + Grundausbildung durchzuführen.

+
+ +{~topLine} + +

DV 2-220 PvGA / Anlage 6.5

+

Auszug aus der Richtlinie für die Abnahme des Leistungsabzeichens der THW-Jugend, Stand 17. November 2011

+ + + + + + + + + + + + + + + + + + + +
+ 2.5. + + Berechtigte Personen für die Abnahme +
+   + +

Als berechtigte Person für die Abnahme des Leistungsabzeichens kann eingesetzt werden, wer erfahrener + Helfer / erfahrene Helferin ist. Die berechtigten Personen für die Abnahme des Leistungsabzeichens + werden durch die Abnahmekommission festgelegt.

+ +

Die eingesetzten berechtigten Personen zur Abnahme des Leistungsabzeichens müssen insbesondere für die + Zusammenarbeit mit Jugendlichen geeignet sein.

+ +

Im Rahmen der Kombinationsprüfung werden die folgenden Teile explizit durch die Prüfer/Prüferin + Grundausbildung abgenommen:

+
    +
  • Theoretische Prüfung
  • +
  • Praktische Prüfung
  • +
  • Teamprüfung
  • +
+

Für den Teil der Abnahme des Leistungsabzeichens der Stufe Gold können berechtigte Personen für die + Abnahme des Leistungsabzeichens entsprechend dieser Abnahmerichtlinie eingesetzt werden.

+
+ 3.4. + + Kombinationsprüfung Grundausbildung und Leistungsabzeichen + Gold +
+   + +

3.4.1. Theoretische Prüfung Grundausbildung

+ +

Die theoretische Einzelprüfung umfasst 40 Fragen (Multiple Choice).

+ +

Die theoretische Prüfung ist bestanden, wenn mindestens 32 der 40 Fragen richtig beantwortet wurden.

+ +

Die Fragen stammen dabei aus der Prüfungsvorschrift Grundausbildung im THW.

+ +

3.4.2. Praktische Einzel-Prüfung Grundausbildung

+ +

Die praktische Einzelprüfung umfasst 24 Aufgaben, welche an Stationen von Prüfern / Prüferinnen + abgenommen werden.

+ +

Die praktische Prüfung ist bestanden, wenn mindestens 19 der 24 Aufgaben richtig gelöst wurden.

+ +

Die Aufgaben stammen dabei aus der Prüfungsvorschrift Grundausbildung im THW.

+ +

3.4.3. Team-Prüfung Grundausbildung

+ +

Es wird eine Team-Aufgabe gestellt, die aufgabenabhängig von Prüflingen zusammen bearbeitet und von + Prüfern / Prüferinnen abgenommen wird.

+ +

Die Aufgaben stammen dabei aus der Prüfungsvorschrift Grundausbildung im THW.

+ +

3.4.4. Gruppenaufgabe Leistungsabzeichen

+ +

Es wird eine Gruppenaufgabe gestellt, die aufgabenabhängig von Junghelfern / Junghelferinnen zusammen + bearbeitet und von den berechtigten Personen für die Abnahme des Leistungsabzeichens abgenommen + wird.

+ +

Die Gruppenaufgabe gilt dann als bestanden, wenn mindestens zwei der drei Teilbereiche richtig gelöst + sind. Die Aufgaben stammen dabei aus der Anlage 8.6.

+ +

3.4.5. Mitwirkung an einem Gemeinschaftsprojekt des Ortsverbandes

+ +

Teilnehmende Junghelfer und Junghelferinnen für die Abnahme des Leistungsabzeichen der Stufe Gold müssen + vor der Abnahme an der Planung und Durchführung eines Gemeinschaftsprojektes (beispielsweise Projekte + des Umweltschutzes, Projekt für oder mit Senioren / Kindern, Aktionsprogramm in der Stadt oder Gemeinde) + aktiv im Team mitgewirkt haben.

+ +

Der eigene Projektanteil ist am Abnahmetag von jedem teilnehmenden Jugendlichen innerhalb von 5 Minuten + vorzutragen oder im Gespräch zu erläutern. Dieser Teil der Abnahme ist dann bestanden, wenn keine + Zweifel an der Mitwirkung des Jugendlichen am Gemeinschaftsprojekt bestehen. Elektronische Hilfsmittel + sind nicht notwendig und werden für die Abnahme nicht vorgehalten.

+ +
\ No newline at end of file diff --git a/templates/page-body.tpl b/templates/page-body.tpl new file mode 100644 index 0000000..5403877 --- /dev/null +++ b/templates/page-body.tpl @@ -0,0 +1,94 @@ + + + + THW Basisausbildung: Die Theorieprüfung (Stand {catalogYear}) + + + + + + + + + + + + + {extraStyleSheet} + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Barrierefreiheit | + Datenschutz | + Impressum +
+ + + + + +
THW - Die Theorie
+
+ + + + + + + + +
+{~pageContent} +{~topLine} +
+
+ + + diff --git a/templates/stats.tpl b/templates/stats.tpl new file mode 100644 index 0000000..13945c4 --- /dev/null +++ b/templates/stats.tpl @@ -0,0 +1,50 @@ +
 
+

Statistiken

+ +

Dies sind Ihre Gesamtstatistiken für diesen Besuch. Die Statistik enthält +sowohl die Zufallsfragen, als auch die Prüfungsbögen. Die Fragen +der Prüfungsbögen fließen in die Fragen-Statistik +mit ein. Wenn Sie die Statistiken löschen möchten, klicken +Sie bitte auf den Link "Zurücksetzen".

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Fragen beantwortet:{fragenBisher}
    Davon Richtig:{fragenRichtig}
    Davon Falsch:{fragenFalsch}
    Quote:{fragenQuote}
Fragebögen:{boegenBisher}
    Bestanden:{boegenRichtig}
    Nicht bestanden:{boegenFalsch}
    Quote:{boegenQuote}
+
+
+ + + +
diff --git a/templates/top-line.tpl b/templates/top-line.tpl new file mode 100644 index 0000000..483640b --- /dev/null +++ b/templates/top-line.tpl @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/templates/zufallsfragen-aufloesung.tpl b/templates/zufallsfragen-aufloesung.tpl new file mode 100644 index 0000000..2d5f67f --- /dev/null +++ b/templates/zufallsfragen-aufloesung.tpl @@ -0,0 +1,80 @@ +
 
+

Zufallsfragen üben

+ +{|Kopf}{|Kopf*Content} +

Frage Nr. {aktuelleFrage} von {fragenCnt}

+

Lernabschnitt {abschnittNr}: {abschnitt}

+{|Kopf*Content}{|Kopf} + +
+ +
+ +
+ +{|Status} +{|Status*Richtig}

Sie haben diese Frage richtig beantwortet!

{|Status*Richtig} +{|Status*Falsch}

Sie haben diese Frage falsch beantwortet!

{|Status*Falsch} +{|Status} + + + + + + + + + + + + + + + + + + + + + +{|ThreeRows}{|ThreeRows*Row} + + + + + +{|ThreeRows*Row}{|ThreeRows} +
{abschnittNr}.{frageNr}{|BogenStatus} + {|BogenStatus*BR}

{|BogenStatus*BR} + {|BogenStatus*Richtig}Richtig{|BogenStatus*Richtig} + {|BogenStatus*Falsch}Falsch{|BogenStatus*Falsch} + {|BogenStatus}
{frageText}{Antwort1}A{|A1L}{|A1L*Haken}X{|A1L*Haken}{|A1L} 
{Antwort2}B{|A2L}{|A2L*Haken}X{|A2L*Haken}{|A2L} 
{Antwort3}C{|A3L}{|A3L*Haken}X{|A3L*Haken}{|A3L} 
+
 
+ + + + + + +
+ +
+ +
Fehlerquote
+ + + + + +
Fragen bisher:{aktuelleFrage}
Davon richtig beantwortet:{fragenRichtig}
Davon falsch beantwortet:{fragenFalsch}
Fehlerquote (20% für Bestehen max.):{fragenQuote}
+ + \ No newline at end of file diff --git a/templates/zufallsfragen-ende.tpl b/templates/zufallsfragen-ende.tpl new file mode 100644 index 0000000..45eb47a --- /dev/null +++ b/templates/zufallsfragen-ende.tpl @@ -0,0 +1,43 @@ +
 
+

Zufallsfragen üben

+

Sie haben alle Fragen beantwortet!

+

Sie haben alle Fragen des gewählten Kataloges beantwortet. Hier sehen Sie nun + eine Zusammenfassung über richtig bzw. falsch beantwortete Fragen und ob + Sie mit der Fehlerquote einen Testbogen bestanden hätten.

+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Insgesamt beantwortete Fragen:{anzFragen}
Richtig beantwortete Fragen:{fragenRichtig}
Prozentualer Anteil:{fragenRichtigQuote}
Falsch beantwortete Fragen:{fragenFalsch}
Prozentualer Anteil:{fragenFalschQuote}
Mit dieser Fehlerqoute hätten Sie die Prüfung + {|Bestanden}{|Bestanden*Ja}bestanden{|Bestanden*Ja}{|Bestanden*Nein}nicht bestanden{|Bestanden*Nein}{|Bestanden}.
+ + + + +
\ No newline at end of file diff --git a/templates/zufallsfragen-error.tpl b/templates/zufallsfragen-error.tpl new file mode 100644 index 0000000..0bbc762 --- /dev/null +++ b/templates/zufallsfragen-error.tpl @@ -0,0 +1,9 @@ +
 
+

Zufallsfragen üben

+

Keine Themenabschnitte gewählt!

+
+ +
+

Sie müssen mindestens einen Themenabschnitt wählen, um mit +dem Zufallsfragen-Test zu beginnen.

+

\ No newline at end of file diff --git a/templates/zufallsfragen-frage.tpl b/templates/zufallsfragen-frage.tpl new file mode 100644 index 0000000..392b22e --- /dev/null +++ b/templates/zufallsfragen-frage.tpl @@ -0,0 +1,90 @@ +
 
+

Zufallsfragen üben

+ +

Frage Nr. {aktuelleFrage} von {fragenCnt}

+

Lernabschnitt {abschnittNr}: {abschnitt}

+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +{|ThreeRows}{|ThreeRows*Row} + + + + + +{|ThreeRows*Row}{|ThreeRows} +
{abschnittNr}.{frageNr}{frageText}{Antwort1}A
{Antwort2}B
{Antwort3}C
+ +
 
+ + + + + + + +
+ +
+ + \ No newline at end of file diff --git a/templates/zufallsfragen-start.tpl b/templates/zufallsfragen-start.tpl new file mode 100644 index 0000000..de3a347 --- /dev/null +++ b/templates/zufallsfragen-start.tpl @@ -0,0 +1,73 @@ +
 
+

Fragen üben

+

Fragen in zufälliger Reihenfolge üben

+

In diesem Bereich können Sie alle oder bestimmte Fragen des Curriculums "Grundausbildung der Helfer des THW" in einer zufälligen Reihenfolge üben. Dabei werden, sofern Sie nicht einen neuen Fragenkatalog generieren, keine Fragen doppelt angezeigt oder ausgelassen. Wenn Sie alle bzw. die gewünschte Anzahl Fragen durchgearbeitet haben, wird eine Gesamtstatistik zur aktuellen Fragen-Serie bzw. wenn Sie in dieser Sitzung bereits mehrere Durchgänge absolviert haben, auch eine Gesamtstatistik angezeigt.

+

Die Fragen werden in zufälliger Reihenfolge einzeln angezeigt. Ein erneutes Beantworten der Fragen in der aktuellen Serie ist nicht möglich, da die Lösung sofort angezeigt wird.

+

Bei den meisten Fragen stehen 3 Antworten zur Auswahl (bei wenigen nur 2). Es ist mindestens eine Antwort anzukreuzen, bei einigen Fragen müssen auch mehrere Antworten angekreuzt werden. Die Aufgabe gilt als richtig gelöst, wenn alle zutreffenden Antworten angekreuzt sind.

+

Hinweis: Sind in den ausgewählten Lernabschnitten weniger Fragen als unter "Anzahl Fragen" ausgewählt wurde vorhanden, wird die Fragenzahl entsprechend reduziert. "Alle Fragen" und die Auswahl nur eines Lernabschnittes beschränkt die Anzahl der Fragen also auf die in diesem Themenbereich vorhandenen Fragen.

+ +
+ + + + + + + + + + +
+ Lernabschnitte:

+ Alle wählen
+ Keine wählen

+ Invertieren
+
+ + {|Abschnitte} + {|Abschnitte*Row} + + + + + {|Abschnitte*Row} + {|Abschnitte} +
+ + + +
+
Max. Anzahl Fragen: + +
+ + + + + +
+
\ No newline at end of file diff --git a/zufallsfragen.inc.php b/zufallsfragen.inc.php new file mode 100644 index 0000000..773e6db --- /dev/null +++ b/zufallsfragen.inc.php @@ -0,0 +1,221 @@ + + * + * The included 'THW Thema' templates, logos and the Q&A catalog are protected + * by copyright laws, and must not be used without the written permission + * of the + * + * Bundesanstalt Technisches Hilfswerk + * Provinzialstrae 93 + * D-53127 Bonn + * Germany + * E-Mail: redaktion@thw.de + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* +* +* Fragen in zuflliger Reihenfolge ben +* +*/ + +$tpl->parseBlock('page-body', 'NavZufall', 'Sublinks'); +$tpl->addVars('navZufall', 'current'); + +if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'neu') { + // Fragenkatalog lschen + unset($_SESSION['zufallsfragen']); +} + +if (isset($_SESSION['zufallsfragen'])) { + // Fragenkatalog schon vorhanden. Zu nchster unbeantworteter Frage + // bzw. Antwort der letzten Frage springen + // Wenn keine Fragen mehr im Katalog vorhanden sind, + // Statistik anzeigen. + + if (count($_SESSION['zufallsfragen'])==0) { + // Alle Fragen beantwortet, Ergebnis zeigen + $tpl->addVars(Array( + 'anzFragen' => $_SESSION['fragen_cnt'], + 'fragenRichtig' => $_SESSION['zufallstats']['Richtig'], + 'fragenRichtigQuote' => sprintf('%.2f %%', $_SESSION['zufallstats']['Richtig'] / $_SESSION['fragen_cnt'] * 100), + 'fragenFalsch' => $_SESSION['zufallstats']['Falsch'], + 'fragenFalschQuote' => sprintf('%.2f %%', $_SESSION['zufallstats']['Falsch'] / $_SESSION['fragen_cnt'] * 100), + )); + + $tpl->addTemplates('content', 'zufallsfragen-ende'); + + + + if (($_SESSION['zufallstats']['Richtig'] / $_SESSION['fragen_cnt']) >= 0.8) { + $tpl->parseBlock('content', 'Bestanden', 'Ja'); + } else { + $tpl->parseBlock('content', 'Bestanden', 'Nein'); + } + + // Sessiondaten lschen + unset($_SESSION['zufallsfragen']); + unset($_SESSION['frage_nr']); + unset($_SESSION['fragen_cnt']); + unset($_SESSION['zufallstats']); + unset($_SESSION['bogen']); + + return; + + } + + + if (!isset($_REQUEST['frage_id']) || $_REQUEST['frage_id'][0] <> $_SESSION['zufallsfragen'][0]) { + $tpl->addTemplates(Array('content' => 'zufallsfragen-frage')); + + // Frage stellen + SingleQuestion($_SESSION['zufallsfragen'][0], $_SESSION['frage_nr'], $_SESSION['fragen_cnt']); + + return; + } + + $tpl->addTemplates(Array('content' => 'zufallsfragen-aufloesung')); + + // Antwort auswerten + + questionHeader($_REQUEST['frage_id'][0], $_SESSION['frage_nr'], $_SESSION['fragen_cnt'], $_SESSION['jahr']); + $korrekt = Answer($_REQUEST['frage_id'][0], $_REQUEST['antwort']); + + // Statistik anpassen + if ($korrekt) { + $_SESSION['zufallstats']['Richtig']++; + $_SESSION['stats']['Fragen_Richtig']++; + $stmt = $GLOBALS['db']->prepare('UPDATE statistik SET fragen=fragen+1,richtig=richtig+1'); + $stmt->execute(); + } else { + $_SESSION['zufallstats']['Falsch']++; + $_SESSION['stats']['Fragen_Falsch']++; + $stmt = $GLOBALS['db']->prepare('UPDATE statistik SET fragen=fragen+1,falsch=falsch+1'); + $stmt->execute(); + } + + $tpl->addVars(Array( + 'submitText' => ($_SESSION['frage_nr']==$_SESSION['fragen_cnt'])?'Gesamtstatistik':'Nächste Frage', + 'aktuelleFrage' => $_SESSION['frage_nr'], + 'fragenRichtig' => $_SESSION['zufallstats']['Richtig'], + 'fragenFalsch' => $_SESSION['zufallstats']['Falsch'], + 'fragenQuote' => sprintf('%0.2f', $_SESSION['zufallstats']['Falsch']/$_SESSION['frage_nr']*100) . '%' + )); + + // Frage entfernen + array_shift($_SESSION['zufallsfragen']); + + $_SESSION['frage_nr']++; + $_SESSION['stats']['Fragen_Bisher']++; + + return; +} + +// Neuen Fragenkatalog erstellen +if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'start') { + + $topicCount = getSingleResult('SELECT COUNT(*) AS Cnt FROM abschnitte WHERE Jahr = ?', + array('i', $_SESSION['jahr'])); + + // Gewhlte Abschnitte in Query einsetzen + $selectedTopics = array(); + for ($topic = 1; $topic <= $topicCount; $topic++){ + if (isset($_REQUEST['abschnitt'][$topic]) && $_REQUEST['abschnitt'][$topic] == '1') { + array_push($selectedTopics, $topic); + } + } + + if (count($selectedTopics) == 0) + { + // Kein Themenabschnitt gewhlt + $tpl->addTemplates(Array('content' => 'zufallsfragen-error')); + + return; + } + + // Sessiondaten lschen + unset($_SESSION['zufallsfragen']); + unset($_SESSION['frage_nr']); + unset($_SESSION['fragen_cnt']); + unset($_SESSION['zufallstats']); + unset($_SESSION['bogen']); + + // Sessions-Variablen initialisieren + $_SESSION['zufallsfragen'] = array(); + $_SESSION['frage_nr'] = 1; + $_SESSION['zufallstats'] = array('Richtig' => '0', 'Falsch' => '0'); + + $tpl->addTemplates(Array('content' => 'zufallsfragen-frage')); + + // Fragen holen + $inClauseParams = implode(',', array_fill(0, count($selectedTopics), '?')); + $inClauseTypes = str_repeat('i', count($selectedTopics)); + $params = array_merge(array('i'.$inClauseTypes, $_SESSION['jahr']), $selectedTopics); + + $stmt = $GLOBALS['db']->prepare('SELECT ID FROM fragen WHERE Jahr = ? AND Abschnitt IN (' . $inClauseParams . ')'); + callBindParamArray($stmt, $params); + $stmt->execute(); + $stmt->bind_result($id); + + // Fragen in Array bertragen + while ($stmt->fetch()) { + array_push($_SESSION['zufallsfragen'], $id); + } + $stmt->close(); + + // Fragen zufllig mischen + shuffle($_SESSION['zufallsfragen']); + + // Nur gewhlte Anzahl Fragen zulassen + if ($_REQUEST['fragen'] > 0 && $_REQUEST['fragen'] < count($_SESSION['zufallsfragen'])) { + $_SESSION['zufallsfragen'] = array_slice($_SESSION['zufallsfragen'], 0, $_REQUEST['fragen']); + } + + // Anzahl in Session speichern + $_SESSION['fragen_cnt'] = count($_SESSION['zufallsfragen']); + + // Erste Frage stellen + SingleQuestion($_SESSION['zufallsfragen'][0], $_SESSION['frage_nr'], $_SESSION['fragen_cnt']); + + return; + +} + +// Startseite mit Abschnittsauswahl +$tpl->addVars('navZufallNeu', 'current'); +$abschnitte = getTopics(); +$topicCount = getSingleResult('SELECT COUNT(*) AS Cnt FROM abschnitte WHERE Jahr = ?', + array('i', $_SESSION['jahr'])); +$maxFragen = getSingleResult('SELECT COUNT(*) AS Cnt FROM fragen WHERE Jahr = ?', + array('i', $_SESSION['jahr'])); + +$tpl->addVars(Array( + 'abschnitteAnz' => $topicCount, + 'maxFragen' => $maxFragen +)); + +$tpl->addTemplates('content', 'zufallsfragen-start'); + +foreach ($abschnitte as $nr => $description) { + $tpl->addVars(Array( + 'abschnittNr' => $nr, + 'abschnittDesc' => htmlspecialchars($description) + )); + + $tpl->parseBlock('content', 'Abschnitte', 'Row', TRUE); +}