$tpl['stat']['users'] = $user_class->countAll(); $tpl['stat']['items'] = $shopcoins_class->countAll(); $tpl['stat']['news'] = $news_class->countAll(); //кладем в кеш металлы и состояния, чтобы работать с ними по id if(!$tpl['metalls'] = $cache->load("metalls")) { $_metalls = $shopcoins_class->getMetalList(); $tpl['metalls'][0]=''; foreach ($_metalls as $row){ $tpl['metalls'][$row['id']] = $row['name']; } $cache->save($tpl['metalls'], "metalls"); } if(!$tpl['conditions'] = $cache->load("conditions")) { $_condition = $shopcoins_class->getConditions(true); $tpl['conditions'][0]=''; foreach ($_condition as $row){ $tpl['conditions'][$row['condition_id']] = $row['name']; } $cache->save($tpl['conditions'], "conditions"); } require $cfg['path'] . '/controllers/topmenu.ctl.php'; $dir = $cfg['path'] . '/controllers/'.$tpl['module'].'/'; if( is_dir($dir)){ if($tpl['task']&&file_exists($dir.$tpl['task'].'.ctl.php')){ $controller = $dir.$tpl['task'].'.ctl.php'; } else {