function Overlay_before_Q_responseExtras() { $app = Q_Config::expect('Q', 'app'); Q_Response::addStylesheet('plugins/Q/css/Q.css'); Q_Response::addStylesheet('css/Overlay.css', '@end'); Q_Response::addStylesheet('http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,300,700'); if (Q_Config::get('Q', 'firebug', false)) { Q_Response::addScript("https://getfirebug.com/firebug-lite-debug.js"); } Q_Response::addScript('js/Overlay.js'); Q_Response::setMeta("title", "Customize My Pic!"); Q_Response::setMeta("description", "Make a statement on Facebook by customizing your profile picture, even from your smartphone."); Q_Response::setMeta("image", Q_Html::themedUrl('img/icon/icon.png')); if (Q_Request::isIE()) { header("X-UA-Compatible", "IE=edge"); } header('Vary: User-Agent'); // running an event for loading action-specific extras (if there are any) $uri = Q_Dispatcher::uri(); $module = $uri->module; $action = $uri->action; $event = "{$module}/{$action}/response/responseExtras"; if (Q::canHandle($event)) { Q::event($event); } }
function Q_response_content() { $app = Q_Config::expect('Q', 'app'); $url = Q_Request::url(); $module = Q_Dispatcher::uri()->module; if (empty($module)) { return Q::event("{$app}/notFound/response/content"); } $action = Q_Dispatcher::uri()->action; $event = "{$module}/{$action}/response/content"; if (!Q::canHandle($event)) { return Q::event("{$app}/notFound/response/content"); } Q_Response::setMeta('format-detection', 'telephone=no,date=no,address=no,email=no,url=no'); // Go ahead and fire the event, returning the result. return Q::event($event); }
function Websites_before_Q_responseExtras() { $user = Users::loggedInUser(false, false); $userId = $user ? $user->id : ""; $websitesUserId = Users::communityId(); $sha1 = sha1(Q_Dispatcher::uri()); $seoStreamName = "Websites/seo/{$sha1}"; $stream = Streams::fetchOne($userId, $websitesUserId, $seoStreamName); if ($stream) { $fields = Q::take($stream->getAllAttributes(), array('keywords', 'description')); foreach ($fields as $k => $v) { Q_Response::setMeta($k, $v); } Q_Response::setSlot('title', $stream->getAttribute('title')); } Q_Response::setScriptData('Q.plugins.Websites.seoStreamName', $seoStreamName); Q_Response::setScriptData('Q.plugins.Websites.userId', Users::communityId()); Q_Response::setScriptData('Q.plugins.Websites.seoReload', Q_Config::expect('Websites', 'seoReload')); }
function Websites_before_Q_responseExtras() { $user = Users::loggedInUser(false, false); $userId = $user ? $user->id : ""; $websitesUserId = Q_Config::expect("Websites", "user", "id"); $sha1 = sha1(Q_Dispatcher::uri()); $seoStreamName = "Websites/seo/{$sha1}"; $streams = Streams::fetch($userId, $websitesUserId, array("Websites/header", "Websites/title", "Websites/slogan", $seoStreamName)); if (!empty($streams[$seoStreamName])) { $fields = Q::take($streams[$seoStreamName]->getAllAttributes(), array('keywords', 'description')); foreach ($fields as $k => $v) { Q_Response::setMeta($k, $v); } Q_Response::setSlot('title', $streams[$seoStreamName]->getAttribute('title')); } foreach ($streams as $name => $s) { if ($s) { $s->addPreloaded($userId); } } Q_Response::setScriptData('Q.plugins.Websites.seoStreamName', $seoStreamName); Q_Response::setScriptData('Q.plugins.Websites.userId', Q_Config::expect('Websites', 'user', 'id')); Q_Response::setScriptData('Q.plugins.Websites.seoReload', Q_Config::expect('Websites', 'seoReload')); }