1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 21:27:25 +02:00

Merge pull request #4364 from yesszus/patch-2

Add Hero plugin translations
This commit is contained in:
Cameron
2021-02-26 07:14:07 -08:00
committed by GitHub
7 changed files with 85 additions and 29 deletions

View File

@@ -9,7 +9,8 @@ if (!getperms('P'))
exit;
}
// e107::lan('hero',true);
//e107::lan('hero',true);
e107::lan('hero',true, true);
e107::css('hero', 'css/bootstrap-iconpicker.min.css');
@@ -80,15 +81,15 @@ class hero_ui extends e_admin_ui
protected $fields = array (
'checkboxes' => array ( 'title' => '', 'type' => null, 'data' => null, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ),
'hero_id' => array ( 'title' => LAN_ID, 'type' => null, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'hero_media' => array('title'=> "Image/Video", 'type'=>'image', 'noedit'=>true, 'data'=>'str', 'readParms'=>array('thumb'=>'100x80'), 'writeParms'=>array('media'=>'hero^', 'video' => 1)),
'hero_bg' => array('title'=> "Background", 'type'=>'image', 'noedit'=>true, 'data'=>'str', 'readParms'=>array('thumb'=>'100x80'), 'writeParms'=>array('media'=>'hero^')),
'hero_media' => array('title'=> LAN_HERO_ADMIN_004, 'type'=>'image', 'noedit'=>true, 'data'=>'str', 'readParms'=>array('thumb'=>'100x80'), 'writeParms'=>array('media'=>'hero^', 'video' => 1)),
'hero_bg' => array('title'=> LAN_HERO_ADMIN_003, 'type'=>'image', 'noedit'=>true, 'data'=>'str', 'readParms'=>array('thumb'=>'100x80'), 'writeParms'=>array('media'=>'hero^')),
'hero_title' => array ( 'title' => LAN_TITLE, 'type' => 'text', 'data' => 'str', 'width' => '18%', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => array('size'=>'block-level'), 'class' => 'left', 'thclass' => 'left', ),
'hero_description' => array ( 'title' => LAN_DESCRIPTION, 'type' => 'text', 'data' => 'str', 'width' => '30%', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => array('size'=>'block-level'), 'class' => 'left', 'thclass' => 'left', ),
'hero_bullets' => array ( 'title' => 'Bullets', 'type' => 'method', 'data' => 'json', 'width' => '35%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'hero_images' => array('title'=> "Media", 'type'=>'method', 'data'=>false, 'nolist'=>true),
'hero_button1' => array ( 'title' => 'Button-1', 'type' => 'method', 'data' => 'json', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'hero_button2' => array ( 'title' => 'Button-2', 'type' => 'method', 'data' => 'json', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'hero_bullets' => array ( 'title' => LAN_ICON, 'type' => 'method', 'data' => 'json', 'width' => '35%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'hero_images' => array('title'=> LAN_HERO_ADMIN_005, 'type'=>'method', 'data'=>false, 'nolist'=>true),
'hero_button1' => array ( 'title' => LAN_HERO_ADMIN_015.'-1', 'type' => 'method', 'data' => 'json', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'hero_button2' => array ( 'title' => LAN_HERO_ADMIN_015.'-2', 'type' => 'method', 'data' => 'json', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'hero_order' => array ( 'title' => LAN_ORDER, 'tab'=>1 , 'type' => 'number', 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'hero_class' => array ( 'title' => LAN_VISIBILITY, 'tab'=>1, 'type' => 'userclass', 'data' => 'int', 'inline'=>true, 'width' => '10%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
@@ -101,8 +102,8 @@ class hero_ui extends e_admin_ui
// protected $preftabs = array('General', 'Other' );
protected $prefs = array(
'visibility' => array('title'=> LAN_VISIBILITY, 'tab'=>0, 'type'=>'userclass', 'data' => 'str', 'help'=>'', 'writeParms'=>array('classlist' => 'public,member,guest,admin,main,classes,nobody, no-excludes')),
'icon_pack' => array('title'=> "Icon Pack", 'tab'=>0, 'type'=>'method', 'data' => 'str', 'writeParms'=>array(),'help'=>''),
'slide_interval' => array('title'=>'Slide Interval', 'type'=>'dropdown', 'data'=>'int', 'writeParms'=>array('optArray'=>array())),
'icon_pack' => array('title'=> LAN_HERO_ADMIN_009, 'tab'=>0, 'type'=>'method', 'data' => 'str', 'writeParms'=>array(),'help'=>''),
'slide_interval' => array('title'=>LAN_HERO_ADMIN_011, 'type'=>'dropdown', 'data'=>'int', 'writeParms'=>array('optArray'=>array())),
);
@@ -114,7 +115,7 @@ class hero_ui extends e_admin_ui
$opts = array();
foreach($r as $v)
{
$opts[$v] = str_replace('000', '', $v).' second(s)';
$opts[$v] = str_replace('000', '', $v).' '.LAN_HERO_ADMIN_016;
}
$this->prefs['slide_interval']['writeParms']['optArray'] = $opts;
@@ -196,7 +197,7 @@ class hero_ui extends e_admin_ui
public function renderHelp()
{
$caption = LAN_HELP;
$text = 'Be sure to enable the hero menu on your home page using the Menu Manager.';
$text = LAN_HERO_ADMIN_007;
return array('caption'=>$caption,'text'=> $text);
@@ -415,11 +416,11 @@ class hero_form_ui extends e_admin_form_ui
<col />
</colgroup>
<tr>
<th class='text-center'>Icon</th>
<th class='text-center'>Icon-style</th>
<th>Text</th>
<th>Animation</th>
<th>Delay (secs)</th>
<th class='text-center'>".LAN_ICON."</th>
<th class='text-center'>".LAN_HERO_ADMIN_010."</th>
<th>".LAN_HERO_ADMIN_012."</th>
<th>".LAN_HERO_ADMIN_013."</th>
<th>".LAN_HERO_ADMIN_014."</th>
</tr>";
@@ -512,7 +513,7 @@ class hero_form_ui extends e_admin_form_ui
$text .= "<tr>
<td class='text-center'>".$this->glyphPicker($name.'[icon]', varset($val['icon']))."</td>
<td>".$this->text($name.'[label]', varset($val['label']), 255, array('size'=>'block-level', 'placeholder'=>'Label'))."</td>
<td>".$this->text($name.'[label]', varset($val['label']), 255, array('size'=>'block-level', 'placeholder'=>LAN_HERO_ADMIN_006))."</td>
<td> ".$this->text($name.'[url]', varset($val['url']), 255, array('size'=>'block-level', 'placeholder'=>'URL'))."</td>
<td> ".$this->btnClass($name.'[class]', varset($val['class']))."</td>
</tr>";
@@ -614,8 +615,8 @@ class hero_form_ui extends e_admin_form_ui
return "<table class='table table-condensed table-bordered' style='margin:0;width:auto'>
<tr>
<th class='text-center'>Background</th>
<th class='text-center'>Image/Video</th>
<th class='text-center'>".LAN_HERO_ADMIN_003."</th>
<th class='text-center'>".LAN_HERO_ADMIN_004."</th>
</tr>
<tr>
<td class='text-center' style='padding-left:15px'>".$this->imagepicker('hero_bg', $bg, null, array('media'=>'hero^'))."</td>
@@ -640,5 +641,3 @@ e107::js('hero', 'js/bootstrap-iconpicker.min.js');
require_once(e_ADMIN."footer.php");

View File

@@ -13,6 +13,8 @@
if (!defined('e107_INIT')) { exit; }
e107::lan('hero',true, true);
if(deftrue('e_FRONTPAGE'))
{
$text = e107::getParser()->parseTemplate("{HERO}", true);
@@ -20,6 +22,6 @@ if(deftrue('e_FRONTPAGE'))
}
elseif(ADMIN)
{
$text = "<div class='alert alert-danger'>Hero only runs on the frontpage of your site.</div>";
$text = "<div class='alert alert-danger'>".LAN_HERO_MENU_001."</div>";
e107::getRender()->tablerender(null, $text,'hero-menu');
}

View File

@@ -10,6 +10,7 @@
**
*/
e107::lan('hero',true, true);
if(!class_exists("hero_setup"))
{
@@ -31,12 +32,12 @@ if(!class_exists("hero_setup"))
if(!empty($ret['success']))
{
e107::getMessage()->addSuccess("Default slides imported.");
e107::getMessage()->addSuccess(LAN_HERO_ADMIN_001);
}
if(!empty($ret['failed']))
{
e107::getMessage()->addError("Failed to import default slides.");
e107::getMessage()->addError(LAN_HERO_ADMIN_002);
e107::getMessage()->addDebug(print_a($ret['failed'],true));
}
@@ -72,4 +73,4 @@ if(!class_exists("hero_setup"))
}
}
}

View File

@@ -0,0 +1,27 @@
<?php
/*
+----------------------------------------------------------------------+
| e107 website content management system Hungarian Language File
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
| Last Modified: 2020/12/18 12:42:44
|
| $Author: Yesszus $
+----------------------------------------------------------------------+
*/
define("LAN_HERO_ADMIN_001", "Default slides imported.");
define("LAN_HERO_ADMIN_002", "Failed to import default slides.");
define("LAN_HERO_ADMIN_003", "Background");
define("LAN_HERO_ADMIN_004", "Image/Video");
define("LAN_HERO_ADMIN_005", "Media");
define("LAN_HERO_ADMIN_006", "Label");
define("LAN_HERO_ADMIN_007", "Be sure to enable the hero menu on your home page using the Menu Manager.");
define("LAN_HERO_ADMIN_009", "Icon pack");
define("LAN_HERO_ADMIN_010", "Icon-style");
define("LAN_HERO_ADMIN_011", "Slide interval");
define("LAN_HERO_ADMIN_012", "Text");
define("LAN_HERO_ADMIN_013", "Animation");
define("LAN_HERO_ADMIN_014", "Delay (sec)");
define("LAN_HERO_ADMIN_015", "Button");
define("LAN_HERO_ADMIN_016", "second(s)");

View File

@@ -0,0 +1,15 @@
<?php
/*
+----------------------------------------------------------------------+
| e107 website content management system Hungarian Language File
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
| Last Modified: 2020/12/18 12:42:44
|
| $Author: Yesszus $
+----------------------------------------------------------------------+
*/
define("LAN_PLUGIN_HERO_NAME", "Hero");
define("LAN_PLUGIN_HERO_SUMMARY", "Home page 'Hero' area management");
define("LAN_PLUGIN_HERO_DESCRIPTION", "Image and text slider, animated bullet points for the hero area of your home page.");

View File

@@ -0,0 +1,12 @@
<?php
/*
+----------------------------------------------------------------------+
| e107 website content management system Hungarian Language File
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
| Last Modified: 2021/02/21 11:15:44
|
| $Author: Yesszus $
+----------------------------------------------------------------------+
*/
define("LAN_HERO_MENU_001", "Hero only runs on the frontpage of your site.");

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<e107Plugin name="Hero" lan="" version="1.0" date="2020-12-15" compatibility="2.0" installRequired="true" >
<e107Plugin name="Hero" lan="LAN_PLUGIN_HERO_NAME" version="1.0" date="2020-12-15" compatibility="2.0" installRequired="true" >
<author name="e107" url="https://e107.org" />
<summary lan="">Home page 'Hero' area management</summary>
<description lan="">Image and text slider, animated bullet points for the hero area of your home page.</description>
<summary lan="LAN_PLUGIN_HERO_SUMMARY">Home page 'Hero' area management</summary>
<description lan="LAN_PLUGIN_HERO_DESCRIPTION">Image and text slider, animated bullet points for the hero area of your home page.</description>
<keywords>
<word>generic</word>
<word>hero</word>
@@ -22,4 +22,4 @@
<mediaCategories>
<category type="image">Hero Images</category>
</mediaCategories>
</e107Plugin>
</e107Plugin>