示例#1
0
 function _render()
 {
     if (!empty($this->_content)) {
         $cssClass = $this->getAttribute('cssClass');
         $wrapStart = '';
         $wrapEnd = '';
         if (!is_null($this->getAttribute('wrapTag'))) {
             if (!is_null($cssClass)) {
                 $wrapperCssClass = ' class="' . $cssClass . '"';
             }
             $wrapStart = '<' . $this->getAttribute('wrapTag') . $wrapperCssClass . '>';
             $wrapEnd = '</' . $this->getAttribute('wrapTag') . '>';
         }
         $url = $this->_content;
         $label = $url;
         if (intval($url)) {
             // link interno
             $siteMap = $this->_application->getSiteMap();
             $menu = $siteMap->getNodeById($url);
             $label = $menu->title;
             $url = org_glizy_helpers_Link::makeURL('link', array('pageId' => $url));
         }
         $output = org_glizy_helpers_Link::formatLink($url, $label, NULL, $cssClass);
         return $wrapStart . $output . $wrapEnd;
     }
     return '';
 }