コード例 #1
0
ファイル: helper.less.php プロジェクト: MATsxm/Meet-Gavern
 function parseOnce($path, $force = 'false')
 {
     if ($force == 'true') {
         JFile::delete($path . DS . 'css' . DS . 'template.css');
         JFile::delete($path . DS . 'css' . DS . 'override.css');
         JFile::delete($path . DS . 'css' . DS . 'error.css');
         JFile::delete($path . DS . 'css' . DS . 'print.css');
         JFile::delete($path . DS . 'css' . DS . 'mail.css');
         // generate new Template CSS files
         try {
             // normal Template code
             lessc::ccompile($path . DS . 'less' . DS . 'main.less', $path . DS . 'css' . DS . 'template.css');
             lessc::ccompile($path . DS . 'less' . DS . 'print.less', $path . DS . 'css' . DS . 'print.css');
             lessc::ccompile($path . DS . 'less' . DS . 'mail.less', $path . DS . 'css' . DS . 'mail.css');
             // additional Template code
             lessc::ccompile($path . DS . 'less' . DS . 'error.less', $path . DS . 'css' . DS . 'error.css');
             lessc::ccompile($path . DS . 'less' . DS . 'offline.less', $path . DS . 'css' . DS . 'offline.css');
             lessc::ccompile($path . DS . 'less' . DS . 'override.less', $path . DS . 'css' . DS . 'override.css');
             $result = true;
         } catch (exception $ex) {
             $result = $ex->getMessage();
             return $result;
         }
         return $result;
     }
 }
コード例 #2
0
ファイル: helper.less.php プロジェクト: richardje/je
 function __construct($parent)
 {
     if ($parent->API->get('recompile_css', 0) == 1) {
         // remove old Template CSS files
         jimport('joomla.filesystem.file');
         JFile::delete($parent->API->URLtemplatepath() . DS . 'css' . DS . 'template.css');
         JFile::delete($parent->API->URLtemplatepath() . DS . 'css' . DS . 'override.css');
         JFile::delete($parent->API->URLtemplatepath() . DS . 'css' . DS . 'error.css');
         JFile::delete($parent->API->URLtemplatepath() . DS . 'css' . DS . 'print.css');
         JFile::delete($parent->API->URLtemplatepath() . DS . 'css' . DS . 'mail.css');
         // generate new Template CSS files
         try {
             // normal Template code
             lessc::ccompile($parent->API->URLtemplatepath() . DS . 'less' . DS . 'main.less', $parent->API->URLtemplatepath() . DS . 'css' . DS . 'template.css');
             lessc::ccompile($parent->API->URLtemplatepath() . DS . 'less' . DS . 'print.less', $parent->API->URLtemplatepath() . DS . 'css' . DS . 'print.css');
             lessc::ccompile($parent->API->URLtemplatepath() . DS . 'less' . DS . 'mail.less', $parent->API->URLtemplatepath() . DS . 'css' . DS . 'mail.css');
             // additional Template code
             lessc::ccompile($parent->API->URLtemplatepath() . DS . 'less' . DS . 'error.less', $parent->API->URLtemplatepath() . DS . 'css' . DS . 'error.css');
             lessc::ccompile($parent->API->URLtemplatepath() . DS . 'less' . DS . 'offline.less', $parent->API->URLtemplatepath() . DS . 'css' . DS . 'offline.css');
             lessc::ccompile($parent->API->URLtemplatepath() . DS . 'less' . DS . 'override.less', $parent->API->URLtemplatepath() . DS . 'css' . DS . 'override.css');
         } catch (exception $ex) {
             exit('LESS Parser fatal error:<br />' . $ex->getMessage());
         }
     }
 }
コード例 #3
0
ファイル: less.php プロジェクト: ralf57/less
 public static function compile($source, $destination)
 {
     try {
         lessc::ccompile($source, $destination);
     } catch (\Exception $ex) {
         \Log::error($ex->getMessage());
     }
 }
コード例 #4
0
 /**
  * Compiles the $uncompiledFile into CSS
  */
 public function compile()
 {
     if (MetaLanguages::within_modification_tolerance($this->uncompiledFile, $this->getCompiledPath())) {
         return;
     }
     $path = $this->getCompiledPath();
     if (file_exists($path) && !is_writable($this->getCompiledPath())) {
         user_error("SCSS compiling error: {$path} is not writable.", E_USER_ERROR);
     } elseif (!is_writable(dirname($path))) {
         user_error("SCSS compiling error: {$path} is not writable.", E_USER_ERROR);
     }
     lessc::ccompile(BASE_PATH . "/" . $this->uncompiledFile, BASE_PATH . "/" . $path);
 }
