예제 #1
0
 function init($args = array())
 {
     if (!empty($this->params['num_per_page'])) {
         $this->num_per_page = (int) $this->params['num_per_page'];
     }
     parent::init();
 }
예제 #2
0
		function init($args = array())
		{	
			if(isset($this->params['num_per_page']))
				$this->num_per_page = $this->params['num_per_page'];
			
			// only load javascript and css for integrated items
			if ( !empty($this->request[ $this->query_string_frag.'_id' ]) )
			{
				$media_work = new entity($this->request[ $this->query_string_frag.'_id' ]);
				if ($media_work->get_values() && $media_work->get_value('type') == id_of('av'))
				{
					$head_items = $this->get_head_items();
					$head_items->add_javascript(JQUERY_URL, true);
					
					$this->displayer_chrome = MediaWorkFactory::displayer_chrome($media_work, 'av');
					if ($this->displayer_chrome)
					{
						$this->displayer_chrome->set_module($this);
						$this->displayer_chrome->set_head_items($head_items);
					}
				}
			}
	
			parent::init($args);
		}
예제 #3
0
 function init($args = array())
 {
     if (!empty($this->params['num_per_page'])) {
         $this->num_per_page = (int) $this->params['num_per_page'];
     }
     $head_items = $this->get_head_items();
     $head_items->add_stylesheet(REASON_HTTP_BASE_PATH . 'modules/av/av_simple.css');
     parent::init();
 }
예제 #4
0
	/**
	 * Init when publication is in related_mode
	 * @author Nathan White
	 */
	function init_related( $args = array())
	{
		// init defaults
		$this->use_filters = false;
		$this->show_login_link = false;
		$this->use_pagination = (isset($this->params['use_pagination']) && $this->params['use_pagination']) ? true : false;
		if (!$this->use_pagination && empty($this->max_num_items)) $this->max_num_items = $this->num_per_page;
		$this->style_string = 'relatedPub';
		unset ($this->request[ $this->query_string_frag.'_id' ] );
		
		$publication_ids = (!empty($this->params['related_publication_unique_names'])) 
						   ? $this->build_ids_from_unique_names($this->params['related_publication_unique_names'])
						   : array();
		
		$pub_es = new entity_selector();
		
		$pub_es->description = 'Selecting publications for this page';
		$pub_es->add_type( id_of('publication_type') );
		$pub_es->enable_multivalue_results();
		$pub_es->limit_tables();
		$pub_es->limit_fields();
		if (!empty($publication_ids)) $pub_es->add_relation('entity.id IN (' . implode(",", array_keys($publication_ids)) . ')');
		else $pub_es->add_right_relationship( $this->page_id, relationship_id_of('page_to_related_publication') );
		$pub_es->add_right_relationship_field('page_to_publication', 'entity', 'id', 'page_id');
		$publications = $pub_es->run_one();
		if (empty($publications))
		{
			//$s = get_microtime();
			$pub_es = new entity_selector( $this->site_id );
			$pub_es->description = 'Selecting publications for this page';
			$pub_es->add_type( id_of('publication_type') );
			$pub_es->enable_multivalue_results();
			$pub_es->limit_tables();
			$pub_es->limit_fields();
			$pub_es->add_right_relationship_field('page_to_publication', 'entity', 'id', 'page_id');	
			$publications = $pub_es->run_one();
		}
		if (!empty($publications)) // lets make sure the pages are live
		{
			$publications = $this->_filter_non_live_related_ids($publications, 'minisite_page', 'page_id');
			$publications = $this->_filter_pubs_with_improper_page_types($publications);
		}
		if (!empty($publications))
		{
			$this->related_publications = $publications;
			
			if ($this->limit_by_page_categories)
			{
				$category_ids = (!empty($this->params['related_category_unique_names'])) 
								? $this->build_ids_from_unique_names($this->params['related_category_unique_names'])
								: array();
				// grab categories in which to limit related news items
				$cat_es = new entity_selector();
				$cat_es->description = 'Selecting categories for this page';
				$cat_es->add_type( id_of('category_type'));
				$cat_es->limit_tables();
				$cat_es->limit_fields();
				if (!empty($category_ids)) $cat_es->add_relation('entity.id IN (' . implode(",", array_keys($category_ids)) . ')');
				else $cat_es->add_right_relationship($this->page_id, relationship_id_of('page_to_category') );
				$categories = $cat_es->run_one();
				if (!empty($categories))
				{
					$this->related_categories = $categories;
				}
			}
			parent::init( $args );
		}
		elseif(!empty($this->params['no_publication_warning']))
		{
			trigger_error('Publication module unable to find an active publication to display.');
		}
	}
예제 #5
0
 function init($options = array())
 {
     if (isset($this->request['item_id'])) {
         $this->model->set_classified_id($this->request['item_id']);
     }
     if (empty($this->request['classified_mode'])) {
         $this->view->init_view();
         // set various generic 3 instance variables based upon the view
         $this->show_list_with_details = $this->view->get_show_list_with_details();
         $this->use_filters = $this->view->get_use_filters();
         parent::init();
     } elseif ($this->request['classified_mode'] == 'add_item') {
         $this->view->init_view_and_form();
     } elseif ($this->request['classified_mode'] == 'submit_success') {
         $this->view->init_view();
     } elseif ($this->request['classified_mode'] == 'delete_item') {
         $this->view->init_view();
     }
 }