mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-05-09 01:35:52 +03:00
Enhance plugins administtration
git-svn-id: http://piwigo.org/svn/trunk@2242 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
fab44f72a8
commit
78e175b3fb
15 changed files with 6800 additions and 173 deletions
|
@ -107,4 +107,182 @@ function get_admin_plugin_menu_link($file)
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sort plugins by status
|
||||||
|
*/
|
||||||
|
function sort_plugins_by_state($plugins, $db_plugins_by_id)
|
||||||
|
{
|
||||||
|
$active_plugins = array();
|
||||||
|
$inactive_plugins = array();
|
||||||
|
$not_installed = array();
|
||||||
|
|
||||||
|
foreach($plugins as $plugin_id => $plugin)
|
||||||
|
{
|
||||||
|
if (isset($db_plugins_by_id[$plugin_id]))
|
||||||
|
{
|
||||||
|
$db_plugins_by_id[$plugin_id]['state'] == 'active' ?
|
||||||
|
$active_plugins[$plugin_id] = $plugin : $inactive_plugins[$plugin_id] = $plugin;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$not_installed[$plugin_id] = $plugin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $active_plugins + $inactive_plugins + $not_installed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve PEM server datas
|
||||||
|
* @param bool (true for retrieve new extensions)
|
||||||
|
*/
|
||||||
|
function check_server_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='))
|
||||||
|
{
|
||||||
|
list( , $extension) = explode('extension_view.php?eid=', $fs_plugin['uri']);
|
||||||
|
if (!is_numeric($extension)) continue;
|
||||||
|
$plugins_to_check[] = $extension;
|
||||||
|
$fs_plugins[$plugin_id]['extension'] = $extension;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$url = PEM_URL . '/uptodate.php?version=' . rawurlencode(PHPWG_VERSION) . '&extensions=' . implode(',', $plugins_to_check);
|
||||||
|
$url .= $newext ? '&newext=Plugin' : '';
|
||||||
|
|
||||||
|
if (!empty($plugins_to_check) and $source = @file_get_contents($url))
|
||||||
|
{
|
||||||
|
return @unserialize($source);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extract plugin files from archive
|
||||||
|
* @param string - install or upgrade
|
||||||
|
* @param string - archive URL
|
||||||
|
* @param string - destination path
|
||||||
|
*/
|
||||||
|
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))
|
||||||
|
{
|
||||||
|
$zip = new PclZip($archive);
|
||||||
|
if ($list = $zip->listContent())
|
||||||
|
{
|
||||||
|
foreach ($list as $file)
|
||||||
|
{
|
||||||
|
// 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)))
|
||||||
|
{
|
||||||
|
$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($result = $zip->extract(PCLZIP_OPT_PATH, $extract_path,
|
||||||
|
PCLZIP_OPT_REMOVE_PATH, $root,
|
||||||
|
PCLZIP_OPT_REPLACE_NEWER))
|
||||||
|
{
|
||||||
|
foreach ($result as $file)
|
||||||
|
{
|
||||||
|
if ($file['stored_filename'] == $main_filepath)
|
||||||
|
{
|
||||||
|
$status = $file['status'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else $status = 'extract_error';
|
||||||
|
}
|
||||||
|
else $status = 'archive_error';
|
||||||
|
}
|
||||||
|
else $status = 'archive_error';
|
||||||
|
}
|
||||||
|
else $status = 'dl_archive_error';
|
||||||
|
}
|
||||||
|
else $status = 'temp_path_error';
|
||||||
|
|
||||||
|
@unlink($archive);
|
||||||
|
return $status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* delete $path directory
|
||||||
|
* @param string - path
|
||||||
|
*/
|
||||||
|
function pm_deltree($path)
|
||||||
|
{
|
||||||
|
if (is_dir($path))
|
||||||
|
{
|
||||||
|
$fh = opendir($path);
|
||||||
|
while ($file = readdir($fh))
|
||||||
|
{
|
||||||
|
if ($file != '.' and $file != '..')
|
||||||
|
{
|
||||||
|
$pathfile = $path . '/' . $file;
|
||||||
|
if (is_dir($pathfile)) pm_deltree($pathfile);
|
||||||
|
else @unlink($pathfile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($fh);
|
||||||
|
return @rmdir($path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* send $path to trash directory
|
||||||
|
* @param string - path
|
||||||
|
*/
|
||||||
|
function send_pm_trash($path)
|
||||||
|
{
|
||||||
|
$trash_path = PHPWG_PLUGINS_PATH . 'trash';
|
||||||
|
if (!is_dir($trash_path))
|
||||||
|
{
|
||||||
|
@mkdir($trash_path);
|
||||||
|
$file = @fopen($trash_path . '/.htaccess', 'w');
|
||||||
|
@fwrite($file, 'deny from all');
|
||||||
|
@fclose($file);
|
||||||
|
}
|
||||||
|
while ($r = $trash_path . '/' . md5(uniqid(rand(), true)))
|
||||||
|
{
|
||||||
|
if (!is_dir($r))
|
||||||
|
{
|
||||||
|
@rename($path, $r);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sort functions
|
||||||
|
*/
|
||||||
|
function extension_name_compare($a, $b)
|
||||||
|
{
|
||||||
|
return strcmp(strtolower($a['ext_name']), strtolower($b['ext_name']));
|
||||||
|
}
|
||||||
|
function extension_author_compare($a, $b)
|
||||||
|
{
|
||||||
|
$r = strcmp(strtolower($a['author']), strtolower($b['author']));
|
||||||
|
if ($r == 0) return extension_name_compare($a, $b);
|
||||||
|
else return $r;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
5872
admin/include/pclzip.lib.php
Normal file
5872
admin/include/pclzip.lib.php
Normal file
File diff suppressed because it is too large
Load diff
|
@ -28,7 +28,7 @@ if( !defined("PHPWG_ROOT_PATH") )
|
||||||
die ("Hacking attempt!");
|
die ("Hacking attempt!");
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
|
include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
|
||||||
check_status(ACCESS_ADMINISTRATOR);
|
check_status(ACCESS_ADMINISTRATOR);
|
||||||
|
|
||||||
$my_base_url = PHPWG_ROOT_PATH.'admin.php?page=plugins';
|
$my_base_url = PHPWG_ROOT_PATH.'admin.php?page=plugins';
|
||||||
|
@ -37,13 +37,13 @@ $my_base_url = PHPWG_ROOT_PATH.'admin.php?page=plugins';
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | perform requested actions |
|
// | perform requested actions |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
if ( isset($_GET['action']) and isset($_GET['plugin']) and !is_adviser() )
|
if (isset($_GET['action']) and isset($_GET['plugin']) and !is_adviser())
|
||||||
{
|
{
|
||||||
$plugin_id = $_GET['plugin'];
|
$plugin_id = $_GET['plugin'];
|
||||||
$crt_db_plugin = get_db_plugins('', $plugin_id);
|
$crt_db_plugin = get_db_plugins('', $plugin_id);
|
||||||
if (!empty($crt_db_plugin))
|
if (!empty($crt_db_plugin))
|
||||||
{
|
{
|
||||||
$crt_db_plugin=$crt_db_plugin[0];
|
$crt_db_plugin = $crt_db_plugin[0];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -51,26 +51,26 @@ if ( isset($_GET['action']) and isset($_GET['plugin']) and !is_adviser() )
|
||||||
}
|
}
|
||||||
|
|
||||||
$errors = array();
|
$errors = array();
|
||||||
$file_to_include = PHPWG_PLUGINS_PATH.$plugin_id.'/maintain.inc.php';
|
$file_to_include = PHPWG_PLUGINS_PATH . $plugin_id . '/maintain.inc.php';
|
||||||
|
|
||||||
switch ( $_GET['action'] )
|
switch ($_GET['action'])
|
||||||
{
|
{
|
||||||
case 'install':
|
case 'install':
|
||||||
if ( !empty($crt_db_plugin))
|
if (!empty($crt_db_plugin))
|
||||||
{
|
{
|
||||||
array_push($errors, 'CANNOT install - ALREADY INSTALLED');
|
array_push($errors, 'CANNOT install - ALREADY INSTALLED');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$fs_plugins = get_fs_plugins();
|
$fs_plugins = get_fs_plugins();
|
||||||
if ( !isset( $fs_plugins[$plugin_id] ) )
|
if (!isset($fs_plugins[$plugin_id]))
|
||||||
{
|
{
|
||||||
array_push($errors, 'CANNOT install - NO SUCH PLUGIN');
|
array_push($errors, 'CANNOT install - NO SUCH PLUGIN');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ( file_exists($file_to_include) )
|
if (file_exists($file_to_include))
|
||||||
{
|
{
|
||||||
include_once($file_to_include);
|
include_once($file_to_include);
|
||||||
if ( function_exists('plugin_install') )
|
if (function_exists('plugin_install'))
|
||||||
{
|
{
|
||||||
plugin_install($plugin_id, $fs_plugins[$plugin_id]['version'], $errors);
|
plugin_install($plugin_id, $fs_plugins[$plugin_id]['version'], $errors);
|
||||||
}
|
}
|
||||||
|
@ -78,28 +78,28 @@ if ( isset($_GET['action']) and isset($_GET['plugin']) and !is_adviser() )
|
||||||
if (empty($errors))
|
if (empty($errors))
|
||||||
{
|
{
|
||||||
$query = '
|
$query = '
|
||||||
INSERT INTO '.PLUGINS_TABLE.' (id,version) VALUES ("'
|
INSERT INTO ' . PLUGINS_TABLE . ' (id,version) VALUES ("'
|
||||||
.$plugin_id.'","'.$fs_plugins[$plugin_id]['version'].'"
|
. $plugin_id . '","' . $fs_plugins[$plugin_id]['version'] . '"
|
||||||
)';
|
)';
|
||||||
pwg_query($query);
|
pwg_query($query);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'activate':
|
case 'activate':
|
||||||
if ( !isset($crt_db_plugin) )
|
if (!isset($crt_db_plugin))
|
||||||
{
|
{
|
||||||
array_push($errors, 'CANNOT '. $_GET['action'] .' - NOT INSTALLED');
|
array_push($errors, 'CANNOT ' . $_GET['action'] . ' - NOT INSTALLED');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ($crt_db_plugin['state']!='inactive')
|
if ($crt_db_plugin['state'] != 'inactive')
|
||||||
{
|
{
|
||||||
array_push($errors, 'invalid current state '.$crt_db_plugin['state']);
|
array_push($errors, 'invalid current state ' . $crt_db_plugin['state']);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ( file_exists($file_to_include) )
|
if (file_exists($file_to_include))
|
||||||
{
|
{
|
||||||
include_once($file_to_include);
|
include_once($file_to_include);
|
||||||
if ( function_exists('plugin_activate') )
|
if (function_exists('plugin_activate'))
|
||||||
{
|
{
|
||||||
plugin_activate($plugin_id, $crt_db_plugin['version'], $errors);
|
plugin_activate($plugin_id, $crt_db_plugin['version'], $errors);
|
||||||
}
|
}
|
||||||
|
@ -107,50 +107,66 @@ INSERT INTO '.PLUGINS_TABLE.' (id,version) VALUES ("'
|
||||||
if (empty($errors))
|
if (empty($errors))
|
||||||
{
|
{
|
||||||
$query = '
|
$query = '
|
||||||
UPDATE '.PLUGINS_TABLE.' SET state="active" WHERE id="'.$plugin_id.'"';
|
UPDATE ' . PLUGINS_TABLE . ' SET state="active" WHERE id="' . $plugin_id . '"';
|
||||||
pwg_query($query);
|
pwg_query($query);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'deactivate':
|
case 'deactivate':
|
||||||
if ( !isset($crt_db_plugin) )
|
if (!isset($crt_db_plugin))
|
||||||
{
|
{
|
||||||
die ('CANNOT '. $_GET['action'] .' - NOT INSTALLED');
|
die ('CANNOT ' . $_GET['action'] . ' - NOT INSTALLED');
|
||||||
}
|
}
|
||||||
if ($crt_db_plugin['state']!='active')
|
if ($crt_db_plugin['state'] != 'active')
|
||||||
{
|
{
|
||||||
die('invalid current state '.$crt_db_plugin['state']);
|
die('invalid current state ' . $crt_db_plugin['state']);
|
||||||
}
|
}
|
||||||
$query = '
|
$query = '
|
||||||
UPDATE '.PLUGINS_TABLE.' SET state="inactive" WHERE id="'.$plugin_id.'"';
|
UPDATE ' . PLUGINS_TABLE . ' SET state="inactive" WHERE id="' . $plugin_id . '"';
|
||||||
pwg_query($query);
|
pwg_query($query);
|
||||||
|
if (file_exists($file_to_include))
|
||||||
@include_once($file_to_include);
|
{
|
||||||
if ( function_exists('plugin_deactivate') )
|
include_once($file_to_include);
|
||||||
|
if (function_exists('plugin_deactivate'))
|
||||||
{
|
{
|
||||||
plugin_deactivate($plugin_id);
|
plugin_deactivate($plugin_id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'uninstall':
|
case 'uninstall':
|
||||||
if ( !isset($crt_db_plugin) )
|
if (!isset($crt_db_plugin))
|
||||||
{
|
{
|
||||||
die ('CANNOT '. $_GET['action'] .' - NOT INSTALLED');
|
die ('CANNOT ' . $_GET['action'] . ' - NOT INSTALLED');
|
||||||
}
|
}
|
||||||
$query = '
|
$query = '
|
||||||
DELETE FROM '.PLUGINS_TABLE.' WHERE id="'.$plugin_id.'"';
|
DELETE FROM ' . PLUGINS_TABLE . ' WHERE id="' . $plugin_id . '"';
|
||||||
pwg_query($query);
|
pwg_query($query);
|
||||||
|
if (file_exists($file_to_include))
|
||||||
@include_once($file_to_include);
|
{
|
||||||
if ( function_exists('plugin_uninstall') )
|
include_once($file_to_include);
|
||||||
|
if (function_exists('plugin_uninstall'))
|
||||||
{
|
{
|
||||||
plugin_uninstall($plugin_id);
|
plugin_uninstall($plugin_id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'delete':
|
||||||
|
if (!pm_deltree(PHPWG_PLUGINS_PATH . $plugin_id))
|
||||||
|
{
|
||||||
|
send_pm_trash(PHPWG_PLUGINS_PATH . $plugin_id);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (empty($errors))
|
if (empty($errors))
|
||||||
{
|
{
|
||||||
// do the redirection so that we allow the plugins to load/unload
|
$my_base_url .= isset($_GET['upgrade']) ?
|
||||||
|
'&plugin='.$plugin_id.'&upgrade='.$_GET['upgrade'].'&reactivate=true':'';
|
||||||
|
|
||||||
|
$my_base_url .= isset($_GET['upgradestatus']) ?
|
||||||
|
'&plugin='.$plugin_id.'&upgradestatus='.$_GET['upgradestatus']:'';
|
||||||
|
|
||||||
redirect($my_base_url);
|
redirect($my_base_url);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -160,112 +176,47 @@ DELETE FROM '.PLUGINS_TABLE.' WHERE id="'.$plugin_id.'"';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | Sections definitions |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
if (empty($_GET['section']))
|
||||||
|
{
|
||||||
|
$page['section'] = 'list';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$page['section'] = $_GET['section'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$tab_link = $my_base_url . '&section=';
|
||||||
|
|
||||||
|
// TabSheet
|
||||||
|
$tabsheet = new tabsheet();
|
||||||
|
// TabSheet initialization
|
||||||
|
$tabsheet->add('list', l10n('plugins_tab_list'), $tab_link.'list');
|
||||||
|
$tabsheet->add('update', l10n('plugins_tab_update'), $tab_link.'update');
|
||||||
|
$tabsheet->add('new', l10n('plugins_tab_new'), $tab_link.'new');
|
||||||
|
// TabSheet selection
|
||||||
|
$tabsheet->select($page['section']);
|
||||||
|
// Assign tabsheet to template
|
||||||
|
$tabsheet->assign();
|
||||||
|
|
||||||
|
$my_base_url .= '§ion=' . $page['section'];
|
||||||
|
|
||||||
|
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | start template output |
|
// | start template output |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
$fs_plugins = get_fs_plugins();
|
$fs_plugins = get_fs_plugins();
|
||||||
uasort($fs_plugins, 'name_compare');
|
uasort($fs_plugins, 'name_compare');
|
||||||
$db_plugins = get_db_plugins();
|
$db_plugins = get_db_plugins();
|
||||||
$db_plugins_by_id=array();
|
$db_plugins_by_id = array();
|
||||||
foreach ($db_plugins as $db_plugin)
|
foreach ($db_plugins as $db_plugin) {
|
||||||
{
|
|
||||||
$db_plugins_by_id[$db_plugin['id']] = $db_plugin;
|
$db_plugins_by_id[$db_plugin['id']] = $db_plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
include(PHPWG_ROOT_PATH.'admin/plugins_'.$page['section'].'.php');
|
||||||
$template->set_filenames(array('plugins' => 'admin/plugins.tpl'));
|
|
||||||
|
|
||||||
$num=0;
|
|
||||||
foreach( $fs_plugins as $plugin_id => $fs_plugin )
|
|
||||||
{
|
|
||||||
$display_name = $fs_plugin['name'];
|
|
||||||
if ( !empty($fs_plugin['uri']) )
|
|
||||||
{
|
|
||||||
$display_name='<a href="'.$fs_plugin['uri'].'">'.$display_name.'</a>';
|
|
||||||
}
|
|
||||||
$desc = $fs_plugin['description'];
|
|
||||||
if (!empty($fs_plugin['author']))
|
|
||||||
{
|
|
||||||
$desc.= ' (<em>';
|
|
||||||
if (!empty($fs_plugin['author uri']))
|
|
||||||
{
|
|
||||||
$desc.= '<a href="'.$fs_plugin['author uri'].'">'.$fs_plugin['author'].'</a>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$desc.= $fs_plugin['author'];
|
|
||||||
}
|
|
||||||
$desc.= '</em>)';
|
|
||||||
}
|
|
||||||
|
|
||||||
$tpl_plugin =
|
|
||||||
array(
|
|
||||||
'NAME' => $display_name,
|
|
||||||
'VERSION' => $fs_plugin['version'],
|
|
||||||
'DESCRIPTION' => $desc,
|
|
||||||
'actions' => array(),
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
$action_url = $my_base_url.'&plugin='.$plugin_id;
|
|
||||||
if ( isset($db_plugins_by_id[$plugin_id]) )
|
|
||||||
{ // already in the database
|
|
||||||
// MAYBE TODO HERE: check for the version and propose upgrade action
|
|
||||||
switch ($db_plugins_by_id[$plugin_id]['state'])
|
|
||||||
{
|
|
||||||
case 'active':
|
|
||||||
$tpl_plugin['actions'][] =
|
|
||||||
array(
|
|
||||||
'U_ACTION' => $action_url . '&action=deactivate',
|
|
||||||
'L_ACTION' => l10n('Deactivate'),
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case 'inactive':
|
|
||||||
$tpl_plugin['actions'][] =
|
|
||||||
array(
|
|
||||||
'U_ACTION' => $action_url . '&action=activate',
|
|
||||||
'L_ACTION' => l10n('Activate'),
|
|
||||||
);
|
|
||||||
$tpl_plugin['actions'][] =
|
|
||||||
array(
|
|
||||||
'U_ACTION' => $action_url . '&action=uninstall',
|
|
||||||
'L_ACTION' => l10n('Uninstall'),
|
|
||||||
'CONFIRM' => true,
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$tpl_plugin['actions'][] =
|
|
||||||
array(
|
|
||||||
'U_ACTION' => $action_url . '&action=install',
|
|
||||||
'L_ACTION' => l10n('Install'),
|
|
||||||
'CONFIRM' => true,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
$template->append('plugins', $tpl_plugin);
|
|
||||||
}
|
|
||||||
|
|
||||||
$missing_plugin_ids = array_diff(
|
|
||||||
array_keys($db_plugins_by_id), array_keys($fs_plugins)
|
|
||||||
);
|
|
||||||
foreach( $missing_plugin_ids as $plugin_id )
|
|
||||||
{
|
|
||||||
$action_url = $my_base_url.'&plugin='.$plugin_id;
|
|
||||||
|
|
||||||
$template->append( 'plugins',
|
|
||||||
array(
|
|
||||||
'NAME' => $plugin_id,
|
|
||||||
'VERSION' => $db_plugins_by_id[$plugin_id]['version'],
|
|
||||||
'DESCRIPTION' => "ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW !",
|
|
||||||
'actions' => array ( array (
|
|
||||||
'U_ACTION' => $action_url . '&action=uninstall',
|
|
||||||
'L_ACTION' => l10n('Uninstall'),
|
|
||||||
) )
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$template->assign_var_from_handle('ADMIN_CONTENT', 'plugins');
|
$template->assign_var_from_handle('ADMIN_CONTENT', 'plugins');
|
||||||
|
|
||||||
?>
|
?>
|
141
admin/plugins_list.php
Normal file
141
admin/plugins_list.php
Normal file
|
@ -0,0 +1,141 @@
|
||||||
|
<?php
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | PhpWebGallery - a PHP based picture gallery |
|
||||||
|
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | file : $Id$
|
||||||
|
// | last update : $Date$
|
||||||
|
// | last modifier : $Author$
|
||||||
|
// | revision : $Revision$
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | This program is free software; you can redistribute it and/or modify |
|
||||||
|
// | it under the terms of the GNU General Public License as published by |
|
||||||
|
// | the Free Software Foundation |
|
||||||
|
// | |
|
||||||
|
// | This program is distributed in the hope that it will be useful, but |
|
||||||
|
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
|
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
||||||
|
// | General Public License for more details. |
|
||||||
|
// | |
|
||||||
|
// | You should have received a copy of the GNU General Public License |
|
||||||
|
// | along with this program; if not, write to the Free Software |
|
||||||
|
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
|
||||||
|
// | USA. |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
|
||||||
|
if( !defined("PHPWG_ROOT_PATH") )
|
||||||
|
{
|
||||||
|
die ("Hacking attempt!");
|
||||||
|
}
|
||||||
|
|
||||||
|
$template->set_filenames(array('plugins' => 'admin/plugins_list.tpl'));
|
||||||
|
|
||||||
|
//----------------------------------------------------------------sort options
|
||||||
|
$order = isset($_GET['order']) ? $_GET['order'] : 'name';
|
||||||
|
|
||||||
|
$template->assign('order',
|
||||||
|
array(htmlentities($my_base_url.'&order=name') => l10n('Name'),
|
||||||
|
htmlentities($my_base_url.'&order=status') => l10n('Status')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$template->assign('selected', htmlentities($my_base_url.'&order=').$order);
|
||||||
|
|
||||||
|
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | start template output |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
|
||||||
|
if ($order == 'status')
|
||||||
|
{
|
||||||
|
$fs_plugins = sort_plugins_by_state($fs_plugins, $db_plugins_by_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($fs_plugins as $plugin_id => $fs_plugin)
|
||||||
|
{
|
||||||
|
$display_name = $fs_plugin['name'];
|
||||||
|
if (!empty($fs_plugin['uri']))
|
||||||
|
{
|
||||||
|
$display_name = '<a href="' . $fs_plugin['uri']
|
||||||
|
. '" onclick="window.open(this.href); return false;">'
|
||||||
|
. $display_name . '</a>';
|
||||||
|
}
|
||||||
|
$desc = $fs_plugin['description'];
|
||||||
|
if (!empty($fs_plugin['author']))
|
||||||
|
{
|
||||||
|
$desc .= ' (<em>';
|
||||||
|
if (!empty($fs_plugin['author uri']))
|
||||||
|
{
|
||||||
|
$desc .= '<a href="' . $fs_plugin['author uri'] . '">'
|
||||||
|
. $fs_plugin['author'] . '</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$desc .= $fs_plugin['author'];
|
||||||
|
}
|
||||||
|
$desc .= '</em>)';
|
||||||
|
}
|
||||||
|
$tpl_plugin =
|
||||||
|
array('NAME' => $display_name,
|
||||||
|
'VERSION' => $fs_plugin['version'],
|
||||||
|
'DESCRIPTION' => $desc);
|
||||||
|
|
||||||
|
$action_url = htmlentities($my_base_url) . '&plugin=' . $plugin_id;
|
||||||
|
|
||||||
|
if (isset($db_plugins_by_id[$plugin_id]))
|
||||||
|
{
|
||||||
|
switch ($db_plugins_by_id[$plugin_id]['state'])
|
||||||
|
{
|
||||||
|
case 'active':
|
||||||
|
$tpl_plugin['actions'][] =
|
||||||
|
array('U_ACTION' => $action_url . '&action=deactivate',
|
||||||
|
'L_ACTION' => l10n('Deactivate'));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'inactive':
|
||||||
|
$tpl_plugin['actions'][] =
|
||||||
|
array('U_ACTION' => $action_url . '&action=activate',
|
||||||
|
'L_ACTION' => l10n('Activate'));
|
||||||
|
$tpl_plugin['actions'][] =
|
||||||
|
array('U_ACTION' => $action_url . '&action=uninstall',
|
||||||
|
'L_ACTION' => l10n('Uninstall'),
|
||||||
|
'CONFIRM' => l10n('Are you sure?'));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tpl_plugin['actions'][] =
|
||||||
|
array('U_ACTION' => $action_url . '&action=install',
|
||||||
|
'L_ACTION' => l10n('Install'),
|
||||||
|
'CONFIRM' => l10n('Are you sure?'));
|
||||||
|
$tpl_plugin['actions'][] =
|
||||||
|
array('U_ACTION' => $action_url . '&action=delete',
|
||||||
|
'L_ACTION' => l10n('plugins_delete'),
|
||||||
|
'CONFIRM' => l10n('plugins_confirm_delete'));
|
||||||
|
}
|
||||||
|
$template->append('plugins', $tpl_plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
$missing_plugin_ids = array_diff(
|
||||||
|
array_keys($db_plugins_by_id), array_keys($fs_plugins)
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach($missing_plugin_ids as $plugin_id)
|
||||||
|
{
|
||||||
|
$action_url = $my_base_url.'&plugin='.$plugin_id;
|
||||||
|
|
||||||
|
$template->append( 'plugins',
|
||||||
|
array(
|
||||||
|
'NAME' => $plugin_id,
|
||||||
|
'VERSION' => $db_plugins_by_id[$plugin_id]['version'],
|
||||||
|
'DESCRIPTION' => "ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW !",
|
||||||
|
'actions' => array ( array (
|
||||||
|
'U_ACTION' => $action_url . '&action=uninstall',
|
||||||
|
'L_ACTION' => l10n('Uninstall'),
|
||||||
|
) )
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
132
admin/plugins_new.php
Normal file
132
admin/plugins_new.php
Normal file
|
@ -0,0 +1,132 @@
|
||||||
|
<?php
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | PhpWebGallery - a PHP based picture gallery |
|
||||||
|
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | file : $Id$
|
||||||
|
// | last update : $Date$
|
||||||
|
// | last modifier : $Author$
|
||||||
|
// | revision : $Revision$
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | This program is free software; you can redistribute it and/or modify |
|
||||||
|
// | it under the terms of the GNU General Public License as published by |
|
||||||
|
// | the Free Software Foundation |
|
||||||
|
// | |
|
||||||
|
// | This program is distributed in the hope that it will be useful, but |
|
||||||
|
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
|
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
||||||
|
// | General Public License for more details. |
|
||||||
|
// | |
|
||||||
|
// | You should have received a copy of the GNU General Public License |
|
||||||
|
// | along with this program; if not, write to the Free Software |
|
||||||
|
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
|
||||||
|
// | USA. |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
|
||||||
|
if( !defined("PHPWG_ROOT_PATH") )
|
||||||
|
{
|
||||||
|
die ("Hacking attempt!");
|
||||||
|
}
|
||||||
|
|
||||||
|
$template->set_filenames(array('plugins' => 'admin/plugins_new.tpl'));
|
||||||
|
|
||||||
|
|
||||||
|
//------------------------------------------------------automatic installation
|
||||||
|
if (isset($_GET['install']) and isset($_GET['extension']) and !is_adviser())
|
||||||
|
{
|
||||||
|
include(PHPWG_ROOT_PATH.'admin/include/pclzip.lib.php');
|
||||||
|
|
||||||
|
$install_status = extract_plugin_files('install',
|
||||||
|
$_GET['install'],
|
||||||
|
$_GET['extension']);
|
||||||
|
|
||||||
|
redirect($my_base_url . '&installstatus=' . $install_status);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------install result
|
||||||
|
if (isset($_GET['installstatus']))
|
||||||
|
{
|
||||||
|
switch ($_GET['installstatus'])
|
||||||
|
{
|
||||||
|
case 'ok':
|
||||||
|
array_push($page['infos'], l10n('plugins_install_ok'), l10n('plugins_install_need_activate'));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'temp_path_error':
|
||||||
|
array_push($page['errors'], l10n('plugins_temp_path_error'));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'dl_archive_error':
|
||||||
|
array_push($page['errors'], l10n('plugins_dl_archive_error'));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'archive_error':
|
||||||
|
array_push($page['errors'], l10n('plugins_archive_error'));
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
array_push($page['errors'], sprintf(l10n('plugins_extract_error'), $_GET['installstatus']), l10n('plugins_check_chmod'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------------------------------------sort options
|
||||||
|
$order = isset($_GET['order']) ? $_GET['order'] : 'date';
|
||||||
|
|
||||||
|
$template->assign('order',
|
||||||
|
array(htmlentities($my_base_url.'&order=date') => l10n('Post date'),
|
||||||
|
htmlentities($my_base_url.'&order=name') => l10n('Name'),
|
||||||
|
htmlentities($my_base_url.'&order=author') => l10n('Author')));
|
||||||
|
|
||||||
|
$template->assign('selected', htmlentities($my_base_url.'&order=').$order);
|
||||||
|
|
||||||
|
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | start template output |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
$plugins_infos = check_server_plugins(true);
|
||||||
|
if ($plugins_infos !== false)
|
||||||
|
{
|
||||||
|
if ($order == 'date') krsort($plugins_infos);
|
||||||
|
else uasort($plugins_infos, 'extension_'.$order.'_compare');
|
||||||
|
|
||||||
|
foreach($plugins_infos as $plugin)
|
||||||
|
{
|
||||||
|
$ext_desc = nl2br(htmlspecialchars(strip_tags(
|
||||||
|
utf8_encode($plugin['ext_description']))));
|
||||||
|
|
||||||
|
$ver_desc = sprintf(l10n('plugins_description'),
|
||||||
|
$plugin['version'],
|
||||||
|
date('Y-m-d', $plugin['date']),
|
||||||
|
nl2br(htmlspecialchars(strip_tags(
|
||||||
|
utf8_encode($plugin['description'])))));
|
||||||
|
|
||||||
|
$url_auto_install = htmlentities($my_base_url)
|
||||||
|
. '&extension=' . $plugin['id_extension']
|
||||||
|
. '&install=%2Fupload%2Fextension-' . $plugin['id_extension']
|
||||||
|
. '%2Frevision-' . $plugin['id_revision'] . '%2F'
|
||||||
|
. str_replace(' ', '%20',$plugin['url']);
|
||||||
|
|
||||||
|
$url_download = PEM_URL .'/upload/extension-'.$plugin['id_extension']
|
||||||
|
. '/revision-' . $plugin['id_revision']
|
||||||
|
. '/' . $plugin['url'];
|
||||||
|
|
||||||
|
$template->append('plugins',
|
||||||
|
array('EXT_NAME' => $plugin['ext_name'],
|
||||||
|
'EXT_URL' => PEM_URL.'/extension_view.php?eid='.$plugin['id_extension'],
|
||||||
|
'EXT_DESC' => $ext_desc,
|
||||||
|
'VERSION' => $plugin['version'],
|
||||||
|
'VERSION_URL' => PEM_URL.'/revision_view.php?rid='.$plugin['id_revision'],
|
||||||
|
'VER_DESC' => $ver_desc,
|
||||||
|
'AUTHOR' => $plugin['author'],
|
||||||
|
'URL_INSTALL' => $url_auto_install,
|
||||||
|
'URL_DOWNLOAD' => $url_download));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
array_push($page['errors'], l10n('plugins_server_error'));
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
158
admin/plugins_update.php
Normal file
158
admin/plugins_update.php
Normal file
|
@ -0,0 +1,158 @@
|
||||||
|
<?php
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | PhpWebGallery - a PHP based picture gallery |
|
||||||
|
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | file : $Id$
|
||||||
|
// | last update : $Date$
|
||||||
|
// | last modifier : $Author$
|
||||||
|
// | revision : $Revision$
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | This program is free software; you can redistribute it and/or modify |
|
||||||
|
// | it under the terms of the GNU General Public License as published by |
|
||||||
|
// | the Free Software Foundation |
|
||||||
|
// | |
|
||||||
|
// | This program is distributed in the hope that it will be useful, but |
|
||||||
|
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
|
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
||||||
|
// | General Public License for more details. |
|
||||||
|
// | |
|
||||||
|
// | You should have received a copy of the GNU General Public License |
|
||||||
|
// | along with this program; if not, write to the Free Software |
|
||||||
|
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
|
||||||
|
// | USA. |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
|
||||||
|
if( !defined("PHPWG_ROOT_PATH") )
|
||||||
|
{
|
||||||
|
die ("Hacking attempt!");
|
||||||
|
}
|
||||||
|
|
||||||
|
$template->set_filenames(array('plugins' => 'admin/plugins_update.tpl'));
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------automatic upgrade
|
||||||
|
if (isset($_GET['upgrade']) and isset($_GET['plugin']) and !is_adviser())
|
||||||
|
{
|
||||||
|
include(PHPWG_ROOT_PATH.'admin/include/pclzip.lib.php');
|
||||||
|
|
||||||
|
$upgrade_status = extract_plugin_files('upgrade',
|
||||||
|
$_GET['upgrade'],
|
||||||
|
$_GET['plugin']);
|
||||||
|
|
||||||
|
$my_base_url .= isset($_GET['reactivate']) ? '&action=activate' : '';
|
||||||
|
|
||||||
|
redirect($my_base_url.'&plugin='.$_GET['plugin'].'&upgradestatus='.$upgrade_status);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------upgrade result
|
||||||
|
if (isset($_GET['upgradestatus']) and isset($_GET['plugin']))
|
||||||
|
{
|
||||||
|
switch ($_GET['upgradestatus'])
|
||||||
|
{
|
||||||
|
case 'ok':
|
||||||
|
array_push($page['infos'],
|
||||||
|
sprintf(l10n('plugins_upgrade_ok'),
|
||||||
|
$fs_plugins[$_GET['plugin']]['name']));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'temp_path_error':
|
||||||
|
array_push($page['errors'], l10n('plugins_temp_path_error'));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'dl_archive_error':
|
||||||
|
array_push($page['errors'], l10n('plugins_dl_archive_error'));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'archive_error':
|
||||||
|
array_push($page['errors'], l10n('plugins_archive_error'));
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
array_push($page['errors'],
|
||||||
|
sprintf(l10n('plugins_extract_error'),
|
||||||
|
$_GET['upgradestatus']));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | start template output |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
$plugins_infos = check_server_plugins();
|
||||||
|
|
||||||
|
if ($plugins_infos !== false)
|
||||||
|
{
|
||||||
|
foreach($fs_plugins as $plugin_id => $fs_plugin)
|
||||||
|
{
|
||||||
|
if (isset($fs_plugin['extension'])
|
||||||
|
and isset($plugins_infos[$fs_plugin['extension']]))
|
||||||
|
{
|
||||||
|
$plugin_info = $plugins_infos[$fs_plugin['extension']];
|
||||||
|
|
||||||
|
$ext_desc = nl2br(htmlspecialchars(strip_tags(
|
||||||
|
utf8_encode($plugin_info['ext_description']))));
|
||||||
|
|
||||||
|
$ver_desc = sprintf(l10n('plugins_description'),
|
||||||
|
$plugin_info['version'],
|
||||||
|
date('Y-m-d', $plugin_info['date']),
|
||||||
|
nl2br(htmlspecialchars(strip_tags(
|
||||||
|
utf8_encode($plugin_info['description'])))));
|
||||||
|
|
||||||
|
if ($plugin_info['version'] == $fs_plugin['version'])
|
||||||
|
{
|
||||||
|
// Plugin is up to date
|
||||||
|
$template->append('plugins_uptodate',
|
||||||
|
array('URL' => $fs_plugin['uri'],
|
||||||
|
'NAME' => $fs_plugin['name'],
|
||||||
|
'EXT_DESC' => $ext_desc,
|
||||||
|
'VERSION' => $fs_plugin['version'],
|
||||||
|
'VER_DESC' => $ver_desc));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Plugin need upgrade
|
||||||
|
$url_auto_update = htmlentities($my_base_url)
|
||||||
|
. '&plugin=' . $plugin_id
|
||||||
|
. (
|
||||||
|
(isset($db_plugins_by_id[$plugin_id])
|
||||||
|
and $db_plugins_by_id[$plugin_id]['state'] == 'active'
|
||||||
|
and $plugin_id != PLUGINSMANAGER_DIR) ?
|
||||||
|
'&action=deactivate' : ''
|
||||||
|
)
|
||||||
|
. '&upgrade=%2Fupload%2Fextension-' . $fs_plugin['extension']
|
||||||
|
. '%2Frevision-' . $plugin_info['id_revision']
|
||||||
|
. '%2F' . $plugin_info['url'];
|
||||||
|
|
||||||
|
$url_download = PEM_URL.'/upload/extension-'. $fs_plugin['extension']
|
||||||
|
. '/revision-' . $plugin_info['id_revision']
|
||||||
|
. '/' . $plugin_info['url'];
|
||||||
|
|
||||||
|
$template->append('plugins_not_uptodate',
|
||||||
|
array('EXT_NAME' => $fs_plugin['name'],
|
||||||
|
'EXT_URL' => $fs_plugin['uri'],
|
||||||
|
'EXT_DESC' => $ext_desc,
|
||||||
|
'VERSION' => $fs_plugin['version'],
|
||||||
|
'VERSION_URL' => PEM_URL.'/revision_view.php?rid='.$plugin_info['id_revision'],
|
||||||
|
'NEW_VERSION' => $plugin_info['version'],
|
||||||
|
'NEW_VER_DESC' => $ver_desc,
|
||||||
|
'URL_UPDATE' => $url_auto_update,
|
||||||
|
'URL_DOWNLOAD' => $url_download));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Can't check plugin
|
||||||
|
$template->append('plugins_cant_check',
|
||||||
|
array('NAME' => $fs_plugin['name'],
|
||||||
|
'VERSION' => $fs_plugin['version']));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
array_push($page['errors'], l10n('plugins_server_error'));
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
|
@ -28,6 +28,7 @@
|
||||||
define('PHPWG_VERSION', 'Butterfly');
|
define('PHPWG_VERSION', 'Butterfly');
|
||||||
define('PHPWG_DOMAIN', 'phpwebgallery.net');
|
define('PHPWG_DOMAIN', 'phpwebgallery.net');
|
||||||
define('PHPWG_URL', 'http://www.'.PHPWG_DOMAIN);
|
define('PHPWG_URL', 'http://www.'.PHPWG_DOMAIN);
|
||||||
|
define('PEM_URL', PHPWG_URL . '/ext');
|
||||||
define('PHPWG_DEFAULT_LANGUAGE', 'en_UK');
|
define('PHPWG_DEFAULT_LANGUAGE', 'en_UK');
|
||||||
define('PHPWG_DEFAULT_TEMPLATE', 'yoga/clear');
|
define('PHPWG_DEFAULT_TEMPLATE', 'yoga/clear');
|
||||||
|
|
||||||
|
|
|
@ -659,4 +659,30 @@ $lang['c13y_ignore_msg2'] = 'Correction the anomaly will cancel the fact that it
|
||||||
$lang['c13y_anomaly_ignored_count'] = '%d anomaly has been ignored.';
|
$lang['c13y_anomaly_ignored_count'] = '%d anomaly has been ignored.';
|
||||||
$lang['c13y_anomalies_ignored_count'] = '%d anomalies has been ignored.';
|
$lang['c13y_anomalies_ignored_count'] = '%d anomalies has been ignored.';
|
||||||
|
|
||||||
|
$lang['plugins_need_update'] = 'Plugins which need upgrade';
|
||||||
|
$lang['plugins_dontneed_update'] = 'Plugins up to date';
|
||||||
|
$lang['plugins_cant_check'] = 'Plugin versions can\'t be checked';
|
||||||
|
$lang['plugins_actual_version'] = 'Current<br>version';
|
||||||
|
$lang['plugins_new_version'] = 'Available<br>version';
|
||||||
|
$lang['plugins_auto_update'] = 'Automatic upgrade';
|
||||||
|
$lang['plugins_auto_install'] = 'Automatic installation';
|
||||||
|
$lang['plugins_download'] = 'Download file';
|
||||||
|
$lang['plugins_description'] = '<b>Version:</b> %s<br><br><b>Date:</b> %s<br><br>%s';
|
||||||
|
$lang['plugins_tab_list'] = 'Plugins list';
|
||||||
|
$lang['plugins_tab_update'] = 'Check for updates';
|
||||||
|
$lang['plugins_tab_new'] = 'Other plugins';
|
||||||
|
$lang['plugins_delete'] = 'Delete';
|
||||||
|
$lang['plugins_confirm_delete'] = 'Are you sure you want to delete this plugin?';
|
||||||
|
$lang['plugins_confirm_install'] = 'Are you sure you want to install this plugin?';
|
||||||
|
$lang['plugins_confirm_upgrade'] = 'Are you sur to install this upgrade? You must verify if this version does not need uninstallation.';
|
||||||
|
$lang['plugins_upgrade_ok'] = '%s has been successfully upgraded.';
|
||||||
|
$lang['plugins_install_ok'] = 'Plugin has been successfully copied';
|
||||||
|
$lang['plugins_install_need_activate'] = 'You might go to plugin list to install and activate it.';
|
||||||
|
$lang['plugins_temp_path_error'] = 'Can\'t create temporary file.';
|
||||||
|
$lang['plugins_dl_archive_error'] = 'Can\'t download archive.';
|
||||||
|
$lang['plugins_archive_error'] = 'Can\'t read or extract archive.';
|
||||||
|
$lang['plugins_extract_error'] = 'An error occured during extraction (%s).';
|
||||||
|
$lang['plugins_check_chmod'] = 'Please check "plugins" folder and sub-folders permissions (CHMOD).';
|
||||||
|
$lang['plugins_server_error'] = 'Can\'t connect to server.';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -661,4 +661,30 @@ $lang['c13y_ignore_msg2'] = 'La correction de l\'anomalie annulera le fait qu\'e
|
||||||
$lang['c13y_anomaly_ignored_count'] = '%d anomalie a été ignorée.';
|
$lang['c13y_anomaly_ignored_count'] = '%d anomalie a été ignorée.';
|
||||||
$lang['c13y_anomalies_ignored_count'] = '%d anomalies ont été ignorées.';
|
$lang['c13y_anomalies_ignored_count'] = '%d anomalies ont été ignorées.';
|
||||||
|
|
||||||
|
$lang['plugins_need_update'] = 'Plugins necessitant une mise à jour';
|
||||||
|
$lang['plugins_dontneed_update'] = 'Plugins à jour';
|
||||||
|
$lang['plugins_cant_check'] = 'Impossible de vérifier les plugins suivant';
|
||||||
|
$lang['plugins_actual_version'] = 'Version<br>actuelle';
|
||||||
|
$lang['plugins_new_version'] = 'Version<br>disponible';
|
||||||
|
$lang['plugins_auto_update'] = 'Mise à jour automatique';
|
||||||
|
$lang['plugins_auto_install'] = 'Installation automatique';
|
||||||
|
$lang['plugins_download'] = 'Télécharger le fichier';
|
||||||
|
$lang['plugins_description'] = '<b>Version:</b> %s<br><br><b>Date:</b> %s<br><br>%s';
|
||||||
|
$lang['plugins_tab_list'] = 'Liste des plugins';
|
||||||
|
$lang['plugins_tab_update'] = 'Vérifier les mises à jour';
|
||||||
|
$lang['plugins_tab_new'] = 'Autres plugins disponibles';
|
||||||
|
$lang['plugins_delete'] = 'Supprimer';
|
||||||
|
$lang['plugins_confirm_install'] = 'Etes-vous sûr de vouloir installer ce plugin?';
|
||||||
|
$lang['plugins_confirm_delete'] = 'Etes-vous sûr de vouloir supprimer ce plugin?';
|
||||||
|
$lang['plugins_confirm_upgrade'] = 'Etes-vous sur de vouloir installer cette mise à jour? Vous devez vérifiez que cette mise à jour ne nécessite pas de désinstallation.';
|
||||||
|
$lang['plugins_upgrade_ok'] = '%s a été mis à jour avec succès.';
|
||||||
|
$lang['plugins_install_ok'] = 'Le plugin a été copié avec succès.';
|
||||||
|
$lang['plugins_install_need_activate'] = 'Rendez-vous dans la liste des plugins pour l\'installer et l\'activer.';
|
||||||
|
$lang['plugins_temp_path_error'] = 'Impossible de créer un fichier temporaire.';
|
||||||
|
$lang['plugins_dl_archive_error'] = 'Impossible de récupérer l\'archive.';
|
||||||
|
$lang['plugins_archive_error'] = 'Impossible de lire ou d\'extraire l\'archive.';
|
||||||
|
$lang['plugins_extract_error'] = 'Une erreur est survenue pendant l\'extraction des fichiers (%s).';
|
||||||
|
$lang['plugins_check_chmod'] = 'Vérifiez les permissions du dossier "plugins" et de ses sous-dossiers (CHMOD).';
|
||||||
|
$lang['plugins_server_error'] = 'Impossible de se connecter au serveur.';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -49,3 +49,34 @@ BODY#theAdminPage #content {
|
||||||
display: block; /* display: none; if you don't want legend */
|
display: block; /* display: none; if you don't want legend */
|
||||||
height: 4em; /* legend height (don't set auto to be Gecko friendly)*/
|
height: 4em; /* legend height (don't set auto to be Gecko friendly)*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Tooltips*/
|
||||||
|
.tooltip {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tooltip span {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tooltip:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
z-index: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tooltip:hover span {
|
||||||
|
display: inline;
|
||||||
|
position: absolute;
|
||||||
|
top: 30px;
|
||||||
|
left: -50px;
|
||||||
|
width: 400px;
|
||||||
|
|
||||||
|
font-size: 11px;
|
||||||
|
text-decoration: none;
|
||||||
|
text-align: justify;
|
||||||
|
background-color: #FFFFCC;
|
||||||
|
color: #444444;
|
||||||
|
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid Black;
|
||||||
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ TABLE.table2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
TABLE.table2 TD, TABLE.table2 TH {
|
TABLE.table2 TD, TABLE.table2 TH {
|
||||||
padding: 0 1em;
|
padding: 4px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
TABLE.table2 TR {
|
TABLE.table2 TR {
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
{* $Id$ *}
|
|
||||||
|
|
||||||
<div class="titrePage">
|
|
||||||
<h2>{'Plugins'|@translate}
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{if isset($plugins) }
|
|
||||||
<table class="table2">
|
|
||||||
<thead><tr class="throw">
|
|
||||||
<td>{'Name'|@translate}</td>
|
|
||||||
<td>{'Version'|@translate}</td>
|
|
||||||
<td>{'Description'|@translate}</td>
|
|
||||||
<td>{'Actions'|@translate}</td>
|
|
||||||
</tr></thead>
|
|
||||||
{foreach from=$plugins item=plugin name=plugins_loop}
|
|
||||||
<tr class="{if $smarty.foreach.plugins_loop.index is odd}row1{else}row2{/if}">
|
|
||||||
<td>{$plugin.NAME}</td>
|
|
||||||
<td>{$plugin.VERSION}</td>
|
|
||||||
<td>{$plugin.DESCRIPTION}</td>
|
|
||||||
<td>
|
|
||||||
{foreach from=$plugin.actions item=action}
|
|
||||||
<a href="{$action.U_ACTION}"
|
|
||||||
{if isset($action.CONFIRM) }
|
|
||||||
onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');"
|
|
||||||
{/if}
|
|
||||||
{$TAG_INPUT_ENABLED}>{$action.L_ACTION}</a>
|
|
||||||
{/foreach}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{/foreach}
|
|
||||||
</table>
|
|
||||||
{/if}
|
|
38
template/yoga/admin/plugins_list.tpl
Normal file
38
template/yoga/admin/plugins_list.tpl
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
<div class="titrePage">
|
||||||
|
<h2>{'Plugins'|@translate}</h2>
|
||||||
|
{$TABSHEET}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{'Sort order'|@translate} :
|
||||||
|
<select onchange="document.location = this.options[this.selectedIndex].value;" style="width:100px">
|
||||||
|
{html_options options=$order selected=$selected}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
{if isset($plugins)}
|
||||||
|
<table class="table2">
|
||||||
|
<thead>
|
||||||
|
<tr class="throw">
|
||||||
|
<td>{'Name'|@translate}</td>
|
||||||
|
<td>{'Version'|@translate}</td>
|
||||||
|
<td>{'Description'|@translate}</td>
|
||||||
|
<td>{'Actions'|@translate}</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
{foreach from=$plugins item=plugin name=plugins_loop}
|
||||||
|
<tr class="{if $smarty.foreach.plugins_loop.index is odd}row1{else}row2{/if}">
|
||||||
|
<td>{$plugin.NAME}</td>
|
||||||
|
<td>{$plugin.VERSION}</td>
|
||||||
|
<td>{$plugin.DESCRIPTION}</td>
|
||||||
|
<td>
|
||||||
|
{foreach from=$plugin.actions item=action}
|
||||||
|
<a href="{$action.U_ACTION}"
|
||||||
|
{if isset($action.CONFIRM)}
|
||||||
|
onclick="return confirm('{$action.CONFIRM|@escape:javascript}');"
|
||||||
|
{/if}
|
||||||
|
{$TAG_INPUT_ENABLED}>{$action.L_ACTION}</a>
|
||||||
|
{/foreach}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
</table>
|
||||||
|
{/if}
|
35
template/yoga/admin/plugins_new.tpl
Normal file
35
template/yoga/admin/plugins_new.tpl
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<div class="titrePage">
|
||||||
|
<h2>{'Plugins'|@translate}</h2>
|
||||||
|
{$TABSHEET}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{'Sort order'|@translate} :
|
||||||
|
<select onchange="document.location = this.options[this.selectedIndex].value;" style="width:120px">
|
||||||
|
{html_options options=$order selected=$selected}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
{if isset($plugins)}
|
||||||
|
<br>
|
||||||
|
<table class="table2">
|
||||||
|
<thead>
|
||||||
|
<tr class="throw">
|
||||||
|
<td>{'Name'|@translate}</td>
|
||||||
|
<td>{'Version'|@translate}</td>
|
||||||
|
<td>{'Author'|@translate}</td>
|
||||||
|
<td>{'Actions'|@translate}</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
{foreach from=$plugins item=plugin name=plugins_loop}
|
||||||
|
<tr class="{if $smarty.foreach.plugins_loop.index is odd}row1{else}row2{/if}">
|
||||||
|
<td><a href="{$plugin.EXT_URL}" onclick="window.open(this.href); return false;" class="tooltip">{$plugin.EXT_NAME}
|
||||||
|
<span>{$plugin.EXT_DESC}</span></a></td>
|
||||||
|
<td style="text-align:center;"><a href="{$plugin.VERSION_URL}" onclick="window.open(this.href); return false;" class="tooltip">{$plugin.VERSION}
|
||||||
|
<span>{$plugin.VER_DESC}</span></a></td>
|
||||||
|
<td>{$plugin.AUTHOR}</td>
|
||||||
|
<td style="text-align:center;"><a href="{$plugin.URL_INSTALL}" onclick="return confirm('{'plugins_confirm_install'|@translate|@escape:javascript}');">{'plugins_auto_install'|@translate}</a>
|
||||||
|
/ <a href="{$plugin.URL_DOWNLOAD}">{'plugins_download'|@translate}</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
</table>
|
||||||
|
{/if}
|
71
template/yoga/admin/plugins_update.tpl
Normal file
71
template/yoga/admin/plugins_update.tpl
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
<div class="titrePage">
|
||||||
|
<h2>{'Plugins'|@translate}</h2>
|
||||||
|
{$TABSHEET}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{if isset($plugins_not_uptodate)}
|
||||||
|
<br>
|
||||||
|
<b>{'plugins_need_update'|@translate}</b>
|
||||||
|
<table class="table2">
|
||||||
|
<thead>
|
||||||
|
<tr class="throw">
|
||||||
|
<td>{'Name'|@translate}</td>
|
||||||
|
<td>{'plugins_actual_version'|@translate}</td>
|
||||||
|
<td>{'plugins_new_version'|@translate}</td>
|
||||||
|
<td>{'plugins_action'|@translate}</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
{foreach from=$plugins_not_uptodate item=plugin name=plugins_loop}
|
||||||
|
<tr class="{if $smarty.foreach.plugins_loop.index is odd}row1{else}row2{/if}">
|
||||||
|
<td><a href="{$plugin.EXT_URL}" onclick="window.open(this.href); return false;" class="tooltip">{$plugin.EXT_NAME}
|
||||||
|
<span>{$plugin.EXT_DESC}</span></a></td>
|
||||||
|
<td style="text-align:center;">{$plugin.VERSION}</td>
|
||||||
|
<td style="text-align:center;"><a href="{$plugin.VERSION_URL}" onclick="window.open(this.href); return false;" class="tooltip">{$plugin.NEW_VERSION}
|
||||||
|
<span>{$plugin.NEW_VER_DESC}</span></a></td>
|
||||||
|
<td style="text-align:center;"><a href="{$plugin.URL_UPDATE}" onclick="return confirm('{'plugins_confirm_upgrade'|@translate|@escape:javascript}');">{'plugins_auto_update'|@translate}</a>
|
||||||
|
/ <a href="{$plugin.URL_DOWNLOAD}">{'plugins_download'|@translate}</a></td>
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
</table>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
|
||||||
|
{if isset($plugins_uptodate)}
|
||||||
|
<br>
|
||||||
|
<b>{'plugins_dontneed_update'|@translate}</b>
|
||||||
|
<table class="table2">
|
||||||
|
<thead>
|
||||||
|
<tr class="throw">
|
||||||
|
<td>{'Name'|@translate}</td>
|
||||||
|
<td>{'Version'|@translate}</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
{foreach from=$plugins_uptodate item=plugin name=plugins_loop}
|
||||||
|
<tr class="{if $smarty.foreach.plugins_loop.index is odd}row1{else}row2{/if}">
|
||||||
|
<td><a href="{$plugin.URL}" onclick="window.open(this.href); return false;" class="tooltip">{$plugin.NAME}
|
||||||
|
<span>{$plugin.EXT_DESC}</span></a></td>
|
||||||
|
<td style="text-align:center;"><span class="tooltip">{$plugin.VERSION}<span>{$plugin.VER_DESC}</span></span></td>
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
</table>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
|
||||||
|
{if isset($plugins_cant_check)}
|
||||||
|
<br>
|
||||||
|
<b>{'plugins_cant_check'|@translate}</b>
|
||||||
|
<table class="table2">
|
||||||
|
<thead>
|
||||||
|
<tr class="throw">
|
||||||
|
<td>{'Name'|@translate}</td>
|
||||||
|
<td>{'Version'|@translate}</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
{foreach from=$plugins_cant_check item=plugin name=plugins_loop}
|
||||||
|
<tr class="{if $smarty.foreach.plugins_loop.index is odd}row1{else}row2{/if}">
|
||||||
|
<td> {$plugin.NAME} </td>
|
||||||
|
<td style="text-align:center;">{$plugin.VERSION}</td>
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
</table>
|
||||||
|
{/if}
|
Loading…
Add table
Add a link
Reference in a new issue