* @license http://www.contenido.org/license/LIZENZ.txt * @link http://www.4fb.de * @link http://www.contenido.org * @since file available since contenido release <= 4.6 * * {@internal * created 2003-12-10 * modified 2008-06-27, Frederic Schneider, add security fix * modified 2008-07-07, Dominik Ziegler, fixed language bug * modified 2009-11-06, Murat Purc, replaced deprecated functions (PHP 5.3 ready) * modified 2010-05-20, Murat Purc, removed request check during processing ticket [#CON-307] * * $Id$: * }} * */ if (!defined('CON_FRAMEWORK')) { die('Illegal call'); } if ($doedit == "1") { conSaveContentEntry ($idartlang, "CMS_IMG", $typenr, $CMS_IMG); conSaveContentEntry ($idartlang, "CMS_IMGDESCR", $typenr, $CMS_IMGDESCR); conMakeArticleIndex ($idartlang, $idart); conGenerateCodeForArtInAllCategories($idart); header("location:".$sess->url($cfg['path']['contenido_fullhtml']."external/backendedit/front_content.php?area=$tmp_area&idart=$idart&idcat=$idcat&changeview=edit&client=$client")); } ?> contenido contenido.css">
spacer.gif" width="10" height="10"> spacer.gif" width="10" height="10"> spacer.gif" width="10" height="10">
query($sql); $db->next_record(); $img_dir = $db->f("dirname"); } $sql = "SELECT * FROM ".$cfg["tab"]["upl"]." WHERE idclient='".$client."' AND filetype IN ('jpeg', 'jpg', 'gif', 'png') ORDER BY dirname, filename ASC"; $db->query($sql); $ds_name = Array(); $ds_lvl = array(); while ( $db->next_record() ) { $descr = $db->f("description"); if ( strlen($descr) > 24 ) { $descr = substr($descr, 0, 24); $descr .= ".."; } // collect data for dir selection $dirname = $db->f("dirname"); $tmp = explode('/', $dirname); $mypath = array(); $mylvl = 0; foreach ($tmp as $value) { if ($value != "") { /* Make sure an entry exists for each path component */ $mypath[]= $value; $thispath = implode("/", $mypath)."/"; if (!in_array($thispath, $ds_name)) { $mylvl++; $ds_lvl[$thispath] = $mylvl; $ds_name[$thispath] = $value; $ds_fullpath[$thispath] = $thispath; } } } if (!in_array($tmp[count($tmp)-2],$ds_name)) { $ds_lvl[$dirname] = count($tmp)-1; $ds_name[$dirname] = $tmp[count($tmp)-2]; $ds_fullpath[$dirname] = $db->f("dirname"); } if (strcmp($img_dir,$db->f("dirname"))==0) { $img_list[] = $db->f("filename"); $img_id[] = $db->f("idupl"); $img_descr[] = $descr; } } $form = new UI_Table_Form("editcontent", $cfg["path"]["contenido_fullhtml"].$cfg["path"]["includes"]."include.backendedit.php"); $form->setVar("lang",$lang); $form->setVar("typenr",$typenr); $form->setVar("idart",$idart); $form->setVar("idcat",$idcat); $form->setVar("idartlang",$idartlang); $form->setVar("contenido",$sess->id); $form->setVar("action",10); $form->setVar("doedit",1); $form->setVar("type",$type); $form->setVar("changeview","edit"); $form->setVar("CMS_LINK", $a_content["CMS_LINK"][$typenr]); $header = sprintf(i18n("Edit image for container %s"),$typenr); $form->addHeader($header); $dirselect = new cHTMLSelectElement("img_dir"); $dirselect->setEvent("change", "doedit.value=0; submit();"); $dirselect->setSize($dirheight); $dirselect->setStyle("width: {$dirwidth}px;"); foreach ($ds_lvl as $key => $value) { $text = str_repeat("-",$value*2)."> ".$ds_name[$key]; $option = new cHTMLOptionElement($text, $ds_fullpath[$key]); switch ($value) { case 0: case 1: $style="background-color:#C0C0C0;"; break; case 2: $style="background-color:#D0D0D0;"; break; case 3: $style="background-color:#E0E0E0;"; break; default: $style="background-color:#F0F0F0;"; break; } if (strcmp($img_dir,$ds_fullpath[$key])==0) { $option->setSelected("selected"); } $dirselect->addOptionElement($key, $option); } $script = '"; $fileselect = new cHTMLSelectElement("CMS_IMG"); $fileselect->setEvent("change", "disp_preview(this.value);"); $fileselect->setSize($fileheight); $fileselect->setStyle("width: {$filewidth}px;"); $option = new cHTMLOptionElement("-- ".i18n("None")." --", "0"); if ($a_content["CMS_IMG"][$typenr] == 0) { $option->setSelected("selected"); } $fileselect->addOptionElement(-1,$option); if (is_array($img_list)) { foreach ($img_list as $key => $value) { $description = $img_descr[$key]; if ($description != "") { $text = $value . " (". $description .")"; } else { $text = $value; } switch ($key % 2) { case 0: $style="background-color:#D0D0D0;"; break; case 1: $style="background-color:#E0E0E0;"; break; } $option = new cHTMLOptionElement($text, $img_id[$key]); if ($a_content["CMS_IMG"][$typenr]==$img_id[$key]) { $option->setSelected("selected"); } $option->setStyle($style); $fileselect->addOptionElement($key, $option); } } $form->add(i18n("Directory / File"), $dirselect->render().$script.$fileselect->render()); $textarea = new cHTMLTextarea("CMS_IMGDESCR", $a_content["CMS_IMGDESCR"][$typenr], $descrwidth, $descrheight); $form->add(i18n("Description"), $textarea->render()); $preview = ''; $form->add(i18n("Preview"), $preview); $form->render(false); ?>