/** * Add EditList to site * * @param XmlBlockCollection $this->_mainBlock * @param string $site * @param AnyDataset $dataset */ protected function AddEditListToSite($block, $site, $dataset) { $para = new XmlParagraphCollection(); $this->_mainBlock->addXmlnukeObject($para); $this->url->addParam("editsite", $site); $editList = new XmlEditList($this->_context, $this->myWords->Value("EDITLIST_TITLE", $site), $this->url->getUrl(), true, false, true, true); $editList->setDataSource($dataset->getIterator()); $listField = new EditListField(); $listField->editlistName = ""; $listField->fieldData = "role"; $editList->addEditListField($listField); $listField = new EditListField(); $listField->editlistName = $this->myWords->Value("EDITLIST_ROLES"); $listField->fieldData = $this->user->getRolesTable()->Role; $editList->addEditListField($listField); $listField = new EditListField(); $listField->editlistName = $this->myWords->Value("EDITLIST_SITES"); $listField->fieldData = $this->user->getRolesTable()->Site; $editList->addEditListField($listField); $para->addXmlnukeObject($editList); }
/** * Action Upload * */ protected function actionUpload() { $blockCenter = new XmlBlockCollection($this->_myWords->Value("UPLOAD"), BlockPosition::Center); $this->_document->addXmlnukeObject($blockCenter); $paragraph = new XmlParagraphCollection(); $blockCenter->addXmlnukeObject($paragraph); switch ($this->_action) { case 'add': $fileProcessor = new UploadFilenameProcessor('*.*'); $fileProcessor->setFilenameLocation(ForceFilenameLocation::DefinePath, "diretorio/subdir/"); $result = $this->_context->processUpload($fileProcessor, false, 'form_file'); $paragraph->addXmlnukeObject(new XmlnukeText("Arquivo " . $result[0] . " enviado com sucesso ao servidor!")); break; default: $paragraph->addXmlnukeObject(new XmlnukeText($this->_myWords->Value("DESCUPLOADTEXT2"))); $url = new XmlnukeManageUrl(URLTYPE::MODULE, $this->_url); $url->addParam('op', '6'); $url->addParam('action', 'add'); $form = new XmlFormCollection($this->_context, $url->getUrl(), $this->_myWords->Value("MAKEUPLOAD")); $paragraph = new XmlParagraphCollection(); $blockCenter->addXmlnukeObject($paragraph); $paragraph->addXmlnukeObject($form); $fileField = new XmlInputFile($this->_myWords->Value("FILE"), 'form_file'); $form->addXmlnukeObject($fileField); $button = new XmlInputButtons(); $button->addSubmit($this->_myWords->Value("ADD"), ""); $form->addXmlnukeObject($button); break; } }