public static function getParameters($lang = null) { if ($lang === null) { $lang = Resources::getCurrentLocale(); } $themes = enumAvailableThemes(); $images = self::enumAvailableImages($lang); $departments = MapperFactory::getMapper('Department')->enumDepartments(Resources::getCurrentLocale()); $departmentsParam = array(array('key' => '', 'value' => Resources::Get('page.gen.anydepartment'))); foreach ($departments as $d) { $item = array(); $item['key'] = $d['departmentkey']; $item['value'] = $d['departmentname']; $departmentsParam[] = $item; } $locales = getAvailableLocalesForChat(); $localesParam = array(array('key' => 'N', 'value' => Resources::Get('page.gen.autolocale'))); // $localesParam = array(); foreach ($locales as $l) { $item = array(); $item['key'] = $l['localeid']; $item['value'] = $l['localename']; $localesParam[] = $item; } $params = array('button' => array('name_key' => 'page.gen.choose_image', 'type' => 'list', 'values' => self::listToArray($images), 'default' => 'webim'), 'theme' => array('name_key' => 'page.gen.choose_theme', 'type' => 'list', 'values' => self::listToArray($themes), 'default' => 'default'), 'include_host_url' => array('name_key' => 'page.gen.include_site_name', 'type' => 'checkbox', 'default' => 'N'), 'secure' => array('name_key' => 'page.gen.secure_links', 'type' => 'checkbox', 'default' => 'N'), 'add_track_code' => array('name_key' => 'page.gen.include_tracker_code', 'type' => 'checkbox', 'default' => 'N'), 'choose_department' => array('name_key' => 'page.gen.choosedepartment', 'type' => 'checkbox', 'default' => 'N'), 'department_key' => array('name_key' => 'page.gen.department', 'type' => 'list', 'values' => $departmentsParam, 'default' => ''), 'choose_operator' => array('name_key' => 'page.gen.chooseoperator', 'type' => 'list', 'values' => array(array('key' => 'N', 'value' => Resources::Get('choose_operator.no')), array('key' => 'optional', 'value' => Resources::Get('choose_operator.optional')), array('key' => 'mandatory', 'value' => Resources::Get('choose_operator.mandatory'))), 'default' => 'N'), 'chat_immediately' => array('name_key' => 'page.gen.chatimmediately', 'type' => 'checkbox', 'default' => 'N'), 'locale' => array('name_key' => 'page.gen.locale', 'type' => 'list', 'values' => $localesParam, 'default' => Resources::getCurrentLocale())); return $params; }
public static function getParameters($lang = NULL) { if ($lang === NULL) { $lang = Resources::getCurrentLocale(); } $themes = enumAvailableThemes(); $images = Button::enumAvailableImages($lang); $departments = MapperFactory::getMapper("Department")->enumDepartments(Resources::getCurrentLocale()); $departmentsParam = array(array('key' => '', 'value' => Resources::Get('page.gen.anydepartment'))); foreach ($departments as $d) { $item = array(); $item['key'] = $d['departmentkey']; $item['value'] = $d['departmentname']; $departmentsParam[] = $item; } $locales = getAvailableLocalesForChat(); $localesParam = array(array('key' => 'N', 'value' => Resources::Get('page.gen.autolocale'))); // $localesParam = array(); foreach ($locales as $l) { $item = array(); $item['key'] = $l['localeid']; $item['value'] = $l['localename']; $localesParam[] = $item; } $params = array("button" => array("name_key" => 'page.gen.choose_image', "type" => "list", "values" => Button::listToArray($images), "default" => "webim"), "theme" => array("name_key" => 'page.gen.choose_theme', "type" => "list", "values" => Button::listToArray($themes), "default" => "default"), "include_host_url" => array("name_key" => 'page.gen.include_site_name', "type" => "checkbox", "default" => "N"), "secure" => array("name_key" => 'page.gen.secure_links', "type" => "checkbox", "default" => "N"), "add_track_code" => array("name_key" => 'page.gen.include_tracker_code', "type" => "checkbox", "default" => "N"), "choose_department" => array("name_key" => 'page.gen.choosedepartment', "type" => "checkbox", "default" => "N"), "department_key" => array("name_key" => 'page.gen.department', "type" => "list", "values" => $departmentsParam, "default" => ""), "choose_operator" => array("name_key" => 'page.gen.chooseoperator', "type" => "list", "values" => array(array('key' => 'N', 'value' => Resources::Get('choose_operator.no')), array('key' => 'optional', 'value' => Resources::Get('choose_operator.optional')), array('key' => 'mandatory', 'value' => Resources::Get('choose_operator.mandatory'))), "default" => "N"), "chat_immediately" => array("name_key" => 'page.gen.chatimmediately', "type" => "checkbox", "default" => "N"), "locale" => array("name_key" => 'page.gen.locale', "type" => "list", "values" => $localesParam, "default" => Resources::getCurrentLocale())); return $params; }