Changeset 1787 for trunk/picture.php
- Timestamp:
- Feb 7, 2007, 10:23:33 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/picture.php
r1730 r1787 44 44 if (!in_array($page['image_id'], $page['items'])) 45 45 { 46 page_not_found('The requested image does not belong to this image set', 47 duplicate_index_url() ); 46 page_not_found( 47 'The requested image does not belong to this image set', 48 duplicate_index_url() 49 ); 48 50 } 49 51 50 52 // add default event handler for rendering element content 51 add_event_handler('render_element_content', 'default_picture_content', 52 EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 53 add_event_handler( 54 'render_element_content', 55 'default_picture_content', 56 EVENT_HANDLER_PRIORITY_NEUTRAL, 57 2 58 ); 53 59 trigger_action('loc_begin_picture'); 54 60 … … 64 70 return $content; 65 71 } 72 66 73 global $user; 67 $my_template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template'], 68 $user['theme'] ); 69 $my_template->set_filenames( array('default_content'=>'picture_content.tpl') ); 74 75 $my_template = new Template( 76 PHPWG_ROOT_PATH.'template/'.$user['template'], 77 $user['theme'] 78 ); 79 $my_template->set_filenames( 80 array('default_content'=>'picture_content.tpl') 81 ); 70 82 71 83 if (isset($element_info['high_url'])) … … 89 101 return $my_template->parse( 'default_content', true); 90 102 } 91 92 93 103 94 104 // +-----------------------------------------------------------------------+ … … 212 222 { 213 223 include_once(PHPWG_ROOT_PATH.'include/functions_rate.inc.php'); 214 rate_picture($page['image_id'], 215 isset($_POST['rate']) ? $_POST['rate'] : $_GET['rate'] ); 224 rate_picture( 225 $page['image_id'], 226 isset($_POST['rate']) ? $_POST['rate'] : $_GET['rate'] 227 ); 216 228 redirect($url_self); 217 229 } … … 396 408 if (!empty($picture['current']['width'])) 397 409 { 398 list($picture['current']['scaled_width'],$picture['current']['scaled_height']) = 399 get_picture_size( 410 list( 411 $picture['current']['scaled_width'], 412 $picture['current']['scaled_height'] 413 ) = get_picture_size( 400 414 $picture['current']['width'], 401 415 $picture['current']['height'], … … 420 434 if ( isset( $_GET['slideshow'] ) and isset($page['next_item']) ) 421 435 { 422 // $redirect_msg, $refresh, $url_link and $title are required for creating an automated423 // refresh page in header.tpl436 // $redirect_msg, $refresh, $url_link and $title are required for creating 437 // an automated refresh page in header.tpl 424 438 $refresh= $_GET['slideshow']; 425 439 $url_link = add_url_params( … … 437 451 438 452 // do we have a plugin that can show metadata for something else than images? 439 $metadata_showable = trigger_event('get_element_metadata_available', 440 ( 441 ($conf['show_exif'] or $conf['show_iptc']) 442 and isset($picture['current']['image_path']) 453 $metadata_showable = trigger_event( 454 'get_element_metadata_available', 455 ( 456 ($conf['show_exif'] or $conf['show_iptc']) 457 and isset($picture['current']['image_path']) 443 458 ), 444 $picture['current']['path'] ); 459 $picture['current']['path'] 460 ); 461 445 462 if ($metadata_showable) 446 463 { … … 472 489 $page['slideshow'] = false; 473 490 } 474 // maybe someone wants a special display (call it before page_header so that they 475 // can add stylesheets) 476 $element_content = trigger_event('render_element_content', 477 '', $picture['current'] ); 478 479 if ( isset($picture['next']['image_url']) 480 and isset($picture['next']['is_picture']) ) 481 { 482 $template->assign_block_vars( 'prefetch', 491 492 // maybe someone wants a special display (call it before page_header so that 493 // they can add stylesheets) 494 $element_content = trigger_event( 495 'render_element_content', 496 '', 497 $picture['current'] 498 ); 499 500 if (isset($picture['next']['image_url']) 501 and isset($picture['next']['is_picture'])) 502 { 503 $template->assign_block_vars( 504 'prefetch', 483 505 array ( 484 506 'URL' => $picture['next']['image_url'] 485 )486 );507 ) 508 ); 487 509 } 488 510 489 511 $template->set_filenames(array( 'picture' => $page['display_tpl'] )); 490 512 491 492 513 //------------------------------------------------------- navigation management 493 foreach ( array('first','previous','next','last') as $which_image)514 foreach (array('first','previous','next','last') as $which_image) 494 515 { 495 516 if (isset($picture[$which_image])) … … 502 523 'U_IMG' => $picture[$which_image]['url'], 503 524 ) 525 ); 526 } 527 else 528 { 529 $template->assign_block_vars( 530 $which_image.'_unactive', 531 array() 504 532 ); 505 533 }
Note: See TracChangeset
for help on using the changeset viewer.