Ejemplo n.º 1
0
	/**
	 * @return string
	 */
	public function icon()
	{
		global $_CB_framework;

		if ( Application::Cms()->getClientId() ) {
			CBActivity::getTemplate( 'twemoji', false, true, false );
		}

		$icon			=	null;
		$emoteClass		=	'streamIconEmote' . ucfirst( strtolower( preg_replace( '/[^-a-zA-Z0-9_]/', '', $this->get( 'value' ) ) ) );

		if ( $this->get( 'icon' ) ) {
			$icon		=	'<img src="' . $_CB_framework->getCfg( 'live_site' ) . '/images/' . htmlspecialchars( $this->get( 'icon' ) ) . '" class="streamIconEmote ' . $emoteClass . ' img-responsive-inline" />';
		} elseif ( $this->get( 'class' ) ) {
			$icon		=	'<span class="streamIconEmote ' . $emoteClass . ' ' . htmlspecialchars( $this->get( 'class' ) ) . '"></span>';
		}

		return $icon;
	}
	/**
	 * Displays tags stream
	 *
	 * @param int       $id
	 * @param Tags      $stream
	 * @param int       $output
	 * @param bool      $data
	 * @param UserTable $user
	 * @param UserTable $viewer
	 */
	private function showTags( $id, $stream, $output, $data, $user, $viewer )
	{
		CBActivity::getTemplate( 'tags', false, false );

		if ( $id ) {
			$stream->set( 'id', $id );

			$rows			=	$stream->data();
		} else {
			if ( $data ) {
				$count		=	$stream->data( true );

				if ( ! $count ) {
					$rows	=	array();
				} else {
					$rows	=	$stream->data();
				}
			} else {
				$rows		=	array();
			}
		}

		if ( $rows ) {
			CBActivity::preFetchUsers( $rows );
		}

		echo HTML_cbactivityTags::showTags( $rows, $stream, $output, $user, $viewer, $this );
	}