$bases = $ff->Pman_Cms['project_name'];
foreach(explode(',', $bases) as $base) {
- $this->scanTemplatesBase($base)
+ $this->scanTemplatesBase($base);
}
}
// $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()
{