Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving to its own folder for easy of git Signed-off-by: thebestsophist <bernardy@enguin.com>
- Loading branch information
thebestsophist
committed
Mar 6, 2012
0 parents
commit c58d999
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
Class Extension_ScreeDetection extends Extension { | ||
|
||
public function about() { | ||
return array( | ||
'author' => array( | ||
'email' => 'hello@enguin.com', | ||
'name' => 'Enguin Design', | ||
'website' => 'http://enguindesign.com' | ||
), | ||
'description' => 'This extention adds user screen information to the symphony param pool for server-side optimizations for responsive web design.', | ||
'name' => 'Screen Detection', | ||
'release-date' => '2012-03-06', | ||
'version' => '2012.03.01' | ||
); | ||
} | ||
|
||
public function install() { | ||
Symphony::Configuration()->set('screen_detection_enabled', 'true', 'screen_detection'); | ||
} | ||
|
||
public function uninstall() { | ||
Symphony::Configuration()->remove('screen_detection'); | ||
} | ||
|
||
public function getSubscribedDelegates(){ | ||
return array( | ||
|
||
array( | ||
'page' => '/frontend/', | ||
'delegate' => 'FrontendParamsResolve', | ||
'callback' => 'addParam' | ||
) | ||
); | ||
} | ||
|
||
|
||
public function addParam($context) { | ||
|
||
$screen_height = !empty($_COOKIE['screen-height']) ? $_COOKIE['screen-height'] : 0; | ||
$screen_width = !empty($_COOKIE['screen-width']) ? $_COOKIE['screen-width'] : 0; | ||
$screen_orientation = !empty($_COOKIE['screen-orientation']) ? $_COOKIE['screen-orientation'] : 0; | ||
|
||
|
||
} | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Screen detection |