Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Nikote

Newbie
  
  • Posts

    1
  • Joined

  • Last visited

About Nikote

  • Birthday 06/09/1994

Information

  • Gender
    Мужчина
  • City:
    Москва

Recent Profile Visitors

975 profile views

Nikote's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Простите, что к вам обращаюсь! Помогите кто чем может, пожалуйста! :)) :cry: При оформлении страницы появилась острая необходимость изменить формат переключателя языка страницы. Обычно он в виде флажков. Можно вместо них ссылки сделать и нажимать на слова - это все работает.... :geek: НО. :evil: Мне нужно оформить это дело в виде SELECTа с OPTIONами. Проблема в том, что после таких манипуляций с темплейтом, переключение языка не происходит. Вроде начинается какая-то деятельность, запросы отправляются, что-то передается, но на одном из if-ов в контроллере срабатывает редирект на главную, какая она была. И вот хоть убей, но не могу понять в чем проблема, какой из параметров не долетает, раз условия так срабатывают. :? Привожу исходник контроллера language.php (для модуля language) <?php class ControllerModuleLanguage extends Controller { protected function index() { if (isset($this->request->post['language_code'])) { $this->session->data['language'] = $this->request->post['language_code']; if (isset($this->request->post['redirect'])) { $this->redirect($this->request->post['redirect']); } else { $this->redirect($this->url->link('common/home')); } } $this->language->load('module/language'); $this->data['text_language'] = $this->language->get('text_language'); if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) { $connection = 'SSL'; } else { $connection = 'NONSSL'; } $this->data['action'] = $this->url->link('module/language', '', $connection); $this->data['language_code'] = $this->session->data['language']; $this->load->model('localisation/language'); $this->data['languages'] = array(); $results = $this->model_localisation_language->getLanguages(); foreach ($results as $result) { if ($result['status']) { $this->data['languages'][] = array( 'name' => $result['name'], 'code' => $result['code'], 'image' => $result['image'] ); } } if (!isset($this->request->get['route'])) { $this->data['redirect'] = $this->url->link('common/home'); } else { $data = $this->request->get; unset($data['_route_']); $route = $data['route']; unset($data['route']); $url = ''; if ($data) { $url = '&' . urldecode(http_build_query($data, '', '&')); } $this->data['redirect'] = $this->url->link($route, $url, $connection); } if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/language.tpl')) { $this->template = $this->config->get('config_template') . '/template/module/language.tpl'; } else { $this->template = 'default/template/module/language.tpl'; } $this->render(); } } ?> а здесь темплейт этого модуля language.tpl, исправленный мной под нужды <?php if (count($languages) > 1) { ?> <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data"> <div id="language"> <select onchange="$('input[name=\'language_code\']').attr('value', '<?php echo $language['code']; ?>'); $(this).parent().parent().submit();"> <?php foreach ($languages as $language) { ?> <option><?php echo $language['name']; ?></option> <?php } ?> </select> <input type="hidden" name="language_code" value="" /> <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" /> </div> </form> <?php } ?> На всякий случай привожу неизмененный исходник темплейта: <?php if (count($languages) > 1) { ?> <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data"> <div id="language"><?php echo $text_language; ?> <?php foreach ($languages as $language) { ?> <img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" title="<?php echo $language['name']; ?>" onclick="$('input[name=\'language_code\']').attr('value', '<?php echo $language['code']; ?>'); $(this).parent().parent().submit();" /> <?php } ?> <input type="hidden" name="language_code" value="" /> <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" /> </div> </form> <?php } ?> Помогите, кто чем может. Спасибо. Версия 1.5.5.1.2 :-) :-) :-)
×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.