Example #1
0
 /**
  * @mcms_message ru.molinos.cms.admin.form.backup
  */
 public function getAdminFormXML(Context $ctx)
 {
     $form = new Form(array('action' => '?q=backup.rpc', 'title' => t('Архивирование сайта')));
     $form->addControl(new EnumRadioControl(array('value' => 'action', 'label' => t('Выберите операцию'), 'options' => array('backup' => t('Скачать архив сайта')), 'required' => true)));
     $form->addControl(new SubmitControl(array('text' => t('Продолжить'))));
     return $form->getXML(Control::data(array()));
 }
 public static function on_get_add_new(Context $ctx)
 {
     $types = array();
     foreach (Widget::list_types($ctx) as $k => $v) {
         $types[$k] = $v['name'];
     }
     asort($types);
     $form = new Form(array('method' => 'get', 'action' => self::listurl . '/add', 'title' => t('Добавление виджета')));
     $form->addControl(new EnumControl(array('label' => t('Тип виджета'), 'required' => true, 'options' => $types, 'default' => 'listwidget', 'value' => 'type')));
     $form->addControl(new SubmitControl(array('text' => t('Продолжить'))));
     $html = $form->getXML(Control::data(array('type' => 'listwidget')));
     return html::wrap('content', $html, array('name' => 'edit', 'title' => t('Новый виджет')));
 }