Changeset 1882 for trunk/picture.php


Ignore:
Timestamp:
Mar 9, 2007, 4:37:56 AM (18 years ago)
Author:
rvelices
Message:

plugins only:

  • fix in category_default.inc.php (action parameters were wrong if show_nb_comments was true)
  • refactor actions and events in picture.php in order to give more flexibility to plugins
  • added some variables in index.tpl (not used by pwg itself) to allow plugins to add their own content
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/picture.php

    r1861 r1882  
    7171  }
    7272
    73   global $user, $page;
    74 
    75   $my_template = new Template(
    76     PHPWG_ROOT_PATH.'template/'.$user['template'],
    77     $user['theme']
    78     );
    79   $my_template->set_filenames(
     73  global $user, $page, $template;
     74
     75  $template->set_filenames(
    8076    array('default_content'=>'picture_content.tpl')
    8177    );
     
    8480  {
    8581    $uuid = uniqid(rand());
    86     $my_template->assign_block_vars(
     82    $template->assign_block_vars(
    8783      'high',
    8884      array(
     
    9288      );
    9389  }
    94   $my_template->assign_vars( array(
     90  $template->assign_vars( array(
    9591      'SRC_IMG' => $element_info['image_url'],
    9692      'ALT_IMG' => $element_info['file'],
     
    9995      )
    10096    );
    101   return $my_template->parse( 'default_content', true);
     97  return $template->parse( 'default_content', true);
    10298}
    10399
     
    483479$page['body_id'] = 'thePicturePage';
    484480
    485 // maybe someone wants a special display (call it before page_header so that
    486 // they can add stylesheets)
    487 $element_content = trigger_event(
    488   'render_element_content',
    489   '',
    490   $picture['current']
    491   );
     481// allow plugins to change what we computed before passing data to template
     482$picture = trigger_event('picture_pictures_data', $picture);
     483
    492484
    493485if (isset($picture['next']['image_url'])
     
    531523    'PHOTO' => $title_nb,
    532524    'TITLE' => $picture['current']['name'],
    533     'ELEMENT_CONTENT' => $element_content,
    534525
    535526    'LEVEL_SEPARATOR' => $conf['level_separator'],
     
    802793}
    803794
     795// maybe someone wants a special display (call it before page_header so that
     796// they can add stylesheets)
     797$element_content = trigger_event(
     798  'render_element_content',
     799  '',
     800  $picture['current']
     801  );
     802$template->assign_var( 'ELEMENT_CONTENT', $element_content );
     803
    804804// +-----------------------------------------------------------------------+
    805805// |                               sub pages                               |
Note: See TracChangeset for help on using the changeset viewer.