Das nervte beim duplizieren:
vom Standart-Temp.
zum Kontakt-Temp.
oder Sitemap-Temp.
...
Aus dem Gründ Beantrage ich folgende Änderung

an der Datei:
'contenido/includes/functions.tpl.php'
in der Funktion:
tplDuplicateTemplate($idtpl)
(an drei Punkten muss etwas ergänzt werden)
Code: Alles auswählen
function tplDuplicateTemplate($idtpl) {
global $db, $client, $lang, $cfg, $sess, $auth;
$db2 = new DB_Contenido;
$sql = "SELECT
*
FROM
".$cfg["tab"]["tpl"]."
WHERE
idtpl = '".$idtpl."'";
$db->query($sql);
$db->next_record();
$idclient = $db->f("idclient");
$idlay = $db->f("idlay");
$new_idtpl = $db->nextid($cfg["tab"]["tpl"]);
# <- START Block --------
$idtpl_conf = $db->f("idtplcfg");
if($idtpl_conf) $new_idtpl_conf = $db->nextid($cfg["tab"]["tpl_conf"]);
# <- END Block --------
$name = sprintf(i18n("%s (Copy)"), $db->f("name"));
$descr = $db->f("description");
$author = $auth->auth["uname"];
$created = time();
$lastmod = time();
# <- ERGÄNZEN : idtplcfg -> $new_idtpl
$sql = "INSERT INTO
".$cfg["tab"]["tpl"]."
(idclient, idlay, idtpl, ".($idtpl_conf?'idtplcfg,':'')." name, description, deletable,author, created, lastmodified)
VALUES
('".$idclient."', '".$idlay."', '".$new_idtpl."', ".($idtpl_conf?"'".$new_idtpl_conf."', ":'')."'".$name."', '".$descr."', '1', '".$author."', '".$created."', '".$lastmod."')";
$db->query($sql);
$a_containers = array();
$sql = "SELECT
*
FROM
".$cfg["tab"]["container"]."
WHERE
idtpl = '".$idtpl."'
ORDER BY
number";
$db->query($sql);
while ($db->next_record()) {
$a_containers[$db->f("number")] = $db->f("idmod");
}
foreach ($a_containers as $key => $value) {
$nextid = $db->nextid($cfg["tab"]["container"]);
$sql = "INSERT INTO ".$cfg["tab"]["container"]."
(idcontainer, idtpl, number, idmod) VALUES ('".$nextid."', '".$new_idtpl."', '".$key."', '".$value."')";
$db->query($sql);
}
# <- START Block ----------------------------------
if($idtpl_conf) {
$a_container_cfg = array();
$sql = "SELECT
*
FROM
".$cfg["tab"]["container_conf"]."
WHERE
idtplcfg = '".$idtpl_conf."'
ORDER BY
number";
$db->query($sql);
while ($db->next_record()) {
$a_container_cfg[$db->f("number")] = $db->f("container");
}
foreach ($a_container_cfg as $key => $value) {
$nextid = $db->nextid($cfg["tab"]["container_conf"]);
$sql = "INSERT INTO ".$cfg["tab"]["container_conf"]."
(idcontainerc, idtplcfg, number, container) VALUES ('".$nextid."', '".$new_idtpl_conf."', '".$key."', '".$value."')";
$db->query($sql);
}
}
# <- END Block ----------------------------------
cInclude ("includes", "functions.rights.php");
copyRightsForElement("tpl", $idtpl, $new_idtpl);
return $new_idtpl;
}
@emergence:
($idtpl_conf = 0 ) kopiere keine Konfigs
Über Kommentare würde ich mich freuen.
Alle Kommentare werden hier ergänzt und unter Updates aufgelistet.
mfg
Oli