Changeset 32151 for extensions/manage_properties_photos
- Timestamp:
- May 1, 2020, 1:44:42 PM (4 years ago)
- Location:
- extensions/manage_properties_photos
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/manage_properties_photos/admin.php
r32137 r32151 309 309 } 310 310 if ($_POST['typ'] == '3') { 311 if($_POST['selectexif']==''){ 312 $_SESSION['page_errors'] = array(l10n('exif field can\'t be empty')); 313 redirect($admin_base_url); 314 } 311 315 $select= $_POST['selectexif']; 312 316 } 313 317 if ($_POST['typ'] == '6') { 318 if($_POST['selectiptc']==''){ 319 $_SESSION['page_errors'] = array(l10n('IPTC field can\'t be empty')); 320 redirect($admin_base_url); 321 } 314 322 $select= $_POST['selectiptc']; 315 323 } … … 402 410 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(wording,orderprop,active,edit,Typ,dataprop)VALUES ("**delpho**","' . $or . '","1",1,"2","DeletePhoto");'; 403 411 pwg_query($q); 404 header('Location:'.ADD_PROP_PHOTO_ADMIN . '-config'); 412 $_SESSION['page_infos'] = array(l10n('Information data registered in database')); 413 redirect(ADD_PROP_PHOTO_ADMIN . '-config'); 405 414 } 406 415 if (isset($_POST['submitremovedelpho'])){ … … 409 418 $query = 'DELETE FROM ' . ADD_PROP_PHOTO_DATADATE_TABLE . ' WHERE id_prop_pho = ' . $iddelpho['id_prop_pho'] . ';'; 410 419 pwg_query($query); 411 header('Location:'.ADD_PROP_PHOTO_ADMIN . '-config'); 420 $_SESSION['page_infos'] = array(l10n('Information data registered in database')); 421 redirect(ADD_PROP_PHOTO_ADMIN . '-config'); 412 422 } 413 423 $descpho = pwg_db_fetch_assoc(pwg_query('SELECT dataprop FROM ' . ADD_PROP_PHOTO_TABLE.' WHERE dataprop="movedescription";')); … … 422 432 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(wording,orderprop,active,edit,Typ,dataprop)VALUES ("Description","' . $or . '","0",0,"1","movedescription");'; 423 433 pwg_query($q); 424 header('Location:'.ADD_PROP_PHOTO_ADMIN . '-config'); 434 $_SESSION['page_infos'] = array(l10n('Information data registered in database')); 435 redirect(ADD_PROP_PHOTO_ADMIN . '-config'); 425 436 } 426 437 if (isset($_POST['submitdefaultdesc'])){ 427 438 pwg_query('DELETE FROM ' . ADD_PROP_PHOTO_TABLE . ' where dataprop ="movedescription";'); 428 header('Location:'.ADD_PROP_PHOTO_ADMIN . '-config'); 439 $_SESSION['page_infos'] = array(l10n('Information data registered in database')); 440 redirect(ADD_PROP_PHOTO_ADMIN . '-config'); 429 441 } 430 442 if (isset($_POST['submitmppoption'])){ -
extensions/manage_properties_photos/admin/admin.tpl
r32135 r32151 19 19 var x = 1; 20 20 var max_fields = $("#hideid").data('maxfield'); 21 22 jQuery('.eiw').delay(2000).slideUp(); 21 23 22 24 jQuery(".drag_button").show(); -
extensions/manage_properties_photos/initpicture.php
r32135 r32151 32 32 global $conf, $user; 33 33 34 $repla1='<dl id="standard" class="imageInfoTable">{strip}'; 35 $repla=' 34 $replastandard='<dl id="standard" class="imageInfoTable">{strip} 36 35 {foreach from=$add_info_photos item=addinfophotos} 37 36 {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)} … … 192 191 {/if} 193 192 {/foreach} 194 '; 195 $repla2='{/strip} 193 {/strip} 196 194 </dl> 197 195 {if isset($metadata)}'; … … 204 202 <h5 class="card-title">{\'Information\'|@translate}</h5> 205 203 <div id="info-content" class="d-flex flex-column"> 206 '.$repla.' 207 </div></div></div></div> 204 {foreach from=$add_info_photos item=addinfophotos} 205 {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)} 206 <div id="Author" class="imageInfo"> 207 <dl class="row mb-0"> 208 <dt class="col-sm-5">{\'Author\'|@translate}</dt> 209 <dd class="col-sm-7">{$INFO_AUTHOR}</dd> 210 </dl> 211 </div> 212 {else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)} 213 <div id="datecreate" class="imageInfo"> 214 <dl class="row mb-0"> 215 <dt class="col-sm-5">{\'Created on\'|@translate}</dt> 216 <dd class="col-sm-7">{$INFO_CREATION_DATE}</dd> 217 </dl> 218 </div> 219 {else if $addinfophotos.AIPID == 3 and isset($INFO_POSTED_DATE)} 220 <div id="datepost" class="imageInfo"> 221 <dl class="row mb-0"> 222 <dt class="col-sm-5">{\'Posted on\'|@translate}</dt> 223 <dd class="col-sm-7">{$INFO_POSTED_DATE}</dd> 224 </dl> 225 </div> 226 {else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)} 227 <div id="Dimensions" class="imageInfo"> 228 <dl class="row mb-0"> 229 <dt class="col-sm-5">{\'Dimensions\'|@translate}</dt> 230 <dd class="col-sm-7">{$INFO_DIMENSIONS}</dd> 231 </dl> 232 </div> 233 {else if $addinfophotos.AIPID == 5} 234 <div id="File" class="imageInfo"> 235 <dl class="row mb-0"> 236 <dt class="col-sm-5">{\'File\'|@translate}</dt> 237 <dd class="col-sm-7">{$INFO_FILE}</dd> 238 </dl> 239 </div> 240 {else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)} 241 <div id="Filesize" class="imageInfo"> 242 <dl class="row mb-0"> 243 <dt class="col-sm-5">{\'Filesize\'|@translate}</dt> 244 <dd class="col-sm-7">{$INFO_FILESIZE}</dd> 245 </dl> 246 </div> 247 {else if $addinfophotos.AIPID == 7 and isset($related_tags)} 248 {if $TAGAFF == 0} 249 <div id="Tags" class="imageInfo"> 250 <dl class="row mb-0"> 251 <dt class="col-sm-5">{\'Tags\'|@translate}</dt> 252 <dd class="col-sm-7"> 253 {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach} 254 </dd> 255 </dl> 256 </div> 257 {/if} 258 {if $TAGAFF == 1} 259 </div> 260 </div> 261 </div> 262 <div id="card-tags" class="card mb-2"> 263 <div class="card-body"> 264 <h5 class="card-title">{\'Tags\'|@translate}</h5> 265 <div id="Tags" class="imageInfo"> 266 {foreach from=$related_tags item=tag name=tag_loop}<a class="btn btn-primary btn-raised mr-1" href="{$tag.URL}">{$tag.name}</a>{/foreach} 267 </div> 268 </div> 269 </div> 270 {/if} 271 {else if $addinfophotos.AIPID == 8 and isset($related_categories)} 272 <div id="Categories" class="imageInfo"> 273 <dl class="row mb-0"> 274 <dt class="col-sm-5">{\'Albums\'|@translate}</dt> 275 <dd class="col-sm-7"> 276 <ul> 277 {foreach from=$related_categories item=cat} 278 <li>{$cat}</li> 279 {/foreach} 280 </ul> 281 </dd> 282 </dl> 283 </div> 284 {else if $addinfophotos.AIPID == 9} 285 <div id="Visits" class="imageInfo"> 286 <dl class="row mb-0"> 287 <dt class="col-sm-5">{\'Visits\'|@translate}</dt> 288 <dd class="col-sm-7">{$INFO_VISITS}</dd> 289 </dl> 290 </div> 291 {else if $addinfophotos.AIPID == 10 and isset($rate_summary)} 292 <div id="Average" class="imageInfo"> 293 <dl class="row mb-0"> 294 <dt class="col-sm-5">{\'Rating score\'|@translate}</dt> 295 <dd class="col-sm-7"> 296 {if $rate_summary.count} 297 <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span> 298 {else} 299 <span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span> 300 {/if} 301 </dd> 302 </dl> 303 </div> 304 {if isset($rating)} 305 <div id="rating" class="imageInfo"> 306 <dl class="row mb-0"> 307 <dt class="col-sm-5"> 308 <span id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</span> 309 </dt> 310 <dd class="col-sm-7"> 311 <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"> 312 <div> 313 {foreach from=$rating.marks item=mark name=rate_loop} 314 {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} 315 <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}"> 316 {else} 317 <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}"> 318 {/if} 319 {/foreach} 320 {strip}{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} 321 {combine_script id=\'rating\' load=\'async\' require=\'core.scripts\' path=\'themes/default/js/rating.js\'} 322 {footer_script} 323 var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[]; 324 _pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id}, 325 onSuccess : function(rating) {ldelim} 326 var e = document.getElementById("updateRate"); 327 if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}"; 328 e = document.getElementById("ratingScore"); 329 if (e) e.innerHTML = rating.score; 330 e = document.getElementById("ratingCount"); 331 if (e) {ldelim} 332 if (rating.count == 1) {ldelim} 333 e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); 334 } else {ldelim} 335 e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); 336 } 337 {rdelim} 338 {rdelim}{rdelim} ); 339 {/footer_script} 340 {/strip} 341 </div> 342 </form> 343 </dd> 344 </dl> 345 </div> 346 {/if} 347 {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)} 348 <div id="Privacy" class="imageInfo"> 349 <dl class="row mb-0"> 350 <dt class="col-sm-5">{\'Who can see this photo?\'|@translate}</dt> 351 <dd class="col-sm-7"> 352 <div> 353 <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a> 354 </div> 355 {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} 356 {footer_script require=\'jquery\'}{strip} 357 function setPrivacyLevel(id, level){ 358 (new PwgWS(\'{$ROOT_URL}\')).callService( 359 "pwg.images.setPrivacyLevel", { image_id:id, level:level}, 360 { 361 method: "POST", 362 onFailure: function(num, text) { alert(num + " " + text); }, 363 onSuccess: function(result) { 364 jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\'); 365 jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\'); 366 jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text()); 367 } 368 } 369 ); 370 } 371 (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox"); 372 {/strip}{/footer_script} 373 <div id="privacyLevelBox" class="switchBox" style="display:none"> 374 {foreach from=$available_permission_levels item=label key=level} 375 <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>✔ </span> 376 <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br> 377 {/foreach} 378 </div> 379 </dd> 380 </dl> 381 </div> 382 {else if $addinfophotos.AIPWORDING == \'Description\' and isset($COMMENT_IMG)} 383 <div id="Description" class="imageInfo"> 384 <dl class="row mb-0"> 385 <dt class="col-sm-5">{\'Description\'|@translate}</dt> 386 <dd class="col-sm-7"> 387 {$COMMENT_IMG} 388 </dd> 389 </dl> 390 </div> 391 {footer_script} 392 jQuery(document).ready(function(){ 393 jQuery(".imageComment").hide(); 394 }); 395 {/footer_script} 396 {else if $addinfophotos.AIPDATA} 397 <div id="add_info" class="imageInfo"> 398 <dl class="row mb-0"> 399 <dt class="label col-sm-5">{$addinfophotos.AIPWORDING}</dt> 400 <dd class="value col-sm-7">{$addinfophotos.AIPDATA}</dd> 401 </dl> 402 </div> 403 {/if} 404 {/foreach} 405 {if $TAGAFF == 0} 406 </div></div></div> 407 {/if} 408 </div> 208 409 {if isset($metadata) || (isset($comment_add) || $COMMENT_COUNT > 0)} 209 410 <div id="infopanel-right" class="col-lg-6 col-12"> … … 749 950 '; 750 951 751 $replastandard=$repla1.$repla.$repla2;752 753 952 $repladarkroom='<div id="theImageInfos" class="row justify-content-center"> 754 953 {if $theme_config->picture_info == \'cards\'}' … … 786 985 787 986 function add_InfoT() { 788 global $conf, $page, $template, $lang, $pwg_loaded_plugins ;987 global $conf, $page, $template, $lang, $pwg_loaded_plugins,$user; 789 988 790 989 if (!empty($page['image_id'])) { 791 if (isset($pwg_loaded_plugins['ExtendedDescription'])){add_event_handler('AP_render_content', 'get_user_language_desc');} 990 991 if ($user['theme'] == 'bootstrap_darkroom'){ 992 $themeconfig = new \BootstrapDarkroom\Config(); 993 if($themeconfig->picture_info=='cards'){ 994 $tagaff = pwg_db_fetch_assoc(pwg_query('SELECT wording FROM '. ADD_PROP_PHOTO_TABLE.' ORDER BY orderprop DESC LIMIT 1')); 995 if($tagaff['wording']=='Tags'){ 996 $template->assign('TAGAFF',1); 997 }else{ 998 $template->assign('TAGAFF',0); 999 } 1000 } 1001 } 1002 1003 1004 if (isset($pwg_loaded_plugins['ExtendedDescription'])){add_event_handler('AP_render_content', 'get_user_language_desc');} 792 1005 793 1006 $tab_add_info_one_photo = tab_add_info_by_photo_show(); -
extensions/manage_properties_photos/language/en_UK/plugin.lang.php
r32137 r32151 56 56 $lang['reference photo id doesn\'t exist please update'] = 'reference photo id doesn\'t exist please update'; 57 57 $lang['reference photo type doesn\'t use metadata please update'] = 'reference photo type doesn\'t use metadata please update'; 58 $lang['exif field can\'t be empty'] = 'exif field can\'t be empty'; 59 $lang['IPTC field can\'t be empty'] = 'IPTC field can\'t be empty'; -
extensions/manage_properties_photos/language/fr_FR/plugin.lang.php
r32137 r32151 54 54 $lang['reference photo id doesn\'t exist please update'] = 'ID choisie comme photo de reference n\'existe pas merci de mettre à jour'; 55 55 $lang['reference photo type doesn\'t use metadata please update'] = 'Le type de la photo de reference n\'utilise pas les exifs, merci de mettre à jour'; 56 $lang['exif field can\'t be empty'] = 'le champ exif ne peux pas être vide'; 57 $lang['IPTC field can\'t be empty'] = 'le champ IPTC ne peux pas être vide';
Note: See TracChangeset
for help on using the changeset viewer.