Merged com.woltlab.wcf.user into WCF
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / system / option / user / GooglePlusUserOptionOutput.class.php
1 <?php
2 namespace wcf\system\option\user;
3 use wcf\data\user\option\UserOption;
4 use wcf\data\user\User;
5 use wcf\util\StringUtil;
6
7 /**
8 * User option output implementation for the output of a google+ user profile.
9 *
10 * @author Jeffrey Reichardt
11 * @copyright 2001-2013 WoltLab GmbH
12 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
13 * @package com.woltlab.wcf.user
14 * @subpackage system.option.user
15 * @category Community Framework
16 */
17 class GooglePlusUserOptionOutput implements IUserOptionOutput {
18 /**
19 * @see wcf\system\option\user\IUserOptionOutput::getOutput()
20 */
21 public function getOutput(User $user, UserOption $option, $value) {
22 if (empty($value)) return '';
23
24 $url = StringUtil::encodeHTML('https://plus.google.com/'.$value.'/posts');
25 $value = StringUtil::encodeHTML($value);
26
27 return '<a href="'.$url.'" class="externalURL"'.(EXTERNAL_LINK_REL_NOFOLLOW ? ' rel="me nofollow"' : ' rel="me"').(EXTERNAL_LINK_TARGET_BLANK ? ' target="_blank"' : '').'>'.$value.'</a>';
28 }
29 }