Ejemplo n.º 1
0
 public function __construct($objParentControl, $strControlId = null)
 {
     try {
         parent::__construct($objParentControl, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     $this->Template = dirname(__FILE__) . '/MessagesPanel.tpl.php';
     $this->dtrMessages = new QDataRepeater($this, 'dtrMessages');
     $this->dtrMessages->Template = dirname(__FILE__) . '/dtrMessages.tpl.php';
     $this->dtrMessages->SetDataBinder('dtrMessages_Bind', $this);
     $this->dtrMessages->Paginator = new QPaginator($this);
     $this->dtrMessages->PaginatorAlternate = new QPaginator($this);
     $this->dtrMessages->Paginator->Visible = false;
     $this->dtrMessages->PaginatorAlternate->Visible = false;
     $this->dtrMessages->ItemsPerPage = 10;
     $this->dtrMessages->UseAjax = true;
     $this->lblTopicInfo = new QLabel($this);
     $this->lblTopicInfo->TagName = 'div';
     $this->btnRespond1 = new RoundedLinkButton($this);
     $this->btnRespond1->Text = 'Respond';
     $this->btnRespond1->ToolTip = 'Post a response';
     $this->btnRespond2 = new RoundedLinkButton($this);
     $this->btnRespond2->Text = 'Respond';
     $this->btnRespond2->ToolTip = 'Post a response';
     $this->btnNotify1 = new RoundedLinkButton($this);
     $this->btnNotify1->Text = 'Email Notification';
     $this->btnNotify2 = new RoundedLinkButton($this);
     $this->btnNotify2->Text = 'Email Notification';
     $this->btnMarkAsViewed1 = new RoundedLinkButton($this);
     $this->btnMarkAsViewed1->Text = 'Mark as Viewed';
     $this->btnMarkAsViewed2 = new RoundedLinkButton($this);
     $this->btnMarkAsViewed2->Text = 'Mark as Viewed';
     $this->btnRespond1->AddCssClass('roundedLinkGray');
     $this->btnRespond2->AddCssClass('roundedLinkGray');
     $this->dlgMessage = new MessageEditDialogBox($this, 'dlgEditMessage');
     $this->pxyEditMessage = new QControlProxy($this);
     // Add Control actions
     $this->btnRespond1->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnRespond_Click'));
     $this->btnRespond1->AddAction(new QClickEvent(), new QTerminateAction());
     $this->btnRespond2->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnRespond_Click'));
     $this->btnRespond2->AddAction(new QClickEvent(), new QTerminateAction());
     $this->btnMarkAsViewed1->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnMarkAsViewed_Click'));
     $this->btnMarkAsViewed1->AddAction(new QClickEvent(), new QTerminateAction());
     $this->btnMarkAsViewed2->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnMarkAsViewed_Click'));
     $this->btnMarkAsViewed2->AddAction(new QClickEvent(), new QTerminateAction());
     $this->btnNotify1->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnNotify_Click'));
     $this->btnNotify1->AddAction(new QClickEvent(), new QTerminateAction());
     $this->btnNotify2->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnNotify_Click'));
     $this->btnNotify2->AddAction(new QClickEvent(), new QTerminateAction());
     $this->pxyEditMessage->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyEditMessage_Click'));
     $this->pxyEditMessage->AddAction(new QClickEvent(), new QTerminateAction());
     // Add "Delete" Functionality for Admin
     if (QApplication::IsLoginAdmin()) {
         $this->pxyDeleteMessage = new QControlProxy($this);
         $this->pxyDeleteMessage->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to PERMANENTLY DELETE this message?'));
         $this->pxyDeleteMessage->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyDeleteMessage_Click'));
         $this->pxyDeleteMessage->AddAction(new QClickEvent(), new QTerminateAction());
     }
     // HIde all buttons until a Topic is properly selected
     $this->btnRespond1->Visible = false;
     $this->btnRespond2->Visible = false;
     $this->btnMarkAsViewed1->Visible = false;
     $this->btnMarkAsViewed2->Visible = false;
     $this->btnNotify1->Visible = false;
     $this->btnNotify2->Visible = false;
 }
Ejemplo n.º 2
0
 protected function Form_Create()
 {
     parent::Form_Create();
     $objPerson = Person::LoadByUsername(QApplication::PathInfo(0));
     if (!$objPerson) {
         QApplication::Redirect('/');
     }
     $this->mctPerson = new PersonMetaControl($this, $objPerson);
     $this->strPageTitle .= $objPerson->DisplayName;
     $this->lblRole = $this->mctPerson->lblPersonTypeId_Create();
     $this->lblRole->Name = 'Qcodo Role';
     if ($this->mctPerson->Person->DonatedFlag) {
         $this->lblRole->Text .= ' and Financial Contributor';
     }
     $this->lblName = $this->mctPerson->lblFirstName_Create();
     $this->lblName->Name = 'Name';
     $this->lblName->Text .= ' ' . $this->mctPerson->Person->LastName;
     $this->lblUsername = $this->mctPerson->lblUsername_Create();
     $this->lblEmail = $this->mctPerson->lblEmail_Create();
     $this->lblEmail->Text = QString::ObfuscateEmail($this->mctPerson->Person->Email);
     $this->lblEmail->HtmlEntities = false;
     $this->lblLocation = $this->mctPerson->lblLocation_Create();
     $this->lblUrl = $this->mctPerson->lblUrl_Create();
     $this->lblUrl->HtmlEntities = false;
     $this->lblRegistrationDate = $this->mctPerson->lblRegistrationDate_Create(null, 'MMMM D, YYYY');
     $this->lblRegistrationDate->Name = 'Member Since';
     // Add Visibility Logic
     $this->lblName->Visible = $this->mctPerson->Person->DisplayRealNameFlag;
     $this->lblEmail->Visible = $this->mctPerson->Person->DisplayEmailFlag;
     $this->lblLocation->Visible = $this->mctPerson->Person->Location;
     if (!$this->mctPerson->Person->Url) {
         $this->lblUrl->Visible = false;
     } else {
         $this->lblUrl->Text = sprintf('<a href="%s">%s</a>', $this->mctPerson->Person->Url, QApplication::HtmlEntities($this->mctPerson->Person->Url));
     }
     // If Is Owner of the Profile
     if ($this->IsOwner()) {
         $this->btnEdit = new RoundedLinkButton($this);
         $this->btnEdit->Text = 'Edit My Profile';
         $this->btnEdit->LinkUrl = '/profile/edit.php';
         $this->btnEdit->AddCssClass('roundedLinkGray');
         $this->btnEditAccount = new RoundedLinkButton($this);
         $this->btnEditAccount->Text = 'Edit My Account';
         $this->btnEditAccount->LinkUrl = '/profile/account.php';
         $this->btnEditAccount->AddCssClass('roundedLinkGray');
         $this->btnPassword = new RoundedLinkButton($this);
         $this->btnPassword->Text = 'Change My Password';
         $this->btnPassword->LinkUrl = '/profile/password.php';
         $this->btnPassword->AddCssClass('roundedLinkGray');
         $this->lblTimezone = $this->mctPerson->lblTimezoneId_Create();
         $this->lblTimezone->HtmlEntities = false;
         if (!$this->lblTimezone->Text) {
             $this->lblTimezone->Text = '<span class="meta">none selected</span>';
         }
         $this->lblOptInFlag = $this->mctPerson->lblOptInFlag_Create();
         // Otherwise, if is administrator
     } else {
         if (QApplication::IsLoginAdmin()) {
             $this->btnEdit = new RoundedLinkButton($this);
             $this->btnEdit->Text = 'Edit User\'s Profile';
             $this->btnEdit->LinkUrl = '/profile/edit.php/' . $this->mctPerson->Person->Username;
             $this->btnEdit->AddCssClass('roundedLinkGray');
             $this->btnEditAccount = new RoundedLinkButton($this);
             $this->btnEditAccount->Text = 'Edit User\'s Account';
             $this->btnEditAccount->LinkUrl = '/profile/account.php/' . $this->mctPerson->Person->Username;
             $this->btnEditAccount->AddCssClass('roundedLinkGray');
             $this->btnNullPassword = new RoundedLinkButton($this);
             $this->btnNullPassword->Text = 'Null User\'s Password';
             $this->btnNullPassword->LinkUrl = '#';
             $this->btnNullPassword->AddCssClass('roundedLinkGray');
             $this->btnNullPassword->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to NULL OUT this User\'s Password?'));
             $this->btnNullPassword->AddAction(new QClickEvent(), new QAjaxAction('btnNullPassword_Click'));
             $this->btnNullPassword->AddAction(new QClickEvent(), new QTerminateAction());
         }
     }
 }
Ejemplo n.º 3
0
?>
		<?php 
$this->lblEmail->RenderForForm();
?>
		<?php 
$this->lblUrl->RenderForForm('Name=Website URL', 'Required=true');
?>
		<?php 
$this->lblLocation->RenderForForm('Name=Location', 'Required=true');
?>
		<?php 
$this->lblRegistrationDate->RenderForForm();
?>

		<?php 
if (QApplication::IsLoginAdmin()) {
    ?>
			<div class="renderForForm">
				<div class="left required">Messages Posted</div>
				<div class="right"><?php 
    _p($this->mctPerson->Person->CountMessages());
    ?>
</div>
			</div>
			
			<?php 
    if (!$this->mctPerson->Person->Password) {
        ?>
				<div class="renderForForm">
					<div class="left required">Password Status</div>
					<div class="right">Password has been nulled out.</div>