Skip to content

Commit

Permalink
Merge pull request #1708 from phaidon/remove-jquery-mobile
Browse files Browse the repository at this point in the history
Mobile theme removed, closes #1046, #1336
  • Loading branch information
Guite committed May 31, 2014
2 parents 3eaa542 + 845e910 commit 9564801
Show file tree
Hide file tree
Showing 51 changed files with 3 additions and 1,252 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"imagine/Imagine": "dev-master",
"matthiasnoback/symfony-service-definition-validator": "dev-master",
"michelf/php-markdown": "1.3.*@dev",
"mobiledetect/mobiledetectlib": "~2",
"phpids/phpids": "dev-master",
"sensio/distribution-bundle": "~2.3",
"sensio/framework-extra-bundle": "~3.0",
Expand Down
32 changes: 0 additions & 32 deletions src/lib/util/UserUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -1830,38 +1830,6 @@ public static function getTheme($force = false)
// theme passed as parameter takes priority, can be RSS, Atom, Printer or other
$pagetheme = $theme;
} else {
$thememobile = ModUtil::getVar('ZikulaThemeModule', 'mobile_theme_name', 'Mobile');
if (empty($thememobile)) {
$thememobile = 'Mobile';
}

$enableMobileTheme = ModUtil::getVar('ZikulaThemeModule', 'enable_mobile_theme', 0);
if (CookieUtil::getCookie('zikula_mobile_theme') == '1' && $enableMobileTheme) {
// Mobile theme has been manually chosen by the user.
$pagetheme = $thememobile;
} else if (CookieUtil::getCookie('zikula_mobile_theme') != '2' && $enableMobileTheme) {
// Mobile theme has not been manually disabled by the user.
$detect = new \Mobile_Detect();
if ($detect->isMobile()) {
// Smartphone, tablet or other mobile device.
if ($enableMobileTheme == 1) {
// Enable for every mobile device.
$pagetheme = $thememobile;
} else if ($enableMobileTheme == 2 && !$detect->isTablet()) {
// Enable for smartphones only
$pagetheme = $thememobile;
} else if ($enableMobileTheme == 3 && $detect->isTablet()) {
// Enable for tablets only
$pagetheme = $thememobile;
}
}
}
// check for specified mobile domain to force mobile theme
$themedomain = ModUtil::getVar('ZikulaThemeModule', 'mobile_theme_domain', '');
if ($themedomain && $_SERVER['SERVER_NAME'] == $themedomain) {
$pagetheme = $thememobile;
}

// check for specified alternative site view domain and theme
$themedomain = ModUtil::getVar('ZikulaThemeModule', 'alt_theme_domain', '');
if ($themedomain && $_SERVER['SERVER_NAME'] == $themedomain && ModUtil::getVar('ZikulaThemeModule', 'alt_theme_name', '')) {
Expand Down
2 changes: 1 addition & 1 deletion src/system/Zikula/Module/ThemeModule/Api/UserApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ public function resettodefault($args)
*/
public function _getthemedomain($themename)
{
if (in_array($themename, array('Andreas08', 'Atom', 'Mobile', 'Printer', 'RSS', 'SeaBreeze'))) {
if (in_array($themename, array('Andreas08', 'Atom', 'Printer', 'RSS', 'SeaBreeze'))) {
return 'zikula';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1347,9 +1347,6 @@ public function modifyconfigAction()
* @type int $maxsizeforlinks maxmimum size for link text
* @type bool $theme_change allow users to change themes
* @type string $admintheme admin theme for site
* @type bool $enable_mobile_theme enable mobile detectio
* @type string $mobile_theme_name name of theme for mobile users
* @type string $mobile_theme_domain domain to use when forcing mobile theme
* @type string $alt_theme_name name of alternate theme
* @type string $alt_theme_domain domain to use when forcing alternate themes
* @type int $itemsperpage items per page in admin view
Expand Down Expand Up @@ -1420,15 +1417,6 @@ public function updateconfigAction(array $args = array())
$admintheme = (string)$this->request->request->get('admintheme', isset($args['admintheme']) ? $args['admintheme'] : '');
ModUtil::setVar('Admin', 'admintheme', $admintheme);

$enable_mobile_theme = (int)$this->request->request->get('enable_mobile_theme', isset($args['enable_mobile_theme']) ? $args['enable_mobile_theme'] : false);
$this->setVar('enable_mobile_theme', $enable_mobile_theme);

$mobile_theme_name = (string)$this->request->request->get('mobile_theme_name', isset($args['mobile_theme_name']) ? $args['mobile_theme_name'] : '');
$this->setVar('mobile_theme_name', $mobile_theme_name);

$mobile_theme_domain = (string)$this->request->request->get('mobile_theme_domain', isset($args['mobile_theme_domain']) ? $args['mobile_theme_domain'] : '');
$this->setVar('mobile_theme_domain', $mobile_theme_domain);

$alt_theme_name = (string)$this->request->request->get('alt_theme_name', isset($args['alt_theme_name']) ? $args['alt_theme_name'] : '');
$this->setVar('alt_theme_name', $alt_theme_name);

Expand Down
24 changes: 0 additions & 24 deletions src/system/Zikula/Module/ThemeModule/Controller/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,28 +111,4 @@ public function resettodefaultAction()

return new RedirectResponse(System::normalizeUrl(ModUtil::url($this->name, 'user', 'index')));
}

/**
* Enable mobile Theme
*
* @return void
*/
public function enableMobileTheme()
{
CookieUtil::setCookie('zikula_mobile_theme', '1', time()+3600*24*365, '/');

return new RedirectResponse(System::normalizeUrl(System::getHomepageUrl()));
}

/**
* Disable mobile Theme
*
* @return void
*/
public function disableMobileTheme()
{
CookieUtil::setCookie('zikula_mobile_theme', '2', time()+3600*24*365, '/');

return new RedirectResponse(System::normalizeUrl(System::getHomepageUrl()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<option value="">{gt text="Use site's theme"}</option>
{html_select_themes state='ThemeUtil::STATE_ACTIVE'|const filter='ThemeUtil::FILTER_ADMIN'|const selected=$admintheme}
</select>
<em class="sub help-block">{gt text='This theme will be used in the admin interface of Zikula. This setting does not override the mobile theme setting in admin area.'}</em>
<em class="sub help-block">{gt text='This theme will be used in the admin interface of Zikula.'}</em>
</div>
</div>
<div class="form-group">
Expand All @@ -49,37 +49,6 @@
</div>
</div>
</fieldset>
<fieldset>
<legend>{gt text="Mobile theme"}</legend>
<div class="form-group">
<label class="col-lg-3 control-label" for="mobile_theme_name">{gt text="Mobile theme"}</label>
<div class="col-lg-9">
<select class="form-control" id="mobile_theme_name" name="mobile_theme_name">
<option value="">{gt text="Use default mobile theme"}</option>
{html_select_themes state='ThemeUtil::STATE_ACTIVE'|const selected=$mobile_theme_name|default:''}
</select>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label" for="mobile_theme_domain">{gt text="Mobile theme domain"}</label>
<div class="col-lg-9">
<input id="mobile_theme_domain" type="text" class="form-control" name="mobile_theme_domain" value="{$mobile_theme_domain|default:''|safetext}" size="50" />
<em class="sub help-block">{gt text='This forces the mobile theme if your server is visited via the specified url, e.g. m.example.com'}</em>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label" for="enable_mobile_theme">{gt text="Mobile device detection"}</label>
<div class="col-lg-9">
<select class="form-control" id="enable_mobile_theme" name="enable_mobile_theme">
<option value="0">{gt text="Disabled"}</option>
<option value="1"{if $enable_mobile_theme == 1} selected="selected"{/if}>{gt text="Enabled: force for smartphones and tablets"}</option>
<option value="2"{if $enable_mobile_theme == 2} selected="selected"{/if}>{gt text="Enabled: force for smartphones only"}</option>
<option value="3"{if $enable_mobile_theme == 3} selected="selected"{/if}>{gt text="Enabled: force for tablets only"}</option>
</select>
<em class="sub help-block">{gt text='Here you can decide if you want to automatically enable the mobile theme for mobile devices.'}</em>
</div>
</div>
</fieldset>
<fieldset>
<legend>{gt text="Compilation"}</legend>
<div class="form-group">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public function install()
$this->setVar('render_cache', false);
$this->setVar('render_expose_template',false);
$this->setVar('render_lifetime', 3600);
$this->setVar('enable_mobile_theme', false);

// Initialisation successful
return true;
Expand All @@ -78,7 +77,7 @@ public function upgrade($oldversion)
{
switch ($oldversion) {
case '3.4.2':
$this->setVar('enable_mobile_theme', false);
$this->delVar('enable_mobile_theme');
// future upgrade
}

Expand Down
20 changes: 0 additions & 20 deletions src/themes/Zikula/Theme/MobileTheme/MobileThemeVersion.php

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions src/themes/Zikula/Theme/MobileTheme/Resources/config/home.ini

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions src/themes/Zikula/Theme/MobileTheme/Resources/config/overrides.yml

This file was deleted.

This file was deleted.

Empty file.

This file was deleted.

79 changes: 0 additions & 79 deletions src/themes/Zikula/Theme/MobileTheme/Resources/public/css/style.css

This file was deleted.

Binary file not shown.
Loading

0 comments on commit 9564801

Please sign in to comment.