Changeset 9242
- Timestamp:
- 08/13/08 22:23:16 (4 months ago)
- Files:
-
- trunk/jaws/html/include/Jaws/Component.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/jaws/html/include/Jaws/Component.php
r9241 r9242 9 9 * @license http://www.gnu.org/copyleft/lesser.html 10 10 */ 11 define('JAWS_COMPONENT_ANY', 0); 12 define('JAWS_COMPONENT_CORE', 1); 13 define('JAWS_COMPONENT_GADGET', 2); 14 define('JAWS_COMPONENT_PLUGIN', 3); 15 11 16 class Jaws_Component 12 17 { … … 85 90 * 86 91 * @access public 87 * @param int $idComponent's ID92 * @param int $id Component's ID 88 93 * @return boolean Returns true if component was sucessfully deleted, false if not 89 94 */ … … 105 110 * 106 111 * @access public 107 * @param string $comp _nameComponent's name112 * @param string $comp Component's name 108 113 * @return mixed Returns an array with the info of the component and false on error 109 114 */ 110 function GetComponentByName($comp _name)115 function GetComponentByName($comp) 111 116 { 112 117 $params = array(); 113 $params['comp_name'] = $comp _name;118 $params['comp_name'] = $comp; 114 119 115 120 $sql = ' … … 127 132 } 128 133 134 /** 135 * Get the list of components 136 * 137 * @access public 138 * @param string $comp Component's name 139 * @param string $type The type of the component, (core, gadget, plugin or any components) 140 * @return mixed Returns an array with the list of the components and false on error 141 */ 142 function GetComponents($comp = '', $type = JAWS_COMPONENT_ANY) 143 { 144 $params = array(); 145 $params['comp_name'] = $comp; 146 $params['comp_type'] = $type; 147 148 $sql = " 149 SELECT 150 [id], [comp_name], [enabled] 151 FROM [[components]]" 152 153 if (!empty($comp)) { 154 $sql .= " WHERE [comp_name] = {comp_name}"; 155 } elseif (!empty($type)) { 156 $sql .= " WHERE [comp_type] = {comp_type}"; 157 } 158 $sql .= " ORDER BY [comp_type], [comp_name]"; 159 160 $result = $GLOBALS['db']->query($sql, $params); 161 if (Jaws_Error::isError($result)) { 162 return false; 163 } 164 165 return $result; 166 } 167 129 168 }
