function web_PhpConsoleTemplateEditForm($templatekey) { $rawtemplate = zb_PhpConsoleGetTemplate($templatekey); $templatename = $rawtemplate['name']; $templatebody = $rawtemplate['body']; $inputs = wf_TextInput('edittemplatename', __('Template name'), $templatename, true, "30"); $inputs .= wf_TextArea('edittemplatebody', '', $templatebody, true, '80x10'); $inputs .= wf_Submit('Edit'); $result = wf_Form("", 'POST', $inputs, 'glamour'); $result .= wf_Link("?module=sqlconsole&devconsole=true", 'Back', true, 'ubButton'); return $result; }
function ms_ShowForm() { $inputs = __('Message') . '<br>'; $inputs .= wf_TextArea('message', '', '', true, '60x6'); $inputs .= wf_TextInput('exactuserlogins', 'Exact users, comma delimiter', '', true, '30'); $inputs .= wf_RadioInput('sendtype', 'Exact users', 'exactusers', true, true); $inputs .= wf_RadioInput('sendtype', 'Debtors', 'debtors', true); $inputs .= wf_RadioInput('sendtype', 'All users', 'allusers', true); $inputs .= wf_Submit('Send'); $form = wf_Form('', 'POST', $inputs, 'glamour'); show_window(__('Masssender'), $form); }
/** * Returns FDB cache lister MAC filters setup form * * @return string */ function web_FDBTableFiltersForm() { $currentFilters = ''; $oldFilters = zb_StorageGet('FDBCACHEMACFILTERS'); if (!empty($oldFilters)) { $currentFilters = base64_decode($oldFilters); } $inputs = __('One MAC address per line') . wf_tag('br'); $inputs .= wf_TextArea('newmacfilters', '', $currentFilters, true, '40x10'); $inputs .= wf_HiddenInput('setmacfilters', 'true'); $inputs .= wf_CheckInput('deletemacfilters', __('Cleanup'), true, false); $inputs .= wf_Submit(__('Save')); $result = wf_Form('', 'POST', $inputs, 'glamour'); return $result; }
function web_NasTemplateEditForm($id) { $id = vf($id, 3); $allradiusnas_q = "SELECT * from `nas` WHERE `nastype`='radius'"; $allradiusnas = simple_queryall($allradiusnas_q); $template_q = "SELECT * from `nastemplates` WHERE `id`='" . $id . "'"; $template_data = simple_query($template_q); $nasselector = array(); if (!empty($allradiusnas)) { foreach ($allradiusnas as $io => $eachnas) { $nasselector[$eachnas['id']] = $eachnas['id'] . ':' . $eachnas['nasname']; } $addinputs = wf_Selector('editnasid', $nasselector, 'Network Access Servers', $template_data['nasid'], true); $addinputs .= wf_HiddenInput('edittemplateid', $template_data['id']); $addinputs .= wf_TextArea('editnastemplate', '', $template_data['template'], true, '60x10'); $addinputs .= wf_Submit('Change'); $addform = wf_Form('', 'POST', $addinputs, 'glamour'); show_window(__('Edit template'), $addform); } }
/** * renders editing form * * @return string */ public function renderForm() { $inputs = ''; $cityDispFlag = $this->checkConf('CITY_DISPLAY'); $citySelFlag = $this->checkConf('CITY_SELECTABLE'); $streetSelFlag = $this->checkConf('STREET_SELECTABLE'); $emailDispFlag = $this->checkConf('EMAIL_DISPLAY'); $spamDispFlag = $this->checkConf('SPAM_TRAPS'); $cachingFlag = $this->checkConf('CACHING'); $inputs .= wf_CheckInput('newcitydisplay', __('Display city input'), true, $cityDispFlag); $inputs .= wf_CheckInput('newcityselectable', __('Show city input as combobox'), true, $citySelFlag); $inputs .= wf_CheckInput('newstreetselectable', __('Show street input as combobox'), true, $streetSelFlag); $inputs .= wf_CheckInput('newemaildisplay', __('Display email field'), true, $emailDispFlag); $inputs .= wf_CheckInput('newespamtraps', __('Render spambots protection traps'), true, $spamDispFlag); $inputs .= wf_CheckInput('newcaching', __('Database connections caching'), true, $cachingFlag); $inputs .= wf_TextInput('newispname', __('Your ISP Name'), @$this->configRaw['ISP_NAME'], true, 25); $inputs .= wf_TextInput('newispurl', __('Your ISP site URL'), @$this->configRaw['ISP_URL'], true, 25); $inputs .= wf_TextInput('newisplogo', __('Your ISP logo URL'), @$this->configRaw['ISP_LOGO'], true, 25); $inputs .= wf_tag('label') . __('Sidebar text - contacts, phones etc.') . ' (HTML)' . wf_tag('label', true) . wf_tag('br'); $inputs .= wf_TextArea('newsidebartext', '', @$this->configRaw['SIDEBAR_TEXT'], true, '50x10'); $inputs .= wf_tag('label') . __('Greeting text') . ' (HTML)' . wf_tag('label', true) . wf_tag('br'); $inputs .= wf_TextArea('newgreetingtext', '', @$this->configRaw['GREETING_TEXT'], true, '50x5'); $inputs .= wf_TextInput('newservices', __('Services offered') . ' ' . __('(separator - comma)'), @$this->configRaw['SERVICES'], true, 25); $inputs .= wf_TextInput('newtariffs', __('Tariffs offered') . ' ' . __('(separator - comma)'), @$this->configRaw['TARIFFS'], true, 25); $inputs .= wf_TextInput('newhideouts', __('City and streets hide lists') . ' ' . __('(separator - comma)'), @$this->configRaw['HIDEOUTS'], true, 25); $inputs .= wf_HiddenInput('changesettings', 'true'); $inputs .= wf_delimiter(); $inputs .= wf_Submit(__('Save')); $result = wf_Form('', 'POST', $inputs, 'glamour'); $result .= wf_Link('?module=sigreq', __('Back'), true, 'ubButton'); return $result; }
function web_TsmsTemplateEditForm() { $maxsize = '140'; $current_template = tsms_GetTemplate(); $cursize = strlen($current_template); $symbolsRest = $maxsize - $cursize; $inputs = wf_TextArea('newsmstemplate', '', $current_template, true, '25x5'); $inputs .= wf_delimiter(); $inputs .= __('Symbols rest') . ': ' . $symbolsRest . wf_delimiter(); $inputs .= wf_Submit(__('Save')); $result = wf_Form("", 'POST', $inputs, 'glamour'); return $result; }
/** * Return conversation form for some thread * * @param string $to - thread username * * @return string */ function im_ConversationForm($to) { $inputs = wf_HiddenInput('im_message_to', $to); $inputs .= wf_TextArea('im_message_text', '', '', true, '60x4'); $inputs .= wf_Submit('Send message'); $result = wf_Form("", 'POST', $inputs, 'glamour'); return $result; }
/** * Returns reply edit form * * @param int $replyid * * @return string */ function web_TicketReplyEditForm($replyid) { $replyid = vf($replyid, 3); $ticketdata = zb_TicketGetData($replyid); $replytext = $ticketdata['text']; $inputs = wf_HiddenInput('editreply', $replyid); $inputs .= wf_TextArea('editreplytext', '', $replytext, true, '60x10'); $inputs .= wf_Submit('Save'); $form = wf_Form('', 'POST', $inputs, 'glamour'); return $form; }
$billing->setpassive($login, $user['passive']); $billing->settariff($login, $user['tariff']); $billing->setcredit($login, $user['credit']); $billing->setcash($login, $user['cash']); zb_UserCreateNotes($login, $user['address']); } if ($iopts['regtype'] == 'SQL') { $querybuff .= "\n INSERT INTO `users` (\n `login`,\n `Password`,\n `Passive`,\n `Down`,\n `DisabledDetailStat`,\n `AlwaysOnline`,\n `Tariff`,\n `Address`,\n `Phone`,\n `Email`,\n `Note`,\n `RealName`,\n `StgGroup`,\n `Credit`,\n `TariffChange`,\n `Userdata0`,\n `Userdata1`,\n `Userdata2`,\n `Userdata3`,\n `Userdata4`,\n `Userdata5`,\n `Userdata6`,\n `Userdata7`,\n `Userdata8`,\n `Userdata9`,\n `CreditExpire`,\n `IP`,\n `D0`,\n `U0`,\n `D1`,\n `U1`,\n `D2`,\n `U2`,\n `D3`,\n `U3`,\n `D4`,\n `U4`,\n `D5`,\n `U5`, \n `D6`, \n `U6`,\n `D7`, \n `U7`, \n `D8`,\n `U8`,\n `D9`,\n `U9`,\n `Cash`,\n `FreeMb`,\n `LastCashAdd`,\n `LastCashAddTime`,\n `PassiveTime`,\n `LastActivityTime`,\n `NAS`)\n VALUES (\n '" . $login . "',\n '" . $password . "',\n '" . $user['passive'] . "',\n '" . $user['down'] . "',\n '1',\n '" . $user['ao'] . "',\n '" . $user['tariff'] . "',\n '',\n '',\n '',\n '',\n '',\n '',\n '" . $user['credit'] . "',\n '', \n '',\n '',\n '',\n '', \n '', \n '', \n '', \n '',\n '', \n '', \n '" . $user['creditex'] . "',\n '" . $ip . "',\n '0',\n '0',\n '0',\n '0',\n '0', \n '0',\n '0',\n '0', \n '0',\n '0',\n '0',\n '0',\n '0', \n '0',\n '0',\n '0', \n '0', \n '0', \n '0', \n '0', \n '" . $user['cash'] . "',\n '0',\n '0', \n '0',\n '0', \n '0',\n '');\n " . "\n"; //multinet $querybuff .= "INSERT INTO `nethosts` (`id`,`netid`,`ip`,`mac`,`option`) VALUES ('', '" . $netid . "' ,'" . $ip . "', '" . $user['mac'] . "', '');" . "\n"; //realname $querybuff .= "INSERT INTO `realname` (`id`,`login`,`realname`) VALUES (NULL, '" . $login . "','" . $user['realname'] . "');" . "\n"; //phone & mobile $querybuff .= "INSERT INTO `phones` (`id`,`login`,`phone`,`mobile`) VALUES (NULL, '" . $login . "','" . $user['phone'] . "','" . $user['mobile'] . "');" . "\n"; //contract $querybuff .= "INSERT INTO `contracts` (`id`,`login`,`contract`) VALUES (NULL, '" . $login . "','" . $user['contract'] . "');" . "\n"; //email $querybuff .= "INSERT INTO `emails` (`id`,`login`,`email`) VALUES (NULL, '" . $login . "','" . $user['email'] . "');" . "\n"; //speedoverride $querybuff .= "INSERT INTO `userspeeds` (`id`,`login`,`speed`) VALUES (NULL, '" . $login . "','0');" . "\n"; //notes $querybuff .= "INSERT INTO `notes` (`id`,`login`,`note`) VALUES ('', '" . $login . "','" . $user['address'] . "');" . "\n"; } } show_window(__('Generated SQL dump'), wf_TextArea('sqldump', '', $querybuff, true, '120x20')); } } } } else { show_error(__('Access denied')); }
/** * returns capability editing form by existing cap id * * @return string */ public function editForm($id) { $id = vf($id, 3); $sup = wf_tag('sup') . '*' . wf_tag('sup', true); $curpage = wf_CheckGet(array('page')) ? vf($_GET['page'], 3) : 1; $result = wf_Link('?module=capabilities&page=' . $curpage, __('Back'), true, 'ubButton'); $stateSelector = array(); $employeeSelector = array(); $employeeSelector['NULL'] = '-'; if (isset($this->availids[$id])) { //states preprocessing if (!empty($this->capabstates)) { foreach ($this->capabstates as $io => $eachcap) { $stateSelector[$eachcap['id']] = $eachcap['state']; } } //employee preprocessing if (!empty($this->employees)) { foreach ($this->employees as $ia => $eachemp) { if ($eachemp['active']) { $employeeSelector[$eachemp['id']] = $eachemp['name']; } } } $inputs = wf_TextInput('editaddress', __('Full address') . $sup, $this->allcapab[$id]['address'], true); $inputs .= wf_TextInput('editphone', __('Phone') . $sup, $this->allcapab[$id]['phone'], true); $inputs .= __('Notes') . wf_tag('br'); $inputs .= wf_TextArea('editnotes', '', $this->allcapab[$id]['notes'], true, '40x5'); $inputs .= wf_TextInput('editprice', __('Price'), $this->allcapab[$id]['price'], true); $inputs .= wf_Selector('editstateid', $stateSelector, __('Status'), $this->allcapab[$id]['stateid'], true); $inputs .= wf_Selector('editemployeeid', $employeeSelector, __('Worker'), $this->allcapab[$id]['employeeid'], true); $inputs .= wf_delimiter(); $inputs .= wf_Submit(__('Save')); $result .= wf_Form("", 'POST', $inputs, 'glamour'); } else { throw new Exception(self::NO_ID); } return $result; }
/** * Shows task editing/management form * * @global object $ubillingConfig * @param int $taskid * * @return void */ function ts_TaskChangeForm($taskid) { global $ubillingConfig; $altercfg = $ubillingConfig->getAlter(); $taskid = vf($taskid, 3); $taskdata = ts_GetTaskData($taskid); $result = ''; $allemployee = ts_GetAllEmployee(); $activeemployee = ts_GetActiveEmployee(); $alljobtypes = ts_GetAllJobtypes(); $messages = new UbillingMessageHelper(); $smsData = ''; if (!empty($taskdata)) { //not done task if (empty($taskdata['login'])) { $login_detected = ts_DetectUserByAddress($taskdata['address']); if ($login_detected) { $addresslink = wf_Link("?module=userprofile&username="******"?module=userprofile&username="******"H:i", strtotime($taskdata['starttime'])) : ''; $smsJobNote = mysql_real_escape_string($taskdata['jobnote']); $smsEmployee = vf($taskdata['employee']); $newSmsText = $smsAddress . ' ' . $smsPhone . ' ' . $smsJobNote . $smsJobTime; $smsDataCells = wf_TableCell(__('Employee'), '', 'row2'); $smsDataCells .= wf_TableCell(@$allemployee[$taskdata['employee']]); $smsDataRows = wf_TableRow($smsDataCells, 'row3'); $smsDataCells = wf_TableCell(__('Message'), '', 'row2'); $smsDataCells .= wf_TableCell(zb_TranslitString($newSmsText)); $smsDataRows .= wf_TableRow($smsDataCells, 'row3'); $smsDataTable = wf_TableBody($smsDataRows, '100%', '0', 'glamour'); $smsInputs = $smsDataTable; $smsInputs .= wf_HiddenInput('postsendemployee', $smsEmployee); $smsInputs .= wf_HiddenInput('postsendsmstext', $newSmsText); $smsInputs .= wf_Submit(__('Send SMS')); $smsForm = wf_Form('', 'POST', $smsInputs, ''); $smsData = wf_modal(wf_img_sized('skins/icon_mobile.gif', __('Send SMS'), '10'), __('Send SMS'), $smsForm, '', '400', '200'); } } $tablecells = wf_TableCell(__('ID'), '30%'); $tablecells .= wf_TableCell($taskdata['id']); $tablerows = wf_TableRow($tablecells, 'row3'); $tablecells = wf_TableCell(__('Task creation date') . ' / ' . __('Administrator')); $tablecells .= wf_TableCell($taskdata['date'] . ' / ' . $taskdata['admin']); $tablerows .= wf_TableRow($tablecells, 'row3'); $tablecells = wf_TableCell(__('Target date')); $tablecells .= wf_TableCell(wf_tag('strong') . $taskdata['startdate'] . ' ' . $taskdata['starttime'] . wf_tag('strong', true)); $tablerows .= wf_TableRow($tablecells, 'row3'); $tablecells = wf_TableCell(__('Task address')); $tablecells .= wf_TableCell($addresslink); $tablerows .= wf_TableRow($tablecells, 'row3'); $tablecells = wf_TableCell(__('Login')); $tablecells .= wf_TableCell($taskLogin . $loginType); $tablerows .= wf_TableRow($tablecells, 'row3'); $tablecells = wf_TableCell(__('Phone')); $tablecells .= wf_TableCell($taskdata['phone']); $tablerows .= wf_TableRow($tablecells, 'row3'); $tablecells = wf_TableCell(__('Job type')); $tablecells .= wf_TableCell(@$alljobtypes[$taskdata['jobtype']]); $tablerows .= wf_TableRow($tablecells, 'row3'); $tablecells = wf_TableCell(__('Who should do')); $tablecells .= wf_TableCell(@$allemployee[$taskdata['employee']] . ' ' . $smsData); $tablerows .= wf_TableRow($tablecells, 'row3'); $tablecells = wf_TableCell(__('Job note')); $tablecells .= wf_TableCell(nl2br($taskdata['jobnote'])); $tablerows .= wf_TableRow($tablecells, 'row3'); $result .= wf_TableBody($tablerows, '100%', '0', 'glamour'); $result .= wf_tag('div', false, '', 'style="clear:both;"') . wf_tag('div', true); // show task preview show_window(__('View task') . ' ' . $modform, $result); //Salary accounting if ($altercfg['SALARY_ENABLED']) { if (cfr('SALARYTASKSVIEW')) { $salary = new Salary(); show_window(__('Additional jobs done'), $salary->taskJobCreateForm($_GET['edittask'])); } } //warehouse integration if ($altercfg['WAREHOUSE_ENABLED']) { if (cfr('WAREHOUSE')) { $warehouse = new Warehouse(); show_window(__('Additionally spent materials'), $warehouse->taskMaterialsReport($_GET['edittask'])); } } //if task undone if ($taskdata['status'] == 0) { $sup = wf_tag('sup') . '*' . wf_tag('sup', false); $inputs = wf_HiddenInput('changetask', $taskid); $inputs .= wf_DatePicker('editenddate') . wf_tag('label', false) . __('Finish date') . $sup . wf_tag('label', true) . wf_tag('br'); $inputs .= wf_tag('br'); $inputs .= wf_Selector('editemployeedone', $activeemployee, __('Worker done'), $taskdata['employee'], true); $inputs .= wf_tag('br'); $inputs .= wf_tag('label', false) . __('Finish note') . wf_tag('label', true) . wf_tag('br'); $inputs .= wf_TextArea('editdonenote', '', '', true, '35x3'); $inputs .= wf_tag('br'); $inputs .= $jobgencheckbox; $inputs .= wf_Submit(__('This task is done')); $form = wf_Form("", 'POST', $inputs, 'glamour'); if (cfr('TASKMANDELETE')) { show_window('', wf_JSAlertStyled('?module=taskman&deletetask=' . $taskid, web_delete_icon() . ' ' . __('Remove this task - it is an mistake'), $messages->getDeleteAlert(), 'ubButton')); } //show editing form if (cfr('TASKMANDONE')) { show_window(__('If task is done'), $form); } } else { $donecells = wf_TableCell(__('Finish date'), '30%'); $donecells .= wf_TableCell($taskdata['enddate']); $donerows = wf_TableRow($donecells, 'row3'); $donecells = wf_TableCell(__('Worker done')); $donecells .= wf_TableCell($allemployee[$taskdata['employeedone']]); $donerows .= wf_TableRow($donecells, 'row3'); $donecells = wf_TableCell(__('Finish note')); $donecells .= wf_TableCell($taskdata['donenote']); $donerows .= wf_TableRow($donecells, 'row3'); $doneresult = wf_TableBody($donerows, '100%', '0', 'glamour'); if (cfr('TASKMANDELETE')) { $doneresult .= wf_JSAlertStyled('?module=taskman&deletetask=' . $taskid, web_delete_icon() . ' ' . __('Remove this task - it is an mistake'), $messages->getDeleteAlert(), 'ubButton'); } if (cfr('TASKMANDONE')) { $doneresult .= ' '; $doneresult .= wf_JSAlertStyled('?module=taskman&setundone=' . $taskid, wf_img('skins/icon_key.gif') . ' ' . __('No work was done'), $messages->getEditAlert(), 'ubButton'); } show_window(__('Task is done'), $doneresult); } } }
/** * Returns comment edit form * * @param int $commentid existing database comment ID * @return string */ protected function commentEditForm($commentid) { $result = ''; if (isset($this->data[$commentid])) { $inputs = wf_HiddenInput('adcommentsmodifyid', $commentid); $inputs .= wf_TextArea('adcommentsmodifytext', '', $this->data[$commentid]['text'], true, '60x10'); $inputs .= wf_Submit(__('Save')); $result = wf_Form('', 'POST', $inputs, 'glamour'); } return $result; }
/** * Returns modal window with telegram message creation form * * @return string */ public function telegramCreateForm() { $result = ''; $inputs = wf_TextInput('newtelegramchatid', __('Chat ID'), '', true, '20'); $inputs .= wf_TextArea('newtelegrammessage', '', '', true, '50x10'); $inputs .= wf_Submit(__('Create')); $form = wf_Form('', 'POST', $inputs, 'glamour'); $result = wf_modalAuto(wf_img('skins/add_icon.png', __('Create new Telegram message')), __('Create new Telegram message'), $form, ''); return $result; }
/** * Returns edit form * * @return string */ protected function editForm($noteId) { $noteData = $this->getNoteData($noteId); if (!empty($noteData)) { $inputs = wf_HiddenInput('editnoteid', $noteId); $inputs .= wf_tag('label') . __('Text') . ': ' . wf_tag('br') . wf_tag('label', true); $inputs .= wf_TextArea('edittext', '', $noteData['text'], true, '50x15'); $checkState = $noteData['active'] == 1 ? true : false; $inputs .= wf_CheckInput('editactive', __('Personal note active'), true, $checkState); $inputs .= wf_DatePickerPreset('editreminddate', $noteData['reminddate']); $inputs .= wf_tag('label') . __('Remind only after this date') . wf_tag('label', true); $inputs .= wf_tag('br'); $inputs .= wf_tag('br'); $inputs .= wf_Submit(__('Save')); $result = wf_Form('', 'POST', $inputs, 'glamour'); } else { $result = __('Strange exeption'); } return $result; }
/** * Shows HTML document template editing form * * @return void */ function zb_DocsTemplateEditForm($template) { $templatebody = zb_DocsLoadTemplate($template); $templatetitle = zb_DocsLoadTemplateTitle($template); $inputs = wf_TextInput('edittemplatetitle', __('Edit template title'), $templatetitle, true, '50'); $inputs .= wf_TextArea('edittemplatebody', '', $templatebody, true, '80x20'); $inputs .= wf_Submit('Save'); $addform = wf_Form('', 'POST', $inputs, 'glamour'); show_window(__('Edit document template'), $addform); }
function zb_CardsMassactions() { if (isset($_POST['_cards'])) { $cards_arr = $_POST['_cards']; if (!empty($cards_arr)) { //cards export if ($_POST['cardactions'] == 'caexport') { $exportdata = ''; foreach ($cards_arr as $cardid => $on) { $exportdata .= zb_CardsExport($cardid) . "\n"; } $exportresult = wf_TextArea($exportdata, '', $exportdata, true, '80x20'); show_window(__('Export'), $exportresult); } // cards activate if ($_POST['cardactions'] == 'caactive') { foreach ($cards_arr as $cardid => $on) { zb_CardsMarkActive($cardid); } } // cards deactivate if ($_POST['cardactions'] == 'cainactive') { foreach ($cards_arr as $cardid => $on) { zb_CardsMarkInactive($cardid); } } // cards delete if ($_POST['cardactions'] == 'cadelete') { foreach ($cards_arr as $cardid => $on) { zb_CardsDelete($cardid); } } } else { show_error(__('No cards selected')); } } else { show_error(__('No cards selected')); } }
/** * Renders network template editing form * * @param int $dhcpid * * @return string */ public function editForm($dhcpid) { $dhcpid = vf($dhcpid, 3); $result = ''; if (isset($this->allDhcpNets[$dhcpid])) { $dhcpnetdata = $this->getNetworkData($dhcpid); $inputs = wf_TextInput('editdhcpconfname', __('DHCP config name'), $dhcpnetdata['confname'], true, 20); $inputs .= __('DHCP custom subnet template') . wf_tag('br'); $inputs .= wf_TextArea('editdhcpconfig', '', $dhcpnetdata['dhcpconfig'], true, '60x10'); $inputs .= wf_Submit(__('Save')); $result = wf_Form('', 'POST', $inputs, 'glamour'); $result .= wf_CleanDiv(); $result .= wf_Link(self::URL_ME, __('Back'), false, 'ubButton'); } else { $result = $this->messages->getStyledMessage(__('Something went wrong'), 'errors'); } return $result; }
/** * Returns editing controller for CF assigned to user * * @param string $login Existing Ubilling user login * @param string $type Type of CF to return control * @param int $typeid Type ID for change * * @return string */ function cf_TypeGetController($login, $type, $typeid) { $type = vf($type); $typeid = vf($typeid); $login = mysql_real_escape_string($login); $result = ''; if ($type == 'VARCHAR') { $inputs = wf_HiddenInput('modtype', $typeid); $inputs .= wf_HiddenInput('login', $login); $inputs .= wf_TextInput('content', '', '', false, 20); $inputs .= wf_Submit(__('Save')); $result = wf_Form("", 'POST', $inputs, ''); } if ($type == 'TRIGGER') { $triggerOpts = array(1 => __('Yes'), 0 => __('No')); $inputs = wf_HiddenInput('modtype', $typeid); $inputs .= wf_HiddenInput('login', $login); $inputs .= wf_Selector('content', $triggerOpts, '', '', false); $inputs .= wf_Submit(__('Save')); $result = wf_Form("", 'POST', $inputs, ''); } if ($type == 'TEXT') { $inputs = wf_HiddenInput('modtype', $typeid); $inputs .= wf_HiddenInput('login', $login); $inputs .= wf_TextArea('content', '', '', true, '25x5'); $inputs .= wf_Submit(__('Save')); $result = wf_Form("", 'POST', $inputs, ''); } return $result; }
function zb_LicenseLister() { $avarice = new Avarice(); $all = $avarice->getLicenseKeys(); $cells = wf_TableCell(__('Module')); $cells .= wf_TableCell(__('Actions')); $rows = wf_TableRow($cells, 'row1'); if (!empty($all)) { foreach ($all as $io => $each) { //construct edit form $editinputs = wf_HiddenInput('editdbkey', $each['KEY']); $editinputs .= wf_TextArea('editlicense', '', $each['LICENSE'], true, '50x10'); $editinputs .= wf_Submit(__('Save')); $editform = wf_Form("", 'POST', $editinputs, 'glamour'); $editcontrol = wf_modal(web_edit_icon(), __('Edit'), $editform, '', '500', '300'); //construct deletion controls $deletecontrol = wf_JSAlert('?module=licensekeys&licensedelete=' . $each['KEY'], web_delete_icon(), __('Removing this may lead to irreparable results')); $cells = wf_TableCell($each['MODULE']); $cells .= wf_TableCell($deletecontrol . ' ' . $editcontrol); $rows .= wf_TableRow($cells, 'row3'); } } //constructing license creation form $addinputs = wf_TextArea('createlicense', '', '', true, '50x10'); $addinputs .= wf_Submit(__('Add')); $addform = wf_Form("", 'POST', $addinputs, 'glamour'); $addcontrol = wf_modal(wf_img('skins/icon_add.gif', __('Add')) . ' ' . __('Add'), __('Add'), $addform, 'ubButton', '500', '300'); $result = wf_TableBody($rows, '100%', 0, ''); $result .= $addcontrol; show_window(__('Installed license keys'), $result); }
/** * returns some build passport edit form * * @praram $buildid existing build id * * @return string */ public function renderEditForm($buildid) { $buildid = vf($buildid, 3); if (isset($this->data[$buildid])) { $currentData = $this->data[$buildid]; } else { $currentData = array(); } $inputs = wf_HiddenInput('savebuildpassport', $buildid); $inputs .= wf_Selector('powner', $this->ownersArr, __('Owner'), @$currentData['owner'], true); $inputs .= wf_TextInput('pownername', __('Owner name'), @$currentData['ownername'], true, 30); $inputs .= wf_TextInput('pownerphone', __('Owner phone'), @$currentData['ownerphone'], true, 30); $inputs .= wf_TextInput('pownercontact', __('Owner contact person'), @$currentData['ownercontact'], true, 30); $keys = @$currentData['keys'] == 1 ? true : false; $inputs .= wf_CheckInput('pkeys', __('Keys available'), true, $keys); $inputs .= wf_TextInput('paccessnotices', __('Build access notices'), @$currentData['accessnotices'], true, 40); $inputs .= wf_Selector('pfloors', $this->floorsArr, __('Floors'), @$currentData['floors'], false); $inputs .= wf_Selector('pentrances', $this->entrancesArr, __('Entrances'), @$currentData['entrances'], false); $inputs .= wf_TextInput('papts', __('Apartments'), @$currentData['apts'], true, 5); $inputs .= __('Notes') . wf_tag('br'); $inputs .= wf_TextArea('pnotes', '', @$currentData['notes'], true, '50x6'); $inputs .= wf_Submit(__('Save')); $result = wf_Form('', 'POST', $inputs, 'glamour'); return $result; }
public function editForm($id) { $id = vf($id, 3); $states = array("1" => __('Yes'), "0" => __('No')); $types = array("text" => __('Text'), "html" => __('HTML')); $result = wf_Link('?module=zbsannouncements', __('Back'), false, 'ubButton'); $result .= wf_modal(__('Preview'), __('Preview'), $this->preview($id), 'ubButton', '600', '400'); $result .= wf_tag('br'); if (isset($this->data[$id])) { $inputs = wf_TextInput('edittitle', __('Title'), $this->data[$id]['title'], true, 40); $sup = wf_tag('sup') . '*' . wf_tag('sup', true); $inputs .= __('Text') . $sup . wf_tag('br'); $inputs .= wf_TextArea('edittext', '', $this->data[$id]['text'], true, '60x10'); $inputs .= wf_Selector('editpublic', $states, __('Public'), $this->data[$id]['public'], false); $inputs .= wf_Selector('edittype', $types, __('Type'), $this->data[$id]['type'], false); $inputs .= wf_delimiter(); $inputs .= wf_Submit(__('Save')); $result .= wf_Form("", 'POST', $inputs, 'glamour'); return $result; } else { throw new Exception(self::EX_ID_NO_EXIST); } }