Contact

Are you interested in working with us? Then take your keyboard or your phone and contact us.

 

ollection(); $languageInstance = new cApiLanguage(); $nextLang = false; $selectedLang = NULL; $checkedCatArt = false; $idcatAuto = cRegistry::getCategoryId(); $artRetItem = NULL; $urlSet = false; $currentLanguage = NULL; $clientId = cRegistry::getClientId(); // get all client language id's $clientsLangInstance->select("idclient= " . $clientId); $resultClientLangs = $clientsLangInstance->fetchArray('idlang', 'idlang'); // get all active languages of a client foreach ($resultClientLangs as $clientLang) { $languageInstance->loadByMany(array( 'active' => '1', 'idlang' => $clientLang )); if ($languageInstance->get('idlang')) { $allLanguages[] = $languageInstance->get('idlang'); } $languageInstance = new cApiLanguage(); } // else check if there more as one language $currentLanguage = cRegistry::getLanguageId(); // set next language is exists foreach ($allLanguages as $langs) { if ($langs > $currentLanguage) { $selectedLang = $langs; $nextLang = true; break; } } // otherwise set first language if ($nextLang === false) { $languageName = $languageCollectionInstance->getLanguageName(reset($allLanguages)); $selectedLang = reset($allLanguages); } // check category and articles, if category exists and has start article // which // is online and not locked the set check to true $catCheck = $catCollection->select("idcat = " . $idcatAuto . " AND " . " idlang = " . $selectedLang . " AND " . "startidartlang != 0", NULL, NULL, NULL); $catRetItem = new cApiCategoryLanguage(); $catRetItem->loadByCategoryIdAndLanguageId($idcatAuto, $selectedLang); if ($catCheck === true && $catRetItem) { $artRetItem = $artCollection->fetchById($catRetItem->get('startidartlang')); } if ($artRetItem) { if ($artRetItem->get('online') == 1 && $artRetItem->get('locked') == 0) { $checkedCatArt = true; } } // if check is true then set url, otherwise check for next language if ($checkedCatArt === true) { $url = $catRetItem->getLink($selectedLang); } else { $config = cRegistry::getClientConfig(cRegistry::getClientId()); $url = cRegistry::getFrontendUrl() . '/en/'.$idart.'&changelang=' . $selectedLang; } $langswitch = array( 'url' => $url, 'name' =>$mod_lang['langs'][$selectedLang] ); $basePath = $cfgClient[$client]['path']['htmlpath']; $tpl = cSmartyFrontend::getInstance(); $tpl->assign('basePath', $basePath); $tpl->assign('langswitch', $langswitch); $tpl->assign('mod_lang', $mod_lang); $tpl->assign('tree', $tree); $tpl->assign('path', $path); $tpl->display('get.tpl'); ?>
Call-back service
Sicherheitscode
Request a Quote

How did you get to us?

Sicherheitscode