diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php index ccecbf29c..3bb269faa 100644 --- a/e107_admin/plugin.php +++ b/e107_admin/plugin.php @@ -233,7 +233,7 @@ class pluginManager{ if($this->action == 'create') { - $pc = new pluginCreator; + $pc = new pluginBuilder; return; } @@ -1298,7 +1298,7 @@ function plugin_adminmenu() /** * Plugin Admin Generator by CaMer0n. //TODO Incorporate plugin.xml generation */ -class pluginCreator +class pluginBuilder { var $fields = array(); @@ -1311,10 +1311,19 @@ class pluginCreator $this->special['checkboxes'] = array('title'=> '','type' => null, 'data' => null, 'width'=>'5%', 'thclass' =>'center', 'forced'=> TRUE, 'class'=>'center', 'toggle' => 'e-multiselect', 'fieldpref'=>true); $this->special['options'] = array( 'title'=> LAN_OPTIONS, 'type' => null, 'data' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced'=>TRUE, 'fieldpref'=>true); + if($_GET['newplugin']) + { + $this->pluginName = $_GET['newplugin']; + } + if(vartrue($_POST['step']) == 3) { - return $this->step3(); + + $this->step3(); + + + return; } if(vartrue($_GET['newplugin']) && $_GET['step']==2) @@ -1357,8 +1366,43 @@ class pluginCreator "); $text = $frm->open('createPlugin','get'); - $text .= $frm->selectbox("newplugin",$newDir); - $text .= $frm->admin_button('step', 2,'other','Go'); + $text .= "
Select your plugin's folder | +".$frm->selectbox("newplugin",$newDir)." | +
Pasted MySql Dump Here | +".$frm->textarea('mysql','', 10,80)." + eg. | +
".var_export($data,true).""; + + + $data = file_get_contents(e_PLUGIN.$newplug."/".$newplug."_sql.php"); $ret = $dv->getTables($data); - $text = $frm->open('newplugin-step3','post', e_SELF.'?mode=create&step=3'); + $text = $frm->open('newplugin-step3','post', e_SELF.'?mode=create&newplugin='.$newplug.'&step=3'); $text .= "
$key |
+ ";
+ foreach($val as $type)
+ {
+ $nm = $key.'-'.$type;
+ $name = "xml[$nm]";
+ $size = (count($val)==1) ? 'span7' : 'span2';
+ $text .= " ".$this->xmlInput($name, $key."-". $type)." ";
+ }
+
+ $text .= " |
".htmlentities($result).""); + } + + + + function form($table,$fieldArray) @@ -1594,6 +1860,7 @@ class pluginCreator 'bbarea' => "Rich-Text Area", 'text' => "Text Box", "method" => "Custom Function", + "image" => "Image", "hidden" => "Hidden" ); break; @@ -1632,6 +1899,8 @@ class pluginCreator $ret['filter'] = false; break; + case 'start': + case 'end': case 'datestamp': $ret['title'] = 'LAN_DATESTAMP'; $ret['type'] = 'datestamp'; @@ -1643,6 +1912,7 @@ class pluginCreator case 'name': case 'title': case 'subject': + case 'summary': $ret['title'] = 'LAN_TITLE'; $ret['type'] = 'text'; $ret['batch'] = false; @@ -1657,6 +1927,8 @@ class pluginCreator $ret['filter'] = false; break; + case 'thumb': + case 'thumbnail': case 'image': $ret['title'] = 'LAN_IMAGE'; $ret['type'] = 'image'; @@ -1664,6 +1936,7 @@ class pluginCreator $ret['filter'] = false; break; + case 'total': case 'order': $ret['title'] = 'LAN_ORDER'; $ret['type'] = 'number'; @@ -1677,7 +1950,14 @@ class pluginCreator $ret['batch'] = true; $ret['filter'] = true; $ret['fieldpref'] = true; - + break; + + case 'type': + $ret['title'] = 'LAN_TYPE'; + $ret['type'] = 'dropdown'; + $ret['batch'] = true; + $ret['filter'] = true; + $ret['fieldpref'] = true; break; case 'icon': @@ -1754,7 +2034,16 @@ class pluginCreator function step3() { - unset($_POST['step']); + if($_POST['xml']) + { + $xmlText = $this->processXml($_POST['xml']); + } + + + + + + unset($_POST['step'],$_POST['xml']); $text .= "\n @@ -1994,9 +2283,13 @@ exit; { $mes->addError("Could not write to ".$generatedFile); } - - $ns->tablerender("Generated",$mes->render()."
".$text.""); + echo $mes->render(); + + $ns->tablerender(LAN_CREATED.": plugin.xml", "
".$xmlText.""); + + + $ns->tablerender(LAN_CREATED.": admin_config.php", "
".$text.""); // return;