$class ) { self::$sections[$key] = $class; } } /** * Set the class used to instantiate a section based on the section key. * * @param string $key section key * @param string $class classname */ public static function set_section_class( $key, $class ) { self::$sections[$key] = $class; } /** * Create an instance of a section based on the section key, providing the * $parameters to instantiate it. * * @param string $key section key * @param array $parameters parameters used to instantiate the section object * * @return Affiliates_Dashboard_Section new section instance or null */ public static function get_section_instance( $key, $parameters = null ) { $section = null; if ( isset( self::$sections[$key] ) ) { if ( $parameters === null ) { $section = new self::$sections[$key](); } else { $section = new self::$sections[$key]( $parameters ); } } return $section; } }