Exemple #1
0
 public function ytStyleSheet($url)
 {
     $app = JFactory::getApplication();
     $doc = JFactory::getDocument();
     $lessurl = str_replace('.css', '.less', str_replace('/css/', '/less/', $url));
     if (($app->getTemplate(true)->params->get('developing', 0) == 1 || JRequest::getVar('less2css') == 'all') && file_exists($lessurl)) {
         YTLess::addStyleSheet($lessurl);
     } elseif (file_exists($url)) {
         $doc->addStyleSheet($url);
     } else {
         die($url . ' not exists');
     }
 }
Exemple #2
0
 function ytStyleSheet($url)
 {
     $doc = JFactory::getDocument();
     if (!file_exists($url) && (strpos($url, 'http:') == false || strpos($url, 'https:') == false)) {
         $url = 'templates/' . $this->template . '/' . $url;
     }
     $lessurl = str_replace('.css', '.less', str_replace('/css/', '/less/', $url));
     if (($this->getParam('developing', 0) == 1 || JRequest::getVar('less2css') == 'all') && file_exists($lessurl)) {
         YTLess::addStyleSheet($lessurl);
     } elseif (file_exists($url)) {
         $doc->addStyleSheet($url);
     } elseif (basename($url) == 'template.css') {
         $doc->addStyleSheet(str_replace('template.css', 'template-' . $this->getParam('themecolor') . '.css', $url));
     } else {
         die($url . ' not exists');
     }
 }