/** View one */
 public function view()
 {
     if (!isset($_GET['id']) || !ctype_digit((string) $_GET['id'])) {
         return;
     }
     $feedback_id = $_GET['id'];
     $feedback = new Feedback($feedback_id);
     if (!$feedback) {
         return;
     }
     $feedback_data = $feedback->getAsArray();
     $form = CmsForm::getInstance()->outputTagForm(false);
     $feedback_data['date_created'] = date(CFG_CMS_DATETIME_FORMAT, $feedback_data['date_created']);
     unset($feedback_data['id']);
     unset($feedback_data['client_id']);
     foreach ($feedback_data as $k => $item) {
         if (!is_string($item)) {
             continue;
         }
         $form->addField(Converter::symb2Ttl($k), CmsHtml::getInstance($k)->value(htmlspecialchars($item, ENT_QUOTES)));
     }
     echo $form;
 }
Esempio n. 2
0
 /**
  * Create file
  */
 public function create_file()
 {
     $dir = $_GET['path'];
     if ($dir[0] == '/') {
         $dir = substr($dir, 1);
     }
     echo CmsForm::getInstance()->setAction('?p=' . P . '&do=_create_file&path=' . $dir)->setSubmitButton(new CmsButton('Create'))->addField('Path', CmsHTML::getInstance('path')->setValue($dir))->addField('File name', CmsInputText::getInstance('name')->hint('With extension'))->addField('File content', CmsTextarea::getInstance('content')->setRowCount(30));
 }