Example #1
0
 public function Render()
 {
     $slices = $this->Base->GetSlices();
     echo "<div class=\"Avatar Avatar" . $this->Base->ID . "\" style=\"";
     if ($this->Left != null) {
         echo "left: " . $this->Left . "px; ";
     }
     if ($this->Top != null) {
         echo "top: " . $this->Top . "px; ";
     }
     if ($this->ZoomFactor != null) {
         echo "transform: scale(" . $this->ZoomFactor . "); ";
         echo "-webkit-transform: scale(" . $this->ZoomFactor . "); ";
         echo "-o-transform: scale(" . $this->ZoomFactor . "); ";
         echo "-ms-transform: scale(" . $this->ZoomFactor . "); ";
         echo "-moz-transform: scale(" . $this->ZoomFactor . "); ";
     }
     if ($this->HorizontalAlignment != null) {
         switch ($this->HorizontalAlignment) {
             case HorizontalAlignment::Left:
                 echo "text-align: left; ";
                 break;
             case HorizontalAlignment::Center:
                 echo "text-align: center; ";
                 break;
             case HorizontalAlignment::Right:
                 echo "text-align: right; ";
                 break;
             default:
                 echo "text-align: " . $this->HorizontalAlignment . "; ";
                 break;
         }
     }
     echo "\">";
     echo "<div class=\"chatbubble\" id=\"Avatar_" . $this->Name . "_chatbubble\">&nbsp;</div>";
     echo "<div class=\"error\" id=\"Avatar_" . $this->Name . "_error\" title=\"Please enable JavaScript to see Avatars\" style=\"background-image: url('" . System::ExpandRelativePath("~/images/avatar/bases/" . $this->Base->ID . "/" . $this->View . "/loading/error.png") . "');\" /></div>";
     echo "<div class=\"loading\" id=\"Avatar_" . $this->Name . "_loading\" style=\"background-image: url('" . System::ExpandRelativePath("~/images/avatar/bases/" . $this->Base->ID . "/" . $this->View . "/loading/outline.png") . "');\">";
     echo "<img class=\"fill\" id=\"Avatar_" . $this->Name . "_loading_fill\" src=\"" . System::ExpandRelativePath("~/images/avatar/bases/" . $this->Base->ID . "/" . $this->View . "/loading/fill.png") . "\" />";
     echo "</div>";
     echo "<div class=\"body\" id=\"Avatar_" . $this->Name . "_body\">";
     foreach ($slices as $slice) {
         $this->RenderRecursive($slice);
     }
     echo "</div>";
     echo "</div>";
     echo "<script type=\"text/javascript\">var " . $this->Name . " = new Avatar(\"" . $this->Name . "\", AvatarBase.GetByID(" . $this->Base->ID . "));</script>";
 }
 protected function OnInitialize()
 {
     parent::OnInitialize();
     $url = "~/API/Search.php?format=json&query=%1";
     $count = count($this->SearchScopes);
     if ($count > 0) {
         $url .= "&include=";
         for ($i = 0; $i < $count; $i++) {
             $scope = $this->SearchScopes[$i];
             $url .= $scope;
             if ($i < $count - 1) {
                 $url .= ",";
             }
         }
     }
     $this->SuggestionURL = System::ExpandRelativePath($url);
 }
