175 |
175 |
}
|
176 |
176 |
|
177 |
177 |
/**
|
178 |
|
* Returns the value for a Admin Panel setting. You must specify both the module-key and the internal setting key.
|
|
178 |
* Returns the value for a Admin Panel setting. You can specify both module-key and internal setting key or the module-key, only.
|
179 |
179 |
*
|
180 |
180 |
* @param string Module key
|
181 |
181 |
* @param string Setting key
|
182 |
182 |
* @return string The setting value
|
183 |
183 |
*/
|
184 |
|
public function extGetFeAdminValue($pre, $val='') {
|
|
184 |
public function extGetFeAdminValue($pre, $val= '') {
|
185 |
185 |
// Check if module is enabled.
|
186 |
186 |
if ($this->isAdminModuleEnabled($pre)) {
|
187 |
187 |
// Exceptions where the values can be overridden from backend:
|
... | ... | |
193 |
193 |
return true;
|
194 |
194 |
}
|
195 |
195 |
|
|
196 |
// preview module is enabled, so we want the preview.
|
|
197 |
if ($pre == 'preview' && !$val) {
|
|
198 |
return true;
|
|
199 |
}
|
|
200 |
|
196 |
201 |
// override all settings with user TSconfig
|
197 |
|
if ($GLOBALS['BE_USER']->extAdminConfig['override.'][$pre . '.'][$val] && $val) {
|
|
202 |
if ($val && isset($GLOBALS['BE_USER']->extAdminConfig['override.'][$pre . '.'][$val])) {
|
198 |
203 |
return $GLOBALS['BE_USER']->extAdminConfig['override.'][$pre . '.'][$val];
|
199 |
204 |
}
|
|
205 |
|
|
206 |
// $GLOBALS['BE_USER']->extAdminConfig['override.'][$pre] contains the default value for all settings.
|
|
207 |
// if they are not explicitely overridden, this default value applies.
|
200 |
208 |
if ($GLOBALS['BE_USER']->extAdminConfig['override.'][$pre]) {
|
201 |
209 |
return $GLOBALS['BE_USER']->extAdminConfig['override.'][$pre];
|
202 |
210 |
}
|
203 |
211 |
|
204 |
|
$retVal = $val ? $GLOBALS['BE_USER']->uc['TSFE_adminConfig'][$pre . '_' . $val] : 1;
|
|
212 |
// get value from adminPanel itself
|
|
213 |
if ($val) {
|
|
214 |
$retVal = $GLOBALS['BE_USER']->uc['TSFE_adminConfig'][$pre . '_' . $val];
|
|
215 |
} else {
|
|
216 |
$retVal= 1;
|
|
217 |
}
|
205 |
218 |
|
|
219 |
// return the value if the preview is forced even if the module is not open.
|
206 |
220 |
if ($pre=='preview' && $this->ext_forcePreview) {
|
207 |
|
if (!$val) {
|
208 |
|
return true;
|
209 |
|
} else {
|
210 |
|
return $retVal;
|
211 |
|
}
|
|
221 |
return $retVal;
|
212 |
222 |
}
|
213 |
|
// regular check:
|
|
223 |
|
|
224 |
// only return the value if the module is open.
|
214 |
225 |
if ($this->isAdminModuleOpen($pre)) { // See if the menu is expanded!
|
215 |
226 |
return $retVal;
|
216 |
227 |
}
|
... | ... | |
226 |
237 |
}
|
227 |
238 |
}
|
228 |
239 |
}
|
229 |
|
|
|
240 |
|
230 |
241 |
/**
|
231 |
242 |
* Enables the force preview option.
|
232 |
243 |
*
|