} echo $layout->column('33%'); echo $layout->subtitle(txt('ftp_public')); if (is_root() || is_admin()) { echo $layout->txtdesc(txt('dsc_ftp_list_public')); } else { echo $layout->txtdesc(txt('dsc_ftp_list_public_user')); } $ftp = new phpos_ftp(); $ftp_ids = $ftp->get_public_ftp(); $c = count($ftp_ids); if ($c != 0) { echo $layout->tbl_start(); $layout->td_classes(array('', '', 'tbl_grey')); echo $layout->head(array('<img src="' . ICONS . 'accounts/small_users.png" />' => '20%', txt('ftp_account') => '40%', 'Host' => '40%')); for ($i = 0; $i < $c; $i++) { $f = new phpos_ftp(); $f->set_id($ftp_ids[$i]['id']); $f->get_ftp(); //$usr_count = $f->count_users(); $u = new phpos_users(); $u->set_id_user($group_ids[$i]['id_owner']); $u->get_user_by_id(); echo $layout->row(array('<img src="' . ICONS . 'accounts/small_users.png" style="height:20px"/>', '<a href="javascript:void(0);" onclick="' . helper_reload(array('section' => 'edit_account', 'ftp_id' => $f->get_id())) . '">' . $f->get_title() . '</a>', $f->get_host()), $f->get_desc()); } echo $layout->tbl_end(); } else { echo $layout->txtdesc(txt('dsc_ftp_list_empty')); } echo $layout->end('column'); echo $layout->clr();
$items = array('0' => txt('no'), '1' => txt('yes')); $form->radio('ftp_new_public', txt('ftp_form_public'), txt('ftp_form_public_desc'), $items, $ftp->get_is_public()); } else { $form->input('hidden', 'ftp_new_public', '', '', '0'); } echo $form->render(); echo $layout->end('column'); echo $layout->column('50%'); $form->title(txt('ftp_authentication'), '', ICONS . 'system_info/key_icon.png'); $form->condition('not_null', true, txt('form_empty_field') . 'Host'); $form->input('text', 'ftp_new_host', 'Host/IP', txt('dsc_ftp_host'), $ftp->get_host()); $form->condition('not_null', true, txt('form_empty_field') . 'Login'); $form->input('text', 'ftp_new_login', 'Login', txt('dsc_ftp_login'), $ftp->get_login()); $form->condition('not_null', true, txt('form_empty_field') . txt('password')); $form->input('password', 'ftp_new_pass', txt('password'), txt('dsc_ftp_pass'), $ftp->get_password()); $form->input('text', 'ftp_new_port', 'Port', txt('dsc_ftp_port'), $ftp->get_port()); $form->status(); $delete_action = "\n\t\t\t\$.messager.confirm('" . txt('delete') . "', '" . txt('delete_confirm') . "?', function(r){\n\t\t\tif (r){\n\t\t\t\tphpos.windowRefresh('" . WIN_ID . "', 'section:list,action:delete,delete_id:" . $ftp->get_id() . "');\t\n\t\t\t}\n\t\t\t});\t"; $form->button(txt('delete'), $delete_action, 'cancel'); $form->submit('', txt('btn_update'), 'edit_add'); //$form->button('', 'button', 'edit_add'); echo $form->render(); echo $layout->end('column'); echo $layout->clr(); echo $form->form_end(); } else { echo $layout->access_denied(); } } else { winreload(WIN_ID, array('section' => 'list')); }
} else { echo $layout->txtdesc(txt('dsc_ftp_list_public_user')); } $ftp = new phpos_ftp(); $ftp_ids = $ftp->get_public_ftp(); $c = count($ftp_ids); if ($c != 0) { echo $layout->tbl_start(); $layout->td_classes(array('', '', 'tbl_grey')); echo $layout->head(array('<img src="' . ICONS . 'server/ftp.png" />' => '20%', txt('ftp_account') => '40%', 'Host' => '40%')); for ($i = 0; $i < $c; $i++) { $f = new phpos_ftp(); $f->set_id($ftp_ids[$i]['id']); $f->get_ftp(); //$usr_count = $f->count_users(); $u = new phpos_users(); $u->set_id_user($group_ids[$i]['id_owner']); $u->get_user_by_id(); if (is_root() || $f->is_my($ftp_ids[$i]['id'])) { $item = '<a href="javascript:void(0);" onclick="' . helper_reload(array('section' => 'edit_account', 'ftp_id' => $f->get_id())) . '">' . $f->get_title() . '</a>'; } else { $item = $f->get_title(); } echo $layout->row(array('<img src="' . ICONS . 'server/ftp.png" style="height:20px"/>', $item, $f->get_host()), $f->get_desc()); } echo $layout->tbl_end(); } else { echo $layout->empty_list(); } echo $layout->end('column'); echo $layout->clr();