/** * Update the response meta values with the data contained within a rtPage object. * * @param rtPage $rt_page * @param sfUser $sf_user * @param sfWebResponse $sf_response * @return void */ public static function setCommonMetasFromPage(rtPage $rt_page, sfUser $sf_user, sfWebResponse $sf_response) { $data = array(); $data['robots'] = $rt_page->getSearchable() ? 'index, follow' : 'NONE'; $data['keywords'] = implode(', ', $rt_page->getTags()); $data['title'] = $rt_page->getTitleHead() ? $rt_page->getTitleHead() : $rt_page->getTitle(); $data['description'] = $rt_page->getDescription(); $data['og:title'] = $rt_page->getTitle(); $data['og:type'] = self::getTypeFromObject($rt_page); $data['og:url'] = str_replace('frontend_dev.php/', '', rtSiteToolkit::getCurrentDomain(null, true) . rtSiteToolkit::getRequestUri()); if ($rt_page->getPrimaryImage()) { $img_path = rtAssetToolkit::getThumbnailPath($rt_page->getPrimaryImage()->getSystemPath(), array('maxHeight' => 400, 'maxWidth' => 400)); $data['og:image'] = rtSiteToolkit::getCurrentDomain(null, true) . $img_path; } if (rtSiteToolkit::getCurrentSite()) { $data['og:site_name'] = rtSiteToolkit::getCurrentSite()->getTitle(); } if ($rt_page->getDescription() !== '') { $data['og:description'] = $rt_page->getDescription(); } self::setCommonMetas($data, $sf_response); }
/** * Get the requested URI. * * @return mixed */ public function getUri() { $parts = explode('?', rtSiteToolkit::getRequestUri()); return $this->cleanDevToken($parts[0]); }
/** * Return Twitter:Tweet code snippet * * @see http://twitter.com/about/resources/tweetbutton * @return Mixed */ function get_tweet_badge() { $enabled = sfConfig::get('app_rt_share_tweet', true); if ($enabled) { // Twitter url parameters $twitter_url = 'http://twitter.com/share'; // Twitter share URL $twitter_widget_js_url = 'http://platform.twitter.com/widgets.js'; // Site url and configuration parameters $data_url = rtSiteToolkit::getCurrentDomain(null, true) . rtSiteToolkit::getRequestUri(); // Page URL $data_count = 'horizontal'; // Parameters: none, vertical or horizontal $tweet_text = 'Tweet'; $link_class = 'twitter-share-button'; // Tags $script_start = sprintf('<script type="text/javascript" src="%s">', $twitter_widget_js_url); $script_end = '</script>'; $link_start = sprintf('<a href="%s" class="%s" style="display:block;" data-url="%s" data-count="%s">', $twitter_url, $link_class, urldecode($data_url), $data_count); $link_end = '</a>'; return $script_start . $script_end . $link_start . $tweet_text . $link_end; } return; }
<?php // Cart item row END $i++; } ?> <!-- Gift voucher START --> <?php $vm = $rt_shop_cart_manager->getVoucherManager(); if ($vm->hasSessionVoucher()) { ?> <?php $voucher = $rt_shop_cart_manager->getVoucherManager()->getSessionVoucherArray(); ?> <?php $options = array('rt-voucher-referer' => urlencode(rtSiteToolkit::getRequestUri())); ?> <tr class="rt-shop-cart-voucher"> <td class="rt-shop-cart-primary-image-thumb"><div> </div></td> <td class="rt-shop-cart-details"><?php echo link_to($voucher['title'], 'rt_shop_voucher_edit', $options); ?> <br /> <span><?php echo __('For'); ?> : <?php echo $voucher['first_name']; ?> <?php echo $voucher['last_name'];
<?php use_helper('I18N', 'rtText'); $class = isset($class) ? $class : 'rt-admin-edit-tools-panel-small'; $options = array('class' => 'rt-admin-edit-tools-trigger', 'query_string' => 'rt-snippet-referer=' . urlencode(rtSiteToolkit::getRequestUri())); ?> <?php if ($snippets && $snippets->count()) { ?> <div class="rt-snippet <?php echo $class; ?> "> <?php foreach ($snippets as $snippet) { ?> <!--RTAS <div class="rt-admin-tools"><?php echo link_to(__('Edit Snippet'), 'rtSnippetAdmin/edit?id=' . $snippet->getId(), $options); ?> </div> RTAS--> <?php echo markdown_to_html($snippet->getContent(), $snippet); ?> <?php } ?> </div> <?php