/[cvs]/nfo/php/libs/com.newsblob.phphtmllib/widgets/TextCSSNav.inc
ViewVC logotype

Diff of /nfo/php/libs/com.newsblob.phphtmllib/widgets/TextCSSNav.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by jonen, Fri Nov 14 21:30:57 2003 UTC revision 1.5 by jonen, Thu May 6 16:27:42 2004 UTC
# Line 103  class TextCSSNav extends BaseWidget { Line 103  class TextCSSNav extends BaseWidget {
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      /**      /**
# Line 164  class TextCSSNav extends BaseWidget { Line 165  class TextCSSNav extends BaseWidget {
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"]) {
# Line 176  class TextCSSNav extends BaseWidget { Line 177  class TextCSSNav extends BaseWidget {
177                                          }                                          }
178                                          $url .= "&".$this->_query_prefix."textcssnavselected=".$cnt;                                          $url .= "&".$this->_query_prefix."textcssnavselected=".$cnt;
179                                  }                                  }
180                                  $obj = html_a(htmlentities($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":
# Line 211  class TextCSSNav extends BaseWidget { Line 211  class TextCSSNav extends BaseWidget {
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  ?>  ?>

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed