本文整理汇总了PHP中QButton类的典型用法代码示例。如果您正苦于以下问题:PHP QButton类的具体用法?PHP QButton怎么用?PHP QButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($objParentObject, $strControlId = null, StewardshipBatch $objBatch, StewardshipStack $objStack = null, $strUrlHashArgument1 = null, $strUrlHashArgument2 = null, $strUrlHashArgument3 = null)
{
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$this->strTemplate = dirname(__FILE__) . '/' . get_class($this) . '.tpl.php';
$this->objBatch = $objBatch;
$this->objStack = $objStack;
$this->strUrlHashArgument = $strUrlHashArgument1;
$this->strUrlHashArgument2 = $strUrlHashArgument2;
$this->strUrlHashArgument3 = $strUrlHashArgument3;
$this->btnSave = new QButton($this);
$this->btnSave->Text = 'Save';
$this->btnSave->CssClass = 'primary';
$this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
$this->btnSave->CausesValidation = $this;
$this->btnCancel = new QLinkButton($this);
$this->btnCancel->Text = 'Cancel';
$this->btnCancel->CssClass = 'cancel';
$this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click'));
$this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
$this->SetupPanel();
}
示例2: dtg_ButtonRender
public function dtg_ButtonRender($item)
{
$strControl = new QButton($this);
$strControl->Text = 'Button';
$strControl->ActionParameter = $item;
$strControl->AddAction(new QClickEvent(), new QServerAction('btn_click'));
return $strControl->Render(false);
}
示例3: dtgNotificationUserAccount_EditLinkColumn_Render
public function dtgNotificationUserAccount_EditLinkColumn_Render(NotificationUserAccount $objNotificationUserAccount)
{
$strControlId = 'btnEdit' . $this->dtgNotificationUserAccount->CurrentRowIndex;
$btnEdit = $this->objForm->GetControl($strControlId);
if (!$btnEdit) {
$btnEdit = new QButton($this->dtgNotificationUserAccount, $strControlId);
$btnEdit->Text = QApplication::Translate('Edit');
$btnEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnEdit_Click'));
}
$btnEdit->ActionParameter = $objNotificationUserAccount->NotificationUserAccountId;
return $btnEdit->Render(false);
}
示例4: dtgDatagrid_EditLinkColumn_Render
public function dtgDatagrid_EditLinkColumn_Render(Datagrid $objDatagrid)
{
$strControlId = 'btnEdit' . $this->dtgDatagrid->CurrentRowIndex;
$btnEdit = $this->objForm->GetControl($strControlId);
if (!$btnEdit) {
$btnEdit = new QButton($this->dtgDatagrid, $strControlId);
$btnEdit->Text = QApplication::Translate('Edit');
$btnEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnEdit_Click'));
}
$btnEdit->ActionParameter = $objDatagrid->DatagridId;
return $btnEdit->Render(false);
}
示例5: renderButton
public function renderButton(Person $objPerson)
{
$objControlId = "editButton" . $objPerson->Id;
if (!($objControl = $this->GetControl($objControlId))) {
$objControl = new QButton($this, $objControlId);
$objControl->Text = "Edit Person #" . $objPerson->Id;
$objControl->AddAction(new QClickEvent(), new QAjaxAction("renderButton_Click"));
$objControl->ActionParameter = $objPerson->Id;
}
// We pass the parameter of "false" to make sure the control doesn't render
// itself RIGHT HERE - that it instead returns its string rendering result.
return $objControl->Render(false);
}
示例6: RenderDeleteButton
/**
* A non-delegated event version. Create a new button for each control and attach an action to it.
*
* @param Person $objPerson
* @return String
*/
public function RenderDeleteButton($objPerson)
{
$strControlId = 'btn' . $objPerson->Id;
$objControl = $this->GetControl($strControlId);
if (!$objControl) {
$objControl = new QButton($this);
$objControl->Text = 'Edit';
$objControl->ActionParameter = $objPerson->Id;
$objControl->AddAction(new QClickEvent(), new QAjaxAction('dtgPersonsButton_Click'));
// This will generate a javascript call for every button created.
}
return $objControl->Render(false);
}
示例7: lnkSelected_Render
public function lnkSelected_Render(Praises $objPraise)
{
$strControlId = 'lnkSelected' . $objPraise->Id;
// Let's see if the Checkbox exists already
$lnkSelected = $this->GetControl($strControlId);
if (!$lnkSelected) {
$lnkSelected = new QButton($this->dtgPraises, $strControlId);
$lnkSelected->Text = $objPraise->Subject;
$lnkSelected->ActionParameter = $objPraise->Id;
$lnkSelected->CssClass = 'linkButton';
$lnkSelected->AddAction(new QClickEvent(), new QServerAction('lnkSelected_Click'));
}
return $lnkSelected->Render(false);
}
示例8: render_btnToggleRecords
public function render_btnToggleRecords($parControl, $strType)
{
$strControlId = 'btnToggleRecordsforaddressofperson' . $strType->Id . 'ofproject' . $this->objProject->Id;
if (!($objControl = $parControl->GetChildControl($strControlId))) {
// But in this case the parent control of the button
// would be this child QDataGrid, don't forget that...
$person_addresses = Address::QueryCount(QQ::Equal(QQN::Address()->PersonId, $strType->Id));
if ($person_addresses > 0) {
$objControl = new QButton($parControl, $strControlId);
$objControl->Width = 20;
$objControl->Text = '+';
$objControl->CssClass = 'inputbutton';
$objControl->ActionParameter = "{$strType->Id}";
// Important! for a better coding we want to all
// actions referer to the child QdataGris stay
// in the child Qdatagrid, so the actions are now
// QAjaxControlAction or QServerControlAction, were the
// controlId parameter is $this, becaouse in $this class
// is defined the event for this button... kind of easy,
// and clean.
$objControl->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnToggleRecords_Click', $this->objParentObject->WaitIcon));
} else {
// No addresses to expand; we'll use an empty label control to signify that
$objControl = new QLabel($parControl, $strControlId);
$objControl->Text = '';
}
}
// We pass the parameter of "false" to make sure the control doesn't render
// itself RIGHT HERE - that it instead returns its string rendering result.
return $objControl->Render(false);
}
示例9: Form_Create
protected function Form_Create()
{
// default legacy protection, will throw an exception
$this->txtTextbox1 = new QTextbox($this);
$this->txtTextbox1->Text = 'Hello!';
$this->txtTextbox1->Width = 500;
$this->lblLabel1 = new QLabel($this);
$this->lblLabel1->HtmlEntities = false;
$this->lblLabel1->Text = "";
$this->btnButton1 = new QButton($this);
$this->btnButton1->Text = "Parse and Display";
$this->btnButton1->AddAction(new QClickEvent(), new QAjaxAction('btnButton1_Click'));
// htmlentities mode
$this->txtTextbox2 = new QTextbox($this);
$this->txtTextbox2->CrossScripting = QCrossScripting::HtmlEntities;
$this->txtTextbox2->Text = 'Hello! <script>alert("I am an evil attacker.")</script>';
$this->txtTextbox2->Width = 500;
$this->lblLabel2 = new QLabel($this);
$this->lblLabel2->Text = "";
$this->btnButton2 = new QButton($this);
$this->btnButton2->Text = "Parse and Display";
$this->btnButton2->AddAction(new QClickEvent(), new QAjaxAction('btnButton2_Click'));
// full protection with the HTMLPurifier defaults
$this->txtTextbox3 = new QTextbox($this);
$this->txtTextbox3->CrossScripting = QCrossScripting::HTMLPurifier;
$this->txtTextbox3->Text = 'Hello! <script>alert("I am an evil attacker.")</script>';
$this->txtTextbox3->Width = 500;
$this->lblLabel3 = new QLabel($this);
$this->lblLabel3->Text = "";
$this->btnButton3 = new QButton($this);
$this->btnButton3->Text = "Parse and Display";
$this->btnButton3->AddAction(new QClickEvent(), new QAjaxAction('btnButton3_Click'));
// full protection with an allowed list of tags
$this->txtTextbox4 = new QTextbox($this);
$this->txtTextbox4->CrossScripting = QCrossScripting::HTMLPurifier;
$this->txtTextbox4->SetPurifierConfig("HTML.Allowed", "b,strong,i,em,img[src]");
$this->txtTextbox4->Text = 'Hello! <script>alert("I am an evil attacker.")</script><b>Hello</b> <i>again</i>!';
$this->txtTextbox4->Width = 500;
$this->lblLabel4 = new QLabel($this);
$this->lblLabel4->HtmlEntities = false;
$this->lblLabel4->Text = "";
$this->btnButton4 = new QButton($this);
$this->btnButton4->Text = "Parse and Display";
$this->btnButton4->AddAction(new QClickEvent(), new QAjaxAction('btnButton4_Click'));
// the textbox won't have the XSS protection!
$this->txtTextbox5 = new QTextbox($this);
$this->txtTextbox5->CrossScripting = QCrossScripting::Allow;
$this->txtTextbox5->Text = 'Hello! <script>alert("I am an evil attacker.")</script><b>Hello</b> again!';
$this->txtTextbox5->Width = 500;
$this->lblLabel5 = new QLabel($this);
$this->lblLabel5->HtmlEntities = false;
$this->lblLabel5->Text = "";
$this->btnButton5 = new QButton($this);
$this->btnButton5->Text = "Parse and Display";
$this->btnButton5->AddAction(new QClickEvent(), new QAjaxAction('btnButton5_Click'));
}
示例10: EditColumn_Render
public function EditColumn_Render(Attribute $objAttribute)
{
// Let's specify a specific Control ID for our button, using the datagrid's CurrentRowIndex
$strControlId = 'btnEditAttribute' . $this->dtgAttributes->CurrentRowIndex;
$btnEdit = $this->objForm->GetControl($strControlId);
if (!$btnEdit) {
// Only create/instantiate a new Edit button for this Row if it doesn't yet exist
$btnEdit = new QButton($this->dtgAttributes, $strControlId);
$btnEdit->Text = 'Add';
$btnEdit->CssClass = 'primary';
// Define an Event Handler on the Button
// Because the event handler, itself, is defined in the control, we use QAjaxControlAction instead of QAjaxAction
$btnEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnEditAttribute_Click'));
}
// Finally, update the Actionparameter for our button to store the $objAttribute's ID.
$btnEdit->ActionParameter = $objAttribute->Id . "_" . $objAttribute->AttributeDataTypeId . "_" . $objAttribute->Name . "_" . $this->dtgAttributes->CurrentRowIndex;
// Return the Rendered Button Control
return $btnEdit->Render(false);
}
示例11: __construct
public function __construct($objParentObject, $strControlId = null, Person $objPerson = null, $strUrlHashArgument)
{
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$this->strTemplate = dirname(__FILE__) . '/../' . $this->objForm->strSubNavItemArray[$this->objForm->strSubNavItemToken][1] . '/' . get_class($this) . '.tpl.php';
$this->objPerson = $objPerson;
$this->strUrlHashArgument = $strUrlHashArgument;
$this->btnSave = new QButton($this);
$this->btnSave->Text = 'Save';
$this->btnSave->CssClass = 'primary';
$this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
$this->btnSave->CausesValidation = $this;
$this->btnCancel = new QLinkButton($this);
$this->btnCancel->Text = 'Cancel';
$this->btnCancel->CssClass = 'cancel';
$this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click'));
$this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
$this->SetupPanel();
}
示例12: render_btnToggleRecordsSummary
public function render_btnToggleRecordsSummary(Project $objProject)
{
// Create their unique id...
$objControlId = 'btnToggleRecordsSummary' . $objProject->Id;
if (!($objControl = $this->GetControl($objControlId))) {
$intTeamMemberCount = Person::CountByProjectAsTeamMember($objProject->Id);
if ($intTeamMemberCount > 0) {
// If not exists create our toggle button who his parent
// is our master QDataGrid...
$objControl = new QButton($this->dtgProjects, $objControlId);
$objControl->Width = 25;
$objControl->Text = '+' . $intTeamMemberCount;
$objControl->CssClass = 'inputbutton';
// Pass the id of the bounded item just for other process
// on click event
$objControl->ActionParameter = $objProject->Id;
// Add event on click the toogle button
$objControl->AddAction(new QClickEvent(), new QAjaxAction('btnToggleRecordsSummary_Click'));
}
}
// We pass the parameter of "false" to make sure the control doesn't render
// itself RIGHT HERE - that it instead returns its string rendering result.
return $objControl->Render(false);
}
示例13: SetupEmailMessageControls
/**
* Sets up the EmailMessageRouteDataGrid if there are messages associated with this group
* @return void
*/
protected function SetupEmailMessageControls()
{
$this->dtgEmailMessageRoute = new EmailMessageRouteDataGrid($this);
$this->dtgEmailMessageRoute->MetaAddColumn(QQN::EmailMessageRoute()->EmailMessage->DateReceived, 'Width=115px', 'FontSize=11px', 'Html=<?= $_CONTROL->ParentControl->RenderEmailDateReceived($_ITEM); ?>');
$this->dtgEmailMessageRoute->MetaAddColumn(QQN::EmailMessageRoute()->EmailMessage->FromAddress, 'Width=200px', 'FontSize=11px', 'Html=<?= $_CONTROL->ParentControl->RenderEmailFromAddress($_ITEM); ?>', 'HtmlEntities=false');
$this->dtgEmailMessageRoute->MetaAddColumn(QQN::EmailMessageRoute()->EmailMessage->Subject, 'Width=420px', 'FontSize=11px', 'Html=<?= $_CONTROL->ParentControl->RenderEmailSubject($_ITEM); ?>', 'HtmlEntities=false');
$this->dtgEmailMessageRoute->SetDataBinder('dtgEmailMessageRoute_Bind', $this);
$this->dtgEmailMessageRoute->Paginator = new QPaginator($this->dtgEmailMessageRoute);
$this->dtgEmailMessageRoute->SortColumnIndex = 0;
$this->dtgEmailMessageRoute->SortDirection = 1;
$this->dlgEmailMessage = new QDialogBox($this);
$this->dlgEmailMessage->Template = dirname(__FILE__) . '/dlgEmailMessage.tpl.php';
$this->dlgEmailMessage->HideDialogBox();
$this->btnEmailMessage = new QButton($this->dlgEmailMessage);
$this->btnEmailMessage->Text = 'Close';
$this->btnEmailMessage->AddAction(new QClickEvent(), new QHideDialogBox($this->dlgEmailMessage));
$this->pxyEmailMessage = new QControlProxy($this);
$this->pxyEmailMessage->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyEmailMessage_Click'));
$this->pxyEmailMessage->AddAction(new QClickEvent(), new QTerminateAction());
}
示例14: btnAddField_Click
protected function btnAddField_Click()
{
$intTotalCount = count($this->lstMapHeaderArray);
$this->lstMapHeader_Create($this, $intTotalCount - 1, $this->chkHeaderRow->Checked ? "addfield" : null);
$objTemp = $this->lstMapHeaderArray[$intTotalCount];
$this->lstMapHeaderArray[$intTotalCount] = $this->lstMapHeaderArray[$intTotalCount - 1];
$this->lstMapHeaderArray[$intTotalCount - 1] = $objTemp;
$txtDefaultValue = new QTextBox($this);
$txtDefaultValue->Width = 200;
$this->txtMapDefaultValueArray[] = $txtDefaultValue;
$lstDefaultValue = new QListBox($this);
$lstDefaultValue->Width = 200;
$lstDefaultValue->Display = false;
$this->lstMapDefaultValueArray[] = $lstDefaultValue;
$dtpDate = new QDateTimePicker($this);
$dtpDate->DateTimePickerType = QDateTimePickerType::Date;
$dtpDate->DateTimePickerFormat = QDateTimePickerFormat::MonthDayYear;
$dtpDate->Display = false;
$this->dtpDateArray[] = $dtpDate;
$btnRemove = new QButton($this);
$btnRemove->Text = "Remove";
$btnRemove->ActionParameter = $intTotalCount - 1;
$btnRemove->AddAction(new QClickEvent(), new QServerAction('btnRemove_Click'));
$btnRemove->AddAction(new QEnterKeyEvent(), new QServerAction('btnRemove_Click'));
$btnRemove->AddAction(new QEnterKeyEvent(), new QTerminateAction());
if (isset($this->arrMapFields[$intTotalCount - 1])) {
unset($this->arrMapFields[$intTotalCount - 1]);
}
$this->btnRemoveArray[$intTotalCount - 1] = $btnRemove;
}
示例15: dtgRoleEntityQtypeCustomFieldAuthorization_EditLinkColumn_Render
public function dtgRoleEntityQtypeCustomFieldAuthorization_EditLinkColumn_Render(RoleEntityQtypeCustomFieldAuthorization $objRoleEntityQtypeCustomFieldAuthorization)
{
$strControlId = 'btnEdit' . $this->dtgRoleEntityQtypeCustomFieldAuthorization->CurrentRowIndex;
$btnEdit = $this->objForm->GetControl($strControlId);
if (!$btnEdit) {
$btnEdit = new QButton($this->dtgRoleEntityQtypeCustomFieldAuthorization, $strControlId);
$btnEdit->Text = QApplication::Translate('Edit');
$btnEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnEdit_Click'));
}
$btnEdit->ActionParameter = $objRoleEntityQtypeCustomFieldAuthorization->RoleEntityQtypeCustomFieldAuthorizationId;
return $btnEdit->Render(false);
}
开发者ID:heshuai64,项目名称:einv2,代码行数:12,代码来源:RoleEntityQtypeCustomFieldAuthorizationListPanelBase.class.php