DataObjects/Cms_templatestr.php
authorAlan <alan@roojs.com>
Fri, 25 Nov 2022 07:18:22 +0000 (15:18 +0800)
committerAlan <alan@roojs.com>
Fri, 25 Nov 2022 07:18:22 +0000 (15:18 +0800)
DataObjects/Cms_templatestr.php

index 7f79fd9..2ce27cd 100644 (file)
@@ -136,7 +136,20 @@ class Pman_Cms_DataObjects_Cms_templatestr extends DB_DataObject
                 $x->selectAdd('distinct(lang) as lang');
                 $x->whereAdd("lang != ''");
                 $ret= array();
+                $got = array();
                 foreach( $x->fetchAll('lang') as $l) {
+                    
+                    $ret[] = array(
+                        'text'=>$l,
+                        'id' =>$l,
+                        'language' => true
+                    );
+                    $got[] = $l;
+                }
+                foreach($defaults as $l) {
+                    if (in_array($l,$got)) {
+                        continue;
+                    }
                     $ret[] = array(
                         'text'=>$l,
                         'id' =>$l,