public function getFilterInput($value) { $from = !empty($value['from']) ? intval($value['from']) : false; $to = !empty($value['to']) ? intval($value['to']) : false; $range = constant('LANG_' . $this->getOption('range') . '10'); return LANG_FROM . ' ' . html_input('text', $this->element_name . '[from]', $from, array('class' => 'input-small')) . ' ' . LANG_TO . ' ' . html_input('text', $this->element_name . '[to]', $to, array('class' => 'input-small')) . ' ' . $range; }
public function getFilterInput($value) { $units = $this->getProperty('units'); if (!$units) { $units = $this->getOption('units'); } if (!$units) { $units = ''; } if ($this->getOption('filter_range')) { $from = !empty($value['from']) ? intval($value['from']) : false; $to = !empty($value['to']) ? intval($value['to']) : false; return LANG_FROM . ' ' . html_input('text', $this->element_name . '[from]', $from, array('class' => 'input-small')) . ' ' . LANG_TO . ' ' . html_input('text', $this->element_name . '[to]', $to, array('class' => 'input-small')) . ($units ? ' ' . $units : ''); } else { return parent::getFilterInput($value); } }
private function view_customer() { $id = $_GET['id']; if ($_POST) { $update = $this->customer->update_blocked_status_customer($id); if ($update) { redirect($this->base_link); } else { parent::alert('error', 'Gagal !', 'Gagal merubah status pelanggan !'); } } $customer = $this->customer->get_customer('', $id); $detail = $this->customer->get_customer('detail', $id); if ($customer['blocked'] == 'N') { $status = $this->radio_config('blocked', 'checked', ''); } else { $status = $this->radio_config('blocked', '', 'checked'); } $customer_data = array(array('label' => '<img src="' . $this->img_dir . 'no_image.jpg" />', 'input' => ''), array('label' => 'Tgl registrasi', 'input' => html_input('text', array('value="' . $customer['reg_date'] . '"', 'class="span3"', 'disabled'))), array('label' => 'Nama lengkap', 'input' => html_input('text', array('value="' . $detail['fullname'] . '"', 'class="span3"', 'disabled'))), array('label' => 'Status', 'input' => $status), array('label' => 'Jenis kelamin', 'input' => html_input('text', array('value="' . $detail['sex'] . '"', 'class="span3"', 'disabled'))), array('label' => 'Alamat', 'input' => html_textarea(array('class="span6"', 'disabled'), $detail['address'])), array('label' => 'Provinsi', 'input' => html_input('text', array('value="' . $detail['state'] . '"', 'class="span3"', 'disabled'))), array('label' => 'Kota', 'input' => html_input('text', array('value="' . $detail['city'] . '"', 'class="span3"', 'disabled'))), array('label' => 'Kode pos', 'input' => html_input('text', array('value="' . $detail['postal_code'] . '"', 'class="span3"', 'disabled'))), array('label' => 'No.Telp', 'input' => html_input('text', array('value="' . $detail['phone_number'] . '"', 'class="span3"', 'disabled'))), array('label' => 'Email', 'input' => html_input('text', array('value="' . $detail['email'] . '"', 'class="span3"', 'disabled')))); $button = array(html_input('submit', array('value="Simpan"', 'class="btn btn-success"')), html_input('button', array('value="Kirim Pesan"', 'onClick="window.location.go(-1)"', 'class="btn btn-success"'))); parent::form_config('', '', $customer_data, 'Data pelanggan', $button); }
function html_sql() { html_input("text", "sqlhost", "localhost", "<br>MYSQL地址", "30"); html_input("text", "sqlport", "3306", "<br>MYSQL端口", "30"); html_input("text", "sqluser", "root", "<br>MYSQL用户", "30"); html_input("password", "sqlpass", "", "<br>MYSQL密码", "30"); html_input("text", "sqldb", "dbname", "<br>MYSQL库名", "30"); html_input("submit", "sqllogin", "登陆", "<br>"); html_n('</form>'); }
} ?> <?php if ($rule['type'] == 'list') { ?> <?php echo html_select("value[{$rule['id']}][{$subject['name']}]", $rule['options'], $default); ?> <?php } ?> <?php if ($rule['type'] == 'number') { ?> <?php echo html_input('text', "value[{$rule['id']}][{$subject['name']}]", $default, array('class' => 'input-number')); ?> <?php } ?> </td> </tr> <?php } ?> </tbody> <?php } ?>
} //'style="display: '.$table_row.';"'; $tpl->assign($action); // file extra //print_r($cfg_type['file_extra']);exit(); if ($cfg_type['file_extra']['name']) { foreach ($cfg_type['file_extra']['name'] as $k => $name) { if ($name) { $rs = array(); $rs['stt'] = $k; $rs['name'] = $name; $rs['code'] = $cfg_type['file_extra']['code'][$k] ? $cfg_type['file_extra']['code'][$k] : $k; $rs['file'] = $file_extra[$rs['code']]; $rs['type'] = $cfg_type['file_extra']['type'][$k]; $rs['note'] = $cfg_type['file_extra']['note'][$k]; $tpl->assign($rs, 'file_extra'); } } } // fields extra if ($cfg_type['fields_extra']['name']) { foreach ($cfg_type['fields_extra']['name'] as $k => $name) { if ($name) { $rs = array(); $rs['stt'] = $k; $rs['name'] = $name; $rs['value'] = html_input($cfg_type['fields_extra']['type'][$k], 'fields_extra[' . $cfg_type['fields_extra']['code'][$k] . ']', $fields_extra[$cfg_type['fields_extra']['code'][$k]]); $tpl->assign($rs, 'fields_extra'); } } }
<?php echo html_input('hidden', $field->element_name, $value, array('id' => $field->id));
<?php if ($field->title) { ?> <label for="<?php echo $field->id; ?> "><?php echo $field->title; ?> </label><?php } echo html_input('text', $field->element_name, $value, array('id' => $field->id, 'size' => 5, 'class' => 'input-number')); if ($field->data['units']) { ?> <span class="input-number-units"><?php html($field->data['units']); ?> </span><?php }
<?php if (!empty($field->hint)) { ?> <div class="hint"><?php echo $field->hint; ?> </div><?php } ?> <?php } else { ?> <?php echo html_input('hidden', $name, $value); ?> <?php } ?> </div> <?php } ?> <?php } ?>
$fields['server'] = $server; $fields['freq'] = 1; $fields['yellowtime'] = 1; $fields['redtime'] = 3; } list($contacttext, $dummy) = get_name($contact); $fields['name'] = $contacttext; title(_("New Ping Probe for") . " " . $contacttext); cms_err_msg(); form_start("form"); html_input("hidden", "id", $id, 8); html_input("hidden", "contact", $contact); html_input("hidden", "contacttext", $contacttext); if ($taskhead > 1) { html_input("hidden", "createtask", 'no'); html_input("hidden", "taskhead", $taskhead); } table(); foreach ($form_fields as $key => $value) { tr(); td(); cms_showfielddesc($form_fields, $key); // the textual name of the field td(); cms_showfield($form_fields, $key, $fields); } add(); endtable(); form_end(); ?>
</div> <div class="field"> <label><?php echo LANG_PASSWORD; ?> :</label> <a href="<?php echo href_to('auth', 'restore'); ?> "><?php echo LANG_FORGOT_PASS; ?> </a> <?php echo html_input('password', 'login_password'); ?> </div> <div class="options"> <input type="checkbox" id="remember" name="remember" value="1" /> <label for="remember"> <?php echo LANG_REMEMBER_ME; ?> </label> </div> <div class="buttons"> <?php echo html_submit(LANG_LOG_IN);
</div> </div> <?php } ?> <?php } ?> </div> <div class="preview_template block" style="display:none"> <div class="thumb"><img src="" /></div> <div class="info"> <div class="title"> <?php echo html_input('text', '', '', array('placeholder' => LANG_PHOTOS_PHOTO_TITLE)); ?> </div> <div class="actions"> <a href="javascript:"><?php echo LANG_DELETE; ?> </a> </div> </div> </div> <div id="album-photos-uploader"></div> <script> <?php
/** * Form data **/ private function form_data($form_title, $product_data, $product_conf) { $tab_data = array(array('tab_active' => 'active', 'tab_link' => 'product-data', 'tab_title' => 'Data Produk', 'tab_data' => $product_data), array('tab_link' => 'product-setting', 'tab_title' => 'Konfigurasi', 'tab_data' => $product_conf)); $button = array(html_input('submit', array('value="Simpan"', 'class="btn btn-success"'))); parent::form_config('yes', $tab_data, '', $form_title, $button); }
</tr> </thead> <tbody> <?php if ($options['is_filter']) { ?> <tr class="filter"> <?php foreach ($columns as $name => $column) { ?> <td> <?php if (isset($column['filter']) && $column['filter'] != 'none' && $column['filter'] != false) { ?> <?php echo html_input('text', 'filter_' . $name, isset($filter[$name]) ? $filter[$name] : '', array('id' => 'filter_' . $name, 'rel' => $name)); ?> <?php } ?> </td> <?php } ?> <?php if ($actions) { ?> <td> </td> <?php
style="display:none"<?php } ?> > <div class="filter-close"> <a href="javascript:toggleFilter();"><span><?php echo LANG_CLOSE; ?> </span></a> </div> <form action="<?php echo cmsCore::getInstance()->uri_absolute; ?> " method="post"> <?php echo html_input('hidden', 'page', 1); ?> <div class="fields"> <?php $fields_count = 0; ?> <?php foreach ($fields as $name => $field) { ?> <?php if (!$field['is_in_filter']) { continue; } ?> <?php $value = isset($filters[$name]) ? $filters[$name] : null;
<span class="ignored_info"><?php echo LANG_PM_CONTACT_IS_PRIVATE; ?> </span> <?php } else { ?> <form action="<?php echo $this->href_to('send'); ?> " method="post"> <?php echo html_input('hidden', "contact_id", $contact['id']); ?> <?php echo html_csrf_token(); ?> <div class="editor"> <?php echo html_editor('content'); ?> </div> <div class="buttons"> <?php echo html_button(LANG_SEND, 'send', 'icms.messages.send()'); ?> </div> </form>
public function getInput($value) { return html_input('text', $this->name, $value); }
public function renderGridRowsJSON($grid, $dataset, $total = 1, $pages_count = 1) { $rows = array(); $row_index = 0; // // проходим по всем строкам из набора данных // if ($total && $dataset) { foreach ($dataset as $row) { $cell_index = 0; // вычисляем содержимое для каждой колонки таблицы foreach ($grid['columns'] as $field => $column) { if (!is_array($row[$field])) { $value = htmlspecialchars($row[$field]); } else { $value = $row[$field]; } if (!$value) { $value = ''; } if (isset($column['flag']) && $column['flag']) { if (isset($column['flag_on'])) { $is_flag_on = $value == $column['flag_on']; } else { $is_flag_on = (bool) $value; } $flag_class = $column['flag'] === true ? 'flag' : $column['flag']; $flag_toggle_url = isset($column['flag_toggle']) ? $column['flag_toggle'] : false; if ($flag_toggle_url) { $flag_toggle_url = string_replace_keys_values($flag_toggle_url, $row); } $flag_content = $flag_toggle_url ? '<a href="' . $flag_toggle_url . '"></a>' : ''; $value = '<div class="flag_trigger ' . ($is_flag_on ? "{$flag_class}_on" : "{$flag_class}_off") . '" data-class="' . $flag_class . '">' . $flag_content . '</div>'; } if (isset($column['handler'])) { $value = $column['handler']($value, $row); } // если из значения нужно сделать ссылку, то парсим шаблон // адреса, заменяя значения полей if (isset($column['href'])) { $column['href'] = string_replace_keys_values($column['href'], $row); $value = '<a href="' . $column['href'] . '">' . $value . '</a>'; } $rows[$row_index][] = $value; $cell_index++; } // если есть колонка действий, то формируем набор ссылок // для текущей строки if ($grid['actions']) { $actions_html = '<div class="actions">'; foreach ($grid['actions'] as $action) { $confirm_attr = ''; if (isset($action['handler'])) { $is_active = $action['handler']($row); } else { $is_active = true; } if ($is_active) { foreach ($row as $cell_id => $cell_value) { if (is_array($cell_value) || is_object($cell_value)) { continue; } // парсим шаблон адреса, заменяя значения полей if (isset($action['href'])) { $action['href'] = str_replace('{' . $cell_id . '}', $cell_value, $action['href']); } // парсим шаблон запроса подтверждения, заменяя значения полей if (isset($action['confirm'])) { $action['confirm'] = str_replace('{' . $cell_id . '}', $cell_value, $action['confirm']); $confirm_attr = 'onclick="if(!confirm(\'' . htmlspecialchars($action['confirm']) . '\')){ return false; }"'; } } $actions_html .= '<a class="' . $action['class'] . '" href="' . $action['href'] . '" title="' . $action['title'] . '" ' . $confirm_attr . '></a>'; } } $actions_html .= '</div>'; $rows[$row_index][] = $actions_html; $cell_index++; } $row_index++; } } $columns = array(); if ($grid['options']['load_columns']) { foreach ($grid['columns'] as $name => $column) { if ($name === 'id' && !$grid['options']['show_id']) { continue; } $columns[] = array('sortable' => $grid['options']['is_sortable'], 'width' => isset($column['width']) ? $column['width'] : '', 'title' => $column['title'], 'name' => $name, 'filter' => isset($column['filter']) && $column['filter'] != 'none' && $column['filter'] != false ? html_input('text', 'filter_' . $name, isset($grid['filter'][$name]) ? $grid['filter'][$name] : '', array('id' => 'filter_' . $name, 'rel' => $name)) : ''); } if ($grid['actions']) { $columns[] = array('sortable' => false, 'width' => sizeof($grid['actions']) * 30, 'title' => LANG_CP_ACTIONS, 'name' => 'dg_actions', 'filter' => ''); } } $result = array('rows' => $rows, 'pages_count' => $pages_count, 'total' => $total, 'columns' => $columns); echo json_encode($result); }
private function form($form_title, $form_data) { $tab_data = array(array('tab_active' => 'active', 'tab_link' => 'main-config', 'tab_title' => 'Website', 'tab_data' => $form_data[0]), array('tab_link' => 'other-config', 'tab_title' => 'Other', 'tab_data' => $form_data[1])); $button = array(html_input('submit', array('value="Simpan"', 'class="btn btn-inverse"'))); parent::form_config('yes', $tab_data, '', $form_title, $button); }
</div> <div class="field"> <label><?php echo LANG_PASSWORD; ?> :</label> <a href="<?php echo href_to('auth', 'restore'); ?> " tabindex="5"><?php echo LANG_FORGOT_PASS; ?> </a> <?php echo html_input('password', 'login_password', '', array('required' => true, 'tabindex' => '2')); ?> </div> <div class="options"> <input type="checkbox" id="remember" name="remember" value="1" tabindex="3" /> <label for="remember"> <?php echo LANG_REMEMBER_ME; ?> </label> </div> <div class="buttons"> <?php echo html_submit(LANG_LOG_IN, 'submit', array('tabindex' => '4'));
?> <div class="author_data"> <div class="name field"> <label><?php echo LANG_COMMENTS_AUTHOR_NAME; ?> :</label> <?php echo html_input('text', 'author_name', $name); ?> </div> <div class="email field"> <label><?php echo LANG_COMMENTS_AUTHOR_EMAIL; ?> :</label> <?php echo html_input('text', 'author_email', $email); ?> </div> </div> <?php } ?> <?php echo $user->is_logged ? html_editor('content') : html_textarea('content'); ?> <div class="buttons"> <?php echo html_button(LANG_PREVIEW, 'preview', 'icms.comments.preview()'); ?> <?php echo html_button(LANG_SEND, 'submit', 'icms.comments.submit()');
echo html_input('hidden', 'action', 'add'); ?> <?php echo html_input('hidden', 'id', 0); ?> <?php echo html_input('hidden', 'parent_id', 0); ?> <?php echo html_input('hidden', 'pc', $controller); ?> <?php echo html_input('hidden', 'pt', $profile_type); ?> <?php echo html_input('hidden', 'pi', $profile_id); ?> <?php echo html_editor('content'); ?> <div class="buttons"> <?php echo html_button(LANG_PREVIEW, 'preview', 'icms.wall.preview()'); ?> <?php echo html_button(LANG_SEND, 'submit', 'icms.wall.submit()'); ?> <?php echo html_button(LANG_CANCEL, 'cancel', 'icms.wall.restoreForm()', array('class' => 'button-cancel')); ?> </div>
} ?> <div id="widget_image_<?php echo $name; ?> " class="widget_image_single"> <div class="data" style="display:none"> <?php if ($is_image_exists) { ?> <?php foreach ($paths as $type => $path) { ?> <?php echo html_input('hidden', "{$name}[{$type}]", $path); ?> <?php } ?> <?php } ?> </div> <div class="preview block" <?php if (!$is_image_exists) { ?> style="display:none"<?php } ?>
?> </div> </h1> <?php if ($this->controller->options['is_status'] && $profile['id'] == $user->id) { ?> <script><?php echo $this->getLangJS('LANG_REPLY', 'LANG_USERS_DELETE_STATUS_CONFIRM'); ?> </script> <div id="user_status_widget"> <?php echo html_input('text', 'status', '', array('maxlength' => 140, 'placeholder' => sprintf(LANG_USERS_WHAT_HAPPENED, $profile['nickname']), 'data-url' => $this->href_to('status'), 'data-user-id' => $profile['id'])); ?> </div> <?php } ?> <?php if (!isset($is_can_view) || $is_can_view) { ?> <?php if (empty($tabs)) { $tabs = $this->controller->getProfileMenu($profile); } ?>
/** * Возвращает скрытое поле, содержащее актуальный CSRF-токен * @return string */ function html_csrf_token() { return html_input('hidden', 'csrf_token', cmsForm::getCSRFToken()); }
$this->setPageTitle($query, $target_title, mb_strtolower(LANG_SEARCH_TITLE)); } ?> <h1><?php echo LANG_SEARCH_TITLE; ?> </h1> <div id="search_form"> <form action="<?php echo href_to('search'); ?> " method="get"> <?php echo html_input('text', 'q', $query, array('placeholder' => LANG_SEARCH_QUERY_INPUT)); ?> <?php echo html_select('type', array('words' => LANG_SEARCH_TYPE_WORDS, 'exact' => LANG_SEARCH_TYPE_EXACT), $type); ?> <?php echo html_select('date', array('all' => LANG_SEARCH_DATES_ALL, 'w' => LANG_SEARCH_DATES_W, 'm' => LANG_SEARCH_DATES_M, 'y' => LANG_SEARCH_DATES_Y), $date); ?> <?php echo html_submit(LANG_FIND); ?> </form> </div> <?php if ($query && empty($search_data)) {
private function form($form_title, $form_data) { $button = array(html_input('submit', array('value="Simpan"', 'class="btn btn-inverse"')), html_input('button', array('value="Kembali"', 'onclick="history.go(-1);"', 'class="btn btn-inverse"'))); parent::form_config('', '', $form_data, $form_title, $button); }
?> <div id="group_staff_add" class="gui-panel"> <h3><?php echo LANG_GROUPS_ADD_STAFF; ?> </h3> <div class="hint"><?php echo LANG_GROUPS_ADD_STAFF_HINT; ?> </div> <div class="field"> <?php echo html_input('text', 'username', '', array('id' => 'staff-username', 'autocomplete' => 'off')); ?> <?php echo html_button(LANG_ADD, 'add', 'icms.groups.addStaff()', array('id' => 'staff-submit', 'disabled' => 'disabled')); ?> <div class="loading-icon" style="display:none"></div> </div> </div> <script> <?php $list = array(); if (is_array($members)) { foreach ($members as $member) {
?> </span> <?php } else { ?> <form action="<?php echo $this->href_to('send'); ?> " method="post"> <?php echo html_input('hidden', 'last_date', '', array('id' => 'msg_last_date')); ?> <?php echo html_input('hidden', 'contact_id', $contact['id']); ?> <?php echo html_csrf_token(); ?> <div class="editor"> <?php echo html_editor('content'); ?> </div> <div class="buttons"> <span id="error_wrap"></span> <span class="ctrenter_hint">ctrl+enter</span> <?php echo html_button(LANG_SEND, 'send', 'icms.messages.send()'); ?>
<?php if ($field->title) { ?> <label for="<?php echo $field->id; ?> "><?php echo $field->title; ?> </label><?php } echo html_input('text', $field->element_name, $value, array('id' => $field->id, 'size' => 5, 'class' => 'input-number', 'required' => array_search(array('required'), $field->getRules()) !== false)); if ($field->data['units']) { ?> <span class="input-number-units"><?php html($field->data['units']); ?> </span><?php }