From 5dc8fbccb29169601ad5fed2b5289631e32e5ac5 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Tue, 14 Jun 2011 11:16:27 +0200 Subject: [PATCH] enable/disable plugins from admin page --- boot.php | 54 +++++++++++++++++++++++++++++------------------ images/icons.png | Bin 10126 -> 10702 bytes mod/admin.php | 53 +++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 85 insertions(+), 22 deletions(-) diff --git a/boot.php b/boot.php index 8edc749109..42b0ca41e6 100644 --- a/boot.php +++ b/boot.php @@ -453,6 +453,37 @@ function system_unavailable() { killme(); }} + +// install and uninstall plugin +if (! function_exists('uninstall_plugin')){ +function uninstall_plugin($plugin){ + logger("Addons: uninstalling " . $plugin); + q("DELETE FROM `addon` WHERE `name` = '%s' LIMIT 1", + dbesc($plugin) + ); + + @include_once('addon/' . $plugin . '/' . $plugin . '.php'); + if(function_exists($plugin . '_uninstall')) { + $func = $plugin . '_uninstall'; + $func(); + } +}} + +if (! function_exists('install_plugin')){ +function install_plugin($plugin){ + logger("Addons: installing " . $plugin); + $t = filemtime('addon/' . $plugin . '/' . $plugin . '.php'); + @include_once('addon/' . $plugin . '/' . $plugin . '.php'); + if(function_exists($plugin . '_install')) { + $func = $plugin . '_install'; + $func(); + $r = q("INSERT INTO `addon` (`name`, `installed`, `timestamp`) VALUES ( '%s', 1, %d ) ", + dbesc($plugin), + intval($t) + ); + } +}} + // Primarily involved with database upgrade, but also sets the // base url for use in cmdline programs which don't have // $_SERVER variables, and synchronising the state of installed plugins. @@ -538,16 +569,7 @@ function check_config(&$a) { if(count($installed)) { foreach($installed as $i) { if(! in_array($i['name'],$plugins_arr)) { - logger("Addons: uninstalling " . $i['name']); - q("DELETE FROM `addon` WHERE `id` = %d LIMIT 1", - intval($i['id']) - ); - - @include_once('addon/' . $i['name'] . '/' . $i['name'] . '.php'); - if(function_exists($i['name'] . '_uninstall')) { - $func = $i['name'] . '_uninstall'; - $func(); - } + uninstall_plugin($i['name']); } else $installed_arr[] = $i['name']; @@ -557,17 +579,7 @@ function check_config(&$a) { if(count($plugins_arr)) { foreach($plugins_arr as $p) { if(! in_array($p,$installed_arr)) { - logger("Addons: installing " . $p); - $t = filemtime('addon/' . $p . '/' . $p . '.php'); - @include_once('addon/' . $p . '/' . $p . '.php'); - if(function_exists($p . '_install')) { - $func = $p . '_install'; - $func(); - $r = q("INSERT INTO `addon` (`name`, `installed`, `timestamp`) VALUES ( '%s', 1, %d ) ", - dbesc($p), - intval($t) - ); - } + install_plugin($p); } } } diff --git a/images/icons.png b/images/icons.png index 4c4c00b8a5e2065d3c88408157b526bcdff06402..fee7781c84240db21d26cd62837a82fb0b99a1ea 100644 GIT binary patch literal 10702 zcmY*9Wl$VVu*cyLBm{SNINaSO96=6u4esvlu7MCd5Fog_yA#~q-Tm>s_v_W}%v5#F z)^zu_OiRQ!urvx1J`w-`K#`S^Q2tnRK86GW+{X-uFVyt0KshN(ivh~V2@n5+8Ocja z0N($5a@vZLJ|KwpGMY{R0P>gr1{5IUC+-Ij-dR>b5`GyD6@ihioZPGs03Zd(N{Fhu zFP&z2IAcPV8nchuYFtT8pkRP`a6q|0g0mdd@JQfRIYLIKKlv6PODu9RPfi{wWnhkP zP9Ui_W1fgar@shByvPCt1_I*Zj4q^YZJlIQlaC*!|Ivr$oYyDOdG%gx_OxjInYqEX z;6fz0%pdwY!DNE+u>}x?dYA}x6pp<_T#^)kfPz#wswJf@uRXb6WBhDn#O$M*_oMoK zlC{eG{WCEUU!^8rOGh>{;A!n$u4dxWPn64UkvtFxCfq>BJ386GK6uaUVtHNDO6vG!KuAE>W)JKaok42q%lT(MIKbmRNQzKn4_z zIO$Dt!Wlan<;lp%k_oaV6eK583+JqoK8ZnEcAA`Et3N?OQN|E07x-R{{vfxQF1QAg zT|b?PF){5voz%G8Wcys2R_$LnpqiSi{4VjXIpOcl1LaEZ#{y2C1fv>{?a(!s{cJ8) zA|i&!+xpiL5fLc?va&u@{=vN_N-m#dWM!Y^1Liz93_d}n2u~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d+x!{q&1HkXV402POo{)JV)B)p&OS%c@3RJsPH+h?9;TC>mD2FCcfH=u z*6PijaI^Hc_jiizo7dpEW$Z=w=kdVFU$=1ET|<~V;pQu}7y%-HHNeZ{rndZ#CvsC~ z5|>nscY%TeycjpSXxF6-AZ~Qge|8OBb~ctvi39fR`R^Fz!e6$0H@?O>T-X+YPo~@= wji0+iga#Wgy3^2LBexEGfKR4exy7~r4@YLQ`Wc{()&Kwi07*qoM6N<$f?*Ti{r~^~ diff --git a/mod/admin.php b/mod/admin.php index f9d248210d..054b49a211 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -310,7 +310,58 @@ function admin_page_users(&$a){ function admin_page_plugins(&$a){ - /* all plugins */ + /** + * Single plugin + */ + if ($a->argc == 3){ + $plugin = $a->argv[2]; + if (!is_file("addon/$plugin/$plugin.php")){ + notice( t("Item not found.") ); + return; + } + + if (x($_GET,"a") && $_GET['a']=="t"){ + // Toggle plugin status + $idx = array_search($plugin, $a->plugins); + if ($idx){ + unset($a->plugins[$idx]); + uninstall_plugin($plugin); + } else { + $a->plugins[] = $plugin; + install_plugin($plugin); + } + set_config("system","addon", implode(", ",$a->plugins)); + goaway($a->get_baseurl() . '/admin/plugins' ); + return; // NOTREACHED + } + // display plugin details + + + if (in_array($plugin, $a->plugins)){ + $status="on"; $action= t("Disable"); + } else { + $status="off"; $action= t("Enable"); + } + + $t = get_markup_template("admin_plugins_details.tpl"); + return replace_macros($t, array( + '$title' => t('Administration'), + '$page' => t('Plugins'), + '$toggle' => t('Toggle'), + '$baseurl' => $a->get_baseurl(), + + '$plugin' => $plugin, + '$status' => $status, + '$action' => $action + )); + } + + + + /** + * List plugins + */ + $plugins = array(); $files = glob("addon/*/"); if($files) {