コード例 #5
0
ファイル: AppController.php プロジェクト: nickpersad/cake
 public function beforeRender()
 {
     // only compile it on development mode
     if (Configure::read('debug') > 0) {
         // import the file to application
         App::import('Vendor', 'lessc');
         // set the LESS file location
         $less = ROOT . DS . APP_DIR . DS . 'webroot' . DS . 'less' . DS . 'main.less';
         // set the CSS file to be written
         $css = ROOT . DS . APP_DIR . DS . 'webroot' . DS . 'css' . DS . 'main.css';
         // compile the file
         lessc::ccompile($less, $css);
     }
     parent::beforeRender();
 }
コード例 #6
0
ファイル: less.php プロジェクト: miguelmeca/wscat
 function createCss()
 {
     $inputFile = "views/backend/less/";
     $outFile = "views/backend/css/";
     $less_cats = array("main.less" => "main.css");
     //ХњСПБрвы
     for (reset($less_cats); $index = key($less_cats); next($less_cats)) {
         try {
             lessc::ccompile($inputFile . $index, $outFile . $less_cats[$index]);
             echo '<span>Брвы' . $inputFile . $index . 'ЕН' . $outFile . $less_cats[$index] . 'ГЩЙІ!</br></span>';
         } catch (exception $ex) {
             echo '<span>БрвыДэЮѓаХЯЂ:' . $ex->getMessage() . '</span>';
         }
     }
 }
コード例 #7
0
ファイル: helper.less.php プロジェクト: alexinteam/joomla3
 function __construct($parent, $force = 'false')
 {
     if ($parent->API->get('recompile_css', 0) == 1) {
         $tpl_path = $parent->API->URLtemplatepath();
         $override_suffix = '';
         if ($parent->API->get('custom_override', '-1') != '-1') {
             $override_suffix = '.' . $parent->API->get('custom_override', '-1');
         }
         $style_suffix = '';
         if ($parent->API->get('template_style', 'main.less') != 'main.less') {
             $style_suffix = '.' . str_replace('.main.less', '', $parent->API->get('template_style', 'main.less'));
         }
         $style_dir = str_replace('.', '', $style_suffix);
         if ($style_dir != '') {
             $style_dir .= DS;
         }
         $files = array('main' => array('css' => 'template' . $style_suffix . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . $parent->API->get('template_style', 'main.less')), 'small.desktop' => array('css' => 'small.desktop' . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . $style_dir . 'small.desktop.less'), 'tablet' => array('css' => 'tablet' . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . $style_dir . 'tablet.less'), 'small.tablet' => array('css' => 'small.tablet' . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . $style_dir . 'small.tablet.less'), 'mobile' => array('css' => 'mobile' . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . $style_dir . 'mobile.less'), 'print' => array('css' => 'print' . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . 'print.less'), 'mailto' => array('css' => 'mailto' . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . 'mailto.less'), 'offline' => array('css' => 'offline' . $style_suffix . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . $style_dir . 'offline.less'), 'override' => array('css' => 'override' . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . 'override.less'));
         if ($parent->API->get('custom_override', '-1') !== '-1') {
             $override_path = JPATH_SITE . DS . 'templates' . DS . 'gk_overrides' . DS . $parent->API->get('custom_override', '-1') . DS . 'less' . DS;
             foreach ($files as $file_name => $file_data) {
                 if (JFile::exists($override_path . $file_name . '.less')) {
                     $files[$file_name]['less'] = $override_path . $file_name . '.less';
                 }
             }
         }
         // remove old Template CSS files
         foreach ($files as $file) {
             JFile::delete($tpl_path . DS . 'css' . DS . $file['css'] . '.css');
         }
         // generate new Template CSS files
         try {
             // normal Template code
             lessc::ccompile($files['main']['less'], $tpl_path . DS . 'css' . DS . $files['main']['css'] . '.css');
             lessc::ccompile($files['small.desktop']['less'], $tpl_path . DS . 'css' . DS . $files['small.desktop']['css'] . '.css');
             lessc::ccompile($files['tablet']['less'], $tpl_path . DS . 'css' . DS . $files['tablet']['css'] . '.css');
             lessc::ccompile($files['small.tablet']['less'], $tpl_path . DS . 'css' . DS . $files['small.tablet']['css'] . '.css');
             lessc::ccompile($files['mobile']['less'], $tpl_path . DS . 'css' . DS . $files['mobile']['css'] . '.css');
             lessc::ccompile($files['print']['less'], $tpl_path . DS . 'css' . DS . $files['print']['css'] . '.css');
             lessc::ccompile($files['mailto']['less'], $tpl_path . DS . 'css' . DS . $files['mailto']['css'] . '.css');
             // additional Template code
             lessc::ccompile($files['offline']['less'], $tpl_path . DS . 'css' . DS . $files['offline']['css'] . '.css');
             lessc::ccompile($files['override']['less'], $tpl_path . DS . 'css' . DS . $files['override']['css'] . '.css');
             return true;
         } catch (exception $ex) {
             exit('LESS Parser fatal error:<br />' . $ex->getMessage());
         }
     }
 }
