- Timestamp:
- Nov 1, 2006, 6:54:35 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 10 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions_plugins.inc.php
r1584 r1590 39 39 if (is_dir($path) and !is_link($path) 40 40 and preg_match('/^[a-zA-Z0-9-_]+$/', $file ) 41 and file_exists($path.'/ index.php')41 and file_exists($path.'/main.inc.php') 42 42 ) 43 43 { 44 44 $plugin = array('name'=>'?', 'version'=>'0', 'uri'=>'', 'description'=>''); 45 $plg_data = implode( '', file($path.'/ index.php') );45 $plg_data = implode( '', file($path.'/main.inc.php') ); 46 46 47 47 if ( preg_match("|Plugin Name: (.*)|i", $plg_data, $val) ) … … 73 73 { 74 74 global $page; 75 76 $uid = md5( var_export($func, true) ); 75 if ( is_array( $func) ) 76 { 77 $s = ''; 78 foreach( $func as $e) 79 { 80 if (is_object($e)) 81 { 82 $s.=get_class($e)."\n"; 83 } 84 else 85 { 86 $s.=$e; 87 } 88 } 89 $uid = md5( $s ); 90 } 91 else 92 { 93 $uid = md5( $func ); 94 } 77 95 $page['plugin_admin_menu'][] = 78 96 array( -
trunk/admin/plugin.php
r1580 r1590 37 37 $template->set_filenames(array('plugin' => 'admin/plugin.tpl')); 38 38 39 trigger_ event('plugin_admin_menu');39 trigger_action('plugin_admin_menu'); 40 40 41 41 -
trunk/admin/plugins.php
r1588 r1590 163 163 $template->set_filenames(array('plugins' => 'admin/plugins.tpl')); 164 164 165 trigger_ event('plugin_admin_menu');165 trigger_action('plugin_admin_menu'); 166 166 167 167 $template->assign_block_vars('plugin_menu.menu_item', -
trunk/include/functions_plugins.inc.php
r1584 r1590 36 36 define('PHPWG_PLUGINS_PATH',PHPWG_ROOT_PATH.'plugins/'); 37 37 38 define('EVENT_HANDLER_PRIORITY_NEUTRAL', 50); 39 38 40 /* Register a event handler. 39 41 * @param string $event the name of the event to listen to 40 42 * @param mixed $func the function that will handle the event 41 */ 42 function add_event_handler($event, $func, $priority=50, $accepted_args=1) 43 { 44 global $pwg_event_handlers; 45 46 if ( isset($pwg_event_handlers[$event]["$priority"]) ) 47 { 48 foreach($pwg_event_handlers[$event]["$priority"] as $handler) 43 * @param int $priority optional priority (greater priority will 44 * be executed at last) 45 */ 46 function add_event_handler($event, $func, 47 $priority=EVENT_HANDLER_PRIORITY_NEUTRAL, $accepted_args=1) 48 { 49 global $pwg_event_handlers; 50 51 if ( isset($pwg_event_handlers[$event][$priority]) ) 52 { 53 foreach($pwg_event_handlers[$event][$priority] as $handler) 49 54 { 50 55 if ( $handler['function'] == $func ) … … 55 60 } 56 61 57 trigger_event('add_event_handler', 58 array('event'=>$event, 'function'=>$func) 59 ); 60 61 $pwg_event_handlers[$event]["$priority"][] = 62 $pwg_event_handlers[$event][$priority][] = 62 63 array( 63 64 'function'=>$func, 64 65 'accepted_args'=>$accepted_args); 65 66 ksort( $pwg_event_handlers[$event] ); 66 67 return true; 67 68 } 68 69 70 /* Register a event handler. 71 * @param string $event the name of the event to listen to 72 * @param mixed $func the function that needs removal 73 * @param int $priority optional priority (greater priority will 74 * be executed at last) 75 */ 76 function remove_event_handler($event, $func, 77 $priority=EVENT_HANDLER_PRIORITY_NEUTRAL) 78 { 79 global $pwg_event_handlers; 80 81 if (!isset( $pwg_event_handlers[$event][$priority] ) ) 82 { 83 return false; 84 } 85 for ($i=0; $i<count($pwg_event_handlers[$event][$priority]); $i++) 86 { 87 if ($pwg_event_handlers[$event][$priority][$i]['function']==$func) 88 { 89 unset($pwg_event_handlers[$event][$priority][$i]); 90 $pwg_event_handlers[$event][$priority] = 91 array_values($pwg_event_handlers[$event][$priority]); 92 93 if ( empty($pwg_event_handlers[$event][$priority]) ) 94 { 95 unset( $pwg_event_handlers[$event][$priority] ); 96 if (empty( $pwg_event_handlers[$event] ) ) 97 { 98 unset( $pwg_event_handlers[$event] ); 99 } 100 } 101 return true; 102 } 103 } 104 return false; 105 } 69 106 70 107 /* Triggers an event and calls all registered event handlers … … 75 112 { 76 113 global $pwg_event_handlers; 77 if ($event!='pre_trigger_event' and $event!='post_trigger_event') 78 {// special case 79 trigger_event('pre_trigger_event', 80 array('event'=>$event, 'data'=>$data) ); 81 if ( !isset($pwg_event_handlers[$event]) ) 82 { 83 trigger_event('post_trigger_event', 84 array('event'=>$event, 'data'=>$data) ); 85 } 86 } 114 115 // just for debugging 116 trigger_action('pre_trigger_event', 117 array('event'=>$event, 'data'=>$data) ); 87 118 88 119 if ( !isset($pwg_event_handlers[$event]) ) 89 120 { 121 trigger_action('post_trigger_event', 122 array('event'=>$event, 'data'=>$data) ); 90 123 return $data; 91 124 } … … 115 148 } 116 149 } 117 118 if ($event!='pre_trigger_event' and $event!='post_trigger_event') 119 { 120 trigger_event('post_trigger_event', 121 array('event'=>$event, 'data'=>$data) ); 122 } 123 150 trigger_action('post_trigger_event', 151 array('event'=>$event, 'data'=>$data) ); 124 152 return $data; 125 153 } 126 154 127 155 156 function trigger_action($event, $data=null) 157 { 158 global $pwg_event_handlers; 159 if ($event!='pre_trigger_event' 160 and $event!='post_trigger_event' 161 and $event!='trigger_action') 162 {// special case for debugging - avoid recursive calls 163 trigger_action('trigger_action', 164 array('event'=>$event, 'data'=>$data) ); 165 } 166 167 if ( !isset($pwg_event_handlers[$event]) ) 168 { 169 return; 170 } 171 $args = array_slice(func_get_args(), 2); 172 173 foreach ($pwg_event_handlers[$event] as $priority => $handlers) 174 { 175 if ( !is_null($handlers) ) 176 { 177 foreach($handlers as $handler) 178 { 179 $all_args = array_merge( array($data), $args); 180 $function_name = $handler['function']; 181 $accepted_args = $handler['accepted_args']; 182 183 if ( $accepted_args == 1 ) 184 $the_args = array($data); 185 elseif ( $accepted_args > 1 ) 186 $the_args = array_slice($all_args, 0, $accepted_args); 187 elseif ( $accepted_args == 0 ) 188 $the_args = NULL; 189 else 190 $the_args = $all_args; 191 192 call_user_func_array($function_name, $the_args); 193 } 194 } 195 } 196 } 128 197 129 198 … … 174 243 foreach( $plugins as $plugin) 175 244 { 176 @include_once( PHPWG_PLUGINS_PATH.$plugin['id'].'/index.php' ); 177 } 178 trigger_event('plugins_loaded'); 245 $file_name = PHPWG_PLUGINS_PATH.$plugin['id'].'/main.inc.php'; 246 if ( file_exists($file_name) ) 247 { 248 include_once( $file_name ); 249 } 250 } 251 trigger_action('plugins_loaded'); 179 252 } 180 253 ?> -
trunk/include/page_header.php
r1578 r1590 31 31 $template->set_filenames(array('header'=>'header.tpl')); 32 32 33 trigger_action('loc_begin_page_header'); 34 33 35 $template->assign_vars( 34 36 array( … … 38 40 39 41 'PAGE_BANNER' => 40 trigger_event('page_banner', 41 isset($page['page_banner']) ? 42 $page['page_banner'] : $conf['page_banner'] ), 42 isset($page['page_banner']) ? 43 $page['page_banner'] : $conf['page_banner'], 43 44 44 45 'BODY_ID' => … … 68 69 } 69 70 71 trigger_action('loc_end_page_header'); 72 70 73 header('Content-Type: text/html; charset='.$lang_info['charset']); 71 74 $template->parse('header'); -
trunk/include/picture_metadata.inc.php
r1126 r1590 40 40 } 41 41 42 if ($exif = @read_exif_data($picture['current'][' src_file_system']))42 if ($exif = @read_exif_data($picture['current']['image_path'])) 43 43 { 44 44 $template->assign_block_vars( … … 93 93 if ($conf['show_iptc']) 94 94 { 95 $iptc = get_iptc_data($picture['current'][' src_file_system'],95 $iptc = get_iptc_data($picture['current']['image_path'], 96 96 $conf['show_iptc_mapping']); 97 97 -
trunk/picture.php
r1503 r1590 47 47 } 48 48 49 // add default event handler for rendering element content 50 add_event_handler('render_element_content', 'default_picture_content', 51 EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 52 trigger_action('loc_begin_picture'); 53 54 // this is the default handler that generates the display for the element 55 function default_picture_content($content, $element_info) 56 { 57 if ( !empty($content) ) 58 {// someone hooked us - so we skip; 59 return $content; 60 } 61 if (!isset($element_info['image_url'])) 62 { // nothing to do 63 return $content; 64 } 65 global $user; 66 $my_template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template'], 67 $user['theme'] ); 68 $my_template->set_filenames( array('default_content'=>'picture_content.tpl') ); 69 70 if (isset($element_info['high_url'])) 71 { 72 $uuid = uniqid(rand()); 73 $my_template->assign_block_vars( 74 'high', 75 array( 76 'U_HIGH' => $element_info['high_url'], 77 'UUID' => $uuid, 78 ) 79 ); 80 } 81 $my_template->assign_vars( array( 82 'SRC_IMG' => $element_info['image_url'], 83 'ALT_IMG' => $element_info['file'], 84 'WIDTH_IMG' => $element_info['scaled_width'], 85 'HEIGHT_IMG' => $element_info['scaled_height'], 86 ) 87 ); 88 return $my_template->parse( 'default_content', true); 89 } 90 91 92 49 93 // +-----------------------------------------------------------------------+ 50 94 // | initialization | … … 100 144 */ 101 145 102 if (isset($_GET['action']) and !is_adviser())146 if (isset($_GET['action'])) 103 147 { 104 148 switch ($_GET['action']) … … 140 184 case 'set_as_representative' : 141 185 { 142 if (is_admin() and isset($page['category']))186 if (is_admin() and !is_adviser() and isset($page['category'])) 143 187 { 144 188 $query = ' … … 175 219 if (isset($_GET['comment_to_delete']) 176 220 and is_numeric($_GET['comment_to_delete']) 177 and is_admin() )221 and is_admin() and !is_adviser() ) 178 222 { 179 223 $query = ' … … 276 320 $file_wo_ext = get_filename_wo_extension($row['file']); 277 321 278 if (isset($row['representative_ext']) and $row['representative_ext'] != '') 279 { 280 $picture[$i]['src'] = 281 $cat_directory.'/pwg_representative/' 282 .$file_wo_ext.'.'.$row['representative_ext']; 283 } 284 else 285 { 286 $icon = get_themeconf('mime_icon_dir'); 287 $icon.= strtolower(get_extension($row['file'])).'.png'; 288 $picture[$i]['src'] = $icon; 289 } 290 // special case for picture files 322 // ------ build element_path and element_url 323 $picture[$i]['element_url'] = $row['path']; 324 if ( ! url_is_remote($row['path']) ) 325 { 326 $picture[$i]['element_url'] = get_root_url().$row['path']; 327 } 328 329 // ------ build image_path and image_url 291 330 if ($picture[$i]['is_picture']) 292 331 { 293 $picture[$i][' src'] = $row['path'];332 $picture[$i]['image_path'] = $row['path']; 294 333 // if we are working on the "current" element, we search if there is a 295 334 // high quality picture … … 299 338 { 300 339 $url_high=$cat_directory.'/pwg_high/'.$row['file']; 301 $picture[$i]['high_file_system'] = $picture[$i]['high'] = $url_high;302 if ( ! url_is_remote($picture[$i]['high ']) )340 $picture[$i]['high_url'] = $picture[$i]['high_path'] = $url_high; 341 if ( ! url_is_remote($picture[$i]['high_path']) ) 303 342 { 304 $picture[$i]['high '] = get_root_url().$picture[$i]['high'];343 $picture[$i]['high_url'] = get_root_url().$picture[$i]['high_path']; 305 344 } 306 345 } 307 346 } 308 347 } 309 $picture[$i]['src_file_system'] = $picture[$i]['src']; 310 if ( ! url_is_remote($picture[$i]['src']) ) 311 { 312 $picture[$i]['src'] = get_root_url(). $picture[$i]['src']; 313 } 314 315 // if picture is not a file, we need the download link 348 else 349 {// not a picture 350 if (isset($row['representative_ext']) and $row['representative_ext']!='') 351 { 352 $picture[$i]['image_path'] = 353 $cat_directory.'/pwg_representative/' 354 .$file_wo_ext.'.'.$row['representative_ext']; 355 } 356 else 357 { 358 $picture[$i]['image_path'] = 359 get_themeconf('mime_icon_dir') 360 .strtolower(get_extension($row['file'])).'.png'; 361 } 362 } 363 364 $picture[$i]['image_url'] = $picture[$i]['image_path']; 365 if ( ! url_is_remote($picture[$i]['image_path']) ) 366 { 367 $picture[$i]['image_url'] = get_root_url().$picture[$i]['image_path']; 368 } 369 316 370 if (!$picture[$i]['is_picture']) 317 { 318 $picture[$i]['download'] = url_is_remote($row['path']) ? '' : get_root_url(); 319 $picture[$i]['download'].= $row['path']; 371 {// if picture is not a file, we need the download link 372 $picture[$i]['download_url'] = $picture[$i]['element_url']; 373 } 374 else 375 {// if picture is a file with high, we put the download link 376 if ( isset($picture[$i]['high_path']) ) 377 { 378 $picture[$i]['download_url'] = get_root_url().'action.php?dwn=' 379 .$picture[$i]['high_path']; 380 } 320 381 } 321 382 … … 351 412 } 352 413 414 // calculation of width and height for the current picture 415 if (empty($picture['current']['width'])) 416 { 417 $taille_image = @getimagesize($picture['current']['image_path']); 418 if ($taille_image!==false) 419 { 420 $picture['current']['width'] = $taille_image[0]; 421 $picture['current']['height']= $taille_image[1]; 422 } 423 } 424 425 if (!empty($picture['current']['width'])) 426 { 427 list($picture['current']['scaled_width'],$picture['current']['scaled_height']) = 428 get_picture_size( 429 $picture['current']['width'], 430 $picture['current']['height'], 431 @$user['maxwidth'], 432 @$user['maxheight'] 433 ); 434 } 435 436 // now give an opportunity to the filters to alter element_url, 437 // image_url, high_url and download_url 438 $picture = trigger_event('picture_navigation', $picture); 439 353 440 $url_admin = 354 441 get_root_url().'admin.php?page=picture_modify' … … 378 465 $title_nb = ($page['current_rank'] + 1).'/'.$page['cat_nb_images']; 379 466 380 // calculation of width and height381 if (empty($picture['current']['width']))382 {383 $taille_image = @getimagesize($picture['current']['src_file_system']);384 $original_width = $taille_image[0];385 $original_height = $taille_image[1];386 }387 else388 {389 $original_width = $picture['current']['width'];390 $original_height = $picture['current']['height'];391 }392 393 $picture_size = get_picture_size(394 $original_width,395 $original_height,396 @$user['maxwidth'],397 @$user['maxheight']398 );399 400 467 // metadata 401 468 $url_metadata = duplicate_picture_url(); 402 if ($conf['show_exif'] or $conf['show_iptc']) 403 { 404 $metadata_showable = true; 469 470 // do we have a plugin that can show metadata for something else than images? 471 $metadata_showable = trigger_event('get_element_metadata_available', 472 ( 473 ($conf['show_exif'] or $conf['show_iptc']) 474 and isset($picture['current']['image_path']) 475 ), 476 $picture['current']['path'] ); 477 if ($metadata_showable) 478 { 405 479 if ( !isset($_GET['metadata']) ) 406 480 { … … 408 482 } 409 483 } 410 else411 {412 $metadata_showable = false;413 }414 484 415 485 $page['body_id'] = 'thePicturePage'; 486 487 // maybe someone wants a special display (call it before page_header so that they 488 // can add stylesheets) 489 $element_content = trigger_event('render_element_content', 490 '', $picture['current'] ); 491 492 if ( isset($picture['next']['image_url']) 493 and isset($picture['next']['is_picture']) ) 494 { 495 $template->assign_block_vars( 'prefetch', 496 array ( 497 'URL' => $picture['next']['image_url'] 498 ) 499 ); 500 } 501 include(PHPWG_ROOT_PATH.'include/page_header.php'); 502 $template->set_filenames(array('picture'=>'picture.tpl')); 503 416 504 //------------------------------------------------------- navigation management 417 505 foreach ( array('first','previous','next','last') as $which_image ) … … 425 513 'IMG' => $picture[$which_image]['thumbnail'], 426 514 'U_IMG' => $picture[$which_image]['url'], 427 'U_IMG_SRC' => $picture[$which_image]['src']428 515 ) 429 516 ); 430 517 } 431 518 } 432 433 include(PHPWG_ROOT_PATH.'include/page_header.php');434 $template->set_filenames(array('picture'=>'picture.tpl'));435 519 436 520 $template->assign_vars( … … 440 524 'PHOTO' => $title_nb, 441 525 'TITLE' => $picture['current']['name'], 442 'SRC_IMG' => $picture['current']['src'], 443 'ALT_IMG' => $picture['current']['file'], 444 'WIDTH_IMG' => $picture_size[0], 445 'HEIGHT_IMG' => $picture_size[1], 526 'ELEMENT_CONTENT' => $element_content, 446 527 447 528 'LEVEL_SEPARATOR' => $conf['level_separator'], 448 449 'L_HOME' => $lang['home'],450 'L_SLIDESHOW' => $lang['slideshow'],451 'L_STOP_SLIDESHOW' => $lang['slideshow_stop'],452 'L_PREV_IMG' =>$lang['previous_page'].' : ',453 'L_NEXT_IMG' =>$lang['next_page'].' : ',454 'L_ADMIN' =>$lang['link_info_image'],455 'L_COMMENT_TITLE' =>$lang['comments_title'],456 'L_ADD_COMMENT' =>$lang['comments_add'],457 'L_DELETE_COMMENT' =>$lang['comments_del'],458 'L_DELETE' =>$lang['delete'],459 'L_SUBMIT' =>$lang['submit'],460 'L_AUTHOR' => $lang['upload_author'],461 'L_COMMENT' =>$lang['comment'],462 'L_DOWNLOAD' => $lang['download'],463 'L_DOWNLOAD_HINT' => $lang['download_hint'],464 'L_PICTURE_METADATA' => $lang['picture_show_metadata'],465 'L_PICTURE_HIGH' => $lang['picture_high'],466 'L_UP_HINT' => $lang['home_hint'],467 'L_UP_ALT' => $lang['home'],468 529 469 530 'U_HOME' => make_index_url(), … … 483 544 //------------------------------------------------------- upper menu management 484 545 485 // download link if file is not a picture486 if ( !$picture['current']['is_picture'])546 // download link 547 if ( isset($picture['current']['download_url']) ) 487 548 { 488 549 $template->assign_block_vars( 489 550 'download', 490 551 array( 491 'U_DOWNLOAD' => $picture['current']['download'] 492 ) 493 ); 494 } 495 496 // display a high quality link if present 497 if (isset($picture['current']['high'])) 498 { 499 $uuid = uniqid(rand()); 500 501 $template->assign_block_vars( 502 'high', 503 array( 504 'U_HIGH' => $picture['current']['high'], 505 'UUID' => $uuid, 506 ) 507 ); 508 509 $template->assign_block_vars( 510 'download', 511 array( 512 'U_DOWNLOAD' => get_root_url().'action.php?dwn=' 513 .$picture['current']['high_file_system'] 552 'U_DOWNLOAD' => $picture['current']['download_url'] 514 553 ) 515 554 ); … … 656 695 657 696 // size in pixels 658 if ($picture['current']['is_picture']) 659 { 660 if ($original_width != $picture_size[0] 661 or $original_height != $picture_size[1]) 697 if ($picture['current']['is_picture'] and isset($picture['current']['width']) ) 698 { 699 if ($picture['current']['scaled_width'] !== $picture['current']['width'] ) 662 700 { 663 701 $infos['INFO_DIMENSIONS'] = 664 '<a href="'.$picture['current'][' src'].'" title="'.702 '<a href="'.$picture['current']['image_url'].'" title="'. 665 703 l10n('Original dimensions').'">'. 666 $ original_width.'*'.$original_height.'</a>';704 $picture['current']['width'].'*'.$picture['current']['height'].'</a>'; 667 705 } 668 706 else 669 707 { 670 $infos['INFO_DIMENSIONS'] = $original_width.'*'.$original_height; 708 $infos['INFO_DIMENSIONS'] = 709 $picture['current']['width'].'*'.$picture['current']['height']; 671 710 } 672 711 } -
trunk/plugins/event_tracer/main.inc.php
r1586 r1590 20 20 function load_config() 21 21 { 22 $x = @file_get_contents( dirname(__FILE__).'/ tracer.dat' );22 $x = @file_get_contents( dirname(__FILE__).'/data.dat' ); 23 23 if ($x!==false) 24 24 { … … 38 38 function save_config() 39 39 { 40 $file = fopen( dirname(__FILE__).'/ tracer.dat', 'w' );40 $file = fopen( dirname(__FILE__).'/data.dat', 'w' ); 41 41 fwrite($file, serialize($this->my_config) ); 42 42 fclose( $file ); 43 43 } 44 44 45 function pre_trigger_event($event_info)45 function on_pre_trigger_event($event_info) 46 46 { 47 if (!$this->me_working) 47 $this->dump('pre_trigger_event', $event_info); 48 } 49 function on_post_trigger_event($event_info) 50 { 51 $this->dump('post_trigger_event', $event_info); 52 } 53 54 function on_trigger_action($event_info) 55 { 56 $this->dump('trigger_action', $event_info); 57 } 58 59 function dump($event, $event_info) 60 { 61 foreach( $this->my_config['filters'] as $filter) 48 62 { 49 foreach( $this->my_config['filters'] as $filter)63 if ( preg_match( '/'.$filter.'/', $event_info['event'] ) ) 50 64 { 51 if ( preg_match( '/'.$filter.'/', $event_info['event'] ))65 if ($this->my_config['show_args']) 52 66 { 53 if ($this->my_config['show_args']) 54 $s = var_export( $event_info['data'], true ); 55 else 56 $s = ''; 57 pwg_debug('begin trigger_event "'.$event_info['event'].'" '.htmlspecialchars($s) ); 58 break; 67 $s = '<pre>'; 68 $s .= htmlspecialchars( var_export( $event_info['data'], true ) ); 69 $s .= '</pre>'; 59 70 } 71 else 72 $s = ''; 73 pwg_debug($event.' "'.$event_info['event'].'" '.($s) ); 74 break; 60 75 } 61 76 } 62 77 } 63 64 /*function post_trigger_event($filter_info)65 {66 if (!$this->me_working)67 {68 $s = var_export( $filter_info['data'], true );69 pwg_debug('end trigger_event '.$filter_info['event'].' '.$s );70 }71 }*/72 78 73 79 function plugin_admin_menu() … … 87 93 88 94 add_event_handler('plugin_admin_menu', array(&$eventTracer, 'plugin_admin_menu') ); 89 add_event_handler('pre_trigger_event', array(&$eventTracer, 'pre_trigger_event') ); 95 add_event_handler('pre_trigger_event', array(&$eventTracer, 'on_pre_trigger_event') ); 96 add_event_handler('post_trigger_event', array(&$eventTracer, 'on_post_trigger_event') ); 97 add_event_handler('trigger_action', array(&$eventTracer, 'on_trigger_action') ); 90 98 ?> -
trunk/plugins/event_tracer/tracer_admin.tpl
r1580 r1590 9 9 10 10 <label>Show event argument 11 <input type="checkbox" name="eventTracer_show_args" value="{EVENT_TRACER_SHOW_ARGS}"/>11 <input type="checkbox" name="eventTracer_show_args" {EVENT_TRACER_SHOW_ARGS} /> 12 12 </label> 13 13 <br/> -
trunk/plugins/hello_world/main.inc.php
r1586 r1590 2 2 Plugin Name: Hello World ! 3 3 Author: PhpWebGallery team 4 Description: This example plugin changes the page banner for the administration page 4 Description: This example plugin changes the page banner for the administration page. 5 5 */ 6 6 7 add_event_handler(' page_banner', 'hello_world_banner' );7 add_event_handler('loc_begin_page_header', 'hello_world_begin_header' ); 8 8 9 function hello_world_b anner($banner)9 function hello_world_begin_header() 10 10 { 11 11 global $page; 12 12 if ( isset($page['body_id']) and $page['body_id']=='theAdminPage') 13 13 { 14 return '<h1>Hello world from PhpWebGallery plugin!</h1>'; 14 $hellos = array( 'Aloha', 'Ahoy', 'Guten tag', 'Hello', 'Hoi', 'Hola', 'Salut', 'Yo' ); 15 shuffle($hellos); 16 $page['page_banner'] = $hellos[0]; 17 // just as an example we modify it a little bit later 18 add_event_handler('loc_end_page_header', 'hello_world_end_header'); 15 19 } 16 return $banner;17 20 } 21 22 23 function hello_world_end_header() 24 { 25 global $template, $page; 26 $template->assign_var( 'PAGE_BANNER', 27 '<h1>"'.$page['page_banner'].'" from PhpWebGallery plugin!</h1>'); 28 } 29 18 30 ?> -
trunk/template/yoga/header.tpl
r1539 r1590 16 16 <link rel="stylesheet" type="text/css" href="{pwg_root}template/{themeconf:template}/theme/{themeconf:theme}/theme.css"> 17 17 {themeconf:local_head} 18 <!-- BEGIN next-->19 <link rel="prefetch" href="{ next.U_IMG_SRC}">20 <!-- END next-->18 <!-- BEGIN prefetch --> 19 <link rel="prefetch" href="{prefetch.URL}"> 20 <!-- END prefetch --> 21 21 <!-- BEGIN refresh --> 22 22 <meta http-equiv="refresh" content="{REFRESH_TIME};url={U_REFRESH}"> -
trunk/template/yoga/picture.tpl
r1344 r1590 5 5 <div id="imageHeaderBar"> 6 6 <div class="browsePath"> 7 <a href="{U_HOME}" rel="home">{ L_HOME}</a>7 <a href="{U_HOME}" rel="home">{lang:home}</a> 8 8 {LEVEL_SEPARATOR}{SECTION_TITLE} 9 9 {LEVEL_SEPARATOR}{PICTURE_TITLE} … … 18 18 19 19 <div class="randomButtons"> 20 <a href="{U_SLIDESHOW}" title="{ L_SLIDESHOW}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/slideshow.png" class="button" alt="{L_SLIDESHOW}"></a>21 <a href="{U_METADATA}" title="{ L_PICTURE_METADATA}"><img src="{pwg_root}{themeconf:icon_dir}/metadata.png" class="button" alt="{L_PICTURE_METADATA}"></a>20 <a href="{U_SLIDESHOW}" title="{lang:slideshow}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/slideshow.png" class="button" alt="{lang:slideshow}"></a> 21 <a href="{U_METADATA}" title="{lang:picture_show_metadata}"><img src="{pwg_root}{themeconf:icon_dir}/metadata.png" class="button" alt="{lang:picture_show_metadata}"></a> 22 22 <!-- BEGIN representative --> 23 23 <a href="{representative.URL}" title="{lang:set as category representative}"><img src="{pwg_root}{themeconf:icon_dir}/representative.png" class="button" alt="{lang:representative}"/></a> … … 27 27 <!-- END favorite --> 28 28 <!-- BEGIN download --> 29 <a href="{download.U_DOWNLOAD}" title="{ L_DOWNLOAD}"><img src="{pwg_root}{themeconf:icon_dir}/save.png" class="button" alt="{L_DOWNLOAD}"></a>29 <a href="{download.U_DOWNLOAD}" title="{lang:download_hint}"><img src="{pwg_root}{themeconf:icon_dir}/save.png" class="button" alt="{lang:download}"></a> 30 30 <!-- END download --> 31 31 <!-- BEGIN admin --> 32 <a href="{U_ADMIN}" title="{ L_ADMIN}"><img src="{pwg_root}{themeconf:icon_dir}/preferences.png" class="button" alt="{L_ADMIN}"></a>32 <a href="{U_ADMIN}" title="{lang:link_info_image}"><img src="{pwg_root}{themeconf:icon_dir}/preferences.png" class="button" alt="{lang:link_info_image}"></a> 33 33 <!-- END admin --> 34 34 <!-- BEGIN caddie --> … … 42 42 <!-- END last --> 43 43 <!-- BEGIN next --> 44 <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>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> 45 45 <!-- 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="{ L_UP_ALT}"></a>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> 47 47 <!-- BEGIN previous --> 48 <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>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> 49 49 <!-- END previous --> 50 50 <!-- BEGIN first --> … … 56 56 57 57 <div id="theImage"> 58 <!-- BEGIN high --> 59 <a href="javascript:phpWGOpenWindow('{high.U_HIGH}','{high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')"> 60 <!-- END high --> 61 <img src="{SRC_IMG}" style="width:{WIDTH_IMG}px;height:{HEIGHT_IMG}px;" alt="{ALT_IMG}"> 62 <!-- BEGIN high --> 63 </a> 64 <p>{L_PICTURE_HIGH}</p> 65 <!-- END high --> 58 {ELEMENT_CONTENT} 66 59 <!-- BEGIN legend --> 67 60 <p>{legend.COMMENT_IMG}</p> … … 69 62 <!-- BEGIN stop_slideshow --> 70 63 <p> 71 [ <a href="{stop_slideshow.U_SLIDESHOW}">{ L_STOP_SLIDESHOW}</a> ]64 [ <a href="{stop_slideshow.U_SLIDESHOW}">{lang:slideshow_stop}</a> ] 72 65 </p> 73 66 <!-- END stop_slideshow --> … … 75 68 76 69 <!-- BEGIN previous --> 77 <a class="navThumb" id="thumbPrev" href="{previous.U_IMG}" title="{ L_PREV_IMG}{previous.TITLE_IMG}" rel="prev">70 <a class="navThumb" id="thumbPrev" href="{previous.U_IMG}" title="{lang:previous_page} : {previous.TITLE_IMG}" rel="prev"> 78 71 <img src="{previous.IMG}" class="thumbLink" id="linkPrev" alt="{previous.TITLE_IMG}"> 79 72 </a> 80 73 <!-- END previous --> 81 74 <!-- BEGIN next --> 82 <a class="navThumb" id="thumbNext" href="{next.U_IMG}" title="{ L_NEXT_IMG}{next.TITLE_IMG}" rel="next">75 <a class="navThumb" id="thumbNext" href="{next.U_IMG}" title="{lang:next_page} : {next.TITLE_IMG}" rel="next"> 83 76 <img src="{next.IMG}" class="thumbLink" id="linkNext" alt="{next.TITLE_IMG}"> 84 77 </a> … … 172 165 <!-- BEGIN comments --> 173 166 <div id="comments"> 174 <h2>[{comments.NB_COMMENT}] { L_COMMENT_TITLE}</h2>167 <h2>[{comments.NB_COMMENT}] {lang:comments_title}</h2> 175 168 176 169 <div class="navigationBar">{comments.NAV_BAR}</div> … … 180 173 <!-- BEGIN delete --> 181 174 <p class="userCommentDelete"> 182 <a href="{comments.comment.delete.U_COMMENT_DELETE}" title="{ L_DELETE_COMMENT}">183 <img src="{pwg_root}{themeconf:icon_dir}/delete.png" class="button" style="border:none;vertical-align:middle; margin-left:5px;" alt="[{ L_DELETE}]"/>175 <a href="{comments.comment.delete.U_COMMENT_DELETE}" title="{lang:comments_del}"> 176 <img src="{pwg_root}{themeconf:icon_dir}/delete.png" class="button" style="border:none;vertical-align:middle; margin-left:5px;" alt="[{lang:delete}]"/> 184 177 </a> 185 178 </p> … … 193 186 <form method="post" action="{U_ADD_COMMENT}" class="filter" id="addComment"> 194 187 <fieldset> 195 <legend>{ L_ADD_COMMENT}</legend>188 <legend>{lang:comments_add}</legend> 196 189 <!-- BEGIN author_field --> 197 <label>{ L_AUTHOR}<input type="text" name="author"></label>190 <label>{lang:upload_author}<input type="text" name="author"></label> 198 191 <!-- END author_field --> 199 192 <!-- BEGIN author_known --> 200 193 <input type="hidden" name="author" value="{comments.add_comment.author_known.KNOWN_AUTHOR}"> 201 194 <!-- END author_known --> 202 <label>{ L_COMMENT}<textarea name="content" rows="10" cols="80"></textarea></label>203 <input type="submit" value="{ L_SUBMIT}" {TAG_INPUT_ENABLED}>195 <label>{lang:comment}<textarea name="content" rows="10" cols="80"></textarea></label> 196 <input type="submit" value="{lang:submit}"> 204 197 </fieldset> 205 198 </form> … … 208 201 </div> 209 202 <!-- END comments --> 210 211
Note: See TracChangeset
for help on using the changeset viewer.