Example #1
0
 public function defAction()
 {
     ui::newButton(lang::get('BTN_SAVE'), "javascript:sendForm('save');");
     ui::newButton(lang::get('BTN_APPLY'), "javascript:sendForm('apply');");
     if (isset($_SESSION['STRUCTURE_LIST_FLAG']) && $_SESSION['STRUCTURE_LIST_FLAG']) {
         ui::setCancelButton('/structure/list');
     } else {
         ui::setCancelButton('/structure/tree');
     }
     $list = reg::getList(ormPages::getPrefix() . '/minitext', true);
     $texts = $js = array();
     foreach ($list as $val) {
         $texts[] = array('id' => $val['id'], 'description' => $val['description'], 'num' => '<center>%text_' . $val['id'] . '%</center>', 'text' => $val['value']);
         $js['text_' . $val['id'] . '_vvv'] = $val['value'];
     }
     // Форма редактирования
     $form = new uiMultiForm('change');
     if (reg::getKey('/core/noDelMiniTexts')) {
         $form->withoutRemoving();
     }
     $form->setRight('minitext_proc');
     $form->setData($texts);
     $form->addColumn('description', lang::get('STRUCTURE_TABLE_FIELD_12'), 200, lang::get('STRUCTURE_TABLE_FIELD_13'));
     $form->addColumn('text', lang::get('STRUCTURE_TABLE_FIELD_9'), 500, lang::get('STRUCTURE_TABLE_FIELD_10'));
     $form->addColumn('num', lang::get('STRUCTURE_TABLE_FIELD_8'), 150, lang::get('STRUCTURE_TABLE_FIELD_11'), false);
     $js = '<script language="javascript"> var textlist = ' . json_encode($js) . ';</script>';
     return $js . $form->getHTML('multi_form_memo');
 }