예제 #1
0
 protected function avatar($user)
 {
     $avatar = URL_IMG . 'avatar' . DASH . $user->getGender() . EXT_PNG;
     if ($user->getAvatar()) {
         $avatar = URL_PHOTOS . $user->getId() . SLASH . 'avatar' . EXT_JPG;
     }
     return DOMFactory::getLink($this->url->getCustomActionURL('profile', $user->getLogin()), DOMFactory::getImage($avatar))->addClass('avatar');
 }
예제 #2
0
 private function prepareMainLinks()
 {
     $friendsLink = DOMFactory::getLink($this->url->getCustomActionURL('friends'), Bundle::get('link.header.friends.link'))->addClass('bold tahoma-13');
     $friendsFindLink = DOMFactory::getLink($this->url->getCustomActionURL('friends', 'find'), Bundle::get('link.header.friends.find.link'))->addClass('bold tahoma-13');
     $videoLink = DOMFactory::getLink($this->url->getCustomActionURL('video'), Bundle::get('link.header.video'))->addClass('bold tahoma-13');
     $addVideoLink = DOMFactory::getLink($this->url->getCustomActionURL('video', 'add'), Bundle::get('link.header.video.add'))->addClass('bold tahoma-13');
     $this->template->friendsLink = DOMFactory::getLi($friendsLink);
     $this->template->friendsFindLink = DOMFactory::getLi($friendsFindLink);
     $this->template->videoLink = DOMFactory::getLi($videoLink);
     $this->template->addVideoLink = DOMFactory::getLi($addVideoLink);
 }
예제 #3
0
 private function makeComment($comment)
 {
     $avatar = $this->prepareAvatar($comment->getUser());
     $author = DOMFactory::getDiv($avatar)->addId('comment-avatar');
     $link = $this->url->getCustomActionURL('profile', $comment->getLogin());
     $nameLink = DOMFactory::getLink($link, $comment->getName());
     $content = DOMFactory::getDiv($nameLink)->addClass('name');
     $content .= DOMFactory::getDiv($comment->getContent());
     $content .= DOMFactory::getDiv('Added on: ' . Date::convert($comment->getDate(), 'j F Y'))->addClass('date');
     $author .= DOMFactory::getDiv($content)->addId('comment-author');
     $section = DOMFactory::getDiv($author)->addId('comment');
     $section .= DOMFactory::getDiv()->addClass('separator');
     return $section;
 }
예제 #4
0
 protected function account()
 {
     $profile = $this->values->profile;
     $this->template->name = $profile->getFirstname() . SPACE . $profile->getLastname();
     $photo = URL_IMG . 'profile' . DASH . $profile->getGender() . EXT_PNG;
     if ($profile->getAvatar()) {
         $photo = URL_PHOTOS . $profile->getId() . SLASH . 'profile' . EXT_JPG;
     }
     $this->template->photo = DOMFactory::getLink($this->url->getCustomActionURL('profile', $profile->getLogin()), DOMFactory::getImage($photo)->addClass('photo-frame'));
     $this->template->videoLink = DOMFactory::getLink($this->url->getCustomActionURL('video', 'user', array($profile->getLogin())), 'Videos')->addClass('tahoma-13')->addStyle('margin-right: 6px;');
     $this->template->photosLink = DOMFactory::getLink($this->url->getCustomActionURL('photos', 'user', array($profile->getLogin())), 'Photos')->addClass('tahoma-13')->addStyle('margin-right: 6px;');
     $this->template->friendsLink = DOMFactory::getLink($this->url->getCustomActionURL('friends', 'user', array($profile->getLogin())), 'Friends')->addClass('tahoma-13')->addStyle('margin-right: 6px;');
     $this->template->blogLink = DOMFactory::getLink($this->url->getCustomActionURL('blog', 'user', array($profile->getLogin())), 'Blog')->addClass('tahoma-13')->addStyle('margin-right: 6px;');
     $this->template->show($this->url->getActionPath());
 }
예제 #5
0
 public static function make($pages)
 {
     $url = URL::getInstance();
     $zero = $url->getParameter(self::ZERO);
     $one = $url->getParameter(self::ONE);
     $pageIndex = '';
     for ($i = self::ONE; $i <= intval($pages); $i++) {
         $link = DOMFactory::getLink($url->getParamURL(array($zero, $i)), $i);
         if ($i == $one || $one == null && $i == self::ONE) {
             $link = $i;
         }
         $pageIndex .= $link . SPACE;
     }
     return $pageIndex;
 }
예제 #6
0
 protected function show()
 {
     if ($this->values->error) {
         $this->template->message = DOMFactory::getDiv($this->values->error)->addClass('error');
     }
     $commentView = new CommentView();
     $commentView->produceComments();
     $this->template->type = $this->url->getController();
     $this->template->id = $this->url->getParameter(0);
     $this->template->sourceId = $this->values->video->getSourceId();
     $this->template->title = $this->values->video->getTitle();
     $this->template->description = $this->values->video->getDescription();
     $this->template->duration = $this->values->video->getLength();
     $this->template->date = Date::convert($this->values->video->getDate(), 'j F Y');
     $this->template->videoObject = $this->template->getTemplate('video', $this->values->video->getType());
     $this->template->link = $this->url->getURL();
     $link = $this->url->getCustomActionURL('profile', $this->values->video->getLogin());
     $this->template->username = DOMFactory::getLink($link, $this->values->video->getUsername());
     $this->template->show($this->url->getActionPath());
 }