<?php
-/**
- * PrimeraApi
- * -------------------------------------------
- * Mit dieser Klasse ist ein einfacher Primeratransfer von Ihrem Account
- * zu dem Account eines bei Primusportal.de registrierten Mitglieds m�glich.
- *
- *------------------ Aenderungen durch Roland Haeder 09.08.2008 ----------------
- * Klasse umbenannt nach PrimeraApi, damit sie in das Framework besser passt.
- * Zudem sind alle oeffentlichen Attribute nun privat, der Konstruktor hat den
- * neuen "magischen" Namen __construct() und "normale" Konstanten sind nach
- * Klassenkonstanten umbenannt. Unsinnige else-Bloecke sind noch umgewandelt.
- * Methodennamen fangen nun immer mit einem kleinen Buchstaben an. Zudem sind
- * die Methoden Pay,Query und Parse umbenannt.
- *------------------ Aenderungen durch Roland Haeder 09.08.2008 ----------------
- *
- * Die Einbindung des Interfaces geschieht folgenderma�en:
- * 1. Einbindung der Klasse in Ihr PHP-Auszahlungsskript:
- * CODE:
- * require_once( "PFAD/ZU/DER/KLASSE/PrimeraApi.class.php" );
- * $PPUsername = "username"; // Ihr Username bei Primusportal
- * $PPPassword = "passwort"; // Ihr Passwort bei Primusportal
- *
- * $Interface = new PrimeraApi($PPUsername, $PPPassword);
- * 2. Durchf�hren einer Auszahlung:
- * CODE:
- * $Status = $Interface->payPrimera($PayReceiver, $PayAmount, $PayDescription);
- *
- * Wobei $PayReicer der Username des Empf�ngers bei
- * Primusportal.de ist. $PayAmount ist der gerundete( !! ) Betrag an Primera,
- * die der Empf�nger erhalten soll. $PayDescription ist eine von Ihnen
- * festgelegte kurze Beschreibung. Die L�nge dieses Textes darf 100 Zeichen
- * nicht �berschreiten. Beispiel:
- * $status = $Interface->payPrimera("garbage", 10000, "Auszahlung IhreSeite.de - id: 12345");
- * 3. �berpr�fung des Status (R�ckgabecode):
- * CODE:
- * if (!$status) {
- * // Ein Fehler ist aufgetreten
- * // Fehlerbehandlung hier einf�gen...
- * }else {
- * // Auszahlung erfolgreich durchgef�hrt
- * // F�hren Sie hier Ihre Datenbankabfragen durch, um die Auszahlung zu
- * // best�tigen...
- * }
- *
- * Die komplette R�ckgabe des Interfaces wird als assoziatives Array in der Klassen-
- * variable __data gespeichert:
- * __data => array('status' => R�ckgabecode (PI_DONE, PI_SENDER_ERROR, ...),
- * "statustext" => Status in Worten (z.B.: "Transaktion erfolgreich durchgef�hrt"),
- * ")
- *
- *
- * @author Andreas Schmidt <xxgarbagexx@web.de>
- * @author Roland Haeder <webmaster@ship-simu.org>
- * @version 1.0 - beta
- * @copyright (c) 2007 by Primusportal.de
- * @copyright (c) 2008 by Roland Haeder
- * @copyright 2009, 2010 by Mailer Developer Team
- */
-class PrimeraApi {
- /**
- * Fehler - Interfacebenutzer
- */
- const PI_ERROR = -1;
-
- /**
- * Statuscode f�r erfolgreich ausgef�hrte Transaktion
- */
- const PI_DONE = 200;
-
- /**
- * Fehler - User existiert nicht oder ist gesperrt
- */
- const PI_RECEIVER_ERROR = 301;
-
- /**
- * Sender-Account Fehler (User nicht existent, gesperrt, ...)
- */
- const PI_SENDER_ERROR = 401;
-
- /**
- * Betrag fehler
- */
- const PI_AMOUNT_ERROR = 501;
-
- /**
- * Zu wenig Primera
- */
- const PI_TOO_LESS_PRIMERA = 502;
-
- /**
- * User nicht aktiv oder existiert nicht
- */
- const PI_USER_CHECK_ERROR = 601;
-
- /**
- * User aktiv
- */
- const PI_USER_CHECK_OK = 602;
-
- /**
- * Primerastand erfolgreich geholt
- */
- const PI_GET_PRIMERA_DONE = 701;
-
- /**
- * URL f�r das Interface auf dem Primusserver:
- */
- var $host = 'http://www.primusportal.de';
- var $path = '/transfer.interface.2.0.php';
-
- var $errno = '0';
- var $err = '';
-
- var $separator = ':';
-
- var $username = '';
- var $password = '';
-
- var $data = array();
-
- var $headers = '';
-
- /**
- * Konstruktor
- */
- function PrimeraApi ($PPUsername, $PPPassword) {
- // Set data
- $this->username = $PPUsername;
- $this->password = $PPPassword;
- }
-
- /**
- * Anfrage senden und R�ckgabecode in Variable speichern
- */
- function queryApi ( $data = array() ) {
- // Base64-encode username and password hash
- $data['PrimusInterface_Username'] = base64_encode($this->username);
- $data['PrimusInterface_Password'] = base64_encode($this->password);
-
- // Send POST request
- $return = sendHttpPostRequest($this->host.$this->path, $data);
-
- // Convert the array into a full string
- $returnStr = implode(chr(10), $return);
-
- // Extract the real content, strip header away
- $content = explode('<!-- return-start -->', $returnStr);
-
- // Store headers away for debugging
- $this->headers = $content[0];
-
- // Return the content
- return $content[1];
- }
-
- /**
- * Funktion parst die R�ckgabe vom Transferskript:
- */
- function parseContent ( $content ) {
- $x = explode(chr(10), $content);
- $return = array();
- foreach ($x as $currentLine) {
- $line_exploded = explode(':', $currentLine,2);
- if (count($line_exploded) > 1) {
- $return[$line_exploded[0]] = $line_exploded[1];
- }
- }
- return $return;
- }
-
- /**
- * @param int/string $Receiver UserID / Username des Empf�ngers
- * @param int $Amount Betrag in ganzzahligen Primera
- * @param string $Description Beschreibung (Sichtbar in Einzelauflistung)
- */
- function payPrimera ($Receiver, $Amount, $Description = '') {
- $valid = FALSE;
- $postData = array('PrimusInterface_Action' => 'Pay',
- 'PrimusInterface_Receiver' => base64_encode($Receiver),
- 'PrimusInterface_Amount' => base64_encode($Amount),
- 'PrimusInterface_Description' => base64_encode($Description) );
-
- $postReturn = $this->parseContent( $this->queryApi($postData) );
-
- $this->data = $postReturn;
- if ($postReturn['status'] == '200') {
- $valid = TRUE;
- }
- return $valid;
- }
-
- /**
- * �berpr�ft den Status eines Primus-Users
- * - existiert der User
- * - ist er aktiv
- * @param string/int $User Userid / Username
- */
- function CheckPrimusUser($User) {
- $valid = FALSE;
- $postData = array('PrimusInterface_Action'=> 'CheckPrimusUser',
- 'PrimusInterface_CheckPrimusUser' => $User);
-
- $postReturn = $this->parseContent( $this->queryApi($postData) );
-
- $this->data = $postReturn;
-
- if ($postReturn['status'] == self::PI_USER_CHECK_OK) {
- $valid = TRUE;
- }
- return $valid;
- }
-
- /**
- * Die Funktion liefer den aktuellen Primerastand
- */
- function getPrimera() {
- $primera = FALSE;
- $postData = array( 'PrimusInterface_Action' => 'GetPrimera' );
- $postReturn = $this->parseContent( $this->queryApi($postData) );
-
- $this->data = $postReturn;
- if ($postReturn['status'] == self::PI_GET_PRIMERA_DONE) {
- $primera = $postReturn['primera'];
- }
- return $primera;
- }
-
- /**
- * Getter fuer data
- */
- function getData () {
- return $this->data;
- }
-}
-
-// [EOF]
-?>
+// @DEPRECATED
* @author Stefan Saasen <s@fase4.com>
* @see _refresh
*/
- function fase4_rdf () {
+ function __construct () {
// default Value, to be overwritten in set_refresh()
$this->_refresh = (time() - 1200);
$this->_clear_cItems();
// Expression call-back to handle jquery inclusion
function doExpressionJquery ($data) {
- // Default is compressed
+ // Default is uncompressed
$scriptName = 'jquery';
$data['output_mode'] = '';
$scriptName .= '-' . $data['value'];
} // END - if
- // Is debug mode enabled?
- if ((!isGetRequestElementSet('jquery')) && (!isSessionVariableSet('jquery'))) {
+ // Is debug-mode enabled and parameter/session key 'jquery' given?
+ if ((!isDebugModeEnabled()) || ((!isGetRequestElementSet('jquery')) && (!isSessionVariableSet('jquery')))) {
// Productive systems want minimized version
$scriptName .= '.min';
} else {
setSession('jquery', '1');
}
- // Complete script name
- $scriptName = sprintf('js/jquery/%s.js', $scriptName);
-
// Add {%url%} around it
- $replacer = sprintf('{%%url%s=%s?dummy=1%%}', $data['output_mode'], $scriptName);
+ $replacer = sprintf('{%%url%s=js/jquery/%s.js?dummy=1%%}', $data['output_mode'], $scriptName);
// Replace the code
$code = replaceExpressionCode($data, $replacer);
// Return the (maybe) replaced code
return $code;
}
+
+// Expression call-back to handle JavaScript inclusion
+function doExpressionJs ($data) {
+ die('<pre>'.print_r($data, TRUE));
+}
} // END - if
// Version number
-setThisExtensionVersion('1.0.4');
+setThisExtensionVersion('1.0.5');
// Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.8.6', '0.8.7', '0.8.8', '0.8.9', '0.9.0', '0.9.1', '0.9.2', '0.9.3', '0.9.4', '0.9.5', '0.9.6', '0.9.7', '0.9.8', '0.9.9', '1.0.0', '1.0.1', '1.0.2', '1.0.3', '1.0.4'));
+setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.8.6', '0.8.7', '0.8.8', '0.8.9', '0.9.0', '0.9.1', '0.9.2', '0.9.3', '0.9.4', '0.9.5', '0.9.6', '0.9.7', '0.9.8', '0.9.9', '1.0.0', '1.0.1', '1.0.2', '1.0.3', '1.0.4', '1.0.5'));
// Keep this extension always active!
setExtensionAlwaysActive('Y');
break;
case '0.2.1': // SQL queries for v0.2.1
- addConfigAddSql('css_php', "ENUM('DIRECT','FILE','INLINE') NOT NULL DEFAULT 'FILE'");
+ addConfigAddSql('css_php', "ENUM('DIRECT','FILE','INLINE','ASSET') NOT NULL DEFAULT 'FILE'");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Ausgabe der CSS-Dateien entweder per css.php oder sie sind direkt eingebunden.");
break;
case '0.6.5': // SQL queries for v0.6.5
- addConfigChangeSql('css_php', 'css_php', "ENUM('DIRECT','FILE','INLINE') NOT NULL DEFAULT 'FILE'");
+ addConfigChangeSql('css_php', 'css_php', "ENUM('DIRECT','FILE','INLINE','ASSET') NOT NULL DEFAULT 'FILE'");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Ausgabe der CSS-Dateien entweder per css.php oder sie sind direkt eingebunden.");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("jQuery aktualisiert.");
break;
+
+ case '1.0.5': // SQL queries for v1.0.5
+ addConfigChangeSql('css_php', 'css_php', "ENUM('DIRECT','FILE','INLINE','ASSET') NOT NULL DEFAULT 'FILE'");
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Ausgabe der CSS-Dateien entweder per css.php, als style-Tag, als minifiziertes Asset "kompiliert" oder sie sind direkt eingebunden.");
+ break;
} // END - switch
// [EOF]
</div>
</div>
-<script type="text/javascript" src="{%url=js/ajax-loader.js?dummy=1%}{%ext,version=sql_patches%}"></script>
+<script type="text/javascript" src="{%js=ajax-loader.js%}"></script>
<script type="text/javascript">
<!--
// These scripts shall be loaded
var scripts = new Array();
-scripts[0] = '{%url,js=js/ajax-common.js%}';
+scripts[0] = '{%js=ajax-common.js%}';
scripts[1] = '{%jquery,js=ui%}';
-scripts[2] = '{%url,js=js/admin-data.js%}';
-scripts[3] = '{%url,js=js/admin-common.js%}';
+scripts[2] = '{%js=admin-data.js%}';
+scripts[3] = '{%js=admin-common.js%}';
// This must be the last one
scripts[scripts.length] = '{%url,js=js.php?js=admin_ajax&admin_page=overview%}';
{%template,loadTemplate=admin_ajax_windows%}
-<script type="text/javascript" src="{%url=js/ajax-loader.js?dummy=1%}{%ext,version=sql_patches%}"></script>
+<script type="text/javascript" src="{%js=ajax-loader.js%}"></script>
<script type="text/javascript">
<!--
// These scripts shall be loaded
var scripts = new Array();
-scripts[0] = '{%url,js=js/ajax-common.js%}';
+scripts[0] = '{%js=ajax-common.js%}';
scripts[1] = '{%jquery,js=ui%}';
-scripts[2] = '{%url,js=js/admin-common.js%}';
+scripts[2] = '{%js=admin-common.js%}';
// This must be the last one
-scripts[scripts.length] = '{%url,js=js/admin-network-query-api.js%}';
+scripts[scripts.length] = '{%js=admin-network-query-api.js%}';
// Load all scripts
if (loadScripts(scripts) == true) {
</div>
</div>
-<script type="text/javascript" src="{%url=js/ajax-loader.js?dummy=1%}{%ext,version=sql_patches%}"></script>
+<script type="text/javascript" src="{%js=ajax-loader.js%}"></script>
<script type="text/javascript">
<!--
// These scripts shall be loaded
var scripts = new Array();
-scripts[0] = '{%url,js=js/ajax-common.js%}';
+scripts[0] = '{%js=ajax-common.js%}';
scripts[1] = '{%jquery,js=ui%}';
-scripts[2] = '{%url,js=js/install-data.js%}';
-scripts[3] = '{%url,js=js/install-common.js%}';
+scripts[2] = '{%js=install-data.js%}';
+scripts[3] = '{%js=install-common.js%}';
// This must be the last one
scripts[scripts.length] = '{%url,js=js.php?js=install_ajax&install_page=$content[install_page]%}';
<input type="button" class="form_submit" value="{--INSTALLER_SWITCH_AJAX--}" onclick="switchInstaller('ajax'); return false" />
</div>
-<script type="text/javascript" src="{%url=js/install-common.js?dummy=1%}{%ext,version=sql_patches%}"></script>
+<script type="text/javascript" src="{%js=install-common.js%}"></script>
</div>
</div>
-<script type="text/javascript" src="{%url=js/ajax-loader.js?dummy=1%}{%ext,version=sql_patches%}"></script>
+<script type="text/javascript" src="{%js=ajax-loader.js%}"></script>
<script type="text/javascript">
<!--
// These scripts shall be loaded
var scripts = new Array();
-scripts[0] = '{%url,js=js/ajax-common.js%}';
-scripts[1] = '{%url,js=js/ajax-test.js%}';
+scripts[0] = '{%js=ajax-common.js%}';
+scripts[1] = '{%js=ajax-test.js%}';
scripts[2] = '{%jquery,js=ui%}';
// Load all scripts
<script src="{%jquery%}{%ext,version=sql_patches%}" type="text/javascript"></script>
<script src="{%jquery,js=migrate-3.0.0%}{%ext,version=sql_patches%}" type="text/javascript"></script>
-<script src="{%url=js/core-common.js?dummy=1%}{%ext,version=sql_patches%}" type="text/javascript"></script>
-<script src="{%url=js/menu-common.js?dummy=1%}{%ext,version=sql_patches%}" type="text/javascript"></script>
+<script src="{%js=core-common.js%}" type="text/javascript"></script>
+<script src="{%js=menu-common.js%}" type="text/javascript"></script>