* -------------------------------------------------------------------- *
* Kurzbeschreibung : Funktionen zum Umgang mit XML-Templates *
* -------------------------------------------------------------------- *
- * $Revision:: $ *
- * $Date:: $ *
- * $Tag:: 0.2.1-FINAL $ *
- * $Author:: $ *
- * -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
initXml();
// Generate FQFN for with special path
- $FQFN = sprintf("%stemplates/xml/%s%s.xml",
+ $FQFN = sprintf('%stemplates/xml/%s%s.xml',
getPath(),
detectExtraTemplatePath('xml', $template),
$template
// Is the file readable?
if (!isFileReadable($FQFN)) {
// No, use without extra path
- $FQFN = sprintf("%stemplates/xml/%s.xml",
+ $FQFN = sprintf('%stemplates/xml/%s.xml',
getPath(),
$template
);
addXmlSpecialElements($template);
// Call the call-back function
- doCallXmlCallbackFunction($content);
+ doCallXmlCallbackFunction();
} else {
// Template not found
displayMessage('{%message,XML_TEMPLATE_404=' . $template . '%}');
// Parses the XML content
function parseXmlData ($content) {
// Is there recode?
- if (!function_exists('recode')) {
+ if (!isPhpExtensionLoaded('recode')) {
// No fallback ATM
reportBug(__FUNCTION__, __LINE__, 'PHP extension recode is missing. Please install it.');
} // END - if
// "Getter" for JOIN statement
function getSqlXmlJoinedTable ($tableJoinType, $tableJoinName, $joinOnLeftTable, $joinOnCondition, $joinOnRightTable) {
// Are all set?
- assert((count($tableJoinType) > 0) && (count($tableJoinName) > 0) && (count($joinOnLeftTable) > 0) && (count($joinOnCondition) > 0) && (count($joinOnRightTable) > 0));
+ assert((isFilledArray($tableJoinType)) && (isFilledArray($tableJoinName)) && (isFilledArray($joinOnLeftTable)) && (isFilledArray($joinOnCondition)) && (isFilledArray($joinOnRightTable)));
// Init SQL
$sql = '';
$sql = '';
// Are there some conditions?
- if (count($whereColumns) > 0) {
+ if (isFilledArray($whereColumns)) {
// Then add these as well
if (count($whereColumns) == 1) {
// One entry found
// Add the rest
$sql .= '`' . $whereColumns[0]['column'] . '`' . $whereColumns[0]['condition'] . chr(39) . $whereColumns[0]['look_for'] . chr(39);
- } elseif ((count($whereColumns > 1)) && (count($conditions) > 0)) {
+ } elseif ((count($whereColumns > 1)) && (isFilledArray($conditions))) {
// More than one "WHERE" + condition found
foreach ($whereColumns as $idx => $columnArray) {
// Default is WHERE
// Is the condition element there?
if (isset($conditions[$columnArray['column']])) {
// Assume the condition
- $condition .= ' ' . $conditions[$columnArray['column']] . ' ';
+ $condition = ' ' . $conditions[$columnArray['column']] . ' ';
} // END - if
// Add to SQL query
- die($sql.'/'.$condition);
$sql .= $condition;
// Table/alias included?
$sql = '';
// Are there entries from orderByColumns to add?
- if (count($orderByColumns) > 0) {
+ if (isFilledArray($orderByColumns)) {
// Add them as well
$sql .= ' ORDER BY ';
foreach ($orderByColumns as $orderByColumn => $array) {