1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92:
<?php
class ContentMenu extends Menu
{
const CONTENT_MENU__CLASS = 'ContentMenu';
public $content = '';
public $display_title = true;
public function __construct($title)
{
parent::__construct($title);
}
public function display()
{
$filters = $this->get_filters();
$is_displayed = empty($filters) || $filters[0]->get_pattern() == '/';
foreach ($filters as $key => $filter)
{
if ($filter->get_pattern() != '/' && $filter->match())
{
$is_displayed = true;
break;
}
}
if ($is_displayed)
{
$tpl = new FileTemplate('framework/menus/content.tpl');
$tpl->put_all(array(
'C_DISPLAY_TITLE' => $this->display_title,
'C_VERTICAL_BLOCK' => ($this->get_block() == Menu::BLOCK_POSITION__LEFT || $this->get_block() == Menu::BLOCK_POSITION__RIGHT),
'ID' => $this->id,
'TITLE' => $this->title,
'CONTENT' => FormatingHelper::second_parse(TextHelper::htmlspecialchars_decode($this->content)),
'C_HIDDEN_WITH_SMALL_SCREENS' => $this->hidden_with_small_screens
));
return $tpl->render();
}
return '';
}
public function set_display_title($display_title) { $this->display_title = $display_title; }
public function set_content($content) { $this->content = FormatingHelper::strparse($content, array(), false); }
public function get_display_title() { return $this->display_title; }
public function get_content() { return $this->content; }
}
?>