28 public function load($sOXID)
30 $sFilePath = $this->
getConfig()->getViewsDir().$sOXID.
"/theme.php";
31 if ( file_exists( $sFilePath ) && is_readable( $sFilePath ) ) {
34 $this->_aTheme = $aTheme;
35 $this->_aTheme[
'id'] = $sOXID;
52 throw oxNew(
"oxException", $sError );
54 $sParent = $this->
getInfo(
'parentTheme');
56 $this->
getConfig()->saveShopConfVar(
"str",
'sTheme', $sParent);
57 $this->
getConfig()->saveShopConfVar(
"str",
'sCustomTheme', $this->
getId());
59 $this->
getConfig()->saveShopConfVar(
"str",
'sTheme', $this->
getId());
60 $this->
getConfig()->saveShopConfVar(
"str",
'sCustomTheme',
'');
71 $this->_aThemeList = array();
72 $sOutDir = $this->
getConfig()->getViewsDir();
73 foreach ( glob( $sOutDir.
"*", GLOB_ONLYDIR ) as $sDir ) {
74 $oTheme =
oxNew(
'oxTheme');
75 if ($oTheme->load(basename($sDir))) {
76 $this->_aThemeList[$sDir] = $oTheme;
91 if (!isset($this->_aTheme[$sName])) {
94 return $this->_aTheme[$sName];
104 $sCustTheme = $this->
getConfig()->getConfigParam(
'sCustomTheme');
108 return $this->
getConfig()->getConfigParam(
'sTheme');
118 $sParent = $this->
getInfo(
'parentTheme');
122 $oTheme =
oxNew(
'oxTheme');
123 if ($oTheme->load($sParent)) {
137 if (!$this->
getId()) {
138 return 'EXCEPTION_THEME_NOT_LOADED';
142 $sParentVersion = $oParent->getInfo(
'version');
143 if (!$sParentVersion) {
144 return 'EXCEPTION_PARENT_VERSION_UNSPECIFIED';
146 $aMyParentVersions = $this->
getInfo(
'parentVersions');
147 if (!$aMyParentVersions || !is_array($aMyParentVersions)) {
148 return 'EXCEPTION_UNSPECIFIED_PARENT_VERSIONS';
150 if (!in_array($sParentVersion, $aMyParentVersions)) {
151 return 'EXCEPTION_PARENT_VERSION_MISMATCH';
153 } elseif ($this->
getInfo(
'parentTheme')) {
154 return 'EXCEPTION_PARENT_THEME_NOT_FOUND';