Example #1
0
 function launch()
 {
     global $interface;
     global $configArray;
     global $library;
     global $locationSingleton;
     global $timer;
     global $user;
     $currentPage = isset($_GET['page']) ? intval($_GET['page']) : 1;
     //Pagination
     $pag = new Pagination();
     $pag->setPagination($currentPage, 30);
     //Most Popular
     $listAPI = new ListAPI();
     $listTitlesFE = $listAPI->getListTitles('freeEbooks', $pag);
     $interface->assign('LIST', !empty($listTitlesFE['titles']) ? $listTitlesFE['titles'] : "");
     $pag->setPagination($currentPage + 1, 30);
     $moreTitles = $listAPI->getListTitles('freeEbooks', $pag);
     if (!empty($moreTitles['titles'])) {
         $interface->assign('NEXTPAGE', $currentPage + 1);
         $interface->assign('ACTION', "FreeEbooks");
     }
     $interface->assign('ButtonBack', true);
     $interface->assign('ButtonHome', true);
     $interface->caching = 0;
     $cacheId = 'homepage|' . $interface->lang;
     //Disable Home page caching for now.
     if (!$interface->is_cached('layout.tpl', $cacheId)) {
         $interface->setPageTitle('Free eBooks');
         $interface->assign('MobileTitle', 'Free eBooks');
         $interface->setTemplate('listecontents.tpl');
     }
     $interface->display('layout.tpl', $cacheId);
 }