File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616$ ua = getVar ("ua " );
1717
1818// include _include in path - for development
19- $ test = getVar ("test " );
19+ $ dev = getVar ("dev " );
20+
21+ // general path
2022$ path = getVar ("path " );
2123
24+ // specific paths
25+ $ css_path = getVar ("css_path " );
26+ $ js_path = getVar ("js_path " );
27+
2228$ deviceClass = new DeviceCore ();
2329$ identification = $ deviceClass ->identifyDevice ($ ua ? $ ua : $ _SERVER ["HTTP_USER_AGENT " ]);
2430if ($ identification && isset ($ identification ["device_id " ])) {
3541#<script type="text/javascript" src="http://devices.dearapi.com/js-include/"></script>
3642#<script type="text/javascript" src="http://devices.dearapi.com/js-include/?test=true"></script>
3743
44+ // what file to include?
45+ $ file = ($ dev ? "lib/ " : "" )."seg_ " .$ device ["segment " ].($ dev ? "_include " : "" );
46+
3847?>
39- document.write('<link type="text/css" rel="stylesheet" media="all" href="<?= $ path ? $ path : "" ?> /css/<?= ($ test ? "lib/ " : "" ) ?> seg_<?= $ device ["segment " ] ?> <?= ($ test ? "_include " : "" ) ?> .css" />');
40- document.write('<script type="text/javascript" src="<?= $ path ? $ path : "" ?> /js/<?= ($ test ? "lib/ " : "" ) ?> seg_<?= $ device ["segment " ] ?> <?= ($ test ? "_include " : "" ) ?> .js"></script>');
48+
49+ <? if ($ css_path ): ?>
50+ document.write('<link type="text/css" rel="stylesheet" media="all" href="<?= $ css_path ?> /<?= $ file ?> .css" />');
51+ <? else : ?>
52+ document.write('<link type="text/css" rel="stylesheet" media="all" href="<?= $ path ? $ path : "" ?> /css/<?= $ file ?> .css" />');
53+ <? endif ; ?>
54+
55+ <? if ($ js_path ): ?>
56+ document.write('<script type="text/javascript" src="<?= $ js_path ?> /<?= $ file ?> .js"></script>');
57+ <? else : ?>
58+ document.write('<script type="text/javascript" src="<?= $ path ? $ path : "" ?> /js/<?= $ file ?> .js"></script>');
59+ <? endif ; ?>
You can’t perform that action at this time.
0 commit comments