1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 06:07:32 +02:00

Adding support for plugins being allowed to be installed in multiple directories

This commit is contained in:
mcfly
2008-02-13 02:58:58 +00:00
parent 144d3e4297
commit 2b3ec398f6
3 changed files with 20 additions and 14 deletions

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_admin/plugin.php,v $ | $Source: /cvs_backup/e107_0.8/e107_admin/plugin.php,v $
| $Revision: 1.12 $ | $Revision: 1.13 $
| $Date: 2008-02-02 22:04:18 $ | $Date: 2008-02-13 02:58:58 $
| $Author: mcfly_e107 $ | $Author: mcfly_e107 $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -483,7 +483,7 @@ function render_plugs($pluginList)
if ($plug_vars['administration']['configFile'] && $plug['plugin_installflag'] == true) if ($plug_vars['administration']['configFile'] && $plug['plugin_installflag'] == true)
{ {
$conf_title = LAN_CONFIGURE.' '.$tp->toHtml($plug_vars['name'], "", "defs,emotes_off, no_make_clickable"); $conf_title = LAN_CONFIGURE.' '.$tp->toHtml($plug_vars['name'], "", "defs,emotes_off, no_make_clickable");
$plugin_icon = "<a title='{$conf_title}' href='".e_PLUGIN.$plug_vars['folder'].'/'.$plug_vars['administration']['configFile']."' >".$plugin_icon.'</a>'; $plugin_icon = "<a title='{$conf_title}' href='".e_PLUGIN.$plug['plugin_path'].'/'.$plug_vars['administration']['configFile']."' >".$plugin_icon.'</a>';
} }
$text .= " $text .= "
@@ -492,10 +492,11 @@ function render_plugs($pluginList)
<table style='width:100%'><tr><td style='text-align:left;width:40px;vertical-align:top'> <table style='width:100%'><tr><td style='text-align:left;width:40px;vertical-align:top'>
".$plugin_icon." ".$plugin_icon."
</td><td> </td><td>
$img <b>".$tp->toHTML($plug['plugin_name'], false, "defs,emotes_off, no_make_clickable")."</b><br />".EPL_ADLAN_11." {$plug['plugin_version']} $img <b>".$tp->toHTML($plug['plugin_name'], false, "defs,emotes_off, no_make_clickable")."</b><br /><b>".EPL_ADLAN_11."</b>&nbsp;{$plug['plugin_version']}
<br />"; <br /><br />
<b>".EPL_ADLAN_64."</b>&nbsp;".$plug['plugin_path']."
$text .="</td> <br />
</td>
</tr></table> </tr></table>
</td> </td>
<td class='forumheader3' style='vertical-align:top'> <td class='forumheader3' style='vertical-align:top'>
@@ -509,7 +510,7 @@ function render_plugs($pluginList)
<tr><td style='vertical-align:top'><b>".EPL_ADLAN_14."</b>:</td><td style='vertical-align:top'> {$plug_vars['description']}&nbsp;"; <tr><td style='vertical-align:top'><b>".EPL_ADLAN_14."</b>:</td><td style='vertical-align:top'> {$plug_vars['description']}&nbsp;";
if ($plug_vars['readme']) if ($plug_vars['readme'])
{ {
$text .= "[ <a href='".e_PLUGIN.$plug_vars['folder']."/".$plug_vars['readme']."'>".$plug_vars['readme']."</a> ]"; $text .= "[ <a href='".e_PLUGIN.$plug['plugin_path']."/".$plug_vars['readme']."'>".$plug_vars['readme']."</a> ]";
} }
$text .="</td></tr> $text .="</td></tr>

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
| $Revision: 1.32 $ | $Revision: 1.33 $
| $Date: 2008-02-13 00:56:00 $ | $Date: 2008-02-13 02:58:58 $
| $Author: mcfly_e107 $ | $Author: mcfly_e107 $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -593,6 +593,8 @@ class e107plugin
$txt = ''; $txt = '';
$path = e_PLUGIN.$plug['plugin_path'].'/'; $path = e_PLUGIN.$plug['plugin_path'].'/';
$_folder = strtolower(preg_replace("#![a-zA-Z0-9]#", '', $plug['plugin_path']));
//We'll just install using plugin.php file for now. //We'll just install using plugin.php file for now.
//return $this->install_plugin_php($path); //return $this->install_plugin_php($path);
@@ -639,6 +641,7 @@ class e107plugin
{ {
preg_match("/CREATE TABLE(.*?)\(/si", $sql_table, $match); preg_match("/CREATE TABLE(.*?)\(/si", $sql_table, $match);
$tablename = trim($match[1]); $tablename = trim($match[1]);
$tablename = str_replace("[folder]", $_folder, $tablename);
if($function == 'uninstall' && isset($_POST['delete_tables']) && $_POST['delete_tables']) if($function == 'uninstall' && isset($_POST['delete_tables']) && $_POST['delete_tables'])
{ {
@@ -648,6 +651,7 @@ class e107plugin
if($function == 'install') if($function == 'install')
{ {
$sql_table = preg_replace("/create table\s+/si", "CREATE TABLE ".MPREFIX, $sql_table); $sql_table = preg_replace("/create table\s+/si", "CREATE TABLE ".MPREFIX, $sql_table);
$sql_table = str_replace("[folder]", $_folder, $sql_table);
$txt .= "Adding table: {$tablename} ... "; $txt .= "Adding table: {$tablename} ... ";
$result = $this->manage_tables('add', array($sql_table)); $result = $this->manage_tables('add', array($sql_table));
$txt .= ($result ? "Success" : "Failed!")."<br />"; $txt .= ($result ? "Success" : "Failed!")."<br />";

View File

@@ -4,9 +4,9 @@
| e107 website system - Language File. | e107 website system - Language File.
| |
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_plugin.php,v $ | $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_plugin.php,v $
| $Revision: 1.3 $ | $Revision: 1.4 $
| $Date: 2007-05-07 13:38:34 $ | $Date: 2008-02-13 02:58:58 $
| $Author: e107steved $ | $Author: mcfly_e107 $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
define("EPL_ADLAN_0", "Install"); define("EPL_ADLAN_0", "Install");
@@ -84,6 +84,7 @@ define("EPL_ADLAN_60", "e107 will attempt to remove all plugin related files.");
// define("EPL_ADLAN_61", "Confirm uninstall"); // duplicated. can be deleted. // define("EPL_ADLAN_61", "Confirm uninstall"); // duplicated. can be deleted.
define("EPL_ADLAN_62", "Cancel uninstall"); define("EPL_ADLAN_62", "Cancel uninstall");
define("EPL_ADLAN_63", "Uninstall:"); define("EPL_ADLAN_63", "Uninstall:");
define("EPL_ADLAN_64", "Folder:");
define("LAN_UPGRADE_SUCCESSFUL", "Upgrade Successful"); define("LAN_UPGRADE_SUCCESSFUL", "Upgrade Successful");
define("LAN_INSTALL_SUCCESSFUL", "Installation Successful"); define("LAN_INSTALL_SUCCESSFUL", "Installation Successful");