Ejemplo n.º 1
0
 static function showLendRequest($option, $bid)
 {
     global $mainframe, $database, $my, $Itemid, $acl;
     global $booklibrary_configuration, $mosConfig_live_site;
     PHP_booklibrary::addTitleAndMetaTags();
     if (!isset($my->id)) {
         //for 1.6
         $my->id = 0;
     }
     if (!$GLOBALS['lendstatus_show'] || !checkAccessBL($GLOBALS['lendrequest_registrationlevel'], 'RECURSE', userGID_BL($my->id), $acl)) {
         echo _BOOKLIBRARY_NOT_AUTHORIZED;
         return;
     }
     $bids = implode(',', $bid);
     // getting all books for this category
     /// Maybe   IN (" .  $bids . ")  needs to be removed with LIKE construction
     $query = "SELECT * FROM #__booklibrary" . "\nWHERE id IN (" . $bids . ")" . "\nORDER BY ordering";
     $database->setQuery($query);
     $books = $database->loadObjectList();
     $currentcat = NULL;
     // Parameters
     //$menu = new mosMenu( $database );
     //$menu = new JTableMenu( $database ); // for 1.6 - JTableMenu
     //      $menu->load( $Itemid );
     //      $params = new mosParameters( $menu->params );
     if (version_compare(JVERSION, '3.0', 'lt')) {
         $menu = new JTableMenu($database);
         // for 1.6
         $menu->load($Itemid);
         $params = new mosParameters($menu->params);
     } else {
         $menu = new JTableMenu($database);
         $menu->load($Itemid);
         $params = new JRegistry();
         $params->loadString($menu->params);
     }
     $menu_name = set_header_name_bl($menu, $Itemid);
     $params->def('header', _BOOKLIBRARY_DESC_TITLE);
     $params->def('header', $menu_name);
     // for 1.6
     $params->def('pageclass_sfx', '');
     $params->def('show_lendstatus', 1);
     $params->def('show_lendrequest', 1);
     $params->def('lend_save', 1);
     $params->def('back_button', $mainframe->getCfg('back_button'));
     // page description
     $currentcat = new stdClass();
     $currentcat->descrip = _BOOKLIBRARY_DESC_LEND;
     // page image
     $currentcat->img = $mosConfig_live_site . '/components/com_booklibrary/images/book.png';
     $currentcat->align = 'right';
     $currentcat->header = '';
     if (@$currentcat->name != '') {
         $currentcat->header = $currentcat->name;
     } else {
         $currentcat->header = $params->get('header');
     }
     // used to show table rows in alternating colours
     $tabclass = array('sectiontableentry1', 'sectiontableentry2');
     $sort_arr['flag'] = 0;
     HTML_booklibrary::showLendRequest($books, $currentcat, $params, $tabclass, $catid, $sub_categories, false, $sort_arr);
 }