function custom_display_html_ref($page, $appearance, $hover = '', $anchor = '', $anchor_appearance = '') { global $SeparateLinkWords, $TDPageQueue, $Messages; if ($hover != '') { $hover = ' title="' . $hover . '"'; } if (query_page_exists($page)) { $found = FALSE; foreach ($TDPageQueue as $t) { if ($t == $page) { $found = TRUE; } } if (!$found) { $TDPageQueue[] = $page; } if ($SeparateLinkWords && $page == $appearance) { $appearance = html_split_name($page); } return '<a href="' . viewURL($page) . $anchor . '"' . $hover . '>' . $appearance . $anchor_appearance . '</a>'; } else { $Messages[] = 'Page <a href="index.php?action=edit&page=' . $page . '">' . $page . '</a> missing from Wiki.'; return $appearance; } }
function template_common_prologue($args) { global $AdditionalHeader, $CommonScript, $FindScript, $HomePage; global $MetaDescription, $MetaKeywords, $page, $pagestore, $ScriptBase; global $SeparateHeaderWords, $SeparateTitleWords, $ShortcutIcon; global $StyleScript, $TableSortScript, $UserName, $UseSpamRevert, $WikiLogo; global $WikiName; if ($SeparateTitleWords) { $args['title'] = html_split_name($args['title']); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html> <head> <meta name="KEYWORDS" content="<?php print $MetaKeywords; ?> "> <meta name="DESCRIPTION" content="<?php print $MetaDescription; ?> "> <?php if ($args['norobots']) { ?> <meta name="ROBOTS" content="NOINDEX, NOFOLLOW"> <?php } ?> <link type="text/css" rel="stylesheet" href="<?php print $StyleScript; ?> "> <link type="text/css" rel="stylesheet" media="print" href="<?php print $StyleScript; ?> &csstype=print"> <script src="<?php print $TableSortScript; ?> " type="text/javascript"></script> <script src="<?php print $CommonScript; ?> " type="text/javascript"></script> <?php if ($ShortcutIcon) { ?> <link rel="SHORTCUT ICON" href="<?php echo $ShortcutIcon; ?> "> <?php } ?> <link rel="ALTERNATE" title="<?php echo htmlspecialchars($WikiName); ?> " href="<?php echo $ScriptBase; ?> ?action=rss&page=<?php echo htmlspecialchars($page); ?> " TYPE="application/rss+xml"> <title><?php print $args['title'] . ' - ' . htmlspecialchars($WikiName); ?> </title> </head> <body onLoad="bodyOnLoad();"> <NOINDEX> <?php if ($AdditionalHeader) { print '<span class="printhide">'; include $AdditionalHeader; print '</span>'; } ?> <div id="header"> <div id="toprightbox" class="printhide"> <div class="jumpsearch"> <form method="get" action="<?php print $FindScript; ?> "> <input type="hidden" name="action" value="find"> Search: <input type="text" name="find" size="20" accesskey=","><?php $jumpSearchPage = $pagestore->page('JumpSearch'); if ($jumpSearchPage->exists()) { print ' <a href="' . viewURL('JumpSearch') . '">JumpSearch Help</a>'; } ?> <?php if ($args['headlink'] && $args['headlink'] != $HomePage && $args['headlink'] != 'RecentChanges' && $pagestore->getChildren($args['headlink'])) { ?> <br><input type="checkbox" name="branch_search" value="<?php print htmlspecialchars($args['headlink']); ?> "> <label name="branch_search">Search only children of <b><?php echo $args['headlink']; ?> </b></label> <?php } ?> </form> </div> <?php if (isset($args['tree'])) { $tree = $pagestore->getTreeFromLeaves($HomePage, $args['headlink']); drawTree($tree, true, $args['headlink']); } ?> </div> <div id="topleftbox"> <div class="logo printhide"> <a href="<?php print viewURL($HomePage); ?> "><img src="<?php print $WikiLogo; ?> " alt="[Home]"></a> </div> <h1> <?php print $args['heading']; if ($args['headlink'] != '') { if ($SeparateHeaderWords) { print html_split_name($args['headlink']); } else { print $args['headlink']; } } if (count($twin = $pagestore->twinpages($args['headlink']))) { // point at the sisterwiki's version print '<sup class="printhide">'; foreach ($twin as $site) { print " " . html_twin($site[0], $site[1]); } print '</sup>'; } print $args['headsufx'] . "</h1>\n"; if (isset($args['redirect_from']) && $args['redirect_from']) { print '(Redirected from <a href="' . viewURL($args['redirect_from']) . '&no_redirect=1">'; if ($SeparateHeaderWords) { print htmlspecialchars(html_split_name($args['redirect_from'])); } else { print htmlspecialchars($args['redirect_from']); } print "</a>)\n"; } ?> <div class="quote printhide"> <?php if (isset($args['quote'])) { $quotepage = $pagestore->page('AnnoyingQuote'); $quote = $quotepage->read(); if ($quotepage->exists()) { global $ParseEngine; $paragraphs = explode("\n\n", $quotepage->text); $last_paragraph = parseText(trim(array_pop($paragraphs)), $ParseEngine, $page); print $last_paragraph; } } ?> </div> </div> </div> </NOINDEX> <div id="contentbox"> <?php if (isset($args["toolbar"])) { ?> <div class="toolbar" id="toolbar-top"> <?php if ($args['spam_revert'] && $UseSpamRevert && $UserName) { ?> <form name="revertForm" method="post" action="<?php print revertURL($page); ?> "></form> <?php print toolbar_button('javascript:spamRevert();', 'Spam Revert', 0); ?> <?php } ?> <td><?php toolbar($page, $args); ?> </div> <?php } ?> <?php }
function template_common_prologue($args) { global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; global $StyleScript, $SeparateTitleWords, $SeparateHeaderWords, $SearchURL, $FindScript; //echo "<p>template_common_prologue(".print_r($args,True).")</p>"; $keywords = ' ' . html_split_name($args['headlink']); $keywords = str_replace('"', '"', $keywords); //ob_start(); // Start buffering output. /* if($SeparateTitleWords) { $args['title'] = html_split_name($args['title']); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns = "http://www.w3.org/1999/xhtml"> <head> <meta name="KEYWORDS" content="<?php print $MetaKeywords . $keywords; ?>" /> <meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" /> <?php if($args['norobots']) { ?> <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> <?php } ?> <link rel="STYLESHEET" href="<?php print $StyleScript; ?>" type="text/css" /> <title><?php print $args['title'] . ' - ' . $WikiName; ?></title> </head> <body> <?php */ ?> <link rel="stylesheet" href="<?php echo $GLOBALS['phpgw_info']['server']['webserver_url'] . '/wiki/template/wiki.css'; ?> " type="text/css" /> <div align="left"> <div id="header"> <?php /* removed logo for now: TODO show it on extern site <div class="logo"> <a href="<?php print viewURL($HomePage); ?>"><img src="<?php print $WikiLogo; ?>" alt="[Home]" /></a> </div> */ ?> <h1 style="margin:0px;"> <?php print $args['heading']; if ($args['headlink'] != '') { ?> <a class="title" href="<?php print findURL($args['headlink']); ?> "> <?php $title = get_title($args['headlink']); if ($SeparateHeaderWords) { print html_split_name($title); } else { print $title; } ?> </a> <?php } print $args['headsufx']; ?> </h1> <?php if ($args['toolbar']) { if (!$args['nosearch']) { echo '<form method="POST" action="' . $FindScript . '" name="thesearch"> <input type="hidden" name="action" value="find"/> <div class="form">' . "\n"; } print html_toolbar_top(); if (!$args['nosearch']) { echo ' | ' . lang('Search') . ': <input type="text" name="find" size="20" />'; } echo "\n<hr align=left width=99% />\n"; if (!$args['nosearch']) { echo "</div>\n</form>\n"; } } ?> </div> <?php }
function html_ref($page, $appearance, $hover = '', $anchor = '', $anchor_appearance = '') { global $db, $SeparateLinkWords; if (!is_array($page) && strstr($page, ':')) { list($name, $lang) = explode(':', $page); if (strlen($lang) == 2 || strlen($lang) == 5 && $lang[2] == '-') { $page = array('name' => $name, 'lang' => $lang); } } $title = get_title($page); if (is_array($appearance)) { $appearance = $appearance['lang'] && $appearance['lang'] != $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] ? $appearance['title'] . ':' . $appearance['lang'] : $appearance['title']; } if ($hover != '') { $hover = ' title="' . $hover . '"'; } global $pagestore; $p = $pagestore->page($page); if ($p->exists()) { if ($SeparateLinkWords && $title == $appearance) { $appearance = html_split_name($title); } return '<a href="' . viewURL($page) . $anchor . '"' . $hover . ' class="wiki">' . $appearance . $anchor_appearance . '</a>'; } elseif (!$p->acl_check()) { if (validate_page($title) == 1 && $appearance == $title) { return $title; } else { return $appearance; } } else { if (validate_page($title) == 1 && $appearance == $title) { return $title . '<a href="' . editURL($page) . '"' . $hover . '>?</a>'; } else { return '(' . $appearance . ')<a href="' . editURL($page) . '"' . $hover . '>?</a>'; } } }
function odt_ref($refPage, $appearance, $hover = '', $anchor = '', $anchor_appearance = '') { global $db, $SeparateLinkWords, $page, $pagestore, $ScriptBase; if ($page == 'RecentChanges') { $p_exists = $pagestore->page_exists($refPage); } else { $p = new WikiPage($db, $refPage); $p_exists = $p->exists(); // automatically handle plurals if (!$p_exists) { foreach (array('s', 'es') as $plural) { if (substr($refPage, -strlen($plural)) == $plural) { $temp_refPage = substr($refPage, 0, strlen($refPage) - strlen($plural)); $p = new WikiPage($db, $temp_refPage); if ($p_exists = $p->exists()) { $refPage = $temp_refPage; break; } } } } } if ($p_exists) { if ($SeparateLinkWords && $refPage == $appearance) { $appearance = html_split_name($refPage); } $url = $ScriptBase . '?page=' . urlencode($refPage) . $anchor; $result = odt_url($url, $appearance . $anchor_appearance); } else { $result = ""; if (validate_page($refPage) == 1 && $appearance == $refPage) { $result = $refPage; } else { // Free link. // Puts the appearance between parenthesis if there's a space in it. if (strpos($appearance, ' ') === false) { $tempAppearance = $appearance; } else { $tempAppearance = "({$appearance})"; } $result = $tempAppearance; } } return $result; }
function html_ref($refPage, $appearance, $hover = '', $anchor = '', $anchor_appearance = '') { global $db, $SeparateLinkWords, $page, $pagestore; if ($hover != '') { $hover = ' alt="' . $hover . '" title="' . $hover . '"'; } $redirect_from = ''; if ($page == 'RecentChanges') { $p_exists = $pagestore->page_exists($refPage); } else { $p = new WikiPage($db, $refPage); $p_exists = $p->exists(); // automatically handle plurals if (!$p_exists) { foreach (array('s', 'es') as $plural) { if (substr($refPage, -strlen($plural)) == $plural) { $temp_refPage = substr($refPage, 0, strlen($refPage) - strlen($plural)); $p = new WikiPage($db, $temp_refPage); if ($p_exists = $p->exists()) { $redirect_from = $refPage; $refPage = $temp_refPage; break; } } } } } $twintext = ""; $onlytwin = ""; $twin = $pagestore->twinpages($refPage, $page); if (!$p_exists && count($twin) == 1) { $onlytwin = html_twin_x($twin[0][0], $twin[0][1], $twin[0][1]); } else { if (count($twin)) { // point at the sisterwiki's version $n = 1; foreach ($twin as $site) { $twintext = $twintext . html_twin_x($site[0], $n, $site[1]); $n++; } $twintext = '<sup>' . $twintext . '</sup>'; } } if ($p_exists) { if ($SeparateLinkWords && $refPage == $appearance) { $appearance = html_split_name($refPage); } $result = '<a href="' . viewURL($refPage) . ($redirect_from ? '&redirect_from=' . $redirect_from : '') . $anchor . '"' . $hover . '>' . $appearance . $anchor_appearance . '</a>' . $onlytwin; } else { $result = ""; if (validate_page($refPage) == 1 && $appearance == $refPage) { if ($onlytwin) { $result = $onlytwin; } else { $result = $refPage; } } else { // Puts the appearance between parenthesis if there's a space in it. if (strpos($appearance, ' ') === false) { $tempAppearance = $appearance; } else { $tempAppearance = "({$appearance})"; } if ($onlytwin) { $result = $onlytwin; } else { $result = $tempAppearance; } } $result = $result . '<a href="' . editURL($refPage, '', $page) . '"' . ' title="Create this Wiki page" ' . $hover . '>?</a>' . $twintext; } return $result; }
function html_ref($page, $appearance, $hover = '', $anchor = '', $anchor_appearance = '') { global $db, $SeparateLinkWords; if ($hover != '') { $hover = ' title="' . $hover . '"'; } $p = new WikiPage($db, $page); if ($p->exists()) { if ($SeparateLinkWords && $page == $appearance) { $appearance = html_split_name($page); } return '<a href="' . viewURL($page) . $anchor . '"' . $hover . '>' . $appearance . $anchor_appearance . '</a>'; } else { if (validate_page($page) == 1 && $appearance == $page) { return $page . '<a href="' . editURL($page) . '"' . $hover . '>?</a>'; } else { return '(' . $appearance . ')<a href="' . editURL($page) . '"' . $hover . '>?</a>'; } } }
function template_common_prologue($args) { global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription; global $StyleScript, $SeparateTitleWords, $SeparateHeaderWords; $keywords = ' ' . html_split_name($args['headlink']); $keywords = str_replace('"', '"', $keywords); preg_match("/^(.*)\\//", $args['headlink'], $path); // Find startpath of page ob_start(); // Start buffering output. if ($SeparateTitleWords) { $args['title'] = html_split_name($args['title']); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns = "http://www.w3.org/1999/xhtml"> <head> <meta name="KEYWORDS" content="<?php print $MetaKeywords . $keywords; ?> " /> <meta name="DESCRIPTION" content="<?php print $MetaDescription; ?> " /> <?php if ($args['norobots']) { ?> <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> <?php } ?> <link rel="STYLESHEET" href="<?php print $StyleScript; ?> " type="text/css" /> <title><?php print $args['title'] . ' - ' . $WikiName; ?> </title> </head> <body> <div id="header"> <div class="logo"> <a href="<?php print viewURL($HomePage); ?> "><img src="<?php print $WikiLogo; ?> " alt="[Home]" /></a> </div> <h1> <?php print $args['heading']; if ($args['headlink'] != '') { ?> <a class="title" href="<?php print findURL($args['headlink']); ?> "> <?php if ($SeparateHeaderWords) { print html_split_name($args['headlink']); } else { print $args['headlink']; } ?> </a> <?php } print $args['headsufx']; ?> </h1> <div id="toolbar-top"> <?php if ($args['toolbar']) { if (isset($path[1])) { print html_toolbar_top($path[1]); } else { print html_toolbar_top(""); } } ?> </div> <hr /> </div> <?php }