This commit is contained in:
Squidly271 2021-05-29 19:54:31 -04:00
parent c31f03667a
commit e42671bd4d
6 changed files with 50 additions and 50 deletions

View File

@ -11,13 +11,13 @@ b398273cf7daa62ab00d2de2336ca25f ./README.md
6e48a62b91bdd066f023f46c6b491afd ./images/discord-gray.svg
8e7dc33512b8a78f28d7179a972c7c34 ./images/discord-hover.svg
54e46db492ddb033dfeb2827c5efd4a8 ./images/discord-white.svg
c31d41a1f7e894c835c2323d4a2b223f ./include/exec.php
52120efaabf72bcb458de43faf368332 ./include/helpers.php
ff2397aabb45396d4b8398c084645196 ./include/exec.php
d7f50413cbaac1c6cb9ceaaef48f270a ./include/helpers.php
8f1129e0cdb994c6d1900192252433d8 ./include/paths.php
3758b1cb84123ea534ce8fb68f92879e ./javascript/libraries.js
4a613e9480d7b3d9aa85741bd683b52f ./skins/Narrow/css.php
a65de3019ba259fb7855fac67ea28770 ./skins/Narrow/skin.html
75191b3c6a84b2f0e608509bd0a788ed ./skins/Narrow/skin.php
dc5fd31a387046c672a1035bdf0da632 ./skins/Narrow/skin.html
d975e0703c7a5ded05c77632da3dbdb1 ./skins/Narrow/skin.php
38d1f40cbc64eed32cdb3292e1ec1f6e ./scripts/PluginAPI.php
bbd9dec6c5df486d75c46388c14f09ce ./scripts/installMulti.php
ce2c904b6a40c4677a3ff3484776959e ./scripts/installMultiPlugin.sh

View File

