|' $tmp_file"); symlink($tmp_file,"/var/log/plugins/$tmp_plg"); $next = end(explode("\n",check_plugin($tmp_plg,$ncsi))); if (version_compare($next,$past,'>')) { copy("/tmp/plugins/$tmp_plg",$tmp_file); $plugin_file = $tmp_file; } } //link/icon $launch = plugin('launch',$plugin_file); if ($icon = plugin('icon',$plugin_file)) { if (substr($icon,-4)=='.png') { if (file_exists("plugins/$name/images/$icon")) { $icon = "plugins/$name/images/$icon"; } elseif (file_exists("plugins/$name/$icon")) { $icon = "plugins/$name/$icon"; } else { $icon = "plugins/dynamix.plugin.manager/images/dynamix.plugin.manager.png"; } $icon = ""; } elseif (substr($icon,0,5)=='icon-') { $icon = ""; } else { if (substr($icon,0,3)!='fa-') $icon = "fa-$icon"; $icon = ""; } $link = $launch ? "$icon" : $icon; } else { $icon = icon($name); $link = $launch ? "" : ""; } //description $readme = "plugins/{$name}/README.md"; if (file_exists($readme)) $desc = Markdown(file_get_contents($readme)); else $desc = Markdown("**{$name}**"); //author $author = plugin('author',$plugin_file) ?: _('anonymous'); //version $version = plugin('version',$plugin_file) ?: _('unknown'); $date = str_replace('.','',$version); //support $support = plugin('support',$plugin_file) ?: ""; $support = $support ? ""._('Support Thread')."" : ""; //category $category = plugin('category',$plugin_file) ?: (strpos($version,'-')!==false ? 'next' : 'stable'); //status $status = _('unknown'); $changes_file = $plugin_file; $url = plugin('pluginURL',$plugin_file); if ($url !== false) { $filename = "/tmp/plugins/".(($os && $branch) ? $tmp_plg : basename($url)); if ($checked && file_exists($filename)) { if ($past && $past != $version) { $status = make_link('install',$plugin_file,'forced'); } else { $latest = plugin('version',$filename); if ($os ? version_compare($latest,$version,'>') : strcmp($latest,$version) > 0) { $version .= "
$latest"; $status = make_link("update",basename($plugin_file)); $changes_file = $filename; if (!$os) $updates++; } else { //status is considered outdated when older than 1 day $status = filectime($filename) > (time()-86400) ? _('up-to-date') : _('need check'); } } } } if (strpos($status,'update')!==false) $rank = '0'; elseif (strpos($status,'install')!==false) $rank = '1'; elseif ($status=='need check') $rank = '2'; elseif ($status=='up-to-date') $rank = '3'; else $rank = '4'; $changes = plugin('changes',$changes_file); if ($changes !== false) { $txtfile = "/tmp/plugins/".basename($plugin_file,'.plg').".txt"; file_put_contents($txtfile,$changes); $version .= " "; } //write plugin information $empty = false; echo ""; echo "$link"; echo "$desc $support"; echo "$author"; echo "$version"; echo "$status"; echo ""; if ($system) { if ($os) { $regular = ['stable','next']; echo ""; } } else { echo make_link('remove',basename($plugin_file)); } echo ""; echo ""; //remove temporary symlink @unlink("/var/log/plugins/$tmp_plg"); } if ($empty) echo " "._('No plugins installed').""; echo "\0".$updates; ?>