Exemplo n.º 1
0
 /**
  * minifyJS
  * Sets the minified data for JavaScript
  */
 private function minifyJS()
 {
     if (preg_match('/BY USING THIS SOFTWARE YOU DECLARE TO ACCEPT THE CHEVERETO EULA/i', $this->data)) {
         $pre = '/* Chevereto @' . get_chevereto_version() . ' | Copyright (C) ' . date('Y') . ' Rodolfo Berríos A. All rights reserved | chevereto.com/license */' . "\n";
     } else {
         $pre = '';
     }
     $this->set_minified_data($pre . $this->get_minified_data($this->data));
 }
Exemplo n.º 2
0
/**
 * chevereto_die
 * This function is an alias of php die() but with html error display :1313:
 */
function chevereto_die($error_msg, $title = '', $explain = array())
{
    if (!is_array($error_msg) && check_value($error_msg)) {
        $error_msg = array($error_msg);
    }
    $what_happend = $explain[0];
    $solution = $explain[1];
    $doctitle = check_value($title) ? $title : 'Error';
    $doctitle .= ' - Chevereto ' . get_chevereto_version();
    require_once __CHV_PATH_CONTENT__ . 'system/error.php';
    // $error_msg are handled here
    die;
}
Exemplo n.º 3
0
function show_chevereto_header()
{
    $doctitle = check_value(get_doctitle()) ? get_doctitle() . ' - ' : '';
    $html = '<script type="text/javascript" src="' . __CHV_URL_SYSTEM_JS__ . conditional_minify('jquery.js') . '"></script>
<script type="text/javascript" src="' . __CHV_URL_SYSTEM_JS__ . conditional_minify('jquery.uploadify-3.1_chevereto.js') . '"></script>
<script type="text/javascript" src="' . __CHV_URL_SYSTEM_JS__ . conditional_minify('functions.js') . '"></script>
<script type="text/javascript" src="' . __CHV_URL_SYSTEM_JS__ . conditional_minify('chevereto.js') . '"></script>
<script type="text/javascript" src="' . __CHV_URL_THEME__ . conditional_minify('theme.js') . '"></script>

<link type="text/css" href="' . __CHV_URL_THEME__ . conditional_minify('style.css') . '" rel="stylesheet" />
<link type="text/css" href="' . __CHV_URL_THEME__ . conditional_minify('uploadify.css') . '" rel="stylesheet" />
<link type="image/x-icon" href="' . __CHV_URL_THEME__ . 'favicon.ico" rel="shortcut icon"  />

<meta name="generator" content="Chevereto ' . get_chevereto_version() . '" />

<meta name="description" content="' . chevereto_config('meta_description') . '" />
<meta name="keywords" content="' . chevereto_config('meta_keywords') . '" />

<title>' . $doctitle . chevereto_config('doctitle') . '</title>

<script type="text/javascript">
	var base_url = "' . __CHV_BASE_URL__ . '";
	var base_url_js = "' . __CHV_URL_SYSTEM_JS__ . '";
	var uploadify_swf = "' . absolute_to_relative(__CHV_PATH_SYSTEM_JS__) . 'uploadify.swf";
	var uploader_file = "' . __CHV_RELATIVE_ROOT__ . 'upload.php";
	var zeroclip_swf = "' . __CHV_URL_SYSTEM_JS__ . 'ZeroClipboard.swf";
	var session_id = "' . session_id() . '";
	var virtual_url_image = "' . __CHV_BASE_URL__ . __CHV_VIRTUALFOLDER_IMAGE__ . '/";
	var virtual_url_uploaded = "' . __CHV_BASE_URL__ . __CHV_VIRTUALFOLDER_UPLOADED__ . '/";
	var config = {
		doctitle : "' . chevereto_config('doctitle') . '",
		virtual_folder_image : "' . chevereto_config('virtual_folder_image') . '",
		virtual_folder_uploaded : "' . chevereto_config('virtual_folder_uploaded') . '",
		max_filesize : "' . chevereto_config('max_filesize') . '",
		min_resize_size : ' . chevereto_config('min_resize_size') . ',
		max_resize_size : ' . chevereto_config('max_resize_size') . ',
		multiupload : ' . (chevereto_config('multiupload') ? "true" : "false") . ',
		multiupload_limit : ' . chevereto_config('multiupload_limit') . ',
		error_reporting : ' . (chevereto_config('error_reporting') ? "true" : "false") . '
	}
	var ImagesUp = ' . json_encode(get_uploaded_images()) . ';
	var lang = ' . json_encode(get_chevereto_safe_lang()) . ';
</script>';
    if (check_value(chevereto_config('facebook_app_id'))) {
        $html .= "\n\n";
        $html .= '<meta property="fb:app_id" content="' . chevereto_config('facebook_app_id') . '" />' . "\n";
        $html .= '<script type="text/javascript">
	(function(d, s, id) {
		  var js, fjs = d.getElementsByTagName(s)[0];
		  if (d.getElementById(id)) return;
		  js = d.createElement(s); js.id = id;
		  js.src = "//connect.facebook.net/' . get_lang_locale() . '/all.js#xfbml=1&appId=' . chevereto_config('facebook_app_id') . '";
		  fjs.parentNode.insertBefore(js, fjs);
		}(document, "script", "facebook-jssdk"));' . "\n";
        $html .= '</script>' . "\n";
    }
    $ga = get_google_analytics();
    $html .= $ga ? "\n" . $ga . "\n" : '';
    $html .= "\n" . '<noscript><meta http-equiv="refresh" content="0;url=' . __CHV_BASE_URL__ . 'error-javascript" /></noscript>' . "\n";
    echo $html;
}