コード例 #8
0
 function __construct($parent)
 {
     if ($parent->API->get('recompile_bootstrap', 0) == 1) {
         // remove old Bootstrap CSS files
         jimport('joomla.filesystem.file');
         JFile::delete($parent->API->URLtemplatepath() . DS . 'bootstrap' . DS . 'output' . DS . 'bootstrap.css');
         JFile::delete($parent->API->URLtemplatepath() . DS . 'bootstrap' . DS . 'output' . DS . 'bootstrap-responsive.css');
         // generate new Bootstrap CSS files
         try {
             // normal Bootstrap code
             lessc::ccompile($parent->API->URLtemplatepath() . DS . 'bootstrap' . DS . 'less' . DS . 'bootstrap.less', $parent->API->URLtemplatepath() . DS . 'bootstrap' . DS . 'output' . DS . 'bootstrap.css');
             // responsive Bootstrap code
             lessc::ccompile($parent->API->URLtemplatepath() . DS . 'bootstrap' . DS . 'less' . DS . 'responsive.less', $parent->API->URLtemplatepath() . DS . 'bootstrap' . DS . 'output' . DS . 'bootstrap-responsive.css');
         } catch (exception $ex) {
             exit('LESS Parser fatal error:<br />' . $ex->getMessage());
         }
     }
 }
コード例 #9
0
ファイル: AppController.php プロジェクト: neggiel/tora
 public function beforeRender()
 {
     // Error layout 変更
     if ($this->name == 'CakeError') {
         $this->layout = 'messages';
     }
     // only compile it on development mode
     if (Configure::read('debug') > 0) {
         // import the file to application
         App::import('Vendor', 'lessc');
         // set the LESS file location
         $less = ROOT . DS . APP_DIR . DS . 'webroot' . DS . 'css' . DS . 'style.less';
         // set the CSS file to be written
         $css = ROOT . DS . APP_DIR . DS . 'webroot' . DS . 'css' . DS . 'style.css';
         // compile the file
         lessc::ccompile($less, $css);
     }
     parent::beforeRender();
 }
コード例 #10
0
<?php

require 'include/lessc.php';
try {
    lessc::ccompile('less/index.less', 'css/index.css');
} catch (exception $ex) {
    exit('lessc fatal error:' . $ex->getMessage());
}
require 'include/Config.php';
require 'include/MysqliRessource.php';
require 'include/ModelMysqli.php';
require 'include/ProjetMysqli.php';
$projetMysqli = new ProjetMysqli();
$projets = $projetMysqli->selectLast6();
?>
<!DOCTYPE html>
<html lang="fr">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Cifa3com</title>
		<meta name="description" content="">
		<link rel="stylesheet" href="css/normalize.min.css">
		<link rel="stylesheet" href="css/base.css">
		<link rel="stylesheet" href="css/index.css">
		<!--[if lt IE 9]>
			<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
			<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
		<![endif]-->
	</head>
	<body>
コード例 #11
0
<?php 

define('LESSPHP_LIB_PATH', 'sites/all/modules/contrib/less/lessphp');
define('LESSPHP_LIB_INCLUDE_FILE', 'lessc.inc.php');

$include = realpath(dirname(__FILE__) . '/../') . DIRECTORY_SEPARATOR . LESSPHP_LIB_PATH . DIRECTORY_SEPARATOR . LESSPHP_LIB_INCLUDE_FILE;
if( !file_exists($include) ) die('less library not found. ensure the module is installed and at the correct path: ' . $include);

$in = $argv[1];
$out = $argv[2];

