23 $this->_aViewData[
"edit"] = $oCategory =
oxNew(
"oxcategory" );;
25 if ( $soxId !=
"-1" && isset( $soxId)) {
31 $oCategory->loadInLang( $this->_iEditLang, $soxId );
34 $oOtherLang = $oCategory->getAvailableInLangs();
35 if (!isset($oOtherLang[$this->_iEditLang])) {
37 $oCategory->loadInLang( key($oOtherLang), $soxId );
43 $this->_aViewData[
"posslang"] =
$aLang;
45 foreach ( $oOtherLang as $id => $language) {
46 $oLang =
new stdClass();
47 $oLang->sLangDesc = $language;
49 $this->_aViewData[
"otherlang"][$id] = clone $oLang;
52 if ( $oCategory->oxcategories__oxparentid->value ==
'oxrootid')
53 $oCategory->oxcategories__oxparentid->setValue(
'');
55 $this->
_getCategoryTree(
"cattree", $oCategory->oxcategories__oxparentid->value, $oCategory->oxcategories__oxid->value,
true, $oCategory->oxcategories__oxshopid->value);
57 $this->_aViewData[
"defsort"] = $oCategory->oxcategories__oxdefsort->value;
64 $oCategoryMainAjax =
oxNew(
'category_main_ajax' );
65 $this->_aViewData[
'oxajax'] = $oCategoryMainAjax->getColumns();
67 return "popups/category_main.tpl";
70 return "category_main.tpl";
80 $aSkipFields = array(
"OXID",
"OXSHOPID",
"OXSHOPINCL",
"OXSHOPEXCL",
"OXPARENTID",
"OXACTIVE",
"OXACTIVEFROM"
81 ,
"OXACTIVETO",
"OXSHORTDESC"
82 ,
"OXUNITNAME",
"OXUNITQUANTITY",
"OXEXTURL",
"OXURLDESC",
"OXURLIMG",
"OXVAT"
83 ,
"OXTHUMB",
"OXPIC1",
"OXPIC2",
"OXPIC3",
"OXPIC4",
"OXPIC5"
84 ,
"OXPIC6",
"OXPIC7",
"OXPIC8",
"OXPIC9",
"OXPIC10",
"OXPIC11",
"OXPIC12",
"OXSTOCKFLAG"
85 ,
"OXSTOCKTEXT",
"OXNOSTOCKTEXT",
"OXDELIVERY",
"OXFILE",
"OXSEARCHKEYS",
"OXTEMPLATE"
86 ,
"OXQUESTIONEMAIL",
"OXISSEARCH",
"OXISCONFIGURABLE",
"OXBUNDLEID",
"OXFOLDER",
"OXSUBCLASS"
87 ,
"OXREMINDACTIVE",
"OXREMINDAMOUNT",
"OXVENDORID",
"OXMANUFACTURERID",
"OXSKIPDISCOUNTS"
88 ,
"OXBLFIXEDPRICE",
"OXICON",
"OXVARSELECT",
"OXAMITEMID",
"OXAMTASKID",
"OXPIXIEXPORT",
"OXPIXIEXPORTED",
"OXSORT"
89 ,
"OXUPDATEPRICE",
"OXUPDATEPRICEA",
"OXUPDATEPRICEB",
"OXUPDATEPRICEC",
"OXUPDATEPRICETIME",
"OXISDOWNLOADABLE"
90 ,
"OXVARMAXPRICE",
"OXSHOWCUSTOMAGREEMENT"
92 $aSkipFields = array_merge($aSkipFields,
oxRegistry::get(
"oxShopMetaData")->getShopFields());
94 $oDbHandler =
oxNew(
"oxDbMetaDataHandler" );
95 $aFields = array_merge( $oDbHandler->getMultilangFields(
'oxarticles' ), $oDbHandler->getSinglelangFields(
'oxarticles', 0 ) );
96 $aFields = array_diff( $aFields, $aSkipFields );
97 $aFields = array_unique( $aFields );
117 if ( !isset( $aParams[
'oxcategories__oxactive']))
118 $aParams[
'oxcategories__oxactive'] = 0;
119 if ( !isset( $aParams[
'oxcategories__oxhidden']))
120 $aParams[
'oxcategories__oxhidden'] = 0;
121 if ( !isset( $aParams[
'oxcategories__oxdefsortmode']))
122 $aParams[
'oxcategories__oxdefsortmode'] = 0;
125 if ($aParams[
'oxcategories__oxvat'] ===
'')
126 $aParams[
'oxcategories__oxvat'] = null;
131 $oCategory =
oxNew(
"oxcategory" );
133 if ( $soxId !=
"-1") {
135 $oCategory->load( $soxId);
136 $oCategory->loadInLang( $this->_iEditLang, $soxId );
140 $myUtilsPic->overwritePic( $oCategory,
'oxcategories',
'oxthumb',
'TC',
'0', $aParams,
$myConfig->getPictureDir(
false) );
141 $myUtilsPic->overwritePic( $oCategory,
'oxcategories',
'oxicon',
'CICO',
'icon', $aParams,
$myConfig->getPictureDir(
false) );
142 $myUtilsPic->overwritePic( $oCategory,
'oxcategories',
'oxpromoicon',
'PICO',
'icon', $aParams,
$myConfig->getPictureDir(
false) );
148 $aParams[
'oxcategories__oxid'] = null;
152 $oCategory->setLanguage(0);
153 if ( isset( $aParams[
"oxcategories__oxlongdesc"] ) ) {
154 $aParams[
"oxcategories__oxlongdesc"] = $this->
_processLongDesc( $aParams[
"oxcategories__oxlongdesc"] );
158 if ( empty($aParams[
'oxcategories__oxpricefrom']) ) {
159 $aParams[
'oxcategories__oxpricefrom'] = 0;
161 if ( empty($aParams[
'oxcategories__oxpriceto']) ) {
162 $aParams[
'oxcategories__oxpriceto'] = 0;
165 $oCategory->assign( $aParams );
166 $oCategory->setLanguage($this->_iEditLang);
168 $oCategory =
oxRegistry::get(
"oxUtilsFile")->processFiles( $oCategory );
184 return str_replace(
'&lang=',
'&lang=', $sValue );
209 $oEx->setMessage(
'CATEGORY_PICTURES_UPLOADISDISABLED' );
217 if (empty($sField)) {
221 $oItem =
oxNew(
'oxCategory');
222 $oItem->load($sOxId);
237 $sItemKey =
'oxcategories__'.$sField;
257 if ($sImgType !==
false) {
260 $myUtilsPic->safePictureDelete($oItem->$sItemKey->value, $sDir .
oxRegistry::get(
"oxUtilsFile")->getImageDirByType($sImgType),
'oxcategories', $sField);
262 $oItem->$sItemKey =
new oxField();