shop_default_category.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00003 $aColumns = array( 'container1' => array(    // field , table,         visible, multilanguage, ident
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 
00023         $sCategoriesTable = $oCat->getViewName();
00024 
00025         $sSynchOxid = oxConfig::getParameter( 'synchoxid' );
00026 
00027         $sQAdd  = " from $sCategoriesTable where ".$oCat->getSqlActiveSnippet();
00028 
00029         return $sQAdd;
00030     }
00031 
00037     public function unassignCat()
00038     {
00039         $sShopId = oxConfig::getParameter( 'oxid');
00040         $oShop = oxNew('oxshop');
00041         if ($oShop->load($sShopId)) {
00042             $oShop->oxshops__oxdefcat = new oxField('');
00043             $oShop->save();
00044         }
00045     }
00046 
00052     public function assignCat()
00053     {
00054         $sChosenCat = oxConfig::getParameter( 'oxcatid' );
00055         $sShopId    = oxConfig::getParameter( 'oxid');
00056         $oShop = oxNew('oxshop');
00057         if ($oShop->load($sShopId)) {
00058             $oShop->oxshops__oxdefcat = new oxField($sChosenCat);
00059             $oShop->save();
00060         }
00061     }
00062 }