diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties index 5c0b5366..91b2010c 100644 --- a/src/messenger/webim/locales/en/properties +++ b/src/messenger/webim/locales/en/properties @@ -255,6 +255,8 @@ page_avatar.intro=You can upload your photo only in JPG, GIF, PNG or TIF image f page_avatar.title=Upload photo 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 +settings.chatstyle=Select style for your chat windows +settings.chatstyle.description= settings.company.title=Company title settings.company.title.description=Enter your company title settings.email=Email diff --git a/src/messenger/webim/locales/ru/properties b/src/messenger/webim/locales/ru/properties index 3d618b14..811f60bd 100644 --- a/src/messenger/webim/locales/ru/properties +++ b/src/messenger/webim/locales/ru/properties @@ -255,6 +255,8 @@ page_avatar.intro= page_avatar.title=Загрузка фотографии page_search.intro=На данной странице можно осуществить поиск диалогов по имени пользователя или фразе, встречающейся в сообщении. page_settings.intro=Здесь вы можете задать опции влияющие на отображение чат окна и общее поведение системы +settings.chatstyle=Выберите вид вашего чат окна +settings.chatstyle.description= settings.company.title=Название компании settings.company.title.description=Введите название Вашей компании settings.email=Адрес электронной почты diff --git a/src/messenger/webim/operator/settings.php b/src/messenger/webim/operator/settings.php index f418c73a..a964aa37 100644 --- a/src/messenger/webim/operator/settings.php +++ b/src/messenger/webim/operator/settings.php @@ -34,6 +34,17 @@ function update_settings() { $page = array('agentId' => ''); $errors = array(); +$stylelist = array(); +$stylesfolder = "../styles"; +if($handle = opendir($stylesfolder)) { + while (false !== ($file = readdir($handle))) { + if (preg_match("/^\w+$/", $file) && is_dir("$stylesfolder/$file")) { + $stylelist[] = $file; + } + } + closedir($handle); +} + loadsettings(); $email = $settings['email']; $title = $settings['title']; @@ -42,6 +53,7 @@ $hosturl = $settings['hosturl']; $enableban = $settings['enableban']; $usernamepattern = $settings['usernamepattern']; $usercanchangename = $settings['usercanchangename']; +$chatstyle = $settings['chatstyle']; if (isset($_POST['email']) && isset($_POST['title']) && isset($_POST['logo'])) { $email = getparam('email'); @@ -52,6 +64,11 @@ if (isset($_POST['email']) && isset($_POST['title']) && isset($_POST['logo'])) { $usernamepattern = getparam('usernamepattern'); $usercanchangename = verifyparam("usercanchangename", "/^on$/", "") == "on" ? "1" : "0"; + $chatstyle = verifyparam("chatstyle","/^\w+$/", $chatstyle); + if(!in_array($chatstyle, $stylelist)) { + $chatstyle = $stylelist[0]; + } + if($email && !is_valid_email($email)) { $errors[] = getlocal("settings.wrong.email"); } @@ -64,6 +81,7 @@ if (isset($_POST['email']) && isset($_POST['title']) && isset($_POST['logo'])) { $settings['enableban'] = $enableban; $settings['usernamepattern'] = $usernamepattern; $settings['usercanchangename'] = $usercanchangename; + $settings['chatstyle'] = $chatstyle; update_settings(); header("Location: $webimroot/operator/index.php"); exit; @@ -78,6 +96,8 @@ $page['formhosturl'] = topage($hosturl); $page['formenableban'] = $enableban == "1"; $page['formusernamepattern'] = topage($usernamepattern); $page['formusercanchangename'] = $usercanchangename == "1"; +$page['formchatstyle'] = $chatstyle; +$page['availableStyles'] = $stylelist; start_html_output(); require('../view/settings.php'); diff --git a/src/messenger/webim/view/settings.php b/src/messenger/webim/view/settings.php index a16258ce..3806d2ee 100644 --- a/src/messenger/webim/view/settings.php +++ b/src/messenger/webim/view/settings.php @@ -86,6 +86,10 @@ + + + + />