public function html($obj)
 {
     $url = CRUDCompiler::compile($this->getLink(), ['this' => $obj]);
     $text = CRUDCompiler::compile($this->getText(), ['this' => $obj]);
     if (trim($text) == '') {
         $text = '#EMPTY#';
     }
     $o = BT::a($url, $text, $this->getClassesStr());
     return $o;
 }
Beispiel #2
0
 public static function breadcrumbsArr()
 {
     return array_merge(DemoMainPageAction::breadcrumbsArr(), [BT::a(self::getUrl(), 'Terms')]);
 }
Beispiel #3
0
 public static function tabHtml($text, $match_url, $link_url, $target = '')
 {
     $classes = '';
     // TODO: код взят из Router::match3() - использовать общую реализацию?
     $url_regexp = '@^' . $match_url . '$@';
     $matches_arr = array();
     $current_url = self::uri_no_getform();
     // TODO: use common request reader
     if (preg_match($url_regexp, $current_url, $matches_arr)) {
         $classes .= ' active ';
     }
     if ($link_url == '') {
         $classes .= ' disabled ';
     }
     $html = '';
     $html .= '<li role="presentation" class="' . Sanitize::sanitizeAttrValue($classes) . '">';
     $html .= BT::a($link_url, $text, '', $target);
     $html .= '</li>';
     return $html;
 }
Beispiel #4
0
 public static function breadcrumbsArr()
 {
     return [BT::a(self::getUrl(), 'Main')];
 }
Beispiel #5
0
 public static function breadcrumbsArr($term_id)
 {
     return array_merge(DemoTermsListAction::breadcrumbsArr(), [BT::a(self::getUrl($term_id), 'Term ' . $term_id)]);
 }
Beispiel #6
0
 public static function breadcrumbsArr($node_id)
 {
     return array_merge(DemoNodesListAction::getBreadcrumbsArr(), [BT::a(self::getUrl($node_id), 'Node ' . $node_id)]);
 }