Example #1
0
 case 'index':
     $content = 'content.php';
     $categories = docs_sections::getSections();
     // Разбиваем на блоки по 4 категории в блоке
     if ($is_category = is_array($categories) && count($categories)) {
         $block = $i = 0;
         foreach ($categories as $cat) {
             $cat_blocks[$block][] = $cat;
             ++$i;
             if ($i >= 4) {
                 $i = 0;
                 ++$block;
             }
         }
     }
     $last_docs = docs::getLast(10);
     break;
 case 'section':
     $content = 'section.php';
     $section = docs_sections::getSection((int) $request['id']);
     $docs = docs::getDocs((int) $request['id']);
     break;
 case 'document':
     $content = 'document.php';
     $doc = docs::getDoc($request['id']);
     break;
 case 'search':
     $content = 'search.php';
     $text_for_search = !empty($request['text']) ? $request['text'] : false;
     if ($text_for_search) {
         $text_for_search = stripslashes($text_for_search);