[xoops-cvslog 4656] CVS update: xoops2jp/html/modules/base/class

Back to archive index

Minahito minah****@users*****
2006年 9月 28日 (木) 14:02:05 JST


Index: xoops2jp/html/modules/base/class/Legacy_Utils.class.php
diff -u /dev/null xoops2jp/html/modules/base/class/Legacy_Utils.class.php:1.1.2.1
--- /dev/null	Thu Sep 28 14:02:05 2006
+++ xoops2jp/html/modules/base/class/Legacy_Utils.class.php	Thu Sep 28 14:02:05 2006
@@ -0,0 +1,46 @@
+<?php
+/**
+ * @package Legacy
+ * @version $Id: Legacy_Utils.class.php,v 1.1.2.1 2006/09/28 05:02:05 minahito Exp $
+ */
+
+/**
+ * The static member functions class for Legacy.
+ */
+class Legacy_Utils
+{
+	/**
+	 * Checks whether must modules have been installed.
+	 * @static
+	 * @return mixed Returns hashmap including the list of uninstalled,
+	 * disabled and recommended modules, basically. But, if there is no problem,
+	 * returns true.
+	 */
+	function checkSystemModules()
+	{
+		$root=&XCube_Root::getSingleton();
+		$systemModules = array_map('trim', explode(',', $root->getSiteConfig('Cube', 'SystemModules')));
+		$recommendedModules = array_map('trim', explode(',', $root->getSiteConfig('Cube',' RecommendedModules')));
+		$moduleHandler =& xoops_gethandler('module');
+		$uninstalledModules = array();
+		$disabledModules = array();
+		foreach ($systemModules as $systemModule) {
+			if (!empty($systemModule)) {
+				if (!($moduleObject =& $moduleHandler->getByDirname($systemModule))) {
+					$uninstalledModules[] = $systemModule;
+				}
+				elseif (!$moduleObject->get('isactive')) {
+					$disabledModules[] = $systemModule;
+				}
+			}
+		}
+		if (count($uninstalledModules) == 0 && count($disabledModules) == 0) {
+			return true;
+		}
+		else {
+			return array('uninstalled' =>$uninstalledModules, 'disabled'=>$disabledModules, 'recommended'=>$recommendedModules);
+		}
+	}
+}
+
+?>
\ No newline at end of file


xoops-cvslog メーリングリストの案内
Back to archive index