mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 11:50:30 +02:00
db pref editor fix and icon-pool uninstall option added.
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
* Administration - Database Utilities
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_admin/db.php,v $
|
||||
* $Revision: 1.35 $
|
||||
* $Date: 2009-09-26 18:08:14 $
|
||||
* $Revision: 1.36 $
|
||||
* $Date: 2009-09-28 07:17:51 $
|
||||
* $Author: e107coders $
|
||||
*
|
||||
*/
|
||||
@@ -201,7 +201,7 @@ class system_tools
|
||||
|
||||
$deleted_list = "";
|
||||
|
||||
$config = ($mode == 'core') ? e107::getConfig('core') : e107::getPlugConfig($mode);
|
||||
$config = ($mode == 'core' || $mode='') ? e107::getConfig('core') : e107::getPlugConfig($mode);
|
||||
|
||||
// Single Pref Deletion using button
|
||||
if(varset($_POST['delpref']))
|
||||
@@ -506,7 +506,7 @@ class system_tools
|
||||
* Preferences Editor
|
||||
* @return
|
||||
*/
|
||||
private function pref_editor($type='')
|
||||
private function pref_editor($type='core')
|
||||
{
|
||||
//TODO Add drop-down filter for editing plugin prefs also.
|
||||
|
||||
@@ -579,7 +579,7 @@ class system_tools
|
||||
<div class='buttons-bar center'>
|
||||
".$frm->admin_button('delpref_checked', DBLAN_21, 'delete')."
|
||||
".$frm->admin_button('back', DBLAN_13, 'back')."
|
||||
<input type='hidden' name='pref_type' value='".$_GET['type']."' />
|
||||
<input type='hidden' name='pref_type' value='".$type."' />
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>\n\n";
|
||||
|
@@ -9,9 +9,9 @@
|
||||
* Image Administration Area
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_admin/image.php,v $
|
||||
* $Revision: 1.22 $
|
||||
* $Date: 2009-08-28 16:11:01 $
|
||||
* $Author: marj_nl_fr $
|
||||
* $Revision: 1.23 $
|
||||
* $Date: 2009-09-28 07:17:52 $
|
||||
* $Author: e107coders $
|
||||
*
|
||||
*/
|
||||
require_once("../class2.php");
|
||||
@@ -661,6 +661,10 @@ if(!e_AJAX_REQUEST) require_once("footer.php");
|
||||
function icon_editor()
|
||||
{
|
||||
global $iconpool, $e107, $emessage, $frm, $tp;
|
||||
|
||||
$ns = e107::getRender();
|
||||
$tp = e107::getParser();
|
||||
|
||||
ksort($iconpool);
|
||||
|
||||
$text = "
|
||||
@@ -734,7 +738,7 @@ function icon_editor()
|
||||
|
||||
";
|
||||
//$text .= "<div style='text-align:center'><a href='".e_SELF."'>".DBLAN_13."</a></div>\n";
|
||||
$e107->ns->tablerender(LAN_IMAGEMANAGER." :: ".IMALAN_71, $emessage->render().$text);
|
||||
$ns->tablerender(LAN_IMAGEMANAGER." :: ".IMALAN_71, $emessage->render().$text);
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
@@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_admin/plugin.php,v $
|
||||
| $Revision: 1.47 $
|
||||
| $Date: 2009-09-25 02:02:38 $
|
||||
| $Revision: 1.48 $
|
||||
| $Date: 2009-09-28 07:17:52 $
|
||||
| $Author: e107coders $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@@ -217,7 +217,8 @@ class pluginManager{
|
||||
$options = array(
|
||||
'del_tables' => varset($_POST['delete_tables'],FALSE),
|
||||
'del_userclasses' => varset($_POST['delete_userclasses'],FALSE),
|
||||
'del_extended' => varset($_POST['delete_xfields'],FALSE)
|
||||
'del_extended' => varset($_POST['delete_xfields'],FALSE),
|
||||
'del_ipool' => varset($_POST['delete_ipool'],FALSE)
|
||||
);
|
||||
$text .= $plugin->manage_plugin_xml($this->id, 'uninstall', $options);
|
||||
}
|
||||
@@ -621,6 +622,8 @@ class pluginManager{
|
||||
{
|
||||
global $plugin,$frm;
|
||||
|
||||
//TODO 'install' checkbox in plugin upload form. (as it is for theme upload)
|
||||
|
||||
/* plugin upload form */
|
||||
|
||||
if(!is_writable(e_PLUGIN))
|
||||
@@ -733,10 +736,12 @@ class pluginManager{
|
||||
|
||||
function pluginRenderPlugin($pluginList)
|
||||
{
|
||||
global $tp, $plugin, $frm;
|
||||
global $plugin, $frm;
|
||||
|
||||
if (empty($pluginList)) return '';
|
||||
|
||||
$tp = e107::getParser();
|
||||
|
||||
|
||||
$text = "";
|
||||
|
||||
@@ -880,7 +885,9 @@ class pluginManager{
|
||||
|
||||
function pluginConfirmUninstall()
|
||||
{
|
||||
global $plugin, $tp;
|
||||
global $plugin, $frm;
|
||||
$tp = e107::getParser();
|
||||
|
||||
$plug = $plugin->getinfo($this->id);
|
||||
|
||||
if ($plug['plugin_installflag'] == true )
|
||||
@@ -931,12 +938,7 @@ class pluginManager{
|
||||
|
||||
if(is_writable(e_PLUGIN.$plug['plugin_path']))
|
||||
{
|
||||
$del_text = "
|
||||
<select class='tbox' name='delete_files'>
|
||||
<option value='0'>".LAN_NO."</option>
|
||||
<option value='1'>".LAN_YES."</option>
|
||||
</select>
|
||||
";
|
||||
$del_text = $frm->selectbox('delete_files','yesno',0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -956,32 +958,22 @@ class pluginManager{
|
||||
<col class='col-control' />
|
||||
</colgroup>
|
||||
<tr>
|
||||
<td>".EPL_ADLAN_55."</td>
|
||||
<td>".LAN_YES."</td>
|
||||
<td>".EPL_ADLAN_55."</td>
|
||||
<td>".LAN_YES."</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
".EPL_ADLAN_57."<div class='smalltext'>".EPL_ADLAN_58."</div>
|
||||
</td>
|
||||
<td>
|
||||
<select class='tbox' name='delete_tables'>
|
||||
<option value='1'>".LAN_YES."</option>
|
||||
<option value='0'>".LAN_NO."</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>".EPL_ADLAN_57."</td>
|
||||
<td>".$frm->selectbox('delete_tables','yesno',1)."
|
||||
<div class='field-help'>".EPL_ADLAN_58."</div>
|
||||
</td>
|
||||
</tr>";
|
||||
|
||||
if ($userclasses)
|
||||
{
|
||||
$text .= " <tr>
|
||||
<td>
|
||||
".EPL_ADLAN_78."<div class='indent'>".$userclasses."</div><div class='smalltext'>".EPL_ADLAN_79."</div>
|
||||
</td>
|
||||
<td>
|
||||
<select class='tbox' name='delete_userclasses'>
|
||||
<option value='1'>".LAN_YES."</option>
|
||||
<option value='0'>".LAN_NO."</option>
|
||||
</select>
|
||||
<td>".EPL_ADLAN_78."<div class='indent'>".$userclasses."</div></td>
|
||||
<td>".$frm->selectbox('delete_userclasses','yesno',1)."
|
||||
<div class='field-help'>".EPL_ADLAN_79."</div>
|
||||
</td>
|
||||
</tr>";
|
||||
}
|
||||
@@ -990,20 +982,30 @@ class pluginManager{
|
||||
{
|
||||
$text .= " <tr>
|
||||
<td>
|
||||
".EPL_ADLAN_80."<div class='indent'>".$eufields."</div><div class='smalltext'>".EPL_ADLAN_79."</div>
|
||||
</td>
|
||||
<td>
|
||||
<select class='tbox' name='delete_xfields'>
|
||||
<option value='1'>".LAN_YES."</option>
|
||||
<option value='0'>".LAN_NO."</option>
|
||||
</select>
|
||||
".EPL_ADLAN_80."<div class='indent'>".$eufields."</div>
|
||||
</td>
|
||||
<td>".$frm->selectbox('delete_xfields','yesno',0)."
|
||||
<div class='field-help'>".EPL_ADLAN_79."</div></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
if(e107::getConfig('ipool')->getPref('plugin-'.$plug['plugin_path']))
|
||||
{
|
||||
$text .= "<tr>
|
||||
<td>Remove icons from icon-pool<div class='indent'>".$eufields."</div>
|
||||
</td>
|
||||
<td>".$frm->selectbox('delete_ipool','yesno',1)."
|
||||
<div class='field-help'>".EPL_ADLAN_79."</div></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$text .="<tr>
|
||||
<td>".EPL_ADLAN_59."<div class='smalltext'>".EPL_ADLAN_60."</div></td>
|
||||
<td>{$del_text}</td>
|
||||
<td>".EPL_ADLAN_59."</td>
|
||||
<td>{$del_text}
|
||||
<div class='field-help'>".EPL_ADLAN_60."</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class='buttons-bar center'>";
|
||||
|
@@ -9,8 +9,8 @@
|
||||
* Form Handler
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $
|
||||
* $Revision: 1.45 $
|
||||
* $Date: 2009-09-25 02:02:38 $
|
||||
* $Revision: 1.46 $
|
||||
* $Date: 2009-09-28 07:17:52 $
|
||||
* $Author: e107coders $
|
||||
*
|
||||
*/
|
||||
@@ -308,6 +308,10 @@ class e_form
|
||||
|
||||
function selectbox($name, $option_array, $selected = false, $options = array())
|
||||
{
|
||||
if($option_array == 'yesno')
|
||||
{
|
||||
$option_array = array(1=>LAN_YES,0=>LAN_NO);
|
||||
}
|
||||
return $this->select_open($name, $options)."\n".$this->option_multi($option_array, $selected)."\n".$this->select_close();
|
||||
}
|
||||
|
||||
|
@@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
|
||||
| $Revision: 1.98 $
|
||||
| $Date: 2009-09-26 16:54:09 $
|
||||
| $Revision: 1.99 $
|
||||
| $Date: 2009-09-28 07:17:52 $
|
||||
| $Author: e107coders $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@@ -294,13 +294,28 @@ class e107plugin
|
||||
}
|
||||
}
|
||||
|
||||
function manage_icons($plugin='')
|
||||
function manage_icons($plugin='',$function='')
|
||||
{
|
||||
global $iconpool,$pref;
|
||||
|
||||
|
||||
$emessage = eMessage::getInstance();
|
||||
$sql = e107::getDb();
|
||||
$tp = e107::getParser();
|
||||
$fl = e107::getFile();
|
||||
|
||||
if($plugin && ($function == 'uninstall') )
|
||||
{
|
||||
if(vartrue($this->unInstallOpts['del_ipool'], FALSE))
|
||||
{
|
||||
$ipool_entry = 'plugin-'.$plugin;
|
||||
e107::getConfig('ipool')->remove($ipool_entry); // FIXME - ipool removal issue.
|
||||
$status = (e107::getConfig('ipool')->save(FALSE)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
|
||||
$emessage->add('Removing Icon-Pool entry: '.$ipool_entry, $status);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$query = "SELECT * FROM #plugin WHERE plugin_installflag =0 ORDER BY plugin_path ASC";
|
||||
$sql->db_Select_gen($query);
|
||||
@@ -950,7 +965,7 @@ class e107plugin
|
||||
$tableList = $dbHandler->get_table_def('',$path.$sqlFile);
|
||||
if (!is_array($tableList))
|
||||
{
|
||||
$error[] = 'Can\'t read SQL definition: '.$path.$sqlFile;
|
||||
$emessage->add("Can\'t read SQL definition: ".$path.$sqlFile,E_MESSAGE_ERROR);
|
||||
break;
|
||||
}
|
||||
// Got the required definition here
|
||||
@@ -960,9 +975,9 @@ class e107plugin
|
||||
{
|
||||
case 'install' :
|
||||
$sqlTable = str_replace("CREATE TABLE ".MPREFIX.'`', "CREATE TABLE `".MPREFIX, preg_replace("/create table\s+/si", "CREATE TABLE ".MPREFIX, $ct[0]));
|
||||
$txt .= "Adding table: {$ct[1]} ... ";
|
||||
$result = $this->manage_tables('add', array($sqlTable)); // Pass the statement to create the table
|
||||
$txt .= ($result ? "Success" : "Failed!").'<br />';
|
||||
$txt = "Adding table: {$ct[1]} ... ";
|
||||
$status = $this->manage_tables('add', array($sqlTable)) ? E_MESSAGE_SUCCESS: E_MESSAGE_ERROR; // Pass the statement to create the table
|
||||
$emessage->add($txt,$status);
|
||||
break;
|
||||
case 'upgrade' :
|
||||
$tmp = $dbHandler->update_table_structure($ct,FALSE,TRUE, $pref['multilanguage']);
|
||||
@@ -980,12 +995,13 @@ class e107plugin
|
||||
case 'uninstall' :
|
||||
if (varsettrue($options['del_tables'], FALSE))
|
||||
{
|
||||
$txt .= "Removing table {$ct[1]} <br />";
|
||||
$this->manage_tables('remove', array($ct[1])); // Delete the table
|
||||
$txt = "Removing table {$ct[1]} <br />";
|
||||
$status = $this->manage_tables('remove', array($ct[1])) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR; // Delete the table
|
||||
$emessage->add($txt,$status);
|
||||
}
|
||||
else
|
||||
{
|
||||
$txt .= "Table {$ct[1]} left in place<br />";
|
||||
{
|
||||
$emessage->add("Table {$ct[1]} left in place.",E_MESSAGE_SUCCESS);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1023,6 +1039,9 @@ class e107plugin
|
||||
$this->XmlLogLanguageFile($function,$plug_vars['logLanguageFile']);
|
||||
}
|
||||
|
||||
$this->manage_icons($this->plugFolder,$function);
|
||||
|
||||
|
||||
//FIXME
|
||||
//If any commentIDs are configured, we need to remove all comments on uninstall
|
||||
if($function == 'uninstall' && isset($plug_vars['commentID']))
|
||||
|
Reference in New Issue
Block a user