mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-08 18:24:31 +02:00
Merge pull request #7161 from nupplaphil/task/mod_toggle_mobile
Move mod/toggle_mobile to src/Module/ToggleMobile
This commit is contained in:
commit
33ec3d8051
3 changed files with 31 additions and 20 deletions
30
src/Module/ToggleMobile.php
Normal file
30
src/Module/ToggleMobile.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
|
||||
/**
|
||||
* Toggles the mobile view (on/off)
|
||||
*/
|
||||
class ToggleMobile extends BaseModule
|
||||
{
|
||||
public static function content()
|
||||
{
|
||||
$a = self::getApp();
|
||||
|
||||
if (isset($_GET['off'])) {
|
||||
$_SESSION['show-mobile'] = false;
|
||||
} else {
|
||||
$_SESSION['show-mobile'] = true;
|
||||
}
|
||||
|
||||
if (isset($_GET['address'])) {
|
||||
$address = $_GET['address'];
|
||||
} else {
|
||||
$address = '';
|
||||
}
|
||||
|
||||
$a->redirect($address);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue