Exemplo n.º 1
0
 public function __construct($objParentObject, $strClosePanelMethod, $intId = null, $strControlId = null)
 {
     // Call the Parent
     try {
         parent::__construct($objParentObject, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     // Setup Callback and Template
     $this->strTemplate = __DOCROOT__ . __PANEL_DRAFTS__ . '/UserEditPanel.tpl.php';
     $this->strClosePanelMethod = $strClosePanelMethod;
     // Construct the UserMetaControl
     // MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent
     $this->mctUser = UserMetaControl::Create($this, $intId);
     // Call MetaControl's methods to create qcontrols based on User's data fields
     $this->lblId = $this->mctUser->lblId_Create();
     $this->txtNick = $this->mctUser->txtNick_Create();
     $this->txtPassword = $this->mctUser->txtPassword_Create();
     $this->txtEmail = $this->mctUser->txtEmail_Create();
     $this->txtStatus = $this->mctUser->txtStatus_Create();
     $this->calCreatedAt = $this->mctUser->calCreatedAt_Create();
     $this->txtActivationKey = $this->mctUser->txtActivationKey_Create();
     $this->calActivatedAt = $this->mctUser->calActivatedAt_Create();
     $this->calLastseenAt = $this->mctUser->calLastseenAt_Create();
     $this->txtRealname = $this->mctUser->txtRealname_Create();
     $this->txtAddress = $this->mctUser->txtAddress_Create();
     $this->txtState = $this->mctUser->txtState_Create();
     $this->txtZip = $this->mctUser->txtZip_Create();
     $this->txtFbinCount = $this->mctUser->txtFbinCount_Create();
     $this->txtFbinTotal = $this->mctUser->txtFbinTotal_Create();
     $this->txtFboutCount = $this->mctUser->txtFboutCount_Create();
     $this->txtFboutTotal = $this->mctUser->txtFboutTotal_Create();
     // Create Buttons and Actions on this Form
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = QApplication::Translate('Save');
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
     $this->btnSave->CausesValidation = $this;
     $this->btnCancel = new QButton($this);
     $this->btnCancel->Text = QApplication::Translate('Cancel');
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click'));
     $this->btnDelete = new QButton($this);
     $this->btnDelete->Text = QApplication::Translate('Delete');
     $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction(QApplication::Translate('Are you SURE you want to DELETE this') . ' ' . QApplication::Translate('User') . '?'));
     $this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
     $this->btnDelete->Visible = $this->mctUser->EditMode;
 }
Exemplo n.º 2
0
 protected function Form_Create()
 {
     // Use the CreateFromPathInfo shortcut (this can also be done manually using the UserMetaControl constructor)
     // MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent
     $this->mctUser = UserMetaControl::CreateFromPathInfo($this);
     // Call MetaControl's methods to create qcontrols based on User's data fields
     $this->lblId = $this->mctUser->lblId_Create();
     $this->txtNick = $this->mctUser->txtNick_Create();
     $this->txtPassword = $this->mctUser->txtPassword_Create();
     $this->txtEmail = $this->mctUser->txtEmail_Create();
     $this->txtStatus = $this->mctUser->txtStatus_Create();
     $this->calCreatedAt = $this->mctUser->calCreatedAt_Create();
     $this->txtActivationKey = $this->mctUser->txtActivationKey_Create();
     $this->calActivatedAt = $this->mctUser->calActivatedAt_Create();
     $this->calLastseenAt = $this->mctUser->calLastseenAt_Create();
     $this->txtRealname = $this->mctUser->txtRealname_Create();
     $this->txtAddress = $this->mctUser->txtAddress_Create();
     $this->txtState = $this->mctUser->txtState_Create();
     $this->txtZip = $this->mctUser->txtZip_Create();
     $this->txtFbinCount = $this->mctUser->txtFbinCount_Create();
     $this->txtFbinTotal = $this->mctUser->txtFbinTotal_Create();
     $this->txtFboutCount = $this->mctUser->txtFboutCount_Create();
     $this->txtFboutTotal = $this->mctUser->txtFboutTotal_Create();
     // Create Buttons and Actions on this Form
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = QApplication::Translate('Save');
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
     $this->btnSave->CausesValidation = true;
     $this->btnCancel = new QButton($this);
     $this->btnCancel->Text = QApplication::Translate('Cancel');
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
     $this->btnDelete = new QButton($this);
     $this->btnDelete->Text = QApplication::Translate('Delete');
     $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction(QApplication::Translate('Are you SURE you want to DELETE this') . ' ' . QApplication::Translate('User') . '?'));
     $this->btnDelete->AddAction(new QClickEvent(), new QAjaxAction('btnDelete_Click'));
     $this->btnDelete->Visible = $this->mctUser->EditMode;
 }
 /**
  * Static Helper Method to Create using QueryString arguments
  *
  * @param mixed $objParentObject QForm or QPanel which will be using this UserMetaControl
  * @param QMetaControlCreateType $intCreateType rules governing User object creation - defaults to CreateOrEdit
  * @return UserMetaControl
  */
 public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     $intId = QApplication::QueryString('intId');
     return UserMetaControl::Create($objParentObject, $intId, $intCreateType);
 }