Ejemplo n.º 1
0
             $data['manufacturers_id'][] = $row[0];
         }
         $qry = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_multishop_configuration_values', 'page_uid=' . $_GET['page_uid']);
         $content .= '<li>Settings removed</li>';
         $qry = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_multishop_specials', 'page_uid=' . $_GET['page_uid']);
         $content .= '<li>Specials removed</li>';
         foreach ($data['categories_id'] as $id) {
             $tmp = mslib_befe::deleteCategory($id);
         }
         $content .= '<li>Categories removed</li>';
         foreach ($data['products_id'] as $id) {
             $tmp = mslib_befe::deleteProduct($id);
         }
         $content .= '<li>Products removed</li>';
         foreach ($data['manufacturers_id'] as $id) {
             $tmp = mslib_befe::deleteManufacturer($id);
         }
         $content .= '<li>Manufacturers removed</li>';
         $content .= '</ul></fieldset>';
     }
     // clears the current multishop data eof
     break;
 case 'restore':
     // restore database
     if ($this->post['action'] == 'restore' and is_numeric($this->post['page_uid']) and ($_FILES['restore_file']['tmp_name'] or $this->post['custom_file'])) {
         // unzip first
         if (!$_FILES['restore_file']['error'] or $this->post['custom_file']) {
             $backup_folder = 'restore_' . date("Y-m-d_G-i-s") . '-' . md5(uniqid());
             $fullpath = PATH_site . 'uploads/tx_multishop/tmp/' . $backup_folder;
             \TYPO3\CMS\Core\Utility\GeneralUtility::mkdir($fullpath);
             $content .= 'Restoring:<BR>' . $fullpath;
Ejemplo n.º 2
0
} else {
    $template = $this->cObj->fileResource(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'templates/admin_manufacturers.tmpl');
}
// Extract the subparts from the template
$subparts = array();
$subparts['template'] = $this->cObj->getSubpart($template, '###TEMPLATE###');
$subparts['results'] = $this->cObj->getSubpart($subparts['template'], '###RESULTS###');
$subparts['noresults'] = $this->cObj->getSubpart($subparts['template'], '###NORESULTS###');
$subparts['manufacturers'] = $this->cObj->getSubpart($subparts['results'], '###MANUFACTURERS###');
if (is_numeric($this->get['status']) and is_numeric($this->get['manufacturers_id'])) {
    $updateArray = array();
    $updateArray['status'] = $this->get['status'];
    $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_manufacturers', 'manufacturers_id=\'' . $this->get['manufacturers_id'] . '\'', $updateArray);
    $res = $GLOBALS['TYPO3_DB']->sql_query($query);
} elseif (is_numeric($this->get['delete']) and is_numeric($this->get['manufacturers_id'])) {
    mslib_befe::deleteManufacturer($this->get['manufacturers_id']);
}
if ($this->get['Search'] and $this->get['limit'] != $this->cookie['limit']) {
    $this->cookie['limit'] = $this->get['limit'];
    $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_multishop_cookie', $this->cookie);
    $GLOBALS['TSFE']->storeSessionData();
}
if ($this->cookie['limit']) {
    $this->get['limit'] = $this->cookie['limit'];
} else {
    $this->get['limit'] = 10;
}
$this->ms['MODULES']['PAGESET_LIMIT'] = $this->get['limit'];
if (is_numeric($this->get['p'])) {
    $p = $this->get['p'];
}