示例#1
0
 static function showSearchBooks($options, $catid, $option)
 {
     global $mainframe, $database, $my;
     global $mosConfig_shownoauth, $mosConfig_live_site, $mosConfig_absolute_path;
     global $cur_template, $Itemid;
     PHP_booklibrary::addTitleAndMetaTags();
     $currentcat = NULL;
     // Parameters
     //     $menu = new mosMenu( $database );
     //     //$menu = new JTableMenu( $database );//for 1.6
     //      $menu->load( $Itemid );
     //      $params = new mosParameters( $menu->params );
     if (version_compare(JVERSION, '3.0', 'ge')) {
         $menu = new JTableMenu($database);
         $menu->load($Itemid);
         $params = new JRegistry();
         $params->loadString($menu->params);
     } else {
         $menu = new mosMenu($database);
         $menu->load($Itemid);
         $params = new mosParameters($menu->params);
     }
     $menu_name = set_header_name_bl($menu, $Itemid);
     $params->def('header', $menu_name);
     //for 1.6
     $params->def('pageclass_sfx', '');
     //
     $params->def('show_search', '1');
     $params->def('back_button', $mainframe->getCfg('back_button'));
     $currentcat = new stdClass();
     $currentcat->descrip = _BOOKLIBRARY_SEARCH_DESC1;
     $currentcat->align = 'right';
     // page image
     $currentcat->img = $mosConfig_live_site . "/components/com_booklibrary/images/book.png";
     $currentcat->header = '';
     if (@$currentcat->name != '') {
         $currentcat->header = $currentcat->name;
     } else {
         $currentcat->header = $params->get('header');
     }
     $currentcat->header = $currentcat->header . ($currentcat->header != '' ? ": " : '') . _BOOKLIBRARY_LABEL_SEARCH;
     // used to show table rows in alternating colours
     $tabclass = array('sectiontableentry1', 'sectiontableentry2');
     $categories[] = mosHTML::makeOption('0', _BOOKLIBRARY_SEARCH_CATEGORY);
     if (count($categories) < 1) {
         mosRedirect("index.php?option=categories&section={$option}&Itemid={$Itemid}&err_msg=You must first create category for that section.");
     }
     $clist = PHP_booklibrary::categoryParentList(0, '', true, $categories);
     // show thte book
     $params->def('showsearch01', "{loadposition com_booklibrary_show_search_01}");
     $params->def('showsearch02', "{loadposition com_booklibrary_show_search_02}");
     $params->def('showsearch03', "{loadposition com_booklibrary_show_search_03}");
     $params->def('showsearch04', "{loadposition com_booklibrary_show_search_04}");
     $params->def('showsearch05', "{loadposition com_booklibrary_show_search_05}");
     HTML_booklibrary::showSearchBooks($params, $currentcat, $clist, $option);
 }