<?php

class Xoonips_WorkflowFactory {
	public static function getWorkflow($c, $dirname, $trustDirname) {
		static $workflows = array();
		$className = ucfirst($trustDirname) . '_' .$c;
		if (!isset($workflows[$className])) {
			require_once XOOPS_TRUST_PATH . "/modules/$trustDirname/class/workflow/$c.class.php";
			$workflows[$className] = new $className($dirname, $trustDirname);
		}
		return $workflows[$className];
	}
}

