69 |
* @return string the raw html output. |
* @return string the raw html output. |
70 |
*/ |
*/ |
71 |
function render( $indent_level=1, $output_debug=0) { |
function render( $indent_level=1, $output_debug=0) { |
72 |
$this->_selected = $_REQUEST[$this->_query_prefix."textcssnavselected"]; |
$this->_selected = @$_REQUEST[$this->_query_prefix."textcssnavselected"]; |
73 |
$div = html_div("textnav", $this->_build_links()); |
$div = html_div("textnav", $this->_build_links()); |
74 |
return $div->render( $indent_level, $output_debug ); |
return $div->render( $indent_level, $output_debug ); |
75 |
} |
} |
103 |
function add($url, $text, $title="", $target="", $selected=FALSE) { |
function add($url, $text, $title="", $target="", $selected=FALSE) { |
104 |
array_push($this->data, array("type"=>"url", "url"=>$url, |
array_push($this->data, array("type"=>"url", "url"=>$url, |
105 |
"text"=>$text, "title"=>$title, |
"text"=>$text, "title"=>$title, |
106 |
"target"=>$target)); |
"target"=>$target, |
107 |
|
"selected"=> $selected)); |
108 |
} |
} |
109 |
|
|
110 |
/** |
/** |
165 |
$container = container(); |
$container = container(); |
166 |
$container->set_collapse(); |
$container->set_collapse(); |
167 |
|
|
168 |
$class = "first"; |
$is_first = TRUE; |
169 |
$cnt = 1; |
$cnt = 1; |
170 |
foreach( $this->data as $nav ) { |
foreach( $this->data as $nav ) { |
171 |
switch ($nav["type"]) { |
switch ($nav["type"]) { |
177 |
} |
} |
178 |
$url .= "&".$this->_query_prefix."textcssnavselected=".$cnt; |
$url .= "&".$this->_query_prefix."textcssnavselected=".$cnt; |
179 |
} |
} |
180 |
$obj = html_a($url, $nav["text"], "", $nav["target"], $nav["title"]); |
$obj = html_a(htmlentities($url), $nav["text"], "normal", $nav["target"], $nav["title"]); |
181 |
if ($class != NULL) { |
|
182 |
if ($this->_highlight_selected && $this->_selected == $cnt) { |
$is_selected = $this->_highlight_selected && ($this->_selected == $cnt || $nav["selected"]); |
183 |
$class = "selected".$class; |
$class = $is_selected ? "selected" : ""; |
184 |
} |
if ($is_first) { |
185 |
|
$class .= "first"; |
186 |
|
} |
187 |
|
if ($is_selected || $is_first) { |
188 |
$obj->set_class( $class ); |
$obj->set_class( $class ); |
|
$class = NULL; |
|
|
} else { |
|
|
if ($this->_highlight_selected && $this->_selected == $cnt) { |
|
|
$obj->set_class( "selected" ); |
|
|
} |
|
189 |
} |
} |
190 |
|
$is_first = FALSE; |
191 |
$cnt++; |
$cnt++; |
192 |
break; |
break; |
193 |
case "blank": |
case "blank": |
211 |
class TextCSSNavCSS extends CSSBuilder { |
class TextCSSNavCSS extends CSSBuilder { |
212 |
|
|
213 |
function user_setup() { |
function user_setup() { |
214 |
$this->add_entry(".textnav", "div", |
$this->add_entry(".textnav", "", |
215 |
array("margin" => "0px 0px 0px 0px") ); |
array( |
216 |
|
"margin" => "0px 0px 0px 0px", |
217 |
|
"padding" => "3px 0px 0px 0px", |
218 |
|
"height" => "16px", |
219 |
|
"color" => "#FFFFFF", |
220 |
|
"font-famiy" => "sans-serif", |
221 |
|
"font-size" => "11px", |
222 |
|
"font-weight" => "bold", |
223 |
|
) ); |
224 |
|
|
225 |
$this->add_entry(".textnav", "a", |
$this->add_entry(".textnav", "a.normal,a.normal:visited,a.normal:active", |
226 |
array("font-family" => "sans-serif", |
array("font-family" => "sans-serif", |
227 |
"font-size" => "8pt", |
"text-decoration" => "none", |
|
"font-weight" => "bold", |
|
|
"text-decoration" => "none", |
|
228 |
"color" => "#FFFFFF", |
"color" => "#FFFFFF", |
229 |
"background-color" => "#999999", |
"background-color" => "#999999", |
230 |
"padding" => "4px 4px 4px 4px", |
"padding" => "2px 4px 2px 4px", |
231 |
"border-right" => "1px solid #828282", |
"border-right" => "1px solid #828282", |
232 |
"border-top" => "1px solid #828282", |
"border-top" => "1px solid #828282", |
233 |
"border-bottom" => "1px solid #828282") ); |
"border-bottom" => "1px solid #828282" |
234 |
|
) ); |
|
$this->add_entry(".textnav", "a.first", |
|
|
array("border-left" => "1px solid #828282") ); |
|
235 |
|
|
236 |
$this->add_entry(".textnav", "a.selected", |
$this->add_entry(".textnav", "a.first,a.first:visited", |
237 |
array("color" => "#828282", |
array("font-family" => "sans-serif", |
238 |
"background-color" => "#EEEEEE") ); |
"text-decoration" => "none", |
239 |
|
"color" => "#FFFFFF", |
240 |
|
"background-color" => "#999999", |
241 |
|
"padding" => "2px 4px 2px 4px", |
242 |
|
"border-left" => "1px solid #828282", |
243 |
|
"border-right" => "1px solid #828282", |
244 |
|
"border-top" => "1px solid #828282", |
245 |
|
"border-bottom" => "1px solid #828282") ); |
246 |
|
|
247 |
$this->add_entry(".textnav", "a.selectedfirst", |
$this->add_entry(".textnav", "a.normal:hover,a.first:hover", |
248 |
array("color" => "#828282", |
array("color" => "#000000", |
249 |
"background-color" => "#EEEEEE", |
"background-color" => "#EEEEEE", |
250 |
"border-left" => "1px solid #828282") ); |
"text-decoration" => "none")); |
|
|
|
251 |
|
|
252 |
$this->add_entry(".textnav", "a:hover", |
$this->add_entry(".textnav", "a.selected,a.selected:visited", |
253 |
array("color" => "#000000", |
array("font-family" => "sans-serif", |
254 |
"background-color" => "#EEEEEE")); |
"text-decoration" => "none", |
255 |
|
"color" => "#828282", |
256 |
|
"background-color" => "#EEEEEE", |
257 |
|
"padding" => "2px 4px 2px 4px", |
258 |
|
"border-right" => "1px solid #828282", |
259 |
|
"border-top" => "1px solid #828282", |
260 |
|
"border-bottom" => "1px solid #828282" |
261 |
|
) ); |
262 |
|
|
263 |
|
$this->add_entry(".textnav", "a.selectedfirst,a.selectedfirst:visited", |
264 |
|
array("font-family" => "sans-serif", |
265 |
|
//"font-size" => "12px", |
266 |
|
"font-weight" => "bold", |
267 |
|
"text-decoration" => "none", |
268 |
|
"color" => "#828282", |
269 |
|
"background-color" => "#EEEEEE", |
270 |
|
"padding" => "2px 4px 2px 4px", |
271 |
|
"border-left" => "1px solid #828282", |
272 |
|
"border-top" => "1px solid #828282", |
273 |
|
"border-bottom" => "1px solid #828282") ); |
274 |
} |
} |
275 |
} |
} |
276 |
?> |
?> |