public function createContainer($settings)
{
if (empty($settings['type'])) {
self::displayFrameworkError(sprintf(__('%s needs a %s parameter.', TF_I18NDOMAIN), '<code>' . __FUNCTION__ . '</code>', '<code>type</code>'));
return;
}
$type = strtolower($settings['type']);
$class = 'TitanFramework' . str_replace(' ', '', ucfirst(str_replace('-', ' ', $settings['type'])));
$action = str_replace('-', '_', $type);
$container = false;
if (!class_exists($class)) {
self::displayFrameworkError(sprintf(__('Container of type %s, does not exist.', TF_I18NDOMAIN), '<code>' . $settings['type'] . '</code>'));
return;
}
// Create the container object.
$container = new $class($settings, $this);
if (empty($this->mainContainers[$type])) {
$this->mainContainers[$type] = array();
}
$this->mainContainers[$type][] = $container;
do_action('tf_' . $action . '_created_' . $this->optionNamespace, $container);
return $container;
}