예제 #1
0
 public function getItemElement()
 {
     $element = new Element('li');
     $link = new Link('#', $this->getItemName());
     $link->setAttribute('data-tree-action', $this->getAction());
     $link->setAttribute('dialog-title', $this->getDialogTitle());
     $link->setAttribute('data-tree-action-url', $this->getActionURL());
     $element->appendChild($link);
     return $element;
 }
예제 #2
0
 /**
  * Add an image to the grid
  *
  * @param string|array $imageData An image
  */
 protected function addRichImage($imageData)
 {
     $imageData = $this->present($imageData);
     if ($this->presenter) {
         return $this->nest($imageData);
     }
     // If we provided a rich thumbnail
     $link = Arrays::get($imageData, 'link');
     $label = Arrays::get($imageData, 'label');
     $caption = Arrays::get($imageData, 'caption');
     // Create image
     $image = Arrays::get($imageData, 'image');
     $image = HtmlImage::create($image);
     // Linked thumbnail
     if (!$caption and !$label and $link) {
         $image = Link::create($link, $image)->addClass('thumbnail');
         // Plain thumbnail
     } else {
         $thumbnail = Element::create('div', $image)->addClass('thumbnail');
         if ($label) {
             $thumbnail->nest(Element::create('h3', $label));
         }
         if ($caption) {
             $thumbnail->nest(Element::create('p', $caption));
         }
         $image = $thumbnail;
     }
     return $this->nest(Element::create('li', $image));
 }
예제 #3
0
 public function getMenuItemLinkElement()
 {
     $a = new Link();
     $a->setValue('');
     if ($this->menuItem->getIcon()) {
         $icon = new Element('i');
         $icon->addClass('fa fa-' . $this->menuItem->getIcon());
         $a->appendChild($icon);
     }
     if ($this->menuItem->getLink()) {
         $a->href($this->menuItem->getLink());
     }
     foreach ($this->menuItem->getLinkAttributes() as $key => $value) {
         $a->setAttribute($key, $value);
     }
     // Set styling for accessiblity options
     if (Config::get('concrete.accessibility.toolbar_large_font')) {
         $spacing = 'padding-top: 15px';
         $height = 'line-height:17px;';
     } else {
         $spacing = 'padding: 16px 5px;';
         $height = 'line-height:14px;';
     }
     $wbTitle = new Element('div');
     $wbTitle->style($height . $spacing);
     $wbTitle->addClass('wb-fourms')->setValue($this->menuItem->getLabel());
     $a->appendChild($wbTitle);
     return $a;
 }
 public function getMenuItemLinkElement()
 {
     $link = new Link('#', '');
     $link->setAttribute('data-panel-url', \URL::to('/ccm/system/panels/page/relations'));
     $link->setAttribute('title', t('View related pages'));
     $link->setAttribute('data-launch-panel', 'page_relations');
     if (is_object($this->multilingualSection)) {
         $icon = $this->flagService->getFlagIcon($this->multilingualSection->getIcon());
         $accessibility = new Element('span', $this->multilingualSection->getLanguageText());
         $accessibility->addClass('ccm-toolbar-accessibility-title');
         $link->appendChild($icon);
         $link->appendChild($accessibility);
     } else {
         $icon = new Element('i', '');
         $icon->addClass('fa fa-sitemap');
         $accessibility = new Element('span', t('Related Pages'));
         $accessibility->addClass('ccm-toolbar-accessibility-title');
         $link->appendChild($icon);
         $link->appendChild($accessibility);
     }
     return $link;
 }
예제 #5
0
 public function getMenuItemLinkElement()
 {
     $a = new Link();
     $a->setValue('');
     if ($this->menuItem->getIcon()) {
         $icon = new Element('i');
         $icon->addClass('fa fa-' . $this->menuItem->getIcon());
         $a->appendChild($icon);
     }
     if ($this->menuItem->getLink()) {
         $a->href($this->menuItem->getLink());
     }
     foreach ($this->menuItem->getLinkAttributes() as $key => $value) {
         $a->setAttribute($key, $value);
     }
     $label = new Element('span');
     $label->addClass('ccm-toolbar-accessibility-title')->setValue($this->menuItem->getLabel());
     $a->appendChild($label);
     return $a;
 }
예제 #6
0
 public function testCanMakeLinkBlank()
 {
     $link = Link::create('#foo', 'bar')->blank();
     $matcher = $this->getMatcher('a', 'bar', array('target' => '_blank', 'href' => '#foo'));
     $this->assertHTML($matcher, $link);
 }
예제 #7
0
파일: Link.php 프로젝트: memeq1/menu
 /**
  * Render the Link
  *
  * @return string
  */
 public function render()
 {
     $this->href = $this->getEvaluatedUrl();
     // Don't compote URL if special URL
     if (!$this->isSpecialUrl()) {
         $this->href = Menu::getContainer()->bound('url') ? Menu::getContainer('url')->to($this->href) : $this->href;
     }
     return parent::render();
 }