/**
 * Constructeur du controlleur
 */
function ControllerRub() {
	this.inheritFrom();
}
ControllerRub.prototype = new Controller();
ControllerRub.prototype.inheritFrom = Controller;

/**
 * Initialisation du contrôleur, et demande d'affichage des arbres
 */
ControllerRub.prototype.init = function() {
	// on récupère simplement la page de détail (pour la relocalisation du contenu)
	this.detailHautIFrameElt = xbGetElementById("pageDetailHaut_parent");
	if (und(this.detailHautIFrameElt)) {
		// pas de différenciation haut / bas
		this.detailHautIFrameElt = xbGetElementById("pageDetail_parent");
	}
}

/**
 * Initialisation, avec affichage de la page correspondant à la clé fournie
 * @param  a_key	(String)  clé du mapping à afficher
 * @param  a_linkId (String)  id de l'objet (activité) éventuelle
 */
ControllerRub.prototype.initWithKey = function(a_key, a_linkId) {
	// on récupère les objets à modifier dynamiquement
	this.pathLib = xbGetElementById("pathLib");
	this.ssRubLib = xbGetElementById("ssRubLib");
	this.ssRubrique = null;
	
	if (a_linkId == -1) {
		// affichage simple
		this.sendRequest(a_key, 'show');
	} else {
		// ajout de l'id
		this.sendRequest(a_key, 'show', [['link_id', a_linkId]]);
	}
}

