Merge pull request #2337 from MPOS/mobile-detection

Mobile detection
This commit is contained in:
Sebastian Grewe 2014-08-29 09:11:28 +02:00
commit 09f681b8f9
3 changed files with 1262 additions and 2 deletions

View File

@ -34,13 +34,18 @@ if (file_exists(CLASS_DIR . '/coins/coin_' . $config['algorithm'] . '.class.php'
require_once(INCLUDE_DIR . '/lib/swiftmailer/swift_required.php');
// Detect device
if ( PHP_SAPI == 'cli') {
require_once(INCLUDE_DIR . '/lib/Mobile_Detect.php');
$detect = new Mobile_Detect;
if (!$detect->isMobile()) {
$theme = $setting->getValue('website_mobile_theme', 'bootstrap');
} else if ( PHP_SAPI == 'cli') {
// Create a new compile folder just for crons
// We call mail templates directly anyway
$theme = 'cron';
} else {
// Use configured theme, fallback to default theme
$setting->getValue('website_theme') ? $theme = $setting->getValue('website_theme') : $theme = 'bootstrap';
$theme = $setting->getValue('website_theme', 'bootstrap');
}
define('THEME', $theme);

View File

@ -69,6 +69,13 @@ $aSettings['website'][] = array(
'name' => 'website_theme', 'value' => $setting->getValue('website_theme'),
'tooltip' => 'The default theme used on your pool.'
);
$aSettings['website'][] = array(
'display' => 'Website mobile theme', 'type' => 'select',
'options' => $aThemes,
'default' => 'bootstrap',
'name' => 'website_mobile_theme', 'value' => $setting->getValue('website_mobile_theme'),
'tooltip' => 'The mobile theme used on your pool.'
);
$aSettings['website'][] = array(
'display' => 'Website Design', 'type' => 'select',
'options' => $aDesigns,

File diff suppressed because one or more lines are too long