hmm its alot to take
but i asked for it
I want them to be never included
I'll explain in sort of detail how the plugin works
step 1 :
theme_index_top triggered for detection of mobile device (to redirect) / url is already mobile
then the all-in-one 'template' is triggered (which is basicly a sum of all the mobileHooks
step 2 :
the mobileHooks are triggered one by one to fill the page with content
i dont use any plugin hooks in the theme to prevent content to be W3C mobile incompatible as i dont use the pluginHooks it would make no sense to me to include all the scripts and css so my header currently exists of :
$h->pluginHook('mobile_hook','mobile',array('mobile_head_start'));
$h->pluginHook('mobile_hook','mobile',array('mobile_head'));
$h->pluginHook('mobile_hook','mobile',array('mobile_head_end'));
the advantage is that i can still add plugin hook to the theme like header_include_raw and doInclude (not really one but you get the point)
but if i do use a pluginhook it will automatically get scripts so header_include_raw is useless in my eyes
doIncludes would be a great options if i can remove any items from the list
so i think im going with te custom function
before $h->pluginHook('mobile_hook','mobile',array('mobile_head_end')); is triggered i'll add:
HTML Code:
<link rel="stylesheet" type="text/css" href=" BASEURL . ?client=mobile&type=css" />
to get all the independant css files (like mobile_sb_base.css) which can be overriden by a THEME/css/mobile_sb_base.css and compress them with a custom function like this one:
Code:
header('Content-type: text/css');
ob_start("compress");
function compress($buffer) {
/* remove comments */
$buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);
/* remove tabs, spaces, newlines, etc. */
$buffer = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $buffer);
return $buffer;
}
/* your css files */
include('master.css');
include('typography.css');
include('grid.css');
include('print.css');
include('handheld.css');
ob_end_flush();
Bookmarks