mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 05:37:32 +02:00
Fixes #1045 - Plugin Builder now functions correctly in generating admin_config.php for plugins which use only preferences (no plugin tables).
This commit is contained in:
@@ -2338,22 +2338,27 @@ class pluginBuilder
|
|||||||
$text .= "<div class='tab-pane active' id='xml'>\n";
|
$text .= "<div class='tab-pane active' id='xml'>\n";
|
||||||
$text .= $this->pluginXml();
|
$text .= $this->pluginXml();
|
||||||
$text .= "</div>";
|
$text .= "</div>";
|
||||||
|
|
||||||
foreach($ret['tables'] as $key=>$table)
|
if(!empty($ret['tables']))
|
||||||
{
|
{
|
||||||
$text .= "<div class='tab-pane' id='".$table."'>\n";
|
foreach($ret['tables'] as $key=>$table)
|
||||||
$fields = $dv->getFields($ret['data'][$key]);
|
{
|
||||||
$text .= $this->form($table,$fields);
|
$text .= "<div class='tab-pane' id='".$table."'>\n";
|
||||||
$text .= "</div>";
|
$fields = $dv->getFields($ret['data'][$key]);
|
||||||
|
$text .= $this->form($table,$fields);
|
||||||
|
$text .= "</div>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= "<div class='tab-pane' id='preferences'>\n";
|
$text .= "<div class='tab-pane' id='preferences'>\n";
|
||||||
$text .= $this->prefs();
|
$text .= $this->prefs();
|
||||||
$text .= "</div>";
|
$text .= "</div>";
|
||||||
|
|
||||||
|
if(empty($ret['tables']))
|
||||||
|
{
|
||||||
|
$text .= $frm->hidden($this->pluginName.'_ui[mode]','main');
|
||||||
|
$text .= $frm->hidden($this->pluginName.'_ui[pluginName]', $this->pluginName);
|
||||||
|
}
|
||||||
|
|
||||||
$text .= "</div>";
|
$text .= "</div>";
|
||||||
|
|
||||||
$text .= "
|
$text .= "
|
||||||
@@ -2837,7 +2842,7 @@ TEMPLATE;
|
|||||||
{
|
{
|
||||||
$text .= $frm->hidden($this->table.'[mode]','main');
|
$text .= $frm->hidden($this->table.'[mode]','main');
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= "</table>".$this->special('checkboxes');
|
$text .= "</table>".$this->special('checkboxes');
|
||||||
|
|
||||||
$text .= "<table class='table adminlist'>
|
$text .= "<table class='table adminlist'>
|
||||||
@@ -3282,6 +3287,7 @@ class ".$thePlugin."_adminArea extends e_admin_dispatcher
|
|||||||
|
|
||||||
|
|
||||||
unset($_POST['newplugin']);
|
unset($_POST['newplugin']);
|
||||||
|
|
||||||
|
|
||||||
foreach($_POST as $table => $vars) // LOOP Through Tables.
|
foreach($_POST as $table => $vars) // LOOP Through Tables.
|
||||||
{
|
{
|
||||||
@@ -3289,9 +3295,9 @@ class ".$thePlugin."_adminArea extends e_admin_dispatcher
|
|||||||
{
|
{
|
||||||
$text .= "
|
$text .= "
|
||||||
'".$vars['mode']."' => array(
|
'".$vars['mode']."' => array(
|
||||||
'controller' => '".$vars['table']."_ui',
|
'controller' => '".$table."',
|
||||||
'path' => null,
|
'path' => null,
|
||||||
'ui' => '".$vars['table']."_form_ui',
|
'ui' => '".str_replace("_ui", "_form_ui", $table)."',
|
||||||
'uipath' => null
|
'uipath' => null
|
||||||
),
|
),
|
||||||
|
|
||||||
@@ -3316,7 +3322,7 @@ $text .= "
|
|||||||
";
|
";
|
||||||
foreach($_POST as $table => $vars) // LOOP Through Tables.
|
foreach($_POST as $table => $vars) // LOOP Through Tables.
|
||||||
{
|
{
|
||||||
if(vartrue($vars['mode']) && $vars['mode'] != 'exclude')
|
if(vartrue($vars['mode']) && $vars['mode'] != 'exclude' && !empty($vars['table']))
|
||||||
{
|
{
|
||||||
$text .= "
|
$text .= "
|
||||||
'".$vars['mode']."/list' => array('caption'=> LAN_MANAGE, 'perm' => 'P'),
|
'".$vars['mode']."/list' => array('caption'=> LAN_MANAGE, 'perm' => 'P'),
|
||||||
@@ -3445,7 +3451,8 @@ class ".$table." extends e_admin_ui
|
|||||||
|
|
||||||
if($_POST['pluginPrefs'] && ($vars['mode']=='main'))
|
if($_POST['pluginPrefs'] && ($vars['mode']=='main'))
|
||||||
{
|
{
|
||||||
$text .= "
|
$text .= "
|
||||||
|
// protected \$preftabs = array('General', 'Other' );
|
||||||
protected \$prefs = array(\n";
|
protected \$prefs = array(\n";
|
||||||
|
|
||||||
foreach($_POST['pluginPrefs'] as $k=>$val)
|
foreach($_POST['pluginPrefs'] as $k=>$val)
|
||||||
@@ -3455,7 +3462,7 @@ if($_POST['pluginPrefs'] && ($vars['mode']=='main'))
|
|||||||
$index = $val['index'];
|
$index = $val['index'];
|
||||||
$type = vartrue($val['type'],'text');
|
$type = vartrue($val['type'],'text');
|
||||||
|
|
||||||
$text .= "\t\t\t'".$index."'\t\t=> array('title'=> '".ucfirst($index)."', 'type'=>'".$type."', 'data' => 'str','help'=>'Help Text goes here'),\n";
|
$text .= "\t\t\t'".$index."'\t\t=> array('title'=> '".ucfirst($index)."', 'tab'=>0, 'type'=>'".$type."', 'data' => 'str', 'help'=>'Help Text goes here'),\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3539,7 +3546,7 @@ $text .= "
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ".$vars['table']."_form_ui extends e_admin_form_ui
|
class ".str_replace("_ui", "_form_ui", $table)." extends e_admin_form_ui
|
||||||
{
|
{
|
||||||
";
|
";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user