function core_textarea($item, $editor = null, $info_item = null) { switch ($item) { default: $content = Config::instance()->core[$item]; break; case 'closed_text': case 'footer_text': case 'mail_signature': case 'rules': $content = get_core_ml_text($item); } return [h::info($info_item ?: $item), h::textarea($content, ['name' => "core[{$item}]", 'class' => $editor ? " {$editor}" : ''])]; }
/** * This centralizes all input type textarea to-HTML necessities. * * @param array $params This array expects three parameters: * . name - the form element's name * . label (optional) - human readable description * . value (optional) - the value * . help (optional) - the help block to append to the text input * . size (optional) - the Bootstrap CSS size of the textarea (e.g., xxlarge) * . rows (optional) - number of rows */ public function getHtmlInputTextarea(array $params = array()) { if (empty($params['label'])) { $params['label'] = ucfirst($params['name']); } h::div(array('class' => 'clearfix'), function () use($params) { h::label(array('for' => $params['name']), $params['label']); h::div(array('class' => 'input'), function () use($params) { if (empty($params['size'])) { $params['size'] = 'large'; } $rows = '3'; if (!empty($params['rows'])) { $rows = $params['rows']; } h::textarea(array('class' => $params['size'], 'name' => $params['name'], 'value' => $params['value'], 'rows' => $rows)); if (!empty($params['help'])) { h::span(array('class' => 'help-block'), $params['help']); } }); }); }
<?php /** * @package CleverStyle CMS * @subpackage System module * @category modules * @author Nazar Mokrynskyi <*****@*****.**> * @copyright Copyright (c) 2011-2014, Nazar Mokrynskyi * @license MIT License, see license.txt */ namespace cs\modules\System; use h, cs\Config, cs\Index, cs\Language; $Config = Config::instance(); $L = Language::instance(); $sa = $Config->core['simple_admin_mode']; Index::instance()->content(h::{'table.cs-table-borderless.cs-left-even.cs-right-odd tr| td'}(core_input('site_mode', 'radio'), core_input('closed_title'), core_textarea('closed_text', 'SIMPLE_EDITOR'), core_input('title_delimiter'), core_input('title_reverse', 'radio'), core_textarea('footer_text', 'SIMPLE_EDITOR'), core_input('show_footer_info', 'radio'), core_input('show_tooltips', 'radio', false), core_input('og_support', 'radio'), core_input('simple_admin_mode', 'radio'), !$sa ? [$L->debug, [h::{'table tr| td'}(core_input('show_db_queries', 'radio'), core_input('show_cookies', 'radio')), ['class' => 'cs-padding-left']]] : false, !$sa ? [h::info('routing'), h::{'table.cs-table-borderless tr| td'}([h::info('routing_in'), h::info('routing_out')], [h::textarea($Config->routing['in'], ['name' => 'routing[in]']), h::textarea($Config->routing['out'], ['name' => 'routing[out]'])])] : false, !$sa ? [h::info('replace'), h::{'table.cs-table-borderless tr| td'}([h::info('replace_in'), h::info('replace_out')], [h::textarea($Config->replace['in'], ['name' => 'replace[in]']), h::textarea($Config->replace['out'], ['name' => 'replace[out]'])])] : false));
$a->apply_button = false; $a->cancel_button_back = true; $Page->title($L->adding_a_bot); $a->content(h::{'p.lead.cs-center'}($L->adding_a_bot) . h::{'table.cs-table-borderless.cs-left-even.cs-right-odd tr| td'}([[$L->bot_name, h::{'input[name=name]'}()], [h::info('bot_user_agent'), h::{'input[name=user_agent]'}()], [h::info('bot_ip'), h::{'input[name=ip]'}()]])); break; case 'edit_raw': if ($is_bot || $rc[3] == User::GUEST_ID || $rc[3] == User::ROOT_ID) { break; } $a->apply_button = false; $a->cancel_button_back = true; $content = $content_ = ''; $user_data = $User->get($search_columns, $rc[3]); $last = count($search_columns) - 1; foreach ($search_columns as $i => $column) { $content_ .= h::th($column) . h::td($column == 'data' ? h::textarea($user_data[$column], ['name' => "user[{$column}]"]) : h::input(['name' => "user[{$column}]", 'value' => $user_data[$column], $column == 'id' ? 'readonly' : false]), ['colspan' => $i == $last ? 3 : false]); if ($i % 2) { $content .= h::tr($content_); $content_ = ''; } } if ($content_ != '') { $content .= h::tr($content_); } unset($i, $column, $content_); $Page->title($L->editing_raw_data_of_user($User->username($rc[3]))); $a->content(h::{'p.lead.cs-center'}($L->editing_raw_data_of_user($User->username($rc[3]))) . h::{'table.cs-table-borderless.cs-center-all'}($content)); break; case 'edit': $a->apply_button = false; $a->cancel_button_back = true;
<?php /** * @package CleverStyle CMS * @subpackage System module * @category modules * @author Nazar Mokrynskyi <*****@*****.**> * @copyright Copyright (c) 2011-2014, Nazar Mokrynskyi * @license MIT License, see license.txt */ namespace cs; use h; $Config = Config::instance(); $L = Language::instance(); Index::instance()->content(h::{'table.cs-table-borderless.cs-left-even.cs-right-odd tr'}([h::td([h::info('key_expire'), h::{'input[type=number]'}(['name' => 'core[key_expire]', 'value' => $Config->core['key_expire'], 'min' => 1]) . $L->seconds]), h::td([h::info('ip_black_list'), h::textarea($Config->core['ip_black_list'], ['name' => 'core[ip_black_list]'])]), h::td([h::info('ip_admin_list_only'), h::{'input[type=radio]'}(['name' => 'core[ip_admin_list_only]', 'checked' => $Config->core['ip_admin_list_only'], 'value' => [0, 1], 'in' => [$L->off, $L->on]])]), h::td([h::info('ip_admin_list'), h::textarea($Config->core['ip_admin_list'], ['name' => 'core[ip_admin_list]']) . h::br() . $L->current_ip . ': ' . h::b(User::instance()->ip)])]));