Changeset 30702 for extensions
- Timestamp:
- Dec 6, 2014, 8:32:09 AM (10 years ago)
- Location:
- extensions/manage_properties_photos
- Files:
-
- 11 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/manage_properties_photos/admin.php
r30676 r30702 5 5 global $template, $conf, $user; 6 6 include_once(PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php'); 7 load_language('plugin.lang', ADD_ INFO_PHOTO_PATH);7 load_language('plugin.lang', ADD_PROP_PHOTO_PATH); 8 8 $my_base_url = get_admin_plugin_menu_link(__FILE__); 9 9 … … 15 15 //-------------------------------------------------------- sections definitions 16 16 if (!isset($_GET['tab'])) 17 $page['tab'] = 'define_ information';17 $page['tab'] = 'define_properties'; 18 18 else 19 19 $page['tab'] = $_GET['tab']; … … 22 22 if ($page['tab'] != 'iap') { 23 23 $tabsheet = new tabsheet(); 24 $tabsheet->add('addip', l10n('Information\'s organization'), ADD_INFO_PHOTO_ADMIN . '-define_information'); 25 //$tabsheet->add('configuration', l10n('Configuration'), ADD_INFO_PHOTO_ADMIN . '-configuration'); 24 $tabsheet->add('addip', l10n('Property'), ADD_PROP_PHOTO_ADMIN . '-define_properties'); 26 25 $tabsheet->select($page['tab']); 27 26 $tabsheet->assign(); … … 62 61 while ($info_photos = pwg_db_fetch_assoc($tab_add_info_one_photo)) { 63 62 64 $d = data_info_photos($id_img, $info_photos['id_ info_pho']);63 $d = data_info_photos($id_img, $info_photos['id_prop_pho']); 65 64 $row = pwg_db_fetch_assoc($d); 66 65 67 66 $items = array( 68 67 'IDPHO' => $_GET['image_id'], 69 'IDINFOPHO' => $info_photos['id_ info_pho'],70 'AIP DESIGNATION' => trigger_change('AP_render_content',$info_photos['designation']),68 'IDINFOPHO' => $info_photos['id_prop_pho'], 69 'AIPWORDING' => trigger_change('AP_render_content',$info_photos['wording']), 71 70 'AIPDATA' => $row['data'], 72 71 ); … … 77 76 78 77 if (isset($_POST['submitaddinfoimg'])) { 79 foreach ($_POST['data'] AS $id_ info_pho => $data) {80 $q = 'SELECT 1 FROM ' . ADD_ INFO_PHOTO_DATA_TABLE . ' WHERE id_img=' . $id_img . ' AND id_info_pho=' . $id_info_pho;78 foreach ($_POST['data'] AS $id_prop_pho => $data) { 79 $q = 'SELECT 1 FROM ' . ADD_PROP_PHOTO_DATA_TABLE . ' WHERE id_img=' . $id_img . ' AND id_prop_pho=' . $id_prop_pho; 81 80 $test = pwg_query($q); 82 81 $row = pwg_db_fetch_assoc($test); 83 82 if (count($row) > 0) { 84 83 if ($data != '') { 85 $query = 'UPDATE ' . $prefixeTable . 'add_ info_photos_data SET data="' . $data . '" WHERE id_img=' . $id_img . ' AND id_info_pho=' . $id_info_pho;84 $query = 'UPDATE ' . $prefixeTable . 'add_properties_photos_data SET data="' . $data . '" WHERE id_img=' . $id_img . ' AND id_prop_pho=' . $id_prop_pho; 86 85 pwg_query($query); 87 86 } else { 88 $query = 'DELETE FROM ' . $prefixeTable . 'add_ info_photos_data WHERE id_img=' . $id_img . ' AND id_info_pho=' . $id_info_pho;87 $query = 'DELETE FROM ' . $prefixeTable . 'add_properties_photos_data WHERE id_img=' . $id_img . ' AND id_prop_pho=' . $id_prop_pho; 89 88 pwg_query($query); 90 89 } 91 90 } else if ($data != '') { 92 $query = 'INSERT ' . $prefixeTable . 'add_ info_photos_data(id_img,id_info_pho,data) VALUES (' . $id_img . ',' . $id_info_pho . ',"' . $data . '");';91 $query = 'INSERT ' . $prefixeTable . 'add_properties_photos_data(id_img,id_prop_pho,data) VALUES (' . $id_img . ',' . $id_prop_pho . ',"' . $data . '");'; 93 92 pwg_query($query); 94 93 } 95 94 96 95 } 97 $redirect_url = ADD_ INFO_PHOTO_ADMIN . '-iap&image_id=' . $id_img;98 $_SESSION['page_infos'] = array(l10n('P ersonal info photoupdate'));96 $redirect_url = ADD_PROP_PHOTO_ADMIN . '-iap&image_id=' . $id_img; 97 $_SESSION['page_infos'] = array(l10n('Properties update')); 99 98 redirect($redirect_url); 100 99 } … … 102 101 103 102 switch ($page['tab']) { 104 case 'define_ information':105 $admin_base_url = ADD_ INFO_PHOTO_ADMIN . '-define_information';103 case 'define_properties': 104 $admin_base_url = ADD_PROP_PHOTO_ADMIN . '-define_properties'; 106 105 $template->assign( 107 106 'addinfotemplate', array( 108 107 'addinfo' => l10n('addinfo'), 109 'U_HOMEP' => $admin_base_url, 110 111 )); 108 )); 112 109 113 110 $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';")); … … 119 116 } 120 117 121 $admin_base_url = ADD_ INFO_PHOTO_ADMIN . '-define_information';118 $admin_base_url = ADD_PROP_PHOTO_ADMIN . '-define_properties'; 122 119 $tab_info_photos = tab_info_photos(); 123 120 124 121 if (pwg_db_num_rows($tab_info_photos)) { 125 122 while ($info_photos = pwg_db_fetch_assoc($tab_info_photos)) { 126 if($info_photos['id_ info_pho']==1){127 $items = array( 128 'IDINFOPHO' => $info_photos['id_ info_pho'],129 'AIP DESIGNATION' => l10n('Author'),130 'AIPORDER' => $info_photos['order info'],131 'AIPACTIVE' => $info_photos['active'], 132 'AIPEDIT' => $info_photos['edit'], 133 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_ info_pho'],134 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_ info_pho'],135 ); 136 }else if($info_photos['id_ info_pho']==2){137 $items = array( 138 'IDINFOPHO' => $info_photos['id_ info_pho'],139 'AIP DESIGNATION' => l10n('Created on'),140 'AIPORDER' => $info_photos['order info'],141 'AIPACTIVE' => $info_photos['active'], 142 'AIPEDIT' => $info_photos['edit'], 143 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_ info_pho'],144 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_ info_pho'],145 ); 146 }else if($info_photos['id_ info_pho']==3){147 $items = array( 148 'IDINFOPHO' => $info_photos['id_ info_pho'],149 'AIP DESIGNATION' => l10n('Posted on'),150 'AIPORDER' => $info_photos['order info'],151 'AIPACTIVE' => $info_photos['active'], 152 'AIPEDIT' => $info_photos['edit'], 153 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_ info_pho'],154 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_ info_pho'],155 ); 156 }else if($info_photos['id_ info_pho']==4){157 $items = array( 158 'IDINFOPHO' => $info_photos['id_ info_pho'],159 'AIP DESIGNATION' => l10n('Dimensions'),160 'AIPORDER' => $info_photos['order info'],161 'AIPACTIVE' => $info_photos['active'], 162 'AIPEDIT' => $info_photos['edit'], 163 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_ info_pho'],164 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_ info_pho'],165 ); 166 }else if($info_photos['id_ info_pho']==5){167 $items = array( 168 'IDINFOPHO' => $info_photos['id_ info_pho'],169 'AIP DESIGNATION' => l10n('File'),170 'AIPORDER' => $info_photos['order info'],171 'AIPACTIVE' => $info_photos['active'], 172 'AIPEDIT' => $info_photos['edit'], 173 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_ info_pho'],174 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_ info_pho'],175 ); 176 }else if($info_photos['id_ info_pho']==6){177 $items = array( 178 'IDINFOPHO' => $info_photos['id_ info_pho'],179 'AIP DESIGNATION' => l10n('Filesize'),180 'AIPORDER' => $info_photos['order info'],181 'AIPACTIVE' => $info_photos['active'], 182 'AIPEDIT' => $info_photos['edit'], 183 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_ info_pho'],184 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_ info_pho'],185 ); 186 }else if($info_photos['id_ info_pho']==7){187 $items = array( 188 'IDINFOPHO' => $info_photos['id_ info_pho'],189 'AIP DESIGNATION' => l10n('Tags'),190 'AIPORDER' => $info_photos['order info'],191 'AIPACTIVE' => $info_photos['active'], 192 'AIPEDIT' => $info_photos['edit'], 193 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_ info_pho'],194 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_ info_pho'],195 ); 196 }else if($info_photos['id_ info_pho']==8){197 $items = array( 198 'IDINFOPHO' => $info_photos['id_ info_pho'],199 'AIP DESIGNATION' => l10n('Albums'),200 'AIPORDER' => $info_photos['order info'],201 'AIPACTIVE' => $info_photos['active'], 202 'AIPEDIT' => $info_photos['edit'], 203 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_ info_pho'],204 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_ info_pho'],205 ); 206 }else if($info_photos['id_ info_pho']==9){207 $items = array( 208 'IDINFOPHO' => $info_photos['id_ info_pho'],209 'AIP DESIGNATION' => l10n('Visits'),210 'AIPORDER' => $info_photos['order info'],211 'AIPACTIVE' => $info_photos['active'], 212 'AIPEDIT' => $info_photos['edit'], 213 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_ info_pho'],214 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_ info_pho'],215 ); 216 }else if($info_photos['id_ info_pho']==10){217 $items = array( 218 'IDINFOPHO' => $info_photos['id_ info_pho'],219 'AIP DESIGNATION' => l10n('Average'),220 'AIPORDER' => $info_photos['order info'],221 'AIPACTIVE' => $info_photos['active'], 222 'AIPEDIT' => $info_photos['edit'], 223 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_ info_pho'],224 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_ info_pho'],225 ); 226 }else if($info_photos['id_ info_pho']==11){227 $items = array( 228 'IDINFOPHO' => $info_photos['id_ info_pho'],229 'AIP DESIGNATION' => l10n('Who can see this photo?'),230 'AIPORDER' => $info_photos['order info'],231 'AIPACTIVE' => $info_photos['active'], 232 'AIPEDIT' => $info_photos['edit'], 233 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_ info_pho'],234 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_ info_pho'],123 if($info_photos['id_prop_pho']==1){ 124 $items = array( 125 'IDINFOPHO' => $info_photos['id_prop_pho'], 126 'AIPWORDING' => l10n('Author'), 127 'AIPORDER' => $info_photos['orderprop'], 128 'AIPACTIVE' => $info_photos['active'], 129 'AIPEDIT' => $info_photos['edit'], 130 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'], 131 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'], 132 ); 133 }else if($info_photos['id_prop_pho']==2){ 134 $items = array( 135 'IDINFOPHO' => $info_photos['id_prop_pho'], 136 'AIPWORDING' => l10n('Created on'), 137 'AIPORDER' => $info_photos['orderprop'], 138 'AIPACTIVE' => $info_photos['active'], 139 'AIPEDIT' => $info_photos['edit'], 140 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'], 141 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'], 142 ); 143 }else if($info_photos['id_prop_pho']==3){ 144 $items = array( 145 'IDINFOPHO' => $info_photos['id_prop_pho'], 146 'AIPWORDING' => l10n('Posted on'), 147 'AIPORDER' => $info_photos['orderprop'], 148 'AIPACTIVE' => $info_photos['active'], 149 'AIPEDIT' => $info_photos['edit'], 150 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'], 151 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'], 152 ); 153 }else if($info_photos['id_prop_pho']==4){ 154 $items = array( 155 'IDINFOPHO' => $info_photos['id_prop_pho'], 156 'AIPWORDING' => l10n('Dimensions'), 157 'AIPORDER' => $info_photos['orderprop'], 158 'AIPACTIVE' => $info_photos['active'], 159 'AIPEDIT' => $info_photos['edit'], 160 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'], 161 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'], 162 ); 163 }else if($info_photos['id_prop_pho']==5){ 164 $items = array( 165 'IDINFOPHO' => $info_photos['id_prop_pho'], 166 'AIPWORDING' => l10n('File'), 167 'AIPORDER' => $info_photos['orderprop'], 168 'AIPACTIVE' => $info_photos['active'], 169 'AIPEDIT' => $info_photos['edit'], 170 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'], 171 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'], 172 ); 173 }else if($info_photos['id_prop_pho']==6){ 174 $items = array( 175 'IDINFOPHO' => $info_photos['id_prop_pho'], 176 'AIPWORDING' => l10n('Filesize'), 177 'AIPORDER' => $info_photos['orderprop'], 178 'AIPACTIVE' => $info_photos['active'], 179 'AIPEDIT' => $info_photos['edit'], 180 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'], 181 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'], 182 ); 183 }else if($info_photos['id_prop_pho']==7){ 184 $items = array( 185 'IDINFOPHO' => $info_photos['id_prop_pho'], 186 'AIPWORDING' => l10n('Tags'), 187 'AIPORDER' => $info_photos['orderprop'], 188 'AIPACTIVE' => $info_photos['active'], 189 'AIPEDIT' => $info_photos['edit'], 190 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'], 191 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'], 192 ); 193 }else if($info_photos['id_prop_pho']==8){ 194 $items = array( 195 'IDINFOPHO' => $info_photos['id_prop_pho'], 196 'AIPWORDING' => l10n('Albums'), 197 'AIPORDER' => $info_photos['orderprop'], 198 'AIPACTIVE' => $info_photos['active'], 199 'AIPEDIT' => $info_photos['edit'], 200 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'], 201 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'], 202 ); 203 }else if($info_photos['id_prop_pho']==9){ 204 $items = array( 205 'IDINFOPHO' => $info_photos['id_prop_pho'], 206 'AIPWORDING' => l10n('Visits'), 207 'AIPORDER' => $info_photos['orderprop'], 208 'AIPACTIVE' => $info_photos['active'], 209 'AIPEDIT' => $info_photos['edit'], 210 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'], 211 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'], 212 ); 213 }else if($info_photos['id_prop_pho']==10){ 214 $items = array( 215 'IDINFOPHO' => $info_photos['id_prop_pho'], 216 'AIPWORDING' => l10n('Average'), 217 'AIPORDER' => $info_photos['orderprop'], 218 'AIPACTIVE' => $info_photos['active'], 219 'AIPEDIT' => $info_photos['edit'], 220 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'], 221 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'], 222 ); 223 }else if($info_photos['id_prop_pho']==11){ 224 $items = array( 225 'IDINFOPHO' => $info_photos['id_prop_pho'], 226 'AIPWORDING' => l10n('Who can see this photo?'), 227 'AIPORDER' => $info_photos['orderprop'], 228 'AIPACTIVE' => $info_photos['active'], 229 'AIPEDIT' => $info_photos['edit'], 230 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'], 231 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'], 235 232 ); 236 233 }else{ 237 234 $items = array( 238 'IDINFOPHO' => $info_photos['id_ info_pho'],239 'AIP DESIGNATION' => trigger_change('AP_render_content',$info_photos['designation']),240 'AIP ORDER' => $info_photos['orderinfo'],241 'AIP ACTIVE' => $info_photos['active'],242 'AIP EDIT' => $info_photos['edit'],243 ' U_DELETE' => $admin_base_url . '&delete=' . $info_photos['id_info_pho'],244 'U_ EDIT' => $admin_base_url . '&edit=' . $info_photos['id_info_pho'],245 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_ info_pho'],246 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_ info_pho'],235 'IDINFOPHO' => $info_photos['id_prop_pho'], 236 'AIPWORDING' => trigger_change('AP_render_content',$info_photos['wording']), 237 'AIPWORDING2' => $info_photos['wording'], 238 'AIPORDER' => $info_photos['orderprop'], 239 'AIPACTIVE' => $info_photos['active'], 240 'AIPEDIT' => $info_photos['edit'], 241 'U_DELETE' => $admin_base_url . '&delete=' . $info_photos['id_prop_pho'], 242 'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'], 243 'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'], 247 244 ); 248 245 } … … 258 255 foreach ($_POST['infoOrd'] as $id =>$val){ 259 256 260 $data[] = array('id_ info_pho' => $id, 'orderinfo' => $val+1);261 } 262 $fields = array('primary' => array('id_ info_pho'), 'update' => array('orderinfo'));263 mass_updates(ADD_ INFO_PHOTO_TABLE, $fields, $data);264 265 $page['infos'][] = l10n(' Infomanual order was saved');257 $data[] = array('id_prop_pho' => $id, 'orderprop' => $val+1); 258 } 259 $fields = array('primary' => array('id_prop_pho'), 'update' => array('orderprop')); 260 mass_updates(ADD_PROP_PHOTO_TABLE, $fields, $data); 261 262 $page['infos'][] = l10n('Properties manual order was saved'); 266 263 redirect($admin_base_url); 267 264 } 268 269 if (isset($_POST['submitaddinfo'])) { 270 $template->assign( 271 'addinfo_edit2', array( 272 'AIPID' => 0, 273 'AIPDESC' => null, 274 'AIPACTIF' => 0, 275 )); 276 277 } 265 278 266 if (isset($_POST['submitaddAIP'])) { 279 267 if (!isset($_POST['inseractive'])) { … … 281 269 } 282 270 if ($_POST['invisibleID'] == 0) { 283 $result = pwg_query('SELECT MAX(order info) FROM piwigo_add_info_photos');271 $result = pwg_query('SELECT MAX(orderprop) FROM '. ADD_PROP_PHOTO_TABLE ); 284 272 $row = pwg_db_fetch_assoc($result); 285 $or = ($row['MAX(order info)'] + 1);273 $or = ($row['MAX(orderprop)'] + 1); 286 274 287 275 $q = ' 288 INSERT INTO ' . $prefixeTable . 'add_ Info_photos(designation,orderinfo,active,edit)VALUES ("' . $_POST['inserdesignation'] . '","' . $or . '","' . $_POST['inseractive'] . '",1);';276 INSERT INTO ' . $prefixeTable . 'add_properties_photos(wording,orderprop,active,edit)VALUES ("' . $_POST['inserwording'] . '","' . $or . '","' . $_POST['inseractive'] . '",1);'; 289 277 pwg_query($q); 290 $_SESSION['page_infos'] = array(l10n('P ersonal infophoto add'));278 $_SESSION['page_infos'] = array(l10n('Property photo add')); 291 279 } else { 292 280 $q = ' 293 UPDATE ' . $prefixeTable . 'add_ Info_photos'294 . ' set designation ="' . $_POST['inserdesignation'] . '" '281 UPDATE ' . $prefixeTable . 'add_properties_photos' 282 . ' set wording ="' . $_POST['inserwording'] . '" ' 295 283 . ' ,active=' . $_POST['inseractive'] 296 . ' WHERE id_ info_pho=' . $_POST['invisibleID'] . ';';284 . ' WHERE id_prop_pho=' . $_POST['invisibleID'] . ';'; 297 285 pwg_query($q); 298 $_SESSION['page_infos'] = array(l10n('P ersonal infophoto update'));286 $_SESSION['page_infos'] = array(l10n('Property photo update')); 299 287 } 300 288 redirect($admin_base_url); 301 }302 303 if (isset($_GET['edit'])) {304 check_input_parameter('edit', $_GET, false, PATTERN_ID);305 306 $result = tab_info_photos($_GET['edit']);307 $row = pwg_db_fetch_assoc($result);308 $template->assign(309 'addinfo_edit2', array(310 'AIPID' => $row['id_info_pho'],311 'AIPDESC' => $row['designation'],312 'AIPACTIF' => $row['active'],313 ));314 289 } 315 290 316 291 if (isset($_GET['delete'])) { 317 292 check_input_parameter('delete', $_GET, false, PATTERN_ID); 318 $query = 'DELETE FROM ' . ADD_ INFO_PHOTO_TABLE . ' WHERE id_info_pho = ' . $_GET['delete'] . ';';293 $query = 'DELETE FROM ' . ADD_PROP_PHOTO_TABLE . ' WHERE id_prop_pho = ' . $_GET['delete'] . ';'; 319 294 pwg_query($query); 320 $query = 'DELETE FROM ' . ADD_ INFO_PHOTO_DATA_TABLE . ' WHERE id_info_pho = ' . $_GET['delete'] . ';';295 $query = 'DELETE FROM ' . ADD_PROP_PHOTO_DATA_TABLE . ' WHERE id_prop_pho = ' . $_GET['delete'] . ';'; 321 296 pwg_query($query); 322 297 323 $_SESSION['page_infos'] = array(l10n('P ersonal infodelete'));298 $_SESSION['page_infos'] = array(l10n('Property delete')); 324 299 redirect($admin_base_url); 325 300 } … … 327 302 if (isset($_GET['hide'])) { 328 303 check_input_parameter('hide', $_GET, false, PATTERN_ID); 329 $query = 'UPDATE ' . ADD_ INFO_PHOTO_TABLE . ' SET active = 1 WHERE id_info_pho=' . $_GET['hide'] . ';';304 $query = 'UPDATE ' . ADD_PROP_PHOTO_TABLE . ' SET active = 1 WHERE id_prop_pho=' . $_GET['hide'] . ';'; 330 305 pwg_query($query); 331 332 $_SESSION['page_infos'] = array(l10n('Info hide'));333 redirect($admin_base_url);334 306 } 335 307 336 308 if (isset($_GET['show'])) { 337 309 check_input_parameter('show', $_GET, false, PATTERN_ID); 338 $query = 'UPDATE ' . ADD_ INFO_PHOTO_TABLE . ' SET active = 0 WHERE id_info_pho=' . $_GET['show'] . ';';310 $query = 'UPDATE ' . ADD_PROP_PHOTO_TABLE . ' SET active = 0 WHERE id_prop_pho=' . $_GET['show'] . ';'; 339 311 pwg_query($query); 340 341 $_SESSION['page_infos'] = array(l10n('Info show'));342 redirect($admin_base_url);343 312 } 344 313 345 314 break; 346 case 'configuration': 347 global $conf; 348 349 $selected = $conf['add_Info_photos']; 350 $options['Author'] = l10n('Author'); 351 $options['datecreate'] = l10n('Created on'); 352 $options['datepost'] = l10n('Posted on'); 353 $options['Dimensions'] = l10n('Dimensions'); 354 $options['File'] = l10n('File'); 355 $options['Filesize'] = l10n('Filesize'); 356 $options['Tags'] = l10n('tags'); 357 $options['Categories'] = l10n('Albums'); 358 $options['Visits'] = l10n('Visits'); 359 $options['Average'] = l10n('Rating score'); 360 361 $template->assign( 362 'gestionA', array( 363 'OPTIONS' => $options, 364 'SELECTED' => $selected 365 )); 366 367 368 if (isset($_POST['add_Info_photos'])) { 369 conf_update_param('add_Info_photos', $_POST['add_Info_photos'], true); 370 $template->delete_compiled_templates(); 371 array_push($page['infos'], l10n('Your configuration settings are saved')); 372 373 $selected = $_POST['add_Info_photos']; 374 $template->assign( 375 'gestionA', array( 376 'OPTIONS' => $options, 377 'SELECTED' => $selected 378 )); 379 } 380 break; 381 382 case 'addinfo': 383 384 385 386 break; 387 } 315 } 388 316 389 317 -
extensions/manage_properties_photos/admin/admin.tpl
r30676 r30702 33 33 }); 34 34 35 jQuery('#aip_sumit').click(function(){ 36 jQuery("#add_info_edit").show(); 37 jQuery("#leg_add").show(); 38 jQuery("#leg_edit").hide(); 39 jQuery('#aip_add').empty(); 40 jQuery('#aip_hide').attr('checked', false); 41 jQuery('#hideid').val(0); 42 jQuery("textarea[name=inserwording]").focus(); 43 }); 44 45 jQuery("#addinfoClose").click(function(){ 46 jQuery("#add_info_edit").hide(); 47 }); 48 49 jQuery('.edit_libinfo').click(function(){ 50 var id_prop_photo=$(this).data('id'); 51 var lib=$(this).data('lib'); 52 var hide=$(this).data('hide'); 53 jQuery("#add_info_edit").show(); 54 jQuery("#leg_add").hide(); 55 jQuery("#leg_edit").show(); 56 jQuery('#hideid').val(id_prop_photo); 57 jQuery('#aip_add').text(lib); 58 if(hide==0){ 59 jQuery('#aip_hide').prop('checked', false); 60 }else{ 61 jQuery('#aip_hide').prop('checked', true); 62 } 63 jQuery("textarea[name=inserwording]").focus(); 64 }); 65 jQuery('.pphide').click(function(){ 66 var id= $(this).data('id'); 67 var link= $(this).data('link2'); 68 $.ajax({ 69 method: 'POST', 70 url: link, 71 success: function(Datalc,textStatus,jqXHR) { 72 jQuery('#pphide'+id).hide(); 73 jQuery('#ppshow'+id).show(); 74 jQuery('#iord_'+id).css("opacity","0.4"); 75 } 76 }); 77 }); 78 jQuery('.ppshow').click(function(){ 79 var id= $(this).data('id'); 80 var link= $(this).data('link2'); 81 $.ajax({ 82 method: 'POST', 83 url: link, 84 success: function(Datalc,textStatus,jqXHR) { 85 jQuery('#pphide'+id).show(); 86 jQuery('#ppshow'+id).hide(); 87 jQuery('#iord_'+id).css("opacity","1"); 88 } 89 }); 90 }); 35 91 }); 36 92 {/footer_script} 37 93 {html_style} 94 .mouse:hover{ 95 cursor:pointer; 96 } 97 {/html_style} 38 98 39 99 40 100 <div class="titrePage"> 41 <h2>{'Manage ment information on picture page'|@translate}</h2>101 <h2>{'Manage properties photos'|@translate}</h2> 42 102 </div> 43 103 {if isset ($addinfotemplate)} 44 <form method="post" action="{$addinfotemplate.U_HOMEP}" > 45 <fieldset> 46 <input class="submit" name="submitaddinfo" type="submit" value="{'Add info photo'|@translate}" /> 47 </fieldset> 48 </form> 49 {if isset ($addinfo_edit2)} 104 <p class="showCreateAlbum"> 105 <a href="#" id="aip_sumit" >{'Create new Property photo'|@translate} </a> 106 </p> 107 <div id="add_info_edit" style="display: none;"> 50 108 <form method="post" > 51 109 <fieldset> 52 <legend>{'Info add/edit'|@translate}</legend>53 <input type="hidden" name="invisibleID" value="{$addinfo_edit2.AIPID}">110 <legend><span id="leg_add">{'Create new Property photo'|@translate}</span><span id="leg_edit">{'Edit Property photo'|@translate}</span></legend> 111 <input id="hideid" type="hidden" name="invisibleID" value="{$addinfo_edit2.AIPID}"> 54 112 <p class="input"> 55 <label for="inser designation">{'Designation'|@translate}</label><br />56 <textarea {if $useED==1}placeholder="{'Use Extended Description tags...'|@translate}"{/if} style="margin-left:50px" rows="5" cols="50" class="description" name="inser designation" id="aip_add">{$addinfo_edit2.AIPDESC}</textarea>113 <label for="inserwording">{'Wording'|@translate}</label><br /> 114 <textarea {if $useED==1}placeholder="{'Use Extended Description tags...'|@translate}"{/if} style="margin-left:50px" rows="5" cols="50" class="description" name="inserwording" id="aip_add">{$addinfo_edit2.AIPDESC}</textarea> 57 115 {if $useED==1} 58 116 <a href="{$ROOT_URL}admin/popuphelp.php?page=extended_desc" onclick="popuphelp(this.href); return false;" title="{'Use Extended Description tags...'|translate}" style="vertical-align: middle; border: 0; margin: 0.5em;"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/help.png" class="button" alt="{'Use Extended Description tags...'|translate}'"></a> … … 61 119 <p class="input" style="width: 700px;"> 62 120 <label for="inseractive">{'Hide'|@translate}</label> 63 <input type="checkbox" name="inseractive" {if {$addinfo_edit2.AIPACTIF}==1}checked{/if} value="1">64 < div style="text-align:center;">121 <input id="aip_hide" type="checkbox" name="inseractive" {if {$addinfo_edit2.AIPACTIF}==1}checked{/if} value="1"> 122 <p class="actionButtons"> 65 123 <input class="submit" name="submitaddAIP" type="submit" value="{'Submit'|@translate}" /> 66 </div> 124 <a href="#" id="addinfoClose">{'Cancel'|@translate}</a> 125 </p> 67 126 </fieldset> 68 127 </form> 69 {/if}128 </div> 70 129 <form id="infoOrdering" method="post" > 71 <p id="manualOrderInfo" style="display:none ">130 <p id="manualOrderInfo" style="display:none; text-align: left"> 72 131 <input class="submit" name="submitManualOrderInfo" type="submit" value="{'Save order'|@translate}"> 73 132 {'... or '|@translate} <a href="#" id="cancelManualOrderInfo">{'cancel manual order'|@translate}</a> 74 133 </p> 75 134 <fieldset> 76 <legend>{' List info'|@translate}</legend>135 <legend>{'Properties List'|@translate}</legend> 77 136 <ul class="categoryUl"> 78 137 {foreach from=$info_photos item=infophoto} 79 <li class="categoryLi{if ($infophoto.AIPEDIT==1)} virtual_cat{/if}" id="iord_{$infophoto.IDINFOPHO}">138 <li {if ($infophoto.AIPACTIVE==0)}style="opacity: 1;"{else}style="opacity: 0.4;"{/if}class="categoryLi{if ($infophoto.AIPEDIT==1)} virtual_cat{/if}" id="iord_{$infophoto.IDINFOPHO}"> 80 139 <img src="{$themeconf.admin_icon_dir}/cat_move.png" class="drag_button" style="display:none;" alt="{'Drag to re-order'|@translate}" title="{'Drag to re-order'|@translate}"> 81 {$infophoto.AIP DESIGNATION}140 {$infophoto.AIPWORDING} 82 141 <input type="hidden" name="infoOrd[{$infophoto.IDINFOPHO}]" value="{$infophoto.AIPORDER}"> 83 142 <br /> 84 143 <span class="actiononphoto" style="display: none"> 85 <label>{'Hide'|@translate}</label> 86 {if ($infophoto.AIPACTIVE==0)} 87 <a href="{$infophoto.U_HIDE}"><span class="graphicalCheckbox icon-check-empty"></span></a> 88 {/if} 89 {if ($infophoto.AIPACTIVE==1)} 90 <a href="{$infophoto.U_SHOW}"><span class="graphicalCheckbox icon-check"></span></a> 91 {/if} 144 <span id="pphide{$infophoto.IDINFOPHO}" {if ($infophoto.AIPACTIVE==1)}style="display: none"{/if}class="graphicalCheckbox icon-check-empty mouse pphide" data-id="{$infophoto.IDINFOPHO}" data-link2="{$infophoto.U_HIDE}">{'Hide'|@translate}</span> 145 <span id="ppshow{$infophoto.IDINFOPHO}" {if ($infophoto.AIPACTIVE==0)}style="display: none"{/if}class="graphicalCheckbox icon-check mouse ppshow" data-id="{$infophoto.IDINFOPHO}" data-link2="{$infophoto.U_SHOW}">{'Hide'|@translate}</span> 92 146 {if ($infophoto.AIPEDIT==1)} 93 <a href="{$infophoto.U_EDIT}"> 94 <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/edit_s.png" alt="{'edit'|@translate}" title="{'edit'|@translate}" /> 95 </a> 147 <img class="edit_libinfo mouse" src="{$ROOT_URL}{$themeconf.admin_icon_dir}/edit_s.png" data-id="{$infophoto.IDINFOPHO}" data-lib="{$infophoto.AIPWORDING2}" data-hide="{$infophoto.AIPACTIVE}" alt="{'edit'|@translate}" title="{'edit'|@translate}" /> 96 148 <a href="{$infophoto.U_DELETE}" onclick="return confirm( document.getElementById('btn_delete').title + '\n\n' + '{'Are you sure?'|@translate|@escape:'javascript'}');"> 97 149 <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/delete.png" id="btn_delete" alt="{'delete'|@translate}" title="{'Delete'|@translate}" /> … … 106 158 </form> 107 159 {/if} 108 {if isset ($gestionA)}109 <div>110 <form method="post" >111 <fieldset>112 <legend>{'Add information before'|@translate}</legend>113 {html_options name="add_Info_photos" options=$gestionA.OPTIONS selected=$gestionA.SELECTED}114 <br>115 <br>116 <div style="text-align:center;">117 <input class="submit" name="submitpab" type="submit" value="{'Save Settings'|@translate}">118 </div>119 </fieldset>120 </form>121 </div>122 {/if}123 160 {if isset ($gestionD)} 124 161 <div> 125 162 <form method="post" > 126 163 <fieldset> 127 <legend>{' List info'|@translate}</legend>164 <legend>{'Properties additionals'|@translate}</legend> 128 165 <table> 129 166 {foreach from=$info_photos item=infophoto} 130 167 <tr> 131 <td style="width: 100px;"><span style="font-weight: bold; text-align: right;" >{$infophoto.AIP DESIGNATION}</span></td>168 <td style="width: 100px;"><span style="font-weight: bold; text-align: right;" >{$infophoto.AIPWORDING}</span></td> 132 169 <td><input type="text" size="150" maxlength="250" {if $useED==1}placeholder="{'Use Extended Description tags...'|@translate}"{/if} name="data[{$infophoto.IDINFOPHO}]" value="{$infophoto.AIPDATA}" /></td> 133 170 </tr> -
extensions/manage_properties_photos/include/function.aip.inc.php
r30631 r30702 1 1 <?php 2 /*picture*/ 2 3 function tab_add_info_one_photo($id_img){ 3 4 $query = ' 4 SELECT aip.id_ info_pho,aip.designation,aipd.data,aip.orderinfo5 FROM ' . ADD_ INFO_PHOTO_TABLE . ' AS aip6 LEFT JOIN ' . ADD_ INFO_PHOTO_DATA_TABLE . ' AS aipd ON aip.id_info_pho=aipd.id_info_pho5 SELECT aip.id_prop_pho,aip.wording,aipd.data,aip.orderprop 6 FROM ' . ADD_PROP_PHOTO_TABLE . ' AS aip 7 LEFT JOIN ' . ADD_PROP_PHOTO_DATA_TABLE . ' AS aipd ON aip.id_prop_pho=aipd.id_prop_pho 7 8 WHERE aipd.id_img = \'' . $id_img . '\' 8 9 AND aip.active = 0 9 ORDER BY aip.order infoASC10 ORDER BY aip.orderprop ASC 10 11 ;'; 11 12 12 13 return pwg_query($query); 13 14 } 14 15 /* 15 16 function tab_add_info_one_photo2($id_img){ 16 17 $query = ' 17 SELECT aip.id_ info_pho,aip.designation,aipd.data,aip.orderinfo18 FROM ' . ADD_ INFO_PHOTO_DATA_TABLE . ' AS aipd19 RIGHT JOIN ' . ADD_ INFO_PHOTO_TABLE . ' AS aip ON aip.id_info_pho=aipd.id_info_pho18 SELECT aip.id_prop_pho,aip.wording,aipd.data,aip.orderprop 19 FROM ' . ADD_PROP_PHOTO_DATA_TABLE . ' AS aipd 20 RIGHT JOIN ' . ADD_PROP_PHOTO_TABLE . ' AS aip ON aip.id_prop_pho=aipd.id_prop_pho 20 21 WHERE aipd.id_img = \'' . $id_img . '\' 21 22 AND aip.active = 0 22 ORDER BY aip.order infoASC23 ORDER BY aip.orderprop ASC 23 24 ;'; 24 25 25 26 return pwg_query($query); 26 27 } 27 28 */ 29 /*Admin*/ 28 30 function tab_add_info_by_photo(){ 29 31 $query = ' 30 SELECT id_ info_pho,designation31 FROM ' . ADD_ INFO_PHOTO_TABLE . '32 SELECT id_prop_pho,wording 33 FROM ' . ADD_PROP_PHOTO_TABLE . ' 32 34 WHERE active = 0 33 35 AND edit = 1 34 ORDER BY order infoASC36 ORDER BY orderprop ASC 35 37 ;'; 36 38 return pwg_query($query); 37 39 } 38 40 41 42 /*initpicture*/ 39 43 function tab_add_info_by_photo_show(){ 40 44 $query = ' 41 SELECT id_ info_pho,designation,orderinfo42 FROM ' . ADD_ INFO_PHOTO_TABLE . '45 SELECT id_prop_pho,wording,orderprop 46 FROM ' . ADD_PROP_PHOTO_TABLE . ' 43 47 WHERE active = 0 44 ORDER BY order infoASC48 ORDER BY orderprop ASC 45 49 ;'; 46 50 return pwg_query($query); 47 51 } 48 52 49 function data_info_photos($id_img=null,$id_info_pho=NULL){ 53 /*initpicture et admin*/ 54 function data_info_photos($id_img=null,$id_prop_pho=NULL){ 50 55 $query = ' 51 56 SELECT data 52 FROM ' . ADD_ INFO_PHOTO_DATA_TABLE;57 FROM ' . ADD_PROP_PHOTO_DATA_TABLE; 53 58 $wa='WHERE'; 54 59 if($id_img!=null){ 55 60 $query .=' '.$wa.' id_img='.$id_img;$wa='AND'; 56 61 } 57 if($id_ info_pho!=null){58 $query .=' '.$wa.' id_ info_pho='.$id_info_pho;$wa='AND';62 if($id_prop_pho!=null){ 63 $query .=' '.$wa.' id_prop_pho='.$id_prop_pho;$wa='AND'; 59 64 } 60 65 $query .= ';'; … … 62 67 } 63 68 64 65 function tab_info_photos($id_ info_pho=NULL){69 /*Admin*/ 70 function tab_info_photos($id_prop_pho=NULL){ 66 71 $query = ' 67 SELECT id_ info_pho,designation,orderinfo,active,edit68 FROM ' . ADD_ INFO_PHOTO_TABLE;69 if($id_ info_pho!=null){70 $query .= ' WHERE id_ info_pho='.$id_info_pho;72 SELECT id_prop_pho,wording,orderprop,active,edit 73 FROM ' . ADD_PROP_PHOTO_TABLE; 74 if($id_prop_pho!=null){ 75 $query .= ' WHERE id_prop_pho='.$id_prop_pho; 71 76 } 72 77 73 $query .= ' ORDER BY order infoASC78 $query .= ' ORDER BY orderprop ASC 74 79 ;'; 75 80 return pwg_query($query); -
extensions/manage_properties_photos/initadmin.php
r30631 r30702 5 5 6 6 function add_info_photo_admin_menu($menu) { 7 load_language('plugin.lang', ADD_ INFO_PHOTO_PATH);7 load_language('plugin.lang', ADD_PROP_PHOTO_PATH); 8 8 $menu[] = array( 9 'NAME' => l10n('Manage infos photos'),10 'URL' => ADD_ INFO_PHOTO_ADMIN,9 'NAME' => l10n('Manage properties photos'), 10 'URL' => ADD_PROP_PHOTO_ADMIN, 11 11 ); 12 12 return $menu; … … 22 22 { 23 23 $sheets['iap'] = array( 24 'caption' => l10n(' Info photos'),25 'url' => ADD_ INFO_PHOTO_ADMIN.'-iap&image_id='.$_GET['image_id'],24 'caption' => l10n('Properties additionals'), 25 'url' => ADD_PROP_PHOTO_ADMIN.'-iap&image_id='.$_GET['image_id'], 26 26 ); 27 27 } -
extensions/manage_properties_photos/initpicture.php
r30642 r30702 2 2 3 3 //Ajout du prefiltre 4 add_event_handler('loc_begin_picture', 'add_info_photo_pre', 56);4 add_event_handler('loc_begin_picture', 'add_info_photo_pre', 05); 5 5 6 6 function add_info_photo_pre() { … … 155 155 </div> 156 156 {else if $addinfophotos.AIPDATA} 157 <div id="add_info class="imageInfo">158 <dt class="label">{$addinfophotos.AIP DESIGNATION}</dt>157 <div id="add_info" class="imageInfo"> 158 <dt class="label">{$addinfophotos.AIPWORDING}</dt> 159 159 <dd class="value">{$addinfophotos.AIPDATA}</dd> 160 160 </div> … … 185 185 while ($info_photos = pwg_db_fetch_assoc($tab_add_info_one_photo)) { 186 186 187 $d = data_info_photos($page['image_id'], $info_photos['id_ info_pho']);187 $d = data_info_photos($page['image_id'], $info_photos['id_prop_pho']); 188 188 $row = pwg_db_fetch_assoc($d); 189 189 190 190 $items = array( 191 'AIPID' => $info_photos['id_ info_pho'],192 'AIPORDER' => $info_photos['order info'],193 'AIP DESIGNATION' => trigger_change('AP_render_content', $info_photos['designation']),191 'AIPID' => $info_photos['id_prop_pho'], 192 'AIPORDER' => $info_photos['orderprop'], 193 'AIPWORDING' => trigger_change('AP_render_content', $info_photos['wording']), 194 194 'AIPDATA' => trigger_change('AP_render_content', $row['data']), 195 195 ); -
extensions/manage_properties_photos/language/en_UK/description.txt
r30631 r30702 1 Add information about the photo page and organize information1 Add properties on photo page and organize this -
extensions/manage_properties_photos/language/en_UK/plugin.lang.php
r30652 r30702 1 1 <?php 2 2 //admin 3 $lang['Manage infos photos'] = 'Manage infos photos'; 4 $lang['Info photos'] = 'Info photos'; 5 $lang['Information\'s organization'] = 'Information\'s organization'; 6 $lang['Personal info photo update'] = 'Personal info photo update'; 7 $lang['Info manual order was saved'] = 'Info manual order was saved'; 8 $lang['Personal info photo add'] = 'Personal info photo add'; 9 $lang['Personal info delete'] = 'Personal info delete'; 10 $lang['Info hide'] = 'Hidden info'; 11 $lang['Info show'] = 'Info show'; 12 $lang['Management information on picture page'] = 'Management information on picture page'; 13 $lang['Add info photo'] = 'Add info photo'; 14 $lang['Info add/edit'] = 'Add/Edit info'; 15 $lang['Designation'] = 'Designation'; 16 $lang['List info'] = 'Info list'; 3 $lang['Manage properties photos'] = 'Manage properties photos'; 4 $lang['Properties additionals'] = 'Properties additionals'; 5 $lang['Property'] = 'Property'; 6 $lang['Properties update'] = 'Properties update'; 7 $lang['Properties manual order was saved'] = 'Properties manual order was saved'; 8 $lang['Property photo add'] = 'Property photo add'; 9 $lang['Property photo update'] = 'Property photo update'; 10 $lang['Property delete'] = 'Property delete'; 11 $lang['Create new Property photo'] = 'Create new Property photo'; 12 $lang['Edit Property photo'] = 'Edit Property photo'; 13 $lang['Wording'] = 'Wording'; 14 $lang['Properties List'] = 'Properties List'; 15 $lang['Properties additionals'] = 'Properties additionals'; -
extensions/manage_properties_photos/main.inc.php
r30641 r30702 1 1 <?php 2 2 /* 3 Plugin Name: Manage Infos Photos3 Plugin Name: Manage Properties Photos 4 4 Version: auto 5 Description: Can add information on photos5 Description: Add properties on photo page and organize this 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=783 7 7 Author: ddtddt … … 13 13 global $prefixeTable; 14 14 15 define('ADD_ INFO_PHOTO_DIR' , basename(dirname(__FILE__)));16 define('ADD_ INFO_PHOTO_PATH' , PHPWG_PLUGINS_PATH . ADD_INFO_PHOTO_DIR . '/');17 if (!defined('ADD_ INFO_PHOTO_TABLE')) define('ADD_INFO_PHOTO_TABLE', $prefixeTable.'add_Info_photos');18 if (!defined('ADD_ INFO_PHOTO_DATA_TABLE')) define('ADD_INFO_PHOTO_DATA_TABLE', $prefixeTable.'add_Info_photos_data');19 define('ADD_ INFO_PHOTO_ADMIN',get_root_url().'admin.php?page=plugin-'.ADD_INFO_PHOTO_DIR);15 define('ADD_PROP_PHOTO_DIR' , basename(dirname(__FILE__))); 16 define('ADD_PROP_PHOTO_PATH' , PHPWG_PLUGINS_PATH . ADD_PROP_PHOTO_DIR . '/'); 17 if (!defined('ADD_PROP_PHOTO_TABLE')) define('ADD_PROP_PHOTO_TABLE', $prefixeTable.'add_properties_photos'); 18 if (!defined('ADD_PROP_PHOTO_DATA_TABLE')) define('ADD_PROP_PHOTO_DATA_TABLE', $prefixeTable.'add_properties_photos_data'); 19 define('ADD_PROP_PHOTO_ADMIN',get_root_url().'admin.php?page=plugin-'.ADD_PROP_PHOTO_DIR); 20 20 21 include_once(ADD_ INFO_PHOTO_PATH . 'include/function.aip.inc.php');21 include_once(ADD_PROP_PHOTO_PATH . 'include/function.aip.inc.php'); 22 22 23 23 // Plugin on picture page -
extensions/manage_properties_photos/maintain.class.php
r30676 r30702 2 2 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 3 3 4 class manage_ info_photos_maintain extends PluginMaintain4 class manage_properties_photos_maintain extends PluginMaintain 5 5 { 6 6 private $installed = false; … … 13 13 global $prefixeTable; 14 14 15 if (!defined('ADD_ INFO_PHOTO_TABLE')) define('ADD_INFO_PHOTO_TABLE', $prefixeTable.'add_Info_photos');16 $query = "CREATE TABLE IF NOT EXISTS ". ADD_ INFO_PHOTO_TABLE ." (17 id_ info_pho SMALLINT(5) UNSIGNED NOT NULL auto_increment,18 designationVARCHAR(255) NOT NULL ,19 order infoSMALLINT(5) UNSIGNED NOT NULL ,15 if (!defined('ADD_PROP_PHOTO_TABLE')) define('ADD_PROP_PHOTO_TABLE', $prefixeTable.'add_properties_photos'); 16 $query = "CREATE TABLE IF NOT EXISTS ". ADD_PROP_PHOTO_TABLE ." ( 17 id_prop_pho SMALLINT(5) UNSIGNED NOT NULL auto_increment, 18 wording VARCHAR(255) NOT NULL , 19 orderprop SMALLINT(5) UNSIGNED NOT NULL , 20 20 active SMALLINT(5) UNSIGNED NOT NULL , 21 21 edit SMALLINT(5) UNSIGNED NOT NULL , 22 PRIMARY KEY (id_ info_pho))DEFAULT CHARSET=utf8;";22 PRIMARY KEY (id_prop_pho))DEFAULT CHARSET=utf8;"; 23 23 $result = pwg_query($query); 24 24 25 if (!defined('ADD_ INFO_PHOTO_DATA_TABLE')) define('ADD_INFO_PHOTO_DATA_TABLE', $prefixeTable.'add_Info_photos_data');26 $query = "CREATE TABLE IF NOT EXISTS ". ADD_ INFO_PHOTO_DATA_TABLE ." (25 if (!defined('ADD_PROP_PHOTO_DATA_TABLE')) define('ADD_PROP_PHOTO_DATA_TABLE', $prefixeTable.'add_properties_photos_data'); 26 $query = "CREATE TABLE IF NOT EXISTS ". ADD_PROP_PHOTO_DATA_TABLE ." ( 27 27 id_img SMALLINT(5) UNSIGNED NOT NULL , 28 id_ info_pho SMALLINT(5) UNSIGNED NOT NULL ,28 id_prop_pho SMALLINT(5) UNSIGNED NOT NULL , 29 29 data VARCHAR(255) NOT NULL , 30 PRIMARY KEY (id_img,id_ info_pho))DEFAULT CHARSET=utf8;";30 PRIMARY KEY (id_img,id_prop_pho))DEFAULT CHARSET=utf8;"; 31 31 $result = pwg_query($query); 32 32 33 $q = 'INSERT INTO ' . $prefixeTable . 'add_ Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (1,"author",1,0,0);';33 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (1,"author",1,0,0);'; 34 34 pwg_query($q); 35 $q = 'INSERT INTO ' . $prefixeTable . 'add_ Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (2,"Created on",2,0,0);';35 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (2,"Created on",2,0,0);'; 36 36 pwg_query($q); 37 $q = 'INSERT INTO ' . $prefixeTable . 'add_ Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (3,"Posted on",3,0,0);';37 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (3,"Posted on",3,0,0);'; 38 38 pwg_query($q); 39 $q = 'INSERT INTO ' . $prefixeTable . 'add_ Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (4,"Dimensions",4,0,0);';39 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (4,"Dimensions",4,0,0);'; 40 40 pwg_query($q); 41 $q = 'INSERT INTO ' . $prefixeTable . 'add_ Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (5,"File",5,0,0);';41 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (5,"File",5,0,0);'; 42 42 pwg_query($q); 43 $q = 'INSERT INTO ' . $prefixeTable . 'add_ Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (6,"Filesize",6,0,0);';43 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (6,"Filesize",6,0,0);'; 44 44 pwg_query($q); 45 $q = 'INSERT INTO ' . $prefixeTable . 'add_ Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (7,"Tags",7,0,0);';45 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (7,"Tags",7,0,0);'; 46 46 pwg_query($q); 47 $q = 'INSERT INTO ' . $prefixeTable . 'add_ Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (8,"Albums",8,0,0);';47 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (8,"Albums",8,0,0);'; 48 48 pwg_query($q); 49 $q = 'INSERT INTO ' . $prefixeTable . 'add_ Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (9,"Visits",9,0,0);';49 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (9,"Visits",9,0,0);'; 50 50 pwg_query($q); 51 $q = 'INSERT INTO ' . $prefixeTable . 'add_ Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (10,"Average",10,0,0);';51 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (10,"Average",10,0,0);'; 52 52 pwg_query($q); 53 $q = 'INSERT INTO ' . $prefixeTable . 'add_ Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (11,"Who can see this photo?",11,0,0);';53 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (11,"Who can see this photo?",11,0,0);'; 54 54 pwg_query($q); 55 55 … … 61 61 62 62 function update($old_version, $new_version, &$errors=array()){ 63 global $conf; 64 if (!isset($conf['add_Info_photos'])) { 65 conf_update_param('add_Info_photos','Categories',true); 66 } 63 67 64 } 68 65 … … 71 68 72 69 function uninstall(){ 73 conf_delete_param('add_Info_photos'); 74 $q = 'DROP TABLE ' . $prefixeTable . 'add_Info_photos;'; 70 $q = 'DROP TABLE ' . $prefixeTable . 'add_properties_photos;'; 75 71 pwg_query($q); 76 $q = 'DROP TABLE ' . $prefixeTable . 'add_ Info_photos_data;';72 $q = 'DROP TABLE ' . $prefixeTable . 'add_properties_photos_data;'; 77 73 pwg_query($q); 78 74 }
Note: See TracChangeset
for help on using the changeset viewer.