コード例 #1
0
 function doStartTag()
 {
     parent::doStartTag();
     $this->href = TagUtil::normalizeHref($this->href, $this->preferred_markup);
     if ($this->menu) {
         // INSIDE A MENU
         $counter = ++$this->menu->counter;
         if (strpos($this->preferred_markup, 'xhtmlmp') !== false) {
             $this->fancy_ok = $this->menu->colorize && $this->_wall->menu_css_tag && $this->menu->table_and_css_background;
             if ($this->fancy_ok) {
                 $this->write('<tr>');
                 $this->write('<td class="bgcolor' . (($counter + 1) % 2 + 1) . '">');
                 if ($this->menu->autonumber) {
                     $this->write(' ' . $counter);
                     if ($this->opvw_icon) {
                         $this->write(' <img localsrc="' . $this->opvw_icon . '" src="" alt=""/>');
                     }
                     $this->write(' <a accesskey="' . $counter . '"');
                 } else {
                     if ($this->accesskey) {
                         $this->write(' ' . $this->accesskey . ' <a accesskey="' . $this->accesskey . '"');
                     } else {
                         $this->write('<a');
                     }
                 }
                 $this->write(' href="' . $this->href . '"');
                 if ($this->title) {
                     $this->write(' title="' . $this->title . '"');
                 }
                 if ($this->xhtmlClass) {
                     $this->write(' class="' . $this->xhtmlClass . '"');
                 }
                 if ($this->xhtmlId) {
                     $this->write(' id="' . $this->xhtmlId . '"');
                 }
                 $this->write('>');
             } else {
                 $this->write('<li>');
                 if ($this->opvw_icon && $this->_wall->use_xhtml_extensions) {
                     $this->write('<img localsrc="' . $this->opvw_icon . '" src="" alt=""/> ');
                 }
                 if ($this->menu->autonumber) {
                     $this->write('<a accesskey="' . $counter . '"');
                 } else {
                     if ($this->accesskey) {
                         $this->write('<a accesskey="' . $this->accesskey . '"');
                     } else {
                         $this->write('<a');
                     }
                 }
                 $this->write(' href="' . $this->href . '"');
                 if ($this->title) {
                     $this->write(' title="' . $this->title . '"');
                 }
                 if ($this->xhtmlClass) {
                     $this->write(' class="' . $this->xhtmlClass . '"');
                 }
                 if ($this->xhtmlId) {
                     $this->write(' id="' . $this->xhtmlId . '"');
                 }
                 $this->write('>');
             }
         } else {
             if (strpos($this->preferred_markup, 'chtml') !== false) {
                 if ($this->menu->autonumber) {
                     $emoji = TagUtil::getEmoji($counter, $this->region);
                     $this->write($emoji . '&nbsp;<a accesskey="' . $counter . '"');
                 } else {
                     if ($this->accesskey) {
                         $emoji = TagUtil::getEmoji($this->accesskey, $this->region);
                         $this->write($emoji . '&nbsp;<a accesskey="' . $this->accesskey . '"');
                     } else {
                         $this->write('<a');
                     }
                 }
                 $this->write(' href="' . $this->href . '"');
                 $this->write('>');
             } else {
                 if (strpos($this->preferred_markup, 'wml') !== false) {
                     if ($this->wml_menu_with_select) {
                         $this->write('<option onpick="' . $this->href . '"');
                         if ($this->title) {
                             $this->write(' title="' . $this->title . '"');
                         }
                         $this->write('>');
                         if ($this->opvw_icon && $this->_wall->use_wml_extensions) {
                             $this->write('<img localsrc="' . $this->opvw_icon . '" src="" alt=""/>');
                         }
                     } else {
                         //accesskey for WML is tricky: extra check accesskey support by WML browser
                         //SECOND THOUGHT: I get problems with GATEWAY. removing accesskey
                         //                for WML for the time being
                         $this->write('<a href="' . $this->href . '"');
                         if ($this->title) {
                             $this->write(' title="' . $this->title . '"');
                         }
                         $this->write('>');
                     }
                 }
             }
         }
     } else {
         // NOT INSIDE A MENU
         if (strpos($this->preferred_markup, 'xhtmlmp') !== false) {
             if ($this->accesskey) {
                 $this->write('<a accesskey="' . $this->accesskey . '"');
             } else {
                 $this->write('<a');
             }
             $this->write(' href="' . $this->href . '"');
             if ($this->title) {
                 $this->write(' title="' . $this->title . '"');
             }
             $this->write('>');
         } else {
             if (strpos($this->preferred_markup, 'chtml') !== false) {
                 if ($this->accesskey) {
                     $this->write('<a accesskey="' . $this->accesskey . '"');
                 } else {
                     $this->write('<a');
                 }
                 $this->write(' href="' . $this->href . '"');
                 $this->write('>');
             } else {
                 if (strpos($this->preferred_markup, 'wml') !== false) {
                     $this->write('<a');
                     $this->write(' href="' . $this->href . '"');
                     if ($this->title) {
                         $this->write(' title="' . $this->title . '"');
                     }
                     $this->write('>');
                 }
             }
         }
     }
 }