function users_payment_methods($data) { $form_id = 'users_shipping_methods_edit_form'; $Form = new Agform('Редактирование методов доставки', $form_id, setUrl('*/save')); $Form->addButton(array('name' => 'Назад', 'href' => setUrl('*/'), 'options' => array())); $Form->addButton(array('name' => 'Сохранить', 'href' => '#', 'options' => array('id' => 'submit', 'class' => 'addButton'))); $Form->addTabs('users_shipping_methods', 'Методы доставки'); $Users_shipping_methods = new Agform_block(); $pm_array['form_id'] = $form_id; $pm_array['on_langs'] = $data['on_langs']; $pm_array['users_shipping_methods'] = $data['users_shipping_methods']; $pm_array['shipping_methods'] = $data['shipping_methods']; $Users_shipping_methods->addView('form_u_shipping_methods', $pm_array); $Form->addBlockToTabs('users_shipping_methods', $Users_shipping_methods); $Form->renderForm(); }
function admin_modules_form_build($data = array(), $save_param = '') { $Form = new Agform('Опции', 'admin_add_edit_form', setUrl('*/save' . $save_param)); $Form->addButton(array('name' => 'Назад', 'href' => setUrl('*/'), 'options' => array())); if ($save_param != '') { $Form->addButton(array('name' => 'Добавить', 'href' => setUrl('*/add'), 'options' => array('class' => 'addButton'))); $Form->addButton(array('name' => 'Удалить', 'href' => setUrl('*/delete' . $save_param), 'href_values' => array('ID'), 'options' => array('class' => 'delete_question'))); } $Form->addButton(array('name' => 'Сохранить и продолжить редактирование', 'href' => '#', 'options' => array('id' => 'submit_back', 'class' => 'addButton'))); $Form->addButton(array('name' => 'Сохранить', 'href' => '#', 'options' => array('id' => 'submit', 'class' => 'addButton'))); $Form->addTabs('base', 'Опции'); $Form->addTabs('desc', 'Описание опции'); $array_tabs_base = array('attributes_options[alias]' => 'alias'); if (!isset($data['base'])) { $data['base'] = FALSE; } $admin_base = new Agform_block($data['base']); $lid = $admin_base->addObject('fieldset', 'base_fieldset', 'Опции'); $admin_base->addObjectTo($lid, 'text', 'main[alias]', 'Артикул:', array('maxlenght' => '50')); $admin_base->addObjectTo($lid, 'select', 'main[rang]', 'Ранг:', array('options' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5'))); $admin_base->addObjectTo($lid, 'select', 'main[active]', 'Активность :', array('options' => array('0' => 'Нет', '1' => 'Да'))); if (!isset($data['desc'])) { $data['desc'] = FALSE; } $admin_name = new Agform_block($data['desc'], $data['on_langs']); $lid = $admin_name->addObject('fieldset', 'name_fieldset', 'Название'); $admin_name->addObjectTo($lid, 'text', 'langs[$][name]', 'Название:', array('option' => array())); if (!isset($data['desc'])) { $data['desc'] = FALSE; } $admin_description = new Agform_block($data['desc'], $data['on_langs']); $admin_description->addObject('textarea', 'langs[$][description]', 'Короткое описание:', array('option' => array('rows' => '3'))); $admin_description->addObject('hidden', 'langs[$][id_modules_description]'); $Form->addBlockToTabs('base', $admin_base); $Form->addBlockToTabs('base', $admin_name); $Form->addBlockToTabs('desc', $admin_description); $Form->renderForm(); }