DOC SYSTEM

Crear en META-INF translation de plugin.
Al momento de habilitar un plugin, se revisara si cuenta con translations.php si cuenta con el archivo creara su .po y subira el archivo a META-INF.
-------------------------------------------
Workspace nace con configuracion de padre.
Ahora cuando se crea un nuevo workspace, nace con la configuracion Environment.
This commit is contained in:
Brayan Osmar Pereyra Suxo
2013-04-08 16:48:03 -04:00
parent 31bda297a6
commit c705cb8ba0
2 changed files with 42 additions and 0 deletions

View File

@@ -205,11 +205,40 @@ class Installer
$this->log("Write: " . $db_file . " => " . ((!$ff) ? $ff : "OK") . "\n", $ff === false);
fclose($fp);
$this->set_configuration();
$this->set_admin();
}
return $test;
}
/**
* set_configuration
*
* @return void
*/
public function set_configuration()
{
$oConf = new Configuration();
$dataCondif = $oConf->getAll();
if (count($dataCondif)) {
foreach ($dataCondif as $value) {
if ($value['CFG_UID'] == 'ENVIRONMENT_SETTINGS') {
$query = 'INSERT INTO CONFIGURATION (CFG_UID, OBJ_UID, CFG_VALUE, PRO_UID, USR_UID, APP_UID) VALUES';
$query .= "('" .
$value['CFG_UID'] . "', '".
$value['OBJ_UID'] . "', '".
$value['CFG_VALUE'] . "', '".
$value['PRO_UID'] . "', '".
$value['USR_UID'] . "', '".
$value['APP_UID'] . "')";
mysql_select_db($this->wf_site_name, $this->connection_database);
$this->run_query($query, "Copy configuracion environment");
break;
}
}
}
}
/**
* set_admin
*

View File

@@ -239,6 +239,7 @@ class PMPluginRegistry
$this->_aPlugins[$detail->sNamespace] = $oPlugin;
if (method_exists( $oPlugin, 'enable' )) {
$oPlugin->enable();
$this->verifyTranslation($detail->sNamespace);
}
return true;
}
@@ -1424,5 +1425,17 @@ class PMPluginRegistry
{
return get_object_vars( $this );
}
public function verifyTranslation ($namePlugin)
{
$language = new Language();
$pathPluginTranslations = PATH_PLUGINS . $namePlugin . PATH_SEP . 'translations' . PATH_SEP;
if (file_exists($pathPluginTranslations . 'translations.php')) {
if (!file_exists($pathPluginTranslations . $namePlugin . '.' . SYS_LANG . '.po')) {
$language->createLanguagePlugin($namePlugin, SYS_LANG);
}
$language->updateLanguagePlugin($namePlugin, SYS_LANG);
}
}
}