Changeset 7669 for extensions/Autosize/autosize.inc.php
- Timestamp:
- Nov 6, 2010, 4:43:08 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/autosize.inc.php
r7642 r7669 46 46 $autosize_parametres = cl_autosize_Get_Options(); 47 47 include (AUTOSIZE_PATH."include/affiche.php"); 48 $debug = isset($conf['debug']) ? $conf['debug'] : 'false';48 $debug = isset($conf['debug']) ? $conf['debug'] : false ; 49 49 $cl_visible=isset($conf['cl_auto']) ? $conf['cl_auto'] : 'true' ; 50 50 … … 99 99 global $template,$infos_message,$erreur_message, $user ; 100 100 global $conf,$lang ; 101 101 102 102 //============================================================== 103 103 if (isset($erreur_message)) … … 130 130 * conflit ============================================= 131 131 */ 132 static public function cl_autosize_script_2($pictures) 133 { 134 global $template,$user,$conf,$picture ; 135 136 $my_path = basename(dirname(__FILE__)).'/' ; 137 $my_path = dirname(__FILE__).'/'; 138 $template->set_filenames( 139 array('autosize_init'=>$my_path. "template/cl_conflit.tpl" 140 ) 141 ); 142 $template->assign( 143 array('AUTOSIZE_ROOT' => AUTOSIZE_PATH) 144 ); 145 146 147 return $pictures; 148 } 132 149 static public function cl_autosize_script() 133 150 { … … 135 152 136 153 $my_path = basename(dirname(__FILE__)).'/' ; 137 $my_path = dirname(__FILE__).'/';154 $my_path = dirname(__FILE__).'/'; 138 155 $template->set_filenames( 139 156 array('autosize_init'=>$my_path. "template/conflit.tpl" … … 148 165 149 166 }// function cl_autosize_script 150 static public function cl_add_css(){151 global $template,$user,$conf,$picture ;152 $path = get_root_url().'plugins/'. basename(dirname(__FILE__)).'/';153 $template->append('head_elements', '154 <link rel="stylesheet" type="text/css" href="'.$path.'css/autosize.css">155 <script type="text/javascript" src="'.$path.'js/css.js"></script>156 <script type="text/javascript">157 158 </script>'159 );160 }161 167 /* 162 168 * … … 165 171 global $template,$user,$conf,$picture ; 166 172 $my_path = realpath(AUTOSIZE_PATH .'/'); 167 168 173 $userdata=$user; 174 $fields = array( 'maxwidth', 'maxheight' ); 169 175 170 176 $ThePicture = $template->get_template_vars('current'); 171 177 $data = array(); 172 178 173 179 174 180 return $content; 175 181 176 182 $data['maxwidth'] = '1200'; 177 183 $data['maxheight'] ='250'; 178 184 $data['user_id'] = $userdata['id']; 179 foreach ($fields as $field){ 180 if (isset($_POST[$field])){ 181 $data[$field] = $_POST[$field]; 182 } 183 } 185 foreach ($fields as $field) 186 { 187 if (isset($_POST[$field])) 188 { 189 $data[$field] = $_POST[$field]; 190 } 191 } 184 192 185 if($data['maxwidth'] != "" ){ 193 if($data['maxwidth'] != "" ) 194 { 186 195 $picture['current']['scaled_width']=$data['maxwidth']; 187 196 $picture['current']['scaled_height']=$data['maxheight']; 188 mass_updates(USER_INFOS_TABLE, 189 array('primary' => array('user_id'), 'update' => $fields), 190 array($data)); 191 } 197 mass_updates(USER_INFOS_TABLE, 198 array('primary' => array('user_id'), 'update' => $fields), 199 array($data)); 200 201 } 202 203 192 204 return $content; 193 205 /* 194 206 $template->assign( 195 207 array( 196 208 'AUTOSIZE_PATH' => $my_path, … … 199 211 ); 200 212 201 202 213 $template->parse( 'autosize_cl_init', false); 214 return $content; 203 215 */ 204 216
Note: See TracChangeset
for help on using the changeset viewer.