Example #1
0
/**
* Compiles a list of the items you have selected to permanently delte
*/
function viewrestoreTrash($cid, $mid, $option)
{
    global $database, $mainframe;
    // seperate contentids
    $cids = implode(',', $cid);
    $mids = implode(',', $mid);
    if ($cids) {
        // Content Items query
        $query = "SELECT a.title AS name" . "\n FROM #__content AS a" . "\n WHERE ( a.id IN (" . $cids . ") )" . "\n ORDER BY a.title";
        $database->setQuery($query);
        $items = $database->loadObjectList();
        $id = $cid;
        $type = "content";
    } else {
        if ($mids) {
            // Content Items query
            $query = "SELECT a.name" . "\n FROM #__menu AS a" . "\n WHERE ( a.id IN (" . $mids . ") )" . "\n ORDER BY a.name";
            $database->setQuery($query);
            $items = $database->loadObjectList();
            $id = $mid;
            $type = "menu";
        }
    }
    HTML_trash::showRestore($option, $id, $items, $type);
}
/**
* Compiles a list of the items you have selected to permanently delte
*/
function viewrestoreTrash($cid, $mid, $option)
{
    global $database;
    if (!in_array(0, $cid)) {
        // Content Items query
        mosArrayToInts($cid);
        $cids = 'a.id=' . implode(' OR a.id=', $cid);
        $query = "SELECT a.title AS name" . "\n FROM #__content AS a" . "\n WHERE ( {$cids} )" . "\n ORDER BY a.title";
        $database->setQuery($query);
        $items = $database->loadObjectList();
        $id = $cid;
        $type = "content";
    } else {
        if (!in_array(0, $mid)) {
            // Content Items query
            mosArrayToInts($mid);
            $mids = 'a.id=' . implode(' OR a.id=', $mid);
            $query = "SELECT a.name" . "\n FROM #__menu AS a" . "\n WHERE ( {$mids} )" . "\n ORDER BY a.name";
            $database->setQuery($query);
            $items = $database->loadObjectList();
            $id = $mid;
            $type = "menu";
        }
    }
    HTML_trash::showRestore($option, $id, $items, $type);
}
/**
* Compiles a list of the items you have selected to permanently delte
*/
function viewrestoreTrash($cid, $mid, $option)
{
    global $mainframe;
    $db =& JFactory::getDBO();
    $return = JRequest::getCmd('return', 'viewContent', 'post');
    JArrayHelper::toInteger($cid, array(0));
    JArrayHelper::toInteger($mid, array(0));
    // seperate contentids
    $cids = implode(',', $cid);
    $mids = implode(',', $mid);
    if ($cids) {
        // Articles query
        $query = 'SELECT a.title AS name' . ' FROM #__content AS a' . ' WHERE ( a.id IN ( ' . $cids . ' ) )' . ' ORDER BY a.title';
        $db->setQuery($query);
        $items = $db->loadObjectList();
        $id = $cid;
        $type = "content";
    } else {
        if ($mids) {
            // Articles query
            $query = 'SELECT a.name' . ' FROM #__menu AS a' . ' WHERE ( a.id IN ( ' . $mids . ' ) )' . ' ORDER BY a.name';
            $db->setQuery($query);
            $items = $db->loadObjectList();
            $id = $mid;
            $type = "menu";
        }
    }
    HTML_trash::showRestore($option, $id, $items, $type, $return);
}