Espandere albero materiali

Funzionalità di frontend per utenti e amministratori dei corsi: navigazione generale, materiali didattici, test, registro valutazioni, ecc.
Post Reply
leo371
Newbie
Posts: 6
Joined: Wed Jan 29, 2014 10:32 am

Espandere albero materiali

Post by leo371 »

Salve,
innanzitutto complimenti per il lavoro che portate avanti, avrei questa necessità: in area studenti --> materiali avendo creato una serie di cartelle contenitori come è possibile fare in modo che l'albero (treeview) sia del tutto espanso nel momento che lo studente clicca su materiali?

Grazie per l'aiuto che potete darmi

Leonardo Nencioni
JudE
Newbie
Posts: 20
Joined: Tue Jul 22, 2014 11:10 am
Version: forma.lms 1.4

Re: Espandere albero materiali

Post by JudE »

Ciao Leonardo, sei riuscito?
JudE
Newbie
Posts: 20
Joined: Tue Jul 22, 2014 11:10 am
Version: forma.lms 1.4

Re: Espandere albero materiali

Post by JudE »

PER CHI VUOLE ESPANDERE TUTTE LE CARTELLE QUANDO CLICCA SU MATERIALI DEL CORSO:


editare il file: lib/lib.treeview.php e alla riga 296 aggiungere l'ELSE come di seguito. Il seguente codice espande solo il primo livello di cartelle.. se vi serve espanderle tutte fatevi na funzione ricorsiva!

Code: Select all

      if( isSet( $arrayExpand[$this->_getExpandId()] ) ) {
			$this->expandList = explode( ',', $arrayExpand[$this->_getExpandId()]);
		}
		else
		{
			if(!isset($arrayState["treeview_state_organization"]) &&
				!isset($arrayState["authentic_request"])){
				$childrensRoot = $this->tdb->getChildrensIdById('0');
				
				foreach($childrensRoot as $value){
					$childrens = $this->tdb->getChildrensIdById($value);
					if(is_array($childrens))
						array_push($this->expandList, $value);
				}
			}
		}
Segnalo che la funzione sopra è probabilmente da riprogettare..
User avatar
alberto
FormaLms Guru
Posts: 1135
Joined: Fri Mar 02, 2012 9:18 am
Contact:

Re: Espandere albero materiali

Post by alberto »

Grazie per il contributo JudE :)
Post Reply