1<?php 2/** 3 * DokuWiki template functions 4 * 5 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 6 * @author Andreas Gohr <andi@splitbrain.org> 7 */ 8 9if(!defined('DOKU_INC')) die('meh.'); 10 11/** 12 * Returns the path to the given template, uses 13 * default one if the custom version doesn't exist. 14 * 15 * @author Andreas Gohr <andi@splitbrain.org> 16 */ 17function template($tpl){ 18 global $conf; 19 20 if(@is_readable(DOKU_INC.'lib/tpl/'.$conf['template'].'/'.$tpl)) 21 return DOKU_INC.'lib/tpl/'.$conf['template'].'/'.$tpl; 22 23 return DOKU_INC.'lib/tpl/default/'.$tpl; 24} 25 26/** 27 * Print the content 28 * 29 * This function is used for printing all the usual content 30 * (defined by the global $ACT var) by calling the appropriate 31 * outputfunction(s) from html.php 32 * 33 * Everything that doesn't use the main template file isn't 34 * handled by this function. ACL stuff is not done here either. 35 * 36 * @author Andreas Gohr <andi@splitbrain.org> 37 */ 38function tpl_content($prependTOC=true) { 39 global $ACT; 40 global $INFO; 41 $INFO['prependTOC'] = $prependTOC; 42 43 ob_start(); 44 trigger_event('TPL_ACT_RENDER',$ACT,'tpl_content_core'); 45 $html_output = ob_get_clean(); 46 trigger_event('TPL_CONTENT_DISPLAY',$html_output,'ptln'); 47 48 return !empty($html_output); 49} 50 51function tpl_content_core(){ 52 global $ACT; 53 global $TEXT; 54 global $PRE; 55 global $SUF; 56 global $SUM; 57 global $IDX; 58 59 switch($ACT){ 60 case 'show': 61 html_show(); 62 break; 63 case 'locked': 64 html_locked(); 65 case 'edit': 66 case 'recover': 67 html_edit(); 68 break; 69 case 'preview': 70 html_edit(); 71 html_show($TEXT); 72 break; 73 case 'draft': 74 html_draft(); 75 break; 76 case 'search': 77 html_search(); 78 break; 79 case 'revisions': 80 $first = isset($_REQUEST['first']) ? intval($_REQUEST['first']) : 0; 81 html_revisions($first); 82 break; 83 case 'diff': 84 html_diff(); 85 break; 86 case 'recent': 87 if (is_array($_REQUEST['first'])) { 88 $_REQUEST['first'] = array_keys($_REQUEST['first']); 89 $_REQUEST['first'] = $_REQUEST['first'][0]; 90 } 91 $first = is_numeric($_REQUEST['first']) ? intval($_REQUEST['first']) : 0; 92 $show_changes = $_REQUEST['show_changes']; 93 html_recent($first, $show_changes); 94 break; 95 case 'index': 96 html_index($IDX); #FIXME can this be pulled from globals? is it sanitized correctly? 97 break; 98 case 'backlink': 99 html_backlinks(); 100 break; 101 case 'conflict': 102 html_conflict(con($PRE,$TEXT,$SUF),$SUM); 103 html_diff(con($PRE,$TEXT,$SUF),false); 104 break; 105 case 'login': 106 html_login(); 107 break; 108 case 'register': 109 html_register(); 110 break; 111 case 'resendpwd': 112 html_resendpwd(); 113 break; 114 case 'denied': 115 print p_locale_xhtml('denied'); 116 break; 117 case 'profile' : 118 html_updateprofile(); 119 break; 120 case 'admin': 121 tpl_admin(); 122 break; 123 case 'subscribe': 124 tpl_subscribe(); 125 break; 126 case 'media': 127 tpl_media(); 128 break; 129 default: 130 $evt = new Doku_Event('TPL_ACT_UNKNOWN',$ACT); 131 if ($evt->advise_before()) 132 msg("Failed to handle command: ".hsc($ACT),-1); 133 $evt->advise_after(); 134 unset($evt); 135 return false; 136 } 137 return true; 138} 139 140/** 141 * Places the TOC where the function is called 142 * 143 * If you use this you most probably want to call tpl_content with 144 * a false argument 145 * 146 * @author Andreas Gohr <andi@splitbrain.org> 147 */ 148function tpl_toc($return=false){ 149 global $TOC; 150 global $ACT; 151 global $ID; 152 global $REV; 153 global $INFO; 154 global $conf; 155 $toc = array(); 156 157 if(is_array($TOC)){ 158 // if a TOC was prepared in global scope, always use it 159 $toc = $TOC; 160 }elseif(($ACT == 'show' || substr($ACT,0,6) == 'export') && !$REV && $INFO['exists']){ 161 // get TOC from metadata, render if neccessary 162 $meta = p_get_metadata($ID, false, METADATA_RENDER_USING_CACHE); 163 if(isset($meta['internal']['toc'])){ 164 $tocok = $meta['internal']['toc']; 165 }else{ 166 $tocok = true; 167 } 168 $toc = $meta['description']['tableofcontents']; 169 if(!$tocok || !is_array($toc) || !$conf['tocminheads'] || count($toc) < $conf['tocminheads']){ 170 $toc = array(); 171 } 172 }elseif($ACT == 'admin'){ 173 // try to load admin plugin TOC FIXME: duplicates code from tpl_admin 174 $plugin = null; 175 if (!empty($_REQUEST['page'])) { 176 $pluginlist = plugin_list('admin'); 177 if (in_array($_REQUEST['page'], $pluginlist)) { 178 // attempt to load the plugin 179 $plugin =& plugin_load('admin',$_REQUEST['page']); 180 } 181 } 182 if ( ($plugin !== null) && 183 (!$plugin->forAdminOnly() || $INFO['isadmin']) ){ 184 $toc = $plugin->getTOC(); 185 $TOC = $toc; // avoid later rebuild 186 } 187 } 188 189 trigger_event('TPL_TOC_RENDER', $toc, null, false); 190 $html = html_TOC($toc); 191 if($return) return $html; 192 echo $html; 193} 194 195/** 196 * Handle the admin page contents 197 * 198 * @author Andreas Gohr <andi@splitbrain.org> 199 */ 200function tpl_admin(){ 201 global $INFO; 202 global $TOC; 203 204 $plugin = null; 205 if (!empty($_REQUEST['page'])) { 206 $pluginlist = plugin_list('admin'); 207 208 if (in_array($_REQUEST['page'], $pluginlist)) { 209 210 // attempt to load the plugin 211 $plugin =& plugin_load('admin',$_REQUEST['page']); 212 } 213 } 214 215 if ($plugin !== null){ 216 if(!is_array($TOC)) $TOC = $plugin->getTOC(); //if TOC wasn't requested yet 217 if($INFO['prependTOC']) tpl_toc(); 218 $plugin->html(); 219 }else{ 220 html_admin(); 221 } 222 return true; 223} 224 225/** 226 * Print the correct HTML meta headers 227 * 228 * This has to go into the head section of your template. 229 * 230 * @triggers TPL_METAHEADER_OUTPUT 231 * @param boolean $alt Should feeds and alternative format links be added? 232 * @author Andreas Gohr <andi@splitbrain.org> 233 */ 234function tpl_metaheaders($alt=true){ 235 global $ID; 236 global $REV; 237 global $INFO; 238 global $JSINFO; 239 global $ACT; 240 global $QUERY; 241 global $lang; 242 global $conf; 243 $it=2; 244 245 // prepare the head array 246 $head = array(); 247 248 // prepare seed for js and css 249 $tseed = 0; 250 $depends = getConfigFiles('main'); 251 foreach($depends as $f) { 252 $time = @filemtime($f); 253 if($time > $tseed) $tseed = $time; 254 } 255 256 // the usual stuff 257 $head['meta'][] = array( 'name'=>'generator', 'content'=>'DokuWiki'); 258 $head['link'][] = array( 'rel'=>'search', 'type'=>'application/opensearchdescription+xml', 259 'href'=>DOKU_BASE.'lib/exe/opensearch.php', 'title'=>$conf['title'] ); 260 $head['link'][] = array( 'rel'=>'start', 'href'=>DOKU_BASE ); 261 if(actionOK('index')){ 262 $head['link'][] = array( 'rel'=>'contents', 'href'=> wl($ID,'do=index',false,'&'), 263 'title'=>$lang['btn_index'] ); 264 } 265 266 if($alt){ 267 $head['link'][] = array( 'rel'=>'alternate', 'type'=>'application/rss+xml', 268 'title'=>'Recent Changes', 'href'=>DOKU_BASE.'feed.php'); 269 $head['link'][] = array( 'rel'=>'alternate', 'type'=>'application/rss+xml', 270 'title'=>'Current Namespace', 271 'href'=>DOKU_BASE.'feed.php?mode=list&ns='.$INFO['namespace']); 272 if(($ACT == 'show' || $ACT == 'search') && $INFO['writable']){ 273 $head['link'][] = array( 'rel'=>'edit', 274 'title'=>$lang['btn_edit'], 275 'href'=> wl($ID,'do=edit',false,'&')); 276 } 277 278 if($ACT == 'search'){ 279 $head['link'][] = array( 'rel'=>'alternate', 'type'=>'application/rss+xml', 280 'title'=>'Search Result', 281 'href'=>DOKU_BASE.'feed.php?mode=search&q='.$QUERY); 282 } 283 284 if(actionOK('export_xhtml')){ 285 $head['link'][] = array( 'rel'=>'alternate', 'type'=>'text/html', 'title'=>'Plain HTML', 286 'href'=>exportlink($ID, 'xhtml', '', false, '&')); 287 } 288 289 if(actionOK('export_raw')){ 290 $head['link'][] = array( 'rel'=>'alternate', 'type'=>'text/plain', 'title'=>'Wiki Markup', 291 'href'=>exportlink($ID, 'raw', '', false, '&')); 292 } 293 } 294 295 // setup robot tags apropriate for different modes 296 if( ($ACT=='show' || $ACT=='export_xhtml') && !$REV){ 297 if($INFO['exists']){ 298 //delay indexing: 299 if((time() - $INFO['lastmod']) >= $conf['indexdelay']){ 300 $head['meta'][] = array( 'name'=>'robots', 'content'=>'index,follow'); 301 }else{ 302 $head['meta'][] = array( 'name'=>'robots', 'content'=>'noindex,nofollow'); 303 } 304 $head['link'][] = array( 'rel'=>'canonical', 'href'=>wl($ID,'',true,'&') ); 305 }else{ 306 $head['meta'][] = array( 'name'=>'robots', 'content'=>'noindex,follow'); 307 } 308 }elseif(defined('DOKU_MEDIADETAIL')){ 309 $head['meta'][] = array( 'name'=>'robots', 'content'=>'index,follow'); 310 }else{ 311 $head['meta'][] = array( 'name'=>'robots', 'content'=>'noindex,nofollow'); 312 } 313 314 // set metadata 315 if($ACT == 'show' || $ACT=='export_xhtml'){ 316 // date of modification 317 if($REV){ 318 $head['meta'][] = array( 'name'=>'date', 'content'=>date('Y-m-d\TH:i:sO',$REV)); 319 }else{ 320 $head['meta'][] = array( 'name'=>'date', 'content'=>date('Y-m-d\TH:i:sO',$INFO['lastmod'])); 321 } 322 323 // keywords (explicit or implicit) 324 if(!empty($INFO['meta']['subject'])){ 325 $head['meta'][] = array( 'name'=>'keywords', 'content'=>join(',',$INFO['meta']['subject'])); 326 }else{ 327 $head['meta'][] = array( 'name'=>'keywords', 'content'=>str_replace(':',',',$ID)); 328 } 329 } 330 331 // load stylesheets 332 $head['link'][] = array('rel'=>'stylesheet', 'media'=>'screen', 'type'=>'text/css', 333 'href'=>DOKU_BASE.'lib/exe/css.php?t='.$conf['template'].'&tseed='.$tseed); 334 $head['link'][] = array('rel'=>'stylesheet', 'media'=>'all', 'type'=>'text/css', 335 'href'=>DOKU_BASE.'lib/exe/css.php?s=all&t='.$conf['template'].'&tseed='.$tseed); 336 $head['link'][] = array('rel'=>'stylesheet', 'media'=>'print', 'type'=>'text/css', 337 'href'=>DOKU_BASE.'lib/exe/css.php?s=print&t='.$conf['template'].'&tseed='.$tseed); 338 339 // make $INFO and other vars available to JavaScripts 340 $json = new JSON(); 341 $script = "var NS='".$INFO['namespace']."';"; 342 if($conf['useacl'] && $_SERVER['REMOTE_USER']){ 343 $script .= "var SIG='".toolbar_signature()."';"; 344 } 345 $script .= 'var JSINFO = '.$json->encode($JSINFO).';'; 346 $head['script'][] = array( 'type'=>'text/javascript', '_data'=> $script); 347 348 // load external javascript 349 $head['script'][] = array( 'type'=>'text/javascript', 'charset'=>'utf-8', '_data'=>'', 350 'src'=>DOKU_BASE.'lib/exe/js.php'.'?tseed='.$tseed); 351 352 // trigger event here 353 trigger_event('TPL_METAHEADER_OUTPUT',$head,'_tpl_metaheaders_action',true); 354 return true; 355} 356 357/** 358 * prints the array build by tpl_metaheaders 359 * 360 * $data is an array of different header tags. Each tag can have multiple 361 * instances. Attributes are given as key value pairs. Values will be HTML 362 * encoded automatically so they should be provided as is in the $data array. 363 * 364 * For tags having a body attribute specify the the body data in the special 365 * attribute '_data'. This field will NOT BE ESCAPED automatically. 366 * 367 * @author Andreas Gohr <andi@splitbrain.org> 368 */ 369function _tpl_metaheaders_action($data){ 370 foreach($data as $tag => $inst){ 371 foreach($inst as $attr){ 372 echo '<',$tag,' ',buildAttributes($attr); 373 if(isset($attr['_data']) || $tag == 'script'){ 374 if($tag == 'script' && $attr['_data']) 375 $attr['_data'] = "<!--//--><![CDATA[//><!--\n". 376 $attr['_data']. 377 "\n//--><!]]>"; 378 379 echo '>',$attr['_data'],'</',$tag,'>'; 380 }else{ 381 echo '/>'; 382 } 383 echo "\n"; 384 } 385 } 386} 387 388/** 389 * Print a link 390 * 391 * Just builds a link. 392 * 393 * @author Andreas Gohr <andi@splitbrain.org> 394 */ 395function tpl_link($url,$name,$more='',$return=false){ 396 $out = '<a href="'.$url.'" '; 397 if ($more) $out .= ' '.$more; 398 $out .= ">$name</a>"; 399 if ($return) return $out; 400 print $out; 401 return true; 402} 403 404/** 405 * Prints a link to a WikiPage 406 * 407 * Wrapper around html_wikilink 408 * 409 * @author Andreas Gohr <andi@splitbrain.org> 410 */ 411function tpl_pagelink($id,$name=null){ 412 print html_wikilink($id,$name); 413 return true; 414} 415 416/** 417 * get the parent page 418 * 419 * Tries to find out which page is parent. 420 * returns false if none is available 421 * 422 * @author Andreas Gohr <andi@splitbrain.org> 423 */ 424function tpl_getparent($id){ 425 global $conf; 426 $parent = getNS($id).':'; 427 resolve_pageid('',$parent,$exists); 428 if($parent == $id) { 429 $pos = strrpos (getNS($id),':'); 430 $parent = substr($parent,0,$pos).':'; 431 resolve_pageid('',$parent,$exists); 432 if($parent == $id) return false; 433 } 434 return $parent; 435} 436 437/** 438 * Print one of the buttons 439 * 440 * @author Adrian Lang <mail@adrianlang.de> 441 * @see tpl_get_action 442 */ 443function tpl_button($type,$return=false){ 444 $data = tpl_get_action($type); 445 if ($data === false) { 446 return false; 447 } elseif (!is_array($data)) { 448 $out = sprintf($data, 'button'); 449 } else { 450 extract($data); 451 if ($id === '#dokuwiki__top') { 452 $out = html_topbtn(); 453 } else { 454 $out = html_btn($type, $id, $accesskey, $params, $method); 455 } 456 } 457 if ($return) return $out; 458 echo $out; 459 return true; 460} 461 462/** 463 * Like the action buttons but links 464 * 465 * @author Adrian Lang <mail@adrianlang.de> 466 * @see tpl_get_action 467 */ 468function tpl_actionlink($type,$pre='',$suf='',$inner='',$return=false){ 469 global $lang; 470 $data = tpl_get_action($type); 471 if ($data === false) { 472 return false; 473 } elseif (!is_array($data)) { 474 $out = sprintf($data, 'link'); 475 } else { 476 extract($data); 477 if (strpos($id, '#') === 0) { 478 $linktarget = $id; 479 } else { 480 $linktarget = wl($id, $params); 481 } 482 $caption = $lang['btn_' . $type]; 483 $out = tpl_link($linktarget, $pre.(($inner)?$inner:$caption).$suf, 484 'class="action ' . $type . '" ' . 485 'accesskey="' . $accesskey . '" rel="nofollow" ' . 486 'title="' . hsc($caption) . '"', 1); 487 } 488 if ($return) return $out; 489 echo $out; 490 return true; 491} 492 493/** 494 * Check the actions and get data for buttons and links 495 * 496 * Available actions are 497 * 498 * edit - edit/create/show/draft 499 * history - old revisions 500 * recent - recent changes 501 * login - login/logout - if ACL enabled 502 * profile - user profile (if logged in) 503 * index - The index 504 * admin - admin page - if enough rights 505 * top - back to top 506 * back - back to parent - if available 507 * backlink - links to the list of backlinks 508 * subscribe/subscription- subscribe/unsubscribe 509 * 510 * @author Andreas Gohr <andi@splitbrain.org> 511 * @author Matthias Grimm <matthiasgrimm@users.sourceforge.net> 512 * @author Adrian Lang <mail@adrianlang.de> 513 */ 514function tpl_get_action($type) { 515 global $ID; 516 global $INFO; 517 global $REV; 518 global $ACT; 519 global $conf; 520 global $auth; 521 522 // check disabled actions and fix the badly named ones 523 if($type == 'history') $type='revisions'; 524 if(!actionOK($type)) return false; 525 526 $accesskey = null; 527 $id = $ID; 528 $method = 'get'; 529 $params = array('do' => $type); 530 switch($type){ 531 case 'edit': 532 // most complicated type - we need to decide on current action 533 if($ACT == 'show' || $ACT == 'search'){ 534 $method = 'post'; 535 if($INFO['writable']){ 536 $accesskey = 'e'; 537 if(!empty($INFO['draft'])) { 538 $type = 'draft'; 539 $params['do'] = 'draft'; 540 } else { 541 $params['rev'] = $REV; 542 if(!$INFO['exists']){ 543 $type = 'create'; 544 } 545 } 546 }else{ 547 if(!actionOK('source')) return false; //pseudo action 548 $params['rev'] = $REV; 549 $type = 'source'; 550 $accesskey = 'v'; 551 } 552 }else{ 553 $params = ''; 554 $type = 'show'; 555 $accesskey = 'v'; 556 } 557 break; 558 case 'revisions': 559 $type = 'revs'; 560 $accesskey = 'o'; 561 break; 562 case 'recent': 563 $accesskey = 'r'; 564 break; 565 case 'index': 566 $accesskey = 'x'; 567 break; 568 case 'top': 569 $accesskey = 'x'; 570 $params = ''; 571 $id = '#dokuwiki__top'; 572 break; 573 case 'back': 574 $parent = tpl_getparent($ID); 575 if (!$parent) { 576 return false; 577 } 578 $id = $parent; 579 $params = ''; 580 $accesskey = 'b'; 581 break; 582 case 'login': 583 $params['sectok'] = getSecurityToken(); 584 if(isset($_SERVER['REMOTE_USER'])){ 585 if (!actionOK('logout')) { 586 return false; 587 } 588 $params['do'] = 'logout'; 589 $type = 'logout'; 590 } 591 break; 592 case 'register': 593 if($_SERVER['REMOTE_USER']){ 594 return false; 595 } 596 break; 597 case 'resendpwd': 598 if($_SERVER['REMOTE_USER']){ 599 return false; 600 } 601 break; 602 case 'admin': 603 if(!$INFO['ismanager']){ 604 return false; 605 } 606 break; 607 case 'revert': 608 if(!$INFO['ismanager'] || !$REV || !$INFO['writable']) { 609 return false; 610 } 611 $params['rev'] = $REV; 612 $params['sectok'] = getSecurityToken(); 613 break; 614 case 'subscription': 615 $type = 'subscribe'; 616 $params['do'] = 'subscribe'; 617 case 'subscribe': 618 if(!$_SERVER['REMOTE_USER']){ 619 return false; 620 } 621 break; 622 case 'backlink': 623 break; 624 case 'profile': 625 if(!isset($_SERVER['REMOTE_USER'])){ 626 return false; 627 } 628 break; 629 case 'subscribens': 630 // Superseded by subscribe/subscription 631 return ''; 632 break; 633 case 'media': 634 break; 635 default: 636 return '[unknown %s type]'; 637 break; 638 } 639 return compact('accesskey', 'type', 'id', 'method', 'params'); 640} 641 642/** 643 * Wrapper around tpl_button() and tpl_actionlink() 644 * 645 * @author Anika Henke <anika@selfthinker.org> 646 */ 647function tpl_action($type,$link=0,$wrapper=false,$return=false,$pre='',$suf='',$inner='') { 648 $out = ''; 649 if ($link) $out .= tpl_actionlink($type,$pre,$suf,$inner,1); 650 else $out .= tpl_button($type,1); 651 if ($out && $wrapper) $out = "<$wrapper>$out</$wrapper>"; 652 653 if ($return) return $out; 654 print $out; 655 return $out ? true : false; 656} 657 658/** 659 * Print the search form 660 * 661 * If the first parameter is given a div with the ID 'qsearch_out' will 662 * be added which instructs the ajax pagequicksearch to kick in and place 663 * its output into this div. The second parameter controls the propritary 664 * attribute autocomplete. If set to false this attribute will be set with an 665 * value of "off" to instruct the browser to disable it's own built in 666 * autocompletion feature (MSIE and Firefox) 667 * 668 * @author Andreas Gohr <andi@splitbrain.org> 669 */ 670function tpl_searchform($ajax=true,$autocomplete=true){ 671 global $lang; 672 global $ACT; 673 global $QUERY; 674 675 // don't print the search form if search action has been disabled 676 if (!actionOk('search')) return false; 677 678 print '<form action="'.wl().'" accept-charset="utf-8" class="search" id="dw__search" method="get"><div class="no">'; 679 print '<input type="hidden" name="do" value="search" />'; 680 print '<input type="text" '; 681 if($ACT == 'search') print 'value="'.htmlspecialchars($QUERY).'" '; 682 if(!$autocomplete) print 'autocomplete="off" '; 683 print 'id="qsearch__in" accesskey="f" name="id" class="edit" title="[F]" />'; 684 print '<input type="submit" value="'.$lang['btn_search'].'" class="button" title="'.$lang['btn_search'].'" />'; 685 if($ajax) print '<div id="qsearch__out" class="ajax_qsearch JSpopup"></div>'; 686 print '</div></form>'; 687 return true; 688} 689 690/** 691 * Print the breadcrumbs trace 692 * 693 * @author Andreas Gohr <andi@splitbrain.org> 694 */ 695function tpl_breadcrumbs($sep='•'){ 696 global $lang; 697 global $conf; 698 699 //check if enabled 700 if(!$conf['breadcrumbs']) return false; 701 702 $crumbs = breadcrumbs(); //setup crumb trace 703 704 //reverse crumborder in right-to-left mode, add RLM character to fix heb/eng display mixups 705 if($lang['direction'] == 'rtl') { 706 $crumbs = array_reverse($crumbs,true); 707 $crumbs_sep = ' ‏<span class="bcsep">'.$sep.'</span>‏ '; 708 } else { 709 $crumbs_sep = ' <span class="bcsep">'.$sep.'</span> '; 710 } 711 712 //render crumbs, highlight the last one 713 print '<span class="bchead">'.$lang['breadcrumb'].':</span>'; 714 $last = count($crumbs); 715 $i = 0; 716 foreach ($crumbs as $id => $name){ 717 $i++; 718 echo $crumbs_sep; 719 if ($i == $last) print '<span class="curid">'; 720 tpl_link(wl($id),hsc($name),'class="breadcrumbs" title="'.$id.'"'); 721 if ($i == $last) print '</span>'; 722 } 723 return true; 724} 725 726/** 727 * Hierarchical breadcrumbs 728 * 729 * This code was suggested as replacement for the usual breadcrumbs. 730 * It only makes sense with a deep site structure. 731 * 732 * @author Andreas Gohr <andi@splitbrain.org> 733 * @author Nigel McNie <oracle.shinoda@gmail.com> 734 * @author Sean Coates <sean@caedmon.net> 735 * @author <fredrik@averpil.com> 736 * @todo May behave strangely in RTL languages 737 */ 738function tpl_youarehere($sep=' » '){ 739 global $conf; 740 global $ID; 741 global $lang; 742 743 // check if enabled 744 if(!$conf['youarehere']) return false; 745 746 $parts = explode(':', $ID); 747 $count = count($parts); 748 749 echo '<span class="bchead">'.$lang['youarehere'].': </span>'; 750 751 // always print the startpage 752 tpl_pagelink(':'.$conf['start']); 753 754 // print intermediate namespace links 755 $part = ''; 756 for($i=0; $i<$count - 1; $i++){ 757 $part .= $parts[$i].':'; 758 $page = $part; 759 if ($page == $conf['start']) continue; // Skip startpage 760 761 // output 762 echo $sep; 763 tpl_pagelink($page); 764 } 765 766 // print current page, skipping start page, skipping for namespace index 767 resolve_pageid('',$page,$exists); 768 if(isset($page) && $page==$part.$parts[$i]) return; 769 $page = $part.$parts[$i]; 770 if($page == $conf['start']) return; 771 echo $sep; 772 tpl_pagelink($page); 773 return true; 774} 775 776/** 777 * Print info if the user is logged in 778 * and show full name in that case 779 * 780 * Could be enhanced with a profile link in future? 781 * 782 * @author Andreas Gohr <andi@splitbrain.org> 783 */ 784function tpl_userinfo(){ 785 global $lang; 786 global $INFO; 787 if(isset($_SERVER['REMOTE_USER'])){ 788 print $lang['loggedinas'].': '.hsc($INFO['userinfo']['name']).' ('.hsc($_SERVER['REMOTE_USER']).')'; 789 return true; 790 } 791 return false; 792} 793 794/** 795 * Print some info about the current page 796 * 797 * @author Andreas Gohr <andi@splitbrain.org> 798 */ 799function tpl_pageinfo($ret=false){ 800 global $conf; 801 global $lang; 802 global $INFO; 803 global $ID; 804 805 // return if we are not allowed to view the page 806 if (!auth_quickaclcheck($ID)) { return false; } 807 808 // prepare date and path 809 $fn = $INFO['filepath']; 810 if(!$conf['fullpath']){ 811 if($INFO['rev']){ 812 $fn = str_replace(fullpath($conf['olddir']).'/','',$fn); 813 }else{ 814 $fn = str_replace(fullpath($conf['datadir']).'/','',$fn); 815 } 816 } 817 $fn = utf8_decodeFN($fn); 818 $date = dformat($INFO['lastmod']); 819 820 // print it 821 if($INFO['exists']){ 822 $out = ''; 823 $out .= $fn; 824 $out .= ' · '; 825 $out .= $lang['lastmod']; 826 $out .= ': '; 827 $out .= $date; 828 if($INFO['editor']){ 829 $out .= ' '.$lang['by'].' '; 830 $out .= editorinfo($INFO['editor']); 831 }else{ 832 $out .= ' ('.$lang['external_edit'].')'; 833 } 834 if($INFO['locked']){ 835 $out .= ' · '; 836 $out .= $lang['lockedby']; 837 $out .= ': '; 838 $out .= editorinfo($INFO['locked']); 839 } 840 if($ret){ 841 return $out; 842 }else{ 843 echo $out; 844 return true; 845 } 846 } 847 return false; 848} 849 850/** 851 * Prints or returns the name of the given page (current one if none given). 852 * 853 * If useheading is enabled this will use the first headline else 854 * the given ID is used. 855 * 856 * @author Andreas Gohr <andi@splitbrain.org> 857 */ 858function tpl_pagetitle($id=null, $ret=false){ 859 global $conf; 860 if(is_null($id)){ 861 global $ID; 862 $id = $ID; 863 } 864 865 $name = $id; 866 if (useHeading('navigation')) { 867 $title = p_get_first_heading($id); 868 if ($title) $name = $title; 869 } 870 871 if ($ret) { 872 return hsc($name); 873 } else { 874 print hsc($name); 875 return true; 876 } 877} 878 879/** 880 * Returns the requested EXIF/IPTC tag from the current image 881 * 882 * If $tags is an array all given tags are tried until a 883 * value is found. If no value is found $alt is returned. 884 * 885 * Which texts are known is defined in the functions _exifTagNames 886 * and _iptcTagNames() in inc/jpeg.php (You need to prepend IPTC 887 * to the names of the latter one) 888 * 889 * Only allowed in: detail.php 890 * 891 * @author Andreas Gohr <andi@splitbrain.org> 892 */ 893function tpl_img_getTag($tags,$alt='',$src=null){ 894 // Init Exif Reader 895 global $SRC; 896 897 if(is_null($src)) $src = $SRC; 898 899 static $meta = null; 900 if(is_null($meta)) $meta = new JpegMeta($src); 901 if($meta === false) return $alt; 902 $info = $meta->getField($tags); 903 if($info == false) return $alt; 904 return $info; 905} 906 907/** 908 * Prints the image with a link to the full sized version 909 * 910 * Only allowed in: detail.php 911 * 912 * @param $maxwidth int - maximal width of the image 913 * @param $maxheight int - maximal height of the image 914 * @param $link bool - link to the orginal size? 915 * @param $params array - additional image attributes 916 */ 917function tpl_img($maxwidth=0,$maxheight=0,$link=true,$params=null){ 918 global $IMG; 919 $w = tpl_img_getTag('File.Width'); 920 $h = tpl_img_getTag('File.Height'); 921 922 //resize to given max values 923 $ratio = 1; 924 if($w >= $h){ 925 if($maxwidth && $w >= $maxwidth){ 926 $ratio = $maxwidth/$w; 927 }elseif($maxheight && $h > $maxheight){ 928 $ratio = $maxheight/$h; 929 } 930 }else{ 931 if($maxheight && $h >= $maxheight){ 932 $ratio = $maxheight/$h; 933 }elseif($maxwidth && $w > $maxwidth){ 934 $ratio = $maxwidth/$w; 935 } 936 } 937 if($ratio){ 938 $w = floor($ratio*$w); 939 $h = floor($ratio*$h); 940 } 941 942 //prepare URLs 943 $url=ml($IMG,array('cache'=>$_REQUEST['cache']),true,'&'); 944 $src=ml($IMG,array('cache'=>$_REQUEST['cache'],'w'=>$w,'h'=>$h),true,'&'); 945 946 //prepare attributes 947 $alt=tpl_img_getTag('Simple.Title'); 948 if(is_null($params)){ 949 $p = array(); 950 }else{ 951 $p = $params; 952 } 953 if($w) $p['width'] = $w; 954 if($h) $p['height'] = $h; 955 $p['class'] = 'img_detail'; 956 if($alt){ 957 $p['alt'] = $alt; 958 $p['title'] = $alt; 959 }else{ 960 $p['alt'] = ''; 961 } 962 $p['src'] = $src; 963 964 $data = array('url'=>($link?$url:null), 'params'=>$p); 965 return trigger_event('TPL_IMG_DISPLAY',$data,'_tpl_img_action',true); 966} 967 968/** 969 * Default action for TPL_IMG_DISPLAY 970 */ 971function _tpl_img_action($data, $param=NULL) { 972 $p = buildAttributes($data['params']); 973 974 if($data['url']) print '<a href="'.hsc($data['url']).'">'; 975 print '<img '.$p.'/>'; 976 if($data['url']) print '</a>'; 977 return true; 978} 979 980/** 981 * This function inserts a 1x1 pixel gif which in reality 982 * is the indexer function. 983 * 984 * Should be called somewhere at the very end of the main.php 985 * template 986 */ 987function tpl_indexerWebBug(){ 988 global $ID; 989 global $INFO; 990 if(!$INFO['exists']) return false; 991 992 $p = array(); 993 $p['src'] = DOKU_BASE.'lib/exe/indexer.php?id='.rawurlencode($ID). 994 '&'.time(); 995 $p['width'] = 2; 996 $p['height'] = 1; 997 $p['alt'] = ''; 998 $att = buildAttributes($p); 999 print "<img $att />"; 1000 return true; 1001} 1002 1003// configuration methods 1004/** 1005 * tpl_getConf($id) 1006 * 1007 * use this function to access template configuration variables 1008 */ 1009function tpl_getConf($id){ 1010 global $conf; 1011 static $tpl_configloaded = false; 1012 1013 $tpl = $conf['template']; 1014 1015 if (!$tpl_configloaded){ 1016 $tconf = tpl_loadConfig(); 1017 if ($tconf !== false){ 1018 foreach ($tconf as $key => $value){ 1019 if (isset($conf['tpl'][$tpl][$key])) continue; 1020 $conf['tpl'][$tpl][$key] = $value; 1021 } 1022 $tpl_configloaded = true; 1023 } 1024 } 1025 1026 return $conf['tpl'][$tpl][$id]; 1027} 1028 1029/** 1030 * tpl_loadConfig() 1031 * reads all template configuration variables 1032 * this function is automatically called by tpl_getConf() 1033 */ 1034function tpl_loadConfig(){ 1035 1036 $file = DOKU_TPLINC.'/conf/default.php'; 1037 $conf = array(); 1038 1039 if (!@file_exists($file)) return false; 1040 1041 // load default config file 1042 include($file); 1043 1044 return $conf; 1045} 1046 1047// language methods 1048/** 1049 * tpl_getLang($id) 1050 * 1051 * use this function to access template language variables 1052 */ 1053function tpl_getLang($id){ 1054 static $lang = array(); 1055 1056 if (count($lang) === 0){ 1057 $path = DOKU_TPLINC.'lang/'; 1058 1059 $lang = array(); 1060 1061 global $conf; // definitely don't invoke "global $lang" 1062 // don't include once 1063 @include($path.'en/lang.php'); 1064 if ($conf['lang'] != 'en') @include($path.$conf['lang'].'/lang.php'); 1065 } 1066 1067 return $lang[$id]; 1068} 1069 1070/** 1071 * prints the "main content" in the mediamanger popup 1072 * 1073 * Depending on the user's actions this may be a list of 1074 * files in a namespace, the meta editing dialog or 1075 * a message of referencing pages 1076 * 1077 * Only allowed in mediamanager.php 1078 * 1079 * @triggers MEDIAMANAGER_CONTENT_OUTPUT 1080 * @param bool $fromajax - set true when calling this function via ajax 1081 * @author Andreas Gohr <andi@splitbrain.org> 1082 */ 1083function tpl_mediaContent($fromajax=false){ 1084 global $IMG; 1085 global $AUTH; 1086 global $INUSE; 1087 global $NS; 1088 global $JUMPTO; 1089 1090 if(is_array($_REQUEST['do'])){ 1091 $do = array_shift(array_keys($_REQUEST['do'])); 1092 }else{ 1093 $do = $_REQUEST['do']; 1094 } 1095 if(in_array($do,array('save','cancel'))) $do = ''; 1096 1097 if(!$do){ 1098 if($_REQUEST['edit']){ 1099 $do = 'metaform'; 1100 }elseif(is_array($INUSE)){ 1101 $do = 'filesinuse'; 1102 }else{ 1103 $do = 'filelist'; 1104 } 1105 } 1106 1107 // output the content pane, wrapped in an event. 1108 if(!$fromajax) ptln('<div id="media__content">'); 1109 $data = array( 'do' => $do); 1110 $evt = new Doku_Event('MEDIAMANAGER_CONTENT_OUTPUT', $data); 1111 if ($evt->advise_before()) { 1112 $do = $data['do']; 1113 if($do == 'metaform'){ 1114 media_metaform($IMG,$AUTH); 1115 }elseif($do == 'filesinuse'){ 1116 media_filesinuse($INUSE,$IMG); 1117 }elseif($do == 'filelist'){ 1118 media_filelist($NS,$AUTH,$JUMPTO); 1119 }elseif($do == 'searchlist'){ 1120 media_searchlist($_REQUEST['q'],$NS,$AUTH); 1121 }else{ 1122 msg('Unknown action '.hsc($do),-1); 1123 } 1124 } 1125 $evt->advise_after(); 1126 unset($evt); 1127 if(!$fromajax) ptln('</div>'); 1128 1129} 1130 1131/** 1132 * Prints the central column in full-screen media manager 1133 * Depending on the opened tab this may be a list of 1134 * files in a namespace, upload form or search form 1135 * 1136 * @author Kate Arzamastseva <pshns@ukr.net> 1137 */ 1138function tpl_fileList(){ 1139 global $AUTH; 1140 global $NS; 1141 global $JUMPTO; 1142 1143 $opened_tab = $_REQUEST['tab_files']; 1144 if (!$opened_tab) $opened_tab = 'files'; 1145 1146 media_tabs_files($opened_tab); 1147 if ($opened_tab == 'files') media_tab_files($NS,$AUTH,$JUMPTO); 1148 if ($opened_tab == 'upload') media_tab_upload($NS,$AUTH,$JUMPTO); 1149 if ($opened_tab == 'search') media_tab_search($NS,$AUTH); 1150 1151} 1152 1153/** 1154 * Prints the third column in full-screen media manager 1155 * Depending on the opened tab this may be details of the 1156 * selected file, the meta editing dialog or 1157 * list of file revisions 1158 * 1159 * @author Kate Arzamastseva <pshns@ukr.net> 1160 */ 1161function tpl_fileDetails(){ 1162 global $AUTH; 1163 global $NS; 1164 global $IMG; 1165 1166 $image = $_REQUEST['image']; 1167 if (!isset($IMG) && !isset($image)) return ''; 1168 1169 $opened_tab = $_REQUEST['tab_details']; 1170 if (!$opened_tab) $opened_tab = 'view'; 1171 if ($_REQUEST['edit']) $opened_tab = 'edit'; 1172 media_tabs_details($opened_tab); 1173 1174 if ($opened_tab == 'view') media_tab_view($image, $NS, $AUTH); 1175 if ($opened_tab == 'edit') { 1176 if ($IMG) media_tab_edit($IMG, $NS, $AUTH); 1177 else if ($image) media_tab_edit($image, $NS, $AUTH); 1178 } 1179 if ($opened_tab == 'history') media_tab_history($image,$NS,$AUTH); 1180} 1181 1182/** 1183 * prints the namespace tree in the mediamanger popup 1184 * 1185 * Only allowed in mediamanager.php 1186 * 1187 * @author Andreas Gohr <andi@splitbrain.org> 1188 */ 1189function tpl_mediaTree($fullscreen = false){ 1190 global $NS; 1191 if ($fullscreen) ptln('<div id="media-menu">'); 1192 else ptln('<div id="media__tree">'); 1193 media_nstree($NS); 1194 ptln('</div>'); 1195} 1196 1197 1198/** 1199 * Print a dropdown menu with all DokuWiki actions 1200 * 1201 * Note: this will not use any pretty URLs 1202 * 1203 * @author Andreas Gohr <andi@splitbrain.org> 1204 */ 1205function tpl_actiondropdown($empty='',$button='>'){ 1206 global $ID; 1207 global $INFO; 1208 global $REV; 1209 global $ACT; 1210 global $conf; 1211 global $lang; 1212 global $auth; 1213 1214 echo '<form action="' . DOKU_SCRIPT . '" method="post" accept-charset="utf-8">'; 1215 echo '<input type="hidden" name="id" value="'.$ID.'" />'; 1216 if($REV) echo '<input type="hidden" name="rev" value="'.$REV.'" />'; 1217 echo '<input type="hidden" name="sectok" value="'.getSecurityToken().'" />'; 1218 1219 echo '<select name="do" class="edit quickselect">'; 1220 echo '<option value="">'.$empty.'</option>'; 1221 1222 echo '<optgroup label=" — ">'; 1223 $act = tpl_get_action('edit'); 1224 if($act) echo '<option value="'.$act['params']['do'].'">'.$lang['btn_'.$act['type']].'</option>'; 1225 1226 $act = tpl_get_action('revisions'); 1227 if($act) echo '<option value="'.$act['params']['do'].'">'.$lang['btn_'.$act['type']].'</option>'; 1228 1229 $act = tpl_get_action('revert'); 1230 if($act) echo '<option value="'.$act['params']['do'].'">'.$lang['btn_'.$act['type']].'</option>'; 1231 1232 $act = tpl_get_action('backlink'); 1233 if($act) echo '<option value="'.$act['params']['do'].'">'.$lang['btn_'.$act['type']].'</option>'; 1234 echo '</optgroup>'; 1235 1236 echo '<optgroup label=" — ">'; 1237 $act = tpl_get_action('recent'); 1238 if($act) echo '<option value="'.$act['params']['do'].'">'.$lang['btn_'.$act['type']].'</option>'; 1239 1240 $act = tpl_get_action('index'); 1241 if($act) echo '<option value="'.$act['params']['do'].'">'.$lang['btn_'.$act['type']].'</option>'; 1242 echo '</optgroup>'; 1243 1244 echo '<optgroup label=" — ">'; 1245 $act = tpl_get_action('login'); 1246 if($act) echo '<option value="'.$act['params']['do'].'">'.$lang['btn_'.$act['type']].'</option>'; 1247 1248 $act = tpl_get_action('profile'); 1249 if($act) echo '<option value="'.$act['params']['do'].'">'.$lang['btn_'.$act['type']].'</option>'; 1250 1251 $act = tpl_get_action('subscribe'); 1252 if($act) echo '<option value="'.$act['params']['do'].'">'.$lang['btn_'.$act['type']].'</option>'; 1253 1254 $act = tpl_get_action('admin'); 1255 if($act) echo '<option value="'.$act['params']['do'].'">'.$lang['btn_'.$act['type']].'</option>'; 1256 echo '</optgroup>'; 1257 1258 echo '</select>'; 1259 echo '<input type="submit" value="'.$button.'" />'; 1260 echo '</form>'; 1261} 1262 1263/** 1264 * Print a informational line about the used license 1265 * 1266 * @author Andreas Gohr <andi@splitbrain.org> 1267 * @param string $img - print image? (|button|badge) 1268 * @param bool $return - when true don't print, but return HTML 1269 */ 1270function tpl_license($img='badge',$imgonly=false,$return=false){ 1271 global $license; 1272 global $conf; 1273 global $lang; 1274 if(!$conf['license']) return ''; 1275 if(!is_array($license[$conf['license']])) return ''; 1276 $lic = $license[$conf['license']]; 1277 1278 $out = '<div class="license">'; 1279 if($img){ 1280 $src = license_img($img); 1281 if($src){ 1282 $out .= '<a href="'.$lic['url'].'" rel="license"'; 1283 if($conf['target']['extern']) $out .= ' target="'.$conf['target']['extern'].'"'; 1284 $out .= '><img src="'.DOKU_BASE.$src.'" class="medialeft lic'.$img.'" alt="'.$lic['name'].'" /></a> '; 1285 } 1286 } 1287 if(!$imgonly) { 1288 $out .= $lang['license']; 1289 $out .= ' <a href="'.$lic['url'].'" rel="license" class="urlextern"'; 1290 if($conf['target']['extern']) $out .= ' target="'.$conf['target']['extern'].'"'; 1291 $out .= '>'.$lic['name'].'</a>'; 1292 } 1293 $out .= '</div>'; 1294 1295 if($return) return $out; 1296 echo $out; 1297} 1298 1299 1300/** 1301 * Includes the rendered XHTML of a given page 1302 * 1303 * This function is useful to populate sidebars or similar features in a 1304 * template 1305 */ 1306function tpl_include_page($pageid,$print=true){ 1307 global $ID; 1308 $oldid = $ID; 1309 $html = p_wiki_xhtml($pageid,'',false); 1310 $ID = $oldid; 1311 1312 if(!$print) return $html; 1313 echo $html; 1314} 1315 1316/** 1317 * Display the subscribe form 1318 * 1319 * @author Adrian Lang <lang@cosmocode.de> 1320 */ 1321function tpl_subscribe() { 1322 global $INFO; 1323 global $ID; 1324 global $lang; 1325 global $conf; 1326 $stime_days = $conf['subscribe_time']/60/60/24; 1327 1328 echo p_locale_xhtml('subscr_form'); 1329 echo '<h2>' . $lang['subscr_m_current_header'] . '</h2>'; 1330 echo '<div class="level2">'; 1331 if ($INFO['subscribed'] === false) { 1332 echo '<p>' . $lang['subscr_m_not_subscribed'] . '</p>'; 1333 } else { 1334 echo '<ul>'; 1335 foreach($INFO['subscribed'] as $sub) { 1336 echo '<li><div class="li">'; 1337 if ($sub['target'] !== $ID) { 1338 echo '<code class="ns">'.hsc(prettyprint_id($sub['target'])).'</code>'; 1339 } else { 1340 echo '<code class="page">'.hsc(prettyprint_id($sub['target'])).'</code>'; 1341 } 1342 $sstl = sprintf($lang['subscr_style_'.$sub['style']], $stime_days); 1343 if(!$sstl) $sstl = hsc($sub['style']); 1344 echo ' ('.$sstl.') '; 1345 1346 echo '<a href="' . wl($ID, 1347 array('do'=>'subscribe', 1348 'sub_target'=>$sub['target'], 1349 'sub_style'=>$sub['style'], 1350 'sub_action'=>'unsubscribe', 1351 'sectok' => getSecurityToken())) . 1352 '" class="unsubscribe">'.$lang['subscr_m_unsubscribe'] . 1353 '</a></div></li>'; 1354 } 1355 echo '</ul>'; 1356 } 1357 echo '</div>'; 1358 1359 // Add new subscription form 1360 echo '<h2>' . $lang['subscr_m_new_header'] . '</h2>'; 1361 echo '<div class="level2">'; 1362 $ns = getNS($ID).':'; 1363 $targets = array( 1364 $ID => '<code class="page">'.prettyprint_id($ID).'</code>', 1365 $ns => '<code class="ns">'.prettyprint_id($ns).'</code>', 1366 ); 1367 $styles = array( 1368 'every' => $lang['subscr_style_every'], 1369 'digest' => sprintf($lang['subscr_style_digest'], $stime_days), 1370 'list' => sprintf($lang['subscr_style_list'], $stime_days), 1371 ); 1372 1373 $form = new Doku_Form(array('id' => 'subscribe__form')); 1374 $form->startFieldset($lang['subscr_m_subscribe']); 1375 $form->addRadioSet('sub_target', $targets); 1376 $form->startFieldset($lang['subscr_m_receive']); 1377 $form->addRadioSet('sub_style', $styles); 1378 $form->addHidden('sub_action', 'subscribe'); 1379 $form->addHidden('do', 'subscribe'); 1380 $form->addHidden('id', $ID); 1381 $form->endFieldset(); 1382 $form->addElement(form_makeButton('submit', 'subscribe', $lang['subscr_m_subscribe'])); 1383 html_form('SUBSCRIBE', $form); 1384 echo '</div>'; 1385} 1386 1387/** 1388 * Tries to send already created content right to the browser 1389 * 1390 * Wraps around ob_flush() and flush() 1391 * 1392 * @author Andreas Gohr <andi@splitbrain.org> 1393 */ 1394function tpl_flush(){ 1395 ob_flush(); 1396 flush(); 1397} 1398 1399 1400/** 1401 * Use favicon.ico from data/media root directory if it exists, otherwise use 1402 * the one in the template's image directory. 1403 * 1404 * @author Anika Henke <anika@selfthinker.org> 1405 */ 1406function tpl_getFavicon($abs=false) { 1407 if (file_exists(mediaFN('favicon.ico'))) { 1408 return ml('favicon.ico', '', true, '', $abs); 1409 } 1410 1411 if($abs) { 1412 return DOKU_URL.substr(DOKU_TPL.'images/favicon.ico', strlen(DOKU_REL)); 1413 } 1414 1415 return DOKU_TPL.'images/favicon.ico'; 1416} 1417 1418/** 1419 * Prints full-screen media manager 1420 * 1421 * @author Kate Arzamastseva <pshns@ukr.net> 1422 */ 1423function tpl_media() { 1424 // 1425 global $DEL, $NS, $IMG, $AUTH, $JUMPTO; 1426 require_once(DOKU_INC.'lib/exe/mediamanager.php'); 1427 1428 echo '<div class="mediamanager" id="id-mediamanager">'; 1429 echo '<div class="mediamanager-slider" id="id-mediamanager-layout">'; 1430 echo '<div id="id-mediamanager-layout-namespaces" class="layout" style="width: 25%;">'; 1431 html_msgarea(); 1432 echo hsc('Namespaces:'); 1433 echo '<br /><br />'; 1434 echo '<div class="scroll-container">'; 1435 tpl_mediaTree(true); 1436 echo '</div>'; 1437 echo '</div>'; 1438 echo '<div id="id-mediamanager-layout-list" class="layout" style="width: 40%;">'; 1439 tpl_fileList(); 1440 echo '</div>'; 1441 echo '<div id="id-mediamanager-layout-detail" class="layout" style="width: 30%;">'; 1442 tpl_fileDetails(); 1443 echo '</div>'; 1444 echo '<div class="clearer"></div>'; 1445 echo '</div>'; 1446 echo '</div>'; 1447} 1448 1449//Setup VIM: ex: et ts=4 : 1450 1451