class purl_useragent in Persistent URL 6
Same name and namespace in other branches
- 7 includes/purl_useragent.inc \purl_useragent
User agent style.
Hierarchy
- class \purl_useragent implements purl_processor
Expanded class hierarchy of purl_useragent
1 string reference to 'purl_useragent'
- purl_purl_processor in ./
purl.module - Implementation of hook_purl_processor().
File
- includes/
purl_useragent.inc, line 6
View source
class purl_useragent implements purl_processor {
public function method() {
return 'useragent';
}
public function admin_form(&$form, $id) {
}
public function description() {
return t('Enter a user agent for this context, such as "iPhone".');
}
public function detect($q) {
$useragent = $_SERVER['HTTP_USER_AGENT'];
if (!empty($useragent)) {
return $useragent;
}
return '';
}
/**
* See a valid value is present in the HTTP_USER_AGENT. Note: we're using
* stripos() which makes this check relatively easy to pass..
*/
public function parse($valid_values, $useragent) {
foreach ($valid_values as $key => $value) {
if (stripos($useragent, $key) !== FALSE) {
return purl_path_elements($this, $valid_values);
}
}
}
/**
* We cannot alter the user agent, no need to try.
*/
public function adjust(&$value, $element, &$q) {
}
public function rewrite(&$path, &$options, $element) {
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
purl_useragent:: |
public | function |
We cannot alter the user agent, no need to try. Overrides purl_processor:: |
|
purl_useragent:: |
public | function |
Allow extension of the admin setup form. Overrides purl_processor:: |
|
purl_useragent:: |
public | function |
Provide a description of processor for the end user Overrides purl_processor:: |
|
purl_useragent:: |
public | function |
Detect the the processor value for the current page request Overrides purl_processor:: |
|
purl_useragent:: |
public | function |
Return the method the processor users. Overrides purl_processor:: |
|
purl_useragent:: |
public | function |
See a valid value is present in the HTTP_USER_AGENT. Note: we're using
stripos() which makes this check relatively easy to pass.. Overrides purl_processor:: |
|
purl_useragent:: |
public | function |
Responsible for rewriting outgoing links. Note: it's this functions
job to make sure it doesn't alter a link that has already been
treated. Overrides purl_processor:: |