/** * Enter description here... * * @param XmlBlockCollection $block * @param string $pollname */ protected function ListAnswers($block, $pollname, $lang) { $yesno = array("Y" => $this->myWords->Value("YES"), "N" => $this->myWords->Value("NO")); $processfields = new CrudFieldCollection(); $field = CrudField::FactoryMinimal("name", $this->myWords->Value("POLLNAME"), 15, true, true); $field->key = true; $field->editable = $this->_context->get("acao") == XmlnukeCrudBase::ACTION_NEW_CONFIRM; $field->defaultValue = $pollname; $processfields->addCrudField($field); $field = CrudField::FactoryMinimal("lang", $this->myWords->Value("POLLLANG"), 5, true, true); $field->key = true; $field->editable = $this->_context->get("acao") == XmlnukeCrudBase::ACTION_NEW_CONFIRM; $field->fieldXmlInput = XmlInputObjectType::SELECTLIST; $field->arraySelectList = $this->_context->LanguagesAvailable(); $field->defaultValue = $lang; $processfields->addCrudField($field); $field = CrudField::FactoryMinimal("code", $this->myWords->Value("ANSWERCODE"), 3, true, true); $field->key = true; $field->dataType = INPUTTYPE::NUMBER; $processfields->addCrudField($field); $field = CrudField::FactoryMinimal("short", $this->myWords->Value("SHORTTEXT"), 10, true, true); $processfields->addCrudField($field); $field = CrudField::FactoryMinimal("answer", $this->myWords->Value("ANSWERTEXT"), 50, true, true); $processfields->addCrudField($field); $field = CrudField::FactoryMinimal("votes", $this->myWords->Value("ANSWERVOTES"), 3, true, true); $field->editable = false; $field->defaultValue = 0; $field->dataType = INPUTTYPE::NUMBER; $processfields->addCrudField($field); if ($this->_isdb) { $crud = new XmlnukeCrudDB($this->_context, $processfields, $this->myWords->Value("AVAILABLEANSWER", $pollname), $this->_moduleUrl, null, $this->_tblanswer, $this->_connection); $crud->setFilter("name = '" . $pollname . "' and lang='" . $lang . "'"); } else { $anydatafile = new AnydatasetFilenameProcessor("poll_" . $pollname . "_" . $lang); $crud = new XmlnukeCrudAnydata($this->_context, $processfields, $this->myWords->Value("AVAILABLEANSWER", $pollname), $this->_moduleUrl, null, $anydatafile); } $crud->addParameter("op", "answernav"); $crud->addParameter("curpoll", $pollname); $crud->addParameter("curlang", $lang); $block->addXmlnukeObject($crud); }
public function CreatePage() { parent::CreatePage(); $onlyGroup = $this->_context->get("onlygroup") != ""; $urlXml = "module:Xmlnuke.Admin.ManageXML"; $urlGrp = "module:Xmlnuke.Admin.ManageGroup"; $this->myWords = $this->WordCollection(); $this->setTitlePage($this->myWords->Value("TITLE")); $this->setHelp($this->myWords->Value("DESCRIPTION")); if (!$onlyGroup) { $this->addMenuOption($this->myWords->Value("EDITALLXML"), $urlXml . "?id=_all"); $this->addMenuOption($this->myWords->Value("NEWXML"), $urlXml); } $this->addMenuOption($this->myWords->Value("NEWGROUP"), $urlGrp); // Open Index File $indexFile = new XMLFilenameProcessor("index"); //XmlDocument $index = $this->_context->getXMLDataBase()->getDocument($indexFile->FullQualifiedName(), null); $groupList = XmlUtil::SelectNodes($index->documentElement, "group"); $table = new XmlTableCollection(); foreach ($groupList as $node) { $groupText = XmlUtil::SelectSingleNode($node, "title")->nodeValue; $groupId = XmlUtil::SelectSingleNode($node, "id")->nodeValue; $row = new XmlTableRowCollection(); $col = new XmlTableColumnCollection(); $anchor = new XmlAnchorCollection($urlGrp . "?id=" . $groupId, ""); $anchor->addXmlnukeObject(new XmlnukeText($this->myWords->Value("TXT_EDIT"), true, false, false)); $col->addXmlnukeObject($anchor); $row->addXmlnukeObject($col); $col = new XmlTableColumnCollection(); $anchor = new XmlAnchorCollection($urlGrp . "?id=" . $groupId . "&action=delete", ""); $anchor->addXmlnukeObject(new XmlnukeText($this->myWords->Value("TXT_DELETE"), true, false, false)); $col->addXmlnukeObject($anchor); $row->addXmlnukeObject($col); $col = new XmlTableColumnCollection(); $col->addXmlnukeObject(new XmlnukeText($groupText, true, false, false)); $row->addXmlnukeObject($col); $table->addXmlnukeObject($row); if (!$onlyGroup) { $fileList = XmlUtil::SelectNodes($index->documentElement, "group[id='" . $groupId . "']/page"); foreach ($fileList as $nodeFile) { $fileText = XmlUtil::SelectSingleNode($nodeFile, "title")->nodeValue; $fileId = XmlUtil::SelectSingleNode($nodeFile, "id")->nodeValue; $fileAbstract = XmlUtil::SelectSingleNode($nodeFile, "summary")->nodeValue; $row = new XmlTableRowCollection(); $col = new XmlTableColumnCollection(); $anchor = new XmlAnchorCollection($urlXml . "?id=" . $fileId, ""); $anchor->addXmlnukeObject(new XmlnukeText($this->myWords->Value("TXT_EDIT"))); $col->addXmlnukeObject($anchor); $row->addXmlnukeObject($col); $col = new XmlTableColumnCollection(); $anchor = new XmlAnchorCollection($urlXml . "?id=" . $fileId . "&action=delete", ""); $anchor->addXmlnukeObject(new XmlnukeText($this->myWords->Value("TXT_DELETE"))); $col->addXmlnukeObject($anchor); $row->addXmlnukeObject($col); $col = new XmlTableColumnCollection(); $col->addXmlnukeObject(new XmlnukeText($fileText)); $col->addXmlnukeObject(new XmlnukeBreakLine()); $col->addXmlnukeObject(new XmlnukeText($fileAbstract, false, true, false)); $row->addXmlnukeObject($col); $table->addXmlnukeObject($row); } } } $block = new XmlBlockCollection($this->myWords->Value("WORKINGAREA"), BlockPosition::Center); $paragraph = new XmlParagraphCollection(); $paragraph->addXmlnukeObject($table); $block->addXmlnukeObject($paragraph); $this->defaultXmlnukeDocument->addXmlnukeObject($block); return $this->defaultXmlnukeDocument->generatePage(); }
public function CreatePage() { if ($this->_context->get("logout") != "") { $this->_context->redirectUrl("module:Xmlnuke.Admin.ControlPanel"); } parent::CreatePage(); $mywords = $this->WordCollection(); $this->bindParameteres(); $this->setTitlePage($mywords->Value("CONTROLPANEL")); $this->setHelp($mywords->Value("CONTROLPANEL_HELP")); $it = $this->GetAdminGroups($this->getGroup()); if ($it->hasNext()) { $sr = $it->moveNext(); $xmlObj = new XmlnukeStringXML("<listmodules group=\"CP_" . $sr->getField("name") . "\" />"); $this->defaultXmlnukeDocument->addXmlnukeObject($xmlObj); //Debug::PrintValue($sr->getField("name")); } else { throw new NotFoundException("Admin Group not found!"); } $block = new XmlBlockCollection($mywords->Value("BLOCKINFO_TITLE"), BlockPosition::Center); $paragraph = new XmlParagraphCollection(); $block->addXmlnukeObject($paragraph); $paragraph->addXmlnukeObject(new XmlnukeText($mywords->Value("INFO_USER", array($this->_context->authenticatedUser(), $this->_context->authenticatedUserId())), false, false, false, true)); $this->defaultXmlnukeDocument->addXmlnukeObject($block); return $this->defaultXmlnukeDocument->generatePage(); }
public function EditUser($users, $uid) { $user = $users->getById($uid); $block = new XmlBlockCollection($this->myWords->Value("EDITUSER") . $user->getField($users->getUserTable()->username), BlockPosition::Center); if (!$this->isUserAdmin() && $user->getField($users->getUserTable()->admin) == "yes") { $p = new XmlParagraphCollection(); $p->addXmlnukeObject(new XmlnukeText($this->myWords->Value("CANNOTEDITADMIN"))); $block->addXmlnukeObject($p); $this->defaultXmlnukeDocument->addXmlnukeObject($block); return; } $tabview = new XmlnukeTabView(); $block->addXmlnukeObject($tabview); // ------------------------------------------------------------------- // EDITAR USUÁRIO $form = new XmlFormCollection($this->_context, $this->url, ""); $form->setJSValidate(true); $form->addXmlnukeObject(new XmlInputHidden("action", "update")); $form->addXmlnukeObject(new XmlInputHidden("curpage", $this->_context->get("curpage"))); $form->addXmlnukeObject(new XmlInputHidden("valueid", $uid)); $textbox = new XmlInputTextBox($this->myWords->Value("LABEL_LOGIN"), "login", $user->getField($users->getUserTable()->username)); $textbox->setDataType(INPUTTYPE::TEXT); $textbox->setRequired(true); $textbox->setReadOnly(true); $form->addXmlnukeObject($textbox); $textbox = new XmlInputTextBox($this->myWords->Value("LABEL_NAME"), "name", $user->getField($users->getUserTable()->name)); $textbox->setDataType(INPUTTYPE::TEXT); $textbox->setRequired(true); $form->addXmlnukeObject($textbox); $textbox = new XmlInputTextBox($this->myWords->Value("LABEL_EMAIL"), "email", $user->getField($users->getUserTable()->email)); $textbox->setDataType(INPUTTYPE::EMAIL); $textbox->setRequired(true); $form->addXmlnukeObject($textbox); $textbox = new XmlInputLabelField($this->myWords->Value("LABEL_PASSWORD"), $this->myWords->Value("FORMPASSWORDNOTVIEW")); $form->addXmlnukeObject($textbox); $check = new XmlInputCheck($this->myWords->Value("FORMADMINISTRADOR"), "admin", "yes"); $check->setChecked($user->getField($users->getUserTable()->admin)); $check->setReadOnly(!$this->isUserAdmin()); $form->addXmlnukeObject($check); $boxButton = new XmlInputButtons(); $boxButton->addSubmit($this->myWords->Value("TXT_UPDATE"), ""); $form->addXmlnukeObject($boxButton); $tabview->addTabItem($this->myWords->Value("TABEDITUSER"), $form); // ------------------------------------------------------------------- // ALTERAR SENHA $form = new XmlFormCollection($this->_context, $this->url, ""); $form->setJSValidate(true); $form->addXmlnukeObject(new XmlInputHidden("action", "changepassword")); $form->addXmlnukeObject(new XmlInputHidden("curpage", $this->_context->get("curpage"))); $form->addXmlnukeObject(new XmlInputHidden("valueid", $uid)); $textbox = new XmlInputTextBox($this->myWords->Value("FORMNEWPASSWORD"), "password", ""); $textbox->setInputTextBoxType(InputTextBoxType::PASSWORD); $textbox->setDataType(INPUTTYPE::TEXT); $textbox->setRequired(true); $form->addXmlnukeObject($textbox); $boxButton = new XmlInputButtons(); $boxButton->addSubmit($this->myWords->Value("TXT_CHANGE"), ""); $form->addXmlnukeObject($boxButton); $tabview->addTabItem($this->myWords->Value("TABCHANGEPASSWD"), $form); // ------------------------------------------------------------------- // REMOVER USUARIO $form = new XmlFormCollection($this->_context, $this->url, ""); $form->setJSValidate(true); $form->addXmlnukeObject(new XmlInputHidden("action", "delete")); $form->addXmlnukeObject(new XmlInputHidden("curpage", $this->_context->get("curpage"))); $form->addXmlnukeObject(new XmlInputHidden("valueid", $uid)); $boxButton = new XmlInputButtons(); $boxButton->addSubmit($this->myWords->Value("BUTTONREMOVE"), ""); $form->addXmlnukeObject($boxButton); $tabview->addTabItem($this->myWords->Value("TABREMOVEUSER"), $form); // ------------------------------------------------------------------- // REMOVER PAPEL DO USUARIO $para = new XmlParagraphCollection(); $form = new XmlFormCollection($this->_context, $this->url, $this->myWords->Value("FORMEDITROLES")); $form->setJSValidate(true); $form->addXmlnukeObject(new XmlInputHidden("action", "removerole")); $form->addXmlnukeObject(new XmlInputHidden("curpage", $this->_context->get("curpage"))); $form->addXmlnukeObject(new XmlInputHidden("valueid", $uid)); $userroles = $users->returnUserProperty($uid, UserProperty::Role); $userroles = is_null($userroles) ? array() : $userroles; $roles = array(); foreach ($userroles as $i) { $roles[$i] = $i; } $form->addXmlnukeObject(new XmlEasyList(EasyListType::SELECTLIST, "role", $this->myWords->Value("FORMUSERROLES"), $roles)); $boxButton = new XmlInputButtons(); $boxButton->addSubmit($this->myWords->Value("TXT_REMOVE"), ""); $form->addXmlnukeObject($boxButton); $para->addXmlnukeObject($form); // ------------------------------------------------------------------- // ADICIONAR PAPEL AO USUARIO $form = new XmlFormCollection($this->_context, $this->url, ""); $form->setJSValidate(true); $form->addXmlnukeObject(new XmlInputHidden("action", "addrole")); $form->addXmlnukeObject(new XmlInputHidden("curpage", $this->_context->get("curpage"))); $form->addXmlnukeObject(new XmlInputHidden("valueid", $uid)); // $textbox = new XmlInputTextBox($this->myWords->Value("FORMROLES"), "role", "", 10); // $textbox->setInputTextBoxType(InputTextBoxType::TEXT); // $textbox->setDataType(INPUTTYPE::TEXT); // $textbox->setRequired(true); // $form->addXmlnukeObject($textbox); // $form->addXmlnukeObject(new XmlInputLabelField("DEFAULT ROLES", "EDITOR")); // $form->addXmlnukeObject(new XmlInputLabelField("", "DESIGNER")); // $form->addXmlnukeObject(new XmlInputLabelField("", "MANAGER")); $roleData = $this->getAllRoles($users); $selectRole = new XmlEasyList(EasyListType::SELECTLIST, "role", $this->myWords->Value("FORMROLES"), $roleData); $form->addXmlnukeObject($selectRole); $boxButton = new XmlInputButtons(); $boxButton->addSubmit($this->myWords->Value("TXT_ADD"), ""); $form->addXmlnukeObject($boxButton); $para->addXmlnukeObject($form); $tabview->addTabItem($this->myWords->Value("TABMANROLE"), $para, $this->_action == "addrole" || $this->_action == "removerole"); //------------------------------------------------------------------------ // CUSTOM FIELDS //------------------------------------------------------------------------ $block2 = new XmlnukeSpanCollection(); $table = new XmlTableCollection(); $row = new XmlTableRowCollection(); $col = new XmlTableColumnCollection(); $col->addXmlnukeObject(new XmlnukeText($this->myWords->Value("ACTION"), true)); $row->addXmlnukeObject($col); $col = new XmlTableColumnCollection(); $col->addXmlnukeObject(new XmlnukeText($this->myWords->Value("GRIDFIELD"), true)); $row->addXmlnukeObject($col); $col = new XmlTableColumnCollection(); $col->addXmlnukeObject(new XmlnukeText($this->myWords->Value("GRIDVALUE"), true)); $row->addXmlnukeObject($col); $table->addXmlnukeObject($row); $fields = $user->getFieldNames(); $fieldsLength = count($fields); foreach ($fields as $fldValue => $fldName) { $values = $user->getFieldArray($fldName); foreach ($values as $value) { $row = new XmlTableRowCollection(); $col = new XmlTableColumnCollection(); if ($fldName != $users->getUserTable()->name && $fldName != $users->getUserTable()->username && $fldName != $users->getUserTable()->email && $fldName != $users->getUserTable()->password && $fldName != $users->getUserTable()->created && $fldName != $users->getUserTable()->admin && $fldName != $users->getUserTable()->id) { $href = new XmlAnchorCollection("module:Xmlnuke.Admin.ManageUsers?action=removecustomvalue&customfield=" . $fldName . "&valueid=" . $uid . "&customvalue=" . urlencode($value), ""); $href->addXmlnukeObject(new XmlnukeText($this->myWords->Value("TXT_REMOVE"))); $col->addXmlnukeObject($href); } else { $col->addXmlnukeObject(new XmlnukeText("---")); } $row->addXmlnukeObject($col); $col = new XmlTableColumnCollection(); $col->addXmlnukeObject(new XmlnukeText($fldName)); $row->addXmlnukeObject($col); $col = new XmlTableColumnCollection(); $col->addXmlnukeObject(new XmlnukeText($value)); $row->addXmlnukeObject($col); $table->addXmlnukeObject($row); } } $paragraph = new XmlParagraphCollection(); $paragraph->addXmlnukeObject($table); $block2->addXmlnukeObject($paragraph); $table = new XmlTableCollection(); $row = new XmlTableRowCollection(); $col = new XmlTableColumnCollection(); $form = new XmlFormCollection($this->_context, $this->url, $this->myWords->Value("GRIDVALUE")); $form->setJSValidate(true); $form->addXmlnukeObject(new XmlInputHidden("action", "addcustomvalue")); $form->addXmlnukeObject(new XmlInputHidden("curpage", $this->_context->get("curpage"))); $form->addXmlnukeObject(new XmlInputHidden("valueid", $uid)); $textbox = new XmlInputTextBox($this->myWords->Value("FORMFIELD"), "customfield", "", 20); $textbox->setInputTextBoxType(InputTextBoxType::TEXT); $textbox->setDataType(INPUTTYPE::TEXT); $textbox->setRequired(true); $form->addXmlnukeObject($textbox); $textbox = new XmlInputTextBox($this->myWords->Value("FORMVALUE"), "customvalue", "", 40); $textbox->setInputTextBoxType(InputTextBoxType::TEXT); $textbox->setDataType(INPUTTYPE::TEXT); $textbox->setRequired(true); $form->addXmlnukeObject($textbox); $boxButton = new XmlInputButtons(); $boxButton->addSubmit($this->myWords->Value("TXT_ADD"), ""); $form->addXmlnukeObject($boxButton); $col->addXmlnukeObject($form); $row->addXmlnukeObject($col); $table->addXmlnukeObject($row); $paragraph = new XmlParagraphCollection(); $paragraph->addXmlnukeObject($table); $block2->addXmlnukeObject($paragraph); $tabview->addTabItem($this->myWords->Value("TABCUSTOMVALUE"), $block2, $this->_action == "addcustomvalue" || $this->_action == "removecustomvalue"); $this->defaultXmlnukeDocument->addXmlnukeObject($block); }
/** * Create Page Method * * @return PageXml */ public function CreatePage() { parent::CreatePage(); $this->_myWords = $this->WordCollection(); $this->defaultXmlnukeDocument->addMenuItem("module:Xmlnuke.Admin.FileManagement", $this->_myWords->Value("FILEMANAGEMENT"), ""); $this->_block = new XmlBlockCollection($this->_myWords->Value("FILEMANAGEMENT"), BlockPosition::Center); $this->setTitlePage($this->_myWords->Value("TITLE")); $this->setHelp($this->_myWords->Value("DESCRIPTION")); $this->defaultXmlnukeDocument->addXmlnukeObject($this->_block); //get the current folder $root = $this->_context->get("folder"); $browser = new XmlFileBrowser($root, $this->_action, $this->_context); //SET FILEBROWSER ACESS LEVEL $processor = new AnydatasetFilenameProcessor("filemanagement"); $processor->setFilenameLocation(ForceFilenameLocation::UseWhereExists); $anyDataSet = new AnyDataset($processor->FullQualifiedNameAndPath()); $ignoreAdmin = false; $it = $anyDataSet->getIterator(); while ($it->hasNext()) { $row = $it->moveNext(); switch ($row->getField("type")) { case "INITIAL_DIR": $initial_dir = $row->getFieldArray("value"); $browser->setSubFoldersPermitted($initial_dir); break; case "VALID_FILE_NEW": $file_new_list = $row->getFieldArray("value"); $browser->setFileNewList($file_new_list); break; case "VALID_FILE_VIEW": $file_view_list = $row->getFieldArray("value"); $browser->setFileViewList($file_view_list); break; case "VALID_FILE_EDIT": $file_edit_list = $row->getFieldArray("value"); $browser->setFileEditList($file_edit_list); break; case "VALID_FILE_DELETE": $file_delete_list = $row->getFieldArray("value"); $browser->setFileDeleteList($file_delete_list); break; case "VALID_FILE_UPLOAD": $file_upload_list = $row->getFieldArray("value"); $browser->setFileUploadList($file_upload_list); break; case "VALID_FILE_MAX_UPLOAD": $file_max_upload = $row->getField("value"); $browser->setFileMaxUpload($file_max_upload); break; case "PERMISSION": $browser->setFileNew($row->getField("file_new")); $browser->setFileView($row->getField("file_view")); $browser->setFileEdit($row->getField("file_edit")); $browser->setFileDelete($row->getField("file_delete")); $browser->setFileUpload($row->getField("file_upload")); $browser->setFolderNew($row->getField("folder_new")); $browser->setFolderView($row->getField("folder_view")); $browser->setFolderEdit($row->getField("folder_edit")); $browser->setFolderDelete($row->getField("folder_delete")); $ignoreAdmin = $row->getField("ignore_admin") == "true"; break; } } if ($this->isUserAdmin() && !$ignoreAdmin) { $browser->setUserType(FileBrownserUserType::ADMIN); } $this->_block->addXmlnukeObject($browser); return $this->defaultXmlnukeDocument->generatePage(); }
public function CreatePage() { parent::CreatePage(); $myWords = $this->WordCollection(); $this->setHelp($myWords->Value("DESCRIPTION")); //this.addMenuOption("OK", "module:Xmlnuke.Admin.ManageGroup?action=aqui"); $this->setTitlePage($myWords->Value("TITLE")); //this.addMenuOption("Click here to ERASE ALL cache.", "module:Xmlnuke.Admin.CustomConfig?action=erase"); //this.addMenuOption("Click here to LIST cache.", "module:Xmlnuke.Admin.CustomConfig?action=list"); $action = strtolower($this->_action); $block = new XmlBlockCollection($myWords->Value("WORKINGAREA"), BlockPosition::Center); /* XmlNode paragraph; XmlNode form; XmlNode boxButton; */ if ($action == "update") { $nv = array(); $nv["xmlnuke.SMTPSERVER"] = $this->_context->get("smtpserver"); $nv["xmlnuke.LANGUAGESAVAILABLE"] = $this->createLanguageString(); $nv["xmlnuke.SHOWCOMPLETEERRORMESSAGES"] = $this->_context->get("showcompleterrormessages"); $nv["xmlnuke.LOGINMODULE"] = $this->_context->get("loginmodule"); $nv["xmlnuke.USERSDATABASE"] = $this->_context->get("usersdatabase"); $nv["xmlnuke.USERSCLASS"] = $this->_context->get("usersclass"); $nv["xmlnuke.DEBUG"] = $this->_context->get("txtdebug"); $nv["xmlnuke.DETECTMOBILE"] = $this->_context->get("txtdetectmobile"); $nv["xmlnuke.CAPTCHACHALLENGE"] = $this->_context->get("captchachallenge"); $nv["xmlnuke.CAPTCHALETTERS"] = $this->_context->get("captchaletters"); $nv["xmlnuke.ENABLEPARAMPROCESSOR"] = $this->_context->get("enableparamprocessor"); $nv["xmlnuke.USEFULLPARAMETER"] = $this->_context->get("usefullparameter"); $nv["xmlnuke.PHPLIBDIR"] = $this->_context->get("phplibdir"); # PHP SPECIFIC $this->_context->updateCustomConfig($nv); $paragraph = new XmlParagraphCollection(); $paragraph->addXmlnukeObject(new XmlnukeText($myWords->Value("UPDATED"), true)); $block->addXmlnukeObject($paragraph); } $form = new XmlFormCollection($this->_context, "module:Xmlnuke.Admin.CustomConfig", $myWords->Value("FORMTITLE")); $form->setJSValidate(true); $form->setFormName("form"); $truefalse = array("" => "Use Default", "true" => "True", "false" => "False"); $form->addXmlnukeObject(new XmlInputHidden("action", "update")); $form->addXmlnukeObject(new XmlInputLabelField("xmlnuke.ROOTDIR", $this->_context->get("xmlnuke.ROOTDIR"))); $form->addXmlnukeObject(new XmlInputLabelField("xmlnuke.USEABSOLUTEPATHSROOTDIR", $this->_context->get("xmlnuke.USEABSOLUTEPATHSROOTDIR"))); $form->addXmlnukeObject(new XmlInputLabelField("xmlnuke.URLMODULE", $this->_context->get("xmlnuke.URLMODULE"))); $form->addXmlnukeObject(new XmlInputLabelField("xmlnuke.URLXMLNUKEADMIN", $this->_context->get("xmlnuke.URLXMLNUKEADMIN"))); $form->addXmlnukeObject(new XmlInputLabelField("xmlnuke.URLXMLNUKEENGINE", $this->_context->get("xmlnuke.URLXMLNUKEENGINE"))); $form->addXmlnukeObject(new XmlInputLabelField("xmlnuke.DEFAULTPAGE", $this->_context->get("xmlnuke.DEFAULTPAGE"))); $form->addXmlnukeObject(new XmlInputLabelField("xmlnuke.XSLCACHE", $this->_context->get("xmlnuke.XSLCACHE"))); $form->addXmlnukeObject(new XmlInputTextBox("xmlnuke.SMTPSERVER", "smtpserver", $this->_context->get("xmlnuke.SMTPSERVER"), 30)); $this->generateLanguageInput($form); $form->addXmlnukeObject(new XmlEasyList(EasyListType::SELECTLIST, "showcompleterrormessages", "xmlnuke.SHOWCOMPLETEERRORMESSAGES", $truefalse, $this->getStringBool($this->_context->get("xmlnuke.SHOWCOMPLETEERRORMESSAGES")))); $form->addXmlnukeObject(new XmlInputTextBox("xmlnuke.LOGINMODULE", "loginmodule", $this->_context->get("xmlnuke.LOGINMODULE"), 30)); $form->addXmlnukeObject(new XmlEasyList(EasyListType::SELECTLIST, "usersdatabase", "xmlnuke.USERSDATABASE", $this->getStringConnectionsArray(), $this->_context->get("xmlnuke.USERSDATABASE"))); $form->addXmlnukeObject(new XmlInputTextBox("xmlnuke.USERSCLASS", "usersclass", $this->_context->get("xmlnuke.USERSCLASS"), 30)); $form->addXmlnukeObject(new XmlEasyList(EasyListType::SELECTLIST, "txtdetectmobile", "xmlnuke.DETECTMOBILE", $truefalse, $this->getStringBool($this->_context->get("xmlnuke.DETECTMOBILE")))); $form->addXmlnukeObject(new XmlEasyList(EasyListType::SELECTLIST, "txtdebug", "xmlnuke.DEBUG", $truefalse, $this->getStringBool($this->_context->get("xmlnuke.DEBUG")))); $form->addXmlnukeObject(new XmlEasyList(EasyListType::SELECTLIST, "captchachallenge", "xmlnuke.CAPTCHACHALLENGE", array("easy" => "Easy", "hard" => "Hard"), $this->_context->get("xmlnuke.CAPTCHACHALLENGE"))); $form->addXmlnukeObject(new XmlEasyList(EasyListType::SELECTLIST, "captchaletters", "xmlnuke.CAPTCHALETTERS", array("5" => "5", "6" => "6", "7" => "7", "8" => "8", "9" => "9", "10" => "10"), $this->_context->get("xmlnuke.CAPTCHALETTERS"))); $form->addXmlnukeObject(new XmlEasyList(EasyListType::SELECTLIST, "enableparamprocessor", "xmlnuke.ENABLEPARAMPROCESSOR", $truefalse, $this->getStringBool($this->_context->get("xmlnuke.ENABLEPARAMPROCESSOR")))); $form->addXmlnukeObject(new XmlEasyList(EasyListType::SELECTLIST, "usefullparameter", "xmlnuke.USEFULLPARAMETER", $truefalse, $this->getStringBool($this->_context->get("xmlnuke.USEFULLPARAMETER")))); $form->addXmlnukeObject(new XmlInputLabelField("xmlnuke.CACHESTORAGEMETHOD", $this->_context->get("xmlnuke.CACHESTORAGEMETHOD"))); $form->addXmlnukeObject(new XmlInputLabelField("xmlnuke.XMLSTORAGEMETHOD", $this->_context->get("xmlnuke.XMLSTORAGEMETHOD"))); $form->addXmlnukeObject(new XmlInputLabelField("xmlnuke.XMLNUKEDATA", $this->_context->get("xmlnuke.XMLNUKEDATA"))); $form->addXmlnukeObject(new XmlInputTextBox("xmlnuke.PHPLIBDIR", "phplibdir", $this->_context->get("xmlnuke.PHPLIBDIR"), 30)); $boxButton = new XmlInputButtons(); $boxButton->addSubmit($myWords->Value("TXT_SAVE")); $form->addXmlnukeObject($boxButton); $block->addXmlnukeObject($form); $this->defaultXmlnukeDocument->addXmlnukeObject($block); return $this->defaultXmlnukeDocument; }
/** *@param string $strTitle *@return void *@desc Title config */ protected function setTitlePage($strTitle) { $this->_mainBlock->setTitle($strTitle); }
public function CreatePage() { parent::CreatePage(); $this->myWords = $this->WordCollection(); $this->setTitlePage($this->myWords->Value("TITLE")); $this->setHelp($this->myWords->Value("DESCRIPTION")); $block = new XmlBlockCollection($this->myWords->Value("BLOCK_TITLE"), BlockPosition::Center); $anydatafile = new AnydatasetFilenameProcessor("_db"); if ($this->_action != "test") { $processfields = new CrudFieldCollection(); $field = new CrudField(); $field->fieldName = "dbname"; $field->editable = true; $field->key = true; $field->visibleInList = true; $field->dataType = INPUTTYPE::TEXT; $field->fieldXmlInput = XmlInputObjectType::TEXTBOX; $field->fieldCaption = $this->myWords->Value("DBNAME"); $field->size = 20; $field->maxLength = 20; $field->required = true; $field->newColumn = true; $processfields->addCrudField($field); $field = new CrudField(); $field->fieldName = "dbtype"; $field->editable = true; $field->key = false; $field->visibleInList = true; $field->dataType = INPUTTYPE::TEXT; $field->fieldXmlInput = XmlInputObjectType::SELECTLIST; $field->fieldCaption = $this->myWords->Value("DBTYPE"); $field->size = 15; $field->maxLength = 15; $field->required = true; $field->arraySelectList = array("dsn" => "dsn (use it)", "literal" => "PDO Literal connection string", "dblib" => "FreeTDS / Microsoft SQL Server / Sybase", "firebird" => "Firebird/Interbase 6", "informix" => "IBM Informix Dynamic Server", "mysql" => "MySQL 3.x/4.x/5.x", "oci" => "Oracle Call Interface", "odbc" => "ODBC v3 (IBM DB2, unixODBC and win32 ODBC)", "pgsql" => "PostgreSQL", "sqlite" => "SQL Lite"); $field->defaultValue = "dsn"; $field->newColumn = true; $processfields->addCrudField($field); $field = new CrudField(); $field->fieldName = "dbconnectionstring"; $field->editable = true; $field->key = false; $field->visibleInList = true; $field->dataType = INPUTTYPE::TEXT; $field->fieldXmlInput = XmlInputObjectType::TEXTBOX; $field->fieldCaption = $this->myWords->Value("DBCONNECTIONSTRING"); $field->size = 50; $field->maxLength = 200; $field->required = true; $field->defaultValue = "adodriver://*****:*****@server/datasource?persist"; $field->newColumn = true; $processfields->addCrudField($field); $buttons = new CustomButtons(); $buttons->action = "test"; $buttons->alternateText = $this->myWords->Value("TESTALTERNATETEXT"); $buttons->enabled = true; $buttons->icon = "common/editlist/ic_selecionar.gif"; $buttons->message = $this->myWords->Value("TESTMESSAGETEXT"); $buttons->multiple = MultipleSelectType::ONLYONE; $crud = new XmlnukeCrudAnydata($this->_context, $processfields, $this->myWords->Value("AVAILABLELANGUAGES"), "module:Xmlnuke.Admin.ManageDBConn", array($buttons), $anydatafile); $block->addXmlnukeObject($crud); $p = new XmlParagraphCollection(); $p->addXmlnukeObject(new XmlnukeText($this->myWords->Value("NOTE"), true)); $p->addXmlnukeObject(new XmlnukeText($this->myWords->Value("PHPNOTE"))); $block->addXmlnukeObject($p); } else { $p = new XmlParagraphCollection(); $db = $this->_context->get("valueid"); if ($db == "") { $p->addXmlnukeObject(new XmlnukeText($this->myWords->Value("ERRORDBEMPTY"))); } else { try { $dbdataset = new DBDataset($db); $dbdataset->TestConnection(); $p->addXmlnukeObject(new XmlnukeText($this->myWords->Value("SEEMSOK"))); } catch (Exception $ex) { $p->addXmlnukeObject(new XmlnukeText($this->myWords->Value("GOTERROR", $ex->getMessage()))); } } $block->addXmlnukeObject($p); $p = new XmlParagraphCollection(); $href = new XmlAnchorCollection("module:Xmlnuke.Admin.ManageDBConn"); $href->addXmlnukeObject(new XmlnukeText($this->myWords->Value("GOBACK"))); $p->addXmlnukeObject($href); $block->addXmlnukeObject($p); } $this->defaultXmlnukeDocument->addXmlnukeObject($block); return $this->defaultXmlnukeDocument->generatePage(); }
protected function Opcao20() { $block = new XmlBlockCollection("Exemplo 20: Portlets", BlockPosition::Center); //XmlnukeBreakLine br = new XmlnukeBreakLine(); $para = new XmlParagraphCollection(); $para->addXmlnukeObject(new XmlnukeText("Esse exemplo mostra como criar um componente de ordenação interativa com o uso de Portlets através da classe de abstração XmlInputSortable")); $block->addXmlnukeObject($para); $form = new XmlFormCollection($this->_context, "", "Portlet Example"); // Portlet One $sortable = new XmlInputSortableList("Teste", "meunome", array("col1", "col2")); $sortable->setConnectKey("ligacao"); $sortable->setFullSize(true); $sortable->addSortableItem("", new XmlnukeText("Coluna 1"), SortableListItemState::Disabled, "col1"); $sortable->addPortlet("1", "Titulo 1", new XmlnukeText("Teste 1"), "col1"); $sortable->addPortlet("2", "Titulo 2", new XmlnukeText("Teste 2"), "col1"); $sortable->addPortlet("3", "Titulo 3", new XmlnukeText("Teste 3"), "col1"); $sortable->addSortableItem("", new XmlnukeText("Coluna 2"), SortableListItemState::Disabled, "col2"); $sortable->addPortlet("4", "Titulo 4", new XmlnukeText("Teste 4"), "col2"); $sortable->addPortlet("5", "Titulo 5", new XmlnukeText("Teste 5"), "col2"); $form->addXmlnukeObject($sortable); // Portlet Two $sortable = new XmlInputSortableList("Teste2", "meunome2"); $sortable->setConnectKey("ligacao"); $sortable->setFullSize(true); $sortable->addSortableItem("", new XmlnukeText("Outra Coluna"), SortableListItemState::Disabled); $sortable->addPortlet("6", "Titulo 6", new XmlnukeText("Teste 6")); $sortable->addPortlet("7", "Titulo 7", new XmlnukeText("Teste 7")); $form->addXmlnukeObject($sortable); $block->addXmlnukeObject($form); $this->_document->addXmlnukeObject($block); }