diff --git a/.gitignore b/.gitignore index 5c1561b7..652a7872 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,6 @@ node_modules #Exclude compiled scripts and styles from repository filemanager/js/* filemanager/css/* -resources/tmp/* \ No newline at end of file +resources/tmp/* +/nbproject/private/ +/nbproject/private \ No newline at end of file diff --git a/bower.json b/bower.json index 42f54447..cfa9bbc5 100644 --- a/bower.json +++ b/bower.json @@ -1,38 +1,33 @@ { - "name": "ResponsiveFilemanager", - "version": "9.9.0", - "homepage": "http://www.responsivefilemanager.com/", - "authors": [ - "tr1pp0 " - ], - "license": "Creative Commons Attribution - NonCommercial 3.0 Unported License", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "dependencies": { - "jquery": "1.9.1", - "jquery_lazyload": "git@github.com:tuupola/jquery_lazyload.git", - "jquery-scrollstop": "git@github.com:ssorallen/jquery-scrollstop.git", - "jQuery-contextMenu": "~1.6.6", - "bootbox.js": "git@github.com:makeusabrew/bootbox.git#3.3.0", - "jquery-touchswipe": "~1.6.8", - "dropzone": "~4.0.1", - "zeroclipboard": "2.1.6", - "bootstrap": "2.3.1", - "bootstrap-modal": "~2.2.5", - "bootstrap-lightbox": "git@github.com:jbutz/bootstrap-lightbox.git#0.6.0", - "jquery-ui": "1.10.4", - "jqueryui-touch-punch": "*", - "jPlayer": "git@github.com:happyworm/jPlayer.git#2.4.0", - "html5shiv": "3.6.2", - "viewerjs": "~0.5.5" - }, - "resolutions": { - "jquery": "1.9.1", - "bootstrap": "2.3.1" - } + "name": "ResponsiveFilemanager", + "version": "9.9.7", + "homepage": "http://www.responsivefilemanager.com/", + "authors": [ + "tr1pp0 " + ], + "license": "Creative Commons Attribution - NonCommercial 3.0 Unported License", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ], + "dependencies": { + "jquery": "1.9.1", + "jquery_lazyload": "git@github.com:tuupola/jquery_lazyload.git", + "jquery-scrollstop": "git@github.com:ssorallen/jquery-scrollstop.git", + "jQuery-contextMenu": "~1.7.0", + "jquery-touchswipe": "~1.6.8", + "dropzone": "~4.0.1", + "zeroclipboard": "2.1.6", + "jquery-ui": "1.10.4", + "jqueryui-touch-punch": "*", + "jPlayer": "git@github.com:happyworm/jPlayer.git#2.4.0", + "html5shiv": "3.6.2", + "viewerjs": "~0.5.5" + }, + "resolutions": { + "jquery": "1.9.1" + } } diff --git a/filemanager/ajax_calls.php b/filemanager/ajax_calls.php old mode 100755 new mode 100644 index 9f3fe755..a12d4203 --- a/filemanager/ajax_calls.php +++ b/filemanager/ajax_calls.php @@ -1,575 +1,479 @@ send(); - exit; +if ($_SESSION['RF']["verify"] != "RESPONSIVEfilemanager") { + response('forbiden', 403)->send(); + exit; } -if (isset($_SESSION['RF']['language_file']) && file_exists($_SESSION['RF']['language_file'])) -{ - include $_SESSION['RF']['language_file']; -} -else -{ - response('Language file is missing!', 500)->send(); - exit; +if (isset($_SESSION['RF']['language_file']) && file_exists($_SESSION['RF']['language_file'])) { + include $_SESSION['RF']['language_file']; +} else { + response('Language file is missing!', 500)->send(); + exit; } -if(isset($_GET['action'])) -{ - switch($_GET['action']) - { - case 'view': - if(isset($_GET['type'])) - { - $_SESSION['RF']["view_type"] = $_GET['type']; - } - else - { - response('view type number missing', 400)->send(); - exit; - } - break; - case 'filter': - if (isset($_GET['type'])) - { - if (isset($remember_text_filter) && $remember_text_filter) - { - $_SESSION['RF']["filter"] = $_GET['type']; - } - } - else { - response('view type number missing', 400); - exit; - } - break; - case 'sort': - if (isset($_GET['sort_by'])) - { - $_SESSION['RF']["sort_by"] = $_GET['sort_by']; - } - - if (isset($_GET['descending'])) - { - $_SESSION['RF']["descending"] = $_GET['descending'] === "TRUE"; - } - break; - case 'image_size': // not used - $pos = strpos($_POST['path'], $upload_dir); - if ($pos !== false) - { - $info = getimagesize(substr_replace($_POST['path'], $current_path, $pos, strlen($upload_dir))); - response($info)->send(); - exit; - } - break; - case 'save_img': - $info = pathinfo($_POST['name']); - - if ( - strpos($_POST['path'], '/') === 0 - || strpos($_POST['path'], '../') !== false - || strpos($_POST['path'], './') === 0 - || (strpos($_POST['url'], 'http://s3.amazonaws.com/feather') !== 0 - && strpos($_POST['url'], 'https://s3.amazonaws.com/feather') !== 0) - || $_POST['name'] != fix_filename($_POST['name'], $transliteration, $convert_spaces, $replace_with) - || ! in_array(strtolower($info['extension']), array( 'jpg', 'jpeg', 'png' )) - ) - { - response('wrong data', 400)->send(); - exit; - } - $image_data = file_get_contents($_POST['url']); - if ($image_data === false) - { - response(trans('Aviary_No_Save'), 400)->send(); - exit; - } - require_once('include/php_image_magician.php'); - $magicianObj = new imageLib($_POST['url']); - $magicianObj->saveImage($current_path . $_POST['path'] . $_POST['name']); - create_img($current_path . $_POST['path'] . $_POST['name'], $thumbs_base_path.$_POST['path'].$_POST['name'], 122, 91); - // TODO something with this function cause its blowing my mind - new_thumbnails_creation( - $current_path.$_POST['path'], - $current_path.$_POST['path'].$_POST['name'], - $_POST['name'], - $current_path, - $relative_image_creation, - $relative_path_from_current_pos, - $relative_image_creation_name_to_prepend, - $relative_image_creation_name_to_append, - $relative_image_creation_width, - $relative_image_creation_height, - $relative_image_creation_option, - $fixed_image_creation, - $fixed_path_from_filemanager, - $fixed_image_creation_name_to_prepend, - $fixed_image_creation_to_append, - $fixed_image_creation_width, - $fixed_image_creation_height, - $fixed_image_creation_option - ); - break; - case 'extract': - if (strpos($_POST['path'], '/') === 0 || strpos($_POST['path'], '../') !== false || strpos($_POST['path'], './') === 0) - { - response('wrong path', 400)->send(); - exit; - } - - $path = $current_path . $_POST['path']; - $info = pathinfo($path); - $base_folder = $current_path . fix_dirname($_POST['path']) . "/"; - - switch ($info['extension']) - { - case "zip": - $zip = new ZipArchive; - if ($zip->open($path) === true) - { - //make all the folders - for ($i = 0; $i < $zip->numFiles; $i++) - { - $OnlyFileName = $zip->getNameIndex($i); - $FullFileName = $zip->statIndex($i); - if (substr($FullFileName['name'], -1, 1) == "/") - { - create_folder($base_folder . $FullFileName['name']); - } - } - //unzip into the folders - for ($i = 0; $i < $zip->numFiles; $i++) - { - $OnlyFileName = $zip->getNameIndex($i); - $FullFileName = $zip->statIndex($i); - - if ( ! (substr($FullFileName['name'], -1, 1) == "/")) - { - $fileinfo = pathinfo($OnlyFileName); - if (in_array(strtolower($fileinfo['extension']), $ext)) - { - copy('zip://' . $path . '#' . $OnlyFileName, $base_folder . $FullFileName['name']); - } - } - } - $zip->close(); - } - else - { - response(trans('Zip_No_Extract'), 500)->send(); - exit; - } - - break; - - case "gz": - $p = new PharData($path); - $p->decompress(); // creates files.tar - - break; - - case "tar": - // unarchive from the tar - $phar = new PharData($path); - $phar->decompressFiles(); - $files = array(); - check_files_extensions_on_phar($phar, $files, '', $ext); - $phar->extractTo($current_path . fix_dirname($_POST['path']) . "/", $files, true); - - break; - - default: - response(trans('Zip_Invalid'), 400)->send(); - exit; - } - break; - case 'media_preview': - $preview_file = $current_path . $_GET["file"]; - $info = pathinfo($preview_file); - ob_start(); - ?> - - - - - - - - - - send(); - exit; - - break; - case 'copy_cut': - if ($_POST['sub_action'] != 'copy' && $_POST['sub_action'] != 'cut') - { - response('wrong sub-action', 400)->send(); - exit; - } - - if (trim($_POST['path']) == '') - { - response('no path', 400)->send(); - exit; - } - - $path = $current_path . $_POST['path']; - - if (is_dir($path)) - { - // can't copy/cut dirs - if ($copy_cut_dirs === false) - { - response(sprintf(trans('Copy_Cut_Not_Allowed'), ($_POST['sub_action'] == 'copy' ? lcfirst(trans('Copy')) : lcfirst(trans('Cut'))), trans('Folders')), 403)->send(); - exit; - } - - // size over limit - if ($copy_cut_max_size !== false && is_int($copy_cut_max_size)) - { - if (($copy_cut_max_size * 1024 * 1024) < foldersize($path)) - { - response(sprintf(trans('Copy_Cut_Size_Limit'), ($_POST['sub_action'] == 'copy' ? lcfirst(trans('Copy')) : lcfirst(trans('Cut'))), $copy_cut_max_size), 400)->send(); - exit; - } - } - - // file count over limit - if ($copy_cut_max_count !== false && is_int($copy_cut_max_count)) - { - if ($copy_cut_max_count < filescount($path)) - { - response(sprintf(trans('Copy_Cut_Count_Limit'), ($_POST['sub_action'] == 'copy' ? lcfirst(trans('Copy')) : lcfirst(trans('Cut'))), $copy_cut_max_count), 400)->send(); - exit; - } - } - } - else - { - // can't copy/cut files - if ($copy_cut_files === false) - { - response(sprintf(trans('Copy_Cut_Not_Allowed'), ($_POST['sub_action'] == 'copy' ? lcfirst(trans('Copy')) : lcfirst(trans('Cut'))), trans('Files')), 403)->send(); - exit; - } - } - - $_SESSION['RF']['clipboard']['path'] = $_POST['path']; - $_SESSION['RF']['clipboard_action'] = $_POST['sub_action']; - break; - case 'clear_clipboard': - $_SESSION['RF']['clipboard'] = null; - $_SESSION['RF']['clipboard_action'] = null; - break; - case 'chmod': - $path = $current_path . $_POST['path']; - if ( - (is_dir($path) && $chmod_dirs === false) - || (is_file($path) && $chmod_files === false) - || (is_function_callable("chmod") === false) ) - { - response(sprintf(trans('File_Permission_Not_Allowed'), (is_dir($path) ? lcfirst(trans('Folders')) : lcfirst(trans('Files'))), 403), 400)->send(); - exit; - } - else - { - $perm = decoct(fileperms($path) & 0777); - $perm_user = substr($perm, 0, 1); - $perm_group = substr($perm, 1, 1); - $perm_all = substr($perm, 2, 1); - - $ret = '
+if (isset($_GET['action'])) { + switch ($_GET['action']) { + case 'view': + if (isset($_GET['type'])) { + $_SESSION['RF']["view_type"] = $_GET['type']; + } else { + response('view type number missing', 400)->send(); + exit; + } + break; + case 'filter': + if (isset($_GET['type'])) { + if (isset($remember_text_filter) && $remember_text_filter) { + $_SESSION['RF']["filter"] = $_GET['type']; + } + } else { + response('view type number missing', 400); + exit; + } + break; + case 'sort': + if (isset($_GET['sort_by'])) { + $_SESSION['RF']["sort_by"] = $_GET['sort_by']; + } + + if (isset($_GET['descending'])) { + $_SESSION['RF']["descending"] = $_GET['descending'] === "TRUE"; + } + break; + case 'image_size': // not used + $pos = strpos($_POST['path'], $upload_dir); + if ($pos !== false) { + $info = getimagesize(substr_replace($_POST['path'], $current_path, $pos, strlen($upload_dir))); + response($info)->send(); + exit; + } + break; + case 'save_img': + $info = pathinfo($_POST['name']); + if ( + strpos($_POST['path'], '/') === 0 || strpos($_POST['path'], '../') !== false || strpos($_POST['path'], './') === 0 || (strpos($_POST['url'], 'http://s3.amazonaws.com/feather') !== 0 && strpos($_POST['url'], 'https://s3.amazonaws.com/feather') !== 0) || $_POST['name'] != fix_filename($_POST['name'], $transliteration, $convert_spaces, $replace_with) || !in_array(strtolower($info['extension']), array('jpg', 'jpeg', 'png')) + ) { + response('wrong data', 400)->send(); + exit; + } + + $image_data = get_file_by_url($_POST['url']); + if ($image_data === false) { + response(trans('Aviary_No_Save'), 400)->send(); + exit; + } + + + file_put_contents($current_path . $_POST['path'] . $_POST['name'], $image_data); + create_img($current_path . $_POST['path'] . $_POST['name'], $thumbs_base_path . $_POST['path'] . $_POST['name'], 122, 91); + // TODO something with this function cause its blowing my mind + new_thumbnails_creation( + $current_path . $_POST['path'], $current_path . $_POST['path'] . $_POST['name'], $_POST['name'], $current_path, $relative_image_creation, $relative_path_from_current_pos, $relative_image_creation_name_to_prepend, $relative_image_creation_name_to_append, $relative_image_creation_width, $relative_image_creation_height, $relative_image_creation_option, $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height, $fixed_image_creation_option + ); + break; + case 'extract': + if (strpos($_POST['path'], '/') === 0 || strpos($_POST['path'], '../') !== false || strpos($_POST['path'], './') === 0) { + response('wrong path', 400)->send(); + exit; + } + + $path = $current_path . $_POST['path']; + $info = pathinfo($path); + $base_folder = $current_path . fix_dirname($_POST['path']) . "/"; + + switch ($info['extension']) { + case "zip": + $zip = new ZipArchive; + if ($zip->open($path) === true) { + //make all the folders + for ($i = 0; $i < $zip->numFiles; $i++) { + $OnlyFileName = $zip->getNameIndex($i); + $FullFileName = $zip->statIndex($i); + if (substr($FullFileName['name'], -1, 1) == "/") { + create_folder($base_folder . $FullFileName['name']); + } + } + //unzip into the folders + for ($i = 0; $i < $zip->numFiles; $i++) { + $OnlyFileName = $zip->getNameIndex($i); + $FullFileName = $zip->statIndex($i); + + if (!(substr($FullFileName['name'], -1, 1) == "/")) { + $fileinfo = pathinfo($OnlyFileName); + if (in_array(strtolower($fileinfo['extension']), $ext)) { + copy('zip://' . $path . '#' . $OnlyFileName, $base_folder . $FullFileName['name']); + } + } + } + $zip->close(); + } else { + response(trans('Zip_No_Extract'), 500)->send(); + exit; + } + + break; + + case "gz": + $p = new PharData($path); + $p->decompress(); // creates files.tar + + break; + + case "tar": + // unarchive from the tar + $phar = new PharData($path); + $phar->decompressFiles(); + $files = array(); + check_files_extensions_on_phar($phar, $files, '', $ext); + $phar->extractTo($current_path . fix_dirname($_POST['path']) . "/", $files, true); + + break; + + default: + response(trans('Zip_Invalid'), 400)->send(); + exit; + } + break; + case 'media_preview': + $preview_file = $current_path . $_GET["file"]; + $info = pathinfo($preview_file); + ob_start(); + ?> + + + + + + + + + + send(); + exit; + + break; + case 'copy_cut': + if ($_POST['sub_action'] != 'copy' && $_POST['sub_action'] != 'cut') { + response('wrong sub-action', 400)->send(); + exit; + } + + if (trim($_POST['path']) == '') { + response('no path', 400)->send(); + exit; + } + + $path = $current_path . $_POST['path']; + + if (is_dir($path)) { + // can't copy/cut dirs + if ($copy_cut_dirs === false) { + response(sprintf(trans('Copy_Cut_Not_Allowed'), ($_POST['sub_action'] == 'copy' ? lcfirst(trans('Copy')) : lcfirst(trans('Cut'))), trans('Folders')), 403)->send(); + exit; + } + + // size over limit + if ($copy_cut_max_size !== false && is_int($copy_cut_max_size)) { + list($sizeFolderToCopy, $fileNum, $foldersCount) = folder_info($path); + if (($copy_cut_max_size * 1024 * 1024) < $sizeFolderToCopy) { + response(sprintf(trans('Copy_Cut_Size_Limit'), ($_POST['sub_action'] == 'copy' ? lcfirst(trans('Copy')) : lcfirst(trans('Cut'))), $copy_cut_max_size), 400)->send(); + exit; + } + } + + // file count over limit + if ($copy_cut_max_count !== false && is_int($copy_cut_max_count)) { + if ($copy_cut_max_count < filescount($path)) { + response(sprintf(trans('Copy_Cut_Count_Limit'), ($_POST['sub_action'] == 'copy' ? lcfirst(trans('Copy')) : lcfirst(trans('Cut'))), $copy_cut_max_count), 400)->send(); + exit; + } + } + } else { + // can't copy/cut files + if ($copy_cut_files === false) { + response(sprintf(trans('Copy_Cut_Not_Allowed'), ($_POST['sub_action'] == 'copy' ? lcfirst(trans('Copy')) : lcfirst(trans('Cut'))), trans('Files')), 403)->send(); + exit; + } + } + + $_SESSION['RF']['clipboard']['path'] = $_POST['path']; + $_SESSION['RF']['clipboard_action'] = $_POST['sub_action']; + break; + case 'clear_clipboard': + $_SESSION['RF']['clipboard'] = null; + $_SESSION['RF']['clipboard_action'] = null; + break; + case 'chmod': + $path = $current_path . $_POST['path']; + if ( + (is_dir($path) && $chmod_dirs === false) || (is_file($path) && $chmod_files === false) || (is_function_callable("chmod") === false)) { + response(sprintf(trans('File_Permission_Not_Allowed'), (is_dir($path) ? lcfirst(trans('Folders')) : lcfirst(trans('Files'))), 403), 400)->send(); + exit; + } else { + $perm = decoct(fileperms($path) & 0777); + $perm_user = substr($perm, 0, 1); + $perm_group = substr($perm, 1, 1); + $perm_all = substr($perm, 2, 1); + + $ret = '
- +
- - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - +
r  w  x  rwx
'.trans('User').' ' . trans('User') . '
'.trans('Group').' ' . trans('Group') . '
'.trans('All').' ' . trans('All') . '
'; - if (is_dir($path)) - { - $ret .= '
'.trans('File_Permission_Recursive').'

+ if (is_dir($path)) { + $ret .= '
' . trans('File_Permission_Recursive') . '

    -
  • -
  • -
  • -
  • +
  • +
  • +
  • +
'; - } - - $ret .= '
'; - - response($ret)->send(); - exit; - } - break; - case 'get_lang': - if ( ! file_exists('lang/languages.php')) - { - response(trans('Lang_Not_Found'), 404)->send(); - exit; - } - - $languages = include 'lang/languages.php'; - if ( ! isset($languages) || ! is_array($languages)) - { - response(trans('Lang_Not_Found'), 404)->send(); - exit; - } - - $curr = $_SESSION['RF']['language']; - - $ret = ''; - - response($ret)->send(); - exit; - - break; - case 'change_lang': - $choosen_lang = $_POST['choosen_lang']; - - if ( ! file_exists('lang/' . $choosen_lang . '.php')) - { - response(trans('Lang_Not_Found'), 404)->send(); - exit; - } - - $_SESSION['RF']['language'] = $choosen_lang; - $_SESSION['RF']['language_file'] = 'lang/' . $choosen_lang . '.php'; - - break; - case 'get_file': // preview or edit - $sub_action = $_GET['sub_action']; - $preview_mode = $_GET["preview_mode"]; - - if ($sub_action != 'preview' && $sub_action != 'edit') - { - response("wrong action")->send(); - exit; - } - - $selected_file = ($sub_action == 'preview' ? $current_path . $_GET['file'] : $current_path . $_POST['path']); - $info = pathinfo($selected_file); - - if ( ! file_exists($selected_file)) - { - response(trans('File_Not_Found'), 404)->send(); - exit; - } - - if ($preview_mode == 'text') - { - $is_allowed = ($sub_action == 'preview' ? $preview_text_files : $edit_text_files); - $allowed_file_exts = ($sub_action == 'preview' ? $previewable_text_file_exts : $editable_text_file_exts); - } - elseif ($preview_mode == 'viewerjs') - { - $is_allowed = $viewerjs_enabled; - $allowed_file_exts = $viewerjs_file_exts; - } - elseif ($preview_mode == 'google') - { - $is_allowed = $googledoc_enabled; - $allowed_file_exts = $googledoc_file_exts; - } - - if ( ! isset($allowed_file_exts) || ! is_array($allowed_file_exts)) - { - $allowed_file_exts = array(); - } - - if ( ! in_array($info['extension'], $allowed_file_exts) - || ! isset($is_allowed) - || $is_allowed === false - || ! is_readable($selected_file) - ) - { - response(sprintf(trans('File_Open_Edit_Not_Allowed'), ($sub_action == 'preview' ? strtolower(trans('Open')) : strtolower(trans('Edit')))), 403)->send(); - exit; - } - - if ($sub_action == 'preview') - { - if ($preview_mode == 'text') - { - // get and sanities - $data = stripslashes(htmlspecialchars(file_get_contents($selected_file))); - - $ret = ''; - - if ( ! in_array($info['extension'],$previewable_text_file_exts_no_prettify)) - { - $ret .= ''; - $ret .= '
'.$info['basename'].'
'.$data.'
'; - } - else - { - $ret .= '
'.$info['basename'].'
'.$data.'
'; - } - - } - elseif ($preview_mode == 'viewerjs') - { - $ret = ''; - - } - elseif ($preview_mode == 'google') - { - $url_file = $base_url . $upload_dir . str_replace($current_path, '', $_GET["file"]); - $googledoc_url = urlencode($url_file); - $googledoc_html = ""; - $ret = '
' . $info['basename'] . '
' . $googledoc_html . ''; - } - } - else - { - $data = stripslashes(htmlspecialchars(file_get_contents($selected_file))); - $ret = ''; - } - - response($ret)->send(); - exit; - - break; - default: response('no action passed', 400)->send(); - exit; + } + + $ret .= '
'; + + response($ret)->send(); + exit; + } + break; + case 'get_lang': + if (!file_exists('lang/languages.php')) { + response(trans('Lang_Not_Found'), 404)->send(); + exit; + } + + $languages = include 'lang/languages.php'; + if (!isset($languages) || !is_array($languages)) { + response(trans('Lang_Not_Found'), 404)->send(); + exit; + } + + $curr = $_SESSION['RF']['language']; + + $ret = ''; + + response($ret)->send(); + exit; + + break; + case 'change_lang': + $choosen_lang = $_POST['choosen_lang']; + + if (!file_exists('lang/' . $choosen_lang . '.php')) { + response(trans('Lang_Not_Found'), 404)->send(); + exit; + } + + $_SESSION['RF']['language'] = $choosen_lang; + $_SESSION['RF']['language_file'] = 'lang/' . $choosen_lang . '.php'; + + break; + case 'get_file': // preview or edit + $sub_action = $_GET['sub_action']; + $preview_mode = $_GET["preview_mode"]; + + if ($sub_action != 'preview' && $sub_action != 'edit') { + response("wrong action")->send(); + exit; + } + + $selected_file = ($sub_action == 'preview' ? $current_path . $_GET['file'] : $current_path . $_POST['path']); + $info = pathinfo($selected_file); + + if (!file_exists($selected_file)) { + response(trans('File_Not_Found'), 404)->send(); + exit; + } + + if ($preview_mode == 'text') { + $is_allowed = ($sub_action == 'preview' ? $preview_text_files : $edit_text_files); + $allowed_file_exts = ($sub_action == 'preview' ? $previewable_text_file_exts : $editable_text_file_exts); + } elseif ($preview_mode == 'viewerjs') { + $is_allowed = $viewerjs_enabled; + $allowed_file_exts = $viewerjs_file_exts; + } elseif ($preview_mode == 'google') { + $is_allowed = $googledoc_enabled; + $allowed_file_exts = $googledoc_file_exts; + } + + if (!isset($allowed_file_exts) || !is_array($allowed_file_exts)) { + $allowed_file_exts = array(); + } + + if (!in_array($info['extension'], $allowed_file_exts) || !isset($is_allowed) || $is_allowed === false || !is_readable($selected_file) + ) { + response(sprintf(trans('File_Open_Edit_Not_Allowed'), ($sub_action == 'preview' ? strtolower(trans('Open')) : strtolower(trans('Edit')))), 403)->send(); + exit; + } + + if ($sub_action == 'preview') { + if ($preview_mode == 'text') { + // get and sanities + $data = stripslashes(htmlspecialchars(file_get_contents($selected_file))); + + $ret = ''; + + if (!in_array($info['extension'], $previewable_text_file_exts_no_prettify)) { + //$ret .= ''; + $ret .= ''; + $ret .= '
' . $info['basename'] . '
' . $data . '
'; + } else { + $ret .= '
' . $info['basename'] . '
' . $data . '
'; + } + } elseif ($preview_mode == 'viewerjs') { + $ret = ''; + } elseif ($preview_mode == 'google') { + $url_file = $base_url . $upload_dir . str_replace($current_path, '', $_GET["file"]); + $googledoc_url = urlencode($url_file); + $googledoc_html = ""; + $ret = '
' . $info['basename'] . '
' . $googledoc_html . ''; + } + } else { + $data = stripslashes(htmlspecialchars(file_get_contents($selected_file))); + $ret = ''; + } + + response($ret)->send(); + exit; + + break; + default: response('no action passed', 400)->send(); + exit; } -} -else -{ - response('no action passed', 400)->send(); - exit; +} else { + response('no action passed', 400)->send(); + exit; } diff --git a/filemanager/config/config.php b/filemanager/config/config.php old mode 100755 new mode 100644 index 1e8638cd..db7edca5 --- a/filemanager/config/config.php +++ b/filemanager/config/config.php @@ -1,363 +1,322 @@ -| in tinymce a new parameter added: filemanager_access_key:"myPrivateKey" -| example tinymce config: -| -| tiny init ... -| external_filemanager_path:"../filemanager/", -| filemanager_title:"Filemanager" , -| filemanager_access_key:"myPrivateKey" , -| ... -| -*/ + |-------------------------------------------------------------------------- + | Optional security + |-------------------------------------------------------------------------- + | + | if set to true only those will access RF whose url contains the access key(akey) like: + | + | in tinymce a new parameter added: filemanager_access_key:"myPrivateKey" + | example tinymce config: + | + | tiny init ... + | external_filemanager_path:"../filemanager/", + | filemanager_title:"Filemanager" , + | filemanager_access_key:"myPrivateKey" , + | ... + | + */ define('USE_ACCESS_KEYS', false); // TRUE or FALSE /* -|-------------------------------------------------------------------------- -| DON'T COPY THIS VARIABLES IN FOLDERS config.php FILES -|-------------------------------------------------------------------------- -*/ + |-------------------------------------------------------------------------- + | DON'T COPY THIS VARIABLES IN FOLDERS config.php FILES + |-------------------------------------------------------------------------- + */ /* -|-------------------------------------------------------------------------- -| Path configuration -|-------------------------------------------------------------------------- -| In this configuration the folder tree is -| root -| |- source <- upload folder -| |- thumbs <- thumbnail folder [must have write permission (755)] -| |- filemanager -| |- js -| | |- tinymce -| | | |- plugins -| | | | |- responsivefilemanager -| | | | | |- plugin.min.js -*/ + |-------------------------------------------------------------------------- + | Path configuration + |-------------------------------------------------------------------------- + | In this configuration the folder tree is + | root + | |- source <- upload folder + | |- thumbs <- thumbnail folder [must have write permission (755)] + | |- filemanager + | |- js + | | |- tinymce + | | | |- plugins + | | | | |- responsivefilemanager + | | | | | |- plugin.min.js + */ $config = array( - - /* - |-------------------------------------------------------------------------- - | DON'T TOUCH (base url (only domain) of site). - |-------------------------------------------------------------------------- - | - | without final / - | - */ - - 'base_url' => ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && ! in_array(strtolower($_SERVER['HTTPS']), array( 'off', 'no' ))) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'], - - /* - |-------------------------------------------------------------------------- - | path from base_url to base of upload folder - |-------------------------------------------------------------------------- - | - | with start and final / - | - */ - 'upload_dir' => '/source/', - - /* - |-------------------------------------------------------------------------- - | relative path from filemanager folder to upload folder - |-------------------------------------------------------------------------- - | - | with final / - | - */ - 'current_path' => '../source/', - - /* - |-------------------------------------------------------------------------- - | relative path from filemanager folder to thumbs folder - |-------------------------------------------------------------------------- - | - | with final / - | DO NOT put inside upload folder - | - */ - 'thumbs_base_path' => '../thumbs/', - - /* - |-------------------------------------------------------------------------- - | Access keys - |-------------------------------------------------------------------------- - | - | add access keys eg: array('myPrivateKey', 'someoneElseKey'); - | keys should only containt (a-z A-Z 0-9 \ . _ -) characters - | if you are integrating lets say to a cms for admins, i recommend making keys randomized something like this: - | $username = 'Admin'; - | $salt = 'dsflFWR9u2xQa' (a hard coded string) - | $akey = md5($username.$salt); - | DO NOT use 'key' as access key! - | Keys are CASE SENSITIVE! - | - */ - - 'access_keys' => array(), - - //-------------------------------------------------------------------------------------------------------- - // YOU CAN COPY AND CHANGE THESE VARIABLES INTO FOLDERS config.php FILES TO CUSTOMIZE EACH FOLDER OPTIONS - //-------------------------------------------------------------------------------------------------------- - - /* - |-------------------------------------------------------------------------- - | Maximum upload size - |-------------------------------------------------------------------------- - | - | in Megabytes - | - */ - 'MaxSizeUpload' => 100, - - - /* - |-------------------------------------------------------------------------- - | default language file name - |-------------------------------------------------------------------------- - */ - 'default_language' => "en_EN", - - /* - |-------------------------------------------------------------------------- - | Icon theme - |-------------------------------------------------------------------------- - | - | Default available: ico and ico_dark - | Can be set to custom icon inside filemanager/img - | - */ - 'icon_theme' => "ico", - - - //Show or not show folder size in list view feature in filemanager (is possible, if there is a large folder, to greatly increase the calculations) - 'show_folder_size' => true, - //Show or not show sorting feature in filemanager - 'show_sorting_bar' => true, - //active or deactive the transliteration (mean convert all strange characters in A..Za..z0..9 characters) - 'transliteration' => false, - //convert all spaces on files name and folders name with $replace_with variable - 'convert_spaces' => false, - //convert all spaces on files name and folders name this value - 'replace_with' => "_", - - // -1: There is no lazy loading at all, 0: Always lazy-load images, 0+: The minimum number of the files in a directory - // when lazy loading should be turned on. - 'lazy_loading_file_number_threshold' => 0, - - - //******************************************* - //Images limit and resizing configuration - //******************************************* - - // set maximum pixel width and/or maximum pixel height for all images - // If you set a maximum width or height, oversized images are converted to those limits. Images smaller than the limit(s) are unaffected - // if you don't need a limit set both to 0 - 'image_max_width' => 0, - 'image_max_height' => 0, - 'image_max_mode' => 'auto', - /* - # $option: 0 / exact = defined size; - # 1 / portrait = keep aspect set height; - # 2 / landscape = keep aspect set width; - # 3 / auto = auto; - # 4 / crop= resize and crop; - */ - - //Automatic resizing // - // If you set $image_resizing to TRUE the script converts all uploaded images exactly to image_resizing_width x image_resizing_height dimension - // If you set width or height to 0 the script automatically calculates the other dimension - // Is possible that if you upload very big images the script not work to overcome this increase the php configuration of memory and time limit - 'image_resizing' => false, - 'image_resizing_width' => 0, - 'image_resizing_height' => 0, - 'image_resizing_mode' => 'auto', // same as $image_max_mode - 'image_resizing_override' => false, - // If set to TRUE then you can specify bigger images than $image_max_width & height otherwise if image_resizing is - // bigger than $image_max_width or height then it will be converted to those values - - //****************** - // Default layout setting - // + /* + |-------------------------------------------------------------------------- + | DON'T TOUCH (base url (only domain) of site). + |-------------------------------------------------------------------------- + | + | without final / + | + */ + + 'base_url' => ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && !in_array(strtolower($_SERVER['HTTPS']), array('off', 'no'))) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'], + /* + |-------------------------------------------------------------------------- + | path from base_url to base of upload folder + |-------------------------------------------------------------------------- + | + | with start and final / + | + */ + 'upload_dir' => '/source/', + //'upload_dir' => '/filemanager/ResponsiveFilemanager/source/', + /* + |-------------------------------------------------------------------------- + | relative path from filemanager folder to upload folder + |-------------------------------------------------------------------------- + | + | with final / + | + */ + 'current_path' => '../source/', + /* + |-------------------------------------------------------------------------- + | relative path from filemanager folder to thumbs folder + |-------------------------------------------------------------------------- + | + | with final / + | DO NOT put inside upload folder + | + */ + 'thumbs_base_path' => '../thumbs/', + /* + |-------------------------------------------------------------------------- + | Access keys + |-------------------------------------------------------------------------- + | + | add access keys eg: array('myPrivateKey', 'someoneElseKey'); + | keys should only containt (a-z A-Z 0-9 \ . _ -) characters + | if you are integrating lets say to a cms for admins, i recommend making keys randomized something like this: + | $username = 'Admin'; + | $salt = 'dsflFWR9u2xQa' (a hard coded string) + | $akey = md5($username.$salt); + | DO NOT use 'key' as access key! + | Keys are CASE SENSITIVE! + | + */ + 'access_keys' => array(), + //-------------------------------------------------------------------------------------------------------- + // YOU CAN COPY AND CHANGE THESE VARIABLES INTO FOLDERS config.php FILES TO CUSTOMIZE EACH FOLDER OPTIONS + //-------------------------------------------------------------------------------------------------------- + + /* + |-------------------------------------------------------------------------- + | Maximum upload size + |-------------------------------------------------------------------------- + | + | in Megabytes + | + */ + 'MaxSizeUpload' => 100, + /* + |-------------------------------------------------------------------------- + | default language file name + |-------------------------------------------------------------------------- + */ + 'default_language' => "en_EN", + /* + |-------------------------------------------------------------------------- + | Icon theme + |-------------------------------------------------------------------------- + | + | Default available: ico and ico_dark + | Can be set to custom icon inside filemanager/img + | + */ + 'icon_theme' => "ico", + //Show or not show folder size in list view feature in filemanager (is possible, if there is a large folder, to greatly increase the calculations) + 'show_folder_size' => true, + //Show or not show sorting feature in filemanager + 'show_sorting_bar' => true, + //active or deactive the transliteration (mean convert all strange characters in A..Za..z0..9 characters) + 'transliteration' => false, + //convert all spaces on files name and folders name with $replace_with variable + 'convert_spaces' => false, + //convert all spaces on files name and folders name this value + 'replace_with' => "_", + // -1: There is no lazy loading at all, 0: Always lazy-load images, 0+: The minimum number of the files in a directory + // when lazy loading should be turned on. + 'lazy_loading_file_number_threshold' => 0, + //******************************************* + //Images limit and resizing configuration + //******************************************* + // set maximum pixel width and/or maximum pixel height for all images + // If you set a maximum width or height, oversized images are converted to those limits. Images smaller than the limit(s) are unaffected + // if you don't need a limit set both to 0 + 'image_max_width' => 0, + 'image_max_height' => 0, + 'image_max_mode' => 'auto', + /* + # $option: 0 / exact = defined size; + # 1 / portrait = keep aspect set height; + # 2 / landscape = keep aspect set width; + # 3 / auto = auto; + # 4 / crop= resize and crop; + */ + + //Automatic resizing // + // If you set $image_resizing to TRUE the script converts all uploaded images exactly to image_resizing_width x image_resizing_height dimension + // If you set width or height to 0 the script automatically calculates the other dimension + // Is possible that if you upload very big images the script not work to overcome this increase the php configuration of memory and time limit + 'image_resizing' => false, + 'image_resizing_width' => 0, + 'image_resizing_height' => 0, + 'image_resizing_mode' => 'auto', // same as $image_max_mode + 'image_resizing_override' => false, + // If set to TRUE then you can specify bigger images than $image_max_width & height otherwise if image_resizing is + // bigger than $image_max_width or height then it will be converted to those values + //****************** + // Default layout setting + // // 0 => boxes - // 1 => detailed list (1 column) - // 2 => columns list (multiple columns depending on the width of the page) - // YOU CAN ALSO PASS THIS PARAMETERS USING SESSION VAR => $_SESSION['RF']["VIEW"]= - // + // 1 => detailed list (1 column) + // 2 => columns list (multiple columns depending on the width of the page) + // YOU CAN ALSO PASS THIS PARAMETERS USING SESSION VAR => $_SESSION['RF']["VIEW"]= + // //****************** - 'default_view' => 0, - - //set if the filename is truncated when overflow first row - 'ellipsis_title_after_first_row' => true, - - //************************* - //Permissions configuration - //****************** - 'delete_files' => true, - 'create_folders' => true, - 'delete_folders' => true, - 'upload_files' => true, - 'rename_files' => true, - 'rename_folders' => true, - 'duplicate_files' => true, - 'copy_cut_files' => true, // for copy/cut files - 'copy_cut_dirs' => true, // for copy/cut directories - 'chmod_files' => false, // change file permissions - 'chmod_dirs' => false, // change folder permissions - 'preview_text_files' => true, // eg.: txt, log etc. - 'edit_text_files' => true, // eg.: txt, log etc. - 'create_text_files' => true, // only create files with exts. defined in $editable_text_file_exts - - // you can preview these type of files if $preview_text_files is true - 'previewable_text_file_exts' => array( 'txt', 'log', 'xml', 'html', 'css', 'htm', 'js' ), - 'previewable_text_file_exts_no_prettify' => array( 'txt', 'log' ), - - // you can edit these type of files if $edit_text_files is true (only text based files) - // you can create these type of files if $create_text_files is true (only text based files) - // if you want you can add html,css etc. - // but for security reasons it's NOT RECOMMENDED! - 'editable_text_file_exts' => array( 'txt', 'log', 'xml', 'html', 'css', 'htm', 'js' ), - - // Preview with Google Documents - 'googledoc_enabled' => true, - 'googledoc_file_exts' => array( 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx' ), - - // Preview with Viewer.js - 'viewerjs_enabled' => true, - 'viewerjs_file_exts' => array( 'pdf', 'odt', 'odp', 'ods' ), - - // defines size limit for paste in MB / operation - // set 'FALSE' for no limit - 'copy_cut_max_size' => 100, - // defines file count limit for paste / operation - // set 'FALSE' for no limit - 'copy_cut_max_count' => 200, - //IF any of these limits reached, operation won't start and generate warning - - //********************** - //Allowed extensions (lowercase insert) - //********************** - 'ext_img' => array( 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg' ), //Images - 'ext_file' => array( 'doc', 'docx', 'rtf', 'pdf', 'xls', 'xlsx', 'txt', 'csv', 'html', 'xhtml', 'psd', 'sql', 'log', 'fla', 'xml', 'ade', 'adp', 'mdb', 'accdb', 'ppt', 'pptx', 'odt', 'ots', 'ott', 'odb', 'odg', 'otp', 'otg', 'odf', 'ods', 'odp', 'css', 'ai' ), //Files - 'ext_video' => array( 'mov', 'mpeg', 'm4v', 'mp4', 'avi', 'mpg', 'wma', "flv", "webm" ), //Video - 'ext_music' => array( 'mp3', 'm4a', 'ac3', 'aiff', 'mid', 'ogg', 'wav' ), //Audio - 'ext_misc' => array( 'zip', 'rar', 'gz', 'tar', 'iso', 'dmg' ), //Archives - - /****************** - * AVIARY config - *******************/ - 'aviary_active' => true, - 'aviary_apiKey' => "2444282ef4344e3dacdedc7a78f8877d", - 'aviary_language' => "en", - 'aviary_theme' => "light", - 'aviary_tools' => "all", - 'aviary_maxSize' => "1400", - // Add or modify the Aviary options below as needed - they will be json encoded when added to the configuration so arrays can be utilized as needed - - //The filter and sorter are managed through both javascript and php scripts because if you have a lot of - //file in a folder the javascript script can't sort all or filter all, so the filemanager switch to php script. - //The plugin automatic swich javascript to php when the current folder exceeds the below limit of files number - 'file_number_limit_js' => 500, - - //********************** - // Hidden files and folders - //********************** - // set the names of any folders you want hidden (eg "hidden_folder1", "hidden_folder2" ) Remember all folders with these names will be hidden (you can set any exceptions in config.php files on folders) - 'hidden_folders' => array(), - // set the names of any files you want hidden. Remember these names will be hidden in all folders (eg "this_document.pdf", "that_image.jpg" ) - 'hidden_files' => array( 'config.php' ), - - /******************* - * JAVA upload - *******************/ - 'java_upload' => true, - 'JAVAMaxSizeUpload' => 200, //Gb - - - //************************************ - //Thumbnail for external use creation - //************************************ - - - // New image resized creation with fixed path from filemanager folder after uploading (thumbnails in fixed mode) - // If you want create images resized out of upload folder for use with external script you can choose this method, - // You can create also more than one image at a time just simply add a value in the array - // Remember than the image creation respect the folder hierarchy so if you are inside source/test/test1/ the new image will create at - // path_from_filemanager/test/test1/ - // PS if there isn't write permission in your destination folder you must set it - // - 'fixed_image_creation' => false, //activate or not the creation of one or more image resized with fixed path from filemanager folder - 'fixed_path_from_filemanager' => array( '../test/', '../test1/' ), //fixed path of the image folder from the current position on upload folder - 'fixed_image_creation_name_to_prepend' => array( '', 'test_' ), //name to prepend on filename - 'fixed_image_creation_to_append' => array( '_test', '' ), //name to appendon filename - 'fixed_image_creation_width' => array( 300, 400 ), //width of image (you can leave empty if you set height) - 'fixed_image_creation_height' => array( 200, '' ), //height of image (you can leave empty if you set width) - /* - # $option: 0 / exact = defined size; - # 1 / portrait = keep aspect set height; - # 2 / landscape = keep aspect set width; - # 3 / auto = auto; - # 4 / crop= resize and crop; - */ - 'fixed_image_creation_option' => array( 'crop', 'auto' ), //set the type of the crop - - - // New image resized creation with relative path inside to upload folder after uploading (thumbnails in relative mode) - // With Responsive filemanager you can create automatically resized image inside the upload folder, also more than one at a time - // just simply add a value in the array - // The image creation path is always relative so if i'm inside source/test/test1 and I upload an image, the path start from here - // - 'relative_image_creation' => false, //activate or not the creation of one or more image resized with relative path from upload folder - 'relative_path_from_current_pos' => array( './', './' ), //relative path of the image folder from the current position on upload folder - 'relative_image_creation_name_to_prepend' => array( '', '' ), //name to prepend on filename - 'relative_image_creation_name_to_append' => array( '_thumb', '_thumb1' ), //name to append on filename - 'relative_image_creation_width' => array( 300, 400 ), //width of image (you can leave empty if you set height) - 'relative_image_creation_height' => array( 200, '' ), //height of image (you can leave empty if you set width) - /* - # $option: 0 / exact = defined size; - # 1 / portrait = keep aspect set height; - # 2 / landscape = keep aspect set width; - # 3 / auto = auto; - # 4 / crop= resize and crop; - */ - 'relative_image_creation_option' => array( 'crop', 'crop' ), //set the type of the crop - - - // Remember text filter after close filemanager for future session - 'remember_text_filter' => false, - + 'default_view' => 0, + //set if the filename is truncated when overflow first row + 'ellipsis_title_after_first_row' => true, + //************************* + //Permissions configuration + //****************** + 'delete_files' => true, + 'create_folders' => true, + 'delete_folders' => true, + 'upload_files' => true, + 'rename_files' => true, + 'rename_folders' => true, + 'duplicate_files' => true, + 'copy_cut_files' => true, // for copy/cut files + 'copy_cut_dirs' => true, // for copy/cut directories + 'chmod_files' => true, // change file permissions + 'chmod_dirs' => true, // change folder permissions + 'preview_text_files' => true, // eg.: txt, log etc. + 'edit_text_files' => true, // eg.: txt, log etc. + 'create_text_files' => true, // only create files with exts. defined in $editable_text_file_exts + // you can preview these type of files if $preview_text_files is true + 'previewable_text_file_exts' => array('txt', 'log', 'xml', 'html', 'css', 'htm', 'js'), + 'previewable_text_file_exts_no_prettify' => array('txt', 'log'), + // you can edit these type of files if $edit_text_files is true (only text based files) + // you can create these type of files if $create_text_files is true (only text based files) + // if you want you can add html,css etc. + // but for security reasons it's NOT RECOMMENDED! + 'editable_text_file_exts' => array('txt', 'log', 'xml', 'html', 'css', 'htm', 'js'), + // Preview with Google Documents + 'googledoc_enabled' => true, + 'googledoc_file_exts' => array('doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'), + // Preview with Viewer.js + 'viewerjs_enabled' => true, + 'viewerjs_file_exts' => array('pdf', 'odt', 'odp', 'ods'), + // defines size limit for paste in MB / operation + // set 'FALSE' for no limit + 'copy_cut_max_size' => 100, + // defines file count limit for paste / operation + // set 'FALSE' for no limit + 'copy_cut_max_count' => 200, + //IF any of these limits reached, operation won't start and generate warning + //********************** + //Allowed extensions (lowercase insert) + //********************** + 'ext_img' => array('jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg'), //Images + 'ext_file' => array('doc', 'docx', 'rtf', 'pdf', 'xls', 'xlsx', 'txt', 'csv', 'html', 'xhtml', 'psd', 'sql', 'log', 'fla', 'xml', 'ade', 'adp', 'mdb', 'accdb', 'ppt', 'pptx', 'odt', 'ots', 'ott', 'odb', 'odg', 'otp', 'otg', 'odf', 'ods', 'odp', 'css', 'ai'), //Files + 'ext_video' => array('mov', 'mpeg', 'm4v', 'mp4', 'avi', 'mpg', 'wma', "flv", "webm"), //Video + 'ext_music' => array('mp3', 'm4a', 'ac3', 'aiff', 'mid', 'ogg', 'wav'), //Audio + 'ext_misc' => array('zip', 'rar', 'gz', 'tar', 'iso', 'dmg'), //Archives + + /* * **************** + * AVIARY config + * ***************** */ + 'aviary_active' => true, + 'aviary_apiKey' => "2444282ef4344e3dacdedc7a78f8877d", + 'aviary_language' => "en", + 'aviary_theme' => "light", + 'aviary_tools' => "all", + 'aviary_maxSize' => "1400", + // Add or modify the Aviary options below as needed - they will be json encoded when added to the configuration so arrays can be utilized as needed + //The filter and sorter are managed through both javascript and php scripts because if you have a lot of + //file in a folder the javascript script can't sort all or filter all, so the filemanager switch to php script. + //The plugin automatic swich javascript to php when the current folder exceeds the below limit of files number + 'file_number_limit_js' => 500, + //********************** + // Hidden files and folders + //********************** + // set the names of any folders you want hidden (eg "hidden_folder1", "hidden_folder2" ) Remember all folders with these names will be hidden (you can set any exceptions in config.php files on folders) + 'hidden_folders' => array(), + // set the names of any files you want hidden. Remember these names will be hidden in all folders (eg "this_document.pdf", "that_image.jpg" ) + 'hidden_files' => array('config.php'), + /* * ***************** + * JAVA upload + * ***************** */ + 'java_upload' => true, + 'JAVAMaxSizeUpload' => 200, //Gb + //************************************ + //Thumbnail for external use creation + //************************************ + // New image resized creation with fixed path from filemanager folder after uploading (thumbnails in fixed mode) + // If you want create images resized out of upload folder for use with external script you can choose this method, + // You can create also more than one image at a time just simply add a value in the array + // Remember than the image creation respect the folder hierarchy so if you are inside source/test/test1/ the new image will create at + // path_from_filemanager/test/test1/ + // PS if there isn't write permission in your destination folder you must set it + // + 'fixed_image_creation' => false, //activate or not the creation of one or more image resized with fixed path from filemanager folder + 'fixed_path_from_filemanager' => array('../test/', '../test1/'), //fixed path of the image folder from the current position on upload folder + 'fixed_image_creation_name_to_prepend' => array('', 'test_'), //name to prepend on filename + 'fixed_image_creation_to_append' => array('_test', ''), //name to appendon filename + 'fixed_image_creation_width' => array(300, 400), //width of image (you can leave empty if you set height) + 'fixed_image_creation_height' => array(200, ''), //height of image (you can leave empty if you set width) + /* + # $option: 0 / exact = defined size; + # 1 / portrait = keep aspect set height; + # 2 / landscape = keep aspect set width; + # 3 / auto = auto; + # 4 / crop= resize and crop; + */ + 'fixed_image_creation_option' => array('crop', 'auto'), //set the type of the crop + // New image resized creation with relative path inside to upload folder after uploading (thumbnails in relative mode) + // With Responsive filemanager you can create automatically resized image inside the upload folder, also more than one at a time + // just simply add a value in the array + // The image creation path is always relative so if i'm inside source/test/test1 and I upload an image, the path start from here + // + 'relative_image_creation' => false, //activate or not the creation of one or more image resized with relative path from upload folder + 'relative_path_from_current_pos' => array('./', './'), //relative path of the image folder from the current position on upload folder + 'relative_image_creation_name_to_prepend' => array('', ''), //name to prepend on filename + 'relative_image_creation_name_to_append' => array('_thumb', '_thumb1'), //name to append on filename + 'relative_image_creation_width' => array(300, 400), //width of image (you can leave empty if you set height) + 'relative_image_creation_height' => array(200, ''), //height of image (you can leave empty if you set width) + /* + # $option: 0 / exact = defined size; + # 1 / portrait = keep aspect set height; + # 2 / landscape = keep aspect set width; + # 3 / auto = auto; + # 4 / crop= resize and crop; + */ + 'relative_image_creation_option' => array('crop', 'crop'), //set the type of the crop + // Remember text filter after close filemanager for future session + 'remember_text_filter' => false, ); return array_merge( - $config, - array( - 'MaxSizeUpload' => ((int)(ini_get('post_max_size')) < $config['MaxSizeUpload']) - ? (int)(ini_get('post_max_size')) : $config['MaxSizeUpload'], - 'ext'=> array_merge( - $config['ext_img'], - $config['ext_file'], - $config['ext_misc'], - $config['ext_video'], - $config['ext_music'] - ), - // For a list of options see: https://developers.aviary.com/docs/web/setup-guide#constructor-config - 'aviary_defaults_config' => array( - 'apiKey' => $config['aviary_apiKey'], - 'language' => $config['aviary_language'], - 'theme' => $config['aviary_theme'], - 'tools' => $config['aviary_tools'], - 'maxSize' => $config['aviary_maxSize'] - ), - ) + $config, array( + 'MaxSizeUpload' => ((int) (ini_get('post_max_size')) < $config['MaxSizeUpload']) ? (int) (ini_get('post_max_size')) : $config['MaxSizeUpload'], + 'ext' => array_merge( + $config['ext_img'], $config['ext_file'], $config['ext_misc'], $config['ext_video'], $config['ext_music'] + ), + // For a list of options see: https://developers.aviary.com/docs/web/setup-guide#constructor-config + 'aviary_defaults_config' => array( + 'apiKey' => $config['aviary_apiKey'], + 'language' => $config['aviary_language'], + 'theme' => $config['aviary_theme'], + 'tools' => $config['aviary_tools'], + 'maxSize' => $config['aviary_maxSize'] + ), + ) ); diff --git a/filemanager/dialog.php b/filemanager/dialog.php old mode 100755 new mode 100644 index 52e12c6c..68513107 --- a/filemanager/dialog.php +++ b/filemanager/dialog.php @@ -3,993 +3,1204 @@ //TODO switch to array extract($config, EXTR_OVERWRITE); -if (USE_ACCESS_KEYS == TRUE){ - if (!isset($_GET['akey'], $access_keys) || empty($access_keys)){ - die('Access Denied!'); - } +if (USE_ACCESS_KEYS == TRUE) { + if (!isset($_GET['akey'], $access_keys) || empty($access_keys)) { + die('Access Denied!'); + } - $_GET['akey'] = strip_tags(preg_replace( "/[^a-zA-Z0-9\._-]/", '', $_GET['akey'])); + $_GET['akey'] = strip_tags(preg_replace("/[^a-zA-Z0-9\._-]/", '', $_GET['akey'])); - if (!in_array($_GET['akey'], $access_keys)){ - die('Access Denied!'); - } + if (!in_array($_GET['akey'], $access_keys)) { + die('Access Denied!'); + } } $_SESSION['RF']["verify"] = "RESPONSIVEfilemanager"; -if(isset($_POST['submit'])){ +if (isset($_POST['submit'])) { - include 'upload.php'; + include 'upload.php'; +} else { + include 'include/utils.php'; -} -else { -include 'include/utils.php'; - -if (isset($_GET['fldr']) - && !empty($_GET['fldr']) - && strpos($_GET['fldr'],'../') === FALSE - && strpos($_GET['fldr'],'./') === FALSE) -{ - $subdir = urldecode(trim(strip_tags($_GET['fldr']),"/") ."/"); - $_SESSION['RF']["filter"]=''; -} -else { $subdir = ''; } + if (isset($_GET['fldr']) && !empty($_GET['fldr']) && strpos($_GET['fldr'], '../') === FALSE && strpos($_GET['fldr'], './') === FALSE) { + $subdir = urldecode(trim(strip_tags($_GET['fldr']), "/") . "/"); + $_SESSION['RF']["filter"] = ''; + } else { + $subdir = ''; + } -if($subdir == "") -{ - if(!empty($_COOKIE['last_position']) - && strpos($_COOKIE['last_position'],'.') === FALSE) - $subdir= trim($_COOKIE['last_position']); -} + if ($subdir == "") { + if (!empty($_COOKIE['last_position']) && strpos($_COOKIE['last_position'], '.') === FALSE) + $subdir = trim($_COOKIE['last_position']); + } //remember last position -setcookie('last_position',$subdir,time() + (86400 * 7)); + setcookie('last_position', $subdir, time() + (86400 * 7)); -if ($subdir == "/") { $subdir = ""; } + if ($subdir == "/") { + $subdir = ""; + } // If hidden folders are specified -if(count($hidden_folders)){ - // If hidden folder appears in the path specified in URL parameter "fldr" - $dirs = explode('/', $subdir); - foreach($dirs as $dir){ - if($dir !== '' && in_array($dir, $hidden_folders)){ - // Ignore the path - $subdir = ""; - break; - } - } -} - -/*** - *SUB-DIR CODE - ***/ + if (count($hidden_folders)) { + // If hidden folder appears in the path specified in URL parameter "fldr" + $dirs = explode('/', $subdir); + foreach ($dirs as $dir) { + if ($dir !== '' && in_array($dir, $hidden_folders)) { + // Ignore the path + $subdir = ""; + break; + } + } + } -if (!isset($_SESSION['RF']["subfolder"])) -{ - $_SESSION['RF']["subfolder"] = ''; -} -$rfm_subfolder = ''; + /* * * + * SUB-DIR CODE + * * */ -if (!empty($_SESSION['RF']["subfolder"]) && strpos($_SESSION['RF']["subfolder"],'../') === FALSE - && strpos($_SESSION['RF']["subfolder"],'./') === FALSE && strpos($_SESSION['RF']["subfolder"],"/") !== 0 - && strpos($_SESSION['RF']["subfolder"],'.') === FALSE) -{ - $rfm_subfolder = $_SESSION['RF']['subfolder']; -} + if (!isset($_SESSION['RF']["subfolder"])) { + $_SESSION['RF']["subfolder"] = ''; + } + $rfm_subfolder = ''; -if ($rfm_subfolder != "" && $rfm_subfolder[strlen($rfm_subfolder)-1] != "/") { $rfm_subfolder .= "/"; } + if (!empty($_SESSION['RF']["subfolder"]) && strpos($_SESSION['RF']["subfolder"], '../') === FALSE && strpos($_SESSION['RF']["subfolder"], './') === FALSE && strpos($_SESSION['RF']["subfolder"], "/") !== 0 && strpos($_SESSION['RF']["subfolder"], '.') === FALSE) { + $rfm_subfolder = $_SESSION['RF']['subfolder']; + } -if (!file_exists($current_path.$rfm_subfolder.$subdir)) -{ - $subdir = ''; - if (!file_exists($current_path.$rfm_subfolder.$subdir)) - { - $rfm_subfolder = ""; + if ($rfm_subfolder != "" && $rfm_subfolder[strlen($rfm_subfolder) - 1] != "/") { + $rfm_subfolder .= "/"; } -} -if (trim($rfm_subfolder) == "") -{ - $cur_dir = $upload_dir . $subdir; - $cur_path = $current_path . $subdir; - $thumbs_path = $thumbs_base_path; - $parent = $subdir; -} -else -{ - $cur_dir = $upload_dir . $rfm_subfolder.$subdir; - $cur_path = $current_path . $rfm_subfolder.$subdir; - $thumbs_path = $thumbs_base_path. $rfm_subfolder; - $parent = $rfm_subfolder.$subdir; -} + if (!file_exists($current_path . $rfm_subfolder . $subdir)) { + $subdir = ''; + if (!file_exists($current_path . $rfm_subfolder . $subdir)) { + $rfm_subfolder = ""; + } + } -$cycle = TRUE; -$max_cycles = 50; -$i = 0; -while($cycle && $i < $max_cycles){ - $i++; - if ($parent=="./") $parent=""; - - if (file_exists($current_path.$parent."config.php")) - { - require_once $current_path.$parent."config.php"; - $cycle = FALSE; + if (trim($rfm_subfolder) == "") { + $cur_dir = $upload_dir . $subdir; + $cur_path = $current_path . $subdir; + $thumbs_path = $thumbs_base_path; + $parent = $subdir; + } else { + $cur_dir = $upload_dir . $rfm_subfolder . $subdir; + $cur_path = $current_path . $rfm_subfolder . $subdir; + $thumbs_path = $thumbs_base_path . $rfm_subfolder; + $parent = $rfm_subfolder . $subdir; } - if ($parent == "") $cycle = FALSE; - else $parent = fix_dirname($parent)."/"; -} + $cycle = TRUE; + $max_cycles = 50; + $i = 0; + while ($cycle && $i < $max_cycles) { + $i++; + if ($parent == "./") + $parent = ""; + + if (file_exists($current_path . $parent . "config.php")) { + require_once $current_path . $parent . "config.php"; + $cycle = FALSE; + } + + if ($parent == "") + $cycle = FALSE; + else + $parent = fix_dirname($parent) . "/"; + } -if (!is_dir($thumbs_path.$subdir)) -{ - create_folder(FALSE, $thumbs_path.$subdir); -} + if (!is_dir($thumbs_path . $subdir)) { + create_folder(FALSE, $thumbs_path . $subdir); + } -if (isset($_GET['popup'])) -{ - $popup = strip_tags($_GET['popup']); -} -else $popup=0; + if (isset($_GET['popup'])) { + $popup = strip_tags($_GET['popup']); + } else + $popup = 0; //Sanitize popup -$popup=!!$popup; + $popup = !!$popup; -if (isset($_GET['crossdomain'])) -{ - $crossdomain = strip_tags($_GET['crossdomain']); -} -else $crossdomain=0; + if (isset($_GET['crossdomain'])) { + $crossdomain = strip_tags($_GET['crossdomain']); + } else + $crossdomain = 0; //Sanitize crossdomain -$crossdomain=!!$crossdomain; + $crossdomain = !!$crossdomain; //view type -if(!isset($_SESSION['RF']["view_type"])) -{ - $view = $default_view; - $_SESSION['RF']["view_type"] = $view; -} + if (!isset($_SESSION['RF']["view_type"])) { + $view = $default_view; + $_SESSION['RF']["view_type"] = $view; + } -if (isset($_GET['view'])) -{ - $view = fix_get_params($_GET['view']); - $_SESSION['RF']["view_type"] = $view; -} + if (isset($_GET['view'])) { + $view = fix_get_params($_GET['view']); + $_SESSION['RF']["view_type"] = $view; + } -$view = $_SESSION['RF']["view_type"]; + $view = $_SESSION['RF']["view_type"]; //filter -$filter = ""; -if(isset($_SESSION['RF']["filter"])) -{ - $filter = $_SESSION['RF']["filter"]; -} - -if(isset($_GET["filter"])) -{ - $filter = fix_get_params($_GET["filter"]); -} - -if (!isset($_SESSION['RF']['sort_by'])) -{ - $_SESSION['RF']['sort_by'] = 'name'; -} - -if (isset($_GET["sort_by"])) -{ - $sort_by = $_SESSION['RF']['sort_by'] = fix_get_params($_GET["sort_by"]); -} -else $sort_by = $_SESSION['RF']['sort_by']; + $filter = ""; + if (isset($_SESSION['RF']["filter"])) { + $filter = $_SESSION['RF']["filter"]; + } + if (isset($_GET["filter"])) { + $filter = fix_get_params($_GET["filter"]); + } -if (!isset($_SESSION['RF']['descending'])) -{ - $_SESSION['RF']['descending'] = TRUE; -} + if (!isset($_SESSION['RF']['sort_by'])) { + $_SESSION['RF']['sort_by'] = 'name'; + } -if (isset($_GET["descending"])) -{ - $descending = $_SESSION['RF']['descending'] = fix_get_params($_GET["descending"])==1; -} -else{ - $descending = $_SESSION['RF']['descending']; -} + if (isset($_GET["sort_by"])) { + $sort_by = $_SESSION['RF']['sort_by'] = fix_get_params($_GET["sort_by"]); + } else + $sort_by = $_SESSION['RF']['sort_by']; -$boolarray = Array(false => 'false', true => 'true'); -$return_relative_url = isset($_GET['relative_url']) && $_GET['relative_url'] == "1" ? true : false; + if (!isset($_SESSION['RF']['descending'])) { + $_SESSION['RF']['descending'] = TRUE; + } -if (!isset($_GET['type'])) $_GET['type'] = 0; + if (isset($_GET["descending"])) { + $descending = $_SESSION['RF']['descending'] = fix_get_params($_GET["descending"]) == 1; + } else { + $descending = $_SESSION['RF']['descending']; + } -if (isset($_GET['editor'])) -{ - $editor = strip_tags($_GET['editor']); -} -else{ - if($_GET['type']==0){ - $editor=false; - }else{ - $editor='tinymce'; - } -} + $boolarray = Array(false => 'false', true => 'true'); -if (!isset($_GET['field_id'])) $_GET['field_id'] = ''; - -$field_id = isset($_GET['field_id']) ? fix_get_params($_GET['field_id']) : ''; -$type_param = fix_get_params($_GET['type']); - -if ($type_param==1) $apply = 'apply_img'; -elseif($type_param==2) $apply = 'apply_link'; -elseif($type_param==0 && $_GET['field_id']=='') $apply = 'apply_none'; -elseif($type_param==3) $apply = 'apply_video'; -else $apply = 'apply'; - -$get_params = array( - 'editor' => $editor, - 'type' => $type_param, - 'lang' => $lang, - 'popup' => $popup, - 'crossdomain' => $crossdomain, - 'field_id' => $field_id, - 'relative_url' => $return_relative_url, - 'akey' => (isset($_GET['akey']) && $_GET['akey'] != '' ? $_GET['akey'] : 'key') -); -if(isset($_GET['CKEditorFuncNum'])){ - $get_params['CKEditorFuncNum'] = $_GET['CKEditorFuncNum']; - $get_params['CKEditor'] = (isset($_GET['CKEditor'])? $_GET['CKEditor'] : ''); -} -$get_params['fldr'] =''; - -$get_params = http_build_query($get_params); - -?> - - - - - - - - Responsive FileManager - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " /> - " /> - " /> - - -
-
- -
-
-
- - -
-
- -
- - -
-

:


- - - - - - - - - - - -
-
- -
-
-
-
- -
-
-
- -
- - - -
+ $return_relative_url = isset($_GET['relative_url']) && $_GET['relative_url'] == "1" ? true : false; - $editor, + 'type' => $type_param, + 'lang' => $lang, + 'popup' => $popup, + 'crossdomain' => $crossdomain, + 'field_id' => $field_id, + 'relative_url' => $return_relative_url, + 'akey' => (isset($_GET['akey']) && $_GET['akey'] != '' ? $_GET['akey'] : 'key') + ); + if (isset($_GET['CKEditorFuncNum'])) { + $get_params['CKEditorFuncNum'] = $_GET['CKEditorFuncNum']; + $get_params['CKEditor'] = (isset($_GET['CKEditor']) ? $_GET['CKEditor'] : ''); + } + $get_params['fldr'] = ''; + + $get_params = http_build_query($get_params); + ?> + + + + + + + + Responsive FileManager + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + " /> + " /> + " /> + + + + +
+ + $file){ - if($file==".") $current_folder=array('file'=>$file); - elseif($file=="..") $prev_folder=array('file'=>$file); - elseif(is_dir($current_path.$rfm_subfolder.$subdir.$file)){ - $date=filemtime($current_path.$rfm_subfolder.$subdir. $file); - if($show_folder_size){ - list($size,$nfiles,$nfolders) = folder_info($current_path.$rfm_subfolder.$subdir. $file); - $current_folders_number++; - } else { - $size=0; - } - $file_ext=trans('Type_dir'); - $sorted[$k]=array( - 'file'=>$file, - 'file_lcase'=>strtolower($file), - 'date'=>$date, - 'size'=>$size, - 'nfiles'=>$nfiles, - 'nfolders'=>$nfolders, - 'extension'=>$file_ext, - 'extension_lcase'=>strtolower($file_ext)); - }else{ - $current_files_number++; - $file_path=$current_path.$rfm_subfolder.$subdir.$file; - $date=filemtime($file_path); - $size=filesize($file_path); - $file_ext = substr(strrchr($file,'.'),1); - $sorted[$k]=array('file'=>$file,'file_lcase'=>strtolower($file),'date'=>$date,'size'=>$size,'extension'=>$file_ext,'extension_lcase'=>strtolower($file_ext)); - } -} + $sorted = array(); + $current_folder = array(); + $prev_folder = array(); + $current_files_number = 0; + $current_folders_number = 0; + foreach ($files as $k => $file) { + if ($file == ".") + $current_folder = array('file' => $file); + elseif ($file == "..") + $prev_folder = array('file' => $file); + elseif (is_dir($current_path . $rfm_subfolder . $subdir . $file)) { + $date = filemtime($current_path . $rfm_subfolder . $subdir . $file); + if ($show_folder_size) { + list($size, $nfiles, $nfolders) = folder_info($current_path . $rfm_subfolder . $subdir . $file); + $current_folders_number++; + } else { + $size = 0; + } + $file_ext = trans('Type_dir'); + $sorted[$k] = array( + 'file' => $file, + 'file_lcase' => strtolower($file), + 'date' => $date, + 'size' => $size, + 'nfiles' => $nfiles, + 'nfolders' => $nfolders, + 'extension' => $file_ext, + 'extension_lcase' => strtolower($file_ext)); + } else { + $current_files_number++; + $file_path = $current_path . $rfm_subfolder . $subdir . $file; + $date = filemtime($file_path); + $size = filesize($file_path); + $file_ext = substr(strrchr($file, '.'), 1); + $sorted[$k] = array('file' => $file, 'file_lcase' => strtolower($file), 'date' => $date, 'size' => $size, 'extension' => $file_ext, 'extension_lcase' => strtolower($file_ext)); + } + } // Should lazy loading be enabled -$lazy_loading_enabled= ($lazy_loading_file_number_threshold == 0 || $lazy_loading_file_number_threshold != -1 && $n_files > $lazy_loading_file_number_threshold) ? true : false; - -function filenameSort($x, $y) { - return $x['file_lcase'] < $y['file_lcase']; -} -function dateSort($x, $y) { - return $x['date'] < $y['date']; -} -function sizeSort($x, $y) { - return $x['size'] < $y['size']; -} -function extensionSort($x, $y) { - return $x['extension_lcase'] < $y['extension_lcase']; -} - -switch($sort_by){ - case 'date': - usort($sorted, 'dateSort'); - break; - case 'size': - usort($sorted, 'sizeSort'); - break; - case 'extension': - usort($sorted, 'extensionSort'); - break; - default: - usort($sorted, 'filenameSort'); - break; -} - -if(!$descending){ - $sorted=array_reverse($sorted); -} - -$files=array_merge(array($prev_folder),array($current_folder),$sorted); -?> - - - - - - - -
- - -
- -
-
- -
-
There is an error! The upload folder there isn't. Check your config.php file.
- -

- -
- - - - - - - - -
    " id="main-item-container"> - $file_number_limit_js && $file!=".." && stripos($file,$filter)===false)) - continue; - $new_name=fix_filename($file,$transliteration); - if($file!='..' && $file!=$new_name){ - //rename - rename_folder($current_path.$subdir.$file,$new_name,$transliteration); - $file=$new_name; - } - //add in thumbs folder if not exist - if (!file_exists($thumbs_path.$subdir.$file)) create_folder(false,$thumbs_path.$subdir.$file); - $class_ext = 3; - if($file=='..' && trim($subdir) != '' ){ - $src = explode("/",$subdir); - unset($src[count($src)-2]); - $src=implode("/",$src); - if($src=='') $src="/"; - } - elseif ($file!='..') { - $src = $subdir . $file."/"; - } - - ?> - - $file_array) { - $file=$file_array['file']; - - if($file == '.' || $file == '..' || is_dir($current_path.$rfm_subfolder.$subdir.$file) || in_array($file, $hidden_files) || !in_array(fix_strtolower($file_array['extension']), $ext) || ($filter!='' && $n_files>$file_number_limit_js && stripos($file,$filter)===false)) - continue; - - $file_path=$current_path.$rfm_subfolder.$subdir.$file; - //check if file have illegal caracter - - $filename=substr($file, 0, '-' . (strlen($file_array['extension']) + 1)); - - if($file!=fix_filename($file,$transliteration)){ - $file1=fix_filename($file,$transliteration); - $file_path1=($current_path.$rfm_subfolder.$subdir.$file1); - if(file_exists($file_path1)){ - $i = 1; - $info=pathinfo($file1); - while(file_exists($current_path.$rfm_subfolder.$subdir.$info['filename'].".[".$i."].".$info['extension'])) { - $i++; - } - $file1=$info['filename'].".[".$i."].".$info['extension']; - $file_path1=($current_path.$rfm_subfolder.$subdir.$file1); - } - - $filename=substr($file1, 0, '-' . (strlen($file_array['extension']) + 1)); - rename_file($file_path,fix_filename($filename,$transliteration),$transliteration); - $file=$file1; - $file_array['extension']=fix_filename($file_array['extension'],$transliteration); - $file_path=$file_path1; - } - - $is_img=false; - $is_video=false; - $is_audio=false; - $show_original=false; - $show_original_mini=false; - $mini_src=""; - $src_thumb=""; - $extension_lower=fix_strtolower($file_array['extension']); - if(in_array($extension_lower, $ext_img)){ - $src = $base_url . $cur_dir . rawurlencode($file); - $mini_src = $src_thumb = $thumbs_path.$subdir. $file; - //add in thumbs folder if not exist - if(!file_exists($src_thumb)){ - try { - if(!create_img($file_path, $src_thumb, 122, 91)){ - $src_thumb=$mini_src=""; - }else{ - new_thumbnails_creation($current_path.$rfm_subfolder.$subdir,$file_path,$file,$current_path,'','','','','','','',$fixed_image_creation,$fixed_path_from_filemanager,$fixed_image_creation_name_to_prepend,$fixed_image_creation_to_append,$fixed_image_creation_width,$fixed_image_creation_height,$fixed_image_creation_option); - } - } catch (Exception $e) { - $src_thumb=$mini_src=""; - } - } - $is_img=true; - //check if is smaller than thumb - list($img_width, $img_height, $img_type, $attr)=@getimagesize($file_path); - if($img_width<122 && $img_height<91){ - $src_thumb=$current_path.$rfm_subfolder.$subdir.$file; - $show_original=true; - } - - if($img_width<45 && $img_height<38){ - $mini_src=$current_path.$rfm_subfolder.$subdir.$file; - $show_original_mini=true; - } - } - $is_icon_thumb=false; - $is_icon_thumb_mini=false; - $no_thumb=false; - if($src_thumb==""){ - $no_thumb=true; - if(file_exists('img/'.$icon_theme.'/'.$extension_lower.".jpg")){ - $src_thumb ='img/'.$icon_theme.'/'.$extension_lower.".jpg"; - }else{ - $src_thumb = "img/".$icon_theme."/default.jpg"; - } - $is_icon_thumb=true; - } - if($mini_src==""){ - $is_icon_thumb_mini=false; - } - - $class_ext=0; - if (in_array($extension_lower, $ext_video)) { - $class_ext = 4; - $is_video=true; - }elseif (in_array($extension_lower, $ext_img)) { - $class_ext = 2; - }elseif (in_array($extension_lower, $ext_music)) { - $class_ext = 5; - $is_audio=true; - }elseif (in_array($extension_lower, $ext_misc)) { - $class_ext = 3; - }else{ - $class_ext = 1; - } - if((!($_GET['type']==1 && !$is_img) && !(($_GET['type']==3 && !$is_video) && ($_GET['type']==3 && !$is_audio))) && $class_ext>0){ -?> - -
- - -
-
-
- - - - - - - - - - - - - - - - + $lazy_loading_enabled = ($lazy_loading_file_number_threshold == 0 || $lazy_loading_file_number_threshold != -1 && $n_files > $lazy_loading_file_number_threshold) ? true : false; + + function filenameSort($x, $y) { + return $x['file_lcase'] < $y['file_lcase']; + } + + function dateSort($x, $y) { + return $x['date'] < $y['date']; + } + + function sizeSort($x, $y) { + return $x['size'] < $y['size']; + } + + function extensionSort($x, $y) { + return $x['extension_lcase'] < $y['extension_lcase']; + } + + switch ($sort_by) { + case 'date': + usort($sorted, 'dateSort'); + break; + case 'size': + usort($sorted, 'sizeSort'); + break; + case 'extension': + usort($sorted, 'extensionSort'); + break; + default: + usort($sorted, 'filenameSort'); + break; + } + + if (!$descending) { + $sorted = array_reverse($sorted); + } + + $files = array_merge(array($prev_folder), array($current_folder), $sorted); + ?> + + + + + + + +
+
+ + + +
+
+ + +
+
+ +
+
There is an error! The upload folder there isn't. Check your config.php file.
+ +

+ +
+ + + + + + + + +
    " id="main-item-container"> + $file_number_limit_js && $file != ".." && stripos($file, $filter) === false)) + continue; + $new_name = fix_filename($file, $transliteration); + if ($file != '..' && $file != $new_name) { + //rename + rename_folder($current_path . $subdir . $file, $new_name, $transliteration); + $file = $new_name; + } + //add in thumbs folder if not exist + if (!file_exists($thumbs_path . $subdir . $file)) + create_folder(false, $thumbs_path . $subdir . $file); + $class_ext = 3; + if ($file == '..' && trim($subdir) != '') { + $src = explode("/", $subdir); + unset($src[count($src) - 2]); + $src = implode("/", $src); + if ($src == '') + $src = "/"; + } + elseif ($file != '..') { + $src = $subdir . $file . "/"; + } + ?> + + $file_array) { + $file = $file_array['file']; + + if ($file == '.' || $file == '..' || is_dir($current_path . $rfm_subfolder . $subdir . $file) || in_array($file, $hidden_files) || !in_array(fix_strtolower($file_array['extension']), $ext) || ($filter != '' && $n_files > $file_number_limit_js && stripos($file, $filter) === false)) + continue; + + $file_path = $current_path . $rfm_subfolder . $subdir . $file; + //check if file have illegal caracter + + $filename = substr($file, 0, '-' . (strlen($file_array['extension']) + 1)); + + if ($file != fix_filename($file, $transliteration)) { + $file1 = fix_filename($file, $transliteration); + $file_path1 = ($current_path . $rfm_subfolder . $subdir . $file1); + if (file_exists($file_path1)) { + $i = 1; + $info = pathinfo($file1); + while (file_exists($current_path . $rfm_subfolder . $subdir . $info['filename'] . ".[" . $i . "]." . $info['extension'])) { + $i++; + } + $file1 = $info['filename'] . ".[" . $i . "]." . $info['extension']; + $file_path1 = ($current_path . $rfm_subfolder . $subdir . $file1); + } + + $filename = substr($file1, 0, '-' . (strlen($file_array['extension']) + 1)); + rename_file($file_path, fix_filename($filename, $transliteration), $transliteration); + $file = $file1; + $file_array['extension'] = fix_filename($file_array['extension'], $transliteration); + $file_path = $file_path1; + } + + $is_img = false; + $is_video = false; + $is_audio = false; + $show_original = false; + $show_original_mini = false; + $mini_src = ""; + $src_thumb = ""; + $extension_lower = fix_strtolower($file_array['extension']); + if (in_array($extension_lower, $ext_img)) { + $src = $base_url . $cur_dir . rawurlencode($file); + $mini_src = $src_thumb = $thumbs_path . $subdir . $file; + //add in thumbs folder if not exist + if (!file_exists($src_thumb)) { + try { + if (!create_img($file_path, $src_thumb, 122, 91)) { + $src_thumb = $mini_src = ""; + } else { + new_thumbnails_creation($current_path . $rfm_subfolder . $subdir, $file_path, $file, $current_path, '', '', '', '', '', '', '', $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height, $fixed_image_creation_option); + } + } catch (Exception $e) { + $src_thumb = $mini_src = ""; + } + } + $is_img = true; + //check if is smaller than thumb + list($img_width, $img_height, $img_type, $attr) = @getimagesize($file_path); + if ($img_width < 122 && $img_height < 91) { + $src_thumb = $current_path . $rfm_subfolder . $subdir . $file; + $show_original = true; + } + + if ($img_width < 45 && $img_height < 38) { + $mini_src = $current_path . $rfm_subfolder . $subdir . $file; + $show_original_mini = true; + } + } + $is_icon_thumb = false; + $is_icon_thumb_mini = false; + $no_thumb = false; + if ($src_thumb == "") { + $no_thumb = true; + if (file_exists('img/' . $icon_theme . '/' . $extension_lower . ".jpg")) { + $src_thumb = 'img/' . $icon_theme . '/' . $extension_lower . ".jpg"; + } else { + $src_thumb = "img/" . $icon_theme . "/default.jpg"; + } + $is_icon_thumb = true; + } + if ($mini_src == "") { + $is_icon_thumb_mini = false; + } + + $class_ext = 0; + if (in_array($extension_lower, $ext_video)) { + $class_ext = 4; + $is_video = true; + } elseif (in_array($extension_lower, $ext_img)) { + $class_ext = 2; + } elseif (in_array($extension_lower, $ext_music)) { + $class_ext = 5; + $is_audio = true; + } elseif (in_array($extension_lower, $ext_misc)) { + $class_ext = 3; + } else { + $class_ext = 1; + } + if ((!($_GET['type'] == 1 && !$is_img) && !(($_GET['type'] == 3 && !$is_video) && ($_GET['type'] == 3 && !$is_audio))) && $class_ext > 0) { + ?> + +
+ + +
+
+ - - - - + +
+
+

+
+
+ +
+ +
+ +
    +
  • + +
  • + +
+
+
+ +
+ + +
+

:


+ + + + + + + + + + + +
+ +
+ +

+
+ + +
+
+
+
+ + +
+
+
+
+ + + + + + +
+
+ +
+
+ + + +
+
+
+
+
+
+ +
+
+ +
+
+
+ +
+ + + + + + + + + +
+
+
+
+
+

+
+
+
+
+
+
+ +
+
+ +
+
+
+ +
+ + + + + + + + + send(); - exit; +if ($_SESSION['RF']["verify"] != "RESPONSIVEfilemanager") { + response('forbiden', 403)->send(); + exit; } -if (strpos($_POST['path'],'/')===0 - || strpos($_POST['path'],'../')!==FALSE - || strpos($_POST['path'],'./')===0) -{ +if (strpos($_POST['path'], '/') === 0 || strpos($_POST['path'], '../') !== FALSE || strpos($_POST['path'], './') === 0) { response('wrong path')->send(); - exit; + exit; } -if (isset($_SESSION['RF']['language_file']) && file_exists($_SESSION['RF']['language_file'])) -{ - //TODO Very bad practice +if (isset($_SESSION['RF']['language_file']) && file_exists($_SESSION['RF']['language_file'])) { + //TODO Very bad practice require_once $_SESSION['RF']['language_file']; -} -else -{ +} else { response('Language file is missing!', 500)->send(); - exit; + exit; } $base = $current_path; -$path = $current_path.$_POST['path']; +$path = $base . $_POST['path']; $cycle = TRUE; $max_cycles = 50; $i = 0; -while($cycle && $i<$max_cycles) -{ +while ($cycle && $i < $max_cycles) { $i++; - if ($path == $base) $cycle=FALSE; + if ($path == $base) + $cycle = FALSE; - if (file_exists($path."config.php")) - { - require_once $path."config.php"; + if (file_exists($path . "config.php")) { + require_once $path . "config.php"; $cycle = FALSE; } - $path = fix_dirname($path)."/"; + $path = fix_dirname($path) . "/"; $cycle = FALSE; } -$path = $current_path.$_POST['path']; -$path_thumb = $thumbs_base_path.$_POST['path']; -if (isset($_POST['name'])) -{ - $name = fix_filename($_POST['name'],$transliteration,$convert_spaces, $replace_with); - if (strpos($name,'../') !== FALSE) - { - response('wrong name', 400)->send(); - exit; - } +$path = $current_path . $_POST['path']; +$path_thumb = $thumbs_base_path . $_POST['path']; +if (isset($_POST['name'])) { + $name = fix_filename($_POST['name'], $transliteration, $convert_spaces, $replace_with); + if (strpos($name, '../') !== FALSE) { + response('wrong name', 400)->send(); + exit; + } } $info = pathinfo($path); -if (isset($info['extension']) && !(isset($_GET['action']) && $_GET['action']=='delete_folder') && !in_array(strtolower($info['extension']), $ext) && $_GET['action'] != 'create_file') -{ - response('wrong extension', 400)->send(); - exit; +if (isset($info['extension']) && !(isset($_GET['action']) && $_GET['action'] == 'delete_folder') && !in_array(strtolower($info['extension']), $ext) && $_GET['action'] != 'create_file') { + response('wrong extension', 400)->send(); + exit; } -if (isset($_GET['action'])) -{ - switch($_GET['action']) - { +if (isset($_GET['action'])) { + switch ($_GET['action']) { case 'delete_file': - if ($delete_files){ + if ($delete_files) { unlink($path); - if (file_exists($path_thumb)) unlink($path_thumb); + if (file_exists($path_thumb)) + unlink($path_thumb); - $info=pathinfo($path); - if ($relative_image_creation){ - foreach($relative_path_from_current_pos as $k=>$path) - { - if ($path!="" && $path[strlen($path)-1]!="/") $path.="/"; + $info = pathinfo($path); + if ($relative_image_creation) { + foreach ($relative_path_from_current_pos as $k => $path) { + if ($path != "" && $path[strlen($path) - 1] != "/") + $path.="/"; - if (file_exists($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension'])) - { - unlink($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension']); + if (file_exists($info['dirname'] . "/" . $path . $relative_image_creation_name_to_prepend[$k] . $info['filename'] . $relative_image_creation_name_to_append[$k] . "." . $info['extension'])) { + unlink($info['dirname'] . "/" . $path . $relative_image_creation_name_to_prepend[$k] . $info['filename'] . $relative_image_creation_name_to_append[$k] . "." . $info['extension']); } } } - if ($fixed_image_creation) - { - foreach($fixed_path_from_filemanager as $k=>$path) - { - if ($path!="" && $path[strlen($path)-1] != "/") $path.="/"; + if ($fixed_image_creation) { + foreach ($fixed_path_from_filemanager as $k => $path) { + if ($path != "" && $path[strlen($path) - 1] != "/") + $path.="/"; - $base_dir=$path.substr_replace($info['dirname']."/", '', 0, strlen($current_path)); - if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'])) - { - unlink($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']); + $base_dir = $path . substr_replace($info['dirname'] . "/", '', 0, strlen($current_path)); + if (file_exists($base_dir . $fixed_image_creation_name_to_prepend[$k] . $info['filename'] . $fixed_image_creation_to_append[$k] . "." . $info['extension'])) { + unlink($base_dir . $fixed_image_creation_name_to_prepend[$k] . $info['filename'] . $fixed_image_creation_to_append[$k] . "." . $info['extension']); } } } } break; case 'delete_folder': - if ($delete_folders){ - if (is_dir($path_thumb)) - { + if ($delete_folders) { + if (is_dir($path_thumb)) { deleteDir($path_thumb); } - if (is_dir($path)) - { + if (is_dir($path)) { deleteDir($path); - if ($fixed_image_creation) - { - foreach($fixed_path_from_filemanager as $k=>$paths){ - if ($paths!="" && $paths[strlen($paths)-1] != "/") $paths.="/"; - - $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path)); - if (is_dir($base_dir)) deleteDir($base_dir); + if ($fixed_image_creation) { + foreach ($fixed_path_from_filemanager as $k => $paths) { + if ($paths != "" && $paths[strlen($paths) - 1] != "/") + $paths.="/"; + + $base_dir = $paths . substr_replace($path, '', 0, strlen($current_path)); + if (is_dir($base_dir)) + deleteDir($base_dir); } } } } break; case 'create_folder': - if ($create_folders) - { - create_folder(fix_path($path,$transliteration,$convert_spaces, $replace_with),fix_path($path_thumb,$transliteration,$convert_spaces, $replace_with)); + if ($create_folders) { + + $name = fix_filename($_POST['name'], $transliteration, $convert_spaces, $replace_with); + $path .= $name; + $path_thumb .= $name; + create_folder(fix_path($path, $transliteration, $convert_spaces, $replace_with), fix_path($path_thumb, $transliteration, $convert_spaces, $replace_with)); } break; + + case 'rename_folder': - if ($rename_folders){ - $name=fix_filename($name,$transliteration,$convert_spaces, $replace_with); - $name=str_replace('.','',$name); - - if (!empty($name)){ - if (!rename_folder($path,$name,$transliteration,$convert_spaces)) - { - response(trans('Rename_existing_folder'), 403)->send(); - exit; - } - - rename_folder($path_thumb,$name,$transliteration,$convert_spaces); - if ($fixed_image_creation){ - foreach($fixed_path_from_filemanager as $k=>$paths){ - if ($paths!="" && $paths[strlen($paths)-1] != "/") $paths.="/"; - - $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path)); - rename_folder($base_dir,$name,$transliteration,$convert_spaces); + if ($rename_folders) { + $name = fix_filename($name, $transliteration, $convert_spaces, $replace_with); + $name = str_replace('.', '', $name); + + if (!empty($name)) { + if (!rename_folder($path, $name, $transliteration, $convert_spaces)) { + response(trans('Rename_existing_folder'), 403)->send(); + exit; + } + + rename_folder($path_thumb, $name, $transliteration, $convert_spaces); + if ($fixed_image_creation) { + foreach ($fixed_path_from_filemanager as $k => $paths) { + if ($paths != "" && $paths[strlen($paths) - 1] != "/") + $paths.="/"; + + $base_dir = $paths . substr_replace($path, '', 0, strlen($current_path)); + rename_folder($base_dir, $name, $transliteration, $convert_spaces); } } } else { response(trans('Empty_name'), 400)->send(); - exit; + exit; } } break; case 'create_file': if ($create_text_files === FALSE) { response(sprintf(trans('File_Open_Edit_Not_Allowed'), strtolower(trans('Edit'))), 403)->send(); - exit; + exit; } - if (!isset($editable_text_file_exts) || !is_array($editable_text_file_exts)){ + if (!isset($editable_text_file_exts) || !is_array($editable_text_file_exts)) { $editable_text_file_exts = array(); } // check if user supplied extension - if (strpos($name, '.') === FALSE){ - response(trans('No_Extension').' '.sprintf(trans('Valid_Extensions'), implode(', ', $editable_text_file_exts)), 400)->send(); - exit; + if (strpos($name, '.') === FALSE) { + response(trans('No_Extension') . ' ' . sprintf(trans('Valid_Extensions'), implode(', ', $editable_text_file_exts)), 400)->send(); + exit; } // correct name $old_name = $name; - $name=fix_filename($name,$transliteration,$convert_spaces, $replace_with); - if (empty($name)) - { + $name = fix_filename($name, $transliteration, $convert_spaces, $replace_with); + if (empty($name)) { response(trans('Empty_name'), 400)->send(); - exit; + exit; } // check extension $parts = explode('.', $name); if (!in_array(end($parts), $editable_text_file_exts)) { - response(trans('Error_extension').' '.sprintf(trans('Valid_Extensions'), implode(', ', $editable_text_file_exts)), 400)->send(); - exit; + response(trans('Error_extension') . ' ' . sprintf(trans('Valid_Extensions'), implode(', ', $editable_text_file_exts)), 400)->send(); + exit; } // file already exists - if (file_exists($path.$name)) { + if (file_exists($path . $name)) { response(trans('Rename_existing_file'), 403)->send(); - exit; + exit; } $content = $_POST['new_content']; - if (@file_put_contents($path.$name, $content) === FALSE) { + if (@file_put_contents($path . $name, $content) === FALSE) { response(trans('File_Save_Error'), 500)->send(); - exit; - } - else { - if (is_function_callable('chmod') !== FALSE){ - chmod($path.$name, 0644); + exit; + } else { + if (is_function_callable('chmod') !== FALSE) { + chmod($path . $name, 0644); } response(trans('File_Save_OK'))->send(); - exit; + exit; } break; case 'rename_file': - if ($rename_files){ - $name=fix_filename($name,$transliteration,$convert_spaces, $replace_with); - if (!empty($name)) - { - if (!rename_file($path,$name,$transliteration)) - { - response(trans('Rename_existing_file'), 403)->send(); - exit; - } - - rename_file($path_thumb,$name,$transliteration); - - if ($fixed_image_creation) - { - $info=pathinfo($path); - - foreach($fixed_path_from_filemanager as $k=>$paths) - { - if ($paths!="" && $paths[strlen($paths)-1] != "/") $paths.="/"; - - $base_dir = $paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path)); - if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'])) - { - rename_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k],$transliteration); + if ($rename_files) { + $name = fix_filename($name, $transliteration, $convert_spaces, $replace_with); + if (!empty($name)) { + if (!rename_file($path, $name, $transliteration)) { + response(trans('Rename_existing_file'), 403)->send(); + exit; + } + + rename_file($path_thumb, $name, $transliteration); + + if ($fixed_image_creation) { + $info = pathinfo($path); + + foreach ($fixed_path_from_filemanager as $k => $paths) { + if ($paths != "" && $paths[strlen($paths) - 1] != "/") + $paths.="/"; + + $base_dir = $paths . substr_replace($info['dirname'] . "/", '', 0, strlen($current_path)); + if (file_exists($base_dir . $fixed_image_creation_name_to_prepend[$k] . $info['filename'] . $fixed_image_creation_to_append[$k] . "." . $info['extension'])) { + rename_file($base_dir . $fixed_image_creation_name_to_prepend[$k] . $info['filename'] . $fixed_image_creation_to_append[$k] . "." . $info['extension'], $fixed_image_creation_name_to_prepend[$k] . $name . $fixed_image_creation_to_append[$k], $transliteration); } } } - } - else { + } else { response(trans('Empty_name'), 400)->send(); - exit; + exit; } } break; case 'duplicate_file': - if ($duplicate_files) - { - $name=fix_filename($name,$transliteration,$convert_spaces, $replace_with); - if (!empty($name)) - { - if (!duplicate_file($path,$name)) - { - response(trans('Rename_existing_file'), 403)->send(); - exit; - } - - duplicate_file($path_thumb,$name); - - if ($fixed_image_creation) - { - $info=pathinfo($path); - foreach($fixed_path_from_filemanager as $k=>$paths) - { - if ($paths!="" && $paths[strlen($paths)-1] != "/") $paths.= "/"; - - $base_dir=$paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path)); - - if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'])) - { - duplicate_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k]); + if ($duplicate_files) { + $name = fix_filename($name, $transliteration, $convert_spaces, $replace_with); + if (!empty($name)) { + if (!duplicate_file($path, $name)) { + response(trans('Rename_existing_file'), 403)->send(); + exit; + } + + duplicate_file($path_thumb, $name); + + if ($fixed_image_creation) { + $info = pathinfo($path); + foreach ($fixed_path_from_filemanager as $k => $paths) { + if ($paths != "" && $paths[strlen($paths) - 1] != "/") + $paths.= "/"; + + $base_dir = $paths . substr_replace($info['dirname'] . "/", '', 0, strlen($current_path)); + + if (file_exists($base_dir . $fixed_image_creation_name_to_prepend[$k] . $info['filename'] . $fixed_image_creation_to_append[$k] . "." . $info['extension'])) { + duplicate_file($base_dir . $fixed_image_creation_name_to_prepend[$k] . $info['filename'] . $fixed_image_creation_to_append[$k] . "." . $info['extension'], $fixed_image_creation_name_to_prepend[$k] . $name . $fixed_image_creation_to_append[$k]); } } } - } - else - { + } else { response(trans('Empty_name'), 400)->send(); - exit; + exit; } } break; case 'paste_clipboard': - if ( ! isset($_SESSION['RF']['clipboard_action'], $_SESSION['RF']['clipboard']['path']) - || $_SESSION['RF']['clipboard_action'] == '' - || $_SESSION['RF']['clipboard']['path'] == '') - { + if (!isset($_SESSION['RF']['clipboard_action'], $_SESSION['RF']['clipboard']['path']) || $_SESSION['RF']['clipboard_action'] == '' || $_SESSION['RF']['clipboard']['path'] == '') { response()->send(); - exit; + exit; } $action = $_SESSION['RF']['clipboard_action']; $data = $_SESSION['RF']['clipboard']; - $data['path'] = $current_path.$data['path']; - $data['path_thumb'] = $thumbs_base_path.$data['path']; + $data['path'] = $current_path . $data['path']; + $data['path_thumb'] = $thumbs_base_path . $data['path']; $pinfo = pathinfo($data['path']); // user wants to paste to the same dir. nothing to do here... if ($pinfo['dirname'] == rtrim($path, '/')) { response()->send(); - exit; + exit; } // user wants to paste folder to it's own sub folder.. baaaah. - if (is_dir($data['path']) && strpos($path, $data['path']) !== FALSE){ + if (is_dir($data['path']) && strpos($path, $data['path']) !== FALSE) { response()->send(); - exit; + exit; } // something terribly gone wrong - if ($action != 'copy' && $action != 'cut'){ + if ($action != 'copy' && $action != 'cut') { response('no action', 400)->send(); - exit; + exit; } // check for writability - if (is_really_writable($path) === FALSE || is_really_writable($path_thumb) === FALSE){ - response(trans('Dir_No_Write').'
'.str_replace('../','',$path).'
'.str_replace('../','',$path_thumb), 403)->send(); - exit; + if (is_really_writable($path) === FALSE || is_really_writable($path_thumb) === FALSE) { + response(trans('Dir_No_Write') . '
' . str_replace('../', '', $path) . '
' . str_replace('../', '', $path_thumb), 403)->send(); + exit; } // check if server disables copy or rename - if (is_function_callable(($action == 'copy' ? 'copy' : 'rename')) === FALSE){ + if (is_function_callable(($action == 'copy' ? 'copy' : 'rename')) === FALSE) { response(sprintf(trans('Function_Disabled'), ($action == 'copy' ? lcfirst(trans('Copy')) : lcfirst(trans('Cut')))), 403)->send(); - exit; + exit; } - if ($action == 'copy') - { + if ($action == 'copy') { rcopy($data['path'], $path); rcopy($data['path_thumb'], $path_thumb); - } - elseif ($action == 'cut') - { + } elseif ($action == 'cut') { rrename($data['path'], $path); rrename($data['path_thumb'], $path_thumb); // cleanup - if (is_dir($data['path']) === TRUE){ + if (is_dir($data['path']) === TRUE) { rrename_after_cleaner($data['path']); rrename_after_cleaner($data['path_thumb']); } @@ -360,29 +330,29 @@ // check perm if ($chmod_perm === FALSE) { - response(sprintf(trans('File_Permission_Not_Allowed'), (is_dir($path) ? lcfirst(trans('Folders')) : lcfirst(trans('Files')) )), 403)->send(); - exit; + response(sprintf(trans('File_Permission_Not_Allowed'), (is_dir($path) ? lcfirst(trans('Folders')) : lcfirst(trans('Files')))), 403)->send(); + exit; } // check mode - if (!preg_match("/^[0-7]{3}$/", $mode)){ + if (!preg_match("/^[0-7]{3}$/", $mode)) { response(trans('File_Permission_Wrong_Mode'), 400)->send(); - exit; + exit; } // check recursive option - if (!in_array($rec_option, $valid_options)){ + if (!in_array($rec_option, $valid_options)) { response("wrong option", 400)->send(); - exit; + exit; } // check if server disabled chmod - if (is_function_callable('chmod') === FALSE){ + if (is_function_callable('chmod') === FALSE) { response(sprintf(trans('Function_Disabled'), 'chmod'), 403)->send(); - exit; + exit; } - $mode = "0".$mode; + $mode = "0" . $mode; $mode = octdec($mode); rchmod($path, $mode, $rec_option); @@ -392,31 +362,29 @@ $content = $_POST['new_content']; // $content = htmlspecialchars($content); not needed // $content = stripslashes($content); - // no file if (!file_exists($path)) { response(trans('File_Not_Found'), 404)->send(); - exit; + exit; } // not writable or edit not allowed if (!is_writable($path) || $edit_text_files === FALSE) { response(sprintf(trans('File_Open_Edit_Not_Allowed'), strtolower(trans('Edit'))), 403)->send(); - exit; + exit; } if (@file_put_contents($path, $content) === FALSE) { response(trans('File_Save_Error'), 500)->send(); - exit; - } - else { + exit; + } else { response(trans('File_Save_OK'))->send(); - exit; + exit; } break; default: response('wrong action', 400)->send(); - exit; + exit; } } diff --git a/filemanager/fonts/metro.eot b/filemanager/fonts/metro.eot new file mode 100644 index 00000000..d762c197 Binary files /dev/null and b/filemanager/fonts/metro.eot differ diff --git a/filemanager/fonts/metro.svg b/filemanager/fonts/metro.svg new file mode 100644 index 00000000..a2da519e --- /dev/null +++ b/filemanager/fonts/metro.svg @@ -0,0 +1,482 @@ + + + + + + +{ + "fontFamily": "metro", + "majorVersion": 1, + "minorVersion": 0, + "fontURL": "http://metroui.org.ua/font.html", + "description": "Metro Icon Font\nFont generated by IcoMoon.", + "copyright": "2012-2015 Metro UI CSS", + "license": "MIT", + "licenseURL": "http://metroui.org.ua/license.html", + "version": "Version 1.0", + "fontId": "metro", + "psName": "metro", + "subFamily": "Regular", + "fullName": "metro" +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/filemanager/fonts/metro.ttf b/filemanager/fonts/metro.ttf new file mode 100644 index 00000000..4650d7af Binary files /dev/null and b/filemanager/fonts/metro.ttf differ diff --git a/filemanager/fonts/metro.woff b/filemanager/fonts/metro.woff new file mode 100644 index 00000000..77f2a255 Binary files /dev/null and b/filemanager/fonts/metro.woff differ diff --git a/filemanager/img/clipboard_apply.png b/filemanager/img/clipboard_apply.png deleted file mode 100644 index d470c443..00000000 Binary files a/filemanager/img/clipboard_apply.png and /dev/null differ diff --git a/filemanager/img/clipboard_clear.png b/filemanager/img/clipboard_clear.png deleted file mode 100644 index e7fb9031..00000000 Binary files a/filemanager/img/clipboard_clear.png and /dev/null differ diff --git a/filemanager/img/copy.png b/filemanager/img/copy.png deleted file mode 100644 index e1d89116..00000000 Binary files a/filemanager/img/copy.png and /dev/null differ diff --git a/filemanager/img/cut.png b/filemanager/img/cut.png deleted file mode 100755 index a139267e..00000000 Binary files a/filemanager/img/cut.png and /dev/null differ diff --git a/filemanager/img/date.png b/filemanager/img/date.png deleted file mode 100644 index ef310f4c..00000000 Binary files a/filemanager/img/date.png and /dev/null differ diff --git a/filemanager/img/dimension.png b/filemanager/img/dimension.png deleted file mode 100755 index 43dcc101..00000000 Binary files a/filemanager/img/dimension.png and /dev/null differ diff --git a/filemanager/img/down.png b/filemanager/img/down.png deleted file mode 100644 index 76511223..00000000 Binary files a/filemanager/img/down.png and /dev/null differ diff --git a/filemanager/img/download.png b/filemanager/img/download.png deleted file mode 100755 index 76125f22..00000000 Binary files a/filemanager/img/download.png and /dev/null differ diff --git a/filemanager/img/duplicate.png b/filemanager/img/duplicate.png deleted file mode 100644 index faa0f97d..00000000 Binary files a/filemanager/img/duplicate.png and /dev/null differ diff --git a/filemanager/img/edit_img.png b/filemanager/img/edit_img.png deleted file mode 100644 index ca55e585..00000000 Binary files a/filemanager/img/edit_img.png and /dev/null differ diff --git a/filemanager/img/file_edit.png b/filemanager/img/file_edit.png deleted file mode 100644 index 4bcd072e..00000000 Binary files a/filemanager/img/file_edit.png and /dev/null differ diff --git a/filemanager/img/glyphicons-halflings-white.png b/filemanager/img/glyphicons-halflings-white.png deleted file mode 100755 index a92969a1..00000000 Binary files a/filemanager/img/glyphicons-halflings-white.png and /dev/null differ diff --git a/filemanager/img/glyphicons-halflings.png b/filemanager/img/glyphicons-halflings.png deleted file mode 100755 index f43139a4..00000000 Binary files a/filemanager/img/glyphicons-halflings.png and /dev/null differ diff --git a/filemanager/img/info.png b/filemanager/img/info.png deleted file mode 100644 index 6baffc33..00000000 Binary files a/filemanager/img/info.png and /dev/null differ diff --git a/filemanager/img/key.png b/filemanager/img/key.png deleted file mode 100644 index 463d0826..00000000 Binary files a/filemanager/img/key.png and /dev/null differ diff --git a/filemanager/img/label.png b/filemanager/img/label.png deleted file mode 100644 index fa653171..00000000 Binary files a/filemanager/img/label.png and /dev/null differ diff --git a/filemanager/img/loading.gif b/filemanager/img/loading.gif deleted file mode 100755 index 6fba7760..00000000 Binary files a/filemanager/img/loading.gif and /dev/null differ diff --git a/filemanager/img/preview.png b/filemanager/img/preview.png deleted file mode 100755 index b1247525..00000000 Binary files a/filemanager/img/preview.png and /dev/null differ diff --git a/filemanager/img/processing.gif b/filemanager/img/processing.gif deleted file mode 100755 index 7c99504e..00000000 Binary files a/filemanager/img/processing.gif and /dev/null differ diff --git a/filemanager/img/rename.png b/filemanager/img/rename.png deleted file mode 100755 index a425ee75..00000000 Binary files a/filemanager/img/rename.png and /dev/null differ diff --git a/filemanager/img/size.png b/filemanager/img/size.png deleted file mode 100644 index fcc302f2..00000000 Binary files a/filemanager/img/size.png and /dev/null differ diff --git a/filemanager/img/sort.png b/filemanager/img/sort.png deleted file mode 100644 index 0a029be0..00000000 Binary files a/filemanager/img/sort.png and /dev/null differ diff --git a/filemanager/img/storing_animation.gif b/filemanager/img/storing_animation.gif deleted file mode 100644 index eca3a53c..00000000 Binary files a/filemanager/img/storing_animation.gif and /dev/null differ diff --git a/filemanager/img/up.png b/filemanager/img/up.png deleted file mode 100644 index 680dadeb..00000000 Binary files a/filemanager/img/up.png and /dev/null differ diff --git a/filemanager/img/upload.png b/filemanager/img/upload.png deleted file mode 100644 index 7380e8f8..00000000 Binary files a/filemanager/img/upload.png and /dev/null differ diff --git a/filemanager/img/url.png b/filemanager/img/url.png deleted file mode 100644 index f18499af..00000000 Binary files a/filemanager/img/url.png and /dev/null differ diff --git a/filemanager/img/zip.png b/filemanager/img/zip.png deleted file mode 100644 index 9ef55c7b..00000000 Binary files a/filemanager/img/zip.png and /dev/null differ diff --git a/filemanager/include/php_image_magician.php b/filemanager/include/php_image_magician.php old mode 100755 new mode 100644 index a16ac96a..d95a5e82 --- a/filemanager/include/php_image_magician.php +++ b/filemanager/include/php_image_magician.php @@ -1,4 +1,5 @@ 255, 'g' => 255, 'b' => 255 ); - - private $sharpenArray = array( 'jpg' ); - - private $psdReaderPath; - private $filterOverlayPath; - - private $isInterlace; - - private $captionBoxPositionArray = array(); - - private $fontDir = 'fonts'; - - private $cropFromTopPercent = 10; - + private $fileName; + private $image; + protected $imageResized; + private $widthOriginal; # Always be the original width + private $heightOriginal; + private $width; # Current width (width after resize) + private $height; + private $imageSize; + private $fileExtension; + private $debug = true; + private $errorArray = array(); + private $forceStretch = true; + private $aggresiveSharpening = false; + private $transparentArray = array('.png', '.gif'); + private $keepTransparency = true; + private $fillColorArray = array('r' => 255, 'g' => 255, 'b' => 255); + private $sharpenArray = array('jpg'); + private $psdReaderPath; + private $filterOverlayPath; + private $isInterlace; + private $captionBoxPositionArray = array(); + private $fontDir = 'fonts'; + private $cropFromTopPercent = 10; ## -------------------------------------------------------- - function __construct($fileName) - # Author: Jarrod Oberto - # Date: 27-02-08 - # Purpose: Constructor - # Param in: $fileName: File name and path. - # Param out: n/a - # Reference: - # Notes: - # - { - if ( ! $this->testGDInstalled()) - { - if ($this->debug) - { - throw new Exception('The GD Library is not installed.'); - } - else - { - throw new Exception(); - } - }; - - $this->initialise(); - - // *** Save the image file name. Only store this incase you want to display it - $this->fileName = $fileName; - $this->fileExtension = fix_strtolower(strrchr($fileName, '.')); - - // *** Open up the file - $this->image = $this->openImage($fileName); - - - // *** Assign here so we don't modify the original - $this->imageResized = $this->image; - - // *** If file is an image - if ($this->testIsImage($this->image)) - { - // *** Get width and height - $this->width = imagesx($this->image); - $this->widthOriginal = imagesx($this->image); - $this->height = imagesy($this->image); - $this->heightOriginal = imagesy($this->image); - - - /* Added 15-09-08 - * Get the filesize using this build in method. - * Stores an array of size - * - * $this->imageSize[1] = width - * $this->imageSize[2] = height - * $this->imageSize[3] = width x height - * - */ - $this->imageSize = getimagesize($this->fileName); - - } - else - { - $this->errorArray[] = 'File is not an image'; - } - } + function __construct($fileName) { + # Author: Jarrod Oberto + # Date: 27-02-08 + # Purpose: Constructor + # Param in: $fileName: File name and path. + # Param out: n/a + # Reference: + # Notes:# + + if (!$this->testGDInstalled()) { + if ($this->debug) { + throw new Exception('The GD Library is not installed.'); + } else { + throw new Exception(); + } + }; + + $this->initialise(); + + // *** Save the image file name. Only store this incase you want to display it + $this->fileName = $fileName; + $this->fileExtension = fix_strtolower(strrchr($fileName, '.')); + + // *** Open up the file + $this->image = $this->openImage($fileName); + + + // *** Assign here so we don't modify the original + $this->imageResized = $this->image; + + // *** If file is an image + if ($this->testIsImage($this->image)) { + // *** Get width and height + $this->width = imagesx($this->image); + $this->widthOriginal = imagesx($this->image); + $this->height = imagesy($this->image); + $this->heightOriginal = imagesy($this->image); + + + /* Added 15-09-08 + * Get the filesize using this build in method. + * Stores an array of size + * + * $this->imageSize[1] = width + * $this->imageSize[2] = height + * $this->imageSize[3] = width x height + * + */ + $this->imageSize = getimagesize($this->fileName); + } else { + $this->errorArray[] = 'File is not an image'; + } + } ## -------------------------------------------------------- - private function initialise() - { - - $this->psdReaderPath = dirname(__FILE__) . '/classPhpPsdReader.php'; - $this->filterOverlayPath = dirname(__FILE__) . '/filters'; - - // *** Set if image should be interlaced or not. - $this->isInterlace = false; - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Resize -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - - public function resizeImage($newWidth, $newHeight, $option = 0, $sharpen = false, $autoRotate = false) - # Author: Jarrod Oberto - # Date: 27-02-08 - # Purpose: Resizes the image - # Param in: $newWidth: - # $newHeight: - # $option: 0 / exact = defined size; - # 1 / portrait = keep aspect set height; - # 2 / landscape = keep aspect set width; - # 3 / auto = auto; - # 4 / crop= resize and crop; - # + private function initialise() { + + $this->psdReaderPath = dirname(__FILE__) . '/classPhpPsdReader.php'; + $this->filterOverlayPath = dirname(__FILE__) . '/filters'; + + // *** Set if image should be interlaced or not. + $this->isInterlace = false; + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Resize + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + public function resizeImage($newWidth, $newHeight, $option = 0, $sharpen = false, $autoRotate = false) { + # Author: Jarrod Oberto + # Date: 27-02-08 + # Purpose: Resizes the image + # Param in: $newWidth: + # $newHeight: + # $option: 0 / exact = defined size; + # 1 / portrait = keep aspect set height; + # 2 / landscape = keep aspect set width; + # 3 / auto = auto; + # 4 / crop= resize and crop; + # # $option can also be an array containing options for - # cropping. E.G., array('crop', 'r') - # + # cropping. E.G., array('crop', 'r') + # # This array only applies to 'crop' and the 'r' refers to - # "crop right". Other value include; tl, t, tr, l, m (default), - # r, bl, b, br, or you can specify your own co-ords (which - # isn't recommended. - # + # "crop right". Other value include; tl, t, tr, l, m (default), + # r, bl, b, br, or you can specify your own co-ords (which + # isn't recommended. + # # $sharpen: true: sharpen (jpg only); - # false: don't sharpen - # Param out: n/a - # Reference: - # Notes: To clarify the $option input: - # 0 = The exact height and width dimensions you set. - # 1 = Whatever height is passed in will be the height that - # is set. The width will be calculated and set automatically - # to a the value that keeps the original aspect ratio. - # 2 = The same but based on the width. We try make the image the - # biggest size we can while stil fitting inside the box size - # 3 = Depending whether the image is landscape or portrait, this - # will automatically determine whether to resize via - # dimension 1,2 or 0 - # 4 = Will resize and then crop the image for best fit - # - # forceStretch can be applied to options 1,2,3 and 4 - # - { - - // *** We can pass in an array of options to change the crop position - $cropPos = 'm'; - if (is_array($option) && fix_strtolower($option[0]) == 'crop') - { - $cropPos = $option[1]; # get the crop option - } - else - { - if (strpos($option, '-') !== false) - { - // *** Or pass in a hyphen seperated option - $optionPiecesArray = explode('-', $option); - $cropPos = end($optionPiecesArray); - } - } - - // *** Check the option is valid - $option = $this->prepOption($option); - - // *** Make sure the file passed in is valid - if ( ! $this->image) - { - if ($this->debug) - { - throw new Exception('file ' . $this->getFileName() . ' is missing or invalid'); - } - else - { - throw new Exception(); - } - }; - - // *** Get optimal width and height - based on $option - $dimensionsArray = $this->getDimensions($newWidth, $newHeight, $option); - - $optimalWidth = $dimensionsArray['optimalWidth']; - $optimalHeight = $dimensionsArray['optimalHeight']; - - // *** Resample - create image canvas of x, y size - $this->imageResized = imagecreatetruecolor($optimalWidth, $optimalHeight); - $this->keepTransparancy($optimalWidth, $optimalHeight, $this->imageResized); - imagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $optimalWidth, $optimalHeight, $this->width, $this->height); - - - // *** If '4', then crop too - if ($option == 4 || $option == 'crop') - { - - if (($optimalWidth >= $newWidth && $optimalHeight >= $newHeight)) - { - $this->crop($optimalWidth, $optimalHeight, $newWidth, $newHeight, $cropPos); - } - } - - // *** If Rotate. - if ($autoRotate) - { - - $exifData = $this->getExif(false); - if (count($exifData) > 0) - { - - switch ($exifData['orientation']) - { - case 8: - $this->imageResized = imagerotate($this->imageResized, 90, 0); - break; - case 3: - $this->imageResized = imagerotate($this->imageResized, 180, 0); - break; - case 6: - $this->imageResized = imagerotate($this->imageResized, -90, 0); - break; - } - } - } - - // *** Sharpen image (if jpg and the user wishes to do so) - if ($sharpen && in_array($this->fileExtension, $this->sharpenArray)) - { - - // *** Sharpen - $this->sharpen(); - } - } + # false: don't sharpen + # Param out: n/a + # Reference: + # Notes: To clarify the $option input: + # 0 = The exact height and width dimensions you set. + # 1 = Whatever height is passed in will be the height that + # is set. The width will be calculated and set automatically + # to a the value that keeps the original aspect ratio. + # 2 = The same but based on the width. We try make the image the + # biggest size we can while stil fitting inside the box size + # 3 = Depending whether the image is landscape or portrait, this + # will automatically determine whether to resize via + # dimension 1,2 or 0 + # 4 = Will resize and then crop the image for best fit + # + # forceStretch can be applied to options 1,2,3 and 4# + // *** We can pass in an array of options to change the crop position + $cropPos = 'm'; + if (is_array($option) && fix_strtolower($option[0]) == 'crop') { + $cropPos = $option[1]; # get the crop option + } else { + if (strpos($option, '-') !== false) { + // *** Or pass in a hyphen seperated option + $optionPiecesArray = explode('-', $option); + $cropPos = end($optionPiecesArray); + } + } + + // *** Check the option is valid + $option = $this->prepOption($option); + // *** Make sure the file passed in is valid + if (!$this->image) { + if ($this->debug) { + throw new Exception('file ' . $this->getFileName() . ' is missing or invalid'); + } else { + throw new Exception(); + } + }; + // *** Get optimal width and height - based on $option + $dimensionsArray = $this->getDimensions($newWidth, $newHeight, $option); + + $optimalWidth = $dimensionsArray['optimalWidth']; + $optimalHeight = $dimensionsArray['optimalHeight']; + + // *** Resample - create image canvas of x, y size + $this->imageResized = imagecreatetruecolor($optimalWidth, $optimalHeight); + $this->keepTransparancy($optimalWidth, $optimalHeight, $this->imageResized); + imagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $optimalWidth, $optimalHeight, $this->width, $this->height); + + + // *** If '4', then crop too + if ($option == 4 || $option == 'crop') { + + if (($optimalWidth >= $newWidth && $optimalHeight >= $newHeight)) { + $this->crop($optimalWidth, $optimalHeight, $newWidth, $newHeight, $cropPos); + } + } + + // *** If Rotate. + if ($autoRotate) { + + $exifData = $this->getExif(false); + if (count($exifData) > 0) { + + switch ($exifData['orientation']) { + case 8: + $this->imageResized = imagerotate($this->imageResized, 90, 0); + break; + case 3: + $this->imageResized = imagerotate($this->imageResized, 180, 0); + break; + case 6: + $this->imageResized = imagerotate($this->imageResized, -90, 0); + break; + } + } + } + + // *** Sharpen image (if jpg and the user wishes to do so) + if ($sharpen && in_array($this->fileExtension, $this->sharpenArray)) { + + // *** Sharpen + $this->sharpen(); + } + } ## -------------------------------------------------------- - public function cropImage($newWidth, $newHeight, $cropPos = 'm') - # Author: Jarrod Oberto - # Date: 08-09-11 - # Purpose: Crops the image - # Param in: $newWidth: crop with - # $newHeight: crop height - # $cropPos: Can be any of the following: - # tl, t, tr, l, m, r, bl, b, br, auto - # Or: - # a custom position such as '30x50' - # Param out: n/a - # Reference: - # Notes: - # - { - - // *** Make sure the file passed in is valid - if ( ! $this->image) - { - if ($this->debug) - { - throw new Exception('file ' . $this->getFileName() . ' is missing or invalid'); - } - else - { - throw new Exception(); - } - }; - - $this->imageResized = $this->image; - $this->crop($this->width, $this->height, $newWidth, $newHeight, $cropPos); - - } + public function cropImage($newWidth, $newHeight, $cropPos = 'm') { + # Author: Jarrod Oberto + # Date: 08-09-11 + # Purpose: Crops the image + # Param in: $newWidth: crop with + # $newHeight: crop height + # $cropPos: Can be any of the following: + # tl, t, tr, l, m, r, bl, b, br, auto + # Or: + # a custom position such as '30x50' + # Param out: n/a + # Reference: + # Notes:# + // *** Make sure the file passed in is valid + if (!$this->image) { + if ($this->debug) { + throw new Exception('file ' . $this->getFileName() . ' is missing or invalid'); + } else { + throw new Exception(); + } + }; + + $this->imageResized = $this->image; + $this->crop($this->width, $this->height, $newWidth, $newHeight, $cropPos); + } ## -------------------------------------------------------- - private function keepTransparancy($width, $height, $im) - # Author: Jarrod Oberto - # Date: 08-04-11 - # Purpose: Keep transparency for png and gif image - # Param in: - # Param out: n/a - # Reference: - # Notes: - # - { - // *** If PNG, perform some transparency retention actions (gif untested) - if (in_array($this->fileExtension, $this->transparentArray) && $this->keepTransparency) - { - imagealphablending($im, false); - imagesavealpha($im, true); - $transparent = imagecolorallocatealpha($im, 255, 255, 255, 127); - imagefilledrectangle($im, 0, 0, $width, $height, $transparent); - } - else - { - $color = imagecolorallocate($im, $this->fillColorArray['r'], $this->fillColorArray['g'], $this->fillColorArray['b']); - imagefilledrectangle($im, 0, 0, $width, $height, $color); - } - } + private function keepTransparancy($width, $height, $im) { + # Author: Jarrod Oberto + # Date: 08-04-11 + # Purpose: Keep transparency for png and gif image + # Param in: + # Param out: n/a + # Reference: + # Notes:# + // *** If PNG, perform some transparency retention actions (gif untested) + if (in_array($this->fileExtension, $this->transparentArray) && $this->keepTransparency) { + imagealphablending($im, false); + imagesavealpha($im, true); + $transparent = imagecolorallocatealpha($im, 255, 255, 255, 127); + imagefilledrectangle($im, 0, 0, $width, $height, $transparent); + } else { + $color = imagecolorallocate($im, $this->fillColorArray['r'], $this->fillColorArray['g'], $this->fillColorArray['b']); + imagefilledrectangle($im, 0, 0, $width, $height, $color); + } + } ## -------------------------------------------------------- - private function crop($optimalWidth, $optimalHeight, $newWidth, $newHeight, $cropPos) - # Author: Jarrod Oberto - # Date: 15-09-08 - # Purpose: Crops the image - # Param in: $newWidth: - # $newHeight: - # Param out: n/a - # Reference: - # Notes: - # - { - - // *** Get cropping co-ordinates - $cropArray = $this->getCropPlacing($optimalWidth, $optimalHeight, $newWidth, $newHeight, $cropPos); - $cropStartX = $cropArray['x']; - $cropStartY = $cropArray['y']; - - // *** Crop this bad boy - $crop = imagecreatetruecolor($newWidth, $newHeight); - $this->keepTransparancy($optimalWidth, $optimalHeight, $crop); - imagecopyresampled($crop, $this->imageResized, 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight, $newWidth, $newHeight); - - $this->imageResized = $crop; - - // *** Set new width and height to our variables - $this->width = $newWidth; - $this->height = $newHeight; - - } + private function crop($optimalWidth, $optimalHeight, $newWidth, $newHeight, $cropPos) { + # Author: Jarrod Oberto + # Date: 15-09-08 + # Purpose: Crops the image + # Param in: $newWidth: + # $newHeight: + # Param out: n/a + # Reference: + # Notes:# + // *** Get cropping co-ordinates + $cropArray = $this->getCropPlacing($optimalWidth, $optimalHeight, $newWidth, $newHeight, $cropPos); + $cropStartX = $cropArray['x']; + $cropStartY = $cropArray['y']; + + // *** Crop this bad boy + $crop = imagecreatetruecolor($newWidth, $newHeight); + $this->keepTransparancy($optimalWidth, $optimalHeight, $crop); + imagecopyresampled($crop, $this->imageResized, 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight, $newWidth, $newHeight); + + $this->imageResized = $crop; + + // *** Set new width and height to our variables + $this->width = $newWidth; + $this->height = $newHeight; + } ## -------------------------------------------------------- - private function getCropPlacing($optimalWidth, $optimalHeight, $newWidth, $newHeight, $pos = 'm') - # - # Author: Jarrod Oberto - # Date: July 11 - # Purpose: Set the cropping area. - # Params in: - # Params out: (array) the crop x and y co-ordinates. - # Notes: When specifying the exact pixel crop position (eg 10x15), be - # very careful as it's easy to crop out of the image leaving - # black borders. - # - { - $pos = fix_strtolower($pos); - - // *** If co-ords have been entered - if (strstr($pos, 'x')) - { - $pos = str_replace(' ', '', $pos); - - $xyArray = explode('x', $pos); - list($cropStartX, $cropStartY) = $xyArray; - - } - else - { - - switch ($pos) - { - case 'tl': - $cropStartX = 0; - $cropStartY = 0; - break; - - case 't': - $cropStartX = ($optimalWidth / 2) - ($newWidth / 2); - $cropStartY = 0; - break; - - case 'tr': - $cropStartX = $optimalWidth - $newWidth; - $cropStartY = 0; - break; - - case 'l': - $cropStartX = 0; - $cropStartY = ($optimalHeight / 2) - ($newHeight / 2); - break; - - case 'm': - $cropStartX = ($optimalWidth / 2) - ($newWidth / 2); - $cropStartY = ($optimalHeight / 2) - ($newHeight / 2); - break; - - case 'r': - $cropStartX = $optimalWidth - $newWidth; - $cropStartY = ($optimalHeight / 2) - ($newHeight / 2); - break; - - case 'bl': - $cropStartX = 0; - $cropStartY = $optimalHeight - $newHeight; - break; - - case 'b': - $cropStartX = ($optimalWidth / 2) - ($newWidth / 2); - $cropStartY = $optimalHeight - $newHeight; - break; - - case 'br': - $cropStartX = $optimalWidth - $newWidth; - $cropStartY = $optimalHeight - $newHeight; - break; - - case 'auto': - // *** If image is a portrait crop from top, not center. v1.5 - if ($optimalHeight > $optimalWidth) - { - $cropStartX = ($optimalWidth / 2) - ($newWidth / 2); - $cropStartY = ($this->cropFromTopPercent / 100) * $optimalHeight; - } - else - { - - // *** Else crop from the center - $cropStartX = ($optimalWidth / 2) - ($newWidth / 2); - $cropStartY = ($optimalHeight / 2) - ($newHeight / 2); - } - break; - - default: - // *** Default to center - $cropStartX = ($optimalWidth / 2) - ($newWidth / 2); - $cropStartY = ($optimalHeight / 2) - ($newHeight / 2); - break; - } - } - - return array( 'x' => $cropStartX, 'y' => $cropStartY ); - } + private function getCropPlacing($optimalWidth, $optimalHeight, $newWidth, $newHeight, $pos = 'm') { + # + # Author: Jarrod Oberto + # Date: July 11 + # Purpose: Set the cropping area. + # Params in: + # Params out: (array) the crop x and y co-ordinates. + # Notes: When specifying the exact pixel crop position (eg 10x15), be + # very careful as it's easy to crop out of the image leaving + # black borders.# + + $pos = fix_strtolower($pos); + + // *** If co-ords have been entered + if (strstr($pos, 'x')) { + $pos = str_replace(' ', '', $pos); + + $xyArray = explode('x', $pos); + list($cropStartX, $cropStartY) = $xyArray; + } else { + + switch ($pos) { + case 'tl': + $cropStartX = 0; + $cropStartY = 0; + break; + + case 't': + $cropStartX = ($optimalWidth / 2) - ($newWidth / 2); + $cropStartY = 0; + break; + + case 'tr': + $cropStartX = $optimalWidth - $newWidth; + $cropStartY = 0; + break; + + case 'l': + $cropStartX = 0; + $cropStartY = ($optimalHeight / 2) - ($newHeight / 2); + break; + + case 'm': + $cropStartX = ($optimalWidth / 2) - ($newWidth / 2); + $cropStartY = ($optimalHeight / 2) - ($newHeight / 2); + break; + + case 'r': + $cropStartX = $optimalWidth - $newWidth; + $cropStartY = ($optimalHeight / 2) - ($newHeight / 2); + break; + + case 'bl': + $cropStartX = 0; + $cropStartY = $optimalHeight - $newHeight; + break; + + case 'b': + $cropStartX = ($optimalWidth / 2) - ($newWidth / 2); + $cropStartY = $optimalHeight - $newHeight; + break; + + case 'br': + $cropStartX = $optimalWidth - $newWidth; + $cropStartY = $optimalHeight - $newHeight; + break; + + case 'auto': + // *** If image is a portrait crop from top, not center. v1.5 + if ($optimalHeight > $optimalWidth) { + $cropStartX = ($optimalWidth / 2) - ($newWidth / 2); + $cropStartY = ($this->cropFromTopPercent / 100) * $optimalHeight; + } else { + + // *** Else crop from the center + $cropStartX = ($optimalWidth / 2) - ($newWidth / 2); + $cropStartY = ($optimalHeight / 2) - ($newHeight / 2); + } + break; + + default: + // *** Default to center + $cropStartX = ($optimalWidth / 2) - ($newWidth / 2); + $cropStartY = ($optimalHeight / 2) - ($newHeight / 2); + break; + } + } + + return array('x' => $cropStartX, 'y' => $cropStartY); + } ## -------------------------------------------------------- - private function getDimensions($newWidth, $newHeight, $option) - # Author: Jarrod Oberto - # Date: 17-11-09 - # Purpose: Get new image dimensions based on user specificaions - # Param in: $newWidth: - # $newHeight: - # Param out: Array of new width and height values - # Reference: - # Notes: If $option = 3 then this function is call recursivly - # + private function getDimensions($newWidth, $newHeight, $option) { + # Author: Jarrod Oberto + # Date: 17-11-09 + # Purpose: Get new image dimensions based on user specificaions + # Param in: $newWidth: + # $newHeight: + # Param out: Array of new width and height values + # Reference: + # Notes: If $option = 3 then this function is call recursivly + # # To clarify the $option input: - # 0 = The exact height and width dimensions you set. - # 1 = Whatever height is passed in will be the height that - # is set. The width will be calculated and set automatically - # to a the value that keeps the original aspect ratio. - # 2 = The same but based on the width. - # 3 = Depending whether the image is landscape or portrait, this - # will automatically determine whether to resize via - # dimension 1,2 or 0. - # 4 = Resize the image as much as possible, then crop the - # remainder. - { - - switch (strval($option)) - { - case '0': - case 'exact': - $optimalWidth = $newWidth; - $optimalHeight = $newHeight; - break; - case '1': - case 'portrait': - $dimensionsArray = $this->getSizeByFixedHeight($newWidth, $newHeight); - $optimalWidth = $dimensionsArray['optimalWidth']; - $optimalHeight = $dimensionsArray['optimalHeight']; - break; - case '2': - case 'landscape': - $dimensionsArray = $this->getSizeByFixedWidth($newWidth, $newHeight); - $optimalWidth = $dimensionsArray['optimalWidth']; - $optimalHeight = $dimensionsArray['optimalHeight']; - break; - case '3': - case 'auto': - $dimensionsArray = $this->getSizeByAuto($newWidth, $newHeight); - $optimalWidth = $dimensionsArray['optimalWidth']; - $optimalHeight = $dimensionsArray['optimalHeight']; - break; - case '4': - case 'crop': - $dimensionsArray = $this->getOptimalCrop($newWidth, $newHeight); - $optimalWidth = $dimensionsArray['optimalWidth']; - $optimalHeight = $dimensionsArray['optimalHeight']; - break; - } - - return array( 'optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight ); - } + # 0 = The exact height and width dimensions you set. + # 1 = Whatever height is passed in will be the height that + # is set. The width will be calculated and set automatically + # to a the value that keeps the original aspect ratio. + # 2 = The same but based on the width. + # 3 = Depending whether the image is landscape or portrait, this + # will automatically determine whether to resize via + # dimension 1,2 or 0. + # 4 = Resize the image as much as possible, then crop the + # remainder. + + switch (strval($option)) { + case '0': + case 'exact': + $optimalWidth = $newWidth; + $optimalHeight = $newHeight; + break; + case '1': + case 'portrait': + $dimensionsArray = $this->getSizeByFixedHeight($newWidth, $newHeight); + $optimalWidth = $dimensionsArray['optimalWidth']; + $optimalHeight = $dimensionsArray['optimalHeight']; + break; + case '2': + case 'landscape': + $dimensionsArray = $this->getSizeByFixedWidth($newWidth, $newHeight); + $optimalWidth = $dimensionsArray['optimalWidth']; + $optimalHeight = $dimensionsArray['optimalHeight']; + break; + case '3': + case 'auto': + $dimensionsArray = $this->getSizeByAuto($newWidth, $newHeight); + $optimalWidth = $dimensionsArray['optimalWidth']; + $optimalHeight = $dimensionsArray['optimalHeight']; + break; + case '4': + case 'crop': + $dimensionsArray = $this->getOptimalCrop($newWidth, $newHeight); + $optimalWidth = $dimensionsArray['optimalWidth']; + $optimalHeight = $dimensionsArray['optimalHeight']; + break; + } + + return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight); + } ## -------------------------------------------------------- - private function getSizeByFixedHeight($newWidth, $newHeight) - { - // *** If forcing is off... - if ( ! $this->forceStretch) - { + private function getSizeByFixedHeight($newWidth, $newHeight) { + // *** If forcing is off... + if (!$this->forceStretch) { - // *** ...check if actual height is less than target height - if ($this->height < $newHeight) - { - return array( 'optimalWidth' => $this->width, 'optimalHeight' => $this->height ); - } - } + // *** ...check if actual height is less than target height + if ($this->height < $newHeight) { + return array('optimalWidth' => $this->width, 'optimalHeight' => $this->height); + } + } - $ratio = $this->width / $this->height; + $ratio = $this->width / $this->height; - $newWidth = $newHeight * $ratio; + $newWidth = $newHeight * $ratio; - //return $newWidth; - return array( 'optimalWidth' => $newWidth, 'optimalHeight' => $newHeight ); - } + //return $newWidth; + return array('optimalWidth' => $newWidth, 'optimalHeight' => $newHeight); + } ## -------------------------------------------------------- - private function getSizeByFixedWidth($newWidth, $newHeight) - { - // *** If forcing is off... - if ( ! $this->forceStretch) - { + private function getSizeByFixedWidth($newWidth, $newHeight) { + // *** If forcing is off... + if (!$this->forceStretch) { - // *** ...check if actual width is less than target width - if ($this->width < $newWidth) - { - return array( 'optimalWidth' => $this->width, 'optimalHeight' => $this->height ); - } - } + // *** ...check if actual width is less than target width + if ($this->width < $newWidth) { + return array('optimalWidth' => $this->width, 'optimalHeight' => $this->height); + } + } - $ratio = $this->height / $this->width; + $ratio = $this->height / $this->width; - $newHeight = $newWidth * $ratio; + $newHeight = $newWidth * $ratio; - //return $newHeight; - return array( 'optimalWidth' => $newWidth, 'optimalHeight' => $newHeight ); - } + //return $newHeight; + return array('optimalWidth' => $newWidth, 'optimalHeight' => $newHeight); + } ## -------------------------------------------------------- - private function getSizeByAuto($newWidth, $newHeight) - # Author: Jarrod Oberto - # Date: 19-08-08 - # Purpose: Depending on the height, choose to resize by 0, 1, or 2 - # Param in: The new height and new width - # Notes: - # - { - // *** If forcing is off... - if ( ! $this->forceStretch) - { - - // *** ...check if actual size is less than target size - if ($this->width < $newWidth && $this->height < $newHeight) - { - return array( 'optimalWidth' => $this->width, 'optimalHeight' => $this->height ); - } - } - - if ($this->height < $this->width) - // *** Image to be resized is wider (landscape) - { - //$optimalWidth = $newWidth; - //$optimalHeight= $this->getSizeByFixedWidth($newWidth); - - $dimensionsArray = $this->getSizeByFixedWidth($newWidth, $newHeight); - $optimalWidth = $dimensionsArray['optimalWidth']; - $optimalHeight = $dimensionsArray['optimalHeight']; - } - elseif ($this->height > $this->width) - // *** Image to be resized is taller (portrait) - { - //$optimalWidth = $this->getSizeByFixedHeight($newHeight); - //$optimalHeight= $newHeight; - - $dimensionsArray = $this->getSizeByFixedHeight($newWidth, $newHeight); - $optimalWidth = $dimensionsArray['optimalWidth']; - $optimalHeight = $dimensionsArray['optimalHeight']; - } - else - // *** Image to be resizerd is a square - { - - if ($newHeight < $newWidth) - { - //$optimalWidth = $newWidth; - //$optimalHeight= $this->getSizeByFixedWidth($newWidth); - $dimensionsArray = $this->getSizeByFixedWidth($newWidth, $newHeight); - $optimalWidth = $dimensionsArray['optimalWidth']; - $optimalHeight = $dimensionsArray['optimalHeight']; - } - else - { - if ($newHeight > $newWidth) - { - //$optimalWidth = $this->getSizeByFixedHeight($newHeight); - //$optimalHeight= $newHeight; - $dimensionsArray = $this->getSizeByFixedHeight($newWidth, $newHeight); - $optimalWidth = $dimensionsArray['optimalWidth']; - $optimalHeight = $dimensionsArray['optimalHeight']; - } - else - { - // *** Sqaure being resized to a square - $optimalWidth = $newWidth; - $optimalHeight = $newHeight; - } - } - } - - return array( 'optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight ); - } + private function getSizeByAuto($newWidth, $newHeight) { + # Author: Jarrod Oberto + # Date: 19-08-08 + # Purpose: Depending on the height, choose to resize by 0, 1, or 2 + # Param in: The new height and new width + # Notes:# + // *** If forcing is off... + if (!$this->forceStretch) { + + // *** ...check if actual size is less than target size + if ($this->width < $newWidth && $this->height < $newHeight) { + return array('optimalWidth' => $this->width, 'optimalHeight' => $this->height); + } + } + + if ($this->height < $this->width) { + // *** Image to be resized is wider (landscape) + //$optimalWidth = $newWidth; + //$optimalHeight= $this->getSizeByFixedWidth($newWidth); + + $dimensionsArray = $this->getSizeByFixedWidth($newWidth, $newHeight); + $optimalWidth = $dimensionsArray['optimalWidth']; + $optimalHeight = $dimensionsArray['optimalHeight']; + } elseif ($this->height > $this->width) { + // *** Image to be resized is taller (portrait) + //$optimalWidth = $this->getSizeByFixedHeight($newHeight); + //$optimalHeight= $newHeight; + + $dimensionsArray = $this->getSizeByFixedHeight($newWidth, $newHeight); + $optimalWidth = $dimensionsArray['optimalWidth']; + $optimalHeight = $dimensionsArray['optimalHeight']; + } else { + // *** Image to be resizerd is a square + + if ($newHeight < $newWidth) { + //$optimalWidth = $newWidth; + //$optimalHeight= $this->getSizeByFixedWidth($newWidth); + $dimensionsArray = $this->getSizeByFixedWidth($newWidth, $newHeight); + $optimalWidth = $dimensionsArray['optimalWidth']; + $optimalHeight = $dimensionsArray['optimalHeight']; + } else { + if ($newHeight > $newWidth) { + //$optimalWidth = $this->getSizeByFixedHeight($newHeight); + //$optimalHeight= $newHeight; + $dimensionsArray = $this->getSizeByFixedHeight($newWidth, $newHeight); + $optimalWidth = $dimensionsArray['optimalWidth']; + $optimalHeight = $dimensionsArray['optimalHeight']; + } else { + // *** Sqaure being resized to a square + $optimalWidth = $newWidth; + $optimalHeight = $newHeight; + } + } + } + + return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight); + } ## -------------------------------------------------------- - private function getOptimalCrop($newWidth, $newHeight) - # Author: Jarrod Oberto - # Date: 17-11-09 - # Purpose: Get optimal crop dimensions - # Param in: width and height as requested by user (fig 3) - # Param out: Array of optimal width and height (fig 2) - # Reference: - # Notes: The optimal width and height return are not the same as the - # same as the width and height passed in. For example: - # + private function getOptimalCrop($newWidth, $newHeight) { + # Author: Jarrod Oberto + # Date: 17-11-09 + # Purpose: Get optimal crop dimensions + # Param in: width and height as requested by user (fig 3) + # Param out: Array of optimal width and height (fig 2) + # Reference: + # Notes: The optimal width and height return are not the same as the + # same as the width and height passed in. For example: + # # # |-----------------| |------------| |-------| - # | | => |**| |**| => | | - # | | |**| |**| | | - # | | |------------| |-------| - # |-----------------| - # original optimal crop - # size size size - # Fig 1 2 3 - # + # | | => |**| |**| => | | + # | | |**| |**| | | + # | | |------------| |-------| + # |-----------------| + # original optimal crop + # size size size + # Fig 1 2 3 + # # 300 x 250 150 x 125 150 x 100 - # + # # The optimal size is the smallest size (that is closest to the crop size) - # while retaining proportion/ratio. - # + # while retaining proportion/ratio. + # # The crop size is the optimal size that has been cropped on one axis to - # make the image the exact size specified by the user. - # - # * represent cropped area - # - { - - // *** If forcing is off... - if ( ! $this->forceStretch) - { + # make the image the exact size specified by the user. + # + # * represent cropped area# + // *** If forcing is off... + if (!$this->forceStretch) { - // *** ...check if actual size is less than target size - if ($this->width < $newWidth && $this->height < $newHeight) - { - return array( 'optimalWidth' => $this->width, 'optimalHeight' => $this->height ); - } - } + // *** ...check if actual size is less than target size + if ($this->width < $newWidth && $this->height < $newHeight) { + return array('optimalWidth' => $this->width, 'optimalHeight' => $this->height); + } + } - $heightRatio = $this->height / $newHeight; - $widthRatio = $this->width / $newWidth; + $heightRatio = $this->height / $newHeight; + $widthRatio = $this->width / $newWidth; - if ($heightRatio < $widthRatio) - { - $optimalRatio = $heightRatio; - } - else - { - $optimalRatio = $widthRatio; - } + if ($heightRatio < $widthRatio) { + $optimalRatio = $heightRatio; + } else { + $optimalRatio = $widthRatio; + } - $optimalHeight = round($this->height / $optimalRatio); - $optimalWidth = round($this->width / $optimalRatio); + $optimalHeight = round($this->height / $optimalRatio); + $optimalWidth = round($this->width / $optimalRatio); - return array( 'optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight ); - } + return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight); + } ## -------------------------------------------------------- - private function sharpen() - # Author: Jarrod Oberto - # Date: 08 04 2011 - # Purpose: Sharpen image - # Param in: n/a - # Param out: n/a - # Reference: - # Notes: - # Credit: Incorporates Joe Lencioni (August 6, 2008) code - { - - if (version_compare(PHP_VERSION, '5.1.0') >= 0) - { - - // *** - if ($this->aggresiveSharpening) - { # A more aggressive sharpening solution - - $sharpenMatrix = array( array( -1, -1, -1 ), - array( -1, 16, -1 ), - array( -1, -1, -1 ) ); - $divisor = 8; - $offset = 0; - - imageconvolution($this->imageResized, $sharpenMatrix, $divisor, $offset); - } - else # More subtle and personally more desirable - { - $sharpness = $this->findSharp($this->widthOriginal, $this->width); - - $sharpenMatrix = array( - array( -1, -2, -1 ), - array( -2, $sharpness + 12, -2 ), //Lessen the effect of a filter by increasing the value in the center cell - array( -1, -2, -1 ) - ); - $divisor = $sharpness; // adjusts brightness - $offset = 0; - imageconvolution($this->imageResized, $sharpenMatrix, $divisor, $offset); - } - } - else - { - if ($this->debug) - { - throw new Exception('Sharpening required PHP 5.1.0 or greater.'); - } - } - } - - ## -------------------------------------------------------- - - private function sharpen2($level) - { - $sharpenMatrix = array( - array( $level, $level, $level ), - array( $level, (8 * $level) + 1, $level ), //Lessen the effect of a filter by increasing the value in the center cell - array( $level, $level, $level ) - ); - - } + private function sharpen() { + # Author: Jarrod Oberto + # Date: 08 04 2011 + # Purpose: Sharpen image + # Param in: n/a + # Param out: n/a + # Reference: + # Notes: + # Credit: Incorporates Joe Lencioni (August 6, 2008) code + + if (version_compare(PHP_VERSION, '5.1.0') >= 0) { + + // *** + if ($this->aggresiveSharpening) { # A more aggressive sharpening solution + $sharpenMatrix = array(array(-1, -1, -1), + array(-1, 16, -1), + array(-1, -1, -1)); + $divisor = 8; + $offset = 0; + + imageconvolution($this->imageResized, $sharpenMatrix, $divisor, $offset); + } else { # More subtle and personally more desirable + $sharpness = $this->findSharp($this->widthOriginal, $this->width); + + $sharpenMatrix = array( + array(-1, -2, -1), + array(-2, $sharpness + 12, -2), //Lessen the effect of a filter by increasing the value in the center cell + array(-1, -2, -1) + ); + $divisor = $sharpness; // adjusts brightness + $offset = 0; + imageconvolution($this->imageResized, $sharpenMatrix, $divisor, $offset); + } + } else { + if ($this->debug) { + throw new Exception('Sharpening required PHP 5.1.0 or greater.'); + } + } + } + + ## -------------------------------------------------------- + + private function sharpen2($level) { + $sharpenMatrix = array( + array($level, $level, $level), + array($level, (8 * $level) + 1, $level), //Lessen the effect of a filter by increasing the value in the center cell + array($level, $level, $level) + ); + } ## -------------------------------------------------------- - private function findSharp($orig, $final) - # Author: Ryan Rud (http://adryrun.com) - # Purpose: Find optimal sharpness - # Param in: n/a - # Param out: n/a - # Reference: - # Notes: - # - { - $final = $final * (750.0 / $orig); - $a = 52; - $b = -0.27810650887573124; - $c = .00047337278106508946; + private function findSharp($orig, $final) { + # Author: Ryan Rud (http://adryrun.com) + # Purpose: Find optimal sharpness + # Param in: n/a + # Param out: n/a + # Reference: + # Notes:# + + $final = $final * (750.0 / $orig); + $a = 52; + $b = -0.27810650887573124; + $c = .00047337278106508946; - $result = $a + $b * $final + $c * $final * $final; + $result = $a + $b * $final + $c * $final * $final; - return max(round($result), 0); - } + return max(round($result), 0); + } ## -------------------------------------------------------- - private function prepOption($option) - # Author: Jarrod Oberto - # Purpose: Prep option like change the passed in option to lowercase - # Param in: (str/int) $option: eg. 'exact', 'crop'. 0, 4 - # Param out: lowercase string - # Reference: - # Notes: - # - { - if (is_array($option)) - { - if (fix_strtolower($option[0]) == 'crop' && count($option) == 2) - { - return 'crop'; - } - else - { - throw new Exception('Crop resize option array is badly formatted.'); - } - } - else - { - if (strpos($option, 'crop') !== false) - { - return 'crop'; - } - } - - if (is_string($option)) - { - return fix_strtolower($option); - } - - return $option; - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Presets -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ + private function prepOption($option) { + # Author: Jarrod Oberto + # Purpose: Prep option like change the passed in option to lowercase + # Param in: (str/int) $option: eg. 'exact', 'crop'. 0, 4 + # Param out: lowercase string + # Reference: + # Notes:# + + if (is_array($option)) { + if (fix_strtolower($option[0]) == 'crop' && count($option) == 2) { + return 'crop'; + } else { + throw new Exception('Crop resize option array is badly formatted.'); + } + } else { + if (strpos($option, 'crop') !== false) { + return 'crop'; + } + } + + if (is_string($option)) { + return fix_strtolower($option); + } + + return $option; + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Presets + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ # # Preset are pre-defined templates you can apply to your image. @@ -980,2753 +860,2347 @@ private function prepOption($option) # These are inteded to be applied to thumbnail images. # - - public function borderPreset($preset) - { - switch ($preset) - { - - case 'simple': - $this->addBorder(7, '#fff'); - $this->addBorder(6, '#f2f1f0'); - $this->addBorder(2, '#fff'); - $this->addBorder(1, '#ccc'); - break; - default: - break; - } - - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Draw border -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - public function addBorder($thickness = 1, $rgbArray = array( 255, 255, 255 )) - # Author: Jarrod Oberto - # Date: 05-05-11 - # Purpose: Add a border to the image - # Param in: - # Param out: - # Reference: - # Notes: This border is added to the INSIDE of the image - # - { - if ($this->imageResized) - { - - $rgbArray = $this->formatColor($rgbArray); - $r = $rgbArray['r']; - $g = $rgbArray['g']; - $b = $rgbArray['b']; - - - $x1 = 0; - $y1 = 0; - $x2 = ImageSX($this->imageResized) - 1; - $y2 = ImageSY($this->imageResized) - 1; - - $rgbArray = ImageColorAllocate($this->imageResized, $r, $g, $b); - - - for ($i = 0; $i < $thickness; $i++) - { - ImageRectangle($this->imageResized, $x1++, $y1++, $x2--, $y2--, $rgbArray); - } - } - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Gray Scale -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - public function greyScale() - # Author: Jarrod Oberto - # Date: 07-05-2011 - # Purpose: Make image greyscale - # Param in: n/a - # Param out: - # Reference: - # Notes: - # - { - if ($this->imageResized) - { - imagefilter($this->imageResized, IMG_FILTER_GRAYSCALE); - } - - } - - ## -------------------------------------------------------- - - public function greyScaleEnhanced() - # Author: Jarrod Oberto - # Date: 07-05-2011 - # Purpose: Make image greyscale - # Param in: n/a - # Param out: - # Reference: - # Notes: - # - { - if ($this->imageResized) - { - imagefilter($this->imageResized, IMG_FILTER_GRAYSCALE); - imagefilter($this->imageResized, IMG_FILTER_CONTRAST, -15); - imagefilter($this->imageResized, IMG_FILTER_BRIGHTNESS, 2); - $this->sharpen($this->width); - } - } - - ## -------------------------------------------------------- - - public function greyScaleDramatic() - # Alias of gd_filter_monopin - { - $this->gd_filter_monopin(); - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Black 'n White -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - public function blackAndWhite() - # Author: Jarrod Oberto - # Date: 07-05-2011 - # Purpose: Make image black and white - # Param in: n/a - # Param out: - # Reference: - # Notes: - # - { - if ($this->imageResized) - { - - imagefilter($this->imageResized, IMG_FILTER_GRAYSCALE); - imagefilter($this->imageResized, IMG_FILTER_CONTRAST, -1000); - } - - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Negative -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - public function negative() - # Author: Jarrod Oberto - # Date: 07-05-2011 - # Purpose: Make image negative - # Param in: n/a - # Param out: - # Reference: - # Notes: - # - { - if ($this->imageResized) - { - - imagefilter($this->imageResized, IMG_FILTER_NEGATE); - } - - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Sepia -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - public function sepia() - # Author: Jarrod Oberto - # Date: 07-05-2011 - # Purpose: Make image sepia - # Param in: n/a - # Param out: - # Reference: - # Notes: - # - { - if ($this->imageResized) - { - imagefilter($this->imageResized, IMG_FILTER_GRAYSCALE); - imagefilter($this->imageResized, IMG_FILTER_BRIGHTNESS, -10); - imagefilter($this->imageResized, IMG_FILTER_CONTRAST, -20); - imagefilter($this->imageResized, IMG_FILTER_COLORIZE, 60, 30, -15); - } - } - - ## -------------------------------------------------------- - - public function sepia2() - - { - if ($this->imageResized) - { - - $total = imagecolorstotal($this->imageResized); - for ($i = 0; $i < $total; $i++) - { - $index = imagecolorsforindex($this->imageResized, $i); - $red = ($index["red"] * 0.393 + $index["green"] * 0.769 + $index["blue"] * 0.189) / 1.351; - $green = ($index["red"] * 0.349 + $index["green"] * 0.686 + $index["blue"] * 0.168) / 1.203; - $blue = ($index["red"] * 0.272 + $index["green"] * 0.534 + $index["blue"] * 0.131) / 2.140; - imagecolorset($this->imageResized, $i, $red, $green, $blue); - } - - - } - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Vintage -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - public function vintage() - # Alias of gd_filter_monopin - { - $this->gd_filter_vintage(); - } - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Presets By Marc Hibbins -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - - /** Apply 'Monopin' preset */ - public function gd_filter_monopin() - { - - if ($this->imageResized) - { - imagefilter($this->imageResized, IMG_FILTER_GRAYSCALE); - imagefilter($this->imageResized, IMG_FILTER_BRIGHTNESS, -15); - imagefilter($this->imageResized, IMG_FILTER_CONTRAST, -15); - $this->imageResized = $this->gd_apply_overlay($this->imageResized, 'vignette', 100); - } - } - - ## -------------------------------------------------------- - - public function gd_filter_vintage() - { - if ($this->imageResized) - { - $this->imageResized = $this->gd_apply_overlay($this->imageResized, 'vignette', 45); - imagefilter($this->imageResized, IMG_FILTER_BRIGHTNESS, 20); - imagefilter($this->imageResized, IMG_FILTER_CONTRAST, -35); - imagefilter($this->imageResized, IMG_FILTER_COLORIZE, 60, -10, 35); - imagefilter($this->imageResized, IMG_FILTER_SMOOTH, 7); - $this->imageResized = $this->gd_apply_overlay($this->imageResized, 'scratch', 10); - } - } - - ## -------------------------------------------------------- - - /** Apply a PNG overlay */ - private function gd_apply_overlay($im, $type, $amount) - # - # Original Author: Marc Hibbins - # License: Attribution-ShareAlike 3.0 - # Purpose: - # Params in: - # Params out: - # Notes: - # - { - $width = imagesx($im); - $height = imagesy($im); - $filter = imagecreatetruecolor($width, $height); - - imagealphablending($filter, false); - imagesavealpha($filter, true); - - $transparent = imagecolorallocatealpha($filter, 255, 255, 255, 127); - imagefilledrectangle($filter, 0, 0, $width, $height, $transparent); - - // *** Resize overlay - $overlay = $this->filterOverlayPath . '/' . $type . '.png'; - $png = imagecreatefrompng($overlay); - imagecopyresampled($filter, $png, 0, 0, 0, 0, $width, $height, imagesx($png), imagesy($png)); - - $comp = imagecreatetruecolor($width, $height); - imagecopy($comp, $im, 0, 0, 0, 0, $width, $height); - imagecopy($comp, $filter, 0, 0, 0, 0, $width, $height); - imagecopymerge($im, $comp, 0, 0, 0, 0, $width, $height, $amount); - - imagedestroy($comp); - - return $im; - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Colorise -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - public function image_colorize($rgb) - { - imageTrueColorToPalette($this->imageResized, true, 256); - $numColors = imageColorsTotal($this->imageResized); - - for ($x = 0; $x < $numColors; $x++) - { - list($r, $g, $b) = array_values(imageColorsForIndex($this->imageResized, $x)); - - // calculate grayscale in percent - $grayscale = ($r + $g + $b) / 3 / 0xff; - - imageColorSet($this->imageResized, $x, - $grayscale * $rgb[0], - $grayscale * $rgb[1], - $grayscale * $rgb[2] - ); - - } - - return true; - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Reflection -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - public function addReflection($reflectionHeight = 50, $startingTransparency = 30, $inside = false, $bgColor = '#fff', $stretch = false, $divider = 0) - { - - // *** Convert color - $rgbArray = $this->formatColor($bgColor); - $r = $rgbArray['r']; - $g = $rgbArray['g']; - $b = $rgbArray['b']; - - $im = $this->imageResized; - $li = imagecreatetruecolor($this->width, 1); - - $bgc = imagecolorallocate($li, $r, $g, $b); - imagefilledrectangle($li, 0, 0, $this->width, 1, $bgc); - - $bg = imagecreatetruecolor($this->width, $reflectionHeight); - $wh = imagecolorallocate($im, 255, 255, 255); - - $im = imagerotate($im, -180, $wh); - imagecopyresampled($bg, $im, 0, 0, 0, 0, $this->width, $this->height, $this->width, $this->height); - - $im = $bg; - - $bg = imagecreatetruecolor($this->width, $reflectionHeight); - - for ($x = 0; $x < $this->width; $x++) - { - imagecopy($bg, $im, $x, 0, $this->width - $x - 1, 0, 1, $reflectionHeight); - } - $im = $bg; - - $transaprencyAmount = $this->invertTransparency($startingTransparency, 100); - - - // *** Fade - if ($stretch) - { - $step = 100 / ($reflectionHeight + $startingTransparency); - } - else - { - $step = 100 / $reflectionHeight; - } - for ($i = 0; $i <= $reflectionHeight; $i++) - { - - if ($startingTransparency > 100) - { - $startingTransparency = 100; - } - if ($startingTransparency < 1) - { - $startingTransparency = 1; - } - imagecopymerge($bg, $li, 0, $i, 0, 0, $this->width, 1, $startingTransparency); - $startingTransparency += $step; - } - - // *** Apply fade - imagecopymerge($im, $li, 0, 0, 0, 0, $this->width, $divider, 100); // Divider - - - // *** width, height of reflection. - $x = imagesx($im); - $y = imagesy($im); - - - // *** Determines if the reflection should be displayed inside or outside the image - if ($inside) - { - - // Create new blank image with sizes. - $final = imagecreatetruecolor($this->width, $this->height); - - imagecopymerge($final, $this->imageResized, 0, 0, 0, $reflectionHeight, $this->width, $this->height - $reflectionHeight, 100); - imagecopymerge($final, $im, 0, $this->height - $reflectionHeight, 0, 0, $x, $y, 100); - - } - else - { - - // Create new blank image with sizes. - $final = imagecreatetruecolor($this->width, $this->height + $y); - - imagecopymerge($final, $this->imageResized, 0, 0, 0, 0, $this->width, $this->height, 100); - imagecopymerge($final, $im, 0, $this->height, 0, 0, $x, $y, 100); - } - - $this->imageResized = $final; - - imagedestroy($li); - imagedestroy($im); - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Rotate -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - public function rotate($value = 90, $bgColor = 'transparent') - # Author: Jarrod Oberto - # Date: 07-05-2011 - # Purpose: Rotate image - # Param in: (mixed) $degrees: (int) number of degress to rotate image - # (str) param "left": rotate left - # (str) param "right": rotate right - # (str) param "upside": upside-down image - # Param out: - # Reference: - # Notes: The default direction of imageRotate() is counter clockwise. - # - { - if ($this->imageResized) - { - - if (is_integer($value)) - { - $degrees = $value; - } - - // *** Convert color - $rgbArray = $this->formatColor($bgColor); - $r = $rgbArray['r']; - $g = $rgbArray['g']; - $b = $rgbArray['b']; - if (isset($rgbArray['a'])) - { - $a = $rgbArray['a']; - } - - if (is_string($value)) - { - - $value = fix_strtolower($value); - - switch ($value) - { - case 'left': - $degrees = 90; - break; - case 'right': - $degrees = 270; - break; - case 'upside': - $degrees = 180; - break; - default: - break; - } - - } - - // *** The default direction of imageRotate() is counter clockwise - // * This makes it clockwise - $degrees = 360 - $degrees; - - // *** Create background color - $bg = ImageColorAllocateAlpha($this->imageResized, $r, $g, $b, $a); - - // *** Fill with background - ImageFill($this->imageResized, 0, 0, $bg); - - // *** Rotate - $this->imageResized = imagerotate($this->imageResized, $degrees, $bg); // Rotate 45 degrees and allocated the transparent colour as the one to make transparent (obviously) - - // Ensure alpha transparency - ImageSaveAlpha($this->imageResized, true); - - } - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Round corners -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - public function roundCorners($radius = 5, $bgColor = 'transparent') - # Author: Jarrod Oberto - # Date: 19-05-2011 - # Purpose: Create rounded corners on your image - # Param in: (int) radius = the amount of curvature - # (mixed) $bgColor = the corner background color - # Param out: n/a - # Reference: - # Notes: - # - { - - // *** Check if the user wants transparency - $isTransparent = false; - if ( ! is_array($bgColor)) - { - if (fix_strtolower($bgColor) == 'transparent') - { - $isTransparent = true; - } - } + public function borderPreset($preset) { + switch ($preset) { + + case 'simple': + $this->addBorder(7, '#fff'); + $this->addBorder(6, '#f2f1f0'); + $this->addBorder(2, '#fff'); + $this->addBorder(1, '#ccc'); + break; + default: + break; + } + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Draw border + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + public function addBorder($thickness = 1, $rgbArray = array(255, 255, 255)) { + # Author: Jarrod Oberto + # Date: 05-05-11 + # Purpose: Add a border to the image + # Param in: + # Param out: + # Reference: + # Notes: This border is added to the INSIDE of the image# + + if ($this->imageResized) { + + $rgbArray = $this->formatColor($rgbArray); + $r = $rgbArray['r']; + $g = $rgbArray['g']; + $b = $rgbArray['b']; + + + $x1 = 0; + $y1 = 0; + $x2 = ImageSX($this->imageResized) - 1; + $y2 = ImageSY($this->imageResized) - 1; + + $rgbArray = ImageColorAllocate($this->imageResized, $r, $g, $b); + + + for ($i = 0; $i < $thickness; $i++) { + ImageRectangle($this->imageResized, $x1++, $y1++, $x2--, $y2--, $rgbArray); + } + } + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Gray Scale + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + public function greyScale() { + # Author: Jarrod Oberto + # Date: 07-05-2011 + # Purpose: Make image greyscale + # Param in: n/a + # Param out: + # Reference: + # Notes:# + + if ($this->imageResized) { + imagefilter($this->imageResized, IMG_FILTER_GRAYSCALE); + } + } + + ## -------------------------------------------------------- + + public function greyScaleEnhanced() { + # Author: Jarrod Oberto + # Date: 07-05-2011 + # Purpose: Make image greyscale + # Param in: n/a + # Param out: + # Reference: + # Notes:# + + if ($this->imageResized) { + imagefilter($this->imageResized, IMG_FILTER_GRAYSCALE); + imagefilter($this->imageResized, IMG_FILTER_CONTRAST, -15); + imagefilter($this->imageResized, IMG_FILTER_BRIGHTNESS, 2); + $this->sharpen($this->width); + } + } + + ## -------------------------------------------------------- + + public function greyScaleDramatic() { + # Alias of gd_filter_monopin + $this->gd_filter_monopin(); + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Black 'n White + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + public function blackAndWhite() { + # Author: Jarrod Oberto + # Date: 07-05-2011 + # Purpose: Make image black and white + # Param in: n/a + # Param out: + # Reference: + # Notes:# + + if ($this->imageResized) { + + imagefilter($this->imageResized, IMG_FILTER_GRAYSCALE); + imagefilter($this->imageResized, IMG_FILTER_CONTRAST, -1000); + } + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Negative + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + public function negative() { + # Author: Jarrod Oberto + # Date: 07-05-2011 + # Purpose: Make image negative + # Param in: n/a + # Param out: + # Reference: + # Notes:# + + if ($this->imageResized) { + + imagefilter($this->imageResized, IMG_FILTER_NEGATE); + } + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Sepia + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + public function sepia() { + # Author: Jarrod Oberto + # Date: 07-05-2011 + # Purpose: Make image sepia + # Param in: n/a + # Param out: + # Reference: + # Notes:# + + if ($this->imageResized) { + imagefilter($this->imageResized, IMG_FILTER_GRAYSCALE); + imagefilter($this->imageResized, IMG_FILTER_BRIGHTNESS, -10); + imagefilter($this->imageResized, IMG_FILTER_CONTRAST, -20); + imagefilter($this->imageResized, IMG_FILTER_COLORIZE, 60, 30, -15); + } + } + + ## -------------------------------------------------------- + + public function sepia2() { + if ($this->imageResized) { + + $total = imagecolorstotal($this->imageResized); + for ($i = 0; $i < $total; $i++) { + $index = imagecolorsforindex($this->imageResized, $i); + $red = ($index["red"] * 0.393 + $index["green"] * 0.769 + $index["blue"] * 0.189) / 1.351; + $green = ($index["red"] * 0.349 + $index["green"] * 0.686 + $index["blue"] * 0.168) / 1.203; + $blue = ($index["red"] * 0.272 + $index["green"] * 0.534 + $index["blue"] * 0.131) / 2.140; + imagecolorset($this->imageResized, $i, $red, $green, $blue); + } + } + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Vintage + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + public function vintage() { + # Alias of gd_filter_monopin + $this->gd_filter_vintage(); + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Presets By Marc Hibbins + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + /** Apply 'Monopin' preset */ + public function gd_filter_monopin() { + + if ($this->imageResized) { + imagefilter($this->imageResized, IMG_FILTER_GRAYSCALE); + imagefilter($this->imageResized, IMG_FILTER_BRIGHTNESS, -15); + imagefilter($this->imageResized, IMG_FILTER_CONTRAST, -15); + $this->imageResized = $this->gd_apply_overlay($this->imageResized, 'vignette', 100); + } + } + + ## -------------------------------------------------------- + + public function gd_filter_vintage() { + if ($this->imageResized) { + $this->imageResized = $this->gd_apply_overlay($this->imageResized, 'vignette', 45); + imagefilter($this->imageResized, IMG_FILTER_BRIGHTNESS, 20); + imagefilter($this->imageResized, IMG_FILTER_CONTRAST, -35); + imagefilter($this->imageResized, IMG_FILTER_COLORIZE, 60, -10, 35); + imagefilter($this->imageResized, IMG_FILTER_SMOOTH, 7); + $this->imageResized = $this->gd_apply_overlay($this->imageResized, 'scratch', 10); + } + } + + ## -------------------------------------------------------- + + /** Apply a PNG overlay */ + private function gd_apply_overlay($im, $type, $amount) { + # + # Original Author: Marc Hibbins + # License: Attribution-ShareAlike 3.0 + # Purpose: + # Params in: + # Params out: + # Notes:# + + $width = imagesx($im); + $height = imagesy($im); + $filter = imagecreatetruecolor($width, $height); + + imagealphablending($filter, false); + imagesavealpha($filter, true); + + $transparent = imagecolorallocatealpha($filter, 255, 255, 255, 127); + imagefilledrectangle($filter, 0, 0, $width, $height, $transparent); + + // *** Resize overlay + $overlay = $this->filterOverlayPath . '/' . $type . '.png'; + $png = imagecreatefrompng($overlay); + imagecopyresampled($filter, $png, 0, 0, 0, 0, $width, $height, imagesx($png), imagesy($png)); + + $comp = imagecreatetruecolor($width, $height); + imagecopy($comp, $im, 0, 0, 0, 0, $width, $height); + imagecopy($comp, $filter, 0, 0, 0, 0, $width, $height); + imagecopymerge($im, $comp, 0, 0, 0, 0, $width, $height, $amount); + + imagedestroy($comp); + + return $im; + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Colorise + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + public function image_colorize($rgb) { + imageTrueColorToPalette($this->imageResized, true, 256); + $numColors = imageColorsTotal($this->imageResized); + + for ($x = 0; $x < $numColors; $x++) { + list($r, $g, $b) = array_values(imageColorsForIndex($this->imageResized, $x)); + + // calculate grayscale in percent + $grayscale = ($r + $g + $b) / 3 / 0xff; + + imageColorSet($this->imageResized, $x, $grayscale * $rgb[0], $grayscale * $rgb[1], $grayscale * $rgb[2] + ); + } + + return true; + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Reflection + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + public function addReflection($reflectionHeight = 50, $startingTransparency = 30, $inside = false, $bgColor = '#fff', $stretch = false, $divider = 0) { + + // *** Convert color + $rgbArray = $this->formatColor($bgColor); + $r = $rgbArray['r']; + $g = $rgbArray['g']; + $b = $rgbArray['b']; + + $im = $this->imageResized; + $li = imagecreatetruecolor($this->width, 1); + + $bgc = imagecolorallocate($li, $r, $g, $b); + imagefilledrectangle($li, 0, 0, $this->width, 1, $bgc); + + $bg = imagecreatetruecolor($this->width, $reflectionHeight); + $wh = imagecolorallocate($im, 255, 255, 255); + + $im = imagerotate($im, -180, $wh); + imagecopyresampled($bg, $im, 0, 0, 0, 0, $this->width, $this->height, $this->width, $this->height); + + $im = $bg; + + $bg = imagecreatetruecolor($this->width, $reflectionHeight); + + for ($x = 0; $x < $this->width; $x++) { + imagecopy($bg, $im, $x, 0, $this->width - $x - 1, 0, 1, $reflectionHeight); + } + $im = $bg; + + $transaprencyAmount = $this->invertTransparency($startingTransparency, 100); + + + // *** Fade + if ($stretch) { + $step = 100 / ($reflectionHeight + $startingTransparency); + } else { + $step = 100 / $reflectionHeight; + } + for ($i = 0; $i <= $reflectionHeight; $i++) { + + if ($startingTransparency > 100) { + $startingTransparency = 100; + } + if ($startingTransparency < 1) { + $startingTransparency = 1; + } + imagecopymerge($bg, $li, 0, $i, 0, 0, $this->width, 1, $startingTransparency); + $startingTransparency += $step; + } + + // *** Apply fade + imagecopymerge($im, $li, 0, 0, 0, 0, $this->width, $divider, 100); // Divider + // *** width, height of reflection. + $x = imagesx($im); + $y = imagesy($im); + + + // *** Determines if the reflection should be displayed inside or outside the image + if ($inside) { + + // Create new blank image with sizes. + $final = imagecreatetruecolor($this->width, $this->height); + + imagecopymerge($final, $this->imageResized, 0, 0, 0, $reflectionHeight, $this->width, $this->height - $reflectionHeight, 100); + imagecopymerge($final, $im, 0, $this->height - $reflectionHeight, 0, 0, $x, $y, 100); + } else { + + // Create new blank image with sizes. + $final = imagecreatetruecolor($this->width, $this->height + $y); + + imagecopymerge($final, $this->imageResized, 0, 0, 0, 0, $this->width, $this->height, 100); + imagecopymerge($final, $im, 0, $this->height, 0, 0, $x, $y, 100); + } + + $this->imageResized = $final; + + imagedestroy($li); + imagedestroy($im); + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Rotate + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + public function rotate($value = 90, $bgColor = 'transparent') { + # Author: Jarrod Oberto + # Date: 07-05-2011 + # Purpose: Rotate image + # Param in: (mixed) $degrees: (int) number of degress to rotate image + # (str) param "left": rotate left + # (str) param "right": rotate right + # (str) param "upside": upside-down image + # Param out: + # Reference: + # Notes: The default direction of imageRotate() is counter clockwise.# + + if ($this->imageResized) { + + if (is_integer($value)) { + $degrees = $value; + } + + // *** Convert color + $rgbArray = $this->formatColor($bgColor); + $r = $rgbArray['r']; + $g = $rgbArray['g']; + $b = $rgbArray['b']; + if (isset($rgbArray['a'])) { + $a = $rgbArray['a']; + } + + if (is_string($value)) { + + $value = fix_strtolower($value); + + switch ($value) { + case 'left': + $degrees = 90; + break; + case 'right': + $degrees = 270; + break; + case 'upside': + $degrees = 180; + break; + default: + break; + } + } + + // *** The default direction of imageRotate() is counter clockwise + // * This makes it clockwise + $degrees = 360 - $degrees; + + // *** Create background color + $bg = ImageColorAllocateAlpha($this->imageResized, $r, $g, $b, $a); + + // *** Fill with background + ImageFill($this->imageResized, 0, 0, $bg); + + // *** Rotate + $this->imageResized = imagerotate($this->imageResized, $degrees, $bg); // Rotate 45 degrees and allocated the transparent colour as the one to make transparent (obviously) + // Ensure alpha transparency + ImageSaveAlpha($this->imageResized, true); + } + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Round corners + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + public function roundCorners($radius = 5, $bgColor = 'transparent') { + # Author: Jarrod Oberto + # Date: 19-05-2011 + # Purpose: Create rounded corners on your image + # Param in: (int) radius = the amount of curvature + # (mixed) $bgColor = the corner background color + # Param out: n/a + # Reference: + # Notes:# + // *** Check if the user wants transparency + $isTransparent = false; + if (!is_array($bgColor)) { + if (fix_strtolower($bgColor) == 'transparent') { + $isTransparent = true; + } + } + + + // *** If we use transparency, we need to color our curved mask with a unique color + if ($isTransparent) { + $bgColor = $this->findUnusedGreen(); + } + + // *** Convert color + $rgbArray = $this->formatColor($bgColor); + $r = $rgbArray['r']; + $g = $rgbArray['g']; + $b = $rgbArray['b']; + if (isset($rgbArray['a'])) { + $a = $rgbArray['a']; + } + + + // *** Create top-left corner mask (square) + $cornerImg = imagecreatetruecolor($radius, $radius); + //$cornerImg = imagecreate($radius, $radius); + //imagealphablending($cornerImg, true); + //imagesavealpha($cornerImg, true); + //imagealphablending($this->imageResized, false); + //imagesavealpha($this->imageResized, true); + // *** Give it a color + $maskColor = imagecolorallocate($cornerImg, 0, 0, 0); + + + // *** Replace the mask color (black) to transparent + imagecolortransparent($cornerImg, $maskColor); + + + // *** Create the image background color + $imagebgColor = imagecolorallocate($cornerImg, $r, $g, $b); + + + // *** Fill the corner area to the user defined color + imagefill($cornerImg, 0, 0, $imagebgColor); + + + imagefilledellipse($cornerImg, $radius, $radius, $radius * 2, $radius * 2, $maskColor); + + + // *** Map to top left corner + imagecopymerge($this->imageResized, $cornerImg, 0, 0, 0, 0, $radius, $radius, 100); #tl + // *** Map rounded corner to other corners by rotating and applying the mask + $cornerImg = imagerotate($cornerImg, 90, 0); + imagecopymerge($this->imageResized, $cornerImg, 0, $this->height - $radius, 0, 0, $radius, $radius, 100); #bl + + $cornerImg = imagerotate($cornerImg, 90, 0); + imagecopymerge($this->imageResized, $cornerImg, $this->width - $radius, $this->height - $radius, 0, 0, $radius, $radius, 100); #br + + $cornerImg = imagerotate($cornerImg, 90, 0); + imagecopymerge($this->imageResized, $cornerImg, $this->width - $radius, 0, 0, 0, $radius, $radius, 100); #tr + // *** If corners are to be transparent, we fill our chromakey color as transparent. + if ($isTransparent) { + //imagecolortransparent($this->imageResized, $imagebgColor); + $this->imageResized = $this->transparentImage($this->imageResized); + imagesavealpha($this->imageResized, true); + } + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Shadow + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + public function addShadow($shadowAngle = 45, $blur = 15, $bgColor = 'transparent') { + # + # Author: Jarrod Oberto (Adapted from Pascal Naidon) + # Ref: http://www.les-stooges.org/pascal/webdesign/vignettes/index.php?la=en + # Purpose: Add a drop shadow to your image + # Params in: (int) $angle: the angle of the shadow + # (int) $blur: the blur distance + # (mixed) $bgColor: the color of the background + # Params out: + # Notes:# + // *** A higher number results in a smoother shadow + define('STEPS', $blur * 2); + + // *** Set the shadow distance + $shadowDistance = $blur * 0.25; + + // *** Set blur width and height + $blurWidth = $blurHeight = $blur; + + + if ($shadowAngle == 0) { + $distWidth = 0; + $distHeight = 0; + } else { + $distWidth = $shadowDistance * cos(deg2rad($shadowAngle)); + $distHeight = $shadowDistance * sin(deg2rad($shadowAngle)); + } + + + // *** Convert color + if (fix_strtolower($bgColor) != 'transparent') { + $rgbArray = $this->formatColor($bgColor); + $r0 = $rgbArray['r']; + $g0 = $rgbArray['g']; + $b0 = $rgbArray['b']; + } - // *** If we use transparency, we need to color our curved mask with a unique color - if ($isTransparent) - { - $bgColor = $this->findUnusedGreen(); - } + $image = $this->imageResized; + $width = $this->width; + $height = $this->height; - // *** Convert color - $rgbArray = $this->formatColor($bgColor); - $r = $rgbArray['r']; - $g = $rgbArray['g']; - $b = $rgbArray['b']; - if (isset($rgbArray['a'])) - { - $a = $rgbArray['a']; - } + $newImage = imagecreatetruecolor($width, $height); + imagecopyresampled($newImage, $image, 0, 0, 0, 0, $width, $height, $width, $height); - // *** Create top-left corner mask (square) - $cornerImg = imagecreatetruecolor($radius, $radius); - //$cornerImg = imagecreate($radius, $radius); - //imagealphablending($cornerImg, true); - //imagesavealpha($cornerImg, true); - - //imagealphablending($this->imageResized, false); - //imagesavealpha($this->imageResized, true); - - // *** Give it a color - $maskColor = imagecolorallocate($cornerImg, 0, 0, 0); - - - // *** Replace the mask color (black) to transparent - imagecolortransparent($cornerImg, $maskColor); - - - // *** Create the image background color - $imagebgColor = imagecolorallocate($cornerImg, $r, $g, $b); - - - // *** Fill the corner area to the user defined color - imagefill($cornerImg, 0, 0, $imagebgColor); - - - imagefilledellipse($cornerImg, $radius, $radius, $radius * 2, $radius * 2, $maskColor); - - - // *** Map to top left corner - imagecopymerge($this->imageResized, $cornerImg, 0, 0, 0, 0, $radius, $radius, 100); #tl - - // *** Map rounded corner to other corners by rotating and applying the mask - $cornerImg = imagerotate($cornerImg, 90, 0); - imagecopymerge($this->imageResized, $cornerImg, 0, $this->height - $radius, 0, 0, $radius, $radius, 100); #bl - - $cornerImg = imagerotate($cornerImg, 90, 0); - imagecopymerge($this->imageResized, $cornerImg, $this->width - $radius, $this->height - $radius, 0, 0, $radius, $radius, 100); #br - - $cornerImg = imagerotate($cornerImg, 90, 0); - imagecopymerge($this->imageResized, $cornerImg, $this->width - $radius, 0, 0, 0, $radius, $radius, 100); #tr - - - // *** If corners are to be transparent, we fill our chromakey color as transparent. - if ($isTransparent) - { - //imagecolortransparent($this->imageResized, $imagebgColor); - $this->imageResized = $this->transparentImage($this->imageResized); - imagesavealpha($this->imageResized, true); - } - - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Shadow -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - public function addShadow($shadowAngle = 45, $blur = 15, $bgColor = 'transparent') - # - # Author: Jarrod Oberto (Adapted from Pascal Naidon) - # Ref: http://www.les-stooges.org/pascal/webdesign/vignettes/index.php?la=en - # Purpose: Add a drop shadow to your image - # Params in: (int) $angle: the angle of the shadow - # (int) $blur: the blur distance - # (mixed) $bgColor: the color of the background - # Params out: - # Notes: - # - { - // *** A higher number results in a smoother shadow - define('STEPS', $blur * 2); - - // *** Set the shadow distance - $shadowDistance = $blur * 0.25; - - // *** Set blur width and height - $blurWidth = $blurHeight = $blur; - - - if ($shadowAngle == 0) - { - $distWidth = 0; - $distHeight = 0; - } - else - { - $distWidth = $shadowDistance * cos(deg2rad($shadowAngle)); - $distHeight = $shadowDistance * sin(deg2rad($shadowAngle)); - } - - - // *** Convert color - if (fix_strtolower($bgColor) != 'transparent') - { - $rgbArray = $this->formatColor($bgColor); - $r0 = $rgbArray['r']; - $g0 = $rgbArray['g']; - $b0 = $rgbArray['b']; - } - - - $image = $this->imageResized; - $width = $this->width; - $height = $this->height; - - - $newImage = imagecreatetruecolor($width, $height); - imagecopyresampled($newImage, $image, 0, 0, 0, 0, $width, $height, $width, $height); - - - // *** RGB - $rgb = imagecreatetruecolor($width + $blurWidth, $height + $blurHeight); - $colour = imagecolorallocate($rgb, 0, 0, 0); - imagefilledrectangle($rgb, 0, 0, $width + $blurWidth, $height + $blurHeight, $colour); - $colour = imagecolorallocate($rgb, 255, 255, 255); - //imagefilledrectangle($rgb, $blurWidth*0.5-$distWidth, $blurHeight*0.5-$distHeight, $width+$blurWidth*0.5-$distWidth, $height+$blurWidth*0.5-$distHeight, $colour); - imagefilledrectangle($rgb, $blurWidth * 0.5 - $distWidth, $blurHeight * 0.5 - $distHeight, $width + $blurWidth * 0.5 - $distWidth, $height + $blurWidth * 0.5 - $distHeight, $colour); - //imagecopymerge($rgb, $newImage, 1+$blurWidth*0.5-$distWidth, 1+$blurHeight*0.5-$distHeight, 0,0, $width, $height, 100); - imagecopymerge($rgb, $newImage, $blurWidth * 0.5 - $distWidth, $blurHeight * 0.5 - $distHeight, 0, 0, $width + $blurWidth, $height + $blurHeight, 100); - - - // *** Shadow (alpha) - $shadow = imagecreatetruecolor($width + $blurWidth, $height + $blurHeight); - imagealphablending($shadow, false); - $colour = imagecolorallocate($shadow, 0, 0, 0); - imagefilledrectangle($shadow, 0, 0, $width + $blurWidth, $height + $blurHeight, $colour); - - - for ($i = 0; $i <= STEPS; $i++) - { - - $t = ((1.0 * $i) / STEPS); - $intensity = 255 * $t * $t; - - $colour = imagecolorallocate($shadow, $intensity, $intensity, $intensity); - $points = array( - $blurWidth * $t, $blurHeight, // Point 1 (x, y) - $blurWidth, $blurHeight * $t, // Point 2 (x, y) - $width, $blurHeight * $t, // Point 3 (x, y) - $width + $blurWidth * (1 - $t), $blurHeight, // Point 4 (x, y) - $width + $blurWidth * (1 - $t), $height, // Point 5 (x, y) - $width, $height + $blurHeight * (1 - $t), // Point 6 (x, y) - $blurWidth, $height + $blurHeight * (1 - $t), // Point 7 (x, y) - $blurWidth * $t, $height // Point 8 (x, y) - ); - imagepolygon($shadow, $points, 8, $colour); - } - - for ($i = 0; $i <= STEPS; $i++) - { - - $t = ((1.0 * $i) / STEPS); - $intensity = 255 * $t * $t; - - $colour = imagecolorallocate($shadow, $intensity, $intensity, $intensity); - imagefilledarc($shadow, $blurWidth - 1, $blurHeight - 1, 2 * (1 - $t) * $blurWidth, 2 * (1 - $t) * $blurHeight, 180, 268, $colour, IMG_ARC_PIE); - imagefilledarc($shadow, $width, $blurHeight - 1, 2 * (1 - $t) * $blurWidth, 2 * (1 - $t) * $blurHeight, 270, 358, $colour, IMG_ARC_PIE); - imagefilledarc($shadow, $width, $height, 2 * (1 - $t) * $blurWidth, 2 * (1 - $t) * $blurHeight, 0, 90, $colour, IMG_ARC_PIE); - imagefilledarc($shadow, $blurWidth - 1, $height, 2 * (1 - $t) * $blurWidth, 2 * (1 - $t) * $blurHeight, 90, 180, $colour, IMG_ARC_PIE); - } - - - $colour = imagecolorallocate($shadow, 255, 255, 255); - imagefilledrectangle($shadow, $blurWidth, $blurHeight, $width, $height, $colour); - imagefilledrectangle($shadow, $blurWidth * 0.5 - $distWidth, $blurHeight * 0.5 - $distHeight, $width + $blurWidth * 0.5 - 1 - $distWidth, $height + $blurHeight * 0.5 - 1 - $distHeight, $colour); - - - // *** The magic - imagealphablending($rgb, false); - - for ($theX = 0; $theX < imagesx($rgb); $theX++) - { - for ($theY = 0; $theY < imagesy($rgb); $theY++) - { - - // *** Get the RGB values for every pixel of the RGB image - $colArray = imagecolorat($rgb, $theX, $theY); - $r = ($colArray >> 16) & 0xFF; - $g = ($colArray >> 8) & 0xFF; - $b = $colArray & 0xFF; - - // *** Get the alpha value for every pixel of the shadow image - $colArray = imagecolorat($shadow, $theX, $theY); - $a = $colArray & 0xFF; - $a = 127 - floor($a / 2); - $t = $a / 128.0; - - // *** Create color - if (fix_strtolower($bgColor) == 'transparent') - { - $myColour = imagecolorallocatealpha($rgb, $r, $g, $b, $a); - } - else - { - $myColour = imagecolorallocate($rgb, $r * (1.0 - $t) + $r0 * $t, $g * (1.0 - $t) + $g0 * $t, $b * (1.0 - $t) + $b0 * $t); - } - - // *** Add color to new rgb image - imagesetpixel($rgb, $theX, $theY, $myColour); - } - } - - imagealphablending($rgb, true); - imagesavealpha($rgb, true); - - $this->imageResized = $rgb; - - imagedestroy($image); - imagedestroy($newImage); - imagedestroy($shadow); - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Add Caption Box -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - public function addCaptionBox($side = 'b', $thickness = 50, $padding = 0, $bgColor = '#000', $transaprencyAmount = 30) - # - # Author: Jarrod Oberto - # Date: 26 May 2011 - # Purpose: Add a caption box - # Params in: (str) $side: the side to add the caption box (t, r, b, or l). - # (int) $thickness: how thick you want the caption box to be. - # (mixed) $bgColor: The color of the caption box. - # (int) $transaprencyAmount: The amount of transparency to be - # applied. - # Params out: n/a - # Notes: - # - { - $side = fix_strtolower($side); - - // *** Convert color - $rgbArray = $this->formatColor($bgColor); - $r = $rgbArray['r']; - $g = $rgbArray['g']; - $b = $rgbArray['b']; - - $positionArray = $this->calculateCaptionBoxPosition($side, $thickness, $padding); - - // *** Store incase we want to use method addTextToCaptionBox() - $this->captionBoxPositionArray = $positionArray; - - - $transaprencyAmount = $this->invertTransparency($transaprencyAmount, 127, false); - $transparent = imagecolorallocatealpha($this->imageResized, $r, $g, $b, $transaprencyAmount); - imagefilledrectangle($this->imageResized, $positionArray['x1'], $positionArray['y1'], $positionArray['x2'], $positionArray['y2'], $transparent); - } - - ## -------------------------------------------------------- - - public function addTextToCaptionBox($text, $fontColor = '#fff', $fontSize = 12, $angle = 0, $font = null) - # - # Author: Jarrod Oberto - # Date: 03 Aug 11 - # Purpose: Simplify adding text to a caption box by automatically - # locating the center of the caption box - # Params in: The usually text paams (less a couple) - # Params out: n/a - # Notes: - # - { - - // *** Get the caption box measurements - if (count($this->captionBoxPositionArray) == 4) - { - $x1 = $this->captionBoxPositionArray['x1']; - $x2 = $this->captionBoxPositionArray['x2']; - $y1 = $this->captionBoxPositionArray['y1']; - $y2 = $this->captionBoxPositionArray['y2']; - } - else - { - if ($this->debug) - { - throw new Exception('No caption box found.'); - } - else - { - return false; - } - } - - - // *** Get text font - $font = $this->getTextFont($font); - - // *** Get text size - $textSizeArray = $this->getTextSize($fontSize, $angle, $font, $text); - $textWidth = $textSizeArray['width']; - $textHeight = $textSizeArray['height']; - - // *** Find the width/height middle points - $boxXMiddle = (($x2 - $x1) / 2); - $boxYMiddle = (($y2 - $y1) / 2); - - // *** Box middle - half the text width/height - $xPos = ($x1 + $boxXMiddle) - ($textWidth / 2); - $yPos = ($y1 + $boxYMiddle) - ($textHeight / 2); - - $pos = $xPos . 'x' . $yPos; - - $this->addText($text, $pos, $padding = 0, $fontColor, $fontSize, $angle, $font); - - } - - ## -------------------------------------------------------- - - private function calculateCaptionBoxPosition($side, $thickness, $padding) - { - $positionArray = array(); - - switch ($side) - { - case 't': - $positionArray['x1'] = 0; - $positionArray['y1'] = $padding; - $positionArray['x2'] = $this->width; - $positionArray['y2'] = $thickness + $padding; - break; - case 'r': - $positionArray['x1'] = $this->width - $thickness - $padding; - $positionArray['y1'] = 0; - $positionArray['x2'] = $this->width - $padding; - $positionArray['y2'] = $this->height; - break; - case 'b': - $positionArray['x1'] = 0; - $positionArray['y1'] = $this->height - $thickness - $padding; - $positionArray['x2'] = $this->width; - $positionArray['y2'] = $this->height - $padding; - break; - case 'l': - $positionArray['x1'] = $padding; - $positionArray['y1'] = 0; - $positionArray['x2'] = $thickness + $padding; - $positionArray['y2'] = $this->height; - break; - - default: - break; - } - - return $positionArray; - - } - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Get EXIF Data -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - public function getExif($debug = false) - # Author: Jarrod Oberto - # Date: 07-05-2011 - # Purpose: Get image EXIF data - # Param in: n/a - # Param out: An associate array of EXIF data - # Reference: - # Notes: - # 23 May 13 : added orientation flag -jco - # - { - - if ( ! $this->debug || ! $debug) - { - $debug = false; - } - - // *** Check all is good - check the EXIF library exists and the file exists, too. - if ( ! $this->testEXIFInstalled()) - { - if ($debug) - { - throw new Exception('The EXIF Library is not installed.'); - } - else - { - return array(); - } - }; - if ( ! file_exists($this->fileName)) - { - if ($debug) - { - throw new Exception('Image not found.'); - } - else - { - return array(); - } - }; - if ($this->fileExtension != '.jpg') - { - if ($debug) - { - throw new Exception('Metadata not supported for this image type.'); - } - else - { - return array(); - } - }; - $exifData = exif_read_data($this->fileName, 'IFD0'); - - // *** Format the apperture value - $ev = $exifData['ApertureValue']; - $apPeicesArray = explode('/', $ev); - if (count($apPeicesArray) == 2) - { - $apertureValue = round($apPeicesArray[0] / $apPeicesArray[1], 2, PHP_ROUND_HALF_DOWN) . ' EV'; - } - else - { - $apertureValue = ''; - } - - // *** Format the focal length - $focalLength = $exifData['FocalLength']; - $flPeicesArray = explode('/', $focalLength); - if (count($flPeicesArray) == 2) - { - $focalLength = $flPeicesArray[0] / $flPeicesArray[1] . '.0 mm'; - } - else - { - $focalLength = ''; - } - - // *** Format fNumber - $fNumber = $exifData['FNumber']; - $fnPeicesArray = explode('/', $fNumber); - if (count($fnPeicesArray) == 2) - { - $fNumber = $fnPeicesArray[0] / $fnPeicesArray[1]; - } - else - { - $fNumber = ''; - } - - // *** Resolve ExposureProgram - if (isset($exifData['ExposureProgram'])) - { - $ep = $exifData['ExposureProgram']; - } - if (isset($ep)) - { - $ep = $this->resolveExposureProgram($ep); - } - - - // *** Resolve MeteringMode - $mm = $exifData['MeteringMode']; - $mm = $this->resolveMeteringMode($mm); - - // *** Resolve Flash - $flash = $exifData['Flash']; - $flash = $this->resolveFlash($flash); - - - if (isset($exifData['Make'])) - { - $exifDataArray['make'] = $exifData['Make']; - } - else - { - $exifDataArray['make'] = ''; - } - - if (isset($exifData['Model'])) - { - $exifDataArray['model'] = $exifData['Model']; - } - else - { - $exifDataArray['model'] = ''; - } - - if (isset($exifData['DateTime'])) - { - $exifDataArray['date'] = $exifData['DateTime']; - } - else - { - $exifDataArray['date'] = ''; - } - - if (isset($exifData['ExposureTime'])) - { - $exifDataArray['exposure time'] = $exifData['ExposureTime'] . ' sec.'; - } - else - { - $exifDataArray['exposure time'] = ''; - } - - if ($apertureValue != '') - { - $exifDataArray['aperture value'] = $apertureValue; - } - else - { - $exifDataArray['aperture value'] = ''; - } - - if (isset($exifData['COMPUTED']['ApertureFNumber'])) - { - $exifDataArray['f-stop'] = $exifData['COMPUTED']['ApertureFNumber']; - } - else - { - $exifDataArray['f-stop'] = ''; - } - - if (isset($exifData['FNumber'])) - { - $exifDataArray['fnumber'] = $exifData['FNumber']; - } - else - { - $exifDataArray['fnumber'] = ''; - } - - if ($fNumber != '') - { - $exifDataArray['fnumber value'] = $fNumber; - } - else - { - $exifDataArray['fnumber value'] = ''; - } - - if (isset($exifData['ISOSpeedRatings'])) - { - $exifDataArray['iso'] = $exifData['ISOSpeedRatings']; - } - else - { - $exifDataArray['iso'] = ''; - } - - if ($focalLength != '') - { - $exifDataArray['focal length'] = $focalLength; - } - else - { - $exifDataArray['focal length'] = ''; - } - - if (isset($ep)) - { - $exifDataArray['exposure program'] = $ep; - } - else - { - $exifDataArray['exposure program'] = ''; - } - - if ($mm != '') - { - $exifDataArray['metering mode'] = $mm; - } - else - { - $exifDataArray['metering mode'] = ''; - } - - if ($flash != '') - { - $exifDataArray['flash status'] = $flash; - } - else - { - $exifDataArray['flash status'] = ''; - } - - if (isset($exifData['Artist'])) - { - $exifDataArray['creator'] = $exifData['Artist']; - } - else - { - $exifDataArray['creator'] = ''; - } - - if (isset($exifData['Copyright'])) - { - $exifDataArray['copyright'] = $exifData['Copyright']; - } - else - { - $exifDataArray['copyright'] = ''; - } - - // *** Orientation - if (isset($exifData['Orientation'])) - { - $exifDataArray['orientation'] = $exifData['Orientation']; - } - else - { - $exifDataArray['orientation'] = ''; - } - - return $exifDataArray; - } - - ## -------------------------------------------------------- - - private function resolveExposureProgram($ep) - { - switch ($ep) - { - case 0: - $ep = ''; - break; - case 1: - $ep = 'manual'; - break; - case 2: - $ep = 'normal program'; - break; - case 3: - $ep = 'aperture priority'; - break; - case 4: - $ep = 'shutter priority'; - break; - case 5: - $ep = 'creative program'; - break; - case 6: - $ep = 'action program'; - break; - case 7: - $ep = 'portrait mode'; - break; - case 8: - $ep = 'landscape mode'; - break; - - default: - break; - } - - return $ep; - } - - ## -------------------------------------------------------- - - private function resolveMeteringMode($mm) - { - switch ($mm) - { - case 0: - $mm = 'unknown'; - break; - case 1: - $mm = 'average'; - break; - case 2: - $mm = 'center weighted average'; - break; - case 3: - $mm = 'spot'; - break; - case 4: - $mm = 'multi spot'; - break; - case 5: - $mm = 'pattern'; - break; - case 6: - $mm = 'partial'; - break; - case 255: - $mm = 'other'; - break; - - default: - break; - } - - return $mm; - } - - ## -------------------------------------------------------- - - private function resolveFlash($flash) - { - switch ($flash) - { - case 0: - $flash = 'flash did not fire'; - break; - case 1: - $flash = 'flash fired'; - break; - case 5: - $flash = 'strobe return light not detected'; - break; - case 7: - $flash = 'strobe return light detected'; - break; - case 9: - $flash = 'flash fired, compulsory flash mode'; - break; - case 13: - $flash = 'flash fired, compulsory flash mode, return light not detected'; - break; - case 15: - $flash = 'flash fired, compulsory flash mode, return light detected'; - break; - case 16: - $flash = 'flash did not fire, compulsory flash mode'; - break; - case 24: - $flash = 'flash did not fire, auto mode'; - break; - case 25: - $flash = 'flash fired, auto mode'; - break; - case 29: - $flash = 'flash fired, auto mode, return light not detected'; - break; - case 31: - $flash = 'flash fired, auto mode, return light detected'; - break; - case 32: - $flash = 'no flash function'; - break; - case 65: - $flash = 'flash fired, red-eye reduction mode'; - break; - case 69: - $flash = 'flash fired, red-eye reduction mode, return light not detected'; - break; - case 71: - $flash = 'flash fired, red-eye reduction mode, return light detected'; - break; - case 73: - $flash = 'flash fired, compulsory flash mode, red-eye reduction mode'; - break; - case 77: - $flash = 'flash fired, compulsory flash mode, red-eye reduction mode, return light not detected'; - break; - case 79: - $flash = 'flash fired, compulsory flash mode, red-eye reduction mode, return light detected'; - break; - case 89: - $flash = 'flash fired, auto mode, red-eye reduction mode'; - break; - case 93: - $flash = 'flash fired, auto mode, return light not detected, red-eye reduction mode'; - break; - case 95: - $flash = 'flash fired, auto mode, return light detected, red-eye reduction mode'; - break; - - default: - break; - } - - return $flash; - - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Get IPTC Data -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Write IPTC Data -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - public function writeIPTCcaption($value) - # Caption - { - $this->writeIPTC(120, $value); - } - - ## -------------------------------------------------------- - - public function writeIPTCwriter($value) - { - //$this->writeIPTC(65, $value); - } - - ## -------------------------------------------------------- - - private function writeIPTC($dat, $value) - { - - # LIMIT TO JPG - - $caption_block = $this->iptc_maketag(2, $dat, $value); - $image_string = iptcembed($caption_block, $this->fileName); - file_put_contents('iptc.jpg', $image_string); - } + // *** RGB + $rgb = imagecreatetruecolor($width + $blurWidth, $height + $blurHeight); + $colour = imagecolorallocate($rgb, 0, 0, 0); + imagefilledrectangle($rgb, 0, 0, $width + $blurWidth, $height + $blurHeight, $colour); + $colour = imagecolorallocate($rgb, 255, 255, 255); + //imagefilledrectangle($rgb, $blurWidth*0.5-$distWidth, $blurHeight*0.5-$distHeight, $width+$blurWidth*0.5-$distWidth, $height+$blurWidth*0.5-$distHeight, $colour); + imagefilledrectangle($rgb, $blurWidth * 0.5 - $distWidth, $blurHeight * 0.5 - $distHeight, $width + $blurWidth * 0.5 - $distWidth, $height + $blurWidth * 0.5 - $distHeight, $colour); + //imagecopymerge($rgb, $newImage, 1+$blurWidth*0.5-$distWidth, 1+$blurHeight*0.5-$distHeight, 0,0, $width, $height, 100); + imagecopymerge($rgb, $newImage, $blurWidth * 0.5 - $distWidth, $blurHeight * 0.5 - $distHeight, 0, 0, $width + $blurWidth, $height + $blurHeight, 100); + + + // *** Shadow (alpha) + $shadow = imagecreatetruecolor($width + $blurWidth, $height + $blurHeight); + imagealphablending($shadow, false); + $colour = imagecolorallocate($shadow, 0, 0, 0); + imagefilledrectangle($shadow, 0, 0, $width + $blurWidth, $height + $blurHeight, $colour); + + + for ($i = 0; $i <= STEPS; $i++) { + + $t = ((1.0 * $i) / STEPS); + $intensity = 255 * $t * $t; + + $colour = imagecolorallocate($shadow, $intensity, $intensity, $intensity); + $points = array( + $blurWidth * $t, $blurHeight, // Point 1 (x, y) + $blurWidth, $blurHeight * $t, // Point 2 (x, y) + $width, $blurHeight * $t, // Point 3 (x, y) + $width + $blurWidth * (1 - $t), $blurHeight, // Point 4 (x, y) + $width + $blurWidth * (1 - $t), $height, // Point 5 (x, y) + $width, $height + $blurHeight * (1 - $t), // Point 6 (x, y) + $blurWidth, $height + $blurHeight * (1 - $t), // Point 7 (x, y) + $blurWidth * $t, $height // Point 8 (x, y) + ); + imagepolygon($shadow, $points, 8, $colour); + } + + for ($i = 0; $i <= STEPS; $i++) { + + $t = ((1.0 * $i) / STEPS); + $intensity = 255 * $t * $t; + + $colour = imagecolorallocate($shadow, $intensity, $intensity, $intensity); + imagefilledarc($shadow, $blurWidth - 1, $blurHeight - 1, 2 * (1 - $t) * $blurWidth, 2 * (1 - $t) * $blurHeight, 180, 268, $colour, IMG_ARC_PIE); + imagefilledarc($shadow, $width, $blurHeight - 1, 2 * (1 - $t) * $blurWidth, 2 * (1 - $t) * $blurHeight, 270, 358, $colour, IMG_ARC_PIE); + imagefilledarc($shadow, $width, $height, 2 * (1 - $t) * $blurWidth, 2 * (1 - $t) * $blurHeight, 0, 90, $colour, IMG_ARC_PIE); + imagefilledarc($shadow, $blurWidth - 1, $height, 2 * (1 - $t) * $blurWidth, 2 * (1 - $t) * $blurHeight, 90, 180, $colour, IMG_ARC_PIE); + } + + + $colour = imagecolorallocate($shadow, 255, 255, 255); + imagefilledrectangle($shadow, $blurWidth, $blurHeight, $width, $height, $colour); + imagefilledrectangle($shadow, $blurWidth * 0.5 - $distWidth, $blurHeight * 0.5 - $distHeight, $width + $blurWidth * 0.5 - 1 - $distWidth, $height + $blurHeight * 0.5 - 1 - $distHeight, $colour); + + + // *** The magic + imagealphablending($rgb, false); + + for ($theX = 0; $theX < imagesx($rgb); $theX++) { + for ($theY = 0; $theY < imagesy($rgb); $theY++) { + + // *** Get the RGB values for every pixel of the RGB image + $colArray = imagecolorat($rgb, $theX, $theY); + $r = ($colArray >> 16) & 0xFF; + $g = ($colArray >> 8) & 0xFF; + $b = $colArray & 0xFF; + + // *** Get the alpha value for every pixel of the shadow image + $colArray = imagecolorat($shadow, $theX, $theY); + $a = $colArray & 0xFF; + $a = 127 - floor($a / 2); + $t = $a / 128.0; + + // *** Create color + if (fix_strtolower($bgColor) == 'transparent') { + $myColour = imagecolorallocatealpha($rgb, $r, $g, $b, $a); + } else { + $myColour = imagecolorallocate($rgb, $r * (1.0 - $t) + $r0 * $t, $g * (1.0 - $t) + $g0 * $t, $b * (1.0 - $t) + $b0 * $t); + } + + // *** Add color to new rgb image + imagesetpixel($rgb, $theX, $theY, $myColour); + } + } + + imagealphablending($rgb, true); + imagesavealpha($rgb, true); + + $this->imageResized = $rgb; + + imagedestroy($image); + imagedestroy($newImage); + imagedestroy($shadow); + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Add Caption Box + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + public function addCaptionBox($side = 'b', $thickness = 50, $padding = 0, $bgColor = '#000', $transaprencyAmount = 30) { + # + # Author: Jarrod Oberto + # Date: 26 May 2011 + # Purpose: Add a caption box + # Params in: (str) $side: the side to add the caption box (t, r, b, or l). + # (int) $thickness: how thick you want the caption box to be. + # (mixed) $bgColor: The color of the caption box. + # (int) $transaprencyAmount: The amount of transparency to be + # applied. + # Params out: n/a + # Notes:# + + $side = fix_strtolower($side); + + // *** Convert color + $rgbArray = $this->formatColor($bgColor); + $r = $rgbArray['r']; + $g = $rgbArray['g']; + $b = $rgbArray['b']; + + $positionArray = $this->calculateCaptionBoxPosition($side, $thickness, $padding); + + // *** Store incase we want to use method addTextToCaptionBox() + $this->captionBoxPositionArray = $positionArray; + + + $transaprencyAmount = $this->invertTransparency($transaprencyAmount, 127, false); + $transparent = imagecolorallocatealpha($this->imageResized, $r, $g, $b, $transaprencyAmount); + imagefilledrectangle($this->imageResized, $positionArray['x1'], $positionArray['y1'], $positionArray['x2'], $positionArray['y2'], $transparent); + } + + ## -------------------------------------------------------- + + public function addTextToCaptionBox($text, $fontColor = '#fff', $fontSize = 12, $angle = 0, $font = null) { + # + # Author: Jarrod Oberto + # Date: 03 Aug 11 + # Purpose: Simplify adding text to a caption box by automatically + # locating the center of the caption box + # Params in: The usually text paams (less a couple) + # Params out: n/a + # Notes:# + // *** Get the caption box measurements + if (count($this->captionBoxPositionArray) == 4) { + $x1 = $this->captionBoxPositionArray['x1']; + $x2 = $this->captionBoxPositionArray['x2']; + $y1 = $this->captionBoxPositionArray['y1']; + $y2 = $this->captionBoxPositionArray['y2']; + } else { + if ($this->debug) { + throw new Exception('No caption box found.'); + } else { + return false; + } + } + + + // *** Get text font + $font = $this->getTextFont($font); + + // *** Get text size + $textSizeArray = $this->getTextSize($fontSize, $angle, $font, $text); + $textWidth = $textSizeArray['width']; + $textHeight = $textSizeArray['height']; + + // *** Find the width/height middle points + $boxXMiddle = (($x2 - $x1) / 2); + $boxYMiddle = (($y2 - $y1) / 2); + + // *** Box middle - half the text width/height + $xPos = ($x1 + $boxXMiddle) - ($textWidth / 2); + $yPos = ($y1 + $boxYMiddle) - ($textHeight / 2); + + $pos = $xPos . 'x' . $yPos; + + $this->addText($text, $pos, $padding = 0, $fontColor, $fontSize, $angle, $font); + } + + ## -------------------------------------------------------- + + private function calculateCaptionBoxPosition($side, $thickness, $padding) { + $positionArray = array(); + + switch ($side) { + case 't': + $positionArray['x1'] = 0; + $positionArray['y1'] = $padding; + $positionArray['x2'] = $this->width; + $positionArray['y2'] = $thickness + $padding; + break; + case 'r': + $positionArray['x1'] = $this->width - $thickness - $padding; + $positionArray['y1'] = 0; + $positionArray['x2'] = $this->width - $padding; + $positionArray['y2'] = $this->height; + break; + case 'b': + $positionArray['x1'] = 0; + $positionArray['y1'] = $this->height - $thickness - $padding; + $positionArray['x2'] = $this->width; + $positionArray['y2'] = $this->height - $padding; + break; + case 'l': + $positionArray['x1'] = $padding; + $positionArray['y1'] = 0; + $positionArray['x2'] = $thickness + $padding; + $positionArray['y2'] = $this->height; + break; + + default: + break; + } + + return $positionArray; + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Get EXIF Data + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + public function getExif($debug = false) { + # Author: Jarrod Oberto + # Date: 07-05-2011 + # Purpose: Get image EXIF data + # Param in: n/a + # Param out: An associate array of EXIF data + # Reference: + # Notes: + # 23 May 13 : added orientation flag -jco# + + + if (!$this->debug || !$debug) { + $debug = false; + } + + // *** Check all is good - check the EXIF library exists and the file exists, too. + if (!$this->testEXIFInstalled()) { + if ($debug) { + throw new Exception('The EXIF Library is not installed.'); + } else { + return array(); + } + }; + if (!file_exists($this->fileName)) { + if ($debug) { + throw new Exception('Image not found.'); + } else { + return array(); + } + }; + if ($this->fileExtension != '.jpg') { + if ($debug) { + throw new Exception('Metadata not supported for this image type.'); + } else { + return array(); + } + }; + $exifData = exif_read_data($this->fileName, 'IFD0'); + + // *** Format the apperture value + $ev = $exifData['ApertureValue']; + $apPeicesArray = explode('/', $ev); + if (count($apPeicesArray) == 2) { + $apertureValue = round($apPeicesArray[0] / $apPeicesArray[1], 2, PHP_ROUND_HALF_DOWN) . ' EV'; + } else { + $apertureValue = ''; + } + + // *** Format the focal length + $focalLength = $exifData['FocalLength']; + $flPeicesArray = explode('/', $focalLength); + if (count($flPeicesArray) == 2) { + $focalLength = $flPeicesArray[0] / $flPeicesArray[1] . '.0 mm'; + } else { + $focalLength = ''; + } + + // *** Format fNumber + $fNumber = $exifData['FNumber']; + $fnPeicesArray = explode('/', $fNumber); + if (count($fnPeicesArray) == 2) { + $fNumber = $fnPeicesArray[0] / $fnPeicesArray[1]; + } else { + $fNumber = ''; + } + + // *** Resolve ExposureProgram + if (isset($exifData['ExposureProgram'])) { + $ep = $exifData['ExposureProgram']; + } + if (isset($ep)) { + $ep = $this->resolveExposureProgram($ep); + } + + + // *** Resolve MeteringMode + $mm = $exifData['MeteringMode']; + $mm = $this->resolveMeteringMode($mm); + + // *** Resolve Flash + $flash = $exifData['Flash']; + $flash = $this->resolveFlash($flash); + + + if (isset($exifData['Make'])) { + $exifDataArray['make'] = $exifData['Make']; + } else { + $exifDataArray['make'] = ''; + } + + if (isset($exifData['Model'])) { + $exifDataArray['model'] = $exifData['Model']; + } else { + $exifDataArray['model'] = ''; + } + + if (isset($exifData['DateTime'])) { + $exifDataArray['date'] = $exifData['DateTime']; + } else { + $exifDataArray['date'] = ''; + } + + if (isset($exifData['ExposureTime'])) { + $exifDataArray['exposure time'] = $exifData['ExposureTime'] . ' sec.'; + } else { + $exifDataArray['exposure time'] = ''; + } + + if ($apertureValue != '') { + $exifDataArray['aperture value'] = $apertureValue; + } else { + $exifDataArray['aperture value'] = ''; + } + + if (isset($exifData['COMPUTED']['ApertureFNumber'])) { + $exifDataArray['f-stop'] = $exifData['COMPUTED']['ApertureFNumber']; + } else { + $exifDataArray['f-stop'] = ''; + } + + if (isset($exifData['FNumber'])) { + $exifDataArray['fnumber'] = $exifData['FNumber']; + } else { + $exifDataArray['fnumber'] = ''; + } + + if ($fNumber != '') { + $exifDataArray['fnumber value'] = $fNumber; + } else { + $exifDataArray['fnumber value'] = ''; + } + + if (isset($exifData['ISOSpeedRatings'])) { + $exifDataArray['iso'] = $exifData['ISOSpeedRatings']; + } else { + $exifDataArray['iso'] = ''; + } + + if ($focalLength != '') { + $exifDataArray['focal length'] = $focalLength; + } else { + $exifDataArray['focal length'] = ''; + } + + if (isset($ep)) { + $exifDataArray['exposure program'] = $ep; + } else { + $exifDataArray['exposure program'] = ''; + } + + if ($mm != '') { + $exifDataArray['metering mode'] = $mm; + } else { + $exifDataArray['metering mode'] = ''; + } + + if ($flash != '') { + $exifDataArray['flash status'] = $flash; + } else { + $exifDataArray['flash status'] = ''; + } + + if (isset($exifData['Artist'])) { + $exifDataArray['creator'] = $exifData['Artist']; + } else { + $exifDataArray['creator'] = ''; + } + + if (isset($exifData['Copyright'])) { + $exifDataArray['copyright'] = $exifData['Copyright']; + } else { + $exifDataArray['copyright'] = ''; + } + + // *** Orientation + if (isset($exifData['Orientation'])) { + $exifDataArray['orientation'] = $exifData['Orientation']; + } else { + $exifDataArray['orientation'] = ''; + } + + return $exifDataArray; + } + + ## -------------------------------------------------------- + + private function resolveExposureProgram($ep) { + switch ($ep) { + case 0: + $ep = ''; + break; + case 1: + $ep = 'manual'; + break; + case 2: + $ep = 'normal program'; + break; + case 3: + $ep = 'aperture priority'; + break; + case 4: + $ep = 'shutter priority'; + break; + case 5: + $ep = 'creative program'; + break; + case 6: + $ep = 'action program'; + break; + case 7: + $ep = 'portrait mode'; + break; + case 8: + $ep = 'landscape mode'; + break; + + default: + break; + } + + return $ep; + } + + ## -------------------------------------------------------- + + private function resolveMeteringMode($mm) { + switch ($mm) { + case 0: + $mm = 'unknown'; + break; + case 1: + $mm = 'average'; + break; + case 2: + $mm = 'center weighted average'; + break; + case 3: + $mm = 'spot'; + break; + case 4: + $mm = 'multi spot'; + break; + case 5: + $mm = 'pattern'; + break; + case 6: + $mm = 'partial'; + break; + case 255: + $mm = 'other'; + break; + + default: + break; + } + + return $mm; + } + + ## -------------------------------------------------------- + + private function resolveFlash($flash) { + switch ($flash) { + case 0: + $flash = 'flash did not fire'; + break; + case 1: + $flash = 'flash fired'; + break; + case 5: + $flash = 'strobe return light not detected'; + break; + case 7: + $flash = 'strobe return light detected'; + break; + case 9: + $flash = 'flash fired, compulsory flash mode'; + break; + case 13: + $flash = 'flash fired, compulsory flash mode, return light not detected'; + break; + case 15: + $flash = 'flash fired, compulsory flash mode, return light detected'; + break; + case 16: + $flash = 'flash did not fire, compulsory flash mode'; + break; + case 24: + $flash = 'flash did not fire, auto mode'; + break; + case 25: + $flash = 'flash fired, auto mode'; + break; + case 29: + $flash = 'flash fired, auto mode, return light not detected'; + break; + case 31: + $flash = 'flash fired, auto mode, return light detected'; + break; + case 32: + $flash = 'no flash function'; + break; + case 65: + $flash = 'flash fired, red-eye reduction mode'; + break; + case 69: + $flash = 'flash fired, red-eye reduction mode, return light not detected'; + break; + case 71: + $flash = 'flash fired, red-eye reduction mode, return light detected'; + break; + case 73: + $flash = 'flash fired, compulsory flash mode, red-eye reduction mode'; + break; + case 77: + $flash = 'flash fired, compulsory flash mode, red-eye reduction mode, return light not detected'; + break; + case 79: + $flash = 'flash fired, compulsory flash mode, red-eye reduction mode, return light detected'; + break; + case 89: + $flash = 'flash fired, auto mode, red-eye reduction mode'; + break; + case 93: + $flash = 'flash fired, auto mode, return light not detected, red-eye reduction mode'; + break; + case 95: + $flash = 'flash fired, auto mode, return light detected, red-eye reduction mode'; + break; + + default: + break; + } + + return $flash; + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Get IPTC Data + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Write IPTC Data + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + public function writeIPTCcaption($value) { + # Caption + $this->writeIPTC(120, $value); + } + + ## -------------------------------------------------------- + + public function writeIPTCwriter($value) { + //$this->writeIPTC(65, $value); + } + + ## -------------------------------------------------------- + + private function writeIPTC($dat, $value) { + + # LIMIT TO JPG + + $caption_block = $this->iptc_maketag(2, $dat, $value); + $image_string = iptcembed($caption_block, $this->fileName); + file_put_contents('iptc.jpg', $image_string); + } ## -------------------------------------------------------- - private function iptc_maketag($rec, $dat, $val) - # Author: Thies C. Arntzen - # Purpose: Function to format the new IPTC text - # Param in: $rec: Application record. (We’re working with #2) - # $dat: Index. (120 for caption, 118 for contact. See the IPTC IIM - # specification: - # http://www.iptc.org/std/IIM/4.1/specification/IIMV4.1.pdf - # $val: Value/data/text. Make sure this is within the length - # constraints of the IPTC IIM specification - # Ref: http://blog.peterhaza.no/working-with-image-meta-data-in-exif-and-iptc-headers-from-php/ - # http://php.net/manual/en/function.iptcembed.php - # - { - $len = strlen($val); - if ($len < 0x8000) - { - return chr(0x1c) . chr($rec) . chr($dat) . - chr($len >> 8) . - chr($len & 0xff) . - $val; - } - else - { - return chr(0x1c) . chr($rec) . chr($dat) . - chr(0x80) . chr(0x04) . - chr(($len >> 24) & 0xff) . - chr(($len >> 16) & 0xff) . - chr(($len >> 8) & 0xff) . - chr(($len) & 0xff) . - $val; - } - } - - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Write XMP Data -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - //http://xmpphptoolkit.sourceforge.net/ - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Add Text -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - public function addText($text, $pos = '20x20', $padding = 0, $fontColor = '#fff', $fontSize = 12, $angle = 0, $font = null) - # Author: Jarrod Oberto - # Date: 18-11-09 - # Purpose: Add text to an image - # Param in: - # Param out: - # Reference: http://php.net/manual/en/function.imagettftext.php - # Notes: Make sure you supply the font. - # - { - - // *** Convert color - $rgbArray = $this->formatColor($fontColor); - $r = $rgbArray['r']; - $g = $rgbArray['g']; - $b = $rgbArray['b']; - - // *** Get text font - $font = $this->getTextFont($font); - - // *** Get text size - $textSizeArray = $this->getTextSize($fontSize, $angle, $font, $text); - $textWidth = $textSizeArray['width']; - $textHeight = $textSizeArray['height']; - - // *** Find co-ords to place text - $posArray = $this->calculatePosition($pos, $padding, $textWidth, $textHeight, false); - $x = $posArray['width']; - $y = $posArray['height']; - - $fontColor = imagecolorallocate($this->imageResized, $r, $g, $b); - - // *** Add text - imagettftext($this->imageResized, $fontSize, $angle, $x, $y, $fontColor, $font, $text); - } - - ## -------------------------------------------------------- - - private function getTextFont($font) - { - // *** Font path (shou - $fontPath = dirname(__FILE__) . '/' . $this->fontDir; - - - // *** The below is/may be needed depending on your version (see ref) - putenv('GDFONTPATH=' . realpath('.')); - - // *** Check if the passed in font exsits... - if ($font == null || ! file_exists($font)) - { - - // *** ...If not, default to this font. - $font = $fontPath . '/arimo.ttf'; - - // *** Check our default font exists... - if ( ! file_exists($font)) - { - - // *** If not, return false - if ($this->debug) - { - throw new Exception('Font not found'); - } - else - { - return false; - } - } - } + private function iptc_maketag($rec, $dat, $val) { + # Author: Thies C. Arntzen + # Purpose: Function to format the new IPTC text + # Param in: $rec: Application record. (We’re working with #2) + # $dat: Index. (120 for caption, 118 for contact. See the IPTC IIM + # specification: + # http://www.iptc.org/std/IIM/4.1/specification/IIMV4.1.pdf + # $val: Value/data/text. Make sure this is within the length + # constraints of the IPTC IIM specification + # Ref: http://blog.peterhaza.no/working-with-image-meta-data-in-exif-and-iptc-headers-from-php/ + # http://php.net/manual/en/function.iptcembed.php# + + $len = strlen($val); + if ($len < 0x8000) { + return chr(0x1c) . chr($rec) . chr($dat) . + chr($len >> 8) . + chr($len & 0xff) . + $val; + } else { + return chr(0x1c) . chr($rec) . chr($dat) . + chr(0x80) . chr(0x04) . + chr(($len >> 24) & 0xff) . + chr(($len >> 16) & 0xff) . + chr(($len >> 8) & 0xff) . + chr(($len) & 0xff) . + $val; + } + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Write XMP Data + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + //http://xmpphptoolkit.sourceforge.net/ + + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Add Text + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + public function addText($text, $pos = '20x20', $padding = 0, $fontColor = '#fff', $fontSize = 12, $angle = 0, $font = null) { + # Author: Jarrod Oberto + # Date: 18-11-09 + # Purpose: Add text to an image + # Param in: + # Param out: + # Reference: http://php.net/manual/en/function.imagettftext.php + # Notes: Make sure you supply the font.# + // *** Convert color + $rgbArray = $this->formatColor($fontColor); + $r = $rgbArray['r']; + $g = $rgbArray['g']; + $b = $rgbArray['b']; + + // *** Get text font + $font = $this->getTextFont($font); + + // *** Get text size + $textSizeArray = $this->getTextSize($fontSize, $angle, $font, $text); + $textWidth = $textSizeArray['width']; + $textHeight = $textSizeArray['height']; + + // *** Find co-ords to place text + $posArray = $this->calculatePosition($pos, $padding, $textWidth, $textHeight, false); + $x = $posArray['width']; + $y = $posArray['height']; + + $fontColor = imagecolorallocate($this->imageResized, $r, $g, $b); + + // *** Add text + imagettftext($this->imageResized, $fontSize, $angle, $x, $y, $fontColor, $font, $text); + } + + ## -------------------------------------------------------- + + private function getTextFont($font) { + // *** Font path (shou + $fontPath = dirname(__FILE__) . '/' . $this->fontDir; + + + // *** The below is/may be needed depending on your version (see ref) + putenv('GDFONTPATH=' . realpath('.')); + + // *** Check if the passed in font exsits... + if ($font == null || !file_exists($font)) { + + // *** ...If not, default to this font. + $font = $fontPath . '/arimo.ttf'; + + // *** Check our default font exists... + if (!file_exists($font)) { + + // *** If not, return false + if ($this->debug) { + throw new Exception('Font not found'); + } else { + return false; + } + } + } + + return $font; + } + + ## -------------------------------------------------------- + + private function getTextSize($fontSize, $angle, $font, $text) { + + // *** Define box (so we can get the width) + $box = @imageTTFBbox($fontSize, $angle, $font, $text); + + // *** Get width of text from dimensions + $textWidth = abs($box[4] - $box[0]); + + // *** Get height of text from dimensions (should also be same as $fontSize) + $textHeight = abs($box[5] - $box[1]); + + return array('height' => $textHeight, 'width' => $textWidth); + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + Add Watermark + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + public function addWatermark($watermarkImage, $pos, $padding = 0, $opacity = 0) { + # Author: Jarrod Oberto + # Date: 18-11-09 + # Purpose: Add watermark image + # Param in: (str) $watermark: The watermark image + # (str) $pos: Could be a pre-determined position such as: + # tl = top left, + # t = top (middle), + # tr = top right, + # l = left, + # m = middle, + # r = right, + # bl = bottom left, + # b = bottom (middle), + # br = bottom right + # Or, it could be a co-ordinate position such as: 50x100 + # + # (int) $padding: If using a pre-determined position you can + # adjust the padding from the edges by passing an amount + # in pixels. If using co-ordinates, this value is ignored. + # Param out: + # Reference: http://www.php.net/manual/en/image.examples-watermark.php + # Notes: Based on example in reference.# + # + + + // Load the stamp and the photo to apply the watermark to + $stamp = $this->openImage($watermarkImage); # stamp + $im = $this->imageResized; # photo + // *** Get stamps width and height + $sx = imagesx($stamp); + $sy = imagesy($stamp); + + // *** Find co-ords to place image + $posArray = $this->calculatePosition($pos, $padding, $sx, $sy); + $x = $posArray['width']; + $y = $posArray['height']; + + // *** Set watermark opacity + if (fix_strtolower(strrchr($watermarkImage, '.')) == '.png') { + + $opacity = $this->invertTransparency($opacity, 100); + $this->filterOpacity($stamp, $opacity); + } + + // Copy the watermark image onto our photo + imagecopy($im, $stamp, $x, $y, 0, 0, imagesx($stamp), imagesy($stamp)); + } + + ## -------------------------------------------------------- + + private function calculatePosition($pos, $padding, $assetWidth, $assetHeight, $upperLeft = true) { + # + # Author: Jarrod Oberto + # Date: 08-05-11 + # Purpose: Calculate the x, y pixel cordinates of the asset to place + # Params in: (str) $pos: Either something like: "tl", "l", "br" or an + # exact position like: "100x50" + # (int) $padding: The amount of padding from the edge. Only + # used for the predefined $pos. + # (int) $assetWidth: The width of the asset to add to the image + # (int) $assetHeight: The height of the asset to add to the image + # (bol) $upperLeft: if true, the asset will be positioned based + # on the upper left x, y coords. If false, it means you're + # using the lower left as the basepoint and this will + # convert it to the upper left position + # Params out: + # NOTE: this is done from the UPPER left corner!! But will convert lower + # left basepoints to upper left if $upperleft is set to false# + # + + $pos = fix_strtolower($pos); + + // *** If co-ords have been entered + if (strstr($pos, 'x')) { + $pos = str_replace(' ', '', $pos); + + $xyArray = explode('x', $pos); + list($width, $height) = $xyArray; + } else { + + switch ($pos) { + case 'tl': + $width = 0 + $padding; + $height = 0 + $padding; + break; + + case 't': + $width = ($this->width / 2) - ($assetWidth / 2); + $height = 0 + $padding; + break; + + case 'tr': + $width = $this->width - $assetWidth - $padding; + $height = 0 + $padding; + ; + break; + + case 'l': + $width = 0 + $padding; + $height = ($this->height / 2) - ($assetHeight / 2); + break; + + case 'm': + $width = ($this->width / 2) - ($assetWidth / 2); + $height = ($this->height / 2) - ($assetHeight / 2); + break; + + case 'r': + $width = $this->width - $assetWidth - $padding; + $height = ($this->height / 2) - ($assetHeight / 2); + break; + + case 'bl': + $width = 0 + $padding; + $height = $this->height - $assetHeight - $padding; + break; + + case 'b': + $width = ($this->width / 2) - ($assetWidth / 2); + $height = $this->height - $assetHeight - $padding; + break; + + case 'br': + $width = $this->width - $assetWidth - $padding; + $height = $this->height - $assetHeight - $padding; + break; + + default: + $width = 0; + $height = 0; + break; + } + } + + if (!$upperLeft) { + $height = $height + $assetHeight; + } + + return array('width' => $width, 'height' => $height); + } + + ## -------------------------------------------------------- + + private function filterOpacity(&$img, $opacity = 75) { + # + # Author: aiden dot mail at freemail dot hu + # Author date: 29-03-08 08:16 + # Date added: 08-05-11 + # Purpose: Change opacity of image + # Params in: $img: Image resource id + # (int) $opacity: the opacity amount: 0-100, 100 being not opaque. + # Params out: (bool) true on success, else false + # Ref: http://www.php.net/manual/en/function.imagefilter.php#82162 + # Notes: png only# + + + if (!isset($opacity)) { + return false; + } + + if ($opacity == 100) { + return true; + } + + $opacity /= 100; + + //get image width and height + $w = imagesx($img); + $h = imagesy($img); + + //turn alpha blending off + imagealphablending($img, false); + + //find the most opaque pixel in the image (the one with the smallest alpha value) + $minalpha = 127; + for ($x = 0; $x < $w; $x++) { + for ($y = 0; $y < $h; $y++) { + $alpha = (imagecolorat($img, $x, $y) >> 24) & 0xFF; + if ($alpha < $minalpha) { + $minalpha = $alpha; + } + } + } + + //loop through image pixels and modify alpha for each + for ($x = 0; $x < $w; $x++) { + for ($y = 0; $y < $h; $y++) { + //get current alpha value (represents the TANSPARENCY!) + $colorxy = imagecolorat($img, $x, $y); + $alpha = ($colorxy >> 24) & 0xFF; + //calculate new alpha + if ($minalpha !== 127) { + $alpha = 127 + 127 * $opacity * ($alpha - 127) / (127 - $minalpha); + } else { + $alpha += 127 * $opacity; + } + //get the color index with new alpha + $alphacolorxy = imagecolorallocatealpha($img, ($colorxy >> 16) & 0xFF, ($colorxy >> 8) & 0xFF, $colorxy & 0xFF, $alpha); + //set pixel with the new color + opacity + if (!imagesetpixel($img, $x, $y, $alphacolorxy)) { + + return false; + } + } + } + + return true; + } - return $font; +## -------------------------------------------------------- - } + private function openImage($file) { + # Author: Jarrod Oberto + # Date: 27-02-08 + # Purpose: + # Param in: + # Param out: n/a + # Reference: + # Notes:# + + + if (!file_exists($file) && !$this->checkStringStartsWith('http://', $file) && !$this->checkStringStartsWith('https://', $file)) { + if ($this->debug) { + throw new Exception('Image not found.'); + } else { + throw new Exception(); + } + }; + + // *** Get extension + $extension = strrchr($file, '.'); + $extension = fix_strtolower($extension); + switch ($extension) { + case '.jpg': + case '.jpeg': + $img = @imagecreatefromjpeg($file); + break; + case '.gif': + $img = @imagecreatefromgif($file); + break; + case '.png': + $img = @imagecreatefrompng($file); + break; + case '.bmp': + $img = @$this->imagecreatefrombmp($file); + break; + case '.psd': + $img = @$this->imagecreatefrompsd($file); + break; + + + // ... etc + + default: + $img = false; + break; + } + return $img; + } - ## -------------------------------------------------------- +## -------------------------------------------------------- - private function getTextSize($fontSize, $angle, $font, $text) - { + public function reset() { + # + # Author: Jarrod Oberto + # Date: 30-08-11 + # Purpose: Reset the resource (allow further editing) + # Params in: + # Params out: + # Notes:# - // *** Define box (so we can get the width) - $box = @imageTTFBbox($fontSize, $angle, $font, $text); + $this->__construct($this->fileName); + } - // *** Get width of text from dimensions - $textWidth = abs($box[4] - $box[0]); +## -------------------------------------------------------- - // *** Get height of text from dimensions (should also be same as $fontSize) - $textHeight = abs($box[5] - $box[1]); + public function saveImage($savePath, $imageQuality = "100") { + # Author: Jarrod Oberto + # Date: 27-02-08 + # Purpose: Saves the image + # Param in: $savePath: Where to save the image including filename: + # $imageQuality: image quality you want the image saved at 0-100 + # Param out: n/a + # Reference: + # Notes: * gif doesn't have a quality parameter + # * jpg has a quality setting 0-100 (100 being the best) + # * png has a quality setting 0-9 (0 being the best) + # + # * bmp files have no native support for bmp files. We use a + # third party class to save as bmp. + // *** Perform a check or two. + if (!is_resource($this->imageResized)) { + if ($this->debug) { + throw new Exception('saveImage: This is not a resource.'); + } else { + throw new Exception(); + } + } + $fileInfoArray = pathInfo($savePath); + clearstatcache(); + if (!is_writable($fileInfoArray['dirname'])) { + if ($this->debug) { + throw new Exception('The path is not writable. Please check your permissions.'); + } else { + throw new Exception(); + } + } + + // *** Get extension + $extension = strrchr($savePath, '.'); + $extension = fix_strtolower($extension); + + $error = ''; + + switch ($extension) { + case '.jpg': + case '.jpeg': + $this->checkInterlaceImage($this->isInterlace); + if (imagetypes() & IMG_JPG) { + imagejpeg($this->imageResized, $savePath, $imageQuality); + } else { + $error = 'jpg'; + } + break; + + case '.gif': + $this->checkInterlaceImage($this->isInterlace); + if (imagetypes() & IMG_GIF) { + imagegif($this->imageResized, $savePath); + } else { + $error = 'gif'; + } + break; + + case '.png': + // *** Scale quality from 0-100 to 0-9 + $scaleQuality = round(($imageQuality / 100) * 9); + + // *** Invert qualit setting as 0 is best, not 9 + $invertScaleQuality = 9 - $scaleQuality; + + $this->checkInterlaceImage($this->isInterlace); + if (imagetypes() & IMG_PNG) { + imagepng($this->imageResized, $savePath, $invertScaleQuality); + } else { + $error = 'png'; + } + break; + + case '.bmp': + file_put_contents($savePath, $this->GD2BMPstring($this->imageResized)); + break; + + + // ... etc + + default: + // *** No extension - No save. + $this->errorArray[] = 'This file type (' . $extension . ') is not supported. File not saved.'; + break; + } + + //imagedestroy($this->imageResized); + // *** Display error if a file type is not supported. + if ($error != '') { + $this->errorArray[] = $error . ' support is NOT enabled. File not saved.'; + } + } - return array( 'height' => $textHeight, 'width' => $textWidth ); - } +## -------------------------------------------------------- + public function displayImage($fileType = 'jpg', $imageQuality = "100") { + # Author: Jarrod Oberto + # Date: 18-11-09 + # Purpose: Display images directly to the browser + # Param in: The image type you want to display + # Param out: + # Reference: + # Notes:# + + + if (!is_resource($this->imageResized)) { + if ($this->debug) { + throw new Exception('saveImage: This is not a resource.'); + } else { + throw new Exception(); + } + } + + switch ($fileType) { + case 'jpg': + case 'jpeg': + header('Content-type: image/jpeg'); + imagejpeg($this->imageResized, '', $imageQuality); + break; + case 'gif': + header('Content-type: image/gif'); + imagegif($this->imageResized); + break; + case 'png': + header('Content-type: image/png'); + + // *** Scale quality from 0-100 to 0-9 + $scaleQuality = round(($imageQuality / 100) * 9); + + // *** Invert qualit setting as 0 is best, not 9 + $invertScaleQuality = 9 - $scaleQuality; + + imagepng($this->imageResized, '', $invertScaleQuality); + break; + case 'bmp': + echo 'bmp file format is not supported.'; + break; + + // ... etc + + default: + // *** No extension - No save. + break; + } + + + //imagedestroy($this->imageResized); + } - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - Add Watermark -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ +## -------------------------------------------------------- - public function addWatermark($watermarkImage, $pos, $padding = 0, $opacity = 0) - # Author: Jarrod Oberto - # Date: 18-11-09 - # Purpose: Add watermark image - # Param in: (str) $watermark: The watermark image - # (str) $pos: Could be a pre-determined position such as: - # tl = top left, - # t = top (middle), - # tr = top right, - # l = left, - # m = middle, - # r = right, - # bl = bottom left, - # b = bottom (middle), - # br = bottom right - # Or, it could be a co-ordinate position such as: 50x100 - # - # (int) $padding: If using a pre-determined position you can - # adjust the padding from the edges by passing an amount - # in pixels. If using co-ordinates, this value is ignored. - # Param out: - # Reference: http://www.php.net/manual/en/image.examples-watermark.php - # Notes: Based on example in reference. - # - # - { + public function setTransparency($bool) { + # Sep 2011 + $this->keepTransparency = $bool; + } - // Load the stamp and the photo to apply the watermark to - $stamp = $this->openImage($watermarkImage); # stamp - $im = $this->imageResized; # photo +## -------------------------------------------------------- - // *** Get stamps width and height - $sx = imagesx($stamp); - $sy = imagesy($stamp); + public function setFillColor($value) { + # Sep 2011 + # Param in: (mixed) $value: (array) Could be an array of RGB + # (str) Could be hex #ffffff or #fff, fff, ffffff + # + # If the keepTransparency is set to false, then no transparency is to be used. + # This is ideal when you want to save as jpg. + # + # this method allows you to set the background color to use instead of + # transparency.# - // *** Find co-ords to place image - $posArray = $this->calculatePosition($pos, $padding, $sx, $sy); - $x = $posArray['width']; - $y = $posArray['height']; + $colorArray = $this->formatColor($value); + $this->fillColorArray = $colorArray; + } - // *** Set watermark opacity - if (fix_strtolower(strrchr($watermarkImage, '.')) == '.png') - { +## -------------------------------------------------------- - $opacity = $this->invertTransparency($opacity, 100); - $this->filterOpacity($stamp, $opacity); - } + public function setCropFromTop($value) { + # Sep 2011 + $this->cropFromTopPercent = $value; + } - // Copy the watermark image onto our photo - imagecopy($im, $stamp, $x, $y, 0, 0, imagesx($stamp), imagesy($stamp)); +## -------------------------------------------------------- - } + public function testGDInstalled() { + # Author: Jarrod Oberto + # Date: 27-02-08 + # Purpose: Test to see if GD is installed + # Param in: n/a + # Param out: (bool) True is gd extension loaded otherwise false + # Reference: + # Notes:# - ## -------------------------------------------------------- + if (extension_loaded('gd') && function_exists('gd_info')) { + $gdInstalled = true; + } else { + $gdInstalled = false; + } - private function calculatePosition($pos, $padding, $assetWidth, $assetHeight, $upperLeft = true) - # - # Author: Jarrod Oberto - # Date: 08-05-11 - # Purpose: Calculate the x, y pixel cordinates of the asset to place - # Params in: (str) $pos: Either something like: "tl", "l", "br" or an - # exact position like: "100x50" - # (int) $padding: The amount of padding from the edge. Only - # used for the predefined $pos. - # (int) $assetWidth: The width of the asset to add to the image - # (int) $assetHeight: The height of the asset to add to the image - # (bol) $upperLeft: if true, the asset will be positioned based - # on the upper left x, y coords. If false, it means you're - # using the lower left as the basepoint and this will - # convert it to the upper left position - # Params out: - # NOTE: this is done from the UPPER left corner!! But will convert lower - # left basepoints to upper left if $upperleft is set to false - # - # - { - $pos = fix_strtolower($pos); - - // *** If co-ords have been entered - if (strstr($pos, 'x')) - { - $pos = str_replace(' ', '', $pos); - - $xyArray = explode('x', $pos); - list($width, $height) = $xyArray; - - } - else - { - - switch ($pos) - { - case 'tl': - $width = 0 + $padding; - $height = 0 + $padding; - break; - - case 't': - $width = ($this->width / 2) - ($assetWidth / 2); - $height = 0 + $padding; - break; - - case 'tr': - $width = $this->width - $assetWidth - $padding; - $height = 0 + $padding;; - break; - - case 'l': - $width = 0 + $padding; - $height = ($this->height / 2) - ($assetHeight / 2); - break; - - case 'm': - $width = ($this->width / 2) - ($assetWidth / 2); - $height = ($this->height / 2) - ($assetHeight / 2); - break; - - case 'r': - $width = $this->width - $assetWidth - $padding; - $height = ($this->height / 2) - ($assetHeight / 2); - break; - - case 'bl': - $width = 0 + $padding; - $height = $this->height - $assetHeight - $padding; - break; - - case 'b': - $width = ($this->width / 2) - ($assetWidth / 2); - $height = $this->height - $assetHeight - $padding; - break; - - case 'br': - $width = $this->width - $assetWidth - $padding; - $height = $this->height - $assetHeight - $padding; - break; - - default: - $width = 0; - $height = 0; - break; - } - } - - if ( ! $upperLeft) - { - $height = $height + $assetHeight; - } - - return array( 'width' => $width, 'height' => $height ); - } - - - ## -------------------------------------------------------- - - private function filterOpacity(&$img, $opacity = 75) - # - # Author: aiden dot mail at freemail dot hu - # Author date: 29-03-08 08:16 - # Date added: 08-05-11 - # Purpose: Change opacity of image - # Params in: $img: Image resource id - # (int) $opacity: the opacity amount: 0-100, 100 being not opaque. - # Params out: (bool) true on success, else false - # Ref: http://www.php.net/manual/en/function.imagefilter.php#82162 - # Notes: png only - # - { - - if ( ! isset($opacity)) - { - return false; - } - - if ($opacity == 100) - { - return true; - } - - $opacity /= 100; - - //get image width and height - $w = imagesx($img); - $h = imagesy($img); - - //turn alpha blending off - imagealphablending($img, false); - - //find the most opaque pixel in the image (the one with the smallest alpha value) - $minalpha = 127; - for ($x = 0; $x < $w; $x++) - { - for ($y = 0; $y < $h; $y++) - { - $alpha = (imagecolorat($img, $x, $y) >> 24) & 0xFF; - if ($alpha < $minalpha) - { - $minalpha = $alpha; - } - } - } - - //loop through image pixels and modify alpha for each - for ($x = 0; $x < $w; $x++) - { - for ($y = 0; $y < $h; $y++) - { - //get current alpha value (represents the TANSPARENCY!) - $colorxy = imagecolorat($img, $x, $y); - $alpha = ($colorxy >> 24) & 0xFF; - //calculate new alpha - if ($minalpha !== 127) - { - $alpha = 127 + 127 * $opacity * ($alpha - 127) / (127 - $minalpha); - } - else - { - $alpha += 127 * $opacity; - } - //get the color index with new alpha - $alphacolorxy = imagecolorallocatealpha($img, ($colorxy >> 16) & 0xFF, ($colorxy >> 8) & 0xFF, $colorxy & 0xFF, $alpha); - //set pixel with the new color + opacity - if ( ! imagesetpixel($img, $x, $y, $alphacolorxy)) - { - - return false; - } - } - } - - return true; - } + return $gdInstalled; + } ## -------------------------------------------------------- - private function openImage($file) - # Author: Jarrod Oberto - # Date: 27-02-08 - # Purpose: - # Param in: - # Param out: n/a - # Reference: - # Notes: - # - { - - if ( ! file_exists($file) && ! $this->checkStringStartsWith('http://', $file) && ! $this->checkStringStartsWith('https://', $file) ) - { - if ($this->debug) - { - throw new Exception('Image not found.'); - } - else - { - throw new Exception(); - } - }; - - // *** Get extension - $extension = strrchr($file, '.'); - $extension = fix_strtolower($extension); - switch ($extension) - { - case '.jpg': - case '.jpeg': - $img = @imagecreatefromjpeg($file); - break; - case '.gif': - $img = @imagecreatefromgif($file); - break; - case '.png': - $img = @imagecreatefrompng($file); - break; - case '.bmp': - $img = @$this->imagecreatefrombmp($file); - break; - case '.psd': - $img = @$this->imagecreatefrompsd($file); - break; - - - // ... etc - - default: - $img = false; - break; - } - - return $img; - } + public function testEXIFInstalled() { + # Author: Jarrod Oberto + # Date: 08-05-11 + # Purpose: Test to see if EXIF is installed + # Param in: n/a + # Param out: (bool) True is exif extension loaded otherwise false + # Reference: + # Notes:# -## -------------------------------------------------------- + if (extension_loaded('exif')) { + $exifInstalled = true; + } else { + $exifInstalled = false; + } - public function reset() - # - # Author: Jarrod Oberto - # Date: 30-08-11 - # Purpose: Reset the resource (allow further editing) - # Params in: - # Params out: - # Notes: - # - { - $this->__construct($this->fileName); - } + return $exifInstalled; + } ## -------------------------------------------------------- - public function saveImage($savePath, $imageQuality = "100") - # Author: Jarrod Oberto - # Date: 27-02-08 - # Purpose: Saves the image - # Param in: $savePath: Where to save the image including filename: - # $imageQuality: image quality you want the image saved at 0-100 - # Param out: n/a - # Reference: - # Notes: * gif doesn't have a quality parameter - # * jpg has a quality setting 0-100 (100 being the best) - # * png has a quality setting 0-9 (0 being the best) - # - # * bmp files have no native support for bmp files. We use a - # third party class to save as bmp. - { - - // *** Perform a check or two. - if ( ! is_resource($this->imageResized)) - { - if ($this->debug) - { - throw new Exception('saveImage: This is not a resource.'); - } - else - { - throw new Exception(); - } - } - $fileInfoArray = pathInfo($savePath); - clearstatcache(); - if ( ! is_writable($fileInfoArray['dirname'])) - { - if ($this->debug) - { - throw new Exception('The path is not writable. Please check your permissions.'); - } - else - { - throw new Exception(); - } - } - - // *** Get extension - $extension = strrchr($savePath, '.'); - $extension = fix_strtolower($extension); - - $error = ''; - - switch ($extension) - { - case '.jpg': - case '.jpeg': - $this->checkInterlaceImage($this->isInterlace); - if (imagetypes() & IMG_JPG) - { - imagejpeg($this->imageResized, $savePath, $imageQuality); - } - else - { - $error = 'jpg'; - } - break; - - case '.gif': - $this->checkInterlaceImage($this->isInterlace); - if (imagetypes() & IMG_GIF) - { - imagegif($this->imageResized, $savePath); - } - else - { - $error = 'gif'; - } - break; - - case '.png': - // *** Scale quality from 0-100 to 0-9 - $scaleQuality = round(($imageQuality / 100) * 9); - - // *** Invert qualit setting as 0 is best, not 9 - $invertScaleQuality = 9 - $scaleQuality; - - $this->checkInterlaceImage($this->isInterlace); - if (imagetypes() & IMG_PNG) - { - imagepng($this->imageResized, $savePath, $invertScaleQuality); - } - else - { - $error = 'png'; - } - break; - - case '.bmp': - file_put_contents($savePath, $this->GD2BMPstring($this->imageResized)); - break; - - - // ... etc - - default: - // *** No extension - No save. - $this->errorArray[] = 'This file type (' . $extension . ') is not supported. File not saved.'; - break; - } - - //imagedestroy($this->imageResized); - - // *** Display error if a file type is not supported. - if ($error != '') - { - $this->errorArray[] = $error . ' support is NOT enabled. File not saved.'; - } - } + public function testIsImage($image) { + # Author: Jarrod Oberto + # Date: 27-02-08 + # Purpose: Test if file is an image + # Param in: n/a + # Param out: n/a + # Reference: + # Notes:# -## -------------------------------------------------------- + if ($image) { + $fileIsImage = true; + } else { + $fileIsImage = false; + } - public function displayImage($fileType = 'jpg', $imageQuality = "100") - # Author: Jarrod Oberto - # Date: 18-11-09 - # Purpose: Display images directly to the browser - # Param in: The image type you want to display - # Param out: - # Reference: - # Notes: - # - { - - if ( ! is_resource($this->imageResized)) - { - if ($this->debug) - { - throw new Exception('saveImage: This is not a resource.'); - } - else - { - throw new Exception(); - } - } - - switch ($fileType) - { - case 'jpg': - case 'jpeg': - header('Content-type: image/jpeg'); - imagejpeg($this->imageResized, '', $imageQuality); - break; - case 'gif': - header('Content-type: image/gif'); - imagegif($this->imageResized); - break; - case 'png': - header('Content-type: image/png'); - - // *** Scale quality from 0-100 to 0-9 - $scaleQuality = round(($imageQuality / 100) * 9); - - // *** Invert qualit setting as 0 is best, not 9 - $invertScaleQuality = 9 - $scaleQuality; - - imagepng($this->imageResized, '', $invertScaleQuality); - break; - case 'bmp': - echo 'bmp file format is not supported.'; - break; - - // ... etc - - default: - // *** No extension - No save. - break; - } - - - //imagedestroy($this->imageResized); - } + return $fileIsImage; + } ## -------------------------------------------------------- - public function setTransparency($bool) - # Sep 2011 - { - $this->keepTransparency = $bool; - } + public function testFunct() { + # Author: Jarrod Oberto + # Date: 27-02-08 + # Purpose: Test Function + # Param in: n/a + # Param out: n/a + # Reference: + # Notes:# -## -------------------------------------------------------- - - public function setFillColor($value) - # Sep 2011 - # Param in: (mixed) $value: (array) Could be an array of RGB - # (str) Could be hex #ffffff or #fff, fff, ffffff - # - # If the keepTransparency is set to false, then no transparency is to be used. - # This is ideal when you want to save as jpg. - # - # this method allows you to set the background color to use instead of - # transparency. - # - { - $colorArray = $this->formatColor($value); - $this->fillColorArray = $colorArray; - } + echo $this->height; + } ## -------------------------------------------------------- - public function setCropFromTop($value) - # Sep 2011 - { - $this->cropFromTopPercent = $value; - } - -## -------------------------------------------------------- + public function setForceStretch($value) { + # Author: Jarrod Oberto + # Date: 23-12-10 + # Purpose: + # Param in: (bool) $value + # Param out: n/a + # Reference: + # Notes:# - public function testGDInstalled() - # Author: Jarrod Oberto - # Date: 27-02-08 - # Purpose: Test to see if GD is installed - # Param in: n/a - # Param out: (bool) True is gd extension loaded otherwise false - # Reference: - # Notes: - # - { - if (extension_loaded('gd') && function_exists('gd_info')) - { - $gdInstalled = true; - } - else - { - $gdInstalled = false; - } - - return $gdInstalled; - } + $this->forceStretch = $value; + } ## -------------------------------------------------------- - public function testEXIFInstalled() - # Author: Jarrod Oberto - # Date: 08-05-11 - # Purpose: Test to see if EXIF is installed - # Param in: n/a - # Param out: (bool) True is exif extension loaded otherwise false - # Reference: - # Notes: - # - { - if (extension_loaded('exif')) - { - $exifInstalled = true; - } - else - { - $exifInstalled = false; - } - - return $exifInstalled; - } + public function setFile($fileName) { + # Author: Jarrod Oberto + # Date: 28-02-08 + # Purpose: + # Param in: n/a + # Param out: n/a + # Reference: + # Notes:# -## -------------------------------------------------------- - - public function testIsImage($image) - # Author: Jarrod Oberto - # Date: 27-02-08 - # Purpose: Test if file is an image - # Param in: n/a - # Param out: n/a - # Reference: - # Notes: - # - { - if ($image) - { - $fileIsImage = true; - } - else - { - $fileIsImage = false; - } - - return $fileIsImage; - } + self::__construct($fileName); + } ## -------------------------------------------------------- - public function testFunct() - # Author: Jarrod Oberto - # Date: 27-02-08 - # Purpose: Test Function - # Param in: n/a - # Param out: n/a - # Reference: - # Notes: - # - { - echo $this->height; - } + public function getFileName() { + # Author: Jarrod Oberto + # Date: 10-09-08 + # Purpose: + # Param in: n/a + # Param out: n/a + # Reference: + # Notes:# -## -------------------------------------------------------- - - public function setForceStretch($value) - # Author: Jarrod Oberto - # Date: 23-12-10 - # Purpose: - # Param in: (bool) $value - # Param out: n/a - # Reference: - # Notes: - # - { - $this->forceStretch = $value; - } + return $this->fileName; + } ## -------------------------------------------------------- - public function setFile($fileName) - # Author: Jarrod Oberto - # Date: 28-02-08 - # Purpose: - # Param in: n/a - # Param out: n/a - # Reference: - # Notes: - # - { - self::__construct($fileName); - } + public function getHeight() { + return $this->height; + } ## -------------------------------------------------------- - public function getFileName() - # Author: Jarrod Oberto - # Date: 10-09-08 - # Purpose: - # Param in: n/a - # Param out: n/a - # Reference: - # Notes: - # - { - return $this->fileName; - } + public function getWidth() { + return $this->width; + } ## -------------------------------------------------------- - public function getHeight() - { - return $this->height; - } + public function getOriginalHeight() { + return $this->heightOriginal; + } ## -------------------------------------------------------- - public function getWidth() - { - return $this->width; - } + public function getOriginalWidth() { + return $this->widthOriginal; + } ## -------------------------------------------------------- - public function getOriginalHeight() - { - return $this->heightOriginal; - } - -## -------------------------------------------------------- + public function getErrors() { + # Author: Jarrod Oberto + # Date: 19-11-09 + # Purpose: Returns the error array + # Param in: n/a + # Param out: Array of errors + # Reference: + # Notes:# - public function getOriginalWidth() - { - return $this->widthOriginal; - } + return $this->errorArray; + } ## -------------------------------------------------------- - public function getErrors() - # Author: Jarrod Oberto - # Date: 19-11-09 - # Purpose: Returns the error array - # Param in: n/a - # Param out: Array of errors - # Reference: - # Notes: - # - { - return $this->errorArray; - } + private function checkInterlaceImage($isEnabled) { + # jpg will use progressive (they don't use interace) + if ($isEnabled) { + imageinterlace($this->imageResized, $isEnabled); + } + } ## -------------------------------------------------------- - private function checkInterlaceImage($isEnabled) - # jpg will use progressive (they don't use interace) - { - if ($isEnabled) - { - imageinterlace($this->imageResized, $isEnabled); - } - } + protected function formatColor($value) { + # Author: Jarrod Oberto + # Date: 09-05-11 + # Purpose: Determine color method passed in and return color as RGB + # Param in: (mixed) $value: (array) Could be an array of RGB + # (str) Could be hex #ffffff or #fff, fff, ffffff + # Param out: + # Reference: + # Notes:# + + $rgbArray = array(); + + // *** If it's an array it should be R, G, B + if (is_array($value)) { + + if (key($value) == 0 && count($value) == 3) { + + $rgbArray['r'] = $value[0]; + $rgbArray['g'] = $value[1]; + $rgbArray['b'] = $value[2]; + } else { + $rgbArray = $value; + } + } else { + if (fix_strtolower($value) == 'transparent') { + + $rgbArray = array( + 'r' => 255, + 'g' => 255, + 'b' => 255, + 'a' => 127 + ); + } else { -## -------------------------------------------------------- - - protected function formatColor($value) - # Author: Jarrod Oberto - # Date: 09-05-11 - # Purpose: Determine color method passed in and return color as RGB - # Param in: (mixed) $value: (array) Could be an array of RGB - # (str) Could be hex #ffffff or #fff, fff, ffffff - # Param out: - # Reference: - # Notes: - # - { - $rgbArray = array(); - - // *** If it's an array it should be R, G, B - if (is_array($value)) - { - - if (key($value) == 0 && count($value) == 3) - { - - $rgbArray['r'] = $value[0]; - $rgbArray['g'] = $value[1]; - $rgbArray['b'] = $value[2]; - - } - else - { - $rgbArray = $value; - } - } - else - { - if (fix_strtolower($value) == 'transparent') - { - - $rgbArray = array( - 'r' => 255, - 'g' => 255, - 'b' => 255, - 'a' => 127 - ); - - } - else - { - - // *** ...Else it should be hex. Let's make it RGB - $rgbArray = $this->hex2dec($value); - } - } - - return $rgbArray; - } - - ## -------------------------------------------------------- - - function hex2dec($hex) - # Purpose: Convert #hex color to RGB - { - $color = str_replace('#', '', $hex); - - if (strlen($color) == 3) - { - $color = $color . $color; - } - - $rgb = array( - 'r' => hexdec(substr($color, 0, 2)), - 'g' => hexdec(substr($color, 2, 2)), - 'b' => hexdec(substr($color, 4, 2)), - 'a' => 0 - ); - - return $rgb; - } - - ## -------------------------------------------------------- - - private function createImageColor($colorArray) - { - $r = $colorArray['r']; - $g = $colorArray['g']; - $b = $colorArray['b']; - - return imagecolorallocate($this->imageResized, $r, $g, $b); - } - - ## -------------------------------------------------------- - - private function testColorExists($colorArray) - { - $r = $colorArray['r']; - $g = $colorArray['g']; - $b = $colorArray['b']; - - if (imagecolorexact($this->imageResized, $r, $g, $b) == -1) - { - return false; - } - else - { - return true; - } - } - - ## -------------------------------------------------------- - - private function findUnusedGreen() - # Purpose: We find a green color suitable to use like green-screen effect. - # Therefore, the color must not exist in the image. - { - $green = 255; - - do - { - - $greenChroma = array( 0, $green, 0 ); - $colorArray = $this->formatColor($greenChroma); - $match = $this->testColorExists($colorArray); - $green--; - - } while ($match == false && $green > 0); - - // *** If no match, just bite the bullet and use green value of 255 - if ( ! $match) - { - $greenChroma = array( 0, $green, 0 ); - } - - return $greenChroma; - } - - ## -------------------------------------------------------- - - private function findUnusedBlue() - # Purpose: We find a green color suitable to use like green-screen effect. - # Therefore, the color must not exist in the image. - { - $blue = 255; - - do - { - - $blueChroma = array( 0, 0, $blue ); - $colorArray = $this->formatColor($blueChroma); - $match = $this->testColorExists($colorArray); - $blue--; - - } while ($match == false && $blue > 0); - - // *** If no match, just bite the bullet and use blue value of 255 - if ( ! $match) - { - $blueChroma = array( 0, 0, $blue ); - } - - return $blueChroma; - } - - ## -------------------------------------------------------- - - private function invertTransparency($value, $originalMax, $invert = true) - # Purpose: This does two things: - # 1) Convert the range from 0-127 to 0-100 - # 2) Inverts value to 100 is not transparent while 0 is fully - # transparent (like Photoshop) - { - // *** Test max range - if ($value > $originalMax) - { - $value = $originalMax; - } - - // *** Test min range - if ($value < 0) - { - $value = 0; - } - - if ($invert) - { - return $originalMax - (($value / 100) * $originalMax); - } - else - { - return ($value / 100) * $originalMax; - } - } - - ## -------------------------------------------------------- - - private function transparentImage($src) - { - // *** making images with white bg transparent - $r1 = 0; - $g1 = 255; - $b1 = 0; - for ($x = 0; $x < imagesx($src); ++$x) - { - for ($y = 0; $y < imagesy($src); ++$y) - { - $color = imagecolorat($src, $x, $y); - $r = ($color >> 16) & 0xFF; - $g = ($color >> 8) & 0xFF; - $b = $color & 0xFF; - for ($i = 0; $i < 270; $i++) - { - //if ($r . $g . $b == ($r1 + $i) . ($g1 + $i) . ($b1 + $i)) { - if ($r == 0 && $g == 255 && $b == 0) - { - //if ($g == 255) { - $trans_colour = imagecolorallocatealpha($src, 0, 0, 0, 127); - imagefill($src, $x, $y, $trans_colour); - } - } - } - } - - return $src; - } - - ## -------------------------------------------------------- - - function checkStringStartsWith($needle, $haystack) - # Check if a string starts with a specific pattern - { - return (substr($haystack, 0, strlen($needle)) == $needle); - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - BMP SUPPORT (SAVING) - James Heinrich -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - private function GD2BMPstring(&$gd_image) - # Author: James Heinrich - # Purpose: Save file as type bmp - # Param in: The image canvas (passed as ref) - # Param out: - # Reference: - # Notes: This code was stripped out of two external files - # (phpthumb.bmp.php,phpthumb.functions.php) and added below to - # avoid dependancies. - # - { - $imageX = ImageSX($gd_image); - $imageY = ImageSY($gd_image); - - $BMP = ''; - for ($y = ($imageY - 1); $y >= 0; $y--) - { - $thisline = ''; - for ($x = 0; $x < $imageX; $x++) - { - $argb = $this->GetPixelColor($gd_image, $x, $y); - $thisline .= chr($argb['blue']) . chr($argb['green']) . chr($argb['red']); - } - while (strlen($thisline) % 4) - { - $thisline .= "\x00"; - } - $BMP .= $thisline; - } - - $bmpSize = strlen($BMP) + 14 + 40; - // BITMAPFILEHEADER [14 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_62uq.asp - $BITMAPFILEHEADER = 'BM'; // WORD bfType; - $BITMAPFILEHEADER .= $this->LittleEndian2String($bmpSize, 4); // DWORD bfSize; - $BITMAPFILEHEADER .= $this->LittleEndian2String(0, 2); // WORD bfReserved1; - $BITMAPFILEHEADER .= $this->LittleEndian2String(0, 2); // WORD bfReserved2; - $BITMAPFILEHEADER .= $this->LittleEndian2String(54, 4); // DWORD bfOffBits; - - // BITMAPINFOHEADER - [40 bytes] http://msdn.microsoft.com/library/en-us/gdi/bitmaps_1rw2.asp - $BITMAPINFOHEADER = $this->LittleEndian2String(40, 4); // DWORD biSize; - $BITMAPINFOHEADER .= $this->LittleEndian2String($imageX, 4); // LONG biWidth; - $BITMAPINFOHEADER .= $this->LittleEndian2String($imageY, 4); // LONG biHeight; - $BITMAPINFOHEADER .= $this->LittleEndian2String(1, 2); // WORD biPlanes; - $BITMAPINFOHEADER .= $this->LittleEndian2String(24, 2); // WORD biBitCount; - $BITMAPINFOHEADER .= $this->LittleEndian2String(0, 4); // DWORD biCompression; - $BITMAPINFOHEADER .= $this->LittleEndian2String(0, 4); // DWORD biSizeImage; - $BITMAPINFOHEADER .= $this->LittleEndian2String(2835, 4); // LONG biXPelsPerMeter; - $BITMAPINFOHEADER .= $this->LittleEndian2String(2835, 4); // LONG biYPelsPerMeter; - $BITMAPINFOHEADER .= $this->LittleEndian2String(0, 4); // DWORD biClrUsed; - $BITMAPINFOHEADER .= $this->LittleEndian2String(0, 4); // DWORD biClrImportant; - - return $BITMAPFILEHEADER . $BITMAPINFOHEADER . $BMP; - } + // *** ...Else it should be hex. Let's make it RGB + $rgbArray = $this->hex2dec($value); + } + } + + return $rgbArray; + } + + ## -------------------------------------------------------- + + function hex2dec($hex) { + # Purpose: Convert #hex color to RGB + $color = str_replace('#', '', $hex); + + if (strlen($color) == 3) { + $color = $color . $color; + } + + $rgb = array( + 'r' => hexdec(substr($color, 0, 2)), + 'g' => hexdec(substr($color, 2, 2)), + 'b' => hexdec(substr($color, 4, 2)), + 'a' => 0 + ); + + return $rgb; + } + + ## -------------------------------------------------------- + + private function createImageColor($colorArray) { + $r = $colorArray['r']; + $g = $colorArray['g']; + $b = $colorArray['b']; + + return imagecolorallocate($this->imageResized, $r, $g, $b); + } + + ## -------------------------------------------------------- + + private function testColorExists($colorArray) { + $r = $colorArray['r']; + $g = $colorArray['g']; + $b = $colorArray['b']; + + if (imagecolorexact($this->imageResized, $r, $g, $b) == -1) { + return false; + } else { + return true; + } + } + + ## -------------------------------------------------------- + + private function findUnusedGreen() { + # Purpose: We find a green color suitable to use like green-screen effect. + # Therefore, the color must not exist in the image. + $green = 255; + + do { + + $greenChroma = array(0, $green, 0); + $colorArray = $this->formatColor($greenChroma); + $match = $this->testColorExists($colorArray); + $green--; + } while ($match == false && $green > 0); + + // *** If no match, just bite the bullet and use green value of 255 + if (!$match) { + $greenChroma = array(0, $green, 0); + } + + return $greenChroma; + } + + ## -------------------------------------------------------- + + private function findUnusedBlue() { + # Purpose: We find a green color suitable to use like green-screen effect. + # Therefore, the color must not exist in the image. + $blue = 255; + + do { + + $blueChroma = array(0, 0, $blue); + $colorArray = $this->formatColor($blueChroma); + $match = $this->testColorExists($colorArray); + $blue--; + } while ($match == false && $blue > 0); + + // *** If no match, just bite the bullet and use blue value of 255 + if (!$match) { + $blueChroma = array(0, 0, $blue); + } + + return $blueChroma; + } + + ## -------------------------------------------------------- + + private function invertTransparency($value, $originalMax, $invert = true) { + # Purpose: This does two things: + # 1) Convert the range from 0-127 to 0-100 + # 2) Inverts value to 100 is not transparent while 0 is fully + # transparent (like Photoshop) + // *** Test max range + if ($value > $originalMax) { + $value = $originalMax; + } + + // *** Test min range + if ($value < 0) { + $value = 0; + } + + if ($invert) { + return $originalMax - (($value / 100) * $originalMax); + } else { + return ($value / 100) * $originalMax; + } + } + + ## -------------------------------------------------------- + + private function transparentImage($src) { + // *** making images with white bg transparent + $r1 = 0; + $g1 = 255; + $b1 = 0; + for ($x = 0; $x < imagesx($src); ++$x) { + for ($y = 0; $y < imagesy($src); ++$y) { + $color = imagecolorat($src, $x, $y); + $r = ($color >> 16) & 0xFF; + $g = ($color >> 8) & 0xFF; + $b = $color & 0xFF; + for ($i = 0; $i < 270; $i++) { + //if ($r . $g . $b == ($r1 + $i) . ($g1 + $i) . ($b1 + $i)) { + if ($r == 0 && $g == 255 && $b == 0) { + //if ($g == 255) { + $trans_colour = imagecolorallocatealpha($src, 0, 0, 0, 127); + imagefill($src, $x, $y, $trans_colour); + } + } + } + } + + return $src; + } + + ## -------------------------------------------------------- + + function checkStringStartsWith($needle, $haystack) { + # Check if a string starts with a specific pattern + return (substr($haystack, 0, strlen($needle)) == $needle); + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + BMP SUPPORT (SAVING) - James Heinrich + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + private function GD2BMPstring(&$gd_image) { + # Author: James Heinrich + # Purpose: Save file as type bmp + # Param in: The image canvas (passed as ref) + # Param out: + # Reference: + # Notes: This code was stripped out of two external files + # (phpthumb.bmp.php,phpthumb.functions.php) and added below to + # avoid dependancies.# + + $imageX = ImageSX($gd_image); + $imageY = ImageSY($gd_image); + + $BMP = ''; + for ($y = ($imageY - 1); $y >= 0; $y--) { + $thisline = ''; + for ($x = 0; $x < $imageX; $x++) { + $argb = $this->GetPixelColor($gd_image, $x, $y); + $thisline .= chr($argb['blue']) . chr($argb['green']) . chr($argb['red']); + } + while (strlen($thisline) % 4) { + $thisline .= "\x00"; + } + $BMP .= $thisline; + } + + $bmpSize = strlen($BMP) + 14 + 40; + // BITMAPFILEHEADER [14 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_62uq.asp + $BITMAPFILEHEADER = 'BM'; // WORD bfType; + $BITMAPFILEHEADER .= $this->LittleEndian2String($bmpSize, 4); // DWORD bfSize; + $BITMAPFILEHEADER .= $this->LittleEndian2String(0, 2); // WORD bfReserved1; + $BITMAPFILEHEADER .= $this->LittleEndian2String(0, 2); // WORD bfReserved2; + $BITMAPFILEHEADER .= $this->LittleEndian2String(54, 4); // DWORD bfOffBits; + // BITMAPINFOHEADER - [40 bytes] http://msdn.microsoft.com/library/en-us/gdi/bitmaps_1rw2.asp + $BITMAPINFOHEADER = $this->LittleEndian2String(40, 4); // DWORD biSize; + $BITMAPINFOHEADER .= $this->LittleEndian2String($imageX, 4); // LONG biWidth; + $BITMAPINFOHEADER .= $this->LittleEndian2String($imageY, 4); // LONG biHeight; + $BITMAPINFOHEADER .= $this->LittleEndian2String(1, 2); // WORD biPlanes; + $BITMAPINFOHEADER .= $this->LittleEndian2String(24, 2); // WORD biBitCount; + $BITMAPINFOHEADER .= $this->LittleEndian2String(0, 4); // DWORD biCompression; + $BITMAPINFOHEADER .= $this->LittleEndian2String(0, 4); // DWORD biSizeImage; + $BITMAPINFOHEADER .= $this->LittleEndian2String(2835, 4); // LONG biXPelsPerMeter; + $BITMAPINFOHEADER .= $this->LittleEndian2String(2835, 4); // LONG biYPelsPerMeter; + $BITMAPINFOHEADER .= $this->LittleEndian2String(0, 4); // DWORD biClrUsed; + $BITMAPINFOHEADER .= $this->LittleEndian2String(0, 4); // DWORD biClrImportant; + + return $BITMAPFILEHEADER . $BITMAPINFOHEADER . $BMP; + } ## -------------------------------------------------------- - private function GetPixelColor(&$img, $x, $y) - # Author: James Heinrich - # Purpose: - # Param in: - # Param out: - # Reference: - # Notes: - # - { - if ( ! is_resource($img)) - { - return false; - } + private function GetPixelColor(&$img, $x, $y) { + # Author: James Heinrich + # Purpose: + # Param in: + # Param out: + # Reference: + # Notes:# + + if (!is_resource($img)) { + return false; + } - return @ImageColorsForIndex($img, @ImageColorAt($img, $x, $y)); - } + return @ImageColorsForIndex($img, @ImageColorAt($img, $x, $y)); + } ## -------------------------------------------------------- - private function LittleEndian2String($number, $minbytes = 1) - # Author: James Heinrich - # Purpose: BMP SUPPORT (SAVING) - # Param in: - # Param out: - # Reference: - # Notes: - # - { - $intstring = ''; - while ($number > 0) - { - $intstring = $intstring . chr($number & 255); - $number >>= 8; - } - - return str_pad($intstring, $minbytes, "\x00", STR_PAD_RIGHT); - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - BMP SUPPORT (READING) -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - private function ImageCreateFromBMP($filename) - # Author: DHKold - # Date: The 15th of June 2005 - # Version: 2.0B - # Purpose: To create an image from a BMP file. - # Param in: BMP file to open. - # Param out: Return a resource like the other ImageCreateFrom functions - # Reference: http://us3.php.net/manual/en/function.imagecreate.php#53879 - # Bug fix: Author: domelca at terra dot es - # Date: 06 March 2008 - # Fix: Correct 16bit BMP support - # Notes: - # - { - - //Ouverture du fichier en mode binaire - if ( ! $f1 = fopen($filename, "rb")) - { - return false; - } - - //1 : Chargement des ent�tes FICHIER - $FILE = unpack("vfile_type/Vfile_size/Vreserved/Vbitmap_offset", fread($f1, 14)); - if ($FILE['file_type'] != 19778) - { - return false; - } - - //2 : Chargement des ent�tes BMP - $BMP = unpack('Vheader_size/Vwidth/Vheight/vplanes/vbits_per_pixel' . - '/Vcompression/Vsize_bitmap/Vhoriz_resolution' . - '/Vvert_resolution/Vcolors_used/Vcolors_important', fread($f1, 40)); - $BMP['colors'] = pow(2, $BMP['bits_per_pixel']); - - if ($BMP['size_bitmap'] == 0) - { - $BMP['size_bitmap'] = $FILE['file_size'] - $FILE['bitmap_offset']; - } - - $BMP['bytes_per_pixel'] = $BMP['bits_per_pixel'] / 8; - $BMP['bytes_per_pixel2'] = ceil($BMP['bytes_per_pixel']); - $BMP['decal'] = ($BMP['width'] * $BMP['bytes_per_pixel'] / 4); - $BMP['decal'] -= floor($BMP['width'] * $BMP['bytes_per_pixel'] / 4); - $BMP['decal'] = 4 - (4 * $BMP['decal']); - - if ($BMP['decal'] == 4) - { - $BMP['decal'] = 0; - } - - //3 : Chargement des couleurs de la palette - $PALETTE = array(); - if ($BMP['colors'] < 16777216) - { - $PALETTE = unpack('V' . $BMP['colors'], fread($f1, $BMP['colors'] * 4)); - } - - //4 : Cr�ation de l'image - $IMG = fread($f1, $BMP['size_bitmap']); - $VIDE = chr(0); - - $res = imagecreatetruecolor($BMP['width'], $BMP['height']); - $P = 0; - $Y = $BMP['height'] - 1; - while ($Y >= 0) - { - $X = 0; - while ($X < $BMP['width']) - { - if ($BMP['bits_per_pixel'] == 24) - { - $COLOR = unpack("V", substr($IMG, $P, 3) . $VIDE); - } - elseif ($BMP['bits_per_pixel'] == 16) - { - - /* - * BMP 16bit fix - * ================= - * - * Ref: http://us3.php.net/manual/en/function.imagecreate.php#81604 - * - * Notes: - * "don't work with bmp 16 bits_per_pixel. change pixel - * generator for this." - * - */ - - // *** Original code (don't work) - //$COLOR = unpack("n",substr($IMG,$P,2)); - //$COLOR[1] = $PALETTE[$COLOR[1]+1]; - - $COLOR = unpack("v", substr($IMG, $P, 2)); - $blue = ($COLOR[1] & 0x001f) << 3; - $green = ($COLOR[1] & 0x07e0) >> 3; - $red = ($COLOR[1] & 0xf800) >> 8; - $COLOR[1] = $red * 65536 + $green * 256 + $blue; - - } - elseif ($BMP['bits_per_pixel'] == 8) - { - $COLOR = unpack("n", $VIDE . substr($IMG, $P, 1)); - $COLOR[1] = $PALETTE[ $COLOR[1] + 1 ]; - } - elseif ($BMP['bits_per_pixel'] == 4) - { - $COLOR = unpack("n", $VIDE . substr($IMG, floor($P), 1)); - if (($P * 2) % 2 == 0) - { - $COLOR[1] = ($COLOR[1] >> 4); - } - else - { - $COLOR[1] = ($COLOR[1] & 0x0F); - } - $COLOR[1] = $PALETTE[ $COLOR[1] + 1 ]; - } - elseif ($BMP['bits_per_pixel'] == 1) - { - $COLOR = unpack("n", $VIDE . substr($IMG, floor($P), 1)); - if (($P * 8) % 8 == 0) - { - $COLOR[1] = $COLOR[1] >> 7; - } - elseif (($P * 8) % 8 == 1) - { - $COLOR[1] = ($COLOR[1] & 0x40) >> 6; - } - elseif (($P * 8) % 8 == 2) - { - $COLOR[1] = ($COLOR[1] & 0x20) >> 5; - } - elseif (($P * 8) % 8 == 3) - { - $COLOR[1] = ($COLOR[1] & 0x10) >> 4; - } - elseif (($P * 8) % 8 == 4) - { - $COLOR[1] = ($COLOR[1] & 0x8) >> 3; - } - elseif (($P * 8) % 8 == 5) - { - $COLOR[1] = ($COLOR[1] & 0x4) >> 2; - } - elseif (($P * 8) % 8 == 6) - { - $COLOR[1] = ($COLOR[1] & 0x2) >> 1; - } - elseif (($P * 8) % 8 == 7) - { - $COLOR[1] = ($COLOR[1] & 0x1); - } - $COLOR[1] = $PALETTE[ $COLOR[1] + 1 ]; - } - else - { - return false; - } - - imagesetpixel($res, $X, $Y, $COLOR[1]); - $X++; - $P += $BMP['bytes_per_pixel']; - } - - $Y--; - $P += $BMP['decal']; - } - //Fermeture du fichier - fclose($f1); - - return $res; - } - - - /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- - PSD SUPPORT (READING) -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ - - private function imagecreatefrompsd($fileName) - # Author: Tim de Koning - # Version: 1.3 - # Purpose: To create an image from a PSD file. - # Param in: PSD file to open. - # Param out: Return a resource like the other ImageCreateFrom functions - # Reference: http://www.kingsquare.nl/phppsdreader - # Notes: - # - { - if (file_exists($this->psdReaderPath)) - { - - - include_once($this->psdReaderPath); - - $psdReader = new PhpPsdReader($fileName); - - if (isset($psdReader->infoArray['error'])) - { - return ''; - } - else - { - return $psdReader->getImage(); - } - } - else - { - return false; - } - } + private function LittleEndian2String($number, $minbytes = 1) { + # Author: James Heinrich + # Purpose: BMP SUPPORT (SAVING) + # Param in: + # Param out: + # Reference: + # Notes:# + + $intstring = ''; + while ($number > 0) { + $intstring = $intstring . chr($number & 255); + $number >>= 8; + } + + return str_pad($intstring, $minbytes, "\x00", STR_PAD_RIGHT); + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + BMP SUPPORT (READING) + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + private function ImageCreateFromBMP($filename) { + # Author: DHKold + # Date: The 15th of June 2005 + # Version: 2.0B + # Purpose: To create an image from a BMP file. + # Param in: BMP file to open. + # Param out: Return a resource like the other ImageCreateFrom functions + # Reference: http://us3.php.net/manual/en/function.imagecreate.php#53879 + # Bug fix: Author: domelca at terra dot es + # Date: 06 March 2008 + # Fix: Correct 16bit BMP support + # Notes:# + //Ouverture du fichier en mode binaire + if (!$f1 = fopen($filename, "rb")) { + return false; + } + + //1 : Chargement des ent�tes FICHIER + $FILE = unpack("vfile_type/Vfile_size/Vreserved/Vbitmap_offset", fread($f1, 14)); + if ($FILE['file_type'] != 19778) { + return false; + } + + //2 : Chargement des ent�tes BMP + $BMP = unpack('Vheader_size/Vwidth/Vheight/vplanes/vbits_per_pixel' . + '/Vcompression/Vsize_bitmap/Vhoriz_resolution' . + '/Vvert_resolution/Vcolors_used/Vcolors_important', fread($f1, 40)); + $BMP['colors'] = pow(2, $BMP['bits_per_pixel']); + + if ($BMP['size_bitmap'] == 0) { + $BMP['size_bitmap'] = $FILE['file_size'] - $FILE['bitmap_offset']; + } + + $BMP['bytes_per_pixel'] = $BMP['bits_per_pixel'] / 8; + $BMP['bytes_per_pixel2'] = ceil($BMP['bytes_per_pixel']); + $BMP['decal'] = ($BMP['width'] * $BMP['bytes_per_pixel'] / 4); + $BMP['decal'] -= floor($BMP['width'] * $BMP['bytes_per_pixel'] / 4); + $BMP['decal'] = 4 - (4 * $BMP['decal']); + + if ($BMP['decal'] == 4) { + $BMP['decal'] = 0; + } + + //3 : Chargement des couleurs de la palette + $PALETTE = array(); + if ($BMP['colors'] < 16777216) { + $PALETTE = unpack('V' . $BMP['colors'], fread($f1, $BMP['colors'] * 4)); + } + + //4 : Cr�ation de l'image + $IMG = fread($f1, $BMP['size_bitmap']); + $VIDE = chr(0); + + $res = imagecreatetruecolor($BMP['width'], $BMP['height']); + $P = 0; + $Y = $BMP['height'] - 1; + while ($Y >= 0) { + $X = 0; + while ($X < $BMP['width']) { + if ($BMP['bits_per_pixel'] == 24) { + $COLOR = unpack("V", substr($IMG, $P, 3) . $VIDE); + } elseif ($BMP['bits_per_pixel'] == 16) { + + /* + * BMP 16bit fix + * ================= + * + * Ref: http://us3.php.net/manual/en/function.imagecreate.php#81604 + * + * Notes: + * "don't work with bmp 16 bits_per_pixel. change pixel + * generator for this." + * + */ + + // *** Original code (don't work) + //$COLOR = unpack("n",substr($IMG,$P,2)); + //$COLOR[1] = $PALETTE[$COLOR[1]+1]; + + $COLOR = unpack("v", substr($IMG, $P, 2)); + $blue = ($COLOR[1] & 0x001f) << 3; + $green = ($COLOR[1] & 0x07e0) >> 3; + $red = ($COLOR[1] & 0xf800) >> 8; + $COLOR[1] = $red * 65536 + $green * 256 + $blue; + } elseif ($BMP['bits_per_pixel'] == 8) { + $COLOR = unpack("n", $VIDE . substr($IMG, $P, 1)); + $COLOR[1] = $PALETTE[$COLOR[1] + 1]; + } elseif ($BMP['bits_per_pixel'] == 4) { + $COLOR = unpack("n", $VIDE . substr($IMG, floor($P), 1)); + if (($P * 2) % 2 == 0) { + $COLOR[1] = ($COLOR[1] >> 4); + } else { + $COLOR[1] = ($COLOR[1] & 0x0F); + } + $COLOR[1] = $PALETTE[$COLOR[1] + 1]; + } elseif ($BMP['bits_per_pixel'] == 1) { + $COLOR = unpack("n", $VIDE . substr($IMG, floor($P), 1)); + if (($P * 8) % 8 == 0) { + $COLOR[1] = $COLOR[1] >> 7; + } elseif (($P * 8) % 8 == 1) { + $COLOR[1] = ($COLOR[1] & 0x40) >> 6; + } elseif (($P * 8) % 8 == 2) { + $COLOR[1] = ($COLOR[1] & 0x20) >> 5; + } elseif (($P * 8) % 8 == 3) { + $COLOR[1] = ($COLOR[1] & 0x10) >> 4; + } elseif (($P * 8) % 8 == 4) { + $COLOR[1] = ($COLOR[1] & 0x8) >> 3; + } elseif (($P * 8) % 8 == 5) { + $COLOR[1] = ($COLOR[1] & 0x4) >> 2; + } elseif (($P * 8) % 8 == 6) { + $COLOR[1] = ($COLOR[1] & 0x2) >> 1; + } elseif (($P * 8) % 8 == 7) { + $COLOR[1] = ($COLOR[1] & 0x1); + } + $COLOR[1] = $PALETTE[$COLOR[1] + 1]; + } else { + return false; + } + + imagesetpixel($res, $X, $Y, $COLOR[1]); + $X++; + $P += $BMP['bytes_per_pixel']; + } + + $Y--; + $P += $BMP['decal']; + } + //Fermeture du fichier + fclose($f1); + + return $res; + } + + /* -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*- + PSD SUPPORT (READING) + * -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*- */ + + private function imagecreatefrompsd($fileName) { + # Author: Tim de Koning + # Version: 1.3 + # Purpose: To create an image from a PSD file. + # Param in: PSD file to open. + # Param out: Return a resource like the other ImageCreateFrom functions + # Reference: http://www.kingsquare.nl/phppsdreader + # Notes:# + + if (file_exists($this->psdReaderPath)) { + + + include_once($this->psdReaderPath); + + $psdReader = new PhpPsdReader($fileName); + + if (isset($psdReader->infoArray['error'])) { + return ''; + } else { + return $psdReader->getImage(); + } + } else { + return false; + } + } ## -------------------------------------------------------- - public function __destruct() - { - if (is_resource($this->imageResized)) - { - imagedestroy($this->imageResized); - } - } + public function __destruct() { + if (is_resource($this->imageResized)) { + imagedestroy($this->imageResized); + } + } ## -------------------------------------------------------- - } - /* * Example with some API calls (outdated): * @@ -3780,4 +3254,4 @@ public function __destruct() * * // *** Free used memory * $magicianObj -> __destruct(); - */ + */ \ No newline at end of file diff --git a/filemanager/include/utils.php b/filemanager/include/utils.php old mode 100755 new mode 100644 index 4c5b43a2..6f1b7278 --- a/filemanager/include/utils.php +++ b/filemanager/include/utils.php @@ -1,91 +1,79 @@ console.log('The " . $lang . " language file is not readable! Falling back...');"; - } - } - - // add lang file to session for easy include - $_SESSION['RF']['language'] = $lang; - $_SESSION['RF']['language_file'] = $language_file; - } - else - { - $lang = $_SESSION['RF']['language']; - $language_file = $_SESSION['RF']['language_file']; - } - - $lang_vars = include $language_file; - - if ( ! is_array($lang_vars)) - { - $lang_vars = array(); - } - /** - * Translate language variable - * - * @param $var string name - * - * @return string translated variable - */ - function trans($var) - { - global $lang_vars; - - return (array_key_exists($var, $lang_vars)) ? $lang_vars[ $var ] : $var; - } +if (!function_exists('trans')) { + // language + if (!isset($_SESSION['RF']['language']) || file_exists($_SESSION['RF']['language_file']) === false || !is_readable($_SESSION['RF']['language_file']) + ) { + $lang = $default_language; + + if (isset($_GET['lang']) && $_GET['lang'] != 'undefined' && $_GET['lang'] != '') { + $lang = fix_get_params($_GET['lang']); + $lang = trim($lang); + } + + $language_file = dirname(dirname(__FILE__)) . '/lang/' . $default_language . '.php'; + if ($lang != $default_language) { + $path_parts = pathinfo($lang); + + if (is_readable(dirname(dirname(__FILE__)) . '/lang/' . $path_parts['basename'] . '.php')) { + $language_file = dirname(dirname(__FILE__)) . '/lang/' . $path_parts['basename'] . '.php'; + } else { + echo ""; + } + } + + // add lang file to session for easy include + $_SESSION['RF']['language'] = $lang; + $_SESSION['RF']['language_file'] = $language_file; + } else { + $lang = $_SESSION['RF']['language']; + $language_file = $_SESSION['RF']['language_file']; + } + + $lang_vars = include $language_file; + + if (!is_array($lang_vars)) { + $lang_vars = array(); + } + + /** + * Translate language variable + * + * @param $var string name + * + * @return string translated variable + */ + function trans($var) { + global $lang_vars; + + return (array_key_exists($var, $lang_vars)) ? $lang_vars[$var] : $var; + } + } /** @@ -95,29 +83,23 @@ function trans($var) * * @return bool */ -function deleteDir($dir) -{ - if ( ! file_exists($dir)) - { - return true; - } - if ( ! is_dir($dir)) - { - return unlink($dir); - } - foreach (scandir($dir) as $item) - { - if ($item == '.' || $item == '..') - { - continue; - } - if ( ! deleteDir($dir . DIRECTORY_SEPARATOR . $item)) - { - return false; - } - } - - return rmdir($dir); +function deleteDir($dir) { + if (!file_exists($dir)) { + return true; + } + if (!is_dir($dir)) { + return unlink($dir); + } + foreach (scandir($dir) as $item) { + if ($item == '.' || $item == '..') { + continue; + } + if (!deleteDir($dir . DIRECTORY_SEPARATOR . $item)) { + return false; + } + } + + return rmdir($dir); } /** @@ -128,19 +110,16 @@ function deleteDir($dir) * * @return bool */ -function duplicate_file($old_path, $name) -{ - if (file_exists($old_path)) - { - $info = pathinfo($old_path); - $new_path = $info['dirname'] . "/" . $name . "." . $info['extension']; - if (file_exists($new_path) && $old_path == $new_path) - { - return false; - } - - return copy($old_path, $new_path); - } +function duplicate_file($old_path, $name) { + if (file_exists($old_path)) { + $info = pathinfo($old_path); + $new_path = $info['dirname'] . "/" . $name . "." . $info['extension']; + if (file_exists($new_path) && $old_path == $new_path) { + return false; + } + + return copy($old_path, $new_path); + } } /** @@ -152,20 +131,17 @@ function duplicate_file($old_path, $name) * * @return bool */ -function rename_file($old_path, $name, $transliteration) -{ - $name = fix_filename($name, $transliteration); - if (file_exists($old_path)) - { - $info = pathinfo($old_path); - $new_path = $info['dirname'] . "/" . $name . "." . $info['extension']; - if (file_exists($new_path) && $old_path == $new_path) - { - return false; - } - - return rename($old_path, $new_path); - } +function rename_file($old_path, $name, $transliteration) { + $name = fix_filename($name, $transliteration); + if (file_exists($old_path)) { + $info = pathinfo($old_path); + $new_path = $info['dirname'] . "/" . $name . "." . $info['extension']; + if (file_exists($new_path) && $old_path == $new_path) { + return false; + } + + return rename($old_path, $new_path); + } } /** @@ -177,19 +153,16 @@ function rename_file($old_path, $name, $transliteration) * * @return bool */ -function rename_folder($old_path, $name, $transliteration) -{ - $name = fix_filename($name, $transliteration, false, '_', true); - if (file_exists($old_path)) - { - $new_path = fix_dirname($old_path) . "/" . $name; - if (file_exists($new_path) && $old_path == $new_path) - { - return false; - } - - return rename($old_path, $new_path); - } +function rename_folder($old_path, $name, $transliteration) { + $name = fix_filename($name, $transliteration, false, '_', true); + if (file_exists($old_path)) { + $new_path = fix_dirname($old_path) . "/" . $name; + if (file_exists($new_path) && $old_path == $new_path) { + return false; + } + + return rename($old_path, $new_path); + } } /** @@ -204,22 +177,21 @@ function rename_folder($old_path, $name, $transliteration) * @return bool * @throws \Exception */ -function create_img($imgfile, $imgthumb, $newwidth, $newheight = null, $option = "crop") -{ - $timeLimit = ini_get('max_execution_time'); - set_time_limit(30); - $result = false; - if (image_check_memory_usage($imgfile, $newwidth, $newheight)) - { - require_once('php_image_magician.php'); - $magicianObj = new imageLib($imgfile); - $magicianObj->resizeImage($newwidth, $newheight, $option); - $magicianObj->saveImage($imgthumb, 80); - $result = true; - } - set_time_limit($timeLimit); - - return $result; +function create_img($imgfile, $imgthumb, $newwidth, $newheight = null, $option = "crop") { + $result = false; + if (file_exists($imgfile) || strpos($imgfile, 'http') === 0) { + $timeLimit = ini_get('max_execution_time'); + set_time_limit(30); + if (strpos($imgfile, 'http') === 0 || image_check_memory_usage($imgfile, $newwidth, $newheight)) { + require_once('php_image_magician.php'); + $magicianObj = new imageLib($imgfile); + $magicianObj->resizeImage($newwidth, $newheight, $option); + $magicianObj->saveImage($imgthumb, 80); + $result = true; + } + set_time_limit($timeLimit); + } + return $result; } /** @@ -229,17 +201,15 @@ function create_img($imgfile, $imgthumb, $newwidth, $newheight = null, $option = * * @return string */ -function makeSize($size) -{ - $units = array( 'B', 'KB', 'MB', 'GB', 'TB' ); - $u = 0; - while ((round($size / 1024) > 0) && ($u < 4)) - { - $size = $size / 1024; - $u++; - } - - return (number_format($size, 0) . " " . $units[ $u ]); +function makeSize($size) { + $units = array('B', 'KB', 'MB', 'GB', 'TB'); + $u = 0; + while ((round($size / 1024) > 0) && ($u < 4)) { + $size = $size / 1024; + $u++; + } + + return (number_format($size, 0) . " " . $units[$u]); } /** @@ -249,34 +219,28 @@ function makeSize($size) * * @return int */ -function folder_info($path) -{ - $total_size = 0; - $files = scandir($path); - $cleanPath = rtrim($path, '/') . '/'; - $files_count = 0; - $folders_count = 0; - foreach ($files as $t) - { - if ($t != "." && $t != "..") - { - $currentFile = $cleanPath . $t; - if (is_dir($currentFile)) - { - list($size,$tmp,$tmp1) = folder_info($currentFile); - $total_size += $size; - $folders_count ++; - } - else - { - $size = filesize($currentFile); - $total_size += $size; - $files_count++; - } - } - } - - return array($total_size,$files_count,$folders_count); +function folder_info($path) { + $total_size = 0; + $files = scandir($path); + $cleanPath = rtrim($path, '/') . '/'; + $files_count = 0; + $folders_count = 0; + foreach ($files as $t) { + if ($t != "." && $t != "..") { + $currentFile = $cleanPath . $t; + if (is_dir($currentFile)) { + list($size, $tmp, $tmp1) = folder_info($currentFile); + $total_size += $size; + $folders_count ++; + } else { + $size = filesize($currentFile); + $total_size += $size; + $files_count++; + } + } + } + + return array($total_size, $files_count, $folders_count); } /** @@ -286,30 +250,24 @@ function folder_info($path) * * @return int */ -function filescount($path) -{ - $total_count = 0; - $files = scandir($path); - $cleanPath = rtrim($path, '/') . '/'; - - foreach ($files as $t) - { - if ($t != "." && $t != "..") - { - $currentFile = $cleanPath . $t; - if (is_dir($currentFile)) - { - $size = filescount($currentFile); - $total_count += $size; - } - else - { - $total_count += 1; - } - } - } - - return $total_count; +function filescount($path) { + $total_count = 0; + $files = scandir($path); + $cleanPath = rtrim($path, '/') . '/'; + + foreach ($files as $t) { + if ($t != "." && $t != "..") { + $currentFile = $cleanPath . $t; + if (is_dir($currentFile)) { + $size = filescount($currentFile); + $total_count += $size; + } else { + $total_count += 1; + } + } + } + + return $total_count; } /** @@ -318,18 +276,15 @@ function filescount($path) * @param string $path * @param string $path_thumbs */ -function create_folder($path = null, $path_thumbs = null) -{ - $oldumask = umask(0); - if ($path && ! file_exists($path)) - { - mkdir($path, 0755, true); - } // or even 01777 so you get the sticky bit set - if ($path_thumbs && ! file_exists($path_thumbs)) - { - mkdir($path_thumbs, 0755, true) or die("$path_thumbs cannot be found"); - } // or even 01777 so you get the sticky bit set - umask($oldumask); +function create_folder($path = null, $path_thumbs = null) { + $oldumask = umask(0); + if ($path && !file_exists($path)) { + mkdir($path, 0755, true); + } // or even 01777 so you get the sticky bit set + if ($path_thumbs && !file_exists($path_thumbs)) { + mkdir($path_thumbs, 0755, true) or die("$path_thumbs cannot be found"); + } // or even 01777 so you get the sticky bit set + umask($oldumask); } /** @@ -338,24 +293,18 @@ function create_folder($path = null, $path_thumbs = null) * @param string $path * @param string $ext */ -function check_files_extensions_on_path($path, $ext) -{ - if ( ! is_dir($path)) - { - $fileinfo = pathinfo($path); - if ( ! in_array(mb_strtolower($fileinfo['extension']), $ext)) - { - unlink($path); - } - } - else - { - $files = scandir($path); - foreach ($files as $file) - { - check_files_extensions_on_path(trim($path, '/') . "/" . $file, $ext); - } - } +function check_files_extensions_on_path($path, $ext) { + if (!is_dir($path)) { + $fileinfo = pathinfo($path); + if (!in_array(mb_strtolower($fileinfo['extension']), $ext)) { + unlink($path); + } + } else { + $files = scandir($path); + foreach ($files as $file) { + check_files_extensions_on_path(trim($path, '/') . "/" . $file, $ext); + } + } } /** @@ -366,26 +315,19 @@ function check_files_extensions_on_path($path, $ext) * @param string $basepath * @param string $ext */ -function check_files_extensions_on_phar($phar, &$files, $basepath, $ext) -{ - foreach ($phar as $file) - { - if ($file->isFile()) - { - if (in_array(mb_strtolower($file->getExtension()), $ext)) - { - $files[] = $basepath . $file->getFileName(); - } - } - else - { - if ($file->isDir()) - { - $iterator = new DirectoryIterator($file); - check_files_extensions_on_phar($iterator, $files, $basepath . $file->getFileName() . '/', $ext); - } - } - } +function check_files_extensions_on_phar($phar, &$files, $basepath, $ext) { + foreach ($phar as $file) { + if ($file->isFile()) { + if (in_array(mb_strtolower($file->getExtension()), $ext)) { + $files[] = $basepath . $file->getFileName(); + } + } else { + if ($file->isDir()) { + $iterator = new DirectoryIterator($file); + check_files_extensions_on_phar($iterator, $files, $basepath . $file->getFileName() . '/', $ext); + } + } + } } /** @@ -395,9 +337,8 @@ function check_files_extensions_on_phar($phar, &$files, $basepath, $ext) * * @return string */ -function fix_get_params($str) -{ - return strip_tags(preg_replace("/[^a-zA-Z0-9\.\[\]_| -]/", '', $str)); +function fix_get_params($str) { + return strip_tags(preg_replace("/[^a-zA-Z0-9\.\[\]_| -]/", '', $str)); } /** @@ -411,39 +352,32 @@ function fix_get_params($str) * * @return string */ -function fix_filename($str, $transliteration, $convert_spaces = false, $replace_with = "_", $is_folder = false) -{ - if ($convert_spaces) - { - $str = str_replace(' ', $replace_with, $str); - } - - if ($transliteration) - { - if (function_exists('transliterator_transliterate')) - { - $str = transliterator_transliterate('Accents-Any', utf8_encode($str)); - } - else - { - $str = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str); - } - - $str = preg_replace("/[^a-zA-Z0-9\.\[\]_| -]/", '', $str); - } - - $str = str_replace(array( '"', "'", "/", "\\" ), "", $str); - $str = strip_tags($str); - - // Empty or incorrectly transliterated filename. - // Here is a point: a good file UNKNOWN_LANGUAGE.jpg could become .jpg in previous code. - // So we add that default 'file' name to fix that issue. - if (strpos($str, '.') === 0 && $is_folder === false) - { - $str = 'file' . $str; - } - - return trim($str); +function fix_filename($str, $transliteration, $convert_spaces = false, $replace_with = "_", $is_folder = false) { + if ($convert_spaces) { + $str = str_replace(' ', $replace_with, $str); + } + + if ($transliteration) { + if (function_exists('transliterator_transliterate')) { + $str = transliterator_transliterate('Accents-Any', utf8_encode($str)); + } else { + $str = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str); + } + + $str = preg_replace("/[^a-zA-Z0-9\.\[\]_| -]/", '', $str); + } + + $str = str_replace(array('"', "'", "/", "\\"), "", $str); + $str = strip_tags($str); + + // Empty or incorrectly transliterated filename. + // Here is a point: a good file UNKNOWN_LANGUAGE.jpg could become .jpg in previous code. + // So we add that default 'file' name to fix that issue. + if (strpos($str, '.') === 0 && $is_folder === false) { + $str = 'file' . $str; + } + + return trim($str); } /** @@ -453,9 +387,8 @@ function fix_filename($str, $transliteration, $convert_spaces = false, $replace_ * * @return string */ -function fix_dirname($str) -{ - return str_replace('~', ' ', dirname(str_replace(' ', '~', $str))); +function fix_dirname($str) { + return str_replace('~', ' ', dirname(str_replace(' ', '~', $str))); } /** @@ -465,16 +398,12 @@ function fix_dirname($str) * * @return string */ -function fix_strtoupper($str) -{ - if (function_exists('mb_strtoupper')) - { - return mb_strtoupper($str); - } - else - { - return strtoupper($str); - } +function fix_strtoupper($str) { + if (function_exists('mb_strtoupper')) { + return mb_strtoupper($str); + } else { + return strtoupper($str); + } } /** @@ -484,31 +413,23 @@ function fix_strtoupper($str) * * @return string */ -function fix_strtolower($str) -{ - if (function_exists('mb_strtoupper')) - { - return mb_strtolower($str); - } - else - { - return strtolower($str); - } +function fix_strtolower($str) { + if (function_exists('mb_strtoupper')) { + return mb_strtolower($str); + } else { + return strtolower($str); + } } -function fix_path($path, $transliteration, $convert_spaces = false, $replace_with = "_") -{ - $info = pathinfo($path); - $tmp_path = $info['dirname']; - $str = fix_filename($info['filename'], $transliteration, $convert_spaces, $replace_with); - if ($tmp_path != "") - { - return $tmp_path . DIRECTORY_SEPARATOR . $str; - } - else - { - return $str; - } +function fix_path($path, $transliteration, $convert_spaces = false, $replace_with = "_") { + $info = pathinfo($path); + $tmp_path = $info['dirname']; + $str = fix_filename($info['filename'], $transliteration, $convert_spaces, $replace_with); + if ($tmp_path != "") { + return $tmp_path . DIRECTORY_SEPARATOR . $str; + } else { + return $str; + } } /** @@ -516,13 +437,10 @@ function fix_path($path, $transliteration, $convert_spaces = false, $replace_wit * * @return string */ -function base_url() -{ - return sprintf( - "%s://%s", - isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http', - $_SERVER['HTTP_HOST'] - ); +function base_url() { + return sprintf( + "%s://%s", isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http', $_SERVER['HTTP_HOST'] + ); } /** @@ -531,21 +449,18 @@ function base_url() * * @return bool */ -function config_loading($current_path, $fld) -{ - if (file_exists($current_path . $fld . ".config")) - { - require_once($current_path . $fld . ".config"); - - return true; - } - echo "!!!!" . $parent = fix_dirname($fld); - if ($parent != "." && ! empty($parent)) - { - config_loading($current_path, $parent); - } - - return false; +function config_loading($current_path, $fld) { + if (file_exists($current_path . $fld . ".config")) { + require_once($current_path . $fld . ".config"); + + return true; + } + echo "!!!!" . $parent = fix_dirname($fld); + if ($parent != "." && !empty($parent)) { + config_loading($current_path, $parent); + } + + return false; } /** @@ -557,45 +472,35 @@ function config_loading($current_path, $fld) * * @return bool */ -function image_check_memory_usage($img, $max_breedte, $max_hoogte) -{ - if (file_exists($img)) - { - $K64 = 65536; // number of bytes in 64K - $memory_usage = memory_get_usage(); - $memory_limit = abs(intval(str_replace('M', '', ini_get('memory_limit')) * 1024 * 1024)); - $image_properties = getimagesize($img); - $image_width = $image_properties[0]; - $image_height = $image_properties[1]; - if (isset($image_properties['bits'])) - $image_bits = $image_properties['bits']; - else - $image_bits = 0; - $image_memory_usage = $K64 + ($image_width * $image_height * ($image_bits) * 2); - $thumb_memory_usage = $K64 + ($max_breedte * $max_hoogte * ($image_bits) * 2); - $memory_needed = intval($memory_usage + $image_memory_usage + $thumb_memory_usage); - - if ($memory_needed > $memory_limit) - { - ini_set('memory_limit', (intval($memory_needed / 1024 / 1024) + 5) . 'M'); - if (ini_get('memory_limit') == (intval($memory_needed / 1024 / 1024) + 5) . 'M') - { - return true; - } - else - { - return false; - } - } - else - { - return true; - } - } - else - { - return false; - } +function image_check_memory_usage($img, $max_breedte, $max_hoogte) { + if (file_exists($img)) { + $K64 = 65536; // number of bytes in 64K + $memory_usage = memory_get_usage(); + $memory_limit = abs(intval(str_replace('M', '', ini_get('memory_limit')) * 1024 * 1024)); + $image_properties = getimagesize($img); + $image_width = $image_properties[0]; + $image_height = $image_properties[1]; + if (isset($image_properties['bits'])) + $image_bits = $image_properties['bits']; + else + $image_bits = 0; + $image_memory_usage = $K64 + ($image_width * $image_height * ($image_bits) * 2); + $thumb_memory_usage = $K64 + ($max_breedte * $max_hoogte * ($image_bits) * 2); + $memory_needed = intval($memory_usage + $image_memory_usage + $thumb_memory_usage); + + if ($memory_needed > $memory_limit) { + ini_set('memory_limit', (intval($memory_needed / 1024 / 1024) + 5) . 'M'); + if (ini_get('memory_limit') == (intval($memory_needed / 1024 / 1024) + 5) . 'M') { + return true; + } else { + return false; + } + } else { + return true; + } + } else { + return false; + } } /** @@ -606,9 +511,8 @@ function image_check_memory_usage($img, $max_breedte, $max_hoogte) * * @return bool */ -function endsWith($haystack, $needle) -{ - return $needle === "" || substr($haystack, -strlen($needle)) === $needle; +function endsWith($haystack, $needle) { + return $needle === "" || substr($haystack, -strlen($needle)) === $needle; } /** @@ -635,59 +539,46 @@ function endsWith($haystack, $needle) * * @return bool */ -function new_thumbnails_creation($targetPath, $targetFile, $name, $current_path, $relative_image_creation, $relative_path_from_current_pos, $relative_image_creation_name_to_prepend, $relative_image_creation_name_to_append, $relative_image_creation_width, $relative_image_creation_height, $relative_image_creation_option, $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height, $fixed_image_creation_option) -{ - //create relative thumbs - $all_ok = true; - if ($relative_image_creation) - { - foreach ($relative_path_from_current_pos as $k => $path) - { - if ($path != "" && $path[ strlen($path) - 1 ] != "/") - { - $path .= "/"; - } - if ( ! file_exists($targetPath . $path)) - { - create_folder($targetPath . $path, false); - } - $info = pathinfo($name); - if ( ! endsWith($targetPath, $path)) - { - if ( ! create_img($targetFile, $targetPath . $path . $relative_image_creation_name_to_prepend[ $k ] . $info['filename'] . $relative_image_creation_name_to_append[ $k ] . "." . $info['extension'], $relative_image_creation_width[ $k ], $relative_image_creation_height[ $k ], $relative_image_creation_option[ $k ])) - { - $all_ok = false; - } - } - } - } - - //create fixed thumbs - if ($fixed_image_creation) - { - foreach ($fixed_path_from_filemanager as $k => $path) - { - if ($path != "" && $path[ strlen($path) - 1 ] != "/") - { - $path .= "/"; - } - $base_dir = $path . substr_replace($targetPath, '', 0, strlen($current_path)); - if ( ! file_exists($base_dir)) - { - create_folder($base_dir, false); - } - $info = pathinfo($name); - if ( ! create_img($targetFile, $base_dir . $fixed_image_creation_name_to_prepend[ $k ] . $info['filename'] . $fixed_image_creation_to_append[ $k ] . "." . $info['extension'], $fixed_image_creation_width[ $k ], $fixed_image_creation_height[ $k ], $fixed_image_creation_option[ $k ])) - { - $all_ok = false; - } - } - } - - return $all_ok; +function new_thumbnails_creation($targetPath, $targetFile, $name, $current_path, $relative_image_creation, $relative_path_from_current_pos, $relative_image_creation_name_to_prepend, $relative_image_creation_name_to_append, $relative_image_creation_width, $relative_image_creation_height, $relative_image_creation_option, $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height, $fixed_image_creation_option) { + //create relative thumbs + $all_ok = true; + if ($relative_image_creation) { + foreach ($relative_path_from_current_pos as $k => $path) { + if ($path != "" && $path[strlen($path) - 1] != "/") { + $path .= "/"; + } + if (!file_exists($targetPath . $path)) { + create_folder($targetPath . $path, false); + } + $info = pathinfo($name); + if (!endsWith($targetPath, $path)) { + if (!create_img($targetFile, $targetPath . $path . $relative_image_creation_name_to_prepend[$k] . $info['filename'] . $relative_image_creation_name_to_append[$k] . "." . $info['extension'], $relative_image_creation_width[$k], $relative_image_creation_height[$k], $relative_image_creation_option[$k])) { + $all_ok = false; + } + } + } + } + + //create fixed thumbs + if ($fixed_image_creation) { + foreach ($fixed_path_from_filemanager as $k => $path) { + if ($path != "" && $path[strlen($path) - 1] != "/") { + $path .= "/"; + } + $base_dir = $path . substr_replace($targetPath, '', 0, strlen($current_path)); + if (!file_exists($base_dir)) { + create_folder($base_dir, false); + } + $info = pathinfo($name); + if (!create_img($targetFile, $base_dir . $fixed_image_creation_name_to_prepend[$k] . $info['filename'] . $fixed_image_creation_to_append[$k] . "." . $info['extension'], $fixed_image_creation_width[$k], $fixed_image_creation_height[$k], $fixed_image_creation_option[$k])) { + $all_ok = false; + } + } + } + + return $all_ok; } - /** * Get a remote file, using whichever mechanism is enabled * @@ -695,27 +586,24 @@ function new_thumbnails_creation($targetPath, $targetFile, $name, $current_path, * * @return bool|mixed|string */ -function get_file_by_url($url) -{ - if (ini_get('allow_url_fopen')) - { - return file_get_contents($url); - } - if ( ! function_exists('curl_version')) - { - return false; - } - - $ch = curl_init(); - - curl_setopt($ch, CURLOPT_HEADER, 0); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_URL, $url); - - $data = curl_exec($ch); - curl_close($ch); - - return $data; +function get_file_by_url($url) { + if (ini_get('allow_url_fopen')) { + return file_get_contents($url); + } + if (!function_exists('curl_version')) { + return false; + } + + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_URL, $url); + + $data = curl_exec($ch); + curl_close($ch); + + return $data; } /** @@ -725,39 +613,33 @@ function get_file_by_url($url) * * @return bool */ -function is_really_writable($dir) -{ - $dir = rtrim($dir, '/'); - // linux, safe off - if (DIRECTORY_SEPARATOR == '/' && @ini_get("safe_mode") == false) - { - return is_writable($dir); - } - - // Windows, safe ON. (have to write a file :S) - if (is_dir($dir)) - { - $dir = $dir . '/' . md5(mt_rand(1, 1000) . mt_rand(1, 1000)); - - if (($fp = @fopen($dir, 'ab')) === false) - { - return false; - } - - fclose($fp); - @chmod($dir, 0755); - @unlink($dir); - - return true; - } - elseif ( ! is_file($dir) || ($fp = @fopen($dir, 'ab')) === false) - { - return false; - } - - fclose($fp); - - return true; +function is_really_writable($dir) { + $dir = rtrim($dir, '/'); + // linux, safe off + if (DIRECTORY_SEPARATOR == '/' && @ini_get("safe_mode") == false) { + return is_writable($dir); + } + + // Windows, safe ON. (have to write a file :S) + if (is_dir($dir)) { + $dir = $dir . '/' . md5(mt_rand(1, 1000) . mt_rand(1, 1000)); + + if (($fp = @fopen($dir, 'ab')) === false) { + return false; + } + + fclose($fp); + @chmod($dir, 0755); + @unlink($dir); + + return true; + } elseif (!is_file($dir) || ($fp = @fopen($dir, 'ab')) === false) { + return false; + } + + fclose($fp); + + return true; } /** @@ -768,15 +650,13 @@ function is_really_writable($dir) * * @return bool */ -function is_function_callable($name) -{ - if (function_exists($name) === false) - { - return false; - } - $disabled = explode(',', ini_get('disable_functions')); - - return ! in_array($name, $disabled); +function is_function_callable($name) { + if (function_exists($name) === false) { + return false; + } + $disabled = explode(',', ini_get('disable_functions')); + + return !in_array($name, $disabled); } /** @@ -786,51 +666,36 @@ function is_function_callable($name) * @param string $destination * @param bool $is_rec */ -function rcopy($source, $destination, $is_rec = false) -{ - if (is_dir($source)) - { - if ($is_rec === false) - { - $pinfo = pathinfo($source); - $destination = rtrim($destination, '/') . DIRECTORY_SEPARATOR . $pinfo['basename']; - } - if (is_dir($destination) === false) - { - mkdir($destination, 0755, true); - } - - $files = scandir($source); - foreach ($files as $file) - { - if ($file != "." && $file != "..") - { - rcopy($source . DIRECTORY_SEPARATOR . $file, rtrim($destination, '/') . DIRECTORY_SEPARATOR . $file, true); - } - } - } - else - { - if (file_exists($source)) - { - if (is_dir($destination) === true) - { - $pinfo = pathinfo($source); - $dest2 = rtrim($destination, '/') . DIRECTORY_SEPARATOR . $pinfo['basename']; - } - else - { - $dest2 = $destination; - } - - copy($source, $dest2); - } - } +function rcopy($source, $destination, $is_rec = false) { + if (is_dir($source)) { + if ($is_rec === false) { + $pinfo = pathinfo($source); + $destination = rtrim($destination, '/') . DIRECTORY_SEPARATOR . $pinfo['basename']; + } + if (is_dir($destination) === false) { + mkdir($destination, 0755, true); + } + + $files = scandir($source); + foreach ($files as $file) { + if ($file != "." && $file != "..") { + rcopy($source . DIRECTORY_SEPARATOR . $file, rtrim($destination, '/') . DIRECTORY_SEPARATOR . $file, true); + } + } + } else { + if (file_exists($source)) { + if (is_dir($destination) === true) { + $pinfo = pathinfo($source); + $dest2 = rtrim($destination, '/') . DIRECTORY_SEPARATOR . $pinfo['basename']; + } else { + $dest2 = $destination; + } + + copy($source, $dest2); + } + } } - - - /** * recursivly renames everything * @@ -842,71 +707,53 @@ function rcopy($source, $destination, $is_rec = false) * @param string $destination * @param bool $is_rec */ -function rrename($source, $destination, $is_rec = false) -{ - if (is_dir($source)) - { - if ($is_rec === false) - { - $pinfo = pathinfo($source); - $destination = rtrim($destination, '/') . DIRECTORY_SEPARATOR . $pinfo['basename']; - } - if (is_dir($destination) === false) - { - mkdir($destination, 0755, true); - } - - $files = scandir($source); - foreach ($files as $file) - { - if ($file != "." && $file != "..") - { - rrename($source . DIRECTORY_SEPARATOR . $file, rtrim($destination, '/') . DIRECTORY_SEPARATOR . $file, true); - } - } - } - else - { - if (file_exists($source)) - { - if (is_dir($destination) === true) - { - $pinfo = pathinfo($source); - $dest2 = rtrim($destination, '/') . DIRECTORY_SEPARATOR . $pinfo['basename']; - } - else - { - $dest2 = $destination; - } - - rename($source, $dest2); - } - } +function rrename($source, $destination, $is_rec = false) { + if (is_dir($source)) { + if ($is_rec === false) { + $pinfo = pathinfo($source); + $destination = rtrim($destination, '/') . DIRECTORY_SEPARATOR . $pinfo['basename']; + } + if (is_dir($destination) === false) { + mkdir($destination, 0755, true); + } + + $files = scandir($source); + foreach ($files as $file) { + if ($file != "." && $file != "..") { + rrename($source . DIRECTORY_SEPARATOR . $file, rtrim($destination, '/') . DIRECTORY_SEPARATOR . $file, true); + } + } + } else { + if (file_exists($source)) { + if (is_dir($destination) === true) { + $pinfo = pathinfo($source); + $dest2 = rtrim($destination, '/') . DIRECTORY_SEPARATOR . $pinfo['basename']; + } else { + $dest2 = $destination; + } + + rename($source, $dest2); + } + } } // On windows rename leaves folders sometime // This will clear leftover folders // After more feedback will merge it with rrename -function rrename_after_cleaner($source) -{ - $files = scandir($source); - - foreach ($files as $file) - { - if ($file != "." && $file != "..") - { - if (is_dir($source . DIRECTORY_SEPARATOR . $file)) - { - rrename_after_cleaner($source . DIRECTORY_SEPARATOR . $file); - } - else - { - unlink($source . DIRECTORY_SEPARATOR . $file); - } - } - } - - return rmdir($source); +function rrename_after_cleaner($source) { + $files = scandir($source); + + foreach ($files as $file) { + if ($file != "." && $file != "..") { + if (is_dir($source . DIRECTORY_SEPARATOR . $file)) { + rrename_after_cleaner($source . DIRECTORY_SEPARATOR . $file); + } else { + unlink($source . DIRECTORY_SEPARATOR . $file); + } + } + } + + return rmdir($source); } /** @@ -916,43 +763,31 @@ function rrename_after_cleaner($source) * @param string $rec_option * @param bool $is_rec */ -function rchmod($source, $mode, $rec_option = "none", $is_rec = false) -{ - if ($rec_option == "none") - { - chmod($source, $mode); - } - else - { - if ($is_rec === false) - { - chmod($source, $mode); - } - - $files = scandir($source); - - foreach ($files as $file) - { - if ($file != "." && $file != "..") - { - if (is_dir($source . DIRECTORY_SEPARATOR . $file)) - { - if ($rec_option == "folders" || $rec_option == "both") - { - chmod($source . DIRECTORY_SEPARATOR . $file, $mode); - } - rchmod($source . DIRECTORY_SEPARATOR . $file, $mode, $rec_option, true); - } - else - { - if ($rec_option == "files" || $rec_option == "both") - { - chmod($source . DIRECTORY_SEPARATOR . $file, $mode); - } - } - } - } - } +function rchmod($source, $mode, $rec_option = "none", $is_rec = false) { + if ($rec_option == "none") { + chmod($source, $mode); + } else { + if ($is_rec === false) { + chmod($source, $mode); + } + + $files = scandir($source); + + foreach ($files as $file) { + if ($file != "." && $file != "..") { + if (is_dir($source . DIRECTORY_SEPARATOR . $file)) { + if ($rec_option == "folders" || $rec_option == "both") { + chmod($source . DIRECTORY_SEPARATOR . $file, $mode); + } + rchmod($source . DIRECTORY_SEPARATOR . $file, $mode, $rec_option, true); + } else { + if ($rec_option == "files" || $rec_option == "both") { + chmod($source . DIRECTORY_SEPARATOR . $file, $mode); + } + } + } + } + } } /** @@ -963,22 +798,18 @@ function rchmod($source, $mode, $rec_option = "none", $is_rec = false) * * @return bool */ -function chmod_logic_helper($perm, $val) -{ - $valid = array( - 1 => array( 1, 3, 5, 7 ), - 2 => array( 2, 3, 6, 7 ), - 4 => array( 4, 5, 6, 7 ) - ); - - if (in_array($perm, $valid[ $val ])) - { - return true; - } - else - { - return false; - } +function chmod_logic_helper($perm, $val) { + $valid = array( + 1 => array(1, 3, 5, 7), + 2 => array(2, 3, 6, 7), + 4 => array(4, 5, 6, 7) + ); + + if (in_array($perm, $valid[$val])) { + return true; + } else { + return false; + } } /** @@ -986,44 +817,38 @@ function chmod_logic_helper($perm, $val) * @param bool $trace * @param bool $halt */ -function debugger($input, $trace = false, $halt = false) -{ - ob_start(); - - echo "
----- DEBUG DUMP -----"; - echo "
";
-	var_dump($input);
-	echo "
"; - - if ($trace) - { - if (is_php('5.3.6')) - { - $debug = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); - } - else - { - $debug = debug_backtrace(false); - } - - echo "
-----STACK TRACE-----"; - echo "
";
-		var_dump($debug);
-		echo "
"; - } - - echo ""; - echo "---------------------------
"; - - $ret = ob_get_contents(); - ob_end_clean(); - - echo $ret; - - if ($halt == true) - { - exit(); - } +function debugger($input, $trace = false, $halt = false) { + ob_start(); + + echo "
----- DEBUG DUMP -----"; + echo "
";
+    var_dump($input);
+    echo "
"; + + if ($trace) { + if (is_php('5.3.6')) { + $debug = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + } else { + $debug = debug_backtrace(false); + } + + echo "
-----STACK TRACE-----"; + echo "
";
+        var_dump($debug);
+        echo "
"; + } + + echo ""; + echo "---------------------------
"; + + $ret = ob_get_contents(); + ob_end_clean(); + + echo $ret; + + if ($halt == true) { + exit(); + } } /** @@ -1031,15 +856,13 @@ function debugger($input, $trace = false, $halt = false) * * @return bool */ -function is_php($version = '5.0.0') -{ - static $phpVer; - $version = (string) $version; +function is_php($version = '5.0.0') { + static $phpVer; + $version = (string) $version; - if ( ! isset($phpVer[ $version ])) - { - $phpVer[ $version ] = (version_compare(PHP_VERSION, $version) < 0) ? false : true; - } + if (!isset($phpVer[$version])) { + $phpVer[$version] = (version_compare(PHP_VERSION, $version) < 0) ? false : true; + } - return $phpVer[ $version ]; + return $phpVer[$version]; } diff --git a/filemanager/lang/en_EN.php b/filemanager/lang/en_EN.php old mode 100755 new mode 100644 index ba41f7f8..70659c11 --- a/filemanager/lang/en_EN.php +++ b/filemanager/lang/en_EN.php @@ -1,100 +1,101 @@ 'Select', - 'Erase' => 'Erase', - 'Open' => 'Open', - 'Confirm_del' => 'Are you sure you want to delete this file?', - 'All' => 'All', - 'Files' => 'Files', - 'Images' => 'Images', - 'Archives' => 'Archives', - 'Error_Upload' => 'The uploaded file exceeds the max size allowed.', - 'Error_extension' => 'File extension is not allowed.', - 'Upload_file' => 'Upload', - 'Filters' => 'Filters', - 'Videos' => 'Videos', - 'Music' => 'Music', - 'New_Folder' => 'New Folder', - 'Folder_Created' => 'Folder correctly created', - 'Existing_Folder' => 'Existing folder', - 'Confirm_Folder_del' => 'Are you sure to delete the folder and all the elements in it?', - 'Return_Files_List' => 'Return to files list', - 'Preview' => 'Preview', - 'Download' => 'Download', - 'Insert_Folder_Name' => 'Insert folder name:', - 'Root' => 'root', - 'Rename' => 'Rename', - 'Back' => 'back', - 'View' => 'View', - 'View_list' => 'List view', - 'View_columns_list' => 'Columns list view', - 'View_boxes' => 'Box view', - 'Toolbar' => 'Toolbar', - 'Actions' => 'Actions', - 'Rename_existing_file' => 'The file is already existing', - 'Rename_existing_folder' => 'The folder is already existing', - 'Empty_name' => 'The name is empty', - 'Text_filter' => 'text filter', - 'Swipe_help' => 'Swipe the name of file/folder to show options', - 'Upload_base' => 'Base upload', - 'Upload_java' => 'JAVA upload (big size files)', - 'Upload_java_help' => "If the Java Applet doesn't load, 1. make sure you have Java installed, otherwise [download link] 2. make sure nothing is blocked by your firewall", - 'Upload_base_help' => "Drag & Drop files or click in the area above (modern browsers) and select the file(s). When the upload is complete, click the 'Return to files list' button.", - 'Type_dir' => 'dir', - 'Type' => 'Type', - 'Dimension' => 'Dimension', - 'Size' => 'Size', - 'Date' => 'Date', - 'Filename' => 'Filename', - 'Operations' => 'Operations', - 'Date_type' => 'y-m-d', - 'OK' => 'OK', - 'Cancel' => 'Cancel', - 'Sorting' => 'sorting', - 'Show_url' => 'Show URL', - 'Extract' => 'Extract here', - 'File_info' => 'file info', - 'Edit_image' => 'Edit image', - 'Duplicate' => 'Duplicate', - 'Folders' => 'Folders', - 'Copy' => 'Copy', - 'Cut' => 'Cut', - 'Paste' => 'Paste', - 'CB' => 'CB', // clipboard - 'Paste_Here' => 'Paste to this directory', - 'Paste_Confirm' => 'Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.', - 'Paste_Failed' => 'Failed to paste file(s)', - 'Clear_Clipboard' => 'Clear clipboard', - 'Clear_Clipboard_Confirm' => 'Are you sure you want to clear the clipboard?', - 'Files_ON_Clipboard' => 'There are files on the clipboard.', - 'Copy_Cut_Size_Limit' => 'The selected files/folders are too big to %s. Limit: %d MB/operation', // %s = cut or copy - 'Copy_Cut_Count_Limit' => 'You selected too many files/folders to %s. Limit: %d files/operation', // %s = cut or copy - 'Copy_Cut_Not_Allowed' => 'You are not allowed to %s files.', // %s(1) = cut or copy, %s(2) = files or folders - 'Aviary_No_Save' => 'Could not save image', - 'Zip_No_Extract' => 'Could not extract. File might be corrupt.', - 'Zip_Invalid' => 'This extension is not supported. Valid: zip, gz, tar.', - 'Dir_No_Write' => 'The directory you selected is not writable.', - 'Function_Disabled' => 'The %s function has been disabled by the server.', // %s = cut or copy - 'File_Permission' => 'File permission', - 'File_Permission_Not_Allowed' => 'Changing %s permissions are not allowed.', // %s = files or folders - 'File_Permission_Recursive' => 'Apply recursively?', - 'File_Permission_Wrong_Mode' => "The supplied permission mode is incorrect.", - 'User' => 'User', - 'Group' => 'Group', - 'Yes' => 'Yes', - 'No' => 'No', - 'Lang_Not_Found' => 'Could not find the language.', - 'Lang_Change' => 'Change the language', - 'File_Not_Found' => 'Could not find the file.', - 'File_Open_Edit_Not_Allowed' => 'You are not allowed to %s this file.', // %s = open or edit - 'Edit' => 'Edit', - 'Edit_File' => "Edit file's content", - 'File_Save_OK' => "File successfully saved.", - 'File_Save_Error' => "There was an error while saving the file.", - 'New_File' => 'New File', - 'No_Extension' => 'You have to add a file extension.', - 'Valid_Extensions' => 'Valid extensions: %s', // %s = txt,log etc. - + 'Select' => 'Select', + 'Erase' => 'Erase', + 'Open' => 'Open', + 'Confirm_del' => 'Are you sure you want to delete this file?', + 'All' => 'All', + 'Files' => 'Files', + 'Images' => 'Images', + 'Archives' => 'Archives', + 'Error_Upload' => 'The uploaded file exceeds the max size allowed.', + 'Error_extension' => 'File extension is not allowed.', + 'Upload_file' => 'Upload', + 'Filters' => 'Filters', + 'Videos' => 'Videos', + 'Music' => 'Music', + 'New_Folder' => 'New Folder', + 'Folder_Created' => 'Folder correctly created', + 'Existing_Folder' => 'Existing folder', + 'Confirm_Folder_del' => 'Are you sure to delete the folder and all the elements in it?', + 'Return_Files_List' => 'Return to files list', + 'Preview' => 'Preview', + 'Download' => 'Download', + 'Insert_Folder_Name' => 'Insert folder name:', + 'Root' => 'root', + 'Rename' => 'Rename', + 'Back' => 'back', + 'View' => 'View', + 'View_list' => 'List view', + 'View_columns_list' => 'Columns list view', + 'View_boxes' => 'Box view', + 'Toolbar' => 'Toolbar', + 'Actions' => 'Actions', + 'Rename_existing_file' => 'The file is already existing', + 'Rename_existing_folder' => 'The folder is already existing', + 'Empty_name' => 'The name is empty', + 'Text_filter' => 'text filter', + 'Swipe_help' => 'Swipe the name of file/folder to show options', + 'Upload_base' => 'Base upload', + 'Upload_java' => 'JAVA upload (big size files)', + 'Upload_java_help' => "If the Java Applet doesn't load, 1. make sure you have Java installed, otherwise [download link] 2. make sure nothing is blocked by your firewall", + 'Upload_base_help' => "Drag & Drop files or click in the area above (modern browsers) and select the file(s). When the upload is complete, click the 'Return to files list' button.", + 'Type_dir' => 'dir', + 'Type' => 'Type', + 'Dimension' => 'Dimension', + 'Size' => 'Size', + 'Date' => 'Date', + 'Filename' => 'Filename', + 'Operations' => 'Operations', + 'Date_type' => 'y-m-d', + 'OK' => 'OK', + 'Cancel' => 'Cancel', + 'Sorting' => 'sorting', + 'Show_url' => 'Show URL', + 'Extract' => 'Extract here', + 'File_info' => 'file info', + 'Edit_image' => 'Edit image', + 'Duplicate' => 'Duplicate', + 'Folders' => 'Folders', + 'Copy' => 'Copy', + 'Cut' => 'Cut', + 'Paste' => 'Paste', + 'CB' => 'CB', // clipboard + 'Paste_Here' => 'Paste to this directory', + 'Paste_Confirm' => 'Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.', + 'Paste_Failed' => 'Failed to paste file(s)', + 'Clear_Clipboard' => 'Clear clipboard', + 'Clear_Clipboard_Confirm' => 'Are you sure you want to clear the clipboard?', + 'Files_ON_Clipboard' => 'There are files on the clipboard.', + 'Copy_Cut_Size_Limit' => 'The selected files/folders are too big to %s. Limit: %d MB/operation', // %s = cut or copy + 'Copy_Cut_Count_Limit' => 'You selected too many files/folders to %s. Limit: %d files/operation', // %s = cut or copy + 'Copy_Cut_Not_Allowed' => 'You are not allowed to %s files.', // %s(1) = cut or copy, %s(2) = files or folders + 'Aviary_No_Save' => 'Could not save image', + 'Zip_No_Extract' => 'Could not extract. File might be corrupt.', + 'Zip_Invalid' => 'This extension is not supported. Valid: zip, gz, tar.', + 'Dir_No_Write' => 'The directory you selected is not writable.', + 'Function_Disabled' => 'The %s function has been disabled by the server.', // %s = cut or copy + 'File_Permission' => 'File permission', + 'File_Permission_Not_Allowed' => 'Changing %s permissions are not allowed.', // %s = files or folders + 'File_Permission_Recursive' => 'Apply recursively?', + 'File_Permission_Wrong_Mode' => "The supplied permission mode is incorrect.", + 'User' => 'User', + 'Group' => 'Group', + 'Yes' => 'Yes', + 'No' => 'No', + 'Lang_Not_Found' => 'Could not find the language.', + 'Lang_Change' => 'Change the language', + 'File_Not_Found' => 'Could not find the file.', + 'File_Open_Edit_Not_Allowed' => 'You are not allowed to %s this file.', // %s = open or edit + 'Edit' => 'Edit', + 'Edit_File' => "Edit file's content", + 'File_Save_OK' => "File successfully saved.", + 'File_Save_Error' => "There was an error while saving the file.", + 'New_File' => 'New File', + 'No_Extension' => 'You have to add a file extension.', + 'Valid_Extensions' => 'Valid extensions: %s', // %s = txt,log etc. + 'Close' => 'Close', + 'Info' => 'Info', + 'About' => 'About' ); diff --git a/filemanager/lang/it.php b/filemanager/lang/it.php index 6af26b03..fae36bd3 100644 --- a/filemanager/lang/it.php +++ b/filemanager/lang/it.php @@ -7,7 +7,7 @@ 'Open' => 'Apri', 'Confirm_del' => 'Sei sicuro di volere cancellare questo file?', 'All' => 'Tutti', - 'Files' => 'Files', + 'Files' => 'File', 'Images' => 'Immagini', 'Archives' => 'Archivi', 'Error_Upload' => 'Il file caricato supera i limiti imposti.', @@ -58,7 +58,7 @@ 'File_info' => 'informazioni file', 'Edit_image' => 'Modifica immagine', 'Duplicate' => 'Duplica', - 'Folders' => 'Folders', + 'Folders' => 'Cartelle', 'Copy' => 'Copia', 'Cut' => 'Taglia', 'Paste' => 'Incolla', @@ -70,8 +70,8 @@ 'Clear_Clipboard_Confirm' => 'Sei sicuro di voler cancellare la clipboard?', 'Files_ON_Clipboard' => 'Ci sono file nella clipboard.', 'Copy_Cut_Size_Limit' => 'I file o cartelle selezionati sono troppo grandi per %s. Il limite è: %d MB/operazione', // %s = cut or copy - 'Copy_Cut_Count_Limit' => 'Hai selezionato troppi files/cartelle da %s. Il limite è: %d files/operazione', // %s = cut or copy - 'Copy_Cut_Not_Allowed' => 'Non hai i permessi per %s files.', // %s(1) = cut or copy, %s(2) = files or folders + 'Copy_Cut_Count_Limit' => 'Hai selezionato troppi file/cartelle da %s. Il limite è: %d file/operazione', // %s = cut or copy + 'Copy_Cut_Not_Allowed' => 'Non hai i permessi per %s %s.', // %s(1) = cut or copy, %s(2) = files or folders 'Aviary_No_Save' => 'Non è stato possibile salvare l\'immagine', 'Zip_No_Extract' => 'Non si può estrarre il pacchetto perchè sembra corrotto', 'Zip_Invalid' => 'Questa estensione non è supportata. Le estensioni valide sono: zip, gz, tar.', @@ -97,4 +97,4 @@ 'No_Extension',"Non hai inserito l'estensione del file.", 'Valid_Extensions' => 'Estensioni valide: %s', // %s = txt,log etc. -); +); \ No newline at end of file diff --git a/filemanager/plugin.min.js b/filemanager/plugin.min.js new file mode 100644 index 00000000..abe0e6a3 --- /dev/null +++ b/filemanager/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("filemanager",function(e){function n(t){0===e.settings.external_filemanager_path.toLowerCase().indexOf(t.origin.toLowerCase())&&"responsivefilemanager"===t.data.sender&&(tinymce.activeEditor.windowManager.getParams().setUrl(t.data.url),tinymce.activeEditor.windowManager.close(),window.removeEventListener?window.removeEventListener("message",n,!1):window.detachEvent("onmessage",n))}function t(t,i,a,s){var r=$(window).innerWidth()-30,g=$(window).innerHeight()-60;if(r>1800&&(r=1800),g>1200&&(g=1200),r>600){var d=(r-20)%138;r=r-d+10}urltype=2,"image"==a&&(urltype=1),"media"==a&&(urltype=3);var o="RESPONSIVE FileManager";"undefined"!=typeof e.settings.filemanager_title&&e.settings.filemanager_title&&(o=e.settings.filemanager_title);var l="key";"undefined"!=typeof e.settings.filemanager_access_key&&e.settings.filemanager_access_key&&(l=e.settings.filemanager_access_key);var f="";"undefined"!=typeof e.settings.filemanager_sort_by&&e.settings.filemanager_sort_by&&(f="&sort_by="+e.settings.filemanager_sort_by);var m="false";"undefined"!=typeof e.settings.filemanager_descending&&e.settings.filemanager_descending&&(m=e.settings.filemanager_descending);var c="";"undefined"!=typeof e.settings.filemanager_subfolder&&e.settings.filemanager_subfolder&&(c="&fldr="+e.settings.filemanager_subfolder);var v="";"undefined"!=typeof e.settings.filemanager_crossdomain&&e.settings.filemanager_crossdomain&&(v="&crossdomain=1",window.addEventListener?window.addEventListener("message",n,!1):window.attachEvent("onmessage",n)),tinymce.activeEditor.windowManager.open({title:o,file:e.settings.external_filemanager_path+"dialog.php?type="+urltype+"&descending="+m+f+c+v+"&lang="+e.settings.language+"&akey="+l,width:r,height:g,resizable:!0,maximizable:!0,inline:1},{setUrl:function(n){var i=s.document.getElementById(t);if(i.value=e.convertURL(n),"createEvent"in document){var a=document.createEvent("HTMLEvents");a.initEvent("change",!1,!0),i.dispatchEvent(a)}else i.fireEvent("onchange")}})}return tinymce.activeEditor.settings.file_browser_callback=t,!1}); \ No newline at end of file diff --git a/filemanager/test.php b/filemanager/test.php new file mode 100644 index 00000000..b8a85285 --- /dev/null +++ b/filemanager/test.php @@ -0,0 +1,34 @@ + + + org.netbeans.modules.php.project + + + ResponsiveFilemanager + + + diff --git a/package.json b/package.json index 0eb21c64..082893d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ResponsiveFilemanager", - "version": "10.0.0", + "version": "9.9.7", "author": { "name": "Alberto Peripolli", "email": "info@albertoperipolli.com" @@ -9,7 +9,7 @@ "github": "https://github.com/trippo/ResponsiveFilemanager", "homepage": "http://www.responsivefilemanager.com/", "devDependencies": { - "gulp": "^3.8.8", + "gulp": "^3.9.0", "laravel-elixir": "*" } -} \ No newline at end of file +} diff --git a/resources/assets/css/metro.css b/resources/assets/css/metro.css new file mode 100644 index 00000000..d2f34d52 --- /dev/null +++ b/resources/assets/css/metro.css @@ -0,0 +1,10526 @@ +html, +body { + padding: 0; + margin: 0; + height: 100%; +} +html, +body, +* { + -ms-box-sizing: border-box; + -o-box-sizing: border-box; + box-sizing: border-box; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +nav, +section { + display: block; +} +audio, +canvas, +video { + display: inline-block; +} +audio:not([controls]) { + display: none; +} +a:hover, +a:active, +.tile:active { + outline: 0; +} +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +img { + max-width: 100%; + height: auto; + vertical-align: middle; + border: 0; + -ms-interpolation-mode: bicubic; +} +#map_canvas img, +.google-maps img { + max-width: none; +} +button, +input, +select, +textarea { + margin: 0; + font-size: 100%; + vertical-align: middle; +} +button, +input { + line-height: normal; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + padding: 0; + border: 0; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} +label, +select, +button, +input[type="button"], +input[type="reset"], +input[type="submit"], +input[type="radio"], +input[type="checkbox"] { + cursor: pointer; +} +input[type="search"] { + -webkit-appearance: textfield; + -ms-box-sizing: content-box; + -o-box-sizing: content-box; + box-sizing: content-box; +} +input[type="search"]::-webkit-search-decoration, +input[type="search"]::-webkit-search-cancel-button { + -webkit-appearance: none; +} +textarea { + overflow: auto; + vertical-align: top; +} +input[type=text]::-ms-clear, +input[type=email]::-ms-clear, +input[type=url]::-ms-clear, +input[type=tel]::-ms-clear, +input[type=number]::-ms-clear, +input[type=time]::-ms-clear { + display: none; +} +input[type=password]::-ms-reveal { + display: none; +} +* { + border-collapse: collapse; +} +a { + text-decoration: none; +} +div, +p, +span { + position: relative; +} +@media print { + * { + text-shadow: none !important; + color: #000 !important; + background: transparent !important; + box-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + .ir a:after, + a[href^="javascript:"]:after, + a[href^="#"]:after { + content: ""; + } + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } +} + +.bg-black { + background: #000000 !important; +} +.bg-white { + background: #ffffff !important; +} +.bg-lime { + background: #a4c400 !important; +} +.bg-green { + background: #60a917 !important; +} +.bg-emerald { + background: #008a00 !important; +} +.bg-teal { + background: #00aba9 !important; +} +.bg-cyan { + background: #1ba1e2 !important; +} +.bg-cobalt { + background: #0050ef !important; +} +.bg-indigo { + background: #6a00ff !important; +} +.bg-violet { + background: #aa00ff !important; +} +.bg-pink { + background: #dc4fad !important; +} +.bg-magenta { + background: #d80073 !important; +} +.bg-crimson { + background: #a20025 !important; +} +.bg-red { + background: #ce352c !important; +} +.bg-orange { + background: #fa6800 !important; +} +.bg-amber { + background: #f0a30a !important; +} +.bg-yellow { + background: #e3c800 !important; +} +.bg-brown { + background: #825a2c !important; +} +.bg-olive { + background: #6d8764 !important; +} +.bg-steel { + background: #647687 !important; +} +.bg-mauve { + background: #76608a !important; +} +.bg-taupe { + background: #87794e !important; +} +.bg-gray { + background: #555555 !important; +} +.bg-dark { + background: #333333 !important; +} +.bg-darker { + background: #222222 !important; +} +.bg-transparent { + background: transparent !important; +} +.bg-darkBrown { + background: #63362f !important; +} +.bg-darkCrimson { + background: #640024 !important; +} +.bg-darkMagenta { + background: #81003c !important; +} +.bg-darkIndigo { + background: #4b0096 !important; +} +.bg-darkCyan { + background: #1b6eae !important; +} +.bg-darkCobalt { + background: #00356a !important; +} +.bg-darkTeal { + background: #004050 !important; +} +.bg-darkEmerald { + background: #003e00 !important; +} +.bg-darkGreen { + background: #128023 !important; +} +.bg-darkOrange { + background: #bf5a15 !important; +} +.bg-darkRed { + background: #9a1616 !important; +} +.bg-darkPink { + background: #9a165a !important; +} +.bg-darkViolet { + background: #57169a !important; +} +.bg-darkBlue { + background: #16499a !important; +} +.bg-lightBlue { + background: #4390df !important; +} +.bg-lightRed { + background: #da5a53 !important; +} +.bg-lightGreen { + background: #7ad61d !important; +} +.bg-lighterBlue { + background: #00ccff !important; +} +.bg-lightTeal { + background: #45fffd !important; +} +.bg-lightOlive { + background: #78aa1c !important; +} +.bg-lightOrange { + background: #c29008 !important; +} +.bg-lightPink { + background: #f472d0 !important; +} +.bg-grayDark { + background: #333333 !important; +} +.bg-grayDarker { + background: #222222 !important; +} +.bg-grayLight { + background: #999999 !important; +} +.bg-grayLighter { + background: #eeeeee !important; +} +.bg-blue { + background: #00aff0 !important; +} +.fg-black { + color: #000000 !important; +} +.fg-white { + color: #ffffff !important; +} +.fg-lime { + color: #a4c400 !important; +} +.fg-green { + color: #60a917 !important; +} +.fg-emerald { + color: #008a00 !important; +} +.fg-teal { + color: #00aba9 !important; +} +.fg-cyan { + color: #1ba1e2 !important; +} +.fg-cobalt { + color: #0050ef !important; +} +.fg-indigo { + color: #6a00ff !important; +} +.fg-violet { + color: #aa00ff !important; +} +.fg-pink { + color: #dc4fad !important; +} +.fg-magenta { + color: #d80073 !important; +} +.fg-crimson { + color: #a20025 !important; +} +.fg-red { + color: #ce352c !important; +} +.fg-orange { + color: #fa6800 !important; +} +.fg-amber { + color: #f0a30a !important; +} +.fg-yellow { + color: #e3c800 !important; +} +.fg-brown { + color: #825a2c !important; +} +.fg-olive { + color: #6d8764 !important; +} +.fg-steel { + color: #647687 !important; +} +.fg-mauve { + color: #76608a !important; +} +.fg-taupe { + color: #87794e !important; +} +.fg-gray { + color: #555555 !important; +} +.fg-dark { + color: #333333 !important; +} +.fg-darker { + color: #222222 !important; +} +.fg-transparent { + color: transparent !important; +} +.fg-darkBrown { + color: #63362f !important; +} +.fg-darkCrimson { + color: #640024 !important; +} +.fg-darkMagenta { + color: #81003c !important; +} +.fg-darkIndigo { + color: #4b0096 !important; +} +.fg-darkCyan { + color: #1b6eae !important; +} +.fg-darkCobalt { + color: #00356a !important; +} +.fg-darkTeal { + color: #004050 !important; +} +.fg-darkEmerald { + color: #003e00 !important; +} +.fg-darkGreen { + color: #128023 !important; +} +.fg-darkOrange { + color: #bf5a15 !important; +} +.fg-darkRed { + color: #9a1616 !important; +} +.fg-darkPink { + color: #9a165a !important; +} +.fg-darkViolet { + color: #57169a !important; +} +.fg-darkBlue { + color: #16499a !important; +} +.fg-lightBlue { + color: #4390df !important; +} +.fg-lighterBlue { + color: #00ccff !important; +} +.fg-lightTeal { + color: #45fffd !important; +} +.fg-lightOlive { + color: #78aa1c !important; +} +.fg-lightOrange { + color: #c29008 !important; +} +.fg-lightPink { + color: #f472d0 !important; +} +.fg-lightRed { + color: #da5a53 !important; +} +.fg-lightGreen { + color: #7ad61d !important; +} +.fg-grayDark { + color: #333333 !important; +} +.fg-grayDarker { + color: #222222 !important; +} +.fg-grayLight { + color: #999999 !important; +} +.fg-grayLighter { + color: #eeeeee !important; +} +.fg-blue { + color: #00aff0 !important; +} +.ol-black { + outline-color: #000000 !important; +} +.ol-white { + outline-color: #ffffff !important; +} +.ol-lime { + outline-color: #a4c400 !important; +} +.ol-green { + outline-color: #60a917 !important; +} +.ol-emerald { + outline-color: #008a00 !important; +} +.ol-teal { + outline-color: #00aba9 !important; +} +.ol-cyan { + outline-color: #1ba1e2 !important; +} +.ol-cobalt { + outline-color: #0050ef !important; +} +.ol-indigo { + outline-color: #6a00ff !important; +} +.ol-violet { + outline-color: #aa00ff !important; +} +.ol-pink { + outline-color: #dc4fad !important; +} +.ol-magenta { + outline-color: #d80073 !important; +} +.ol-crimson { + outline-color: #a20025 !important; +} +.ol-red { + outline-color: #ce352c !important; +} +.ol-orange { + outline-color: #fa6800 !important; +} +.ol-amber { + outline-color: #f0a30a !important; +} +.ol-yellow { + outline-color: #e3c800 !important; +} +.ol-brown { + outline-color: #825a2c !important; +} +.ol-olive { + outline-color: #6d8764 !important; +} +.ol-steel { + outline-color: #647687 !important; +} +.ol-mauve { + outline-color: #76608a !important; +} +.ol-taupe { + outline-color: #87794e !important; +} +.ol-gray { + outline-color: #555555 !important; +} +.ol-dark { + outline-color: #333333 !important; +} +.ol-darker { + outline-color: #222222 !important; +} +.ol-transparent { + outline-color: transparent !important; +} +.ol-darkBrown { + outline-color: #63362f !important; +} +.ol-darkCrimson { + outline-color: #640024 !important; +} +.ol-darkMagenta { + outline-color: #81003c !important; +} +.ol-darkIndigo { + outline-color: #4b0096 !important; +} +.ol-darkCyan { + outline-color: #1b6eae !important; +} +.ol-darkCobalt { + outline-color: #00356a !important; +} +.ol-darkTeal { + outline-color: #004050 !important; +} +.ol-darkEmerald { + outline-color: #003e00 !important; +} +.ol-darkGreen { + outline-color: #128023 !important; +} +.ol-darkOrange { + outline-color: #bf5a15 !important; +} +.ol-darkRed { + outline-color: #9a1616 !important; +} +.ol-darkPink { + outline-color: #9a165a !important; +} +.ol-darkViolet { + outline-color: #57169a !important; +} +.ol-darkBlue { + outline-color: #16499a !important; +} +.ol-lightBlue { + outline-color: #4390df !important; +} +.ol-lighterBlue { + outline-color: #00ccff !important; +} +.ol-lightTeal { + outline-color: #45fffd !important; +} +.ol-lightOlive { + outline-color: #78aa1c !important; +} +.ol-lightOrange { + outline-color: #c29008 !important; +} +.ol-lightPink { + outline-color: #f472d0 !important; +} +.ol-lightRed { + outline-color: #da5a53 !important; +} +.ol-lightGreen { + outline-color: #7ad61d !important; +} +.ol-grayDark { + outline-color: #333333 !important; +} +.ol-grayDarker { + outline-color: #222222 !important; +} +.ol-grayLight { + outline-color: #999999 !important; +} +.ol-grayLighter { + outline-color: #eeeeee !important; +} +.ol-blue { + outline-color: #00aff0 !important; +} +.bd-black { + border-color: #000000 !important; +} +.bd-white { + border-color: #ffffff !important; +} +.bd-lime { + border-color: #a4c400 !important; +} +.bd-green { + border-color: #60a917 !important; +} +.bd-emerald { + border-color: #008a00 !important; +} +.bd-teal { + border-color: #00aba9 !important; +} +.bd-cyan { + border-color: #1ba1e2 !important; +} +.bd-cobalt { + border-color: #0050ef !important; +} +.bd-indigo { + border-color: #6a00ff !important; +} +.bd-violet { + border-color: #aa00ff !important; +} +.bd-pink { + border-color: #dc4fad !important; +} +.bd-magenta { + border-color: #d80073 !important; +} +.bd-crimson { + border-color: #a20025 !important; +} +.bd-red { + border-color: #ce352c !important; +} +.bd-orange { + border-color: #fa6800 !important; +} +.bd-amber { + border-color: #f0a30a !important; +} +.bd-yellow { + border-color: #e3c800 !important; +} +.bd-brown { + border-color: #825a2c !important; +} +.bd-olive { + border-color: #6d8764 !important; +} +.bd-steel { + border-color: #647687 !important; +} +.bd-mauve { + border-color: #76608a !important; +} +.bd-taupe { + border-color: #87794e !important; +} +.bd-gray { + border-color: #555555 !important; +} +.bd-dark { + border-color: #333333 !important; +} +.bd-darker { + border-color: #222222 !important; +} +.bd-transparent { + border-color: transparent !important; +} +.bd-darkBrown { + border-color: #63362f !important; +} +.bd-darkCrimson { + border-color: #640024 !important; +} +.bd-darkMagenta { + border-color: #81003c !important; +} +.bd-darkIndigo { + border-color: #4b0096 !important; +} +.bd-darkCyan { + border-color: #1b6eae !important; +} +.bd-darkCobalt { + border-color: #00356a !important; +} +.bd-darkTeal { + border-color: #004050 !important; +} +.bd-darkEmerald { + border-color: #003e00 !important; +} +.bd-darkGreen { + border-color: #128023 !important; +} +.bd-darkOrange { + border-color: #bf5a15 !important; +} +.bd-darkRed { + border-color: #9a1616 !important; +} +.bd-darkPink { + border-color: #9a165a !important; +} +.bd-darkViolet { + border-color: #57169a !important; +} +.bd-darkBlue { + border-color: #16499a !important; +} +.bd-lightBlue { + border-color: #4390df !important; +} +.bd-lightTeal { + border-color: #45fffd !important; +} +.bd-lightOlive { + border-color: #78aa1c !important; +} +.bd-lightOrange { + border-color: #c29008 !important; +} +.bd-lightPink { + border-color: #f472d0 !important; +} +.bd-lightRed { + border-color: #da5a53 !important; +} +.bd-lightGreen { + border-color: #7ad61d !important; +} +.bd-grayDark { + border-color: #333333 !important; +} +.bd-grayDarker { + border-color: #222222 !important; +} +.bd-grayLight { + border-color: #999999 !important; +} +.bd-grayLighter { + border-color: #eeeeee !important; +} +.bd-blue { + border-color: #00aff0 !important; +} +.bg-hover-black:hover { + background: #000000 !important; +} +.bg-hover-white:hover { + background: #ffffff !important; +} +.bg-hover-lime:hover { + background: #a4c400 !important; +} +.bg-hover-green:hover { + background: #60a917 !important; +} +.bg-hover-emerald:hover { + background: #008a00 !important; +} +.bg-hover-teal:hover { + background: #00aba9 !important; +} +.bg-hover-cyan:hover { + background: #1ba1e2 !important; +} +.bg-hover-cobalt:hover { + background: #0050ef !important; +} +.bg-hover-indigo:hover { + background: #6a00ff !important; +} +.bg-hover-violet:hover { + background: #aa00ff !important; +} +.bg-hover-pink:hover { + background: #dc4fad !important; +} +.bg-hover-magenta:hover { + background: #d80073 !important; +} +.bg-hover-crimson:hover { + background: #a20025 !important; +} +.bg-hover-red:hover { + background: #ce352c !important; +} +.bg-hover-orange:hover { + background: #fa6800 !important; +} +.bg-hover-amber:hover { + background: #f0a30a !important; +} +.bg-hover-yellow:hover { + background: #e3c800 !important; +} +.bg-hover-brown:hover { + background: #825a2c !important; +} +.bg-hover-olive:hover { + background: #6d8764 !important; +} +.bg-hover-steel:hover { + background: #647687 !important; +} +.bg-hover-mauve:hover { + background: #76608a !important; +} +.bg-hover-taupe:hover { + background: #87794e !important; +} +.bg-hover-gray:hover { + background: #555555 !important; +} +.bg-hover-dark:hover { + background: #333333 !important; +} +.bg-hover-darker:hover { + background: #222222 !important; +} +.bg-hover-transparent:hover { + background: transparent !important; +} +.bg-hover-darkBrown:hover { + background: #63362f !important; +} +.bg-hover-darkCrimson:hover { + background: #640024 !important; +} +.bg-hover-darkMagenta:hover { + background: #81003c !important; +} +.bg-hover-darkIndigo:hover { + background: #4b0096 !important; +} +.bg-hover-darkCyan:hover { + background: #1b6eae !important; +} +.bg-hover-darkCobalt:hover { + background: #00356a !important; +} +.bg-hover-darkTeal:hover { + background: #004050 !important; +} +.bg-hover-darkEmerald:hover { + background: #003e00 !important; +} +.bg-hover-darkGreen:hover { + background: #128023 !important; +} +.bg-hover-darkOrange:hover { + background: #bf5a15 !important; +} +.bg-hover-darkRed:hover { + background: #9a1616 !important; +} +.bg-hover-darkPink:hover { + background: #9a165a !important; +} +.bg-hover-darkViolet:hover { + background: #57169a !important; +} +.bg-hover-darkBlue:hover { + background: #16499a !important; +} +.bg-hover-lightBlue:hover { + background: #4390df !important; +} +.bg-hover-lightTeal:hover { + background: #45fffd !important; +} +.bg-hover-lightOlive:hover { + background: #78aa1c !important; +} +.bg-hover-lightOrange:hover { + background: #c29008 !important; +} +.bg-hover-lightPink:hover { + background: #f472d0 !important; +} +.bg-hover-lightRed:hover { + background: #da5a53 !important; +} +.bg-hover-lightGreen:hover { + background: #7ad61d !important; +} +.bg-hover-grayDark:hover { + background: #333333 !important; +} +.bg-hover-grayDarker:hover { + background: #222222 !important; +} +.bg-hover-grayLight:hover { + background: #999999 !important; +} +.bg-hover-grayLighter:hover { + background: #eeeeee !important; +} +.bg-hover-blue:hover { + background: #00aff0 !important; +} +.fg-hover-black:hover { + color: #000000 !important; +} +.fg-hover-white:hover { + color: #ffffff !important; +} +.fg-hover-lime:hover { + color: #a4c400 !important; +} +.fg-hover-green:hover { + color: #60a917 !important; +} +.fg-hover-emerald:hover { + color: #008a00 !important; +} +.fg-hover-teal:hover { + color: #00aba9 !important; +} +.fg-hover-cyan:hover { + color: #1ba1e2 !important; +} +.fg-hover-cobalt:hover { + color: #0050ef !important; +} +.fg-hover-indigo:hover { + color: #6a00ff !important; +} +.fg-hover-violet:hover { + color: #aa00ff !important; +} +.fg-hover-pink:hover { + color: #dc4fad !important; +} +.fg-hover-magenta:hover { + color: #d80073 !important; +} +.fg-hover-crimson:hover { + color: #a20025 !important; +} +.fg-hover-red:hover { + color: #ce352c !important; +} +.fg-hover-orange:hover { + color: #fa6800 !important; +} +.fg-hover-amber:hover { + color: #f0a30a !important; +} +.fg-hover-yellow:hover { + color: #e3c800 !important; +} +.fg-hover-brown:hover { + color: #825a2c !important; +} +.fg-hover-olive:hover { + color: #6d8764 !important; +} +.fg-hover-steel:hover { + color: #647687 !important; +} +.fg-hover-mauve:hover { + color: #76608a !important; +} +.fg-hover-taupe:hover { + color: #87794e !important; +} +.fg-hover-gray:hover { + color: #555555 !important; +} +.fg-hover-dark:hover { + color: #333333 !important; +} +.fg-hover-darker:hover { + color: #222222 !important; +} +.fg-hover-transparent:hover { + color: transparent !important; +} +.fg-hover-darkBrown:hover { + color: #63362f !important; +} +.fg-hover-darkCrimson:hover { + color: #640024 !important; +} +.fg-hover-darkMagenta:hover { + color: #81003c !important; +} +.fg-hover-darkIndigo:hover { + color: #4b0096 !important; +} +.fg-hover-darkCyan:hover { + color: #1b6eae !important; +} +.fg-hover-darkCobalt:hover { + color: #00356a !important; +} +.fg-hover-darkTeal:hover { + color: #004050 !important; +} +.fg-hover-darkEmerald:hover { + color: #003e00 !important; +} +.fg-hover-darkGreen:hover { + color: #128023 !important; +} +.fg-hover-darkOrange:hover { + color: #bf5a15 !important; +} +.fg-hover-darkRed:hover { + color: #9a1616 !important; +} +.fg-hover-darkPink:hover { + color: #9a165a !important; +} +.fg-hover-darkViolet:hover { + color: #57169a !important; +} +.fg-hover-darkBlue:hover { + color: #16499a !important; +} +.fg-hover-lightBlue:hover { + color: #4390df !important; +} +.fg-hover-lightTeal:hover { + color: #45fffd !important; +} +.fg-hover-lightOlive:hover { + color: #78aa1c !important; +} +.fg-hover-lightOrange:hover { + color: #c29008 !important; +} +.fg-hover-lightPink:hover { + color: #f472d0 !important; +} +.fg-hover-lightRed:hover { + color: #da5a53 !important; +} +.fg-hover-lightGreen:hover { + color: #7ad61d !important; +} +.fg-hover-grayDark:hover { + color: #333333 !important; +} +.fg-hover-grayDarker:hover { + color: #222222 !important; +} +.fg-hover-grayLight:hover { + color: #999999 !important; +} +.fg-hover-grayLighter:hover { + color: #eeeeee !important; +} +.fg-hover-blue:hover { + color: #00aff0 !important; +} +.bg-active-black:active { + background: #000000 !important; +} +.bg-active-white:active { + background: #ffffff !important; +} +.bg-active-lime:active { + background: #a4c400 !important; +} +.bg-active-green:active { + background: #60a917 !important; +} +.bg-active-emerald:active { + background: #008a00 !important; +} +.bg-active-teal:active { + background: #00aba9 !important; +} +.bg-active-cyan:active { + background: #1ba1e2 !important; +} +.bg-active-cobalt:active { + background: #0050ef !important; +} +.bg-active-indigo:active { + background: #6a00ff !important; +} +.bg-active-violet:active { + background: #aa00ff !important; +} +.bg-active-pink:active { + background: #dc4fad !important; +} +.bg-active-magenta:active { + background: #d80073 !important; +} +.bg-active-crimson:active { + background: #a20025 !important; +} +.bg-active-red:active { + background: #ce352c !important; +} +.bg-active-orange:active { + background: #fa6800 !important; +} +.bg-active-amber:active { + background: #f0a30a !important; +} +.bg-active-yellow:active { + background: #e3c800 !important; +} +.bg-active-brown:active { + background: #825a2c !important; +} +.bg-active-olive:active { + background: #6d8764 !important; +} +.bg-active-steel:active { + background: #647687 !important; +} +.bg-active-mauve:active { + background: #76608a !important; +} +.bg-active-taupe:active { + background: #87794e !important; +} +.bg-active-gray:active { + background: #555555 !important; +} +.bg-active-dark:active { + background: #333333 !important; +} +.bg-active-darker:active { + background: #222222 !important; +} +.bg-active-transparent:active { + background: transparent !important; +} +.bg-active-darkBrown:active { + background: #63362f !important; +} +.bg-active-darkCrimson:active { + background: #640024 !important; +} +.bg-active-darkMagenta:active { + background: #81003c !important; +} +.bg-active-darkIndigo:active { + background: #4b0096 !important; +} +.bg-active-darkCyan:active { + background: #1b6eae !important; +} +.bg-active-darkCobalt:active { + background: #00356a !important; +} +.bg-active-darkTeal:active { + background: #004050 !important; +} +.bg-active-darkEmerald:active { + background: #003e00 !important; +} +.bg-active-darkGreen:active { + background: #128023 !important; +} +.bg-active-darkOrange:active { + background: #bf5a15 !important; +} +.bg-active-darkRed:active { + background: #9a1616 !important; +} +.bg-active-darkPink:active { + background: #9a165a !important; +} +.bg-active-darkViolet:active { + background: #57169a !important; +} +.bg-active-darkBlue:active { + background: #16499a !important; +} +.bg-active-lightBlue:active { + background: #4390df !important; +} +.bg-active-lightTeal:active { + background: #45fffd !important; +} +.bg-active-lightOlive:active { + background: #78aa1c !important; +} +.bg-active-lightOrange:active { + background: #c29008 !important; +} +.bg-active-lightPink:active { + background: #f472d0 !important; +} +.bg-active-lightRed:active { + background: #da5a53 !important; +} +.bg-active-lightGreen:active { + background: #7ad61d !important; +} +.bg-active-grayDark:active { + background: #333333 !important; +} +.bg-active-grayDarker:active { + background: #222222 !important; +} +.bg-active-grayLight:active { + background: #999999 !important; +} +.bg-active-grayLighter:active { + background: #eeeeee !important; +} +.bg-active-blue:active { + background: #00aff0 !important; +} +.fg-active-black:active { + color: #000000 !important; +} +.fg-active-white:active { + color: #ffffff !important; +} +.fg-active-lime:active { + color: #a4c400 !important; +} +.fg-active-green:active { + color: #60a917 !important; +} +.fg-active-emerald:active { + color: #008a00 !important; +} +.fg-active-teal:active { + color: #00aba9 !important; +} +.fg-active-cyan:active { + color: #1ba1e2 !important; +} +.fg-active-cobalt:active { + color: #0050ef !important; +} +.fg-active-indigo:active { + color: #6a00ff !important; +} +.fg-active-violet:active { + color: #aa00ff !important; +} +.fg-active-pink:active { + color: #dc4fad !important; +} +.fg-active-magenta:active { + color: #d80073 !important; +} +.fg-active-crimson:active { + color: #a20025 !important; +} +.fg-active-red:active { + color: #ce352c !important; +} +.fg-active-orange:active { + color: #fa6800 !important; +} +.fg-active-amber:active { + color: #f0a30a !important; +} +.fg-active-yellow:active { + color: #e3c800 !important; +} +.fg-active-brown:active { + color: #825a2c !important; +} +.fg-active-olive:active { + color: #6d8764 !important; +} +.fg-active-steel:active { + color: #647687 !important; +} +.fg-active-mauve:active { + color: #76608a !important; +} +.fg-active-taupe:active { + color: #87794e !important; +} +.fg-active-gray:active { + color: #555555 !important; +} +.fg-active-dark:active { + color: #333333 !important; +} +.fg-active-darker:active { + color: #222222 !important; +} +.fg-active-transparent:active { + color: transparent !important; +} +.fg-active-darkBrown:active { + color: #63362f !important; +} +.fg-active-darkCrimson:active { + color: #640024 !important; +} +.fg-active-darkMagenta:active { + color: #81003c !important; +} +.fg-active-darkIndigo:active { + color: #4b0096 !important; +} +.fg-active-darkCyan:active { + color: #1b6eae !important; +} +.fg-active-darkCobalt:active { + color: #00356a !important; +} +.fg-active-darkTeal:active { + color: #004050 !important; +} +.fg-active-darkEmerald:active { + color: #003e00 !important; +} +.fg-active-darkGreen:active { + color: #128023 !important; +} +.fg-active-darkOrange:active { + color: #bf5a15 !important; +} +.fg-active-darkRed:active { + color: #9a1616 !important; +} +.fg-active-darkPink:active { + color: #9a165a !important; +} +.fg-active-darkViolet:active { + color: #57169a !important; +} +.fg-active-darkBlue:active { + color: #16499a !important; +} +.fg-active-lightBlue:active { + color: #4390df !important; +} +.fg-active-lightTeal:active { + color: #45fffd !important; +} +.fg-active-lightOlive:active { + color: #78aa1c !important; +} +.fg-active-lightOrange:active { + color: #c29008 !important; +} +.fg-active-lightPink:active { + color: #f472d0 !important; +} +.fg-active-lightRed:active { + color: #da5a53 !important; +} +.fg-active-lightGreen:active { + color: #7ad61d !important; +} +.fg-active-grayDark:active { + color: #333333 !important; +} +.fg-active-grayDarker:active { + color: #222222 !important; +} +.fg-active-grayLight:active { + color: #999999 !important; +} +.fg-active-grayLighter:active { + color: #eeeeee !important; +} +.fg-active-blue:active { + color: #00aff0 !important; +} +.bg-focus-black:focus { + background: #000000 !important; +} +.bg-focus-white:focus { + background: #ffffff !important; +} +.bg-focus-lime:focus { + background: #a4c400 !important; +} +.bg-focus-green:focus { + background: #60a917 !important; +} +.bg-focus-emerald:focus { + background: #008a00 !important; +} +.bg-focus-teal:focus { + background: #00aba9 !important; +} +.bg-focus-cyan:focus { + background: #1ba1e2 !important; +} +.bg-focus-cobalt:focus { + background: #0050ef !important; +} +.bg-focus-indigo:focus { + background: #6a00ff !important; +} +.bg-focus-violet:focus { + background: #aa00ff !important; +} +.bg-focus-pink:focus { + background: #dc4fad !important; +} +.bg-focus-magenta:focus { + background: #d80073 !important; +} +.bg-focus-crimson:focus { + background: #a20025 !important; +} +.bg-focus-red:focus { + background: #ce352c !important; +} +.bg-focus-orange:focus { + background: #fa6800 !important; +} +.bg-focus-amber:focus { + background: #f0a30a !important; +} +.bg-focus-yellow:focus { + background: #e3c800 !important; +} +.bg-focus-brown:focus { + background: #825a2c !important; +} +.bg-focus-olive:focus { + background: #6d8764 !important; +} +.bg-focus-steel:focus { + background: #647687 !important; +} +.bg-focus-mauve:focus { + background: #76608a !important; +} +.bg-focus-taupe:focus { + background: #87794e !important; +} +.bg-focus-gray:focus { + background: #555555 !important; +} +.bg-focus-dark:focus { + background: #333333 !important; +} +.bg-focus-darker:focus { + background: #222222 !important; +} +.bg-focus-transparent:focus { + background: transparent !important; +} +.bg-focus-darkBrown:focus { + background: #63362f !important; +} +.bg-focus-darkCrimson:focus { + background: #640024 !important; +} +.bg-focus-darkMagenta:focus { + background: #81003c !important; +} +.bg-focus-darkIndigo:focus { + background: #4b0096 !important; +} +.bg-focus-darkCyan:focus { + background: #1b6eae !important; +} +.bg-focus-darkCobalt:focus { + background: #00356a !important; +} +.bg-focus-darkTeal:focus { + background: #004050 !important; +} +.bg-focus-darkEmerald:focus { + background: #003e00 !important; +} +.bg-focus-darkGreen:focus { + background: #128023 !important; +} +.bg-focus-darkOrange:focus { + background: #bf5a15 !important; +} +.bg-focus-darkRed:focus { + background: #9a1616 !important; +} +.bg-focus-darkPink:focus { + background: #9a165a !important; +} +.bg-focus-darkViolet:focus { + background: #57169a !important; +} +.bg-focus-darkBlue:focus { + background: #16499a !important; +} +.bg-focus-lightBlue:focus { + background: #4390df !important; +} +.bg-focus-lightTeal:focus { + background: #45fffd !important; +} +.bg-focus-lightOlive:focus { + background: #78aa1c !important; +} +.bg-focus-lightOrange:focus { + background: #c29008 !important; +} +.bg-focus-lightPink:focus { + background: #f472d0 !important; +} +.bg-focus-lightRed:focus { + background: #da5a53 !important; +} +.bg-focus-lightGreen:focus { + background: #7ad61d !important; +} +.bg-focus-grayDark:focus { + background: #333333 !important; +} +.bg-focus-grayDarker:focus { + background: #222222 !important; +} +.bg-focus-grayLight:focus { + background: #999999 !important; +} +.bg-focus-grayLighter:focus { + background: #eeeeee !important; +} +.bg-focus-blue:focus { + background: #00aff0 !important; +} +.fg-focus-black:focus { + color: #000000 !important; +} +.fg-focus-white:focus { + color: #ffffff !important; +} +.fg-focus-lime:focus { + color: #a4c400 !important; +} +.fg-focus-green:focus { + color: #60a917 !important; +} +.fg-focus-emerald:focus { + color: #008a00 !important; +} +.fg-focus-teal:focus { + color: #00aba9 !important; +} +.fg-focus-cyan:focus { + color: #1ba1e2 !important; +} +.fg-focus-cobalt:focus { + color: #0050ef !important; +} +.fg-focus-indigo:focus { + color: #6a00ff !important; +} +.fg-focus-violet:focus { + color: #aa00ff !important; +} +.fg-focus-pink:focus { + color: #dc4fad !important; +} +.fg-focus-magenta:focus { + color: #d80073 !important; +} +.fg-focus-crimson:focus { + color: #a20025 !important; +} +.fg-focus-red:focus { + color: #ce352c !important; +} +.fg-focus-orange:focus { + color: #fa6800 !important; +} +.fg-focus-amber:focus { + color: #f0a30a !important; +} +.fg-focus-yellow:focus { + color: #e3c800 !important; +} +.fg-focus-brown:focus { + color: #825a2c !important; +} +.fg-focus-olive:focus { + color: #6d8764 !important; +} +.fg-focus-steel:focus { + color: #647687 !important; +} +.fg-focus-mauve:focus { + color: #76608a !important; +} +.fg-focus-taupe:focus { + color: #87794e !important; +} +.fg-focus-gray:focus { + color: #555555 !important; +} +.fg-focus-dark:focus { + color: #333333 !important; +} +.fg-focus-darker:focus { + color: #222222 !important; +} +.fg-focus-transparent:focus { + color: transparent !important; +} +.fg-focus-darkBrown:focus { + color: #63362f !important; +} +.fg-focus-darkCrimson:focus { + color: #640024 !important; +} +.fg-focus-darkMagenta:focus { + color: #81003c !important; +} +.fg-focus-darkIndigo:focus { + color: #4b0096 !important; +} +.fg-focus-darkCyan:focus { + color: #1b6eae !important; +} +.fg-focus-darkCobalt:focus { + color: #00356a !important; +} +.fg-focus-darkTeal:focus { + color: #004050 !important; +} +.fg-focus-darkEmerald:focus { + color: #003e00 !important; +} +.fg-focus-darkGreen:focus { + color: #128023 !important; +} +.fg-focus-darkOrange:focus { + color: #bf5a15 !important; +} +.fg-focus-darkRed:focus { + color: #9a1616 !important; +} +.fg-focus-darkPink:focus { + color: #9a165a !important; +} +.fg-focus-darkViolet:focus { + color: #57169a !important; +} +.fg-focus-darkBlue:focus { + color: #16499a !important; +} +.fg-focus-lightBlue:focus { + color: #4390df !important; +} +.fg-focus-lightTeal:focus { + color: #45fffd !important; +} +.fg-focus-lightOlive:focus { + color: #78aa1c !important; +} +.fg-focus-lightOrange:focus { + color: #c29008 !important; +} +.fg-focus-lightPink:focus { + color: #f472d0 !important; +} +.fg-focus-lightRed:focus { + color: #da5a53 !important; +} +.fg-focus-lightGreen:focus { + color: #7ad61d !important; +} +.fg-focus-grayDark:focus { + color: #333333 !important; +} +.fg-focus-grayDarker:focus { + color: #222222 !important; +} +.fg-focus-grayLight:focus { + color: #999999 !important; +} +.fg-focus-grayLighter:focus { + color: #eeeeee !important; +} +.fg-focus-blue:focus { + color: #00aff0 !important; +} + +.dropdown-toggle { + position: relative; + cursor: pointer; +} +.dropdown-toggle:before { + display: block; + position: absolute; + vertical-align: middle; + color: transparent; + font-size: 0; + content: ""; + height: 5px; + width: 5px; + background-color: transparent !important; + border-left: 1px solid; + border-bottom: 1px solid; + border-color: #1d1d1d; + top: 50%; + left: 100%; + margin-left: -1rem; + margin-top: -0.1625rem; + z-index: 2; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); +} +.dropdown-toggle.drop-marker-light:before { + border-color: #ffffff; +} +*.dropdown-toggle { + padding-right: 1.625rem; +} +.flush-list { + padding: 0; + margin: 0; + list-style: none inside none; +} +.shadow { + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35); +} +.block-shadow { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3); +} +.block-shadow-success { + box-shadow: 0 0 25px 0 rgba(0, 128, 0, 0.7); +} +.block-shadow-error { + box-shadow: 0 0 25px 0 rgba(128, 0, 0, 0.7); +} +.block-shadow-danger { + box-shadow: 0 0 25px 0 rgba(128, 0, 0, 0.7); +} +.block-shadow-warning { + box-shadow: 0 0 25px 0 rgba(255, 165, 0, 0.7); +} +.block-shadow-info { + box-shadow: 0 0 25px 0 rgba(89, 205, 226, 0.7); +} +.block-shadow-impact { + box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2); +} +.bottom-shadow { + box-shadow: -1px 6px 6px -6px rgba(0, 0, 0, 0.35); +} +.text-shadow { + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); +} +.no-shadow { + box-shadow: none !important; +} +.full-size { + width: 100% !important; +} +.block { + display: block !important; +} +.inline-block { + display: inline-block !important; +} +.no-display { + display: none !important; +} +.no-margin { + margin: 0 !important; +} +.no-margin-right { + margin-right: 0 !important; +} +.no-margin-left { + margin-left: 0 !important; +} +.no-margin-top { + margin-top: 0 !important; +} +.no-margin-bottom { + margin-bottom: 0 !important; +} +.no-padding { + padding: 0 !important; +} +.no-padding-left { + padding-left: 0 !important; +} +.no-padding-right { + padding-right: 0 !important; +} +.no-padding-top { + padding-top: 0 !important; +} +.no-padding-bottom { + padding-bottom: 0 !important; +} +.no-float { + float: none !important; +} +.no-visible { + visibility: hidden !important; +} +.no-border { + border: 0 !important; +} +.no-overflow { + overflow: hidden !important; +} +.place-right { + float: right !important; +} +.place-left { + float: left !important; +} +.clear-float:before, +.clear-float:after { + display: table; + content: ""; +} +.clear-float:after { + clear: both; +} +.clearfix:before, +.clearfix:after { + display: table; + content: ""; +} +.clearfix:after { + clear: both; +} +.no-user-select { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.no-appearance { + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; +} +.debug { + border: 1px dashed red; +} +.example { + padding: .625rem 1.825rem .625rem 2.5rem; + border: 1px #ccc dashed; + position: relative; + margin: 0 0 .625rem 0; + background-color: #ffffff; +} +.example:before, +.example:after { + display: table; + content: ""; +} +.example:after { + clear: both; +} +.example:before { + position: absolute; + content: attr(data-text); + text-transform: lowercase; + left: 1.5rem; + top: 11.875rem; + color: gray; + display: block; + font-size: 1rem; + line-height: 1rem; + height: 1rem; + text-align: right; + white-space: nowrap; + direction: ltr; + width: 12.5rem; + -webkit-transform: rotate(-90deg); + transform: rotate(-90deg); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; +} +.video-container { + position: relative; + padding-bottom: 56.25%; + padding-top: 30px; + height: 0; + overflow: hidden; +} +.video-container iframe, +.video-container object, +.video-container embed { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.padding10 { + padding: 0.625rem; +} +.padding20 { + padding: 1.25rem; +} +.padding30 { + padding: 1.875rem; +} +.padding40 { + padding: 2.5rem; +} +.padding50 { + padding: 3.125rem; +} +.padding60 { + padding: 3.75rem; +} +.padding70 { + padding: 4.375rem; +} +.padding80 { + padding: 5rem; +} +.padding90 { + padding: 5.625rem; +} +.padding100 { + padding: 6.25rem; +} +.padding5 { + padding: 5px; +} +.margin5 { + margin: 5px; +} +.margin10 { + margin: 0.625rem; +} +.margin20 { + margin: 1.25rem; +} +.margin30 { + margin: 1.875rem; +} +.margin40 { + margin: 2.5rem; +} +.margin50 { + margin: 3.125rem; +} +.margin60 { + margin: 3.75rem; +} +.margin70 { + margin: 4.375rem; +} +.margin80 { + margin: 5rem; +} +.margin90 { + margin: 5.625rem; +} +.margin100 { + margin: 6.25rem; +} +.element-selected { + border: 4px #4390df solid !important; +} +.element-selected:after { + position: absolute; + display: block; + border-top: 28px solid #4390df; + border-left: 28px solid transparent; + right: 0; + content: ""; + top: 0; + z-index: 101; +} +.element-selected:before { + position: absolute; + display: block; + content: ""; + background-color: transparent; + border-color: #ffffff !important; + border-left: 2px solid; + border-bottom: 2px solid; + height: .25rem; + width: .5rem; + right: 0; + top: 0; + z-index: 102; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); +} +/* Block function */ +.set-border { + border: 1px #eeeeee solid; +} +.set-border.medium-border { + border-width: 8px; +} +.set-border.large-border { + border-width: 16px; +} +.no-border { + border: none !important; +} +.no-border-left { + border-left: none !important; +} +.no-border-right { + border-right: none !important; +} +.no-border-top { + border-top: none !important; +} +.no-border-bottom { + border-bottom: none !important; +} +.transparent-border { + border-color: transparent !important; +} +/* transform functions */ +.rotate45 { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); +} +.rotate90 { + -webkit-transform: rotate(90deg); + transform: rotate(90deg); +} +.rotate135 { + -webkit-transform: rotate(135deg); + transform: rotate(135deg); +} +.rotate180 { + -webkit-transform: rotate(180deg); + transform: rotate(180deg); +} +.rotate225 { + -webkit-transform: rotate(225deg); + transform: rotate(225deg); +} +.rotate270 { + -webkit-transform: rotate(270deg); + transform: rotate(270deg); +} +.rotate360 { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); +} +.rotate-45 { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); +} +.rotate-90 { + -webkit-transform: rotate(-90deg); + transform: rotate(-90deg); +} +.rotate-135 { + -webkit-transform: rotate(-135deg); + transform: rotate(-135deg); +} +.rotate-180 { + -webkit-transform: rotate(-180deg); + transform: rotate(-180deg); +} +.rotate-225 { + -webkit-transform: rotate(-225deg); + transform: rotate(-225deg); +} +.rotate-270 { + -webkit-transform: rotate(-270deg); + transform: rotate(-270deg); +} +.rotate-360 { + -webkit-transform: rotate(-360deg); + transform: rotate(-360deg); +} +.rotateX45 { + -webkit-transform: rotateX(45deg); + transform: rotateX(45deg); +} +.rotateX90 { + -webkit-transform: rotateX(90deg); + transform: rotateX(90deg); +} +.rotateX135 { + -webkit-transform: rotateX(135deg); + transform: rotateX(135deg); +} +.rotateX180 { + -webkit-transform: rotateX(180deg); + transform: rotateX(180deg); +} +.rotateX225 { + -webkit-transform: rotateX(225deg); + transform: rotateX(225deg); +} +.rotateX270 { + -webkit-transform: rotateX(270deg); + transform: rotateX(270deg); +} +.rotateX360 { + -webkit-transform: rotateX(360deg); + transform: rotateX(360deg); +} +.rotateX-45 { + -webkit-transform: rotateX(-45deg); + transform: rotateX(-45deg); +} +.rotateX-90 { + -webkit-transform: rotateX(-90deg); + transform: rotateX(-90deg); +} +.rotateX-135 { + -webkit-transform: rotateX(-135deg); + transform: rotateX(-135deg); +} +.rotateX-180 { + -webkit-transform: rotateX(-180deg); + transform: rotateX(-180deg); +} +.rotateX-225 { + -webkit-transform: rotateX(-225deg); + transform: rotateX(-225deg); +} +.rotateX-270 { + -webkit-transform: rotateX(-270deg); + transform: rotateX(-270deg); +} +.rotateX-360 { + -webkit-transform: rotateX(-360deg); + transform: rotateX(-360deg); +} +.rotateY45 { + -webkit-transform: rotateY(45deg); + transform: rotateY(45deg); +} +.rotateY90 { + -webkit-transform: rotateY(90deg); + transform: rotateY(90deg); +} +.rotateY135 { + -webkit-transform: rotateY(135deg); + transform: rotateY(135deg); +} +.rotateY180 { + -webkit-transform: rotateY(180deg); + transform: rotateY(180deg); +} +.rotateY225 { + -webkit-transform: rotateY(225deg); + transform: rotateY(225deg); +} +.rotateY270 { + -webkit-transform: rotateY(270deg); + transform: rotateY(270deg); +} +.rotateY360 { + -webkit-transform: rotateY(360deg); + transform: rotateY(360deg); +} +.rotateY-45 { + -webkit-transform: rotateY(-45deg); + transform: rotateY(-45deg); +} +.rotateY-90 { + -webkit-transform: rotateY(-90deg); + transform: rotateY(-90deg); +} +.rotateY-135 { + -webkit-transform: rotateY(-135deg); + transform: rotateY(-135deg); +} +.rotateY-180 { + -webkit-transform: rotateY(-180deg); + transform: rotateY(-180deg); +} +.rotateY-225 { + -webkit-transform: rotateY(-225deg); + transform: rotateY(-225deg); +} +.rotateY-270 { + -webkit-transform: rotateY(-270deg); + transform: rotateY(-270deg); +} +.rotateY-360 { + -webkit-transform: rotateY(-360deg); + transform: rotateY(-360deg); +} +@font-face { + font-family: "PT Serif Caption"; + font-style: normal; + font-weight: 400; + src: local("Cambria"), local("PT Serif Caption"), local("PTSerif-Caption"), url(https://themes.googleusercontent.com/static/fonts/ptserifcaption/v6/7xkFOeTxxO1GMC1suOUYWWhBabBbEjGd1iRmpyoZukE.woff) format('woff'); +} +@font-face { + font-family: "Open Sans Light"; + font-style: normal; + font-weight: 300; + src: local("Segoe UI Light"), local("Open Sans Light"), local("OpenSans-Light"), url(https://themes.googleusercontent.com/static/fonts/opensans/v8/DXI1ORHCpsQm3Vp6mXoaTZ1r3JsPcQLi8jytr04NNhU.woff) format('woff'); +} +@font-face { + font-family: "Open Sans"; + font-style: normal; + font-weight: 400; + src: local("Segoe UI"), local("Open Sans"), local("OpenSans"), url(https://themes.googleusercontent.com/static/fonts/opensans/v8/K88pR3goAWT7BTt32Z01mz8E0i7KZn-EPnyo3HZu7kw.woff) format('woff'); +} +@font-face { + font-family: "Open Sans Bold"; + font-style: normal; + font-weight: 700; + src: local("Segoe UI Bold"), local("Open Sans Bold"), local("OpenSans-Bold"), url(https://themes.googleusercontent.com/static/fonts/opensans/v8/k3k702ZOKiLJc3WVjuplzJ1r3JsPcQLi8jytr04NNhU.woff) format('woff'); +} +html { + font-size: 100%; +} +@media screen and (min-width: 1401px) { + html { + font-size: 120%; + } +} +@media screen and (max-width: 1400px) { + html { + font-size: 110%; + } +} +@media screen and (max-width: 1200px) { + html { + font-size: 100%; + } +} +@media screen and (max-width: 768px) { + html { + font-size: 100%; + } +} +@media screen and (max-width: 640px) { + html { + font-size: 90%; + } +} +@media screen and (max-width: 320px) { + html { + font-size: 80%; + } +} +body { + font-family: "Segoe UI", "Open Sans", serif; + font-size: 0.875rem; + line-height: 1.1; + font-weight: 400; + font-style: normal; +} +#font .light { + font-weight: 300; + font-style: normal; +} +#font .normal { + font-weight: 400; + font-style: normal; +} +#font .bold { + font-style: normal; + font-weight: 700; +} +#font .italic { + font-style: italic; +} +.leader { + font: 400 2.25rem/1.1 "Segoe UI", "Open Sans", serif; +} +.sub-leader { + font: 500 1.875rem/1.1 "Segoe UI", "Open Sans", serif; +} +.header { + font: 500 1.5rem/1.1 "Segoe UI", "Open Sans", serif; +} +.sub-header { + font: 500 1.125rem/1.1 "Segoe UI", "Open Sans", serif; +} +.alt-header { + font: 500 1rem/1.1 "Segoe UI", "Open Sans", serif; +} +.sub-alt-header { + font: 500 0.875rem/1.1 "Segoe UI", "Open Sans", serif; +} +.minor-header { + font: 500 0.75rem/1.1 "Segoe UI", "Open Sans", serif; +} +@media screen and (max-width: 800px) { + h1, + h2, + h3, + h4, + h5, + h6, + p { + margin: .625rem 0 .625rem .625rem; + } +} +h1 { + font: 400 2.25rem/1.1 "Segoe UI", "Open Sans", serif; +} +h2 { + font: 500 1.875rem/1.1 "Segoe UI", "Open Sans", serif; +} +h3 { + font: 500 1.5rem/1.1 "Segoe UI", "Open Sans", serif; +} +h4 { + font: 500 1.125rem/1.1 "Segoe UI", "Open Sans", serif; +} +h5 { + font: 500 0.875rem/1.1 "Segoe UI", "Open Sans", serif; +} +h6 { + font: 500 0.75rem/1.1 "Segoe UI", "Open Sans", serif; +} +h1, +h2, +h3, +h4, +h5, +h6 { + margin: .625rem 0; + font-weight: 300!important; +} +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small, +h1 .small, +h2 .small, +h3 .small, +h4 .small, +h5 .small, +h6 .small { + font-weight: 400; + font-size: .7em; + line-height: 1; + color: #777; +} +.text-light { + font-weight: 300; + font-style: normal; +} +.text-normal { + font-weight: 400; + font-style: normal; +} +.text-bold { + font-style: normal; + font-weight: 700; +} +.text-italic { + font-style: italic; +} +.uppercase { + text-transform: uppercase; +} +.lowercase { + text-transform: lowercase; +} +.capital { + text-transform: capitalize; +} +.align-left { + text-align: left; +} +.align-right { + text-align: right; +} +.align-center { + text-align: center; +} +.align-justify { + text-align: justify; +} +.v-align-top { + vertical-align: top; +} +.v-align-bottom { + vertical-align: bottom; +} +.v-align-baseline { + vertical-align: baseline; +} +.v-align-middle { + vertical-align: middle; +} +.v-align-sub { + vertical-align: sub; +} +.v-align-super { + vertical-align: super; +} +.v-align-top-text { + vertical-align: text-top; +} +.v-align-bottom-text { + vertical-align: text-bottom; +} +.text-dashed { + border: 0; + border-bottom: 1px gray dashed; + display: inline; +} +.indent-paragraph:first-letter { + margin-left: 2.5rem; +} +.text-secondary { + font-size: 0.75rem; +} +.text-accent, +.text-enlarged { + font-size: 1.1rem; +} +.text-default { + font-size: 0.875rem; +} +.text-small { + font-size: 0.625rem; +} +.text-light { + font-weight: 300; +} +.text-ellipsis { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.no-wrap { + white-space: nowrap !important; +} +abbr { + text-decoration: none; + border-bottom: 1px #999999 dotted; + cursor: help; + display: inline; +} +address { + font-weight: 400; + font-style: normal; + margin: .625rem 0; +} +blockquote { + margin: .625rem 0; + padding: 0 0 0 .625rem; + border-left: 0.25rem #999999 solid; +} +blockquote small { + color: #999999; +} +blockquote small:before { + content: "\2014 \00A0"; +} +blockquote.place-right { + border: 0; + border-right: 4px #999999 solid; + padding-right: .625rem; + text-align: right; +} +blockquote.place-right small:before { + content: ""; +} +blockquote.place-right small:after { + content: " \00A0 \2014"; +} +.unstyled-list { + padding-left: 0; + list-style: none; +} +.unstyled-list li ul, +.unstyled-list li ol { + list-style: none; + padding-left: 1.5625rem; +} +.inline-list { + list-style: none; + padding-left: 0; +} +.inline-list li { + display: inline-block; + margin-right: .625rem; +} +.inline-list li:last-child { + margin-right: 0; +} +ul, +ol { + margin-left: .3125rem; +} +ul li, +ol li { + line-height: 1.25rem; +} +ul li ul, +ol li ul, +ul li ol, +ol li ol { + padding-left: 1.5625rem; +} +dl dt, +dl dd { + line-height: 1.25rem; +} +dl dt { + font-style: normal; + font-weight: 700; +} +dl dd { + margin-left: .9375rem; +} +dl.horizontal dt { + float: left; + width: 10rem; + overflow: hidden; + clear: left; + text-align: right; + text-overflow: ellipsis; + white-space: nowrap; +} +dl.horizontal dd { + margin-left: 11.25rem; +} +a { + color: #2086bf; +} +a:visited { + color: #2086bf; +} +hr { + border: 0; + height: 2px; + background-color: #88b9e3; +} +hr.thin { + height: 1px; +} +hr.fat { + height: 3px; +} + +.container { + width: 960px; + margin: 0 auto; +} +@media screen and (min-width: 1401px) { + .container:not(.no-responsive-future) { + width: 1200px; + } +} +@media screen and (max-width: 992px) { + .container:not(.no-responsive-future) { + width: 100%; + padding: 0; + } +} +@media screen and (max-width: 768px) { + .container:not(.no-responsive-future) { + width: 100%; + padding: 0; + } +} +@media screen and (max-width: 640px) { + .container:not(.no-responsive-future) { + width: 100%; + padding: 0; + } +} +.grid { + display: block; + position: relative; + margin: .625rem 0; +} +.grid:before, +.grid:after { + display: table; + content: ""; +} +.grid:after { + clear: both; +} +.grid .row { + width: 100%; + display: block; + margin: 0 0 2.12765% 0; +} +.grid .row:before, +.grid .row:after { + display: table; + content: ""; +} +.grid .row:after { + clear: both; +} +.grid .row:last-child { + margin-bottom: 0; +} +.grid .row > .cell { + display: block; + float: left; + width: 100%; + min-height: 10px; + margin: 0 0 0 2.12765%; +} +.grid .row > .cell:first-child { + margin-left: 0; +} +.grid .row.cells2 > .cell { + width: 48.936175%; +} +.grid .row.cells2 > .cell.colspan2 { + width: 100%; +} +.grid .row.cells3 > .cell { + width: 31.9149%; +} +.grid .row.cells3 > .cell.colspan2 { + width: 65.95745%; +} +.grid .row.cells3 > .cell.colspan3 { + width: 100%; +} +.grid .row.cells4 > .cell { + width: 23.4042625%; +} +.grid .row.cells4 > .cell.colspan2 { + width: 48.936175%; +} +.grid .row.cells4 > .cell.colspan3 { + width: 74.4680875%; +} +.grid .row.cells4 > .cell.colspan4 { + width: 100%; +} +.grid .row.cells5 > .cell { + width: 18.29788%; +} +.grid .row.cells5 > .cell.colspan2 { + width: 38.72341%; +} +.grid .row.cells5 > .cell.colspan3 { + width: 59.14894%; +} +.grid .row.cells5 > .cell.colspan4 { + width: 79.57447%; +} +.grid .row.cells5 > .cell.colspan5 { + width: 100%; +} +.grid .row.cells6 > .cell { + width: 14.893625%; +} +.grid .row.cells6 > .cell.colspan2 { + width: 31.9149%; +} +.grid .row.cells6 > .cell.colspan3 { + width: 48.936175%; +} +.grid .row.cells6 > .cell.colspan4 { + width: 65.95745%; +} +.grid .row.cells6 > .cell.colspan5 { + width: 82.978725%; +} +.grid .row.cells6 > .cell.colspan6 { + width: 100%; +} +.grid .row.cells7 > .cell { + width: 12.46201429%; +} +.grid .row.cells7 > .cell.colspan2 { + width: 27.05167857%; +} +.grid .row.cells7 > .cell.colspan3 { + width: 41.64134286%; +} +.grid .row.cells7 > .cell.colspan4 { + width: 56.23100714%; +} +.grid .row.cells7 > .cell.colspan5 { + width: 70.82067143%; +} +.grid .row.cells7 > .cell.colspan6 { + width: 85.41033571%; +} +.grid .row.cells7 > .cell.colspan7 { + width: 100%; +} +.grid .row.cells8 > .cell { + width: 10.63830625%; +} +.grid .row.cells8 > .cell.colspan2 { + width: 23.4042625%; +} +.grid .row.cells8 > .cell.colspan3 { + width: 36.17021875%; +} +.grid .row.cells8 > .cell.colspan4 { + width: 48.936175%; +} +.grid .row.cells8 > .cell.colspan5 { + width: 61.70213125%; +} +.grid .row.cells8 > .cell.colspan6 { + width: 74.4680875%; +} +.grid .row.cells8 > .cell.colspan7 { + width: 87.23404375%; +} +.grid .row.cells8 > .cell.colspan8 { + width: 100%; +} +.grid .row.cells9 > .cell { + width: 9.21986667%; +} +.grid .row.cells9 > .cell.colspan2 { + width: 20.56738333%; +} +.grid .row.cells9 > .cell.colspan3 { + width: 31.9149%; +} +.grid .row.cells9 > .cell.colspan4 { + width: 43.26241667%; +} +.grid .row.cells9 > .cell.colspan5 { + width: 54.60993333%; +} +.grid .row.cells9 > .cell.colspan6 { + width: 65.95745%; +} +.grid .row.cells9 > .cell.colspan7 { + width: 77.30496667%; +} +.grid .row.cells9 > .cell.colspan8 { + width: 88.65248333%; +} +.grid .row.cells9 > .cell.colspan9 { + width: 100%; +} +.grid .row.cells10 > .cell { + width: 8.085115%; +} +.grid .row.cells10 > .cell.colspan2 { + width: 18.29788%; +} +.grid .row.cells10 > .cell.colspan3 { + width: 28.510645%; +} +.grid .row.cells10 > .cell.colspan4 { + width: 38.72341%; +} +.grid .row.cells10 > .cell.colspan5 { + width: 48.936175%; +} +.grid .row.cells10 > .cell.colspan6 { + width: 59.14894%; +} +.grid .row.cells10 > .cell.colspan7 { + width: 69.361705%; +} +.grid .row.cells10 > .cell.colspan8 { + width: 79.57447%; +} +.grid .row.cells10 > .cell.colspan9 { + width: 89.787235%; +} +.grid .row.cells10 > .cell.colspan10 { + width: 100%; +} +.grid .row.cells11 > .cell { + width: 7.15668182%; +} +.grid .row.cells11 > .cell.colspan2 { + width: 16.44101364%; +} +.grid .row.cells11 > .cell.colspan3 { + width: 25.72534545%; +} +.grid .row.cells11 > .cell.colspan4 { + width: 35.00967727%; +} +.grid .row.cells11 > .cell.colspan5 { + width: 44.29400909%; +} +.grid .row.cells11 > .cell.colspan6 { + width: 53.57834091%; +} +.grid .row.cells11 > .cell.colspan7 { + width: 62.86267273%; +} +.grid .row.cells11 > .cell.colspan8 { + width: 72.14700455%; +} +.grid .row.cells11 > .cell.colspan9 { + width: 81.43133636%; +} +.grid .row.cells11 > .cell.colspan10 { + width: 90.71566818%; +} +.grid .row.cells11 > .cell.colspan11 { + width: 100%; +} +.grid .row.cells12 > .cell { + width: 6.3829875%; +} +.grid .row.cells12 > .cell.colspan2 { + width: 14.893625%; +} +.grid .row.cells12 > .cell.colspan3 { + width: 23.4042625%; +} +.grid .row.cells12 > .cell.colspan4 { + width: 31.9149%; +} +.grid .row.cells12 > .cell.colspan5 { + width: 40.4255375%; +} +.grid .row.cells12 > .cell.colspan6 { + width: 48.936175%; +} +.grid .row.cells12 > .cell.colspan7 { + width: 57.4468125%; +} +.grid .row.cells12 > .cell.colspan8 { + width: 65.95745%; +} +.grid .row.cells12 > .cell.colspan9 { + width: 74.4680875%; +} +.grid .row.cells12 > .cell.colspan10 { + width: 82.978725%; +} +.grid .row.cells12 > .cell.colspan11 { + width: 91.4893625%; +} +.grid .row.cells12 > .cell.colspan12 { + width: 100%; +} +.grid .row:empty { + display: none; +} +@media screen and (max-width: 768px) { + .grid:not(.no-responsive-future) .row { + margin: 0; + } + .grid:not(.no-responsive-future) .row > .cell, + .grid:not(.no-responsive-future) .row > .cell[class*=colspan] { + width: 48.936175% ; + margin-bottom: 10px; + } + .grid:not(.no-responsive-future) .row > .cell:nth-child(odd), + .grid:not(.no-responsive-future) .row > .cell[class*=colspan]:nth-child(odd) { + margin-left: 0; + } +} +@media only screen and (max-width: 640px) { + .grid:not(.no-responsive-future) .row { + margin: 0; + } + .grid:not(.no-responsive-future) .row > .cell, + .grid:not(.no-responsive-future) .row > .cell[class*=colspan] { + width: 100%; + margin: .3125rem 0; + } +} +.grid.condensed { + display: block; + position: relative; + margin: .625rem 0; +} +.grid.condensed:before, +.grid.condensed:after { + display: table; + content: ""; +} +.grid.condensed:after { + clear: both; +} +.grid.condensed .row { + width: 100%; + display: block; + margin: 0 0 0 0; +} +.grid.condensed .row:before, +.grid.condensed .row:after { + display: table; + content: ""; +} +.grid.condensed .row:after { + clear: both; +} +.grid.condensed .row:last-child { + margin-bottom: 0; +} +.grid.condensed .row > .cell { + display: block; + float: left; + width: 100%; + min-height: 10px; + margin: 0 0 0 0; +} +.grid.condensed .row > .cell:first-child { + margin-left: 0; +} +.grid.condensed .row.cells2 > .cell { + width: 50%; +} +.grid.condensed .row.cells2 > .cell.colspan2 { + width: 100%; +} +.grid.condensed .row.cells3 > .cell { + width: 33.33333333%; +} +.grid.condensed .row.cells3 > .cell.colspan2 { + width: 66.66666667%; +} +.grid.condensed .row.cells3 > .cell.colspan3 { + width: 100%; +} +.grid.condensed .row.cells4 > .cell { + width: 25%; +} +.grid.condensed .row.cells4 > .cell.colspan2 { + width: 50%; +} +.grid.condensed .row.cells4 > .cell.colspan3 { + width: 75%; +} +.grid.condensed .row.cells4 > .cell.colspan4 { + width: 100%; +} +.grid.condensed .row.cells5 > .cell { + width: 20%; +} +.grid.condensed .row.cells5 > .cell.colspan2 { + width: 40%; +} +.grid.condensed .row.cells5 > .cell.colspan3 { + width: 60%; +} +.grid.condensed .row.cells5 > .cell.colspan4 { + width: 80%; +} +.grid.condensed .row.cells5 > .cell.colspan5 { + width: 100%; +} +.grid.condensed .row.cells6 > .cell { + width: 16.66666667%; +} +.grid.condensed .row.cells6 > .cell.colspan2 { + width: 33.33333333%; +} +.grid.condensed .row.cells6 > .cell.colspan3 { + width: 50%; +} +.grid.condensed .row.cells6 > .cell.colspan4 { + width: 66.66666667%; +} +.grid.condensed .row.cells6 > .cell.colspan5 { + width: 83.33333333%; +} +.grid.condensed .row.cells6 > .cell.colspan6 { + width: 100%; +} +.grid.condensed .row.cells7 > .cell { + width: 14.28571429%; +} +.grid.condensed .row.cells7 > .cell.colspan2 { + width: 28.57142857%; +} +.grid.condensed .row.cells7 > .cell.colspan3 { + width: 42.85714286%; +} +.grid.condensed .row.cells7 > .cell.colspan4 { + width: 57.14285714%; +} +.grid.condensed .row.cells7 > .cell.colspan5 { + width: 71.42857143%; +} +.grid.condensed .row.cells7 > .cell.colspan6 { + width: 85.71428571%; +} +.grid.condensed .row.cells7 > .cell.colspan7 { + width: 100%; +} +.grid.condensed .row.cells8 > .cell { + width: 12.5%; +} +.grid.condensed .row.cells8 > .cell.colspan2 { + width: 25%; +} +.grid.condensed .row.cells8 > .cell.colspan3 { + width: 37.5%; +} +.grid.condensed .row.cells8 > .cell.colspan4 { + width: 50%; +} +.grid.condensed .row.cells8 > .cell.colspan5 { + width: 62.5%; +} +.grid.condensed .row.cells8 > .cell.colspan6 { + width: 75%; +} +.grid.condensed .row.cells8 > .cell.colspan7 { + width: 87.5%; +} +.grid.condensed .row.cells8 > .cell.colspan8 { + width: 100%; +} +.grid.condensed .row.cells9 > .cell { + width: 11.11111111%; +} +.grid.condensed .row.cells9 > .cell.colspan2 { + width: 22.22222222%; +} +.grid.condensed .row.cells9 > .cell.colspan3 { + width: 33.33333333%; +} +.grid.condensed .row.cells9 > .cell.colspan4 { + width: 44.44444444%; +} +.grid.condensed .row.cells9 > .cell.colspan5 { + width: 55.55555556%; +} +.grid.condensed .row.cells9 > .cell.colspan6 { + width: 66.66666667%; +} +.grid.condensed .row.cells9 > .cell.colspan7 { + width: 77.77777778%; +} +.grid.condensed .row.cells9 > .cell.colspan8 { + width: 88.88888889%; +} +.grid.condensed .row.cells9 > .cell.colspan9 { + width: 100%; +} +.grid.condensed .row.cells10 > .cell { + width: 10%; +} +.grid.condensed .row.cells10 > .cell.colspan2 { + width: 20%; +} +.grid.condensed .row.cells10 > .cell.colspan3 { + width: 30%; +} +.grid.condensed .row.cells10 > .cell.colspan4 { + width: 40%; +} +.grid.condensed .row.cells10 > .cell.colspan5 { + width: 50%; +} +.grid.condensed .row.cells10 > .cell.colspan6 { + width: 60%; +} +.grid.condensed .row.cells10 > .cell.colspan7 { + width: 70%; +} +.grid.condensed .row.cells10 > .cell.colspan8 { + width: 80%; +} +.grid.condensed .row.cells10 > .cell.colspan9 { + width: 90%; +} +.grid.condensed .row.cells10 > .cell.colspan10 { + width: 100%; +} +.grid.condensed .row.cells11 > .cell { + width: 9.09090909%; +} +.grid.condensed .row.cells11 > .cell.colspan2 { + width: 18.18181818%; +} +.grid.condensed .row.cells11 > .cell.colspan3 { + width: 27.27272727%; +} +.grid.condensed .row.cells11 > .cell.colspan4 { + width: 36.36363636%; +} +.grid.condensed .row.cells11 > .cell.colspan5 { + width: 45.45454545%; +} +.grid.condensed .row.cells11 > .cell.colspan6 { + width: 54.54545455%; +} +.grid.condensed .row.cells11 > .cell.colspan7 { + width: 63.63636364%; +} +.grid.condensed .row.cells11 > .cell.colspan8 { + width: 72.72727273%; +} +.grid.condensed .row.cells11 > .cell.colspan9 { + width: 81.81818182%; +} +.grid.condensed .row.cells11 > .cell.colspan10 { + width: 90.90909091%; +} +.grid.condensed .row.cells11 > .cell.colspan11 { + width: 100%; +} +.grid.condensed .row.cells12 > .cell { + width: 8.33333333%; +} +.grid.condensed .row.cells12 > .cell.colspan2 { + width: 16.66666667%; +} +.grid.condensed .row.cells12 > .cell.colspan3 { + width: 25%; +} +.grid.condensed .row.cells12 > .cell.colspan4 { + width: 33.33333333%; +} +.grid.condensed .row.cells12 > .cell.colspan5 { + width: 41.66666667%; +} +.grid.condensed .row.cells12 > .cell.colspan6 { + width: 50%; +} +.grid.condensed .row.cells12 > .cell.colspan7 { + width: 58.33333333%; +} +.grid.condensed .row.cells12 > .cell.colspan8 { + width: 66.66666667%; +} +.grid.condensed .row.cells12 > .cell.colspan9 { + width: 75%; +} +.grid.condensed .row.cells12 > .cell.colspan10 { + width: 83.33333333%; +} +.grid.condensed .row.cells12 > .cell.colspan11 { + width: 91.66666667%; +} +.grid.condensed .row.cells12 > .cell.colspan12 { + width: 100%; +} +@media screen and (max-width: 768px) { + .grid.condensed:not(.no-responsive-future) .row { + margin: 0; + } + .grid.condensed:not(.no-responsive-future) .row > .cell, + .grid.condensed:not(.no-responsive-future) .row > .cell[class*=colspan] { + width: 50% ; + margin-bottom: 10px ; + } + .grid.condensed:not(.no-responsive-future) .row > .cell:nth-child(odd), + .grid.condensed:not(.no-responsive-future) .row > .cell[class*=colspan]:nth-child(odd) { + margin-left: 0; + } +} +@media only screen and (max-width: 640px) { + .grid.condensed:not(.no-responsive-future) .row { + margin: 0; + } + .grid.condensed:not(.no-responsive-future) .row > .cell, + .grid.condensed:not(.no-responsive-future) .row > .cell[class*=colspan] { + width: 100%; + margin: .3125rem 0; + } +} +.table { + width: 100%; + margin: .625rem 0; +} +.table th, +.table td { + padding: 0.625rem; +} +.table thead { + border-bottom: 4px solid #999999; +} +.table thead th, +.table thead td { + cursor: default; + color: #52677a; + border-color: transparent; + text-align: left; + font-style: normal; + font-weight: 700; + line-height: 100%; +} +.table tfoot { + border-top: 4px solid #999999; +} +.table tfoot th, +.table tfoot td { + cursor: default; + color: #52677a; + border-color: transparent; + text-align: left; + font-style: normal; + font-weight: 700; + line-height: 100%; +} +.table tbody td { + padding: 0.625rem 0.85rem; +} +.table .sortable-column { + position: relative; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.table .sortable-column:after { + position: absolute; + content: ""; + width: 1rem; + height: 1rem; + left: 100%; + margin-left: -20px; + top: 50%; + margin-top: -0.5rem; + color: inherit; + font-size: 1rem; + line-height: 1; +} +.table .sortable-column.sort-asc, +.table .sortable-column.sort-desc { + background-color: #eeeeee; +} +.table .sortable-column.sort-asc:after, +.table .sortable-column.sort-desc:after { + color: #1d1d1d; +} +.table .sortable-column.sort-asc:after { + content: "\2191"; +} +.table .sortable-column.sort-desc:after { + content: "\2193"; +} +.table.sortable-markers-on-left .sortable-column { + padding-left: 30px; +} +.table.sortable-markers-on-left .sortable-column:before, +.table.sortable-markers-on-left .sortable-column:after { + left: 0; + margin-left: 10px; +} +.table tr.selected td { + background-color: rgba(28, 183, 236, 0.1); +} +.table td.selected { + background-color: rgba(28, 183, 236, 0.3); +} +.table.striped tbody tr:nth-child(odd) { + background: #eeeeee; +} +.table.hovered tbody tr:hover { + background-color: rgba(28, 183, 236, 0.1); +} +.table.cell-hovered tbody td:hover { + background-color: rgba(28, 183, 236, 0.3); +} +.table.border { + border: 1px #999999 solid; +} +.table.bordered th, +.table.bordered td { + border: 1px #999999 solid; +} +.table.bordered thead tr:first-child th, +.table.bordered thead tr:first-child td { + border-top: none; +} +.table.bordered thead tr:first-child th:first-child, +.table.bordered thead tr:first-child td:first-child { + border-left: none; +} +.table.bordered thead tr:first-child th:last-child, +.table.bordered thead tr:first-child td:last-child { + border-right: none; +} +.table.bordered tbody tr:first-child td { + border-top: none; +} +.table.bordered tbody tr td:first-child { + border-left: none; +} +.table.bordered tbody tr td:last-child { + border-right: none; +} +.table.bordered tbody tr:last-child td { + border-bottom: none; +} +.table .condensed th, +.table .condensed td { + padding: .3125rem; +} +.table .super-condensed th, +.table .super-condensed td { + padding: .125rem; +} +.app-bar { + display: block; + width: 100%; + position: relative; + background-color: #0072c6; + color: #ffffff; + height: 3.125rem; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.app-bar:before, +.app-bar:after { + display: table; + content: ""; +} +.app-bar:after { + clear: both; +} +.app-bar .app-bar-element { + line-height: 3.125rem; + padding: 0 .625rem; + font-size: 1rem; + cursor: pointer; + color: inherit; + display: block; + float: left; + position: relative; + vertical-align: middle !important; + height: 3.125rem; +} +.app-bar .app-bar-element:hover, +.app-bar .app-bar-element:active { + background-color: #005696; +} +.app-bar .app-bar-element.branding { + padding-left: 1rem; + padding-right: 1rem; +} +.app-bar .app-bar-divider { + display: block; + float: left; + line-height: 3.125rem; + height: 3.125rem; + width: 1px; + background-color: #4c9cd7; + padding: 0; +} +.app-bar .dropdown-toggle { + padding-right: 1.5rem !important; +} +.app-bar .dropdown-toggle:before { + border-color: #ffffff; +} +.app-bar .app-bar-menu { + display: block; + float: left; + margin: 0; + padding: 0; +} +.app-bar .app-bar-menu > li, +.app-bar .app-bar-menu > li > a { + line-height: 3.125rem; + padding: 0 .625rem; + font-size: 1rem; + cursor: pointer; + color: inherit; + display: block; + float: left; + position: relative; + vertical-align: middle !important; + height: 3.125rem; +} +.app-bar .app-bar-menu > li:hover, +.app-bar .app-bar-menu > li > a:hover, +.app-bar .app-bar-menu > li:active, +.app-bar .app-bar-menu > li > a:active { + background-color: #005696; +} +.app-bar .app-bar-menu > li.branding, +.app-bar .app-bar-menu > li > a.branding { + padding-left: 1rem; + padding-right: 1rem; +} +.app-bar .app-bar-menu > li:before, +.app-bar .app-bar-menu > li > a:before, +.app-bar .app-bar-menu > li:after, +.app-bar .app-bar-menu > li > a:after { + display: table; + content: ""; +} +.app-bar .app-bar-menu > li:after, +.app-bar .app-bar-menu > li > a:after { + clear: both; +} +.app-bar .app-bar-menu > li > .input-control.text, +.app-bar .app-bar-menu > li > a > .input-control.text { + margin-top: .55rem; + font-size: .875rem; + line-height: 1.8rem; + display: block; +} +.app-bar .app-bar-menu > li > .input-control.text input, +.app-bar .app-bar-menu > li > a > .input-control.text input { + border-color: transparent !important; +} +.app-bar .app-bar-menu > li > .button, +.app-bar .app-bar-menu > li > a > .button { + margin-top: -0.15rem; +} +.app-bar .app-bar-menu > li > .image-button, +.app-bar .app-bar-menu > li > a > .image-button { + margin: 0; + background-color: transparent; + color: #ffffff; + font-size: inherit; +} +.app-bar .app-bar-menu > li > .image-button img.icon, +.app-bar .app-bar-menu > li > a > .image-button img.icon { + padding: 0; +} +.app-bar .app-bar-menu > li .d-menu { + top: 100%; + border: 2px solid #005696; +} +.app-bar .app-bar-menu > li .d-menu li:not(.disabled):hover { + background-color: #eee; +} +.app-bar .app-bar-menu > li .d-menu li:not(.disabled):hover > a { + color: #1d1d1d; +} +.app-bar .app-bar-menu > li .d-menu .d-menu { + top: -0.625rem; + left: 100%; +} +.app-bar .app-bar-menu > li .d-menu .dropdown-toggle:before { + border-color: #1d1d1d; +} +.app-bar .app-bar-pull { + display: none; + float: right !important; + color: #fff; + cursor: pointer; + font: 2rem sans-serif; + position: absolute; + top: 0; + right: 0; + height: 3.125rem; + width: 3.125rem; + line-height: 1.25rem; + vertical-align: middle; + text-align: center; + margin: 0; +} +.app-bar .app-bar-pull:before { + content: "\2261"; + position: absolute; + top: .875rem; + left: .875rem; +} +.app-bar .app-bar-drop-container { + position: absolute; + top: 100%; + left: 0; + margin-top: 10px; + border: 2px solid #005696; +} +.app-bar .app-bar-drop-container:before { + content: ''; + position: absolute; + background-color: #ffffff; + width: 10px; + height: 10px; + border: 2px #005696 solid; + top: 1px; + left: 1rem; + margin: -8px 0; + border-bottom: none; + border-right: none; + -webkit-transform: rotate(45deg); + transform: rotate(45deg); +} +.app-bar .app-bar-drop-container:before { + z-index: 0; +} +.app-bar .app-bar-drop-container.place-right { + right: 0; + left: auto; +} +.app-bar .app-bar-drop-container.place-right:before { + left: auto; + right: 1rem; +} +.app-bar .app-bar-element:before, +.app-bar .app-bar-element:after { + display: table; + content: ""; +} +.app-bar .app-bar-element:after { + clear: both; +} +.app-bar .app-bar-element > .input-control.text { + margin-top: .55rem; + font-size: .875rem; + line-height: 1.8rem; + display: block; +} +.app-bar .app-bar-element > .input-control.text input { + border-color: transparent !important; +} +.app-bar .app-bar-element > .button { + margin-top: -0.15rem; +} +.app-bar .app-bar-element > .image-button { + margin: 0; + background-color: transparent; + color: #ffffff; + font-size: inherit; +} +.app-bar .app-bar-element > .image-button img.icon { + padding: 0; +} +.app-bar.drop-up .app-bar-drop-container { + top: auto; + bottom: 3.75rem; +} +.app-bar.drop-up .app-bar-drop-container:before { + top: auto; + bottom: 1px; + -webkit-transform: rotate(225deg); + transform: rotate(225deg); +} +.app-bar.drop-up .app-bar-menu > li > .d-menu { + top: auto; + bottom: 3.125rem; +} +.app-bar.drop-up .d-menu .d-menu { + top: auto !important; + bottom: 0 !important; +} +.app-bar.fixed-top, +.app-bar.fixed-bottom { + z-index: 1030; + position: fixed; +} +.app-bar.fixed-top { + top: 0; +} +.app-bar.fixed-bottom { + bottom: 0; +} +@media screen and (max-width: 800px) { + .app-bar:not(.no-responsive-future) { + overflow: visible; + height: auto; + } + .app-bar:not(.no-responsive-future) .app-bar-pull { + display: block !important; + } + .app-bar:not(.no-responsive-future) .app-bar-menu { + width: 100%; + border-top: 1px solid #4c9cd7; + position: relative; + float: none; + z-index: 1000; + background-color: #005696; + display: none; + clear: both; + } + .app-bar:not(.no-responsive-future) .app-bar-menu > li, + .app-bar:not(.no-responsive-future) .app-bar-menu > li > a { + float: none; + } + .app-bar:not(.no-responsive-future) .app-bar-menu > li { + height: auto; + } + .app-bar:not(.no-responsive-future) .app-bar-menu li:hover { + background-color: #0072c6 !important; + } + .app-bar:not(.no-responsive-future) .app-bar-menu li:hover a { + background-color: #0072c6 !important; + color: #ffffff !important; + } + .app-bar:not(.no-responsive-future) .app-bar-menu .d-menu { + border: 0 !important; + border-top: 1px solid #4c9cd7 !important; + clear: both; + float: none !important; + width: 100% !important; + position: relative !important; + left: 0 !important; + box-shadow: none; + max-width: 100%; + background-color: #005696 !important; + } + .app-bar:not(.no-responsive-future) .app-bar-menu .d-menu li { + width: 100% !important; + background-color: inherit; + } + .app-bar:not(.no-responsive-future) .app-bar-menu .d-menu li a { + padding-left: 20px; + padding-right: 0; + background-color: inherit; + width: 100%; + color: #ffffff; + } + .app-bar:not(.no-responsive-future) .app-bar-menu .d-menu .dropdown-toggle:before { + border-color: #ffffff !important; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + } + .app-bar:not(.no-responsive-future) .app-bar-menu .d-menu .divider { + background-color: #4c9cd7; + } + .app-bar:not(.no-responsive-future) .app-bar-menu .d-menu .d-menu { + top: 0 !important; + } +} +.h-menu li:hover > .dropdown-toggle:before, +.v-menu li:hover > .dropdown-toggle:before, +.d-menu li:hover > .dropdown-toggle:before, +.m-menu li:hover > .dropdown-toggle:before { + border-color: #ffffff; +} + +.d-menu { + text-align: left; + background: #ffffff; + max-width: 15.625rem; + list-style: none inside none; + margin: 0; + padding: 0; + position: relative; + width: auto; + float: left; + position: absolute; + display: none; + z-index: 1000; + left: 0; + box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2); +} +.d-menu li:hover > .dropdown-toggle:before { + border-color: #ffffff; +} +.d-menu li { + display: block; + float: none; + position: relative; +} +.d-menu li:before, +.d-menu li:after { + display: table; + content: ""; +} +.d-menu li:after { + clear: both; +} +.d-menu li a { + color: #727272; + font-size: .875rem; + display: block; + float: none; + padding: .75rem 2rem .75rem 2.5rem; + text-decoration: none; + vertical-align: middle; + position: relative; + white-space: nowrap; + min-width: 12.5rem; + border: 0 !important; + border: none !important; +} +.d-menu li a img, +.d-menu li a .icon { + position: absolute; + left: .875rem; + top: 50%; + margin-top: -0.5625rem; + color: #262626; + max-height: 1.125rem; + font-size: 1.125rem; + display: inline-block; + margin-right: .3125rem; + vertical-align: middle; + text-align: center; +} +.d-menu li.active { + border-left: 2px solid; + border-color: #1ba1e2; +} +.d-menu li.active > a { + background-color: #59cde2; + color: #ffffff; + font-weight: bold; +} +.d-menu li:hover { + text-decoration: none; + background: #59cde2; +} +.d-menu li:hover > a, +.d-menu li:hover .icon { + color: #ffffff; +} +.d-menu .divider { + padding: 0; + height: 1px; + margin: 0 1px; + overflow: hidden; + background-color: #f2f2f2; +} +.d-menu .divider:hover { + background-color: #f2f2f2; +} +.d-menu.subdown .d-menu { + min-width: 0 !important; + position: relative; + width: 100%; + left: 0 !important; + right: 0 !important; + top: 100%; + box-shadow: none; +} +.d-menu .item-block { + display: block; + padding: .625rem; + background-color: #eeeeee; +} +.d-menu .d-menu { + left: 100%; + top: -10%; +} +.d-menu .menu-title { + background-color: #f6f7f8; + font-size: 12px; + line-height: 14px; + padding: 4px 8px; + border: 0; + color: #646464; +} +.d-menu .menu-title:first-child { + margin: 0; + border-top-width: 0; +} +.d-menu .menu-title:first-child:hover { + border-top-width: 0; +} +.d-menu .menu-title:hover { + background-color: #f6f7f8; + cursor: default; + border: 0; +} +.d-menu .dropdown-toggle:before { + -webkit-transform: rotate(-135deg); + transform: rotate(-135deg); + margin-top: -2px; +} +.d-menu.subdown .dropdown-toggle:before { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + margin-left: -1.25rem; +} +.d-menu li.disabled a { + color: #eeeeee; +} +.d-menu li.disabled:hover { + background-color: inherit; + cursor: default !important; + border: 0; +} +.d-menu li.disabled:hover a { + cursor: inherit; +} +.d-menu.context li a { + font-size: .75rem; + padding: .3125rem 2rem .3125rem 2.5rem; +} +.d-menu.context li a .icon { + margin-top: -0.4375rem; + font-size: .825rem; + color: inherit; +} +.d-menu.no-min-size li a { + min-width: 0; +} +.d-menu.full-size li a { + min-width: 0; + width: 100%; +} +.d-menu .d-menu { + left: 100%; + top: -10%; +} +.d-menu.open { + display: block !important; +} +.d-menu.drop-left { + left: -100%; +} +.d-menu.drop-up { + top: auto; + bottom: 0; +} +.d-menu.context li a { + font-size: .75rem; + padding: .3125rem 2rem .3125rem 2.5rem; +} +.d-menu.context li a .icon { + margin-top: -0.4375rem; +} +.d-menu.place-right { + left: auto !important; + right: 0; + width: auto; +} +.m-menu { + text-align: left; + display: block; + height: auto !important; + position: relative; + background-color: #ffffff; + color: #1d1d1d; + box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2); + list-style: none inside none; + margin: 0; + padding: 0; +} +.m-menu:before, +.m-menu:after { + display: table; + content: ""; +} +.m-menu:after { + clear: both; +} +.m-menu > li, +.m-menu .m-menu-item { + display: block; + float: left; + background-color: #ffffff; +} +.m-menu > li:hover, +.m-menu .m-menu-item:hover { + background-color: #59cde2; +} +.m-menu > li:hover > a, +.m-menu .m-menu-item:hover > a { + color: #ffffff; +} +.m-menu > li.no-hovered, +.m-menu .m-menu-item.no-hovered { + background-color: inherit; + color: inherit; +} +.m-menu > li:first-child, +.m-menu .m-menu-item:first-child { + margin-left: 0; +} +.m-menu > li > a, +.m-menu .m-menu-item > a { + display: block; + float: left; + position: relative; + font-weight: normal; + color: inherit; + font-size: .875rem; + outline: none; + text-decoration: none; + padding: 1rem 1.625rem; + border: 0 !important; + border: none !important; +} +.m-menu > li > a:hover, +.m-menu .m-menu-item > a:hover { + background-color: inherit; +} +.m-menu > li > a.dropdown-toggle, +.m-menu .m-menu-item > a.dropdown-toggle { + padding: 1rem 1.625rem 1rem 1.125rem; +} +.m-menu > li.active-container, +.m-menu .m-menu-item.active-container { + background-color: #59cde2; +} +.m-menu > li.active-container a, +.m-menu .m-menu-item.active-container a { + color: #ffffff; +} +.m-menu > li.active-container a.dropdown-toggle:before, +.m-menu .m-menu-item.active-container a.dropdown-toggle:before { + border-color: #ffffff; +} +.m-menu > li .d-menu, +.m-menu .m-menu-item .d-menu { + left: 0; + top: 100%; +} +.m-menu .m-menu-container { + position: absolute; + left: 0; + right: 0; + top: 100%; + padding: .3125rem; + font-size: .75rem; + z-index: 1000; + background-color: inherit; +} +.m-menu .m-menu-container li, +.m-menu .m-menu-container a { + color: #ffffff; +} +.m-menu .m-menu-container a { + text-decoration: underline; +} +.m-menu .m-menu-container li:hover > a, +.m-menu .m-menu-container li.active > a { + text-decoration: none; +} +.m-menu .m-menu-container { + display: none; +} +.m-menu .m-menu-container.open { + display: block; +} +.v-menu.context li a, +.d-menu.context li a { + font-size: .75rem; + padding: .3125rem 2rem .3125rem 2.5rem; +} +.v-menu.context li a .icon, +.d-menu.context li a .icon { + margin-top: -0.4375rem; + font-size: .825rem; + color: inherit; +} +.v-menu.no-min-size li a, +.d-menu.no-min-size li a { + min-width: 0; +} +.v-menu.full-size li a, +.d-menu.full-size li a { + min-width: 0; + width: 100%; +} +.horizontal-menu { + display: block; + width: 100%; + color: #1d1d1d; + position: relative; + padding: 0; + margin: 0; + list-style: none inside none; +} +.horizontal-menu:before, +.horizontal-menu:after { + display: table; + content: ""; +} +.horizontal-menu:after { + clear: both; +} +.horizontal-menu > li { + display: block; + float: left; + color: inherit; + background-color: inherit; + position: relative; +} +.horizontal-menu > li > a { + position: relative; + display: block; + float: left; + font-size: 1.4rem; + color: inherit; + background-color: inherit; + padding: .625rem 1.625rem; + line-height: 1.4rem; +} +.horizontal-menu > li > .d-menu { + left: 0; + top: 100%; +} +.horizontal-menu.compact > li > a { + font-size: .9rem; + line-height: .9rem; +} +.vertical-menu { + display: block; + width: 100%; + color: #1d1d1d; + padding: 0; + margin: 0; + list-style: none inside none; + position: relative; + width: auto; + float: left; +} +.vertical-menu:before, +.vertical-menu:after { + display: table; + content: ""; +} +.vertical-menu:after { + clear: both; +} +.vertical-menu > li { + display: block; + float: left; + color: inherit; + background-color: inherit; + position: relative; +} +.vertical-menu > li > a { + position: relative; + display: block; + float: left; + font-size: 1.4rem; + color: inherit; + background-color: inherit; + padding: .625rem 1.625rem; + line-height: 1.4rem; +} +.vertical-menu > li > .d-menu { + left: 0; + top: 100%; +} +.vertical-menu.compact > li > a { + font-size: .9rem; + line-height: .9rem; +} +.vertical-menu > li { + float: none; +} +.vertical-menu > li > a { + float: none; +} +.vertical-menu > li > .d-menu { + left: 100%; + top: 0; +} +.vertical-menu.compact > li > a { + padding-top: .325rem; + padding-bottom: .325rem; +} +.vertical-menu .dropdown-toggle:before { + margin-top: -2px; + -webkit-transform: rotate(-135deg); + transform: rotate(-135deg); +} +.t-menu { + list-style: none inside none; + margin: 0; + padding: 0; + position: relative; + width: auto; + float: left; + background-color: #ffffff; + box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2); +} +.t-menu > li { + position: relative; +} +.t-menu > li > a { + display: block; + padding: 1rem 1.2rem; + border-bottom: 1px #eeeeee solid; + position: relative; +} +.t-menu > li > a .icon { + width: 1.5rem; + height: 1.5rem; + font-size: 1.5rem; +} +.t-menu > li:hover > a { + background-color: #1ba1e2; + color: #ffffff; +} +.t-menu > li:last-child a { + border-bottom: 0; +} +.t-menu.compact > li > a { + padding: .5rem .7rem; +} +.t-menu.compact > li > a .icon { + width: 1rem; + height: 1rem; + font-size: 1rem; +} +.t-menu .t-menu { + position: absolute; + left: 100%; + margin-left: .3125rem !important; + top: 0; + float: none; +} +.t-menu .t-menu > li { + float: left; + display: block; +} +.t-menu .t-menu > li > a { + float: left; + display: block; +} +.t-menu .t-menu.horizontal .t-menu { + left: 0 !important; + top: 100% !important; + margin-top: .3125rem !important; + margin-left: 0 !important; +} +.t-menu .dropdown-toggle:after { + content: ""; + background-color: transparent; + position: absolute; + left: auto; + top: auto; + bottom: 0; + right: 0; + width: 0; + height: 0; + border-style: solid; + border-width: 0 0 8px 8px; + border-color: transparent transparent #1ba1e2 transparent; + -webkit-transform: rotate(0); + transform: rotate(0); +} +.t-menu .dropdown-toggle:before { + display: none; +} +.t-menu > li:hover > .dropdown-toggle:after { + border-color: transparent transparent #1b6eae transparent; +} +.t-menu.horizontal { + list-style: none inside none; + margin: 0; + padding: 0; + position: relative; + width: auto; + float: left; + background-color: #ffffff; + box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2); +} +.t-menu.horizontal > li { + position: relative; +} +.t-menu.horizontal > li > a { + display: block; + padding: 1rem 1.2rem; + border-bottom: 1px #eeeeee solid; + position: relative; +} +.t-menu.horizontal > li > a .icon { + width: 1.5rem; + height: 1.5rem; + font-size: 1.5rem; +} +.t-menu.horizontal > li:hover > a { + background-color: #1ba1e2; + color: #ffffff; +} +.t-menu.horizontal > li:last-child a { + border-bottom: 0; +} +.t-menu.horizontal.compact > li > a { + padding: .5rem .7rem; +} +.t-menu.horizontal.compact > li > a .icon { + width: 1rem; + height: 1rem; + font-size: 1rem; +} +.t-menu.horizontal .t-menu { + position: absolute; + left: 100%; + margin-left: .3125rem !important; + top: 0; + float: none; +} +.t-menu.horizontal .t-menu > li { + float: left; + display: block; +} +.t-menu.horizontal .t-menu > li > a { + float: left; + display: block; +} +.t-menu.horizontal .t-menu.horizontal .t-menu { + left: 0 !important; + top: 100% !important; + margin-top: .3125rem !important; + margin-left: 0 !important; +} +.t-menu.horizontal .dropdown-toggle:after { + content: ""; + background-color: transparent; + position: absolute; + left: auto; + top: auto; + bottom: 0; + right: 0; + width: 0; + height: 0; + border-style: solid; + border-width: 0 0 8px 8px; + border-color: transparent transparent #1ba1e2 transparent; + -webkit-transform: rotate(0); + transform: rotate(0); +} +.t-menu.horizontal .dropdown-toggle:before { + display: none; +} +.t-menu.horizontal > li:hover > .dropdown-toggle:after { + border-color: transparent transparent #1b6eae transparent; +} +.t-menu.horizontal > li { + display: block; + float: left; +} +.t-menu.horizontal > li > a { + display: block; + float: left; + border-right: 1px #eeeeee solid; + border-bottom: 0; +} +.t-menu.horizontal > li:last-child > a { + border-right: 0; +} +.t-menu.horizontal .t-menu:not(.horizontal) { + left: 0 !important; + top: 100% !important; + margin-top: .3125rem !important; + margin-left: 0 !important; +} +.t-menu.horizontal .t-menu:not(.horizontal) .t-menu.horizontal { + left: 100% !important; + margin-left: .3125rem !important; + top: 0 !important; + float: left !important; +} +[data-role="dropdown"]:not(.open), +[data-role="dropdown"]:not(.keep-open) { + display: none; + position: absolute; + z-index: 1000; +} +.button { + padding: 0 1rem; + height: 2.125rem; + text-align: center; + vertical-align: middle !important; + background-color: #ffffff; + border: 1px #d9d9d9 solid; + color: #262626; + cursor: pointer; + display: inline-block; + outline: none; + font-size: .875rem; + line-height: 1; + margin: .15625rem 0; + position: relative; +} +.button.default { + background-color: #008287; + color: #fff; +} +.button:hover { + border-color: #787878; +} +.button:active { + background: #eeeeee; + color: #262626; + box-shadow: none !important; +} +.button:focus { + outline: 0; +} +.button:disabled, +.button.disabled { + background-color: #eaeaea !important; + color: #bebebe !important; + cursor: default !important; + border-color: transparent; +} +.button * { + color: inherit; +} +.button *:hover { + color: inherit; +} +.button.rounded { + border-radius: .325rem; +} +.button.no-border { + border: 0 !important; +} +.button > [class*=mif-] { + vertical-align: middle !important; +} +.button.button-shadow { + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3); +} +.button img { + height: .875rem; + vertical-align: middle; + margin: 0; +} +.round-button, +.cycle-button, +.square-button { + padding: 0 1rem; + height: 2.125rem; + vertical-align: middle !important; + background-color: #ffffff; + border: 1px #d9d9d9 solid; + color: #262626; + cursor: pointer; + display: inline-block; + outline: none; + font-size: .875rem; + line-height: 1; + margin: .15625rem 0; + position: relative; + width: 2.125rem; + min-width: 2.125rem; + padding: 0 !important; + border-radius: 50% !important; + text-align: center; + text-decoration: none; + vertical-align: middle; +} +.round-button.default, +.cycle-button.default, +.square-button.default { + background-color: #008287; + color: #fff; +} +.round-button:hover, +.cycle-button:hover, +.square-button:hover { + border-color: #787878; +} +.round-button:active, +.cycle-button:active, +.square-button:active { + background: #eeeeee; + color: #262626; + box-shadow: none !important; +} +.round-button:focus, +.cycle-button:focus, +.square-button:focus { + outline: 0; +} +.round-button:disabled, +.cycle-button:disabled, +.square-button:disabled, +.round-button.disabled, +.cycle-button.disabled, +.square-button.disabled { + background-color: #eaeaea !important; + color: #bebebe !important; + cursor: default !important; + border-color: transparent; +} +.round-button *, +.cycle-button *, +.square-button * { + color: inherit; +} +.round-button *:hover, +.cycle-button *:hover, +.square-button *:hover { + color: inherit; +} +.round-button.rounded, +.cycle-button.rounded, +.square-button.rounded { + border-radius: .325rem; +} +.round-button.no-border, +.cycle-button.no-border, +.square-button.no-border { + border: 0 !important; +} +.round-button > [class*=mif-], +.cycle-button > [class*=mif-], +.square-button > [class*=mif-] { + vertical-align: middle !important; +} +.round-button img, +.cycle-button img, +.square-button img { + height: .875rem; + vertical-align: middle; + margin: 0; +} +.round-button.loading-pulse, +.cycle-button.loading-pulse, +.square-button.loading-pulse { + position: relative; + padding: 0 1.325rem; +} +.round-button.loading-pulse:before, +.cycle-button.loading-pulse:before, +.square-button.loading-pulse:before { + position: absolute; + content: ""; + left: 0; + top: 50%; + margin-top: -10px; + width: 20px; + height: 20px; + background-color: #333; + border-radius: 100%; + -webkit-animation: scaleout 1s infinite ease-in-out; + animation: scaleout 1s infinite ease-in-out; +} +.round-button.loading-pulse.lighten:before, +.cycle-button.loading-pulse.lighten:before, +.square-button.loading-pulse.lighten:before { + background-color: #fff; +} +.round-button.loading-cube, +.cycle-button.loading-cube, +.square-button.loading-cube { + position: relative; + padding: 0 1.325rem; +} +.round-button.loading-cube:before, +.cycle-button.loading-cube:before, +.square-button.loading-cube:before, +.round-button.loading-cube:after, +.cycle-button.loading-cube:after, +.square-button.loading-cube:after { + content: ""; + background-color: #333; + width: 5px; + height: 5px; + position: absolute; + top: 50%; + left: 3px; + margin-top: -8px; + -webkit-animation: cubemove 1.8s infinite ease-in-out; + animation: cubemove 1.8s infinite ease-in-out; +} +.round-button.loading-cube:after, +.cycle-button.loading-cube:after, +.square-button.loading-cube:after { + -webkit-animation-delay: -0.9s; + animation-delay: -0.9s; +} +.round-button.loading-cube.lighten:before, +.cycle-button.loading-cube.lighten:before, +.square-button.loading-cube.lighten:before, +.round-button.loading-cube.lighten:after, +.cycle-button.loading-cube.lighten:after, +.square-button.loading-cube.lighten:after { + background-color: #fff; +} +.round-button.dropdown-toggle, +.cycle-button.dropdown-toggle, +.square-button.dropdown-toggle { + padding-right: 1.625rem; +} +.round-button.dropdown-toggle.drop-marker-light:before, +.cycle-button.dropdown-toggle.drop-marker-light:before, +.square-button.dropdown-toggle.drop-marker-light:before, +.round-button.dropdown-toggle.drop-marker-light:after, +.cycle-button.dropdown-toggle.drop-marker-light:after, +.square-button.dropdown-toggle.drop-marker-light:after { + background-color: #ffffff; +} +.round-button.big-button, +.cycle-button.big-button, +.square-button.big-button { + width: 3.125rem; + height: 3.125rem; + line-height: 1.1; +} +.round-button.mini-button, +.cycle-button.mini-button, +.square-button.mini-button { + width: 1.5rem; + height: 1.5rem; +} +.round-button.small-button, +.cycle-button.small-button, +.square-button.small-button { + width: 1.7rem; + height: 1.7rem; +} +.round-button.large-button, +.cycle-button.large-button, +.square-button.large-button { + width: 2.55rem; + height: 2.55rem; +} +.square-button { + border-radius: 0 !important; +} +a.button, +a.round-button, +a.square-button { + color: inherit; +} +a.button:hover, +a.round-button:hover, +a.square-button:hover { + text-decoration: none; +} +.button.loading-pulse { + position: relative; + padding: 0 1.325rem; +} +.button.loading-pulse:before { + position: absolute; + content: ""; + left: 0; + top: 50%; + margin-top: -10px; + width: 20px; + height: 20px; + background-color: #333; + border-radius: 100%; + -webkit-animation: scaleout 1s infinite ease-in-out; + animation: scaleout 1s infinite ease-in-out; +} +.button.loading-pulse.lighten:before { + background-color: #fff; +} +.button.loading-cube { + position: relative; + padding: 0 1.325rem; +} +.button.loading-cube:before, +.button.loading-cube:after { + content: ""; + background-color: #333; + width: 5px; + height: 5px; + position: absolute; + top: 50%; + left: 3px; + margin-top: -8px; + -webkit-animation: cubemove 1.8s infinite ease-in-out; + animation: cubemove 1.8s infinite ease-in-out; +} +.button.loading-cube:after { + -webkit-animation-delay: -0.9s; + animation-delay: -0.9s; +} +.button.loading-cube.lighten:before, +.button.loading-cube.lighten:after { + background-color: #fff; +} +.command-button { + padding: 0 1rem; + height: 2.125rem; + text-align: center; + vertical-align: middle !important; + background-color: #ffffff; + border: 1px #d9d9d9 solid; + color: #262626; + cursor: pointer; + display: inline-block; + outline: none; + font-size: .875rem; + line-height: 1; + margin: .15625rem 0; + position: relative; + height: auto; + text-align: left; + font-size: 1.325rem; + padding-left: 4rem; + padding-top: 8px; + padding-bottom: 4px; +} +.command-button.default { + background-color: #008287; + color: #fff; +} +.command-button:hover { + border-color: #787878; +} +.command-button:active { + background: #eeeeee; + color: #262626; + box-shadow: none !important; +} +.command-button:focus { + outline: 0; +} +.command-button:disabled, +.command-button.disabled { + background-color: #eaeaea !important; + color: #bebebe !important; + cursor: default !important; + border-color: transparent; +} +.command-button * { + color: inherit; +} +.command-button *:hover { + color: inherit; +} +.command-button.rounded { + border-radius: .325rem; +} +.command-button.no-border { + border: 0 !important; +} +.command-button > [class*=mif-] { + vertical-align: middle !important; +} +.command-button img { + height: .875rem; + vertical-align: middle; + margin: 0; +} +.command-button.loading-pulse { + position: relative; + padding: 0 1.325rem; +} +.command-button.loading-pulse:before { + position: absolute; + content: ""; + left: 0; + top: 50%; + margin-top: -10px; + width: 20px; + height: 20px; + background-color: #333; + border-radius: 100%; + -webkit-animation: scaleout 1s infinite ease-in-out; + animation: scaleout 1s infinite ease-in-out; +} +.command-button.loading-pulse.lighten:before { + background-color: #fff; +} +.command-button.loading-cube { + position: relative; + padding: 0 1.325rem; +} +.command-button.loading-cube:before, +.command-button.loading-cube:after { + content: ""; + background-color: #333; + width: 5px; + height: 5px; + position: absolute; + top: 50%; + left: 3px; + margin-top: -8px; + -webkit-animation: cubemove 1.8s infinite ease-in-out; + animation: cubemove 1.8s infinite ease-in-out; +} +.command-button.loading-cube:after { + -webkit-animation-delay: -0.9s; + animation-delay: -0.9s; +} +.command-button.loading-cube.lighten:before, +.command-button.loading-cube.lighten:after { + background-color: #fff; +} +.command-button.dropdown-toggle { + padding-right: 1.625rem; +} +.command-button.dropdown-toggle.drop-marker-light:before, +.command-button.dropdown-toggle.drop-marker-light:after { + background-color: #ffffff; +} +.command-button small { + display: block; + font-size: .8rem; + line-height: 1.625rem; + margin-top: -0.3125rem; +} +.command-button .icon { + left: 1rem; + top: 50%; + margin-top: -1rem; + position: absolute; + font-size: 2rem; + height: 2rem; + width: 2rem; + margin-right: .625rem; +} +.command-button.icon-right { + padding-left: 1rem; + padding-right: 4rem; +} +.command-button.icon-right .icon { + left: auto; + right: 0; +} +.image-button { + padding: 0 1rem; + height: 2.125rem; + text-align: center; + vertical-align: middle !important; + background-color: #ffffff; + border: 1px #d9d9d9 solid; + color: #262626; + cursor: pointer; + display: inline-block; + outline: none; + font-size: .875rem; + line-height: 1; + margin: .15625rem 0; + position: relative; + border: 0; + padding-left: 2.75rem; + background-color: #eeeeee; +} +.image-button.default { + background-color: #008287; + color: #fff; +} +.image-button:hover { + border-color: #787878; +} +.image-button:active { + background: #eeeeee; + color: #262626; + box-shadow: none !important; +} +.image-button:focus { + outline: 0; +} +.image-button:disabled, +.image-button.disabled { + background-color: #eaeaea !important; + color: #bebebe !important; + cursor: default !important; + border-color: transparent; +} +.image-button * { + color: inherit; +} +.image-button *:hover { + color: inherit; +} +.image-button.rounded { + border-radius: .325rem; +} +.image-button.no-border { + border: 0 !important; +} +.image-button > [class*=mif-] { + vertical-align: middle !important; +} +.image-button img { + height: .875rem; + vertical-align: middle; + margin: 0; +} +.image-button.loading-pulse { + position: relative; + padding: 0 1.325rem; +} +.image-button.loading-pulse:before { + position: absolute; + content: ""; + left: 0; + top: 50%; + margin-top: -10px; + width: 20px; + height: 20px; + background-color: #333; + border-radius: 100%; + -webkit-animation: scaleout 1s infinite ease-in-out; + animation: scaleout 1s infinite ease-in-out; +} +.image-button.loading-pulse.lighten:before { + background-color: #fff; +} +.image-button.loading-cube { + position: relative; + padding: 0 1.325rem; +} +.image-button.loading-cube:before, +.image-button.loading-cube:after { + content: ""; + background-color: #333; + width: 5px; + height: 5px; + position: absolute; + top: 50%; + left: 3px; + margin-top: -8px; + -webkit-animation: cubemove 1.8s infinite ease-in-out; + animation: cubemove 1.8s infinite ease-in-out; +} +.image-button.loading-cube:after { + -webkit-animation-delay: -0.9s; + animation-delay: -0.9s; +} +.image-button.loading-cube.lighten:before, +.image-button.loading-cube.lighten:after { + background-color: #fff; +} +.image-button.dropdown-toggle { + padding-right: 1.625rem; +} +.image-button.dropdown-toggle.drop-marker-light:before, +.image-button.dropdown-toggle.drop-marker-light:after { + background-color: #ffffff; +} +.image-button:active { + background-color: #e1e1e1; +} +.image-button .icon { + position: absolute; + left: 0; + top: 0; + height: 100%; + width: 2.125rem; + padding: .525rem; + font-size: 1rem; + background-color: #999999; + text-align: center; + vertical-align: middle; +} +.image-button img.icon { + padding-top: .525rem; +} +.image-button.icon-right { + padding-left: 1rem; + padding-right: 2.75rem; +} +.image-button.icon-right .icon { + right: 0; + left: auto !important; +} +a.image-button { + padding-top: 10px; +} +.image-button.small-button { + padding-left: 2rem; + padding-right: 1rem; + padding-top: 0; +} +.image-button.small-button .icon { + width: 1.625rem; + font-size: .875rem; + height: 100%; + padding: .4rem; +} +.image-button.small-button.icon-right { + padding-left: .625rem; + padding-right: 2rem; +} +.shortcut-button { + padding: 0 1rem; + height: 2.125rem; + vertical-align: middle !important; + background-color: #ffffff; + border: 1px #d9d9d9 solid; + color: #262626; + cursor: pointer; + display: inline-block; + outline: none; + font-size: .875rem; + line-height: 1; + margin: .15625rem 0; + position: relative; + width: 5.75rem; + height: 5.75rem; + text-align: center; +} +.shortcut-button.default { + background-color: #008287; + color: #fff; +} +.shortcut-button:hover { + border-color: #787878; +} +.shortcut-button:active { + background: #eeeeee; + color: #262626; + box-shadow: none !important; +} +.shortcut-button:focus { + outline: 0; +} +.shortcut-button:disabled, +.shortcut-button.disabled { + background-color: #eaeaea !important; + color: #bebebe !important; + cursor: default !important; + border-color: transparent; +} +.shortcut-button * { + color: inherit; +} +.shortcut-button *:hover { + color: inherit; +} +.shortcut-button.rounded { + border-radius: .325rem; +} +.shortcut-button.no-border { + border: 0 !important; +} +.shortcut-button > [class*=mif-] { + vertical-align: middle !important; +} +.shortcut-button img { + height: .875rem; + vertical-align: middle; + margin: 0; +} +.shortcut-button.loading-pulse { + position: relative; + padding: 0 1.325rem; +} +.shortcut-button.loading-pulse:before { + position: absolute; + content: ""; + left: 0; + top: 50%; + margin-top: -10px; + width: 20px; + height: 20px; + background-color: #333; + border-radius: 100%; + -webkit-animation: scaleout 1s infinite ease-in-out; + animation: scaleout 1s infinite ease-in-out; +} +.shortcut-button.loading-pulse.lighten:before { + background-color: #fff; +} +.shortcut-button.loading-cube { + position: relative; + padding: 0 1.325rem; +} +.shortcut-button.loading-cube:before, +.shortcut-button.loading-cube:after { + content: ""; + background-color: #333; + width: 5px; + height: 5px; + position: absolute; + top: 50%; + left: 3px; + margin-top: -8px; + -webkit-animation: cubemove 1.8s infinite ease-in-out; + animation: cubemove 1.8s infinite ease-in-out; +} +.shortcut-button.loading-cube:after { + -webkit-animation-delay: -0.9s; + animation-delay: -0.9s; +} +.shortcut-button.loading-cube.lighten:before, +.shortcut-button.loading-cube.lighten:after { + background-color: #fff; +} +.shortcut-button.dropdown-toggle { + padding-right: 1.625rem; +} +.shortcut-button.dropdown-toggle.drop-marker-light:before, +.shortcut-button.dropdown-toggle.drop-marker-light:after { + background-color: #ffffff; +} +.shortcut-button .icon, +.shortcut-button .title { + display: block; + color: inherit; +} +.shortcut-button .icon { + font-size: 1.7rem; + height: 1.7rem; + width: 1.7rem; + margin: .875rem auto; +} +.shortcut-button .badge { + color: inherit; + position: absolute; + top: 0; + right: 0; + font-size: .7rem; + line-height: 1rem; + padding: 0 .225rem; +} +a.shortcut-button { + padding-top: 10px; +} +.button.dropdown-toggle { + padding-right: 1.625rem; +} +.button.dropdown-toggle.drop-marker-light:before, +.button.dropdown-toggle.drop-marker-light:after { + background-color: #ffffff; +} +.nav-button { + width: 2rem; + height: 2rem; + background-size: 1rem 1rem; + background: center center no-repeat; + text-indent: -9999px; + border: 0; + display: inline-block; + cursor: pointer; + z-index: 2; + position: relative; +} +.nav-button:active, +.nav-button:focus { + outline: 1px #eeeeee solid; +} +.nav-button span { + position: absolute; + top: 1.2rem; + left: .5rem; + width: 1.2rem; + height: 2px; + margin: 0 0 0; + background: #1d1d1d; + -webkit-transform: rotate(0); + transform: rotate(0); + transition: all 0.3s linear; +} +.nav-button span:before, +.nav-button span:after { + content: ''; + position: absolute; + top: -0.5rem; + right: 0; + width: 1.2rem; + height: 2px; + background: #1d1d1d; + -webkit-transform: rotate(0); + transform: rotate(0); + transition: all 0.3s linear; +} +.nav-button span:after { + top: .5rem; +} +.nav-button.transform span { + -webkit-transform: rotate(180deg); + transform: rotate(180deg); + background: #1d1d1d; +} +.nav-button.transform span:before, +.nav-button.transform span:after { + content: ''; + top: -5px; + right: 0; + width: .75rem; + -webkit-transform: rotate(45deg); + transform: rotate(45deg); +} +.nav-button.transform span:after { + top: 5px; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); +} +.group-of-buttons .button.active, +.group-of-buttons .toolbar-button.active { + background-color: #00ccff; + color: #ffffff; +} +.group-of-buttons .button:active, +.group-of-buttons .toolbar-button:active { + background-color: #1ba1e2; + color: #ffffff; +} +.split-button { + display: inline-block; + position: relative; +} +.split-button:before, +.split-button:after { + display: table; + content: ""; +} +.split-button:after { + clear: both; +} +.split-button .button, +.split-button .split { + display: block; + float: left; +} +.split-button .split { + padding: 0 1rem 0 .625rem; + height: 2.125rem; + text-align: center; + vertical-align: middle !important; + background-color: #ffffff; + border: 1px #d9d9d9 solid; + color: #262626; + cursor: pointer; + outline: none; + font-size: .875rem; + line-height: 2.1rem; + position: relative; + margin: .15625rem 0; +} +.split-button .split:hover { + background-color: #eeeeee; + border-color: #787878; +} +.split-button .split-content { + position: absolute; + top: 100%; +} +.split.primary { + background: #2086bf; + color: #ffffff; + border-color: #2086bf; +} +.split.primary:active { + background: #1b6eae; +} +.split.primary:hover { + background: #59cde2; + border-color: #59cde2; +} +.split.primary.dropdown-toggle:before { + border-color: #ffffff; +} +.split.success { + background: #60a917; + color: #ffffff; + border-color: #60a917; +} +.split.success:active { + background: #128023; +} +.split.success:hover { + background: #7ad61d; + border-color: #7ad61d; +} +.split.success.dropdown-toggle:before { + border-color: #ffffff; +} +.split.danger { + background: #ce352c; + color: #ffffff; + border-color: #ce352c; +} +.split.danger:active { + background: #9a1616; +} +.split.danger:hover { + background: #da5a53; + border-color: #da5a53; +} +.split.danger.dropdown-toggle:before { + border-color: #ffffff; +} +.split.info { + background: #59cde2; + color: #ffffff; + border-color: #59cde2; +} +.split.info:active { + background: #1ba1e2; +} +.split.info:hover { + background: #4390df; + border-color: #4390df; +} +.split.info.dropdown-toggle:before { + border-color: #ffffff; +} +.split.warning { + background: #fa6800; + color: #ffffff; + border-color: #fa6800; +} +.split.warning:active { + background: #bf5a15; +} +.split.warning:hover { + background: #c29008; + border-color: #c29008; +} +.split.warning.dropdown-toggle:before { + border-color: #ffffff; +} +.mini-button { + font-size: .6rem; + line-height: 1.3; + padding: .2rem .625rem; + height: 1.4rem; +} +.small-button { + font-size: .7rem; + line-height: 1.68rem; + padding: 0 .625rem; + height: 1.7rem; +} +.large-button { + height: 2.55rem; + font-size: 1.05rem; + line-height: 2.52rem; +} +.big-button { + height: 3.125rem; + font-size: 1.2rem; + line-height: 1; +} +.primary { + background: #2086bf; + color: #ffffff; + border-color: #2086bf; +} +.primary:active { + background: #1b6eae; + color: #ffffff; +} +.success { + background: #60a917; + color: #ffffff; + border-color: #60a917; +} +.success:active { + background: #128023; + color: #ffffff; +} +.danger, +.alert { + background: #ce352c; + color: #ffffff; + border-color: #ce352c; +} +.danger:active, +.alert:active { + background: #9a1616; + color: #ffffff; +} +.info { + background: #59cde2; + color: #ffffff; + border-color: #59cde2; +} +.info:active { + background: #1ba1e2; + color: #ffffff; +} +.warning { + background: #fa6800; + color: #ffffff; + border-color: #fa6800; +} +.warning:active { + background: #bf5a15; + color: #ffffff; +} +.link { + background: transparent; + color: #2086bf; + border-color: transparent; + text-decoration: underline; +} +.link:hover, +.link:active { + background: transparent; + color: #114968; + border-color: transparent; +} +a.button, +span.button, +div.button, +a.round-button, +span.round-button, +div.round-button, +a.cycle-button, +span.cycle-button, +div.cycle-button, +a.square-button, +span.square-button, +div.square-button { + padding-top: .53125rem !important; +} +a.button.big-button, +span.button.big-button, +div.button.big-button, +a.round-button.big-button, +span.round-button.big-button, +div.round-button.big-button, +a.cycle-button.big-button, +span.cycle-button.big-button, +div.cycle-button.big-button, +a.square-button.big-button, +span.square-button.big-button, +div.square-button.big-button { + padding-top: .78125rem !important; +} +.toolbar { + position: relative; +} +.toolbar:before, +.toolbar:after { + display: table; + content: ""; +} +.toolbar:after { + clear: both; +} +.toolbar-section { + position: relative; + padding-left: .5725rem; + margin: .125rem; + float: left; + width: auto; +} +.toolbar-section.no-divider:before { + display: none; +} +.toolbar-section:before { + position: absolute; + content: ""; + width: .325rem; + height: 100%; + left: 0; + background: #eeeeee linear-gradient(90deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent) !important; + background-size: 0.325rem 0.325rem !important; + cursor: move; +} +.toolbar-button { + padding: 0 1rem; + height: 2.125rem; + vertical-align: middle !important; + background-color: #ffffff; + border: 1px #d9d9d9 solid; + color: #262626; + cursor: pointer; + display: inline-block; + outline: none; + font-size: .875rem; + line-height: 1; + margin: .15625rem 0; + position: relative; + width: 2.125rem; + min-width: 2.125rem; + padding: 0 !important; + border-radius: 50% !important; + text-align: center; + text-decoration: none; + vertical-align: middle; + border-radius: 0 !important; + margin: 0; +} +.toolbar-button.default { + background-color: #008287; + color: #fff; +} +.toolbar-button:hover { + border-color: #787878; +} +.toolbar-button:active { + background: #eeeeee; + color: #262626; + box-shadow: none !important; +} +.toolbar-button:focus { + outline: 0; +} +.toolbar-button:disabled, +.toolbar-button.disabled { + background-color: #eaeaea !important; + color: #bebebe !important; + cursor: default !important; + border-color: transparent; +} +.toolbar-button * { + color: inherit; +} +.toolbar-button *:hover { + color: inherit; +} +.toolbar-button.rounded { + border-radius: .325rem; +} +.toolbar-button.no-border { + border: 0 !important; +} +.toolbar-button > [class*=mif-] { + vertical-align: middle !important; +} +.toolbar-button img { + height: .875rem; + vertical-align: middle; + margin: 0; +} +.toolbar-button.loading-pulse { + position: relative; + padding: 0 1.325rem; +} +.toolbar-button.loading-pulse:before { + position: absolute; + content: ""; + left: 0; + top: 50%; + margin-top: -10px; + width: 20px; + height: 20px; + background-color: #333; + border-radius: 100%; + -webkit-animation: scaleout 1s infinite ease-in-out; + animation: scaleout 1s infinite ease-in-out; +} +.toolbar-button.loading-pulse.lighten:before { + background-color: #fff; +} +.toolbar-button.loading-cube { + position: relative; + padding: 0 1.325rem; +} +.toolbar-button.loading-cube:before, +.toolbar-button.loading-cube:after { + content: ""; + background-color: #333; + width: 5px; + height: 5px; + position: absolute; + top: 50%; + left: 3px; + margin-top: -8px; + -webkit-animation: cubemove 1.8s infinite ease-in-out; + animation: cubemove 1.8s infinite ease-in-out; +} +.toolbar-button.loading-cube:after { + -webkit-animation-delay: -0.9s; + animation-delay: -0.9s; +} +.toolbar-button.loading-cube.lighten:before, +.toolbar-button.loading-cube.lighten:after { + background-color: #fff; +} +.toolbar-button.dropdown-toggle { + padding-right: 1.625rem; +} +.toolbar-button.dropdown-toggle.drop-marker-light:before, +.toolbar-button.dropdown-toggle.drop-marker-light:after { + background-color: #ffffff; +} +.toolbar-button.big-button { + width: 3.125rem; + height: 3.125rem; + line-height: 1.1; +} +.toolbar-button.mini-button { + width: 1.5rem; + height: 1.5rem; +} +.toolbar-button.small-button { + width: 1.7rem; + height: 1.7rem; +} +.toolbar-button.large-button { + width: 2.55rem; + height: 2.55rem; +} +.toolbar-group, +.toolbar-section { + display: inline-block; +} +.toolbar-group.condensed:before, +.toolbar-section.condensed:before, +.toolbar-group.condensed:after, +.toolbar-section.condensed:after { + display: table; + content: ""; +} +.toolbar-group.condensed:after, +.toolbar-section.condensed:after { + clear: both; +} +.toolbar-group.condensed .button, +.toolbar-section.condensed .button, +.toolbar-group.condensed .toolbar-button, +.toolbar-section.condensed .toolbar-button { + display: block; + float: left; +} +.toolbar-group-check .toolbar-button.checked { + background-color: #59cde2; + color: #ffffff; + border-color: #59cde2; +} +.toolbar-group-radio .toolbar-button.checked { + background-color: #59cde2; + color: #ffffff; + border-color: #59cde2; +} +.toolbar.rounded .toolbar-button { + border-radius: .3125rem !important; +} +.toolbar.rounded .toolbar-section:before { + border-radius: .3125rem !important; +} +.v-toolbar { + position: relative; + float: left; +} +.v-toolbar:before, +.v-toolbar:after { + display: table; + content: ""; +} +.v-toolbar:after { + clear: both; +} +.v-toolbar.rounded .toolbar-button { + border-radius: .3125rem !important; +} +.v-toolbar.rounded .toolbar-section:before { + border-radius: .3125rem !important; +} +.v-toolbar .toolbar-section { + padding-left: 0; + padding-top: .5725rem; +} +.v-toolbar .toolbar-section:before { + width: 100%; + top: 0; + height: .325rem; +} +.v-toolbar .toolbar-button { + display: block; + margin-bottom: .25rem; +} +.v-toolbar.no-divider .toolbar-section:before { + display: none; +} +.pagination { + display: block; + margin: .625rem 0; +} +.pagination:before, +.pagination:after { + display: table; + content: ""; +} +.pagination:after { + clear: both; +} +.pagination > .item { + display: block; + float: left; + margin-left: .0652rem; + padding: 0.25rem .625rem; + background-color: #ffffff; + cursor: pointer; + border: 1px #eeeeee solid; + text-align: center; + font-size: .875rem; +} +.pagination > .item:first-child { + margin-left: 0 !important; +} +.pagination > .item.current, +.pagination > .item.active { + background-color: #1ba1e2; + border-color: #59cde2; + color: #ffffff; + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); +} +.pagination > .item:hover { + background-color: #75c7ee; + border-color: #75c7ee; + color: #ffffff; +} +.pagination > .item:disabled, +.pagination > .item.disabled { + cursor: default; + background-color: #eeeeee; + border-color: #eeeeee; + color: #999999; +} +.pagination > .item.spaces { + border: 0; + cursor: default; +} +.pagination > .item.spaces:hover { + background-color: inherit !important; + color: inherit !important; +} +.pagination.rounded > .item { + border-radius: .3125rem; +} +.pagination.cycle > .item { + width: 28px; + height: 28px; + border-radius: 50%; + font-size: .7rem; + padding: .4375rem 0; +} +.pagination.no-border > .item { + border: 0; +} +.pagination.no-border > .item:hover { + color: #59cde2; + background-color: transparent !important; +} +.pagination.no-border > .item:disabled, +.pagination.no-border > .item.disabled { + cursor: default; + background-color: transparent; + border-color: transparent; + color: #999999; +} +.pagination.no-border > .item.current:hover, +.pagination.no-border > .item.active:hover { + background-color: #75c7ee !important; + border-color: #75c7ee !important; + color: #ffffff !important; +} +.breadcrumbs { + padding: 0; + margin: 0; + list-style: none inside none; + background-color: #ffffff; + color: #999; + padding: 1rem; +} +.breadcrumbs > li { + display: inline-block; + color: inherit; + margin: 0 1rem 0 0; + position: relative; + vertical-align: middle; +} +.breadcrumbs > li:before, +.breadcrumbs > li:after { + display: block; + position: absolute; + vertical-align: middle; + color: transparent; + font-size: 0; + content: ""; + height: 1px; + width: .375rem; + background-color: #1d1d1d; + top: 50%; + left: 100%; + margin-left: .5rem; +} +.breadcrumbs > li:before { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + margin-top: -0.125rem; +} +.breadcrumbs > li:after { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + margin-top: .125rem; +} +.breadcrumbs > li > a { + color: inherit; + display: inline-block; + line-height: 1; +} +.breadcrumbs > li:last-child { + color: #1d1d1d; + font-weight: bolder; +} +.breadcrumbs > li:last-child a { + cursor: default; +} +.breadcrumbs > li:last-child:before, +.breadcrumbs > li:last-child:after { + background-color: transparent; +} +.breadcrumbs > li:hover { + color: #1d1d1d; +} +.breadcrumbs img, +.breadcrumbs .icon { + display: inline-block; + line-height: .8; + height: 1rem; + width: 1rem; + font-size: 1rem; + vertical-align: -15%; +} +.breadcrumbs.dark { + background-color: #393832; +} +.breadcrumbs.dark > li:hover, +.breadcrumbs.dark > li:last-child { + color: #ffffff; +} +.breadcrumbs.dark > li:before, +.breadcrumbs.dark > li:after { + background-color: #ffffff; +} +.input-control { + display: inline-block; + min-height: 2.125rem; + height: 2.125rem; + position: relative; + min-width: 10.875rem; + vertical-align: middle; + margin: .325rem 0; + line-height: 1; +} +.input-control[data-role=select] { + height: auto; +} +.input-control.text .button, +.input-control.select .button, +.input-control.file .button, +.input-control.password .button, +.input-control.number .button, +.input-control.email .button, +.input-control.tel .button { + position: absolute; + top: 0; + right: 0; + z-index: 2; + margin: 0; +} +.input-control.text > label, +.input-control.select > label, +.input-control.file > label, +.input-control.password > label, +.input-control.number > label, +.input-control.email > label, +.input-control.tel > label, +.input-control.text > .label, +.input-control.select > .label, +.input-control.file > .label, +.input-control.password > .label, +.input-control.number > .label, +.input-control.email > .label, +.input-control.tel > .label { + position: absolute; + left: 0; + top: -1rem; + font-size: .875rem; +} +.input-control.text > input:disabled + .button, +.input-control.select > input:disabled + .button, +.input-control.file > input:disabled + .button, +.input-control.password > input:disabled + .button, +.input-control.number > input:disabled + .button, +.input-control.email > input:disabled + .button, +.input-control.tel > input:disabled + .button { + display: none; +} +.input-control.text .prepend-icon, +.input-control.select .prepend-icon, +.input-control.file .prepend-icon, +.input-control.password .prepend-icon, +.input-control.number .prepend-icon, +.input-control.email .prepend-icon, +.input-control.tel .prepend-icon { + width: 24px; + height: 24px; + font-size: 24px; + line-height: 1; + position: absolute; + top: 4px; + left: 4px; + z-index: 2; + color: #555555; +} +.input-control.text .prepend-icon ~ input, +.input-control.select .prepend-icon ~ input, +.input-control.file .prepend-icon ~ input, +.input-control.password .prepend-icon ~ input, +.input-control.number .prepend-icon ~ input, +.input-control.email .prepend-icon ~ input, +.input-control.tel .prepend-icon ~ input { + padding-left: 30px !important; +} +.input-control input, +.input-control textarea, +.input-control select { + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; + position: relative; + border: 1px #d9d9d9 solid; + width: 100%; + height: 100%; + padding: .3125rem; + z-index: 0; +} +.input-control input:focus, +.input-control textarea:focus, +.input-control select:focus { + outline: none; +} +.input-control input:disabled, +.input-control textarea:disabled, +.input-control select:disabled { + background-color: #EBEBE4; +} +.input-control input:focus, +.input-control textarea:focus, +.input-control select:focus, +.input-control input:hover, +.input-control textarea:hover, +.input-control select:hover { + border-color: #787878; +} +.input-control textarea { + position: relative !important; + min-height: 6.25rem; + font-family: "Segoe UI", "Open Sans", serif; +} +.input-control.textarea { + height: auto; + overflow: auto; +} +.input-control.select { + position: relative; +} +.input-control.select select { + padding-right: 20px !important; +} +.input-control.rounded input, +.input-control.rounded textarea, +.input-control.rounded select { + border-radius: 0.3125rem; +} +.input-control.big-input { + height: 4.125rem; +} +.input-control.big-input input { + font-size: 1.875rem; + padding-left: 1.25rem !important; +} +.input-control.big-input .button { + height: 3.25rem; + top: 50%; + margin-top: -1.625rem; + right: 0.3125rem !important; + font-size: 1.125rem; + font-weight: bold; + padding-left: 1.875rem; + padding-right: 1.875rem; +} +.input-control.error input, +.input-control.error textarea, +.input-control.error select { + border-color: #ce352c !important; +} +.input-control.error.neon input, +.input-control.error.neon textarea, +.input-control.error.neon select { + box-shadow: 0 0 25px 0 rgba(128, 0, 0, 0.7); +} +.input-control.warning input, +.input-control.warning textarea, +.input-control.warning select { + border-color: #e3c800 !important; +} +.input-control.warning.neon input, +.input-control.warning.neon textarea, +.input-control.warning.neon select { + box-shadow: 0 0 25px 0 rgba(255, 165, 0, 0.7); +} +.input-control.success input, +.input-control.success textarea, +.input-control.success select { + border-color: #60a917 !important; +} +.input-control.success.neon input, +.input-control.success.neon textarea, +.input-control.success.neon select { + box-shadow: 0 0 25px 0 rgba(0, 128, 0, 0.7); +} +.input-control.info input, +.input-control.info textarea, +.input-control.info select { + border-color: #1ba1e2 !important; +} +.input-control.info.neon input, +.input-control.info.neon textarea, +.input-control.info.neon select { + box-shadow: 0 0 25px 0 rgba(89, 205, 226, 0.7); +} +.input-control.required input, +.input-control.required textarea, +.input-control.required select { + border: 1px dashed #1ba1e2 !important; +} +.input-control.required.neon input, +.input-control.required.neon textarea, +.input-control.required.neon select { + box-shadow: 0 0 25px 0 rgba(89, 205, 226, 0.7); +} +.input-control.file input[type=file] { + position: absolute; + opacity: 0; + width: 0.0625rem; + height: 0.0625rem; +} +.input-control.file input[type=file]:disabled ~ input[type=text], +.input-control.file input[type=file]:disabled ~ .button { + background-color: #EBEBE4; +} +.input-control.file:hover input[type=text], +.input-control.file:hover button { + border-color: #787878; +} +.input-control .button-group { + position: absolute; + right: 0; + top: 0; + margin: 0; + padding: 0; + z-index: 2; +} +.input-control .button-group:before, +.input-control .button-group:after { + display: table; + content: ""; +} +.input-control .button-group:after { + clear: both; +} +.input-control .button-group .button { + position: relative; + float: left; + margin: 0; +} +.input-control > [class*=helper-button], +.input-control > .button-group > [class*=helper-button] { + visibility: hidden; + margin: 0; + border: 0; + height: 1.875rem; + padding: 0 .6rem; + z-index: 100; + font-size: .75rem; +} +.input-control > .helper-button { + margin: 2px 2px 0 !important; +} +.input-control > .button-group > .helper-button { + margin: 2px 0 !important; +} +.input-control > .button-group > .helper-button:last-child { + margin-right: 2px !important; +} +.input-control input:focus ~ [class*=helper-button], +.input-control input:focus ~ .button-group > [class*=helper-button] { + visibility: visible; +} +.input-control input ~ [class*=helper-button]:active, +.input-control input ~ .button-group > [class*=helper-button]:active { + visibility: visible; +} +.input-control input:disabled ~ [class*=helper-button], +.input-control input:disabled ~ .button-group > [class*=helper-button] { + display: none !important; +} +.input-control.modern { + position: relative; + width: 12.25rem; + height: 3rem; + display: inline-block; + margin: .625rem 0; +} +.input-control.modern input { + position: absolute; + top: 1rem; + left: 0; + right: 0; + bottom: .5rem; + border: 0; + border-bottom: 2px #DDDDDD solid; + background-color: transparent; + outline: none; + font-size: 1rem; + padding-bottom: .5rem; + padding-left: 0; + width: 100%; + z-index: 2; + height: 1.75rem; +} +.input-control.modern input:focus { + border-bottom-color: #1d1d1d; +} +.input-control.modern .label, +.input-control.modern .informer { + position: absolute; + display: block; + z-index: 1; + color: #1d1d1d; +} +.input-control.modern .label { + opacity: 0; + top: 16px; + left: 0; + transition: all 0.3s linear; +} +.input-control.modern .informer { + opacity: 0; + bottom: .75rem; + color: #C8C8C8; + font-size: .8rem; + transition: all 0.3s linear; +} +.input-control.modern .placeholder { + font-size: 1rem; + color: #C8C8C8; + position: absolute; + top: 1rem; + left: 0; + z-index: 1; + opacity: 1; + transition: all 0.3s linear; +} +.input-control.modern .helper-button { + top: 8px; +} +.input-control.modern.iconic { + margin-left: 2rem; +} +.input-control.modern.iconic .icon { + width: 1.5rem; + height: 1.5rem; + font-size: 1.5rem; + line-height: 100%; + position: absolute; + left: -32px; + top: 50%; + margin-top: -0.5rem; + display: block; + opacity: .2; + transition: all 0.3s linear; +} +.input-control.modern.iconic .icon img { + width: 100%; + max-width: 100%; + height: 100%; + max-height: 100%; +} +.input-control.modern input:focus ~ .label { + opacity: 1; + -webkit-transform: translateY(-18px); + transform: translateY(-18px); + transition: all 0.3s linear; +} +.input-control.modern input:focus ~ .placeholder { + opacity: 0; + -webkit-transform: translateX(200px); + transform: translateX(200px); + transition: all 0.3s linear; +} +.input-control.modern input:focus ~ .informer { + opacity: 1; + color: #1d1d1d; + bottom: -0.75rem; + transition: all 0.3s linear; +} +.input-control.modern input:focus ~ .icon { + opacity: 1; + transition: all 0.3s linear; +} +.input-control.modern.error input { + border-bottom-color: #ce352c; +} +.input-control.modern.error .informer, +.input-control.modern.error .label { + color: #ce352c !important; +} +.input-control.modern.success input { + border-bottom-color: #60a917; +} +.input-control.modern.success .informer, +.input-control.modern.success .label { + color: #60a917 !important; +} +.input-control.modern.warning input { + border-bottom-color: #e3c800; +} +.input-control.modern.warning .informer, +.input-control.modern.warning .label { + color: #e3c800 !important; +} +.input-control.modern.info input { + border-bottom-color: #1ba1e2; +} +.input-control.modern.info .informer, +.input-control.modern.info .label { + color: #1ba1e2 !important; +} +.input-control.modern input:disabled { + border-bottom-style: dotted; + color: #BCBCBC; +} +.input-control.checkbox, +.input-control.radio { + line-height: 1.875rem; + min-width: 1rem; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.input-control.checkbox input[type="checkbox"], +.input-control.radio input[type="checkbox"], +.input-control.checkbox input[type="radio"], +.input-control.radio input[type="radio"] { + position: absolute; + opacity: 0; + width: 0.0625rem; + height: 0.0625rem; +} +.input-control.checkbox .caption, +.input-control.radio .caption { + margin: 0 .125rem; + vertical-align: middle; +} +.input-control.checkbox .check, +.input-control.radio .check { + width: 1.625rem; + height: 1.625rem; + background-color: #ffffff; + border: 1px #999999 solid; + padding: 0; + position: relative; + display: inline-block; + vertical-align: middle; +} +.input-control.checkbox.text-left .check, +.input-control.radio.text-left .check { + margin: 0 0 0 .3125rem; +} +.input-control.checkbox .check:focus, +.input-control.radio .check:focus { + border-color: #bcd9e2; +} +.input-control.checkbox .check:before, +.input-control.radio .check:before { + position: absolute; + vertical-align: middle; + color: transparent; + font-size: 0; + content: ""; + height: .3125rem; + width: .565rem; + background-color: transparent; + border-left: .1875rem solid; + border-bottom: .1875rem solid; + border-color: transparent; + left: 50%; + top: 50%; + margin-left: -0.325rem; + margin-top: -0.365rem; + display: block; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + transition: all 0.2s linear; +} +.input-control.checkbox input[type=radio] ~ .check:before, +.input-control.radio input[type=radio] ~ .check:before { + border-color: transparent !important; +} +.input-control.checkbox input[type="checkbox"]:checked ~ .check:before, +.input-control.radio input[type="checkbox"]:checked ~ .check:before, +.input-control.checkbox input[type="radio"]:checked ~ .check:before, +.input-control.radio input[type="radio"]:checked ~ .check:before { + border-color: #555555; + transition: all 0.2s linear; +} +.input-control.checkbox input[type="checkbox"]:disabled ~ .caption, +.input-control.radio input[type="checkbox"]:disabled ~ .caption, +.input-control.checkbox input[type="radio"]:disabled ~ .caption, +.input-control.radio input[type="radio"]:disabled ~ .caption { + color: #cacaca; + cursor: default; +} +.input-control.checkbox input[type="checkbox"]:disabled ~ .check, +.input-control.radio input[type="checkbox"]:disabled ~ .check, +.input-control.checkbox input[type="radio"]:disabled ~ .check, +.input-control.radio input[type="radio"]:disabled ~ .check { + border-color: #cacaca; + cursor: default; +} +.input-control.checkbox input[type="checkbox"]:disabled:checked ~ .check:before, +.input-control.radio input[type="checkbox"]:disabled:checked ~ .check:before { + border-color: #cacaca; +} +.input-control.checkbox input[type="radio"]:disabled:checked ~ .check:before, +.input-control.radio input[type="radio"]:disabled:checked ~ .check:before { + background-color: #cacaca; +} +.input-control.checkbox input[data-show="indeterminate"] ~ .check:before, +.input-control.radio input[data-show="indeterminate"] ~ .check:before, +.input-control.checkbox input[data-show="indeterminate"]:checked ~ .check:before, +.input-control.radio input[data-show="indeterminate"]:checked ~ .check:before, +.input-control.checkbox input.indeterminate:checked ~ .check:before, +.input-control.radio input.indeterminate:checked ~ .check:before, +.input-control.checkbox input[type="checkbox"]:indeterminate ~ .check:before, +.input-control.radio input[type="checkbox"]:indeterminate ~ .check:before { + display: none; +} +.input-control.checkbox input[data-show="indeterminate"] ~ .check:after, +.input-control.radio input[data-show="indeterminate"] ~ .check:after, +.input-control.checkbox input[data-show="indeterminate"]:checked ~ .check:after, +.input-control.radio input[data-show="indeterminate"]:checked ~ .check:after, +.input-control.checkbox input.indeterminate:checked ~ .check:after, +.input-control.radio input.indeterminate:checked ~ .check:after, +.input-control.checkbox input[type="checkbox"]:indeterminate ~ .check:after, +.input-control.radio input[type="checkbox"]:indeterminate ~ .check:after { + position: absolute; + display: block; + content: "" !important; + background-color: #1d1d1d; + height: .875rem; + width: .875rem; + left: 50%; + top: 50%; + margin-left: -0.4375rem; + margin-top: -0.4375rem; +} +.input-control.checkbox input[data-show="indeterminate"]:not(:checked) ~ .check:after, +.input-control.radio input[data-show="indeterminate"]:not(:checked) ~ .check:after { + background-color: transparent; +} +.input-control.checkbox input[data-show="indeterminate"]:disabled ~ .check:after, +.input-control.radio input[data-show="indeterminate"]:disabled ~ .check:after { + background-color: #cacaca; +} +.input-control.radio .check { + border: 1px #999999 solid; + border-radius: 50%; +} +.input-control.radio .check:before { + position: absolute; + display: block; + content: "" !important; + background-color: #1d1d1d; + height: .5624rem; + width: .5624rem; + left: 50%; + top: 50%; + margin-left: -0.375rem; + margin-top: -0.375rem; + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + border-radius: 50%; +} +.input-control.radio input[type="radio"]:not(:checked) ~ .check:before { + background-color: transparent; +} +.input-control.small-check .check { + width: 1rem !important; + height: 1rem !important; +} +.input-control.small-check .check:before { + width: 6px; + height: 3px; + margin-left: -4px; + margin-top: -4px; + border-width: 2px; +} +.input-control.small-check.radio .check:before { + height: .375rem; + width: .375rem; + left: 50%; + top: 50%; + margin-left: -0.25rem; + margin-top: -0.25rem; +} +.input-control.small-check input[data-show="indeterminate"] ~ .check:after, +.input-control.small-check input[data-show="indeterminate"]:checked ~ .check:after, +.input-control.small-check input.indeterminate:checked ~ .check:after, +.input-control.small-check input[type="checkbox"]:indeterminate ~ .check:after { + height: .375rem; + width: .375rem; + left: 50%; + top: 50%; + margin-left: -0.1875rem; + margin-top: -0.1875rem; +} +input[type="button"], +input[type="reset"], +input[type="submit"] { + padding: 0 1rem; + height: 2.125rem; + text-align: center; + vertical-align: middle !important; + background-color: #ffffff; + border: 1px #d9d9d9 solid; + color: #262626; + cursor: pointer; + display: inline-block; + outline: none; + font-size: .875rem; + line-height: 1; + margin: .15625rem 0; + position: relative; + vertical-align: middle; +} +input[type="button"].default, +input[type="reset"].default, +input[type="submit"].default { + background-color: #008287; + color: #fff; +} +input[type="button"]:hover, +input[type="reset"]:hover, +input[type="submit"]:hover { + border-color: #787878; +} +input[type="button"]:active, +input[type="reset"]:active, +input[type="submit"]:active { + background: #eeeeee; + color: #262626; + box-shadow: none !important; +} +input[type="button"]:focus, +input[type="reset"]:focus, +input[type="submit"]:focus { + outline: 0; +} +input[type="button"]:disabled, +input[type="reset"]:disabled, +input[type="submit"]:disabled, +input[type="button"].disabled, +input[type="reset"].disabled, +input[type="submit"].disabled { + background-color: #eaeaea !important; + color: #bebebe !important; + cursor: default !important; + border-color: transparent; +} +input[type="button"] *, +input[type="reset"] *, +input[type="submit"] * { + color: inherit; +} +input[type="button"] *:hover, +input[type="reset"] *:hover, +input[type="submit"] *:hover { + color: inherit; +} +input[type="button"].rounded, +input[type="reset"].rounded, +input[type="submit"].rounded { + border-radius: .325rem; +} +input[type="button"].no-border, +input[type="reset"].no-border, +input[type="submit"].no-border { + border: 0 !important; +} +input[type="button"] > [class*=mif-], +input[type="reset"] > [class*=mif-], +input[type="submit"] > [class*=mif-] { + vertical-align: middle !important; +} +input[type="button"] img, +input[type="reset"] img, +input[type="submit"] img { + height: .875rem; + vertical-align: middle; + margin: 0; +} +input[type="button"].loading-pulse, +input[type="reset"].loading-pulse, +input[type="submit"].loading-pulse { + position: relative; + padding: 0 1.325rem; +} +input[type="button"].loading-pulse:before, +input[type="reset"].loading-pulse:before, +input[type="submit"].loading-pulse:before { + position: absolute; + content: ""; + left: 0; + top: 50%; + margin-top: -10px; + width: 20px; + height: 20px; + background-color: #333; + border-radius: 100%; + -webkit-animation: scaleout 1s infinite ease-in-out; + animation: scaleout 1s infinite ease-in-out; +} +input[type="button"].loading-pulse.lighten:before, +input[type="reset"].loading-pulse.lighten:before, +input[type="submit"].loading-pulse.lighten:before { + background-color: #fff; +} +input[type="button"].loading-cube, +input[type="reset"].loading-cube, +input[type="submit"].loading-cube { + position: relative; + padding: 0 1.325rem; +} +input[type="button"].loading-cube:before, +input[type="reset"].loading-cube:before, +input[type="submit"].loading-cube:before, +input[type="button"].loading-cube:after, +input[type="reset"].loading-cube:after, +input[type="submit"].loading-cube:after { + content: ""; + background-color: #333; + width: 5px; + height: 5px; + position: absolute; + top: 50%; + left: 3px; + margin-top: -8px; + -webkit-animation: cubemove 1.8s infinite ease-in-out; + animation: cubemove 1.8s infinite ease-in-out; +} +input[type="button"].loading-cube:after, +input[type="reset"].loading-cube:after, +input[type="submit"].loading-cube:after { + -webkit-animation-delay: -0.9s; + animation-delay: -0.9s; +} +input[type="button"].loading-cube.lighten:before, +input[type="reset"].loading-cube.lighten:before, +input[type="submit"].loading-cube.lighten:before, +input[type="button"].loading-cube.lighten:after, +input[type="reset"].loading-cube.lighten:after, +input[type="submit"].loading-cube.lighten:after { + background-color: #fff; +} +input[type="button"].dropdown-toggle, +input[type="reset"].dropdown-toggle, +input[type="submit"].dropdown-toggle { + padding-right: 1.625rem; +} +input[type="button"].dropdown-toggle.drop-marker-light:before, +input[type="reset"].dropdown-toggle.drop-marker-light:before, +input[type="submit"].dropdown-toggle.drop-marker-light:before, +input[type="button"].dropdown-toggle.drop-marker-light:after, +input[type="reset"].dropdown-toggle.drop-marker-light:after, +input[type="submit"].dropdown-toggle.drop-marker-light:after { + background-color: #ffffff; +} +.switch, +.switch-original { + display: inline-block; + margin: 0 .625rem 0 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.switch input, +.switch-original input { + position: absolute; + opacity: 0; + width: 0.0625rem; + height: 0.0625rem; +} +.switch .check, +.switch-original .check, +.switch .caption, +.switch-original .caption { + display: inline-block; + vertical-align: middle; + line-height: 18px; +} +.switch .check { + width: 36px; + height: 16px; + background-color: #929292; + border-radius: 8px; + overflow: visible; + position: relative; +} +.switch .check:before { + position: absolute; + display: block; + content: ""; + width: 22px; + height: 22px; + z-index: 2; + margin-top: -4px; + margin-left: -3px; + border-radius: 50%; + background-color: #ffffff; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35); +} +.switch input:checked ~ .check { + background-color: #008287; +} +.switch input:not(:checked) ~ .check:before { + background-color: #ffffff; + transition: all 0.2s linear; +} +.switch input:checked ~ .check { + background-color: #008287; +} +.switch input:checked ~ .check:before { + -webkit-transform: translateX(22px); + transform: translateX(22px); + transition: all 0.2s linear; +} +.switch input:disabled ~ .check { + background-color: #D5D5D5; +} +.switch input:disabled ~ .check:before { + background-color: #BDBDBD; +} +.switch-original .caption { + margin: 0 5px; +} +.switch-original .check { + position: relative; + height: 1.125rem; + width: 2.8125rem; + outline: 2px #a6a6a6 solid; + border: 1px #fff solid; + cursor: pointer; + background: #A6A6A6; + z-index: 1; + display: inline-block; + vertical-align: middle; +} +.switch-original .check:after { + position: absolute; + left: -1px; + top: -1px; + display: block; + content: ""; + height: 1rem; + width: .5625rem; + outline: 2px #333 solid; + border: 1px #333 solid; + cursor: pointer; + background: #333; + z-index: 2; + transition: all 0.2s linear; +} +.switch-original input[type="checkbox"]:focus ~ .check { + outline: 1px #999999 dotted !important; +} +.switch-original input[type="checkbox"]:checked ~ .check { + background: #008287; +} +.switch-original input[type="checkbox"]:checked ~ .check:after { + left: auto; + -webkit-transform: translateX(2rem); + transform: translateX(2rem); + transition: all 0.2s linear; +} +.switch-original input[type="checkbox"]:disabled ~ .check { + background-color: #e6e6e6; + border-color: #ffffff; +} +.switch-original input[type="checkbox"]:disabled ~ .check:after { + background-color: #8a8a8a; + outline-color: #8a8a8a; + border-color: #8a8a8a; +} +.progress, +.progress-bar { + display: block; + position: relative; + width: 100%; + height: auto; + margin: .625rem 0; + background: #eeeeee; + overflow: hidden; +} +.progress:before, +.progress-bar:before, +.progress:after, +.progress-bar:after { + display: table; + content: ""; +} +.progress:after, +.progress-bar:after { + clear: both; +} +.progress .bar, +.progress-bar .bar { + position: relative; + display: block; + float: left; + width: 0; + background-color: #1ba1e2; + z-index: 1; + text-align: center; + height: .625rem; + line-height: .625rem; + color: #ffffff; +} +.progress.small > .bar, +.progress-bar.small > .bar { + height: .3125rem; +} +.progress.large > .bar, +.progress-bar.large > .bar { + height: 1rem; +} +.progress.gradient-bar .bar, +.progress-bar.gradient-bar .bar { + background: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55); +} +.popover { + display: block; + min-width: 12.5rem; + height: auto; + position: relative; + background-color: #eeeeee; + padding: 1.25rem; +} +.popover * { + color: inherit; +} +.popover.popover-shadow { + box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.4); +} +.popover:before { + content: ""; + width: .625rem; + height: .625rem; + display: block; + position: absolute; + background-color: inherit; + left: -0.3125rem; + top: 50%; + margin-top: -0.3125rem; + -webkit-transform: rotate(45deg); + transform: rotate(45deg); +} +.popover.marker-on-top:before { + top: 0; + left: 50%; + margin-left: -0.3125rem; +} +.popover.marker-on-right:before { + top: 50%; + margin-top: -0.3125rem; + left: 100%; + margin-left: -0.3125rem; +} +.popover.marker-on-bottom:before { + top: 100%; + margin-left: -0.3125rem; + left: 50%; + margin-top: -0.3125rem; +} +.overlay { + position: fixed; + left: 0; + top: 0; + right: 0; + bottom: 0; + background-color: rgba(255, 255, 255, 0.5); + z-index: 1049; +} +.overlay.transparent { + background-color: rgba(255, 255, 255, 0); +} +.window { + display: block; + position: relative; + height: auto; + width: 100%; + background-color: #ffffff; + box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3); +} +.window-caption { + position: relative; + background-color: #ffffff; + padding: .4375rem .3125rem; + border-bottom: 1px #e9e9e9 solid; + border-top: 0; + cursor: default; +} +.window-caption .window-caption-title { + font-size: .875rem; + font-style: normal; + font-weight: 700; +} +.window-caption .window-caption-icon { + margin-left: .3125rem; +} +.window-caption .window-caption-icon * { + height: 1rem; + width: 1rem; +} +.window-caption .window-caption-icon ~ .window-caption-title { + padding-left: .3125rem; +} +.window-caption .btn-close, +.window-caption .btn-min, +.window-caption .btn-max { + position: absolute; + height: 1.5rem; + min-height: 1.5rem; + text-align: center; + vertical-align: middle; + font-size: 1rem; + font-weight: normal; + padding: 0 0 .625rem 0; + z-index: 3; + outline: none; + cursor: pointer; + background-color: #ffffff; + color: #777777; + width: 1.5rem; + top: .25rem; + right: .25rem; +} +.window-caption .btn-close:hover, +.window-caption .btn-min:hover, +.window-caption .btn-max:hover { + background-color: #cde6f7; + color: #2a8dd4; +} +.window-caption .btn-close:hover:after, +.window-caption .btn-min:hover:after, +.window-caption .btn-max:hover:after { + border-color: #2a8dd4; +} +.window-caption .btn-close:active, +.window-caption .btn-min:active, +.window-caption .btn-max:active { + background-color: #92c0e0 !important; + color: #ffffff !important; +} +.window-caption .btn-close:after, +.window-caption .btn-min:after, +.window-caption .btn-max:after { + border-color: #777777; + width: .625rem !important; + height: .375rem !important; + content: '\D7'; + position: absolute; + left: 50%; + top: -2px; + margin-left: -0.25em; +} +.window-caption .btn-min:after, +.window-caption .btn-max:after { + display: block; + position: absolute; + width: .625rem; + height: .625rem; + border: 0 #000 solid; + border-bottom-width: 2px; + content: ' '; + bottom: .375rem; + left: 50%; + margin-left: -0.375rem; + top: auto; +} +.window-caption .btn-max:after { + height: .375rem; + border: 1px #000 solid; + border-top-width: 2px; +} +.window-caption .btn-max { + right: 1.8125rem; +} +.window-caption .btn-min { + right: 3.375rem; +} +.window-caption .btn-close:after { + margin-top: .1875rem; + margin-left: -0.3125rem; +} +.window-content { + position: relative; + width: 100%; + height: auto; + display: block; + padding: .25rem; +} +.window.success { + box-shadow: 0 0 25px 0 rgba(0, 128, 0, 0.7); +} +.window.success .window-caption { + background-color: #60a917; + color: #ffffff; +} +.window.error { + box-shadow: 0 0 25px 0 rgba(128, 0, 0, 0.7); +} +.window.error .window-caption { + background-color: #ce352c; + color: #ffffff; +} +.window.warning { + box-shadow: 0 0 25px 0 rgba(255, 165, 0, 0.7); +} +.window.warning .window-caption { + background-color: #fa6800; + color: #ffffff; +} +.simple-list, +.numeric-list { + list-style: none; + counter-reset: li; + padding-left: 0; + margin-left: .625rem; +} +.simple-list li ul, +.numeric-list li ul, +.simple-list li ol, +.numeric-list li ol { + list-style: none; + padding-left: 1.5625rem; +} +.simple-list li, +.numeric-list li { + position: relative; + padding: 4px 12px; + list-style: none; + color: #262626; +} +.simple-list li:before, +.numeric-list li:before { + position: absolute; + top: 50%; + margin-top: -0.8rem; + left: -10px; + color: #59cde2; + font-size: 2rem; + vertical-align: middle; +} +.simple-list ul, +.numeric-list ul { + margin: 4px .5em 0; +} +.simple-list > li:before { + content: "\2022"; +} +.simple-list > ul li:before { + content: "\00B7"; +} +.numeric-list > li { + padding: 4px 12px 4px 18px; +} +.numeric-list > li:before { + content: counter(li); + counter-increment: li; + font-size: .8rem !important; + color: #ffffff; + background-color: #59cde2; + width: 1.25rem; + height: 1.25rem; + border-radius: 50%; + text-align: center; + margin-top: -0.65rem; +} +.numeric-list.square-marker > li:before { + border-radius: 0; +} +.step-list { + margin: 0 0 0 2rem; + padding: 0; + list-style-type: none; + counter-reset: li; +} +.step-list > li { + border-left: 1px #ccc solid; + position: relative; + padding: 0 .625rem; + margin: .625rem; + vertical-align: top; +} +.step-list > li:before { + position: absolute; + content: counter(li); + counter-increment: li; + font-size: 2rem; + color: #999999; + left: 0; + top: .3125rem; + margin-left: -1.5rem; +} +.image-container { + display: inline-block; + position: relative; + vertical-align: middle; + max-width: 100%; + background-color: transparent; +} +.image-container .frame { + background-color: #ffffff; + position: relative; + width: 100%; + height: 100%; +} +.image-container img { + display: block; + width: 100%; + height: 100%; +} +.image-container .image-overlay { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + opacity: 0; + overflow: hidden; + font-size: .875rem; + line-height: 1rem; + padding: 1em 1.5em; + background-color: rgba(27, 161, 226, 0.7); + color: #ffffff; + text-align: center; + border-radius: inherit; + transition: all 0.65s ease; +} +.image-container .image-overlay:hover { + opacity: 1; +} +.image-container .image-overlay:hover:before, +.image-container .image-overlay:hover:after { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); +} +.image-container .image-overlay:before, +.image-container .image-overlay:after { + display: block; + position: absolute; + content: ""; + border: 1px solid rgba(255, 255, 255, 0.7); + top: 1em; + bottom: 1em; + left: 1em; + right: 1em; + opacity: 0; + border-radius: inherit; + -webkit-transform: scale(1.5); + transform: scale(1.5); + transition: all 0.65s ease; +} +.image-container .image-overlay:after { + border-left: none; + border-right: none; + bottom: 1em; + top: 1em; +} +.image-container .image-overlay:before { + border-top: none; + border-bottom: none; + bottom: 1em; + top: 1em; +} +.image-container.diamond { + overflow: hidden; +} +.image-container.diamond .frame { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + overflow: hidden; +} +.image-container.diamond .frame img, +.image-container.diamond .frame .image-replacer { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); +} +.image-container.rounded img { + border-radius: 0.3125rem; +} +.image-container.bordered .frame { + border: 1px #eeeeee solid; + padding: .5rem; +} +.image-container.polaroid .frame { + border: 1px #eeeeee solid; + padding: .5rem .5rem 2rem; +} +.image-container.handing { + margin-top: 20px; +} +.image-container.handing .frame { + border: 1px #eeeeee solid; + position: relative; + padding: .5rem; +} +.image-container.handing .frame:after { + content: ""; + position: absolute; + width: .625rem; + height: .625rem; + background-color: #647687; + border-radius: 50%; + top: -20%; + left: 50%; + margin-left: -0.3125rem; + z-index: 3; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35); +} +.image-container.handing.image-format-hd .frame:after { + top: -25%; +} +.image-container.handing.image-format-square .frame:after { + top: -15%; +} +.image-container.handing:after { + position: absolute; + content: ""; + background-color: transparent; + border-top: 1px solid #eeeeee; + -webkit-transform: rotate(-16deg); + transform: rotate(-16deg); + z-index: 2; + top: 0; + left: 0; + width: 50%; + height: 50%; + -webkit-transform-origin: top left; + transform-origin: top left; +} +.image-container.handing:before { + position: absolute; + content: ""; + background-color: transparent; + border-top: 1px solid #eeeeee; + -webkit-transform: rotate(16deg); + transform: rotate(16deg); + z-index: 2; + top: 0; + right: 0; + width: 50%; + height: 50%; + -webkit-transform-origin: top right; + transform-origin: top right; +} +.image-container.handing.ani { + -webkit-transform-origin: 50% -25px; + transform-origin: 50% -25px; + -webkit-animation: swinging 10s ease-in-out 0s infinite; + animation: swinging 10s ease-in-out 0s infinite; +} +.image-container.handing.ani-hover:hover { + -webkit-transform-origin: 50% -25px; + transform-origin: 50% -25px; + -webkit-animation: swinging 5s ease-in-out 0s; + animation: swinging 5s ease-in-out 0s; +} +@-webkit-keyframes swinging { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 5% { + -webkit-transform: rotate(10deg); + transform: rotate(10deg); + } + 10% { + -webkit-transform: rotate(-9deg); + transform: rotate(-9deg); + } + 15% { + -webkit-transform: rotate(8deg); + transform: rotate(8deg); + } + 20% { + -webkit-transform: rotate(-7deg); + transform: rotate(-7deg); + } + 25% { + -webkit-transform: rotate(6deg); + transform: rotate(6deg); + } + 30% { + -webkit-transform: rotate(-5deg); + transform: rotate(-5deg); + } + 35% { + -webkit-transform: rotate(4deg); + transform: rotate(4deg); + } + 40% { + -webkit-transform: rotate(-3deg); + transform: rotate(-3deg); + } + 45% { + -webkit-transform: rotate(2deg); + transform: rotate(2deg); + } + 50% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } +} +@keyframes swinging { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 5% { + -webkit-transform: rotate(10deg); + transform: rotate(10deg); + } + 10% { + -webkit-transform: rotate(-9deg); + transform: rotate(-9deg); + } + 15% { + -webkit-transform: rotate(8deg); + transform: rotate(8deg); + } + 20% { + -webkit-transform: rotate(-7deg); + transform: rotate(-7deg); + } + 25% { + -webkit-transform: rotate(6deg); + transform: rotate(6deg); + } + 30% { + -webkit-transform: rotate(-5deg); + transform: rotate(-5deg); + } + 35% { + -webkit-transform: rotate(4deg); + transform: rotate(4deg); + } + 40% { + -webkit-transform: rotate(-3deg); + transform: rotate(-3deg); + } + 45% { + -webkit-transform: rotate(2deg); + transform: rotate(2deg); + } + 50% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } +} +@-webkit-keyframes scaleout { + 0% { + -webkit-transform: scale(0); + transform: scale(0); + } + 100% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 0; + } +} +@keyframes scaleout { + 0% { + -webkit-transform: scale(0); + transform: scale(0); + } + 100% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 0; + } +} +@-webkit-keyframes cubemove { + 25% { + -webkit-transform: translateX(10px) rotate(-90deg); + transform: translateX(10px) rotate(-90deg); + } + 50% { + -webkit-transform: translateX(10px) translateY(10px) rotate(-179deg); + transform: translateX(10px) translateY(10px) rotate(-179deg); + } + 50.1% { + -webkit-transform: translateX(10px) translateY(10px) rotate(-180deg); + transform: translateX(10px) translateY(10px) rotate(-180deg); + } + 75% { + -webkit-transform: translateX(0px) translateY(10px) rotate(-270deg); + transform: translateX(0px) translateY(10px) rotate(-270deg); + } + 100% { + -webkit-transform: rotate(-360deg); + transform: rotate(-360deg); + } +} +@keyframes cubemove { + 25% { + -webkit-transform: translateX(10px) rotate(-90deg); + transform: translateX(10px) rotate(-90deg); + } + 50% { + -webkit-transform: translateX(10px) translateY(10px) rotate(-179deg); + transform: translateX(10px) translateY(10px) rotate(-179deg); + } + 50.1% { + -webkit-transform: translateX(10px) translateY(10px) rotate(-180deg); + transform: translateX(10px) translateY(10px) rotate(-180deg); + } + 75% { + -webkit-transform: translateX(0px) translateY(10px) rotate(-270deg); + transform: translateX(0px) translateY(10px) rotate(-270deg); + } + 100% { + -webkit-transform: rotate(-360deg); + transform: rotate(-360deg); + } +} +@-webkit-keyframes orbit { + 0% { + opacity: 1; + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + -webkit-transform: rotate(225deg); + transform: rotate(225deg); + } + 7% { + -webkit-transform: rotate(345deg); + transform: rotate(345deg); + -webkit-animation-timing-function: linear; + animation-timing-function: linear; + } + 35% { + -webkit-transform: rotate(495deg); + transform: rotate(495deg); + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + } + 42% { + -webkit-transform: rotate(690deg); + transform: rotate(690deg); + -webkit-animation-timing-function: linear; + animation-timing-function: linear; + } + 70% { + opacity: 1; + -webkit-transform: rotate(835deg); + transform: rotate(835deg); + -webkit-animation-timing-function: linear; + animation-timing-function: linear; + } + 76% { + opacity: 1; + } + 77% { + -webkit-transform: rotate(955deg); + transform: rotate(955deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + 78% { + -webkit-transform: rotate(955deg); + transform: rotate(955deg); + opacity: 0; + } + 100% { + -webkit-transform: rotate(955deg); + transform: rotate(955deg); + opacity: 0; + } +} +@keyframes orbit { + 0% { + opacity: 1; + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + -webkit-transform: rotate(225deg); + transform: rotate(225deg); + } + 7% { + -webkit-transform: rotate(345deg); + transform: rotate(345deg); + -webkit-animation-timing-function: linear; + animation-timing-function: linear; + } + 35% { + -webkit-transform: rotate(495deg); + transform: rotate(495deg); + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + } + 42% { + -webkit-transform: rotate(690deg); + transform: rotate(690deg); + -webkit-animation-timing-function: linear; + animation-timing-function: linear; + } + 70% { + opacity: 1; + -webkit-transform: rotate(835deg); + transform: rotate(835deg); + -webkit-animation-timing-function: linear; + animation-timing-function: linear; + } + 76% { + opacity: 1; + } + 77% { + -webkit-transform: rotate(955deg); + transform: rotate(955deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + 78% { + -webkit-transform: rotate(955deg); + transform: rotate(955deg); + opacity: 0; + } + 100% { + -webkit-transform: rotate(955deg); + transform: rotate(955deg); + opacity: 0; + } +} +@-webkit-keyframes metro-slide { + 0% { + left: -50%; + } + 100% { + left: 150%; + } +} +@keyframes metro-slide { + 0% { + left: -50%; + } + 100% { + left: 150%; + } +} +@-webkit-keyframes metro-opacity { + 0% { + opacity: 0; + } + 50% { + opacity: .5; + } + 100% { + opacity: 1; + } +} +@keyframes metro-opacity { + 0% { + opacity: 0; + } + 50% { + opacity: .5; + } + 100% { + opacity: 1; + } +} +.calendar { + min-width: 15.625rem; + border: 1px #eeeeee solid; + font-size: .75rem; + padding: .3125rem; + background-color: #ffffff; +} +.calendar .calendar-grid { + margin: 0; + padding: 0; +} +.calendar .calendar-row { + margin: 0 0 .3125rem; + width: 100%; +} +.calendar .calendar-row:before, +.calendar .calendar-row:after { + display: table; + content: ""; +} +.calendar .calendar-row:after { + clear: both; +} +.calendar .calendar-row:last-child { + margin-bottom: 0; +} +.calendar .calendar-cell { + width: 12.46201429%; + margin: 0 0 0 2.12765%; + display: block; + float: left; +} +.calendar .calendar-cell:first-child { + margin-left: 0; +} +.calendar .calendar-cell.sel-month { + width: 41.64134286%; +} +.calendar .calendar-cell.sel-year { + width: 48.936175%; +} +.calendar .calendar-cell.sel-plus, +.calendar .calendar-cell.sel-minus { + width: 23.4042625%; +} +.calendar .calendar-cell.month-cell, +.calendar .calendar-cell.year-cell { + width: 23.4042625%; +} +.calendar .calendar-actions .button { + margin: .15625rem; +} +.calendar .day-of-week { + padding: .3125rem; + cursor: default; +} +.calendar a { + display: block; + padding: .3125rem; +} +.calendar a:hover { + background-color: #75c7ee; + color: #ffffff; + border-radius: inherit; +} +.calendar .calendar-header { + background-color: #59cde2; + color: #ffffff; +} +.calendar .calendar-header a { + color: #ffffff; + padding: .325rem; +} +.calendar .calendar-header a:hover { + background-color: #47b4e9; + color: #ffffff; +} +.calendar .calendar-actions:before, +.calendar .calendar-actions:after { + display: table; + content: ""; +} +.calendar .calendar-actions:after { + clear: both; +} +.calendar .today a { + background-color: #60a917; + color: #ffffff; + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); +} +.calendar .day { + border: 1px #bcd9e2 solid; +} +.calendar .day a { + display: block; + position: relative; +} +.calendar .month, +.calendar .year { + border: 1px #bcd9e2 solid; +} +.calendar .month a, +.calendar .year a { + padding-top: 1.3125rem; + padding-bottom: 1.3125rem; +} +.calendar .empty { + cursor: default; +} +.calendar .other-day { + display: block; + text-align: center; + color: #999999; + padding: .325rem; + background-color: #eeeeee; + border: 1px #bcd9e2 solid; +} +.calendar .selected { + background-color: #59cde2; +} +.calendar .selected a { + background-color: #59cde2; + color: #ffffff; +} +.calendar .exclude { + background-color: #ce352c; +} +.calendar .exclude a { + cursor: not-allowed; + background-color: #ce352c; + color: #ffffff; +} +.calendar.rounded button { + border-radius: 0.3125rem; +} +.calendar.rounded .day, +.calendar.rounded .month, +.calendar.rounded .year, +.calendar.rounded .other-day, +.calendar.rounded .today, +.calendar.rounded .calendar-header, +.calendar.rounded .selected { + border-radius: 0.3125rem; +} +.calendar.rounded .today a, +.calendar.rounded .selected a, +.calendar.rounded .exclude a { + border-radius: 0.3125rem; +} +.calendar.rounded .calendar-header a:hover { + border-radius: 0.3125rem; +} +.calendar.no-border .day, +.calendar.no-border .month, +.calendar.no-border .year, +.calendar.no-border .other-day, +.calendar.no-border .today, +.calendar.no-border .calendar-header { + border: 0; +} +.calendar.no-border .today a { + border: 0; +} +.calendar-dropdown { + border: 0; + box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3); +} +.tabcontrol { + overflow: hidden; + position: relative; + width: 100%; +} +.tabcontrol .tabs { + width: 100%; + margin: 0; + padding: 0; + list-style: none inside; + border-bottom: 2px #1ba1e2 solid; + white-space: nowrap; + overflow: visible; +} +.tabcontrol .tabs:before, +.tabcontrol .tabs:after { + display: table; + content: ""; +} +.tabcontrol .tabs:after { + clear: both; +} +.tabcontrol .tabs li { + display: inline-block; + margin: 0 0 -4px -4px; + position: relative; + white-space: nowrap; +} +.tabcontrol .tabs li a { + display: block; + float: left; + padding: 8px 24px; + color: #1d1d1d; + font-size: .6875rem; + font-weight: bold; + text-transform: uppercase; + position: relative; + white-space: nowrap; +} +.tabcontrol .tabs li:hover a { + background-color: #eeeeee; +} +.tabcontrol .tabs li.active a { + background-color: #1ba1e2; + color: #ffffff; + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); +} +.tabcontrol .tabs li.disabled a { + background: #eeeeee linear-gradient(-45deg, rgba(0, 0, 0, 0.15) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.15) 50%, rgba(0, 0, 0, 0.15) 75%, transparent 75%, transparent) !important; + background-size: 40px 40px !important; + color: #999999 !important; + cursor: default; +} +.tabcontrol .tabs li.non-visible-tabs { + display: block; + float: right; +} +.tabcontrol .tabs li.non-visible-tabs:empty { + display: none; +} +.tabcontrol .tabs li.non-visible-tabs.dropdown-toggle { + height: 100% !important; +} +.tabcontrol.tabs-bottom .tabs { + border-bottom: none; + border-top: 2px #1ba1e2 solid; +} +.tabcontrol .frames { + width: 100%; + overflow: hidden; + position: relative; +} +.tabcontrol .frames .frame { + display: block; + position: relative; + width: 100%; + padding: 20px; + background-color: #999999; +} +.tabcontrol2 { + overflow: hidden; + position: relative; + width: 100%; +} +.tabcontrol2 .tabs { + width: 100%; + margin: 0; + padding: 0; + list-style: none inside; + border-bottom: 2px #1ba1e2 solid; + white-space: nowrap; + overflow: visible; +} +.tabcontrol2 .tabs:before, +.tabcontrol2 .tabs:after { + display: table; + content: ""; +} +.tabcontrol2 .tabs:after { + clear: both; +} +.tabcontrol2 .tabs li { + display: block; + float: left; + position: relative; + white-space: nowrap; +} +.tabcontrol2 .tabs li a { + display: block; + float: left; + padding: 8px 24px; + color: #1d1d1d; + font-size: .6875rem; + font-weight: bold; + text-transform: uppercase; + position: relative; + white-space: nowrap; +} +.tabcontrol2 .tabs li:hover a { + background-color: #eeeeee; +} +.tabcontrol2 .tabs li.active a { + background-color: #1ba1e2; + color: #ffffff; + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); +} +.tabcontrol2 .tabs li.disabled a { + background: #eeeeee linear-gradient(-45deg, rgba(0, 0, 0, 0.15) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.15) 50%, rgba(0, 0, 0, 0.15) 75%, transparent 75%, transparent) !important; + background-size: 40px 40px !important; + color: #999999 !important; + cursor: default; +} +.tabcontrol2 .tabs li.non-visible-tabs { + display: block; + float: right; +} +.tabcontrol2 .tabs li.non-visible-tabs:empty { + display: none; +} +.tabcontrol2 .tabs li.non-visible-tabs.dropdown-toggle { + height: 100% !important; +} +.tabcontrol2.tabs-bottom .tabs { + border-bottom: none; + border-top: 2px #1ba1e2 solid; +} +.tabcontrol2 .frames { + width: 100%; + overflow: hidden; + position: relative; +} +.tabcontrol2 .frames .frame { + display: block; + position: relative; + width: 100%; + padding: 20px; + background-color: #999999; +} +.tabcontrol2 .tabs { + border-bottom: 0; + vertical-align: bottom; + z-index: 2; +} +.tabcontrol2 .tabs li { + padding-top: 2px; + overflow: visible; + margin: 0 2px; +} +.tabcontrol2 .tabs li:after { + content: ""; + position: absolute; + left: 0; + top: 100%; + width: 100%; + background-color: #ffffff; + height: 2px; + z-index: 3; +} +.tabcontrol2 .tabs li:not(.active):after { + background-color: #eeeeee; + height: 1px; +} +.tabcontrol2 .tabs li:first-child { + margin-left: 10px; +} +.tabcontrol2 .tabs li a { + background-color: #eeeeee; + padding-top: .3125rem; + text-shadow: none !important; +} +.tabcontrol2 .tabs li.active { + padding-top: 0; + padding-bottom: 0; +} +.tabcontrol2 .tabs li.active a { + background-color: #ffffff; + border: 1px #eeeeee solid; + border-top: 2px #ce352c solid; + border-bottom: 0; + color: #1ba1e2; +} +.tabcontrol2 .tabs li.active:hover a { + background-color: inherit; +} +.tabcontrol2 .tabs li:hover a { + background-color: #e1e1e1; +} +.tabcontrol2.tabs-bottom .tabs { + border-top: 0; +} +.tabcontrol2.tabs-bottom .tabs li { + padding: 0; +} +.tabcontrol2.tabs-bottom .tabs li:after { + top: 0 !important; + background-color: #ffffff; + margin-top: -2px; +} +.tabcontrol2.tabs-bottom .tabs li.active { + padding-bottom: 0; +} +.tabcontrol2.tabs-bottom .tabs li.active a { + border: 1px #eeeeee solid; + border-bottom: 2px #ce352c solid; + border-top: 0; +} +.tabcontrol2.tabs-bottom .tabs li:not(.active) { + margin-bottom: 0; +} +.tabcontrol2.tabs-bottom .tabs li:not(.active):after { + background-color: #eeeeee; +} +.tabcontrol2 .frames { + z-index: 1; + border: 1px #eeeeee solid; +} +.tabcontrol2 .frames .frame { + background-color: #ffffff; +} + +.rating { + cursor: pointer; + display: inline-block; +} +.rating:before, +.rating:after { + display: table; + content: ""; +} +.rating:after { + clear: both; +} +.rating .star { + cursor: pointer; + display: block; + float: left; + color: #555555; + font-size: 20px; + z-index: 1; + position: relative; + width: 20px; + height: 24px; + vertical-align: middle; + line-height: 22px; +} +.rating .star:before, +.rating .star:after { + position: absolute; + content: '\2605'; + display: block; + z-index: 2; + top: 0 !important; + left: 0; + vertical-align: middle; +} +.rating .star.on { + color: gold; +} +.rating .star.on.half { + color: #555555; +} +.rating .star.on.half:after { + color: gold; +} +.rating .star.half:after { + z-index: 3; + width: 8px; + overflow: hidden; +} +.rating:not(.static):hover > .star, +.rating:not(.static):hover > .star:after { + color: gold !important; +} +.rating:not(.static) .star:hover ~ .star, +.rating:not(.static) .star:hover ~ .star:after { + color: gray !important; +} +.rating:not(.static) .star:hover { + color: gold !important; +} +.rating.poor .star.on { + color: #ce352c; +} +.rating.poor .star.on.half { + color: #555555; +} +.rating.poor .star.on.half:after { + color: #ce352c; +} +.rating.regular .star.on { + color: gold; +} +.rating.regular .star.on.half { + color: #555555; +} +.rating.regular .star.on.half:after { + color: gold; +} +.rating.good .star.on { + color: #60a917; +} +.rating.good .star.on.half { + color: #555555; +} +.rating.good .star.on.half:after { + color: #60a917; +} +.rating.small .star { + width: 14px; + height: 16px; + font-size: 14px; + line-height: 14px; +} +.rating.small .star.half:after { + width: 6px; +} +.rating.large .star { + width: 28px; + height: 30px; + font-size: 32px; + line-height: 24px; +} +.rating.large .star.half:after { + width: 13px; +} +.rating .score { + display: block; + font-size: .8rem; +} +.rating.small .score { + font-size: .6rem; +} +.rating.large .score { + font-size: 1rem; +} +.slider { + height: 12px; + width: auto; + position: relative; + background-color: #999999; + margin-bottom: 10px; +} +.slider .marker { + height: 12px; + width: 12px; + cursor: pointer; + position: absolute; + top: 0; + left: 0; + background-color: #1d1d1d; + z-index: 2; +} +.slider .marker:focus, +.slider .marker:active, +.slider .markerhover { + outline: 2px #ce352c solid; +} +.slider .complete { + height: 100%; + width: auto; + background-color: #00aba9; + z-index: 1; + transition: background .3s ease; +} +.slider > .slider-hint { + background-color: #ffffff; + position: absolute; + z-index: 3; + border: 1px #ccc solid; + padding: 2px 4px; + top: -40px; + min-width: 30px; + text-align: center; + font-size: 14px; + display: none; + box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3); +} +.slider > .slider-hint:before { + display: none; +} +.slider.permanent-hint > .slider-hint { + display: block; +} +.slider.hint-bottom .slider-hint { + top: 100%; + margin-top: 5px; +} +.slider.vertical { + height: 100px; + width: 12px; + float: left; + margin-right: 10px; +} +.slider.vertical:last-child:first-child { + margin-left: 0; +} +.slider.vertical .marker { + left: 0 !important; +} +.slider.vertical .complete { + position: absolute; + height: auto; + width: 100% !important; + bottom: 0; + left: 0; +} +.slider.vertical .slider-hint { + left: 100%; + margin-left: 5px; + margin-top: 0; +} +.slider.vertical.hint-left .slider-hint { + left: -40px; +} +.slider:hover .complete { + background-color: #45fffd; +} +.slider:active .complete, +.slider:active + .marker:active .complete { + background-color: #45fffd; +} +.slider.place-left { + margin-right: 20px; +} +.slider.place-right { + margin-left: 20px; +} +.slider.large { + height: 24px; +} +.slider.large .marker { + width: 24px; + height: 24px; +} +.slider.large .slider-hint { + min-width: 30px; +} +.slider.large.vertical { + width: 24px; + height: 100px; +} + +.charm { + display: block; + position: fixed; + z-index: 1060; + background: #1d1d1d; + color: #eeeeee; +} +.charm.right-side { + width: auto; + right: 0; + top: 0; + bottom: 0; +} +.charm.left-side { + width: auto; + left: 0; + top: 0; + bottom: 0; +} +.charm.top-side { + height: auto; + left: 0; + right: 0; + top: 0; +} +.charm.top-side { + height: auto; + left: 0; + right: 0; + bottom: 0; +} +.notify-container { + position: fixed; + top: 0; + right: 0; + width: auto; + z-index: 1061; +} +.notify-container:before, +.notify-container:after { + display: table; + content: ""; +} +.notify-container:after { + clear: both; +} +.notify-container.position-left { + left: 0; + right: auto; +} +.notify-container.position-top { + left: 0; + right: 0; + top: 0; + height: auto; +} +.notify-container.position-top .notify { + float: left; +} +.notify-container.position-bottom { + left: 0; + right: 0; + bottom: 0; + top: auto; + height: auto; +} +.notify-container.position-bottom .notify { + float: left; +} +.notify { + display: block; + margin: .3125rem; + padding: .625rem; + min-width: 200px; + cursor: default; + max-width: 300px; +} +.notify .notify-icon { + width: 32px; + height: 32px; + font-size: 32px; + text-align: center; + position: absolute; + margin: -16px 10px; + top: 50%; + left: 0; +} +.notify .notify-icon ~ .notify-title, +.notify .notify-icon ~ .notify-text { + position: relative; + margin-left: 42px; +} +.notify .notify-title, +.notify .notify-text { + display: block; + margin-right: 20px; +} +.notify .notify-title { + font-weight: 500; + font-size: 1rem; +} +.notify .notify-text { + font-size: .875rem; +} +.notify .notify-closer { + position: absolute; + height: 1rem; + width: 1rem; + text-align: center; + vertical-align: middle; + font-size: 1rem; + font-weight: normal; + padding: 0 0 .625rem 0; + z-index: 3; + outline: none; + cursor: pointer; + background-color: #ffffff; + color: #777777; + top: .25rem; + right: .25rem; +} +.notify .notify-closer:after { + border-color: #777777; + content: '\D7'; + position: absolute; + left: 50%; + top: 50%; + margin-top: -0.65rem; + margin-left: -0.35rem; +} +.notify .notify-closer:hover { + background-color: #cde6f7; + color: #ffffff; +} +.notify .notify-closer:active { + background-color: #92c0e0; + color: #ffffff; +} +.notify { + background-color: #e5f3fb; + color: #1d1d1d; +} +.notify.success { + background-color: #60a917; + color: #ffffff; +} +.notify.success .notify-closer { + background-color: #60a917; + color: #ffffff; +} +.notify.success .notify-closer:hover { + background-color: #7ad61d; +} +.notify.success .notify-closer:active { + background-color: #128023; +} +.notify.alert { + background-color: #ce352c; + color: #ffffff; +} +.notify.alert .notify-closer { + background-color: #ce352c; + color: #ffffff; +} +.notify.alert .notify-closer:hover { + background-color: #da5a53; +} +.notify.alert .notify-closer:active { + background-color: #9a1616; +} +.notify.warning { + background-color: #fa6800; + color: #ffffff; +} +.notify.warning .notify-closer { + background-color: #fa6800; + color: #ffffff; +} +.notify.warning .notify-closer:hover { + background-color: #c29008; +} +.notify.warning .notify-closer:active { + background-color: #bf5a15; +} +.notify.info { + background-color: #1ba1e2; + color: #ffffff; +} +.notify.info .notify-closer { + background-color: #1ba1e2; + color: #ffffff; +} +.notify.info .notify-closer:hover { + background-color: #59cde2; +} +.notify.info .notify-closer:active { + background-color: #1b6eae; +} +p [data-hint] { + border-bottom: 1px #373737 dotted; + white-space: nowrap; +} +.hint { + position: fixed; + color: #1d1d1d; + padding: 10px; + font-size: 12px; + width: auto; + max-width: 220px; + margin-top: 10px; + z-index: 1030; + display: none; + border: 1px #eee solid; +} +.hint .hint-title, +.hint .hint-text { + color: inherit; + text-align: left; +} +.hint .hint-title { + font-size: 1.2em; + font-weight: bold; +} +.hint:before { + content: ''; + position: absolute; + background-color: inherit; + width: 10px; + height: 10px; + border: 1px #eee solid; + -webkit-transform: rotate(45deg); + transform: rotate(45deg); +} +.hint:before { + z-index: 2; +} +.hint.bottom:before { + top: 1px; + left: 5px; + margin: -7px 0; + border-bottom: none; + border-right: none; +} +.hint.top:before { + top: 100%; + margin-top: -5px; + left: 5px; + border-top: none; + border-left: none; +} +.hint.left:before { + top: 5px; + left: 100%; + margin-left: -5px; + border-bottom: none; + border-left: none; +} +.hint.right:before { + top: 5px; + left: -9px; + margin: 1px 0 0 3px; + border-top: none; + border-right: none; +} +.hint2 { + position: fixed; + color: #1d1d1d; + padding: 10px; + font-size: 12px; + width: auto; + max-width: 220px; + margin-top: 10px; + z-index: 1030; + display: none; + border: 1px #eee solid; +} +.hint2 .hint-title, +.hint2 .hint-text { + color: inherit; + text-align: left; +} +.hint2 .hint-title { + font-size: 1.2em; + font-weight: bold; +} +.hint2:before { + content: ''; + position: absolute; + background-color: inherit; + width: 10px; + height: 10px; + border: 1px #eee solid; + -webkit-transform: rotate(45deg); + transform: rotate(45deg); +} +.hint2:before { + z-index: 2; +} +.hint2.bottom:before { + top: 1px; + left: 5px; + margin: -7px 0; + border-bottom: none; + border-right: none; +} +.hint2.top:before { + top: 100%; + margin-top: -5px; + left: 5px; + border-top: none; + border-left: none; +} +.hint2.left:before { + top: 5px; + left: 100%; + margin-left: -5px; + border-bottom: none; + border-left: none; +} +.hint2.right:before { + top: 5px; + left: -9px; + margin: 1px 0 0 3px; + border-top: none; + border-right: none; +} +.hint2.bottom:before { + top: 1px; + left: 50%; + margin: -7px 0 0 -5px; + border-bottom: none; + border-right: none; +} +.hint2.top:before { + top: 100%; + margin-top: -5px; + left: 50%; + margin-left: -5px; + border-top: none; + border-left: none; +} +.hint2.left:before { + top: 50%; + margin-top: -5px; + left: 100%; + margin-left: -5px; + border-bottom: none; + border-left: none; +} +.hint2.right:before { + top: 50%; + margin: -5px 0 0 3px; + left: -9px; + border-top: none; + border-right: none; +} +.preloader-ring { + position: relative; + padding-top: 0.22rem; + width: 32px; + height: 32px; + margin: .625rem; +} +.preloader-ring > .wrap { + position: absolute; + width: 30px; + height: 30px; +} +.preloader-ring > .wrap > .circle { + opacity: 0; + width: 30px; + height: 30px; + -webkit-transform: rotate(225deg); + transform: rotate(225deg); + -webkit-animation: orbit 4000ms infinite; + animation: orbit 4000ms infinite; +} +.preloader-ring > .wrap > .circle:after { + position: absolute; + content: ''; + width: 4px; + height: 4px; + border-radius: 4px; + background: #ffffff; +} +.preloader-ring > .wrap:nth-child(2) { + -webkit-transform: rotate(-14deg); + transform: rotate(-14deg); +} +.preloader-ring > .wrap:nth-child(2) > .circle { + -webkit-animation-delay: 133.33333333ms; + animation-delay: 133.33333333ms; +} +.preloader-ring > .wrap:nth-child(3) { + -webkit-transform: rotate(-28deg); + transform: rotate(-28deg); +} +.preloader-ring > .wrap:nth-child(3) > .circle { + -webkit-animation-delay: 266.66666667ms; + animation-delay: 266.66666667ms; +} +.preloader-ring > .wrap:nth-child(4) { + -webkit-transform: rotate(-42deg); + transform: rotate(-42deg); +} +.preloader-ring > .wrap:nth-child(4) > .circle { + -webkit-animation-delay: 400ms; + animation-delay: 400ms; +} +.preloader-ring > .wrap:nth-child(5) { + -webkit-transform: rotate(-56deg); + transform: rotate(-56deg); +} +.preloader-ring > .wrap:nth-child(5) > .circle { + -webkit-animation-delay: 533.33333333ms; + animation-delay: 533.33333333ms; +} +.preloader-ring.dark-style > .wrap > .circle:after { + background-color: #555555; +} +.preloader-metro { + width: 100%; + height: 10px; + background-color: transparent; + overflow: hidden; +} +.preloader-metro > .circle { + display: inline-block; + position: absolute; + width: 10px; + height: 10px; + background-color: #ffffff; + opacity: 0; + margin-left: 5px; + -webkit-animation: metro-slide 3s cubic-bezier(0.1, 0.85, 0.9, 0.15) infinite, metro-opacity 2s ease-in-out infinite alternate; + animation: metro-slide 3s cubic-bezier(0.1, 0.85, 0.9, 0.15) infinite, metro-opacity 2s ease-in-out infinite alternate; +} +.preloader-metro > .circle:nth-child(2) { + -webkit-animation-delay: .8s; + animation-delay: .8s; +} +.preloader-metro > .circle:nth-child(3) { + -webkit-animation-delay: .7s; + animation-delay: .7s; +} +.preloader-metro > .circle:nth-child(4) { + -webkit-animation-delay: .6s; + animation-delay: .6s; +} +.preloader-metro > .circle:nth-child(5) { + -webkit-animation-delay: .5s; + animation-delay: .5s; +} +.preloader-metro.dark-style > .circle { + background-color: #555555; +} +.dialog-overlay { + background-color: transparent; + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + min-height: 100%; + min-width: 100%; + z-index: 1049; +} +.dialog { + position: fixed; + display: block; + width: auto; + height: auto; + float: left; + background-color: #ffffff; + color: #1d1d1d; + z-index: 1050; + box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3); +} +.dialog .dialog-close-button { + position: absolute; + height: 1.5rem; + width: 1.5rem; + min-height: 1.5rem; + text-align: center; + vertical-align: middle; + font-size: 1rem; + font-weight: normal; + padding: .125rem 0 .625rem 0; + z-index: 3; + outline: none; + cursor: pointer; + background-color: #ffffff; + color: #777777; + top: .25rem; + right: .25rem; +} +.dialog .dialog-close-button:hover { + background-color: #cde6f7; + color: #2a8dd4; +} +.dialog .dialog-close-button:hover:after { + border-color: #2a8dd4; +} +.dialog .dialog-close-button:active { + background-color: #92c0e0; + color: #ffffff !important; +} +.dialog .dialog-close-button:after { + border-color: #777777; + content: '\D7'; + line-height: 1; +} +.dialog.success { + background: #60a917; + color: #ffffff; + border-color: #60a917; +} +.dialog.success:active { + background: #128023; + color: #ffffff; +} +.dialog.success .dialog-close-button { + background-color: #7ad61d; + color: #ffffff; +} +.dialog.success .dialog-close-button:active { + background-color: #128023; +} +.dialog.warning { + background: #fa6800; + color: #ffffff; + border-color: #fa6800; +} +.dialog.warning:active { + background: #bf5a15; + color: #ffffff; +} +.dialog.warning .dialog-close-button { + background-color: #c29008; + color: #ffffff; +} +.dialog.warning .dialog-close-button:active { + background-color: #bf5a15; +} +.dialog.alert { + background: #ce352c; + color: #ffffff; + border-color: #ce352c; +} +.dialog.alert:active { + background: #9a1616; + color: #ffffff; +} +.dialog.alert .dialog-close-button { + background-color: #da5a53; + color: #ffffff; +} +.dialog.alert .dialog-close-button:active { + background-color: #9a1616; +} +.dialog.info { + background: #59cde2; + color: #ffffff; + border-color: #59cde2; +} +.dialog.info:active { + background: #1ba1e2; + color: #ffffff; +} +.dialog.info .dialog-close-button { + background-color: #59cde2; + color: #ffffff; +} +.dialog.info .dialog-close-button:active { + background-color: #1b6eae; +} + +@media screen and (max-width: 640px) { + .no-phone { + display: none !important; + } +} +@media screen and (max-width: 800px) { + .no-tablet { + display: none !important; + } +} +@media screen and (min-width: 900px) { + .no-pc { + display: none !important; + } +} +/*docs*/ +body { + +} + +.page-content { + padding-top: 48px; +} + +.color-list li { + display: inline-block; + padding: 10px; + width: 14.2857%; +} + +.prettyprint { + background-color: #eeeeee; + border: 0 !important; + border-width: 1px !important; + border-color: #eeeeee !important; + border-left: 8px #555555 solid !important; +} + +.prettyprint ol { + background-color: transparent !important; +} + +.prettyprint li {background-color: white !important; list-style-type: decimal !important; padding-left: 1em; border-bottom: 1px #eee solid;} +.prettyprint li:last-child{border-bottom: 0;} +.prettyprint code .tag { + font-size: .7rem; +} + +.prettyprint { + overflow: hidden; + overflow-x: scroll; +} + +.demo-grid .row > .cell { + padding: 10px; + background-color: darkgray; + color: white; + text-align: center; + border: 1px #000 solid; +} + + +@media screen and (max-width: 800px) { + .app-bar.fixed-top { + position: relative !important; + } + .page-content { + padding-top: 0 !important; + } +} + +@media screen and (max-width: 640px) { + .page-content { + padding-top: 32px; + } +} +.op-dark { + background-color: rgba(51, 51, 51, 0.7) !important; +} +/*icons anim*/ + +.ani-spin, +.ani-hover-spin:hover { + -webkit-animation: ani-spin 1.5s linear infinite; + animation: ani-spin 1.5s linear infinite; +} + +.ani-spin.ani-slow, +.ani-hover-spin.ani-slow:hover { + -webkit-animation: ani-spin 2.2s linear infinite; + animation: ani-spin 2.2s linear infinite; +} +.ani-float, +.ani-hover-float:hover { + -webkit-animation: ani-float 2s linear infinite; + animation: ani-float 2s linear infinite; +} +.ani-float.ani-fast, +.ani-hover-float.ani-fast:hover { + -webkit-animation: ani-float 1s linear infinite; + animation: ani-float 1s linear infinite; +} +.ani-float.ani-slow, +.ani-hover-float.ani-slow:hover { + -webkit-animation: ani-float 3s linear infinite; + animation: ani-float 3s linear infinite; +} + +@-webkit-keyframes swinging { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 5% { + -webkit-transform: rotate(10deg); + transform: rotate(10deg); + } + 10% { + -webkit-transform: rotate(-9deg); + transform: rotate(-9deg); + } + 15% { + -webkit-transform: rotate(8deg); + transform: rotate(8deg); + } + 20% { + -webkit-transform: rotate(-7deg); + transform: rotate(-7deg); + } + 25% { + -webkit-transform: rotate(6deg); + transform: rotate(6deg); + } + 30% { + -webkit-transform: rotate(-5deg); + transform: rotate(-5deg); + } + 35% { + -webkit-transform: rotate(4deg); + transform: rotate(4deg); + } + 40% { + -webkit-transform: rotate(-3deg); + transform: rotate(-3deg); + } + 45% { + -webkit-transform: rotate(2deg); + transform: rotate(2deg); + } + 50% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } +} +@keyframes swinging { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 5% { + -webkit-transform: rotate(10deg); + transform: rotate(10deg); + } + 10% { + -webkit-transform: rotate(-9deg); + transform: rotate(-9deg); + } + 15% { + -webkit-transform: rotate(8deg); + transform: rotate(8deg); + } + 20% { + -webkit-transform: rotate(-7deg); + transform: rotate(-7deg); + } + 25% { + -webkit-transform: rotate(6deg); + transform: rotate(6deg); + } + 30% { + -webkit-transform: rotate(-5deg); + transform: rotate(-5deg); + } + 35% { + -webkit-transform: rotate(4deg); + transform: rotate(4deg); + } + 40% { + -webkit-transform: rotate(-3deg); + transform: rotate(-3deg); + } + 45% { + -webkit-transform: rotate(2deg); + transform: rotate(2deg); + } + 50% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } +} +@-webkit-keyframes scaleout { + 0% { + -webkit-transform: scale(0); + transform: scale(0); + } + 100% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 0; + } +} +@keyframes scaleout { + 0% { + -webkit-transform: scale(0); + transform: scale(0); + } + 100% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 0; + } +} +@-webkit-keyframes cubemove { + 25% { + -webkit-transform: translateX(10px) rotate(-90deg); + transform: translateX(10px) rotate(-90deg); + } + 50% { + -webkit-transform: translateX(10px) translateY(10px) rotate(-179deg); + transform: translateX(10px) translateY(10px) rotate(-179deg); + } + 50.1% { + -webkit-transform: translateX(10px) translateY(10px) rotate(-180deg); + transform: translateX(10px) translateY(10px) rotate(-180deg); + } + 75% { + -webkit-transform: translateX(0px) translateY(10px) rotate(-270deg); + transform: translateX(0px) translateY(10px) rotate(-270deg); + } + 100% { + -webkit-transform: rotate(-360deg); + transform: rotate(-360deg); + } +} +@keyframes cubemove { + 25% { + -webkit-transform: translateX(10px) rotate(-90deg); + transform: translateX(10px) rotate(-90deg); + } + 50% { + -webkit-transform: translateX(10px) translateY(10px) rotate(-179deg); + transform: translateX(10px) translateY(10px) rotate(-179deg); + } + 50.1% { + -webkit-transform: translateX(10px) translateY(10px) rotate(-180deg); + transform: translateX(10px) translateY(10px) rotate(-180deg); + } + 75% { + -webkit-transform: translateX(0px) translateY(10px) rotate(-270deg); + transform: translateX(0px) translateY(10px) rotate(-270deg); + } + 100% { + -webkit-transform: rotate(-360deg); + transform: rotate(-360deg); + } +} +@-webkit-keyframes orbit { + 0% { + opacity: 1; + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + -webkit-transform: rotate(225deg); + transform: rotate(225deg); + } + 7% { + -webkit-transform: rotate(345deg); + transform: rotate(345deg); + -webkit-animation-timing-function: linear; + animation-timing-function: linear; + } + 35% { + -webkit-transform: rotate(495deg); + transform: rotate(495deg); + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + } + 42% { + -webkit-transform: rotate(690deg); + transform: rotate(690deg); + -webkit-animation-timing-function: linear; + animation-timing-function: linear; + } + 70% { + opacity: 1; + -webkit-transform: rotate(835deg); + transform: rotate(835deg); + -webkit-animation-timing-function: linear; + animation-timing-function: linear; + } + 76% { + opacity: 1; + } + 77% { + -webkit-transform: rotate(955deg); + transform: rotate(955deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + 78% { + -webkit-transform: rotate(955deg); + transform: rotate(955deg); + opacity: 0; + } + 100% { + -webkit-transform: rotate(955deg); + transform: rotate(955deg); + opacity: 0; + } +} +@keyframes orbit { + 0% { + opacity: 1; + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + -webkit-transform: rotate(225deg); + transform: rotate(225deg); + } + 7% { + -webkit-transform: rotate(345deg); + transform: rotate(345deg); + -webkit-animation-timing-function: linear; + animation-timing-function: linear; + } + 35% { + -webkit-transform: rotate(495deg); + transform: rotate(495deg); + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + } + 42% { + -webkit-transform: rotate(690deg); + transform: rotate(690deg); + -webkit-animation-timing-function: linear; + animation-timing-function: linear; + } + 70% { + opacity: 1; + -webkit-transform: rotate(835deg); + transform: rotate(835deg); + -webkit-animation-timing-function: linear; + animation-timing-function: linear; + } + 76% { + opacity: 1; + } + 77% { + -webkit-transform: rotate(955deg); + transform: rotate(955deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + 78% { + -webkit-transform: rotate(955deg); + transform: rotate(955deg); + opacity: 0; + } + 100% { + -webkit-transform: rotate(955deg); + transform: rotate(955deg); + opacity: 0; + } +} +@-webkit-keyframes metro-slide { + 0% { + left: -50%; + } + 100% { + left: 150%; + } +} +@keyframes metro-slide { + 0% { + left: -50%; + } + 100% { + left: 150%; + } +} +@-webkit-keyframes metro-opacity { + 0% { + opacity: 0; + } + 50% { + opacity: .5; + } + 100% { + opacity: 1; + } +} +@keyframes metro-opacity { + 0% { + opacity: 0; + } + 50% { + opacity: .5; + } + 100% { + opacity: 1; + } +} +@-webkit-keyframes ani-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@keyframes ani-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@-webkit-keyframes ani-bounce { + 0%, + 10%, + 20%, + 50%, + 80% { + -webkit-transform: translateY(0); + transform: translateY(0); + } + 40% { + -webkit-transform: translateY(-15px); + transform: translateY(-15px); + } + 60% { + -webkit-transform: translateY(-15px); + transform: translateY(-15px); + } +} +@keyframes ani-bounce { + 0%, + 10%, + 20%, + 50%, + 80% { + -webkit-transform: translateY(0); + transform: translateY(0); + } + 40% { + -webkit-transform: translateY(-15px); + transform: translateY(-15px); + } + 60% { + -webkit-transform: translateY(-15px); + transform: translateY(-15px); + } +} +@-webkit-keyframes ani-float { + 0% { + -webkit-transform: translateY(0); + transform: translateY(0); + } + 50% { + -webkit-transform: translateY(-6px); + transform: translateY(-6px); + } + 100% { + -webkit-transform: translateY(0); + transform: translateY(0); + } +} +@keyframes ani-float { + 0% { + -webkit-transform: translateY(0); + transform: translateY(0); + } + 50% { + -webkit-transform: translateY(-6px); + transform: translateY(-6px); + } + 100% { + -webkit-transform: translateY(0); + transform: translateY(0); + } +} +.mif-ani-bounce, +.mif-ani-hover-bounce:hover { + -webkit-animation: ani-bounce 2s ease infinite; + animation: ani-bounce 2s ease infinite; +} + +.mif-ani-bounce.mif-ani-slow, +.mif-ani-hover-bounce.mif-ani-slow:hover { + -webkit-animation: ani-bounce 3s ease infinite; + animation: ani-bounce 3s ease infinite; +} +.mif-ani-float, +.mif-ani-hover-float:hover { + -webkit-animation: ani-float 2s linear infinite; + animation: ani-float 2s linear infinite; +} +.mif-ani-float.mif-ani-fast, +.mif-ani-hover-float.mif-ani-fast:hover { + -webkit-animation: ani-float 1s linear infinite; + animation: ani-float 1s linear infinite; +} +.mif-ani-float.mif-ani-slow, +.mif-ani-hover-float.mif-ani-slow:hover { + -webkit-animation: ani-float 3s linear infinite; + animation: ani-float 3s linear infinite; +} + +/*icons metro*/ +@font-face { + font-family: 'metro'; + src:url('../fonts/metro.eot?-gkxixq'); + src:url('../fonts/metro.eot?#iefix-gkxixq') format('embedded-opentype'), + url('../fonts/metro.ttf?-gkxixq') format('truetype'), + url('../fonts/metro.woff?-gkxixq') format('woff'), + url('../fonts/metro.svg?-gkxixq#metro') format('svg'); + font-weight: normal; + font-style: normal; +} + +[class^="mif-"], [class*=" mif-"] { + font-family: 'metro'; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.mif-file-add:before { + content: "\e6c1"; +} +.mif-directions-bike:before { + content: "\e6bf"; +} +.mif-location-city:before { + content: "\e6c0"; +} +.mif-wifi-low:before { + content: "\e60c"; +} +.mif-wifi-mid:before { + content: "\e60d"; +} +.mif-wifi-full:before { + content: "\e634"; +} +.mif-tablet-landscape:before { + content: "\e635"; +} +.mif-calculator2:before { + content: "\e636"; +} +.mif-barbell:before { + content: "\e637"; +} +.mif-chart-line:before { + content: "\e656"; +} +.mif-3d-rotation:before { + content: "\e600"; +} +.mif-alarm:before { + content: "\e601"; +} +.mif-alarm-on:before { + content: "\e602"; +} +.mif-favorite:before { + content: "\e603"; +} +.mif-perm-phone-msg:before { + content: "\e604"; +} +.mif-print:before { + content: "\e605"; +} +.mif-bt-settings:before { + content: "\e606"; +} +.mif-settings-ethernet:before { + content: "\e607"; +} +.mif-settings-phone:before { + content: "\e608"; +} +.mif-settings-power:before { + content: "\e609"; +} +.mif-settings-voice:before { + content: "\e60a"; +} +.mif-shopping-basket:before { + content: "\e60b"; +} +.mif-dialer-sip:before { + content: "\e60e"; +} +.mif-dialpad:before { + content: "\e60f"; +} +.mif-contacts-dialer:before { + content: "\e610"; +} +.mif-contacts-mail:before { + content: "\e611"; +} +.mif-ring-volume:before { + content: "\e612"; +} +.mif-voicemail:before { + content: "\e613"; +} +.mif-drafts:before { + content: "\e614"; +} +.mif-mail:before { + content: "\e615"; +} +.mif-bluetooth:before { + content: "\e626"; +} +.mif-bt-connected:before { + content: "\e627"; +} +.mif-bt-disabled:before { + content: "\e628"; +} +.mif-bt-searching:before { + content: "\e629"; +} +.mif-brightness-auto:before { + content: "\e62a"; +} +.mif-multitrack-audio:before { + content: "\e616"; +} +.mif-widgets:before { + content: "\e617"; +} +.mif-usb:before { + content: "\e638"; +} +.mif-money:before { + content: "\e639"; +} +.mif-vertical-align-bottom:before { + content: "\e63a"; +} +.mif-vertical-align-center:before { + content: "\e63b"; +} +.mif-vertical-align-top:before { + content: "\e63c"; +} +.mif-file-download:before { + content: "\e63d"; +} +.mif-file-upload:before { + content: "\e63e"; +} +.mif-keyboard-return:before { + content: "\e63f"; +} +.mif-keyboard-voice:before { + content: "\e640"; +} +.mif-phonelink:before { + content: "\e641"; +} +.mif-phonelink-off:before { + content: "\e642"; +} +.mif-security:before { + content: "\e618"; +} +.mif-looks:before { + content: "\e643"; +} +.mif-palette:before { + content: "\e619"; +} +.mif-layers:before { + content: "\e644"; +} +.mif-layers-clear:before { + content: "\e61a"; +} +.mif-local-airport:before { + content: "\e645"; +} +.mif-florist:before { + content: "\e61b"; +} +.mif-gas-station:before { + content: "\e61c"; +} +.mif-hotel:before { + content: "\e646"; +} +.mif-local-service:before { + content: "\e61d"; +} +.mif-map2:before { + content: "\e620"; +} +.mif-my-location:before { + content: "\e61e"; +} +.mif-traff:before { + content: "\e621"; +} +.mif-apps:before { + content: "\e647"; +} +.mif-chevron-left:before { + content: "\e648"; +} +.mif-chevron-right:before { + content: "\e649"; +} +.mif-expand-less:before { + content: "\e64a"; +} +.mif-expand-more:before { + content: "\e64b"; +} +.mif-menu:before { + content: "\e64c"; +} +.mif-more-horiz:before { + content: "\e64d"; +} +.mif-more-vert:before { + content: "\e64e"; +} +.mif-unfold-less:before { + content: "\e64f"; +} +.mif-unfold-more:before { + content: "\e650"; +} +.mif-bt-audio:before { + content: "\e651"; +} +.mif-not:before { + content: "\e633"; +} +.mif-drive-eta:before { + content: "\e652"; +} +.mif-event-available:before { + content: "\e653"; +} +.mif-event-busy:before { + content: "\e654"; +} +.mif-folder-special:before { + content: "\e655"; +} +.mif-phone-bt:before { + content: "\e657"; +} +.mif-phone-forwarded:before { + content: "\e658"; +} +.mif-phone-in-talk:before { + content: "\e659"; +} +.mif-phone-locked:before { + content: "\e65a"; +} +.mif-phone-missed:before { + content: "\e65b"; +} +.mif-phone-paused:before { + content: "\e65c"; +} +.mif-sd-card:before { + content: "\e65d"; +} +.mif-sync-disabled:before { + content: "\e622"; +} +.mif-sync-problem:before { + content: "\e623"; +} +.mif-vpn-lock:before { + content: "\e624"; +} +.mif-vpn-publ:before { + content: "\e625"; +} +.mif-school:before { + content: "\e61f"; +} +.mif-eye-slash:before { + content: "\f070"; +} +.mif-cut:before { + content: "\f0c4"; +} +.mif-columns:before { + content: "\f0db"; +} +.mif-user-md:before { + content: "\f0f0"; +} +.mif-stethoscope:before { + content: "\f0f1"; +} +.mif-ambulance:before { + content: "\f0f9"; +} +.mif-medkit:before { + content: "\f0fa"; +} +.mif-paw:before { + content: "\f1b0"; +} +.mif-file-pdf:before { + content: "\f1c1"; +} +.mif-file-word:before { + content: "\f1c2"; +} +.mif-file-excel:before { + content: "\f1c3"; +} +.mif-file-powerpoint:before { + content: "\f1c4"; +} +.mif-file-image:before { + content: "\f1c5"; +} +.mif-file-archive:before { + content: "\f1c6"; +} +.mif-file-audio:before { + content: "\f1c7"; +} +.mif-file-movie:before { + content: "\f1c8"; +} +.mif-file-code:before { + content: "\f1c9"; +} +.mif-visa:before { + content: "\f1f0"; +} +.mif-mastercard:before { + content: "\f1f1"; +} +.mif-discover:before { + content: "\f1f2"; +} +.mif-amex:before { + content: "\f1f3"; +} +.mif-cc-paypal:before { + content: "\f1f4"; +} +.mif-heartbeat:before { + content: "\f21e"; +} +.mif-venus:before { + content: "\f221"; +} +.mif-mars:before { + content: "\f222"; +} +.mif-medium:before { + content: "\f23a"; +} +.mif-stack2:before { + content: "\e6b9"; +} +.mif-stack3:before { + content: "\e6ba"; +} +.mif-lamp:before { + content: "\e6bb"; +} +.mif-injection:before { + content: "\e6bc"; +} +.mif-thermometer2:before { + content: "\e6bd"; +} +.mif-justice:before { + content: "\e6be"; +} +.mif-cabinet:before { + content: "\e62b"; +} +.mif-suitcase:before { + content: "\e62c"; +} +.mif-gamepad:before { + content: "\e65e"; +} +.mif-satellite:before { + content: "\e65f"; +} +.mif-lock:before { + content: "\e660"; +} +.mif-unlock:before { + content: "\e661"; +} +.mif-battery-full:before { + content: "\e62d"; +} +.mif-battery-two:before { + content: "\e62e"; +} +.mif-battery-one:before { + content: "\e62f"; +} +.mif-battery-empty:before { + content: "\e630"; +} +.mif-battery-charge:before { + content: "\e631"; +} +.mif-tools:before { + content: "\e632"; +} +.mif-pin:before { + content: "\e662"; +} +.mif-discout:before { + content: "\e663"; +} +.mif-profile:before { + content: "\e664"; +} +.mif-dollar:before { + content: "\e665"; +} +.mif-dollars:before { + content: "\e666"; +} +.mif-coins:before { + content: "\e6b8"; +} +.mif-male:before { + content: "\e667"; +} +.mif-female:before { + content: "\e668"; +} +.mif-piano:before { + content: "\e669"; +} +.mif-anchor:before { + content: "\e66a"; +} +.mif-chevron-thin-down:before { + content: "\e66b"; +} +.mif-chevron-thin-left:before { + content: "\e697"; +} +.mif-chevron-thin-right:before { + content: "\e69b"; +} +.mif-chevron-thin-up:before { + content: "\e69c"; +} +.mif-flow-branch:before { + content: "\e69d"; +} +.mif-flow-cascade:before { + content: "\e69e"; +} +.mif-flow-line:before { + content: "\e69f"; +} +.mif-flow-parallel:before { + content: "\e6a0"; +} +.mif-flow-tree:before { + content: "\e6a1"; +} +.mif-air:before { + content: "\e6a2"; +} +.mif-medal:before { + content: "\e6a3"; +} +.mif-paper-plane:before { + content: "\e6a4"; +} +.mif-shareable:before { + content: "\e6a5"; +} +.mif-shop:before { + content: "\e6a6"; +} +.mif-shopping-basket2:before { + content: "\e6a7"; +} +.mif-thumbs-down:before { + content: "\e6a8"; +} +.mif-thumbs-up:before { + content: "\e6a9"; +} +.mif-traffic-cone:before { + content: "\e6aa"; +} +.mif-water:before { + content: "\e6ab"; +} +.mif-creative-cloud:before { + content: "\e6ac"; +} +.mif-dropbox:before { + content: "\e6ad"; +} +.mif-evernote:before { + content: "\e6ae"; +} +.mif-paypal:before { + content: "\e6af"; +} +.mif-swarm:before { + content: "\e6b0"; +} +.mif-vk:before { + content: "\e6b1"; +} +.mif-yelp:before { + content: "\e6b2"; +} +.mif-dribbble:before { + content: "\e6b3"; +} +.mif-lastfm:before { + content: "\e6b4"; +} +.mif-pinterest:before { + content: "\e6b5"; +} +.mif-stumbleupon:before { + content: "\e6b6"; +} +.mif-vimeo:before { + content: "\e6b7"; +} +.mif-microscope:before { + content: "\f089"; +} +.mif-library:before { + content: "\e921"; +} +.mif-file-binary:before { + content: "\f094"; +} +.mif-mail-read:before { + content: "\f03c"; +} +.mif-quote:before { + content: "\f063"; +} +.mif-sunrise:before { + content: "\e66c"; +} +.mif-sun:before { + content: "\e66d"; +} +.mif-moon:before { + content: "\e66e"; +} +.mif-sun3:before { + content: "\e66f"; +} +.mif-windy:before { + content: "\e670"; +} +.mif-wind:before { + content: "\e671"; +} +.mif-snowflake:before { + content: "\e672"; +} +.mif-cloudy:before { + content: "\e673"; +} +.mif-cloud2:before { + content: "\e674"; +} +.mif-weather:before { + content: "\e675"; +} +.mif-weather2:before { + content: "\e676"; +} +.mif-weather3:before { + content: "\e677"; +} +.mif-lines:before { + content: "\e678"; +} +.mif-cloud3:before { + content: "\e679"; +} +.mif-lightning:before { + content: "\e67a"; +} +.mif-lightning2:before { + content: "\e67b"; +} +.mif-rainy:before { + content: "\e67c"; +} +.mif-rainy2:before { + content: "\e67d"; +} +.mif-windy2:before { + content: "\e67e"; +} +.mif-windy3:before { + content: "\e67f"; +} +.mif-snowy:before { + content: "\e680"; +} +.mif-snowy2:before { + content: "\e681"; +} +.mif-snowy3:before { + content: "\e682"; +} +.mif-weather4:before { + content: "\e683"; +} +.mif-cloudy2:before { + content: "\e684"; +} +.mif-cloud4:before { + content: "\e685"; +} +.mif-lightning3:before { + content: "\e686"; +} +.mif-sun4:before { + content: "\e687"; +} +.mif-moon2:before { + content: "\e688"; +} +.mif-cloudy3:before { + content: "\e689"; +} +.mif-cloud5:before { + content: "\e68a"; +} +.mif-cloud6:before { + content: "\e68b"; +} +.mif-lightning4:before { + content: "\e68c"; +} +.mif-rainy3:before { + content: "\e68d"; +} +.mif-rainy4:before { + content: "\e68e"; +} +.mif-windy4:before { + content: "\e68f"; +} +.mif-windy5:before { + content: "\e690"; +} +.mif-snowy4:before { + content: "\e691"; +} +.mif-snowy5:before { + content: "\e692"; +} +.mif-weather5:before { + content: "\e693"; +} +.mif-cloudy4:before { + content: "\e694"; +} +.mif-lightning5:before { + content: "\e695"; +} +.mif-thermometer:before { + content: "\e696"; +} +.mif-none:before { + content: "\e698"; +} +.mif-celsius:before { + content: "\e699"; +} +.mif-fahrenheit:before { + content: "\e69a"; +} +.mif-home:before { + content: "\e900"; +} +.mif-pencil:before { + content: "\e905"; +} +.mif-eyedropper:before { + content: "\e90a"; +} +.mif-paint:before { + content: "\e90c"; +} +.mif-image:before { + content: "\e90d"; +} +.mif-images:before { + content: "\e90e"; +} +.mif-camera:before { + content: "\e90f"; +} +.mif-headphones:before { + content: "\e910"; +} +.mif-music:before { + content: "\e911"; +} +.mif-film:before { + content: "\e913"; +} +.mif-video-camera:before { + content: "\e914"; +} +.mif-dice:before { + content: "\e915"; +} +.mif-wifi-connect:before { + content: "\e91b"; +} +.mif-feed:before { + content: "\e91d"; +} +.mif-mic:before { + content: "\e91e"; +} +.mif-books:before { + content: "\e920"; +} +.mif-file-empty:before { + content: "\e924"; +} +.mif-files-empty:before { + content: "\e925"; +} +.mif-file-text:before { + content: "\e926"; +} +.mif-file-picture:before { + content: "\e927"; +} +.mif-file-music:before { + content: "\e928"; +} +.mif-file-play:before { + content: "\e929"; +} +.mif-file-video:before { + content: "\e92a"; +} +.mif-file-zip:before { + content: "\e92b"; +} +.mif-stack:before { + content: "\e92e"; +} +.mif-folder:before { + content: "\e92f"; +} +.mif-folder-open:before { + content: "\e930"; +} +.mif-folder-plus:before { + content: "\e931"; +} +.mif-folder-minus:before { + content: "\e932"; +} +.mif-folder-download:before { + content: "\e933"; +} +.mif-folder-upload:before { + content: "\e934"; +} +.mif-tag:before { + content: "\e935"; +} +.mif-tags:before { + content: "\e936"; +} +.mif-barcode:before { + content: "\e937"; +} +.mif-qrcode:before { + content: "\e938"; +} +.mif-cart:before { + content: "\e93a"; +} +.mif-credit-card:before { + content: "\e93f"; +} +.mif-calculator:before { + content: "\e940"; +} +.mif-help:before { + content: "\e941"; +} +.mif-phone:before { + content: "\e942"; +} +.mif-envelop:before { + content: "\e945"; +} +.mif-location:before { + content: "\e948"; +} +.mif-compass:before { + content: "\e949"; +} +.mif-compass2:before { + content: "\e94a"; +} +.mif-map:before { + content: "\e94b"; +} +.mif-history:before { + content: "\e94d"; +} +.mif-bell:before { + content: "\e951"; +} +.mif-calendar:before { + content: "\e953"; +} +.mif-printer:before { + content: "\e954"; +} +.mif-keyboard:before { + content: "\e955"; +} +.mif-display:before { + content: "\e956"; +} +.mif-laptop:before { + content: "\e957"; +} +.mif-mobile:before { + content: "\e959"; +} +.mif-tablet:before { + content: "\e95a"; +} +.mif-download:before { + content: "\e960"; +} +.mif-upload:before { + content: "\e961"; +} +.mif-floppy-disk:before { + content: "\e962"; +} +.mif-drive:before { + content: "\e963"; +} +.mif-database:before { + content: "\e964"; +} +.mif-undo:before { + content: "\e965"; +} +.mif-redo:before { + content: "\e966"; +} +.mif-bubble:before { + content: "\e96b"; +} +.mif-bubbles:before { + content: "\e96c"; +} +.mif-user:before { + content: "\e971"; +} +.mif-users:before { + content: "\e972"; +} +.mif-user-plus:before { + content: "\e973"; +} +.mif-user-minus:before { + content: "\e974"; +} +.mif-user-check:before { + content: "\e975"; +} +.mif-hour-glass:before { + content: "\e979"; +} +.mif-spinner:before { + content: "\e97a"; +} +.mif-spinner1:before { + content: "\e97b"; +} +.mif-spinner2:before { + content: "\e97d"; +} +.mif-spinner3:before { + content: "\e981"; +} +.mif-spinner4:before { + content: "\e982"; +} +.mif-spinner5:before { + content: "\e983"; +} +.mif-search:before { + content: "\e986"; +} +.mif-zoom-in:before { + content: "\e987"; +} +.mif-zoom-out:before { + content: "\e988"; +} +.mif-enlarge:before { + content: "\e989"; +} +.mif-shrink:before { + content: "\e98a"; +} +.mif-enlarge2:before { + content: "\e98b"; +} +.mif-shrink2:before { + content: "\e98c"; +} +.mif-key:before { + content: "\e98d"; +} +.mif-wrench:before { + content: "\e991"; +} +.mif-equalizer:before { + content: "\e992"; +} +.mif-equalizer-v:before { + content: "\e993"; +} +.mif-cog:before { + content: "\e994"; +} +.mif-cogs:before { + content: "\e995"; +} +.mif-magic-wand:before { + content: "\e997"; +} +.mif-bug:before { + content: "\e999"; +} +.mif-chart-pie:before { + content: "\e99a"; +} +.mif-chart-dots:before { + content: "\e99b"; +} +.mif-chart-bars:before { + content: "\e99c"; +} +.mif-chart-bars2:before { + content: "\e99d"; +} +.mif-trophy:before { + content: "\e99e"; +} +.mif-gift:before { + content: "\e99f"; +} +.mif-spoon-fork:before { + content: "\e9a3"; +} +.mif-rocket:before { + content: "\e9a5"; +} +.mif-meter:before { + content: "\e9a6"; +} +.mif-hammer:before { + content: "\e9a8"; +} +.mif-fire:before { + content: "\e9a9"; +} +.mif-lab:before { + content: "\e9aa"; +} +.mif-bin:before { + content: "\e9ac"; +} +.mif-truck:before { + content: "\e9b0"; +} +.mif-target:before { + content: "\e9b3"; +} +.mif-power:before { + content: "\e9b5"; +} +.mif-switch:before { + content: "\e9b6"; +} +.mif-power-cord:before { + content: "\e9b7"; +} +.mif-clipboard:before { + content: "\e9b8"; +} +.mif-list-numbered:before { + content: "\e9b9"; +} +.mif-list:before { + content: "\e9ba"; +} +.mif-list2:before { + content: "\e9bb"; +} +.mif-tree:before { + content: "\e9bc"; +} +.mif-cloud:before { + content: "\e9c1"; +} +.mif-cloud-download:before { + content: "\e9c2"; +} +.mif-cloud-upload:before { + content: "\e9c3"; +} +.mif-download2:before { + content: "\e9c7"; +} +.mif-upload2:before { + content: "\e9c8"; +} +.mif-earth:before { + content: "\e9ca"; +} +.mif-link:before { + content: "\e9cb"; +} +.mif-flag:before { + content: "\e9cc"; +} +.mif-attachment:before { + content: "\e9cd"; +} +.mif-eye:before { + content: "\e9ce"; +} +.mif-bookmark:before { + content: "\e9d2"; +} +.mif-bookmarks:before { + content: "\e9d3"; +} +.mif-contrast:before { + content: "\e9d5"; +} +.mif-brightness:before { + content: "\e9d6"; +} +.mif-star-empty:before { + content: "\e9d7"; +} +.mif-star-half:before { + content: "\e9d8"; +} +.mif-star-full:before { + content: "\e9d9"; +} +.mif-heart:before { + content: "\e9da"; +} +.mif-heart-broken:before { + content: "\e9db"; +} +.mif-warning:before { + content: "\ea07"; +} +.mif-notification:before { + content: "\ea08"; +} +.mif-question:before { + content: "\ea09"; +} +.mif-plus:before { + content: "\ea0a"; +} +.mif-minus:before { + content: "\ea0b"; +} +.mif-info:before { + content: "\ea0c"; +} +.mif-cancel:before { + content: "\ea0d"; +} +.mif-blocked:before { + content: "\ea0e"; +} +.mif-cross:before { + content: "\ea0f"; +} +.mif-checkmark:before { + content: "\ea10"; +} +.mif-spell-check:before { + content: "\ea12"; +} +.mif-enter:before { + content: "\ea13"; +} +.mif-exit:before { + content: "\ea14"; +} +.mif-play:before { + content: "\ea1c"; +} +.mif-pause:before { + content: "\ea1d"; +} +.mif-stop:before { + content: "\ea1e"; +} +.mif-backward:before { + content: "\ea1f"; +} +.mif-forward:before { + content: "\ea20"; +} +.mif-first:before { + content: "\ea21"; +} +.mif-last:before { + content: "\ea22"; +} +.mif-previous:before { + content: "\ea23"; +} +.mif-next:before { + content: "\ea24"; +} +.mif-eject:before { + content: "\ea25"; +} +.mif-volume-high:before { + content: "\ea26"; +} +.mif-volume-medium:before { + content: "\ea27"; +} +.mif-volume-low:before { + content: "\ea28"; +} +.mif-volume-mute:before { + content: "\ea29"; +} +.mif-volume-mute2:before { + content: "\ea2a"; +} +.mif-volume-plus:before { + content: "\ea2b"; +} +.mif-volume-minus:before { + content: "\ea2c"; +} +.mif-loop:before { + content: "\ea2d"; +} +.mif-loop2:before { + content: "\ea2e"; +} +.mif-infinite:before { + content: "\ea2f"; +} +.mif-shuffle:before { + content: "\ea30"; +} +.mif-arrow-up-left:before { + content: "\ea39"; +} +.mif-arrow-up:before { + content: "\ea3a"; +} +.mif-arrow-up-right:before { + content: "\ea3b"; +} +.mif-arrow-right:before { + content: "\ea3c"; +} +.mif-arrow-down-right:before { + content: "\ea3d"; +} +.mif-arrow-down:before { + content: "\ea3e"; +} +.mif-arrow-down-left:before { + content: "\ea3f"; +} +.mif-arrow-left:before { + content: "\ea40"; +} +.mif-tab:before { + content: "\ea45"; +} +.mif-move-up:before { + content: "\ea46"; +} +.mif-move-down:before { + content: "\ea47"; +} +.mif-sort-asc:before { + content: "\ea4c"; +} +.mif-sort-desc:before { + content: "\ea4d"; +} +.mif-command:before { + content: "\ea4e"; +} +.mif-shift:before { + content: "\ea4f"; +} +.mif-crop:before { + content: "\ea57"; +} +.mif-filter:before { + content: "\ea5b"; +} +.mif-bold:before { + content: "\ea62"; +} +.mif-underline:before { + content: "\ea63"; +} +.mif-italic:before { + content: "\ea64"; +} +.mif-strikethrough:before { + content: "\ea65"; +} +.mif-page-break:before { + content: "\ea68"; +} +.mif-superscript:before { + content: "\ea69"; +} +.mif-subscript:before { + content: "\ea6a"; +} +.mif-table:before { + content: "\ea71"; +} +.mif-insert-template:before { + content: "\ea72"; +} +.mif-pilcrow:before { + content: "\ea73"; +} +.mif-ltr:before { + content: "\ea74"; +} +.mif-rtl:before { + content: "\ea75"; +} +.mif-section:before { + content: "\ea76"; +} +.mif-paragraph-left:before { + content: "\ea77"; +} +.mif-paragraph-center:before { + content: "\ea78"; +} +.mif-paragraph-right:before { + content: "\ea79"; +} +.mif-paragraph-justify:before { + content: "\ea7a"; +} +.mif-indent-increase:before { + content: "\ea7b"; +} +.mif-indent-decrease:before { + content: "\ea7c"; +} +.mif-embed:before { + content: "\ea7f"; +} +.mif-embed2:before { + content: "\ea80"; +} +.mif-share:before { + content: "\ea82"; +} +.mif-google:before { + content: "\ea87"; +} +.mif-google-plus:before { + content: "\ea88"; +} +.mif-facebook:before { + content: "\ea8d"; +} +.mif-twitter:before { + content: "\ea91"; +} +.mif-feed3:before { + content: "\ea95"; +} +.mif-youtube:before { + content: "\ea99"; +} +.mif-steam:before { + content: "\eaae"; +} +.mif-onedrive:before { + content: "\eab0"; +} +.mif-github:before { + content: "\eab3"; +} +.mif-git:before { + content: "\eab5"; +} +.mif-apple:before { + content: "\eabf"; +} +.mif-android:before { + content: "\eac1"; +} +.mif-windows:before { + content: "\eac3"; +} +.mif-skype:before { + content: "\eac6"; +} +.mif-linkedin:before { + content: "\eac8"; +} +.mif-html5:before { + content: "\eadf"; +} +.mif-css3:before { + content: "\eae1"; +} +.mif-chrome:before { + content: "\eae5"; +} +.mif-firefox:before { + content: "\eae6"; +} +.mif-ie:before { + content: "\eae7"; +} +.mif-opera:before { + content: "\eae8"; +} +.mif-safari:before { + content: "\eae9"; +} diff --git a/resources/assets/js/custom.js b/resources/assets/js/custom.js new file mode 100644 index 00000000..b714ab5e --- /dev/null +++ b/resources/assets/js/custom.js @@ -0,0 +1,213 @@ +/** + * + * @param {type} title + * @param {type} icon + * @param {type} content + * @returns {undefined} + */ +function alertDialog(title, icon, content) { + var html = '

' + title + '



' + + content + '

' + + '' + //+ '' + + '
'; + $("#dcmDialog-content").html(html); + showDialog("#dcmDialog"); +} + +/** + * + * @param {type} id + * @returns {undefined} + */ +function showDialog(id) { + var dialog = $(id).data('dialog'); + dialog.open(); +} + +/** + * + * @param {type} id + * @returns {undefined} + */ +function ocultDialog(id) { + var dialog = $(id).data('dialog'); + dialog.close(); +} + +/** + * + * @param {type} id + * @param {type} destroy + * @returns {undefined} + */ +function ocultDialog2(id, destroy) { + if (destroy) { + $(id + " .body-preview").html(""); + } + ocultDialog(id); +} + +/** + * + * @param {type} title + * @param {type} cancelTxt + * @param {type} okTxt + * @param {type} callback + * @param {type} defaultVal + * @param {type} icon + * @returns {undefined} + */ +function showPrompt(title, cancelTxt, okTxt, callback, defaultVal, icon) { + + + var header = '

' + title + '



'; + + var input = '
' + + '' + + '
'; + + var template = '
' + + '
' + + header + + input + + '

' + + '
'; + + + var okBut = $(' '); + var cancelBut = $(' \n'); + + okBut.click(function() { + callback($("#inputDialog input").val()); + ocultDialog("#inputDialog"); + $("#inputDialog").remove(); + }); + cancelBut.click(function() { + ocultDialog("#inputDialog"); + $("#inputDialog").remove(); + }); + + var dialog = $(template); + var actions = dialog.find(".form-actions"); + cancelBut.appendTo(actions); + okBut.appendTo(actions); + + dialog.appendTo("body").dialog(); + showDialog("#inputDialog"); +} + +/** + * + * @param {type} title + * @param {type} body + * @param {type} cancelTxt + * @param {type} okTxt + * @param {type} callback + * @param {type} icon + * @returns {undefined} + */ +function showConfirmDialog(title, body, cancelTxt, okTxt, callback, icon) { + var header = '

' + title + '



'; + + + var template = '
' + + '
' + + header + + body + + '

' + + '
'; + + + var okBut = $(' '); + var cancelBut = $(' \n'); + + var dialog = $(template); + var actions = dialog.find(".form-actions"); + cancelBut.appendTo(actions); + okBut.appendTo(actions); + + dialog.appendTo("body").dialog(); + + okBut.click(function() { + callback(true); + ocultDialog("#confirmDialog"); + $("#confirmDialog").remove(); + }); + cancelBut.click(function() { + ocultDialog("#confirmDialog"); + $("#confirmDialog").remove(); + }); + + showDialog("#confirmDialog"); +} + +function alertDialog2(title, icon, body, okTxt, callback) { + var header = '

' + title + '



'; + + + var template = '
' + + '
' + + header + + body + + '

' + + '
'; + + + var okBut = $(' '); + + var dialog = $(template); + var actions = dialog.find(".form-actions"); + okBut.appendTo(actions); + + dialog.appendTo("body").dialog(); + + okBut.click(function() { + callback(true); + ocultDialog("#alertDialog"); + $("#alertDialog").remove(); + }); + + showDialog("#alertDialog"); + +} + +$(function() { + $('.filterx').hide(300); + + + $("#showFilters").click(function() { + var parentx = $(this).parent(); + if (parentx.hasClass("active")) { + $('.filterx').hide(300); + parentx.attr("class", ""); + } else { + //show filters + $('.filterx').show(300); + parentx.attr("class", "active fg-yellow"); + //ocult links + $('.actionx').hide(300); + $("#showLinks").parent().attr("class", ""); + } + + }); + + $('.actionx').hide(300); + $("#showLinks").click(function() { + var parentx = $(this).parent(); + if (parentx.hasClass("active")) { + $('.actionx').hide(300); + parentx.attr("class", ""); + } else { + //show links + $('.actionx').show(300); + parentx.attr("class", "active fg-yellow"); + //ocult filters + $('.filterx').hide(300); + $("#showFilters").parent().attr("class", ""); + } + + }); + +}); +//alertDialog($('#lang_info').val(), "mif-warning", msg); \ No newline at end of file diff --git a/resources/assets/js/include.commercial.js b/resources/assets/js/include.commercial.js deleted file mode 100755 index 6cbe21df..00000000 --- a/resources/assets/js/include.commercial.js +++ /dev/null @@ -1,2269 +0,0 @@ -var encodeURL,show_animation,hide_animation,apply,apply_none,apply_img,apply_any,apply_video,apply_link,apply_file_rename,apply_file_duplicate,apply_folder_rename; -(function ($, Modernizr, image_editor) -{ - "use strict"; - - var version = "9.9.5"; - var active_contextmenu = true; - var copy_count = 0; - - var delay = (function () - { - var timer = 0; - return function (callback, ms) - { - clearTimeout(timer); - timer = setTimeout(callback, ms); - }; - })(); - - var getLink = function($trigger) - { - var m = $('#base_url').val() + $('#cur_dir').val(); - var add = $trigger.find('a.link').attr('data-file'); - - if (add != "" && add != null) - { - m += add; - } - - add = $trigger.find('h4 a.folder-link').attr('data-file'); - - if (add != "" && add != null) - { - m += add; - } - return m; - } - - var FileManager = { - - contextActions: { - - copy_url : function($trigger) - { - var m = getLink($trigger); - - bootbox.alert( - 'URL:
' + - '
' + - '' + - '' + - '
' - ); - - $('#copy-button' + copy_count).html(' ' + $('#lang_copy').val()); - - var client = new ZeroClipboard($('#copy-button' + copy_count)); - - client.on("ready", function (readyEvent) - { - - client.on("wrongFlash noFlash", function () - { - ZeroClipboard.destroy(); - }); - - client.on("aftercopy", function (event) - { - $('#copy-button' + copy_count).html(' ' + $('#ok').val()); - $('#copy-button' + copy_count).attr('class', 'btn disabled'); - copy_count++; - }); - - client.on('error', function (event) {}); - - }); - }, - - unzip: function($trigger) - { - var m = $('#sub_folder').val() + $('#fldr_value').val() + $trigger.find('a.link').attr('data-file'); - $.ajax({ - type: "POST", - url: "ajax_calls.php?action=extract", - data: { - path: m - } - }).done(function (msg) - { - if (msg != "") - { - bootbox.alert(msg); - } - else - { - window.location.href = $('#refresh').attr('href') + '&' + new Date().getTime(); - } - }); - }, - - edit_img: function($trigger) - { - var filename = $trigger.attr('data-name'); - var full_path = $('#base_url_true').val() + $('#cur_dir').val() + filename; - - var aviaryElement = $('#aviary_img'); - aviaryElement.attr('data-name', filename); - show_animation(); - aviaryElement.attr('src', full_path).load(launchEditor(aviaryElement.attr('id'), full_path)); - }, - - duplicate: function($trigger) - { - var old_name = $trigger.find('h4').text().trim(); - - bootbox.prompt($('#lang_duplicate').val(), $('#cancel').val(), $('#ok').val(), function (name) - { - if (name !== null) - { - name = fix_filename(name); - if (name != old_name) - { - var _this = $trigger.find('.rename-file'); - execute_action('duplicate_file', _this.attr('data-path'), _this.attr('data-thumb'), name, _this, 'apply_file_duplicate'); - } - } - }, old_name); - }, - - select: function($trigger) - { - var url = getLink($trigger); - var external = $('#field_id').val(); - var windowParent; - var is_return_relative_url = $('#return_relative_url').val(); - console.log(url); - url = url.replace($('#base_url').val(), ''); - url = url.replace($('#cur_dir').val(), ''); - if ($('#popup').val() == 1) - { - windowParent = window.opener; - } - else - { - windowParent = window.parent; - } - if (external != "") - { - if ($('#crossdomain').val() == 1) - { - windowParent.postMessage({ - sender: 'responsivefilemanager', - url: url, - field_id: external - }, - '*' - ); - } - else - { - var target = $('#' + external, windowParent.document); - target.val(url).trigger('change'); - if (typeof windowParent.responsive_filemanager_callback == 'function') - { - windowParent.responsive_filemanager_callback(external); - } - close_window(); - } - } - else - { - apply_any(url); - } - - - }, - copy: function($trigger) - { - copy_cut_clicked($trigger, 'copy'); - }, - cut: function($trigger) - { - copy_cut_clicked($trigger, 'cut'); - }, - paste: function() - { - paste_to_this_dir(); - }, - chmod: function($trigger) - { - chmod($trigger); - }, - edit_text_file: function($trigger) - { - edit_text_file($trigger); - } - - }, - - makeContextMenu: function() - { - var fm = this; - - $.contextMenu({ - selector: 'figure:not(.back-directory), .list-view2 figure:not(.back-directory)', - autoHide: true, - build: function ($trigger) - { - - $trigger.addClass('selected'); - - var options = { - callback: function (key, options) - { - fm.contextActions[key]($trigger); - }, - items: {} - }; - // tooltip options - // edit image/show url - if ( - ( - $trigger.find('.img-precontainer-mini .filetype').hasClass('png') - || $trigger.find('.img-precontainer-mini .filetype').hasClass('jpg') - || $trigger.find('.img-precontainer-mini .filetype').hasClass('jpeg') - ) && image_editor) - { - options.items.edit_img = { - name: $('#lang_edit_image').val(), - icon: "edit_img", - disabled: false - }; - } - // select folder - if ($trigger.hasClass('directory') && $('#type_param').val()!=0) - { - options.items.select = { - name: $('#lang_select').val(), - icon: "", - disabled: false - }; - } - - options.items.copy_url = { - name: $('#lang_show_url').val(), - icon: "url", - disabled: false - }; - // extract - if ($trigger.find('.img-precontainer-mini .filetype').hasClass('zip') || - $trigger.find('.img-precontainer-mini .filetype').hasClass('tar') || - $trigger.find('.img-precontainer-mini .filetype').hasClass('gz')) - { - options.items.unzip = { - name: $('#lang_extract').val(), - icon: "extract", - disabled: false - }; - } - - // edit file's content - if ($trigger.find('.img-precontainer-mini .filetype').hasClass('edit-text-file-allowed')) - { - options.items.edit_text_file = { - name: $('#lang_edit_file').val(), - icon: "edit", - disabled: false - }; - } - - - // duplicate - if (!$trigger.hasClass('directory') && $('#duplicate').val() == 1) - { - options.items.duplicate = { - name: $('#lang_duplicate').val(), - icon: "duplicate", - disabled: false - }; - } - - // copy & cut - if (!$trigger.hasClass('directory') && $('#copy_cut_files_allowed').val() == 1) - { - options.items.copy = { - name: $('#lang_copy').val(), - icon: "copy", - disabled: false - }; - options.items.cut = { - name: $('#lang_cut').val(), - icon: "cut", - disabled: false - }; - } - else if ($trigger.hasClass('directory') && $('#copy_cut_dirs_allowed').val() == 1) - { - options.items.copy = { - name: $('#lang_copy').val(), - icon: "copy", - disabled: false - }; - options.items.cut = { - name: $('#lang_cut').val(), - icon: "cut", - disabled: false - }; - } - - // paste - // Its not added to folders because it might confuse someone - if ($('#clipboard').val() != 0 && !$trigger.hasClass('directory')) - { - options.items.paste = { - name: $('#lang_paste_here').val(), - icon: "clipboard-apply", - disabled: false - }; - } - - // file permission - if (!$trigger.hasClass('directory') && $('#chmod_files_allowed').val() == 1) - { - options.items.chmod = { - name: $('#lang_file_permission').val(), - icon: "key", - disabled: false - }; - } - else if ($trigger.hasClass('directory') && $('#chmod_dirs_allowed').val() == 1) - { - options.items.chmod = { - name: $('#lang_file_permission').val(), - icon: "key", - disabled: false - }; - } - - // fileinfo - options.items.sep = '----'; - options.items.info = { - name: "" + $('#lang_file_info').val() + "", - disabled: true - }; - options.items.name = { - name: $trigger.attr('data-name'), - icon: 'label', - disabled: true - }; - if ($trigger.attr('data-type') == "img") - { - options.items.dimension = { - name: $trigger.find('.img-dimension').html(), - icon: "dimension", - disabled: true - }; - } - if ($trigger.hasClass('directory')){ - options.items.size = { - name: $trigger.find('.file-size').html()+" - "+$trigger.find('.nfiles').val()+" "+$('#lang_files').val()+" - "+$trigger.find('.nfolders').val()+" "+$('#lang_folders').val(), - icon: "size", - disabled: true - }; - }else{ - - options.items.size = { - name: $trigger.find('.file-size').html(), - icon: "size", - disabled: true - }; - } - options.items.date = { - name: $trigger.find('.file-date').html(), - icon: "date", - disabled: true - }; - - - return options; - }, - events: { - hide: function () - { - $('figure').removeClass('selected'); - } - } - }); - - $(document).on('contextmenu', function (e) - { - if (!$(e.target).is("figure")) - { - return false; - } - }); - }, - - bindGridEvents: function() - { - var grid = $('ul.grid'); - - grid.on('click', '.modalAV', function (e) - { - var _this = $(this); - e.preventDefault(); - - var previewElement = $('#previewAV'); - var bodyPreviewElement = $(".body-preview"); - previewElement.removeData("modal"); - previewElement.modal({ - backdrop: 'static', - keyboard: false - }); - - if (_this.hasClass('audio')) - { - bodyPreviewElement.css('height', '80px'); - } - else - { - bodyPreviewElement.css('height', '345px'); - } - - $.ajax({ - url: _this.attr('data-url'), - success: function (data) - { - bodyPreviewElement.html(data); - } - }); - }); - - grid.on('click', '.file-preview-btn', function (e) - { - var _this = $(this); - e.preventDefault(); - - $.ajax({ - url: _this.attr('data-url'), - success: function (data) - { - bootbox.alert(data); - } - }); - }); - - grid.on('click', '.preview', function () - { - var _this = $(this); - if(_this.hasClass('disabled')==false) - { - $('#full-img').attr('src', decodeURIComponent(_this.attr('data-url'))); - } - return true; - }); - - grid.on('click', '.rename-file', function () - { - var _this = $(this); - - var file_container = _this.parent().parent().parent(); - var file_title = file_container.find('h4'); - var old_name = $.trim(file_title.text()); - bootbox.prompt($('#rename').val(), $('#cancel').val(), $('#ok').val(), function (name) - { - if (name !== null) - { - name = fix_filename(name); - if (name != old_name) - { - execute_action('rename_file', _this.attr('data-path'), _this.attr('data-thumb'), name, file_container, 'apply_file_rename'); - } - } - }, old_name); - }); - - grid.on('click', '.rename-folder', function () - { - var _this = $(this); - - var file_container = _this.parent().parent().parent(); - var file_title = file_container.find('h4'); - var old_name = $.trim(file_title.text()); - bootbox.prompt($('#rename').val(), $('#cancel').val(), $('#ok').val(), function (name) - { - if (name !== null) - { - name = fix_filename(name).replace('.', ''); - if (name != old_name) - { - execute_action('rename_folder', _this.attr('data-path'), _this.attr('data-thumb'), name, file_container, 'apply_folder_rename'); - } - } - }, old_name); - }); - - grid.on('click', '.delete-file', function () - { - var _this = $(this); - bootbox.confirm(_this.attr('data-confirm'), $('#cancel').val(), $('#ok').val(), function (result) - { - if (result == true) - { - execute_action('delete_file', _this.attr('data-path'), _this.attr('data-thumb'), '', '', ''); - var fil = $('#files_number'); - fil.text(parseInt(fil.text())-1); - _this.parent().parent().parent().parent().remove(); - } - }); - }); - - grid.on('click', '.delete-folder', function () - { - var _this = $(this); - - bootbox.confirm(_this.attr('data-confirm'), $('#cancel').val(), $('#ok').val(), function (result) - { - if (result == true) - { - execute_action('delete_folder', _this.attr('data-path'), _this.attr('data-thumb'), '', '', ''); - var fol = $('#folders_number'); - fol.text(parseInt(fol.text())-1); - _this.parent().parent().parent().remove(); - } - }); - }); - - function handleFileLink($el) - { - window[ $el.attr('data-function') ]($el.attr('data-file'), $('#field_id').val()); - } - - $('ul.grid').on('click','.link',function () - { - handleFileLink($(this)); - }); - - $('ul.grid').on('click','div.box', function (e) - { - - var fileLink = $(this).find(".link"); - if (fileLink.length !== 0) - { - handleFileLink(fileLink); - } - else - { - var folderLink = $(this).find(".folder-link"); - if (folderLink.length !== 0) - { - document.location = $(folderLink).prop("href"); - } - } - }); - // End of link handler - }, - - makeFilters: function(js_script) - { - $('#filter-input').on('keyup', function () - { - $('.filters label').removeClass("btn-inverse"); - $('.filters label').find('i').removeClass('icon-white'); - $('#ff-item-type-all').addClass("btn-inverse"); - $('#ff-item-type-all').find('i').addClass('icon-white'); - var val = fix_filename($(this).val()).toLowerCase(); - $(this).val(val); - if (js_script) - { - delay(function () - { - $('li', 'ul.grid ').each(function () - { - var _this = $(this); - if (val != "" && _this.attr('data-name').toLowerCase().indexOf(val) == -1) - { - _this.hide(100); - } - else - { - _this.show(100); - } - }); - - $.ajax({ - url: "ajax_calls.php?action=filter&type=" + val - }).done(function (msg) - { - if (msg != "") - { - bootbox.alert(msg); - } - }); - delay(function () - { - var sortDescending = $('#descending').val() != 0 ? true : false; - sortUnorderedList(sortDescending, "." + $('#sort_by').val()); - - lazyLoad(); - }, 500); - - }, 300); - } - }).keypress(function (e) - { - if (e.which == 13) - { - $('#filter').trigger('click'); - } - }); - - // filtering - $('#filter').on('click', function () - { - var val = fix_filename($('#filter-input').val()); - window.location.href = $('#current_url').val() + "&filter=" + val; - }); - }, - - makeUploader: function() - { - // upload btn - $('#uploader-btn').on('click', function () - { - var path = $('#sub_folder').val() + $('#fldr_value').val() + "/"; - path = path.substring(0, path.length - 1); - - $('#iframe-container').html($('