OutputTranslations.php
[Pman.Cms] / OutputTranslations.php
1 <?php
2
3 require_once 'Pman.php'; /// needed as we might not be included from pman..
4
5 class Pman_Cms_OutputTranslations extends Pman
6 {
7     var $cms_template = '';
8     var $on_table = '';
9     var $on_id = '';
10     var $on_col = '';
11     var $lang = '';
12     
13     function get()
14     {
15         print_R('run');exit;
16         if(
17                 empty($this->cms_template) || 
18                 (empty($this->on_table) || empty($this->on_id) || empty($this->on_col))
19         ){
20             return array();
21         }
22         
23         if(!empty($this->template)){
24             return $this->templateTranslations();
25         }
26         
27         return $this->tableTranslations();
28         
29     }
30     
31     function templateTranslations()
32     {
33         $ret = array();
34         
35         $template = DB_DataObject::factory('cms_template');
36         if(!$template->get('template', $this->cms_template)){
37             return $ret;
38         }
39         
40         $string = DB_DataObject::factory('cms_templatestr');
41         $string->setFrom(array(
42             'template_id' => $template->id,
43             'lang' => '',
44             'active' => 1
45         ));
46         
47         $ret = $string->fetchAll('id', 'mdsum');
48         
49         print_R($ret);exit;
50         
51         
52     }
53     
54     function tableTranslations()
55     {
56         
57     }
58 }