seeddms-code/views/bootstrap/class.Info.php

157 lines
5.4 KiB
PHP
Raw Normal View History

2012-12-14 07:53:13 +00:00
<?php
/**
* Implementation of Info view
*
* @category DMS
* @package SeedDMS
2012-12-14 07:53:13 +00:00
* @license GPL 2
* @version @version@
* @author Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2002-2005 Markus Westphal,
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
* 2010-2012 Uwe Steinmann
* @version Release: @package_version@
*/
/**
* Include parent class
*/
//require_once("class.Bootstrap.php");
2012-12-14 07:53:13 +00:00
/**
* Class which outputs the html page for Info view
*
* @category DMS
* @package SeedDMS
2012-12-14 07:53:13 +00:00
* @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2002-2005 Markus Westphal,
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
* 2010-2012 Uwe Steinmann
* @version Release: @package_version@
*/
class SeedDMS_View_Info extends SeedDMS_Theme_Style {
2012-12-14 07:53:13 +00:00
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$settings = $this->params['settings'];
2012-12-14 07:53:13 +00:00
$version = $this->params['version'];
2014-04-10 09:19:45 +00:00
$availversions = $this->params['availversions'];
$extmgr = $this->params['extmgr'];
2012-12-14 07:53:13 +00:00
2012-12-17 08:44:52 +00:00
$this->htmlStartPage(getMLText("admin_tools"));
2012-12-14 07:53:13 +00:00
$this->globalNavigation();
$this->contentStart();
2012-12-17 08:44:52 +00:00
$this->pageNavigation(getMLText("admin_tools"), "admin_tools");
2014-04-10 09:19:45 +00:00
if($availversions) {
$newversion = '';
foreach($availversions as $availversion) {
if($availversion[0] == 'stable')
$newversion = $availversion[1];
}
2020-02-28 08:47:23 +00:00
if($newversion > $version->version()) {
2014-04-10 09:19:45 +00:00
$this->warningMsg(getMLText('no_current_version', array('latestversion'=>$newversion)));
}
} else {
$this->warningMsg(getMLText('no_version_check'));
}
2020-10-07 16:33:22 +00:00
$this->rowStart();
$this->columnStart(6);
$this->contentHeading(getMLText("seeddms_info"));
$seedextensions = $extmgr->getExtensionConfiguration();
echo "<table class=\"table table-condensed table-sm\">\n";
echo "<thead>\n<tr>\n";
echo "<th></th>";
echo "<th>".getMLText("name");
echo "</th>\n";
echo "</tr>\n</thead>\n<tbody>\n";
$dbversion = $dms->getDBVersion();
echo "<tr><td></td><td>".getMLText('seeddms_version')."</td><td>".$version->version()."</td></tr>\n";
if($user->isAdmin()) {
echo "<tr><td><td>".getMLText('database_schema_version')."</td><td>".$dbversion['major'].".".$dbversion['minor'].".".$dbversion['subminor']."</td></tr>\n";
foreach($seedextensions as $extname=>$extconf) {
echo "<tr><td>";
if(!$settings->extensionIsDisabled($extname))
echo "<i class=\"fa fa-circle text-success\"></i> ";
else
echo "<i class=\"fa fa-circle text-danger text-error\"></i> ";
echo "</td><td>".$extname."<br />".$extconf['title']."</td><td>".$extconf['version']."</td>";
echo "</tr>\n";
}
}
echo "</tbody>\n</table>\n";
2020-10-07 16:33:22 +00:00
$this->columnEnd();
$this->columnStart(6);
if($user->isAdmin()) {
$this->contentHeading(getMLText("php_info"));
echo "<table class=\"table table-condensed table-sm\">\n";
echo "<thead>\n<tr>\n";
echo "<th>".getMLText("name");
echo "</th>\n";
echo "</tr>\n</thead>\n<tbody>\n";
echo "<tr><td>PHP</td><td>".phpversion()."</td></tr>\n";
echo "<tr><td>Path to php.ini</td><td>".php_ini_loaded_file()."</td></tr>\n";
echo "</tbody>\n</table>\n";
$this->contentHeading(getMLText("installed_php_extensions"));
$phpextensions = get_loaded_extensions(false);
echo "<table class=\"table table-condensed table-sm\">\n";
echo "<thead>\n<tr>\n";
echo "<th>".getMLText("name");
echo "</th>\n";
echo "</tr>\n</thead>\n<tbody>\n";
foreach($phpextensions as $extname)
echo "<tr><td>".$extname."</td><td>"."</td></tr>\n";
echo "</tbody>\n</table>\n";
$this->contentHeading(getMLText("missing_php_extensions"));
echo "<table class=\"table table-condensed table-sm\">\n";
echo "<thead>\n<tr>\n";
echo "<th>".getMLText("name");
echo "</th>\n";
echo "</tr>\n</thead>\n<tbody>\n";
$requiredext = array('zip', 'xml', 'xsl', 'json', 'intl', 'fileinfo', 'mbstring', 'curl', 'sqlite');
foreach(array_diff($requiredext, $phpextensions) as $extname)
echo "<tr><td>".$extname."</td><td>"."</td></tr>\n";
echo "</tbody>\n</table>\n";
2020-12-22 16:05:45 +00:00
$this->contentHeading(getMLText("missing_php_functions_and_classes"));
echo "<table class=\"table table-condensed table-sm\">\n";
2021-03-30 11:03:26 +00:00
echo "<thead>\n<tr>\n";
echo "<th>".getMLText("name");
echo "<th>".getMLText("missing_func_class_note");
2021-03-30 11:03:26 +00:00
echo "</th>\n";
echo "</tr>\n</thead>\n<tbody>\n";
foreach(array('proc_open') as $funcname) {
if(!function_exists($funcname)) {
echo "<tr><td>".$funcname."</td><td>".getMLText('func_'.$funcname."_missing")."</td></tr>";
}
}
foreach(array('finfo') as $classname) {
if(!class_exists($classname)) {
echo "<tr><td>".$classname."</td><td>".getMLText('class_'.$classname."_missing")."</td></tr>";
}
}
2021-03-30 11:03:26 +00:00
echo "</tbody>\n</table>\n";
2020-12-22 16:05:45 +00:00
if(function_exists('apache_get_modules')) {
$this->contentHeading(getMLText("installed_apache_extensions"));
$apacheextensions = apache_get_modules();
echo "<table class=\"table table-condensed table-sm\">\n";
2020-12-22 16:05:45 +00:00
echo "<thead>\n<tr>\n";
echo "<th>".getMLText("name");
echo "</th>\n";
echo "</tr>\n</thead>\n<tbody>\n";
foreach($apacheextensions as $extname)
echo "<tr><td>".$extname."</td><td>"."</td></tr>\n";
echo "</tbody>\n</table>\n";
}
}
2020-10-07 16:33:22 +00:00
$this->columnEnd();
$this->rowEnd();
$this->contentEnd();
2012-12-14 07:53:13 +00:00
$this->htmlEndPage();
} /* }}} */
}