-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathText.php
More file actions
43 lines (39 loc) · 1.27 KB
/
Text.php
File metadata and controls
43 lines (39 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
* Definition of class Text
*
* @copyright 2015-today Justso GmbH
* @author j.schirrmacher@justso.de
* @package justso\justgen\model
*/
namespace justso\justgen;
/**
* Class Text
*
* @package justso\justgen\model
*/
class Text extends \justso\justtexts\Text
{
protected function readFileContents($language)
{
$texts = parent::readFileContents($language);
$config = $this->env->getBootstrap()->getConfiguration();
$ruleMatcher = new RuleMatcher($config['pages']);
$template = $ruleMatcher->find($this->pageName);
if ($template != null) {
$templateRoot = $this->env->getBootstrap()->getAppRoot() . '/templates';
$templateName = str_replace('dynamic:', '', $template) . '.tpl';
$pageTemplate = new PageTemplate($templateRoot, $templateName, $this->languages);
$vars = $pageTemplate->getSmartyVars($this->env, $this->pageName);
foreach (array_diff($vars, array_keys($texts)) as $missing) {
$texts[$missing] = array(
'id' => $missing,
'name' => $missing,
'content' => '',
'outdated' => false,
);
}
}
return $texts;
}
}