protected function Form_Create() { parent::Form_Create(); $this->dtgShowcaseItems = new ShowcaseItemDataGrid($this); $this->dtgShowcaseItems->Paginator = new QPaginator($this->dtgShowcaseItems); $this->dtgShowcaseItems->AlternateRowStyle->CssClass = 'alternate'; $this->dtgShowcaseItems->Noun = 'showcase item'; $this->dtgShowcaseItems->NounPlural = 'showcase items'; $this->dtgShowcaseItems->SetDataBinder('dtgShowcaseItems_Bind'); $this->dtgShowcaseItems->ItemsPerPage = 20; $this->dtgShowcaseItems->AddColumn(new QDataGridColumn('Actions', '<?= $_FORM->RenderActions($_ITEM); ?>', 'HtmlEntities=false', 'Width=100px', 'FontSize=10px')); $this->dtgShowcaseItems->MetaAddColumn('Name', 'Width=400px'); $this->dtgShowcaseItems->MetaAddColumn('Url', 'Width=285px'); $this->dtgShowcaseItems->MetaAddColumn('LiveFlag', 'Name=Live?', 'Width=50px'); $this->dtgShowcaseItems->MetaAddColumn(QQN::ShowcaseItem()->Person->DisplayName, 'Name=By', 'Html=<?= $_FORM->RenderPostedBy($_ITEM); ?>', 'HtmlEntities=false', 'Width=100px', 'CssClass=small reverseLink'); $this->lstLiveFlag = new QListBox($this); $this->lstLiveFlag->Name = 'Filter by Live Flag'; $this->lstLiveFlag->AddItem('- View All -', null); $this->lstLiveFlag->AddItem('Live', true); $this->lstLiveFlag->AddItem('Not Live', false); $this->lstLiveFlag->AddAction(new QChangeEvent(), new QAjaxAction('Refresh')); $this->pxyToggle = new QControlProxy($this); $this->pxyToggle->AddAction(new QClickEvent(), new QAjaxAction('pxyToggle_Click')); $this->pxyToggle->AddAction(new QClickEvent(), new QTerminateAction()); $this->pxyView = new QControlProxy($this); $this->pxyView->AddAction(new QClickEvent(), new QAjaxAction('pxyView_Click')); $this->pxyView->AddAction(new QClickEvent(), new QTerminateAction()); $this->dlgBox = new QDialogBox($this); $this->dlgBox->MatteClickable = false; $this->dlgBox->HideDialogBox(); $this->btnClose = new QButton($this->dlgBox); $this->btnClose->AddAction(new QClickEvent(), new QHideDialogBox($this->dlgBox)); }
protected function Form_Create() { parent::Form_Create(); // Define Controls $this->txtOldPassword = new QTextBox($this, 'oldPassword'); $this->txtOldPassword->Name = 'Current Password'; $this->txtOldPassword->MaxLength = Person::PasswordMaxLength; $this->txtOldPassword->TextMode = QTextMode::Password; $this->txtOldPassword->Required = true; $this->txtNewPassword = new QTextBox($this, 'password'); $this->txtNewPassword->Name = 'New Password'; $this->txtNewPassword->MaxLength = Person::PasswordMaxLength; $this->txtNewPassword->TextMode = QTextMode::Password; $this->txtNewPassword->Required = true; $this->txtConfirmPassword = new QTextBox($this, 'confirmPassword'); $this->txtConfirmPassword->Name = 'Confirm'; $this->txtConfirmPassword->MaxLength = Person::PasswordMaxLength; $this->txtConfirmPassword->TextMode = QTextMode::Password; $this->txtConfirmPassword->Required = true; // Define Buttons $this->btnUpdate = new QButton($this); $this->btnUpdate->CausesValidation = true; if (!QApplication::$Person->PasswordResetFlag) { $this->btnCancel = new QLinkButton($this); $this->btnCancel->LinkUrl = QApplication::$Person->ViewProfileUrl; } // Add Actions $this->btnUpdate->AddAction(new QClickEvent(), new QAjaxAction('btnUpdate_Click')); // Initial Focus $this->txtOldPassword->Focus(); }
protected function Form_Create() { parent::Form_Create(); $this->lnkHome = new RoundedLinkButton($this); $this->lnkHome->Text = 'Back to Home'; $this->lnkHome->LinkUrl = '/'; $this->lnkHome->AddCssClass('roundedLinkGray'); }
protected function Form_Create() { parent::Form_Create(); $this->txtSearch = new SearchTextBox($this, 'txtSearch'); $this->txtSearch->Text = QApplication::QueryString('search'); $this->txtSearch->AddAction(new QEnterKeyEvent(0, "qc.getControl('txtSearch').value != ''"), new QServerAction('txtSearch_Enter')); $this->txtSearch->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->dtrForums = new QDataRepeater($this, 'dtrForums'); $this->dtrForums->Template = 'dtrForums.tpl.php'; $this->dtrForums->SetDataBinder('dtrForums_Bind'); }
protected function Form_Create() { parent::Form_Create(); $this->dtrPackageCategories = new QDataRepeater($this); $this->dtrPackageCategories->Template = 'dtrPackageCategories.tpl.php'; $this->dtrPackageCategories->SetDataBinder('dtrPackageCategories_Bind'); $this->btnNew = new RoundedLinkButton($this); $this->btnNew->CssClass = 'searchOption'; $this->btnNew->ToolTip = 'Create a new QPM package'; $this->btnNew->LinkUrl = '/qpm/edit.php/new'; }
protected function Form_Create() { parent::Form_Create(); // "New" is a special keyword if (($strToken = trim(strtolower(QApplication::PathInfo(0)))) == 'new') { $strToken = null; } $objPackage = Package::LoadByToken($strToken); if (!$objPackage) { $objPackage = new Package(); $this->blnEditMode = false; $this->strPageTitle .= 'Create New'; $this->strHeadline = 'Create a New QPM Package'; } else { if (!$objPackage->IsEditableForPerson(QApplication::$Person)) { QApplication::RedirectToLogin(); } $this->blnEditMode = true; $this->strPageTitle .= 'Edit Package ' . $objPackage->Token; $this->strHeadline = 'Edit Package ' . $objPackage->Token; } $this->mctPackage = new PackageMetaControl($this, $objPackage); $this->txtToken = $this->mctPackage->txtToken_Create(); $this->txtToken->Required = true; $this->lstCategory = $this->mctPackage->lstPackageCategory_Create(); $this->lstCategory->Required = true; // Remove "Issue" for ($intIndex = 0; $intIndex < $this->lstCategory->ItemCount; $intIndex++) { $objListItem = $this->lstCategory->GetItem($intIndex); $objCategory = PackageCategory::Load($objListItem->Value); if ($objCategory && $objCategory->Token == 'issues') { $this->lstCategory->RemoveItem($intIndex); break; } } $this->txtName = $this->mctPackage->txtName_Create(); $this->txtName->Required = true; $this->txtDescription = $this->mctPackage->txtDescription_Create(); $this->txtDescription->Required = true; $this->btnOkay = new QButton($this); $this->btnOkay->CausesValidation = true; $this->btnOkay->Text = $this->blnEditMode ? 'Update Package' : 'Save New Package'; $this->btnCancel = new QLinkButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnOkay->AddAction(new QClickEvent(), new QToggleEnableAction($this->btnOkay)); $this->btnOkay->AddAction(new QClickEvent(), new QAjaxAction('btnOkay_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); if (!$this->blnEditMode) { $this->txtToken->Focus(); } else { $this->txtName->Focus(); } }
protected function Form_Create() { parent::Form_Create(); $this->strSanitizedPath = WikiItem::SanitizeForPath(QApplication::$PathInfo, $intWikiItemTypeId); if ($this->intWikiItemTypeId != $intWikiItemTypeId) { throw new Exception('WikiItemTypeId Mismatch'); } $this->objWikiItem = WikiItem::LoadByPathWikiItemTypeId($this->strSanitizedPath, $this->intWikiItemTypeId); $strWikiType = WikiItemType::$TokenArray[$this->intWikiItemTypeId]; $strWikiClassName = 'Wiki' . $strWikiType; // See if we're editing or creating new if (!$this->objWikiItem) { $this->objWikiItem = new WikiItem(); $objWikiVersion = new WikiVersion(); $objWikiObject = new $strWikiClassName(); $this->blnEditMode = false; $this->strPageTitle = 'Create New Wiki ' . $strWikiType; $this->strHeadline = 'Create a New Wiki ' . $strWikiType; } else { // Make sure this person is allowed to edit it if (!$this->objWikiItem->IsEditableForPerson(QApplication::$Person)) { QApplication::Redirect($this->objWikiItem->UrlPath); } // Get the Wiki Version object based on the $_GET variables, or use CurrentWikiVersion if none passed in $arrGetKeys = array_keys($_GET); $objWikiVersion = null; if (count($arrGetKeys) == 1) { $objWikiVersion = WikiVersion::LoadByWikiItemIdVersionNumber($this->objWikiItem->Id, $arrGetKeys[0]); } if (!$objWikiVersion) { $objWikiVersion = $this->objWikiItem->CurrentWikiVersion; } if (!$objWikiVersion->IsCurrentVersion()) { $this->intVersionNumber = $objWikiVersion->VersionNumber; } $objWikiObject = $objWikiVersion->__get($strWikiClassName); $this->blnEditMode = true; $this->strPageTitle .= $objWikiVersion->Name; $this->strHeadline = 'Edit Wiki ' . $strWikiType; } $this->CreateControlsForWikiVersionAndObject($objWikiVersion, $objWikiObject); $this->btnOkay = new QButton($this); $this->btnOkay->CausesValidation = true; $this->btnOkay->Text = $this->blnEditMode ? 'Update Wiki ' : 'Save New Wiki '; $this->btnOkay->Text .= $strWikiType; $this->btnCancel = new QLinkButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnOkay->AddAction(new QClickEvent(), new QToggleEnableAction($this->btnOkay)); $this->btnOkay->AddAction(new QClickEvent(), new QServerAction('btnOkay_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QServerAction('btnCancel_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); $this->txtTitle->Focus(); }
protected function Form_Create() { parent::Form_Create(); $this->objPackage = Package::LoadByToken(QApplication::PathInfo(0)); if (!$this->objPackage) { QApplication::Redirect('/qpm/'); } $this->strPageTitle .= $this->objPackage->Name; $this->dtgContributions = new PackageContributionDataGrid($this); $this->dtgContributions->SetDataBinder('dtgContributions_Bind'); $this->dtgContributions->AlternateRowStyle->CssClass = 'alternate'; $this->dtgContributions->MetaAddColumn(QQN::PackageContribution()->Person->Username, 'Name=QPM Path for Version', 'Html=<?= $_FORM->RenderPath($_ITEM); ?>', 'Width=350px', 'VerticalAlign=top', 'FontNames=Monaco, Courier, Courier New,Monospaced', 'HtmlEntities=false'); $this->dtgContributions->MetaAddColumn(QQN::PackageContribution()->CurrentPackageVersion->Notes, 'Name=Version Notes', 'Html=<?= $_FORM->RenderNotes($_ITEM); ?>', 'Width=400px', 'VerticalAlign=top', 'CssClass=small', 'HtmlEntities=false'); $this->dtgContributions->MetaAddColumn('CurrentPostDate', 'Name=Posted', 'Width=100px', 'VerticalAlign=top'); $this->dtgContributions->MetaAddColumn(QQN::PackageContribution()->Person->DisplayName, 'Name=By', 'Html=<?= $_FORM->RenderPostedBy($_ITEM); ?>', 'HtmlEntities=false', 'Width=100px', 'CssClass=reverseLink', 'VerticalAlign=top'); $this->dtgContributions->SortColumnIndex = 2; $this->dtgContributions->SortDirection = 1; $this->dtgContributions->Paginator = new QPaginator($this->dtgContributions); if ($this->objPackage->IsEditableForPerson(QApplication::$Person)) { $this->btnEdit = new RoundedLinkButton($this); $this->btnEdit->CssClass = 'searchOption'; $this->btnEdit->ToolTip = 'Edit This package'; $this->btnEdit->LinkUrl = '/qpm/edit.php/' . $this->objPackage->Token; } // Setup messages panel if ($this->objPackage->PackageCategory->Token != 'issues') { $this->pnlMessages = new MessagesPanel($this); $this->pnlMessages->SelectTopic($this->objPackage->TopicLink->GetTopic()); $this->pnlMessages->lblTopicInfo_SetTemplate(__INCLUDES__ . '/messages/lblTopicInfoForPackage.tpl.php'); $this->pnlMessages->btnRespond1->Text = 'Post Comment'; $this->pnlMessages->btnRespond2->Text = 'Post Comment'; $this->pnlMessages->strAdditionalCssClass = 'topicForPackage'; if (array_key_exists('lastpage', $_GET)) { $this->pnlMessages->SetPageNumber(QPaginatedControl::LastPage); } } else { $strTokenParts = explode('_', $this->objPackage->Token); if (count($strTokenParts) == 2) { $strIssueNumber = $strTokenParts[1]; } else { $strIssueNumber = null; } $this->pnlMessages = new QPanel($this); $this->pnlMessages->CssClass = 'topic topicForPackage'; $this->pnlMessages->Text = '<h1>Comments</h1>'; $this->pnlMessages->Text .= '<br/>Comments for this issue-related QPM package have been disabled on this screen. To view, post and edit comments, '; $this->pnlMessages->Text .= 'please do so on the <a href="/issues/view.php/' . $strIssueNumber . '">issue page</a>, itself.'; } }
protected function Form_Create() { parent::Form_Create(); // Define MetaControl $this->mctPerson = new PersonMetaControl($this, new Person()); // Define Controls $this->txtUsername = $this->mctPerson->txtUsername_Create('username'); $this->txtUsername->Instructions = '6 - 20 alphanumeric characters'; $this->txtPassword = new QTextBox($this, 'password'); $this->txtPassword->Name = 'Password'; $this->txtPassword->MaxLength = Person::PasswordMaxLength; $this->txtPassword->TextMode = QTextMode::Password; $this->txtPassword->Required = true; $this->txtPassword->CausesValidation = true; $this->txtConfirmPassword = new QTextBox($this, 'confirmPassword'); $this->txtConfirmPassword->Name = 'Confirm'; $this->txtConfirmPassword->MaxLength = Person::PasswordMaxLength; $this->txtConfirmPassword->TextMode = QTextMode::Password; $this->txtConfirmPassword->Required = true; $this->txtConfirmPassword->CausesValidation = true; $this->txtFirstName = $this->mctPerson->txtFirstName_Create('firstName'); $this->txtLastName = $this->mctPerson->txtLastName_Create('lastName'); $this->txtEmail = $this->mctPerson->txtEmail_Create('email'); $this->txtEmail->Instructions = 'You hate SPAM. So do we.<br/>We will NEVER release your information to anyone. Period.'; $this->chkDisplayRealNameFlag = $this->mctPerson->chkDisplayRealNameFlag_Create('realName'); $this->chkOptInFlag = $this->mctPerson->chkOptInFlag_Create('optIn'); $this->txtLocation = $this->mctPerson->txtLocation_Create('location'); $this->txtLocation->Name = 'Your Location'; $this->txtLocation->Instructions = 'e.g., "Sunnyvale, CA"'; $this->lstCountry = $this->mctPerson->lstCountry_Create('country'); $this->lstCountry->Name = 'Display Country Flag'; $this->txtUrl = $this->mctPerson->txtUrl_Create('url'); $this->txtUrl->Name = 'Website URL'; $this->txtUrl->Instructions = 'Be sure and include "http://"'; $this->btnRegister = new QButton($this); $this->btnRegister->Text = 'Register'; $this->btnRegister->Name = ' '; $this->btnRegister->CausesValidation = true; $this->lnkLogin = new RoundedLinkButton($this); $this->lnkLogin->Text = 'Login'; $this->lnkLogin->LinkUrl = '/login/'; $this->lnkLogin->AddCssClass('roundedLinkGray'); // Add Actions $this->btnRegister->AddAction(new QClickEvent(), new QAjaxAction('btnRegister_Click')); // Initial Focus $this->txtUsername->Focus(); }
protected function Form_Create() { parent::Form_Create(); $this->dtgWikiItems = new WikiItemDataGrid($this); // $this->dtgWikiItems->CssClass = 'datagrid issuesDataGrid'; $this->dtgWikiItems->Paginator = new QPaginator($this->dtgWikiItems); $this->dtgWikiItems->AlternateRowStyle->CssClass = 'alternate'; $this->dtgWikiItems->Noun = 'wiki item'; $this->dtgWikiItems->NounPlural = 'wiki items'; $this->dtgWikiItems->SetDataBinder('dtgWikiItems_Bind'); $this->dtgWikiItems->ItemsPerPage = 20; $this->dtgWikiItems->MetaAddTypeColumn('WikiItemTypeId', 'WikiItemType', 'Name=Wiki Type', 'Width=80px'); $this->dtgWikiItems->MetaAddColumn('CurrentName', 'Name=Title', 'Width=340px'); $this->dtgWikiItems->MetaAddColumn('Path', 'Html=<?= $_FORM->RenderPath($_ITEM); ?>', 'HtmlEntities=false', 'Width=310px'); $this->dtgWikiItems->MetaAddColumn('CurrentPostDate', 'Name=Last Updated', 'Width=110px', 'CssClass=small'); $this->dtgWikiItems->MetaAddColumn(QQN::WikiItem()->CurrentPostedByPerson->DisplayName, 'Name=By', 'Html=<?= $_FORM->RenderPostedBy($_ITEM); ?>', 'HtmlEntities=false', 'Width=100px', 'CssClass=small reverseLink'); $this->dtgWikiItems->GetColumnByName('Wiki Type')->OrderByClause = QQ::OrderBy(QQN::WikiItem()->WikiItemTypeId, QQN::WikiItem()->CurrentName); $this->dtgWikiItems->GetColumnByName('Wiki Type')->ReverseOrderByClause = QQ::OrderBy(QQN::WikiItem()->WikiItemTypeId, false, QQN::WikiItem()->CurrentName, false); $this->dtgWikiItems->SortColumnIndex = 0; $this->lstWikiItemType = new QListBox($this); $this->lstWikiItemType->Name = 'Wiki Type'; $this->lstWikiItemType->AddAction(new QChangeEvent(), new QAjaxAction('Refresh')); $this->lstWikiItemType->AddAction(new QEnterKeyEvent(), new QAjaxAction('Refresh')); $this->lstWikiItemType->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->lstWikiItemType->AddItem('- View All -', null); foreach (WikiItemType::$NameArray as $intId => $strName) { $this->lstWikiItemType->AddItem($strName, $intId); } $this->txtTitle = new QTextBox($this); $this->txtTitle->Name = 'Title'; $this->txtTitle->AddAction(new QChangeEvent(), new QAjaxAction('Refresh')); $this->txtTitle->AddAction(new QEnterKeyEvent(), new QAjaxAction('Refresh')); $this->txtTitle->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtPath = new QTextBox($this); $this->txtPath->Name = 'Path'; $this->txtPath->AddAction(new QChangeEvent(), new QAjaxAction('Refresh')); $this->txtPath->AddAction(new QEnterKeyEvent(), new QAjaxAction('Refresh')); $this->txtPath->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtPostedBy = new QTextBox($this); $this->txtPostedBy->Name = 'Posted By'; $this->txtPostedBy->AddAction(new QChangeEvent(), new QAjaxAction('Refresh')); $this->txtPostedBy->AddAction(new QEnterKeyEvent(), new QAjaxAction('Refresh')); $this->txtPostedBy->AddAction(new QEnterKeyEvent(), new QTerminateAction()); }
protected function Form_Create() { parent::Form_Create(); $objShowcases = ShowcaseItem::LoadArrayByLiveFlag(true); $this->objShowcaseArray = array(); while (count($this->objShowcaseArray) < 14 && count($objShowcases)) { $intKeyArray = array_keys($objShowcases); $intRandomKey = $intKeyArray[rand(0, count($intKeyArray) - 1)]; $this->objShowcaseArray[] = $objShowcases[$intRandomKey]; unset($objShowcases[$intRandomKey]); } $this->btnNew = new RoundedLinkButton($this); $this->btnNew->Text = 'Submit a Project or Site'; $this->btnNew->AddAction(new QClickEvent(), new QAjaxAction('btnNew_Click')); $this->btnNew->AddAction(new QClickEvent(), new QTerminateAction()); $this->pxyItem = new QControlProxy($this); $this->pxyItem->AddAction(new QClickEvent(), new QAjaxAction('pxyItem_Click')); $this->pxyItem->AddAction(new QClickEvent(), new QTerminateAction()); if (ShowcaseItem::IsAdminableForPerson(QApplication::$Person)) { $this->btnAdmin = new RoundedLinkButton($this); $this->btnAdmin->Text = 'Administer Showcase Items'; $this->btnAdmin->LinkUrl = '/showcase/admin.php'; } $this->dlgBox = new QDialogBox($this); $this->dlgBox->MatteClickable = true; $this->dlgBox->HideDialogBox(); $this->btnClose = new QButton($this->dlgBox); $this->btnClose->AddAction(new QClickEvent(), new QHideDialogBox($this->dlgBox)); $this->txtName = new QTextBox($this->dlgBox); $this->txtName->Required = true; $this->txtDescription = new QTextBox($this->dlgBox); $this->txtDescription->TextMode = QTextMode::MultiLine; $this->txtUrl = new UrlTextBox($this->dlgBox); $this->txtUrl->Required = true; $this->flcImage = new QFileControl($this->dlgBox); $this->flcImage->Required = true; $this->btnOkay = new QButton($this->dlgBox); $this->btnOkay->CausesValidation = true; $this->btnOkay->AddAction(new QClickEvent(), new QServerAction('btnOkay_Click')); $this->btnCancel = new QLinkButton($this->dlgBox); $this->btnCancel->AddAction(new QClickEvent(), new QHideDialogBox($this->dlgBox)); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); }
protected function Form_Create() { parent::Form_Create(); // Define Controls $this->txtUsername = new QTextBox($this, 'username'); $this->txtUsername->Name = 'Email / Username'; $this->txtUsername->MaxLength = Person::EmailMaxLength; $this->txtUsername->Required = true; $this->txtPassword = new QTextBox($this, 'password'); $this->txtPassword->Name = 'Password'; $this->txtPassword->MaxLength = Person::PasswordMaxLength; $this->txtPassword->TextMode = QTextMode::Password; $this->txtPassword->Required = true; $this->txtPassword->CausesValidation = true; $this->btnLogin = new QButton($this); $this->btnLogin->Text = 'Log In'; $this->btnLogin->Name = ' '; $this->btnLogin->CausesValidation = true; $this->chkRemember = new QCheckBox($this); $this->chkRemember->HtmlEntities = false; $this->lnkRegister = new RoundedLinkButton($this); $this->lnkRegister->Text = 'Register'; $this->lnkRegister->LinkUrl = '/register/'; $this->lnkRegister->AddCssClass('roundedLinkGray'); $this->lnkForgot = new RoundedLinkButton($this); $this->lnkForgot->Text = 'Forgot My Password'; if (array_key_exists('strReferer', $_GET)) { $this->lnkForgot->LinkUrl = '/login/forgot.php?strReferer=' . urlencode($_GET['strReferer']); } else { $this->lnkForgot->LinkUrl = '/login/forgot.php'; } $this->lnkForgot->AddCssClass('roundedLinkGray'); // Add Actions $this->txtUsername->AddAction(new QEnterKeyEvent(), new QFocusControlAction($this->txtPassword)); $this->txtUsername->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtPassword->AddAction(new QEnterKeyEvent(), new QServerAction('btnLogin_Click')); $this->txtPassword->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->btnLogin->AddAction(new QClickEvent(), new QServerAction('btnLogin_Click')); // Initial Focus $this->txtUsername->Focus(); }
protected function Form_Create() { parent::Form_Create(); // Define MetaControl on the Person Object we are editing $objPerson = null; // Administrators are able to edit anyone's profile if (QApplication::$Person->PersonTypeId == PersonType::Administrator && ($strUsername = QApplication::PathInfo(0))) { $objPerson = Person::LoadByUsername($strUsername); } // Everyone else will just be allowed to edit themselves if (!$objPerson) { $objPerson = QApplication::$Person; } // Define the MetaControl, itself $this->mctPerson = new PersonMetaControl($this, $objPerson); // Update the Page Title if Not Editing Myself (for administrators) if (QApplication::$Person->Id != $this->mctPerson->Person->Id) { $this->strPageTitle = 'Edit Account - ' . $this->mctPerson->Person->DisplayName; } // Define Controls $this->txtUsername = $this->mctPerson->txtUsername_Create('username'); $this->txtFirstName = $this->mctPerson->txtFirstName_Create('firstName'); $this->txtLastName = $this->mctPerson->txtLastName_Create('lastName'); $this->txtEmail = $this->mctPerson->txtEmail_Create('email'); if (QApplication::$Person->PersonTypeId == PersonType::Administrator) { $this->lstPersonType = $this->mctPerson->lstPersonType_Create('role'); $this->chkDonatedFlag = $this->mctPerson->chkDonatedFlag_Create('donated'); if ($this->mctPerson->Person->Id == QApplication::$Person->Id) { $this->lstPersonType->Enabled = false; } } // Define Buttons $this->btnUpdate = new QButton($this); $this->btnUpdate->CausesValidation = true; $this->btnCancel = new QLinkButton($this); $this->btnCancel->LinkUrl = $this->mctPerson->Person->ViewProfileUrl; // Add Actions $this->btnUpdate->AddAction(new QClickEvent(), new QAjaxAction('btnUpdate_Click')); // Initial Focus $this->txtUsername->Focus(); }
protected function Form_Create() { parent::Form_Create(); $this->objCategory = PackageCategory::LoadByToken(QApplication::PathInfo(0)); if (!$this->objCategory) { QApplication::Redirect('/qpm/'); } $this->strPageTitle .= $this->objCategory->Name; $this->dtgPackages = new PackageDataGrid($this); $this->dtgPackages->SetDataBinder('dtgPackages_Bind'); $this->dtgPackages->AlternateRowStyle->CssClass = 'alternate'; $this->dtgPackages->MetaAddColumn('Name', 'VerticalAlign=top', 'Width=250px'); $this->dtgPackages->MetaAddColumn('Token', 'Name=Path', 'VerticalAlign=top', 'Width=190px', 'HtmlEntities=false', 'Html=<a href="/qpm/package.php/<?= $_ITEM->Token; ?>" title="View Package Details"><?= $_ITEM->Token; ?></a>'); $this->dtgPackages->MetaAddColumn('Description', 'CssClass=small', 'Width=300px'); $this->dtgPackages->MetaAddColumn('LastPostDate', 'Name=Last Upload', 'Width=100px', 'VerticalAlign=top', 'CssClass=small'); $this->dtgPackages->MetaAddColumn(QQN::Package()->LastPostedByPerson->DisplayName, 'Name=By', 'Html=<?= $_FORM->RenderPostedBy($_ITEM); ?>', 'HtmlEntities=false', 'Width=100px', 'CssClass=small reverseLink', 'VerticalAlign=top'); $this->dtgPackages->Paginator = new QPaginator($this->dtgPackages); $this->btnNew = new RoundedLinkButton($this); $this->btnNew->CssClass = 'searchOption'; $this->btnNew->ToolTip = 'Create a new QPM package'; $this->btnNew->LinkUrl = '/qpm/edit.php/new'; }
protected function Form_Create() { parent::Form_Create(); $this->objIssue = Issue::Load(QApplication::PathInfo(0)); if (!$this->objIssue) { QApplication::Redirect('/issues/'); } $this->strPageTitle .= $this->objIssue->Title; $this->pnlDetails = new QPanel($this); $this->pnlDetails->Template = dirname(__FILE__) . '/pnlDetails.tpl.php'; $objTopic = $this->objIssue->TopicLink->GetTopic(); $objTopic->MarkAsViewed(); $this->pnlMessages = new MessagesPanel($this); $this->pnlMessages->SelectTopic($objTopic); $this->pnlMessages->lblTopicInfo_SetTemplate(__INCLUDES__ . '/messages/lblTopicInfoForIssue.tpl.php'); if (QApplication::PathInfo(1) == 'lastpage') { $this->pnlMessages->SetPageNumber(QPaginatedControl::LastPage); } $this->SetupIssueInformationControls(); $this->SetupVotingControls(); $this->SetupSubmitFixControls(); }
protected function Form_Create() { parent::Form_Create(); // Get the Wiki Item and confirm that it exists and that he is authorized to admin $this->strSanitizedPath = WikiItem::SanitizeForPath(QApplication::$PathInfo, $this->intWikiItemTypeId); $this->objWikiItem = WikiItem::LoadByPathWikiItemTypeId($this->strSanitizedPath, $this->intWikiItemTypeId); if (!$this->objWikiItem) { QApplication::Redirect('/'); } if (!$this->objWikiItem->IsAdminableForPerson(QApplication::$Person)) { QApplication::RedirectToLogin(); } $this->strPageTitle .= $this->objWikiItem->CurrentName; $this->lstEditorMinimum = new QListBox($this); foreach (PersonType::$NameArray as $intTypeId => $strName) { $this->lstEditorMinimum->AddItem($strName, $intTypeId, $intTypeId == $this->objWikiItem->EditorMinimumPersonTypeId); } $this->lstNavItem = new QListBox($this); $this->lstNavItem->AddItem('- Default -', null); foreach (QApplication::$NavBarArray as $intIndex => $arrItems) { $this->lstNavItem->AddItem($arrItems[0], $intIndex, !is_null($this->objWikiItem->OverrideNavbarIndex) && $this->objWikiItem->OverrideNavbarIndex == $intIndex); } if (is_null($this->lstNavItem->SelectedValue)) { $this->lstNavItem->SelectedIndex = 0; } $this->lstNavItem->AddAction(new QChangeEvent(), new QAjaxAction('lstNavItem_Change')); $this->lstSubNavItem = new QListBox($this); $this->lstNavItem_Change(null, null, null); $this->btnOkay = new QButton($this); $this->btnOkay->CausesValidation = true; $this->btnOkay->Text = 'Update'; $this->btnCancel = new QLinkButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnOkay->AddAction(new QClickEvent(), new QToggleEnableAction($this->btnOkay)); $this->btnOkay->AddAction(new QClickEvent(), new QAjaxAction('btnOkay_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); }
protected function Form_Create() { parent::Form_Create(); // Define Controls $this->txtEmail = new EmailTextBox($this, 'email'); $this->txtEmail->Name = 'Email'; $this->txtEmail->MaxLength = Person::EmailMaxLength; $this->txtEmail->Required = true; $this->txtEmail->CausesValidation = true; $this->btnSend = new QButton($this); $this->btnSend->Text = 'Reset My Password'; $this->btnSend->Name = ' '; $this->btnSend->CausesValidation = true; $this->lnkRegister = new RoundedLinkButton($this); $this->lnkRegister->Text = 'Register'; $this->lnkRegister->LinkUrl = '/register/'; $this->lnkRegister->AddCssClass('roundedLinkGray'); $this->lnkLogin = new RoundedLinkButton($this); $this->lnkLogin->Text = 'Login'; $this->lnkLogin->LinkUrl = '/login/'; $this->lnkLogin->AddCssClass('roundedLinkGray'); // Add Actions $this->txtEmail->AddAction(new QEnterKeyEvent(), new QAjaxAction('btnSend_Click')); $this->txtEmail->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->btnSend->AddAction(new QClickEvent(), new QAjaxAction('btnSend_Click')); // Initial Focus $this->txtEmail->Focus(); // Result $this->dlgResult = new QDialogBox($this); $this->dlgResult->Text = '<h1>Password Reset</h1><p>Your username and new password should be emailed to you within the next few minutes.</p>' . '<p class="hint">Note that <strong>Qcodo.com</strong> emails could also show up in your <strong>SPAM</strong> or <strong>Junk Mail</strong> folder.</p><br/>'; $this->dlgResult->MatteClickable = false; $this->dlgResult->AutoRenderChildren = true; $this->dlgResult->HideDialogBox(); $this->dlgResult->CssClass = 'dialogbox'; $this->btnOkay = new QButton($this->dlgResult); $this->btnOkay->Text = 'Okay'; $this->btnOkay->AddAction(new QClickEvent(), new QServerAction('btnOkay_Click')); }
protected function Form_Create() { parent::Form_Create(); // Define MetaControl on the Person Object we are editing $objPerson = null; // Administrators are able to edit anyone's profile if (QApplication::$Person->PersonTypeId == PersonType::Administrator && ($strUsername = QApplication::PathInfo(0))) { $objPerson = Person::LoadByUsername($strUsername); } // Everyone else will just be allowed to edit themselves if (!$objPerson) { $objPerson = QApplication::$Person; } // Define the MetaControl, itself $this->mctPerson = new PersonMetaControl($this, $objPerson); // Update the Page Title if Not Editing Myself (for administrators) if (QApplication::$Person->Id != $this->mctPerson->Person->Id) { $this->strPageTitle = 'Edit Profile - ' . $this->mctPerson->Person->DisplayName; } // Define Controls $this->lstTimezone = $this->mctPerson->lstTimezone_Create('timezone'); $this->chkDisplayRealNameFlag = $this->mctPerson->chkDisplayRealNameFlag_Create('realName'); $this->chkDisplayEmailFlag = $this->mctPerson->chkDisplayEmailFlag_Create('displayEmail'); $this->chkOptInFlag = $this->mctPerson->chkOptInFlag_Create('optIn'); $this->txtLocation = $this->mctPerson->txtLocation_Create('location'); $this->lstCountry = $this->mctPerson->lstCountry_Create('country'); $this->txtUrl = $this->mctPerson->txtUrl_Create('url'); // Define Buttons $this->btnUpdate = new QButton($this); $this->btnUpdate->CausesValidation = true; $this->btnCancel = new QLinkButton($this); $this->btnCancel->LinkUrl = $this->mctPerson->Person->ViewProfileUrl; // Add Actions $this->btnUpdate->AddAction(new QClickEvent(), new QAjaxAction('btnUpdate_Click')); // Initial Focus $this->lstTimezone->Focus(); }
protected function Form_Create() { parent::Form_Create(); }
protected function Form_Create() { parent::Form_Create(); $this->dtgIssues = new IssueDataGrid($this, 'issues'); $this->dtgIssues->CssClass = 'datagrid issuesDataGrid'; $this->dtgIssues->Paginator = new QPaginator($this->dtgIssues); $this->dtgIssues->AlternateRowStyle->CssClass = 'alternate'; $this->dtgIssues->Noun = 'issue'; $this->dtgIssues->NounPlural = 'issues'; $this->dtgIssues->SetDataBinder('dtgIssues_Bind'); $this->dtgIssues->MetaAddColumn('Id', 'Html=<?= $_FORM->RenderId($_ITEM); ?>', 'Name=Issue ID', 'HtmlEntities=false'); $this->dtgIssues->MetaAddColumn('Title', 'Html=<?= $_FORM->RenderTitle($_ITEM); ?>', 'Name=Summary', 'HtmlEntities=false'); $this->dtgIssues->MetaAddTypeColumn('IssuePriorityTypeId', 'IssuePriorityType', 'Name=Priority'); $this->dtgIssues->MetaAddTypeColumn('IssueStatusTypeId', 'IssueStatusType', 'Html=<?= $_FORM->RenderStatus($_ITEM); ?>', 'HtmlEntities=false', 'Name=Status'); $this->dtgIssues->AddColumn(new QDataGridColumn('Category', '<?= $_FORM->RenderCategory($_ITEM); ?>', 'CssClass=small')); $this->dtgIssues->MetaAddColumn('PostDate', 'Name=Posted', 'CssClass=small'); $this->dtgIssues->MetaAddColumn(QQN::Issue()->PostedByPerson->DisplayName, 'Name=By', 'Html=<?= $_FORM->RenderPostedBy($_ITEM); ?>', 'HtmlEntities=false', 'CssClass=small reverseLink'); $this->dtgIssues->MetaAddColumn(QQN::Issue()->TopicLink->LastPostDate, 'Name=Last Updated', 'CssClass=small'); $this->dtgIssues->MetaAddColumn(QQN::Issue()->AssignedToPerson->DisplayName, 'Name=Assigned To', 'Html=<?= $_FORM->RenderAssignedTo($_ITEM); ?>', 'HtmlEntities=false', 'CssClass=small reverseLink'); $this->dtgIssues->GetColumnByName('Status')->OrderByClause = QQ::OrderBy(QQN::Issue()->IssueStatusTypeId, QQN::Issue()->IssueResolutionTypeId); $this->dtgIssues->GetColumnByName('Status')->ReverseOrderByClause = QQ::OrderBy(QQN::Issue()->IssueStatusTypeId, false, QQN::Issue()->IssueResolutionTypeId, false); $this->dtgIssues->SortColumnIndex = 7; $this->dtgIssues->SortDirection = 1; $this->objIssueFieldForCategory = IssueField::LoadIssueFieldForCategory(); $this->objIssueFieldForQcodoVersion = IssueField::LoadIssueFieldForQcodoVersion(); $this->objIssueFieldForPhpVersion = IssueField::LoadIssueFieldForPhpVersion(); $this->txtId = new QIntegerTextBox($this); $this->txtId->Name = 'Go to Issue by ID'; $this->txtId->AddAction(new QChangeEvent(), new QAjaxAction('txtId_Change')); $this->txtId->AddAction(new QEnterKeyEvent(), new QAjaxAction('txtId_Change')); $this->txtId->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtId->CausesValidation = $this->txtId; $this->btnNew = new RoundedLinkButton($this); $this->btnNew->CssClass = 'searchOption'; $this->btnNew->ToolTip = 'Report a new bug or issue'; $this->btnNew->LinkUrl = '/issues/edit.php/new'; $this->txtSummary = new QTextBox($this); $this->txtSummary->Name = 'Summary'; $this->txtSummary->AddAction(new QChangeEvent(), new QAjaxAction('Refresh')); $this->txtSummary->AddAction(new QEnterKeyEvent(), new QAjaxAction('Refresh')); $this->txtSummary->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->lstCategory = new QListBox($this); $this->lstCategory->Name = 'Category'; $this->lstCategory->AddAction(new QChangeEvent(), new QAjaxAction('Refresh')); $this->lstCategory->AddAction(new QEnterKeyEvent(), new QAjaxAction('Refresh')); $this->lstCategory->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->lstCategory->AddItem('- View All -', null); foreach ($this->objIssueFieldForCategory->GetIssueFieldOptionArray(QQ::OrderBy(QQN::IssueFieldOption()->OrderNumber)) as $objOption) { $this->lstCategory->AddItem($objOption->Name, $objOption->Id); } $this->lstPriority = new QListBox($this); $this->lstPriority->Name = 'Priority'; $this->lstPriority->AddAction(new QChangeEvent(), new QAjaxAction('Refresh')); $this->lstPriority->AddAction(new QEnterKeyEvent(), new QAjaxAction('Refresh')); $this->lstPriority->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->lstPriority->AddItem('- View All -', null); foreach (IssuePriorityType::$NameArray as $intKey => $strName) { $this->lstPriority->AddItem($strName, $intKey); } $this->lstStatus = new QListBox($this); $this->lstStatus->Name = 'Status'; $this->lstStatus->AddAction(new QChangeEvent(), new QAjaxAction('Refresh')); $this->lstStatus->AddAction(new QEnterKeyEvent(), new QAjaxAction('Refresh')); $this->lstStatus->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->lstStatus->AddItem('- View All -', null); foreach (IssueStatusType::$NameArray as $intKey => $strName) { $this->lstStatus->AddItem($strName, $intKey); } $this->txtPostedBy = new QTextBox($this); $this->txtPostedBy->Name = 'Posted By'; $this->txtPostedBy->AddAction(new QChangeEvent(), new QAjaxAction('Refresh')); $this->txtPostedBy->AddAction(new QEnterKeyEvent(), new QAjaxAction('Refresh')); $this->txtPostedBy->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtAssignedTo = new QTextBox($this); $this->txtAssignedTo->Name = 'Assigned To'; $this->txtAssignedTo->AddAction(new QChangeEvent(), new QAjaxAction('Refresh')); $this->txtAssignedTo->AddAction(new QEnterKeyEvent(), new QAjaxAction('Refresh')); $this->txtAssignedTo->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->chkIncludeClosed = new QCheckBox($this); $this->chkIncludeClosed->AddAction(new QClickEvent(), new QAjaxAction('Refresh')); }
protected function Form_Create() { $this->strSanitizedPath = WikiItem::SanitizeForPath(QApplication::$PathInfo, $this->intWikiItemTypeId); $this->objWikiItem = WikiItem::LoadByPathWikiItemTypeId($this->strSanitizedPath, $this->intWikiItemTypeId); $this->strPageTitle .= sprintf(' %s - ', WikiItemType::$NameArray[$this->intWikiItemTypeId]); // If Doesn't Exist, Show the 404 page if (!$this->objWikiItem) { parent::Form_Create(); $this->strHtmlIncludeFilePath = dirname(__FILE__) . '/index_404.tpl.php'; $this->strPageTitle .= QApplication::$PathInfo; return; } // cleanup any dangling versions (if applicable) if (!$this->objWikiItem->CurrentWikiVersion) { if ($this->objWikiItem->CleanupOrphans()) { parent::Form_Create(); $this->strHtmlIncludeFilePath = dirname(__FILE__) . '/index_404.tpl.php'; $this->strPageTitle .= QApplication::$PathInfo; return; } } // Get the Wiki Version object based on the $_GET variables, or use CurrentWikiVersion if none passed in $arrGetKeys = array_keys($_GET); if (count($arrGetKeys) == 1) { $this->objWikiVersion = WikiVersion::LoadByWikiItemIdVersionNumber($this->objWikiItem->Id, $arrGetKeys[0]); } if (!$this->objWikiVersion) { $this->objWikiVersion = $this->objWikiItem->CurrentWikiVersion; } // Setup NavBar and SubNav stuff (if applicable) and setup PageTitle if (!is_null($this->objWikiItem->OverrideNavbarIndex)) { $this->intNavBarIndex = $this->objWikiItem->OverrideNavbarIndex; $this->intSubNavIndex = $this->objWikiItem->OverrideSubnavIndex; $this->strPageTitle = $this->objWikiVersion->Name; } else { $this->strPageTitle .= $this->objWikiVersion->Name; } // Create Controls for Page parent::Form_Create(); if ($this->objWikiItem->IsEditableForPerson(QApplication::$Person)) { $this->btnSetAsCurrentVersion = new QLinkButton($this); $this->btnSetAsCurrentVersion->Text = 'Set as Current'; $this->btnSetAsCurrentVersion->AddAction(new QClickEvent(), new QAjaxAction('btnSetAsCurrentVersion_Click')); $this->btnSetAsCurrentVersion->AddAction(new QClickEvent(), new QTerminateAction()); } // Setup the Main Content Area $this->pnlContent = new QPanel($this); $this->pnlContent->CssClass = 'wiki'; $this->pnlContentHeadline = new QPanel($this->pnlContent); $this->pnlContentHeadline->Template = 'pnlContentHeadline.tpl.php'; $this->btnEdit = new RoundedLinkButton($this->pnlContentHeadline); $this->btnEdit->AddAction(new QClickEvent(), new QAjaxAction('btnEdit_Click')); $this->btnEdit->AddAction(new QClickEvent(), new QTerminateAction()); $this->btnEdit->AddCssClass('roundedLinkGray'); $this->btnToggleVersions = new RoundedLinkButton($this->pnlContentHeadline); $this->btnToggleVersions->AddAction(new QClickEvent(), new QAjaxAction('btnToggleVersions_Click')); $this->btnToggleVersions->AddAction(new QClickEvent(), new QTerminateAction()); $this->btnToggleMessages = new RoundedLinkButton($this->pnlContentHeadline); $this->btnToggleMessages->AddAction(new QClickEvent(), new QAjaxAction('btnToggleMessages_Click')); $this->btnToggleMessages->AddAction(new QClickEvent(), new QTerminateAction()); if ($this->objWikiItem->IsAdminableForPerson(QApplication::$Person)) { $this->btnAdmin = new RoundedLinkButton($this->pnlContentHeadline); $this->btnAdmin->AddAction(new QClickEvent(), new QAjaxAction('btnAdmin_Click')); $this->btnAdmin->AddAction(new QClickEvent(), new QTerminateAction()); $this->btnAdmin->AddCssClass('roundedLinkGray'); $this->btnAdmin->Text = 'Admin This Wiki'; } $this->pnlVersions = new WikiVersionsPanel($this->objWikiItem, $this, 'wikiVersionsPanel'); if (count($arrGetKeys) && is_numeric($arrGetKeys[0])) { $this->pnlVersions_Show(); } else { $this->pnlVersions_Hide(); } // Set the template path baed on the wiki item type $this->SetTemplatePath(); // Setup DateTime of Post $dttLocalize = QApplication::LocalizeDateTime($this->objWikiVersion->PostDate); $this->strPostStartedLinkText = strtolower($dttLocalize->__toString('DDDD, MMMM D, YYYY, h:mm z ')) . strtolower(QApplication::DisplayTimezoneLink($dttLocalize, false)); // Setup messages panel $this->pnlMessages = new MessagesPanel($this); $this->pnlMessages->SelectTopic($this->objWikiItem->TopicLink->GetTopic()); $this->pnlMessages->lblTopicInfo_SetTemplate(__INCLUDES__ . '/messages/lblTopicInfoForWiki.tpl.php'); $this->pnlMessages->btnRespond1->Text = 'Post Comment'; $this->pnlMessages->btnRespond2->Text = 'Post Comment'; $this->pnlMessages->strAdditionalCssClass = 'topicForWiki'; if (array_key_exists('lastpage', $_GET)) { $this->pnlMessages->SetPageNumber(QPaginatedControl::LastPage); $this->pnlMessages_Show(); } else { if (QApplication::IsWikiViewComments()) { $this->pnlMessages_Show(); } else { $this->pnlMessages_Hide(); } } }
protected function Form_Create() { parent::Form_Create(); // Uses the MessagesPanel control for most of the DisplayMessages functionality $this->pnlMessages = new MessagesPanel($this); // Figure out the Forum, ViewState and Topic we are viewing $this->objForum = Forum::Load(QApplication::PathInfo(0)); $this->CalculateViewState($strHeaderSmall, $strHeaderLarge); // Update the MessagePanel Header template based on the View State switch ($this->intViewState) { case 4: $this->pnlMessages->lblTopicInfo_SetTemplate(__INCLUDES__ . '/messages/lblTopicInfoWithForumName.tpl.php'); break; case 1: case 3: case 5: // No Topic is Selected -- therefore, no template break; default: $this->pnlMessages->lblTopicInfo_SetTemplate(__INCLUDES__ . '/messages/lblTopicInfo.tpl.php'); break; } // Setup Controls $this->lblHeader = new QLabel($this); $this->lblHeader->HtmlEntities = false; $this->lblHeader->Text = sprintf('<span style="font-weight: normal; font-size: 12px;">%s: </span> %s', $strHeaderSmall, $strHeaderLarge); $this->lblDescription_Setup(); $this->btnPost_Setup(); $this->txtSearch = new SearchTextBox($this, 'txtSearch'); $this->txtSearch->Text = QApplication::QueryString('search'); $this->txtSearch->AddAction(new QChangeEvent(), new QAjaxAction('ExecuteSearch')); $this->txtSearch->AddAction(new QEnterKeyEvent(), new QAjaxAction('ExecuteSearch')); $this->txtSearch->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtSearch->ActionParameter = $this->intViewState == 5 || $this->intViewState == 6; $this->dtrTopics = new QDataRepeater($this, 'dtrTopics'); $this->dtrTopics->Template = 'dtrTopics.tpl.php'; $this->dtrTopics->SetDataBinder('dtrTopics_Bind'); $this->dtrTopics->Paginator = new ForumTopicsPaginator($this); $this->dtrTopics->ItemsPerPage = 20; $this->dtrTopics->UseAjax = true; $this->pnlMessages->AddControlToRefreshOnUpdate($this->dtrTopics); $this->pnlMessages->SetCallbackOnNewPost($this, 'dtrTopics_Reset'); if (QApplication::PathInfo(2) == 'lastpage') { $this->pnlMessages->SetPageNumber(QPaginatedControl::LastPage); } // Search Stuff $this->btnSearchAll = new RoundedLinkButton($this); $this->btnSearchAll->Text = 'All Forums'; $this->btnSearchAll->CssClass = 'searchOption'; $this->btnSearchAll->ToolTip = 'Search all forums'; $this->btnSearchThis = new RoundedLinkButton($this); $this->btnSearchThis->CssClass = 'searchOption'; if ($this->objForum) { $this->btnSearchThis->Text = '"' . $this->objForum->Name . '"'; $this->btnSearchThis->ToolTip = 'Search within ' . $this->btnSearchThis->Text . ' forum'; } else { if ($this->objTopic) { if ($this->objTopic->TopicLink->Forum) { $this->btnSearchThis->Text = '"' . $this->objTopic->TopicLink->Forum->Name . '"'; $this->btnSearchThis->ToolTip = 'Search within ' . $this->btnSearchThis->Text . ' forum'; } else { $this->btnSearchThis->Text = '"Issues"'; $this->btnSearchThis->ToolTip = 'Search within ' . $this->btnSearchThis->Text . ' forum'; } } else { $this->btnSearchThis->Visible = false; } } if (strlen(trim(QApplication::QueryString('search')))) { if ($this->objForum && $this->objForum->Id == QApplication::PathInfo(0)) { $this->btnSearchThis->AddCssClass('searchOptionActive'); } else { $this->btnSearchAll->AddCssClass('searchOptionActive'); } } else { $this->btnSearchAll->Display = false; $this->btnSearchThis->Display = false; } $this->btnSearchThis->AddAction(new QClickEvent(), new QAjaxAction('ExecuteSearch')); $this->btnSearchThis->AddAction(new QClickEvent(), new QTerminateAction()); $this->btnSearchThis->ActionParameter = true; $this->btnSearchAll->AddAction(new QClickEvent(), new QAjaxAction('ExecuteSearch')); $this->btnSearchAll->AddAction(new QClickEvent(), new QTerminateAction()); $this->btnSearchAll->ActionParameter = false; // Last Minute Cleanup switch ($this->intViewState) { case 3: case 4: $this->txtSearch->ActionParameter = false; break; default: $this->txtSearch->ActionParameter = true; break; } }
protected function Form_Create() { parent::Form_Create(); $objIssue = Issue::Load(QApplication::PathInfo(0)); if (!$objIssue) { $objIssue = new Issue(); $objIssue->IssuePriorityTypeId = IssuePriorityType::Standard; $objIssue->IssueStatusTypeId = IssueStatusType::NewIssue; $objIssue->PostedByPerson = QApplication::$Person; $this->blnEditMode = false; $this->strPageTitle .= 'Create New'; $this->strHeadline = 'Report a New Bug or Issue'; } else { if (!$objIssue->IsEditableForPerson(QApplication::$Person)) { QApplication::RedirectToLogin(); } $this->blnEditMode = true; $this->strPageTitle .= 'Edit Issue #' . $objIssue->Id; $this->strHeadline = 'Edit Issue #' . $objIssue->Id; } $this->mctIssue = new IssueMetaControl($this, $objIssue); $this->txtTitle = $this->mctIssue->txtTitle_Create(); $this->txtTitle->Required = true; $this->txtExampleCode = $this->mctIssue->txtExampleCode_Create(); $this->txtExampleTemplate = $this->mctIssue->txtExampleTemplate_Create(); $this->txtExampleData = $this->mctIssue->txtExampleData_Create(); $this->txtExpectedOutput = $this->mctIssue->txtExpectedOutput_Create(); $this->txtActualOutput = $this->mctIssue->txtActualOutput_Create(); $this->lstPriority = $this->mctIssue->lstIssuePriorityType_Create(); $this->lstStatus = $this->mctIssue->lstIssueStatusType_Create(); $this->lstResolution = $this->mctIssue->lstIssueResolutionType_Create(); $this->txtAssignedTo = new QTextBox($this); $this->txtAssignedTo->ReadOnly = true; $this->txtDueDate = new QDateTimeTextBox($this); $this->calDueDate = new QCalendar($this->txtDueDate, $this->txtDueDate); $this->txtDueDate->Text = $this->mctIssue->Issue->DueDate ? $this->mctIssue->Issue->DueDate->__toString() : null; $this->dlgAssignedTo = new PersonSelectorDialog($this, 'dlgAssignedTo_Select'); $this->txtAssignedTo->AddAction(new QClickEvent(), new QShowDialogBox($this->dlgAssignedTo)); $this->txtAssignedTo->AddAction(new QClickEvent(), new QFocusControlAction($this->dlgAssignedTo->txtMemberSearch)); $this->lstStatus->AddAction(new QChangeEvent(), new QAjaxAction('RefreshStatuses')); foreach (IssueField::LoadArrayByActiveFlag(true, QQ::OrderBy(QQN::IssueField()->OrderNumber)) as $objIssueField) { $this->lstField_Setup($objIssueField); } $this->txtLongDescription = new QTextBox($this); $this->txtLongDescription->Visible = !$this->blnEditMode; $this->txtLongDescription->Required = !$this->blnEditMode; $this->txtLongDescription->TextMode = QTextMode::MultiLine; $this->btnOkay = new QButton($this); $this->btnOkay->CausesValidation = true; $this->btnOkay->Text = $this->blnEditMode ? 'Update Issue' : 'Save New Issue'; $this->btnCancel = new QLinkButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnOkay->AddAction(new QClickEvent(), new QToggleEnableAction($this->btnOkay)); $this->btnOkay->AddAction(new QClickEvent(), new QAjaxAction('btnOkay_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); if ($objIssue->IsAdminableForPerson(QApplication::$Person)) { $this->RefreshStatuses(); } else { $this->txtAssignedTo->Visible = false; $this->txtDueDate->Visible = false; $this->lstStatus->Visible = false; $this->lstResolution->Visible = false; } $this->txtTitle->Focus(); }
protected function Form_Create() { parent::Form_Create(); $this->objBlogTopicArray = Topic::QueryArray(QQ::Equal(QQN::Topic()->TopicLink->ForumId, 5), QQ::Clause(QQ::OrderBy(QQN::Topic()->Id, false), QQ::LimitInfo(4))); }
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()); } } }