summaryrefslogtreecommitdiffstats
path: root/modules-available/translation/page.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2016-05-11 19:00:30 +0200
committerSimon Rettberg2016-05-11 19:00:30 +0200
commit1cc1c2ed092c46eb35893c1d85accb24cf43d7f9 (patch)
tree95c1302f4a1ae441e174a1dca64133e2873f8297 /modules-available/translation/page.inc.php
parentAdd PhpStorm prefs (diff)
downloadslx-admin-1cc1c2ed092c46eb35893c1d85accb24cf43d7f9.tar.gz
slx-admin-1cc1c2ed092c46eb35893c1d85accb24cf43d7f9.tar.xz
slx-admin-1cc1c2ed092c46eb35893c1d85accb24cf43d7f9.zip
Still working in modularization cleanup and refinement
Diffstat (limited to 'modules-available/translation/page.inc.php')
-rw-r--r--modules-available/translation/page.inc.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/modules-available/translation/page.inc.php b/modules-available/translation/page.inc.php
index f3474acd..1fc3a0fe 100644
--- a/modules-available/translation/page.inc.php
+++ b/modules-available/translation/page.inc.php
@@ -205,6 +205,7 @@ class Page_Translation extends Page
'module' => $this->module->getIdentifier(),
'moduleName' => $this->module->getDisplayName()
));
+ Render::openTag('div', array('class' => 'row'));
// Templates
$this->showModuleTemplates();
// Messages
@@ -213,6 +214,7 @@ class Page_Translation extends Page
$this->showModuleStrings();
// Module specific
$this->showModuleCustom();
+ Render::closeTag('div');
}
private function showModuleTemplates()
@@ -403,8 +405,13 @@ class Page_Translation extends Page
if ($module === false) {
$module = $this->module;
}
+ $allFiles = $this->getAllFiles('modules', '.php');
+ if ($module->getIdentifier() === 'main') {
+ $allFiles = array_merge($allFiles, $this->getAllFiles('apis', '.php'), $this->getAllFiles('inc', '.php'));
+ $allFiles[] = 'index.php';
+ }
$tags = $this->loadTagsFromPhp('/Message\s*::\s*add\w+\s*\(\s*[\'"](?<module>[^\'"\.]*)\.(?<tag>[^\'"]*)[\'"]\s*(?<data>\)|\,.*)/i',
- $this->getAllFiles('modules', '.php'));
+ $allFiles);
// Filter out tags that don't refer to this module
foreach (array_keys($tags) as $tag) {
// Figure out if this is a message from this module or not
@@ -869,6 +876,7 @@ class Page_Translation extends Page
}
Message::addError('invalid-section', $this->section);
$this->redirect(1);
+ return false;
}
/**
@@ -878,7 +886,7 @@ class Page_Translation extends Page
{
$this->ensureValidDestLanguage();
if ($this->module === false) {
- Message::addError('main.no-module-given');
+ Message::addError('no-module-given');
$this->redirect();
}
$file = $this->getJsonFile();
@@ -906,7 +914,7 @@ class Page_Translation extends Page
$translation = Request::post('new-text', array(), 'array');
foreach (Request::post('new-id', array(), 'array') as $k => $tag) {
- if (empty($translation[$k]))
+ if (empty($translation[$k]) || empty($tag))
continue;
$data[(string)$tag] = (string)$translation[$k];
}