<?php
/*
=================================================================
Bullet Energy - by White-Master 
-----------------------------------------------------------------
http://white-master.ru/
-----------------------------------------------------------------
Copyright (c) 2011 White-Master
=================================================================
Данный код защищен авторскими правами
=================================================================
Файл: main_viewer.class.php
=================================================================
*/
class BulletEnergyView extends BulletEnergy
{
  public $tpl = null; //сменить на приват
  private $DIR_TPL = '';
  private $id = 0;
  private $userID = '';
  public function __construct()
  {
    if (!class_exists('dle_template')) {
      include_once (ROOT_DIR . '/engine/classes/templates.class.php');
    }
    $this->tpl = new dle_template;
    $this->tpl->dir = ROOT_DIR . '/templates/' . parent::$config_dle['skin'] . '/bullet_energy/';
    $this->DIR_TPL = parent::$config_dle['http_home_url'] . 'templates/' . parent::$config_dle['skin'] . '/bullet_energy/';
    $this->id = parent::$handler->db->safesql(parent::$handler->getInt('id'));
    $this->userID = parent::$handler->db->safesql(parent::$id_member['user_id']);
    //require_once (ENGINE_DIR . '/bullet_energy/classes/linck.class.php');
    //$this->linck = new BulletEnergyLinck(array('cpu' => parent::$modules_config['cpu'], 'home' => parent::$config_dle['http_home_url']));
    //$cl = new ReflectionClass('BulletEnergyLinck');
    //Reflection::export($cl);
    //var_dump(parent::$handler->linck);
    //:TODO: refrect conctruct
  }
  public function add_topic($data = '')
  {
    $form .= "<form onsubmit=\"if(document.new_topic.topic_name.value == '' || document.new_topic.message_new_topic.value == ''){BeAlert('<br>" . parent::$modules_lang['error_6'] . "', '" . parent::$modules_lang['information'] . "');return false}\" id = \"new_topic\" name=\"new_topic\" method=\"post\" action=''>";
    $this->tpl->load_template('add_topic.tpl');
    $this->tpl->set('{Bbcode}', $this->get_bb_message('', true, '', 'new_topic', 'message_new_topic', false));
    $this->tpl->set('{Form}', '<textarea id="message_new_topic" name="message_new_topic" onclick="setNewField(this.name,document.getElementById(\'new_topic\'))" rows="15" class="bullet_area"></textarea>');
    $this->tpl->set('{Uploader}', $this->_get_uploader($data));
    if (parent::$handler->ckeckModulesConfig('be_access_topic_new_private')) {
      $this->tpl->set('[paramPrivateTopic]', '');
      $this->tpl->set('[/paramPrivateTopic]', '');
    } else {
      $this->tpl->set_block("'\\[paramPrivateTopic\\](.*?)\\[/paramPrivateTopic\\]'si", '');
    }
    $this->tpl->copy_template = $form . $this->tpl->copy_template . '<input name="action" value="add_topic" type="hidden"/></form>';
    $this->tpl->compile('add_topic');
    return $this->tpl->result['add_topic'];
  }
  private function _get_uploader($data = '')
  {
    if (parent::$handler->ckeckModulesConfig('be_upload_img') or parent::$handler->ckeckModulesConfig('be_upload')) {
      if (parent::$handler->ckeckModulesConfig('be_upload')) {
        $ext .= parent::$modules_config['upload_file_type'];
      }
      if (parent::$handler->ckeckModulesConfig('be_upload_img')) {
        $ext .= ', gif, jpg, png, jpe, jpeg';
      }
      if ($data) {
        $isData = '';
      } else {
        $isData = 'style="display:none"';
      }
      return '<div id="upload_file_block"><div class="InnertMainBoxUpload"><div class="bottom_upload"><div class="innert_buttm"><input id="file_upload" name="file_upload" type="file" /><span class="access_upload"><ul><li><strong>' . parent::$modules_lang['upload_0'] . '</strong>:' . $ext . '</li><li><strong>' . parent::$modules_lang['upload_1'] . '</strong>: ' . parent::$handler->formatsize(parent::$modules_config['upload_max_size'] * 1024) . '</li></ul></span></div></div><ol ' . $isData . ' id="block_files">' . $data . '</ol></div></div>';
    } else {
      return false;
    }
  }
  public function error_set($title = '', $data = '', $meta = array())
  {
    if ($meta) {
      parent::$meta['title'] = $meta[0];
    } elseif (!$meta) {
      parent::$meta['title'] = parent::$modules_lang['error_3'];
    }
    $this->tpl->load_template('info.tpl');
    $this->tpl->set('{title}', $title);
    $this->tpl->set('{error}', $data);
    $this->tpl->compile('info');
    return $this->tpl->result['info'];
  }
  public function setTplAttachmentList($data = array())
  {
    /*Function is modified 04.07.2011 RC 0.1*/
    $option = array('insert' => '', 'name' => '', 'description' => '', 'idFile' => '', 'img' => array());
    if ($data['fileType'] == 0) {
      $file = parent::$config_dle['http_home_url'] . "uploads/forum/images/" . $data['fileDateUpload'] . "/{$data['fileName']}";
      if (file_exists(ROOT_DIR . '/uploads/forum/images/' . $data['fileDateUpload'] . '/thumbs/' . $data['fileName'])) {
        $option['img'][] = "<a class=\"mini_img\" href=\"javascript:;MiniImg('{$file}')\">" . parent::$modules_lang['attachment_5'] . "</a>";
      }
      if (file_exists(ROOT_DIR . '/uploads/forum/images/' . $data['fileDateUpload'] . '/' . $data['fileName']) and parent::$modules_config['images_prev_insert']) {
        $option['img'][] = "<a class=\"ful_img\" href=\"javascript:;FullImg('{$file}')\">" . parent::$modules_lang['attachment_6'] . "</a>";
      }
      if (!file_exists(ROOT_DIR . '/uploads/forum/images/' . $data['fileDateUpload'] . '/thumbs/' . $data['fileName'])) {
        $option['img'][] = "<a class=\"ful_img\" href=\"javascript:;FullImg('{$file}')\">" . parent::$modules_lang['attachment_6'] . "</a>";
      }
      $option['insert'] = implode(' - ', $option['img']);
      $option['description'] = '<li class="descrip_file">' . parent::$modules_lang['attachment_7'] . ':</li>';
      $option['name'] = '<a class="name_file" target="_blank" href = "' . $file . '">' . $data['fileNameSiteView'] . '</a>';
    } else {
      $option['insert'] = parent::$modules_lang['attachment_8'];
      $option['name'] = $data['fileNameSiteView'];
    }
    return '<li class="file" id="' . $data['fileDbId'] . '"><div class="BoxInnertList"><span class="' . $data['fileExtensions'] . ' icon">ICO</span>
    <ol class="file_info"><li>' . $option['name'] . '</li>' . $option['description'] . '<li>' . $option['insert'] . '</li></ol><a href ="#" onclick = "DelAttach(\'' . $data['fileDbId'] . '\',\'' . parent::$hash_login . '\'); return false;" class = "delbutton">' . parent::$modules_lang['attachment_9'] . '</a></div></li>';
  }
  /**
   * BulletEnergyView::setTplReplyFull()
   * Метод компиляции шаблона полного ответа в теме.
   * @param mixed $data - массив входных параметров.
   * @param mixed $data[id_parent] - Идентификатор узла в котором находится тема.
   * @param mixed $data[title] - Заголовок темы.
   * @param mixed $data[id] - Идентификатор темы.
   * @param mixed $data[data] - Данные которые ввел пользователь в форме быстрого ответа.
   * @return void
   */
  public function setTplReplyFull($data = array())
  {
    //var_dump($data);
    $this->tpl->load_template('add_message_full.tpl');
    $this->tpl->set('{editor}', $this->get_bb_message($data['data'], true, '', 'message_add_form', 'message_reply', true));
    $this->tpl->set('{Uploader}', $this->_get_uploader($data['attachment']));
    if (parent::$groups_config[parent::$id_member['user_group']]['be_captha_status']) {
      $this->tpl->set('{captha}', '');
    } else {
      if (parent::$modules_config['captha_type']) {
        $this->tpl->set('{captha}', '<div id="recaptchaForumBlock"> </div><script type="text/javascript" src="http://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script><script language="javascript"type="text/javascript">$(function(){Recaptcha.create("' . parent::$modules_config['republic'] . '","recaptchaForumBlock",{theme:"clean",lang:"' . parent::$modules_lang['recapthaLang'] . '"});});</script>');
      } else {
        $question = parent::$question[array_rand(parent::$question)];
        $this->tpl->set('{captha}', '<dl><dt>' . parent::$modules_lang['msg_15'] . $question['question'] . '</dt><dd><input name="question" id="question" type="text" onfocus="if(this.value==\'Введите ответ...\') this.value=\'\';" onblur="if(this.value==\'\') this.value=\'Введите ответ...\';" value="Введите ответ..." autocomplete="off"></dd><input type="hidden" name="question_sec" value="' . $question['id'] . '"></dl>');
      }
    }
    $data['error'] = count($data['error']) ? $data['error'] : '';
    $this->tpl->copy_template = $data['error'] . "<form  method=\"post\" name=\"message_add_form\" id=\"message_add_form\" action=\"\">" . $this->tpl->copy_template . "
		<input type=\"hidden\" name=\"topict_id\" id=\"topict_id\" value=\"$data[id]\" /><input type=\"hidden\" name=\"action\"  value=\"add_message\"/></form>";
    $this->tpl->compile('add_message_full');
    return $this->tpl->result['add_message_full'];
  }
  /**
   * BulletEnergyView::static_view()
   * Метод вывода статического шаблона.
   * @param string $title - Заголовок  в теле шаблона.
   * @param string $data - Выводимая информация.
   * @return
   */
  public function static_view($title = '', $data = '')
  {
    $this->tpl->load_template('static.tpl');
    $this->tpl->set('{description}', $title);
    $this->tpl->set('{static}', $data);
    $this->tpl->compile('static');
    return $this->tpl->result['static'];
  }
  public function add_message($data = array())
  {
    $this->tpl->load_template('add_message.tpl');
    $this->tpl->set('{editor}', $this->get_bb_message('', false, 'onkeypress="submitKey(event);"', 'message_add_form', 'message_reply', true));
    if (parent::$groups_config[parent::$id_member['user_group']]['be_captha_status']) {
      $this->tpl->set('{captha}', '');
    } else {
      if (parent::$modules_config['captha_type']) {
        $this->tpl->set('{captha}', '<div id="recaptchaForumBlock"> </div><script type="text/javascript" src="http://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script><script language="javascript"type="text/javascript">$(function(){Recaptcha.create("' . parent::$modules_config['republic'] . '","recaptchaForumBlock",{theme:"clean",lang:"' . parent::$modules_lang['recapthaLang'] . '"});});</script>');
      } else {
        $question = parent::$question[array_rand(parent::$question)];
        $this->tpl->set('{captha}', '<dl><dt>' . parent::$modules_lang['msg_15'] . $question['question'] . '</dt><dd><input name="question" id="question" type="text" onfocus="if(this.value==\'Введите ответ...\') this.value=\'\';" onblur="if(this.value==\'\') this.value=\'Введите ответ...\';" value="Введите ответ..." /></dd><input type="hidden" name="question_sec" value="' . $question['id'] . '" /></dl>');
      }
    }
    if (parent::$id_member['foto']) {
      $this->tpl->set('{foto}', parent::$config_dle['http_home_url'] . 'uploads/fotos/' . parent::$id_member['foto']);
    } else {
      $this->tpl->set('{foto}', parent::$config_dle['http_home_url'] . 'templates/' . parent::$config_dle['skin'] . '/bullet_energy/images/noavatar.png');
    }
    $this->tpl->copy_template = "<form  method=\"post\" name=\"message_add_form\" id=\"message_add_form\" action=\"\">" . $this->tpl->copy_template . "<input type=\"hidden\" name=\"topict_id\" id=\"topict_id\" value=\"$data[0]\" /><input type=\"hidden\" name=\"action\"  value=\"add_message\"/></form>";
    $this->tpl->compile('add_message');
    return $this->tpl->result['add_message'];
  }
  public function get_bb_message($data = '', $fullMode = false, $keySubmit = '', $formName = '', $selFiled = '', $form = false)
  {
    $option = array();
    if ($fullMode) {
      $option['fullBB'] = '<li class="b_code"><span title="' . $lang['bbTitl_18'] . '" onclick="simpletag(\'code\')" id="b_code"></span></li><li class="separator"></li><li><span title="' . $lang['bbTitl_16'] . '" onclick="tag_list(\'ol\')" id="b_ol"></span></li><li><span title="' . $lang['bbTitl_17'] . '" onclick="tag_list(\'list\')" id="b_list"></span></li><li class="separator"></li><li class="b_youtube"><span title="' . $lang['bbTitl_15'] . '" onclick="tag_youtube()" id="b_youtube"></span></li><li class="b_tag_video"><span title="' . $lang['bbTitl_20'] . '" onclick="tag_video()" id="b_tag_video"></span></li><li class="b_tag_audio"><span title="' . $lang['bbTitl_19'] . '" onclick="tag_audio()" id="b_tag_audio"></span></li><li title="' . $lang['bbTitl_21'] . '" class="color_swith"><div id="colorSelector">&nbsp;<div></div></div></li>';
    }
    if ($form) {
      $option['form'] = '<textarea rows="9" ' . $keySubmit . ' onclick="setNewField(this.name,document.getElementById(\'' . $formName . '\'))" class="addMsgForm" cols="" name="' . $selFiled . '" id="' . $selFiled . '">' . $data . '</textarea>';
    }
    $i = 0;
    $smiles = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr>";
    $smilies = explode(",", parent::$config_dle['smilies']);
    foreach ($smilies as $smile) {
      $i++;
      $smile = trim($smile);
      $smiles .= "<td style=\"padding:2px;\" align=\"center\"><a href=\"javascript:;\" onclick=\"dle_smiley(':$smile:'); return false;\"><img style=\"border: none;\" alt=\"$smile\" src=\"" . parent::$config_dle['http_home_url'] . "engine/data/emoticons/$smile.gif\" /></a></td>";
      if ($i % 4 == 0)
        $smiles .= "</tr><tr>";
    }
    $smiles .= "</tr></table>";
    $lang = parent::$modules_lang;
    if (parent::$group_user[parent::$id_member['user_group']]['allow_url']) {
      $option['url'] = '<li><span title="' . $lang['bbTitl_10'] . '" onclick="tag_url()" id="b_tag_url"></span></li><li><span title="' . $lang['bbTitl_11'] . '" onclick="tag_leech()" id="b_tag_leech"></span></li>';
    }
    if (parent::$group_user[parent::$id_member['user_group']]['allow_image']) {
      $option['images'] = '<li><span title="' . $lang['bbTitl_12'] . '" onclick="tag_image()" id="b_img"></span></li>';
    }
    $ret = '<div class="form_add_comment"><script type="text/javascript"language="javascript">var selField="message_reply";var fombj=document.forms[\'' . $formName . '\'];</script><div class="bbcode_bullet"><ol class="bbcode_forum"><li><span title="' . $lang['bbTitl_2'] . '" onclick="simpletag(\'b\')" id="b_b"></span></li><li><span title="' . $lang['bbTitl_3'] . '" onclick="simpletag(\'i\')" id="b_i"></span></li><li><span title="' . $lang['bbTitl_4'] . '" onclick="simpletag(\'u\')" id="b_u"></span></li><li><span title="' . $lang['bbTitl_5'] . '" onclick="simpletag(\'s\')" id="b_s"></span></li> <li class="separator"></li><li><span title="' . $lang['bbTitl_7'] . '" onclick="simpletag(\'left\')" id="b_left"></span></li><li><span title="' . $lang['bbTitl_8'] . '" onclick="simpletag(\'center\')" id="b_center"></span></li><li><span title="' . $lang['bbTitl_9'] . '" onclick="simpletag(\'right\')" id="b_right"></span></li><li class="separator"></li><li><span title="' . $lang['bbTitl_6'] . '" onclick="ins_emo(this);" id="b_emo"></span></li>' . $option['url'] . $option['images'] . '<li class="separator"></li><li class="b_hide"><span title="' . $lang['bbTitl_13'] . '" onclick="simpletag(\'hide\')" id="b_hide"></span></li><li><span title="' . $lang['bbTitl_14'] . '" onclick="simpletag(\'quote\')" id="b_quote"></span></li><li><span title="' . $lang['bbTitl_1'] . '" onclick="simpletag(\'spoiler\')" id="b_spoiler"></span></li>' . $option['fullBB'] . '</ol><div id="bullet_energy_emo" style="display: none;"><div style="overflow: auto;">' . $smiles . '</div></div></div><textarea class="forum_textarea" name="post_text" id="post_text"></textarea>' . $option['form'] . '</div>';
    return $ret;
  }
  /**
   * BulletEnergyView::sub_cat_view()
   * Метод вывода подкатегорий форума внутри родительской категории.
   * @param mixed $data - Массив дочерних узлов.
   * @param integer $mainCatId - Идентификатор родетельского узла.
   * @return
   */
  public function setTplchildTree($data = array(), $mainCatId = 0)
  {
    //11.07.2011
    foreach ($data as $category) {
      //var_dump(parent::$tree[$category] );
      $this->tpl->load_template('short_category.tpl');
      $last = unserialize(parent::$tree[$category]['tree_last_info']);
      $typeCat = intval(parent::$tree[$category]['tree_type']);
      if (parent::$tree[$category]['tree_last_info']) {
        $this->tpl->set('{lastAutorAvatarLinck}', $last[4]);
        $this->tpl->set('{lastAutorName}', $last[0]);
        $this->tpl->set('{lastTopicName}', $last[2]);
        $this->tpl->set('{lastTopicLinck}', $last[3]);
        $this->tpl->set('[popupUserCard]', parent::$handler->linck->card_user(array($last[0], $last[5])));
        $this->tpl->set('[/popupUserCard]', '</a>');
        $this->tpl->set('{lastMessageDate}', parent::$handler->langdate(parent::$modules_config['time_step_last_message_cat'], $last[1]));
        $this->tpl->set('[LastMessage]', '');
        $this->tpl->set('[/LastMessage]', '');
      } else {
        $this->tpl->set_block("'\\[LastMessage\\](.*?)\\[/LastMessage\\]'si", $info_last);
      }
      $this->tpl->set('{nameTree}', stripslashes(parent::$tree[$category]['tree_title']));
      $this->tpl->set('{description}', stripslashes(parent::$tree[$category]['tree_description']));
      if (parent::$tree[$category]['tree_type'] == '2') {
        $this->tpl->set('[linckTree]', '<a href="' . parent::$tree[$category]['tree_type_sub'] . '">');
        $this->tpl->set_block("'\\[blockInfo\\](.*?)\\[/blockInfo\\]'si", "");
      } else {
        $this->tpl->set('[linckTree]', parent::$handler->linck->cat_linck(parent::$tree[$category]['tree_id']));
        $this->tpl->set('[blockInfo]', '');
        $this->tpl->set('[/blockInfo]', '');
      }
      $this->tpl->set('[/linckTree]', '</a>');
      $this->tpl->set('{topic}', parent::$tree[$category]['tree_topic']);
      $this->tpl->set('{message}', parent::$tree[$category]['tree_answer']);
      $this->tpl->set('{treeId}', parent::$tree[$category]['tree_id']);
      if (parent::$tree[$category]['read'] and $typeCat != 2 and parent::$logged_is) {
        $this->tpl->set('{status}', 'unread');
        $this->tpl->set('{statusTitl}', parent::$modules_lang['tree_6']);
      }
      if (!parent::$tree[$category]['read'] and $typeCat != 2 and parent::$logged_is) {
        $this->tpl->set('{status}', 'read');
        $this->tpl->set('{statusTitl}', parent::$modules_lang['tree_7']);
      }
      if (!parent::$logged_is) {
        $this->tpl->set('{status}', 'unread');
        $this->tpl->set('{statusTitl}', parent::$modules_lang['tree_6']);
      }
      if (!parent::$tree[$category]['read'] and $typeCat == 2) {
        $this->tpl->set('{status}', 'linck');
        $this->tpl->set('{statusTitl}', parent::$modules_lang['tree_8']);
      }
      $this->tpl->compile('short_category');
    }
    $this->tpl->load_template('block_category.tpl');
    $this->tpl->set('{description}', '');
    $this->tpl->set('{nameTree}', parent::$modules_lang['tree_1'] . stripslashes(parent::$tree[$mainCatId]['tree_title']));
    $this->tpl->set('{idTree}', parent::$tree[$mainCatId]['tree_id']);
    $this->tpl->set('{contentTree}', $this->tpl->result['short_category']);
    $this->tpl->set('[linckTree]', parent::$handler->linck->cat_linck(parent::$tree[$mainCatId]['tree_id']));
    $this->tpl->set('[/linckTree]', '</a>');
    $this->tpl->compile('block_category');
    return $this->tpl->result['block_category'];
  }
  /**
   * BulletEnergyView::list_tree_tpl()
   * Вывод дерева узлов главной страницы форума.
   * @return
   */
  public function setListTreeMainPage($tree = array())
  {
    //11.07.2011
    foreach ($tree as $category) {
      $typeCat = intval($category['tree_type']);
      $status = '';
      if ($category['tree_parent_id'] > '0' and $category['tree_approve'] == '1') {
        $this->tpl->load_template('short_category.tpl');
        $last = unserialize($category['tree_last_info']);
        if ($category['tree_last_info']) {
          $this->tpl->set('{lastAutorAvatarLinck}', $last[4]);
          $this->tpl->set('{lastAutorName}', $last[0]);
          $this->tpl->set('{lastTopicName}', $last[2]);
          $this->tpl->set('{lastTopicLinck}', $last[3]);
          $this->tpl->set('[popupUserCard]', parent::$handler->linck->card_user(array($last[0], $last[5])));
          $this->tpl->set('[/popupUserCard]', '</a>');
          $this->tpl->set('{lastMessageDate}', parent::$handler->langdate(parent::$modules_config['time_step_last_message_cat'], $last[1]));
          $this->tpl->set('[LastMessage]', '');
          $this->tpl->set('[/LastMessage]', '');
        } else {
          $this->tpl->set_block("'\\[LastMessage\\](.*?)\\[/LastMessage\\]'si", '');
        }
        $this->tpl->set('{nameTree}', stripslashes($category['tree_title']));
        $this->tpl->set('{description}', stripslashes($category['tree_description']));
        if ($typeCat == 2) {
          $this->tpl->set('[linckTree]', '<a href="' . $category['tree_type_sub'] . '">');
          $this->tpl->set_block("'\\[blockInfo\\](.*?)\\[/blockInfo\\]'si", "");
          $this->tpl->set('{rssTree}', '');
        } else {
          $this->tpl->set('[linckTree]', parent::$handler->linck->cat_linck($category['tree_id']));
          $this->tpl->set('[blockInfo]', '');
          $this->tpl->set('[/blockInfo]', '');
        }
        $this->tpl->set('[/linckTree]', '</a>');
        $this->tpl->set('{topic}', $category['tree_topic']);
        $this->tpl->set('{message}', $category['tree_answer']);
        $this->tpl->set('{treeId}', $category['tree_id']);
        if ($category['read'] and $typeCat != 2 and parent::$logged_is) {
          $this->tpl->set('{status}', 'unread');
          $this->tpl->set('{statusTitl}', parent::$modules_lang['tree_6']);
        }
        if (!$category['read'] and $typeCat != 2 and parent::$logged_is) {
          $this->tpl->set('{status}', 'read');
          $this->tpl->set('{statusTitl}', parent::$modules_lang['tree_7']);
        }
        if (!parent::$logged_is) {
          $this->tpl->set('{status}', 'unread');
          $this->tpl->set('{statusTitl}', parent::$modules_lang['tree_6']);
        }
        if (!$category['read'] and $typeCat == 2) {
          $this->tpl->set('{status}', 'linck');
          $this->tpl->set('{statusTitl}', parent::$modules_lang['tree_8']);
        }
        $this->tpl->compile('short_category_' . $category['tree_parent_id']);
      }
      continue;
    }
    foreach ($tree as $category) {
      $status = '';
      if (intval($category['tree_parent_id']) == 0 and intval($category['tree_approve']) == 1) {
        $this->tpl->load_template('block_category.tpl');
        $this->tpl->set('{description}', stripcslashes($category['tree_description']));
        $this->tpl->set('{nameTree}', stripslashes($category['tree_title']));
        $this->tpl->set('{treeId}', $category['tree_id']);
        $this->tpl->set('[linckTree]', parent::$handler->linck->cat_linck($category['tree_id']));
        $this->tpl->set('[/linckTree]', '</a>');
        $this->tpl->set('{contentTree}', $this->tpl->result['short_category_' . $category['tree_id']]);
        $this->tpl->compile('block_category');
      }
      continue;
    }
    return $this->tpl->result['block_category'];
  }
  /**
   * BulletEnergyView::setTplPaginator()
   * Метод установки шаблона пагинатора.
   * @param string $prev_linck = Ссыла (-и) на преведущую страницу.
   * @param string $next_linck = Ссыла (-и) на следущую страницу.
   * @param string $rek_page   = Текущая страница.
   * @return
   */
  public function setTplPaginator($prev_linck = '', $next_linck = '', $rek_page = '')
  {
    //:TODO: - Рассмотреть передачу через массив.
    //11.07.2011
    $this->tpl->load_template('navigation.tpl');
    if ($prev_linck) {
      $this->tpl->set('[prevLink]', '<li title="' . parent::$modules_lang['paginator_2'] . '" class="prevLink"><a href="' . $prev_linck . '">');
      $this->tpl->set('[/prevLink]', '</a></li>');
    } else {
      $this->tpl->set_block("'\\[prevLink\\](.*?)\\[/prevLink\\]'si", "");
    }
    if ($next_linck) {
      $this->tpl->set('[nextLink]', '<li title="' . parent::$modules_lang['paginator_1'] . '" class="nextLink"><a href="' . $next_linck . '">');
      $this->tpl->set('[/nextLink]', '</a></li>');
    } else {
      $this->tpl->set_block("'\\[nextLink\\](.*?)\\[/nextLink\\]'si", "");
    }
    $this->tpl->set('{pages}', $rek_page);
    $this->tpl->compile('navigation');
    return $this->tpl->result['navigation'];
  }
  /**
   * BulletEnergyView::setBlockTopic()
   * Метод компиляции основного блока вокруг списка тем.
   * @param mixed $data - Входной массив данных на вывод.
   * @param mixed $data[topicList]  = Список тем для вывода либо информационное сообщение.
   * @param mixed $data[titlAction] = Заголовок (Заголовок категории либо заголовок раздела Новых тем)
   * @param mixed $data[treeDescr]  = Описание узла.
   * @param mixed $data[paginator]  = Пагинатор если есть.
   * @return
   */
  public function setBlockTopic($data = array())
  {
    //11.07.2011
    $this->tpl->load_template('block_topic.tpl');
    $this->tpl->set('{listTopic}', $data['topicList']);
    if ($data['paginator']) {
      $this->tpl->set('{navigation}', $data['paginator']);
      $this->tpl->set('[navigation]', '');
      $this->tpl->set('[/navigation]', '');
    } else {
      $this->tpl->set('{navigation}', '');
      $this->tpl->set_block("'\\[navigation\\](.*?)\\[/navigation\\]'si", "");
    }
    $this->tpl->set('{treeDescription}', $data['treeDescr']);
    $this->tpl->set('{treeName}', $data['titlAction']);
    if (parent::$action == 'categories') {
      $this->tpl->set('[linckTreeName]', parent::$handler->linck->cat_linck($this->id) /*:TODO:*/ );
      $this->tpl->set('[/linckTreeName]', '</a>');
      if (parent::$logged_is) {
        $this->tpl->set('{treeOption}', '<a onclick="ReadTree(\'' . $this->id . '\'); return false;" href="#" class="optionTree">' . parent::$modules_lang['tree_7'] . '</a>');
      } else {
        $this->tpl->set('{treeOption}', '');
      }
      $this->tpl->set('{infoTitl}', parent::$tree[$this->id]['tree_info_titl']);
      $this->tpl->set('{infoText}', parent::$tree[$this->id]['tree_info_text']);
      $this->tpl->set('[/infoBox]', '');
      $this->tpl->set('[infoBox]', '');
    } else {
      $this->tpl->set_block("'\\[infoBox\\](.*?)\\[/infoBox\\]'si", "");
      $this->tpl->set('[linckTreeName]', '');
      $this->tpl->set('[/linckTreeName]', '');
      $this->tpl->set('{treeOption}', '');
    }
    $this->tpl->compile('block_topic');
    return $this->tpl->result['block_topic'];
  }
  public function messge_topic($data = array())
  {
    //var_dump($data['like']);
    $edit = '';
    $option = array();
    if ($data['isOnline'] and parent::$modules_config['online']) {
      $this->tpl->set('{isOnline}', parent::$modules_lang['msg_32']);
      $this->tpl->set('{isOnlineCss}', 'online');
    } elseif (!$data['isOnline'] and parent::$modules_config['online']) {
      $this->tpl->set('{isOnline}', parent::$modules_lang['msg_33']);
      $this->tpl->set('{isOnlineCss}', 'offline');
    } else {
      $this->tpl->set('{isOnline}', '');
      $this->tpl->set('{isOnlineCss}', '');
    }
    $this->tpl->load_template('short_message.tpl');
    $this->tpl->set('{messageAutorIp}', $data['message_autor_ip']);
    $this->tpl->set('[popupUserCard]', parent::$handler->linck->card_user(array($data['message_autor'], $data['autors_id'])));
    $this->tpl->set('[/popupUserCard]', '</a>');
    $this->tpl->set('{autorName}', $data['message_autor']);
    $this->tpl->set('[/profile]', '</a>');
    $this->tpl->set('[profile]', parent::$handler->linck->linckUserSiteProfile($data['message_autor']));
    $this->tpl->set('[/profile]', '</a>');
    $this->tpl->set('{messageId}', $data['mesage_id']);
    $this->tpl->set('{messageLinck}', '<a class="getMessageLinck" onclick="getMessageLinck(\'' . $data['mesage_id'] . '\'); return false;" title="' . parent::$modules_lang['msg_13'] . '" href="' . parent::$handler->linck->postLinck($this->id, $data['mesage_id']) . '">#' . $data['id_msg_topic'] . '</a>');
    $this->tpl->set('{userGroup}', $data['user_group']);
    $this->tpl->set('{newsNum}', $data['news_num']);
    $this->tpl->set('{commNum}', $data['comm_num']);
    $this->tpl->set('{cssName}', $data['css_name']);
    $this->tpl->set('{like}', $data['like']);
    $this->tpl->set('{cssGroup}', $data['css_group']);
    $this->tpl->set('{regDate}', $data['reg_date']);
    $this->tpl->set('{foto}', $data['foto']);
    $this->tpl->set('{signature}', $data['signature']);
    if (parent::$modules_config['reputations']) {
      if ($data['repa_off'] == 0) {
        $option['repa'] = explode('|', $data['repa_mod']);
        if (parent::$modules_config['reputations_type'] == 1) {
          $option['view'] = "(<font color=green><b>" . $option['repa'][0] . "</b></font><b>|</b><font color=red><b>" . $option['repa'][1] . "</b></font>)";
        } elseif (parent::$modules_config['reputations_type'] == 2) {
          $option['view'] = "(<font color=green><b>" . $option['repa'][0] . "</b></font><b>|<b>" . $data['repa'] . "</b>|</b><font color=red><b>" . $option['repa'][1] . "</b></font>)";
        } else {
          $option['view'] = $data['repa'];
        }
        $this->tpl->set('{reputation}', parent::$handler->linck->reputationPermaLinck($data['message_autor'], 'plus') . parent::$handler->linck->reputationPermaLinck($data['message_autor'], 'user', $option['view']) . parent::$handler->linck->reputationPermaLinck($data['message_autor'], 'minus'));
      } else {
        $this->tpl->set('{reputation}', 'Выкл.');
      }
    }
    if (trim($data['signature'])) {
      $this->tpl->set('[signatureBox]', '');
      $this->tpl->set('[/signatureBox]', '');
    } else {
      $this->tpl->set_block("'\\[signatureBox\\](.*?)\\[/signatureBox\\]'si", "");
    }
    $this->tpl->set('{icq}', $data['icq']);
    $this->tpl->set('{forumPostNum}', $data['forum_post_count']);
    $this->tpl->set('{forumTopicNum}', $data['forum_topic_count']);
    //
    if ($data['deleteMessage']) {
      $this->tpl->set('[deleteMsg]', "<a href=\"javascript:DeleteMsg('{$data['mesage_id']}','" . parent::$hash_login . "')\" class=\"edit top\">");
      $this->tpl->set('[/deleteMsg]', '</a>');
    } else {
      $this->tpl->set_block("'\\[deleteMsg\\](.*?)\\[/deleteMsg\\]'si", "");
    }
    if ($data['editCommentAccess']) {
      $this->tpl->set('[msgEdit]', "<a href=\"javascript:;\" onclick=\"MsgEdit('{$data['mesage_id']}','" . parent::$hash_login . "'); return false;\" class=\"edit top\">");
      $this->tpl->set('[/msgEdit]', '</a>');
    } else {
      $this->tpl->set_block("'\\[msgEdit\\](.*?)\\[/msgEdit\\]'si", "");
    }
    if ($data['fast']) {
      $this->tpl->set('[fast]', "<a onmouseover=\"copy_fast_insert('" . str_replace(array(" ", "&#039;"), array("&nbsp;", "&amp;#039;"), $data['message_autor']) . "');\" href=\"javascript:;\" onclick=\"fast_insert('" . str_replace(array(" ", "&#039;"), array("&nbsp;", "&amp;#039;"), $data['message_autor']) . "'); return false;\">");
      $this->tpl->set('[/fast]', "</a>");
    } else {
      $this->tpl->set_block("'\\[fast\\](.*?)\\[/fast\\]'si", "");
    }
    if ($data['complaint']) {
      $this->tpl->set('[complaint]', "<a class=\"ComplaintMessageLinck\" href=\"javascript:PostComplaint('{$data['mesage_id']}')\">");
      $this->tpl->set('[/complaint]', '</a>');
    } else {
      $this->tpl->set_block("'\\[complaint\\](.*?)\\[/complaint\\]'si", "");
    }
    $this->tpl->set('{messageDate}', $data['message_date']);
    if ($data['msg_edit_date']) {
      $edit = '<p class="EditMsgView">' . parent::$modules_lang['msg_12'] . $data['edit_autor'] . ' ' . date('d.m.Y в H:i', $data['msg_edit_date']) . '</p>';
    }
    if (parent::$groups_config[parent::$id_member['user_group']]['be_access_hide']) {
      $data['message_text'] = str_ireplace("[hide]", "", str_ireplace("[/hide]", "", $data['message_text']));
    } else {
      $data['message_text'] = preg_replace("#\[hide\](.+?)\[/hide\]#ims", "<div class=\"HideNo\">" . parent::$modules_lang['msg_11'] . "</div>", $data['message_text']);
    }
    $this->tpl->set('{messageText}', '<div id="MsgTextBox-' . $data['mesage_id'] . '">' . $data['message_text'] . $edit . '</div>'); //
    $this->tpl->compile('short_message');
  }
  public function setTplMessageSearchUser($data = array())
  {
    $edit = '';
    $this->tpl->load_template('other_topic_post.tpl');
    $this->tpl->set('[profile]', parent::$handler->linck->linckUserSiteProfile($data['message_autor']));
    $this->tpl->set('[/profile]', '</a>');
    $this->tpl->set('{foto}', $data['foto']);
    $this->tpl->set('[popupUserCard]', parent::$handler->linck->card_user(array($data['message_autor'], $data['autors_id'])));
    $this->tpl->set('[/popupUserCard]', '</a>');
    $this->tpl->set('{titleTopic}', $data['title']);
    $this->tpl->set('[linckTopic]', parent::$handler->linck->topic_linck($data['id']));
    $this->tpl->set('[/linckTopic]', '</a>');
    $this->tpl->set('{nameTree}', $data['titlTree']);
    $this->tpl->set('[linckTree]', parent::$handler->linck->cat_linck($data['idTree']));
    $this->tpl->set('[/linckTree]', '</a>');
    $this->tpl->set('{messageAuthor}', $data['message_autor']);
    $this->tpl->set_block("'\\[topic\\](.*?)\\[/topic\\]'si", "");
    $this->tpl->set('[msg]', '');
    $this->tpl->set('[/msg]', '');
    $this->tpl->set('{messageDate}', $data['message_date']);
    if ($data['msg_edit_date']) {
      $edit = '<p class="EditMsgView">' . parent::$modules_lang['msg_12'] . $data['edit_autor'] . ' ' . date('d.m.Y в H:i', $data['msg_edit_date']) . '</p>';
    }
    if (parent::$groups_config[parent::$id_member['user_group']]['be_access_hide']) {
      $data['message_text'] = str_ireplace("[hide]", "", str_ireplace("[/hide]", "", $data['message_text']));
    } else {
      $data['message_text'] = preg_replace("#\[hide\](.+?)\[/hide\]#ims", "<div class=\"HideNo\">" . parent::$modules_lang['msg_11'] . "</div>", $data['message_text']);
    }
    $this->tpl->set('{messageText}', $data['message_text'] . $edit); //
    $this->tpl->compile('short_message');
  }
  public function setTplMessageModeration($data = array())
  {
  }
  public function topic_search_user($data = array())
  {
    $edit = '';
    $this->tpl->load_template('other_topic_post.tpl');
    $this->tpl->set('{foto}', $data['foto']);
    $this->tpl->set('[popupUserCard]', parent::$handler->linck->card_user(array($data['message_autor'], $data['autors_id'])));
    $this->tpl->set('[/popupUserCard]', '</a>');
    $this->tpl->set('{titleTopic}', $data['title']);
    $this->tpl->set('[linckTopic]', parent::$handler->linck->topic_linck($data['id']));
    $this->tpl->set('[/linckTopic]', '</a>');
    $this->tpl->set('{nameTree}', $data['titlTree']);
    $this->tpl->set('{replyCount}', $data['reply_count']);
    $this->tpl->set('[linckTree]', parent::$handler->linck->cat_linck($data['idTree']));
    $this->tpl->set('[/linckTree]', '</a>');
    $this->tpl->set_block("'\\[msg\\](.*?)\\[/msg\\]'si", "");
    $this->tpl->set('[topic]', '');
    $this->tpl->set('[/topic]', '');
    $this->tpl->set('{messageAuthor}', $data['message_autor']);
    $this->tpl->set('[profile]', parent::$handler->linck->linckUserSiteProfile($data['message_autor']));
    $this->tpl->set('[/profile]', '</a>');
    $this->tpl->set('{messageDate}', $data['message_date']);
    if ($data['msg_edit_date']) {
      $edit = '<p class="EditMsgView">' . parent::$modules_lang['msg_12'] . $data['edit_autor'] . ' ' . date('d.m.Y в H:i', $data['msg_edit_date']) . '</p>';
    }
    if (parent::$groups_config[parent::$id_member['user_group']]['be_access_hide']) {
      $data['message_text'] = str_ireplace("[hide]", "", str_ireplace("[/hide]", "", $data['message_text']));
    } else {
      $data['message_text'] = preg_replace("#\[hide\](.+?)\[/hide\]#ims", "<div class=\"HideNo\">" . parent::$modules_lang['msg_11'] . "</div>", $data['message_text']);
    }
    $this->tpl->set('{messageText}', $data['message_text'] . $edit); //
    $this->tpl->compile('short_message');
  }
  public function setTplViewFullTopic($data = array())
  {
    //var_dump($data['topicName']);
    $this->tpl->load_template('block_full_topic.tpl');
    $this->tpl->set('{message_list}', $data['message'] . '<li id="addNewMsg"></li>');
    $this->tpl->set('{navigation}', $data['paginator']);
    $this->tpl->set('{topicName}', $data['topicName']);
    $this->tpl->set('{topicOption}', $data['optionSel']);
    $this->tpl->set('{topicDescription}', $data['topicDescrSite']);
    $this->tpl->compile('block_full_topic');
    return $this->tpl->result['block_full_topic'] . $data['replic'];
  }
  public function setTopicList($data = array())
  {
    $this->tpl->load_template('short_topic.tpl');
    $this->tpl->set('{id}', $data['id']);
    $this->tpl->set('{title}', $data['title']);
    $this->tpl->set('{replyCount}', $data['reply_count']);
    $this->tpl->set('{viewCount}', $data['view_count']);
    $this->tpl->set('{description}', $data['site_description']);
    $this->tpl->set('{topicPostDate}', parent::$handler->langdate(parent::$modules_config['time_step_topic_new'], $data['post_date']));
    $this->tpl->set('{autor}', parent::$handler->linck->user_linck($data['autor']));
    $this->tpl->set('[linck]', parent::$handler->linck->topic_linck($data['id']));
    $this->tpl->set('[/linck]', '</a>');
    $this->tpl->set('{edit}', $data['editButton']);
    $this->tpl->set('{icon}', $data['icon']);
    if ($data['last']) {
      $this->tpl->set('{lastAutorAvatarLinck}', $data['last'][4] ? parent::$config_dle['http_home_url'] . 'uploads/fotos/' . $data['last'][4] : parent::$config_dle['http_home_url'] . 'templates/' . parent::$config_dle['skin'] . '/bullet_energy/images/noavatar.png');
      $this->tpl->set('{lastAutorName}', $data['last'][0]);
      $this->tpl->set('{lastTopicName}', htmlspecialchars($data['last'][2]));
      $this->tpl->set('[lastMessageLinck]', '<a href="' . $data['last'][3] . '">');
      $this->tpl->set('[/lastMessageLinck]', '</a>');
      $this->tpl->set('[popupUserCard]', parent::$handler->linck->card_user(array($data['last'][0], $data['last'][5])));
      $this->tpl->set('[/popupUserCard]', '</a>');
      $this->tpl->set('{lastMessageDate}', parent::$handler->langdate(parent::$modules_config['time_step_last_message_cat'], $data['last'][1]));
      $this->tpl->set('[LastMessage]', '');
      $this->tpl->set('[/LastMessage]', '');
      $this->tpl->set('[profile]', parent::$handler->linck->linckUserSiteProfile($data['last'][0]));
      $this->tpl->set('[/profile]', '</a>');
    } else {
      $this->tpl->set_block("'\\[LastMessage\\](.*?)\\[/LastMessage\\]'si", "");//:TODO: is topic wtf last post?
    }
    $this->tpl->set('{status}', $data['status_read']);
    $this->tpl->set('{statusTitl}', $data['statusTitl']);
    return $this->tpl->compile('short_topic');
  }
  public function setTplMainBlock($data = '', $meta = array(), $option = array())
  {
    parent::$meta['title'] = stripslashes($meta[0]);
    parent::$meta['description'] = stripslashes($meta[1]);
    parent::$meta['keywords'] = stripslashes($meta[2]);
    $speedbar = $this->setSpeedbar(array('noVisible' => $option['spedbarVisible'], 'titlAction' => $option['spedbar']['titlAction'], 'titlTree' => $option['spedbar']['titlTree'], 'idTree' => $option['spedbar']['idTree'], 'topicId' => $option['spedbar']['topicId']));
    $navigate = $this->set_navigate();
    $this->tpl->load_template('main_forum.tpl');
    $this->tpl->set('{content_forum}', $data);
    $this->tpl->set('{speedbar}', $speedbar);
    $this->tpl->set('{navigate_forum}', $navigate);
    $buttom_block = parent::$handler->set_buttom(array('id' => $option['spedbar']['idTree']));
    if ($buttom_block) {
      $this->tpl->set('{buttom}', $buttom_block);
      $this->tpl->set('[buttom]', '');
      $this->tpl->set('[/buttom]', '');
    } else {
      $this->tpl->set_block("'\\[buttom\\](.*?)\\[/buttom\\]'si", "");
    }
    $this->tpl->set('{widgetOnline}', $option['widget']['online']);
    $this->tpl->set('{widgetMessage}', $option['widget']['message']);
    $this->tpl->compile('main_forum');
    return '<div id="bullet_energy">' . $this->tpl->result['main_forum'] . '</div>';
  }
  /**
   * BulletEnergyView::set_navigate()
   * Метод установки блока навигации на форуме (Главная, форум, помощь)
   * @return
   */
  public function set_navigate()
  {
    //11.07.2011
    if (trim(parent::$modules_config['url_site']) != "") {
      $main .= '<li><a href="' . parent::$modules_config['url_site'] . '">' . parent::$modules_lang['main'] . '</a></li>';
    }
    if (!parent::$logged_is and intval(parent::$modules_config['reg_linck_5']) == 1) {
      $main .= '<li><a href="' . parent::$config_dle['http_home_url'] . 'index.php?do=register">' . parent::$modules_lang['register'] . '</a></li>';
    }
    $main .= '<li><a href="' . parent::$handler->linck->linckMainPageForum() . '">' . parent::$modules_lang['forum'] . '</a></li>';
    if (parent::$logged_is) {
      $main .= '<li><a href="' . parent::$handler->linck->sub_navigate_linck('new_post') . '">' . parent::$modules_lang['what_new'] . '</a></li>';
      $main .= '<li><a href="' . parent::$handler->linck->watchedLinck() . '">' . parent::$modules_lang['topicVis'] . '</a></li>';
    }
    if (parent::$moderator[parent::$id_member['user_id']]) {
      $main .= '<li><a href="' . parent::$handler->linck->linckModeration() . '">' . parent::$modules_lang['moderation'] . '</a></li>';
    }
    /*if (parent::$groups_config[parent::$id_member['user_group']]['be_access_search']) {
    $main .= '<li><a href="' . parent::$handler->linck->sub_navigate_linck('search') . '">' . parent::$modules_lang['search_post'] . '</a></li>';
    }*/
    return '<ul class="main_menu">' . $main . '</ul>';
  }
  private function getPosotionUserTree($option = 0, $marker = false)
  {
    //11.07.2011
    $marker = $marker ? array('a' => 'class="no_linck"', 'li' => 'class="last"') : array('linck' => 'href="' . parent::$handler->linck->treeLinck($option) . '"');
    $treeId = parent::$treePermanent[$option]['tree_parent_id'];
    $treeInfo = parent::$treePermanent;
    $list = "<li {$marker['li']}><a {$marker['a']} {$marker['linck']}>{$treeInfo[$option]['tree_title']}</a><span class=\"arrow\"><span></span></span></li>";
    while ($treeId) {
      $list = '<li>' . parent::$handler->linck->cat_linck($treeId) . "{$treeInfo[$treeId]['tree_title']}</a><span class=\"arrow\"><span></span></span></li>" . $list;
      $treeId = $treeInfo[$treeId]['tree_parent_id'];
      if ($treeInfo[$treeId]['tree_parent_id'] == 0 and $treeInfo[$treeId]['tree_type'] != 0) {
        break;
      }
    }
    return $list;
  }
  //$quick_nav = '<li class="FastNav"><a class="ButtonFastNav" title="' . parent::$modules_lang['qick_nav'] . '" href="javascript:;GetQuikNav()">&nbsp;</a></li>';
  public function setSpeedbar($data = array())
  {
    //11.07.2011
    $speedbar = '<li class="home"><a title="' . parent::$modules_lang['go_site'] . '" href="' . parent::$modules_config['url_site'] . '">' . parent::$modules_lang['main'] . '</a><span class="arrow"><span></span></span></li>';
    $speedbar .= parent::$action == 'main' ? '<li class="last"><a class="no_linck" title="' . parent::$modules_lang['go_forum'] . '">' . parent::$modules_lang['forum'] . parent::$modules_config['speedbar_titl'] . '</a><span class="arrow"><span></span></span></li>' : '<li><a title="' . parent::$modules_lang['go_forum'] . '" href="' . parent::$handler->linck->linckMainPageForum() . '">' . parent::$modules_lang['forum'] . ' ' . parent::$modules_config['speedbar_titl'] . '</a><span class="arrow"><span></span></span></li>';
    switch (parent::$action) {
      case 'categories':
        $speedbar .= $this->getPosotionUserTree($this->id, true);
        break;
      case 'showtopic':
        $speedbar .= $this->getPosotionUserTree($data['idTree'], false) . '<li class="last"><a class="no_linck">' . $data['titlAction'] . '</a><span class="arrow"><span></span></span></li>';
        break;
      case 'new_post':
        $speedbar .= '<li class="last"><a class="no_linck">' . parent::$modules_lang['what_new'] . '</a><span class="arrow"><span></span></span></li>';
        break;
      case 'newtopic':
        $speedbar .= $this->getPosotionUserTree($this->id) . '<li class="last"><a class="no_linck">' . parent::$modules_lang['topic_new_0'] . '</a><span class="arrow"><span></span></span></li>';
        break;
      case 'message_user':
        $speedbar .= '<li class="last"><a class="no_linck">' . $data['titlAction'] . '</a><span class="arrow"><span></span></span></li>';
        break;
      case 'topic_user':
        $speedbar .= '<li class="last"><a class="no_linck">' . $data['titlAction'] . '</a><span class="arrow"><span></span></span></li>';
        break;
      case 'add_message':
        $speedbar .= $this->getPosotionUserTree($data['idTree']) . '<li>' . parent::$handler->linck->topic_linck($data['topicId']) . $data['titlAction'] . '</a><span class="arrow"><span></span></span></li><li class="last"><a class="no_linck">' . parent::$modules_lang['topic_40'] . '</a><span class="arrow"><span></span></span></li>';
        break;
      case 'findpost':
        $speedbar .= '<li class="last"><a class="no_linck">' . $data['titlAction'] . '</a><span class="arrow"><span></span></span></li>';
        break;
      case 'moderation':
        $speedbar .= '<li class="last"><a class="no_linck">' . $data['titlAction'] . '</a><span class="arrow"><span></span></span></li>';
      case 'watched':
        $speedbar .= '<li class="last"><a class="no_linck">' . parent::$modules_lang['topicVis'] . '</a><span class="arrow"><span></span></span></li>';
        break;
    }
    $this->tpl->load_template('speedbar.tpl');
    $this->tpl->set('{speedbar}', '<ul>' . $speedbar . '</ul>');
    $this->tpl->compile('speedbar');
    return $this->tpl->result['speedbar'];
  }
}

?>