/** * Form for copying item(s) **/ function copyItem($cid, $sectionid, $option) { global $database, $adminLanguage; if (!is_array($cid) || count($cid) < 1) { echo "<script> alert(\"" . $adminLanguage->A_COMP_CONTENT_SEL_MOVE . "\"); window.history.go(-1);</script>\n"; exit; } //seperate contentids $cids = implode(',', $cid); ## Content Items query $query = "SELECT a.title" . "\n FROM #__content AS a" . "\n WHERE ( a.id IN (" . $cids . ") )" . "\n ORDER BY a.title"; $database->setQuery($query); $items = $database->loadObjectList(); ## Section & Category query $query = "SELECT CONCAT_WS(',',s.id,c.id) AS `value`, CONCAT_WS(' // ', s.name, c.name) AS `text`" . "\n FROM #__sections AS s" . "\n INNER JOIN #__categories AS c ON c.section = s.id" . "\n WHERE s.scope='content'" . "\n ORDER BY s.name, c.name"; $database->setQuery($query); $rows = $database->loadObjectList(); // build the html select list $sectCatList = mosHTML::selectList($rows, 'sectcat', 'class="inputbox" size="10"', 'value', 'text', NULL); HTML_content::copySection($option, $cid, $sectCatList, $sectionid, $items); }