118 |
123 |
119 // link to the page view, but we have to build |
124 // link to the page view, but we have to build |
120 // the HREF. we support both the old form where |
125 // the HREF. we support both the old form where |
121 // the page always comes at the end, and the new |
126 // the page always comes at the end, and the new |
122 // form that uses %s for sprintf() |
127 // form that uses %s for sprintf() |
123 $href = $this->getConf('view_url'); |
128 $href = makeUrl($page, false, true); |
124 |
129 |
125 if (strpos($href, '%s') === false) { |
|
126 // use the old form (page-at-end) |
|
127 $href = $href . $page . $anchor; |
|
128 } else { |
|
129 // use the new form (sprintf format string) |
|
130 $href = sprintf($href, $page . $anchor); |
|
131 } |
|
132 |
|
133 // get the CSS class and generate output |
130 // get the CSS class and generate output |
134 $css = $this->formatConf(' class="%s"', 'css'); |
131 $css = $this->formatConf(' class="%s"', 'css'); |
135 |
132 |
136 $start = '<a'.$css.' href="'.$href.$as.'"'.$nobg.'>'; |
133 $start = '<a'.$css.' href="'.$href.$as.'"'.$nobg.'>'; |
137 $end = '</a>'; |
134 $end = '</a>'; |
141 |
138 |
142 // link to the page view, but we have to build |
139 // link to the page view, but we have to build |
143 // the HREF. we support both the old form where |
140 // the HREF. we support both the old form where |
144 // the page always comes at the end, and the new |
141 // the page always comes at the end, and the new |
145 // form that uses %s for sprintf() |
142 // form that uses %s for sprintf() |
146 $href = $this->getConf('view_url'); |
143 $href = makeUrl($page, false, true); |
147 |
|
148 if (strpos($href, '%s') === false) { |
|
149 // use the old form (page-at-end) |
|
150 $href = $href . $page . $anchor; |
|
151 } else { |
|
152 // use the new form (sprintf format string) |
|
153 $href = sprintf($href, $page . $anchor); |
|
154 } |
|
155 |
144 |
156 // get the CSS class and generate output |
145 // get the CSS class and generate output |
157 $css = $this->formatConf(' class="%s"', 'css'); |
146 $css = $this->formatConf(' class="%s"', 'css'); |
158 |
147 |
159 $start = '<a'.$css.' href="'.$href.$as.'"'.$nobg.' class="wikilink-nonexistent">'; |
148 $start = '<a'.$css.' href="'.$href.'"'.$nobg.' class="wikilink-nonexistent">'; |
160 $end = '</a>'; |
149 $end = '</a>'; |
161 |
|
162 } |
150 } |
163 if (!strlen($text)) { |
151 if (!strlen($text)) { |
164 $start .= $this->textEncode($options['page']); |
152 $start .= $this->textEncode($options['page']); |
165 } |
153 } |
166 if (isset($type)) { |
154 if (isset($type)) { |