Цитата:
Сообщение от void
Не белая страница, а вывод ошибок отключен. Или включите вывод ошибок, или посмотрите в error.log вашего апача.
|
Fatal error: Cannot redeclare user_ismobile() (previously declared in /var/www/rada/fileadmin/user_mobile.php:4) in /var/www/rada/fileadmin/user_mobile.php on line 5
Сам файл user_mobile.php:
<?php
function user_isMobile() {
return preg_match('/(IEMobile|Windows CE|NetFront|PlayStation|PLAYSTATION|like Mac OS X|MIDP|UP\.Browser|Symbian|Nintendo)/', $_SERVER['HTTP_USER_AGENT']);
}
class user_mobile {
/**
* Checks if current browser is a mobile phone. If yes, checks that
* child template given in 'value' of the configuration exists for the
* current template object. If it does, returns corresponding
* child template name
*
* @param array $conf Configuration for this function (parameters: conf and toRecord)
* @param tx_templavoila_pi1 $pObj Parent object
*/
public function getChildTemplate(array $conf, tx_templavoila_pi1& $pObj) {
$result = '';
if ($conf['conf']['value'] && user_isMobile()) {
// We got a mobile browser! Check if we have a mobile TO
$toRec = $pObj->markupObj->getTemplateRecord($conf['toRecord']['tx_templavoila_to'], $conf['conf']['value'], $GLOBALS['TSFE']->sys_language_uid);
if (is_array($toRec)) {
$result = $conf['conf']['value'];
}
}
return $result;
}
}
?>