if( file_exists($in) && file_exists(dirname($out)) ) {

	require $include;
	try {
		lessc::ccompile($argv[1], $argv[2]);
	} 
	catch (exception $ex) {
		die($ex->getMessage());
	}
}
else {
	die("\ncompilation failed. check input and output files\n");
}

echo "Complete\n";

?>
コード例 #12
0
function bootstrap_admin_phpless()
{
    require_once WP_PLUGIN_DIR . '/bootstrap-admin/includes/lessc.inc.php';
    lessc::ccompile(WP_PLUGIN_DIR . '/bootstrap-admin/assets/css/global.less', WP_PLUGIN_DIR . '/bootstrap-admin/assets/css/compiled-style.css');
}
コード例 #13
0
<?php

require 'include/lessc.php';
try {
    lessc::ccompile('less/video.less', 'css/video.css');
} catch (exception $ex) {
    exit('lessc fatal error:' . $ex->getMessage());
}
require 'include/Config.php';
require 'include/MysqliRessource.php';
require 'include/ModelMysqli.php';
require 'include/EtudiantMysqli.php';
require 'include/ProjetMysqli.php';
$etudiantMysqli = new EtudiantMysqli();
$projetMysqli = new ProjetMysqli();
if (isset($_GET['id']) && !empty($_GET['id']) && ctype_digit($_GET['id'])) {
    $id = (int) $_GET['id'];
    $projet = $projetMysqli->selectAllById($id);
    if ($projet['filiere'] == 1) {
        $projets = $projetMysqli->selectLast3Mt();
    } else {
        $projets = $projetMysqli->selectLast3Rea();
    }
} else {
    header('Location: index.php');
    exit;
}
$crochet = array("[", "]");
function daylimotion_id_by_url($url)
{
    $media_url = "";
コード例 #14
0
<?php

require 'include/lessc.php';
try {
    lessc::ccompile('less/equipe-pedagogique.less', 'css/equipe-pedagogique.css');
} catch (exception $ex) {
    exit('lessc fatal error:' . $ex->getMessage());
}
/*require 'include/Config.php';
require 'include/MysqliRessource.php';
require 'include/ModelMysqli.php';
require 'include/ProjetMysqli.php';
$projetMysqli = new ProjetMysqli();
$projets = $projetMysqli->selectLast6();*/
?>
<!DOCTYPE html>
<html lang="fr">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Equipe pédagogique - Cifa3com</title>
		<meta name="description" content="">
		<link rel="stylesheet" href="css/normalize.min.css">
		<link rel="stylesheet" href="css/base.css">
		<link rel="stylesheet" href="css/equipe-pedagogique.css">
		<!--[if lt IE 9]>
			<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
			<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
		<![endif]-->
	</head>
	<body>
コード例 #15
0
ファイル: less-processor.php プロジェクト: ssrsfs/blg
<?php

$file = isset($_REQUEST['file']) ? $_REQUEST['file'] : '';
if ($file && file_exists(TYPEF_DIR . $file) && is_file(TYPEF_DIR . $file)) {
    header('Content-type: text/css');
    $dir = dirname($file);
    $md5 = md5($file) . '.css';
    $dst = TYPEF_DIR . '/files/cache/lessphp/' . $md5;
    lessc::ccompile(TYPEF_DIR . $file, $dst);
    $css = SimpleCss::LoadFile($dst, TYPEF_WEB_DIR . $dir);
    $code = $css->toString();
    preg_match_all('/url\\(\\"([\\w\\W\\s\\S]*?)"\\)/', $code, $matches);
    if (isset($matches[1])) {
        foreach ($matches[1] as $url) {
            $url = Typeframe_Attribute_Url::ConvertShortUrlToExpression($url);
            $url = Typeframe::Pagemill()->data()->parseVariables($url);
            $code = str_replace($matches[1], $url, $code);
        }
    }
    echo $code;
    exit;
} else {
    http_response_code(404);
    Typeframe::SetPageTemplate('/404.html');
    Typeframe::CurrentPage()->stop();
}
<?php

require 'include/lessc.php';
try {
    lessc::ccompile('less/index.less', 'css/index.css');
    lessc::ccompile('less/etudiants.less', 'css/etudiants.css');
} catch (exception $ex) {
    exit('lessc fatal error:' . $ex->getMessage());
}
require 'include/Config.php';
require 'include/MysqliRessource.php';
require 'include/ModelMysqli.php';
require 'include/EtudiantMysqli.php';
$etudiantMysqli = new EtudiantMysqli();
$etudiants = $etudiantMysqli->selectAllMt();
?>
<!DOCTYPE html>
<html lang="fr">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Etudiants en formation monteur truquiste - Cifa3com</title>
		<meta name="description" content="">
		<link rel="stylesheet" href="css/normalize.min.css">
		<link rel="stylesheet" href="css/base.css">
		<link rel="stylesheet" href="css/index.css">
		<link rel="stylesheet" href="css/etudiants.css">
		<style>
			.videos h2 {
				padding-top: 20px;
				text-align: center;
<?php

require 'include/lessc.php';
try {
    lessc::ccompile('less/realisateur.less', 'css/realisateur.css');
} catch (exception $ex) {
    exit('lessc fatal error:' . $ex->getMessage());
}
require 'include/Config.php';
require 'include/MysqliRessource.php';
require 'include/ModelMysqli.php';
require 'include/ProjetMysqli.php';
$projetMysqli = new ProjetMysqli();
$projets = $projetMysqli->selectLast3Rea();
?>
<!DOCTYPE html>
<html lang="fr">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Formation Réalisateur Audiovisuel - Cifa3com</title>
		<meta name="description" content="">
		<link rel="stylesheet" href="css/normalize.min.css">
		<link rel="stylesheet" href="css/base.css">
		<link rel="stylesheet" href="css/realisateur.css">
		<!--[if lt IE 9]>
			<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
			<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
		<![endif]-->
	</head>
	<body>
コード例 #18
0
    } else {
        if (isChromeFrame()) {
            $isChromeFrame = true;
        } else {
            if (isFirefox()) {
                $isFirefox = true;
            }
        }
    }
}
$ieVersion = ieVersion();
if ($isIe && !$isChromeFrame) {
    /* COMPILE LESS TO CSS IF LESS FILE HAS BEEN UPDATED */
    include '/includes/lessphp/lessc.inc.php';
    lessc::ccompile('/styles/x.less', '/styles/x.css');
    lessc::ccompile('/styles/googleChromeFrame.less', '/styles/googleChromeFrame.css');
}
?>
<!DOCTYPE html>

