Update plugins to use the new l10n function

This commit is contained in:
torkel104 2016-11-07 20:58:47 +01:00
parent fddf121032
commit ff8fe8dc02
8 changed files with 25 additions and 45 deletions

6
bl-plugins/about/plugin.php Normal file → Executable file
View File

@ -12,14 +12,12 @@ class pluginAbout extends Plugin {
public function form()
{
global $Language;
$html = '<div>';
$html .= '<label>'.$Language->get('Plugin label').'</label>';
$html .= '<label>'.$this->L('Plugin label').'</label>';
$html .= '<input name="label" id="jslabel" type="text" value="'.$this->getDbField('label').'">';
$html .= '</div>';
$html .= '<div>';
$html .= '<label>'.$Language->get('About').'</label>';
$html .= '<label>'.$this->L('About').'</label>';
$html .= '<textarea name="text" id="jstext">'.$this->getDbField('text').'</textarea>';
$html .= '</div>';

10
bl-plugins/disqus/plugin.php Normal file → Executable file
View File

@ -36,29 +36,27 @@ class pluginDisqus extends Plugin {
public function form()
{
global $Language;
$html = '<div>';
$html .= '<label>'.$Language->get('Disqus shortname').'</label>';
$html .= '<label>'.$this->L('Disqus shortname').'</label>';
$html .= '<input name="shortname" id="jsshortname" type="text" value="'.$this->getDbField('shortname').'">';
$html .= '</div>';
$html .= '<div>';
$html .= '<input type="hidden" name="enablePages" value="0">';
$html .= '<input name="enablePages" id="jsenablePages" type="checkbox" value="1" '.($this->getDbField('enablePages')?'checked':'').'>';
$html .= '<label class="forCheckbox" for="jsenablePages">'.$Language->get('Enable Disqus on pages').'</label>';
$html .= '<label class="forCheckbox" for="jsenablePages">'.$this->L('Enable Disqus on pages').'</label>';
$html .= '</div>';
$html .= '<div>';
$html .= '<input type="hidden" name="enablePosts" value="0">';
$html .= '<input name="enablePosts" id="jsenablePosts" type="checkbox" value="1" '.($this->getDbField('enablePosts')?'checked':'').'>';
$html .= '<label class="forCheckbox" for="jsenablePosts">'.$Language->get('Enable Disqus on posts').'</label>';
$html .= '<label class="forCheckbox" for="jsenablePosts">'.$this->L('Enable Disqus on posts').'</label>';
$html .= '</div>';
$html .= '<div>';
$html .= '<input type="hidden" name="enableDefaultHomePage" value="0">';
$html .= '<input name="enableDefaultHomePage" id="jsenableDefaultHomePage" type="checkbox" value="1" '.($this->getDbField('enableDefaultHomePage')?'checked':'').'>';
$html .= '<label class="forCheckbox" for="jsenableDefaultHomePage">'.$Language->get('Enable Disqus on default home page').'</label>';
$html .= '<label class="forCheckbox" for="jsenableDefaultHomePage">'.$this->L('Enable Disqus on default home page').'</label>';
$html .= '</div>';
return $html;

10
bl-plugins/googletools/plugin.php Normal file → Executable file
View File

@ -12,18 +12,16 @@ class pluginGoogleTools extends Plugin {
public function form()
{
global $Language;
$html = '<div>';
$html .= '<label for="jsgoogle-site-verification">'.$Language->get('Google Webmasters tools').'</label>';
$html .= '<label for="jsgoogle-site-verification">'.$this->L('Google Webmasters tools').'</label>';
$html .= '<input id="jsgoogle-site-verification" type="text" name="google-site-verification" value="'.$this->getDbField('google-site-verification').'">';
$html .= '<div class="tip">'.$Language->get('complete-this-field-with-the-google-site-verification').'</div>';
$html .= '<div class="tip">'.$this->L('complete-this-field-with-the-google-site-verification').'</div>';
$html .= '</div>';
$html .= '<div>';
$html .= '<label for="jstracking-id">'.$Language->get('Google Analytics Tracking ID').'</label>';
$html .= '<label for="jstracking-id">'.$this->L('Google Analytics Tracking ID').'</label>';
$html .= '<input id="jstracking-id" type="text" name="tracking-id" value="'.$this->getDbField('tracking-id').'">';
$html .= '<div class="tip">'.$Language->get('complete-this-field-with-the-tracking-id').'</div>';
$html .= '<div class="tip">'.$this->L('complete-this-field-with-the-tracking-id').'</div>';
$html .= '</div>';
return $html;

6
bl-plugins/latest_posts/plugin.php Normal file → Executable file
View File

@ -12,15 +12,13 @@ class pluginLatestPosts extends Plugin {
public function form()
{
global $Language;
$html = '<div>';
$html .= '<label>'.$Language->get('Plugin label').'</label>';
$html .= '<label>'.$this->L('Plugin label').'</label>';
$html .= '<input name="label" id="jslabel" type="text" value="'.$this->getDbField('label').'">';
$html .= '</div>';
$html .= '<div>';
$html .= '<label>'.$Language->get('Amount of posts').'</label>';
$html .= '<label>'.$this->L('Amount of posts').'</label>';
$html .= '<input name="amount" id="jsamount" type="text" value="'.$this->getDbField('amount').'">';
$html .= '</div>';

6
bl-plugins/maintenancemode/plugin.php Normal file → Executable file
View File

@ -12,16 +12,14 @@ class pluginMaintenanceMode extends Plugin {
public function form()
{
global $Language;
$html = '<div>';
$html .= '<input type="hidden" name="enable" value="0">';
$html .= '<input name="enable" id="jsenable" type="checkbox" value="1" '.($this->getDbField('enable')?'checked':'').'>';
$html .= '<label class="forCheckbox" for="jsenable">'.$Language->get('Enable maintenance mode').'</label>';
$html .= '<label class="forCheckbox" for="jsenable">'.$this->L('Enable maintenance mode').'</label>';
$html .= '</div>';
$html .= '<div>';
$html .= '<label>'.$Language->get('Message').'</label>';
$html .= '<label>'.$this->L('Message').'</label>';
$html .= '<input name="message" id="jsmessage" type="text" value="'.$this->getDbField('message').'">';
$html .= '</div>';

9
bl-plugins/pages/plugin.php Normal file → Executable file
View File

@ -12,17 +12,15 @@ class pluginPages extends Plugin {
public function form()
{
global $Language;
$html = '<div>';
$html .= '<label>'.$Language->get('Plugin label').'</label>';
$html .= '<label>'.$this->L('Plugin label').'</label>';
$html .= '<input name="label" id="jslabel" type="text" value="'.$this->getDbField('label').'">';
$html .= '</div>';
$html .= '<div>';
$html .= '<input type="hidden" name="homeLink" value="0">';
$html .= '<input name="homeLink" id="jshomeLink" type="checkbox" value="1" '.($this->getDbField('homeLink')?'checked':'').'>';
$html .= '<label class="forCheckbox" for="jshomeLink">'.$Language->get('Show home link').'</label>';
$html .= '<label class="forCheckbox" for="jshomeLink">'.$this->L('Show home link').'</label>';
$html .= '</div>';
return $html;
@ -30,7 +28,6 @@ class pluginPages extends Plugin {
public function siteSidebar()
{
global $Language;
global $pagesParents;
global $Site, $Url;
@ -48,7 +45,7 @@ class pluginPages extends Plugin {
// Show home link ?
if($this->getDbField('homeLink')) {
$html .= '<li>';
$html .= '<a class="parent'.( ($Url->whereAmI()=='home')?' active':'').'" href="'.$Site->homeLink().'">'.$Language->get('Home').'</a>';
$html .= '<a class="parent'.( ($Url->whereAmI()=='home')?' active':'').'" href="'.$Site->homeLink().'">'.$this->L('Home').'</a>';
$html .= '</li>';
}

12
bl-plugins/simplemde/plugin.php Normal file → Executable file
View File

@ -20,22 +20,20 @@ class pluginsimpleMDE extends Plugin {
public function form()
{
global $Language;
$html = '<div>';
$html .= '<label>'.$Language->get('Toolbar').'</label>';
$html .= '<label>'.$this->L('Toolbar').'</label>';
$html .= '<input name="toolbar" id="jstoolbar" type="text" value="'.$this->getDbField('toolbar').'">';
$html .= '</div>';
$html .= '<div>';
$html .= '<label>'.$Language->get('Tab size').'</label>';
$html .= '<label>'.$this->L('Tab size').'</label>';
$html .= '<input name="tabSize" id="jstabSize" type="text" value="'.$this->getDbField('tabSize').'">';
$html .= '</div>';
$html .= '<div>';
$html .= '<input type="hidden" name="autosave" value="0">';
$html .= '<input name="autosave" id="jsautosave" type="checkbox" value="1" '.($this->getDbField('autosave')?'checked':'').'>';
$html .= '<label class="forCheckbox" for="jsautosave">'.$Language->get('Autosave').'</label>';
$html .= '<label class="forCheckbox" for="jsautosave">'.$this->L('Autosave').'</label>';
$html .= '</div>';
return $html;
@ -78,8 +76,6 @@ class pluginsimpleMDE extends Plugin {
public function adminBodyEnd()
{
global $layout;
global $Language;
$html = '';
// Load CSS and JS only on Controllers in array.
@ -109,7 +105,7 @@ class pluginsimpleMDE extends Plugin {
// This function is necesary on each Editor, it is used by Bludit Images v8.
$html .= 'function editorAddImage(filename) {
addContentSimpleMDE("!['.$Language->get('Image description').']("+filename+")");
addContentSimpleMDE("!['.$this->L('Image description').']("+filename+")");
}'.PHP_EOL;
$html .= '$(document).ready(function() { '.PHP_EOL;

11
bl-plugins/tags/plugin.php Normal file → Executable file
View File

@ -12,23 +12,21 @@ class pluginTags extends Plugin {
public function form()
{
global $Language;
$html = '<div>';
$html .= '<label>'.$Language->get('Plugin label').'</label>';
$html .= '<label>'.$this->L('Plugin label').'</label>';
$html .= '<input name="label" id="jslabel" type="text" value="'.$this->getDbField('label').'">';
$html .= '</div>';
$html .= '<div>';
$html .= $Language->get('Sort the tag list by').': <select name="sort">';
$html .= $this->L('Sort the tag list by').': <select name="sort">';
foreach(array('alpha' => 'Alphabetical order',
'count' => 'Number of times each tag has been used',
'date' => 'Date each tag was first used') as $key=>$value) {
if ($key == $this->getDbField('sort')) {
$html .= '<option value="'.$key.'" selected>'.$Language->get($value).'</option>';
$html .= '<option value="'.$key.'" selected>'.$this->L($value).'</option>';
} else {
$html .= '<option value="'.$key.'">'.$Language->get($value).'</option>';
$html .= '<option value="'.$key.'">'.$this->L($value).'</option>';
}
}
$html .= '</select>';
@ -39,7 +37,6 @@ class pluginTags extends Plugin {
public function siteSidebar()
{
global $Language;
global $dbTags;
global $Url;