diff --git a/src/messenger/webim/install/view_index.php b/src/messenger/webim/install/view_index.php index dff60550..be1f9bad 100644 --- a/src/messenger/webim/install/view_index.php +++ b/src/messenger/webim/install/view_index.php @@ -22,7 +22,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("install.title") ?> + <?php echo getlocal("install.title") ?> - <?php echo getlocal("app.title") ?> "> diff --git a/src/messenger/webim/install/view_installerr.php b/src/messenger/webim/install/view_installerr.php index 41310e82..2e7cf0ab 100644 --- a/src/messenger/webim/install/view_installerr.php +++ b/src/messenger/webim/install/view_installerr.php @@ -22,7 +22,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("install.err.title") ?> + <?php echo getlocal("install.err.title") ?> - <?php echo getlocal("app.title") ?> "> diff --git a/src/messenger/webim/libs/settings.php b/src/messenger/webim/libs/settings.php new file mode 100644 index 00000000..0eeee01f --- /dev/null +++ b/src/messenger/webim/libs/settings.php @@ -0,0 +1,37 @@ + $value) { + if(!isset($settings_in_db[$key])) { + perform_query("insert into chatconfig (vckey) values ('$key')",$link); + } + $query = sprintf("update chatconfig set vcvalue='%s' where vckey='$key'", mysql_real_escape_string($value)); + perform_query($query,$link); + } + + mysql_close($link); +} + +function setup_settings_tabs($active) { + global $page, $webimroot; + $page['tabs'] = array( + getlocal("page_settings.tab.main") => $active != 0 ? "$webimroot/operator/settings.php" : "", + getlocal("page_settings.tab.features") => $active != 1 ? "$webimroot/operator/features.php" : "", + ); +} + +?> diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties index 9bcbd1e4..e92f96aa 100644 --- a/src/messenger/webim/locales/en/properties +++ b/src/messenger/webim/locales/en/properties @@ -88,6 +88,7 @@ errors.prefix=
  • errors.required=Please fill "{0}". errors.suffix=
  • errors.wrong_field=Please fill "{0}" correctly. +features.saved=Features activated form.field.address.description=Ex: 12.23.45.123 or todo.com form.field.address=Visitor's Address form.field.agent_commonname.description=This name will be seen by your visitors. @@ -245,6 +246,8 @@ page_login.remember=Remember page_login.title=Login page_search.intro=Search for chat history of a specified user or a specified phrase in a message. page_settings.intro=Specify options affecting chat window and common system behavior +page_settings.tab.features=Optional Services +page_settings.tab.main=General pending.table.ban=Ban the visitor pending.table.head.contactid=Visitor's address pending.table.head.etc=Misc @@ -279,6 +282,7 @@ settings.host=URL of your website settings.logo.description=Enter http address of your company logo settings.logo=Your company logo settings.no.title=Please enter your company title +settings.saved=Changes saved settings.title=Messenger settings settings.usercanchangename.description=Turn off to hide edit box from chat window settings.usercanchangename=Allows users to change their names diff --git a/src/messenger/webim/locales/ru/properties b/src/messenger/webim/locales/ru/properties index ff0523b8..2ef8a350 100644 --- a/src/messenger/webim/locales/ru/properties +++ b/src/messenger/webim/locales/ru/properties @@ -88,6 +88,7 @@ errors.prefix=
  • errors.required=Заполните поле "{0}". errors.suffix=
  • errors.wrong_field=Неправильно заполнено поле "{0}" +features.saved=Набор сервисов изменен form.field.address.description=Например: 12.23.45.123 или relay.info.ru form.field.address=Адрес посетителя form.field.agent_commonname.description=Под этим именем Вас увидят ваши посетители из других стран. @@ -245,6 +246,8 @@ page_login.remember= page_login.title=Вход в систему page_search.intro=На данной странице можно осуществить поиск диалогов по имени пользователя или фразе, встречающейся в сообщении. page_settings.intro=Здесь вы можете задать опции влияющие на отображение чат окна и общее поведение системы +page_settings.tab.features=Дополнительные сервисы +page_settings.tab.main=Общее pending.table.ban=Пометить посетителя как нежелательного pending.table.head.contactid=Адрес посетителя pending.table.head.etc=Разное @@ -272,13 +275,14 @@ settings.enableban.description= settings.enableban=Включить функцию "Нежелательные посетители" settings.geolink.description=На любом IP адресе можно будет открыть небольшое окно с геоинформацией. Можно использовать {ip}. settings.geolink=Ссылка на внешний geolocation сервис -settings.geolinkparams.description=Размер окна и наличие тулбаров +settings.geolinkparams.description=Размер окна и наличие тулбаров settings.geolinkparams=Опции для окна с геоинформацией settings.host.description=Будет открываться по нажатию на логотип или название компании в чат окне settings.host=Ссылка на ваш веб сайт settings.logo.description=Введите ссылку на логотип компании settings.logo=Лого компании settings.no.title=Введите имя Вашей компании +settings.saved=Изменения сохранены settings.title=Настройки мессенджера settings.usercanchangename.description=Возможность убрать поле смены имени из чат окна settings.usercanchangename=Разрешить посетителям менять имена diff --git a/src/messenger/webim/operator/features.php b/src/messenger/webim/operator/features.php new file mode 100644 index 00000000..2cb25158 --- /dev/null +++ b/src/messenger/webim/operator/features.php @@ -0,0 +1,52 @@ + ''); +$errors = array(); + +$options = array('enableban', 'usercanchangename'); + +loadsettings(); +$params = array(); +foreach($options as $opt) { + $params[$opt] = $settings[$opt]; +} + +if (isset($_POST['sent'])) { + $params['enableban'] = verifyparam("enableban","/^on$/", "") == "on" ? "1" : "0"; + $params['usercanchangename'] = verifyparam("usercanchangename", "/^on$/", "") == "on" ? "1" : "0"; + + foreach($options as $opt) { + $settings[$opt] = $params[$opt]; + } + update_settings(); + header("Location: $webimroot/operator/features.php?stored"); + exit; +} + +$page['operator'] = topage(get_operator_name($operator)); +$page['formenableban'] = $params['enableban'] == "1"; +$page['formusercanchangename'] = $params['usercanchangename'] == "1"; +$page['stored'] = isset($_GET['stored']); + +setup_settings_tabs(1); +start_html_output(); +require('../view/features.php'); +?> \ No newline at end of file diff --git a/src/messenger/webim/operator/settings.php b/src/messenger/webim/operator/settings.php index 032f910f..edc63358 100644 --- a/src/messenger/webim/operator/settings.php +++ b/src/messenger/webim/operator/settings.php @@ -14,23 +14,10 @@ require_once('../libs/common.php'); require_once('../libs/operator.php'); +require_once('../libs/settings.php'); $operator = check_login(); -function update_settings() { - global $settings, $settings_in_db; - $link = connect(); - foreach ($settings as $key => $value) { - if(!isset($settings_in_db[$key])) { - perform_query("insert into chatconfig (vckey) values ('$key')",$link); - } - $query = sprintf("update chatconfig set vcvalue='%s' where vckey='$key'", mysql_real_escape_string($value)); - perform_query($query,$link); - } - - mysql_close($link); -} - $page = array('agentId' => ''); $errors = array(); @@ -46,7 +33,7 @@ if($handle = opendir($stylesfolder)) { } $options = array( - 'email', 'title', 'logo', 'hosturl', 'enableban', 'usernamepattern', 'usercanchangename', + 'email', 'title', 'logo', 'hosturl', 'usernamepattern', 'chatstyle', 'chattitle', 'geolink', 'geolinkparams'); loadsettings(); @@ -60,9 +47,7 @@ if (isset($_POST['email']) && isset($_POST['title']) && isset($_POST['logo'])) { $params['title'] = getparam('title'); $params['logo'] = getparam('logo'); $params['hosturl'] = getparam('hosturl'); - $params['enableban'] = verifyparam("enableban","/^on$/", "") == "on" ? "1" : "0"; $params['usernamepattern'] = getparam('usernamepattern'); - $params['usercanchangename'] = verifyparam("usercanchangename", "/^on$/", "") == "on" ? "1" : "0"; $params['chattitle'] = getparam('chattitle'); $params['geolink'] = getparam('geolink'); $params['geolinkparams'] = getparam('geolinkparams'); @@ -89,7 +74,7 @@ if (isset($_POST['email']) && isset($_POST['title']) && isset($_POST['logo'])) { $settings[$opt] = $params[$opt]; } update_settings(); - header("Location: $webimroot/operator/index.php"); + header("Location: $webimroot/operator/settings.php?stored"); exit; } } @@ -101,13 +86,13 @@ $page['formlogo'] = topage($params['logo']); $page['formhosturl'] = topage($params['hosturl']); $page['formgeolink'] = topage($params['geolink']); $page['formgeolinkparams'] = topage($params['geolinkparams']); -$page['formenableban'] = $params['enableban'] == "1"; $page['formusernamepattern'] = topage($params['usernamepattern']); -$page['formusercanchangename'] = $params['usercanchangename'] == "1"; $page['formchatstyle'] = $params['chatstyle']; $page['formchattitle'] = topage($params['chattitle']); $page['availableStyles'] = $stylelist; +$page['stored'] = isset($_GET['stored']); +setup_settings_tabs(0); start_html_output(); require('../view/settings.php'); ?> \ No newline at end of file diff --git a/src/messenger/webim/styles.css b/src/messenger/webim/styles.css index 45885472..21ad0936 100644 --- a/src/messenger/webim/styles.css +++ b/src/messenger/webim/styles.css @@ -334,4 +334,13 @@ input.submit { .firstmessage a:hover { color: #8a6a6a; -} \ No newline at end of file +} + +#formmessage { + border: 1px solid #4C96D4; + background-color: #E7F1F9; + padding: 8px 11px; + font-size: 11px; font-weight:bold; + width : 400px; + margin: 5px 2px; +} diff --git a/src/messenger/webim/view/agent.php b/src/messenger/webim/view/agent.php index 80e415af..9b967ac1 100644 --- a/src/messenger/webim/view/agent.php +++ b/src/messenger/webim/view/agent.php @@ -22,7 +22,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("page_agent.title") ?> + <?php echo getlocal("page_agent.title") ?> - <?php echo getlocal("app.title") ?> "> @@ -74,7 +74,7 @@ $v) { if($v) { ?>
    -
    +
    diff --git a/src/messenger/webim/view/agents.php b/src/messenger/webim/view/agents.php index 8a4ada09..1ca74776 100644 --- a/src/messenger/webim/view/agents.php +++ b/src/messenger/webim/view/agents.php @@ -22,7 +22,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("page_agents.title") ?> + <?php echo getlocal("page_agents.title") ?> - <?php echo getlocal("app.title") ?> "> diff --git a/src/messenger/webim/view/avatar.php b/src/messenger/webim/view/avatar.php index 9899f39d..0a1bd31c 100644 --- a/src/messenger/webim/view/avatar.php +++ b/src/messenger/webim/view/avatar.php @@ -22,7 +22,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("page_avatar.title") ?> + <?php echo getlocal("page_avatar.title") ?> - <?php echo getlocal("app.title") ?> "> @@ -70,7 +70,7 @@ -
    *
    $v) { if($v) { ?>
    +
    -
    diff --git a/src/messenger/webim/view/ban.php b/src/messenger/webim/view/ban.php index c0a6ac29..00720054 100644 --- a/src/messenger/webim/view/ban.php +++ b/src/messenger/webim/view/ban.php @@ -22,7 +22,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("page_ban.title") ?> + <?php echo getlocal("page_ban.title") ?> - <?php echo getlocal("app.title") ?> "> diff --git a/src/messenger/webim/view/blocked_visitors.php b/src/messenger/webim/view/blocked_visitors.php index 7c8fd817..c05d013d 100644 --- a/src/messenger/webim/view/blocked_visitors.php +++ b/src/messenger/webim/view/blocked_visitors.php @@ -22,7 +22,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("page_bans.title") ?> + <?php echo getlocal("page_bans.title") ?> - <?php echo getlocal("app.title") ?> "> diff --git a/src/messenger/webim/view/features.php b/src/messenger/webim/view/features.php new file mode 100644 index 00000000..ab788f09 --- /dev/null +++ b/src/messenger/webim/view/features.php @@ -0,0 +1,101 @@ + + + + + + + + + + + + <?php echo getlocal("settings.title") ?> - <?php echo getlocal("app.title") ?> + + +"> +"> + + + + + + + + +
    + +
    +

    +
    |">
    + + + +
    +
    + 0 ) { ?> + + + + + + +
    + 0 ) { + print getlocal("errors.header"); + foreach( $errors as $e ) { + print getlocal("errors.prefix"); + print $e; + print getlocal("errors.suffix"); + } + print getlocal("errors.footer"); + } ?> + +
    + + +
    + + +
    + + + + + +
    $v) { if($v) { ?>
    + + + + + + + + + +
    + /> +
    + /> +
    + +
    +
    + +
    + + + + diff --git a/src/messenger/webim/view/gen_button.php b/src/messenger/webim/view/gen_button.php index ba2ab501..dec3b4c9 100644 --- a/src/messenger/webim/view/gen_button.php +++ b/src/messenger/webim/view/gen_button.php @@ -22,7 +22,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("page.gen_button.title") ?> + <?php echo getlocal("page.gen_button.title") ?> - <?php echo getlocal("app.title") ?> "> diff --git a/src/messenger/webim/view/login.php b/src/messenger/webim/view/login.php index 4851377d..6e43dce7 100644 --- a/src/messenger/webim/view/login.php +++ b/src/messenger/webim/view/login.php @@ -22,7 +22,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("page_login.title") ?> + <?php echo getlocal("page_login.title") ?> - <?php echo getlocal("app.title") ?> "> diff --git a/src/messenger/webim/view/menu.php b/src/messenger/webim/view/menu.php index 6fdeb125..bac1c19c 100644 --- a/src/messenger/webim/view/menu.php +++ b/src/messenger/webim/view/menu.php @@ -22,7 +22,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("topMenu.admin") ?> + <?php echo getlocal("topMenu.admin") ?> - <?php echo getlocal("app.title") ?> "> diff --git a/src/messenger/webim/view/pending_users.php b/src/messenger/webim/view/pending_users.php index c8e21e0f..d58bc8b2 100644 --- a/src/messenger/webim/view/pending_users.php +++ b/src/messenger/webim/view/pending_users.php @@ -34,7 +34,7 @@ var updaterOptions = { - <?php echo getlocal("app.title") ?> - <?php echo getlocal("clients.title") ?> + <?php echo getlocal("clients.title") ?> - <?php echo getlocal("app.title") ?> "> diff --git a/src/messenger/webim/view/permissions.php b/src/messenger/webim/view/permissions.php index 45017a4d..25550ed9 100644 --- a/src/messenger/webim/view/permissions.php +++ b/src/messenger/webim/view/permissions.php @@ -22,7 +22,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("permissions.title") ?> + <?php echo getlocal("permissions.title") ?> - <?php echo getlocal("app.title") ?> "> @@ -70,7 +70,7 @@
    $v) { if($v) { ?>
    +
    diff --git a/src/messenger/webim/view/preview.php b/src/messenger/webim/view/preview.php index 53cd58d0..39865b19 100644 --- a/src/messenger/webim/view/preview.php +++ b/src/messenger/webim/view/preview.php @@ -22,7 +22,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("page.preview.title") ?> + <?php echo getlocal("page.preview.title") ?> - <?php echo getlocal("app.title") ?> "> diff --git a/src/messenger/webim/view/settings.php b/src/messenger/webim/view/settings.php index c3b6cf9c..0cdc2da3 100644 --- a/src/messenger/webim/view/settings.php +++ b/src/messenger/webim/view/settings.php @@ -22,7 +22,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("settings.title") ?> + <?php echo getlocal("settings.title") ?> - <?php echo getlocal("app.title") ?> "> @@ -63,9 +63,16 @@
    + +
    +
    -
    +
    + + + +
    $v) { if($v) { ?>
    @@ -102,18 +109,10 @@ - - - - diff --git a/src/messenger/webim/view/thread_log.php b/src/messenger/webim/view/thread_log.php index cd631687..63ef9ce5 100644 --- a/src/messenger/webim/view/thread_log.php +++ b/src/messenger/webim/view/thread_log.php @@ -23,7 +23,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("thread.chat_log") ?> + <?php echo getlocal("thread.chat_log") ?> - <?php echo getlocal("app.title") ?> "> diff --git a/src/messenger/webim/view/thread_search.php b/src/messenger/webim/view/thread_search.php index 68085193..55c03d02 100644 --- a/src/messenger/webim/view/thread_search.php +++ b/src/messenger/webim/view/thread_search.php @@ -22,7 +22,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("page_analysis.search.title") ?> + <?php echo getlocal("page_analysis.search.title") ?> - <?php echo getlocal("app.title") ?> "> diff --git a/src/messenger/webim/view/translate.php b/src/messenger/webim/view/translate.php index 0af7605a..ade94b0c 100644 --- a/src/messenger/webim/view/translate.php +++ b/src/messenger/webim/view/translate.php @@ -22,7 +22,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("page.translate.title") ?> + <?php echo getlocal("page.translate.title") ?> - <?php echo getlocal("app.title") ?> "> diff --git a/src/messenger/webim/view/translatelist.php b/src/messenger/webim/view/translatelist.php index b2ec7a27..39455023 100644 --- a/src/messenger/webim/view/translatelist.php +++ b/src/messenger/webim/view/translatelist.php @@ -22,7 +22,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("page.translate.title") ?> + <?php echo getlocal("page.translate.title") ?> - <?php echo getlocal("app.title") ?> "> diff --git a/src/messenger/webim/view/userhistory.php b/src/messenger/webim/view/userhistory.php index ef35fb7c..32e33200 100644 --- a/src/messenger/webim/view/userhistory.php +++ b/src/messenger/webim/view/userhistory.php @@ -22,7 +22,7 @@ - <?php echo getlocal("app.title") ?> - <?php echo getlocal("page.analysis.userhistory.title") ?> + <?php echo getlocal("page.analysis.userhistory.title") ?> - <?php echo getlocal("app.title") ?> ">
    - /> -
    - /> -
    - +