/** * отображаем весь список материалов */ function indexAction() { if (isset($_POST['status'])) { $_SESSION['status'] = $_POST['status']; } if (isset($_POST['id_parent']) and $_POST['id_parent'] > 0) { $limit = 1000; } else { // get limit // всего в каталоге $_total_gallery = dbh::gallery_get_total_count(); $limit = pager::pager_limit($_total_gallery, ADMIN_GALLERY_AT_PAGE); } // строим запрос $_sql = 'SELECT * FROM ' . $this->tablename . ' where id>0 ' . general::get_status_for_filter($this->tablename) . ' ' . general::get_for_filter($this->tablename, 'id_parent') . ' order by sort limit ' . $limit; // выполняем запрос + при необходимости выводим сам запрос $result = mysql::query($_sql, 0); // выбираем фотоальбомы $_sql = 'SELECT * FROM gallery_grupa where status=1 and id_parent=0 order by pole'; $gallery_grupa = mysql::query($_sql, 0); return system::show_tpl(array('result' => $result, 'msg' => $this->msg, '_status' => isset($_POST['status']) ? $_POST['status'] : 2, 'gallery_grupa' => $gallery_grupa, 'tpl_folder' => $this->tpl_folder, '_total_gallery' => $_total_gallery), $this->tpl_folder . '/index.php'); }