@ -61,7 +61,7 @@ if ( !is_dir($caPaths['templates-community']) ) {
if ($caSettings['debugging'] == "yes") {
if ( ! is_file($caPaths['logging']) ) {
$caVersion = plugin("version","/var/log/plugins/community.applications.plg");
file_put_contents($caPaths['logging'],"Community Applications Version: $caVersion\n");
file_put_contents($caPaths['logging'],"MD5's: \n".shell_exec("cd /usr/local/emhttp/plugins/community.applications && md5sum -c ca.md5")."\n",FILE_APPEND);
$lingo = $_SESSION['locale'] ?: "en_US";
@ -349,13 +349,13 @@ function DownloadApplicationFeed() {
writeJsonFile($caPaths['community-templates-info'],$myTemplates);
writeJsonFile($caPaths['categoryList'],$ApplicationFeed['categories']);
foreach ($ApplicationFeed['repositories'] as &$repo) {
if ( $repo['downloads'] ) {
$repo['trending'] = $repo['trending'] / $repo['downloads'];
}
}
writeJsonFile($caPaths['repositoryList'],$ApplicationFeed['repositories']);
return true;
}
@ -844,7 +844,7 @@ function force_update() {
getConvertedTemplates();
moderateTemplates();
$currentServer = @file_get_contents($caPaths['currentServer']);
$appFeedTime = readJsonFile($caPaths['lastUpdated-old']);
$updateTime = tr(date("F",$appFeedTime['last_updated_timestamp']),0).date(" d, Y @ g:i a",$appFeedTime['last_updated_timestamp']);
$updateTime = str_replace("'","'",$updateTime);
@ -866,7 +866,7 @@ function display_content() {
if ( file_exists($caPaths['community-templates-displayed']) || file_exists($caPaths['repositoriesDisplayed']) ) {
$o['display'] = display_apps($pageNumber,$selectedApps,$startup);
}
$displayedApps = readJsonFile($caPaths['community-templates-displayed']);
/* if ( ! is_array($displayedApps['community']) || count($displayedApps['community']) < 1)
$o['script'] = "disableSort();"; */
@ -881,7 +881,7 @@ function display_content() {
#######################################################################
function convert_docker() {
global $caPaths;
$dockerID = getPost("ID","");
$file = readJsonFile($caPaths['dockerSearchResults']);
@ -914,7 +914,7 @@ function convert_docker() {
#########################################################
function search_dockerhub() {
global $caPaths;
$filter = getPost("filter","");
$pageNumber = getPost("page","1");
@ -972,13 +972,13 @@ function search_dockerhub() {
#####################################################################
function dismiss_warning() {
global $caPaths;
file_put_contents($caPaths['warningAccepted'],"warning dismissed");
postReturn(['status'=>"warning dismissed"]);
}
function dismiss_plugin_warning() {
global $caPaths;
file_put_contents($caPaths['pluginWarning'],"disclaimer ok");
postReturn(['status'=>"disclaimed"]);
}
@ -988,7 +988,7 @@ function dismiss_plugin_warning() {
###############################################################
function previous_apps() {
global $caPaths, $caSettings, $DockerClient;
$installed = getPost("installed","");
$filter = getPost("filter","");
$dockerUpdateStatus = readJsonFile($caPaths['dockerUpdateStatus']);
@ -1205,7 +1205,7 @@ function remove_application() {
###################################################################################
function updatePLGstatus() {
global $caPaths;
$filename = getPost("filename","");
$displayed = readJsonFile($caPaths['community-templates-displayed']);
$superCategories = array_keys($displayed);
@ -1250,7 +1250,7 @@ function uninstall_docker() {
##################################################
function pinApp() {
global $caPaths;
$repository = getPost("repository","oops");
$name = getPost("name","oops");
$pinnedApps = readJsonFile($caPaths['pinnedV2']);
@ -1265,7 +1265,7 @@ function pinApp() {
######################################
function areAppsPinned() {
global $caPaths;
postReturn(['status' => in_array(true,readJsonFile($caPaths['pinnedV2']))]);
}
@ -1412,7 +1412,7 @@ function statistics() {
#######################################
function removePrivateApp() {
global $caPaths;
$path = getPost("path",false);
if ( ! $path || pathinfo($path,PATHINFO_EXTENSION) != "xml") {
@ -1467,11 +1467,11 @@ function populateAutoComplete() {
$autoComplete[$name] = str_replace("binhex ","",$autoComplete[$name]);
if ( startsWith($autoComplete[$name],"activ ") )
$autoComplete[$name] = str_replace("activ ","",$autoComplete[$name]);
if ( ! $autoComplete[strtolower($template['Author'])."'s Repository"] && ! $autoComplete[strtolower($template['Author']."' Repository")]) {
$autoComplete[strtolower($template['Author'])] = $template['Author'];
}
if ( $template['ExtraSearchTerms'] ) {
foreach (explode(" ",$template['ExtraSearchTerms']) as $searchTerm) {
$searchTerm = str_replace("%20"," ",$searchTerm);
@ -1567,7 +1567,7 @@ function getRepoDescription() {
###########################################
function createXML() {
global $caPaths;
$xmlFile = getPost("xml","");
if ( ! $xmlFile ) {
postReturn(["error"=>"CreateXML: XML file was missing"]);
@ -1662,7 +1662,7 @@ function createXML() {
########################
function switchLanguage() {
global $caPaths;
$language = getPost("language","");
if ( $language == "en_US" )
$language = "";
@ -1704,7 +1704,7 @@ function remove_multiApplications() {
############################################
function getCategoriesPresent() {
global $caPaths;
if ( is_file($caPaths['community-templates-allSearchResults']) )
$displayed = readJsonFile($caPaths['community-templates-allSearchResults']);
else
@ -1745,7 +1745,7 @@ function toggleFavourite() {
####################################
function getFavourite() {
global $caSettings;
postReturn(["favourite"=>$caSettings['favourite']]);
}
##########################
@ -1788,7 +1788,7 @@ function changeSortOrder() {
$reposDisplayed['community'] = array_merge($bio,$nonbio);
writeJsonFile($caPaths['repositoriesDisplayed'],$reposDisplayed);
}
postReturn(['status'=>"ok"]);
}
############################################
@ -1796,7 +1796,7 @@ function changeSortOrder() {
############################################
function getSortOrder() {
global $sortOrder;
postReturn(["sortBy"=>$sortOrder['sortBy'],"sortDir"=>$sortOrder['sortDir']]);
}
@ -1805,7 +1805,7 @@ function getSortOrder() {
############################################################
function defaultSortOrder() {
global $caPaths, $sortOrder;
$sortOrder['sortBy'] = "Name";
$sortOrder['sortDir'] = "Up";
writeJsonFile($caPaths['sortOrder'],$sortOrder);
@ -1816,7 +1816,7 @@ function defaultSortOrder() {
#######################################
function javascriptError() {
global $caPaths, $caSettings;
if ($caSettings['debugging'] == "yes") {
file_put_contents($caPaths['logging'],"******* ERROR **********\n".print_r($_POST,true)."\n",FILE_APPEND);
}

View File

@ -210,7 +210,7 @@ function fixTemplates($template) {
if ( $template['DeprecatedMaxVer'] && version_compare($caSettings['unRaidVersion'],$template['DeprecatedMaxVer'],">") )
$template['Deprecated'] = true;
if ( version_compare($caSettings['unRaidVersion'],"6.10.0-beta4",">") ) {
if ( version_compare($caSettings['unRaidVersion'],"6.10.0-beta4",">") ) {
if ( $template['Config'] ) {
if ( $template['Config']['@attributes'] ) {
if (preg_match("/^(Container Path:|Container Port:|Container Label:|Container Variable:|Container Device:)/",$template['Config']['@attributes']['Description']) ) {
@ -227,7 +227,7 @@ function fixTemplates($template) {
}
}
}
return $template;
}
###############################################
@ -237,7 +237,7 @@ function makeXML($template) {
# ensure its a v2 template if the Config entries exist
if ( $template['Config'] && ! $template['@attributes'] )
$template['@attributes'] = array("version"=>2);
if ( $template['OriginalOverview'] ) {
$template['Overview'] = $template['OriginalOverview'];
$template['Description'] = $template['OriginalOverview'];
@ -286,7 +286,7 @@ function versionCheck($template) {
}
}
*/
if ( $template['IncompatibleVersion'] ) {
if ( ! is_array($template['IncompatibleVersion']) ) {
$incompatible[] = $template['IncompatibleVersion'];
@ -297,8 +297,8 @@ function versionCheck($template) {
if ( $ver == $template['pluginVersion'] ) return false;
}
}
if ( $template['MinVer'] && ( version_compare($template['MinVer'],$caSettings['unRaidVersion']) > 0 ) ) return false;
if ( $template['MaxVer'] && ( version_compare($template['MaxVer'],$caSettings['unRaidVersion']) < 0 ) ) return false;
return true;

View File

@ -74,7 +74,7 @@
<div class='ca_center ca_credit'>dockerPolice, pluginCop</div>
<div class='ca_center ca_creditheader'><?tr("Additional Libraries");?></div>
<div class='ca_center ca_credit'>Awesomeplete (Lea Verou), Chart.js (various), chartjs-plugin-trendline (Marcus Alsterfjord), XML2Array/Array2XML (Miles Johnson), sprintf.js (Alexandru Mărășteanu) clamp.js (Joseph Schmitt)</div>
<br>
<br>
<div class='ca_center ca_italic'><font size='1rem;'><?tr("Copyright");?> &copy; 2015-2021 Andrew Zawadzki</font></div>
</div>
</span>

View File

@ -88,10 +88,10 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
if ( ! $template['bio'] )
$template['CardDescription'] = tr("No description present");
else
else
$template['CardDescription'] = $template['bio'];
$template['bio'] = strip_tags(markdown($template['bio']));
$template['display_dockerName'] = $template['RepoName'];
$template['display_DonateImage'] = $template['DonateLink'] ? "<a class='ca_tooltip donateLink donate ca_href' data-href='{$template['DonateLink']}' data-target='_blank' title='{$template['DonateText']}'>".tr("Donate")."</a>" : "";
@ -165,7 +165,7 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
if ( $template['RepoName'] ) {
$template['display_favouriteButton'] = "<span class='appIcons ca_tooltip $favClass ca_fav' data-repository='".htmlentities($template['RepoName'],ENT_QUOTES)."' title='$favMsg'></span>";
}
$template['display_ModeratorComment'] .= $template['ModeratorComment'] ? "</span></strong><font color='purple'>{$template['ModeratorComment']}</font>" : "";
if ( $pinnedApps["{$template['Repository']}&{$template['SortName']}"] ) {
@ -568,7 +568,7 @@ function getPopupDescriptionSkin($appNumber) {
$ovr = str_replace("<br>","\n",$ovr);
$ovr = str_replace(" ","&nbsp;&nbsp;&nbsp;&nbsp;",$ovr);
$ovr = markdown(strip_tags($ovr));
$template['ModeratorComment'] .= $template['CAComment'];
if ( $template['Plugin'] ) {
@ -874,7 +874,7 @@ function getRepoDescriptionSkin($repository) {
$templates = readJsonFile($caPaths['community-templates-info']);
$repo = $repositories[$repository];
$repo['icon'] = $repo['icon'] ?: "/plugins/dynamix.docker.manager/images/question.png";
$t .= "<div class='popupTitle'>$repository</div>";
$t .= "<div class='ca_hr'></div>";
$t .= "<div class='popupIconArea ca_center'><img class='popupIcon' src='{$repo['icon']}' onerror='this.src=&quot;/plugins/dynamix.docker.manager/images/question.png&quot;'></div>";
@ -889,14 +889,14 @@ function getRepoDescriptionSkin($repository) {
$t .= "<div class='ca_hr'></div>";
if ( $caSettings['favourite'] == $repository )
if ( $caSettings['favourite'] == $repository )
$t .= "<div class='ca_center'><span class='ca_favouriteRepo appIconsPopUp'> ".tr("Favourite Repository")."</span></div>";
else
$t .= "<div id='favMsg' class='ca_center'><span class='ca_non_favouriteRepo appIconsPopUp favPopup' data-repository='".htmlentities($repository,ENT_QUOTES)."'> ".tr("Set as favourite repository")."</span></div>";
$installLine = "<div style='display:flex;flex-wrap:wrap;justify-content:center;width:90%;margin-left:5%;'>";
$installLine .= "<div><a class='appIconsPopUp ca_repoSearchPopUp ca_showRepo' data-repository='".htmlentities($repository,ENT_QUOTES)."'> Search Apps</a></div>";
if ( $repo['WebPage'] )
if ( $repo['WebPage'] )
$installLine .= "<div><a class='appIconsPopUp ca_webpage' href='{$repo['WebPage']}' target='_blank'> ".tr("Web Page")."</a></div>";
if ( $repo['Forum'] )
$installLine .= "<div><a class='appIconsPopUp ca_forum' href='{$repo['Forum']}' target='_blank'> ".tr("Forum")."</a></div>";
@ -915,18 +915,18 @@ function getRepoDescriptionSkin($repository) {
$installLine .= "<div><img src='/plugins/community.applications/images/discord-white.svg' style='height:1.5rem;'></img><a class='appIconsPopUp' style='position:absolute;' target='_blank' href='{$repo['Discord']}'> ".tr("Discord")."</a></div>";
}
}
$t .= "$installLine</div>";
$t .= "$installLine</div>";
$totalApps = $totalPlugins = $totalDocker = $totalDownloads = 0;
foreach ($templates as $template) {
if ( $template['RepoName'] !== $repository ) continue;
if ( $template['BranchID'] ) continue;
if ( $template['Blacklist'] ) continue;
if ( $template['Deprecated'] && $caSettings['hideDeprecated'] !== "false" ) continue;
if ( ! $template['Compatible'] && $caSettings['hideIncompatible'] !== "false" ) continue;
if ( $template['Registry'] ) {
$totalDocker++;
if ( $template['downloads'] ) {
@ -952,9 +952,9 @@ function getRepoDescriptionSkin($repository) {
$t .= "<tr><td style='width:50%;'>".tr("Total Plugin Applications")."</td><td style='width:30%;text-align:right;'>$totalPlugins</td></tr>";
if ( $totalLanguage )
$t .= "<tr><td style='width:50%;'>".tr("Total Languages")."</td><td style='width:30%;text-align:right;'>$totalLanguage</td></tr>";
if ($dockerVars['DOCKER_AUTHORING_MODE'] == "yes")
if ($dockerVars['DOCKER_AUTHORING_MODE'] == "yes")
$t .= "<tr><td style='width:50%;'><a href='{$repo['url']}' target='_blank'>".tr("Repository URL")."</a></td></tr>";
$t .= "<tr><td style='width:50%;'>".tr("Total Applications")."</td><td style='width:30%;text-align:right;'>$totalApps</td></tr>";
if ( $downloadDockerCount && $totalDownloads ) {
@ -963,7 +963,7 @@ function getRepoDescriptionSkin($repository) {
$t .= "<tr><td>".tr("Average Downloads Per App")."</td><td style='text-align:right;'>".number_format($avgDownloads)."</td></tr>";
}
$t .= "</table>";
$t .= "</div>";
$t .= "</div>";
@ -986,7 +986,7 @@ function displayCard($template) {
if ( $template['ca_fav'] )
$holder .= " ca_holderFav";
$descriptionArea = $template['RepositoryTemplate'] ? "ca_descriptionAreaRepository" : "ca_descriptionArea";
$popupType = $template['RepositoryTemplate'] ? "ca_repoPopup" : "ca_appPopup";