function editPage()
 {
     global $mainframe, $option;
     $db =& JFactory::getDBO();
     $user =& JFactory::getUser();
     $cid = JRequest::getVar('cid', array(0), '', 'array');
     $option = JRequest::getCmd('option');
     $uid = (int) @$cid[0];
     $row =& JTable::getInstance('flippingpage', 'Table');
     $row->load($uid);
     $query = 'SELECT id FROM #__flippingbook_books';
     $db->setQuery($query);
     if (count($db->loadObjectList()) < 1) {
         $msg = JText::_('CREATE A BOOK FIRST');
         $link = 'index.php?option=com_flippingbook&task=book_manager';
         $mainframe->redirect($link, $msg);
         return;
     }
     $query = 'SELECT id, title FROM #__flippingbook_books ORDER BY title';
     $db->setQuery($query);
     $book_rows = $db->loadObjectList();
     $book_filter[] = JHTML::_('select.option', -1, '- ' . JText::_('Select Book') . ' -');
     foreach ($book_rows as $book_row) {
         $book_option[] = JHTML::_('select.option', $book_row->id, $book_row->title);
     }
     $lists['books'] = JHTML::_('select.genericlist', $book_option, 'book_id', 'class="inputbox" size="1"', 'value', 'text', $row->book_id);
     $lists['files'] = $this->getFilesSelectBox('file', $row->file, 0, 'jpg|jpeg|swf|JPG|JPEG|SWF', '');
     $lists['zoomed_image'] = $this->getFilesSelectBox('zoom_url', $row->zoom_url, 1, 'jpg|jpeg|swf|JPG|JPEG|SWF', 'onchange="update_fields_state();"');
     require_once JPATH_COMPONENT . DS . 'views' . DS . 'page_manager.php';
     PageManager::editPage($row, $lists);
 }