aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-03-03 12:50:54 +0000
committerrvelices <rv-github@modusoptimus.com>2008-03-03 12:50:54 +0000
commit7688a7cbb6c4906f70d87b56cd6e90d028e99666 (patch)
treee197ac0fef76f918e100ae1e45c582309d3e99d8 /admin/include
parent14bfa8a3e6e5fa81fa3eba565a1b696840f351cd (diff)
- history, stats and redirect go smarty
- lang correction - small change in calling check_server_plugins (use by ref param instead of global) git-svn-id: http://piwigo.org/svn/trunk@2245 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/include')
-rw-r--r--admin/include/functions_plugins.inc.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/admin/include/functions_plugins.inc.php b/admin/include/functions_plugins.inc.php
index 9b59fdb0f..b51a22fd2 100644
--- a/admin/include/functions_plugins.inc.php
+++ b/admin/include/functions_plugins.inc.php
@@ -136,10 +136,8 @@ function sort_plugins_by_state($plugins, $db_plugins_by_id)
* Retrieve PEM server datas
* @param bool (true for retrieve new extensions)
*/
-function check_server_plugins($newext=false)
+function check_server_plugins(& $fs_plugins, $newext=false)
{
- global $fs_plugins;
-
foreach($fs_plugins as $plugin_id => $fs_plugin)
{
if (!empty($fs_plugin['uri']) and strpos($fs_plugin['uri'] , 'extension_view.php?eid='))
@@ -150,7 +148,7 @@ function check_server_plugins($newext=false)
$fs_plugins[$plugin_id]['extension'] = $extension;
}
}
-
+
$url = PEM_URL . '/uptodate.php?version=' . rawurlencode(PHPWG_VERSION) . '&extensions=' . implode(',', $plugins_to_check);
$url .= $newext ? '&newext=Plugin' : '';
@@ -170,7 +168,6 @@ function check_server_plugins($newext=false)
*/
function extract_plugin_files($action, $source, $dest)
{
- global $archive;
if ($archive = tempnam( PHPWG_PLUGINS_PATH, 'zip'))
{
if (@copy(PEM_URL . str_replace(' ', '%20', $source), $archive))
@@ -192,12 +189,12 @@ function extract_plugin_files($action, $source, $dest)
{
$root = dirname($main_filepath); // main.inc.php path in archive
if ($action == 'upgrade')
- {
+ {
$extract_path = PHPWG_PLUGINS_PATH.$dest;
}
else
{
- $extract_path = PHPWG_PLUGINS_PATH
+ $extract_path = PHPWG_PLUGINS_PATH
. ($root == '.' ? 'extension_' . $dest : basename($root));
}
if($result = $zip->extract(PCLZIP_OPT_PATH, $extract_path,
@@ -222,7 +219,7 @@ function extract_plugin_files($action, $source, $dest)
else $status = 'dl_archive_error';
}
else $status = 'temp_path_error';
-
+
@unlink($archive);
return $status;
}