diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php
index 2515b0c75..b9c622f1f 100644
--- a/e107_admin/plugin.php
+++ b/e107_admin/plugin.php
@@ -1536,11 +1536,59 @@ class pluginBuilder
'keywords' => array('one','two'),
'category' => array('category'),
'copyright' => array('copyright'),
- // 'languageFile' => array('type','path'),
// 'adminLinks' => array('url','description','icon','iconSmall','primary'),
// 'sitelinks' => array('url','description','icon','iconSmall')
);
+ // Load old plugin.php file if it exists;
+ $legacyFile = e_PLUGIN.$this->pluginName."/plugin.php";
+ if(file_exists($legacyFile))
+ {
+ require_once($legacyFile);
+ $mes = e107::getMessage();
+ $mes->addInfo("Loading plugin.php file");
+
+ $defaults = array(
+ "main-name" => $eplug_name,
+ "author-name" => $eplug_author,
+ "author-url" => $eplug_url,
+ "description-description" => $eplug_description,
+ "summary-summary" => $eplug_description
+ );
+
+ if(count($eplug_tables) && !file_exists(e_PLUGIN.$this->pluginName."/".$this->pluginName."_sql.php"))
+ {
+
+ $cont = '';
+ foreach($eplug_tables as $tab)
+ {
+ if(strpos($tab,"INSERT INTO")!==FALSE)
+ {
+ continue;
+ }
+
+ $cont .= "\n".str_replace("\t"," ",$tab);
+
+ }
+
+ if(file_put_contents(e_PLUGIN.$this->pluginName."/".$this->pluginName."_sql.php",$cont))
+ {
+ $mes->addInfo($this->pluginName."_sql.php as been generated",'default',true);
+ $red = e107::getRedirect();
+ $red->redirect(e_REQUEST_URL,true);
+ // $red->redirect(e_SELF."?mode=create&newplugin=".$this->pluginName."&createFiles=1&step=2",true);
+ }
+ else
+ {
+ $msg = $this->pluginName."_sql.php is missing!
";
+ $msg .= "Please create ".$this->pluginName."_sql.php in your plugin directory with the following content:
".$cont.""; + $mes->addWarning($msg); + } + + + } + } + $text = "