Example #1
0
         //@header('HTTP/1.1 404 Not Found');
     }
     return;
 } elseif (isset($_GET['show'])) {
     if (!$res) {
         header("HTTP/1.0 404 Not Found");
         return;
     } else {
         $src = $dir . $res['file'];
         $text = Rubrics::article($src);
         echo $text;
         return;
     }
 } elseif (isset($_GET['gallery'])) {
     $src = Rubrics::find($dir, $id);
     $info = Rubrics::info($src);
     $ans['info'] = $info;
     return Ans::ret($ans);
 } elseif (isset($_GET['load'])) {
     if (!$res) {
         //@header("Status: 404 Not Found");
         //@header("HTTP/1.0 404 Not Found");
         @header('location: ' . View::getPath() . '?' . $type . '/' . $id);
         //Просто редирект на страницу со списокм всех файлов
     } else {
         //echo View::getPath().$dir.$res['file'];
         //exit;
         @header('location: ' . View::getPath() . $dir . $res['file']);
     }
     exit;
 } else {
Example #2
0
            if (!$group['path']) {
                $ans['breadcrumbs'][] = array('href' => 'producers', 'title' => 'Производители');
            }
        }
    }
    Catalog::sort($ans['list'], $md);
    //Numbers
    $pages = ceil(sizeof($ans['list']) / $md['count']);
    if ($pages < $page) {
        $page = $pages;
    }
    $ans['numbers'] = Catalog::numbers($page, $pages, 11);
    $ans['list'] = array_slice($ans['list'], ($page - 1) * $md['count'], $md['count']);
    //Text
    $src = Rubrics::find($conf['dir'] . 'articles/', $ans['title']);
    if ($src) {
        $ans['textinfo'] = Rubrics::info($src);
        $ans['text'] = Load::loadTEXT('-doc/get.php?src=' . $src);
        //Изменение текста не отражается как изменение каталога, должно быть вне кэша
    }
    foreach ($ans['list'] as $k => $pos) {
        $pos = Catalog::getPos($pos);
        $group = Catalog::getGroup($pos['group']);
        $pos['descr'] = $group['descr'];
        unset($pos['texts']);
        unset($pos['files']);
        $ans['list'][$k] = $pos;
    }
    return $ans;
}, $args, $re);
return Ans::ret($ans);
Example #3
0
                return;
            }
            //Скрытый файл Word
            if (!is_file(Path::theme($dir) . $file)) {
                return;
            }
            $fd = Load::nameinfo($file);
            if (!in_array($fd['ext'], array('docx', 'html', 'tpl'))) {
                return;
            }
            $list[] = Rubrics::info(Path::toutf($dir . $file));
        }, scandir(Path::theme($dir)));
        Load::sort($list);
        return $list;
    }, array($dir));
    $list = array_slice($list, $start, $count);
    $ans['list'] = $list;
} else {
    if ($type == 'page') {
        if ($type == 'page') {
            $id = Ans::GET('id');
        }
        if (!$id) {
            return Ans::err($ans, 'Для type=page необходимо указать id страницы');
        }
        $src = Rubrics::find($dir, $id);
        $ans['info'] = Rubrics::info($src);
        $ans['text'] = Rubrics::article($src);
    }
}
return Ans::ret($ans);