3 require_once 'Pman.php'; /// needed as we might not be included from pman..
5 class Pman_Cms_OutputTranslations extends Pman
11 $this->getTranslations($lang);
14 function getTranslations($lang)
21 $template = DB_DataObject::factory('cms_template');
22 $template_ids = $template->fetchAll('id');
24 print_R($template_ids);exit;
26 foreach ($template->fetchAll() as $tmpl){
27 $base = DB_DataObject::factory('cms_templatestr');
29 'template_id' => $tmpl->id,
33 $base = $base->fetchAll('id');
35 $translation = DB_DataObject::factory('cms_templatestr');
36 $translation->autoJoin();
37 $translation->setFrom(array(
38 'template_id' => $tmpl->id,
39 'lang' => $this->lang,
42 $translation->whereAddIn('cms_templatestr.src_id', $base, 'int');
44 foreach ($translation->fetchAll() as $t){
45 if(!isset($ret[$tmpl->template])){
46 $ret[$tmpl->template] = array();
49 $ret[$tmpl->template][$t->src_id_mdsum] = (empty($t->txt)) ? $t->src_id_txt : $t->txt;
54 $template = DB_DataObject::factory('cms_template');
56 foreach ($template->fetchAll() as $tmpl){
57 $base = DB_DataObject::factory('cms_templatestr');
59 'template_id' => $tmpl->id,
63 $base = $base->fetchAll('id');
65 $translation = DB_DataObject::factory('cms_templatestr');
66 $translation->autoJoin();
67 $translation->setFrom(array(
68 'template_id' => $tmpl->id,
69 'lang' => $this->lang,
72 $translation->whereAddIn('cms_templatestr.src_id', $base, 'int');
74 foreach ($translation->fetchAll() as $t){
75 if(!isset($ret[$tmpl->template])){
76 $ret[$tmpl->template] = array();
79 $ret[$tmpl->template][$t->src_id_mdsum] = (empty($t->txt)) ? $t->src_id_txt : $t->txt;