function theme_header($pageid, $title, $include_menu, $mode, $user_id) { global $PHP_SELF; global $HTTP_VARS; global $ADMIN_TYPE; if ($pageid == 'install') { $pageTitle = get_opendb_title_and_version() . " Installation"; } else { $pageTitle = get_opendb_title(); } echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">" . "\n<html>" . "\n<head>" . "\n<title>" . $pageTitle . (!empty($title) ? " - {$title}" : "") . "</title>" . "\n<meta http-equiv=\"Content-Type\" content=\"" . get_content_type_charset() . "\">" . "\n<link rel=\"icon\" href=\"" . theme_image_src("icon-16x16.png") . "\" type=\"image/png\" />" . "\n<link rel=\"search\" type=\"application/opensearchdescription+xml\" title=\"" . get_opendb_title() . " Title Search\" href=\"./searchplugins.php?type=title\">" . "\n<link rel=\"search\" type=\"application/opensearchdescription+xml\" title=\"" . get_opendb_title() . " UPC Search\" href=\"./searchplugins.php?type=upc\">" . get_theme_css($pageid, $mode) . get_opendb_rss_feeds_links() . get_theme_javascript($pageid) . "</head>" . "\n<body>"; echo "<div id=\"header\">"; echo "<h1><a href=\"index.php\">" . $pageTitle . "</a></h1>"; if ($include_menu) { echo "<ul class=\"headerLinks\">"; $help_page = get_opendb_help_page($pageid); if ($help_page != NULL) { echo "<li class=\"help\"><a href=\"help.php?page=" . $help_page . "\" target=\"_new\" title=\"" . get_opendb_lang_var('help') . "\">" . theme_image("help.png") . "</a></li>"; } $printable_page_url = get_printable_page_url($pageid); if ($printable_page_url != NULL) { echo "<li><a href=\"" . $printable_page_url . "\" target=\"_new\" title=\"" . get_opendb_lang_var('printable_version') . "\">" . theme_image("printable.gif") . "</a></li>"; } if (is_exists_my_reserve_basket($user_id)) { echo "<li><a href=\"borrow.php?op=my_reserve_basket\">" . theme_image("basket.png", get_opendb_lang_var('item_reserve_list')) . "</a></li>"; } if (is_user_granted_permission(PERM_VIEW_LISTINGS, NULL, TRUE)) { echo "<li><form class=\"quickSearch\" action=\"listings.php\">" . "<input type=\"hidden\" name=\"search_list\" value=\"y\">" . "<input type=\"hidden\" name=\"title_match\" value=\"partial\">" . "<input type=\"text\" class=\"text\" name=\"title\" size=\"10\" value=\"Title Search\" onfocus=\"if(this.value=='Title Search'){this.value='';this.style.color='black';}\" onblur=\"if(this.value==''){this.value='Title Search';this.style.color='gray';}\">" . "</form></li>"; } if (is_user_granted_permission(PERM_VIEW_ADVANCED_SEARCH, NULL, TRUE)) { echo "<li><a href=\"search.php\" title=\"" . get_opendb_lang_var('advanced_search') . "\">" . get_opendb_lang_var('advanced') . "</a></li>"; } if (strlen($user_id) > 0) { echo "<li class=\"login\"><a href=\"logout.php\">" . get_opendb_lang_var('logout', 'user_id', $user_id) . "</a></li>"; } else { echo "<li class=\"login\"><a href=\"login.php?op=login\">" . get_opendb_lang_var('login') . "</a></li>"; } echo "</ul>"; } echo "</div>"; echo "<div id=\"content\" class=\"{$pageid}Content\">"; if ($include_menu) { if ($pageid == 'admin') { echo "\n<div id=\"admin-menu\" class=\"menuContainer toggleContainer\" onclick=\"return toggleVisible('admin-menu');\">\r\n <span id=\"admin-menu-toggle\" class=\"menuToggle toggleHidden\">" . get_opendb_lang_var('admin_tools') . "</span>\r\n <div id=\"admin-menu-content\" class=\"menuContent elementHidden\">\r\n <h2 class=\"menu\">Admin Tools</h2>"; $menu_options_rs = get_system_admin_tools_menu(); echo get_menu_options_list($menu_options_rs); echo "\n</div>"; echo "\n</div>"; } echo "\n<div id=\"menu\" class=\"menuContainer toggleContainer\" onclick=\"return toggleVisible('menu');\">"; echo "<span id=\"menu-toggle\" class=\"menuToggle toggleHidden\">" . get_opendb_lang_var('main_menu') . "</span>"; echo "<div id=\"menu-content\" class=\"menuContent elementHidden\">"; echo "<h2 class=\"menu\">" . get_opendb_lang_var('main_menu') . '</h2>'; echo get_menu_options_list(get_menu_options($user_id)); echo "\n</div>"; echo "\n</div>"; } }
function request_http_basic_auth() { header('WWW-Authenticate: Basic realm="' . htmlspecialchars(get_opendb_title()) . '"'); header('HTTP/1.0 401 Unauthorized'); }
function get_opendb_title_and_version() { return get_opendb_title(FALSE) . " " . get_opendb_version(); }
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Reference for creating the plugin: http://developer.mozilla.org/en/docs/Creating_OpenSearch_plugins_for_Firefox http://software.hixie.ch/utilities/cgi/data/data */ // This must be first - includes config.php require_once "./include/begin.inc.php"; include_once "./lib/database.php"; include_once "./lib/auth.php"; include_once "./lib/logging.php"; include_once "./lib/http.php"; $siteUrl = get_site_url(); $siteTitle = get_opendb_title(); if ($_GET['type'] == "title") { $shortName = "{$siteTitle} Title"; $description = "OpenDb title search on " . $siteUrl; $searchUrl = $siteUrl . "listings.php?search_list=y&linked_items=include&title_match=partial&title={searchTerms}"; $searchtags = "opendb title search"; } else { if ($_GET['type'] == "upc") { $shortName = "{$siteTitle} UPC"; $description = "OpenDb UPC search on " . $siteUrl; $searchUrl = $siteUrl . "listings.php?search_list=y&attribute_type=UPC_ID&attr_match=partial&attribute_val={searchTerms}"; $searchtags = "opendb upc search"; } } header("Content-Type: text/xml"); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";