Merge pull request #1792 from brayanpereyra/master

BUG 0000 TRANSLATIONS IN PLUGINS
This commit is contained in:
julceslauhub
2013-06-06 13:35:18 -07:00
3 changed files with 17 additions and 6 deletions

View File

@@ -579,8 +579,7 @@ class Bootstrap
//trick to generate the translation.language.js file , merging two files
if (strtolower($typefile) == 'js' && $typearray[0] == 'translation') {
Bootstrap::sendHeaders($filename, 'text/javascript', $download, $downloadFileName);
if ($typearray[1] != "enterprise") {
if ($typearray[1] != "enterprise" && $typearray[1] != "pmCaseArchive") {
$arrayAux = array($typearray[0], $typearray[1], $typearray[count($typearray) - 1]);
$filename = str_replace(implode(".", $typearray), implode(".", $arrayAux), $filename);

View File

@@ -370,7 +370,7 @@ class G
$files = glob( $dir . '*', GLOB_MARK );
foreach ($files as $file ) {
if (substr( $file, -1 ) == '/' ) {
$this->delTree( $file );
self::delTree( $file );
} else {
unlink( $file );
}

View File

@@ -473,10 +473,22 @@ class headPublisher
if (!is_file($sPath . $filename . ".js")) {
$aux = explode(PATH_SEP, $filename);
//check if G_PLUGIN_CLASS is defined, because publisher can be called without an environment
if (count($aux) == 2 && defined('G_PLUGIN_CLASS')) {
if (count($aux) > 2 && defined('G_PLUGIN_CLASS')) {
$flagPlugin = false;
$keyPlugin = count($aux)-2;
$oPluginRegistry = & PMPluginRegistry::getSingleton();
if ($oPluginRegistry->isRegisteredFolder($aux[0])) {
array_push($this->extJsLibrary, 'translation.' . trim($aux[0]) . '.' . SYS_LANG);
if ($oPluginRegistry->isRegisteredFolder($aux[$keyPlugin])) {
$flagPlugin = true;
} else {
$keyPlugin --;
if ($oPluginRegistry->isRegisteredFolder($aux[$keyPlugin]))) {
$flagPlugin = true;
}
}
if ($flagPlugin) {
array_push($this->extJsLibrary, 'translation.' . trim($aux[$keyPlugin]) . '.' . SYS_LANG);
$sPath = PATH_PLUGINS;
}
}