fuel/fuel/core/classes/theme.php
protected function create_theme_array($theme)
	{
		if ( ! is_array($theme))
		{
			if ( ! $path = $this->find($theme))
			{
				throw new \ThemeException(sprintf('Theme "%s" could not be found.', $theme));
			}

			$theme = array(
				'name' => $theme,
				'path' => $path,
			);
		}
		else
		{
			if ( ! isset($theme['name']) or ! isset($theme['path']))
			{
				throw new \ThemeException('Theme name and path must be given in array config.');
			}
		}

		// load the theme info file
		if ( ! isset($theme['info']))
		{
			$theme['info'] = $this->load_info($theme);
		}

		if ( ! isset($theme['asset_base']))
		{
			// determine the asset location and base URL
			$assets_folder = rtrim($this->config['assets_folder'], DS).'/';

			// all theme files are inside the docroot
			if (strpos($path, DOCROOT) === 0 and is_dir($path.$assets_folder))
			{
				$theme['asset_path'] = $path.$assets_folder;
				$theme['asset_base'] = str_replace(DOCROOT, '', $theme['asset_path']);
			}

			// theme views and templates are outside the docroot
			else
			{
				$theme['asset_base'] = $assets_folder.$theme['name'].'/';
			}
		}

		if ( ! isset($theme['asset_path']) and strpos($theme['asset_base'], '://') === false)
		{
			$theme['asset_path'] = DOCROOT.$theme['asset_base'];
		}

		// always uses forward slashes (DS is a backslash on Windows)
		$theme['asset_base'] = str_replace(DS, '/', $theme['asset_base']);

		return $theme;
	}
protected function create_theme_array($theme)
	{
		if ( ! is_array($theme))
		{
			if ( ! $path = $this->find($theme))
			{
				throw new \ThemeException(sprintf('Theme "%s" could not be found.', $theme));
			}

			$theme = array(
				'name' => $theme,
				'path' => $path,
			);
		}
		else
		{
			if ( ! isset($theme['name']) or ! isset($theme['path']))
			{
				throw new \ThemeException('Theme name and path must be given in array config.');
			}
		}

		// load the theme info file
		if ( ! isset($theme['info']))
		{
			$theme['info'] = $this->load_info($theme);
		}

		if ( ! isset($theme['asset_base']))
		{
			// determine the asset location and base URL
			$assets_folder = rtrim($this->config['assets_folder'], DS).'/';

			// all theme files are inside the docroot
			if (strpos($path, DOCROOT) === 0 and is_dir($path.$assets_folder))
			{
				$theme['asset_path'] = $path.$assets_folder;
				$theme['asset_base'] = str_replace(DOCROOT, '', $theme['asset_path']);
			}

			// theme views and templates are outside the docroot
			else
			{
				$theme['asset_base'] = $assets_folder.$theme['name'].'/';
			}
		}

		if ( ! isset($theme['asset_path']) and strpos($theme['asset_base'], '://') === false)
		{
			$theme['asset_path'] = DOCROOT.$theme['asset_base'];
		}

		// always uses forward slashes (DS is a backslash on Windows)
		$theme['asset_base'] = str_replace(DS, '/', $theme['asset_base']);

		return $theme;
	}
protected function create_theme_array ( $ theme ) { if ( ! is_array ( $ theme ) ) { if ( ! $ path = $ this -> find ( $ theme ) ) { throw new \ ThemeException ( sprintf ( 'Theme "%s" could not be found.' , $ theme ) ) ; } $ theme = array ( 'name' => $ theme , 'path' => $ path , ) ; } else { if ( ! isset ( $ theme [ 'name' ] ) or ! isset ( $ theme [ 'path' ] ) ) { throw new \ ThemeException ( 'Theme name and path must be given in array config.' ) ; } } // load the theme info file if ( ! isset ( $ theme [ 'info' ] ) ) { $ theme [ 'info' ] = $ this -> load_info ( $ theme ) ; } if ( ! isset ( $ theme [ 'asset_base' ] ) ) { // determine the asset location and base URL $ assets_folder = rtrim ( $ this -> config [ 'assets_folder' ] , DS ) . '/' ; // all theme files are inside the docroot if ( strpos ( $ path , DOCROOT ) === 0 and is_dir ( $ path . $ assets_folder ) ) { $ theme [ 'asset_path' ] = $ path . $ assets_folder ; $ theme [ 'asset_base' ] = str_replace ( DOCROOT , '' , $ theme [ 'asset_path' ] ) ; } // theme views and templates are outside the docroot else { $ theme [ 'asset_base' ] = $ assets_folder . $ theme [ 'name' ] . '/' ; } } if ( ! isset ( $ theme [ 'asset_path' ] ) and strpos ( $ theme [ 'asset_base' ] , '://' ) === false ) { $ theme [ 'asset_path' ] = DOCROOT . $ theme [ 'asset_base' ] ; } // always uses forward slashes (DS is a backslash on Windows) $ theme [ 'asset_base' ] = str_replace ( DS , '/' , $ theme [ 'asset_base' ] ) ; return $ theme ; }
Creates a theme array by locating the given theme and setting all of the
option.  It will throw a \ThemeException if it cannot locate the theme.

@param   string  $theme  Theme name to set active
@return  array   The theme array
@throws  \ThemeException
Creates a theme array by locating the given theme and setting all of the option . It will throw a \ ThemeException if it cannot locate the theme .