function init() { if (!empty(App::$primary->config['site']['domain'])) { $domain = App::$primary->config['site']['domain']; } else { $domain = implode('.', array_slice(explode('.', idn_to_utf8(INJI_DOMAIN_NAME)), -2)); } $alias = str_replace($domain, '', idn_to_utf8(INJI_DOMAIN_NAME)); $city = null; if ($alias) { $alias = str_replace('.', '', $alias); $city = Geography\City::get($alias, 'alias'); } if (!$city) { $city = Geography\City::get(1, 'default'); } Geography\City::$cur = $city; }
var city = $('.citySelect .form-control').val(); if (changerData[group] && changerData[group][city]) { data = changerData[group][city]; } CKEDITOR.instances[instance].setData(data, function () { CKEDITOR.instances[instance].updateElement(); }); } </script> <div class="form-group newGroup" style="display: none;"> <label>Код группы</label> <input class="form-control" data-skip=1 /> </div> <div class="form-group citySelect"> <label>Город</label> <select class ="form-control" onchange="changeCitySelect(this);"> <option value = 0>Выберите город</option> <?php foreach (Geography\City::getList() as $city) { echo "<option value = '{$city->id}'>{$city->name}</option>"; } ?> </select> </div> <div class="form-group"> <textarea class="htmleditor"></textarea> </div> <?php }]]];