/** * Get link of a page * * @access public * @static * @param string $page pagename * @param string $linkstr linkstr * @param string $option option * - page : link to page * - anchor : link to anchor * - off : no link * @return string * @uses sonots::make_pagelink_nopg * @uses sonots::make_pageanchor */ function link($page, $linkstr, $option) { switch ($option) { case 'page': $link = sonots::make_pagelink_nopg($page, $linkstr); break; case 'anchor': $anchor = sonots::make_pageanchor($page); $link = sonots::make_pagelink_nopg('', $linkstr, '#' . $anchor); break; case 'off': $link = $linkstr; break; } return $link; }
/** * make page aname link showing anchor icon (symbol) * * PukiWiki API Extension * * @access public * @static * @param string $page * @return string html * @see aname.inc.php (aname allows only fiexed_anchors such as x83dvkd8) * @version $Id: v 1.1 2008-06-07 11:14:46 sonots $ * @todo refine more */ function make_pageanamelink_icon($page) { global $_symbol_anchor; global $pkwk_dtd; $id = sonots::make_pageanchor($page); // from aname if (isset($pkwk_dtd) && $pkwk_dtd < PKWK_DTD_XHTML_1_1) { $attr_id = ' id="' . $id . '" name="' . $id . '"'; } else { $attr_id = ' id="' . $id . '"'; } $attr_href = ' href="#' . $id . '"'; $attr_title = ' title="' . $id . '"'; $attr_class = ' class="anchor_super"'; $link = '<a' . $attr_class . $attr_id . $attr_href . $attr_title . '>' . $_symbol_anchor . '</a>'; return $link; }
/** * Convert Includeline to Headline * * @return PluginSonotsHeadline */ function headline($usecache = true) { $linenum = $this->linenum; $depth = 0; $options = sonots::parse_options($this->args, array('titlestr' => 'title')); $string = PluginSonotsMetapage::linkstr($this->page, $options['titlestr'], $usecache); $anchor = sonots::make_pageanchor($this->page); return new PluginSonotsHeadline($this->page, $linenum, $depth, $string, $anchor); }