Bug fixed - Plugin meta data

This commit is contained in:
dignajar 2015-11-22 15:11:47 -03:00
parent ca9cde4eff
commit bbfa1fb48e
6 changed files with 30 additions and 14 deletions

View File

@ -63,29 +63,31 @@ function build_plugins()
{
$Plugin = new $pluginClass;
// Set Plugin data
// Default language and meta data for the plugin
$tmpMetaData = array();
$languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.'en_US.json';
$database = new dbJSON($languageFilename, false);
$tmpMetaData = $database->db['plugin-data'];
// Check if the plugin is translated.
$languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.$Site->locale().'.json';
if( Sanitize::pathFile($languageFilename) )
{
$database = new dbJSON($languageFilename, false);
}
else
{
$languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.'en_US.json';
$database = new dbJSON($languageFilename, false);
$tmpMetaData = array_merge($tmpMetaData, $database->db['plugin-data']);
}
$databaseArray = $database->db;
$Plugin->setData( $databaseArray['plugin-data'] );
// Set plugin meta data
$Plugin->setData($tmpMetaData);
// Add words to language dictionary.
unset($databaseArray['plugin-data']);
$Language->add($databaseArray);
unset($database->db['plugin-data']);
$Language->add($database->db);
// Push Plugin to array all plugins installed and not installed.
$plugins['all'][$pluginClass] = $Plugin;
// If the plugin installed
// If the plugin is installed, order by hooks.
if($Plugin->installed())
{
foreach($pluginsEvents as $event=>$value)

View File

@ -13,7 +13,7 @@
"password": "Contraseña",
"confirm-password": "Confirmar contraseña",
"editor": "Editor",
"dashboard": "Panel",
"dashboard": "Panel de administración",
"role": "Rol",
"post": "Entrada",
"posts": "Entradas",

View File

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Acerca de",
"description": "Pequeña descripcion sobre tu mismo o sobre tu sitio."
}
}

View File

@ -2,6 +2,6 @@
"plugin-data":
{
"name": "Open Graph",
"description": "El protocolo Open Graph sirve para publicar contenido en las redes sociales."
"description": "Utiliza este plugin para mejorar las publicaciones en las redes sociales."
}
}

View File

@ -2,7 +2,7 @@
"plugin-data":
{
"name": "SimpleMDE",
"description": "Simple y facil editor Markdown desarrollado por @WesCossick. Adaptado por Diego Najar para Bludit."
"description": "Simple y sensillo editor Markdown desarrollado por @WesCossick. Adaptado por Diego Najar para Bludit."
},
"toolbar": "Barra de herramientas",
"tab-size": "Tamaño de la tabulación"

View File

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Listado de tags",
"description": "Muestra los tags de forma ordenada y muestra la cantidad de posts asociados a un tag."
}
}