示例#1
0
 /**
  * Create edit popup
  * @param Regex $p_oRegex
  * @param array $p_aCategories
  * @return string Code HTML
  */
 private function createEditPopup($p_oRegex, $p_aCategories)
 {
     $oPopup = new View('popup');
     $oPopup->addData('id', $p_oRegex->getId());
     $oPopup->addData('buttonstyle', 'btn-primary');
     $oPopup->addData('buttonicon', 'fa-edit');
     $oPopup->addData('buttontext', Language::translate('PARSER_ADMIN_EDIT_EDIT'));
     $oPopup->addData('title', Language::translate('PARSER_ADMIN_EDIT_TITLE'));
     //Create formular
     $oFormEdit = new FormGenerator();
     $oFormEdit->setAction('index.php?p=adminparser&edit=' . $p_oRegex->getId());
     $oFormEdit->addInput(Language::translate('PARSER_ADMIN_EDIT_NAME'), 'name', true, false, 'text', '', $p_oRegex->getName());
     $oFormEdit->addInput(Language::translate('PARSER_ADMIN_EDIT_REGEX'), 'regex', true, false, 'text', '', $p_oRegex->getRegex());
     $oFormEdit->addSelect(Language::translate('PARSER_ADMIN_EDIT_CATEGORIE'), 'categorie', $p_aCategories, $p_oRegex->getCategorie());
     $oFormEdit->addCheckbox(Language::translate('PARSER_ADMIN_EDIT_DELETE'), 'delete');
     $oFormEdit->create();
     $oPopup->addData('content', $oFormEdit->getCode());
     $oPopup->create();
     return $oPopup->getCode();
 }