friendica/src/Module/ToggleMobile.php
nupplaPhil 1de3f186d7
Introduce new DI container
- Adding Friendica\DI class for getting dynamic classes
- Replacing BaseObject::getApp() with this class
2019-12-29 20:16:55 +01:00

32 lines
491 B
PHP

<?php
namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\DI;
/**
* Toggles the mobile view (on/off)
*/
class ToggleMobile extends BaseModule
{
public static function content(array $parameters = [])
{
$a = DI::app();
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);
}
}