<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js ie6 lt-ie10 lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 lt-ie10 lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 lt-ie10 lt-ie9" lang="en"> <![endif]-->
<!--[if IE 9]>    <html class="no-js ie9 lt-ie10" lang="en"> <![endif]-->
<!--[if IE 10]>    <html class="no-js ie10" lang="en"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<head>
	<?php 
コード例 #19
0
 /**
  * Compiles a LESS syntax file and saves the compiled version
  */
 public function compile($lessFile, $compiledFile)
 {
     if (Configure::read('debug') > 0) {
         lessc::ccompile($lessFile, $compiledFile);
     }
 }
コード例 #20
0
ファイル: template.php プロジェクト: chaudhary4k4/modernstore
 protected function lessToCss($lessPath)
 {
     if (class_exists('lessc') == false) {
         require_once JMF_FRAMEWORK_PATH . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'less' . DIRECTORY_SEPARATOR . 'lessc.inc.php';
     }
     $developer_mode = $this->params->get('devmode', false) == '1' ? true : false;
     $filename = JFile::stripExt(JFile::getName($lessPath));
     $cssPath = JMF_TPL_PATH . DIRECTORY_SEPARATOR . 'css' . DIRECTORY_SEPARATOR . $filename . '.css';
     if (!JFile::exists($lessPath)) {
         $lessPath = JMF_TPL_PATH . DIRECTORY_SEPARATOR . 'less' . DIRECTORY_SEPARATOR . $filename . '.less';
     }
     if (JFile::exists($lessPath) && JFile::exists($cssPath)) {
         $lessTime = filemtime($lessPath);
         $cssTime = filemtime($cssPath);
         if ($lessTime <= $cssTime && $developer_mode == false) {
             return JMF_TPL_URL . '/css/' . $filename . '.css';
         }
     }
     if (JFile::exists($cssPath)) {
         JFile::delete($cssPath);
     }
     try {
         lessc::ccompile($lessPath, $cssPath);
     } catch (exception $e) {
         throw new Exception(JText::sprintf('PLG_SYSTEM_JMFRAMEWORK_LESS_ERROR', $e->getMessage()));
     }
     return JMF_TPL_URL . '/css/' . $filename . '.css';
 }
