[ Index ] |
|
Code source de Claroline 188 |
1 <?php // $Id: CLANN___Navigator.php,v 1.12 2006/12/19 08:18:07 moosh Exp $ 2 if ( count( get_included_files() ) == 1 ) die( '---' ); 3 /** 4 * CLAROLINE 5 * 6 * @version 1.8 $Revision: 1.12 $ 7 * @copyright (c) 2001-2006 Universite catholique de Louvain (UCL) 8 * 9 * @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE 10 * 11 * @author claroline Team <cvs@claroline.net> 12 * @author Renaud Fallier <renaud.claroline@gmail.com> 13 * @author Frédéric Minne <minne@ipm.ucl.ac.be> 14 * 15 * @package CLLINKER 16 * 17 */ 18 19 require_once (dirname(__FILE__) . '/navigator.lib.php'); 20 require_once (dirname(__FILE__) . '/CLANN___Resolver.php'); 21 22 /** 23 * Class announcement Navigator 24 * 25 * @package CLANN 26 * @subpackage CLLINKER 27 * 28 * @author Fallier Renaud <renaud.claroline@gmail.com> 29 */ 30 class CLANN___Navigator extends Navigator 31 { 32 /** 33 * @var $_claroContainer 34 */ 35 var $_claroContainer; 36 37 /*---------------------------- 38 public method 39 ---------------------------*/ 40 41 /** 42 * Constructor 43 * 44 * @param $basePath string path root directory of courses 45 */ 46 function CLANN___Navigator($basePath = null) 47 { 48 global $_course; 49 $this->_claroContainer = FALSE; 50 } 51 52 /** 53 * list the contents of a announcement 54 * 55 * @param $node string of current node (crl) 56 * @return ClaroContainer who contains the objects current node 57 * @throws E_USER_ERROR if the node is not intended for the tool forum 58 * @throws E_USER_ERROR if the node is empty 59 */ 60 function getResource($node = null) 61 { 62 if(!is_null($node)) 63 { 64 // if this node (crl) is for announcement 65 if(CRLTool::isForThisTool($node, 'CLANN___')) 66 { 67 $elementCRLArray = CRLTool::parseCRL($node); 68 69 if( !isset ($elementCRLArray['resource_id']) ) 70 { 71 // listing of annoncouncement 72 $annonce = $this->_listAnnonce($elementCRLArray['course_sys_code']); 73 $elementList = array(); 74 75 foreach ($annonce as $itemAnnonce ) 76 { 77 $crl = $node . '/' . $itemAnnonce['id']; 78 $res = new CLANN___Resolver(get_path('rootWeb')); 79 $title = $res->getTitle($elementCRLArray['course_sys_code'], $itemAnnonce['id']); 80 $isVisible = ( $itemAnnonce['visibility'] == 'SHOW'); 81 $container = new ClaroObject( $title , $crl , TRUE , FALSE , $isVisible ); 82 $elementList[] = $container ; 83 } 84 85 $this->_claroContainer = new ClaroContainer ( '' , $node , $elementList ); 86 87 return $this->_claroContainer; 88 89 } 90 else 91 { 92 trigger_error ("Error : resource_id must be empty", E_USER_ERROR); 93 } 94 } 95 else 96 { 97 trigger_error ("Error : not crl for a announcement tool", E_USER_ERROR); 98 } 99 } 100 // if the node is null 101 else 102 { 103 trigger_error ('Error : crl is empty', E_USER_ERROR); 104 } 105 } 106 107 /*---------------------------- 108 private method 109 ---------------------------*/ 110 111 /** 112 * list the announcement of a course 113 * 114 * @return $array a array which contains the id and the title of a announcement 115 */ 116 function _listAnnonce($course_sys_code) 117 { 118 $courseInfoArray = get_info_course($course_sys_code); 119 $tbl_cdb_names = claro_sql_get_course_tbl($courseInfoArray["dbNameGlu"]); 120 $tbl_annonce = $tbl_cdb_names['announcement']; 121 122 $sql = 'SELECT `id`,`title` , `visibility` FROM `'.$tbl_annonce.'`'; 123 $annonces = claro_sql_query_fetch_all($sql); 124 125 return $annonces; 126 } 127 } 128 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Nov 29 14:38:42 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |