Skip to content

Commit

Permalink
Debug v22
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 3, 2025
1 parent fc0cbc5 commit a3fd9b7
Show file tree
Hide file tree
Showing 3 changed files with 238 additions and 262 deletions.
44 changes: 33 additions & 11 deletions htdocs/admin/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@
$options['search_source_github'] = 1;
}

//$remotestore = new Dolistore(false);
$remotestore = new ExternalModules();
//$remotestore = new Dolistore(false);
$remotestore = new ExternalModules();
$remotestore->loadRemoteSources();


if (!$user->admin) {
accessforbidden();
Expand Down Expand Up @@ -484,7 +486,6 @@




/*
* View
*/
Expand Down Expand Up @@ -1264,6 +1265,8 @@

print '<br>';

print '<!-- summary of sources -->';

// Marketplace and community modules
print '<div class="div-table-responsive-no-min">';
print '<table summary="list_of_modules" class="noborder centpercent">'."\n";
Expand All @@ -1277,19 +1280,38 @@
// Marketplace
print '<tr class="oddeven">'."\n";
$url = 'https://www.dolistore.com';
print '<td class="hideonsmartphone"><a href="'.$url.'" target="_blank" rel="noopener noreferrer external"><img border="0" class="imgautosize imgmaxwidth180" src="'.DOL_URL_ROOT.'/theme/dolistore_logo.png"></a></td>';
print '<td class="hideonsmartphone center"><a href="'.$url.'" target="_blank" rel="noopener noreferrer external"><img border="0" class="imgautosize imgmaxwidth180" src="'.DOL_URL_ROOT.'/theme/dolistore_logo.svg"></a></td>';
print '<td><span class="opacitymedium">'.$langs->trans("DoliStoreDesc").'</span></td>';
print '<td><a href="'.$url.'" target="_blank" rel="noopener noreferrer external">'.$url.'</a></td>';
print '<td>' . $remotestore->libStatut($remotestore->dolistoreApiStatus).'</td>';
print '<td>'.img_picto('', 'url', 'class="pictofixedwidth"').'<a href="'.$url.'" target="_blank" rel="noopener noreferrer external">'.$url.'</a></td>';
print '<td>';
if (!getDolGlobalString('MAIN_DISABLE_DOLISTORE_SEARCH') && getDolGlobalInt('MAIN_ENABLE_DOLISTORE')) {
$messagetoadd = '';
if ($remotestore->dolistoreApiStatus <= 0) {
$messagetoadd = '<br>'.$remotestore->dolistoreApiError.'<br>Failed to login to: '.$remotestore->dolistore_api_url;
$messagetoadd .= '<br>using API public key: '.$remotestore->dolistore_api_key;
// Add basic auth if needed
$basicAuthLogin = getDolGlobalString('MAIN_MODULE_DOLISTORE_BASIC_LOGIN');
$basicAuthPassword = getDolGlobalString('MAIN_MODULE_DOLISTORE_BASIC_PASSWORD');
if ($basicAuthLogin) {
$messagetoadd .= '<br>using basic auth login: base64('.$basicAuthLogin.':'.$basicAuthPassword.')';
}
}
print $remotestore->libStatus($remotestore->dolistoreApiStatus, 2, $messagetoadd);
}
print '</td>';
print '</tr>';

// Community
print '<tr class="oddeven">'."\n";
$url = 'https://github.com/Dolibarr/dolibarr-community-modules';
print '<td class="hideonsmartphone"><a href="'.$url.'" target="_blank" rel="noopener noreferrer external"><img border="0" class="imgautosize imgmaxwidth180" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.png"></a></td>';
print '<td class="hideonsmartphone center"><a href="'.$url.'" target="_blank" rel="noopener noreferrer external"><img border="0" class="imgautosize imgmaxwidth180" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg"></a></td>';
print '<td><span class="opacitymedium">'.$langs->trans("CommunityModulesDesc").'</span></td>';
print '<td><a href="'.$url.'" target="_blank" rel="noopener noreferrer external">'.$url.'</a></td>';
print '<td>' . $remotestore->libStatut($remotestore->githubFileStatus) . '</td>';
print '<td>'.img_picto('', 'url', 'class="pictofixedwidth"').'<a href="'.$url.'" target="_blank" rel="noopener noreferrer external">'.$url.'</a></td>';
print '<td>';
if (!getDolGlobalString('MAIN_DISABLE_DOLISTORE_SEARCH') && getDolGlobalInt('MAIN_ENABLE_COMMUNITY_REPO')) {
print $remotestore->libStatus($remotestore->githubFileStatus, 2, '<br><small>Content of repository file '.$remotestore->file_source_url.' is in the cache file '.$remotestore->cache_file.'</small>');
}
print '</td>';
print '</tr>';

print "</table>\n";
Expand All @@ -1301,10 +1323,10 @@

$conf->global->MAIN_DISABLE_DOLISTORE_SEARCH = 0; // avoid warning with the new Dolistore website

if (!getDolGlobalString('MAIN_DISABLE_DOLISTORE_SEARCH') && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 && $remotestore->numberOfProviders > 0) {
if (!getDolGlobalString('MAIN_DISABLE_DOLISTORE_SEARCH') && $remotestore->numberOfProviders > 0) {
// $options is array with filter criteria

if (getDolGlobalInt('MAIN_ENANLE_OLD_DOLISTORE')) {
if (getDolGlobalInt('MAIN_ENABLE_DOLISTORE')) {
$nbmaxtoshow = $options['per_page'];
$options['per_page']++;

Expand Down
Loading

0 comments on commit a3fd9b7

Please sign in to comment.