Changeset 1787 for trunk


Ignore:
Timestamp:
Feb 7, 2007, 10:23:33 PM (17 years ago)
Author:
plg
Message:

Feature 638 added: "Fixed navigation bar" extension integration.

Location:
trunk
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/picture.php

    r1730 r1787  
    4444if (!in_array($page['image_id'], $page['items']))
    4545{
    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    );
    4850}
    4951
    5052// add default event handler for rendering element content
    51 add_event_handler('render_element_content', 'default_picture_content',
    52   EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
     53add_event_handler(
     54  'render_element_content',
     55  'default_picture_content',
     56  EVENT_HANDLER_PRIORITY_NEUTRAL,
     57  2
     58  );
    5359trigger_action('loc_begin_picture');
    5460
     
    6470    return $content;
    6571  }
     72 
    6673  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    );
    7082
    7183  if (isset($element_info['high_url']))
     
    89101  return $my_template->parse( 'default_content', true);
    90102}
    91 
    92 
    93103
    94104// +-----------------------------------------------------------------------+
     
    212222    {
    213223      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        );
    216228      redirect($url_self);
    217229    }
     
    396408if (!empty($picture['current']['width']))
    397409{
    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(
    400414      $picture['current']['width'],
    401415      $picture['current']['height'],
     
    420434if ( isset( $_GET['slideshow'] ) and isset($page['next_item']) )
    421435{
    422   // $redirect_msg, $refresh, $url_link and $title are required for creating an automated
    423   // refresh page in header.tpl
     436  // $redirect_msg, $refresh, $url_link and $title are required for creating
     437  // an automated refresh page in header.tpl
    424438  $refresh= $_GET['slideshow'];
    425439  $url_link = add_url_params(
     
    437451
    438452// 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'])
    443458    ),
    444     $picture['current']['path'] );
     459  $picture['current']['path']
     460  );
     461
    445462if ($metadata_showable)
    446463{
     
    472489  $page['slideshow'] = false; 
    473490}
    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
     500if (isset($picture['next']['image_url'])
     501    and isset($picture['next']['is_picture']))
     502{
     503  $template->assign_block_vars(
     504    'prefetch',
    483505    array (
    484506      'URL' => $picture['next']['image_url']
    485     )
    486   );
     507      )
     508    );
    487509}
    488510
    489511$template->set_filenames(array( 'picture' => $page['display_tpl'] ));
    490512
    491 
    492513//------------------------------------------------------- navigation management
    493 foreach ( array('first','previous','next','last') as $which_image )
     514foreach (array('first','previous','next','last') as $which_image)
    494515{
    495516  if (isset($picture[$which_image]))
     
    502523        'U_IMG' => $picture[$which_image]['url'],
    503524        )
     525      );
     526  }
     527  else
     528  {
     529    $template->assign_block_vars(
     530      $which_image.'_unactive',
     531      array()
    504532      );
    505533  }
  • trunk/template/yoga/picture.tpl

    r1780 r1787  
    4141  <a class="navButton prev" href="{last.U_IMG}" title="{lang:last_page} : {last.TITLE_IMG}" rel="last"><img src="{pwg_root}{themeconf:icon_dir}/last.png" class="button" alt="{lang:last_page}"></a>
    4242<!-- END last -->
     43<!-- BEGIN last_unactive -->
     44  <a class="navButton prev"><img src="{pwg_root}{themeconf:icon_dir}/last_unactive.png" class="button" alt="{lang:last_page}"></a>
     45<!-- END last_unactive -->
    4346<!-- BEGIN next -->
    44   <a class="navButton next" href="{next.U_IMG}" title="{lang:next_page} : {next.TITLE_IMG}" rel="next"><img src="{pwg_root}{themeconf:icon_dir}/right.png" class="button" alt="{lang:next_page}"></a>
     47  <a class="navButton next" href="{next.U_IMG}" title="{L_NEXT_IMG}{next.TITLE_IMG}" rel="next"><img src="{pwg_root}{themeconf:icon_dir}/right.png" class="button" alt="{lang:next_page}"></a>
    4548<!-- END next -->
    46   <a class="navButton up" href="{U_UP}" title="{lang:thumbnails}" rel="up"><img src="{pwg_root}{themeconf:icon_dir}/up.png" class="button" alt="{lang:home}"></a>
     49<!-- BEGIN next_unactive -->
     50  <a class="navButton next"><img src="{pwg_root}{themeconf:icon_dir}/right_unactive.png" class="button" alt="{lang:next_page}"></a>
     51<!-- END next_unactive -->
     52  <a class="navButton up" href="{U_UP}" title="{lang:thumbnails}" rel="up"><img src="{pwg_root}{themeconf:icon_dir}/up.png" class="button" alt="{L_UP_ALT}"></a>
    4753<!-- BEGIN previous -->
    48   <a class="navButton prev" href="{previous.U_IMG}" title="{lang:previous_page} : {previous.TITLE_IMG}" rel="prev"><img src="{pwg_root}{themeconf:icon_dir}/left.png" class="button" alt="{lang:previous_page}"></a>
     54  <a class="navButton prev" href="{previous.U_IMG}" title="{L_PREV_IMG}{previous.TITLE_IMG}" rel="prev"><img src="{pwg_root}{themeconf:icon_dir}/left.png" class="button" alt="{lang:previous_page}"></a>
    4955<!-- END previous -->
     56<!-- BEGIN previous_unactive -->
     57  <a class="navButton prev"><img src="{pwg_root}{themeconf:icon_dir}/left_unactive.png" class="button" alt="{lang:previous_page}"></a>
     58<!-- END previous_unactive -->
    5059<!-- BEGIN first -->
    5160  <a class="navButton prev" href="{first.U_IMG}" title="{lang:first_page} : {first.TITLE_IMG}" rel="first"><img src="{pwg_root}{themeconf:icon_dir}/first.png" class="button" alt="{lang:first_page}"></a>
    5261<!-- END first -->
     62<!-- BEGIN first_unactive -->
     63  <a class="navButton prev"><img src="{pwg_root}{themeconf:icon_dir}/first_unactive.png" class="button" alt="{lang:first_page}"></a>
     64<!-- END first_unactive -->
    5365</div>
    5466
Note: See TracChangeset for help on using the changeset viewer.