示例#1
0
function getcss()
{
	if (isset($_GET['nocss']))
		return array();
		
	global $abspath, $wwwpath;
	$files = GetSubfiles("$abspath/design/".$_SESSION['murrix']['theme']."/stylesheets");

	$files2 = array();
	for ($n = 0; $n < count($files); $n++)
	{
		$paths = pathinfo($files[$n]);
		if (strtolower($paths['extension']) == "css")
			$files2[] = "$wwwpath/design/".$_SESSION['murrix']['theme']."/stylesheets/".$files[$n];
	}

	return $files2;
}
示例#2
0
];

FCKConfig.ToolbarSets["Basic"] = [
	['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
];

FCKConfig.ToolbarSets["Simple"] = [
	['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','Smiley','SpecialChar','UniversalKey','OrderedList','UnorderedList','-','Link','Unlink']
];



FCKConfig.SmileyPath		= '<?php 
echo $smiley_path_www;
?>
';
FCKConfig.SmileyColumns 	= 7;
FCKConfig.SmileyWindowWidth	= 660;
FCKConfig.SmileyWindowHeight	= 500;
FCKConfig.SmileyImages		= [
<?
$files = GetSubfiles($smiley_path_abs);
for ($n = 0; $n < count($files); $n++)
{
	echo "'".$files[$n]."'";
	if ($n != count($files)-1)
		echo ",";
}
?>
];
示例#3
0
	function actionFinish(&$system, $args)
	{
		global $abspath, $db_prefix, $root_id, $anonymous_id;
		$db_prefix = $this->db['prefix'];
		
		if (empty($args['theme']))
		{
			$system->addAlert("You must enter select a theme");
			return;
		}
		
		if (empty($args['imgsize']))
		{
			$system->addAlert("You must enter a imagesize");
			return;
		}
		
		if (empty($args['thumbsize']))
		{
			$system->addAlert("You must enter a thumbnailsize");
			return;
		}
		
		if (empty($args['default_lang']))
		{
			$system->addAlert("You must enter a default language");
			return;
		}
		
		if (empty($args['default_path']))
		{
			$system->addAlert("You must enter a default path");
			return;
		}
		
		if (empty($args['password']))
		{
			$system->addAlert("You must enter a password");
			return;
		}
		
		unset($args['action']);
		$this->config = $args;
		
		
		$logtext = "";
			
		if (!$db_conn = mysql_pconnect($this->db['adress'], $this->db['username'], $this->db['password']))
		{
			$system->addAlert("Error connecting to MySQL: " . mysql_errno() . " " . mysql_error());
			return;
		}
			
		if (!mysql_select_db($this->db['name']))
		{
			if (mysql_query("CREATE DATABASE `".$this->db['name']."`"))
				$logtext .= "Database ".$this->db['name']." created.<br/>";
			else
			{
				$system->addAlert("Failed to create database ".$this->db['name'].". Error: " . mysql_errno() . " " . mysql_error());
				return;
			}
		}

		mysql_select_db($this->db['name']);
		
		$files = GetSubfiles("$abspath/scripts/install/db");
		foreach ($files as $file)
		{
			$query = "DROP TABLE IF EXISTS `".$this->db['prefix'].basename($file, ".sql")."`";
			mysql_query($query);
		
			$query = str_replace("%PREFIX%", $this->db['prefix'], implode("", file("$abspath/scripts/install/db/$file")));
			
			if (mysql_query($query))
				$logtext .= "Imported $file successfully.<br/>";
			else
			{
				$system->addAlert("Failed to import $file. Error: " . mysql_errno() . " " . mysql_error()."\n$query");
				return;
			}
		}
		
		$xml = new mXml();
		
		$files = GetSubfiles("$abspath/scripts/install/classes");
		foreach ($files as $file)
		{
			$filedata = getFileData($file, "$abspath/scripts/install/classes/$file");
			$msgid = $xml->parseXML(array("node_id" => 0, "data" => $filedata));
			
			$logtext .= mMsg::getText($msgid);
			
			if (mMsg::isError($msgid))
			{
				$system->addAlert(mMsg::getError($msgid));
				return;
			}
			else
				$logtext .= "Imported $file successfully.<br/>";
		}

		$files = GetSubfiles("$abspath/scripts/install/objects");
		foreach ($files as $file)
		{
			$filedata = getFileData($file, "$abspath/scripts/install/objects/$file");
			$msgid = $xml->parseXML(array("node_id" => 0, "data" => $filedata));
			
			$logtext .= mMsg::getText($msgid);
			
			if (mMsg::isError($msgid))
			{
				$system->addAlert(mMsg::getError($msgid));
				return;
			}
			else
				$logtext .= "Imported $file successfully.<br/>";
		}
		
		$root_id = 1;
		
		$admin_group_id = createGroup("admins", "Administrators group", true);
		$anon_group_id = createGroup("anonymous", "Anonymous group", false);
		
		$anon_user_id = createUserSimple("Anonymous", "anonymous", "", "", "anonymous", false);
		$anonymous_id = $anon_user_id;
		$admin_user_id = createUserSimple("Administrator", "admin", $this->config['password'], "", "admins", true);
		
		
		$files = GetSubfiles("$abspath/cache");
		foreach ($files as $file)
			unlink("$abspath/cache/$file");
			
		$files = GetSubfiles("$abspath/files");
		foreach ($files as $file)
			unlink("$abspath/files/$file");
			
		$files = GetSubfiles("$abspath/thumbnails");
		foreach ($files as $file)
			unlink("$abspath/thumbnails/$file");
		
		// Insert initial objects
/*
		$root_obj = new mObject();
		$root_obj->setClassName("folder");
		$root_obj->loadVars();
		$root_obj->setLanguage("eng");
		$root_obj->setName("root");
		$root_obj->setIcon("murrix");
		$root_obj->setRights("all=r");
		
		$root_obj->setVarValue("description", "This is the root node");

		if ($root_obj->save())
		{
			$root_obj->setMeta("initial_rights", "admins=rwc");
			$logtext .= "Created ".$root_obj->getName().".<br/>";
		}
		else
		{
			$logtext .= "Failed to create ".$root_obj->getName().".<br/>";
			$logtext .= $root_obj->error;
			$this->done = false;
		}

		$home_obj = new mObject();
		$home_obj->setClassName("folder");
		$home_obj->loadVars();
		$home_obj->setLanguage("eng");
		$home_obj->setName("home");
		$home_obj->setIcon("home");
		$home_obj->setRights("all=r");

		$home_obj->setVarValue("description", "This folder contain home folders");
		
		if ($home_obj->save())
		{
			$home_obj->linkWithNode($root_obj->getNodeId());
			$logtext .= "Created ".$home_obj->getName().".<br/>";
		}
		else
		{
			$logtext .= "Failed to create ".$home_obj->getName().".<br/>";
			$logtext .= $home_obj->error;
			$this->done = false;
		}
		
		$users_home_obj = new mObject();
		$users_home_obj->setClassName("folder");
		$users_home_obj->loadVars();
		$users_home_obj->setLanguage("eng");
		$users_home_obj->setName("users");
		$users_home_obj->setIcon("user");
		$users_home_obj->setRights("all=r");

		$users_home_obj->setVarValue("description", "This folder contain home folders");
		
		if ($users_home_obj->save())
		{
			$users_home_obj->linkWithNode($home_obj->getNodeId());
			$logtext .= "Created ".$users_home_obj->getName().".<br/>";
		}
		else
		{
			$logtext .= "Failed to create ".$users_home_obj->getName().".<br/>";
			$logtext .= $users_home_obj->error;
			$this->done = false;
		}
		
		$group_home_obj = new mObject();
		$group_home_obj->setClassName("folder");
		$group_home_obj->loadVars();
		$group_home_obj->setLanguage("eng");
		$group_home_obj->setName("groups");
		$group_home_obj->setIcon("group2");
		$group_home_obj->setRights("all=r");

		$users_home_obj->setVarValue("description", "This folder contain group folders");
		
		if ($group_home_obj->save())
		{
			$group_home_obj->linkWithNode($home_obj->getNodeId());
			$logtext .= "Created ".$group_home_obj->getName().".<br/>";
		}
		else
		{
			$logtext .= "Failed to create ".$group_home_obj->getName().".<br/>";
			$logtext .= $group_home_obj->error;
			$this->done = false;
		}
		
		$adminhome_obj = new mObject();
		$adminhome_obj->setClassName("folder");
		$adminhome_obj->loadVars();
		$adminhome_obj->setLanguage("eng");
		$adminhome_obj->setName($this->admin_username);
		$adminhome_obj->setRights("admins=rwc");

		$adminhome_obj->setVarValue("description", "This is the home for ".$this->admin_username);
		
		if ($adminhome_obj->save())
		{
			$adminhome_obj->linkWithNode($users_home_obj->getNodeId());
			$logtext .= "Created ".$adminhome_obj->getName().".<br/>";
			
			$administrator->home_id = $adminhome_obj->getNodeId();
			$administrator->save();
		}
		else
		{
			$logtext .= "Failed to create ".$adminhome_obj->getName().".<br/>";
			$logtext .= $adminhome_obj->error;
			$this->done = false;
		}
		
		$adminshome_obj = new mObject();
		$adminshome_obj->setClassName("folder");
		$adminshome_obj->loadVars();
		$adminshome_obj->setLanguage("eng");
		$adminshome_obj->setName("admins");
		$adminshome_obj->setRights("admins=rwc");

		$adminshome_obj->setVarValue("description", "This is the home for admins");
		
		if ($adminshome_obj->save())
		{
			$adminshome_obj->linkWithNode($group_home_obj->getNodeId());
			$logtext .= "Created ".$adminshome_obj->getName().".<br/>";
			
			$administrator_group->home_id = $adminshome_obj->getNodeId();
			$administrator_group->save();
		}
		else
		{
			$logtext .= "Failed to create ".$adminshome_obj->getName().".<br/>";
			$logtext .= $adminshome_obj->error;
			$this->done = false;
		}
		
		$public_obj = new mObject();
		$public_obj->setClassName("folder");
		$public_obj->loadVars();
		$public_obj->setLanguage("eng");
		$public_obj->setName("public");
		$public_obj->setRights("all=r");

		$public_obj->setVarValue("description", "This folder is readable by anyone");
		
		if ($public_obj->save())
		{
			$public_obj->linkWithNode($root_obj->getNodeId());
			$logtext .= "Created ".$public_obj->getName().".<br/>";
		}
		else
		{
			$logtext .= "Failed to create ".$public_obj->getName().".<br/>";
			$logtext .= $public_obj->error;
			$this->done = false;
		}
		*/
		
		
		
		setSetting("ROOT_NODE_ID",	1,				"any");
		setSetting("ANONYMOUS_ID",	$anonymous->id,			"any");
		setSetting("TRANSPORT",		$this->config['transport'],	"any");
		setSetting("DEFAULT_THEME",	$this->config['theme'],		"any");
		
		setSetting("IMGSIZE",		$this->config['imgsize'],	$this->config['theme']);
		setSetting("THUMBSIZE",		$this->config['thumbsize'],	$this->config['theme']);
		setSetting("INSTANTTHUMBS",	$this->config['instantthumbs'],	$this->config['theme']);
		setSetting("DEFAULT_PATH",	$this->config['default_path'],	$this->config['theme']);
		setSetting("DEFAULT_LANG",	$this->config['default_lang'],	$this->config['theme']);

		$confdata = "<?\n";
		$confdata .= "\$mysql_address = \"".$this->db['adress']."\";\n";
		$confdata .= "\$mysql_user = \"".$this->db['username']."\";\n";
		$confdata .= "\$mysql_pass = \"".$this->db['password']."\";\n";
		$confdata .= "\$mysql_db = \"".$this->db['name']."\";\n";
		$confdata .= "\$db_prefix = \"".$this->db['prefix']."\";\n";
		$confdata .= "?>";

		if (is_writable($abspath))
		{
			$conffile = fopen("$abspath/config.inc.php", "w");
			fwrite($conffile, $confdata);
			fclose($conffile);
			chmod("$abspath/config.inc.php", 0600);
			$logtext .= "Wrote config, $abspath/config.inc.php.<br/>";
		}
		else
		{
			$logtext .= "Unable to write config file.<br/>";
			$logtext .= "Please put the folowing into \"config.inc.php\" and place it in MURRiXs rootpath:<br/>";
			$logtext .= "<br/>";
			$logtext .= nl2br(htmlentities($confdata));
			$logtext .= "<br/>";
		}
		
		$logtext .= "Installation complete!<br/>";
		
		
		$data = compiletpl("finish", array("logtext"=>$logtext));
		$system->setZoneData($this->zone, utf8e($data));
		
		$data = compiletpl("menu", array("action"=>"finish"));
		$system->setZoneData("zone_menu", utf8e($data));
	}
示例#4
0
{
	$parts = SplitFilepath($file);
	include_once("$abspath/design/$theme/include/$file");
}

/* ========================= */
// Clear cache
/* ========================= */
$_SESSION['murrix']['callcache'] = array();



/* ========================= */
// Load translations
/* ========================= */
$files = GetSubfiles("$abspath/design/$theme/translations");
$_SESSION['murrix']['languages'] = array();
foreach ($files as $file)
{
	include_once("$abspath/design/$theme/translations/$file");
	$name = basename($file, ".php");
 	$_SESSION['murrix']['translations'][$name] = $translation;
	$_SESSION['murrix']['languages'][] = $name;
}

if (!isset($_SESSION['murrix']['language']))
	$_SESSION['murrix']['language'] = getSetting("DEFAULT_LANG", "eng");

$prof->startTimer( "system" );
/* ========================= */
// Init system
示例#5
0
	function loadScripts()
	{
		$this->scripts = array();
		
		global $abspath;
		$files = GetSubfiles("$abspath/cscripts");
		foreach ($files as $file)
		{
			$name = basename($file, ".php");
			$class_name = "cs".ucfirst($name);
			$this->scripts[$name] = new $class_name();
		}
	}
示例#6
0
function GetSubfilesAndSubfolders($dir)
{
	$folders = GetSubfolders($dir);
	$files = GetSubfiles($dir);

	return array_merge($folders, $files);
}