Changeset 3453 for branches/2.0/include/ws_functions.inc.php
- Timestamp:
- Jun 24, 2009, 11:42:39 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/include/ws_functions.inc.php
r3239 r3453 1734 1734 } 1735 1735 1736 function ws_categories_setInfo($params, &$service) 1737 { 1738 global $conf; 1739 if (!is_admin() || is_adviser() ) 1740 { 1741 return new PwgError(401, 'Access denied'); 1742 } 1743 1744 // category_id 1745 // name 1746 // comment 1747 1748 $params['category_id'] = (int)$params['category_id']; 1749 if ($params['category_id'] <= 0) 1750 { 1751 return new PwgError(WS_ERR_INVALID_PARAM, "Invalid category_id"); 1752 } 1753 1754 // database registration 1755 $update = array( 1756 'id' => $params['category_id'], 1757 ); 1758 1759 $info_columns = array( 1760 'name', 1761 'comment', 1762 ); 1763 1764 $perform_update = false; 1765 foreach ($info_columns as $key) 1766 { 1767 if (isset($params[$key])) 1768 { 1769 $perform_update = true; 1770 $update[$key] = $params[$key]; 1771 } 1772 } 1773 1774 if ($perform_update) 1775 { 1776 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 1777 mass_updates( 1778 CATEGORIES_TABLE, 1779 array( 1780 'primary' => array('id'), 1781 'update' => array_diff(array_keys($update), array('id')) 1782 ), 1783 array($update) 1784 ); 1785 } 1786 1787 } 1788 1736 1789 function ws_logfile($string) 1737 1790 {
Note: See TracChangeset
for help on using the changeset viewer.