Example #3
0
    protected function RenderContent()
    {
        ?>
		<div class="ChatBar<?php 
        switch ($this->Position) {
            case ChatBarPosition::Top:
                echo " Top";
                break;
            case ChatBarPosition::Bottom:
                echo " Bottom";
                break;
        }
        ?>
" id="ChatArea_<?php 
        echo $this->ID;
        ?>
">
			&nbsp;
			<div class="ChatPanels" id="ChatArea_<?php 
        echo $this->ID;
        ?>
_Panels">
				<div class="ChatPanel BuddyListPanel" id="ChatArea_<?php 
        echo $this->ID;
        ?>
_BuddyListPanel">
				<?php 
        foreach ($this->Buddies as $buddy) {
            ?>
							<a href="#" onclick="<?php 
            echo $this->ID;
            ?>
.CreateChat('<?php 
            echo $buddy->UserName;
            ?>
', '<?php 
            echo $buddy->DisplayName;
            ?>
', '<?php 
            echo $buddy->ImageURL;
            ?>
'); return false;"><?php 
            echo $buddy->DisplayName;
            ?>
</a>
						<?php 
        }
        ?>
				</div>
			<?php 
        $i = 0;
        foreach ($this->Panels as $panel) {
            ?>
				<div class="ChatPanel" id="ChatArea_<?php 
            echo $this->ID;
            ?>
_Panel_<?php 
            echo $i;
            ?>
">
					<input type="hidden" id="ChatArea_<?php 
            echo $this->ID;
            ?>
_Panel_<?php 
            echo $i;
            ?>
_Receiver" value="<?php 
            echo $panel->UserName;
            ?>
" />
					<input type="hidden" id="ChatArea_<?php 
            echo $this->ID;
            ?>
_Panel_<?php 
            echo $i;
            ?>
_Receiver_DisplayName" value="<?php 
            echo $panel->DisplayName;
            ?>
" />
					<input type="hidden" id="ChatArea_<?php 
            echo $this->ID;
            ?>
_Panel_Receiver_<?php 
            echo $panel->UserName;
            ?>
_ID" value="<?php 
            echo $i;
            ?>
" />
					<div class="ChatPanelTitle">
						<a class="Title" href="#" onclick="<?php 
            echo $this->ID;
            ?>
.ActivateChat(<?php 
            echo $i;
            ?>
); return false;"><?php 
            echo $panel->DisplayName;
            ?>
</a>
					<?php 
            if ($panel->PopoutURL != null) {
                ?>
						<a target="_blank" class="Close" href="<?php 
                echo System::ExpandRelativePath($panel->PopoutURL);
                ?>
"><i class="fa fa-external-link"></i></a>
					<?php 
            }
            ?>
						<a class="Close" href="#" onclick="<?php 
            echo $this->ID;
            ?>
.CloseChat(<?php 
            echo $i;
            ?>
); return false;"><i class="fa fa-times"></i></a>
					</div>
					<div class="ChatPanelHistory" id="ChatArea_<?php 
            echo $this->ID;
            ?>
_Panel_<?php 
            echo $i;
            ?>
_History">
					<?php 
            foreach ($panel->Messages as $message) {
                ?>
						<div class="ChatPanelHistoryMessage">
							<img class="ChatPanelHistoryMessageAvatar" src="<?php 
                echo System::ExpandRelativePath($message->ImageURL);
                ?>
" alt="<?php 
                echo $message->DisplayName;
                ?>
" title="<?php 
                echo $message->DisplayName;
                ?>
" />
							<div class="ChatPanelHistoryMessageContent"><?php 
                echo $message->Content;
                ?>
</div>
						</div>
						<?php 
            }
            ?>
					</div>
					<div class="ChatPanelStatus" id="ChatArea_<?php 
            echo $this->ID;
            ?>
_Panel_<?php 
            echo $i;
            ?>
_Status">&nbsp;</div>
					<textarea class="ChatPanelInput" id="ChatArea_<?php 
            echo $this->ID;
            ?>
_Panel_<?php 
            echo $i;
            ?>
_Input" type="text" placeholder="<?php 
            echo $this->PlaceholderText;
            ?>
" onkeydown="<?php 
            echo $this->ID;
            ?>
.OnKeyDown(<?php 
            echo $i;
            ?>
, event);" onkeyup="<?php 
            echo $this->ID;
            ?>
.OnKeyUp(<?php 
            echo $i;
            ?>
, event);"></textarea>
				</div>
			<?php 
            $i++;
        }
        ?>
			</div>
			<div class="ChatButtons" id="ChatArea_<?php 
        echo $this->ID;
        ?>
_Buttons">
				<a href="#" class="ChatBarButton" id="ChatArea_<?php 
        echo $this->ID;
        ?>
_BuddyListButton" onclick="<?php 
        echo $this->ID;
        ?>
.ActivateBuddyList(); return false;"><span class="ChatBarButtonText">Buddy List</span></a>
			<?php 
        $i = 0;
        foreach ($this->Panels as $panel) {
            ?>
				<a href="#" class="ChatBarButton" id="ChatArea_<?php 
            echo $this->ID;
            ?>
_Buttons_<?php 
            echo $i;
            ?>
_Button" onclick="<?php 
            echo $this->ID;
            ?>
.ActivateChat(<?php 
            echo $i;
            ?>
); return false;">
					<img class="ChatBarButtonAvatar" src="<?php 
            echo System::ExpandRelativePath($panel->ImageURL);
            ?>
" />
					<span class="ChatBarButtonText"><?php 
            echo $panel->DisplayName;
            ?>
</span>
				</a>
			<?php 
            $i++;
        }
        ?>
			</div>
			<script type="text/javascript">var <?php 
        echo $this->ID;
        ?>
 = new ChatBar("<?php 
        echo $this->ID;
        ?>
", "<?php 
        echo $this->UserName;
        ?>
");</script>
		</div>
		<?php 
    }
Example #4
0
    public function Render($comment_base_url = null)
    {
        $CurrentUser = User::GetCurrent();
        $ParentObjectType = 0;
        switch (get_class($this)) {
            case "GroupTopicComment":
                $ParentObjectType = 1;
                break;
            case "JournalEntryComment":
                $ParentObjectType = 2;
                break;
        }
        ?>
<div class="Comment">
	<div class="CommentTitle" id="Comment_<?php 
        echo $this->ID;
        ?>
_title"><?php 
        echo $this->Title;
        ?>
</div>
	<div class="CommentEditor CommentTitle" id="Comment_<?php 
        echo $this->ID;
        ?>
_editor_title"><input id="Comment_<?php 
        echo $this->ID;
        ?>
_editor_title_input" type="text" value="<?php 
        echo $this->Title;
        ?>
" /></div>
	<div class="CommentContent" id="Comment_<?php 
        echo $this->ID;
        ?>
_content"><?php 
        echo $this->Content;
        ?>
</div>
	<div class="CommentEditor" id="Comment_<?php 
        echo $this->ID;
        ?>
_editor_content">
		<textarea id="Comment_<?php 
        echo $this->ID;
        ?>
_editor_content_input"><?php 
        echo $this->Content;
        ?>
</textarea>
	</div>
	<div class="CommentInformation">
		<span class="PostedBy">
		Posted by <span class="Author"><a href="<?php 
        echo System::ExpandRelativePath("~/community/members/" . $this->Author->ShortName);
        ?>
" target="_blank"><img src="<?php 
        echo System::ExpandRelativePath("~/community/members/" . $this->Author->ShortName . "/images/avatar/thumbnail.png");
        ?>
" style="height: 32px;" /> <?php 
        mmo_display_user_badges_by_user($this->Author);
        echo $this->Author->LongName;
        ?>
</a></span>
		on <span class="Timestamp"><?php 
        echo $this->TimestampCreated;
        ?>
</span>
		</span>
		<span class="CommentActions">
			<a id="Comment_<?php 
        echo $this->ID;
        ?>
_actions_like" href="#" onclick="CommentManager.SetPopularity(<?php 
        echo $ParentObjectType;
        ?>
, <?php 
        echo $this->ID;
        ?>
, 1); return false;">Like</a>
			|
			<a id="Comment_<?php 
        echo $this->ID;
        ?>
_actions_dislike" href="#" onclick="CommentManager.SetPopularity(<?php 
        echo $ParentObjectType;
        ?>
, <?php 
        echo $this->ID;
        ?>
, -1); return false;">Dislike</a>
			|
			<a id="Comment_<?php 
        echo $this->ID;
        ?>
_actions_reply" href="#" onclick="CommentManager.Reply(<?php 
        echo $ParentObjectType;
        ?>
, <?php 
        echo $this->ID;
        ?>
); return false;">Reply</a>
		<?php 
        if ($this->Author->ID == $CurrentUser->ID) {
            ?>
			|
			<a id="Comment_<?php 
            echo $this->ID;
            ?>
_actions_modify" href="#" onclick="CommentManager.BeginModify(<?php 
            echo $ParentObjectType;
            ?>
, <?php 
            echo $this->ID;
            ?>
); return false;">Modify</a>
			|
			<a id="Comment_<?php 
            echo $this->ID;
            ?>
_actions_delete" href="#" onclick="CommentManager.Delete(<?php 
            echo $ParentObjectType;
            ?>
, <?php 
            echo $this->ID;
            ?>
); return false;">Delete</a>
		<?php 
        }
        ?>
		</span>
	</div>
</div>
		<?php 
    }
Example #5
0
 public function ToString()
 {
     $value = "<span class=\"ProfileBadges\">";
     $badges = Badge::GetByUser($this);
     foreach ($badges as $badge) {
         $value .= "<img src=\"" . System::ExpandRelativePath("~/images/badges/" . $badge->Name . ".png") . "\" alt=\"" . $badge->Title . "\" title=\"" . $badge->Title . "\" /> ";
     }
     $value .= "</span>";
     $value .= $this->LongName;
     return $value;
 }