Просмотр файла vkclone-0.0.1/protected/components/Theme.php

Размер файла: 1.56Kb
<?php
/**
 * Theme helper
 */
class Theme extends CHtml {
	const ICON_ADD = 'add.png';
	const ICON_ARROW_DOWN = 'arrow_down.png';
	const ICON_ARROW_UP = 'arrow_up.png';
	const ICON_AVATAR = 'avatar.png';
	const ICON_CHAT = 'chat.png';
	const ICON_DELETE = 'delete.png';
	const ICON_DEVIL = 'devil.png';
	const ICON_EDIT = 'edit.png';
	const ICON_FEMALE72 = 'female.72.png';
	const ICON_FEMALE = 'female.png';
	const ICON_FOLDER = 'folder.png';
	const ICON_FORUM = 'forum.png';
	const ICON_FRIENDS = 'friends.png';
	const ICON_GROUP = 'group.png';
	const ICON_IDELETE = 'idelete.png';
	const ICON_IEDIT = 'iedit.png';
	const ICON_INBOX = 'inbox.png';
	const ICON_LOCK = 'lock.png';
	const ICON_MALE72 = 'male.72.png';
	const ICON_MALE = 'male.png';
	const ICON_MUSIC = 'music.png';
	const ICON_OFFLINE = 'offline.gif';
	const ICON_ONLINE = 'online.gif';
	const ICON_OUTBOX = 'outbox.png';
	const ICON_PHOTOCAMERA = 'photocamera.png';
	const ICON_PHOTOS = 'photos.png';
	const ICON_PUBLIC = 'public.png';
	const ICON_READERS = 'readers.png';
	const ICON_SUBSCRIPTIONS = 'subscriptions.png';
	const ICON_USER = 'user.png';

	/**
	 * Renders theme icon
	 */
	static public function icon($src, $alt = null, $htmlOptions = array()) {
		$htmlOptions['class'] = 'icon';
		if ($alt === null)
			$alt = strtok($src, '.');
		return parent::image(Yii::app()->baseUrl.'/images/'.$src, $alt, $htmlOptions);
	}

	/**
	 * Renders user link
	 */
	static public function username(User $user) {
		return parent::tag('strong', array(), parent::link($user->name, array('/users/user/index', 'id' => $user->id)));
	}
}