Changeset 4513
- Timestamp:
- Dec 18, 2009, 10:12:41 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/calendar_weekly.class.php
r4398 r4513 55 55 ), 56 56 array( 57 'sql'=> pwg_db_get_week($this->date_field) +1,57 'sql'=> pwg_db_get_week($this->date_field).'+1', 58 58 'labels' => $week_no_labels, 59 59 ), 60 60 array( 61 'sql'=> pwg_db_get_dayofweek($this->date_field) -1,61 'sql'=> pwg_db_get_dayofweek($this->date_field).'-1', 62 62 'labels' => $lang['day'] 63 63 ), -
trunk/include/ws_functions.inc.php
r4511 r4513 856 856 return new PwgError(401, 'Access denied'); 857 857 } 858 if (!$service->isPost()) 859 { 860 return new PwgError(405, "This method requires HTTP POST"); 861 } 858 862 $params['image_id'] = array_map( 'intval',$params['image_id'] ); 859 863 if ( empty($params['image_id']) ) … … 866 870 return new PwgError(WS_ERR_INVALID_PARAM, "Invalid level"); 867 871 } 872 868 873 $query = ' 869 874 UPDATE '.IMAGES_TABLE.' … … 951 956 { 952 957 unlink($output_filepath); 953 958 954 959 if (is_file($output_filepath)) 955 960 { … … 958 963 } 959 964 } 960 965 961 966 $upload_dir = PHPWG_ROOT_PATH.'upload/buffer'; 962 967 $pattern = '/'.$original_sum.'-'.$type.'/'; … … 983 988 984 989 $i = 0; 985 990 986 991 foreach ($chunks as $chunk) 987 992 { … … 1015 1020 1016 1021 $upload_dir = dirname($file_path); 1017 1022 1018 1023 if (!is_dir($upload_dir)) { 1019 1024 umask(0000); … … 1102 1107 // 1103 1108 $update = array(); 1104 1109 1105 1110 if ('high' == $params['type']) 1106 1111 { … … 1121 1126 { 1122 1127 $update['id'] = $params['image_id']; 1123 1128 1124 1129 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 1125 1130 mass_updates( … … 1840 1845 exit(); 1841 1846 } 1842 1847 1843 1848 $query = ' 1844 1849 SELECT … … 1858 1863 exit(); 1859 1864 } 1860 1865 1861 1866 $to_update_cat_ids = array(); 1862 1867 1863 1868 // in case of replace mode, we first check the existing associations 1864 1869 $query = ' … … 1885 1890 } 1886 1891 } 1887 1892 1888 1893 $new_cat_ids = array_diff($cat_ids, $existing_cat_ids); 1889 1894 if (count($new_cat_ids) == 0) … … 1891 1896 return true; 1892 1897 } 1893 1898 1894 1899 if ($search_current_ranks) 1895 1900 { … … 1915 1920 $current_rank_of[$cat_id] = 0; 1916 1921 } 1917 1922 1918 1923 if ('auto' == $rank_on_category[$cat_id]) 1919 1924 { … … 1922 1927 } 1923 1928 } 1924 1929 1925 1930 $inserts = array(); 1926 1931 1927 1932 foreach ($new_cat_ids as $cat_id) 1928 1933 { … … 1936 1941 ); 1937 1942 } 1938 1943 1939 1944 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 1940 1945 mass_inserts( … … 1943 1948 $inserts 1944 1949 ); 1945 1950 1946 1951 update_category($new_cat_ids); 1947 1952 } -
trunk/template-common/scripts.js
r3282 r4513 112 112 this.transport.onreadystatechange = this.onStateChange.pwgBind(this); 113 113 114 var url = this.urlRoot; 115 url += "ws.php?format=json&method="+method; 114 var url = this.urlRoot+"ws.php?format=json"; 115 116 var body = "method="+method; 116 117 if (parameters) 117 118 { … … 121 122 { 122 123 for (var i=0; i<parameters[property].length; i++) 123 url+= "&"+property+"[]="+encodeURIComponent(parameters[property][i]);124 body += "&"+property+"[]="+encodeURIComponent(parameters[property][i]); 124 125 } 125 126 else 126 url+= "&"+property+"="+encodeURIComponent(parameters[property]);127 body += "&"+property+"="+encodeURIComponent(parameters[property]); 127 128 } 128 129 } 129 this.transport.open(this.options.method, url, this.options.async); 130 this.transport.send(null); 130 131 if (this.options.method == "POST" ) 132 { 133 this.transport.open(this.options.method, url, this.options.async); 134 this.transport.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 135 this.transport.send(body); 136 } 137 else 138 { 139 url += "&"+body; 140 this.transport.open(this.options.method, url, this.options.async); 141 this.transport.send(null); 142 } 131 143 }, 132 144 -
trunk/template/yoga/picture.tpl
r3445 r4513 215 215 "pwg.images.setPrivacyLevel", {image_id: id, level:level} , 216 216 { 217 method: "POST", 217 218 onFailure: function(num, text) { selectElement.disabled = false; alert(num + " " + text); }, 218 219 onSuccess: function(result) { selectElement.disabled = false; } -
trunk/ws.php
r4460 r4513 137 137 'level' => array('maxValue'=>$conf['available_permission_levels']), 138 138 ), 139 'sets the privacy levels for the images '139 'sets the privacy levels for the images (POST method only)' 140 140 ); 141 141 … … 279 279 array( 280 280 'image_id' => array(), 281 281 282 282 'name' => array('default' => null), 283 283 'author' => array('default' => null), … … 298 298 <br><b>multiple_value_mode</b> can be "append" (no change on existing values, add the new values) or "replace" and applies to multiple values properties like tag_ids/categories' 299 299 ); 300 300 301 301 $service->addMethod( 302 302 'pwg.categories.setInfo', … … 304 304 array( 305 305 'category_id' => array(), 306 306 307 307 'name' => array('default' => null), 308 308 'comment' => array('default' => null),
Note: See TracChangeset
for help on using the changeset viewer.