#1467 Plugin download page general redesign

Implements the new general design (thanks to Clement's and Jule's mockup)
Allows the display or the hiding of non-compatible plugins
Add advanced filters in the page (harmonization with the advanced filters in the user manager)
Add the display of a screenshot, the rating and the tags for each plugins
Add Piwigo's Certification levels for each plugins
Add the file admin/themes/default/css/components/general.css to save css compnents that will be used in diffenrent places in the admin
This commit is contained in:
guetz
2021-10-09 11:48:18 +02:00
committed by Zacharie Guet
parent b28020818d
commit 0b51ba3720
20 changed files with 1336 additions and 402 deletions
+48 -12
View File
@@ -376,7 +376,7 @@ DELETE FROM '. PLUGINS_TABLE .'
}
// Retrieve PEM versions
function get_versions_to_check($version=PHPWG_VERSION)
function get_versions_to_check($beta_test=false, $version=PHPWG_VERSION)
{
global $conf;
@@ -384,30 +384,66 @@ DELETE FROM '. PLUGINS_TABLE .'
$url = PEM_URL . '/api/get_version_list.php?category_id='. $conf['pem_plugins_category'] .'&format=php';
if (fetchRemote($url, $result) and $pem_versions = @unserialize($result))
{
if (!preg_match('/^\d+\.\d+\.\d+$/', $version))
$i = 0;
// If the actual version exist, put the PEM id in $versions_to_check
while ($i < count($pem_versions) && count($versions_to_check) == 0)
{
$version = $pem_versions[0]['name'];
}
$branch = get_branch_from_version($version);
foreach ($pem_versions as $pem_version)
{
if (strpos($pem_version['name'], $branch) === 0)
if (get_branch_from_version($pem_versions[$i]['name']) == get_branch_from_version($version))
{
$versions_to_check[] = $pem_version['id'];
$versions_to_check[] = $pem_versions[$i]['id'];
}
$i++;
}
// If $beta_test is true, search the previous version
if ($beta_test)
{
// If the actual version is not in PEM, put the latest PEM version
if (count($versions_to_check) == 0)
{
$versions_to_check[] = $pem_versions[0]['id'];
}
else // Else search the next version in PEM
{
$has_found_previous_version = false;
while ($i < count($pem_versions) && !$has_found_previous_version)
{
if ($pem_versions[$i]['id'] != $versions_to_check[0])
{
$versions_to_check[] = $pem_versions[$i]['id'];
$has_found_previous_version = true;
}
$i++;
}
}
}
// if (!preg_match('/^\d+\.\d+\.\d+$/', $version))
// {
// $version = $pem_versions[0]['name'];
// }
// $branch = get_branch_from_version($version);
// foreach ($pem_versions as $pem_version)
// {
// if (strpos($pem_version['name'], $branch) === 0)
// {
// $versions_to_check[] = $pem_version['id'];
// }
// }
}
return $versions_to_check;
}
/**
* Retrieve PEM server datas to $server_plugins
* $beta_test parameter add plugins compatible with the previous version
*/
function get_server_plugins($new=false)
function get_server_plugins($new=false, $beta_test=false)
{
global $user, $conf;
$versions_to_check = $this->get_versions_to_check();
$versions_to_check = $this->get_versions_to_check($beta_test);
if (empty($versions_to_check))
{
return false;
@@ -424,7 +460,7 @@ DELETE FROM '. PLUGINS_TABLE .'
}
// Retrieve PEM plugins infos
$url = PEM_URL . '/api/get_revision_list.php';
$url = PEM_URL . '/api/get_revision_list-next.php';
$get_data = array(
'category_id' => $conf['pem_plugins_category'],
'format' => 'php',
+1 -1
View File
@@ -509,7 +509,7 @@ SELECT
}
// Retrieve PEM themes infos
$url = PEM_URL . '/api/get_revision_list.php';
$url = PEM_URL . '/api/get_revision_list-next.php';
$get_data = array_merge($get_data, array(
'last_revision_only' => 'true',
'version' => implode(',', $versions_to_check),