예제 #1
0
	/**
	 * Modifies the params array to dramatically expand what can be passed in via page type parameters for a publication
	 * @author Nathan White
	 */
	function handle_params( $params )
	{
		// This is a slight hack to get publications to default to *not* limiting to the current site. This should allow publications to be displayed anywhere.
		$this->base_params['limit_to_current_site'] = false;
		
		// all params that could be provided in page_types
		$potential_params = array('use_filters', 'use_pagination', 'num_per_page', 'max_num_items', 'minimum_date_strtotime_format', 'show_login_link', 
		      					  'show_module_title', 'related_mode', 'related_order', 'date_format', 'related_title',
		      					  'limit_by_page_categories', 'related_publication_unique_names', 'related_category_unique_names','css',
		      					  'show_featured_items','jump_to_item_if_only_one_result','authorization','comment_form_file_location','post_form_file_location',);
		$markup_params = 	array('markup_generator_info' => $this->markup_generator_info, 
							      'item_specific_variables_to_pass' => $this->item_specific_variables_to_pass,
							      'variables_to_pass' => $this->variables_to_pass);
		
		$params_to_add = array_diff_assoc_recursive($params, $markup_params + $potential_params);
		if (!empty($params_to_add))
		{
			foreach ($params_to_add as $k=>$v)
			{
				$this->acceptable_params[$k] = $v;
			}
		}
		$this->acceptable_params['module_displays_search_interface'] = true;
		$this->acceptable_params['module_displays_filter_interface'] = true;
		$this->acceptable_params['show_pagination_in_module'] = true;
		$this->acceptable_params['no_publication_warning'] = true;
		parent::handle_params( $params );
	}