コード例 #21
0
 function lessCSS($file)
 {
     if ($this->getParam('less_php', 0)) {
         // check if LESS.js is enabled
         jimport('joomla.filesystem.file');
         if (JFile::exists($this->templatepath() . DS . 'less' . DS . str_replace('/', DS, $file) . '.less')) {
             // check if file duplicate written in LESS exists
             require_once 'lessc.inc.php';
             lessc::ccompile($this->templatepath() . DS . 'less' . DS . str_replace('/', DS, $file) . '.less', $this->templatepath() . DS . 'less' . DS . str_replace('/', DS, $file) . '.css');
             echo '<link rel="stylesheet" href="' . $this->templateurl() . '/less/' . $file . '.css" type="text/css" />' . "\n";
         } else {
             echo '<link rel="stylesheet" href="' . $this->templateurl() . '/css/' . $file . '.css" type="text/css" />' . "\n";
         }
     } else {
         echo '<link rel="stylesheet" href="' . $this->templateurl() . '/css/' . $file . '.css" type="text/css" />' . "\n";
     }
 }
コード例 #22
0
ファイル: view.html.php プロジェクト: TeamCodeStudio/fpmoz
 protected function compileLess()
 {
     $assets = JPATH_COMPONENT_ADMINISTRATOR . '/assets';
     @(include_once $assets . '/less/lessc.inc.php');
     if (defined('DEV') && DEV) {
         try {
             $css_file = $assets . '/styles/roksprocket.css';
             @unlink($css_file);
             lessc::ccompile($assets . '/less/global.less', $css_file);
         } catch (exception $e) {
             JError::raiseError('LESS Compiler', $e->getMessage());
         }
     }
     RokCommon_Header::addStyle(JURI::base(true) . '/components/com_roksprocket/assets/styles/roksprocket.css?nocache=2.1.12');
 }
コード例 #23
0
 /**
  *
  */
 protected function compileLess()
 {
     $document = JFactory::getDocument();
     $assets = JPATH_PLUGINS . DIRECTORY_SEPARATOR . 'editors' . DIRECTORY_SEPARATOR . 'rokpad' . DIRECTORY_SEPARATOR . 'assets';
     @(include_once $assets . '/less/mixins/lessc.inc.php');
     if (defined('DEV') && DEV) {
         try {
             $css_file = $assets . '/styles/rokpad.css';
             @unlink($css_file);
             lessc::ccompile($assets . '/less/global.less', $css_file);
         } catch (exception $e) {
             JError::raiseError('LESS Compiler', $e->getMessage());
         }
     }
     $document->addStyleSheet($this->_basepath . 'assets/styles/rokpad.css' . $this->_appendCacheToken());
 }
コード例 #24
0
	/**
	 * lessPhp
	 *
	 * @return void
	 */
	public function lessPhp( $files )
	{
		require_once (t3lib_extMgm::extPath( 't3_less' ) . 'Resources/Private/Lib/' . $this->configuration['other']['lessPhpScriptPath']);

		// create outputfolder if it does not exist
		if( !is_dir( $this->outputfolder ) )
		{
			t3lib_div::mkdir_deep( '', $this->outputfolder );
		}

		$less = t3lib_div::makeInstance( 'lessc' );
		$this->checkForAdditionalConfiguration( $less );


		// compile each less-file
		foreach( $files as $file )
		{
			//get only the name of less file
			$filename = array_pop( explode( '/', $file ) );

			$md5 = md5( $filename . md5_file( $file ) );

			$outputfile = $this->outputfolder . substr( $filename, 0, -5 ) . '_' . $md5 . '.css';

			if( $this->configuration['other']['forceMode'] )
			{
				unlink( $outputfile );
			}

			if( !file_exists( $outputfile ) )
			{
				if( $this->configuration['other']['compressed'] )
				{
					$less->setFormatter( "compressed" );
					lessc::ccompile( $file, $this->outputfolder . substr( $filename, 0, -5 ) . '_' . $md5 . '.css', $less );
				}
				else
				{
					lessc::ccompile( $file, $this->outputfolder . substr( $filename, 0, -5 ) . '_' . $md5 . '.css' );
				}
				t3lib_div::fixPermissions( $outputfile, FALSE );
			}
		}

		// unlink compiled files which have no equal source less-file
		if( $this->configuration['other']['unlinkCssFilesWithNoSourceFile'] == 1 )
		{
			$this->unlinkGeneratedFilesWithNoSourceFile( $files );
		}

		$files = t3lib_div::getFilesInDir( $this->outputfolder, "css" );
		//respect given sort order defined in TS
		usort( $files, array( $this, 'getSortOrderPhp' ) );

		foreach( $files as $cssFile )
		{
			$excludeFromPageRender = isset( $this->configuration['phpcompiler']['filesettings'][substr( $cssFile, 0, -37 )]['excludeFromPageRenderer'] ) ? $this->configuration['phpcompiler']['filesettings'][substr( $cssFile, 0, -37 )]['excludeFromPageRenderer'] : 0;
			if( !$excludeFromPageRender || $excludeFromPageRender == 0 )
			{
				// array with filesettings from TS
				$tsOptions = $this->configuration['phpcompiler']['filesettings'][substr( $cssFile, 0, -37 )];

				$GLOBALS['TSFE']->getPageRenderer()->addCssFile(
					$this->outputfolder . $cssFile, $rel = 'stylesheet', $media = isset( $tsOptions['media'] ) ? $tsOptions['media'] : 'all', $title = isset( $tsOptions['title'] ) ? $tsOptions['title'] : '', $compress = isset( $tsOptions['compress'] ) && $tsOptions['compress'] >= '0' ? (boolean) $tsOptions['compress'] : TRUE, $forceOnTop = isset( $tsOptions['forceOnTop'] ) && $tsOptions['forceOnTop'] >= '0' ? (boolean) $tsOptions['forceOnTop'] : FALSE, $allWrap = isset( $tsOptions['allWrap'] ) ? $tsOptions['allWrap'] : '', $excludeFromConcatenation = isset( $tsOptions['excludeFromConcatenation'] ) && $tsOptions['excludeFromConcatenation'] >= '0' ? (boolean) $tsOptions['excludeFromConcatenation'] : FALSE
				);
			}
		}
	}
