00001 <?php 00002 /* 00003 This file is part of DocBookWiki. DocBookWiki is a web application 00004 that displays and edits DocBook documents. 00005 00006 Copyright (C) 2004, 2005, 2006, 2007 00007 Dashamir Hoxha, dashohoxha@users.sourceforge.net 00008 00009 DocBookWiki is free software; you can redistribute it and/or modify 00010 it under the terms of the GNU General Public License as published 00011 by the Free Software Foundation; either version 2 of the License, 00012 or (at your option) any later version. 00013 00014 DocBookWiki is distributed in the hope that it will be useful, but 00015 WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with DocBookWiki; if not, write to the Free Software 00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00022 USA 00023 */ 00024 00028 class books extends WebObject 00029 { 00030 function onRender() 00031 { 00032 //add the recordset 'books' 00033 $rs = new EditableRS("books"); 00034 $book_list = CONTENT.'books/book_list'; 00035 $books = shell("cat $book_list | cut -d: -f1 | uniq"); 00036 $arr_books = explode("\n", trim($books)); 00037 for ($i=0; $i < sizeof($arr_books); $i++) 00038 { 00039 $book_id = trim($arr_books[$i]); 00040 $rs->addRec(array('id'=>$book_id, 'title'=>$book_id)); 00041 } 00042 global $webPage; 00043 $webPage->addRecordset($rs); 00044 00045 //add variable show_books_list 00046 $show = (sizeof($arr_books) > 2 ? 'true' : 'false'); 00047 WebApp::addVar('show_books_list', $show); 00048 } 00049 } 00050 ?>