From 9926b57bcdf73aea596b2b08a7ad22a11e77615e Mon Sep 17 00:00:00 2001 From: dairiki Date: Wed, 26 Feb 2003 23:59:48 +0000 Subject: [PATCH] Fixes from Todd Mokros for linkUnknownWikiWord in MacOSX and Portland themes. git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@2676 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- themes/MacOSX/themeinfo.php | 27 +++++++++++++++++++++------ themes/Portland/themeinfo.php | 17 ++++++++++++++--- 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/themes/MacOSX/themeinfo.php b/themes/MacOSX/themeinfo.php index 81fbbe927..a25ef1a5e 100644 --- a/themes/MacOSX/themeinfo.php +++ b/themes/MacOSX/themeinfo.php @@ -1,6 +1,6 @@ 'edit')); - //$link = HTML::span(HTML::a(array('href' => $url), '?')); - $link = HTML::span($this->makeButton('?', $url)); + global $request; + + // Get rid of anchors on unknown wikiwords + if (isa($wikiword, 'WikiPageName')) { + $default_text = $wikiword->shortName; + $wikiword = $wikiword->name; + } + else { + $default_text = $wikiword; + } + $url = WikiURL($wikiword, array('action' => 'create')); + //$link = HTML::span(HTML::a(array('href' => $url), '?')); + $button = $this->makeButton('?', $url); + $button->addTooltip(sprintf(_("Create: %s"), $wikiword)); + $link = HTML::span($button); + if (!empty($linktext)) { $link->unshiftContent(HTML::u($linktext)); $link->setAttr('class', 'named-wikiunknown'); } else { - $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($wikiword))); + $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($default_text))); $link->setAttr('class', 'wikiunknown'); } - + if ($request->getArg('frame')) + $link->setAttr('target', '_top'); + return $link; } } diff --git a/themes/Portland/themeinfo.php b/themes/Portland/themeinfo.php index 8c653eada..3a15abab7 100644 --- a/themes/Portland/themeinfo.php +++ b/themes/Portland/themeinfo.php @@ -1,5 +1,5 @@ 'edit')); + global $request; + if (isa($wikiword, 'WikiPageName')) { + $default_text = $wikiword->shortName; + $wikiword = $wikiword->name; + } + else { + $default_text = $wikiword; + } + + $url = WikiURL($wikiword, array('action' => 'create')); $link = HTML::span(HTML::a(array('href' => $url), '?')); if (!empty($linktext)) { @@ -17,9 +26,11 @@ class Theme_Portland extends Theme { $link->setAttr('class', 'named-wikiunknown'); } else { - $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($wikiword))); + $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($default_text))); $link->setAttr('class', 'wikiunknown'); } + if ($request->getArg('frame')) + $link->setAttr('target', '_top'); return $link; } -- 2.45.0