コード例 #25
0
ファイル: AppController.php プロジェクト: veslo1/RentSquare
 public function beforeRender()
 {
     parent::beforeRender();
     if ($this->Auth->user()) {
         $this->set('user', $this->Auth->user());
         if (isset($curProp['timezone'])) {
             $use_timezone = $curProp['timezone'];
         } else {
             $timezone = $this->Auth->user('timezone');
         }
         $this->set('user_timezone', $timezone);
         //	Set the number of unread messages
         $this->loadModel('ConversationsUser');
         $this->set('unreadMsgs', $this->ConversationsUser->getUnreadCount($this->Auth->user('id')));
         // Set Maintenance Number
         $this->loadModel('MaintenanceTicket');
         $this->set('pendingMaint', $this->MaintenanceTicket->getUnreadMaintCount($this->Auth->user(), $this->propId, 'pending'));
         $this->set('openMaint', $this->MaintenanceTicket->getUnreadMaintCount($this->Auth->user(), $this->propId, 'open'));
         if ($this->Auth->user('type') == USER_TYPE_MANAGER) {
         } else {
             if ($this->Auth->user('type') == USER_TYPE_TENANT) {
                 $this->loadModel('User');
                 $user = $this->User->get($this->Auth->user('id'));
                 $this->loadModel('Property');
                 $prop = $this->Property->get($user['User']['property_id']);
                 $this->loadModel('Unit');
                 $this->Unit->contain();
                 $unit = $this->Unit->get($this->Auth->user('unit_id'), $this->Auth->user('id'));
                 $this->set('curUnit', $unit['Unit']);
                 if (isset($prop['Property'])) {
                     $this->set('curProp', $prop['Property']);
                     $this->set('propManager', $prop['Property']['manager_id']);
                 }
             }
         }
     }
     // only compile it on development mode
     if (Configure::read('debug') > 0) {
         // import the file to application
         App::import('Vendor', 'lessc');
         // set the LESS file location
         $less = ROOT . DS . APP_DIR . DS . 'webroot' . DS . 'less' . DS . 'main.less';
         $frontLess = ROOT . DS . APP_DIR . DS . 'webroot' . DS . 'less' . DS . 'front.less';
         $backLess = ROOT . DS . APP_DIR . DS . 'webroot' . DS . 'less' . DS . 'back.less';
         // set the CSS file to be written
         $css = ROOT . DS . APP_DIR . DS . 'webroot' . DS . 'css' . DS . 'main.css';
         $frontCss = ROOT . DS . APP_DIR . DS . 'webroot' . DS . 'css' . DS . 'front.css';
         $backCss = ROOT . DS . APP_DIR . DS . 'webroot' . DS . 'css' . DS . 'back.css';
         // compile the file
         lessc::ccompile($less, $css);
         lessc::ccompile($frontLess, $frontCss);
         lessc::ccompile($backLess, $backCss);
     }
     parent::beforeRender();
 }
