Exemple #1
0
/**
* Form for moving item(s) to a different section and category
*/
function moveSection($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();
    $database->setQuery($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");
    $rows = $database->loadObjectList();
    // build the html select list
    $sectCatList = mosHTML::selectList($rows, 'sectcat', 'class="inputbox" size="8"', 'value', 'text', null);
    HTML_content::moveSection($cid, $sectCatList, $option, $sectionid, $items);
}