Пример #1
0
<?php

$attributes['order'] = empty($attributes['order']) ? "code" : $attributes['order'];
$attributes['pagesize'] = empty($attributes['pagesize']) ? $oSettingsManager->getValue("AdminTableSize", 25, "INT", "Number of elements in tables of administrator backend") : (int) $attributes['pagesize'];
if (!isset($attributes['sort'])) {
    $attributes['sort'] = "ASC";
} else {
    if (!in_array($attributes['sort'], array("ASC", "DESC"))) {
        $attributes['sort'] = "ASC";
    }
}
$attributes['asort'] = $attributes['sort'] == "ASC" ? "DESC" : "ASC";
$attributes['page'] = empty($attributes['page']) ? 1 : (int) $attributes['page'];
$oPaging = new Paging($attributes['pagesize'], $oLanguageManager->getLanguagesCount(), $attributes['page']);
$oPaging->setLinkFormat($here . "&page=%d");
$arrPageSizes = array(10, 25, 50, 100, 200);
if ($arrLanguages = $oLanguageManager->getLanguages($attributes['order'], $attributes['sort'], $oPaging->getOffSet(), $oPaging->getPageSize())) {
    _assign("arrLanguages", $arrLanguages);
    _assign("arrPages", $oPaging->getPages());
    _assign("arrPageSizes", $arrPageSizes);
}
_display("admin/dspLanguages.tpl");
Пример #2
0
<?php

$attributes['page_size'] = empty($attributes['page_size']) ? $oSettingsManager->getValue("GalleryPicutresOnPage", 12, "INT", "Number of pictures in gallery page") : intval($attributes['page_size']);
$attributes['page'] = empty($attributes['page']) ? 1 : intval($attributes['page']);
if (!empty($attributes['gallery'])) {
    if ($ogGalleryManager->checkGallery($attributes['gallery'])) {
        $arrGalleries = $ogGalleryManager->getGalleries();
        $oPaging = new Paging($attributes['page_size'], $ogGalleryManager->getImagesCount($attributes['gallery']), $attributes['page']);
        $arrImages = $ogGalleryManager->getImages($attributes['gallery'], $oPaging->getOffSet(), $oPaging->getPageSize());
        $oPaging->setLinkFormat($attributes['gallery'] . '.gallery/' . "%d");
        $intAuthorID = $ogGalleryManager->getGalleryAuthorID($attributes['gallery']);
        $intEditorID = $ogGalleryManager->getGalleryEditorID($attributes['gallery']);
        $oAuthor = false;
        $oEditor = false;
        if ($intAuthorID) {
            $oAuthor = $oUserManager->getUserByID($intAuthorID);
        }
        if ($intEditorID) {
            $oEditor = $oUserManager->getUserByID($intEditorID);
        }
        if ($oAuthor) {
            _assign('oAuthor', $oAuthor);
        }
        if ($oEditor) {
            _assign('oEditor', $oEditor);
        }
        _assign("arrPages", $oPaging->getPages());
        _assign("arrGalleries", $arrGalleries);
        _assign("arrImages", $arrImages);
        _display("home/dspGallery.tpl");
    } else {