コード例 #26
0
<?php

require 'include/lessc.php';
try {
    lessc::ccompile('less/monteur-truquiste.less', 'css/monteur-truquiste.css');
} catch (exception $ex) {
    exit('lessc fatal error:' . $ex->getMessage());
}
require 'include/Config.php';
require 'include/MysqliRessource.php';
require 'include/ModelMysqli.php';
require 'include/ProjetMysqli.php';
$projetMysqli = new ProjetMysqli();
$projets = $projetMysqli->selectLast3Mt();
?>
<!DOCTYPE html>
<html lang="fr">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Formation Monteur Truquiste - Cifa3com</title>
		<meta name="description" content="">
		<link rel="stylesheet" href="css/normalize.min.css">
		<link rel="stylesheet" href="css/base.css">
		<link rel="stylesheet" href="css/monteur-truquiste.css">
		<!--[if lt IE 9]>
			<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
			<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
		<![endif]-->
	</head>
	<body>
コード例 #27
0
ファイル: rokbox.php プロジェクト: densem-2013/exikom
 /**
  *
  */
 protected function compileLess()
 {
     global $app;
     $document = JFactory::getDocument();
     $assets = JPATH_SITE . $this->_basepath . 'assets';
     if (defined('ROKBOX_DEV') && ROKBOX_DEV || @file_exists($assets . '/less/lessc.inc.php')) {
         //define("DEV", true); // to recompile/unify JS
         @(include_once $assets . '/less/lessc.inc.php');
         try {
             $css_file = $assets . '/styles/rokbox.css';
             @unlink($css_file);
             lessc::ccompile($assets . '/less/global.less', $css_file);
         } catch (exception $e) {
             JError::raiseError('LESS Compiler', $e->getMessage());
         }
     }
     $document->addStyleSheet(JURI::root(true) . $this->_basepath . 'assets/styles/rokbox.css');
 }
コード例 #28
0
ファイル: carabiner.php プロジェクト: nsystem1/cloneReader
 /**
  * _less function.
  *
  * converts css file with less css
  *
  * @access private
  * @param string $input_file
  * @param string $output_file (default: '') if left blank this will be the same
  * as the input but with .css rather than .less
  * @return string the output file
  */
 private function _less($input_file, $output_file = '')
 {
     // set output file name and compile
     if ($output_file == '') {
         $output_file = str_replace('.less', '.css', $input_file);
     }
     // get base name for caching
     $path_parts = pathinfo($output_file);
     $output_file = $path_parts['basename'];
     $dir_name = $path_parts['dirname'];
     // error if file is not there
     if (!file_exists($this->style_path . $input_file)) {
         log_message('error', 'Carabiner: .less file does not exist at ' . $this->style_path . $input_file);
     }
     log_message('debug', 'Carabiner: less file saved to ' . $this->cache_path . $output_file);
     if (lessc::ccompile($this->style_path . $input_file, $this->cache_path . $output_file)) {
         log_message('debug', 'Carabiner: less file saved to ' . $this->cache_path . $output_file);
     }
     return $output_file;
 }
コード例 #29
0
$lang_path = 'conf/lang_' . $cur_lang . '.php';
$lang_en_path = 'conf/lang_en.php';
// default english lang strings (in case of missing items or language)
$lang = array();
require_once APP_PATH . $lang_en_path;
if (file_exists($lang_path)) {
    require_once APP_PATH . $lang_path;
}
// this ensures that dates will be localised also
// locale names must match PHP standards: see conf/locale_names.txt
$location = setlocale(LC_ALL, $cur_lang);
DEFINE('LOCATION', $location);
// used in TaskItem
define('MAX_ACTION', count(\tpp\lang('state_order')) - 2);
// set correct locale settings (timezone must be set first)
$timezone = ini('timezone');
// @ to avoid error NOTICE if timezone does not exist
if (@date_default_timezone_set($timezone) === false) {
    // this will return a suitable default if user has not set the timezone in his server
    $timezone = date_default_timezone_get();
    date_default_timezone_set($timezone);
}
DEFINE('TIMEZONE', $timezone);
// compile LESS css sheets
require_once APP_PATH . 'lib/lessc.inc.php';
log && msg('Compiling the lessCSS files');
try {
    \lessc::ccompile('css/style.less', 'css/style.css');
} catch (exception $ex) {
    exit('lessc fatal error:<br />' . $ex->getMessage());
}