Файл: sys/inc/main_menu.php
Строк: 73
<?php
/* DCMS S (Special)
* Версия файла 0.0.1
* Дата последнего редактирования 18.10.2015
* Модифицировал densnet
*/
$rekl = mysql_result(mysql_query("SELECT COUNT(*) FROM `rekl` WHERE `sel` = '2'"), 0);
if ($rekl > 0) {
echo "<div class = 'rekl'>";
rekl(2);
echo "</div>";
}
$q_menu = mysql_query("SELECT * FROM `menu` ORDER BY `pos` ASC");
echo "<table>";
while ($post_menu = mysql_fetch_assoc($q_menu)) {
echo "<div class = 'adm_menu'>";
if (!isset($post_menu['icon'])) {
mysql_query('ALTER TABLE `menu` ADD `icon` VARCHAR( 32 ) NULL DEFAULT NULL');
}
if (!isset($post_menu['type'])) {
mysql_query("ALTER TABLE `menu` ADD `type` ENUM('link') NOT NULL DEFAULT 'link' AFTER `id`");
}
if ($post_menu['type'] == 'include') {
if ($post_menu['include'] != NULL && is_file(H . $post_menu['include'])) {
@include H . $post_menu['include'];
}
}
if ($post_menu['type'] == 'link') {
echo "<a class = 'adm_menu_link' href='$post_menu[url]'>";
echo icons($post_menu['icon'], 'code');
} elseif ($post_menu['type'] == 'include') {
echo "<div class = 'null'>";
} else {
echo "<div class = 'comms'><center><b>";
}
echo "<div class = 'adm_menu_title'>$post_menu[name] ";
if ($post_menu['counter'] != NULL && is_file(H . $post_menu['counter'])) {
@include H . $post_menu['counter'];
}
echo "</div>";
if ($post_menu['type'] == 'link') {
echo "</a>";
} else {
echo "</b></center></div>n";
}
echo "</div>n";
}
echo "</table>";
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `menu`"), 0);
#Если нет разделов меню
if ($k_post == 0) {
echo "<div class = 'comm'>";
echo "<img style = 'vertical-align: middle;' src = '/style/icons/menu.png' /> <span style = 'vertical-align: middle;font-size: 22px;color:#D0D3D8;'>Нет разделов меню...</span>";
if (user::access('adm_menu')) {
echo "<div class = 'hr'></div>";
echo "<a href = '/adm_panel/menu.php' style = 'color:#88C057;text-transform: uppercase;'><img src = '/style/icons/plus.png'/> <b>Добавить меню</b></a>";
}
echo "</div>";
} else {
if (user::access('adm_menu')) {
echo "<div class = 'comm'>";
echo "<a href = '/adm_panel/menu.php' style = 'color:#88C057;text-transform: uppercase;'><img src = '/style/icons/plus.png'/> <b>Добавить меню</b></a>";
echo "</div>";
}
}