XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
XCube_Theme.class.php
1<?php
12
19 public $mName;
20
26 public $mDirname;
27
33 public $mDepends = [];
34
35 public $mVersion;
36
37 public $mUrl;
38
39 public $mThemeOptions;
40
46 public $mRenderSystemName;
47
53 public $mScreenShot;
54
55 public $mDescription;
56
62 public $mFormat;
63
64 public $mAuthor;
65
69 public $mLicence;
70
71 public $mLicense;
72
73 public $_mManifesto = [];
74
82 public function loadManifesto( $file ) {
83 if ( file_exists( $file ) ) {
84 $iniHandler = new XCube_IniHandler( $file, true );
85 $this->_mManifesto = $iniHandler->getAllConfig();
86 $this->mName = $this->_mManifesto['Manifesto']['Name'] ?? '';
87 $this->mDepends = $this->_mManifesto['Manifesto']['Depends'] ?? '';
88 $this->mVersion = $this->_mManifesto['Manifesto']['Version'] ?? '';
89 $this->mUrl = $this->_mManifesto['Manifesto']['Url'] ?? '';
90 $this->mThemeOptions = $this->_mManifesto['Manifesto']['ThemeOptions'] ?? '';
91
92 $this->mRenderSystemName = $this->_mManifesto['Theme']['RenderSystem'] ?? '';
93 $this->mAuthor = $this->_mManifesto['Theme']['Author'] ?? '';
94
95 if ( isset( $this->_mManifesto['Theme']['ScreenShot'] ) ) {
96 $this->mScreenShot = $this->_mManifesto['Theme']['ScreenShot'];
97 }
98
99 if ( isset( $this->_mManifesto['Theme']['Description'] ) ) {
100 $this->mDescription = $this->_mManifesto['Theme']['Description'];
101 }
102
103 $this->mFormat = $this->_mManifesto['Theme']['Format'] ?? '';
104
105 if ( isset( $this->_mManifesto['Theme']['License'] ) ) {
106 $this->mLicense = $this->_mManifesto['Theme']['License'];
107 $this->mLicence = $this->_mManifesto['Theme']['License'];
108 } elseif ( isset( $this->_mManifesto['Theme']['Licence'] ) ) { // For typo English, French
109 $this->mLicense = $this->_mManifesto['Theme']['Licence'];
110 $this->mLicence = $this->_mManifesto['Theme']['Licence'];
111 }
112
113 return true;
114 }
115
116 return false;
117 }
118}