* @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\Core, cs\Index, cs\Language; $Config = Config::instance(); $L = Language::instance(); $Config->reload_languages(); $translate_engines = _mb_substr(get_files_list(ENGINES . '/Text', '/^[^_].*?\\.php$/i', 'f'), 0, -4); $translate_engines_settings = []; $current_engine_settings = ''; foreach ($translate_engines as $engine) { $parameters = file_get_json(ENGINES . '/Text/' . $engine . '.json'); if (is_array($parameters) && !empty($parameters)) { $table = ''; foreach ($parameters as $paremeter => $description) { $table .= h::{'tr td'}([$description, h::input(['name' => 'core[auto_translation_engine][' . $paremeter . ']', 'value' => isset($Config->core['auto_translation_engine'][$paremeter]) ? $Config->core['auto_translation_engine'][$paremeter] : ''])]); } $translate_engines_settings[] = base64_encode(h::table($table)); } else { $translate_engines_settings[] = base64_encode($parameters ?: $L->no_settings_found); } if ($engine == $Config->core['auto_translation_engine']['name']) { $current_engine_settings = base64_decode(array_slice($translate_engines_settings, -1)[0]); } } unset($engine, $parameters, $paremeter, $description, $table); Index::instance()->content(h::{'p.lead.cs-center'}(FIXED_LANGUAGE ? $L->language_fixed_as . ' ' . Core::instance()->language : false) . h::{'table.cs-table-borderless.cs-left-even.cs-right-odd tr| td'}(core_select($Config->core['active_languages'], 'language', 'change_language', 'current_language'), core_select($Config->core['languages'], 'active_languages', 'change_active_languages', null, true), [h::info('multilingual'), h::{'input[type=radio]'}(['name' => 'core[multilingual]', 'checked' => $Config->core['multilingual'], 'value' => [0, 1], 'in' => [$L->off, $L->on], 'OnClick' => ["\$('.cs-multilingual').hide(); \$('.cs-auto-translation').hide();", "\$('.cs-multilingual').show(); if (\$('#auto_translation [value=1]').prop('checked')) \$('.cs-auto-translation').show();"]])], [[h::info('auto_translation'), h::{'input[type=radio]'}(['name' => 'core[auto_translation]', 'checked' => $Config->core['auto_translation'], 'value' => [0, 1], 'in' => [$L->off, $L->on], 'OnClick' => ["\$('.cs-auto-translation').hide();", "\$('.cs-auto-translation').show();"]])], ['style' => !$Config->core['multilingual'] ? 'display: none; ' : '', 'id' => 'auto_translation', 'class' => 'cs-multilingual']], [[h::info('auto_translation_engine'), h::select($translate_engines, ['name' => 'core[auto_translation_engine][name]', 'selected' => $Config->core['auto_translation_engine']['name'], 'data-settings' => $translate_engines_settings, 'size' => 5])], ['style' => !$Config->core['multilingual'] || !$Config->core['auto_translation'] ? 'display: none; ' : '', 'id' => 'auto_translation_engine', 'class' => 'cs-auto-translation']], [[$L->auto_translation_engine_settings, ['style' => !$Config->core['multilingual'] || !$Config->core['auto_translation'] ? 'display: none; ' : '', 'class' => 'cs-auto-translation cs-multilingual']], [$current_engine_settings, ['style' => !$Config->core['multilingual'] || !$Config->core['auto_translation'] ? 'display: none; ' : '', 'id' => 'auto_translation_engine_settings', 'class' => 'cs-auto-translation']]]));
<?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(); Index::instance()->content(h::{'table.cs-table-borderless.cs-left-even.cs-right-odd tr| td'}(core_input('session_expire', 'number', null, false, 1, false, $L->seconds), core_input('online_time', 'number', null, false, 1, false, $L->seconds), [h::info('sign_in_attempts_block_count'), h::{'input[type=number]'}(['name' => 'core[sign_in_attempts_block_count]', 'value' => $Config->core['sign_in_attempts_block_count'], 'min' => 0, 'onChange' => "if (\$(this).val() == 0) { \$('.cs-sign-in-attempts-block-count').hide(); } else { \$('.cs-sign-in-attempts-block-count').show(); }"])], [core_input('sign_in_attempts_block_time', 'number', null, false, 1, false, $L->seconds), ['style' => $Config->core['sign_in_attempts_block_count'] == 0 ? 'display: none;' : '', 'class' => 'cs-sign-in-attempts-block-count']], core_input('remember_user_ip', 'radio'), core_input('password_min_length', 'number', null, false, 4), core_input('password_min_strength', 'range', null, false, 0, 7), [h::info('allow_user_registration'), h::{'input[type=radio]'}(['name' => 'core[allow_user_registration]', 'checked' => $Config->core['allow_user_registration'], 'value' => [0, 1], 'in' => [$L->off, $L->on], 'onchange' => ["\$('.cs-allow-user-registration').hide();", "\$('.cs-allow-user-registration').show();" . "if (!\$('.cs-allow-user-registration input[value=1]').prop('checked')) { \$('.cs-require-registration-confirmation').hide(); }"]])], [[h::info('require_registration_confirmation'), h::{'input[type=radio]'}(['name' => 'core[require_registration_confirmation]', 'checked' => $Config->core['require_registration_confirmation'], 'value' => [0, 1], 'in' => [$L->off, $L->on], 'onchange' => ["\$('.cs-require-registration-confirmation').hide();", "\$('.cs-require-registration-confirmation').show();"]])], ['style' => $Config->core['allow_user_registration'] == 0 ? 'display: none;' : '', 'class' => 'cs-allow-user-registration']], [core_input('registration_confirmation_time', 'number', null, false, 1, false, $L->days), ['style' => $Config->core['allow_user_registration'] == 1 && $Config->core['require_registration_confirmation'] == 1 ? '' : 'display: none;', 'class' => 'cs-allow-user-registration cs-require-registration-confirmation']], [core_input('auto_sign_in_after_registration', 'radio'), ['style' => $Config->core['allow_user_registration'] == 1 && $Config->core['require_registration_confirmation'] == 1 ? '' : 'display: none;', 'class' => 'cs-allow-user-registration cs-require-registration-confirmation']], core_textarea('rules', 'SIMPLE_EDITOR')));
module_storage_settings: if (file_exists(MODULES . "/{$rc['3']}/meta/storage.json")) { $storages = [0 => $L->core_storage]; foreach ($Config->storage as $i => &$storage_data) { if ($i) { $storages[$i] = "{$storage_data['host']} ({$storage_data['connection']})"; } } unset($i, $storage_data); $storage_list = []; $storage_json = file_get_json(MODULES . "/{$rc['3']}/meta/storage.json"); foreach ($storage_json as $storage) { $storage_list[] = [$L->{"{$rc['3']}_storage_{$storage}"}, h::select(['in' => array_values($storages), 'value' => array_keys($storages)], ['name' => "storage[{$storage}]", 'selected' => isset($Config->components['modules'][$rc[3]]['storage'][$storage]) ? $Config->components['modules'][$rc[3]]['storage'][$storage] : 0, 'size' => 5])]; } unset($storage_json, $storages, $storage); $a->content(h::{'table.cs-table'}(h::{'thead tr th'}([h::info('appointment_of_storage'), h::info('system_storage')]) . h::{'tbody tr| td'}($storage_list))); unset($storage_list); } if ($rc[2] == 'install') { goto back_to_module_installation_2; } } break; case 'enable': $show_modules = false; $check_dependencies = check_dependencies($rc[3], 'module', null, 'enable'); if (!$check_dependencies && $Config->core['simple_admin_mode']) { break; } $Page->title($L->enabling_of_module($rc[3])); $a->content(h::{'p.lead.cs-center'}($L->enable_module($rc[3])));
<?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; $Config = Config::instance(); $timezones = get_timezones_list(); $sa = $Config->core['simple_admin_mode']; Index::instance()->content(h::{'table.cs-table-borderless.cs-left-even.cs-right-odd tr| td'}(core_input('name', 'text', 'site_name'), !$sa ? core_textarea('url') : false, !$sa ? core_textarea('cookie_domain') : false, !$sa ? core_textarea('cookie_path') : false, !$sa ? core_input('cookie_prefix') : false, [h::info('timezone'), h::select(['in' => array_keys($timezones), 'value' => array_values($timezones)], ['name' => 'core[timezone]', 'selected' => $Config->core['timezone'], 'size' => 7])], core_input('admin_email', 'email')));
<?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));
<?php /** * @package Static Pages * @category modules * @author Nazar Mokrynskyi <*****@*****.**> * @copyright Copyright (c) 2011-2014, Nazar Mokrynskyi * @license MIT License, see license.txt */ namespace cs\modules\Static_pages; use h, cs\Config, cs\Index, cs\Language, cs\Page; $Index = Index::instance(); $L = Language::instance(); $id = (int) Config::instance()->route[1]; $data = Static_pages::instance()->get_category($id); Page::instance()->title($L->editing_of_page_category($data['title'])); $Index->apply_button = false; $Index->cancel_button_back = true; $Index->action = 'admin/Static_pages'; $Index->content(h::{'p.lead.cs-center'}($L->editing_of_page_category($data['title'])) . h::{'table.cs-table-borderless.cs-center-all'}(h::{'thead tr th'}($L->parent_category, $L->category_title, h::info('category_path')), h::{'tbody tr td'}(h::{'select[name=parent][size=5]'}(get_categories_list($id), ['selected' => $data['parent']]), h::{'input[name=title]'}(['value' => $data['title']]), h::{'input[name=path]'}(['value' => $data['path']]))) . h::{'input[type=hidden][name=id]'}(['value' => $id]) . h::{'input[type=hidden][name=mode][value=edit_category]'}());
if (isset($user_data['reg_ip'])) { $user_data['reg_ip'] = hex2ip($user_data['reg_ip'], 10); if ($user_data['reg_ip'][1]) { $user_data['reg_ip'] = $user_data['reg_ip'][0] . h::br() . $user_data['reg_ip'][1]; } else { $user_data['reg_ip'] = $user_data['reg_ip'][0]; } } if (isset($user_data['last_ip'])) { $user_data['last_ip'] = hex2ip($user_data['last_ip'], 10); if ($user_data['last_ip'][1]) { $user_data['last_ip'] = $user_data['last_ip'][0] . h::br() . $user_data['last_ip'][1]; } else { $user_data['last_ip'] = $user_data['last_ip'][0]; } } if (in_array(User::ADMIN_GROUP_ID, $groups)) { $type = h::info('a'); } elseif (in_array(User::USER_GROUP_ID, $groups)) { $type = h::info('u'); } elseif ($is_bot) { $type = h::info('b'); } else { $type = h::info('g'); } $users_list[] = array_values([$buttons, $type] + $user_data); } } unset($id, $buttons, $user_data, $users_ids, $is_guest, $is_root, $is_bot); $a->content(h::{'ul.cs-tabs li'}($L->search, h::info('show_columns')) . h::div(h::div(h::select(['in' => array_merge([$L->all_columns], $search_columns), 'value' => array_merge([''], $search_columns)], ['selected' => $search_column ?: '', 'name' => 'search_column']) . $L->search_mode . ' ' . h::select($search_modes, ['selected' => $search_mode ?: 'LIKE', 'name' => 'search_mode']) . h::{'input.uk-form-width-medium'}(['value' => $search_text, 'name' => 'search_text', 'placeholder' => $L->search_text]) . $L->page . ' ' . h::{'input[type=number]'}(['value' => $start + 1, 'min' => 1, 'name' => 'search_start']) . $L->items . ' ' . h::{'input[type=number]'}(['value' => $limit, 'min' => 1, 'name' => 'search_limit']), ['style' => 'text-align: left;']) . h::{'ul#cs-users-search-columns.uk-padding-remove'}($columns_list)) . h::{'input#cs-users-search-selected-columns[name=columns][type=hidden]'}() . h::hr() . h::{'p.cs-left'}(h::{'button[type=submit]'}($L->search), $L->found_users($results_count) . ($results_count > $limit ? ' / ' . $L->page_from($start + 1, ceil($results_count / $limit)) : '')) . h::{'table.cs-table.cs-center-all'}(h::{'thead tr th'}(array_merge([$L->action, ''], $columns)) . h::{'tbody tr| td'}($users_list)) . h::{'p.cs-left'}($L->found_users($results_count) . ($results_count > $limit ? ' / ' . $L->page_from($start + 1, ceil($results_count / $limit)) : ''), h::{'a.cs-button'}($L->add_user, ['href' => 'admin/System/users/users/add/0']) . h::{'a.cs-button'}($L->add_bot, ['href' => 'admin/System/users/users/add_bot/0']))); }
<?php /** * @package Static Pages * @category modules * @author Nazar Mokrynskyi <*****@*****.**> * @copyright Copyright (c) 2011-2014, Nazar Mokrynskyi * @license MIT License, see license.txt */ namespace cs\modules\Static_pages; use h, cs\Config, cs\Index, cs\Language, cs\Page; $Config = Config::instance(); $Index = Index::instance(); $L = Language::instance(); Page::instance()->title($L->addition_of_page_category); $Index->apply_button = false; $Index->cancel_button_back = true; $Index->action = 'admin/Static_pages'; $Index->content(h::{'p.lead.cs-center'}($L->addition_of_page_category) . h::{'table.cs-table-borderless.cs-center-all'}(h::{'thead tr th'}($L->parent_category, $L->category_title, h::info('category_path')), h::{'tbody tr td'}(h::{'select[name=parent][size=5]'}(get_categories_list(), ['selected' => isset($Config->route[1]) ? (int) $Config->route[1] : 0]), h::{'input[name=title]'}(), h::{'input[name=path]'}())) . h::{'input[type=hidden][name=mode][value=add_category]'}());
$a->form = false; $a->generate_auto = false; $db = DB::instance(); if (isset($rc[4])) { $Page->content(h::{'p.cs-test-result'}($db->test([$rc[3], $rc[4]]) ? $L->success : $L->failed)); } elseif (isset($rc[3])) { $Page->content(h::{'p.cs-test-result'}($db->test([$rc[3]]) ? $L->success : $L->failed)); } else { $Page->content(h::{'p.cs-test-result'}($db->test($_POST['db']) ? $L->success : $L->failed)); } } } else { $test_dialog = true; $db_list = []; $databases = $Config->db; if (!empty($databases)) { foreach ($databases as $i => &$db_data) { $db_list[] = [[[h::{'a.cs-button-compact'}([h::icon('plus'), ['href' => "{$a->action}/add/{$i}", 'data-title' => "{$L->add} {$L->mirror} {$L->of_db}"]], $i ? [h::icon('pencil'), ['href' => "{$a->action}/edit/{$i}", 'data-title' => "{$L->edit} {$L->db}"]] : false, $i ? [h::icon('trash-o'), ['href' => "{$a->action}/delete/{$i}", 'data-title' => $L->delete . ' ' . $L->db]] : false, [h::icon('signal'), ['onMouseDown' => "cs.db_test('{$a->action}/test/{$i}', true);", 'data-title' => $L->test_connection]]), ['class' => 'cs-left-all']], $i ? $db_data['host'] : $Core->db_host, $i ? $db_data['type'] : $Core->db_type, $i ? $db_data['prefix'] : $Core->db_prefix, $i ? $db_data['name'] : $Core->db_name, $i ? $db_data['user'] : '******', $i ? $db_data['charset'] : $Core->db_charset], ['class' => $i ? '' : 'text-primary']]; foreach ($Config->db[$i]['mirrors'] as $m => &$mirror) { if (is_array($mirror) && !empty($mirror)) { $db_list[] = [[h::{'a.cs-button-compact'}([h::icon('pencil'), ['href' => "admin/System/{$rc['0']}/{$rc['1']}/edit/{$i}/{$m}", 'data-title' => "{$L->edit} {$L->mirror} {$L->of_db}"]], [h::icon('trash-o'), ['href' => "admin/System/{$rc['0']}/{$rc['1']}/delete/{$i}/{$m}", 'data-title' => "{$L->delete} {$L->mirror} {$L->of_db}"]], [h::icon('signal'), ['onMouseDown' => "cs.db_test('{$a->action}/test/{$i}/{$m}', true);", 'data-title' => $L->test_connection]]), ['class' => 'cs-right-all']], $mirror['host'], $mirror['type'], $mirror['prefix'], $mirror['name'], $mirror['user'], $mirror['charset']]; } } unset($m, $mirror); } unset($i, $db_data); } unset($databases); $a->content(h::{'table.cs-table'}(h::{'thead tr th'}($L->action, $L->db_host, $L->db_type, $L->db_prefix, $L->db_name, $L->db_user, $L->db_charset) . h::tbody(h::{'tr| td'}([$db_list]))) . h::{'table.cs-table-borderless.cs-left-even.cs-right-odd tr| td'}([[h::info('db_balance'), h::{'input[type=radio]'}(['name' => 'core[db_balance]', 'checked' => $Config->core['db_balance'], 'value' => [0, 1], 'in' => [$L->off, $L->on]])], [h::info('maindb_for_write'), h::{'input[type=radio]'}(['name' => 'core[maindb_for_write]', 'checked' => $Config->core['maindb_for_write'], 'value' => [0, 1], 'in' => [$L->off, $L->on]])]]) . h::{'p a.cs-button'}($L->add_database, ['href' => "admin/System/{$rc['0']}/{$rc['1']}/add"]) . h::{'input[type=hidden]'}(['name' => 'mode', 'value' => 'config'])); } $test_dialog && $a->content(h::{'div#cs-db-test.uk-modal div'}(h::h3($L->test_connection) . h::div()));
function core_select($items_array, $item, $id = null, $info_item = null, $multiple = false, $size = 5) { return [h::info($info_item ?: $item), h::select($items_array, ['name' => "core[{$item}]" . ($multiple ? '[]' : ''), 'selected' => Config::instance()->core[$item], 'size' => $size, 'id' => $id ?: false, $multiple ? 'multiple' : false])]; }
<?php /** * @package Plupload * @category modules * @author Moxiecode Systems AB * @author Nazar Mokrynskyi <*****@*****.**> (integration with CleverStyle CMS) * @copyright Moxiecode Systems AB * @license GNU GPL v2, see license.txt */ namespace cs; use h; $Index = Index::instance(); $Index->apply_button = false; $Config = Config::instance(); $L = Language::instance(); $Index->content(h::{'table.cs-table-borderless.cs-left-even.cs-right-odd tr| td'}([$L->upload_limit . ' (b, kb, mb, gb)', h::{'input[name=max_file_size]'}(['value' => $Config->module('Plupload')->max_file_size])], [h::info('plupload_confirmation_time'), h::{'input[name=confirmation_time]'}(['value' => $Config->module('Plupload')->confirmation_time]) . $L->seconds]));
<?php /** * @package Static Pages * @category modules * @author Nazar Mokrynskyi <*****@*****.**> * @copyright Copyright (c) 2011-2014, Nazar Mokrynskyi * @license MIT License, see license.txt */ namespace cs\modules\Static_pages; use h, cs\Config, cs\Index, cs\Language, cs\Page; $Index = Index::instance(); $L = Language::instance(); $id = (int) Config::instance()->route[1]; $data = Static_pages::instance()->get($id); Page::instance()->title($L->editing_of_page($data['title'])); $Index->apply_button = false; $Index->cancel_button_back = true; $Index->action = 'admin/Static_pages'; $Index->content(h::{'p.lead.cs-center'}($L->editing_of_page($data['title'])) . h::{'table.cs-table-borderless.cs-center-all'}(h::{'thead tr th'}($L->category, $L->page_title, h::info('page_path'), h::info('page_interface')), h::{'tbody tr td'}(h::{'select[name=category][size=5]'}(get_categories_list(), ['selected' => $data['category']]), h::{'input[name=title]'}(['value' => $data['title']]), h::{'input[name=path]'}(['value' => $data['path']]), h::{'div input[type=radio][name=interface]'}(['checked' => $data['interface'], 'value' => [0, 1], 'in' => [$L->off, $L->on]]))) . h::{'table.cs-table-borderless.cs-center-all'}(h::{'thead tr th'}($L->content), h::{'tbody tr td textarea[name=content]'}($data['content'], ['class' => $data['interface'] ? 'EDITOR' : ''])) . h::{'input[type=hidden][name=id]'}(['value' => $id]) . h::{'input[type=hidden][name=mode][value=edit_page]'}());
<?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(); Index::instance()->content(h::{'table.cs-table-borderless.cs-left-even.cs-right-odd tr| td'}([[h::info('smtp'), h::{'input[type=radio]'}(['name' => 'core[smtp]', 'checked' => $Config->core['smtp'], 'value' => [0, 1], 'in' => [$L->off, $L->on], 'OnClick' => ["\$('#smtp_form').parent().parent().hide();", "\$('#smtp_form').parent().parent().show();"]])], [['', h::{'table#smtp_form tr'}(h::td(core_input('smtp_host')), h::td(core_input('smtp_port')), h::td([h::info('smtp_secure'), h::{'input[type=radio]'}(['name' => 'core[smtp_secure]', 'checked' => $Config->core['smtp_secure'], 'value' => ['', 'ssl', 'tls'], 'in' => [$L->off, 'SSL', 'TLS']])]), h::td([$L->smtp_auth, h::{'input[type=radio]'}(['name' => 'core[smtp_auth]', 'checked' => $Config->core['smtp_auth'], 'value' => [0, 1], 'in' => [$L->off, $L->on], 'OnClick' => ["\$('#smtp_user, #smtp_password').hide();", "\$('#smtp_user, #smtp_password').show();"]])]), [h::td(core_input('smtp_user')), ['style' => (!$Config->core['smtp_auth'] ? 'display: none;' : '') . ' padding-left: 20px;', 'id' => 'smtp_user']], [h::td(core_input('smtp_password')), ['style' => !$Config->core['smtp_auth'] ? 'display: none;' : '', 'id' => 'smtp_password']])], ['style' => !$Config->core['smtp'] ? 'display: none; ' : '']], core_input('mail_from'), core_input('mail_from_name'), core_textarea('mail_signature', 'SIMPLE_EDITOR')]));
<?php /** * @package OAuth2 * @category modules * @author Nazar Mokrynskyi <*****@*****.**> * @copyright Copyright (c) 2011-2014, Nazar Mokrynskyi * @license MIT License, see license.txt */ namespace cs\modules\OAuth2; use h, cs\Config, cs\Index, cs\Language\Prefix, cs\Page; $Index = Index::instance(); $L = new Prefix('oauth2_'); Page::instance()->title($L->list_of_client); $Index->apply_button = false; $module_data = Config::instance()->module('OAuth2'); $Index->content(h::{'p.lead.cs-center'}($L->list_of_clients) . h::{'table.cs-table.cs-center-all'}(h::{'thead tr th'}([$L->client_name, 'client_id', 'client_secret', $L->action]) . h::{'tbody tr'}(array_map(function ($client) use($L) { return h::td([$client['name'], h::{'input{disabled]'}($client['id']), h::{'input{disabled]'}($client['secret']), h::{'a.cs-button-compact'}([h::icon('pencil'), ['href' => "admin/OAuth2/clients/edit/{$client['id']}", 'data-title' => $L->edit]]) . h::{'a.cs-button-compact'}([h::icon('trash-o'), ['href' => "admin/OAuth2/clients/delete/{$client['id']}", 'data-title' => $L->delete]])], ['class' => $client['active'] ? false : 'text-muted']); }, OAuth2::instance()->clients_list()))) . h::{'table.cs-table-borderless.cs-left-even.cs-right-odd.uk-margin-top tr| td'}([h::info('oauth2_allow_guest_tokens'), h::{'input[type=radio]'}(['name' => 'general[guest_tokens]', 'checked' => $module_data->guest_tokens, 'value' => [0, 1], 'in' => [$L->no, $L->yes]])], [h::info('oauth2_automatic_prolongation'), h::{'input[type=radio]'}(['name' => 'general[automatic_prolongation]', 'checked' => $module_data->automatic_prolongation, 'value' => [0, 1], 'in' => [$L->no, $L->yes]])], [h::info('oauth2_expiration'), h::{'input[type=number]'}(['name' => 'general[expiration]', 'value' => $module_data->expiration, 'min' => 1]) . $L->seconds]) . h::{'p.cs-left a.cs-button'}([$L->add_client, ['href' => 'admin/OAuth2/clients/add']]));
<?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)])]));
<?php /** * @package Static Pages * @category modules * @author Nazar Mokrynskyi <*****@*****.**> * @copyright Copyright (c) 2011-2014, Nazar Mokrynskyi * @license MIT License, see license.txt */ namespace cs\modules\Static_pages; use h, cs\Config, cs\Index, cs\Language, cs\Page; $Config = Config::instance(); $Index = Index::instance(); $L = Language::instance(); Page::instance()->title($L->adding_of_page); $Index->apply_button = false; $Index->cancel_button_back = true; $Index->action = 'admin/Static_pages'; $Index->content(h::{'p.lead.cs-center'}($L->adding_of_page) . h::{'table.cs-table-borderless.cs-center-all'}(h::{'thead tr th'}($L->category, $L->page_title, h::info('page_path'), h::info('page_interface')), h::{'tbody tr td'}(h::{'select[name=category][size=5]'}(get_categories_list(), ['selected' => isset($Config->route[1]) ? (int) $Config->route[1] : 0]), h::{'input[name=title]'}(), h::{'input[name=path]'}(), h::{'div input[type=radio][name=interface]'}(['checked' => 1, 'value' => [0, 1], 'in' => [$L->off, $L->on]]))) . h::{'table.cs-table-borderless.cs-center-all'}(h::{'thead tr th'}($L->content), h::{'tbody tr td textarea.EDITOR[name=content]'}()) . h::{'input[type=hidden][name=mode][value=add_page]'}());