UpdateBjsTemplates.php
authorAlan <alan@roojs.com>
Fri, 24 Feb 2023 04:19:27 +0000 (12:19 +0800)
committerAlan <alan@roojs.com>
Fri, 24 Feb 2023 04:19:27 +0000 (12:19 +0800)
UpdateBjsTemplates.php

index 47e9ac4..d4056b5 100644 (file)
@@ -59,7 +59,7 @@ class Pman_Cms_UpdateBjsTemplates extends Pman
         
         $bases = $ff->Pman_Cms['project_name'];
         foreach(explode(',', $bases) as $base) {
-            $this->scanTemplatesBase($base)
+            $this->scanTemplatesBase($base);
         }
     }
     
@@ -116,57 +116,7 @@ class Pman_Cms_UpdateBjsTemplates extends Pman
        // $this->scanPmanTemplates();
         
     }
-    
-    function scanPmanTemplates()
-    {
-        foreach ($this->modules() as $m){
-            $view_name = "Pman.$m";
-            
-            $dh = opendir("Pman/$m");
-        
-            $ret = array();
-
-            if(!$dh){
-                continue;
-            }
-            
-            while (($fn = readdir($dh)) !== false) {
-            
-                if(empty($fn) || $fn[0] == '.' || !preg_match('/\.bjs$/', $fn)){
-                    continue;
-                }
-
-                if($this->cli){
-                    echo "Processing {$fn} \n";
-                }
-
-                $template = DB_DataObject::factory('cms_template');
-                $template->setFrom(array(
-                    'template' => $fn,
-                    'lang' => 'en',
-                    'view_name' => $view_name
-                ));
-
-                $o = false;
-
-                if($template->find(true)){
-                    $o = clone ($template);
-                }
-
-                $template->updated = $template->sqlValue("NOW()");
-
-                (empty($o)) ? $template->insert() : $template->update($o);
-
-                $data = json_decode(file_get_contents('Pman' . '/' . $m . '/' . $fn), true);
-
-                $template->words = empty($data['strings']) ? array() : $data['strings'];
-
-                $x = DB_DataObject::Factory('cms_templatestr');
-                $x->syncTemplateWords($template, false);
-            }
-        }
-        
-    }
+     
     
     function scanTables()
     {