Go to the documentation of this file.00001 <?php
00002
00003 $aColumns = array( 'container1' => array(
00004 array( 'oxtitle', 'oxcategories', 1, 1, 0 ),
00005 array( 'oxdesc', 'oxcategories', 1, 1, 0 ),
00006 array( 'oxid', 'oxcategories', 0, 0, 1 )
00007 )
00008 );
00012 class ajaxComponent extends ajaxListComponent
00013 {
00019 protected function _getQuery()
00020 {
00021 $oCat = oxNew('oxcategory');
00022 $oCat->setLanguage( oxConfig::getParameter('editlanguage') );
00023
00024 $sCategoriesTable = $oCat->getViewName();
00025 return " from $sCategoriesTable where ".$oCat->getSqlActiveSnippet();
00026 }
00027
00033 public function unassignCat()
00034 {
00035 $sShopId = oxConfig::getParameter( 'oxid');
00036 $oShop = oxNew('oxshop');
00037 if ($oShop->load($sShopId)) {
00038 $oShop->oxshops__oxdefcat = new oxField('');
00039 $oShop->save();
00040 }
00041 }
00042
00048 public function assignCat()
00049 {
00050 $sChosenCat = oxConfig::getParameter( 'oxcatid' );
00051 $sShopId = oxConfig::getParameter( 'oxid');
00052 $oShop = oxNew('oxshop');
00053 if ($oShop->load($sShopId)) {
00054 $oShop->oxshops__oxdefcat = new oxField($sChosenCat);
00055 $oShop->save();
00056 }
00057 }
00058 }