mirror of
https://github.com/e107inc/e107.git
synced 2025-08-12 09:34:54 +02:00
Modification to plugin.xml and theme.xml spec. 'lan=' instead of 'lang='.
Added <summary> and <keywords> Plugin builder enhanced to match these changes
This commit is contained in:
@@ -1305,6 +1305,7 @@ class pluginBuilder
|
||||
var $table = '';
|
||||
var $pluginName = '';
|
||||
var $special = array();
|
||||
var $tableCount = 0;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
@@ -1449,14 +1450,16 @@ class pluginBuilder
|
||||
$text = $frm->open('newplugin-step3','post', e_SELF.'?mode=create&newplugin='.$newplug.'&step=3');
|
||||
$text .= "<div class='admintabs' id='tab-container'>\n";
|
||||
$text .= "<ul class='e-tabs' id='core-emote-tabs'>\n";
|
||||
$text .= "<li id='tab-xml'><a href='#xml'>Basic Info.</a></li>";
|
||||
|
||||
$this->tableCount = count($ret['tables']);
|
||||
|
||||
foreach($ret['tables'] as $key=>$table)
|
||||
{
|
||||
$text .= "<li id='tab-".$table."'><a href='#".$table."'>Table: ".$table."</a></li>";
|
||||
}
|
||||
$text .= "<li id='tab-preferences'><a href='#preferences'>Preferences</a></li>";
|
||||
$text .= "<li id='tab-xml'><a href='#xml'>Meta Info.</a></li>";
|
||||
|
||||
$text .= "</ul>";
|
||||
|
||||
foreach($ret['tables'] as $key=>$table)
|
||||
@@ -1489,11 +1492,9 @@ class pluginBuilder
|
||||
$text .= $frm->close();
|
||||
|
||||
$mes->addInfo("Review all fields and modify if necessary.");
|
||||
|
||||
if(count($ret['tables']) > 1)
|
||||
{
|
||||
$mes->addInfo("Review ALL tables before clicking 'Generate'.");
|
||||
}
|
||||
|
||||
$mes->addInfo("Review ALL tabs before clicking 'Generate'.");
|
||||
|
||||
|
||||
$ns->tablerender("Plugin Builder", $mes->render() . $text);
|
||||
}
|
||||
@@ -1513,9 +1514,11 @@ class pluginBuilder
|
||||
//TODO Plugin.xml Form Fields. .
|
||||
|
||||
$data = array(
|
||||
'main' => array('name','lang','version','date', 'compatibility','installRequired'),
|
||||
'main' => array('name','lang','version','date', 'compatibility'),
|
||||
'author' => array('name','url'),
|
||||
'summary' => array('summary'),
|
||||
'description' => array('description'),
|
||||
'keywords' => array('one','two'),
|
||||
'category' => array('category'),
|
||||
'copyright' => array('copyright'),
|
||||
// 'languageFile' => array('type','path'),
|
||||
@@ -1600,12 +1603,28 @@ class pluginBuilder
|
||||
|
||||
case 'main-installRequired':
|
||||
return "Installation required: ".$frm->radio_switch($name,'',LAN_YES, LAN_NO);
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'description-description':
|
||||
$help = "A short description of the plugin<br />(Must be written in English)";
|
||||
case 'summary-summary':
|
||||
$help = "A short one-line description of the plugin<br />(Must be written in English)";
|
||||
$required = true;
|
||||
$size = 100;
|
||||
$placeholder= " ";
|
||||
break;
|
||||
|
||||
case 'keywords-one':
|
||||
case 'keywords-two':
|
||||
$help = "Keyword/Tag for this plugin<br />(Must be written in English)";
|
||||
$required = true;
|
||||
$size = 20;
|
||||
$placeholder= " ";
|
||||
break;
|
||||
|
||||
case 'description-description':
|
||||
$help = "A full description of the plugin<br />(Must be written in English)";
|
||||
$required = true;
|
||||
$size = 100;
|
||||
$placeholder = " ";
|
||||
break;
|
||||
|
||||
|
||||
@@ -1621,14 +1640,20 @@ class pluginBuilder
|
||||
}
|
||||
|
||||
$req = ($required == true) ? "&required=1" : "";
|
||||
$placeholder = (varset($placeholder)) ? $placeholder : $type;
|
||||
|
||||
if($type == 'date')
|
||||
switch ($type)
|
||||
{
|
||||
$text = $frm->datepicker($name,time(),'dateformat=yy-mm-dd'.$req);
|
||||
}
|
||||
elseif($type == 'category')
|
||||
{
|
||||
$options = array(
|
||||
case 'date':
|
||||
$text = $frm->datepicker($name,time(),'dateformat=yy-mm-dd'.$req);
|
||||
break;
|
||||
|
||||
case 'description':
|
||||
$text = $frm->textarea($name,$default, 3, 80, $req);
|
||||
break;
|
||||
|
||||
case 'category':
|
||||
$options = array(
|
||||
'settings' => 'settings',
|
||||
'users' => 'users',
|
||||
'content' => 'content',
|
||||
@@ -1637,23 +1662,26 @@ class pluginBuilder
|
||||
'misc' => 'misc',
|
||||
'menu' => 'menu',
|
||||
'about' => 'about'
|
||||
);
|
||||
);
|
||||
|
||||
$text = $frm->selectbox($name, $options,'','required=1', true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = $frm->text($name, $default, $size, 'placeholder='.$type.$req);
|
||||
$text = $frm->selectbox($name, $options,'','required=1', true);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
$text = $frm->text($name, $default, $size, 'placeholder='.$placeholder . $req);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$text .= ($help) ? "<span class='field-help'>".$help."</span>" : "";
|
||||
return $text;
|
||||
|
||||
}
|
||||
|
||||
function processXml($data)
|
||||
function createXml($data)
|
||||
{
|
||||
|
||||
//print_a($_POST);
|
||||
$ns = e107::getRender();
|
||||
$mes = e107::getMessage();
|
||||
|
||||
@@ -1669,9 +1697,14 @@ class pluginBuilder
|
||||
|
||||
$template = <<<TEMPLATE
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<e107Plugin name="{MAIN_NAME}" version="{MAIN_VERSION}" date="{MAIN_DATE}" compatibility="{MAIN_COMPATIBILITY}" installRequired="{MAIN_INSTALLREQUIRED}" >
|
||||
<e107Plugin name="{MAIN_NAME}" lan="" version="{MAIN_VERSION}" date="{MAIN_DATE}" compatibility="{MAIN_COMPATIBILITY}" installRequired="true" >
|
||||
<author name="{AUTHOR_NAME}" url="{AUTHOR_URL}" />
|
||||
<description lang="">{DESCRIPTION_DESCRIPTION}</description>
|
||||
<summary lan="">{SUMMARY_SUMMARY}</summary>
|
||||
<description lan="">{DESCRIPTION_DESCRIPTION}</description>
|
||||
<keywords>
|
||||
<word>{KEYWORDS_ONE}</word>
|
||||
<word>{KEYWORDS_TWO}</word>
|
||||
</keywords>
|
||||
<category>{CATEGORY_CATEGORY}</category>
|
||||
<copyright>{COPYRIGHT_COPYRIGHT}</copyright>
|
||||
<adminLinks>
|
||||
@@ -1724,26 +1757,31 @@ TEMPLATE;
|
||||
|
||||
$modes = array("main"=>"Main Area","cat"=>"Categories");
|
||||
|
||||
// echo "TABLE COUNT= ".$this->tableCount ;
|
||||
|
||||
|
||||
$this->table = $table."_ui";
|
||||
|
||||
$text .= "<table class='table adminform'>\n";
|
||||
|
||||
|
||||
$text .= "
|
||||
<tr>
|
||||
<td>Plugin Title</td>
|
||||
<td>".$frm->text($this->table.'[pluginTitle]', $newplug, '', 'required=1').
|
||||
|
||||
$frm->hidden($this->table.'[pluginName]', $this->pluginName, 15).
|
||||
$frm->hidden($this->table.'[table]', $table, 15).
|
||||
"</td>
|
||||
|
||||
</tr>
|
||||
$text .= $frm->hidden($this->table.'[pluginName]', $this->pluginName, 15).
|
||||
$frm->hidden($this->table.'[table]', $table, 15);
|
||||
|
||||
if($this->tableCount > 1)
|
||||
{
|
||||
$text .= "<table class='table adminform'>\n";
|
||||
$text .= "
|
||||
<tr>
|
||||
<td>Mode</td>
|
||||
<td>".$frm->selectbox($this->table."[mode]",$modes, '', 'required=1', true)."</td>
|
||||
</tr>
|
||||
|
||||
";
|
||||
}
|
||||
else
|
||||
{
|
||||
$text .= $frm->hidden($this->table.'[mode]','main');
|
||||
}
|
||||
|
||||
$text .= "</table>".$this->special('checkboxes');
|
||||
|
||||
@@ -1901,9 +1939,10 @@ TEMPLATE;
|
||||
|
||||
case 'id':
|
||||
$ret['title'] = 'LAN_ID';
|
||||
// $ret['type'] = 'datestamp';
|
||||
$ret['type'] = 'boolean';
|
||||
$ret['batch'] = false;
|
||||
$ret['filter'] = false;
|
||||
$ret['width'] = '5%';
|
||||
break;
|
||||
|
||||
case 'start':
|
||||
@@ -2005,7 +2044,7 @@ TEMPLATE;
|
||||
$ret['batch'] = false;
|
||||
$ret['filter'] = false;
|
||||
$ret['thclass'] = 'center';
|
||||
$ret['width'] = '5%';
|
||||
$ret['width'] = 'auto';
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2045,9 +2084,11 @@ TEMPLATE;
|
||||
function step3()
|
||||
{
|
||||
|
||||
$pluginTitle = $_POST['xml']['main-name'] ;
|
||||
|
||||
if($_POST['xml'])
|
||||
{
|
||||
$xmlText = $this->processXml($_POST['xml']);
|
||||
$xmlText = $this->createXml($_POST['xml']);
|
||||
}
|
||||
|
||||
|
||||
@@ -2179,7 +2220,7 @@ $text .=
|
||||
class ".$table." extends e_admin_ui
|
||||
{
|
||||
|
||||
protected \$pluginTitle = '".$vars['pluginTitle']."';
|
||||
protected \$pluginTitle = '".$pluginTitle."';
|
||||
protected \$pluginName = '".$vars['pluginName']."';
|
||||
protected \$table = '".$vars['table']."';
|
||||
protected \$pid = '".$vars['pid']."';
|
||||
|
@@ -67,7 +67,7 @@ class convert
|
||||
break;
|
||||
|
||||
case 'forum': // DEPRECATED - temporary here from BC reasons only
|
||||
default:
|
||||
// default:
|
||||
//BC - old 'forum' call
|
||||
if(strpos($mask, '%') === FALSE)
|
||||
{
|
||||
@@ -94,6 +94,99 @@ class convert
|
||||
if($string == null) return false;
|
||||
return is_integer($string) ? $this->convert_date($string, $mask) : $this->toTime($string, $mask);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Converts from one date function mask to the other and vice-versa.
|
||||
*/
|
||||
function toMask($mask)
|
||||
{
|
||||
$convert = array(
|
||||
'%Y' => 'yy',
|
||||
'%d' => 'dd',
|
||||
'%m' => 'mm',
|
||||
'%B' => 'MM', // Full month name, based on the locale
|
||||
'%A' => 'DD', // A full textual representation of the day
|
||||
|
||||
'%y' => 'y',
|
||||
'%a' => 'D', // An abbreviated textual representation of the day
|
||||
'%b' => 'M', // Abbreviated month name, based on the locale
|
||||
'%h' => 'M', // Abbreviated month name, based on the locale (an alias of %b)
|
||||
|
||||
'%l' => 'h', // 12 hour format - no leading zero
|
||||
'%I' => 'hh', // 12 hour format - leading zero
|
||||
'%H' => 'hh', // 24 hour format - leading zero
|
||||
'%M' => 'mm',
|
||||
'%S' => 'ss',
|
||||
'%p' => 'TT', // %p UPPER-CASE 'AM' or 'PM' based on the given time
|
||||
'%P' => 'tt', // %P lower-case 'am' or 'pm' based on the given time
|
||||
'%T' => 'hh:mm:ss',
|
||||
'%r' => "hh:mmm:ss TT" // 12 hour format
|
||||
|
||||
);
|
||||
|
||||
$s = array_keys($convert);
|
||||
$r = array_values($convert);
|
||||
|
||||
if(strpos($mask, '%') === FALSE)
|
||||
{
|
||||
return str_replace($r, $s,$mask);
|
||||
}
|
||||
|
||||
|
||||
return str_replace($s,$r, $mask);
|
||||
|
||||
// Keep this info here:
|
||||
/*
|
||||
* $options allowed keys:
|
||||
|
||||
*
|
||||
* d - day of month (no leading zero)
|
||||
dd - day of month (two digit)
|
||||
o - day of the year (no leading zeros)
|
||||
oo - day of the year (three digit)
|
||||
D - day name short
|
||||
DD - day name long
|
||||
m - month of year (no leading zero)
|
||||
mm - month of year (two digit)
|
||||
M - month name short
|
||||
MM - month name long
|
||||
y - year (two digit)
|
||||
yy - year (four digit)
|
||||
@ - Unix timestamp (ms since 01/01/1970)
|
||||
! - Windows ticks (100ns since 01/01/0001)
|
||||
'...' - literal text
|
||||
'' - single quote
|
||||
anything else - literal text
|
||||
|
||||
ATOM - 'yy-mm-dd' (Same as RFC 3339/ISO 8601)
|
||||
COOKIE - 'D, dd M yy'
|
||||
ISO_8601 - 'yy-mm-dd'
|
||||
RFC_822 - 'D, d M y' (See RFC 822)
|
||||
RFC_850 - 'DD, dd-M-y' (See RFC 850)
|
||||
RFC_1036 - 'D, d M y' (See RFC 1036)
|
||||
RFC_1123 - 'D, d M yy' (See RFC 1123)
|
||||
RFC_2822 - 'D, d M yy' (See RFC 2822)
|
||||
RSS - 'D, d M y' (Same as RFC 822)
|
||||
TICKS - '!'
|
||||
TIMESTAMP - '@'
|
||||
W3C - 'yy-mm-dd' (Same as ISO 8601)
|
||||
*
|
||||
* h Hour with no leading 0
|
||||
* hh Hour with leading 0
|
||||
* m Minute with no leading 0
|
||||
* mm Minute with leading 0
|
||||
* s Second with no leading 0
|
||||
* ss Second with leading 0
|
||||
* l Milliseconds always with leading 0
|
||||
* t a or p for AM/PM
|
||||
* T A or P for AM/PM
|
||||
* tt am or pm for AM/PM
|
||||
* TT AM or PM for AM/PM
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -540,6 +540,7 @@ class e_form
|
||||
* @param array or str
|
||||
* @example $frm->datepicker('my_field',time(),'type=date');
|
||||
* @example $frm->datepicker('my_field',time(),'type=datetime&inline=1');
|
||||
* @example $frm->datepicker('my_field',time(),'type=date&dateformat=yy-mm-dd');
|
||||
*
|
||||
* @url http://trentrichardson.com/examples/timepicker/
|
||||
*/
|
||||
@@ -557,37 +558,10 @@ class e_form
|
||||
|
||||
// echo "TYPE=".$type;
|
||||
|
||||
$ampm = (preg_match("/%l|%I|%p|%P/",$timeFormat)) ? 'true' : 'false';
|
||||
|
||||
$convert = array(
|
||||
'%d' => 'dd',
|
||||
'%m' => 'mm',
|
||||
'%y' => 'y',
|
||||
'%Y' => 'yy',
|
||||
|
||||
'%a' => 'D', // An abbreviated textual representation of the day
|
||||
'%A' => 'DD', // A full textual representation of the day
|
||||
'%B' => 'MM', // Full month name, based on the locale
|
||||
'%b' => 'M', // Abbreviated month name, based on the locale
|
||||
'%h' => 'M', // Abbreviated month name, based on the locale (an alias of %b)
|
||||
|
||||
'%l' => 'h', // 12 hour format - no leading zero
|
||||
'%I' => 'hh', // 12 hour format - leading zero
|
||||
'%H' => 'hh', // 24 hour format - leading zero
|
||||
'%M' => 'mm',
|
||||
'%S' => 'ss',
|
||||
'%p' => 'TT', // %p UPPER-CASE 'AM' or 'PM' based on the given time
|
||||
'%P' => 'tt', // %P lower-case 'am' or 'pm' based on the given time
|
||||
'%T' => 'hh:mm:ss',
|
||||
'%r' => "hh:mmm:ss TT" // 12 hour format
|
||||
|
||||
);
|
||||
|
||||
$s = array_keys($convert);
|
||||
$r = array_values($convert);
|
||||
|
||||
$dformat = str_replace($s,$r,$dateFormat);
|
||||
$tformat = str_replace($s,$r,$timeFormat);
|
||||
$ampm = (preg_match("/%l|%I|%p|%P/",$timeFormat)) ? 'true' : 'false';
|
||||
|
||||
$dformat = e107::getDate()->toMask($dateFormat);
|
||||
$tformat = e107::getDate()->toMask($timeFormat);
|
||||
|
||||
$id = $this->name2id($name);
|
||||
|
||||
@@ -604,6 +578,7 @@ class e_form
|
||||
);
|
||||
|
||||
$defdisp = (isset($def[$type])) ? $def[$type] : $def['date'];
|
||||
$defdisp = e107::getDate()->toMask($defdisp);
|
||||
|
||||
if ($datestamp)
|
||||
{
|
||||
@@ -611,7 +586,8 @@ class e_form
|
||||
}
|
||||
|
||||
$text = "";
|
||||
|
||||
// $text .= 'dformat='.$dformat.' defdisp='.$defdisp;
|
||||
|
||||
$class = (isset($classes[$type])) ? $classes[$type] : "tbox e-date";
|
||||
$size = vartrue($options['size']) ? intval($options['size']) : 40;
|
||||
$required = vartrue($options['required']) ? "required" : "";
|
||||
@@ -628,55 +604,7 @@ class e_form
|
||||
}
|
||||
|
||||
return $text;
|
||||
// Keep this info here:
|
||||
/*
|
||||
* $options allowed keys:
|
||||
|
||||
*
|
||||
* d - day of month (no leading zero)
|
||||
dd - day of month (two digit)
|
||||
o - day of the year (no leading zeros)
|
||||
oo - day of the year (three digit)
|
||||
D - day name short
|
||||
DD - day name long
|
||||
m - month of year (no leading zero)
|
||||
mm - month of year (two digit)
|
||||
M - month name short
|
||||
MM - month name long
|
||||
y - year (two digit)
|
||||
yy - year (four digit)
|
||||
@ - Unix timestamp (ms since 01/01/1970)
|
||||
! - Windows ticks (100ns since 01/01/0001)
|
||||
'...' - literal text
|
||||
'' - single quote
|
||||
anything else - literal text
|
||||
|
||||
ATOM - 'yy-mm-dd' (Same as RFC 3339/ISO 8601)
|
||||
COOKIE - 'D, dd M yy'
|
||||
ISO_8601 - 'yy-mm-dd'
|
||||
RFC_822 - 'D, d M y' (See RFC 822)
|
||||
RFC_850 - 'DD, dd-M-y' (See RFC 850)
|
||||
RFC_1036 - 'D, d M y' (See RFC 1036)
|
||||
RFC_1123 - 'D, d M yy' (See RFC 1123)
|
||||
RFC_2822 - 'D, d M yy' (See RFC 2822)
|
||||
RSS - 'D, d M y' (Same as RFC 822)
|
||||
TICKS - '!'
|
||||
TIMESTAMP - '@'
|
||||
W3C - 'yy-mm-dd' (Same as ISO 8601)
|
||||
*
|
||||
* h Hour with no leading 0
|
||||
* hh Hour with leading 0
|
||||
* m Minute with no leading 0
|
||||
* mm Minute with leading 0
|
||||
* s Second with no leading 0
|
||||
* ss Second with leading 0
|
||||
* l Milliseconds always with leading 0
|
||||
* t a or p for AM/PM
|
||||
* T A or P for AM/PM
|
||||
* tt am or pm for AM/PM
|
||||
* TT AM or PM for AM/PM
|
||||
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@@ -257,7 +257,7 @@ class e107plugin
|
||||
{
|
||||
if ($plug_info['@attributes']['name'])
|
||||
{
|
||||
$pName = vartrue($plug_info['@attributes']['lang']) ? $plug_info['@attributes']['lang'] : $plug_info['@attributes']['name'] ;
|
||||
$pName = vartrue($plug_info['@attributes']['lan']) ? $plug_info['@attributes']['lan'] : $plug_info['@attributes']['name'] ;
|
||||
|
||||
$_installed = ($plug_info['@attributes']['installRequired'] == 'true' || $plug_info['@attributes']['installRequired'] == 1 ? 0 : 1);
|
||||
|
||||
|
@@ -2,7 +2,12 @@
|
||||
<!-- $Id: plugin.xml,v 1.5 2009-12-08 17:21:34 secretr Exp $ -->
|
||||
<e107Plugin name="Banners" version="1.0" date="2012-08-01" compatibility="0.8" installRequired="true">
|
||||
<author name="e107 Inc." url="http://e107.org" email="jalist@e107.org" />
|
||||
<summary>Add advertising banners to your e107 website</summary>
|
||||
<description lang="BNRLAN_100">Add advertising banners to your e107 website</description>
|
||||
<keywords>
|
||||
<word>banners</word>
|
||||
<word>advertise</word>
|
||||
</keywords>
|
||||
<languageFiles>
|
||||
<file type='log' path='languages/--LAN--_admin_banner.php' />
|
||||
<file type='install' path='languages/--LAN--_admin_banner.php' />
|
||||
|
Reference in New Issue
Block a user