repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleVariablesLocator.php | ModuleVariablesLocator.getConfigurationKey | protected function getConfigurationKey()
{
if (Registry::instanceExists(\OxidEsales\Eshop\Core\ConfigFile::class)) {
$config = Registry::get(\OxidEsales\Eshop\Core\ConfigFile::class);
} else {
$config = new \OxidEsales\Eshop\Core\ConfigFile(getShopBasePath() . '/config.inc.php');
Registry::set(\OxidEsales\Eshop\Core\ConfigFile::class, $config);
}
return $config->getVar('sConfigKey') ?: Config::DEFAULT_CONFIG_KEY;
} | php | protected function getConfigurationKey()
{
if (Registry::instanceExists(\OxidEsales\Eshop\Core\ConfigFile::class)) {
$config = Registry::get(\OxidEsales\Eshop\Core\ConfigFile::class);
} else {
$config = new \OxidEsales\Eshop\Core\ConfigFile(getShopBasePath() . '/config.inc.php');
Registry::set(\OxidEsales\Eshop\Core\ConfigFile::class, $config);
}
return $config->getVar('sConfigKey') ?: Config::DEFAULT_CONFIG_KEY;
} | [
"protected",
"function",
"getConfigurationKey",
"(",
")",
"{",
"if",
"(",
"Registry",
"::",
"instanceExists",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"ConfigFile",
"::",
"class",
")",
")",
"{",
"$",
"config",
"=",
"Registry",
"::",
"get... | Returns configuration key. This method is independent from oxConfig functionality.
@return string | [
"Returns",
"configuration",
"key",
".",
"This",
"method",
"is",
"independent",
"from",
"oxConfig",
"functionality",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleVariablesLocator.php#L104-L113 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleVariablesLocator.php | ModuleVariablesLocator.getModuleVarFromDB | protected function getModuleVarFromDB($name)
{
// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
$masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
$shopId = $this->getShopIdCalculator()->getShopId();
$configKey = $this->getConfigurationKey();
$query = "SELECT DECODE( oxvarvalue , ? ) FROM oxconfig WHERE oxvarname = ? AND oxshopid = ?";
$value = $masterDb->getOne($query, [$configKey, $name, $shopId]);
return unserialize($value);
} | php | protected function getModuleVarFromDB($name)
{
// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
$masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
$shopId = $this->getShopIdCalculator()->getShopId();
$configKey = $this->getConfigurationKey();
$query = "SELECT DECODE( oxvarvalue , ? ) FROM oxconfig WHERE oxvarname = ? AND oxshopid = ?";
$value = $masterDb->getOne($query, [$configKey, $name, $shopId]);
return unserialize($value);
} | [
"protected",
"function",
"getModuleVarFromDB",
"(",
"$",
"name",
")",
"{",
"// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).",
"$",
"masterDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabasePr... | Returns shop module variable value directly from database.
@param string $name Module variable name
@return string | [
"Returns",
"shop",
"module",
"variable",
"value",
"directly",
"from",
"database",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleVariablesLocator.php#L122-L135 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/TextEditorHandler.php | TextEditorHandler.renderPlainTextEditor | public function renderPlainTextEditor($width, $height, $objectValue, $fieldName)
{
if (strpos($width, '%') === false) {
$width .= 'px';
}
if (strpos($height, '%') === false) {
$height .= 'px';
}
$disabledTextEditor = $this->isTextEditorDisabled() ? 'disabled ' : '';
return "<textarea ${disabledTextEditor}id='editor_{$fieldName}' name='$fieldName' style='width:{$width}; height:{$height};'>{$objectValue}</textarea>";
} | php | public function renderPlainTextEditor($width, $height, $objectValue, $fieldName)
{
if (strpos($width, '%') === false) {
$width .= 'px';
}
if (strpos($height, '%') === false) {
$height .= 'px';
}
$disabledTextEditor = $this->isTextEditorDisabled() ? 'disabled ' : '';
return "<textarea ${disabledTextEditor}id='editor_{$fieldName}' name='$fieldName' style='width:{$width}; height:{$height};'>{$objectValue}</textarea>";
} | [
"public",
"function",
"renderPlainTextEditor",
"(",
"$",
"width",
",",
"$",
"height",
",",
"$",
"objectValue",
",",
"$",
"fieldName",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"width",
",",
"'%'",
")",
"===",
"false",
")",
"{",
"$",
"width",
".=",
"'p... | Returns simple textarea element filled with object text to edit.
@param int $width The editor width.
@param int $height The editor height.
@param object $objectValue The object value passed to editor.
@param string $fieldName The name of object field which content is passed to editor.
@return string The Editor output. | [
"Returns",
"simple",
"textarea",
"element",
"filled",
"with",
"object",
"text",
"to",
"edit",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/TextEditorHandler.php#L56-L68 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/PaymentMain.php | PaymentMain.save | public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
// checkbox handling
if (!isset($aParams['oxpayments__oxactive'])) {
$aParams['oxpayments__oxactive'] = 0;
}
if (!isset($aParams['oxpayments__oxchecked'])) {
$aParams['oxpayments__oxchecked'] = 0;
}
$oPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
if ($soxId != "-1") {
$oPayment->loadInLang($this->_iEditLang, $soxId);
} else {
$aParams['oxpayments__oxid'] = null;
//$aParams = $oPayment->ConvertNameArray2Idx( $aParams);
}
$oPayment->setLanguage(0);
$oPayment->assign($aParams);
// setting add sum calculation rules
$aRules = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxpayments__oxaddsumrules");
// if sum eqals 0, show notice, that default value will be used.
if (empty($aRules)) {
$this->_aViewData["noticeoxaddsumrules"] = 1;
}
$oPayment->oxpayments__oxaddsumrules = new \OxidEsales\Eshop\Core\Field(array_sum($aRules));
//#708
if (!is_array($this->_aFieldArray)) {
$this->_aFieldArray = \OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesFromText($oPayment->oxpayments__oxvaldesc->value);
}
// build value
$sValdesc = "";
foreach ($this->_aFieldArray as $oField) {
$sValdesc .= $oField->name . "__@@";
}
$oPayment->oxpayments__oxvaldesc = new \OxidEsales\Eshop\Core\Field($sValdesc, \OxidEsales\Eshop\Core\Field::T_RAW);
$oPayment->setLanguage($this->_iEditLang);
$oPayment->save();
// set oxid if inserted
$this->setEditObjectId($oPayment->getId());
} | php | public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
// checkbox handling
if (!isset($aParams['oxpayments__oxactive'])) {
$aParams['oxpayments__oxactive'] = 0;
}
if (!isset($aParams['oxpayments__oxchecked'])) {
$aParams['oxpayments__oxchecked'] = 0;
}
$oPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
if ($soxId != "-1") {
$oPayment->loadInLang($this->_iEditLang, $soxId);
} else {
$aParams['oxpayments__oxid'] = null;
//$aParams = $oPayment->ConvertNameArray2Idx( $aParams);
}
$oPayment->setLanguage(0);
$oPayment->assign($aParams);
// setting add sum calculation rules
$aRules = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxpayments__oxaddsumrules");
// if sum eqals 0, show notice, that default value will be used.
if (empty($aRules)) {
$this->_aViewData["noticeoxaddsumrules"] = 1;
}
$oPayment->oxpayments__oxaddsumrules = new \OxidEsales\Eshop\Core\Field(array_sum($aRules));
//#708
if (!is_array($this->_aFieldArray)) {
$this->_aFieldArray = \OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesFromText($oPayment->oxpayments__oxvaldesc->value);
}
// build value
$sValdesc = "";
foreach ($this->_aFieldArray as $oField) {
$sValdesc .= $oField->name . "__@@";
}
$oPayment->oxpayments__oxvaldesc = new \OxidEsales\Eshop\Core\Field($sValdesc, \OxidEsales\Eshop\Core\Field::T_RAW);
$oPayment->setLanguage($this->_iEditLang);
$oPayment->save();
// set oxid if inserted
$this->setEditObjectId($oPayment->getId());
} | [
"public",
"function",
"save",
"(",
")",
"{",
"parent",
"::",
"save",
"(",
")",
";",
"$",
"soxId",
"=",
"$",
"this",
"->",
"getEditObjectId",
"(",
")",
";",
"$",
"aParams",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
... | Saves payment parameters changes. | [
"Saves",
"payment",
"parameters",
"changes",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/PaymentMain.php#L84-L136 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.getBaseLanguage | public function getBaseLanguage()
{
if ($this->_iBaseLanguageId === null) {
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$blAdmin = $this->isAdmin();
// languages and search engines
if ($blAdmin && (($iSeLang = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('changelang')) !== null)) {
$this->_iBaseLanguageId = $iSeLang;
}
if (is_null($this->_iBaseLanguageId)) {
$this->_iBaseLanguageId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('lang');
}
//or determining by domain
$aLanguageUrls = $myConfig->getConfigParam('aLanguageURLs');
if (!$blAdmin && is_array($aLanguageUrls)) {
foreach ($aLanguageUrls as $iId => $sUrl) {
if ($sUrl && $myConfig->isCurrentUrl($sUrl)) {
$this->_iBaseLanguageId = $iId;
break;
}
}
}
if (is_null($this->_iBaseLanguageId)) {
$this->_iBaseLanguageId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('language');
if (!isset($this->_iBaseLanguageId)) {
$this->_iBaseLanguageId = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('language');
}
}
// if language still not set and not search engine browsing,
// getting language from browser
if (is_null($this->_iBaseLanguageId) && !$blAdmin && !\OxidEsales\Eshop\Core\Registry::getUtils()->isSearchEngine()) {
// getting from cookie
$this->_iBaseLanguageId = \OxidEsales\Eshop\Core\Registry::getUtilsServer()->getOxCookie('language');
// getting from browser
if (is_null($this->_iBaseLanguageId)) {
$this->_iBaseLanguageId = $this->detectLanguageByBrowser();
}
}
if (is_null($this->_iBaseLanguageId)) {
$this->_iBaseLanguageId = $myConfig->getConfigParam('sDefaultLang');
}
$this->_iBaseLanguageId = (int) $this->_iBaseLanguageId;
// validating language
$this->_iBaseLanguageId = $this->validateLanguage($this->_iBaseLanguageId);
\OxidEsales\Eshop\Core\Registry::getUtilsServer()->setOxCookie('language', $this->_iBaseLanguageId);
}
return $this->_iBaseLanguageId;
} | php | public function getBaseLanguage()
{
if ($this->_iBaseLanguageId === null) {
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$blAdmin = $this->isAdmin();
// languages and search engines
if ($blAdmin && (($iSeLang = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('changelang')) !== null)) {
$this->_iBaseLanguageId = $iSeLang;
}
if (is_null($this->_iBaseLanguageId)) {
$this->_iBaseLanguageId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('lang');
}
//or determining by domain
$aLanguageUrls = $myConfig->getConfigParam('aLanguageURLs');
if (!$blAdmin && is_array($aLanguageUrls)) {
foreach ($aLanguageUrls as $iId => $sUrl) {
if ($sUrl && $myConfig->isCurrentUrl($sUrl)) {
$this->_iBaseLanguageId = $iId;
break;
}
}
}
if (is_null($this->_iBaseLanguageId)) {
$this->_iBaseLanguageId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('language');
if (!isset($this->_iBaseLanguageId)) {
$this->_iBaseLanguageId = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('language');
}
}
// if language still not set and not search engine browsing,
// getting language from browser
if (is_null($this->_iBaseLanguageId) && !$blAdmin && !\OxidEsales\Eshop\Core\Registry::getUtils()->isSearchEngine()) {
// getting from cookie
$this->_iBaseLanguageId = \OxidEsales\Eshop\Core\Registry::getUtilsServer()->getOxCookie('language');
// getting from browser
if (is_null($this->_iBaseLanguageId)) {
$this->_iBaseLanguageId = $this->detectLanguageByBrowser();
}
}
if (is_null($this->_iBaseLanguageId)) {
$this->_iBaseLanguageId = $myConfig->getConfigParam('sDefaultLang');
}
$this->_iBaseLanguageId = (int) $this->_iBaseLanguageId;
// validating language
$this->_iBaseLanguageId = $this->validateLanguage($this->_iBaseLanguageId);
\OxidEsales\Eshop\Core\Registry::getUtilsServer()->setOxCookie('language', $this->_iBaseLanguageId);
}
return $this->_iBaseLanguageId;
} | [
"public",
"function",
"getBaseLanguage",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_iBaseLanguageId",
"===",
"null",
")",
"{",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
... | Returns active shop language id
@return string | [
"Returns",
"active",
"shop",
"language",
"id"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L150-L209 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.getObjectTplLanguage | public function getObjectTplLanguage()
{
if ($this->_iObjectTplLanguageId === null) {
$this->_iObjectTplLanguageId = $this->getTplLanguage();
if ($this->isAdmin()) {
$aLanguages = $this->getAdminTplLanguageArray();
if (!isset($aLanguages[$this->_iObjectTplLanguageId]) ||
$aLanguages[$this->_iObjectTplLanguageId]->active == 0
) {
$this->_iObjectTplLanguageId = key($aLanguages);
}
}
}
return $this->_iObjectTplLanguageId;
} | php | public function getObjectTplLanguage()
{
if ($this->_iObjectTplLanguageId === null) {
$this->_iObjectTplLanguageId = $this->getTplLanguage();
if ($this->isAdmin()) {
$aLanguages = $this->getAdminTplLanguageArray();
if (!isset($aLanguages[$this->_iObjectTplLanguageId]) ||
$aLanguages[$this->_iObjectTplLanguageId]->active == 0
) {
$this->_iObjectTplLanguageId = key($aLanguages);
}
}
}
return $this->_iObjectTplLanguageId;
} | [
"public",
"function",
"getObjectTplLanguage",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_iObjectTplLanguageId",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_iObjectTplLanguageId",
"=",
"$",
"this",
"->",
"getTplLanguage",
"(",
")",
";",
"if",
"(",
"$"... | Returns language id used to load objects according to current template language
@return int | [
"Returns",
"language",
"id",
"used",
"to",
"load",
"objects",
"according",
"to",
"current",
"template",
"language"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L216-L232 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.getTplLanguage | public function getTplLanguage()
{
if ($this->_iTplLanguageId === null) {
$iSessLang = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('tpllanguage');
$this->_iTplLanguageId = $this->isAdmin() ? $this->setTplLanguage($iSessLang) : $this->getBaseLanguage();
}
return $this->_iTplLanguageId;
} | php | public function getTplLanguage()
{
if ($this->_iTplLanguageId === null) {
$iSessLang = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('tpllanguage');
$this->_iTplLanguageId = $this->isAdmin() ? $this->setTplLanguage($iSessLang) : $this->getBaseLanguage();
}
return $this->_iTplLanguageId;
} | [
"public",
"function",
"getTplLanguage",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_iTplLanguageId",
"===",
"null",
")",
"{",
"$",
"iSessLang",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getSession",
"(",
")",
"->",... | Returns active shop templates language id
If it is not an admin area, template language id is same
as base shop language id
@return string | [
"Returns",
"active",
"shop",
"templates",
"language",
"id",
"If",
"it",
"is",
"not",
"an",
"admin",
"area",
"template",
"language",
"id",
"is",
"same",
"as",
"base",
"shop",
"language",
"id"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L241-L249 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.getEditLanguage | public function getEditLanguage()
{
if ($this->_iEditLanguageId === null) {
if (!$this->isAdmin()) {
$this->_iEditLanguageId = $this->getBaseLanguage();
} else {
$iLang = null;
// choosing language ident
// check if we really need to set the new language
if ("saveinnlang" == \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveView()->getFncName()) {
$iLang = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("new_lang");
}
$iLang = ($iLang === null) ? \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('editlanguage') : $iLang;
$iLang = ($iLang === null) ? \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('editlanguage') : $iLang;
$iLang = ($iLang === null) ? $this->getBaseLanguage() : $iLang;
// validating language
$this->_iEditLanguageId = $this->validateLanguage($iLang);
// writing to session
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable('editlanguage', $this->_iEditLanguageId);
}
}
return $this->_iEditLanguageId;
} | php | public function getEditLanguage()
{
if ($this->_iEditLanguageId === null) {
if (!$this->isAdmin()) {
$this->_iEditLanguageId = $this->getBaseLanguage();
} else {
$iLang = null;
// choosing language ident
// check if we really need to set the new language
if ("saveinnlang" == \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveView()->getFncName()) {
$iLang = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("new_lang");
}
$iLang = ($iLang === null) ? \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('editlanguage') : $iLang;
$iLang = ($iLang === null) ? \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('editlanguage') : $iLang;
$iLang = ($iLang === null) ? $this->getBaseLanguage() : $iLang;
// validating language
$this->_iEditLanguageId = $this->validateLanguage($iLang);
// writing to session
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable('editlanguage', $this->_iEditLanguageId);
}
}
return $this->_iEditLanguageId;
} | [
"public",
"function",
"getEditLanguage",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_iEditLanguageId",
"===",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isAdmin",
"(",
")",
")",
"{",
"$",
"this",
"->",
"_iEditLanguageId",
"=",
"$",
"thi... | Returns editing object working language id
@return string | [
"Returns",
"editing",
"object",
"working",
"language",
"id"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L256-L281 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.getLanguageArray | public function getLanguageArray($iLanguage = null, $blOnlyActive = false, $blSort = false)
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
if (is_null($iLanguage)) {
$iLanguage = $this->_iBaseLanguageId;
}
$aLanguages = [];
$aConfLanguages = $myConfig->getConfigParam('aLanguages');
$aLangParams = $myConfig->getConfigParam('aLanguageParams');
if (is_array($aConfLanguages)) {
$i = 0;
reset($aConfLanguages);
foreach ($aConfLanguages as $key => $val) {
if ($blOnlyActive && is_array($aLangParams)) {
//skipping non active languages
if (!$aLangParams[$key]['active']) {
$i++;
continue;
}
}
if ($val) {
$oLang = new stdClass();
$oLang->id = isset($aLangParams[$key]['baseId']) ? $aLangParams[$key]['baseId'] : $i;
$oLang->oxid = $key;
$oLang->abbr = $key;
$oLang->name = $val;
if (is_array($aLangParams)) {
$oLang->active = $aLangParams[$key]['active'];
$oLang->sort = $aLangParams[$key]['sort'];
}
$oLang->selected = (isset($iLanguage) && $oLang->id == $iLanguage) ? 1 : 0;
$aLanguages[$oLang->id] = $oLang;
}
++$i;
}
}
if ($blSort && is_array($aLangParams)) {
uasort($aLanguages, [$this, '_sortLanguagesCallback']);
}
return $aLanguages;
} | php | public function getLanguageArray($iLanguage = null, $blOnlyActive = false, $blSort = false)
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
if (is_null($iLanguage)) {
$iLanguage = $this->_iBaseLanguageId;
}
$aLanguages = [];
$aConfLanguages = $myConfig->getConfigParam('aLanguages');
$aLangParams = $myConfig->getConfigParam('aLanguageParams');
if (is_array($aConfLanguages)) {
$i = 0;
reset($aConfLanguages);
foreach ($aConfLanguages as $key => $val) {
if ($blOnlyActive && is_array($aLangParams)) {
//skipping non active languages
if (!$aLangParams[$key]['active']) {
$i++;
continue;
}
}
if ($val) {
$oLang = new stdClass();
$oLang->id = isset($aLangParams[$key]['baseId']) ? $aLangParams[$key]['baseId'] : $i;
$oLang->oxid = $key;
$oLang->abbr = $key;
$oLang->name = $val;
if (is_array($aLangParams)) {
$oLang->active = $aLangParams[$key]['active'];
$oLang->sort = $aLangParams[$key]['sort'];
}
$oLang->selected = (isset($iLanguage) && $oLang->id == $iLanguage) ? 1 : 0;
$aLanguages[$oLang->id] = $oLang;
}
++$i;
}
}
if ($blSort && is_array($aLangParams)) {
uasort($aLanguages, [$this, '_sortLanguagesCallback']);
}
return $aLanguages;
} | [
"public",
"function",
"getLanguageArray",
"(",
"$",
"iLanguage",
"=",
"null",
",",
"$",
"blOnlyActive",
"=",
"false",
",",
"$",
"blSort",
"=",
"false",
")",
"{",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::... | Returns array of available languages.
@param integer $iLanguage Number if current language (default null)
@param bool $blOnlyActive load only current language or all
@param bool $blSort enable sorting or not
@return array | [
"Returns",
"array",
"of",
"available",
"languages",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L292-L340 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.getAdminTplLanguageArray | public function getAdminTplLanguageArray()
{
if ($this->_aAdminTplLanguageArray === null) {
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$aLangArray = $this->getLanguageArray();
$this->_aAdminTplLanguageArray = [];
$sSourceDir = $myConfig->getAppDir() . 'views/admin/';
foreach ($aLangArray as $iLangKey => $oLang) {
$sFilePath = "{$sSourceDir}{$oLang->abbr}/lang.php";
if (file_exists($sFilePath) && is_readable($sFilePath)) {
$this->_aAdminTplLanguageArray[$iLangKey] = $oLang;
}
}
}
// moving pointer to beginning
reset($this->_aAdminTplLanguageArray);
return $this->_aAdminTplLanguageArray;
} | php | public function getAdminTplLanguageArray()
{
if ($this->_aAdminTplLanguageArray === null) {
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$aLangArray = $this->getLanguageArray();
$this->_aAdminTplLanguageArray = [];
$sSourceDir = $myConfig->getAppDir() . 'views/admin/';
foreach ($aLangArray as $iLangKey => $oLang) {
$sFilePath = "{$sSourceDir}{$oLang->abbr}/lang.php";
if (file_exists($sFilePath) && is_readable($sFilePath)) {
$this->_aAdminTplLanguageArray[$iLangKey] = $oLang;
}
}
}
// moving pointer to beginning
reset($this->_aAdminTplLanguageArray);
return $this->_aAdminTplLanguageArray;
} | [
"public",
"function",
"getAdminTplLanguageArray",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_aAdminTplLanguageArray",
"===",
"null",
")",
"{",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"("... | Returns languages array containing possible admin template translations
@return array | [
"Returns",
"languages",
"array",
"containing",
"possible",
"admin",
"template",
"translations"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L347-L368 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.getLanguageAbbr | public function getLanguageAbbr($iLanguage = null)
{
if ($this->_aLangAbbr === null) {
$this->_aLangAbbr = $this->getLanguageIds();
}
$iLanguage = isset($iLanguage) ? (int) $iLanguage : $this->getBaseLanguage();
if (isset($this->_aLangAbbr[$iLanguage])) {
$iLanguage = $this->_aLangAbbr[$iLanguage];
}
return $iLanguage;
} | php | public function getLanguageAbbr($iLanguage = null)
{
if ($this->_aLangAbbr === null) {
$this->_aLangAbbr = $this->getLanguageIds();
}
$iLanguage = isset($iLanguage) ? (int) $iLanguage : $this->getBaseLanguage();
if (isset($this->_aLangAbbr[$iLanguage])) {
$iLanguage = $this->_aLangAbbr[$iLanguage];
}
return $iLanguage;
} | [
"public",
"function",
"getLanguageAbbr",
"(",
"$",
"iLanguage",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_aLangAbbr",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_aLangAbbr",
"=",
"$",
"this",
"->",
"getLanguageIds",
"(",
")",
";",
"}",
... | Returns selected language abbreviation
@param int $iLanguage language id [optional]
@return string | [
"Returns",
"selected",
"language",
"abbreviation"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L377-L389 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.translateString | public function translateString($sStringToTranslate, $iLang = null, $blAdminMode = null)
{
$this->setIsTranslated();
// checking if in cache exist
$aLang = $this->_getLangTranslationArray($iLang, $blAdminMode);
if (isset($aLang[$sStringToTranslate])) {
return $aLang[$sStringToTranslate];
}
// checking if in map exist
$aMap = $this->_getLanguageMap($iLang, $blAdminMode);
if (isset($aMap[$sStringToTranslate], $aLang[$aMap[$sStringToTranslate]])) {
return $aLang[$aMap[$sStringToTranslate]];
}
// checking if in theme options exist
if (count($this->_aAdditionalLangFiles)) {
$aLang = $this->_getLangTranslationArray($iLang, $blAdminMode, $this->_aAdditionalLangFiles);
if (isset($aLang[$sStringToTranslate])) {
return $aLang[$sStringToTranslate];
}
}
$this->setIsTranslated(false);
if (!$this->isTranslated()) {
Registry::getLogger()->warning(
"translation for $sStringToTranslate not found",
compact('iLang', 'blAdminMode')
);
}
return $sStringToTranslate;
} | php | public function translateString($sStringToTranslate, $iLang = null, $blAdminMode = null)
{
$this->setIsTranslated();
// checking if in cache exist
$aLang = $this->_getLangTranslationArray($iLang, $blAdminMode);
if (isset($aLang[$sStringToTranslate])) {
return $aLang[$sStringToTranslate];
}
// checking if in map exist
$aMap = $this->_getLanguageMap($iLang, $blAdminMode);
if (isset($aMap[$sStringToTranslate], $aLang[$aMap[$sStringToTranslate]])) {
return $aLang[$aMap[$sStringToTranslate]];
}
// checking if in theme options exist
if (count($this->_aAdditionalLangFiles)) {
$aLang = $this->_getLangTranslationArray($iLang, $blAdminMode, $this->_aAdditionalLangFiles);
if (isset($aLang[$sStringToTranslate])) {
return $aLang[$sStringToTranslate];
}
}
$this->setIsTranslated(false);
if (!$this->isTranslated()) {
Registry::getLogger()->warning(
"translation for $sStringToTranslate not found",
compact('iLang', 'blAdminMode')
);
}
return $sStringToTranslate;
} | [
"public",
"function",
"translateString",
"(",
"$",
"sStringToTranslate",
",",
"$",
"iLang",
"=",
"null",
",",
"$",
"blAdminMode",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setIsTranslated",
"(",
")",
";",
"// checking if in cache exist",
"$",
"aLang",
"=",
... | Searches for translation string in file and on success returns translation,
otherwise returns initial string.
@param string $sStringToTranslate Initial string
@param int $iLang optional language number
@param bool $blAdminMode on special case you can force mode, to load language constant from admin/shops language file
@return string | [
"Searches",
"for",
"translation",
"string",
"in",
"file",
"and",
"on",
"success",
"returns",
"translation",
"otherwise",
"returns",
"initial",
"string",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L419-L452 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.formatCurrency | public function formatCurrency($dValue, $oActCur = null)
{
if (!$oActCur) {
$oActCur = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject();
}
$sValue = \OxidEsales\Eshop\Core\Registry::getUtils()->fRound($dValue, $oActCur);
return number_format((double) $sValue, $oActCur->decimal, $oActCur->dec, $oActCur->thousand);
} | php | public function formatCurrency($dValue, $oActCur = null)
{
if (!$oActCur) {
$oActCur = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject();
}
$sValue = \OxidEsales\Eshop\Core\Registry::getUtils()->fRound($dValue, $oActCur);
return number_format((double) $sValue, $oActCur->decimal, $oActCur->dec, $oActCur->thousand);
} | [
"public",
"function",
"formatCurrency",
"(",
"$",
"dValue",
",",
"$",
"oActCur",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"oActCur",
")",
"{",
"$",
"oActCur",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",... | Returns formatted number, according to active currency formatting standards.
@param float $dValue Plain price
@param object $oActCur Object of active currency
@return string | [
"Returns",
"formatted",
"number",
"according",
"to",
"active",
"currency",
"formatting",
"standards",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L519-L527 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.formatVat | public function formatVat($dValue, $oActCur = null)
{
$iDecPos = 0;
$sValue = ( string ) $dValue;
/** @var \OxidEsales\Eshop\Core\StrRegular $oStr */
$oStr = getStr();
if (($iDotPos = $oStr->strpos($sValue, '.')) !== false) {
$iDecPos = $oStr->strlen($oStr->substr($sValue, $iDotPos + 1));
}
$oActCur = $oActCur ? $oActCur : \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject();
$iDecPos = ($iDecPos < $oActCur->decimal) ? $iDecPos : $oActCur->decimal;
return number_format((double) $dValue, $iDecPos, $oActCur->dec, $oActCur->thousand);
} | php | public function formatVat($dValue, $oActCur = null)
{
$iDecPos = 0;
$sValue = ( string ) $dValue;
/** @var \OxidEsales\Eshop\Core\StrRegular $oStr */
$oStr = getStr();
if (($iDotPos = $oStr->strpos($sValue, '.')) !== false) {
$iDecPos = $oStr->strlen($oStr->substr($sValue, $iDotPos + 1));
}
$oActCur = $oActCur ? $oActCur : \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject();
$iDecPos = ($iDecPos < $oActCur->decimal) ? $iDecPos : $oActCur->decimal;
return number_format((double) $dValue, $iDecPos, $oActCur->dec, $oActCur->thousand);
} | [
"public",
"function",
"formatVat",
"(",
"$",
"dValue",
",",
"$",
"oActCur",
"=",
"null",
")",
"{",
"$",
"iDecPos",
"=",
"0",
";",
"$",
"sValue",
"=",
"(",
"string",
")",
"$",
"dValue",
";",
"/** @var \\OxidEsales\\Eshop\\Core\\StrRegular $oStr */",
"$",
"oSt... | Returns formatted vat value, according to formatting standards.
@param float $dValue Plain price
@param object $oActCur Object of active currency
@return string | [
"Returns",
"formatted",
"vat",
"value",
"according",
"to",
"formatting",
"standards",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L537-L551 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.getLanguageTag | public function getLanguageTag($iLanguage = null)
{
if (!isset($iLanguage)) {
$iLanguage = $this->getBaseLanguage();
}
$iLanguage = (int) $iLanguage;
return ($iLanguage) ? "_$iLanguage" : "";
} | php | public function getLanguageTag($iLanguage = null)
{
if (!isset($iLanguage)) {
$iLanguage = $this->getBaseLanguage();
}
$iLanguage = (int) $iLanguage;
return ($iLanguage) ? "_$iLanguage" : "";
} | [
"public",
"function",
"getLanguageTag",
"(",
"$",
"iLanguage",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"iLanguage",
")",
")",
"{",
"$",
"iLanguage",
"=",
"$",
"this",
"->",
"getBaseLanguage",
"(",
")",
";",
"}",
"$",
"iLanguage",
"=... | According to user configuration forms and return language prefix.
@param integer $iLanguage User selected language (default null)
@return string | [
"According",
"to",
"user",
"configuration",
"forms",
"and",
"return",
"language",
"prefix",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L560-L569 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.validateLanguage | public function validateLanguage($iLang = null)
{
// checking if this language is valid
$aLanguages = $this->getLanguageArray(null, !$this->isAdmin());
if (!isset($aLanguages[$iLang]) && is_array($aLanguages)) {
$oLang = current($aLanguages);
if (isset($oLang->id)) {
$iLang = $oLang->id;
}
}
return (int) $iLang;
} | php | public function validateLanguage($iLang = null)
{
// checking if this language is valid
$aLanguages = $this->getLanguageArray(null, !$this->isAdmin());
if (!isset($aLanguages[$iLang]) && is_array($aLanguages)) {
$oLang = current($aLanguages);
if (isset($oLang->id)) {
$iLang = $oLang->id;
}
}
return (int) $iLang;
} | [
"public",
"function",
"validateLanguage",
"(",
"$",
"iLang",
"=",
"null",
")",
"{",
"// checking if this language is valid",
"$",
"aLanguages",
"=",
"$",
"this",
"->",
"getLanguageArray",
"(",
"null",
",",
"!",
"$",
"this",
"->",
"isAdmin",
"(",
")",
")",
";... | Validate language id. If not valid id, returns default value
@param int $iLang Language id
@return int | [
"Validate",
"language",
"id",
".",
"If",
"not",
"valid",
"id",
"returns",
"default",
"value"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L578-L590 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.setBaseLanguage | public function setBaseLanguage($iLang = null)
{
if (is_null($iLang)) {
$iLang = $this->getBaseLanguage();
} else {
$this->_iBaseLanguageId = (int) $iLang;
}
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable('language', $iLang);
} | php | public function setBaseLanguage($iLang = null)
{
if (is_null($iLang)) {
$iLang = $this->getBaseLanguage();
} else {
$this->_iBaseLanguageId = (int) $iLang;
}
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable('language', $iLang);
} | [
"public",
"function",
"setBaseLanguage",
"(",
"$",
"iLang",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"iLang",
")",
")",
"{",
"$",
"iLang",
"=",
"$",
"this",
"->",
"getBaseLanguage",
"(",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
... | Set base shop language
@param int $iLang Language id | [
"Set",
"base",
"shop",
"language"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L597-L606 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.setTplLanguage | public function setTplLanguage($iLang = null)
{
$this->_iTplLanguageId = isset($iLang) ? (int) $iLang : $this->getBaseLanguage();
if ($this->isAdmin()) {
$aLanguages = $this->getAdminTplLanguageArray();
if (!isset($aLanguages[$this->_iTplLanguageId])) {
$this->_iTplLanguageId = key($aLanguages);
}
}
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable('tpllanguage', $this->_iTplLanguageId);
return $this->_iTplLanguageId;
} | php | public function setTplLanguage($iLang = null)
{
$this->_iTplLanguageId = isset($iLang) ? (int) $iLang : $this->getBaseLanguage();
if ($this->isAdmin()) {
$aLanguages = $this->getAdminTplLanguageArray();
if (!isset($aLanguages[$this->_iTplLanguageId])) {
$this->_iTplLanguageId = key($aLanguages);
}
}
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable('tpllanguage', $this->_iTplLanguageId);
return $this->_iTplLanguageId;
} | [
"public",
"function",
"setTplLanguage",
"(",
"$",
"iLang",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_iTplLanguageId",
"=",
"isset",
"(",
"$",
"iLang",
")",
"?",
"(",
"int",
")",
"$",
"iLang",
":",
"$",
"this",
"->",
"getBaseLanguage",
"(",
")",
";"... | Validates and sets templates language id
@param int $iLang Language id
@return null | [
"Validates",
"and",
"sets",
"templates",
"language",
"id"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L615-L628 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language._recodeLangArray | protected function _recodeLangArray($aLangArray, $sCharset, $blRecodeKeys = false)
{
$newEncoding = $this->getTranslationsExpectedEncoding();
if ($sCharset == $newEncoding) {
return $aLangArray;
}
if ($blRecodeKeys) {
$aLangArray = $this->_recodeLangArrayWithKeys($aLangArray, $sCharset, $newEncoding);
} else {
$this->_recodeLangArrayValues($aLangArray, $sCharset, $newEncoding);
}
return $aLangArray;
} | php | protected function _recodeLangArray($aLangArray, $sCharset, $blRecodeKeys = false)
{
$newEncoding = $this->getTranslationsExpectedEncoding();
if ($sCharset == $newEncoding) {
return $aLangArray;
}
if ($blRecodeKeys) {
$aLangArray = $this->_recodeLangArrayWithKeys($aLangArray, $sCharset, $newEncoding);
} else {
$this->_recodeLangArrayValues($aLangArray, $sCharset, $newEncoding);
}
return $aLangArray;
} | [
"protected",
"function",
"_recodeLangArray",
"(",
"$",
"aLangArray",
",",
"$",
"sCharset",
",",
"$",
"blRecodeKeys",
"=",
"false",
")",
"{",
"$",
"newEncoding",
"=",
"$",
"this",
"->",
"getTranslationsExpectedEncoding",
"(",
")",
";",
"if",
"(",
"$",
"sChars... | Goes through language array and recodes its values if encoding does not fit with needed one. Returns recoded data
@param array $aLangArray language data
@param string $sCharset charset which was used while making file
@param bool $blRecodeKeys leave keys untouched or recode it
@deprecated since 6.0 (2016-12-07) As the shop installation is utf-8, this method will be removed.
@return array | [
"Goes",
"through",
"language",
"array",
"and",
"recodes",
"its",
"values",
"if",
"encoding",
"does",
"not",
"fit",
"with",
"needed",
"one",
".",
"Returns",
"recoded",
"data"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L641-L655 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language._recodeLangArrayValues | protected function _recodeLangArrayValues(&$aLangArray, $sCharset, $newEncoding)
{
foreach ($aLangArray as $sItemKey => &$sValue) {
$sValue = iconv($sCharset, $newEncoding, $sValue);
}
} | php | protected function _recodeLangArrayValues(&$aLangArray, $sCharset, $newEncoding)
{
foreach ($aLangArray as $sItemKey => &$sValue) {
$sValue = iconv($sCharset, $newEncoding, $sValue);
}
} | [
"protected",
"function",
"_recodeLangArrayValues",
"(",
"&",
"$",
"aLangArray",
",",
"$",
"sCharset",
",",
"$",
"newEncoding",
")",
"{",
"foreach",
"(",
"$",
"aLangArray",
"as",
"$",
"sItemKey",
"=>",
"&",
"$",
"sValue",
")",
"{",
"$",
"sValue",
"=",
"ic... | Goes through language array and recodes its values.
@param array $aLangArray language data
@param string $sCharset charset which was used while making file
@param string $newEncoding charset which was used while making file
@deprecated since 6.0 (2016-12-07) As the shop installation is utf-8, this method will be removed. | [
"Goes",
"through",
"language",
"array",
"and",
"recodes",
"its",
"values",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L666-L671 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language._recodeLangArrayWithKeys | protected function _recodeLangArrayWithKeys($aLangArray, $sCharset, $newEncoding)
{
$aLangs = [];
foreach ($aLangArray as $sItemKey => $sValue) {
$sItemKey = iconv($sCharset, $newEncoding, $sItemKey);
$aLangs[$sItemKey] = iconv($sCharset, $newEncoding, $sValue);
}
return $aLangs;
} | php | protected function _recodeLangArrayWithKeys($aLangArray, $sCharset, $newEncoding)
{
$aLangs = [];
foreach ($aLangArray as $sItemKey => $sValue) {
$sItemKey = iconv($sCharset, $newEncoding, $sItemKey);
$aLangs[$sItemKey] = iconv($sCharset, $newEncoding, $sValue);
}
return $aLangs;
} | [
"protected",
"function",
"_recodeLangArrayWithKeys",
"(",
"$",
"aLangArray",
",",
"$",
"sCharset",
",",
"$",
"newEncoding",
")",
"{",
"$",
"aLangs",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"aLangArray",
"as",
"$",
"sItemKey",
"=>",
"$",
"sValue",
")",
"... | Goes through language array and recodes its values and keys. Returns recoded data
@param array $aLangArray language data
@param string $sCharset charset which was used while making file
@param string $newEncoding charset which was used while making file
@deprecated since 6.0 (2016-12-07) As the shop installation is utf-8, this method will be removed.
@return array | [
"Goes",
"through",
"language",
"array",
"and",
"recodes",
"its",
"values",
"and",
"keys",
".",
"Returns",
"recoded",
"data"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L684-L694 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language._getLangFilesPathArray | protected function _getLangFilesPathArray($iLang)
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$aLangFiles = [];
$sAppDir = $oConfig->getAppDir();
$sLang = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageAbbr($iLang);
$sTheme = $oConfig->getConfigParam("sTheme");
$aModulePaths = $this->_getActiveModuleInfo();
//get generic lang files
$sGenericPath = $sAppDir . 'translations/' . $sLang;
if ($sGenericPath) {
$aLangFiles[] = $sGenericPath . "/lang.php";
$aLangFiles = $this->_appendLangFile($aLangFiles, $sGenericPath);
}
//get theme lang files
if ($sTheme) {
$sThemePath = $sAppDir . 'views/' . $sTheme . '/' . $sLang;
$aLangFiles[] = $sThemePath . "/lang.php";
$aLangFiles = $this->_appendLangFile($aLangFiles, $sThemePath);
}
$aLangFiles = array_merge($aLangFiles, $this->getCustomThemeLanguageFiles($iLang));
// modules language files
$aLangFiles = $this->_appendModuleLangFiles($aLangFiles, $aModulePaths, $sLang);
// custom language files
$aLangFiles = $this->_appendCustomLangFiles($aLangFiles, $sLang);
return count($aLangFiles) ? $aLangFiles : false;
} | php | protected function _getLangFilesPathArray($iLang)
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$aLangFiles = [];
$sAppDir = $oConfig->getAppDir();
$sLang = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageAbbr($iLang);
$sTheme = $oConfig->getConfigParam("sTheme");
$aModulePaths = $this->_getActiveModuleInfo();
//get generic lang files
$sGenericPath = $sAppDir . 'translations/' . $sLang;
if ($sGenericPath) {
$aLangFiles[] = $sGenericPath . "/lang.php";
$aLangFiles = $this->_appendLangFile($aLangFiles, $sGenericPath);
}
//get theme lang files
if ($sTheme) {
$sThemePath = $sAppDir . 'views/' . $sTheme . '/' . $sLang;
$aLangFiles[] = $sThemePath . "/lang.php";
$aLangFiles = $this->_appendLangFile($aLangFiles, $sThemePath);
}
$aLangFiles = array_merge($aLangFiles, $this->getCustomThemeLanguageFiles($iLang));
// modules language files
$aLangFiles = $this->_appendModuleLangFiles($aLangFiles, $aModulePaths, $sLang);
// custom language files
$aLangFiles = $this->_appendCustomLangFiles($aLangFiles, $sLang);
return count($aLangFiles) ? $aLangFiles : false;
} | [
"protected",
"function",
"_getLangFilesPathArray",
"(",
"$",
"iLang",
")",
"{",
"$",
"oConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"$",
"aLangFiles",
"=",
"[",
"]",
";",
"$",
"sAppDir... | Returns array with paths where frontend language files are stored
@param int $iLang active language
@return array | [
"Returns",
"array",
"with",
"paths",
"where",
"frontend",
"language",
"files",
"are",
"stored"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L714-L747 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.getCustomThemeLanguageFiles | protected function getCustomThemeLanguageFiles($language)
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sCustomTheme = $oConfig->getConfigParam("sCustomTheme");
$sAppDir = $oConfig->getAppDir();
$sLang = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageAbbr($language);
$aLangFiles = [];
if ($sCustomTheme) {
$sCustPath = $sAppDir . 'views/' . $sCustomTheme . '/' . $sLang;
$aLangFiles[] = $sCustPath . "/lang.php";
$aLangFiles = $this->_appendLangFile($aLangFiles, $sCustPath);
}
return $aLangFiles;
} | php | protected function getCustomThemeLanguageFiles($language)
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sCustomTheme = $oConfig->getConfigParam("sCustomTheme");
$sAppDir = $oConfig->getAppDir();
$sLang = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageAbbr($language);
$aLangFiles = [];
if ($sCustomTheme) {
$sCustPath = $sAppDir . 'views/' . $sCustomTheme . '/' . $sLang;
$aLangFiles[] = $sCustPath . "/lang.php";
$aLangFiles = $this->_appendLangFile($aLangFiles, $sCustPath);
}
return $aLangFiles;
} | [
"protected",
"function",
"getCustomThemeLanguageFiles",
"(",
"$",
"language",
")",
"{",
"$",
"oConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"$",
"sCustomTheme",
"=",
"$",
"oConfig",
"->",
... | Returns custom theme language files.
@param int $language active language
@return array | [
"Returns",
"custom",
"theme",
"language",
"files",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L756-L771 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language._getAdminLangFilesPathArray | protected function _getAdminLangFilesPathArray($iLang)
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$aLangFiles = [];
$sAppDir = $oConfig->getAppDir();
$sLang = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageAbbr($iLang);
$aModulePaths = [];
$aModulePaths = array_merge($aModulePaths, $this->_getActiveModuleInfo());
$aModulePaths = array_merge($aModulePaths, $this->_getDisabledModuleInfo());
// admin lang files
$sAdminPath = $sAppDir . 'views/admin/' . $sLang;
$aLangFiles[] = $sAdminPath . "/lang.php";
$aLangFiles[] = $sAppDir . 'translations/' . $sLang . '/translit_lang.php';
$aLangFiles = $this->_appendLangFile($aLangFiles, $sAdminPath);
// themes options lang files
$sThemePath = $sAppDir . 'views/*/' . $sLang;
$aLangFiles = $this->_appendLangFile($aLangFiles, $sThemePath, "options");
// module language files
$aLangFiles = $this->_appendModuleLangFiles($aLangFiles, $aModulePaths, $sLang, true);
// custom language files
$aLangFiles = $this->_appendCustomLangFiles($aLangFiles, $sLang, true);
return count($aLangFiles) ? $aLangFiles : false;
} | php | protected function _getAdminLangFilesPathArray($iLang)
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$aLangFiles = [];
$sAppDir = $oConfig->getAppDir();
$sLang = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageAbbr($iLang);
$aModulePaths = [];
$aModulePaths = array_merge($aModulePaths, $this->_getActiveModuleInfo());
$aModulePaths = array_merge($aModulePaths, $this->_getDisabledModuleInfo());
// admin lang files
$sAdminPath = $sAppDir . 'views/admin/' . $sLang;
$aLangFiles[] = $sAdminPath . "/lang.php";
$aLangFiles[] = $sAppDir . 'translations/' . $sLang . '/translit_lang.php';
$aLangFiles = $this->_appendLangFile($aLangFiles, $sAdminPath);
// themes options lang files
$sThemePath = $sAppDir . 'views/*/' . $sLang;
$aLangFiles = $this->_appendLangFile($aLangFiles, $sThemePath, "options");
// module language files
$aLangFiles = $this->_appendModuleLangFiles($aLangFiles, $aModulePaths, $sLang, true);
// custom language files
$aLangFiles = $this->_appendCustomLangFiles($aLangFiles, $sLang, true);
return count($aLangFiles) ? $aLangFiles : false;
} | [
"protected",
"function",
"_getAdminLangFilesPathArray",
"(",
"$",
"iLang",
")",
"{",
"$",
"oConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"$",
"aLangFiles",
"=",
"[",
"]",
";",
"$",
"sA... | Returns array with paths where admin language files are stored
@param int $iLang active language
@return array | [
"Returns",
"array",
"with",
"paths",
"where",
"admin",
"language",
"files",
"are",
"stored"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L780-L809 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language._appendLangFile | protected function _appendLangFile($aLangFiles, $sFullPath, $sFilePattern = "lang")
{
$aFiles = glob($sFullPath . "/*_{$sFilePattern}.php");
if (is_array($aFiles) && count($aFiles)) {
foreach ($aFiles as $sFile) {
if (!strpos($sFile, 'cust_lang.php')) {
$aLangFiles[] = $sFile;
}
}
}
return $aLangFiles;
} | php | protected function _appendLangFile($aLangFiles, $sFullPath, $sFilePattern = "lang")
{
$aFiles = glob($sFullPath . "/*_{$sFilePattern}.php");
if (is_array($aFiles) && count($aFiles)) {
foreach ($aFiles as $sFile) {
if (!strpos($sFile, 'cust_lang.php')) {
$aLangFiles[] = $sFile;
}
}
}
return $aLangFiles;
} | [
"protected",
"function",
"_appendLangFile",
"(",
"$",
"aLangFiles",
",",
"$",
"sFullPath",
",",
"$",
"sFilePattern",
"=",
"\"lang\"",
")",
"{",
"$",
"aFiles",
"=",
"glob",
"(",
"$",
"sFullPath",
".",
"\"/*_{$sFilePattern}.php\"",
")",
";",
"if",
"(",
"is_arr... | Appends lang or options files if exists, except custom lang files
@param array $aLangFiles existing language files
@param string $sFullPath path to language files to append
@param string $sFilePattern file pattern to search for, default is "lang"
@return array | [
"Appends",
"lang",
"or",
"options",
"files",
"if",
"exists",
"except",
"custom",
"lang",
"files"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L820-L832 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language._appendCustomLangFiles | protected function _appendCustomLangFiles($aLangFiles, $sLang, $blForAdmin = false)
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sAppDir = $oConfig->getAppDir();
$sTheme = $oConfig->getConfigParam("sTheme");
$sCustomTheme = $oConfig->getConfigParam("sCustomTheme");
if ($blForAdmin) {
$aLangFiles[] = $sAppDir . 'views/admin/' . $sLang . '/cust_lang.php';
} else {
if ($sTheme) {
$aLangFiles[] = $sAppDir . 'views/' . $sTheme . '/' . $sLang . '/cust_lang.php';
}
if ($sCustomTheme) {
$aLangFiles[] = $sAppDir . 'views/' . $sCustomTheme . '/' . $sLang . '/cust_lang.php';
}
}
return $aLangFiles;
} | php | protected function _appendCustomLangFiles($aLangFiles, $sLang, $blForAdmin = false)
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sAppDir = $oConfig->getAppDir();
$sTheme = $oConfig->getConfigParam("sTheme");
$sCustomTheme = $oConfig->getConfigParam("sCustomTheme");
if ($blForAdmin) {
$aLangFiles[] = $sAppDir . 'views/admin/' . $sLang . '/cust_lang.php';
} else {
if ($sTheme) {
$aLangFiles[] = $sAppDir . 'views/' . $sTheme . '/' . $sLang . '/cust_lang.php';
}
if ($sCustomTheme) {
$aLangFiles[] = $sAppDir . 'views/' . $sCustomTheme . '/' . $sLang . '/cust_lang.php';
}
}
return $aLangFiles;
} | [
"protected",
"function",
"_appendCustomLangFiles",
"(",
"$",
"aLangFiles",
",",
"$",
"sLang",
",",
"$",
"blForAdmin",
"=",
"false",
")",
"{",
"$",
"oConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")... | Appends Custom language files cust_lang.php
@param array $aLangFiles existing language files
@param string $sLang language abbreviation
@param bool $blForAdmin add files for admin
@return array | [
"Appends",
"Custom",
"language",
"files",
"cust_lang",
".",
"php"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L843-L862 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language._appendModuleLangFiles | protected function _appendModuleLangFiles($aLangFiles, $aModulePaths, $sLang, $blForAdmin = false)
{
if (is_array($aModulePaths)) {
foreach ($aModulePaths as $sPath) {
$moduleTranslationPathFinder = $this->getModuleTranslationPathFinder();
$sFullPath = $moduleTranslationPathFinder->findTranslationPath($sLang, $blForAdmin, $sPath);
$aLangFiles = $this->_appendLangFile($aLangFiles, $sFullPath);
//load admin modules options lang files
if ($blForAdmin) {
$aLangFiles[] = $sFullPath . '/module_options.php';
}
}
}
return $aLangFiles;
} | php | protected function _appendModuleLangFiles($aLangFiles, $aModulePaths, $sLang, $blForAdmin = false)
{
if (is_array($aModulePaths)) {
foreach ($aModulePaths as $sPath) {
$moduleTranslationPathFinder = $this->getModuleTranslationPathFinder();
$sFullPath = $moduleTranslationPathFinder->findTranslationPath($sLang, $blForAdmin, $sPath);
$aLangFiles = $this->_appendLangFile($aLangFiles, $sFullPath);
//load admin modules options lang files
if ($blForAdmin) {
$aLangFiles[] = $sFullPath . '/module_options.php';
}
}
}
return $aLangFiles;
} | [
"protected",
"function",
"_appendModuleLangFiles",
"(",
"$",
"aLangFiles",
",",
"$",
"aModulePaths",
",",
"$",
"sLang",
",",
"$",
"blForAdmin",
"=",
"false",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"aModulePaths",
")",
")",
"{",
"foreach",
"(",
"$",
"... | Appends module lang or options files if exists
@param array $aLangFiles existing language files
@param array $aModulePaths module language file paths
@param string $sLang language abbreviation
@param bool $blForAdmin add files for admin
@return array | [
"Appends",
"module",
"lang",
"or",
"options",
"files",
"if",
"exists"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L874-L890 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language._getLangFileCacheName | protected function _getLangFileCacheName($blAdmin, $iLang, $aLangFiles = null)
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sLangFilesIdent = '_default';
if (is_array($aLangFiles) && $aLangFiles) {
$sLangFilesIdent = '_' . md5(implode('+', $aLangFiles));
}
return "langcache_" . ((int) $blAdmin) . "_{$iLang}_" . $myConfig->getShopId() . "_" . $myConfig->getConfigParam('sTheme') . $sLangFilesIdent;
} | php | protected function _getLangFileCacheName($blAdmin, $iLang, $aLangFiles = null)
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sLangFilesIdent = '_default';
if (is_array($aLangFiles) && $aLangFiles) {
$sLangFilesIdent = '_' . md5(implode('+', $aLangFiles));
}
return "langcache_" . ((int) $blAdmin) . "_{$iLang}_" . $myConfig->getShopId() . "_" . $myConfig->getConfigParam('sTheme') . $sLangFilesIdent;
} | [
"protected",
"function",
"_getLangFileCacheName",
"(",
"$",
"blAdmin",
",",
"$",
"iLang",
",",
"$",
"aLangFiles",
"=",
"null",
")",
"{",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
... | Returns language cache file name
@param bool $blAdmin admin or not
@param int $iLang current language id
@param array $aLangFiles language files to load [optional]
@return string | [
"Returns",
"language",
"cache",
"file",
"name"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L901-L910 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language._getLanguageFileData | protected function _getLanguageFileData($blAdmin = false, $iLang = 0, $aLangFiles = null)
{
$myUtils = \OxidEsales\Eshop\Core\Registry::getUtils();
$sCacheName = $this->_getLangFileCacheName($blAdmin, $iLang, $aLangFiles);
$aLangCache = $myUtils->getLangCache($sCacheName);
if (!$aLangCache && $aLangFiles === null) {
if ($blAdmin) {
$aLangFiles = $this->_getAdminLangFilesPathArray($iLang);
} else {
$aLangFiles = $this->_getLangFilesPathArray($iLang);
}
}
if (!$aLangCache && $aLangFiles) {
$aLangCache = [];
$sBaseCharset = $this->getTranslationsExpectedEncoding();
$aLang = [];
$aLangSeoReplaceChars = [];
foreach ($aLangFiles as $sLangFile) {
if (file_exists($sLangFile) && is_readable($sLangFile)) {
//$aSeoReplaceChars null indicates that there is no setting made
$aSeoReplaceChars = null;
include $sLangFile;
$aLang = array_merge(['charset' => 'UTF-8'], $aLang);
if (isset($aSeoReplaceChars) && is_array($aSeoReplaceChars)) {
$aLangSeoReplaceChars = array_merge($aLangSeoReplaceChars, $aSeoReplaceChars);
}
$aLangCache = array_merge($aLangCache, $aLang);
}
}
$aLangCache['charset'] = $sBaseCharset;
// special character replacement list
$aLangCache['_aSeoReplaceChars'] = $aLangSeoReplaceChars;
//save to cache
$myUtils->setLangCache($sCacheName, $aLangCache);
}
return $aLangCache;
} | php | protected function _getLanguageFileData($blAdmin = false, $iLang = 0, $aLangFiles = null)
{
$myUtils = \OxidEsales\Eshop\Core\Registry::getUtils();
$sCacheName = $this->_getLangFileCacheName($blAdmin, $iLang, $aLangFiles);
$aLangCache = $myUtils->getLangCache($sCacheName);
if (!$aLangCache && $aLangFiles === null) {
if ($blAdmin) {
$aLangFiles = $this->_getAdminLangFilesPathArray($iLang);
} else {
$aLangFiles = $this->_getLangFilesPathArray($iLang);
}
}
if (!$aLangCache && $aLangFiles) {
$aLangCache = [];
$sBaseCharset = $this->getTranslationsExpectedEncoding();
$aLang = [];
$aLangSeoReplaceChars = [];
foreach ($aLangFiles as $sLangFile) {
if (file_exists($sLangFile) && is_readable($sLangFile)) {
//$aSeoReplaceChars null indicates that there is no setting made
$aSeoReplaceChars = null;
include $sLangFile;
$aLang = array_merge(['charset' => 'UTF-8'], $aLang);
if (isset($aSeoReplaceChars) && is_array($aSeoReplaceChars)) {
$aLangSeoReplaceChars = array_merge($aLangSeoReplaceChars, $aSeoReplaceChars);
}
$aLangCache = array_merge($aLangCache, $aLang);
}
}
$aLangCache['charset'] = $sBaseCharset;
// special character replacement list
$aLangCache['_aSeoReplaceChars'] = $aLangSeoReplaceChars;
//save to cache
$myUtils->setLangCache($sCacheName, $aLangCache);
}
return $aLangCache;
} | [
"protected",
"function",
"_getLanguageFileData",
"(",
"$",
"blAdmin",
"=",
"false",
",",
"$",
"iLang",
"=",
"0",
",",
"$",
"aLangFiles",
"=",
"null",
")",
"{",
"$",
"myUtils",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
... | Returns language cache array
@param bool $blAdmin admin or not [optional]
@param int $iLang current language id [optional]
@param array $aLangFiles language files to load [optional]
@return array | [
"Returns",
"language",
"cache",
"array"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L921-L965 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language._getLanguageMap | protected function _getLanguageMap($iLang, $blAdmin = null)
{
$blAdmin = isset($blAdmin) ? $blAdmin : $this->isAdmin();
$sKey = $iLang . ((int) $blAdmin);
if (!isset($this->_aLangMap[$sKey])) {
$this->_aLangMap[$sKey] = [];
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sMapFile = '';
$sParentMapFile = $myConfig->getAppDir() . '/views/' . ($blAdmin ? 'admin' : $myConfig->getConfigParam("sTheme")) . '/' . \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageAbbr($iLang) . '/map.php';
$sCustomThemeMapFile = $myConfig->getAppDir() . '/views/' . ($blAdmin ? 'admin' : $myConfig->getConfigParam("sCustomTheme")) . '/' . \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageAbbr($iLang) . '/map.php';
if (file_exists($sCustomThemeMapFile) && is_readable($sCustomThemeMapFile)) {
$sMapFile = $sCustomThemeMapFile;
} elseif (file_exists($sParentMapFile) && is_readable($sParentMapFile)) {
$sMapFile = $sParentMapFile;
}
if ($sMapFile) {
include $sMapFile;
$this->_aLangMap[$sKey] = $aMap;
}
}
return $this->_aLangMap[$sKey];
} | php | protected function _getLanguageMap($iLang, $blAdmin = null)
{
$blAdmin = isset($blAdmin) ? $blAdmin : $this->isAdmin();
$sKey = $iLang . ((int) $blAdmin);
if (!isset($this->_aLangMap[$sKey])) {
$this->_aLangMap[$sKey] = [];
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sMapFile = '';
$sParentMapFile = $myConfig->getAppDir() . '/views/' . ($blAdmin ? 'admin' : $myConfig->getConfigParam("sTheme")) . '/' . \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageAbbr($iLang) . '/map.php';
$sCustomThemeMapFile = $myConfig->getAppDir() . '/views/' . ($blAdmin ? 'admin' : $myConfig->getConfigParam("sCustomTheme")) . '/' . \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageAbbr($iLang) . '/map.php';
if (file_exists($sCustomThemeMapFile) && is_readable($sCustomThemeMapFile)) {
$sMapFile = $sCustomThemeMapFile;
} elseif (file_exists($sParentMapFile) && is_readable($sParentMapFile)) {
$sMapFile = $sParentMapFile;
}
if ($sMapFile) {
include $sMapFile;
$this->_aLangMap[$sKey] = $aMap;
}
}
return $this->_aLangMap[$sKey];
} | [
"protected",
"function",
"_getLanguageMap",
"(",
"$",
"iLang",
",",
"$",
"blAdmin",
"=",
"null",
")",
"{",
"$",
"blAdmin",
"=",
"isset",
"(",
"$",
"blAdmin",
")",
"?",
"$",
"blAdmin",
":",
"$",
"this",
"->",
"isAdmin",
"(",
")",
";",
"$",
"sKey",
"... | Returns language map array
@param int $iLang language index
@param bool $blAdmin admin mode [default NULL]
@return array | [
"Returns",
"language",
"map",
"array"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L975-L1000 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language._getCacheLanguageId | protected function _getCacheLanguageId($blAdmin, $iLang = null)
{
$iLang = ($iLang === null && $blAdmin) ? $this->getTplLanguage() : $iLang;
if (!isset($iLang)) {
$iLang = $this->getBaseLanguage();
if (!isset($iLang)) {
$iLang = 0;
}
}
return (int) $iLang;
} | php | protected function _getCacheLanguageId($blAdmin, $iLang = null)
{
$iLang = ($iLang === null && $blAdmin) ? $this->getTplLanguage() : $iLang;
if (!isset($iLang)) {
$iLang = $this->getBaseLanguage();
if (!isset($iLang)) {
$iLang = 0;
}
}
return (int) $iLang;
} | [
"protected",
"function",
"_getCacheLanguageId",
"(",
"$",
"blAdmin",
",",
"$",
"iLang",
"=",
"null",
")",
"{",
"$",
"iLang",
"=",
"(",
"$",
"iLang",
"===",
"null",
"&&",
"$",
"blAdmin",
")",
"?",
"$",
"this",
"->",
"getTplLanguage",
"(",
")",
":",
"$... | Returns current language cache language id
@param bool $blAdmin admin mode
@param int $iLang language id [optional]
@return int | [
"Returns",
"current",
"language",
"cache",
"language",
"id"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L1010-L1021 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language._getLangTranslationArray | protected function _getLangTranslationArray($iLang = null, $blAdmin = null, $aLangFiles = null)
{
startProfile("_getLangTranslationArray");
$blAdmin = isset($blAdmin) ? $blAdmin : $this->isAdmin();
$iLang = $this->_getCacheLanguageId($blAdmin, $iLang);
$sCacheName = $this->_getLangFileCacheName($blAdmin, $iLang, $aLangFiles);
if (!isset($this->_aLangCache[$sCacheName])) {
$this->_aLangCache[$sCacheName] = [];
}
if (!isset($this->_aLangCache[$sCacheName][$iLang])) {
// loading main lang files data
$this->_aLangCache[$sCacheName][$iLang] = $this->_getLanguageFileData($blAdmin, $iLang, $aLangFiles);
}
stopProfile("_getLangTranslationArray");
// if language array exists ..
return (isset($this->_aLangCache[$sCacheName][$iLang]) ? $this->_aLangCache[$sCacheName][$iLang] : []);
} | php | protected function _getLangTranslationArray($iLang = null, $blAdmin = null, $aLangFiles = null)
{
startProfile("_getLangTranslationArray");
$blAdmin = isset($blAdmin) ? $blAdmin : $this->isAdmin();
$iLang = $this->_getCacheLanguageId($blAdmin, $iLang);
$sCacheName = $this->_getLangFileCacheName($blAdmin, $iLang, $aLangFiles);
if (!isset($this->_aLangCache[$sCacheName])) {
$this->_aLangCache[$sCacheName] = [];
}
if (!isset($this->_aLangCache[$sCacheName][$iLang])) {
// loading main lang files data
$this->_aLangCache[$sCacheName][$iLang] = $this->_getLanguageFileData($blAdmin, $iLang, $aLangFiles);
}
stopProfile("_getLangTranslationArray");
// if language array exists ..
return (isset($this->_aLangCache[$sCacheName][$iLang]) ? $this->_aLangCache[$sCacheName][$iLang] : []);
} | [
"protected",
"function",
"_getLangTranslationArray",
"(",
"$",
"iLang",
"=",
"null",
",",
"$",
"blAdmin",
"=",
"null",
",",
"$",
"aLangFiles",
"=",
"null",
")",
"{",
"startProfile",
"(",
"\"_getLangTranslationArray\"",
")",
";",
"$",
"blAdmin",
"=",
"isset",
... | get language array from lang translation file
@param int $iLang optional language
@param bool $blAdmin admin mode switch
@param array $aLangFiles language files to load [optional]
@return array | [
"get",
"language",
"array",
"from",
"lang",
"translation",
"file"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L1032-L1052 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.getUrlLang | public function getUrlLang($iLang = null)
{
if (!$this->isAdmin()) {
$iLang = isset($iLang) ? $iLang : $this->getBaseLanguage();
return $this->getName() . "=" . $iLang;
}
} | php | public function getUrlLang($iLang = null)
{
if (!$this->isAdmin()) {
$iLang = isset($iLang) ? $iLang : $this->getBaseLanguage();
return $this->getName() . "=" . $iLang;
}
} | [
"public",
"function",
"getUrlLang",
"(",
"$",
"iLang",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isAdmin",
"(",
")",
")",
"{",
"$",
"iLang",
"=",
"isset",
"(",
"$",
"iLang",
")",
"?",
"$",
"iLang",
":",
"$",
"this",
"->",
"getB... | Returns url language parameter
@param int $iLang language id [optional]
@return string | [
"Returns",
"url",
"language",
"parameter"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L1096-L1102 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.detectLanguageByBrowser | public function detectLanguageByBrowser()
{
$sBrowserLanguage = $this->_getBrowserLanguage();
if (!is_null($sBrowserLanguage)) {
$aLanguages = $this->getLanguageArray(null, true);
foreach ($aLanguages as $oLang) {
if ($oLang->abbr == $sBrowserLanguage) {
return $oLang->id;
}
}
}
} | php | public function detectLanguageByBrowser()
{
$sBrowserLanguage = $this->_getBrowserLanguage();
if (!is_null($sBrowserLanguage)) {
$aLanguages = $this->getLanguageArray(null, true);
foreach ($aLanguages as $oLang) {
if ($oLang->abbr == $sBrowserLanguage) {
return $oLang->id;
}
}
}
} | [
"public",
"function",
"detectLanguageByBrowser",
"(",
")",
"{",
"$",
"sBrowserLanguage",
"=",
"$",
"this",
"->",
"_getBrowserLanguage",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"sBrowserLanguage",
")",
")",
"{",
"$",
"aLanguages",
"=",
"$",
"thi... | Detect language by user browser settings. Returns language ID if
detected, otherwise returns null.
@return int | [
"Detect",
"language",
"by",
"user",
"browser",
"settings",
".",
"Returns",
"language",
"ID",
"if",
"detected",
"otherwise",
"returns",
"null",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L1151-L1163 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.getMultiLangTables | public function getMultiLangTables()
{
$aTables = ["oxarticles", "oxartextends", "oxattribute",
"oxcategories", "oxcontents", "oxcountry",
"oxdelivery", "oxdiscount", "oxgroups",
"oxlinks",
// @deprecated since v.5.3.0 (2016-06-17); The Admin Menu: Customer Info -> News feature will be moved to a module in v6.0.0
"oxnews",
// END deprecated
"oxobject2attribute",
"oxpayments", "oxselectlist", "oxshops",
"oxactions", "oxwrapping", "oxdeliveryset",
"oxvendor", "oxmanufacturers", "oxmediaurls",
"oxstates"];
$aMultiLangTables = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aMultiLangTables');
if (is_array($aMultiLangTables)) {
$aTables = array_merge($aTables, $aMultiLangTables);
}
return $aTables;
} | php | public function getMultiLangTables()
{
$aTables = ["oxarticles", "oxartextends", "oxattribute",
"oxcategories", "oxcontents", "oxcountry",
"oxdelivery", "oxdiscount", "oxgroups",
"oxlinks",
// @deprecated since v.5.3.0 (2016-06-17); The Admin Menu: Customer Info -> News feature will be moved to a module in v6.0.0
"oxnews",
// END deprecated
"oxobject2attribute",
"oxpayments", "oxselectlist", "oxshops",
"oxactions", "oxwrapping", "oxdeliveryset",
"oxvendor", "oxmanufacturers", "oxmediaurls",
"oxstates"];
$aMultiLangTables = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aMultiLangTables');
if (is_array($aMultiLangTables)) {
$aTables = array_merge($aTables, $aMultiLangTables);
}
return $aTables;
} | [
"public",
"function",
"getMultiLangTables",
"(",
")",
"{",
"$",
"aTables",
"=",
"[",
"\"oxarticles\"",
",",
"\"oxartextends\"",
",",
"\"oxattribute\"",
",",
"\"oxcategories\"",
",",
"\"oxcontents\"",
",",
"\"oxcountry\"",
",",
"\"oxdelivery\"",
",",
"\"oxdiscount\"",
... | Returns all multi language tables
@return array | [
"Returns",
"all",
"multi",
"language",
"tables"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L1170-L1192 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.getSeoReplaceChars | public function getSeoReplaceChars($iLang)
{
// get language replace chars
$aSeoReplaceChars = $this->translateString('_aSeoReplaceChars', $iLang);
if (!is_array($aSeoReplaceChars)) {
$aSeoReplaceChars = [];
}
return $aSeoReplaceChars;
} | php | public function getSeoReplaceChars($iLang)
{
// get language replace chars
$aSeoReplaceChars = $this->translateString('_aSeoReplaceChars', $iLang);
if (!is_array($aSeoReplaceChars)) {
$aSeoReplaceChars = [];
}
return $aSeoReplaceChars;
} | [
"public",
"function",
"getSeoReplaceChars",
"(",
"$",
"iLang",
")",
"{",
"// get language replace chars",
"$",
"aSeoReplaceChars",
"=",
"$",
"this",
"->",
"translateString",
"(",
"'_aSeoReplaceChars'",
",",
"$",
"iLang",
")",
";",
"if",
"(",
"!",
"is_array",
"("... | Get SEO spec. chars replacement list for current language
@param int $iLang language ID
@return null | [
"Get",
"SEO",
"spec",
".",
"chars",
"replacement",
"list",
"for",
"current",
"language"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L1201-L1210 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language._getDisabledModuleInfo | protected function _getDisabledModuleInfo()
{
if ($this->_aDisabledModuleInfo === null) {
$oModuleList = oxNew(\OxidEsales\Eshop\Core\Module\ModuleList::class);
$this->_aDisabledModuleInfo = $oModuleList->getDisabledModuleInfo();
}
return $this->_aDisabledModuleInfo;
} | php | protected function _getDisabledModuleInfo()
{
if ($this->_aDisabledModuleInfo === null) {
$oModuleList = oxNew(\OxidEsales\Eshop\Core\Module\ModuleList::class);
$this->_aDisabledModuleInfo = $oModuleList->getDisabledModuleInfo();
}
return $this->_aDisabledModuleInfo;
} | [
"protected",
"function",
"_getDisabledModuleInfo",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_aDisabledModuleInfo",
"===",
"null",
")",
"{",
"$",
"oModuleList",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Module",
"\\",
"... | Returns active module Ids with paths
@return array | [
"Returns",
"active",
"module",
"Ids",
"with",
"paths"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L1232-L1240 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.getLanguageIds | public function getLanguageIds($iShopId = null)
{
if (empty($iShopId) || $iShopId == \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId()) {
$aLanguages = $this->getActiveShopLanguageIds();
} else {
$aLanguages = $this->_getLanguageIdsFromDatabase($iShopId);
}
return $aLanguages;
} | php | public function getLanguageIds($iShopId = null)
{
if (empty($iShopId) || $iShopId == \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId()) {
$aLanguages = $this->getActiveShopLanguageIds();
} else {
$aLanguages = $this->_getLanguageIdsFromDatabase($iShopId);
}
return $aLanguages;
} | [
"public",
"function",
"getLanguageIds",
"(",
"$",
"iShopId",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"iShopId",
")",
"||",
"$",
"iShopId",
"==",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")"... | Get current Shop language ids.
@param int $iShopId shop id
@return array | [
"Get",
"current",
"Shop",
"language",
"ids",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L1271-L1280 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language._selectLanguageParamValues | protected function _selectLanguageParamValues($sParamName, $sShopId = null)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sQuery = "
select " . $oConfig->getDecodeValueQuery() . " as oxvarvalue
from oxconfig
where oxvarname = '{$sParamName}' ";
if (!empty($sShopId)) {
$sQuery .= " and oxshopid = '{$sShopId}' limit 1";
}
return $oDb->getAll($sQuery);
} | php | protected function _selectLanguageParamValues($sParamName, $sShopId = null)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sQuery = "
select " . $oConfig->getDecodeValueQuery() . " as oxvarvalue
from oxconfig
where oxvarname = '{$sParamName}' ";
if (!empty($sShopId)) {
$sQuery .= " and oxshopid = '{$sShopId}' limit 1";
}
return $oDb->getAll($sQuery);
} | [
"protected",
"function",
"_selectLanguageParamValues",
"(",
"$",
"sParamName",
",",
"$",
"sShopId",
"=",
"null",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
"\\",
"OxidEsales",
"\\... | Returns array of all config values of given paramName
@param string $sParamName Parameter name
@param string|null $sShopId Shop id
@return array | [
"Returns",
"array",
"of",
"all",
"config",
"values",
"of",
"given",
"paramName"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L1351-L1366 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language._getLanguageIdsFromLanguageParamsArray | protected function _getLanguageIdsFromLanguageParamsArray($aLanguageParams)
{
$aLanguages = [];
foreach ($aLanguageParams as $sAbbr => $aValue) {
$iBaseId = (int) $aValue['baseId'];
$aLanguages[$iBaseId] = $sAbbr;
}
return $aLanguages;
} | php | protected function _getLanguageIdsFromLanguageParamsArray($aLanguageParams)
{
$aLanguages = [];
foreach ($aLanguageParams as $sAbbr => $aValue) {
$iBaseId = (int) $aValue['baseId'];
$aLanguages[$iBaseId] = $sAbbr;
}
return $aLanguages;
} | [
"protected",
"function",
"_getLanguageIdsFromLanguageParamsArray",
"(",
"$",
"aLanguageParams",
")",
"{",
"$",
"aLanguages",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"aLanguageParams",
"as",
"$",
"sAbbr",
"=>",
"$",
"aValue",
")",
"{",
"$",
"iBaseId",
"=",
"... | gets language code array from aLanguageParams array
@param array $aLanguageParams Language parameters
@return array | [
"gets",
"language",
"code",
"array",
"from",
"aLanguageParams",
"array"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L1375-L1384 | train |
OXID-eSales/oxideshop_ce | source/Core/Language.php | Language.getModuleTranslationPathFinder | protected function getModuleTranslationPathFinder()
{
if (is_null($this->moduleTranslationPathFinder)) {
$this->moduleTranslationPathFinder = oxNew(\OxidEsales\Eshop\Core\Module\ModuleTranslationPathFinder::class);
}
return $this->moduleTranslationPathFinder;
} | php | protected function getModuleTranslationPathFinder()
{
if (is_null($this->moduleTranslationPathFinder)) {
$this->moduleTranslationPathFinder = oxNew(\OxidEsales\Eshop\Core\Module\ModuleTranslationPathFinder::class);
}
return $this->moduleTranslationPathFinder;
} | [
"protected",
"function",
"getModuleTranslationPathFinder",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"moduleTranslationPathFinder",
")",
")",
"{",
"$",
"this",
"->",
"moduleTranslationPathFinder",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"... | Getter for the module translation path finder.
@return \OxidEsales\Eshop\Core\Module\ModuleTranslationPathFinder The module translation finder. | [
"Getter",
"for",
"the",
"module",
"translation",
"path",
"finder",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Language.php#L1403-L1410 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Actions.php | Actions.addArticle | public function addArticle($articleId)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sQ = "select max(oxsort) from oxactions2article where oxactionid = " . $oDb->quote($this->getId()) . " and oxshopid = '" . $this->getShopId() . "'";
$iSort = ((int) $oDb->getOne($sQ)) + 1;
$oNewGroup = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
$oNewGroup->init('oxactions2article');
$oNewGroup->oxactions2article__oxshopid = new \OxidEsales\Eshop\Core\Field($this->getShopId());
$oNewGroup->oxactions2article__oxactionid = new \OxidEsales\Eshop\Core\Field($this->getId());
$oNewGroup->oxactions2article__oxartid = new \OxidEsales\Eshop\Core\Field($articleId);
$oNewGroup->oxactions2article__oxsort = new \OxidEsales\Eshop\Core\Field($iSort);
$oNewGroup->save();
} | php | public function addArticle($articleId)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sQ = "select max(oxsort) from oxactions2article where oxactionid = " . $oDb->quote($this->getId()) . " and oxshopid = '" . $this->getShopId() . "'";
$iSort = ((int) $oDb->getOne($sQ)) + 1;
$oNewGroup = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
$oNewGroup->init('oxactions2article');
$oNewGroup->oxactions2article__oxshopid = new \OxidEsales\Eshop\Core\Field($this->getShopId());
$oNewGroup->oxactions2article__oxactionid = new \OxidEsales\Eshop\Core\Field($this->getId());
$oNewGroup->oxactions2article__oxartid = new \OxidEsales\Eshop\Core\Field($articleId);
$oNewGroup->oxactions2article__oxsort = new \OxidEsales\Eshop\Core\Field($iSort);
$oNewGroup->save();
} | [
"public",
"function",
"addArticle",
"(",
"$",
"articleId",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"sQ",
"=",
"\"select max(oxsort) from oxactions2article where oxac... | Adds an article to this actions
@param string $articleId id of the article to be added | [
"Adds",
"an",
"article",
"to",
"this",
"actions"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Actions.php#L43-L56 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Actions.php | Actions.removeArticle | public function removeArticle($articleId)
{
// remove actions from articles also
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sDelete = "delete from oxactions2article where oxactionid = " . $oDb->quote($this->getId()) . " and oxartid = " . $oDb->quote($articleId) . " and oxshopid = '" . $this->getShopId() . "'";
$iRemovedArticles = $oDb->execute($sDelete);
return (bool) $iRemovedArticles;
} | php | public function removeArticle($articleId)
{
// remove actions from articles also
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sDelete = "delete from oxactions2article where oxactionid = " . $oDb->quote($this->getId()) . " and oxartid = " . $oDb->quote($articleId) . " and oxshopid = '" . $this->getShopId() . "'";
$iRemovedArticles = $oDb->execute($sDelete);
return (bool) $iRemovedArticles;
} | [
"public",
"function",
"removeArticle",
"(",
"$",
"articleId",
")",
"{",
"// remove actions from articles also",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"sDelete",
"=",
"\"de... | Removes an article from this actions
@param string $articleId id of the article to be removed
@return bool | [
"Removes",
"an",
"article",
"from",
"this",
"actions"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Actions.php#L65-L73 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Actions.php | Actions.delete | public function delete($articleId = null)
{
$articleId = $articleId ? $articleId : $this->getId();
if (!$articleId) {
return false;
}
// remove actions from articles also
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sDelete = "delete from oxactions2article where oxactionid = " . $oDb->quote($articleId) . " and oxshopid = '" . $this->getShopId() . "'";
$oDb->execute($sDelete);
return parent::delete($articleId);
} | php | public function delete($articleId = null)
{
$articleId = $articleId ? $articleId : $this->getId();
if (!$articleId) {
return false;
}
// remove actions from articles also
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sDelete = "delete from oxactions2article where oxactionid = " . $oDb->quote($articleId) . " and oxshopid = '" . $this->getShopId() . "'";
$oDb->execute($sDelete);
return parent::delete($articleId);
} | [
"public",
"function",
"delete",
"(",
"$",
"articleId",
"=",
"null",
")",
"{",
"$",
"articleId",
"=",
"$",
"articleId",
"?",
"$",
"articleId",
":",
"$",
"this",
"->",
"getId",
"(",
")",
";",
"if",
"(",
"!",
"$",
"articleId",
")",
"{",
"return",
"fal... | Removes article action, returns true on success. For
performance - you can not load action object - just pass
action ID.
@param string $articleId Object ID
@return bool | [
"Removes",
"article",
"action",
"returns",
"true",
"on",
"success",
".",
"For",
"performance",
"-",
"you",
"can",
"not",
"load",
"action",
"object",
"-",
"just",
"pass",
"action",
"ID",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Actions.php#L84-L97 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Actions.php | Actions.getTimeLeft | public function getTimeLeft()
{
$iNow = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime();
$iFrom = strtotime($this->oxactions__oxactiveto->value);
return $iFrom - $iNow;
} | php | public function getTimeLeft()
{
$iNow = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime();
$iFrom = strtotime($this->oxactions__oxactiveto->value);
return $iFrom - $iNow;
} | [
"public",
"function",
"getTimeLeft",
"(",
")",
"{",
"$",
"iNow",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getUtilsDate",
"(",
")",
"->",
"getTime",
"(",
")",
";",
"$",
"iFrom",
"=",
"strtotime",
"(",
"$",
"this",
... | return time left until finished
@return int | [
"return",
"time",
"left",
"until",
"finished"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Actions.php#L104-L110 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Actions.php | Actions.getTimeUntilStart | public function getTimeUntilStart()
{
$iNow = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime();
$iFrom = strtotime($this->oxactions__oxactivefrom->value);
return $iFrom - $iNow;
} | php | public function getTimeUntilStart()
{
$iNow = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime();
$iFrom = strtotime($this->oxactions__oxactivefrom->value);
return $iFrom - $iNow;
} | [
"public",
"function",
"getTimeUntilStart",
"(",
")",
"{",
"$",
"iNow",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getUtilsDate",
"(",
")",
"->",
"getTime",
"(",
")",
";",
"$",
"iFrom",
"=",
"strtotime",
"(",
"$",
"th... | return time left until start
@return int | [
"return",
"time",
"left",
"until",
"start"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Actions.php#L117-L123 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Actions.php | Actions.start | public function start()
{
$this->oxactions__oxactivefrom = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s', \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime()));
if ($this->oxactions__oxactiveto->value && ($this->oxactions__oxactiveto->value != '0000-00-00 00:00:00')) {
$iNow = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime();
$iTo = strtotime($this->oxactions__oxactiveto->value);
if ($iNow > $iTo) {
$this->oxactions__oxactiveto = new \OxidEsales\Eshop\Core\Field('0000-00-00 00:00:00');
}
}
$this->save();
} | php | public function start()
{
$this->oxactions__oxactivefrom = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s', \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime()));
if ($this->oxactions__oxactiveto->value && ($this->oxactions__oxactiveto->value != '0000-00-00 00:00:00')) {
$iNow = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime();
$iTo = strtotime($this->oxactions__oxactiveto->value);
if ($iNow > $iTo) {
$this->oxactions__oxactiveto = new \OxidEsales\Eshop\Core\Field('0000-00-00 00:00:00');
}
}
$this->save();
} | [
"public",
"function",
"start",
"(",
")",
"{",
"$",
"this",
"->",
"oxactions__oxactivefrom",
"=",
"new",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Field",
"(",
"date",
"(",
"'Y-m-d H:i:s'",
",",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",... | start the promotion NOW! | [
"start",
"the",
"promotion",
"NOW!"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Actions.php#L128-L139 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Actions.php | Actions.stop | public function stop()
{
$this->oxactions__oxactiveto = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s', \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime()));
$this->save();
} | php | public function stop()
{
$this->oxactions__oxactiveto = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s', \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime()));
$this->save();
} | [
"public",
"function",
"stop",
"(",
")",
"{",
"$",
"this",
"->",
"oxactions__oxactiveto",
"=",
"new",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Field",
"(",
"date",
"(",
"'Y-m-d H:i:s'",
",",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
... | stop the promotion NOW! | [
"stop",
"the",
"promotion",
"NOW!"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Actions.php#L144-L148 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Actions.php | Actions.isRunning | public function isRunning()
{
if (!($this->oxactions__oxactive->value
&& $this->oxactions__oxtype->value == 2
&& $this->oxactions__oxactivefrom->value != '0000-00-00 00:00:00'
)
) {
return false;
}
$iNow = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime();
$iFrom = strtotime($this->oxactions__oxactivefrom->value);
if ($iNow < $iFrom) {
return false;
}
if ($this->oxactions__oxactiveto->value != '0000-00-00 00:00:00') {
$iTo = strtotime($this->oxactions__oxactiveto->value);
if ($iNow > $iTo) {
return false;
}
}
return true;
} | php | public function isRunning()
{
if (!($this->oxactions__oxactive->value
&& $this->oxactions__oxtype->value == 2
&& $this->oxactions__oxactivefrom->value != '0000-00-00 00:00:00'
)
) {
return false;
}
$iNow = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime();
$iFrom = strtotime($this->oxactions__oxactivefrom->value);
if ($iNow < $iFrom) {
return false;
}
if ($this->oxactions__oxactiveto->value != '0000-00-00 00:00:00') {
$iTo = strtotime($this->oxactions__oxactiveto->value);
if ($iNow > $iTo) {
return false;
}
}
return true;
} | [
"public",
"function",
"isRunning",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"oxactions__oxactive",
"->",
"value",
"&&",
"$",
"this",
"->",
"oxactions__oxtype",
"->",
"value",
"==",
"2",
"&&",
"$",
"this",
"->",
"oxactions__oxactivefrom",
"->"... | check if this action is active
@return bool | [
"check",
"if",
"this",
"action",
"is",
"active"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Actions.php#L155-L178 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Actions.php | Actions.getBannerArticle | public function getBannerArticle()
{
$sArtId = $this->fetchBannerArticleId();
if ($sArtId) {
$oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
if ($this->isAdmin()) {
$oArticle->setLanguage(\OxidEsales\Eshop\Core\Registry::getLang()->getEditLanguage());
}
if ($oArticle->load($sArtId)) {
return $oArticle;
}
}
return null;
} | php | public function getBannerArticle()
{
$sArtId = $this->fetchBannerArticleId();
if ($sArtId) {
$oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
if ($this->isAdmin()) {
$oArticle->setLanguage(\OxidEsales\Eshop\Core\Registry::getLang()->getEditLanguage());
}
if ($oArticle->load($sArtId)) {
return $oArticle;
}
}
return null;
} | [
"public",
"function",
"getBannerArticle",
"(",
")",
"{",
"$",
"sArtId",
"=",
"$",
"this",
"->",
"fetchBannerArticleId",
"(",
")",
";",
"if",
"(",
"$",
"sArtId",
")",
"{",
"$",
"oArticle",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"App... | return assigned banner article
@return oxArticle | [
"return",
"assigned",
"banner",
"article"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Actions.php#L197-L214 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Actions.php | Actions.fetchBannerArticleId | protected function fetchBannerArticleId()
{
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$articleId = $database->getOne(
'select oxobjectid from oxobject2action ' .
'where oxactionid=' . $database->quote($this->getId()) .
' and oxclass="oxarticle"'
);
return $articleId;
} | php | protected function fetchBannerArticleId()
{
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$articleId = $database->getOne(
'select oxobjectid from oxobject2action ' .
'where oxactionid=' . $database->quote($this->getId()) .
' and oxclass="oxarticle"'
);
return $articleId;
} | [
"protected",
"function",
"fetchBannerArticleId",
"(",
")",
"{",
"$",
"database",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"articleId",
"=",
"$",
"database",
"->",
"getOne",
"(",
"'se... | Fetch the oxobjectid of the article corresponding this action.
@return string The id of the oxobjectid belonging to this action. | [
"Fetch",
"the",
"oxobjectid",
"of",
"the",
"article",
"corresponding",
"this",
"action",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Actions.php#L222-L233 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Actions.php | Actions.getBannerPictureUrl | public function getBannerPictureUrl()
{
if (isset($this->oxactions__oxpic) && $this->oxactions__oxpic->value) {
$sPromoDir = \OxidEsales\Eshop\Core\Registry::getUtilsFile()->normalizeDir(\OxidEsales\Eshop\Core\UtilsFile::PROMO_PICTURE_DIR);
return \OxidEsales\Eshop\Core\Registry::getConfig()->getPictureUrl($sPromoDir . $this->oxactions__oxpic->value, false);
}
} | php | public function getBannerPictureUrl()
{
if (isset($this->oxactions__oxpic) && $this->oxactions__oxpic->value) {
$sPromoDir = \OxidEsales\Eshop\Core\Registry::getUtilsFile()->normalizeDir(\OxidEsales\Eshop\Core\UtilsFile::PROMO_PICTURE_DIR);
return \OxidEsales\Eshop\Core\Registry::getConfig()->getPictureUrl($sPromoDir . $this->oxactions__oxpic->value, false);
}
} | [
"public",
"function",
"getBannerPictureUrl",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"oxactions__oxpic",
")",
"&&",
"$",
"this",
"->",
"oxactions__oxpic",
"->",
"value",
")",
"{",
"$",
"sPromoDir",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",... | Returns assigned banner article picture url
@return string | [
"Returns",
"assigned",
"banner",
"article",
"picture",
"url"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Actions.php#L240-L247 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Actions.php | Actions.getBannerLink | public function getBannerLink()
{
$sUrl = null;
if (isset($this->oxactions__oxlink) && $this->oxactions__oxlink->value) {
/** @var \OxidEsales\Eshop\Core\UtilsUrl $oUtilsUlr */
$oUtilsUlr = \OxidEsales\Eshop\Core\Registry::getUtilsUrl();
$sUrl = $oUtilsUlr->addShopHost($this->oxactions__oxlink->value);
$sUrl = $oUtilsUlr->processUrl($sUrl);
} else {
if ($oArticle = $this->getBannerArticle()) {
// if article is assigned to banner, getting article link
$sUrl = $oArticle->getLink();
}
}
return $sUrl;
} | php | public function getBannerLink()
{
$sUrl = null;
if (isset($this->oxactions__oxlink) && $this->oxactions__oxlink->value) {
/** @var \OxidEsales\Eshop\Core\UtilsUrl $oUtilsUlr */
$oUtilsUlr = \OxidEsales\Eshop\Core\Registry::getUtilsUrl();
$sUrl = $oUtilsUlr->addShopHost($this->oxactions__oxlink->value);
$sUrl = $oUtilsUlr->processUrl($sUrl);
} else {
if ($oArticle = $this->getBannerArticle()) {
// if article is assigned to banner, getting article link
$sUrl = $oArticle->getLink();
}
}
return $sUrl;
} | [
"public",
"function",
"getBannerLink",
"(",
")",
"{",
"$",
"sUrl",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"oxactions__oxlink",
")",
"&&",
"$",
"this",
"->",
"oxactions__oxlink",
"->",
"value",
")",
"{",
"/** @var \\OxidEsales\\Eshop\\C... | Returns assigned banner link. If no link is defined and article is
assigned to banner, article link will be returned.
@return string | [
"Returns",
"assigned",
"banner",
"link",
".",
"If",
"no",
"link",
"is",
"defined",
"and",
"article",
"is",
"assigned",
"to",
"banner",
"article",
"link",
"will",
"be",
"returned",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Actions.php#L255-L272 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/DeliverySetRdfa.php | DeliverySetRdfa.getAllRDFaDeliveries | public function getAllRDFaDeliveries()
{
$aRDFaDeliveries = [];
$aAssignedRDFaDeliveries = $this->getAssignedRDFaDeliveries();
foreach ($this->_aRDFaDeliveries as $sName => $iType) {
$oDelivery = new stdClass();
$oDelivery->name = $sName;
$oDelivery->type = $iType;
$oDelivery->checked = in_array($sName, $aAssignedRDFaDeliveries);
$aRDFaDeliveries[] = $oDelivery;
}
return $aRDFaDeliveries;
} | php | public function getAllRDFaDeliveries()
{
$aRDFaDeliveries = [];
$aAssignedRDFaDeliveries = $this->getAssignedRDFaDeliveries();
foreach ($this->_aRDFaDeliveries as $sName => $iType) {
$oDelivery = new stdClass();
$oDelivery->name = $sName;
$oDelivery->type = $iType;
$oDelivery->checked = in_array($sName, $aAssignedRDFaDeliveries);
$aRDFaDeliveries[] = $oDelivery;
}
return $aRDFaDeliveries;
} | [
"public",
"function",
"getAllRDFaDeliveries",
"(",
")",
"{",
"$",
"aRDFaDeliveries",
"=",
"[",
"]",
";",
"$",
"aAssignedRDFaDeliveries",
"=",
"$",
"this",
"->",
"getAssignedRDFaDeliveries",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_aRDFaDeliveries",
... | Returns an array including all available RDFa deliveries.
@return array | [
"Returns",
"an",
"array",
"including",
"all",
"available",
"RDFa",
"deliveries",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/DeliverySetRdfa.php#L73-L86 | train |
OXID-eSales/oxideshop_ce | source/Core/Routing/ControllerClassNameResolver.php | ControllerClassNameResolver.getClassNameById | public function getClassNameById($classId)
{
$className = $this->getClassNameFromShopMap($classId);
if (empty($className)) {
$className = $this->getClassNameFromModuleMap($classId);
}
return $className;
} | php | public function getClassNameById($classId)
{
$className = $this->getClassNameFromShopMap($classId);
if (empty($className)) {
$className = $this->getClassNameFromModuleMap($classId);
}
return $className;
} | [
"public",
"function",
"getClassNameById",
"(",
"$",
"classId",
")",
"{",
"$",
"className",
"=",
"$",
"this",
"->",
"getClassNameFromShopMap",
"(",
"$",
"classId",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"className",
")",
")",
"{",
"$",
"className",
"=",
... | Map argument classId to related className.
@param string $classId
@return string|null | [
"Map",
"argument",
"classId",
"to",
"related",
"className",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Routing/ControllerClassNameResolver.php#L48-L56 | train |
OXID-eSales/oxideshop_ce | source/Core/Routing/ControllerClassNameResolver.php | ControllerClassNameResolver.getIdByClassName | public function getIdByClassName($className)
{
$classId = $this->getClassIdFromShopMap($className);
if (empty($classId)) {
$classId = $this->getClassIdFromModuleMap($className);
}
return $classId;
} | php | public function getIdByClassName($className)
{
$classId = $this->getClassIdFromShopMap($className);
if (empty($classId)) {
$classId = $this->getClassIdFromModuleMap($className);
}
return $classId;
} | [
"public",
"function",
"getIdByClassName",
"(",
"$",
"className",
")",
"{",
"$",
"classId",
"=",
"$",
"this",
"->",
"getClassIdFromShopMap",
"(",
"$",
"className",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"classId",
")",
")",
"{",
"$",
"classId",
"=",
"$... | Map argument className to related classId.
@param string $className
@return string|null | [
"Map",
"argument",
"className",
"to",
"related",
"classId",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Routing/ControllerClassNameResolver.php#L65-L73 | train |
OXID-eSales/oxideshop_ce | source/Core/Routing/ControllerClassNameResolver.php | ControllerClassNameResolver.getClassNameFromShopMap | protected function getClassNameFromShopMap($classId)
{
$shopControllerMapProvider = $this->getShopControllerMapProvider();
$idToNameMap = $shopControllerMapProvider->getControllerMap();
$className = $this->arrayLookup($classId, $idToNameMap);
return $className;
} | php | protected function getClassNameFromShopMap($classId)
{
$shopControllerMapProvider = $this->getShopControllerMapProvider();
$idToNameMap = $shopControllerMapProvider->getControllerMap();
$className = $this->arrayLookup($classId, $idToNameMap);
return $className;
} | [
"protected",
"function",
"getClassNameFromShopMap",
"(",
"$",
"classId",
")",
"{",
"$",
"shopControllerMapProvider",
"=",
"$",
"this",
"->",
"getShopControllerMapProvider",
"(",
")",
";",
"$",
"idToNameMap",
"=",
"$",
"shopControllerMapProvider",
"->",
"getControllerM... | Get class name from shop controller provider.
@param string $classId
@return string|null | [
"Get",
"class",
"name",
"from",
"shop",
"controller",
"provider",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Routing/ControllerClassNameResolver.php#L82-L89 | train |
OXID-eSales/oxideshop_ce | source/Core/Routing/ControllerClassNameResolver.php | ControllerClassNameResolver.getClassNameFromModuleMap | protected function getClassNameFromModuleMap($classId)
{
$moduleControllerMapProvider = $this->getModuleControllerMapProvider();
$idToNameMap = $moduleControllerMapProvider->getControllerMap();
$className = $this->arrayLookup($classId, $idToNameMap);
return $className;
} | php | protected function getClassNameFromModuleMap($classId)
{
$moduleControllerMapProvider = $this->getModuleControllerMapProvider();
$idToNameMap = $moduleControllerMapProvider->getControllerMap();
$className = $this->arrayLookup($classId, $idToNameMap);
return $className;
} | [
"protected",
"function",
"getClassNameFromModuleMap",
"(",
"$",
"classId",
")",
"{",
"$",
"moduleControllerMapProvider",
"=",
"$",
"this",
"->",
"getModuleControllerMapProvider",
"(",
")",
";",
"$",
"idToNameMap",
"=",
"$",
"moduleControllerMapProvider",
"->",
"getCon... | Get class name from module controller provider.
@param string $classId
@return string|null | [
"Get",
"class",
"name",
"from",
"module",
"controller",
"provider",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Routing/ControllerClassNameResolver.php#L98-L105 | train |
OXID-eSales/oxideshop_ce | source/Core/Routing/ControllerClassNameResolver.php | ControllerClassNameResolver.getClassIdFromShopMap | protected function getClassIdFromShopMap($className)
{
$shopControllerMapProvider = $this->getShopControllerMapProvider();
$idToNameMap = $shopControllerMapProvider->getControllerMap();
$classId = $this->arrayLookup($className, array_flip($idToNameMap));
return $classId;
} | php | protected function getClassIdFromShopMap($className)
{
$shopControllerMapProvider = $this->getShopControllerMapProvider();
$idToNameMap = $shopControllerMapProvider->getControllerMap();
$classId = $this->arrayLookup($className, array_flip($idToNameMap));
return $classId;
} | [
"protected",
"function",
"getClassIdFromShopMap",
"(",
"$",
"className",
")",
"{",
"$",
"shopControllerMapProvider",
"=",
"$",
"this",
"->",
"getShopControllerMapProvider",
"(",
")",
";",
"$",
"idToNameMap",
"=",
"$",
"shopControllerMapProvider",
"->",
"getControllerM... | Get class id from shop controller provider.
@param string $className
@return string|null | [
"Get",
"class",
"id",
"from",
"shop",
"controller",
"provider",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Routing/ControllerClassNameResolver.php#L114-L121 | train |
OXID-eSales/oxideshop_ce | source/Core/Routing/ControllerClassNameResolver.php | ControllerClassNameResolver.getClassIdFromModuleMap | protected function getClassIdFromModuleMap($className)
{
$moduleControllerMapProvider = $this->getModuleControllerMapProvider();
$idToNameMap = $moduleControllerMapProvider->getControllerMap();
$classId = $this->arrayLookup($className, array_flip($idToNameMap));
return $classId;
} | php | protected function getClassIdFromModuleMap($className)
{
$moduleControllerMapProvider = $this->getModuleControllerMapProvider();
$idToNameMap = $moduleControllerMapProvider->getControllerMap();
$classId = $this->arrayLookup($className, array_flip($idToNameMap));
return $classId;
} | [
"protected",
"function",
"getClassIdFromModuleMap",
"(",
"$",
"className",
")",
"{",
"$",
"moduleControllerMapProvider",
"=",
"$",
"this",
"->",
"getModuleControllerMapProvider",
"(",
")",
";",
"$",
"idToNameMap",
"=",
"$",
"moduleControllerMapProvider",
"->",
"getCon... | Get class id from module controller provider.
@param string $className
@return string|null | [
"Get",
"class",
"id",
"from",
"module",
"controller",
"provider",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Routing/ControllerClassNameResolver.php#L130-L137 | train |
OXID-eSales/oxideshop_ce | source/Core/Routing/ControllerClassNameResolver.php | ControllerClassNameResolver.getShopControllerMapProvider | protected function getShopControllerMapProvider()
{
if (is_null($this->shopControllerMapProvider)) {
$this->shopControllerMapProvider = oxNew(\OxidEsales\Eshop\Core\Routing\ShopControllerMapProvider::class);
}
return $this->shopControllerMapProvider;
} | php | protected function getShopControllerMapProvider()
{
if (is_null($this->shopControllerMapProvider)) {
$this->shopControllerMapProvider = oxNew(\OxidEsales\Eshop\Core\Routing\ShopControllerMapProvider::class);
}
return $this->shopControllerMapProvider;
} | [
"protected",
"function",
"getShopControllerMapProvider",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"shopControllerMapProvider",
")",
")",
"{",
"$",
"this",
"->",
"shopControllerMapProvider",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop"... | Getter for ShopControllerMapProvider object
@return \OxidEsales\Eshop\Core\Routing\ShopControllerMapProvider | [
"Getter",
"for",
"ShopControllerMapProvider",
"object"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Routing/ControllerClassNameResolver.php#L159-L166 | train |
OXID-eSales/oxideshop_ce | source/Core/Routing/ControllerClassNameResolver.php | ControllerClassNameResolver.getModuleControllerMapProvider | protected function getModuleControllerMapProvider()
{
if (is_null($this->moduleControllerMapProvider)) {
$this->moduleControllerMapProvider = oxNew(\OxidEsales\Eshop\Core\Routing\ModuleControllerMapProvider::class);
}
return $this->moduleControllerMapProvider;
} | php | protected function getModuleControllerMapProvider()
{
if (is_null($this->moduleControllerMapProvider)) {
$this->moduleControllerMapProvider = oxNew(\OxidEsales\Eshop\Core\Routing\ModuleControllerMapProvider::class);
}
return $this->moduleControllerMapProvider;
} | [
"protected",
"function",
"getModuleControllerMapProvider",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"moduleControllerMapProvider",
")",
")",
"{",
"$",
"this",
"->",
"moduleControllerMapProvider",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"... | Getter for ModuleControllerMapProvider object
@return \OxidEsales\Eshop\Core\Routing\ModuleControllerMapProvider | [
"Getter",
"for",
"ModuleControllerMapProvider",
"object"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Routing/ControllerClassNameResolver.php#L173-L180 | train |
OXID-eSales/oxideshop_ce | source/Core/Routing/Module/ClassProviderStorage.php | ClassProviderStorage.set | public function set($value)
{
$value = $this->toLowercase($value);
$this->getConfig()->saveShopConfVar('aarr', self::STORAGE_KEY, $value);
} | php | public function set($value)
{
$value = $this->toLowercase($value);
$this->getConfig()->saveShopConfVar('aarr', self::STORAGE_KEY, $value);
} | [
"public",
"function",
"set",
"(",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"toLowercase",
"(",
"$",
"value",
")",
";",
"$",
"this",
"->",
"getConfig",
"(",
")",
"->",
"saveShopConfVar",
"(",
"'aarr'",
",",
"self",
"::",
"STORAGE_... | Set the stored controller value from the oxconfig.
@param array $value The controllers field of the modules metadata. | [
"Set",
"the",
"stored",
"controller",
"value",
"from",
"the",
"oxconfig",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Routing/Module/ClassProviderStorage.php#L39-L44 | train |
OXID-eSales/oxideshop_ce | source/Core/Routing/Module/ClassProviderStorage.php | ClassProviderStorage.add | public function add($moduleId, $controllers)
{
$controllerMap = $this->get();
$controllerMap[$moduleId] = $controllers;
$this->set($controllerMap);
} | php | public function add($moduleId, $controllers)
{
$controllerMap = $this->get();
$controllerMap[$moduleId] = $controllers;
$this->set($controllerMap);
} | [
"public",
"function",
"add",
"(",
"$",
"moduleId",
",",
"$",
"controllers",
")",
"{",
"$",
"controllerMap",
"=",
"$",
"this",
"->",
"get",
"(",
")",
";",
"$",
"controllerMap",
"[",
"$",
"moduleId",
"]",
"=",
"$",
"controllers",
";",
"$",
"this",
"->"... | Add the controllers for the module, given by its ID, to the storage.
@param string $moduleId The ID of the module controllers to add.
@param array $controllers The controllers to add to the storage. | [
"Add",
"the",
"controllers",
"for",
"the",
"module",
"given",
"by",
"its",
"ID",
"to",
"the",
"storage",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Routing/Module/ClassProviderStorage.php#L52-L58 | train |
OXID-eSales/oxideshop_ce | source/Core/Routing/Module/ClassProviderStorage.php | ClassProviderStorage.remove | public function remove($moduleId)
{
$controllerMap = $this->get();
unset($controllerMap[strtolower($moduleId)]);
$this->set($controllerMap);
} | php | public function remove($moduleId)
{
$controllerMap = $this->get();
unset($controllerMap[strtolower($moduleId)]);
$this->set($controllerMap);
} | [
"public",
"function",
"remove",
"(",
"$",
"moduleId",
")",
"{",
"$",
"controllerMap",
"=",
"$",
"this",
"->",
"get",
"(",
")",
";",
"unset",
"(",
"$",
"controllerMap",
"[",
"strtolower",
"(",
"$",
"moduleId",
")",
"]",
")",
";",
"$",
"this",
"->",
... | Delete the controllers for the module, given by its ID, from the storage.
@param string $moduleId The ID of the module, for which we want to delete the controllers from the storage. | [
"Delete",
"the",
"controllers",
"for",
"the",
"module",
"given",
"by",
"its",
"ID",
"from",
"the",
"storage",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Routing/Module/ClassProviderStorage.php#L65-L71 | train |
OXID-eSales/oxideshop_ce | source/Core/Routing/Module/ClassProviderStorage.php | ClassProviderStorage.toLowercase | private function toLowercase($modulesControllers)
{
$result = [];
if (!is_null($modulesControllers)) {
foreach ($modulesControllers as $moduleId => $controllers) {
$result[strtolower($moduleId)] = $this->controllerKeysToLowercase($controllers);
}
}
return $result;
} | php | private function toLowercase($modulesControllers)
{
$result = [];
if (!is_null($modulesControllers)) {
foreach ($modulesControllers as $moduleId => $controllers) {
$result[strtolower($moduleId)] = $this->controllerKeysToLowercase($controllers);
}
}
return $result;
} | [
"private",
"function",
"toLowercase",
"(",
"$",
"modulesControllers",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"modulesControllers",
")",
")",
"{",
"foreach",
"(",
"$",
"modulesControllers",
"as",
"$",
"moduleId",
... | Change the module IDs and the controller keys to lower case.
@param array $modulesControllers The controller arrays of several modules.
@return array The given controller arrays of several modules, with the module IDs and the controller keys in lower case. | [
"Change",
"the",
"module",
"IDs",
"and",
"the",
"controller",
"keys",
"to",
"lower",
"case",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Routing/Module/ClassProviderStorage.php#L80-L91 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/SeoEncoderCategory.php | SeoEncoderCategory.getCategoryUri | public function getCategoryUri($oCat, $iLang = null, $blRegenerate = false)
{
startProfile(__FUNCTION__);
$sCatId = $oCat->getId();
// skipping external category URLs
if ($oCat->oxcategories__oxextlink->value) {
$sSeoUrl = null;
} else {
// not found in cache, process it from the top
if (!isset($iLang)) {
$iLang = $oCat->getLanguage();
}
$aCacheMap = [];
$aStdLinks = [];
while ($oCat && !($sSeoUrl = $this->_categoryUrlLoader($oCat, $iLang))) {
if ($iLang != $oCat->getLanguage()) {
$sId = $oCat->getId();
$oCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
$oCat->loadInLang($iLang, $sId);
}
// prepare oCat title part
$sTitle = $this->_prepareTitle($oCat->oxcategories__oxtitle->value, false, $oCat->getLanguage());
foreach (array_keys($aCacheMap) as $id) {
$aCacheMap[$id] = $sTitle . '/' . $aCacheMap[$id];
}
$aCacheMap[$oCat->getId()] = $sTitle;
$aStdLinks[$oCat->getId()] = $oCat->getBaseStdLink($iLang);
// load parent
$oCat = $oCat->getParentCategory();
}
foreach ($aCacheMap as $sId => $sUri) {
$this->_aCatCache[$sId . '_' . $iLang] = $this->_processSeoUrl($sSeoUrl . $sUri . '/', $sId, $iLang);
$this->_saveToDb('oxcategory', $sId, $aStdLinks[$sId], $this->_aCatCache[$sId . '_' . $iLang], $iLang);
}
$sSeoUrl = $this->_aCatCache[$sCatId . '_' . $iLang];
}
stopProfile(__FUNCTION__);
return $sSeoUrl;
} | php | public function getCategoryUri($oCat, $iLang = null, $blRegenerate = false)
{
startProfile(__FUNCTION__);
$sCatId = $oCat->getId();
// skipping external category URLs
if ($oCat->oxcategories__oxextlink->value) {
$sSeoUrl = null;
} else {
// not found in cache, process it from the top
if (!isset($iLang)) {
$iLang = $oCat->getLanguage();
}
$aCacheMap = [];
$aStdLinks = [];
while ($oCat && !($sSeoUrl = $this->_categoryUrlLoader($oCat, $iLang))) {
if ($iLang != $oCat->getLanguage()) {
$sId = $oCat->getId();
$oCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
$oCat->loadInLang($iLang, $sId);
}
// prepare oCat title part
$sTitle = $this->_prepareTitle($oCat->oxcategories__oxtitle->value, false, $oCat->getLanguage());
foreach (array_keys($aCacheMap) as $id) {
$aCacheMap[$id] = $sTitle . '/' . $aCacheMap[$id];
}
$aCacheMap[$oCat->getId()] = $sTitle;
$aStdLinks[$oCat->getId()] = $oCat->getBaseStdLink($iLang);
// load parent
$oCat = $oCat->getParentCategory();
}
foreach ($aCacheMap as $sId => $sUri) {
$this->_aCatCache[$sId . '_' . $iLang] = $this->_processSeoUrl($sSeoUrl . $sUri . '/', $sId, $iLang);
$this->_saveToDb('oxcategory', $sId, $aStdLinks[$sId], $this->_aCatCache[$sId . '_' . $iLang], $iLang);
}
$sSeoUrl = $this->_aCatCache[$sCatId . '_' . $iLang];
}
stopProfile(__FUNCTION__);
return $sSeoUrl;
} | [
"public",
"function",
"getCategoryUri",
"(",
"$",
"oCat",
",",
"$",
"iLang",
"=",
"null",
",",
"$",
"blRegenerate",
"=",
"false",
")",
"{",
"startProfile",
"(",
"__FUNCTION__",
")",
";",
"$",
"sCatId",
"=",
"$",
"oCat",
"->",
"getId",
"(",
")",
";",
... | Returns SEO uri for passed category
@param \OxidEsales\Eshop\Application\Model\Category $oCat category object
@param int $iLang language
@param bool $blRegenerate if TRUE forces seo url regeneration
@return string | [
"Returns",
"SEO",
"uri",
"for",
"passed",
"category"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SeoEncoderCategory.php#L77-L126 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/SeoEncoderCategory.php | SeoEncoderCategory.getCategoryPageUrl | public function getCategoryPageUrl($category, $pageNumber, $languageId = null, $isFixed = null)
{
if (!isset($languageId)) {
$languageId = $category->getLanguage();
}
$stdUrl = $category->getBaseStdLink($languageId);
$parameters = null;
$stdUrl = $this->_trimUrl($stdUrl, $languageId);
$seoUrl = $this->getCategoryUri($category, $languageId);
if ($isFixed === null) {
$isFixed = $this->_isFixed('oxcategory', $category->getId(), $languageId);
}
return $this->assembleFullPageUrl($category, 'oxcategory', $stdUrl, $seoUrl, $pageNumber, $parameters, $languageId, $isFixed);
} | php | public function getCategoryPageUrl($category, $pageNumber, $languageId = null, $isFixed = null)
{
if (!isset($languageId)) {
$languageId = $category->getLanguage();
}
$stdUrl = $category->getBaseStdLink($languageId);
$parameters = null;
$stdUrl = $this->_trimUrl($stdUrl, $languageId);
$seoUrl = $this->getCategoryUri($category, $languageId);
if ($isFixed === null) {
$isFixed = $this->_isFixed('oxcategory', $category->getId(), $languageId);
}
return $this->assembleFullPageUrl($category, 'oxcategory', $stdUrl, $seoUrl, $pageNumber, $parameters, $languageId, $isFixed);
} | [
"public",
"function",
"getCategoryPageUrl",
"(",
"$",
"category",
",",
"$",
"pageNumber",
",",
"$",
"languageId",
"=",
"null",
",",
"$",
"isFixed",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"languageId",
")",
")",
"{",
"$",
"languageId"... | Returns category SEO url for specified page
@param \OxidEsales\Eshop\Application\Model\Category $category Category object.
@param int $pageNumber Number of the page which should be prepared.
@param int $languageId Language id.
@param bool $isFixed Fixed url marker (default is null).
@return string | [
"Returns",
"category",
"SEO",
"url",
"for",
"specified",
"page"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SeoEncoderCategory.php#L138-L154 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/SeoEncoderCategory.php | SeoEncoderCategory.markRelatedAsExpired | public function markRelatedAsExpired($oCategory)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sIdQuoted = $oDb->quote($oCategory->getId());
// select it from table instead of using object carrying value
// this is because this method is usually called inside update,
// where object may already be carrying changed id
$aCatInfo = $oDb->getAll("select oxrootid, oxleft, oxright from oxcategories where oxid = $sIdQuoted limit 1");
$sCatRootIdQuoted = $oDb->quote($aCatInfo[0][0]);
// update sub cats
$sQ = "update oxseo as seo1, (select oxid from oxcategories where oxrootid={$sCatRootIdQuoted} and oxleft > " . ((int) $aCatInfo[0][1]) . " and oxright < " . ((int) $aCatInfo[0][2]) . ") as seo2 set seo1.oxexpired = '1' where seo1.oxtype = 'oxcategory' and seo1.oxobjectid = seo2.oxid";
$oDb->execute($sQ);
// update subarticles
$sQ = "update oxseo as seo1, (select o2c.oxobjectid as id from oxcategories as cat left join oxobject2category"
." as o2c on o2c.oxcatnid=cat.oxid where cat.oxrootid={$sCatRootIdQuoted} and cat.oxleft >= "
.((int) $aCatInfo[0][1] )." and cat.oxright <= ".((int) $aCatInfo[0][2] ).") as seo2 "
."set seo1.oxexpired = '1' where seo1.oxtype = 'oxarticle' and seo1.oxobjectid = seo2.id "
."and seo1.oxfixed = 0";
$oDb->execute($sQ);
} | php | public function markRelatedAsExpired($oCategory)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sIdQuoted = $oDb->quote($oCategory->getId());
// select it from table instead of using object carrying value
// this is because this method is usually called inside update,
// where object may already be carrying changed id
$aCatInfo = $oDb->getAll("select oxrootid, oxleft, oxright from oxcategories where oxid = $sIdQuoted limit 1");
$sCatRootIdQuoted = $oDb->quote($aCatInfo[0][0]);
// update sub cats
$sQ = "update oxseo as seo1, (select oxid from oxcategories where oxrootid={$sCatRootIdQuoted} and oxleft > " . ((int) $aCatInfo[0][1]) . " and oxright < " . ((int) $aCatInfo[0][2]) . ") as seo2 set seo1.oxexpired = '1' where seo1.oxtype = 'oxcategory' and seo1.oxobjectid = seo2.oxid";
$oDb->execute($sQ);
// update subarticles
$sQ = "update oxseo as seo1, (select o2c.oxobjectid as id from oxcategories as cat left join oxobject2category"
." as o2c on o2c.oxcatnid=cat.oxid where cat.oxrootid={$sCatRootIdQuoted} and cat.oxleft >= "
.((int) $aCatInfo[0][1] )." and cat.oxright <= ".((int) $aCatInfo[0][2] ).") as seo2 "
."set seo1.oxexpired = '1' where seo1.oxtype = 'oxarticle' and seo1.oxobjectid = seo2.id "
."and seo1.oxfixed = 0";
$oDb->execute($sQ);
} | [
"public",
"function",
"markRelatedAsExpired",
"(",
"$",
"oCategory",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"sIdQuoted",
"=",
"$",
"oDb",
"->",
"quote",
"("... | Marks related to category objects as expired
@param \OxidEsales\Eshop\Application\Model\Category $oCategory Category object | [
"Marks",
"related",
"to",
"category",
"objects",
"as",
"expired"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SeoEncoderCategory.php#L186-L208 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/SeoEncoderCategory.php | SeoEncoderCategory.onDeleteCategory | public function onDeleteCategory($oCategory)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sIdQuoted = $oDb->quote($oCategory->getId());
$oDb->execute("update oxseo, (select oxseourl from oxseo where oxobjectid = $sIdQuoted and oxtype = 'oxcategory') as test set oxseo.oxexpired=1 where oxseo.oxseourl like concat(test.oxseourl, '%') and (oxtype = 'oxcategory' or oxtype = 'oxarticle')");
$oDb->execute("delete from oxseo where oxseo.oxtype = 'oxarticle' and oxseo.oxparams = $sIdQuoted");
$oDb->execute("delete from oxseo where oxobjectid = $sIdQuoted and oxtype = 'oxcategory'");
$oDb->execute("delete from oxobject2seodata where oxobjectid = $sIdQuoted");
$oDb->execute("delete from oxseohistory where oxobjectid = $sIdQuoted");
} | php | public function onDeleteCategory($oCategory)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sIdQuoted = $oDb->quote($oCategory->getId());
$oDb->execute("update oxseo, (select oxseourl from oxseo where oxobjectid = $sIdQuoted and oxtype = 'oxcategory') as test set oxseo.oxexpired=1 where oxseo.oxseourl like concat(test.oxseourl, '%') and (oxtype = 'oxcategory' or oxtype = 'oxarticle')");
$oDb->execute("delete from oxseo where oxseo.oxtype = 'oxarticle' and oxseo.oxparams = $sIdQuoted");
$oDb->execute("delete from oxseo where oxobjectid = $sIdQuoted and oxtype = 'oxcategory'");
$oDb->execute("delete from oxobject2seodata where oxobjectid = $sIdQuoted");
$oDb->execute("delete from oxseohistory where oxobjectid = $sIdQuoted");
} | [
"public",
"function",
"onDeleteCategory",
"(",
"$",
"oCategory",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"sIdQuoted",
"=",
"$",
"oDb",
"->",
"quote",
"(",
... | deletes Category seo entries
@param \OxidEsales\Eshop\Application\Model\Category $oCategory Category object | [
"deletes",
"Category",
"seo",
"entries"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SeoEncoderCategory.php#L215-L224 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ContentController.php | ContentController.getViewId | public function getViewId()
{
if (!isset($this->_sViewId)) {
$this->_sViewId = parent::getViewId() . '|' . \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxcid');
}
return $this->_sViewId;
} | php | public function getViewId()
{
if (!isset($this->_sViewId)) {
$this->_sViewId = parent::getViewId() . '|' . \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxcid');
}
return $this->_sViewId;
} | [
"public",
"function",
"getViewId",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_sViewId",
")",
")",
"{",
"$",
"this",
"->",
"_sViewId",
"=",
"parent",
"::",
"getViewId",
"(",
")",
".",
"'|'",
".",
"\\",
"OxidEsales",
"\\",
"Esh... | Returns prefix ID used by template engine.
@return string $this->_sViewId | [
"Returns",
"prefix",
"ID",
"used",
"by",
"template",
"engine",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ContentController.php#L112-L119 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ContentController.php | ContentController._canShowContent | protected function _canShowContent($sContentIdent)
{
return !($this->isEnabledPrivateSales() &&
!$this->getUser() && !in_array($sContentIdent, $this->_aPsAllowedContents)
);
} | php | protected function _canShowContent($sContentIdent)
{
return !($this->isEnabledPrivateSales() &&
!$this->getUser() && !in_array($sContentIdent, $this->_aPsAllowedContents)
);
} | [
"protected",
"function",
"_canShowContent",
"(",
"$",
"sContentIdent",
")",
"{",
"return",
"!",
"(",
"$",
"this",
"->",
"isEnabledPrivateSales",
"(",
")",
"&&",
"!",
"$",
"this",
"->",
"getUser",
"(",
")",
"&&",
"!",
"in_array",
"(",
"$",
"sContentIdent",
... | Checks if content can be shown
@param string $sContentIdent ident of content to display
@return bool | [
"Checks",
"if",
"content",
"can",
"be",
"shown"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ContentController.php#L167-L172 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ContentController.php | ContentController.getContentCategory | public function getContentCategory()
{
if ($this->_oContentCat === null) {
// setting default status ..
$this->_oContentCat = false;
if (($oContent = $this->getContent()) && $oContent->oxcontents__oxtype->value == 2) {
$this->_oContentCat = $oContent;
}
}
return $this->_oContentCat;
} | php | public function getContentCategory()
{
if ($this->_oContentCat === null) {
// setting default status ..
$this->_oContentCat = false;
if (($oContent = $this->getContent()) && $oContent->oxcontents__oxtype->value == 2) {
$this->_oContentCat = $oContent;
}
}
return $this->_oContentCat;
} | [
"public",
"function",
"getContentCategory",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oContentCat",
"===",
"null",
")",
"{",
"// setting default status ..",
"$",
"this",
"->",
"_oContentCat",
"=",
"false",
";",
"if",
"(",
"(",
"$",
"oContent",
"=",
"$... | If current content is assigned to category returns its object
@return oxcontent | [
"If",
"current",
"content",
"is",
"assigned",
"to",
"category",
"returns",
"its",
"object"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ContentController.php#L216-L227 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ContentController.php | ContentController.showPlainTemplate | public function showPlainTemplate()
{
$blPlain = (bool) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('plain');
if ($blPlain === false) {
$oUser = $this->getUser();
if ($this->isEnabledPrivateSales() &&
(!$oUser || ($oUser && !$oUser->isTermsAccepted()))
) {
$blPlain = true;
}
}
return (bool) $blPlain;
} | php | public function showPlainTemplate()
{
$blPlain = (bool) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('plain');
if ($blPlain === false) {
$oUser = $this->getUser();
if ($this->isEnabledPrivateSales() &&
(!$oUser || ($oUser && !$oUser->isTermsAccepted()))
) {
$blPlain = true;
}
}
return (bool) $blPlain;
} | [
"public",
"function",
"showPlainTemplate",
"(",
")",
"{",
"$",
"blPlain",
"=",
"(",
"bool",
")",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getRequestParameter",
"(",
"'plain'",
")",
";",
"if",
... | Returns true if user forces to display plain template or
if private sales switched ON and user is not logged in
@return bool | [
"Returns",
"true",
"if",
"user",
"forces",
"to",
"display",
"plain",
"template",
"or",
"if",
"private",
"sales",
"switched",
"ON",
"and",
"user",
"is",
"not",
"logged",
"in"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ContentController.php#L235-L248 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ContentController.php | ContentController.getContentId | public function getContentId()
{
if ($this->_sContentId === null) {
$sContentId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxcid');
$sLoadId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxloadid');
$this->_sContentId = false;
$oContent = oxNew(\OxidEsales\Eshop\Application\Model\Content::class);
if ($sLoadId) {
$blRes = $oContent->loadByIdent($sLoadId);
} elseif ($sContentId) {
$blRes = $oContent->load($sContentId);
} else {
//get default content (impressum)
$blRes = $oContent->loadByIdent('oximpressum');
}
if ($blRes && $oContent->oxcontents__oxactive->value) {
$this->_sContentId = $oContent->oxcontents__oxid->value;
$this->_oContent = $oContent;
}
}
return $this->_sContentId;
} | php | public function getContentId()
{
if ($this->_sContentId === null) {
$sContentId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxcid');
$sLoadId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxloadid');
$this->_sContentId = false;
$oContent = oxNew(\OxidEsales\Eshop\Application\Model\Content::class);
if ($sLoadId) {
$blRes = $oContent->loadByIdent($sLoadId);
} elseif ($sContentId) {
$blRes = $oContent->load($sContentId);
} else {
//get default content (impressum)
$blRes = $oContent->loadByIdent('oximpressum');
}
if ($blRes && $oContent->oxcontents__oxactive->value) {
$this->_sContentId = $oContent->oxcontents__oxid->value;
$this->_oContent = $oContent;
}
}
return $this->_sContentId;
} | [
"public",
"function",
"getContentId",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sContentId",
"===",
"null",
")",
"{",
"$",
"sContentId",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"ge... | Template variable getter. Returns active content id.
If no content id specified, uses "impressum" content id
@return object | [
"Template",
"variable",
"getter",
".",
"Returns",
"active",
"content",
"id",
".",
"If",
"no",
"content",
"id",
"specified",
"uses",
"impressum",
"content",
"id"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ContentController.php#L266-L291 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ContentController.php | ContentController._getTplName | protected function _getTplName()
{
// assign template name
$sTplName = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('tpl');
if ($sTplName) {
// security fix so that you cant access files from outside template dir
$sTplName = basename($sTplName);
//checking if it is template name, not content id
if (!getStr()->preg_match("/\.tpl$/", $sTplName)) {
$sTplName = null;
} else {
$sTplName = 'message/' . $sTplName;
}
}
return $sTplName;
} | php | protected function _getTplName()
{
// assign template name
$sTplName = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('tpl');
if ($sTplName) {
// security fix so that you cant access files from outside template dir
$sTplName = basename($sTplName);
//checking if it is template name, not content id
if (!getStr()->preg_match("/\.tpl$/", $sTplName)) {
$sTplName = null;
} else {
$sTplName = 'message/' . $sTplName;
}
}
return $sTplName;
} | [
"protected",
"function",
"_getTplName",
"(",
")",
"{",
"// assign template name",
"$",
"sTplName",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getRequestParameter",
"(",
"'tpl'",
")",
";",
"if",
... | Returns name of template
@return string | [
"Returns",
"name",
"of",
"template"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ContentController.php#L328-L346 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ContentController.php | ContentController.getTitle | public function getTitle()
{
if ($this->_sContentTitle === null) {
$oContent = $this->getContent();
$this->_sContentTitle = $oContent->oxcontents__oxtitle->value;
}
return $this->_sContentTitle;
} | php | public function getTitle()
{
if ($this->_sContentTitle === null) {
$oContent = $this->getContent();
$this->_sContentTitle = $oContent->oxcontents__oxtitle->value;
}
return $this->_sContentTitle;
} | [
"public",
"function",
"getTitle",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sContentTitle",
"===",
"null",
")",
"{",
"$",
"oContent",
"=",
"$",
"this",
"->",
"getContent",
"(",
")",
";",
"$",
"this",
"->",
"_sContentTitle",
"=",
"$",
"oContent",
... | Template variable getter. Returns tag title
@return string | [
"Template",
"variable",
"getter",
".",
"Returns",
"tag",
"title"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ContentController.php#L372-L380 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ContentController.php | ContentController.getBusinessEntityExtends | public function getBusinessEntityExtends()
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$aExtends = [];
foreach ($this->_aBusinessEntityExtends as $sExtend) {
$aExtends[$sExtend] = $myConfig->getConfigParam($sExtend);
}
return $aExtends;
} | php | public function getBusinessEntityExtends()
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$aExtends = [];
foreach ($this->_aBusinessEntityExtends as $sExtend) {
$aExtends[$sExtend] = $myConfig->getConfigParam($sExtend);
}
return $aExtends;
} | [
"public",
"function",
"getBusinessEntityExtends",
"(",
")",
"{",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"$",
"aExtends",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
... | Gets extended business entity data
@return object | [
"Gets",
"extended",
"business",
"entity",
"data"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ContentController.php#L421-L431 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ContentController.php | ContentController.getDeliveryChargeSpecs | public function getDeliveryChargeSpecs()
{
$aDeliveryChargeSpecs = [];
$oDeliveryChargeSpecs = $this->getDeliveryList();
foreach ($oDeliveryChargeSpecs as $oDeliveryChargeSpec) {
if ($oDeliveryChargeSpec->oxdelivery__oxaddsumtype->value == "abs") {
$oDelSets = oxNew(\OxidEsales\Eshop\Application\Model\DeliverySetList::class);
$oDelSets->loadRDFaDeliverySetList($oDeliveryChargeSpec->getId());
$oDeliveryChargeSpec->deliverysetmethods = $oDelSets;
$aDeliveryChargeSpecs[] = $oDeliveryChargeSpec;
}
}
return $aDeliveryChargeSpecs;
} | php | public function getDeliveryChargeSpecs()
{
$aDeliveryChargeSpecs = [];
$oDeliveryChargeSpecs = $this->getDeliveryList();
foreach ($oDeliveryChargeSpecs as $oDeliveryChargeSpec) {
if ($oDeliveryChargeSpec->oxdelivery__oxaddsumtype->value == "abs") {
$oDelSets = oxNew(\OxidEsales\Eshop\Application\Model\DeliverySetList::class);
$oDelSets->loadRDFaDeliverySetList($oDeliveryChargeSpec->getId());
$oDeliveryChargeSpec->deliverysetmethods = $oDelSets;
$aDeliveryChargeSpecs[] = $oDeliveryChargeSpec;
}
}
return $aDeliveryChargeSpecs;
} | [
"public",
"function",
"getDeliveryChargeSpecs",
"(",
")",
"{",
"$",
"aDeliveryChargeSpecs",
"=",
"[",
"]",
";",
"$",
"oDeliveryChargeSpecs",
"=",
"$",
"this",
"->",
"getDeliveryList",
"(",
")",
";",
"foreach",
"(",
"$",
"oDeliveryChargeSpecs",
"as",
"$",
"oDel... | Returns delivery methods with assigned deliverysets.
@return object | [
"Returns",
"delivery",
"methods",
"with",
"assigned",
"deliverysets",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ContentController.php#L468-L482 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ContentController.php | ContentController.getDeliveryList | public function getDeliveryList()
{
if ($this->_oDelList === null) {
$this->_oDelList = oxNew(\OxidEsales\Eshop\Application\Model\DeliveryList::class);
$this->_oDelList->getList();
}
return $this->_oDelList;
} | php | public function getDeliveryList()
{
if ($this->_oDelList === null) {
$this->_oDelList = oxNew(\OxidEsales\Eshop\Application\Model\DeliveryList::class);
$this->_oDelList->getList();
}
return $this->_oDelList;
} | [
"public",
"function",
"getDeliveryList",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oDelList",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_oDelList",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
... | Template variable getter. Returns delivery list
@return object | [
"Template",
"variable",
"getter",
".",
"Returns",
"delivery",
"list"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ContentController.php#L489-L497 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ContentController.php | ContentController.getRdfaPriceValidity | public function getRdfaPriceValidity()
{
$iDays = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iRDFaPriceValidity');
$iFrom = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime();
$iThrough = $iFrom + ($iDays * 24 * 60 * 60);
$oPriceValidity = [];
$oPriceValidity['validfrom'] = date('Y-m-d\TH:i:s', $iFrom) . "Z";
$oPriceValidity['validthrough'] = date('Y-m-d\TH:i:s', $iThrough) . "Z";
return $oPriceValidity;
} | php | public function getRdfaPriceValidity()
{
$iDays = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iRDFaPriceValidity');
$iFrom = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime();
$iThrough = $iFrom + ($iDays * 24 * 60 * 60);
$oPriceValidity = [];
$oPriceValidity['validfrom'] = date('Y-m-d\TH:i:s', $iFrom) . "Z";
$oPriceValidity['validthrough'] = date('Y-m-d\TH:i:s', $iThrough) . "Z";
return $oPriceValidity;
} | [
"public",
"function",
"getRdfaPriceValidity",
"(",
")",
"{",
"$",
"iDays",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'iRDFaPriceValidity'",
")",
";",
"$",
"iFrom",
"=",
... | Returns rdfa VAT
@return bool | [
"Returns",
"rdfa",
"VAT"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ContentController.php#L514-L524 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ContentController.php | ContentController.getParsedContent | public function getParsedContent()
{
/** @var \OxidEsales\Eshop\Core\UtilsView $oUtilsView */
$oUtilsView = \OxidEsales\Eshop\Core\Registry::getUtilsView();
return $oUtilsView->parseThroughSmarty($this->getContent()->oxcontents__oxcontent->value, $this->getContent()->getId(), null, true);
} | php | public function getParsedContent()
{
/** @var \OxidEsales\Eshop\Core\UtilsView $oUtilsView */
$oUtilsView = \OxidEsales\Eshop\Core\Registry::getUtilsView();
return $oUtilsView->parseThroughSmarty($this->getContent()->oxcontents__oxcontent->value, $this->getContent()->getId(), null, true);
} | [
"public",
"function",
"getParsedContent",
"(",
")",
"{",
"/** @var \\OxidEsales\\Eshop\\Core\\UtilsView $oUtilsView */",
"$",
"oUtilsView",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getUtilsView",
"(",
")",
";",
"return",
"$",
"o... | Returns content parsed through smarty
@return string | [
"Returns",
"content",
"parsed",
"through",
"smarty"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ContentController.php#L531-L536 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/LinksController.php | LinksController.getLinksList | public function getLinksList()
{
if ($this->_oLinksList === null) {
$this->_oLinksList = false;
// Load links
$oLinksList = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
$oLinksList->init("oxlinks");
$oLinksList->getList();
$this->_oLinksList = $oLinksList;
}
return $this->_oLinksList;
} | php | public function getLinksList()
{
if ($this->_oLinksList === null) {
$this->_oLinksList = false;
// Load links
$oLinksList = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
$oLinksList->init("oxlinks");
$oLinksList->getList();
$this->_oLinksList = $oLinksList;
}
return $this->_oLinksList;
} | [
"public",
"function",
"getLinksList",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oLinksList",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_oLinksList",
"=",
"false",
";",
"// Load links",
"$",
"oLinksList",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\... | Template variable getter. Returns links list
@return object | [
"Template",
"variable",
"getter",
".",
"Returns",
"links",
"list"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/LinksController.php#L38-L50 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/CategoriesComponent.php | CategoriesComponent.getProduct | public function getProduct()
{
if (($sActProduct = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('anid'))) {
$oParentView = $this->getParent();
if (($oProduct = $oParentView->getViewProduct())) {
return $oProduct;
} else {
$oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
if ($oProduct->load($sActProduct)) {
// storing for reuse
$oParentView->setViewProduct($oProduct);
return $oProduct;
}
}
}
} | php | public function getProduct()
{
if (($sActProduct = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('anid'))) {
$oParentView = $this->getParent();
if (($oProduct = $oParentView->getViewProduct())) {
return $oProduct;
} else {
$oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
if ($oProduct->load($sActProduct)) {
// storing for reuse
$oParentView->setViewProduct($oProduct);
return $oProduct;
}
}
}
} | [
"public",
"function",
"getProduct",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"sActProduct",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getRequestParameter",
"(",
"'anid'",
")",
")",
")",
"{",
... | get active article
@return \OxidEsales\Eshop\Application\Model\Article | [
"get",
"active",
"article"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/CategoriesComponent.php#L84-L100 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/CategoriesComponent.php | CategoriesComponent._getActCat | protected function _getActCat()
{
$sActManufacturer = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('mnid');
$sActCat = $sActManufacturer ? null : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('cnid');
// loaded article - then checking additional parameters
$oProduct = $this->getProduct();
if ($oProduct) {
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sActManufacturer = $myConfig->getConfigParam('bl_perfLoadManufacturerTree') ? $sActManufacturer : null;
$sActVendor = (getStr()->preg_match('/^v_.?/i', $sActCat)) ? $sActCat : null;
$sActCat = $this->_addAdditionalParams($oProduct, $sActCat, $sActManufacturer, $sActVendor);
}
// Checking for the default category
if ($sActCat === null && !$oProduct && !$sActManufacturer) {
// set remote cat
$sActCat = \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveShop()->oxshops__oxdefcat->value;
if ($sActCat == 'oxrootid') {
// means none selected
$sActCat = null;
}
}
return $sActCat;
} | php | protected function _getActCat()
{
$sActManufacturer = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('mnid');
$sActCat = $sActManufacturer ? null : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('cnid');
// loaded article - then checking additional parameters
$oProduct = $this->getProduct();
if ($oProduct) {
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sActManufacturer = $myConfig->getConfigParam('bl_perfLoadManufacturerTree') ? $sActManufacturer : null;
$sActVendor = (getStr()->preg_match('/^v_.?/i', $sActCat)) ? $sActCat : null;
$sActCat = $this->_addAdditionalParams($oProduct, $sActCat, $sActManufacturer, $sActVendor);
}
// Checking for the default category
if ($sActCat === null && !$oProduct && !$sActManufacturer) {
// set remote cat
$sActCat = \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveShop()->oxshops__oxdefcat->value;
if ($sActCat == 'oxrootid') {
// means none selected
$sActCat = null;
}
}
return $sActCat;
} | [
"protected",
"function",
"_getActCat",
"(",
")",
"{",
"$",
"sActManufacturer",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getRequestParameter",
"(",
"'mnid'",
")",
";",
"$",
"sActCat",
"=",
"... | get active category id
@return string | [
"get",
"active",
"category",
"id"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/CategoriesComponent.php#L107-L136 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/CategoriesComponent.php | CategoriesComponent._loadCategoryTree | protected function _loadCategoryTree($sActCat)
{
/** @var \OxidEsales\Eshop\Application\Model\CategoryList $oCategoryTree */
$oCategoryTree = oxNew(\OxidEsales\Eshop\Application\Model\CategoryList::class);
$oCategoryTree->buildTree($sActCat);
$oParentView = $this->getParent();
// setting active category tree
$oParentView->setCategoryTree($oCategoryTree);
$this->setCategoryTree($oCategoryTree);
// setting active category
$oParentView->setActiveCategory($oCategoryTree->getClickCat());
} | php | protected function _loadCategoryTree($sActCat)
{
/** @var \OxidEsales\Eshop\Application\Model\CategoryList $oCategoryTree */
$oCategoryTree = oxNew(\OxidEsales\Eshop\Application\Model\CategoryList::class);
$oCategoryTree->buildTree($sActCat);
$oParentView = $this->getParent();
// setting active category tree
$oParentView->setCategoryTree($oCategoryTree);
$this->setCategoryTree($oCategoryTree);
// setting active category
$oParentView->setActiveCategory($oCategoryTree->getClickCat());
} | [
"protected",
"function",
"_loadCategoryTree",
"(",
"$",
"sActCat",
")",
"{",
"/** @var \\OxidEsales\\Eshop\\Application\\Model\\CategoryList $oCategoryTree */",
"$",
"oCategoryTree",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
... | Category tree loader
@param string $sActCat active category id | [
"Category",
"tree",
"loader"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/CategoriesComponent.php#L143-L157 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/CategoriesComponent.php | CategoriesComponent._loadManufacturerTree | protected function _loadManufacturerTree($sActManufacturer)
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
if ($myConfig->getConfigParam('bl_perfLoadManufacturerTree')) {
$oManufacturerTree = $this->getManufacturerList();
$shopHomeURL = $myConfig->getShopHomeUrl();
$oManufacturerTree->buildManufacturerTree('manufacturerlist', $sActManufacturer, $shopHomeURL);
$oParentView = $this->getParent();
// setting active Manufacturer list
$oParentView->setManufacturerTree($oManufacturerTree);
$this->setManufacturerTree($oManufacturerTree);
// setting active Manufacturer
if (($oManufacturer = $oManufacturerTree->getClickManufacturer())) {
$oParentView->setActManufacturer($oManufacturer);
}
}
} | php | protected function _loadManufacturerTree($sActManufacturer)
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
if ($myConfig->getConfigParam('bl_perfLoadManufacturerTree')) {
$oManufacturerTree = $this->getManufacturerList();
$shopHomeURL = $myConfig->getShopHomeUrl();
$oManufacturerTree->buildManufacturerTree('manufacturerlist', $sActManufacturer, $shopHomeURL);
$oParentView = $this->getParent();
// setting active Manufacturer list
$oParentView->setManufacturerTree($oManufacturerTree);
$this->setManufacturerTree($oManufacturerTree);
// setting active Manufacturer
if (($oManufacturer = $oManufacturerTree->getClickManufacturer())) {
$oParentView->setActManufacturer($oManufacturer);
}
}
} | [
"protected",
"function",
"_loadManufacturerTree",
"(",
"$",
"sActManufacturer",
")",
"{",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"if",
"(",
"$",
"myConfig",
"->",
"getConfigP... | Manufacturer tree loader
@param string $sActManufacturer active Manufacturer id | [
"Manufacturer",
"tree",
"loader"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/CategoriesComponent.php#L164-L183 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/BasketItem.php | BasketItem.getIconUrl | public function getIconUrl()
{
// icon url must be (re)loaded in case icon is not set or shop was switched between ssl/nonssl
if ($this->_sIconUrl === null || $this->_blSsl != \OxidEsales\Eshop\Core\Registry::getConfig()->isSsl()) {
$this->_sIconUrl = $this->getArticle()->getIconUrl();
}
return $this->_sIconUrl;
} | php | public function getIconUrl()
{
// icon url must be (re)loaded in case icon is not set or shop was switched between ssl/nonssl
if ($this->_sIconUrl === null || $this->_blSsl != \OxidEsales\Eshop\Core\Registry::getConfig()->isSsl()) {
$this->_sIconUrl = $this->getArticle()->getIconUrl();
}
return $this->_sIconUrl;
} | [
"public",
"function",
"getIconUrl",
"(",
")",
"{",
"// icon url must be (re)loaded in case icon is not set or shop was switched between ssl/nonssl",
"if",
"(",
"$",
"this",
"->",
"_sIconUrl",
"===",
"null",
"||",
"$",
"this",
"->",
"_blSsl",
"!=",
"\\",
"OxidEsales",
"\... | Returns article icon picture url
@return string | [
"Returns",
"article",
"icon",
"picture",
"url"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/BasketItem.php#L443-L451 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/BasketItem.php | BasketItem.getArticle | public function getArticle($blCheckProduct = false, $sProductId = null, $blDisableLazyLoading = false)
{
if ($this->_oArticle === null || (!$this->_oArticle->isOrderArticle() && $blDisableLazyLoading)) {
$sProductId = $sProductId ? $sProductId : $this->_sProductId;
if (!$sProductId) {
//this exception may not be caught, anyhow this is a critical exception
/** @var \OxidEsales\Eshop\Core\Exception\ArticleException $oEx */
$oEx = oxNew(\OxidEsales\Eshop\Core\Exception\ArticleException::class);
$oEx->setMessage('EXCEPTION_ARTICLE_NOPRODUCTID');
throw $oEx;
}
$this->_oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
// #M773 Do not use article lazy loading on order save
if ($blDisableLazyLoading) {
$this->_oArticle->modifyCacheKey('_allviews');
$this->_oArticle->disableLazyLoading();
}
// performance:
// - skipping variants loading
// - skipping 'ab' price info
// - load parent field
$this->_oArticle->setNoVariantLoading(true);
$this->_oArticle->setLoadParentData(true);
if (!$this->_oArticle->load($sProductId)) {
/** @var \OxidEsales\Eshop\Core\Exception\NoArticleException $oEx */
$oEx = oxNew(\OxidEsales\Eshop\Core\Exception\NoArticleException::class);
$oLang = \OxidEsales\Eshop\Core\Registry::getLang();
$oEx->setMessage(sprintf($oLang->translateString('ERROR_MESSAGE_ARTICLE_ARTICLE_DOES_NOT_EXIST', $oLang->getBaseLanguage()), $sProductId));
$oEx->setArticleNr($sProductId);
$oEx->setProductId($sProductId);
throw $oEx;
}
// cant put not visible product to basket (M:1286)
if ($blCheckProduct && !$this->_oArticle->isVisible()) {
/** @var \OxidEsales\Eshop\Core\Exception\NoArticleException $oEx */
$oEx = oxNew(\OxidEsales\Eshop\Core\Exception\NoArticleException::class);
$oLang = \OxidEsales\Eshop\Core\Registry::getLang();
$oEx->setMessage(sprintf($oLang->translateString('ERROR_MESSAGE_ARTICLE_ARTICLE_DOES_NOT_EXIST', $oLang->getBaseLanguage()), $this->_oArticle->oxarticles__oxartnum->value));
$oEx->setArticleNr($sProductId);
$oEx->setProductId($sProductId);
throw $oEx;
}
// cant put not buyable product to basket
if ($blCheckProduct && !$this->_oArticle->isBuyable()) {
/** @var \OxidEsales\Eshop\Core\Exception\ArticleInputException $oEx */
$oEx = oxNew(\OxidEsales\Eshop\Core\Exception\ArticleInputException::class);
$oEx->setMessage('ERROR_MESSAGE_ARTICLE_ARTICLE_NOT_BUYABLE');
$oEx->setArticleNr($sProductId);
$oEx->setProductId($sProductId);
throw $oEx;
}
}
return $this->_oArticle;
} | php | public function getArticle($blCheckProduct = false, $sProductId = null, $blDisableLazyLoading = false)
{
if ($this->_oArticle === null || (!$this->_oArticle->isOrderArticle() && $blDisableLazyLoading)) {
$sProductId = $sProductId ? $sProductId : $this->_sProductId;
if (!$sProductId) {
//this exception may not be caught, anyhow this is a critical exception
/** @var \OxidEsales\Eshop\Core\Exception\ArticleException $oEx */
$oEx = oxNew(\OxidEsales\Eshop\Core\Exception\ArticleException::class);
$oEx->setMessage('EXCEPTION_ARTICLE_NOPRODUCTID');
throw $oEx;
}
$this->_oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
// #M773 Do not use article lazy loading on order save
if ($blDisableLazyLoading) {
$this->_oArticle->modifyCacheKey('_allviews');
$this->_oArticle->disableLazyLoading();
}
// performance:
// - skipping variants loading
// - skipping 'ab' price info
// - load parent field
$this->_oArticle->setNoVariantLoading(true);
$this->_oArticle->setLoadParentData(true);
if (!$this->_oArticle->load($sProductId)) {
/** @var \OxidEsales\Eshop\Core\Exception\NoArticleException $oEx */
$oEx = oxNew(\OxidEsales\Eshop\Core\Exception\NoArticleException::class);
$oLang = \OxidEsales\Eshop\Core\Registry::getLang();
$oEx->setMessage(sprintf($oLang->translateString('ERROR_MESSAGE_ARTICLE_ARTICLE_DOES_NOT_EXIST', $oLang->getBaseLanguage()), $sProductId));
$oEx->setArticleNr($sProductId);
$oEx->setProductId($sProductId);
throw $oEx;
}
// cant put not visible product to basket (M:1286)
if ($blCheckProduct && !$this->_oArticle->isVisible()) {
/** @var \OxidEsales\Eshop\Core\Exception\NoArticleException $oEx */
$oEx = oxNew(\OxidEsales\Eshop\Core\Exception\NoArticleException::class);
$oLang = \OxidEsales\Eshop\Core\Registry::getLang();
$oEx->setMessage(sprintf($oLang->translateString('ERROR_MESSAGE_ARTICLE_ARTICLE_DOES_NOT_EXIST', $oLang->getBaseLanguage()), $this->_oArticle->oxarticles__oxartnum->value));
$oEx->setArticleNr($sProductId);
$oEx->setProductId($sProductId);
throw $oEx;
}
// cant put not buyable product to basket
if ($blCheckProduct && !$this->_oArticle->isBuyable()) {
/** @var \OxidEsales\Eshop\Core\Exception\ArticleInputException $oEx */
$oEx = oxNew(\OxidEsales\Eshop\Core\Exception\ArticleInputException::class);
$oEx->setMessage('ERROR_MESSAGE_ARTICLE_ARTICLE_NOT_BUYABLE');
$oEx->setArticleNr($sProductId);
$oEx->setProductId($sProductId);
throw $oEx;
}
}
return $this->_oArticle;
} | [
"public",
"function",
"getArticle",
"(",
"$",
"blCheckProduct",
"=",
"false",
",",
"$",
"sProductId",
"=",
"null",
",",
"$",
"blDisableLazyLoading",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oArticle",
"===",
"null",
"||",
"(",
"!",
"$",
... | Retrieves the article .Throws an exception if article does not exist,
is not buyable or visible.
@param bool $blCheckProduct checks if product is buyable and visible
@param string $sProductId product id
@param bool $blDisableLazyLoading disable lazy loading
@throws oxArticleException exception in case of no current object product id is set
@throws oxNoArticleException exception in case if product not exitst or not visible
@throws oxArticleInputException exception if product is not buyable (stock and so on)
@return \OxidEsales\Eshop\Application\Model\Article|oxOrderArticle | [
"Retrieves",
"the",
"article",
".",
"Throws",
"an",
"exception",
"if",
"article",
"does",
"not",
"exist",
"is",
"not",
"buyable",
"or",
"visible",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/BasketItem.php#L467-L525 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/BasketItem.php | BasketItem.getTitle | public function getTitle()
{
if ($this->_sTitle === null || $this->getLanguageId() != \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage()) {
$oArticle = $this->getArticle();
$this->_sTitle = $oArticle->oxarticles__oxtitle->value;
if ($oArticle->oxarticles__oxvarselect->value) {
$this->_sTitle = $this->_sTitle . ', ' . $this->getVarSelect();
}
}
return $this->_sTitle;
} | php | public function getTitle()
{
if ($this->_sTitle === null || $this->getLanguageId() != \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage()) {
$oArticle = $this->getArticle();
$this->_sTitle = $oArticle->oxarticles__oxtitle->value;
if ($oArticle->oxarticles__oxvarselect->value) {
$this->_sTitle = $this->_sTitle . ', ' . $this->getVarSelect();
}
}
return $this->_sTitle;
} | [
"public",
"function",
"getTitle",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sTitle",
"===",
"null",
"||",
"$",
"this",
"->",
"getLanguageId",
"(",
")",
"!=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getLang",
"(",
... | Returns product title
@return string | [
"Returns",
"product",
"title"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/BasketItem.php#L582-L594 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/BasketItem.php | BasketItem.getLink | public function getLink()
{
if ($this->_sLink === null || $this->getLanguageId() != \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage()) {
$this->_sLink = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->cleanUrl($this->getArticle()->getLink(), ['force_sid']);
}
return $this->getSession()->processUrl($this->_sLink);
} | php | public function getLink()
{
if ($this->_sLink === null || $this->getLanguageId() != \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage()) {
$this->_sLink = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->cleanUrl($this->getArticle()->getLink(), ['force_sid']);
}
return $this->getSession()->processUrl($this->_sLink);
} | [
"public",
"function",
"getLink",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sLink",
"===",
"null",
"||",
"$",
"this",
"->",
"getLanguageId",
"(",
")",
"!=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getLang",
"(",
... | Returns product details URL
@return string | [
"Returns",
"product",
"details",
"URL"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/BasketItem.php#L601-L608 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/BasketItem.php | BasketItem.getWrapping | public function getWrapping()
{
$oWrap = null;
if ($sWrapId = $this->getWrappingId()) {
$oWrap = oxNew(\OxidEsales\Eshop\Application\Model\Wrapping::class);
$oWrap->load($sWrapId);
}
return $oWrap;
} | php | public function getWrapping()
{
$oWrap = null;
if ($sWrapId = $this->getWrappingId()) {
$oWrap = oxNew(\OxidEsales\Eshop\Application\Model\Wrapping::class);
$oWrap->load($sWrapId);
}
return $oWrap;
} | [
"public",
"function",
"getWrapping",
"(",
")",
"{",
"$",
"oWrap",
"=",
"null",
";",
"if",
"(",
"$",
"sWrapId",
"=",
"$",
"this",
"->",
"getWrappingId",
"(",
")",
")",
"{",
"$",
"oWrap",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"A... | Returns basket item wrapping object
@return oxwrapping | [
"Returns",
"basket",
"item",
"wrapping",
"object"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/BasketItem.php#L874-L883 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/BasketItem.php | BasketItem.getFRegularUnitPrice | public function getFRegularUnitPrice()
{
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($this->getRegularUnitPrice()->getPrice());
} | php | public function getFRegularUnitPrice()
{
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($this->getRegularUnitPrice()->getPrice());
} | [
"public",
"function",
"getFRegularUnitPrice",
"(",
")",
"{",
"return",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getLang",
"(",
")",
"->",
"formatCurrency",
"(",
"$",
"this",
"->",
"getRegularUnitPrice",
"(",
")",
"->",
"getPr... | Returns formatted regular unit price
@deprecated in v4.8/5.1 on 2013-10-08; use oxPrice smarty formatter
@return string | [
"Returns",
"formatted",
"regular",
"unit",
"price"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/BasketItem.php#L932-L935 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/BasketItem.php | BasketItem.getFUnitPrice | public function getFUnitPrice()
{
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($this->getUnitPrice()->getPrice());
} | php | public function getFUnitPrice()
{
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($this->getUnitPrice()->getPrice());
} | [
"public",
"function",
"getFUnitPrice",
"(",
")",
"{",
"return",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getLang",
"(",
")",
"->",
"formatCurrency",
"(",
"$",
"this",
"->",
"getUnitPrice",
"(",
")",
"->",
"getPrice",
"(",
... | Returns formatted unit price
@deprecated in v4.8/5.1 on 2013-10-08; use oxPrice smarty formatter
@return string | [
"Returns",
"formatted",
"unit",
"price"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/BasketItem.php#L944-L947 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/BasketItem.php | BasketItem.getVarSelect | public function getVarSelect()
{
if ($this->_sVarSelect === null || $this->getLanguageId() != \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage()) {
$oArticle = $this->getArticle();
$sVarSelectValue = $oArticle->oxarticles__oxvarselect->value;
$this->_sVarSelect = (!empty($sVarSelectValue) || $sVarSelectValue === '0') ? $sVarSelectValue : '';
}
return $this->_sVarSelect;
} | php | public function getVarSelect()
{
if ($this->_sVarSelect === null || $this->getLanguageId() != \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage()) {
$oArticle = $this->getArticle();
$sVarSelectValue = $oArticle->oxarticles__oxvarselect->value;
$this->_sVarSelect = (!empty($sVarSelectValue) || $sVarSelectValue === '0') ? $sVarSelectValue : '';
}
return $this->_sVarSelect;
} | [
"public",
"function",
"getVarSelect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sVarSelect",
"===",
"null",
"||",
"$",
"this",
"->",
"getLanguageId",
"(",
")",
"!=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getLang",... | Returns varselect value
@return string | [
"Returns",
"varselect",
"value"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/BasketItem.php#L976-L985 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/BasketItem.php | BasketItem.setLanguageId | public function setLanguageId($iLanguageId)
{
$iOldLang = $this->_iLanguageId;
$this->_iLanguageId = $iLanguageId;
// #0003777: reload content on language change
if ($iOldLang !== null && $iOldLang != $iLanguageId) {
try {
$this->_setArticle($this->getProductId());
} catch (\OxidEsales\Eshop\Core\Exception\NoArticleException $oEx) {
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($oEx);
} catch (\OxidEsales\Eshop\Core\Exception\ArticleInputException $oEx) {
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($oEx);
}
}
} | php | public function setLanguageId($iLanguageId)
{
$iOldLang = $this->_iLanguageId;
$this->_iLanguageId = $iLanguageId;
// #0003777: reload content on language change
if ($iOldLang !== null && $iOldLang != $iLanguageId) {
try {
$this->_setArticle($this->getProductId());
} catch (\OxidEsales\Eshop\Core\Exception\NoArticleException $oEx) {
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($oEx);
} catch (\OxidEsales\Eshop\Core\Exception\ArticleInputException $oEx) {
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($oEx);
}
}
} | [
"public",
"function",
"setLanguageId",
"(",
"$",
"iLanguageId",
")",
"{",
"$",
"iOldLang",
"=",
"$",
"this",
"->",
"_iLanguageId",
";",
"$",
"this",
"->",
"_iLanguageId",
"=",
"$",
"iLanguageId",
";",
"// #0003777: reload content on language change",
"if",
"(",
... | Set language Id, reload basket content on language change.
@param integer $iLanguageId language id | [
"Set",
"language",
"Id",
"reload",
"basket",
"content",
"on",
"language",
"change",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/BasketItem.php#L1002-L1017 | train |
OXID-eSales/oxideshop_ce | source/Core/Field.php | Field.convertToFormattedDbDate | public function convertToFormattedDbDate()
{
$this->setValue(\OxidEsales\Eshop\Core\Registry::getUtilsDate()->formatDBDate($this->rawValue), self::T_RAW);
} | php | public function convertToFormattedDbDate()
{
$this->setValue(\OxidEsales\Eshop\Core\Registry::getUtilsDate()->formatDBDate($this->rawValue), self::T_RAW);
} | [
"public",
"function",
"convertToFormattedDbDate",
"(",
")",
"{",
"$",
"this",
"->",
"setValue",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getUtilsDate",
"(",
")",
"->",
"formatDBDate",
"(",
"$",
"this",
"->",
"rawValue",
... | Converts to formatted db date | [
"Converts",
"to",
"formatted",
"db",
"date"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Field.php#L137-L140 | train |
OXID-eSales/oxideshop_ce | source/Core/Field.php | Field._initValue | protected function _initValue($value = null, $type = self::T_TEXT)
{
switch ($type) {
case self::T_TEXT:
$this->rawValue = $value;
break;
case self::T_RAW:
$this->value = $value;
break;
}
} | php | protected function _initValue($value = null, $type = self::T_TEXT)
{
switch ($type) {
case self::T_TEXT:
$this->rawValue = $value;
break;
case self::T_RAW:
$this->value = $value;
break;
}
} | [
"protected",
"function",
"_initValue",
"(",
"$",
"value",
"=",
"null",
",",
"$",
"type",
"=",
"self",
"::",
"T_TEXT",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"self",
"::",
"T_TEXT",
":",
"$",
"this",
"->",
"rawValue",
"=",
"$",
"val... | Initial field value
@param mixed $value Field value
@param int $type Value type | [
"Initial",
"field",
"value"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Field.php#L156-L166 | train |
OXID-eSales/oxideshop_ce | source/Core/Field.php | Field.setValue | public function setValue($value = null, $type = self::T_TEXT)
{
unset($this->rawValue);
unset($this->value);
$this->_initValue($value, $type);
} | php | public function setValue($value = null, $type = self::T_TEXT)
{
unset($this->rawValue);
unset($this->value);
$this->_initValue($value, $type);
} | [
"public",
"function",
"setValue",
"(",
"$",
"value",
"=",
"null",
",",
"$",
"type",
"=",
"self",
"::",
"T_TEXT",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"rawValue",
")",
";",
"unset",
"(",
"$",
"this",
"->",
"value",
")",
";",
"$",
"this",
"->... | Sets field value and type
@param mixed $value Field value
@param int $type Value type | [
"Sets",
"field",
"value",
"and",
"type"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Field.php#L174-L179 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/CategoryText.php | CategoryText.save | public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
$oCategory = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
$iCatLang = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("catlang");
$iCatLang = $iCatLang ? $iCatLang : 0;
if ($soxId != "-1") {
$oCategory->loadInLang($iCatLang, $soxId);
} else {
$aParams['oxcategories__oxid'] = null;
}
//Disable editing for derived items
if ($oCategory->isDerived()) {
return;
}
$oCategory->setLanguage(0);
$oCategory->assign($aParams);
$oCategory->setLanguage($iCatLang);
$oCategory->save();
// set oxid if inserted
$this->setEditObjectId($oCategory->getId());
} | php | public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
$oCategory = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
$iCatLang = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("catlang");
$iCatLang = $iCatLang ? $iCatLang : 0;
if ($soxId != "-1") {
$oCategory->loadInLang($iCatLang, $soxId);
} else {
$aParams['oxcategories__oxid'] = null;
}
//Disable editing for derived items
if ($oCategory->isDerived()) {
return;
}
$oCategory->setLanguage(0);
$oCategory->assign($aParams);
$oCategory->setLanguage($iCatLang);
$oCategory->save();
// set oxid if inserted
$this->setEditObjectId($oCategory->getId());
} | [
"public",
"function",
"save",
"(",
")",
"{",
"parent",
"::",
"save",
"(",
")",
";",
"$",
"soxId",
"=",
"$",
"this",
"->",
"getEditObjectId",
"(",
")",
";",
"$",
"aParams",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
... | Saves category description text to DB.
@return mixed | [
"Saves",
"category",
"description",
"text",
"to",
"DB",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/CategoryText.php#L67-L96 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.