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

View File

@ -13,7 +13,7 @@
"password": "Contraseña", "password": "Contraseña",
"confirm-password": "Confirmar contraseña", "confirm-password": "Confirmar contraseña",
"editor": "Editor", "editor": "Editor",
"dashboard": "Panel", "dashboard": "Panel de administración",
"role": "Rol", "role": "Rol",
"post": "Entrada", "post": "Entrada",
"posts": "Entradas", "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": "plugin-data":
{ {
"name": "Open Graph", "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": "plugin-data":
{ {
"name": "SimpleMDE", "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", "toolbar": "Barra de herramientas",
"tab-size": "Tamaño de la tabulación" "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."
}
}