00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00032 class ilMDUtilSelect
00033 {
00043 function _getLanguageSelect($a_selected,$a_name,$prepend = array())
00044 {
00045 include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
00046
00047 global $lng;
00048
00049 foreach(ilMDLanguageItem::_getPossibleLanguageCodes() as $code)
00050 {
00051 $tmp_options[$code] = $lng->txt('meta_l_'.$code);
00052 }
00053 asort($tmp_options,SORT_STRING);
00054
00055 foreach($prepend as $value => $translation)
00056 {
00057 $options[$value] = $translation;
00058 }
00059 $options = array_merge($options,$tmp_options);
00060 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00061 }
00062
00072 function _getStructureSelect($a_selected,$a_name,$prepend = array())
00073 {
00074 global $lng;
00075
00076 $items = array('Atomic','Collection','Networked','Hierarchical','Linear');
00077
00078 foreach($prepend as $value => $translation)
00079 {
00080 $options[$value] = $translation;
00081 }
00082
00083 foreach($items as $item)
00084 {
00085 $options[$item] = $lng->txt('meta_'.strtolower($item));
00086 }
00087 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00088 }
00098 function _getStatusSelect($a_selected,$a_name,$prepend = array())
00099 {
00100 global $lng;
00101
00102 $items = array('Draft','Final','Revised','Unavailable');
00103
00104 foreach($prepend as $value => $translation)
00105 {
00106 $options[$value] = $translation;
00107 }
00108
00109 foreach($items as $item)
00110 {
00111 $options[$item] = $lng->txt('meta_'.strtolower($item));
00112 }
00113 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00114 }
00124 function _getRoleSelect($a_selected,$a_name,$prepend = array())
00125 {
00126 global $lng;
00127
00128 $items = array('Author','Publisher','Unknown','Initiator','Terminator','Editor','GraphicalDesigner','TechnicalImplementer',
00129 'ContentProvider','TechnicalValidator','EducationalValidator','ScriptWriter','InstructionalDesigner',
00130 'SubjectMatterExpert','Creator','Validator');
00131
00132 foreach($prepend as $value => $translation)
00133 {
00134 $options[$value] = $translation;
00135 }
00136
00137 foreach($items as $item)
00138 {
00139 $options[$item] = $lng->txt('meta_'.strtolower($item));
00140 }
00141 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00142 }
00152 function _getOperatingSystemSelect($a_selected,$a_name,$prepend = array())
00153 {
00154 global $lng;
00155
00156 $items = array('PC-DOS','MS-Windows','MAC-OS','Unix','Multi-OS','None');
00157
00158 foreach($prepend as $value => $translation)
00159 {
00160 $options[$value] = $translation;
00161 }
00162
00163 foreach($items as $item)
00164 {
00165 $options[$item] = $item;
00166 }
00167 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00168 }
00178 function _getBrowserSelect($a_selected,$a_name,$prepend = array())
00179 {
00180 global $lng;
00181
00182 $items = array('Any','NetscapeCommunicator','MS-InternetExplorer','Opera','Amaya','Mozilla');
00183
00184 foreach($prepend as $value => $translation)
00185 {
00186 $options[$value] = $translation;
00187 }
00188
00189 foreach($items as $item)
00190 {
00191 $options[$item] = $item;
00192 }
00193 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00194 }
00205 function _getFormatSelect($a_selected,$a_name,$prepend = array())
00206 {
00207 global $lng,$ilDB;
00208
00209 foreach($prepend as $value => $translation)
00210 {
00211 $options[$value] = $translation;
00212 }
00213
00214
00215 $query = "SELECT DISTINCT(format) as forma from il_meta_format ORDER BY format LIMIT 200";
00216 $res = $ilDB->query($query);
00217 if(!$res->numRows())
00218 {
00219 return '';
00220 }
00221 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
00222 {
00223 if(strlen($row->forma))
00224 {
00225 $options[$row->forma] = substr($row->forma,0,48);
00226 }
00227 }
00228
00229 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00230 }
00241 function _getDurationSelect($a_selected,$a_name,$prepend = array())
00242 {
00243 global $lng;
00244
00245 foreach($prepend as $value => $translation)
00246 {
00247 $options[$value] = $translation;
00248 }
00249
00250 $items = array(15 => '15 '.$this->lng->txt('minutes'),
00251 30 => '30 '.$this->lng->txt('minutes'),
00252 45 => '45 '.$this->lng->txt('minutes'),
00253 60 => '1 '. $this->lng->txt('hour'),
00254 90 => '1 '. $this->lng->txt('hour').' 30 '.$this->lng->txt('minutes'),
00255 120 => '2 '.$this->lng->txt('hours'),
00256 180 => '3 '.$this->lng->txt('hours'),
00257 240 => '4 '.$this->lng->txt('hours'));
00258
00259 foreach($items as $key => $item)
00260 {
00261 $options[$key] = $item;
00262 }
00263 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00264 }
00275 function _getInteractivityTypeSelect($a_selected,$a_name,$prepend = array())
00276 {
00277 global $lng;
00278
00279 $items = array('Actice','Expositive','Mixed');
00280
00281 foreach($prepend as $value => $translation)
00282 {
00283 $options[$value] = $translation;
00284 }
00285
00286 foreach($items as $item)
00287 {
00288 $options[$item] = $item;
00289 }
00290 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00291 }
00302 function _getLearningResourceTypeSelect($a_selected,$a_name,$prepend = array())
00303 {
00304 global $lng;
00305
00306 $items = array('Exercise','Simulation','Questionnaire','Diagram','Figure','Graph','Index',
00307 'Slide','Table','NarrativeText','Exam','Experiment','ProblemStatement','SelfAssessment','Lecture');
00308
00309 foreach($prepend as $value => $translation)
00310 {
00311 $options[$value] = $translation;
00312 }
00313
00314 foreach($items as $item)
00315 {
00316 $options[$item] = $item;
00317 }
00318 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00319 }
00330 function _getInteractivityLevelSelect($a_selected,$a_name,$prepend = array())
00331 {
00332 global $lng;
00333
00334 $items = array(1 => 'VeryLow',2 => 'Low',3 => 'Medium',4 => 'High',5 => 'VeryHigh');
00335
00336 foreach($prepend as $value => $translation)
00337 {
00338 $options[$value] = $translation;
00339 }
00340
00341 foreach($items as $key => $item)
00342 {
00343 $options[$key] = $item;
00344 }
00345 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00346 }
00357 function _getSemanticDensitySelect($a_selected,$a_name,$prepend = array())
00358 {
00359 global $lng;
00360
00361 $items = array(1 => 'VeryLow',2 => 'Low',3 => 'Medium',4 => 'High',5 => 'VeryHigh');
00362
00363 foreach($prepend as $value => $translation)
00364 {
00365 $options[$value] = $translation;
00366 }
00367
00368 foreach($items as $key => $item)
00369 {
00370 $options[$key] = $item;
00371 }
00372 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00373 }
00384 function _getIntendedEndUserRoleSelect($a_selected,$a_name,$prepend = array())
00385 {
00386 global $lng;
00387
00388 $items = array('Teacher','Author','Learner','Manager');
00389
00390 foreach($prepend as $value => $translation)
00391 {
00392 $options[$value] = $translation;
00393 }
00394
00395 foreach($items as $item)
00396 {
00397 $options[$item] = $item;
00398 }
00399 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00400 }
00410 function _getContextSelect($a_selected,$a_name,$prepend = array())
00411 {
00412 global $lng;
00413
00414 $items = array('School','HigherEducation','Training','Other');
00415
00416 foreach($prepend as $value => $translation)
00417 {
00418 $options[$value] = $translation;
00419 }
00420
00421 foreach($items as $item)
00422 {
00423 $options[$item] = $item;
00424 }
00425 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00426 }
00427
00428
00438 function _getLocationTypeSelect($a_selected,$a_name,$prepend = array())
00439 {
00440 global $lng;
00441
00442 $items = array('LocalFile','Reference');
00443
00444 foreach($prepend as $value => $translation)
00445 {
00446 $options[$value] = $translation;
00447 }
00448
00449 foreach($items as $item)
00450 {
00451 $options[$item] = $item;
00452 }
00453 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00454 }
00465 function _getDifficultySelect($a_selected,$a_name,$prepend = array())
00466 {
00467 global $lng;
00468
00469 $items = array(1 => 'VeryEasy',2 => 'Easy',3 => 'Medium',4 => 'Difficult',5 => 'VeryDifficult');
00470
00471 foreach($prepend as $value => $translation)
00472 {
00473 $options[$value] = $translation;
00474 }
00475
00476 foreach($items as $key => $item)
00477 {
00478 $options[$key] = $item;
00479 }
00480 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00481 }
00492 function _getTypicalAgeRangeSelect($a_selected,$a_name,$prepend = array())
00493 {
00494 global $lng;
00495
00496 foreach($prepend as $value => $translation)
00497 {
00498 $options[$value] = $translation;
00499 }
00500 for($i = 1; $i < 100 ; $i++)
00501 {
00502 $items[$i] = $i;
00503 }
00504 foreach($items as $key => $item)
00505 {
00506 $options[$key] = $item;
00507 }
00508 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00509 }
00510
00521 function _getTypicalLearningTimeSelect($a_selected,$a_name,$prepend = array())
00522 {
00523 global $lng;
00524
00525 foreach($prepend as $value => $translation)
00526 {
00527 $options[$value] = $translation;
00528 }
00529 $items = array(15 => '15 '.$this->lng->txt('minutes'),
00530 30 => '30 '.$this->lng->txt('minutes'),
00531 45 => '45 '.$this->lng->txt('minutes'),
00532 60 => '1 '. $this->lng->txt('hour'),
00533 90 => '1 '. $this->lng->txt('hour').' 30 '.$this->lng->txt('minutes'),
00534 120 => '2 '.$this->lng->txt('hours'),
00535 180 => '3 '.$this->lng->txt('hours'),
00536 240 => '4 '.$this->lng->txt('hours'));
00537
00538 foreach($items as $key => $item)
00539 {
00540 $options[$key] = $item;
00541 }
00542 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00543 }
00554 function _getCostsSelect($a_selected,$a_name,$prepend = array())
00555 {
00556 global $lng;
00557
00558 $items = array('Yes','No');
00559
00560 foreach($prepend as $value => $translation)
00561 {
00562 $options[$value] = $translation;
00563 }
00564
00565 foreach($items as $item)
00566 {
00567 $options[$item] = $item;
00568 }
00569 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00570 }
00581 function _getCopyrightAndOtherRestrictionsSelect($a_selected,$a_name,$prepend = array())
00582 {
00583 global $lng;
00584
00585 $items = array('Yes','No');
00586
00587 foreach($prepend as $value => $translation)
00588 {
00589 $options[$value] = $translation;
00590 }
00591
00592 foreach($items as $item)
00593 {
00594 $options[$item] = $item;
00595 }
00596 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00597 }
00608 function _getPurposeSelect($a_selected,$a_name,$prepend = array())
00609 {
00610 global $lng;
00611
00612 $items = array('Discipline','Idea','Prerequisite','EducationalObjective','AccessibilityRestrictions',
00613 'EducationalLevel','SkillLevel','SecurityLevel','Competency');
00614
00615 foreach($prepend as $value => $translation)
00616 {
00617 $options[$value] = $translation;
00618 }
00619
00620 foreach($items as $item)
00621 {
00622 $options[$item] = $item;
00623 }
00624 return ilUtil::formSelect($a_selected,$a_name,$options,false,true);
00625 }
00626
00627
00628 }