File: D:/HostingSpaces/SBogers64/klimroosbudel.nl/wwwroot/kms/lib/general/url_pin.class.php
<?php
/**
* pagePin.class.php
* Created by Komma Mediadesign.
* Author: mike
* Date: 4/10/13
*/
class Url_Pin
{
/*
* Pin a 'url-point'
*/
public static function set($prefix = null)
{
$key = 'url_pin';
if ($prefix != null) {
$key = $prefix.'_'.$key;
}
$stringUrl = substr($_SERVER['REQUEST_URI'], 1);
Session::set($key, $stringUrl);
}
/*
* Get pinned 'url-point'
*/
public static function get($prefix = null)
{
$key = 'url_pin';
if ($prefix != null) {
$key = $prefix.'_'.$key;
}
if ($url = Session::get($key)) {
return $url;
}
return false;
}
/*
* Return to pinned 'url-point'
*/
public static function redirect($prefix = null)
{
$key = 'url_pin';
if ($prefix != null) {
$key = $prefix.'_'.$key;
}
if ($url = Session::get($key)) {
header('location:'.'/'.$url);
exit;
}
}
}