Перейти к публикации
Поиск в
  • Дополнительно...
Искать результаты, содержащие...
Искать результаты в...

spk

Новичок
  
  • Публикаций

    15
  • Зарегистрирован

  • Посещение

1 подписчик

Достижения spk

Apprentice

Apprentice (3/14)

  • Conversation Starter
  • First Post
  • Collaborator
  • Week One Done
  • One Month Later

Последние медали

0

Репутация

  1. Начал переделывать модуль под 1.4.7, но видимо не до конца разобрался. Вроде все получилось, кроме контроллеров в catalog/ (см. скрин) <?phpclass ControllerCatalogPoll extends Controller { private $error = array(); public function index() { $this->load->language('catalog/poll'); $this->document->title = $this->language->get('heading_title'); $this->load->model('catalog/poll'); $this->getList(); } public function insert() { $this->load->language('catalog/poll'); $this->document->title = $this->language->get('heading_title'); $this->load->model('catalog/poll'); if (($this->request->server['REQUEST_METHOD'] == 'POST') && ($this->validateForm())) { $this->model_catalog_poll->addPoll($this->request->post); $this->session->data['success'] = $this->language->get('text_success'); $this->redirect(HTTPS_SERVER .'index.php?route=catalog/poll' . $url); } $this->getForm(); } public function update() { $this->load->language('catalog/poll'); $this->document->title = $this->language->get('heading_title'); $this->load->model('catalog/poll'); if (($this->request->server['REQUEST_METHOD'] == 'POST') && ($this->validateForm())) { $this->model_catalog_poll->editPoll($this->request->get['poll_id'], $this->request->post); $this->session->data['success'] = $this->language->get('text_success'); $this->redirect(HTTPS_SERVER .'index.php?route=catalog/poll' . $url); } $this->getForm(); } public function delete() { $this->load->language('catalog/poll'); $this->document->title = $this->language->get('heading_title'); $this->load->model('catalog/poll'); if ((isset($this->request->post['selected'])) && ($this->validateDelete())) { foreach ($this->request->post['selected'] as $poll_id) { $this->model_catalog_poll->deletePoll($poll_id); } $this->session->data['success'] = $this->language->get('text_success'); $this->redirect(HTTPS_SERVER .'index.php?route=catalog/poll' . $url); } $this->getList(); } private function getList() { $this->document->breadcrumbs = array(); $this->document->breadcrumbs[] = array( 'href' => HTTPS_SERVER . 'index.php?route=common/home', 'text' => $this->language->get('text_home'), 'separator' => FALSE ); $this->document->breadcrumbs[] = array( 'href' => HTTPS_SERVER . 'index.php?route=catalog/poll' . $url, 'text' => $this->language->get('heading_title'), 'separator' => ' :: ' ); $this->data['insert'] = HTTPS_SERVER . 'index.php?route=catalog/poll/insert' . $url; $this->data['delete'] = HTTPS_SERVER . 'index.php?route=catalog/poll/delete' . $url; $this->data['questions'] = array(); $results = $this->model_catalog_poll->getPolls(); foreach ($results as $result) { $action = array(); $action[] = array( 'text' => $this->language->get('text_edit'), 'href' => HTTPS_SERVER . 'index.php?route=catalog/poll/update&poll_id=' . $result['poll_id'] . $url ); $this->data['questions'][] = array( 'poll_id' => $result['poll_id'], 'question' => $result['question'], 'status' => ($result['status'] ? $this->language->get('text_enabled') : $this->language->get('text_disabled')), 'active' => ($result['active'] ? $this->language->get('text_active') : $this->language->get('text_inactive')), 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])), 'selected' => isset($this->request->post['selected']) && in_array($result['poll_id'], $this->request->post['selected']), 'action' => $action ); } $this->data['heading_title'] = $this->language->get('heading_title'); $this->data['text_date_added'] = $this->language->get('text_date_added'); $this->data['text_enabled'] = $this->language->get('text_enabled'); $this->data['text_disabled'] = $this->language->get('text_disabled'); $this->data['text_no_results'] = $this->language->get('text_no_results'); $this->data['column_question'] = $this->language->get('column_question'); $this->data['column_status'] = $this->language->get('column_status'); $this->data['column_active'] = $this->language->get('column_active'); $this->data['column_date_added'] = $this->language->get('column_date_added'); $this->data['column_action'] = $this->language->get('column_action'); $this->data['button_insert'] = $this->language->get('button_insert'); $this->data['button_delete'] = $this->language->get('button_delete'); if (isset($this->error['warning'])) { $this->data['error_warning'] = $this->error['warning']; } else { $this->data['error_warning'] = ''; } if (isset($this->session->data['success'])) { $this->data['success'] = $this->session->data['success']; unset($this->session->data['success']); } else { $this->data['success'] = ''; } $this->template = 'catalog/poll_list.tpl'; $this->children = array( 'common/header', 'common/footer' ); $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression')); } private function getForm() { $this->data['heading_title'] = $this->language->get('heading_title'); $this->data['text_enabled'] = $this->language->get('text_enabled'); $this->data['text_disabled'] = $this->language->get('text_disabled'); $this->data['text_active'] = $this->language->get('text_active'); $this->data['text_inactive'] = $this->language->get('text_inactive'); $this->data['text_none'] = $this->language->get('text_none'); $this->data['text_new_poll'] = $this->language->get('text_new_poll'); $this->data['text_no_votes'] = $this->language->get('text_no_votes'); $this->data['entry_question'] = $this->language->get('entry_question'); for ($i = 1; $i <= 8; $i++) { $this->data['entry_answer_' . $i] = $this->language->get('entry_answer_' . $i); } $this->data['entry_status'] = $this->language->get('entry_status'); $this->data['entry_active'] = $this->language->get('entry_active'); $this->data['button_save'] = $this->language->get('button_save'); $this->data['button_cancel'] = $this->language->get('button_cancel'); $this->data['tab_general'] = $this->language->get('tab_general'); $this->data['tab_data'] = $this->language->get('tab_data'); $this->data['tab_results'] = $this->language->get('tab_results'); // Extract results if (isset($this->request->get['poll_id'])) { $poll_id = $this->request->get['poll_id']; $poll_data = $this->model_catalog_poll->getPollData($poll_id); $reactions = $this->model_catalog_poll->getPollResults($poll_id); $total_votes = $this->model_catalog_poll->getTotalResults($poll_id); if ($reactions) { $this->data['reactions'] = TRUE; $percent = array(0, 0, 0, 0, 0, 0, 0, 0); $totals = array(0, 0, 0, 0, 0, 0, 0, 0); foreach($reactions as $reaction) { $totals[$reaction['answer'] - 1]++; } for($i = 0; $i < 8; $i++) { $percent[$i] = round(100 * ($totals[$i]/$total_votes)); } $this->data['poll_data'] = $poll_data; $this->data['percent'] = $percent; $this->data['total_votes'] = $total_votes; $this->data['text_poll_results'] = $this->language->get('text_poll_results'); $this->data['text_percent'] = $this->language->get('text_percent'); $this->data['text_answer'] = $this->language->get('text_answer'); } } // End extraction of results if (isset($this->error['warning'])) { $this->data['error_warning'] = $this->error['warning']; } else { $this->data['error_warning'] = ''; } if (isset($this->error['question'])) { $this->data['error_question'] = $this->error['question']; } else { $this->data['error_question'] = ''; } for ($i = 1; $i <= 8; $i++) { if (isset($this->error['answer_' . $i])) { $this->data['error_answer_' . $i] = $this->error['answer_' . $i]; } else { $this->data['error_answer_' . $i] = ''; } } if (isset($this->error['active_poll'])) { $this->data['error_active_poll'] = $this->error['active_poll']; } else { $this->data['error_active_poll'] = ''; } $this->document->breadcrumbs = array(); $this->document->breadcrumbs[] = array( 'href' => HTTPS_SERVER . 'index.php?route=common/home', 'text' => $this->language->get('text_home'), 'separator' => FALSE ); $this->document->breadcrumbs[] = array( 'href' => HTTPS_SERVER . 'index.php?route=catalog/poll', 'text' => $this->language->get('heading_title'), 'separator' => ' :: ' ); if (!isset($this->request->get['poll_id'])) { $this->data['new_poll'] = TRUE; $this->data['action'] = HTTPS_SERVER .'index.php?route=catalog/poll/insert'; } else { $this->data['action'] = HTTPS_SERVER . 'index.php?route=catalog/poll/update&poll_id=' . $this->request->get['poll_id'] . $url; } $this->data['cancel'] = HTTPS_SERVER . 'index.php?route=catalog/poll' . $url; if ((isset($this->request->get['poll_id'])) && ($this->request->server['REQUEST_METHOD'] != 'POST')) { $poll_info = $this->model_catalog_poll->getPoll($this->request->get['poll_id']); } $this->load->model('localisation/language'); $this->data['languages'] = $this->model_localisation_language->getLanguages(); if (isset($this->request->post['poll_description'])) { $this->data['poll_description'] = $this->request->post['poll_description']; } elseif (isset($poll_info)) { $this->data['poll_description'] = $this->model_catalog_poll->getPollDescriptions($this->request->get['poll_id']); } else { $this->data['poll_description'] = array(); } if (isset($this->request->post['status'])) { $this->data['status'] = $this->request->post['status']; } elseif (isset($poll_info)) { $this->data['status'] = $poll_info['status']; } else { $this->data['status'] = ''; } if (isset($this->request->post['active'])) { $this->data['active'] = $this->request->post['active']; } elseif (isset($poll_info)) { $this->data['active'] = $poll_info['active']; } else { $this->data['active'] = ''; } $this->template = 'catalog/poll_form.tpl'; $this->children = array( 'common/header', 'common/footer' ); $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression')); } private function validateForm() { if (!$this->user->hasPermission('modify', 'catalog/poll')) { $this->error['warning'] = $this->language->get('error_permission'); } foreach ($this->request->post['poll_description'] as $language_id => $value) { if ((strlen(utf8_decode($value['question'])) < 2) || (strlen(utf8_decode($value['question'])) > 255)) { $this->error['question'][$language_id] = $this->language->get('error_question'); } for ($i = 1; $i <= 8; $i++) { if ((strlen(utf8_decode($value['answer_' . $i])) > 0) && ((strlen(utf8_decode($value['answer_' . $i])) < 2) || (strlen(utf8_decode($value['answer_' . $i])) > 255))) { $this->error['answer_' . $i][$language_id] = $this->language->get('error_answer'); } } if ($this->request->post['active'] == 1) { $check_active_poll = $this->model_catalog_poll->checkActivePoll(); if ($check_active_poll) { $active_poll = $this->model_catalog_poll->getActivePoll(); if ($active_poll['poll_id'] != $this->request->get['poll_id']) { $this->error['active_poll'][$language_id] = $this->language->get('error_active_poll'); } } } } if (!$this->error) { return TRUE; } else { return FALSE; } } private function validateDelete() { if (!$this->user->hasPermission('modify', 'catalog/poll')) { $this->error['warning'] = $this->language->get('error_permission'); } if (!$this->error) { return TRUE; } else { return FALSE; } }}?>
  2. Спасибо, помогло.
  3. Вот тут заметил у себя одну проблему и вроде кажется она уже у меня давно. http://shopcomputer.ru/ При наведение на кнопку искать мышка почему-то показывает выделение, а не ну короче понятно ;) И так вроде со всеми кнопками <a onclick= Кто-нибудь знает как это можно исправить?
  4. spk

    Кнопка - ссылка.

    Вот умник нашелся, те надо ты и учи.А свои идеи высказать слабо?Всем спасибо, уже решил проблему.
  5. Здравствуйте1 Я чет не могу разобраться, как в файлах .tpl кнопку-ссылку. Только ссылку в определенное место, так как эти кнопки мне нужно будет раскидать по всему движку. <a class="button1"><span><?php echo $warning2; ?></span></a> А вот как сюда ссылку примостить допустим в yandex?
  6. spk

    Русские буквы в *.tpl

    Да с контроллерами и кодировками то я пробовал уже и кстати тоже notepad++ пользуюсь. Мне другой способ интересовал, но я уже решил свою проблему.
  7. Мне необходимо вывести другую информацию на главной странице вместо последних товаров. Делать сразу в home.tpl не получится, так как он не воспринимает русские буквы. Как еще можно это сделать?
  8. а ты думаешь зря некоторые на 1.4.0 сидят !? да уж больно много недочетов в 1.4.0, чтоб из-за модулей на ней оставаться.
  9. Кто-нибудь может обновить до 1.4.7Модулей много, а половину не работает...
  10. спасибо за быстрый ответ! Вот в чем мой вопрос: Понимаете мне экспорт нужно распечатывать для учета, а там вместо полей, id_.
  11. Классный шаблон. Поскорее бы его попробовать.
  12. Смысл в том, что тот файл который он выбросил сам и не принимает. Я так понимаю импорта нормального все равно не добиться. Поэтому хочу хотя бы экспорт под себя настроить для учета.Вы ответите на мой вопрос?
  13. Он тот который экспортирует тоже не принимает. Но пока главное мне изменить, то что он выдает!
  14. Здравствуйте.Тот файл, который выводит модуль экспорта мне совсем не годится. Скажите в каком точно файле это можно поправить. И еще можете объяснить как должен выглядеть файл excel, а то какие не пробовал, вообще ничего не кушает.Спасибо.

×
×
  • Создать...

Важная информация

На нашем сайте используются файлы cookie и происходит обработка некоторых персональных данных пользователей, чтобы улучшить пользовательский интерфейс. Чтобы узнать для чего и какие персональные данные мы обрабатываем перейдите по ссылке. Если Вы нажмете «Я даю согласие», это означает, что Вы понимаете и принимаете все условия, указанные в этом Уведомлении о Конфиденциальности.