productTypes = $options['productTypes']; $this->urlBase = isset($options['urlBase']) ? $options['urlBase'] : ''; } public function setUrlBase($base) { $this->urlBase = $base; } public function render($bEcho = true) { $str = ''; $str.= ""; // Display the Column Headers foreach (App::Get()->settings['browser_pt_search_met'] as $metKey) { $str .= ""; } if (isset(App::Get()->settings['browser_pt_hidden_search_met'])) { foreach (App::Get()->settings['browser_pt_hidden_search_met'] as $metKey) { $str .= ""; } } $str .= ""; // Display the Data foreach ($this->productTypes as $ptKey => $ptMetadata) { if (isset(App::Get()->settings['browser_product_type_ignores']) && in_array($ptKey,App::Get()->settings['browser_product_type_ignores'])) { continue; } $str .= ""; foreach (App::Get()->settings['browser_pt_search_met'] as $metKey) { if ($metKey == App::Get()->settings['browser_pt_search_linkkey']) { $str .= ""; } else { if (count($ptMetadata[$metKey]) > 1) { $str .= ""; } else { $str .= ""; } } } if (isset(App::Get()->settings['browser_pt_hidden_search_met'])) { foreach (App::Get()->settings['browser_pt_hidden_search_met'] as $metKey) { if (count($ptMetadata[$metKey]) > 1) { $str .= ""; } else { $str .= ""; } } } $str .= "\r\n"; } $str .= "
".ucwords($metKey)."{$metKey}
urlBase}/products/{$ptKey}\">{$ptMetadata[$metKey][0]}"; if(count($ptMetadata[$metKey]) == 2){ $str .= " ({$ptMetadata[$metKey][1]})"; } $str .= "" . implode(", ", $ptMetadata[$metKey]) . "{$ptMetadata[$metKey][0]}" . implode(", ", $ptMetadata[$metKey]) . "{$ptMetadata[$metKey][0]}
"; $str .= "
"; if ($bEcho) { echo $str; } else { return $str; } } }