34 $aLangData[
'params'] =
$myConfig->getConfigParam(
'aLanguageParams' );
35 $aLangData[
'lang'] =
$myConfig->getConfigParam(
'aLanguages' );
36 $aLangData[
'urls'] =
$myConfig->getConfigParam(
'aLanguageURLs' );
37 $aLangData[
'sslUrls'] =
$myConfig->getConfigParam(
'aLanguageSSLURLs' );
39 $iBaseId = (int) $aLangData[
'params'][$sOxId][
'baseId'];
42 if ( $iBaseId == 0 ) {
43 $oEx =
oxNew(
"oxExceptionToDisplay" );
44 $oEx->setMessage(
'LANGUAGE_DELETINGMAINLANG_WARNING' );
50 unset( $aLangData[
'params'][$sOxId] );
51 unset( $aLangData[
'lang'][$sOxId] );
52 unset( $aLangData[
'urls'][$iBaseId] );
53 unset( $aLangData[
'sslUrls'][$iBaseId] );
56 $myConfig->saveShopConfVar(
'aarr',
'aLanguageParams', $aLangData[
'params'] );
57 $myConfig->saveShopConfVar(
'aarr',
'aLanguages', $aLangData[
'lang'] );
58 $myConfig->saveShopConfVar(
'arr',
'aLanguageURLs', $aLangData[
'urls'] );
59 $myConfig->saveShopConfVar(
'arr',
'aLanguageSSLURLs', $aLangData[
'sslUrls'] );
62 if ( $iBaseId ==
$myConfig->getConfigParam(
'sDefaultLang' ) ) {
63 $myConfig->saveShopConfVar(
'str',
'sDefaultLang', 0 );
83 return "language_list.tpl";
93 $aLangParams = $this->
getConfig()->getConfigParam(
'aLanguageParams' );
95 $sDefaultLang = $this->
getConfig()->getConfigParam(
'sDefaultLang' );
98 $sOxId = $sValue->oxid;
99 $aLanguages[$sKey]->active = ( !isset( $aLangParams[$sOxId][
"active"] ) ) ? 1 : $aLangParams[$sOxId][
"active"];
100 $aLanguages[$sKey]->default = ( $aLangParams[$sOxId][
"baseId"] == $sDefaultLang ) ?
true :
false;
101 $aLanguages[$sKey]->sort = $aLangParams[$sOxId][
"sort"];
104 if ( is_array( $aLangParams ) ) {
107 if ( is_array( $aSorting ) ) {
108 foreach ( $aSorting as $aFieldSorting ) {
109 foreach ( $aFieldSorting as $sField => $sDir ) {
110 $this->_sDefSortField = $sField;
111 $this->_sDefSortOrder = $sDir;
113 if ( $sField ==
'active' ) {
115 $this->_sDefSortOrder =
'desc';
122 uasort(
$aLanguages, array($this,
'_sortLanguagesCallback' ) );
140 $sVal1 = is_string( $oLang1->$sSortParam ) ? strtolower( $oLang1->$sSortParam ) : $oLang1->$sSortParam;
141 $sVal2 = is_string( $oLang2->$sSortParam ) ? strtolower( $oLang2->$sSortParam ) : $oLang2->$sSortParam;
143 if ( $this->_sDefSortOrder ==
'asc' ) {
144 return ( $sVal1 < $sVal2 ) ? -1 : 1;
146 return ( $sVal1 > $sVal2 ) ? -1 : 1;
160 $iLangId = (int) $iLangId;
168 $oDbMeta =
oxNew(
"oxDbMetaDataHandler" );
169 $oDbMeta->resetLanguage( $iLangId );
178 $oEx =
oxNew(
"oxExceptionToDisplay" );
179 $oEx->setMessage(
'LANGUAGE_ERROR_RESETING_MULTILANG_FIELDS' );