diff --git a/trunk/conlite/classes/class.csv.php b/trunk/conlite/classes/class.csv.php
index 657dc52..eba7337 100644
--- a/trunk/conlite/classes/class.csv.php
+++ b/trunk/conlite/classes/class.csv.php
@@ -1,15 +1,9 @@
_delimiter = ";";
- }
-
- function setRow ($row)
- {
- $args = func_num_args();
-
- for ($arg=1;$arg<$args;$arg++)
- {
- $ma = func_get_arg($arg);
- $this->setCell($row, $arg, $ma);
- }
- }
-
- function setCell($row, $cell, $data)
- {
- $row = Contenido_Security::escapeDB($row);
- $cell = Contenido_Security::escapeDB($cell);
- $data = Contenido_Security::escapeDB($data);
-
- $data = str_replace('"', '""', $data);
- $this->_data[$row][$cell] = '"'.$data.'"';
- }
-
- function setDelimiter ($delimiter)
- {
- $this->_delimiter = $delimiter;
- }
-
- function make() {
+class CSV {
+
+ var $_data = array();
+ var $_delimiter;
+
+ public function __construct() {
+ $this->_delimiter = ";";
+ }
+
+ public function setRow($row) {
+ $args = func_num_args();
+
+ for ($arg = 1; $arg < $args; $arg++) {
+ $ma = func_get_arg($arg);
+ $this->setCell($row, $arg, $ma);
+ }
+ }
+
+ public function setCell($row, $cell, $data) {
+ $row = Contenido_Security::escapeDB($row);
+ $cell = Contenido_Security::escapeDB($cell);
+ $data = Contenido_Security::escapeDB($data);
+
+ $data = str_replace('"', '""', $data);
+ $this->_data[$row][$cell] = '"' . $data . '"';
+ }
+
+ public function setDelimiter($delimiter) {
+ $this->_delimiter = $delimiter;
+ }
+
+ public function make() {
$out = '';
foreach ($this->_data as $row => $line) {
$out .= implode($this->_delimiter, $line);
diff --git a/trunk/conlite/classes/drivers/class.gdb.driver.php b/trunk/conlite/classes/drivers/class.gdb.driver.php
index 75dd7fa..9631d0f 100644
--- a/trunk/conlite/classes/drivers/class.gdb.driver.php
+++ b/trunk/conlite/classes/drivers/class.gdb.driver.php
@@ -1,15 +1,9 @@
_sEncoding = $sEncoding;
- }
-
- function setItemClassInstance($oInstance) {
- $this->_oItemClassInstance = $oInstance;
- }
-
- function buildJoinQuery($destinationTable, $destinationClass, $destinationPrimaryKey, $sourceClass, $primaryKey) {
-
- }
-
- function buildOperator($sField, $sOperator, $sRestriction) {
+ public function setEncoding($sEncoding) {
+ $this->_sEncoding = $sEncoding;
+ }
+
+ public function setItemClassInstance($oInstance) {
+ $this->_oItemClassInstance = $oInstance;
+ }
+
+ public function buildJoinQuery($destinationTable, $destinationClass, $destinationPrimaryKey, $sourceClass, $primaryKey) {
- }
+ }
+ public function buildOperator($sField, $sOperator, $sRestriction) {
+
+ }
}
-
?>
diff --git a/trunk/conlite/includes/include.client_edit.php b/trunk/conlite/includes/include.client_edit.php
index 40a4485..bbc73ce 100644
--- a/trunk/conlite/includes/include.client_edit.php
+++ b/trunk/conlite/includes/include.client_edit.php
@@ -1,4 +1,5 @@
nextid($cfg["tab"]["clients"]);
$idclient = $nextid;
$new = true;
}
-if(!$perm->have_perm_area_action($area))
-{
- $notification->displayNotification("error", i18n("Permission denied"));
+if (!$perm->have_perm_area_action($area)) {
+ $notification->displayNotification("error", i18n("Permission denied"));
} else {
- if ( !isset($idclient) )
- {
- $notification->displayNotification("error", i18n("No client ID passed"));
- } else {
- if (($action == "client_edit") && ($perm->have_perm_area_action($area, $action)))
- {
- $sNewNotification = '';
- if ($active != "1")
- {
- $active = "0";
- }
-
- if ($new == true)
- {
-
- $sLangNotification = i18n('Notice: In order to use this client, you must create a new language for it.');
- $sTarget = $sess->url('frameset.php?area=lang');
- $sJsLink = "parent.parent.location.href='".$sTarget."';
+ if (!isset($idclient)) {
+ $notification->displayNotification("error", i18n("No client ID passed"));
+ } else {
+ if (($action == "client_edit") && ($perm->have_perm_area_action($area, $action))) {
+ $sNewNotification = '';
+ if ($active != "1") {
+ $active = "0";
+ }
+
+ if ($new == true) {
+
+ $sLangNotification = i18n('Notice: In order to use this client, you must create a new language for it.');
+ $sTarget = $sess->url('frameset.php?area=lang');
+ $sJsLink = "parent.parent.location.href='" . $sTarget . "';
top.header.markActive(top.header.document.getElementById('sub_lang'));";
- $sLangNotificationLink = sprintf(i18n('Please click %shere%s to create a new language.'), '', '');
- $sNewNotification = '
'.$sLangNotification.'
'.$sLangNotificationLink;
- if (substr($frontendpath, strlen($frontendpath)-1) != "/")
- {
- $frontendpath .= "/";
- }
-
- if (substr($htmlpath, strlen($htmlpath)-1) != "/")
- {
- $htmlpath .= "/";
- }
-
- $sql = "INSERT INTO
- ".$cfg["tab"]["clients"]."
+ $sLangNotificationLink = sprintf(i18n('Please click %shere%s to create a new language.'), '', '');
+ $sNewNotification = '
' . $sLangNotification . '
' . $sLangNotificationLink;
+ if (substr($frontendpath, strlen($frontendpath) - 1) != "/") {
+ $frontendpath .= "/";
+ }
+
+ if (substr($htmlpath, strlen($htmlpath) - 1) != "/") {
+ $htmlpath .= "/";
+ }
+
+ $sql = "INSERT INTO
+ " . $cfg["tab"]["clients"] . "
SET
- name = '".Contenido_Security::escapeDB($clientname, $db)."',
- frontendpath = '".Contenido_Security::escapeDB($frontendpath, $db)."',
- htmlpath = '".Contenido_Security::escapeDB($htmlpath, $db)."',
- errsite_cat = '".Contenido_Security::toInteger($errsite_cat)."',
- errsite_art = '".Contenido_Security::toInteger($errsite_art)."',
- idclient = '".Contenido_Security::toInteger($idclient)."'";
-
- $properties->setValue("idclient", $idclient, "backend", "clientimage", $clientlogo);
-
- // Copy the client template to the real location
- $destPath = $frontendpath;
- $sourcePath = $cfg['path']['contenido'] . $cfg['path']['frontendtemplate'];
-
- if($copytemplate) {
- if(!file_exists($destPath)) {
- if(recursive_copy($sourcePath, $destPath)) {
- $res = fopen($destPath."config.php","rb+");
- $res2 = fopen($destPath."config.php.new", "ab+");
- if($res && $res2) {
- while(!feof($res)) {
- $buffer = fgets($res, 4096);
- $buffer = str_replace("!CLIENT!", $idclient, $buffer);
- $buffer = str_replace("!PATH!", $cfg["path"]["contenido"], $buffer);
- fwrite($res2, $buffer);
+ name = '" . Contenido_Security::escapeDB($clientname, $db) . "',
+ frontendpath = '" . Contenido_Security::escapeDB($frontendpath, $db) . "',
+ htmlpath = '" . Contenido_Security::escapeDB($htmlpath, $db) . "',
+ errsite_cat = '" . Contenido_Security::toInteger($errsite_cat) . "',
+ errsite_art = '" . Contenido_Security::toInteger($errsite_art) . "',
+ idclient = '" . Contenido_Security::toInteger($idclient) . "'";
+
+ $properties->setValue("idclient", $idclient, "backend", "clientimage", $clientlogo);
+
+ // Copy the client template to the real location
+ $destPath = $frontendpath;
+ $sourcePath = $cfg['path']['contenido'] . $cfg['path']['frontendtemplate'];
+
+ if ($copytemplate) {
+ if (!file_exists($destPath)) {
+ if (recursive_copy($sourcePath, $destPath)) {
+ $res = fopen($destPath . "config.php", "rb+");
+ $res2 = fopen($destPath . "config.php.new", "ab+");
+ if ($res && $res2) {
+ while (!feof($res)) {
+ $buffer = fgets($res, 4096);
+ $buffer = str_replace("!CLIENT!", $idclient, $buffer);
+ $buffer = str_replace("!PATH!", $cfg["path"]["contenido"], $buffer);
+ fwrite($res2, $buffer);
+ }
+ } else {
+ $notification->displayNotification("error", i18n("Couldn't write the file config.php."));
+ }
+
+ fclose($res);
+ fclose($res2);
+
+ unlink($destPath . "config.php");
+ rename($destPath . "config.php.new", $destPath . "config.php");
+ $message = sprintf(i18n("Succesfully copied client-template to %s."), $destPath);
+ $notification->displayNotification("info", $message);
+ } else {
+ $message = sprintf(i18n("Cannot create directory %s . The client was created, but you have to copy the frontend-template yourself"), $destPath);
+ $notification->displayNotification("warning", $message);
+ }
+ } else {
+ $message = sprintf(i18n("The directory %s already exists. The client was created, but you have to copy the frontend-template yourself"), $destPath);
+ $notification->displayNotification("warning", $message);
}
} else {
- $notification->displayNotification("error",i18n("Couldn't write the file config.php."));
+ $message = sprintf(i18n("Client '%s' created."), $clientname);
+ $notification->displayNotification("info", $message);
}
-
- fclose($res);
- fclose($res2);
-
- unlink($destPath."config.php");
- rename($destPath."config.php.new", $destPath."config.php");
- $message = sprintf(i18n("Succesfully copied client-template to %s."),$destPath);
- $notification->displayNotification("info", $message);
+ rereadClients();
} else {
- $message = sprintf(i18n("Cannot create directory %s . The client was created, but you have to copy the frontend-template yourself"),$destPath);
- $notification->displayNotification("warning", $message);
- }
- } else {
- $message = sprintf(i18n("The directory %s already exists. The client was created, but you have to copy the frontend-template yourself"),$destPath);
- $notification->displayNotification("warning", $message);
- }
- } else {
- $message = sprintf(i18n("Client '%s' created."),$clientname);
- $notification->displayNotification("info", $message);
- }
- rereadClients();
-} else {
- $pathwithoutslash = $frontendpath;
- if (substr($frontendpath, strlen($frontendpath)-1) != "/")
- {
- $frontendpath .= "/";
- }
-
- if (substr($htmlpath, strlen($htmlpath)-1) != "/")
- {
- $htmlpath .= "/";
- }
-
- if (($oldpath != $frontendpath) && ($oldpath != $pathwithoutslash))
- {
- $notification->displayNotification("warning", i18n("You changed the client path. You might need to copy the frontend to the new location"));
-
- }
- $sql = "UPDATE
- ".$cfg["tab"]["clients"]."
- SET
- name = '".Contenido_Security::escapeDB($clientname, $db)."',
- frontendpath = '".Contenido_Security::escapeDB($frontendpath, $db)."',
- htmlpath = '".Contenido_Security::escapeDB($htmlpath, $db)."',
- errsite_cat = '".Contenido_Security::toInteger($errsite_cat)."',
- errsite_art = '".Contenido_Security::toInteger($errsite_art)."'
- WHERE
- idclient = '".Contenido_Security::toInteger($idclient)."'";
- }
-
- $db->query($sql);
- $new = false;
- rereadClients();
-
- $properties->setValue("idclient", $idclient, "backend", "clientimage", $clientlogo);
-
- /* Clear the con_code table */
- $sql = "DELETE FROM ".$cfg["tab"]["code"]." WHERE idclient = '".Contenido_Security::toInteger($idclient)."'";
- $db->query($sql);
-
- $notification->displayNotification("info", i18n("Changes saved").$sNewNotification);
-
- $cApiClient = new cApiClient;
- $cApiClient->loadByPrimaryKey($idclient);
-
- if(isset($_REQUEST["generate_xhtml"])) {
- switch($_REQUEST["generate_xhtml"]) {
- case "html":
- $cApiClient->setProperty("generator", "xhtml", "false");
- $cApiClient->setProperty("generator", "html5", "false");
- break;
-
- case "xhtml":
- $cApiClient->setProperty("generator", "xhtml", "true");
- $cApiClient->setProperty("generator", "html5", "false");
- break;
-
- case "html5":
- $cApiClient->setProperty("generator", "xhtml", "false");
- $cApiClient->setProperty("generator", "html5", "true");
- break;
+ $pathwithoutslash = $frontendpath;
+ if (substr($frontendpath, strlen($frontendpath) - 1) != "/") {
+ $frontendpath .= "/";
+ }
- default: // do nothing
- break;
- }
- }
- }
-
-
- $tpl->reset();
-
- $sql = "SELECT
+ if (substr($htmlpath, strlen($htmlpath) - 1) != "/") {
+ $htmlpath .= "/";
+ }
+
+ if (($oldpath != $frontendpath) && ($oldpath != $pathwithoutslash)) {
+ $notification->displayNotification("warning", i18n("You changed the client path. You might need to copy the frontend to the new location"));
+ }
+ $sql = "UPDATE
+ " . $cfg["tab"]["clients"] . "
+ SET
+ name = '" . Contenido_Security::escapeDB($clientname, $db) . "',
+ frontendpath = '" . Contenido_Security::escapeDB($frontendpath, $db) . "',
+ htmlpath = '" . Contenido_Security::escapeDB($htmlpath, $db) . "',
+ errsite_cat = '" . Contenido_Security::toInteger($errsite_cat) . "',
+ errsite_art = '" . Contenido_Security::toInteger($errsite_art) . "'
+ WHERE
+ idclient = '" . Contenido_Security::toInteger($idclient) . "'";
+ }
+
+ $db->query($sql);
+ $new = false;
+ rereadClients();
+
+ $properties->setValue("idclient", $idclient, "backend", "clientimage", $clientlogo);
+
+ /* Clear the con_code table */
+ $sql = "DELETE FROM " . $cfg["tab"]["code"] . " WHERE idclient = '" . Contenido_Security::toInteger($idclient) . "'";
+ $db->query($sql);
+
+ $notification->displayNotification("info", i18n("Changes saved") . $sNewNotification);
+
+ $cApiClient = new cApiClient;
+ $cApiClient->loadByPrimaryKey($idclient);
+
+ if (isset($_REQUEST["generate_xhtml"])) {
+ switch ($_REQUEST["generate_xhtml"]) {
+ case "html":
+ $cApiClient->setProperty("generator", "xhtml", "false");
+ $cApiClient->setProperty("generator", "html5", "false");
+ break;
+
+ case "xhtml":
+ $cApiClient->setProperty("generator", "xhtml", "true");
+ $cApiClient->setProperty("generator", "html5", "false");
+ break;
+
+ case "html5":
+ $cApiClient->setProperty("generator", "xhtml", "false");
+ $cApiClient->setProperty("generator", "html5", "true");
+ break;
+
+ default: // do nothing
+ break;
+ }
+ }
+ }
+
+
+ $tpl->reset();
+
+ $sql = "SELECT
idclient, name, frontendpath, htmlpath, errsite_cat, errsite_art
FROM
- ".$cfg["tab"]["clients"]."
+ " . $cfg["tab"]["clients"] . "
WHERE
- idclient = '".Contenido_Security::toInteger($idclient)."'";
-
- $db->query($sql);
-
- $db->next_record();
-
- $form = '