Exemplo n.º 1
0
 /**
  * Confirm New user
  *
  */
 protected function CreateNewUserConfirm()
 {
     if (!$this->_login->getCanRegister()) {
         $this->FormLogin();
         return;
     }
     $myWords = $this->WordCollection();
     $container = new XmlnukeUIAlert($this->_context, UIAlert::BoxAlert);
     $container->setAutoHide(5000);
     $this->_blockCenter->addXmlnukeObject($container);
     if ($this->_login->getName() == "" || $this->_login->getEmail() == "" || $this->_login->getUsername() == "" || !Util::isValidEmail($this->_login->getEmail())) {
         $container->addXmlnukeObject(new XmlnukeText($myWords->Value("INCOMPLETEDATA"), true));
         $this->CreateNewUser();
     } elseif (!XmlInputImageValidate::validateText($this->_context)) {
         $container->addXmlnukeObject(new XmlnukeText($myWords->Value("OBJECTIMAGEINVALID"), true));
         $this->CreateNewUser();
     } else {
         $newpassword = $this->getRandomPassword();
         if (!$this->_users->addUser($this->_login->getName(), $this->_login->getUsername(), $this->_login->getEmail(), $newpassword)) {
             $container->addXmlnukeObject(new XmlnukeText($myWords->Value("CREATEUSERFAIL"), true));
             $this->CreateNewUser();
         } else {
             $this->sendWelcomeMessage($myWords, $this->_context->get("name"), $this->_context->get("newloguser"), $this->_context->get("email"), $newpassword);
             $this->_users->Save();
             $container->addXmlnukeObject(new XmlnukeText($myWords->Value("CREATEUSEROK"), true));
             $container->setUIAlertType(UIAlert::BoxInfo);
             $this->FormLogin($block);
         }
     }
 }
Exemplo n.º 2
0
 /**
  * Enter description here...
  *
  * @return IXmlnukeDocumentObject
  */
 protected function showResultMessage()
 {
     $msg = $this->_context->get(self::PARAM_MSG);
     if ($msg == self::ACTION_NEW_CONFIRM) {
         $message = $this->_lang->Value("MSG_NEW_SUCCESS");
     } else {
         if ($msg == self::ACTION_EDIT_CONFIRM) {
             $message = $this->_lang->Value("MSG_EDIT_SUCCESS");
         } else {
             if ($msg == self::ACTION_DELETE_CONFIRM) {
                 $message = $this->_lang->Value("MSG_DELETE_SUCCESS");
             } else {
                 $message = $this->_lang->Value("MSG_NOCHANGE");
             }
         }
     }
     $container = new XmlnukeUIAlert($this->_context, UIAlert::BoxInfo);
     $container->setAutoHide(8000);
     $container->addXmlnukeObject(new XmlnukeText($message, true, true, false));
     return $container;
 }
Exemplo n.º 3
0
 protected function Opcao18()
 {
     $block = new XmlBlockCollection("Exemplo 18: UI Alert", BlockPosition::Center);
     //XmlnukeBreakLine br = new XmlnukeBreakLine();
     $para = new XmlParagraphCollection();
     $para->addXmlnukeObject(new XmlnukeText("Esse exemplo mostra como mostrar uma mensagem de alert no cliente"));
     $block->addXmlnukeObject($para);
     if ($this->_context->get("type") != "") {
         switch ($this->_context->get("type")) {
             case 1:
                 $uialert = new XmlnukeUIAlert($this->_context, UIAlert::Dialog, "Isso é um teste");
                 break;
             case 2:
                 $uialert = new XmlnukeUIAlert($this->_context, UIAlert::ModalDialog, "Isso é um teste");
                 $uialert->setAutoHide(10000);
                 break;
             case 3:
                 $uialert = new XmlnukeUIAlert($this->_context, UIAlert::ModalDialog, "Isso é um teste");
                 $uialert->addRedirectButton("Ok", $this->_url);
                 $uialert->addCloseButton("Cancel");
                 break;
             case 4:
                 $uialert = new XmlnukeUIAlert($this->_context, UIAlert::ModalDialog, "Isso é um teste");
                 $uialert->addRedirectButton("Ok, proceed!", $this->_url);
                 $uialert->addCloseButton("Cancel");
                 $uialert->setOpenAction(UIAlertOpenAction::Button, "Clique me");
                 break;
             case 5:
                 $uialert = new XmlnukeUIAlert($this->_context, UIAlert::BoxInfo, "Isso é um teste");
                 $uialert->setAutoHide(2000);
                 break;
             case 6:
                 $uialert = new XmlnukeUIAlert($this->_context, UIAlert::BoxAlert, "Isso é um teste");
                 break;
         }
         $uialert->addXmlnukeObject(new XmlnukeText("Isso é um novo teste, novo teste"));
         $block->addXmlnukeObject($uialert);
     }
     $list = array();
     $list[$this->_url . "?op=18&type=1"] = "Caixa de Diálogo";
     $list[$this->_url . "?op=18&type=2"] = "Caixa de Diálogo Modal";
     $list[$this->_url . "?op=18&type=3"] = "Caixa de Diálogo Modal com botão de fechar";
     $list[$this->_url . "?op=18&type=4"] = "Caixa de Diálogo Modal com botões de confirmação e abrir personalizado";
     $list[$this->_url . "?op=18&type=5"] = "Box de Informação com auto hide";
     $list[$this->_url . "?op=18&type=6"] = "Box de Alerta";
     $listElement = new XmlListCollection(XmlListType::UnorderedList, "Opções");
     foreach ($list as $key => $value) {
         $href = new XmlAnchorCollection($key);
         $href->addXmlnukeObject(new XmlnukeText($value));
         $listElement->addXmlnukeObject($href);
     }
     $block->addXmlnukeObject($listElement);
     $this->_document->addXmlnukeObject($block);
 }