40 $this->toolbar_menu = ''; |
40 $this->toolbar_menu = ''; |
41 $this->additional_headers = ''; |
41 $this->additional_headers = ''; |
42 $this->plugin_blocks = Array(); |
42 $this->plugin_blocks = Array(); |
43 $this->theme_loaded = false; |
43 $this->theme_loaded = false; |
44 |
44 |
45 $this->fading_button = '<div style="background-image: url('.scriptPath.'/images/about-powered-enano-hover.png); background-repeat: no-repeat; width: 88px; height: 31px; margin: 0 auto;"> |
45 $this->fading_button = '<div style="background-image: url('.scriptPath.'/images/about-powered-enano-hover.png); background-repeat: no-repeat; width: 88px; height: 31px; margin: 0 auto 5px auto;"> |
46 <a href="http://enanocms.org/" onclick="window.open(this.href); return false;"><img style="border-width: 0;" alt=" " src="'.scriptPath.'/images/about-powered-enano.png" onmouseover="domOpacity(this, 100, 0, 500);" onmouseout="domOpacity(this, 0, 100, 500);" /></a> |
46 <a href="http://enanocms.org/" onclick="window.open(this.href); return false;"><img style="border-width: 0;" alt=" " src="'.scriptPath.'/images/about-powered-enano.png" onmouseover="domOpacity(this, 100, 0, 500);" onmouseout="domOpacity(this, 0, 100, 500);" /></a> |
47 </div>'; |
47 </div>'; |
48 |
48 |
49 $this->theme_list = Array(); |
49 $this->theme_list = Array(); |
50 $this->named_theme_list = Array(); |
50 $this->named_theme_list = Array(); |
195 |
196 |
196 // Get the "article" button text (depends on namespace) |
197 // Get the "article" button text (depends on namespace) |
197 switch($paths->namespace) { |
198 switch($paths->namespace) { |
198 case "Article": |
199 case "Article": |
199 default: |
200 default: |
200 $ns = 'article'; |
201 $ns = $lang->get('onpage_lbl_page_article'); |
201 break; |
202 break; |
202 case "Admin": |
203 case "Admin": |
203 $ns = 'administration page'; |
204 $ns = $lang->get('onpage_lbl_page_admin'); |
204 break; |
205 break; |
205 case "System": |
206 case "System": |
206 $ns = 'system message'; |
207 $ns = $lang->get('onpage_lbl_page_system'); |
207 break; |
208 break; |
208 case "File": |
209 case "File": |
209 $ns = 'uploaded file'; |
210 $ns = $lang->get('onpage_lbl_page_file'); |
210 break; |
211 break; |
211 case "Help": |
212 case "Help": |
212 $ns = 'documentation page'; |
213 $ns = $lang->get('onpage_lbl_page_help'); |
213 break; |
214 break; |
214 case "User": |
215 case "User": |
215 $ns = 'user page'; |
216 $ns = $lang->get('onpage_lbl_page_user'); |
216 break; |
217 break; |
217 case "Special": |
218 case "Special": |
218 $ns = 'special page'; |
219 $ns = $lang->get('onpage_lbl_page_special'); |
219 break; |
220 break; |
220 case "Template": |
221 case "Template": |
221 $ns = 'template'; |
222 $ns = $lang->get('onpage_lbl_page_template'); |
222 break; |
223 break; |
223 case "Project": |
224 case "Project": |
224 $ns = 'project page'; |
225 $ns = $lang->get('onpage_lbl_page_project'); |
225 break; |
226 break; |
226 case "Category": |
227 case "Category": |
227 $ns = 'category'; |
228 $ns = $lang->get('onpage_lbl_page_category'); |
228 break; |
229 break; |
229 } |
230 } |
230 $this->namespace_string = $ns; |
231 $this->namespace_string = $ns; |
|
232 unset($ns); |
231 $code = $plugins->setHook('page_type_string_set'); |
233 $code = $plugins->setHook('page_type_string_set'); |
232 foreach ( $code as $cmd ) |
234 foreach ( $code as $cmd ) |
233 { |
235 { |
234 eval($cmd); |
236 eval($cmd); |
235 } |
237 } |
282 |
284 |
283 $db->free_result(); |
285 $db->free_result(); |
284 $n = ( $session->get_permissions('mod_comments') ) ? (string)$nc : (string)$na; |
286 $n = ( $session->get_permissions('mod_comments') ) ? (string)$nc : (string)$na; |
285 if ( $session->get_permissions('mod_comments') && $nu > 0 ) |
287 if ( $session->get_permissions('mod_comments') && $nu > 0 ) |
286 { |
288 { |
287 $n .= ' total/'.$nu.' unapp.'; |
289 $subst = array( |
|
290 'num_comments' => $nc, |
|
291 'num_unapp' => $nu |
|
292 ); |
|
293 $btn_text = $lang->get('onpage_btn_discussion_unapp', $subst); |
|
294 } |
|
295 else |
|
296 { |
|
297 $subst = array( |
|
298 'num_comments' => $nc |
|
299 ); |
|
300 $btn_text = $lang->get('onpage_btn_discussion', $subst); |
288 } |
301 } |
289 |
302 |
290 $button->assign_vars(array( |
303 $button->assign_vars(array( |
291 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxComments()); return false; }" title="View the comments that other users have posted about this page (alt-c)" accesskey="c"', |
304 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxComments()); return false; }" title="View the comments that other users have posted about this page (alt-c)" accesskey="c"', |
292 'PARENTFLAGS' => 'id="mdgToolbar_discussion"', |
305 'PARENTFLAGS' => 'id="mdgToolbar_discussion"', |
293 'HREF' => makeUrl($paths->page, 'do=comments', true), |
306 'HREF' => makeUrl($paths->page, 'do=comments', true), |
294 'TEXT' => 'discussion ('.$n.')', |
307 'TEXT' => $btn_text, |
295 )); |
308 )); |
296 |
309 |
297 $tb .= $button->run(); |
310 $tb .= $button->run(); |
298 } |
311 } |
299 // Edit button |
312 // Edit button |
301 { |
314 { |
302 $button->assign_vars(array( |
315 $button->assign_vars(array( |
303 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxEditor()); return false; }" title="Edit the contents of this page (alt-e)" accesskey="e"', |
316 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxEditor()); return false; }" title="Edit the contents of this page (alt-e)" accesskey="e"', |
304 'PARENTFLAGS' => 'id="mdgToolbar_edit"', |
317 'PARENTFLAGS' => 'id="mdgToolbar_edit"', |
305 'HREF' => makeUrl($paths->page, 'do=edit', true), |
318 'HREF' => makeUrl($paths->page, 'do=edit', true), |
306 'TEXT' => 'edit this page' |
319 'TEXT' => $lang->get('onpage_btn_edit') |
307 )); |
320 )); |
308 $tb .= $button->run(); |
321 $tb .= $button->run(); |
309 // View source button |
322 // View source button |
310 } |
323 } |
311 else if($session->get_permissions('view_source') && ( !$session->get_permissions('edit_page') || !$session->get_permissions('even_when_protected') && $paths->page_protected ) && $paths->namespace != 'Special' && $paths->namespace != 'Admin') |
324 else if($session->get_permissions('view_source') && ( !$session->get_permissions('edit_page') || !$session->get_permissions('even_when_protected') && $paths->page_protected ) && $paths->namespace != 'Special' && $paths->namespace != 'Admin') |
312 { |
325 { |
313 $button->assign_vars(array( |
326 $button->assign_vars(array( |
314 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxViewSource()); return false; }" title="View the source code (wiki markup) that this page uses (alt-e)" accesskey="e"', |
327 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxViewSource()); return false; }" title="View the source code (wiki markup) that this page uses (alt-e)" accesskey="e"', |
315 'PARENTFLAGS' => 'id="mdgToolbar_edit"', |
328 'PARENTFLAGS' => 'id="mdgToolbar_edit"', |
316 'HREF' => makeUrl($paths->page, 'do=viewsource', true), |
329 'HREF' => makeUrl($paths->page, 'do=viewsource', true), |
317 'TEXT' => 'view source' |
330 'TEXT' => $lang->get('onpage_btn_viewsource') |
318 )); |
331 )); |
319 $tb .= $button->run(); |
332 $tb .= $button->run(); |
320 } |
333 } |
321 // History button |
334 // History button |
322 if ( $session->get_permissions('read') /* && $paths->wiki_mode */ && $paths->page_exists && $paths->namespace != 'Special' && $paths->namespace != 'Admin' && $session->get_permissions('history_view') ) |
335 if ( $session->get_permissions('read') /* && $paths->wiki_mode */ && $paths->page_exists && $paths->namespace != 'Special' && $paths->namespace != 'Admin' && $session->get_permissions('history_view') ) |
323 { |
336 { |
324 $button->assign_vars(array( |
337 $button->assign_vars(array( |
325 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxHistory()); return false; }" title="View a log of actions taken on this page (alt-h)" accesskey="h"', |
338 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxHistory()); return false; }" title="View a log of actions taken on this page (alt-h)" accesskey="h"', |
326 'PARENTFLAGS' => 'id="mdgToolbar_history"', |
339 'PARENTFLAGS' => 'id="mdgToolbar_history"', |
327 'HREF' => makeUrl($paths->page, 'do=history', true), |
340 'HREF' => makeUrl($paths->page, 'do=history', true), |
328 'TEXT' => 'history' |
341 'TEXT' => $lang->get('onpage_btn_history') |
329 )); |
342 )); |
330 $tb .= $button->run(); |
343 $tb .= $button->run(); |
331 } |
344 } |
332 |
345 |
333 $menubtn = $this->makeParserText($tplvars['toolbar_menu_button']); |
346 $menubtn = $this->makeParserText($tplvars['toolbar_menu_button']); |
337 if ( $session->get_permissions('read') && $paths->page_exists && ( $session->get_permissions('rename') && ( $paths->page_protected && $session->get_permissions('even_when_protected') || !$paths->page_protected ) ) && $paths->namespace != 'Special' && $paths->namespace != 'Admin' ) |
350 if ( $session->get_permissions('read') && $paths->page_exists && ( $session->get_permissions('rename') && ( $paths->page_protected && $session->get_permissions('even_when_protected') || !$paths->page_protected ) ) && $paths->namespace != 'Special' && $paths->namespace != 'Admin' ) |
338 { |
351 { |
339 $menubtn->assign_vars(array( |
352 $menubtn->assign_vars(array( |
340 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxRename()); return false; }" title="Change the display name of this page (alt-r)" accesskey="r"', |
353 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxRename()); return false; }" title="Change the display name of this page (alt-r)" accesskey="r"', |
341 'HREF' => makeUrl($paths->page, 'do=rename', true), |
354 'HREF' => makeUrl($paths->page, 'do=rename', true), |
342 'TEXT' => 'rename', |
355 'TEXT' => $lang->get('onpage_btn_rename'), |
343 )); |
356 )); |
344 $this->toolbar_menu .= $menubtn->run(); |
357 $this->toolbar_menu .= $menubtn->run(); |
345 } |
358 } |
346 |
359 |
347 // Vote-to-delete button |
360 // Vote-to-delete button |
348 if ( $paths->wiki_mode && $session->get_permissions('vote_delete') && $paths->page_exists && $paths->namespace != 'Special' && $paths->namespace != 'Admin') |
361 if ( $paths->wiki_mode && $session->get_permissions('vote_delete') && $paths->page_exists && $paths->namespace != 'Special' && $paths->namespace != 'Admin') |
349 { |
362 { |
350 $menubtn->assign_vars(array( |
363 $menubtn->assign_vars(array( |
351 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxDelVote()); return false; }" title="Vote to have this page deleted (alt-d)" accesskey="d"', |
364 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxDelVote()); return false; }" title="Vote to have this page deleted (alt-d)" accesskey="d"', |
352 'HREF' => makeUrl($paths->page, 'do=delvote', true), |
365 'HREF' => makeUrl($paths->page, 'do=delvote', true), |
353 'TEXT' => 'vote to delete this page', |
366 'TEXT' => $lang->get('onpage_btn_votedelete'), |
354 )); |
367 )); |
355 $this->toolbar_menu .= $menubtn->run(); |
368 $this->toolbar_menu .= $menubtn->run(); |
356 } |
369 } |
357 |
370 |
358 // Clear-votes button |
371 // Clear-votes button |
359 if ( $session->get_permissions('read') && $paths->wiki_mode && $paths->page_exists && $paths->namespace != 'Special' && $paths->namespace != 'Admin' && $session->get_permissions('vote_reset') && $paths->cpage['delvotes'] > 0) |
372 if ( $session->get_permissions('read') && $paths->wiki_mode && $paths->page_exists && $paths->namespace != 'Special' && $paths->namespace != 'Admin' && $session->get_permissions('vote_reset') && $paths->cpage['delvotes'] > 0) |
360 { |
373 { |
361 $menubtn->assign_vars(array( |
374 $menubtn->assign_vars(array( |
362 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxResetDelVotes()); return false; }" title="Vote to have this page deleted (alt-y)" accesskey="y"', |
375 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxResetDelVotes()); return false; }" title="Vote to have this page deleted (alt-y)" accesskey="y"', |
363 'HREF' => makeUrl($paths->page, 'do=resetvotes', true), |
376 'HREF' => makeUrl($paths->page, 'do=resetvotes', true), |
364 'TEXT' => 'reset deletion votes', |
377 'TEXT' => $lang->get('onpage_btn_votedelete_reset'), |
365 )); |
378 )); |
366 $this->toolbar_menu .= $menubtn->run(); |
379 $this->toolbar_menu .= $menubtn->run(); |
367 } |
380 } |
368 |
381 |
369 // Printable page button |
382 // Printable page button |
370 if ( $paths->page_exists && $paths->namespace != 'Special' && $paths->namespace != 'Admin' ) |
383 if ( $paths->page_exists && $paths->namespace != 'Special' && $paths->namespace != 'Admin' ) |
371 { |
384 { |
372 $menubtn->assign_vars(array( |
385 $menubtn->assign_vars(array( |
373 'FLAGS' => 'title="View a version of this page that is suitable for printing"', |
386 'FLAGS' => 'title="View a version of this page that is suitable for printing"', |
374 'HREF' => makeUrl($paths->page, 'printable=yes', true), |
387 'HREF' => makeUrl($paths->page, 'printable=yes', true), |
375 'TEXT' => 'view printable version', |
388 'TEXT' => $lang->get('onpage_btn_printable'), |
376 )); |
389 )); |
377 $this->toolbar_menu .= $menubtn->run(); |
390 $this->toolbar_menu .= $menubtn->run(); |
378 } |
391 } |
379 |
392 |
380 // Protect button |
393 // Protect button |
381 if($session->get_permissions('read') && $paths->wiki_mode && $paths->page_exists && $paths->namespace != 'Special' && $paths->namespace != 'Admin' && $session->get_permissions('protect')) |
394 if($session->get_permissions('read') && $paths->wiki_mode && $paths->page_exists && $paths->namespace != 'Special' && $paths->namespace != 'Admin' && $session->get_permissions('protect')) |
382 { |
395 { |
383 |
396 |
384 $label = $this->makeParserText($tplvars['toolbar_label']); |
397 $label = $this->makeParserText($tplvars['toolbar_label']); |
385 $label->assign_vars(array('TEXT' => 'protection:')); |
398 $label->assign_vars(array('TEXT' => $lang->get('onpage_lbl_protect'))); |
386 $t0 = $label->run(); |
399 $t0 = $label->run(); |
387 |
400 |
388 $ctmp = ''; |
401 $ctmp = ''; |
389 if ( $paths->cpage['protected'] == 1 ) |
402 if ( $paths->cpage['protected'] == 1 ) |
390 { |
403 { |
391 $ctmp=' style="text-decoration: underline;"'; |
404 $ctmp=' style="text-decoration: underline;"'; |
392 } |
405 } |
393 $menubtn->assign_vars(array( |
406 $menubtn->assign_vars(array( |
394 'FLAGS' => 'accesskey="i" onclick="if ( !KILL_SWITCH ) { ajaxProtect(1); return false; }" id="protbtn_1" title="Prevents all non-administrators from editing this page. [alt-i]"'.$ctmp, |
407 'FLAGS' => 'accesskey="i" onclick="if ( !KILL_SWITCH ) { ajaxProtect(1); return false; }" id="protbtn_1" title="Prevents all non-administrators from editing this page. [alt-i]"'.$ctmp, |
395 'HREF' => makeUrl($paths->page, 'do=protect&level=1', true), |
408 'HREF' => makeUrl($paths->page, 'do=protect&level=1', true), |
396 'TEXT' => 'on' |
409 'TEXT' => $lang->get('onpage_btn_protect_on') |
397 )); |
410 )); |
398 $t1 = $menubtn->run(); |
411 $t1 = $menubtn->run(); |
399 |
412 |
400 $ctmp = ''; |
413 $ctmp = ''; |
401 if ( $paths->cpage['protected'] == 0 ) |
414 if ( $paths->cpage['protected'] == 0 ) |
493 if ( $session->get_permissions('read') && $session->get_permissions('clear_logs') && $paths->namespace != 'Special' && $paths->namespace != 'Admin' ) |
506 if ( $session->get_permissions('read') && $session->get_permissions('clear_logs') && $paths->namespace != 'Special' && $paths->namespace != 'Admin' ) |
494 { |
507 { |
495 $menubtn->assign_vars(array( |
508 $menubtn->assign_vars(array( |
496 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxClearLogs()); return false; }" title="Remove all edit and action logs for this page from the database. IRREVERSIBLE! (alt-l)" accesskey="l"', |
509 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxClearLogs()); return false; }" title="Remove all edit and action logs for this page from the database. IRREVERSIBLE! (alt-l)" accesskey="l"', |
497 'HREF' => makeUrl($paths->page, 'do=flushlogs', true), |
510 'HREF' => makeUrl($paths->page, 'do=flushlogs', true), |
498 'TEXT' => 'clear page logs', |
511 'TEXT' => $lang->get('onpage_btn_clearlogs'), |
499 )); |
512 )); |
500 $this->toolbar_menu .= $menubtn->run(); |
513 $this->toolbar_menu .= $menubtn->run(); |
501 } |
514 } |
502 |
515 |
503 // Delete page button |
516 // Delete page button |
504 if ( $session->get_permissions('read') && $session->get_permissions('delete_page') && $paths->page_exists && $paths->namespace != 'Special' && $paths->namespace != 'Admin' ) |
517 if ( $session->get_permissions('read') && $session->get_permissions('delete_page') && $paths->page_exists && $paths->namespace != 'Special' && $paths->namespace != 'Admin' ) |
505 { |
518 { |
506 $s = 'delete this page'; |
519 $s = $lang->get('onpage_btn_deletepage'); |
507 if ( $paths->cpage['delvotes'] == 1 ) |
520 if ( $paths->cpage['delvotes'] == 1 ) |
508 { |
521 { |
509 $s .= ' (<b>'.$paths->cpage['delvotes'].'</b> vote)'; |
522 $subst = array( |
|
523 'num_votes' => $paths->cpage['delvotes'], |
|
524 'plural' => '' |
|
525 ); |
|
526 $s .= $lang->get('onpage_btn_deletepage_votes', $subst); |
510 } |
527 } |
511 else if ( $paths->cpage['delvotes'] > 1 ) |
528 else if ( $paths->cpage['delvotes'] > 1 ) |
512 { |
529 { |
513 $s .= ' (<b>'.$paths->cpage['delvotes'].'</b> votes)'; |
530 $subst = array( |
|
531 'num_votes' => $paths->cpage['delvotes'], |
|
532 'plural' => $lang->get('meta_plural') |
|
533 ); |
|
534 $s .= $lang->get('onpage_btn_deletepage_votes', $subst); |
514 } |
535 } |
515 |
536 |
516 $menubtn->assign_vars(array( |
537 $menubtn->assign_vars(array( |
517 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxDeletePage()); return false; }" title="Delete this page. This is always reversible unless the logs are cleared. (alt-k)" accesskey="k"', |
538 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxDeletePage()); return false; }" title="Delete this page. This is always reversible unless the logs are cleared. (alt-k)" accesskey="k"', |
518 'HREF' => makeUrl($paths->page, 'do=deletepage', true), |
539 'HREF' => makeUrl($paths->page, 'do=deletepage', true), |
559 if($session->get_permissions('edit_acl') || $session->user_level >= USER_LEVEL_ADMIN) |
580 if($session->get_permissions('edit_acl') || $session->user_level >= USER_LEVEL_ADMIN) |
560 { |
581 { |
561 $menubtn->assign_vars(array( |
582 $menubtn->assign_vars(array( |
562 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { return ajaxOpenACLManager(); }" title="Manage who can do what with this page (alt-m)" accesskey="m"', |
583 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { return ajaxOpenACLManager(); }" title="Manage who can do what with this page (alt-m)" accesskey="m"', |
563 'HREF' => makeUrl($paths->page, 'do=aclmanager', true), |
584 'HREF' => makeUrl($paths->page, 'do=aclmanager', true), |
564 'TEXT' => 'manage page access', |
585 'TEXT' => $lang->get('onpage_btn_acl'), |
565 )); |
586 )); |
566 $this->toolbar_menu .= $menubtn->run(); |
587 $this->toolbar_menu .= $menubtn->run(); |
567 } |
588 } |
568 |
589 |
569 // Administer page button |
590 // Administer page button |
570 if ( $session->user_level >= USER_LEVEL_ADMIN && $paths->page_exists && $paths->namespace != 'Special' && $paths->namespace != 'Admin' ) |
591 if ( $session->user_level >= USER_LEVEL_ADMIN && $paths->page_exists && $paths->namespace != 'Special' && $paths->namespace != 'Admin' ) |
571 { |
592 { |
572 $menubtn->assign_vars(array( |
593 $menubtn->assign_vars(array( |
573 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxAdminPage()); return false; }" title="Administrative options for this page" accesskey="g"', |
594 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxAdminPage()); return false; }" title="Administrative options for this page" accesskey="g"', |
574 'HREF' => makeUrlNS('Special', 'Administration', 'module='.$paths->nslist['Admin'].'PageManager', true), |
595 'HREF' => makeUrlNS('Special', 'Administration', 'module='.$paths->nslist['Admin'].'PageManager', true), |
575 'TEXT' => 'administrative options', |
596 'TEXT' => $lang->get('onpage_btn_admin'), |
576 )); |
597 )); |
577 $this->toolbar_menu .= $menubtn->run(); |
598 $this->toolbar_menu .= $menubtn->run(); |
578 } |
599 } |
579 |
600 |
580 if ( strlen($this->toolbar_menu) > 0 ) |
601 if ( strlen($this->toolbar_menu) > 0 ) |
581 { |
602 { |
582 $button->assign_vars(array( |
603 $button->assign_vars(array( |
583 'FLAGS' => 'id="mdgToolbar_moreoptions" onclick="if ( !KILL_SWITCH ) { return false; }" title="Additional options for working with this page"', |
604 'FLAGS' => 'id="mdgToolbar_moreoptions" onclick="if ( !KILL_SWITCH ) { return false; }" title="Additional options for working with this page"', |
584 'PARENTFLAGS' => '', |
605 'PARENTFLAGS' => '', |
585 'HREF' => makeUrl($paths->page, 'do=moreoptions', true), |
606 'HREF' => makeUrl($paths->page, 'do=moreoptions', true), |
586 'TEXT' => 'more options' |
607 'TEXT' => $lang->get('onpage_btn_moreoptions') |
587 )); |
608 )); |
588 $tb .= $button->run(); |
609 $tb .= $button->run(); |
589 } |
610 } |
590 |
611 |
591 $is_opera = (isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'], 'Opera')) ? true : false; |
612 $is_opera = (isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'], 'Opera')) ? true : false; |
630 $p = ( isset($_GET['printable']) ) ? '/printable' : ''; |
651 $p = ( isset($_GET['printable']) ) ? '/printable' : ''; |
631 |
652 |
632 // Add the e-mail address client code to the header |
653 // Add the e-mail address client code to the header |
633 $this->add_header($email->jscode()); |
654 $this->add_header($email->jscode()); |
634 |
655 |
|
656 // Add language file |
|
657 $lang_uri = makeUrlNS('Special', 'LangExportJSON/' . $lang->lang_id, false, true); |
|
658 $this->add_header("<script type=\"text/javascript\" src=\"$lang_uri\"></script>"); |
|
659 |
635 // Generate the code for the Log out and Change theme sidebar buttons |
660 // Generate the code for the Log out and Change theme sidebar buttons |
636 // Once again, the new template parsing system can be used here |
661 // Once again, the new template parsing system can be used here |
637 |
662 |
638 $parser = $this->makeParserText($tplvars['sidebar_button']); |
663 $parser = $this->makeParserText($tplvars['sidebar_button']); |
639 |
664 |
640 $parser->assign_vars(Array( |
665 $parser->assign_vars(Array( |
641 'HREF'=>makeUrlNS('Special', 'Logout'), |
666 'HREF'=>makeUrlNS('Special', 'Logout'), |
642 'FLAGS'=>'onclick="if ( !KILL_SWITCH ) { mb_logout(); return false; }"', |
667 'FLAGS'=>'onclick="if ( !KILL_SWITCH ) { mb_logout(); return false; }"', |
643 'TEXT'=>'Log out', |
668 'TEXT'=>$lang->get('sidebar_btn_logout'), |
644 )); |
669 )); |
645 |
670 |
646 $logout_link = $parser->run(); |
671 $logout_link = $parser->run(); |
647 |
672 |
648 $parser->assign_vars(Array( |
673 $parser->assign_vars(Array( |
649 'HREF'=>makeUrlNS('Special', 'Login/' . $paths->page), |
674 'HREF'=>makeUrlNS('Special', 'Login/' . $paths->page), |
650 'FLAGS'=>'onclick="if ( !KILL_SWITCH ) { ajaxStartLogin(); return false; }"', |
675 'FLAGS'=>'onclick="if ( !KILL_SWITCH ) { ajaxStartLogin(); return false; }"', |
651 'TEXT'=>'Log in', |
676 'TEXT'=>$lang->get('sidebar_btn_login'), |
652 )); |
677 )); |
653 |
678 |
654 $login_link = $parser->run(); |
679 $login_link = $parser->run(); |
655 |
680 |
656 $parser->assign_vars(Array( |
681 $parser->assign_vars(Array( |
657 'HREF'=>makeUrlNS('Special', 'ChangeStyle/'.$paths->page), |
682 'HREF'=>makeUrlNS('Special', 'ChangeStyle/'.$paths->page), |
658 'FLAGS'=>'onclick="if ( !KILL_SWITCH ) { ajaxChangeStyle(); return false; }"', |
683 'FLAGS'=>'onclick="if ( !KILL_SWITCH ) { ajaxChangeStyle(); return false; }"', |
659 'TEXT'=>'Change theme', |
684 'TEXT'=>$lang->get('sidebar_btn_changestyle'), |
660 )); |
685 )); |
661 |
686 |
662 $theme_link = $parser->run(); |
687 $theme_link = $parser->run(); |
663 |
688 |
664 $parser->assign_vars(Array( |
689 $parser->assign_vars(Array( |
665 'HREF'=>makeUrlNS('Special', 'Administration'), |
690 'HREF'=>makeUrlNS('Special', 'Administration'), |
666 'FLAGS'=>'onclick="if ( !KILL_SWITCH ) { void(ajaxStartAdminLogin()); return false; }"', |
691 'FLAGS'=>'onclick="if ( !KILL_SWITCH ) { void(ajaxStartAdminLogin()); return false; }"', |
667 'TEXT'=>'Administration', |
692 'TEXT'=>$lang->get('sidebar_btn_administration'), |
668 )); |
693 )); |
669 |
694 |
670 $admin_link = $parser->run(); |
695 $admin_link = $parser->run(); |
671 |
696 |
672 $SID = ($session->sid_super) ? $session->sid_super : ''; |
697 $SID = ($session->sid_super) ? $session->sid_super : ''; |
1411 |
1472 |
1412 // External links |
1473 // External links |
1413 // $message = preg_replace('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?) ([^\]]+)\\]#', '<a href="\\1://\\2">\\3</a><br style="display: none;" />', $message); |
1474 // $message = preg_replace('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?) ([^\]]+)\\]#', '<a href="\\1://\\2">\\3</a><br style="display: none;" />', $message); |
1414 // $message = preg_replace('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?)\\]#', '<a href="\\1://\\2">\\1://\\2</a><br style="display: none;" />', $message); |
1475 // $message = preg_replace('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?)\\]#', '<a href="\\1://\\2">\\1://\\2</a><br style="display: none;" />', $message); |
1415 |
1476 |
1416 preg_match_all('/\[((https?|ftp|irc):\/\/([^@\]"\':]+)?((([a-z0-9-]+\.)*)[a-z0-9-]+)(\/[A-z0-9_%\|~`!\!@#\$\^&\*\(\):;\.,\/-]*(\?(([a-z0-9_-]+)(=[A-z0-9_%\|~`\!@#\$\^&\*\(\):;\.,\/-\[\]]+)?((&([a-z0-9_-]+)(=[A-z0-9_%\|~`!\!@#\$\^&\*\(\):;\.,\/-]+)?)*))?)?)?) ([^\]]+)\]/is', $message, $ext_link); |
1477 preg_match_all('/\[((https?|ftp|irc):\/\/([^@\s\]"\':]+)?((([a-z0-9-]+\.)*)[a-z0-9-]+)(\/[A-z0-9_%\|~`!\!@#\$\^&\*\(\):;\.,\/-]*(\?(([a-z0-9_-]+)(=[A-z0-9_%\|~`\!@#\$\^&\*\(\):;\.,\/-\[\]]+)?((&([a-z0-9_-]+)(=[A-z0-9_%\|~`!\!@#\$\^&\*\(\):;\.,\/-]+)?)*))?)?)?) ([^\]]+)\]/is', $message, $ext_link); |
|
1478 |
|
1479 // die('<pre>' . htmlspecialchars( print_r($ext_link, true) ) . '</pre>'); |
1417 |
1480 |
1418 for ( $i = 0; $i < count($ext_link[0]); $i++ ) |
1481 for ( $i = 0; $i < count($ext_link[0]); $i++ ) |
1419 { |
1482 { |
1420 $text_parser->assign_vars(Array( |
1483 $text_parser->assign_vars(Array( |
1421 'HREF' => $ext_link[1][$i], |
1484 'HREF' => $ext_link[1][$i], |
1671 // SourceForge/W3C buttons |
1734 // SourceForge/W3C buttons |
1672 $ob = Array(); |
1735 $ob = Array(); |
1673 $admintitle = ( $session->user_level >= USER_LEVEL_ADMIN ) ? 'title="You may disable this button in the admin panel under General Configuration."' : ''; |
1736 $admintitle = ( $session->user_level >= USER_LEVEL_ADMIN ) ? 'title="You may disable this button in the admin panel under General Configuration."' : ''; |
1674 if(getConfig('sflogo_enabled')=='1') |
1737 if(getConfig('sflogo_enabled')=='1') |
1675 { |
1738 { |
1676 $ob[] = '<a style="text-align: center;" href="http://sourceforge.net/" onclick="if ( !KILL_SWITCH ) { window.open(this.href);return false; }"><img style="border-width: 0px;" alt="SourceForge.net Logo" src="http://sflogo.sourceforge.net/sflogo.php?group_id='.getConfig('sflogo_groupid').'&type='.getConfig('sflogo_type').'" /></a>'; |
1739 $sflogo_secure = ( isset($_SERVER['HTTPS']) ) ? 'https' : 'http'; |
|
1740 $ob[] = '<a style="text-align: center;" href="http://sourceforge.net/" onclick="if ( !KILL_SWITCH ) { window.open(this.href);return false; }"><img style="border-width: 0px;" alt="SourceForge.net Logo" src="' . $sflogo_secure . '://sflogo.sourceforge.net/sflogo.php?group_id='.getConfig('sflogo_groupid').'&type='.getConfig('sflogo_type').'" /></a>'; |
1677 } |
1741 } |
1678 if(getConfig('w3c_v32') =='1') $ob[] = '<a style="text-align: center;" href="http://validator.w3.org/check?uri=referer" onclick="if ( !KILL_SWITCH ) { window.open(this.href);return false; }"><img style="border: 0px solid #FFFFFF;" alt="Valid HTML 3.2" src="http://www.w3.org/Icons/valid-html32" /></a>'; |
1742 if(getConfig('w3c_v32') =='1') $ob[] = '<a style="text-align: center;" href="http://validator.w3.org/check?uri=referer" onclick="if ( !KILL_SWITCH ) { window.open(this.href);return false; }"><img style="border: 0px solid #FFFFFF;" alt="Valid HTML 3.2" src="http://www.w3.org/Icons/valid-html32" /></a>'; |
1679 if(getConfig('w3c_v40') =='1') $ob[] = '<a style="text-align: center;" href="http://validator.w3.org/check?uri=referer" onclick="if ( !KILL_SWITCH ) { window.open(this.href);return false; }"><img style="border: 0px solid #FFFFFF;" alt="Valid HTML 4.0" src="http://www.w3.org/Icons/valid-html40" /></a>'; |
1743 if(getConfig('w3c_v40') =='1') $ob[] = '<a style="text-align: center;" href="http://validator.w3.org/check?uri=referer" onclick="if ( !KILL_SWITCH ) { window.open(this.href);return false; }"><img style="border: 0px solid #FFFFFF;" alt="Valid HTML 4.0" src="http://www.w3.org/Icons/valid-html40" /></a>'; |
1680 if(getConfig('w3c_v401') =='1') $ob[] = '<a style="text-align: center;" href="http://validator.w3.org/check?uri=referer" onclick="if ( !KILL_SWITCH ) { window.open(this.href);return false; }"><img style="border: 0px solid #FFFFFF;" alt="Valid HTML 4.01" src="http://www.w3.org/Icons/valid-html401" /></a>'; |
1744 if(getConfig('w3c_v401') =='1') $ob[] = '<a style="text-align: center;" href="http://validator.w3.org/check?uri=referer" onclick="if ( !KILL_SWITCH ) { window.open(this.href);return false; }"><img style="border: 0px solid #FFFFFF;" alt="Valid HTML 4.01" src="http://www.w3.org/Icons/valid-html401" /></a>'; |
1681 if(getConfig('w3c_vxhtml10')=='1') $ob[] = '<a style="text-align: center;" href="http://validator.w3.org/check?uri=referer" onclick="if ( !KILL_SWITCH ) { window.open(this.href);return false; }"><img style="border: 0px solid #FFFFFF;" alt="Valid XHTML 1.0" src="http://www.w3.org/Icons/valid-xhtml10" /></a>'; |
1745 if(getConfig('w3c_vxhtml10')=='1') $ob[] = '<a style="text-align: center;" href="http://validator.w3.org/check?uri=referer" onclick="if ( !KILL_SWITCH ) { window.open(this.href);return false; }"><img style="border: 0px solid #FFFFFF;" alt="Valid XHTML 1.0" src="http://www.w3.org/Icons/valid-xhtml10" /></a>'; |