mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 21:57:51 +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:
@@ -2339,6 +2339,8 @@ class pluginBuilder
|
||||
$text .= $this->pluginXml();
|
||||
$text .= "</div>";
|
||||
|
||||
if(!empty($ret['tables']))
|
||||
{
|
||||
foreach($ret['tables'] as $key=>$table)
|
||||
{
|
||||
$text .= "<div class='tab-pane' id='".$table."'>\n";
|
||||
@@ -2346,13 +2348,16 @@ class pluginBuilder
|
||||
$text .= $this->form($table,$fields);
|
||||
$text .= "</div>";
|
||||
}
|
||||
|
||||
}
|
||||
$text .= "<div class='tab-pane' id='preferences'>\n";
|
||||
$text .= $this->prefs();
|
||||
$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>";
|
||||
|
||||
@@ -3283,15 +3288,16 @@ class ".$thePlugin."_adminArea extends e_admin_dispatcher
|
||||
|
||||
unset($_POST['newplugin']);
|
||||
|
||||
|
||||
foreach($_POST as $table => $vars) // LOOP Through Tables.
|
||||
{
|
||||
if(vartrue($vars['mode']) && $vars['mode'] != 'exclude')
|
||||
{
|
||||
$text .= "
|
||||
'".$vars['mode']."' => array(
|
||||
'controller' => '".$vars['table']."_ui',
|
||||
'controller' => '".$table."',
|
||||
'path' => null,
|
||||
'ui' => '".$vars['table']."_form_ui',
|
||||
'ui' => '".str_replace("_ui", "_form_ui", $table)."',
|
||||
'uipath' => null
|
||||
),
|
||||
|
||||
@@ -3316,7 +3322,7 @@ $text .= "
|
||||
";
|
||||
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 .= "
|
||||
'".$vars['mode']."/list' => array('caption'=> LAN_MANAGE, 'perm' => 'P'),
|
||||
@@ -3446,6 +3452,7 @@ class ".$table." extends e_admin_ui
|
||||
if($_POST['pluginPrefs'] && ($vars['mode']=='main'))
|
||||
{
|
||||
$text .= "
|
||||
// protected \$preftabs = array('General', 'Other' );
|
||||
protected \$prefs = array(\n";
|
||||
|
||||
foreach($_POST['pluginPrefs'] as $k=>$val)
|
||||
@@ -3455,7 +3462,7 @@ if($_POST['pluginPrefs'] && ($vars['mode']=='main'))
|
||||
$index = $val['index'];
|
||||
$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