-
-
Save Fi1osof/5a1a114ef7bd99624f76 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once MODX_CORE_PATH.'components/modxsite/processors/site/web/resources/getdata.class.php'; | |
class modSocietyWebResourcesGetdataProcessor extends modSiteWebResourcesGetdataProcessor{ | |
public function initialize(){ | |
$this->setDefaultProperties(array( | |
"cultureKey" => $this->modx->getOption('cultureKey'), | |
)); | |
return parent::initialize(); | |
} | |
protected function setSelection(xPDOQuery $c){ | |
$c = parent::setSelection($c); | |
$lang = $this->getProperty('cultureKey'); | |
if($lang != 'ru'){ | |
$c->leftJoin('XlexiconDictionary', "Dictionary", "Dictionary.res = {$this->classKey}.id AND Dictionary.language = '{$lang}'"); | |
$c->select(array( | |
"if(Dictionary.pagetitle != '', Dictionary.pagetitle, {$this->classKey}.pagetitle) as pagetitle", | |
"if(Dictionary.longtitle != '', Dictionary.longtitle, {$this->classKey}.longtitle) as longtitle", | |
"if(Dictionary.content != '', Dictionary.content, {$this->classKey}.content) as content", | |
"if(Dictionary.menutitle != '', Dictionary.menutitle, {$this->classKey}.menutitle) as menutitle", | |
)); | |
} | |
return $c; | |
} | |
} | |
return 'modSocietyWebResourcesGetdataProcessor'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment