Ejemplo n.º 1
0
 public function testAllFilters()
 {
     $broker = $this->_getPluginBroker();
     add_filter('filter1', 'test_callback');
     add_filter('filter2', 'test_callback');
     clear_filters();
     $this->assertEmpty($broker->getFilters('filter1'));
     $this->assertEmpty($broker->getFilters('filter2'));
 }
 /**
  * Add the data linker navigation link.
  */
 public function hookPublicHead($args)
 {
     clear_filters(array('Display', 'Item', 'Dublin Core', 'Title'));
     queue_css_file("print", "print");
     // queues a css file to print pages
     queue_css_file('linked');
     // assumes plugin has a /views/public/css/linked.css file
     queue_js_file('showHide');
     queue_js_file('search_mod');
     $view = get_view();
     if (isset($view->item)) {
         if (metadata("item", 'collection_name') == "Vertellers") {
             add_filter(array('Display', 'Item', 'Dublin Core', 'Title'), 'title_maker_info_retrieve_popup_jquery', 7);
         }
         if (metadata("item", 'collection_name') == "Verzamelaars") {
             add_filter(array('Display', 'Item', 'Dublin Core', 'Title'), 'title_collector_info_retrieve_popup_jquery', 7);
         }
         if (metadata("item", 'Item Type Name') == "Volksverhaaltype") {
             add_filter(array('Display', 'Item', 'Dublin Core', 'Identifier'), 'identifier_info_retrieve_popup_jquery', 7);
         }
         if (metadata("item", 'Item Type Name') == "Volksverhaal") {
             // PRIVACY
             if ($this->get_elements_private_status_by_value(metadata($view->item, array('Dublin Core', 'Creator')))) {
                 #in case of existing privacy issues
                 add_filter(array('Display', 'Item', 'Dublin Core', 'Creator'), 'creator_privacy_hide', 1);
                 add_filter(array('Display', 'Item', 'Item Type Metadata', 'Collector'), 'creator_privacy_hide', 1);
                 add_filter(array('Display', 'Item', 'Item Type Metadata', 'Contributor'), 'creator_privacy_hide', 1);
             }
             #                add_filter(array('Display', 'Item', 'Item Type Metadata', 'Kloeke georeference'),   'my_kloeke_link_function', 4);
             add_filter(array('Display', 'Item', 'Item Type Metadata', 'Text'), 'text_extreme_hide', 5);
             add_filter(array('Display', 'Item', 'Item Type Metadata', 'Text'), 'text_copyright_hide', 6);
         }
         #TODO: aangeven wanneer dit moet gebeuren zoals hierboven
         if (metadata("item", 'Item Type Name') == "Volksverhaal" || metadata("item", 'Item Type Name') == "Lexicon item" || metadata("item", 'Item Type Name') == "Text Edition") {
             add_filter(array('Display', 'Item', 'Dublin Core', 'Motif'), 'motif_info_retrieve_popup_jquery', 7);
             add_filter(array('Display', 'Item', 'Dublin Core', 'Subject'), 'subject_info_retrieve_popup_jquery', 7);
             add_filter(array('Display', 'Item', 'Dublin Core', 'Language'), 'language_info_retrieve_popup_jquery', 7);
             add_filter(array('Display', 'Item', 'Dublin Core', 'Type'), 'type_info_retrieve_popup_jquery', 7);
             add_filter(array('Display', 'Item', 'Dublin Core', 'Creator'), 'creator_info_retrieve_popup_jquery', 7);
             add_filter(array('Display', 'Item', 'Item Type Metadata', 'Collector'), 'collector_info_retrieve_popup_jquery', 7);
             add_filter(array('Display', 'Item', 'Item Type Metadata', 'Subgenre'), 'subgenre_info_retrieve_popup_jquery', 7);
             add_filter(array('Display', 'Item', 'Item Type Metadata', 'Named Entity Location'), 'nep_info_retrieve_popup_jquery', 7);
             add_filter(array('Display', 'Item', 'Item Type Metadata', 'Named Entity'), 'ne_other_info_retrieve_popup_jquery', 7);
             #later veranderen
             add_filter(array('Display', 'Item', 'Item Type Metadata', 'Named Entity Actor'), 'nea_info_retrieve_popup_jquery', 7);
             add_filter(array('Display', 'Item', 'Item Type Metadata', 'Place of Action'), 'pvh_info_retrieve_popup_jquery', 7);
             add_filter(array('Display', 'Item', 'Item Type Metadata', 'Motif'), 'motif_info_retrieve_popup_jquery', 7);
             add_filter(array('Display', 'Item', 'Item Type Metadata', 'Kloeke Georeference'), 'kloeke_info_retrieve_popup_jquery', 7);
             add_filter(array('Display', 'Item', 'Item Type Metadata', 'Kloeke Georeference in Text'), 'kloeke_info_retrieve_popup_jquery', 7);
             //                add_filter(array('Display', 'Item', 'Dublin Core', 'Description'),                  'scroll_to_full_text', 5); // should check if there is Text available
             add_filter(array('Display', 'Item', 'Dublin Core', 'Source'), 'make_urls_clickable_in_text', 6);
             add_filter(array('Display', 'Item', 'Item Type Metadata', 'Literature'), 'make_urls_clickable_in_text');
             add_filter(array('Display', 'Item', 'Dublin Core', 'Date'), 'present_dates_as_language', 20);
         }
     }
     if (isset($view->items)) {
         add_filter(array('Display', 'Item', 'Dublin Core', 'Date'), 'present_dates_as_language', 20);
     }
 }