$step->setExplanation($lang->get("wze_articleimport_target", "On the right you need to select the target channel. All imported articles will be stored within this channel.")); ////// STEP 2 ////// $step2 = new Step(); $step2->setTitle($lang->get("wzt_articleimport_srctype", "Select source type")); $step2->setExplanation($lang->get("wze_articleimport_srctype", "Please select the type of source you want to import the articles from.")); $source_types[0][0] = $lang->get("multipage", "Multipage"); $source_types[0][1] = "PAGE"; //$source_types[1][0] = $lang->get("channel"); //$source_types[1][1] = "CHANNEL"; //$source_types[2][0] = $lang->get("cluster"); //$source_types[2][1] = "CLUSTER"; $step2->add(new WZRadio("source_type", $source_types)); ////// Step 3 ////// // determine singlepages $sql = "Select distinct sm.MENU_ID FROM sitemap sm, sitepage_master spm WHERE sm.SPM_ID = spm.SPM_ID and sm.VERSION=0"; $query = new query($db, $sql); $sourcePages = array(); while ($query->getrow()) { $sourcePages[] = array(backTrail($query->field("MENU_ID")), $query->field("MENU_ID")); } sort($sourcePages); $step3 = new Step(); $step3->add(new WZSelect("menuid", $lang->get("wz_imp_selcl", "Zu importierenden Knoten wählen"), $sourcePages)); $stepx = new STImportToChannel(); $wizard->add($step); $wizard->add($step2); $wizard->add($step3); $wizard->add($stepx); $page->add($wizard); $page->draw(); echo $errors;
function backTrail($menu) { global $db; $result = getDBCell("sitemap", "NAME", "MENU_ID = $menu"); $parent = getDBCell("sitemap", "PARENT_ID", "MENU_ID = $menu"); if ($parent != 0 && $parent != "" && $parent != "0" && $parent != $menu) $result = backTrail($parent). " > " . $result; return $result; }
$parents = parentClusters($clnids, $level + 1); $clnids = array_merge($clnids, $parents); if (is_array($clnids)) { $clnids = array_unique($clnids); } return $clnids; } $pclusters = parentClusters($clusters, 0); $clusters = array_merge($pclusters, $clusters); $clusters = array_unique($clusters); for ($j = 0; $j < count($clusters); $j++) { $spids = createDBCArray("sitepage", "SPID", "CLNID = " . $clusters[$j]); for ($k = 0; $k < count($spids); $k++) { $iname = getDBCell("sitepage_names", "NAME", "VARIATION_ID=1 AND SPID = " . $spids[$k]); $menu = getDBCell("sitepage", "MENU_ID", "SPID = " . $spids[$k]); $linktext = backTrail($menu); $spm = getDBCell("sitepage", "SPM_ID", "SPID = " . $spids[$k]); $spmtype = getDBCell("sitepage_master", "SPMTYPE_ID", "SPM_ID = " . $spm); if ($iname != "" && $spmtype != 1) { $linktext = $linktext . " > " . $iname; } $linkhref = $c["docroot"] . "modules/sitepages/sitepagebrowser.php?sid={$sid}&jump=go&oid=" . $spids[$k]; $link = "<a href=\"#\" onClick=\"window.opener.document.location.href='" . $linkhref . "';return false;\">{$linktext}</a>"; $form->add(new Label("lbl", $link, "standardlight", 2)); } } // process channels $ids = createNameValueArrayEx("channel_articles", "TITLE", "CHID", "ARTICLE_ID={$oid}"); for ($i = 0; $i < count($ids); $i++) { $title = $lang->get("channel", "Channel") . " " . getDBCell("channels", "NAME", "CHID=" . $ids[$i][1]) . " > " . $ids[$i][0]; $link = '<a href="#" onClick="window.opener.document.location.href=\'' . $c["docroot"] . "modules/channels/edit.php?sid=" . $sid . '&go=update&oid=' . $oid . '&setch=' . $ids[$i][1] . '\';return false;">' . $title . '</a>';