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 .= " + + + + + + + + + "; + + /* NOT a good idea - requires the use of $_POST which would prevent browser 'go Back' navigation. + if(e_DOMAIN == FALSE) // localhost. + { + $text .= " + + + "; + } + */ + + + $text .= " +
Select your plugin's folder".$frm->selectbox("newplugin",$newDir)."
Pasted MySql Dump Here".$frm->textarea('mysql','', 10,80)." + eg.
+
+ ".$frm->admin_button('step', 2,'other','Go')." +
"; + + + + + + + + + $text .= $frm->close(); $ns->tablerender("Plugin Builder", $mes->render() . $text); @@ -1366,6 +1410,17 @@ class pluginCreator } + function enterMysql() + { + + $frm = e107::getForm(); + return "
".$frm->textarea('mysql','', 10,80)."
"; + + } + + + + function step2() { @@ -1379,11 +1434,19 @@ class pluginCreator $newplug = $_GET['newplugin']; $this->pluginName = $newplug; + + + // $data = e107::getXml()->loadXMLfile(e_PLUGIN.'links_page/plugin.xml', 'advanced'); + // print_a($data); + // echo "
".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 .= "
\n"; $text .= "