static function getObjectStructure() { $structure = array('id' => array('property' => 'id', 'type' => 'label', 'label' => 'Id', 'description' => 'The unique id of this association'), 'weight' => array('property' => 'weight', 'type' => 'integer', 'label' => 'Weight', 'description' => 'The sort order of the book store', 'default' => 0), 'facetName' => array('property' => 'facetName', 'type' => 'enum', 'label' => 'Facet', 'values' => LibraryFacetSetting::getAvailableFacets(), 'description' => 'The facet to include'), 'displayName' => array('property' => 'displayName', 'type' => 'text', 'label' => 'Display Name', 'description' => 'The full name of the facet for display to the user'), 'numEntriesToShowByDefault' => array('property' => 'numEntriesToShowByDefault', 'type' => 'integer', 'label' => 'Num Entries', 'description' => 'The number of values to show by default.', 'default' => '5'), 'showAsDropDown' => array('property' => 'showAsDropDown', 'type' => 'checkbox', 'label' => 'Drop Down?', 'description' => 'Whether or not the facets should be shown in a drop down list', 'default' => '0'), 'sortMode' => array('property' => 'sortMode', 'type' => 'enum', 'label' => 'Sort', 'values' => array('alphabetically' => 'Alphabetically', 'num_results' => 'By number of results'), 'description' => 'How the facet values should be sorted.', 'default' => 'num_results'), 'showAboveResults' => array('property' => 'showAboveResults', 'type' => 'checkbox', 'label' => 'Show Above Results', 'description' => 'Whether or not the facets should be shown above the results', 'default' => 0), 'showInResults' => array('property' => 'showInResults', 'type' => 'checkbox', 'label' => 'Show on Results Page', 'description' => 'Whether or not the facets should be shown in regular search results', 'default' => 1), 'showInAuthorResults' => array('property' => 'showInAuthorResults', 'type' => 'checkbox', 'label' => 'Show for Author Searches', 'description' => 'Whether or not the facets should be shown when searching by author', 'default' => 1), 'showInAdvancedSearch' => array('property' => 'showInAdvancedSearch', 'type' => 'checkbox', 'label' => 'Show on Advanced Search', 'description' => 'Whether or not the facet should be an option on the Advanced Search Page', 'default' => 1), 'collapseByDefault' => array('property' => 'collapseByDefault', 'type' => 'checkbox', 'label' => 'Collapse by Default', 'description' => 'Whether or not the facet should be an collapsed by default.', 'default' => 0), 'useMoreFacetPopup' => array('property' => 'useMoreFacetPopup', 'type' => 'checkbox', 'label' => 'Use More Facet Popup', 'description' => 'Whether or not mroe facet options are shown in a popup box.', 'default' => 1)); return $structure; }
static function getDefaultFacets($libraryId = -1) { global $configArray; $defaultFacets = array(); $facet = new LibraryFacetSetting(); $facet->setupTopFacet('format_category', 'Format Category'); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; if ($configArray['Index']['enableDetailedAvailability']) { $facet = new LibraryFacetSetting(); $facet->setupTopFacet('availability_toggle', 'Available?', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; } if (!$configArray['Index']['enableDetailedAvailability']) { $facet = new LibraryFacetSetting(); $facet->setupSideFacet('available_at', 'Available Now At', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; } $facet = new LibraryFacetSetting(); $facet->setupSideFacet('format', 'Format', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupSideFacet('literary_form_full', 'Literary Form', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupSideFacet('target_audience_full', 'Reading Level', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $facet->numEntriesToShowByDefault = 8; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupSideFacet('topic_facet', 'Subject', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupSideFacet('time_since_added', 'Added in the Last', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupSideFacet('authorStr', 'Author', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupAdvancedFacet('awards_facet', 'Awards', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupSideFacet('econtent_device', 'Compatible Device', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupAdvancedFacet('econtent_source', 'eContent Source', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupAdvancedFacet('econtent_protection_type', 'eContent Protection', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupAdvancedFacet('era', 'Era', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupSideFacet('genre_facet', 'Genre', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupSideFacet('itype', 'Item Type', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupSideFacet('language', 'Language', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupAdvancedFacet('lexile_code', 'Lexile Code', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupAdvancedFacet('lexile_score', 'Lexile Score', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupAdvancedFacet('mpaa_rating', 'Movie Rating', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupSideFacet('owning_library', 'Owning System', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupSideFacet('owning_location', 'Owning Branch', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupSideFacet('publishDate', 'Publication Date', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupAdvancedFacet('geographic_facet', 'Region', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; $facet = new LibraryFacetSetting(); $facet->setupSideFacet('rating_facet', 'User Rating', true); $facet->libraryId = $libraryId; $facet->weight = count($defaultFacets) + 1; $defaultFacets[] = $facet; return $defaultFacets; }
function getObjectStructure() { return LibraryFacetSetting::getObjectStructure(); }