aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include/functions_plugins.inc.php
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2008-03-02 18:56:05 +0000
committerpatdenice <patdenice@piwigo.org>2008-03-02 18:56:05 +0000
commit1283b5ecb1e5e01d9f2ebef555949ac517be89dd (patch)
treead8c1c347d50324989f1776e8a3a2c30a5c99478 /admin/include/functions_plugins.inc.php
parent78e175b3fb7c8d2f9824b15632595523f9ea236c (diff)
Corections to respect coding conventions.
Change plugins versions to 1.8 Change 3 plugins URI. git-svn-id: http://piwigo.org/svn/trunk@2243 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/include/functions_plugins.inc.php30
1 files changed, 21 insertions, 9 deletions
diff --git a/admin/include/functions_plugins.inc.php b/admin/include/functions_plugins.inc.php
index 25ad0dd65..9b59fdb0f 100644
--- a/admin/include/functions_plugins.inc.php
+++ b/admin/include/functions_plugins.inc.php
@@ -182,18 +182,24 @@ function extract_plugin_files($action, $source, $dest)
{
// we search main.inc.php in archive
if (basename($file['filename']) == 'main.inc.php'
- and (!isset($main_filepath) or strlen($file['filename']) < strlen($main_filepath)))
+ and (!isset($main_filepath)
+ or strlen($file['filename']) < strlen($main_filepath)))
{
$main_filepath = $file['filename'];
}
}
-
if (isset($main_filepath))
{
$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 . ($root == '.' ? 'extension_' . $dest : basename($root));
-
+ if ($action == 'upgrade')
+ {
+ $extract_path = PHPWG_PLUGINS_PATH.$dest;
+ }
+ else
+ {
+ $extract_path = PHPWG_PLUGINS_PATH
+ . ($root == '.' ? 'extension_' . $dest : basename($root));
+ }
if($result = $zip->extract(PCLZIP_OPT_PATH, $extract_path,
PCLZIP_OPT_REMOVE_PATH, $root,
PCLZIP_OPT_REPLACE_NEWER))
@@ -226,7 +232,7 @@ function extract_plugin_files($action, $source, $dest)
* delete $path directory
* @param string - path
*/
-function pm_deltree($path)
+function deltree($path)
{
if (is_dir($path))
{
@@ -236,8 +242,14 @@ function pm_deltree($path)
if ($file != '.' and $file != '..')
{
$pathfile = $path . '/' . $file;
- if (is_dir($pathfile)) pm_deltree($pathfile);
- else @unlink($pathfile);
+ if (is_dir($pathfile))
+ {
+ deltree($pathfile);
+ }
+ else
+ {
+ @unlink($pathfile);
+ }
}
}
closedir($fh);
@@ -250,7 +262,7 @@ function pm_deltree($path)
* send $path to trash directory
* @param string - path
*/
-function send_pm_trash($path)
+function send_to_trash($path)
{
$trash_path = PHPWG_PLUGINS_PATH . 'trash';
if (!is_dir($trash_path))