1<?php 2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */ 3 4/** 5 * Settings template config class 6 * 7 * @author Alex Killing <alex.killing@gmx.de> 8 * @version $Id$ 9 * @ingroup ServicesAdministration 10 */ 11class ilSettingsTemplateConfig 12{ 13 private $type; 14 private $tab = array(); 15 private $setting = array(); 16 17 const TEXT = "text"; 18 const SELECT = "select"; 19 const BOOL = "bool"; 20 const CHECKBOX = "check"; 21 22 /** 23 * Constructor 24 * 25 * @param string object type 26 */ 27 public function __construct($a_obj_type) 28 { 29 $this->setType($a_obj_type); 30 } 31 32 /** 33 * Set type 34 * 35 * @param string $a_val type 36 */ 37 public function setType($a_val) 38 { 39 $this->type = $a_val; 40 } 41 42 /** 43 * Get type 44 * 45 * @return string type 46 */ 47 public function getType() 48 { 49 return $this->type; 50 } 51 52 /** 53 * Add hidable tabs 54 * 55 * @param int tab id 56 * @param string tab text 57 */ 58 public function addHidableTab($a_tab_id, $a_text) 59 { 60 $this->tabs[$a_tab_id] = array( 61 "id" => $a_tab_id, 62 "text" => $a_text 63 ); 64 } 65 66 /** 67 * Get hidable tabs 68 */ 69 public function getHidableTabs() 70 { 71 return $this->tabs; 72 } 73 74 /** 75 * Add setting 76 * 77 * @param 78 * @return 79 */ 80 public function addSetting($a_id, $a_type, $a_text, $a_hidable, $a_length = 0, $a_options = array()) 81 { 82 $this->setting[$a_id] = array( 83 "id" => $a_id, 84 "type" => $a_type, 85 "text" => $a_text, 86 "hidable" => $a_hidable, 87 "length" => $a_length, 88 "options" => $a_options 89 ); 90 } 91 92 /** 93 * Get settings 94 * @return 95 */ 96 public function getSettings() 97 { 98 return $this->setting; 99 } 100} 101