コード例 #1
0
ファイル: html.php プロジェクト: rrgarcia-tiempodev/lendr
 function render()
 {
     $app = JFactory::getApplication();
     $layout = $this->getLayout();
     $this->params = JComponentHelper::getParams('com_lendr');
     //retrieve task list from model
     $model = new LendrModelsBook();
     if ($layout == 'list') {
         $this->books = $model->listItems();
         $this->_bookListView = LendrHelpersView::load('Book', '_entry', 'phtml');
     } else {
         $this->book = $model->getItem();
         $this->_addReviewView = LendrHelpersView::load('Review', '_add', 'phtml');
         $this->_addReviewView->book = $this->book;
         $this->_addReviewView->user = JFactory::getUser();
         $this->_lendBookView = LendrHelpersView::load('Book', '_lend', 'phtml');
         $this->_lendBookView->borrower = $this->book->waitlist_user;
         $this->_lendBookView->book = $this->book;
         $this->_returnBookView = LendrHelpersView::load('Book', '_return', 'phtml');
         $this->_returnBookView->borrower = $this->book->waitlist_user;
         $this->_returnBookView->book = $this->book;
         $this->_reviewsView = LendrHelpersView::load('Review', 'list', 'phtml');
         $this->_reviewsView->reviews = $this->book->reviews;
         $this->_modalMessage = LendrHelpersView::load('Profile', '_message', 'phtml');
     }
     //display
     return parent::render();
 }
コード例 #2
0
ファイル: html.php プロジェクト: rrgarcia-tiempodev/lendr
 function render()
 {
     $app = JFactory::getApplication();
     $layout = $app->input->get('layout');
     //retrieve task list from model
     $profileModel = new LendrModelsProfile();
     $this->_modalMessage = LendrHelpersView::load('Profile', '_message', 'phtml');
     switch ($layout) {
         case "profile":
             $this->profile = $profileModel->getItem();
             $this->_addBookView = LendrHelpersView::load('Book', '_add', 'phtml');
             $this->_libraryView = LendrHelpersView::load('Library', '_library', 'phtml');
             $this->_libraryView->library = $this->profile->library;
             $this->_waitlistView = LendrHelpersView::load('Waitlist', '_waitlist', 'phtml');
             $this->_waitlistView->waitlist = $this->profile->waitlist;
             $this->_wishlistView = LendrHelpersView::load('Wishlist', '_wishlist', 'phtml');
             $this->_wishlistView->wishlist = $this->profile->wishlist;
             break;
         case "list":
         default:
             $this->profiles = $profileModel->listItems();
             $this->_profileListView = LendrHelpersView::load('Profile', '_entry', 'phtml');
             break;
     }
     //display
     return parent::render();
 }
コード例 #3
0
ファイル: phtml.php プロジェクト: rrgarcia-tiempodev/lendr
 function render()
 {
     $this->_bookListView = LendrHelpersView::load('Book', '_entry', 'phtml');
     $this->_borrowBookView = LendrHelpersView::load('Book', '_borrow', 'phtml');
     $this->_lendBookView = LendrHelpersView::load('Book', '_lend', 'phtml');
     $this->_returnBookView = LendrHelpersView::load('Book', '_return', 'phtml');
     return parent::render();
 }
コード例 #4
0
ファイル: view.php プロジェクト: rrgarcia-tiempodev/lendr
 function getHtml($view, $layout, $item, $data)
 {
     $objectView = LendrHelpersView::load($view, $layout, 'phtml');
     $objectView->{$item} = $data;
     ob_start();
     echo $objectView->render();
     $html = ob_get_contents();
     ob_clean();
     return $html;
 }
コード例 #5
0
ファイル: add.php プロジェクト: rrgarcia-tiempodev/lendr
 public function execute()
 {
     $app = JFactory::getApplication();
     $return = array("success" => false);
     $modelName = $app->input->get('model', 'Book');
     $view = $app->input->get('view', 'Book');
     $layout = $app->input->get('layout', '_entry');
     $item = $app->input->get('item', 'book');
     $modelName = 'LendrModels' . ucwords($modelName);
     $model = new $modelName();
     if ($row = $model->store()) {
         $return['success'] = true;
         $return['msg'] = JText::_('COM_LENDR_SAVE_SUCCESS');
         $return['html'] = LendrHelpersView::getHtml($view, $layout, $item, $row);
     } else {
         $return['msg'] = JText::_('COM_LENDR_SAVE_FAILURE');
     }
     echo json_encode($return);
 }
コード例 #6
0
ファイル: phtml.php プロジェクト: rrgarcia-tiempodev/lendr
 function render()
 {
     $this->_bookListView = LendrHelpersView::load('Book', '_entry', 'phtml');
     return parent::render();
 }
コード例 #7
0
ファイル: phtml.php プロジェクト: rrgarcia-tiempodev/lendr
 function render()
 {
     $this->_reviewEntryView = LendrHelpersView::load('Review', '_entry', 'phtml');
     return parent::render();
 }