<?php
	require_once( $GLOBALS["site_root"]."/includes/widgets/Widget.inc.php" );
	require_once( $GLOBALS["site_root"]."/includes/widgets/Openads.inc.php" );
	require_once( $GLOBALS["site_root"]."/includes/widgets/MiniJobs.inc.php" );

	require_once( $GLOBALS["site_root"]."/includes/models/Articles.inc.php" );
	require_once( $GLOBALS["site_root"]."/includes/models/Articlecategories.inc.php" );

	class ArticleWithJobs extends Widget {
		protected $iArticleId = 0;
		protected $article_model;
		protected $ac_model;
		protected $oJobs;

		public function __construct( $id , $parent = null ) {
			parent::__construct( $id , $parent );
			$this->article_model = new ArticlesModel();
			$this->ac_model = new ArticlecategoriesModel();
			$this->oMiniJobs = new MiniJobs( "minijobs" , $this );
		}

		public function render() {
			if ($this->sRendered) return $this->sRendered;
			$article = $this->article_model->getLatestArticleFromCategory( 
				$this->ac_model->getArticleCategoryIdFromName( array( "--news--" , "--profinfo--" ) ),
				$GLOBALS["langcode"] );
			$this->setParam( "article" , $article );
			$this->setParam( "larticle" , $article["larticle"] );
			return parent::render();
		}
	}

?>
