';
// Commented out because of bug #914 and had to use code extra below
// echo $themeObject->ShowHeader(lang('modulehelp', array($module)), '', lang('wikihelp', $module), 'wiki');
$header = '';
echo $header;
echo $gCms->modules[$module]['object']->GetHelpPage();
echo "
";
}
echo '
0)
{
echo '
';
// do we need to worry about this for XSS?
foreach ($_SESSION['modules_messages'] as $onemessage)
{
echo "- " . $onemessage . "
";
}
echo "
";
unset($_SESSION['modules_messages']);
}
?>
ShowHeader('modules').'
'; ?>
|
|
|
|
|
|
|
|
DisplayImage('icons/system/true.gif', lang('true'),'','','systemicon');
$image_false = $themeObject->DisplayImage('icons/system/false.gif', lang('false'),'','','systemicon');
foreach($gCms->modules as $key=>$value)
{
$modinstance =& $value['object'];
$is_sysmodule = (array_search( $key, $gCms->cmssystemmodules ) !== FALSE);
$namecol = $key;
$versioncol = " ";
$statuscol = array();
$statusspans = false;
$actioncol = array();
$activecol = " ";
$helpcol = " ";
$aboutcol = " ";
$xmlcol = " ";
$xmlcol = '
';
//Is there help?
if ($modinstance->GetHelp() != '')
{
$namecol = "".$key."";
}
// check these modules permissions to see if we can uninstall this thing
$permsok = is_directory_writable( $config['root_path'].DIRECTORY_SEPARATOR.
'modules'.DIRECTORY_SEPARATOR.$key );
$maxverok = version_compare($modinstance->MaximumCMSVersion(), $CMS_VERSION);
$maxverok = ($maxverok >= 0 )?1:0;
#Make sure it's a valid module for this version of CMSMS
if (version_compare($modinstance->MinimumCMSVersion(), $CMS_VERSION) == 1)
{
// Fix undefined index error if module is not already installed.
$statuscol[] = ''.lang('minimumversionrequired').': '.$modinstance->MinimumCMSVersion().'';
$xmlcol = " ";
$statusspans = true;
}
else if( $maxverok == 0 )
{
// maximum cms version exceeded
$xmlcol = " ";
$statuscol[] = ''.lang('maximumversionsupported').' = '.$modinstance->MaximumCMSVersion()."";
}
if (!isset($dbm[$key])) #Not installed, lets put up the install button
{
$brokendeps = 0;
$xmlcol = " ";
$dependencies = $modinstance->GetDependencies();
if (count($dependencies) > 0) #Check for any deps
{
#Now check to see if we can satisfy any deps
foreach ($dependencies as $onedepkey=>$onedepvalue)
{
if (!isset($gCms->modules[$onedepkey]) ||
$gCms->modules[$onedepkey]['installed'] != true ||
$gCms->modules[$onedepkey]['active'] != true ||
version_compare($gCms->modules[$onedepkey]['object']->GetVersion(), $onedepvalue) < 0)
{
$brokendeps++;
}
}
}
$versioncol = $modinstance->GetVersion();
$statuscol[] = lang('notinstalled');
if ($brokendeps > 0)
{
$actioncol[] = ''.lang('missingdependency').'';
}
else if( $maxverok == 1)
{
$actioncol[] = "".lang('install')."";
$xmlcol = ' ';
}
if( !$is_sysmodule )
{
if( $permsok )
{
$actioncol[] .= "".lang('remove')."";
}
else
{
$actioncol[] = "".lang('changepermissions')."";
}
}
}
else if (version_compare($modinstance->GetVersion(),
$dbm[$key]['Version']) == 1)
#Check for an upgrade
{
$xmlcol = " ";
$versioncol = $dbm[$key]['Version'];
$statuscol[] = ''.lang('needupgrade').'';
$activecol = ($dbm[$key]['Active']==true?"".$image_true."":"".$image_false."");
if( $maxverok == 1)
{
$actioncol[] = "GetVersion()."\" onclick=\"return confirm('".cms_html_entity_decode_utf8(lang('upgradeconfirm'),true)."');\">".lang('upgrade')."";
}
$xmlcol = ' ';
}
else #Must be installed
{
$versioncol = $dbm[$key]['Version'];
$statuscol[] = lang('installed');
//$actioncol = " ";
#Can't be removed if it has a dependency...
if (!$modinstance->CheckForDependents())
{
$activecol = ($dbm[$key]['Active']==true?"".$image_true."":"".$image_false."");
$actioncol[] = "UninstallPreMessage() !== FALSE? cms_utf8entities($modinstance->UninstallPreMessage()):lang('uninstallconfirm').' '.$key)."');\">".lang('uninstall')."";
}
else
{
// HAS DEPENDENTS ===============
$result = $db->Execute("SELECT child_module from
".cms_db_prefix()."module_deps WHERE parent_module='$key'");
$dependentof = array();;
while ($result && $row = $result->FetchRow()) {
$dependentof[$row['child_module']] = "";
}
$str = implode(array_keys($dependentof),", ");
$activecol = ($dbm[$key]['Active']==true?$image_true:"".$image_false."");
$statuscol[] = lang('hasdependents')." ($str)";
// END HAS DEPENDENTS ===========
}
if( !$permsok )
{
$statuscol[] = lang('cantremove');
$actioncol[] = "".lang('changepermissions')."";
}
}
//Is there help?
if ($modinstance->GetHelp() != '')
{
$helpcol = "".lang('help')."";
}
//About is constructed from other details now
$aboutcol = "".lang('about')."";
// row output
echo "\n";
echo "| $namecol | ";
echo "$versioncol | ";
if( $statusspans === true)
{
echo ''.implode(' ',$statuscol)." | ";
}
else
{
echo "".implode(' ',$statuscol)." | ";
echo ''.$activecol.' | ';
echo ''.implode(' ',$actioncol).' | ';
}
echo "$helpcol | ";
echo "$aboutcol | ";
echo "$xmlcol | ";
echo "
\n";
($curclass=="row1"?$curclass="row2":$curclass="row1");
}
?>
ShowErrors(lang('modulesnotwritable'));
}
else
{
?>
';
}
}//end if access
else {
//now print the menssage
echo "
".lang('needpermissionto', array('Modify Modules'))."
";
}
echo '
« '.lang('back').'
';
}
include_once("footer.php");
# vim:ts=4 sw=4 noet
?>