Exemple #1
0
     $art_add_link = '<a href="' . $context->getUrl(['function' => 'add_art', 'artstart' => $artstart]) . '"' . rex::getAccesskey(rex_i18n::msg('article_add'), 'add_2') . '><i class="rex-icon rex-icon-add-article"></i></a>';
 }
 // ---------- COUNT DATA
 $sql = rex_sql::factory();
 // $sql->setDebug();
 $sql->setQuery('SELECT COUNT(*) as artCount
             FROM
                 ' . rex::getTablePrefix() . 'article
             WHERE
                 ((parent_id=' . $category_id . ' AND startarticle=0) OR (id=' . $category_id . ' AND startarticle=1))
                 AND clang_id=' . $clang . '
             ORDER BY
                 priority, name');
 // --------------------- ADD PAGINATION
 $artPager = new rex_pager(30, 'artstart');
 $artPager->setRowCount($sql->getValue('artCount'));
 $artFragment = new rex_fragment();
 $artFragment->setVar('urlprovider', $context);
 $artFragment->setVar('pager', $artPager);
 echo $artFragment->parse('core/navigations/pagination.php');
 // ---------- READ DATA
 $sql->setQuery('SELECT *
             FROM
                 ' . rex::getTablePrefix() . 'article
             WHERE
                 ((parent_id=' . $category_id . ' AND startarticle=0) OR (id=' . $category_id . ' AND startarticle=1))
                 AND clang_id=' . $clang . '
             ORDER BY
                 priority, name
             LIMIT ' . $artPager->getCursor() . ',' . $artPager->getRowsPerPage());
 // ---------- INLINE THE EDIT/ADD FORM