/** * {@inheritDoc} * Canonize attribute 'conditional' with 'conditionalStylesheet' */ public function itemToString(stdClass $item) { if (isset($item->conditional)) { $item->conditionalStylesheet = $item->conditional; $item->conditional = null; } return parent::itemToString($item); }
/** * Create HTML link element from data item * * @param stdClass $item data item * * @return string */ public function itemToString(\stdClass $item) { // Normalize href to account for themes, then call the parent class: $relPath = 'css/' . $item->href; $currentTheme = ThemeTools::findContainingTheme($relPath); if (!empty($currentTheme)) { $urlHelper = $this->getView()->plugin('url'); $item->href = $urlHelper('home') . "themes/{$currentTheme}/" . $relPath; } return parent::itemToString($item); }
/** * Create HTML link element from data item * * @param \stdClass $item data item * * @return string */ public function itemToString(\stdClass $item) { // Normalize href to account for themes, then call the parent class: $relPath = 'css/' . $item->href; $details = $this->themeInfo->findContainingTheme($relPath, ThemeInfo::RETURN_ALL_DETAILS); if (!empty($details)) { $urlHelper = $this->getView()->plugin('url'); $url = $urlHelper('home') . "themes/{$details['theme']}/" . $relPath; $url .= strstr($url, '?') ? '&_=' : '?_='; $url .= filemtime($details['path']); $item->href = $url; } return parent::itemToString($item); }
public function itemToString(\stdClass $item) { if (isset($item->href) && !$this->startsWith($item->href, '//') && !$this->startsWith($item->href, 'http') && !$this->startsWith($item->href, 'ftp')) { if ($this->inline === true) { return $this->itemToInlineCssString($item); } else { $item->href = $this->view->mediapath($item->href); } } return parent::itemToString($item); }