diff --git a/kernel/dbpages.class.php b/kernel/dbpages.class.php index 61933d7f..af815b1d 100644 --- a/kernel/dbpages.class.php +++ b/kernel/dbpages.class.php @@ -333,10 +333,6 @@ class dbPages extends dbJSON } } - $fields['status'] = CLI_STATUS; - $fields['date'] = Date::current(DB_DATE_FORMAT); - $fields['username'] = 'admin'; - //$tmpPaths = glob(PATH_PAGES.'*', GLOB_ONLYDIR); $tmpPaths = Filesystem::listDirectories(PATH_PAGES); foreach($tmpPaths as $directory) @@ -364,7 +360,14 @@ class dbPages extends dbJSON foreach($newPaths as $key=>$value) { - if(!isset($this->db[$key])) { + if(!isset($this->db[$key])) + { + // Default values for the new pages. + $fields['status'] = CLI_STATUS; + $fields['date'] = Date::current(DB_DATE_FORMAT); + $fields['username'] = 'admin'; + + // Create the entry for the new page. $this->db[$key] = $fields; } diff --git a/plugins/googletools/languages/en_US.json b/plugins/googletools/languages/en_US.json new file mode 100644 index 00000000..1e2b8fc9 --- /dev/null +++ b/plugins/googletools/languages/en_US.json @@ -0,0 +1,16 @@ +{ + "plugin-data": + { + "name": "Google Tools", + "description": "This plugin generate the meta tag to validate your site with Google Webmasters Tools and the JavaScript code to track your site with Google Analytics.", + "author": "Bludit", + "email": "", + "website": "", + "version": "1.0", + "releaseDate": "2015-09-28" + }, + "google-webmasters-tools": "Google Webmasters tools", + "google-analytics-tracking-id": "Google Analytics Tracking ID", + "complete-this-field-with-the-google-site-verification": "Complete this field with the Google Site verification to verify the site owner.", + "complete-this-field-with-the-tracking-id": "Complete this field with the Tracking ID to generate the Javascript tracking code for Google Analytics." +} \ No newline at end of file diff --git a/plugins/googletools/languages/es_AR.json b/plugins/googletools/languages/es_AR.json new file mode 100644 index 00000000..9ffa450f --- /dev/null +++ b/plugins/googletools/languages/es_AR.json @@ -0,0 +1,11 @@ +{ + "plugin-data": + { + "name": "Herramientas de Google", + "description": "Este plugin genera los meta tags para validar el sitio con Google Webmasters Tools y el codigo JavaScript para trackear el sitio con Google Analytics." + }, + "google-webmasters-tools": "Google Webmasters tools", + "google-analytics-tracking-id": "Google Analytics Tracking ID", + "complete-this-field-with-the-google-site-verification": "Complete este campo con el código de verificación de Google Webmasters Tools para verificar la propiedad del sitio.", + "complete-this-field-with-the-tracking-id": "Complete este campo con el Tracking ID para generar el código Javascript para trackear el sitio." +} \ No newline at end of file diff --git a/plugins/googletools/plugin.php b/plugins/googletools/plugin.php new file mode 100644 index 00000000..10461354 --- /dev/null +++ b/plugins/googletools/plugin.php @@ -0,0 +1,63 @@ +dbFields = array( + 'tracking-id'=>'', + 'google-site-verification'=>'' + ); + } + + public function form() + { + global $Language; + + $html = '
'; + $html .= ''; + $html .= ''; + $html .= '
'.$Language->get('complete-this-field-with-the-google-site-verification').'
'; + $html .= '
'; + + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= '
'.$Language->get('complete-this-field-with-the-tracking-id').'
'; + $html .= '
'; + + return $html; + } + + public function siteHead() + { + $html = PHP_EOL.''.PHP_EOL; + $html .= ''.PHP_EOL; + + if(Text::isEmpty($this->getDbField('google-site-verification'))) { + return false; + } + + return $html; + } + + public function siteBodyEnd() + { + $html = PHP_EOL.''.PHP_EOL; + $html .= "".PHP_EOL; + + if(Text::isEmpty($this->getDbField('tracking-id'))) { + return false; + } + + return $html; + } +} \ No newline at end of file