| | 103 | /** |
|---|
| | 104 | * Get the info of a component |
|---|
| | 105 | * |
|---|
| | 106 | * @access public |
|---|
| | 107 | * @param string $comp_name Component's name |
|---|
| | 108 | * @return mixed Returns an array with the info of the component and false on error |
|---|
| | 109 | */ |
|---|
| | 110 | function GetComponentByName($comp_name) |
|---|
| | 111 | { |
|---|
| | 112 | $params = array(); |
|---|
| | 113 | $params['comp_name'] = $comp_name; |
|---|
| | 114 | |
|---|
| | 115 | $sql = ' |
|---|
| | 116 | SELECT |
|---|
| | 117 | [id], [comp_name], [enabled] |
|---|
| | 118 | FROM [[components]] |
|---|
| | 119 | WHERE [comp_name] = {comp_name}'; |
|---|
| | 120 | |
|---|
| | 121 | $result = $GLOBALS['db']->query($sql, $params); |
|---|
| | 122 | if (Jaws_Error::IsError($result) || !isset($result['id'])) { |
|---|
| | 123 | return false; |
|---|
| | 124 | } |
|---|
| | 125 | |
|---|
| | 126 | return $result; |
|---|
| | 127 | } |
|---|
| | 128 | |
|---|