diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/admin/action.php b/admin/action.php new file mode 100755 index 0000000..40f243d --- /dev/null +++ b/admin/action.php @@ -0,0 +1,225 @@ + 'mysql', + 'host' => $MCONF['db_host'], + 'user' => $MCONF['db_usr'], + 'password' => $MCONF['db_pw'], + 'database' => $MCONF['db_name'], + 'db_prefix' => $MCONF['db_prefix'] + )); + $backup = $db->backup(); + if ($backup['error']) + { + echo msg('fail', $lang->get('action_backup_fail')); + } + else + { + header("Cache-Control: public"); + header("content-Description: File Transfer"); + header('Content-Disposition: attachment; filename=Backup_' . str_replace(' ', '_', $MCONF['title']) . '_' . date('Y-m-d_h-d') . '.sql'); + header("Content-Type: application/octet-stream; "); + header("Content-Transfer-Encoding: binary"); + echo $backup['msg']; + exit; + } +} +else +{ + printHeader($lang->get('action_edit_content')); +} +if (hasPerm('manage_system')) +{ + //construction + if (isset($_GET['construction'])) + { + if (isset($_GET['constr_message'])) + { + if (isset($_POST['constr_message'])) + { + if (file_put_contents('../inc/System/construction2.txt', $_POST['constr_message'])) + { + copy('../inc/System/construction2.txt', '../inc/System/construction.txt'); + echo msg('succes', $lang->get('action_construction_message_success').' '.$lang->get('back').''); + } else + { + echo msg('fail', $lang->get('action_try_again_later').' '.$lang->get('back').''); + } + } else + { + tinymce(); + ?> +
+

get('action_construction_message_edit');?>

+
+ + +
+
+ get('action_construction_success').' '.$lang->get('back').''); + } else + { + echo msg('fail', $lang->get('action_try_again_later').' '.$lang->get('back').''); + } + } else + { + ?> +
+

+ get('action_construction_confirm');?>
+ get('general_yes');?> + get('general_no');?> +

+
+ get('action_construction_removed_success').' '.$lang->get('back').''); + } else + { + echo msg('fail', $lang->get('action_try_again_later').' '.$lang->get('back').''); + } + } else + { + ?> +
+

+ get('action_construction_remove');?>
+ get('general_yes');?> + get('general_no');?> +

+
+ get('action_change_page_title_success')); + } else + { + echo msg('fail', $lang->get('action_try_again_later')); + } + } + $moduluri = '../apps/'; + if ($handle = opendir($moduluri)) + { + while (false !== ($mod = readdir($handle))) + { + if ($mod != "." && $mod != ".." && is_dir($moduluri . $mod)) + { + require $moduluri . $mod . '/config.php'; + if (isset($_CONF['general_conf']) && $_CONF['general_conf'] != '' && file_exists($moduluri . $mod . '/' . $_CONF['general_conf'])) + { + //echo '
  • '; + require $moduluri . $mod . '/' . $_CONF['general_conf']; + } + } + } + closedir($handle); + } + } + //Update + if(isset($_GET['update'])) + { + if(hasPerm('update')) + { + $version_remote = json_decode(file_get_contents($MCONF['update_uri'].'version.json')); + if ($version_remote->versionNum > $MCONF['version_num']) + { + if (copy($MCONF['update_uri'].'update.v' . $version_remote->versionNum . '.incremental.zip', 'update.zip')) + { + if (md5_file('update.zip') == $version_remote->md5) + { + if (!file_exists('updateNeu/')) + { + mkdir('updateNeu/'); + } + $zip = new ZipArchive; + $res = $zip->open('update.zip'); + if ($res === true) + { + $zip->extractTo('updateNeu/'); + $zip->close(); + $updateInfos = json_decode(file_get_contents('updateNeu/filesToUpdate.json')); + //array mit dateine erstellen + $isUp = false; + $fTU = []; + foreach ($updateInfos->files as $num => $file) + { + $fTU[] = $file; + $upNeu = 'updateNeu/' . $file; + $upRem = '../' . $file; + if (copy($upNeu, $upRem)) + { + echo msg('succes', sprintf($lang->get('action_update_item_succss'), $file)); + $isUp = true; + } else + { + echo msg('fail', sprintf($lang->get('action_update_item_fail'), $file)); + } + } + + //Jetzt altes update entfernen + if (rrmdir('updateNeu') && $isUp && unlink('update.zip')) + { + echo msg('succes', $lang->get('action_update_success').' '.$lang->get('back').''); + } else + { + echo msg('fail', $lang->get('action_update_fail').' '.$lang->get('back').''); + } + } else + { + echo msg('fail', $lang->get('action_update_fail_unzip')); + } + } else + { + echo msg('fail', $lang->get('action_update_md5_fake')); + } + } else + { + echo msg('fail', $lang->get('action_update_fail_copy')); + } + } else + { + echo msg('info', $lang->get('general_version_current_new')); + } + } + } +} +else +{ + echo msg('info', $lang->get('missing_permission')); +} +require_once '../inc/footer.php'; +?> \ No newline at end of file diff --git a/admin/assets/Logo.svg b/admin/assets/Logo.svg new file mode 100755 index 0000000..d7642ba --- /dev/null +++ b/admin/assets/Logo.svg @@ -0,0 +1,764 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/admin/assets/admin.css b/admin/assets/admin.css new file mode 100755 index 0000000..5bd6ad9 --- /dev/null +++ b/admin/assets/admin.css @@ -0,0 +1,1501 @@ +@import url(fonts.css); +@import url(icons.css); + +* { + margin: 0; + padding: 0; +} + +*, *:focus, *:hover, *:active { + outline: none; +} + +::selection { + background: rgba(76, 175, 80, 0.51); +} + +::-moz-selection { + background: rgba(76, 175, 80, 0.51); +} + +body { + font-family: "Open Sans", sans-serif; + font-size: 15px; + color: #212121; + background: #e6e6e6; +} + +h1, h2, h3, h4, h5, h6 { + font-family: "Roboto", sans-serif; + font-weight: 400; +} + +/*Inputs und co*/ +input, textarea { + font-size: 15px; + font-family: "Open Sans", sans-serif; + width: 326px; + padding: 10px 2px 5px; + border: 0; + border-bottom: 1px solid #ccc; + background: transparent; + margin: 0px 5px 15px; + background: -webkit-linear-gradient(top, rgba(255, 255, 255, 0) 94%, #4CAF50 6%); + background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 94%, #4CAF50 6%); + background-position: center bottom; + background-size: 0 100%; + background-repeat: no-repeat; + transition: 0.2s ease; + -webkit-transition: 0.2s ease; +} + +textarea { + max-width: 500px; + width: calc(100% - 15px); + height: 120px; + background: -webkit-linear-gradient(top, rgba(255, 255, 255, 0) 98.5%, #4CAF50 1.5%); + background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 98.5%, #4CAF50 1.5%); + background-position: center bottom; + background-size: 0 100%; + background-repeat: no-repeat; +} + +input:focus, textarea:focus { + background-size: 350px 100%; + border-bottom: 1px solid transparent; +} + +textarea:focus { + background-size: 500px 100%; +} + +input:invalid:focus, textarea:invalid:focus { + background: -webkit-linear-gradient(top, rgba(255, 255, 255, 0) 94%, #D32F2F 6%); + background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 94%, #D32F2F 6%); + outline: none; + border: 0; +} + +/*Checkbox*/ +input[type=checkbox] { + display: none; +} + +label { + cursor: pointer; + margin: 15px 5px; + display: inline-block; +} + +input[type=checkbox] + label i { + display: inline-block; + border: 2px solid #5C5C5C; + width: 15px; + height: 15px; + margin: 0 10px 0 0; + vertical-align: middle; + transition: 0.2s ease; + -webkit-transition: 0.2s ease; + border-radius: 2px; + +} + +input[type=checkbox]:disabled + label i { + border: 2px solid #bdbdbd; + cursor: not-allowed; +} + +input[type=checkbox]:checked + label i { + border: 2px solid #388e3c; + background: #388e3c; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12); +} + +input[type=checkbox]:disabled:checked + label i { + border: 2px solid #bdbdbd; + background: #bdbdbd; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} + +input[type=checkbox] + label i:after { + content: ""; + border: 3px solid transparent; + border-top: 0; + border-left: 0; + width: 5px; + height: 12px; + display: block; + border-radius: 1px; + transition: 0.2s ease; + -webkit-transition: 0.2s ease; + transform: rotate(37deg); + margin-top: -1px; + margin-left: 4px; +} + +input[type=checkbox]:checked + label i:after { + border: 3px solid #fff; + border-top: 0; + border-left: 0; +} + +/*Radiobutton*/ +input[type=radio] { + display: none; +} + +input[type=radio] + label i { + display: inline-block; + border: 2px solid #5C5C5C; + width: 15px; + height: 15px; + margin: 0 10px 0 0; + vertical-align: middle; + transition: 0.2s ease; + -webkit-transition: 0.2s ease; + border-radius: 100%; +} + +input[type=radio]:checked + label i { + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12); + border: 2px solid #388e3c; +} + +input[type=radio] + label i:after { + content: ""; + background: #388e3c; + width: 0; + height: 0; + display: block; + border-radius: 100%; + margin: 7px; + transition: 0.2s ease; + -webkit-transition: 0.2s ease; +} + +input[type=radio]:checked + label i:after { + width: 11px; + height: 11px; + margin: 2px 0 0 2px; +} + +/*Select Dropdown*/ +select { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + border: none; + border-radius: 0; + font-size: 1em; + width: 326px; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAMCAMAAABYzB2OAAAAjVBMVEVycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnKNtVJEAAAALnRSTlMAAwUHCCcpPUNFSUpLTFRWZ2iEhYuMj5aXmJmhoq2vsri63t/j5Ojp6+zv8Pn7gVWTcwAAAHNJREFUeAFVxlcSgkAYBOEGA4qYFbOYwwpz/+PJX7W1yvcw0zC4TAkm1wySlzTGG0nvBCepSjGklSTHQrVyCJCV1kuY2X/60HNWc4Dc6tntPOxzDCvr+812jbeRtyXYSWbPT3RQ7Rjxp1VIRZuG+HSOfX4B5w8QMqI/lJcAAAAASUVORK5CYII=) no-repeat right; + padding: 0 10px 5px 5px; + border-bottom: 1px solid #ccc; + cursor: pointer; + outline: none; +} + +select:focus { + outline: none; + border-bottom: 1px solid transparent; +} + +/*Button*/ +.button, input[type=submit] { + color: #fff; + background: #4CAF50; /*3F51B5*/ + border: none; + border-radius: 2px; + position: relative; + height: 36px; + margin: 10px; + min-width: 64px; + padding: 0 16px; + display: inline-block; + font-family: "Roboto", "Helvetica", "Arial", sans-serif; + font-size: 14px; + font-weight: 500; + text-transform: uppercase; + overflow: hidden; + cursor: pointer; + text-decoration: none; + text-align: center; + line-height: 36px; + vertical-align: middle; + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .14), 0 1px 1px -2px rgba(0, 0, 0, .2), 0 1px 2px 0 rgba(0, 0, 0, .12); + transition: 0.2s ease; + -webkit-transition: 0.2s ease; + + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Chrome/Safari/Opera */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE/Edge */ + user-select: none; +} + +input[type=submit] { + width: auto; +} + +.button:hover, input[type=submit]:hover { + background: #499149; + text-decoration: none; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .14), 0 3px 4px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12); +} + +.button:active, input[type=submit]:active { + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .14), 0 3px 4px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12); +} + +.button:disabled, input[type=submit]:disabled { + background: #d6d6d6; + color: #212121; +} + +.btn_del { + background: #F44336 !important; +} + +.btn_del:hover { + background: #c72c2c !important; +} + +.btn_blau { + background: #3F51B5 !important; +} + +.btn_blau:hover { + background: #4659d0 !important; +} + +a { + color: #388E3C; + text-decoration: none; + cursor: pointer; +} + +a:hover { + text-decoration: underline; +} + +i.divider { + border-bottom: 1px solid #ccc; + width: 100%; + display: block; + margin: 10px 0; +} + +code { + border: 1px solid #ccc; + padding: 1px 4px; + margin: 0 5px; + background: #f8f8f8; +} + +p { + margin-top: 10px; +} + +iframe { + border: 0; +} + +hr{ + border: 1px solid #ccc; + border-width: 1px 0 0 0; +} + +a.del i { + font-size: 20px; + vertical-align: sub; +} + +a.del { + color: #F44336; + transition: 0.2s ease; + -webkit-transition: 0.2s ease; +} + +a.del:hover { + color: #c72c2c; + text-decoration: none; +} + +/*Loading Spinner*/ +.spinner-container { + margin: 0 auto; + width: 40px; +} + +.spinner { + -webkit-animation: rotate 2s ease-in-out infinite; + animation: rotate 2s ease-in-out infinite; + width: 40px; + height: 40px; +} + +@-webkit-keyframes rotate { + 100% { + -webkit-transform: rotate(360deg); + } +} + +@keyframes rotate { + 100% { + transform: rotate(360deg); + } +} + +.path { + stroke-dasharray: 187; + stroke-dashoffset: 0; + -webkit-transform-origin: center; + transform-origin: center; + -webkit-animation: dash 1.4s ease-in-out infinite, colors 5.6s ease-in-out infinite; + animation: dash 1.4s ease-in-out infinite, colors 5.6s ease-in-out infinite; +} + +@-webkit-keyframes colors { + 0% { + stroke: #4CAF50; + } + 25% { + stroke: #F44336; + } + 50% { + stroke: #FF9800; + } + 75% { + stroke: #4baa4f; + } + 100% { + stroke: #4CAF50; + } +} + +@keyframes colors { + 0% { + stroke: #4CAF50; + } + 25% { + stroke: #F44336; + } + 50% { + stroke: #FF9800; + } + 75% { + stroke: #4baa4f; + } + 100% { + stroke: #4CAF50; + } +} + +@keyframes dash { + 0% { + stroke-dasharray: 1, 150; + stroke-dashoffset: 0; + } + 50% { + stroke-dasharray: 90, 150; + stroke-dashoffset: -35; + } + 100% { + stroke-dasharray: 90, 150; + stroke-dashoffset: -124; + } +} + +@-webkit-keyframes dash { + 0% { + stroke-dasharray: 1, 150; + stroke-dashoffset: 0; + } + 50% { + stroke-dasharray: 90, 150; + stroke-dashoffset: -35; + } + 100% { + stroke-dasharray: 90, 150; + stroke-dashoffset: -124; + } +} + +/*Tabelle*/ +table { + box-shadow: 1px 1px 2px 0 rgba(0, 0, 0, .14); + border: 1px solid #E0E0E0; + border-collapse: collapse; + white-space: nowrap; + max-width: 100%; + margin: 15px 0; + overflow: auto; + display: inline-block; +} + +tr, td { + padding: 0 5px; +} + +tr { + border-bottom: 1px solid #E0E0E0; + padding: 10px 5px; + transition: 0.1s ease; + -webkit-transition: 0.1s ease; +} + +tr:hover { + background: #EEEEEE; +} + +tr:last-child { + border-bottom: 0; +} + +tr th { + text-align: left; + padding: 10px; + background: rgb(246, 246, 246); +} + +tr td { + padding: 10px 5px 10px 10px; +} + +/*Permissions*/ +table.permissions{ + min-width: 100%; + display: table; + box-shadow: none; + border: none; + margin-bottom: 25px; +} + +table.permissions th{ + color: #999999; + background: #fff; + font-weight: normal; + padding-bottom: 15px; +} + +table.permissions tr:last-child{ + border-bottom: 1px solid #E0E0E0; +} + +table.permissions tr:hover{ + background: #f8f8f8; +} + +table.permissions label{ + margin: 0; + width: 100%; +} + +table.permissions .permdesc{ + width: 100px; + text-align: center; +} + +table.permissions .critical{ + font-size: 25px; + vertical-align: middle; + float: right; + color: #F44336; + opacity: 0; + transition: 0.1s ease; + -webkit-transition: 0.1s ease; +} + +table.permissions tr:hover .critical{ + opacity: 1; +} + +audio, video { + width: 100%; +} + +/*Snackbar*/ +.snackbar { + background: #323232; + padding: 9px 10px; + color: #fff; + position: fixed; + bottom: -100%; + left: calc(50vw - 130px); + width: 260px; + cursor: default; + border-radius: 2px 2px 0 0; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12); + -webkit-animation: snackbar_fade 7s ease-in-out; + animation: snackbar_fade 7s ease-in-out; + z-index: 800; +} + +.snackbar p { + width: 242px; + text-align: center; +} + +.closeMsg { + font-family: Roboto, arial, sans-serif; + font-weight: bold; + color: #fff; + transition: 0.1s ease; + -webkit-transition: 0.1s ease; + float: right; +} + +.closeMsg:hover { + text-decoration: none; + color: #E91E63; +} + +@keyframes snackbar_fade { + 0% { + bottom: -100%; + } + + 10% { + bottom: 0; + } + + 90% { + bottom: 0; + } + + 100% { + bottom: -100%; + } +} + +@-webkit-keyframes snackbar_fade { + 0% { + bottom: -100%; + } + + 10% { + bottom: 0; + } + + 90% { + bottom: 0; + } + + 100% { + bottom: -100%; + } +} + +/*Login*/ +.login_wrapper { + background: url('bglogin.jpg') no-repeat center fixed; + background-size: cover; + width: 100%; + height: 100vh; + position: absolute; +} + +.login_wrapper img{ + width: 340px; + display: block; + margin: 40px auto 0; +} + +.login_container { + width: 350px; + background: #fff; + border-radius: 2px; + padding: 10px; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12); + /*position: fixed; + top: calc(50vh - 136.5px); + left: calc(50vw - 175px);*/ + margin: 15px auto; +} + +/*header*/ +header { + background: #fff; + box-shadow: 0 0 5px #727272; + float: right; + padding: 6px 25px 15px; + position: fixed; + left: 284px; + right: 0; + height: 35px; + color: #727272; + z-index: 10; + font-size: 30px; + overflow: hidden; +} + +header:after { + height: 10px; + content: ''; + display: block; +} + +header .options { + display: block; + float: right; + font-size: 15px; + text-align: right; + cursor: pointer; + -moz-user-select: -moz-none; + -webkit-user-select: none; + user-select: none; + position: fixed; + top: -9px; + right: 10px; + background: #fff; + height: 65px; +} + +header .options span { + font-size: 18px; + vertical-align: middle; +} + +header .options p { + display: inline-block; +} + +header .options input[type=checkbox]:checked + label ul { + height: auto; + opacity: 1; +} + +header .options p span.icon- { + vertical-align: middle; + display: inline-block; + transition: 0.1s ease; + -webkit-transition: 0.1s ease; +} + +header .options p span.icon-:before { + content: "\f078"; +} + +header .options input[type=checkbox]:checked + label p span.icon-{ + transform: rotate(180deg); +} + +header .options span.usr_info:before { + content: '' !important; +} + +header .options ul { + list-style-type: none; + background: #fff; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12); + margin-top: 3px; + text-align: left; + height: 0; + overflow: hidden; + margin-right: -15px; + display: block; + right: 30px; + position: absolute; + padding: 8px 0; + + opacity: 0; + transition: 0.1s ease; + -webkit-transition: 0.1s ease; + min-width: 170px; +} + +header .options ul li a { + color: #212121; + padding: 8px 10px 8px 15px; + display: block; + transition: 0.1s ease; + -webkit-transition: 0.1s ease; +} + +header .options ul li a:hover { + background: #e7e7e7; + text-decoration: none; +} + +header .options img { + border-radius: 100%; + height: 40px; + vertical-align: middle; + margin-right: 10px; + margin-top: -8px; +} + +/*menu*/ +nav { + float: left; + width: 284px; + color: #fff; + background: #23282D; /*37474F*/ + position: fixed; + top: 0; + bottom: 0; + z-index: 1; + /*overflow-x: hidden; + overflow-y: auto;*/ +} + +nav header { + background: #32373C; + position: static; + float: none; + box-shadow: none; + height: 75px; + color: #fff; + font-family: 'Roboto', arial, sans-serif; + padding-top: 40px; + font-size: 18px; +} + +nav ul { + padding-top: 20px; +} + +nav ul li { + list-style-type: none; +} + +nav ul li a { + width: calc(100% - 25px); + display: block; + padding: 13px 0 13px 25px; + color: #e8e8e8; + font-weight: 600; + transition: 0.1s ease; + -webkit-transition: 0.1s ease; +} + +nav ul li:hover { + background: #191E23; + color: #4CAF50; +} + +nav ul li:hover a { + color: #4CAF50; +} + +nav ul li a.now, nav ul li a.now:hover, nav ul li.active a, nav ul li.active a:hover, nav ul li.active ul li a.now { + background: #4CAF50; + color: #e8e8e8 !important; +} + +nav ul li a:hover, nav ul li ul li a:hover { + text-decoration: none; + color: #4CAF50 !important; +} + +nav ul li ul { + padding-top: 0; + height: 0; + overflow: hidden; + transition: 0.2s ease; + -webkit-transition: 0.2s ease; + opacity: 0; + display: block; + margin-left: 284px; + margin-top: -48px; + width: 284px; + position: absolute; + background: #20262b; + color: #e8e8e8; +} + +nav ul li:hover ul li a { + color: #e8e8e8; +} + +nav ul li:hover ul { + width: 284px; + opacity: 1; + height: auto; +} + +nav ul li.active ul { + height: auto; + width: 284px; + opacity: 1; + margin-left: 0; + background: #23282D; + margin-top: 0; + position: static; +} + +nav ul li.active ul li a { + padding: 10px 0 10px 50px; + width: calc(100% - 50px); + background: #23282D; + color: #e8e8e8; +} + +nav [class^="icon-"], nav [class*=" icon-"], nav .icon { + vertical-align: sub; + font-size: 20px; + padding-right: 8px; +} + +.sub_menu{ + position: absolute; + right: 5px; + padding-top: 2px; + font-size: 15px !important; +} + +nav ul li.active i.sub_menu:before{ + content: "\f078"; +} + +.show-menu, input#show-menu { + display: none; +} + +.show-menu { + text-decoration: none; + color: #000; + position: fixed; + top: 11px; + left: 5px; + z-index: 12; + cursor: pointer; +} + +input[type=checkbox]#show-menu { + display: none; + -webkit-appearance: none; +} + +.show-menu i { + width: 25px; + margin: 9px 10px 4px; + display: block; +} + +input[type=checkbox]#show-menu:checked ~ nav { + display: block; + opacity: 1; + left: 0; + z-index: 12; + overflow-x: scroll; +} + +input[type=checkbox]#show-menu:checked ~ nav ul li { + display: block; + list-style-type: none; +} + +.mobile-overlay { + opacity: 0; + transition: 0.3s ease; + -o-transition: 0.3s ease; + -webkit-transition: 0.3s ease; + margin: 0; +} + +input[type=checkbox]#show-menu:checked ~ .mobile-overlay { + z-index: 11; + position: fixed; + top: -15px; + right: -6px; + left: -5px; + bottom: -15px; + background: rgba(250, 250, 250, 0.5); + opacity: 1; +} + +/*main*/ +.main { + width: 1156px; + margin-left: calc(50vw - 446px); + margin-top: 5px; + background: #fff; + padding: 10px 10px 20px; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12); + border-radius: 1px; + z-index: 1; +} + +/*Cards*/ +.cardsContainer { + display: flex; + width: 100%; + max-width: 1156px; + margin: 0 auto; +} + +.cardsContainer-main { + margin-left: calc((50vw - 451px)); + max-width: 1185px; +} + +[class^="card-"], [class*=" card-"] { + flex: 4; + padding: 10px 10px 15px; + margin: 10px 5px; + height: 90px; + background: #fff; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12); + border-radius: 2px; + transition: 0.1s ease; + -webkit-transition: 0.1s ease; + overflow: hidden; + color: #fff; + cursor: default; + word-break: break-all; + + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Chrome/Safari/Opera */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE/Edge */ + user-select: none; +} + +[class^="card-"] span, [class*=" card-"] span { + font-size: 2vw; + display: block; + margin-bottom: 10px; + font-weight: bold; + font-family: Roboto, arial, helvetica, sans-serif; +} + +[class^="card-"]:hover, [class*=" card-"]:hover { + box-shadow: 2px 4px 3px 0 rgba(0, 0, 0, .14), 0 4px 2px -2px rgba(0, 0, 0, .2), 0 2px 7px 0 rgba(0, 0, 0, .12); + text-decoration: none; +} + +a[class^="card-"]:hover, a[class*=" card-"]:hover { + cursor: pointer; +} + +.card-blue { + background: #2196F3; +} + +.card-lightblue { + background: #03A9F4; +} + +.card-cyan { + background: #00BCD4; +} + +.card-lightblue { + background: #03A9F4; +} + +.card-teal { + background: #009688; +} + +.card-green { + background: #4CAF50; +} + +.card-lightgreen { + background: #8BC34A; +} + +.card-lime { + background: #CDDC39; + color: #212121; +} + +.card-yellow { + background: #FFEB3B; + color: #212121; +} + +.card-amber { + background: #FFC107; + color: #212121; +} + +.card-orange { + background: #FF9800; +} + +.card-brown { + background: #795548; +} + +.card-bluegrey { + background: #607D8B; +} + +.card-grey { + background: #9E9E9E; + color: #212121; +} + +.card-deeporange { + background: #FF5722; +} + +.card-red { + background: #F44336; +} + +.card-pink { + background: #E91C63; +} + +.card-purple { + background: #9C27B0; +} + +.card-deeppurple { + background: #673AB7; +} + +.card-indigo { + background: #4051B5; +} + +.card-white { + color: #212121; + background: #fff; +} + +.form span { + float: left; + width: 200px; + text-align: left; + padding-top: 5px; +} + +/*Msgs*/ +[class^="message-"], [class*=" message-"] { + width: calc(100% - 95px); + max-width: 280px; + padding: 10px 15px 10px 80px; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12); + border-radius: 2px; + margin: 10px auto; + background: #fff; + min-height: 44px; +} + +[class^="message-"]:before, [class*=" message-"]:before { + /* use !important to prevent issues with browser extensions that change fonts */ + font-family: 'cmsicons' !important; + 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; + + font-size: 45px; + margin: -10px 10px -8px -80px; + color: #fff; + padding: 7px 15px 8px; + border-radius: 2px 0 0 2px; + + min-height: 49px; + display: block; + width: 37px; + float: left; +} + +.message-success:before { + content: "\f058"; + background: #4CAF50; +} + +.message-fail:before { + content: "\f057"; + background: #F44336; +} + +.message-info:before { + content: "\f05a"; + background: #2280db; +} + +/*Files*/ +table#filesList { + min-width: calc(100% + 20px); + display: table; + box-shadow: none; + margin: 5px -10px; + border-left: 0; + border-right: 0; +} + +table#filesList td { + padding: 5px 10px; +} + +table#filesList a { + color: #212121; +} + +table#filesList thead{ + border-bottom: 1px solid #E0E0E0; +} + +table#filesList thead th{ + cursor: pointer; +} + +table#filesList thead th:after{ + font-family: 'cmsicons' !important; + 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; + + content: "\f0dc"; + padding-left: 6px; +} + +table#filesList thead th.headerSortDown:after{ + content: "\f0de"; +} + +table#filesList thead th.headerSortUp:after{ + content: "\f0dd"; +} + +.upbtninput { + position: fixed; + top: -100px; +} + +.overlay { + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.4); + z-index: 99; +} + +.window { + width: 100%; + max-width: 984px; + left: calc((50vw - 366px)); + top: 40px; + background: #fff; + padding: 10px 10px 20px; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12); + z-index: 1; + border-radius: 2px; + position: fixed; + overflow: auto; + max-height: calc(100vh - 80px); + height: auto; +} + +.window .head { + margin: -10px -10px 20px; + padding: 10px 10px; + background: #eaeaea; + border-radius: 2px 2px 0 0; + -moz-user-select: -moz-none; + -webkit-user-select: none; + user-select: none; + cursor: default; + position: fixed; + width: 984px; +} + +.window .head .closeMsg { + color: #212121; +} + +.window .head .closeMsg:hover { + color: #5d5d5d; +} + +.window #content { + margin-top: 60px; +} + +.window-confirm, .window-confirm .head { + width: 350px; + text-align: center; + left: calc(50vw - 175px); +} + +.window-confirm .head { + margin: -10px -10px 10px 0; + text-align: left; +} + +.select { + width: 95%; +} + +.select:focus { + background: #fff; + border-bottom: 1px solid #4CAF50; +} + +.window textarea { + width: calc(100% - 10px); + height: 400px; + font-family: monospace; + max-width: 100%; + resize: none; +} + +.window textarea:focus { + background: #fff; + border-bottom: 1px solid #4CAF50; +} + +.progbar_btm { + background: #4CAF50; + height: 4px; + margin-top: 2px; +} + +/*dropFileArea*/ +#dropFileArea{ + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 999; + background: rgba(250,250,250,0.6); +} + +.dropmsgcontainer{ + width: 400px; + text-align: center; + bottom: 20px; + position: fixed; + left: calc(50vw - 215px); +} + +.dropmsg{ + background: #2196F3; + color: #fff; + font-size: 16px; + padding: 10px; + border-radius: 2px; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12); +} + +.dropicon{ + font-size: 90px; + text-shadow: 0 2px 2px rgba(0, 0, 0, .14), 0 3px 1px rgba(0, 0, 0, .2), 0 1px 5px rgba(0, 0, 0, .12); + height: 110px; + -moz-animation: bounce 2s infinite; + -webkit-animation: bounce 2s infinite; + animation: bounce 2s infinite; +} + +@-webkit-keyframes bounce { + 0%, 20%, 50%, 80%, 100% { + padding-bottom:0; + } + 40% { + padding-bottom:15px; + } + 60% { + padding-bottom:10px; + } +} +@keyframes bounce { + 0%, 20%, 50%, 80%, 100% { + padding-bottom:0; + } + 40% { + padding-bottom:15px; + } + 60% { + padding-bottom:10px; + } +} + +/*Bild ZooomIN*/ +.imgContaienr { + margin: 10px -10px; + overflow: auto; + height: 500px; +} + +.imgContaienr img { + margin: 0 auto; + display: block; + cursor: zoom-in; + max-height: 100%; + max-width: 100%; +} + +img.zoomedin { + max-height: inherit; + max-width: inherit; + cursor: zoom-out; +} + +/*icons*/ +.icon_ue { + width: 95px; + text-align: center; + padding: 10px 5px; + border: 1px solid #dadada; + border-radius: 2px; + height: 90px; + float: left; + margin: 6px; + transition: 0.1s ease; + -webkit-transition: 0.1s ease; +} + +.icon_ue:hover { + transform: scale(1.05); + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12); + background: #f6f6f6; +} + +.icon_ue span { + font-size: 40px; + cursor: default; +} + +.icon_ue p { + margin-top: 5px; + word-break: break-all; + cursor: default; +} + +/*installer*/ +.install-container{ + width: 600px; + background: #fff; + border-radius: 2px; + padding: 10px; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12); + margin: 10px auto; +} + +.install-logo{ + margin: 20px auto; + max-width: 400px; + display: block; +} + +@media screen and (max-width: 450px) { + header .options span.usr_info { + display: none; + } + + .snackbar { + width: calc(100vw - 20px); + left: 0; + border-radius: 0; + } + + .snackbar p { + width: calc(100% - 15px); + } + + .login_container { + width: calc(100vw - 20px); + text-align: center; + margin: 30px auto; + border-radius: 0; + } + + input { + width: calc(100% - 14px); + } + + select { + width: 100%; + display: block; + } + + header { + font-size: 6vw; + } +} + +@media screen and (max-width: 1480px) { + nav { + position: fixed; + left: -300px; + transition: all 0.35s; + opacity: 0; + z-index: 12; + top: 0; + width: 90vw; + max-width: 284px; + text-align: left; + min-height: 100vh; + } + + nav ul li ul { + margin: 0; + position: static; + } + + .show-menu { + display: block; + position: fixed; + top: -12px; + left: -5px; + z-index: 11; + font-size: 30px; + /*background: #fff; + border-radius: 0 0 4px 0; + box-shadow: 0 0 8px #212121;*/ + } + + .main { + width: calc(100vw - 20px); + margin-left: 0; + } + + header { + left: 0; + padding-left: 45px; + } + + .cardsContainer { + max-width: 100%; + margin: 0 auto; + } + + [class^="card-"] span, [class*=" card-"] span { + font-size: calc(4vw + 4px); + } + + .window { + left: calc((50vw - 503px)); + } +} + +@media screen and (max-width: 1004px) { + .window { + left: 0; + top: 0; + max-width: calc(100% - 20px); + max-height: calc(100vh - 30px); + } + + .window .head { + max-width: calc(100% - 20px); + } + + table#filesList { + display: inline-block; + } +} \ No newline at end of file diff --git a/admin/assets/bglogin.jpg b/admin/assets/bglogin.jpg new file mode 100755 index 0000000..2aa9e3f Binary files /dev/null and b/admin/assets/bglogin.jpg differ diff --git a/admin/assets/favicon.ico b/admin/assets/favicon.ico new file mode 100755 index 0000000..c9614d2 Binary files /dev/null and b/admin/assets/favicon.ico differ diff --git a/admin/assets/fonts.css b/admin/assets/fonts.css new file mode 100755 index 0000000..159215a --- /dev/null +++ b/admin/assets/fonts.css @@ -0,0 +1,393 @@ +/* cyrillic-ext */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 300; + src: local('Open Sans Light'), local('OpenSans-Light'), url(fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTa-j2U0lmluP9RWlSytm3ho.woff2) format('woff2'); + unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; +} +/* cyrillic */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 300; + src: local('Open Sans Light'), local('OpenSans-Light'), url(fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTZX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 300; + src: local('Open Sans Light'), local('OpenSans-Light'), url(fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTRWV49_lSm1NYrwo-zkhivY.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 300; + src: local('Open Sans Light'), local('OpenSans-Light'), url(fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTaaRobkAwv3vxw3jMhVENGA.woff2) format('woff2'); + unicode-range: U+0370-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 300; + src: local('Open Sans Light'), local('OpenSans-Light'), url(fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTf8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2'); + unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 300; + src: local('Open Sans Light'), local('OpenSans-Light'), url(fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTT0LW-43aMEzIO6XUTLjad8.woff2) format('woff2'); + unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 300; + src: local('Open Sans Light'), local('OpenSans-Light'), url(fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTegdm0LZdjqr5-oayXSOefg.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans'), local('OpenSans'), url(fonts/gfonts/K88pR3goAWT7BTt32Z01mxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; +} +/* cyrillic */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans'), local('OpenSans'), url(fonts/gfonts/RjgO7rYTmqiVp7vzi-Q5URJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans'), local('OpenSans'), url(fonts/gfonts/LWCjsQkB6EMdfHrEVqA1KRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans'), local('OpenSans'), url(fonts/gfonts/xozscpT2726on7jbcb_pAhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+0370-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans'), local('OpenSans'), url(fonts/gfonts/59ZRklaO5bWGqF5A9baEERJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans'), local('OpenSans'), url(fonts/gfonts/u-WUoqrET9fUeobQW7jkRRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans'), local('OpenSans'), url(fonts/gfonts/cJZKeOuBrn4kERxqtaUH3VtXRa8TVwTICgirnJhmVJw.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 600; + src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(fonts/gfonts/MTP_ySUJH_bn48VBG8sNSq-j2U0lmluP9RWlSytm3ho.woff2) format('woff2'); + unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; +} +/* cyrillic */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 600; + src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(fonts/gfonts/MTP_ySUJH_bn48VBG8sNSpX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 600; + src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(fonts/gfonts/MTP_ySUJH_bn48VBG8sNShWV49_lSm1NYrwo-zkhivY.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 600; + src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(fonts/gfonts/MTP_ySUJH_bn48VBG8sNSqaRobkAwv3vxw3jMhVENGA.woff2) format('woff2'); + unicode-range: U+0370-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 600; + src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(fonts/gfonts/MTP_ySUJH_bn48VBG8sNSv8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2'); + unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 600; + src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(fonts/gfonts/MTP_ySUJH_bn48VBG8sNSj0LW-43aMEzIO6XUTLjad8.woff2) format('woff2'); + unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 600; + src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(fonts/gfonts/MTP_ySUJH_bn48VBG8sNSugdm0LZdjqr5-oayXSOefg.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 700; + src: local('Open Sans Bold'), local('OpenSans-Bold'), url(fonts/gfonts/k3k702ZOKiLJc3WVjuplzK-j2U0lmluP9RWlSytm3ho.woff2) format('woff2'); + unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; +} +/* cyrillic */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 700; + src: local('Open Sans Bold'), local('OpenSans-Bold'), url(fonts/gfonts/k3k702ZOKiLJc3WVjuplzJX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 700; + src: local('Open Sans Bold'), local('OpenSans-Bold'), url(fonts/gfonts/k3k702ZOKiLJc3WVjuplzBWV49_lSm1NYrwo-zkhivY.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 700; + src: local('Open Sans Bold'), local('OpenSans-Bold'), url(fonts/gfonts/k3k702ZOKiLJc3WVjuplzKaRobkAwv3vxw3jMhVENGA.woff2) format('woff2'); + unicode-range: U+0370-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 700; + src: local('Open Sans Bold'), local('OpenSans-Bold'), url(fonts/gfonts/k3k702ZOKiLJc3WVjuplzP8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2'); + unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 700; + src: local('Open Sans Bold'), local('OpenSans-Bold'), url(fonts/gfonts/k3k702ZOKiLJc3WVjuplzD0LW-43aMEzIO6XUTLjad8.woff2) format('woff2'); + unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 700; + src: local('Open Sans Bold'), local('OpenSans-Bold'), url(fonts/gfonts/k3k702ZOKiLJc3WVjuplzOgdm0LZdjqr5-oayXSOefg.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; +} + +/* cyrillic-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: local('Roboto'), local('Roboto-Regular'), url(fonts/gfonts/ek4gzZ-GeXAPcSbHtCeQI_esZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); + unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; +} +/* cyrillic */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: local('Roboto'), local('Roboto-Regular'), url(fonts/gfonts/mErvLBYg_cXG3rLvUsKT_fesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: local('Roboto'), local('Roboto-Regular'), url(fonts/gfonts/2n2p-_Y08sg57CNWQfKNvesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: local('Roboto'), local('Roboto-Regular'), url(fonts/gfonts/u0TOpm082MNkS5K0Q4rhqvesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); + unicode-range: U+0370-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: local('Roboto'), local('Roboto-Regular'), url(fonts/gfonts/NdF9MtnOpLzo-noMoG0miPesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); + unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: local('Roboto'), local('Roboto-Regular'), url(fonts/gfonts/Fcx7Wwv8OzT71A3E1XOAjvesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); + unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: local('Roboto'), local('Roboto-Regular'), url(fonts/gfonts/CWB0XYA8bzo0kSThX0UTuA.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 500; + src: local('Roboto Medium'), local('Roboto-Medium'), url(fonts/gfonts/ZLqKeelYbATG60EpZBSDyxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; +} +/* cyrillic */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 500; + src: local('Roboto Medium'), local('Roboto-Medium'), url(fonts/gfonts/oHi30kwQWvpCWqAhzHcCSBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 500; + src: local('Roboto Medium'), local('Roboto-Medium'), url(fonts/gfonts/rGvHdJnr2l75qb0YND9NyBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 500; + src: local('Roboto Medium'), local('Roboto-Medium'), url(fonts/gfonts/mx9Uck6uB63VIKFYnEMXrRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+0370-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 500; + src: local('Roboto Medium'), local('Roboto-Medium'), url(fonts/gfonts/mbmhprMH69Zi6eEPBYVFhRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 500; + src: local('Roboto Medium'), local('Roboto-Medium'), url(fonts/gfonts/oOeFwZNlrTefzLYmlVV1UBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 500; + src: local('Roboto Medium'), local('Roboto-Medium'), url(fonts/gfonts/RxZJdnzeo3R5zSexge8UUVtXRa8TVwTICgirnJhmVJw.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 700; + src: local('Roboto Bold'), local('Roboto-Bold'), url(fonts/gfonts/77FXFjRbGzN4aCrSFhlh3hJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; +} +/* cyrillic */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 700; + src: local('Roboto Bold'), local('Roboto-Bold'), url(fonts/gfonts/isZ-wbCXNKAbnjo6_TwHThJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 700; + src: local('Roboto Bold'), local('Roboto-Bold'), url(fonts/gfonts/UX6i4JxQDm3fVTc1CPuwqhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 700; + src: local('Roboto Bold'), local('Roboto-Bold'), url(fonts/gfonts/jSN2CGVDbcVyCnfJfjSdfBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+0370-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 700; + src: local('Roboto Bold'), local('Roboto-Bold'), url(fonts/gfonts/PwZc-YbIL414wB9rB1IAPRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 700; + src: local('Roboto Bold'), local('Roboto-Bold'), url(fonts/gfonts/97uahxiqZRoncBaCEI3aWxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); + unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 700; + src: local('Roboto Bold'), local('Roboto-Bold'), url(fonts/gfonts/d-6IYplOFocCacKzxwXSOFtXRa8TVwTICgirnJhmVJw.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; +} diff --git a/admin/assets/fonts/cmsicons.eot b/admin/assets/fonts/cmsicons.eot new file mode 100755 index 0000000..ad0d51f Binary files /dev/null and b/admin/assets/fonts/cmsicons.eot differ diff --git a/admin/assets/fonts/cmsicons.svg b/admin/assets/fonts/cmsicons.svg new file mode 100755 index 0000000..8b03749 --- /dev/null +++ b/admin/assets/fonts/cmsicons.svg @@ -0,0 +1,675 @@ + + + +Generated by IcoMoon + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/admin/assets/fonts/cmsicons.ttf b/admin/assets/fonts/cmsicons.ttf new file mode 100755 index 0000000..31d0241 Binary files /dev/null and b/admin/assets/fonts/cmsicons.ttf differ diff --git a/admin/assets/fonts/cmsicons.woff b/admin/assets/fonts/cmsicons.woff new file mode 100755 index 0000000..014ca86 Binary files /dev/null and b/admin/assets/fonts/cmsicons.woff differ diff --git a/admin/assets/fonts/gfonts/2n2p-_Y08sg57CNWQfKNvesZW2xOQ-xsNqO47m55DA.woff2 b/admin/assets/fonts/gfonts/2n2p-_Y08sg57CNWQfKNvesZW2xOQ-xsNqO47m55DA.woff2 new file mode 100755 index 0000000..ed0b13c Binary files /dev/null and b/admin/assets/fonts/gfonts/2n2p-_Y08sg57CNWQfKNvesZW2xOQ-xsNqO47m55DA.woff2 differ diff --git a/admin/assets/fonts/gfonts/59ZRklaO5bWGqF5A9baEERJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/59ZRklaO5bWGqF5A9baEERJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..bb84592 Binary files /dev/null and b/admin/assets/fonts/gfonts/59ZRklaO5bWGqF5A9baEERJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/gfonts/77FXFjRbGzN4aCrSFhlh3hJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/77FXFjRbGzN4aCrSFhlh3hJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..06fd740 Binary files /dev/null and b/admin/assets/fonts/gfonts/77FXFjRbGzN4aCrSFhlh3hJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/gfonts/97uahxiqZRoncBaCEI3aWxJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/97uahxiqZRoncBaCEI3aWxJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..b61298b Binary files /dev/null and b/admin/assets/fonts/gfonts/97uahxiqZRoncBaCEI3aWxJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/gfonts/CWB0XYA8bzo0kSThX0UTuA.woff2 b/admin/assets/fonts/gfonts/CWB0XYA8bzo0kSThX0UTuA.woff2 new file mode 100755 index 0000000..120796b Binary files /dev/null and b/admin/assets/fonts/gfonts/CWB0XYA8bzo0kSThX0UTuA.woff2 differ diff --git a/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTRWV49_lSm1NYrwo-zkhivY.woff2 b/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTRWV49_lSm1NYrwo-zkhivY.woff2 new file mode 100755 index 0000000..04a1081 Binary files /dev/null and b/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTRWV49_lSm1NYrwo-zkhivY.woff2 differ diff --git a/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTT0LW-43aMEzIO6XUTLjad8.woff2 b/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTT0LW-43aMEzIO6XUTLjad8.woff2 new file mode 100755 index 0000000..3e198c1 Binary files /dev/null and b/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTT0LW-43aMEzIO6XUTLjad8.woff2 differ diff --git a/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTZX5f-9o1vgP2EXwfjgl7AY.woff2 b/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTZX5f-9o1vgP2EXwfjgl7AY.woff2 new file mode 100755 index 0000000..8535639 Binary files /dev/null and b/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTZX5f-9o1vgP2EXwfjgl7AY.woff2 differ diff --git a/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTa-j2U0lmluP9RWlSytm3ho.woff2 b/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTa-j2U0lmluP9RWlSytm3ho.woff2 new file mode 100755 index 0000000..acb92ca Binary files /dev/null and b/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTa-j2U0lmluP9RWlSytm3ho.woff2 differ diff --git a/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTaaRobkAwv3vxw3jMhVENGA.woff2 b/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTaaRobkAwv3vxw3jMhVENGA.woff2 new file mode 100755 index 0000000..ab00dd4 Binary files /dev/null and b/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTaaRobkAwv3vxw3jMhVENGA.woff2 differ diff --git a/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTegdm0LZdjqr5-oayXSOefg.woff2 b/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTegdm0LZdjqr5-oayXSOefg.woff2 new file mode 100755 index 0000000..96ae7ed Binary files /dev/null and b/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTegdm0LZdjqr5-oayXSOefg.woff2 differ diff --git a/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTf8zf_FOSsgRmwsS7Aa9k2w.woff2 b/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTf8zf_FOSsgRmwsS7Aa9k2w.woff2 new file mode 100755 index 0000000..cd40e6a Binary files /dev/null and b/admin/assets/fonts/gfonts/DXI1ORHCpsQm3Vp6mXoaTf8zf_FOSsgRmwsS7Aa9k2w.woff2 differ diff --git a/admin/assets/fonts/gfonts/Fcx7Wwv8OzT71A3E1XOAjvesZW2xOQ-xsNqO47m55DA.woff2 b/admin/assets/fonts/gfonts/Fcx7Wwv8OzT71A3E1XOAjvesZW2xOQ-xsNqO47m55DA.woff2 new file mode 100755 index 0000000..0c7aec2 Binary files /dev/null and b/admin/assets/fonts/gfonts/Fcx7Wwv8OzT71A3E1XOAjvesZW2xOQ-xsNqO47m55DA.woff2 differ diff --git a/admin/assets/fonts/gfonts/K88pR3goAWT7BTt32Z01mxJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/K88pR3goAWT7BTt32Z01mxJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..0f1eeae Binary files /dev/null and b/admin/assets/fonts/gfonts/K88pR3goAWT7BTt32Z01mxJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/gfonts/LWCjsQkB6EMdfHrEVqA1KRJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/LWCjsQkB6EMdfHrEVqA1KRJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..cd47128 Binary files /dev/null and b/admin/assets/fonts/gfonts/LWCjsQkB6EMdfHrEVqA1KRJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNShWV49_lSm1NYrwo-zkhivY.woff2 b/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNShWV49_lSm1NYrwo-zkhivY.woff2 new file mode 100755 index 0000000..97af259 Binary files /dev/null and b/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNShWV49_lSm1NYrwo-zkhivY.woff2 differ diff --git a/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSj0LW-43aMEzIO6XUTLjad8.woff2 b/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSj0LW-43aMEzIO6XUTLjad8.woff2 new file mode 100755 index 0000000..bb98ecd Binary files /dev/null and b/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSj0LW-43aMEzIO6XUTLjad8.woff2 differ diff --git a/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSpX5f-9o1vgP2EXwfjgl7AY.woff2 b/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSpX5f-9o1vgP2EXwfjgl7AY.woff2 new file mode 100755 index 0000000..d539aeb Binary files /dev/null and b/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSpX5f-9o1vgP2EXwfjgl7AY.woff2 differ diff --git a/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSq-j2U0lmluP9RWlSytm3ho.woff2 b/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSq-j2U0lmluP9RWlSytm3ho.woff2 new file mode 100755 index 0000000..7019bce Binary files /dev/null and b/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSq-j2U0lmluP9RWlSytm3ho.woff2 differ diff --git a/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSqaRobkAwv3vxw3jMhVENGA.woff2 b/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSqaRobkAwv3vxw3jMhVENGA.woff2 new file mode 100755 index 0000000..4111b36 Binary files /dev/null and b/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSqaRobkAwv3vxw3jMhVENGA.woff2 differ diff --git a/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSugdm0LZdjqr5-oayXSOefg.woff2 b/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSugdm0LZdjqr5-oayXSOefg.woff2 new file mode 100755 index 0000000..8993a4d Binary files /dev/null and b/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSugdm0LZdjqr5-oayXSOefg.woff2 differ diff --git a/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSv8zf_FOSsgRmwsS7Aa9k2w.woff2 b/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSv8zf_FOSsgRmwsS7Aa9k2w.woff2 new file mode 100755 index 0000000..363eedb Binary files /dev/null and b/admin/assets/fonts/gfonts/MTP_ySUJH_bn48VBG8sNSv8zf_FOSsgRmwsS7Aa9k2w.woff2 differ diff --git a/admin/assets/fonts/gfonts/NdF9MtnOpLzo-noMoG0miPesZW2xOQ-xsNqO47m55DA.woff2 b/admin/assets/fonts/gfonts/NdF9MtnOpLzo-noMoG0miPesZW2xOQ-xsNqO47m55DA.woff2 new file mode 100755 index 0000000..7936b66 Binary files /dev/null and b/admin/assets/fonts/gfonts/NdF9MtnOpLzo-noMoG0miPesZW2xOQ-xsNqO47m55DA.woff2 differ diff --git a/admin/assets/fonts/gfonts/PwZc-YbIL414wB9rB1IAPRJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/PwZc-YbIL414wB9rB1IAPRJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..1674e4e Binary files /dev/null and b/admin/assets/fonts/gfonts/PwZc-YbIL414wB9rB1IAPRJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/gfonts/RjgO7rYTmqiVp7vzi-Q5URJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/RjgO7rYTmqiVp7vzi-Q5URJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..1fd235c Binary files /dev/null and b/admin/assets/fonts/gfonts/RjgO7rYTmqiVp7vzi-Q5URJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/gfonts/RxZJdnzeo3R5zSexge8UUVtXRa8TVwTICgirnJhmVJw.woff2 b/admin/assets/fonts/gfonts/RxZJdnzeo3R5zSexge8UUVtXRa8TVwTICgirnJhmVJw.woff2 new file mode 100755 index 0000000..5f96609 Binary files /dev/null and b/admin/assets/fonts/gfonts/RxZJdnzeo3R5zSexge8UUVtXRa8TVwTICgirnJhmVJw.woff2 differ diff --git a/admin/assets/fonts/gfonts/UX6i4JxQDm3fVTc1CPuwqhJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/UX6i4JxQDm3fVTc1CPuwqhJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..d60d115 Binary files /dev/null and b/admin/assets/fonts/gfonts/UX6i4JxQDm3fVTc1CPuwqhJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/gfonts/ZLqKeelYbATG60EpZBSDyxJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/ZLqKeelYbATG60EpZBSDyxJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..f63bc9a Binary files /dev/null and b/admin/assets/fonts/gfonts/ZLqKeelYbATG60EpZBSDyxJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/gfonts/cJZKeOuBrn4kERxqtaUH3VtXRa8TVwTICgirnJhmVJw.woff2 b/admin/assets/fonts/gfonts/cJZKeOuBrn4kERxqtaUH3VtXRa8TVwTICgirnJhmVJw.woff2 new file mode 100755 index 0000000..5287058 Binary files /dev/null and b/admin/assets/fonts/gfonts/cJZKeOuBrn4kERxqtaUH3VtXRa8TVwTICgirnJhmVJw.woff2 differ diff --git a/admin/assets/fonts/gfonts/d-6IYplOFocCacKzxwXSOFtXRa8TVwTICgirnJhmVJw.woff2 b/admin/assets/fonts/gfonts/d-6IYplOFocCacKzxwXSOFtXRa8TVwTICgirnJhmVJw.woff2 new file mode 100755 index 0000000..11cde5d Binary files /dev/null and b/admin/assets/fonts/gfonts/d-6IYplOFocCacKzxwXSOFtXRa8TVwTICgirnJhmVJw.woff2 differ diff --git a/admin/assets/fonts/gfonts/ek4gzZ-GeXAPcSbHtCeQI_esZW2xOQ-xsNqO47m55DA.woff2 b/admin/assets/fonts/gfonts/ek4gzZ-GeXAPcSbHtCeQI_esZW2xOQ-xsNqO47m55DA.woff2 new file mode 100755 index 0000000..e4546e4 Binary files /dev/null and b/admin/assets/fonts/gfonts/ek4gzZ-GeXAPcSbHtCeQI_esZW2xOQ-xsNqO47m55DA.woff2 differ diff --git a/admin/assets/fonts/gfonts/isZ-wbCXNKAbnjo6_TwHThJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/isZ-wbCXNKAbnjo6_TwHThJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..3336046 Binary files /dev/null and b/admin/assets/fonts/gfonts/isZ-wbCXNKAbnjo6_TwHThJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/gfonts/jSN2CGVDbcVyCnfJfjSdfBJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/jSN2CGVDbcVyCnfJfjSdfBJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..637645b Binary files /dev/null and b/admin/assets/fonts/gfonts/jSN2CGVDbcVyCnfJfjSdfBJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzBWV49_lSm1NYrwo-zkhivY.woff2 b/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzBWV49_lSm1NYrwo-zkhivY.woff2 new file mode 100755 index 0000000..1503cf2 Binary files /dev/null and b/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzBWV49_lSm1NYrwo-zkhivY.woff2 differ diff --git a/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzD0LW-43aMEzIO6XUTLjad8.woff2 b/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzD0LW-43aMEzIO6XUTLjad8.woff2 new file mode 100755 index 0000000..4d8eb89 Binary files /dev/null and b/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzD0LW-43aMEzIO6XUTLjad8.woff2 differ diff --git a/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzJX5f-9o1vgP2EXwfjgl7AY.woff2 b/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzJX5f-9o1vgP2EXwfjgl7AY.woff2 new file mode 100755 index 0000000..8394e2e Binary files /dev/null and b/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzJX5f-9o1vgP2EXwfjgl7AY.woff2 differ diff --git a/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzK-j2U0lmluP9RWlSytm3ho.woff2 b/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzK-j2U0lmluP9RWlSytm3ho.woff2 new file mode 100755 index 0000000..bef0033 Binary files /dev/null and b/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzK-j2U0lmluP9RWlSytm3ho.woff2 differ diff --git a/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzKaRobkAwv3vxw3jMhVENGA.woff2 b/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzKaRobkAwv3vxw3jMhVENGA.woff2 new file mode 100755 index 0000000..ffc6ce4 Binary files /dev/null and b/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzKaRobkAwv3vxw3jMhVENGA.woff2 differ diff --git a/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzOgdm0LZdjqr5-oayXSOefg.woff2 b/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzOgdm0LZdjqr5-oayXSOefg.woff2 new file mode 100755 index 0000000..be4c25b Binary files /dev/null and b/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzOgdm0LZdjqr5-oayXSOefg.woff2 differ diff --git a/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzP8zf_FOSsgRmwsS7Aa9k2w.woff2 b/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzP8zf_FOSsgRmwsS7Aa9k2w.woff2 new file mode 100755 index 0000000..cf04c33 Binary files /dev/null and b/admin/assets/fonts/gfonts/k3k702ZOKiLJc3WVjuplzP8zf_FOSsgRmwsS7Aa9k2w.woff2 differ diff --git a/admin/assets/fonts/gfonts/mErvLBYg_cXG3rLvUsKT_fesZW2xOQ-xsNqO47m55DA.woff2 b/admin/assets/fonts/gfonts/mErvLBYg_cXG3rLvUsKT_fesZW2xOQ-xsNqO47m55DA.woff2 new file mode 100755 index 0000000..d08397f Binary files /dev/null and b/admin/assets/fonts/gfonts/mErvLBYg_cXG3rLvUsKT_fesZW2xOQ-xsNqO47m55DA.woff2 differ diff --git a/admin/assets/fonts/gfonts/mbmhprMH69Zi6eEPBYVFhRJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/mbmhprMH69Zi6eEPBYVFhRJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..d92b712 Binary files /dev/null and b/admin/assets/fonts/gfonts/mbmhprMH69Zi6eEPBYVFhRJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/gfonts/mx9Uck6uB63VIKFYnEMXrRJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/mx9Uck6uB63VIKFYnEMXrRJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..314cf3f Binary files /dev/null and b/admin/assets/fonts/gfonts/mx9Uck6uB63VIKFYnEMXrRJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/gfonts/oHi30kwQWvpCWqAhzHcCSBJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/oHi30kwQWvpCWqAhzHcCSBJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..b3ca824 Binary files /dev/null and b/admin/assets/fonts/gfonts/oHi30kwQWvpCWqAhzHcCSBJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/gfonts/oOeFwZNlrTefzLYmlVV1UBJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/oOeFwZNlrTefzLYmlVV1UBJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..604b893 Binary files /dev/null and b/admin/assets/fonts/gfonts/oOeFwZNlrTefzLYmlVV1UBJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/gfonts/rGvHdJnr2l75qb0YND9NyBJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/rGvHdJnr2l75qb0YND9NyBJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..7e1a807 Binary files /dev/null and b/admin/assets/fonts/gfonts/rGvHdJnr2l75qb0YND9NyBJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/gfonts/u-WUoqrET9fUeobQW7jkRRJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/u-WUoqrET9fUeobQW7jkRRJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..0b5a66e Binary files /dev/null and b/admin/assets/fonts/gfonts/u-WUoqrET9fUeobQW7jkRRJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/gfonts/u0TOpm082MNkS5K0Q4rhqvesZW2xOQ-xsNqO47m55DA.woff2 b/admin/assets/fonts/gfonts/u0TOpm082MNkS5K0Q4rhqvesZW2xOQ-xsNqO47m55DA.woff2 new file mode 100755 index 0000000..f630772 Binary files /dev/null and b/admin/assets/fonts/gfonts/u0TOpm082MNkS5K0Q4rhqvesZW2xOQ-xsNqO47m55DA.woff2 differ diff --git a/admin/assets/fonts/gfonts/xozscpT2726on7jbcb_pAhJtnKITppOI_IvcXXDNrsc.woff2 b/admin/assets/fonts/gfonts/xozscpT2726on7jbcb_pAhJtnKITppOI_IvcXXDNrsc.woff2 new file mode 100755 index 0000000..7971f53 Binary files /dev/null and b/admin/assets/fonts/gfonts/xozscpT2726on7jbcb_pAhJtnKITppOI_IvcXXDNrsc.woff2 differ diff --git a/admin/assets/fonts/index.html b/admin/assets/fonts/index.html new file mode 100755 index 0000000..e69de29 diff --git a/admin/assets/icons.css b/admin/assets/icons.css new file mode 100755 index 0000000..b27ca9e --- /dev/null +++ b/admin/assets/icons.css @@ -0,0 +1,2289 @@ +@font-face { + font-family: 'cmsicons'; + src: url('fonts/cmsicons.eot?26rmlx'); + src: url('fonts/cmsicons.eot?26rmlx#iefix') format('embedded-opentype'), + url('fonts/cmsicons.ttf?26rmlx') format('truetype'), + url('fonts/cmsicons.woff?26rmlx') format('woff'), + url('fonts/cmsicons.svg?26rmlx#cmsicons') format('svg'); + font-weight: normal; + font-style: normal; +} + +[class^="icon-"], [class*=" icon-"], .icon { + /* use !important to prevent issues with browser extensions that change fonts */ + font-family: 'cmsicons' !important; + 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; +} + +.icon-glass:before { + content: "\f000"; +} +.icon-music:before { + content: "\f001"; +} +.icon-search:before { + content: "\f002"; +} +.icon-envelope-o:before { + content: "\f003"; +} +.icon-heart:before { + content: "\f004"; +} +.icon-star:before { + content: "\f005"; +} +.icon-star-o:before { + content: "\f006"; +} +.icon-user:before { + content: "\f007"; +} +.icon-film:before { + content: "\f008"; +} +.icon-th-large:before { + content: "\f009"; +} +.icon-th:before { + content: "\f00a"; +} +.icon-th-list:before { + content: "\f00b"; +} +.icon-check:before { + content: "\f00c"; +} +.icon-close:before { + content: "\f00d"; +} +.icon-remove:before { + content: "\f00d"; +} +.icon-times:before { + content: "\f00d"; +} +.icon-power-off:before { + content: "\f011"; +} +.icon-signal:before { + content: "\f012"; +} +.icon-cog2:before { + content: "\f013"; +} +.icon-gear:before { + content: "\f013"; +} +.icon-trash-o:before { + content: "\f014"; +} +.icon-home2:before { + content: "\f015"; +} +.icon-file-o:before { + content: "\f016"; +} +.icon-clock-o:before { + content: "\f017"; +} +.icon-road:before { + content: "\f018"; +} +.icon-download:before { + content: "\f019"; +} +.icon-arrow-circle-o-down:before { + content: "\f01a"; +} +.icon-arrow-circle-o-up:before { + content: "\f01b"; +} +.icon-inbox:before { + content: "\f01c"; +} +.icon-play-circle-o:before { + content: "\f01d"; +} +.icon-repeat:before { + content: "\f01e"; +} +.icon-rotate-right:before { + content: "\f01e"; +} +.icon-refresh:before { + content: "\f021"; +} +.icon-list-alt:before { + content: "\f022"; +} +.icon-lock2:before { + content: "\f023"; +} +.icon-flag:before { + content: "\f024"; +} +.icon-headphones:before { + content: "\f025"; +} +.icon-volume-off:before { + content: "\f026"; +} +.icon-volume-down:before { + content: "\f027"; +} +.icon-volume-up:before { + content: "\f028"; +} +.icon-qrcode:before { + content: "\f029"; +} +.icon-barcode:before { + content: "\f02a"; +} +.icon-tag:before { + content: "\f02b"; +} +.icon-tags:before { + content: "\f02c"; +} +.icon-book:before { + content: "\f02d"; +} +.icon-bookmark:before { + content: "\f02e"; +} +.icon-print:before { + content: "\f02f"; +} +.icon-camera2:before { + content: "\f030"; +} +.icon-font:before { + content: "\f031"; +} +.icon-bold:before { + content: "\f032"; +} +.icon-italic:before { + content: "\f033"; +} +.icon-text-height:before { + content: "\f034"; +} +.icon-text-width:before { + content: "\f035"; +} +.icon-align-left:before { + content: "\f036"; +} +.icon-align-center:before { + content: "\f037"; +} +.icon-align-right:before { + content: "\f038"; +} +.icon-align-justify:before { + content: "\f039"; +} +.icon-list:before { + content: "\f03a"; +} +.icon-dedent:before { + content: "\f03b"; +} +.icon-outdent:before { + content: "\f03b"; +} +.icon-indent:before { + content: "\f03c"; +} +.icon-video-camera:before { + content: "\f03d"; +} +.icon-image2:before { + content: "\f03e"; +} +.icon-photo:before { + content: "\f03e"; +} +.icon-picture-o:before { + content: "\f03e"; +} +.icon-pencil2:before { + content: "\f040"; +} +.icon-map-marker:before { + content: "\f041"; +} +.icon-adjust:before { + content: "\f042"; +} +.icon-tint:before { + content: "\f043"; +} +.icon-edit:before { + content: "\f044"; +} +.icon-pencil-square-o:before { + content: "\f044"; +} +.icon-share-square-o:before { + content: "\f045"; +} +.icon-check-square-o:before { + content: "\f046"; +} +.icon-step-backward:before { + content: "\f048"; +} +.icon-fast-backward:before { + content: "\f049"; +} +.icon-backward:before { + content: "\f04a"; +} +.icon-play:before { + content: "\f04b"; +} +.icon-pause:before { + content: "\f04c"; +} +.icon-stop:before { + content: "\f04d"; +} +.icon-forward:before { + content: "\f04e"; +} +.icon-fast-forward:before { + content: "\f050"; +} +.icon-step-forward:before { + content: "\f051"; +} +.icon-eject:before { + content: "\f052"; +} +.icon-chevron-left:before { + content: "\f053"; +} +.icon-chevron-right:before { + content: "\f054"; +} +.icon-plus-circle:before { + content: "\f055"; +} +.icon-minus-circle:before { + content: "\f056"; +} +.icon-times-circle:before { + content: "\f057"; +} +.icon-check-circle:before { + content: "\f058"; +} +.icon-question-circle:before { + content: "\f059"; +} +.icon-info-circle:before { + content: "\f05a"; +} +.icon-crosshairs:before { + content: "\f05b"; +} +.icon-times-circle-o:before { + content: "\f05c"; +} +.icon-check-circle-o:before { + content: "\f05d"; +} +.icon-ban:before { + content: "\f05e"; +} +.icon-arrow-left:before { + content: "\f060"; +} +.icon-arrow-right:before { + content: "\f061"; +} +.icon-arrow-up:before { + content: "\f062"; +} +.icon-arrow-down:before { + content: "\f063"; +} +.icon-mail-forward:before { + content: "\f064"; +} +.icon-share2:before { + content: "\f064"; +} +.icon-expand:before { + content: "\f065"; +} +.icon-compress:before { + content: "\f066"; +} +.icon-plus2:before { + content: "\f067"; +} +.icon-minus:before { + content: "\f068"; +} +.icon-asterisk:before { + content: "\f069"; +} +.icon-exclamation-circle:before { + content: "\f06a"; +} +.icon-gift:before { + content: "\f06b"; +} +.icon-leaf:before { + content: "\f06c"; +} +.icon-fire:before { + content: "\f06d"; +} +.icon-exclamation-triangle:before { + content: "\f071"; +} +.icon-warning:before { + content: "\f071"; +} +.icon-plane:before { + content: "\f072"; +} +.icon-calendar:before { + content: "\f073"; +} +.icon-random:before { + content: "\f074"; +} +.icon-comment:before { + content: "\f075"; +} +.icon-magnet:before { + content: "\f076"; +} +.icon-chevron-up:before { + content: "\f077"; +} +.icon-chevron-down:before { + content: "\f078"; +} +.icon-folder2:before { + content: "\f07b"; +} +.icon-folder-open2:before { + content: "\f07c"; +} +.icon-arrows-v:before { + content: "\f07d"; +} +.icon-arrows-h:before { + content: "\f07e"; +} +.icon-bar-chart:before { + content: "\f080"; +} +.icon-bar-chart-o:before { + content: "\f080"; +} +.icon-twitter-square:before { + content: "\f081"; +} +.icon-facebook-square:before { + content: "\f082"; +} +.icon-camera-retro:before { + content: "\f083"; +} +.icon-key:before { + content: "\f084"; +} +.icon-cogs2:before { + content: "\f085"; +} +.icon-gears:before { + content: "\f085"; +} +.icon-comments:before { + content: "\f086"; +} +.icon-thumbs-o-up:before { + content: "\f087"; +} +.icon-thumbs-o-down:before { + content: "\f088"; +} +.icon-star-half:before { + content: "\f089"; +} +.icon-heart-o:before { + content: "\f08a"; +} +.icon-sign-out:before { + content: "\f08b"; +} +.icon-linkedin-square:before { + content: "\f08c"; +} +.icon-thumb-tack:before { + content: "\f08d"; +} +.icon-external-link:before { + content: "\f08e"; +} +.icon-sign-in:before { + content: "\f090"; +} +.icon-trophy:before { + content: "\f091"; +} +.icon-github-square:before { + content: "\f092"; +} +.icon-upload2:before { + content: "\f093"; +} +.icon-lemon-o:before { + content: "\f094"; +} +.icon-phone:before { + content: "\f095"; +} +.icon-square-o:before { + content: "\f096"; +} +.icon-bookmark-o:before { + content: "\f097"; +} +.icon-phone-square:before { + content: "\f098"; +} +.icon-twitter:before { + content: "\f099"; +} +.icon-facebook:before { + content: "\f09a"; +} +.icon-facebook-f:before { + content: "\f09a"; +} +.icon-github:before { + content: "\f09b"; +} +.icon-unlock:before { + content: "\f09c"; +} +.icon-credit-card:before { + content: "\f09d"; +} +.icon-feed:before { + content: "\f09e"; +} +.icon-rss:before { + content: "\f09e"; +} +.icon-hdd-o:before { + content: "\f0a0"; +} +.icon-bullhorn:before { + content: "\f0a1"; +} +.icon-bell-o:before { + content: "\f0a2"; +} +.icon-certificate:before { + content: "\f0a3"; +} +.icon-hand-o-right:before { + content: "\f0a4"; +} +.icon-hand-o-left:before { + content: "\f0a5"; +} +.icon-hand-o-up:before { + content: "\f0a6"; +} +.icon-hand-o-down:before { + content: "\f0a7"; +} +.icon-arrow-circle-left:before { + content: "\f0a8"; +} +.icon-arrow-circle-right:before { + content: "\f0a9"; +} +.icon-arrow-circle-up:before { + content: "\f0aa"; +} +.icon-arrow-circle-down:before { + content: "\f0ab"; +} +.icon-globe:before { + content: "\f0ac"; +} +.icon-wrench2:before { + content: "\f0ad"; +} +.icon-tasks:before { + content: "\f0ae"; +} +.icon-filter:before { + content: "\f0b0"; +} +.icon-briefcase:before { + content: "\f0b1"; +} +.icon-arrows-alt:before { + content: "\f0b2"; +} +.icon-group2:before { + content: "\f0c0"; +} +.icon-users2:before { + content: "\f0c0"; +} +.icon-chain:before { + content: "\f0c1"; +} +.icon-link2:before { + content: "\f0c1"; +} +.icon-cloud:before { + content: "\f0c2"; +} +.icon-flask:before { + content: "\f0c3"; +} +.icon-cut:before { + content: "\f0c4"; +} +.icon-scissors:before { + content: "\f0c4"; +} +.icon-copy:before { + content: "\f0c5"; +} +.icon-files-o:before { + content: "\f0c5"; +} +.icon-paperclip:before { + content: "\f0c6"; +} +.icon-floppy-o:before { + content: "\f0c7"; +} +.icon-save:before { + content: "\f0c7"; +} +.icon-square:before { + content: "\f0c8"; +} +.icon-bars:before { + content: "\f0c9"; +} +.icon-navicon:before { + content: "\f0c9"; +} +.icon-reorder:before { + content: "\f0c9"; +} +.icon-list-ul:before { + content: "\f0ca"; +} +.icon-list-ol:before { + content: "\f0cb"; +} +.icon-strikethrough:before { + content: "\f0cc"; +} +.icon-underline:before { + content: "\f0cd"; +} +.icon-table:before { + content: "\f0ce"; +} +.icon-magic:before { + content: "\f0d0"; +} +.icon-truck:before { + content: "\f0d1"; +} +.icon-pinterest:before { + content: "\f0d2"; +} +.icon-pinterest-square:before { + content: "\f0d3"; +} +.icon-google-plus-square:before { + content: "\f0d4"; +} +.icon-google-plus:before { + content: "\f0d5"; +} +.icon-money:before { + content: "\f0d6"; +} +.icon-caret-down:before { + content: "\f0d7"; +} +.icon-caret-up:before { + content: "\f0d8"; +} +.icon-caret-left:before { + content: "\f0d9"; +} +.icon-caret-right:before { + content: "\f0da"; +} +.icon-columns:before { + content: "\f0db"; +} +.icon-sort:before { + content: "\f0dc"; +} +.icon-unsorted:before { + content: "\f0dc"; +} +.icon-sort-desc:before { + content: "\f0dd"; +} +.icon-sort-down:before { + content: "\f0dd"; +} +.icon-sort-asc:before { + content: "\f0de"; +} +.icon-sort-up:before { + content: "\f0de"; +} +.icon-envelope:before { + content: "\f0e0"; +} +.icon-linkedin:before { + content: "\f0e1"; +} +.icon-rotate-left:before { + content: "\f0e2"; +} +.icon-undo:before { + content: "\f0e2"; +} +.icon-gavel:before { + content: "\f0e3"; +} +.icon-legal:before { + content: "\f0e3"; +} +.icon-dashboard:before { + content: "\f0e4"; +} +.icon-tachometer:before { + content: "\f0e4"; +} +.icon-comment-o:before { + content: "\f0e5"; +} +.icon-comments-o:before { + content: "\f0e6"; +} +.icon-bolt:before { + content: "\f0e7"; +} +.icon-flash:before { + content: "\f0e7"; +} +.icon-sitemap:before { + content: "\f0e8"; +} +.icon-umbrella:before { + content: "\f0e9"; +} +.icon-clipboard:before { + content: "\f0ea"; +} +.icon-paste:before { + content: "\f0ea"; +} +.icon-lightbulb-o:before { + content: "\f0eb"; +} +.icon-exchange:before { + content: "\f0ec"; +} +.icon-cloud-download:before { + content: "\f0ed"; +} +.icon-cloud-upload:before { + content: "\f0ee"; +} +.icon-user-md:before { + content: "\f0f0"; +} +.icon-stethoscope:before { + content: "\f0f1"; +} +.icon-suitcase:before { + content: "\f0f2"; +} +.icon-bell:before { + content: "\f0f3"; +} +.icon-coffee:before { + content: "\f0f4"; +} +.icon-cutlery:before { + content: "\f0f5"; +} +.icon-file-text-o:before { + content: "\f0f6"; +} +.icon-building-o:before { + content: "\f0f7"; +} +.icon-hospital-o:before { + content: "\f0f8"; +} +.icon-ambulance:before { + content: "\f0f9"; +} +.icon-medkit:before { + content: "\f0fa"; +} +.icon-fighter-jet:before { + content: "\f0fb"; +} +.icon-beer:before { + content: "\f0fc"; +} +.icon-h-square:before { + content: "\f0fd"; +} +.icon-plus-square:before { + content: "\f0fe"; +} +.icon-angle-double-left:before { + content: "\f100"; +} +.icon-angle-double-right:before { + content: "\f101"; +} +.icon-angle-double-up:before { + content: "\f102"; +} +.icon-angle-double-down:before { + content: "\f103"; +} +.icon-angle-left:before { + content: "\f104"; +} +.icon-angle-right:before { + content: "\f105"; +} +.icon-angle-up:before { + content: "\f106"; +} +.icon-angle-down:before { + content: "\f107"; +} +.icon-desktop:before { + content: "\f108"; +} +.icon-laptop:before { + content: "\f109"; +} +.icon-tablet:before { + content: "\f10a"; +} +.icon-mobile:before { + content: "\f10b"; +} +.icon-mobile-phone:before { + content: "\f10b"; +} +.icon-circle-o:before { + content: "\f10c"; +} +.icon-quote-left:before { + content: "\f10d"; +} +.icon-quote-right:before { + content: "\f10e"; +} +.icon-spinner:before { + content: "\f110"; +} +.icon-circle:before { + content: "\f111"; +} +.icon-mail-reply:before { + content: "\f112"; +} +.icon-reply:before { + content: "\f112"; +} +.icon-github-alt:before { + content: "\f113"; +} +.icon-folder-o:before { + content: "\f114"; +} +.icon-folder-open-o:before { + content: "\f115"; +} +.icon-smile-o:before { + content: "\f118"; +} +.icon-frown-o:before { + content: "\f119"; +} +.icon-meh-o:before { + content: "\f11a"; +} +.icon-gamepad:before { + content: "\f11b"; +} +.icon-keyboard-o:before { + content: "\f11c"; +} +.icon-flag-o:before { + content: "\f11d"; +} +.icon-flag-checkered:before { + content: "\f11e"; +} +.icon-terminal:before { + content: "\f120"; +} +.icon-code:before { + content: "\f121"; +} +.icon-mail-reply-all:before { + content: "\f122"; +} +.icon-reply-all:before { + content: "\f122"; +} +.icon-star-half-empty:before { + content: "\f123"; +} +.icon-star-half-full:before { + content: "\f123"; +} +.icon-star-half-o:before { + content: "\f123"; +} +.icon-location-arrow:before { + content: "\f124"; +} +.icon-crop:before { + content: "\f125"; +} +.icon-code-fork:before { + content: "\f126"; +} +.icon-chain-broken:before { + content: "\f127"; +} +.icon-unlink:before { + content: "\f127"; +} +.icon-question:before { + content: "\f128"; +} +.icon-info:before { + content: "\f129"; +} +.icon-exclamation:before { + content: "\f12a"; +} +.icon-superscript:before { + content: "\f12b"; +} +.icon-subscript:before { + content: "\f12c"; +} +.icon-eraser:before { + content: "\f12d"; +} +.icon-puzzle-piece:before { + content: "\f12e"; +} +.icon-microphone:before { + content: "\f130"; +} +.icon-microphone-slash:before { + content: "\f131"; +} +.icon-shield:before { + content: "\f132"; +} +.icon-calendar-o:before { + content: "\f133"; +} +.icon-fire-extinguisher:before { + content: "\f134"; +} +.icon-rocket:before { + content: "\f135"; +} +.icon-maxcdn:before { + content: "\f136"; +} +.icon-chevron-circle-left:before { + content: "\f137"; +} +.icon-chevron-circle-right:before { + content: "\f138"; +} +.icon-chevron-circle-up:before { + content: "\f139"; +} +.icon-chevron-circle-down:before { + content: "\f13a"; +} +.icon-html5:before { + content: "\f13b"; +} +.icon-css3:before { + content: "\f13c"; +} +.icon-anchor2:before { + content: "\f13d"; +} +.icon-unlock-alt:before { + content: "\f13e"; +} +.icon-bullseye:before { + content: "\f140"; +} +.icon-ellipsis-h:before { + content: "\f141"; +} +.icon-ellipsis-v:before { + content: "\f142"; +} +.icon-rss-square:before { + content: "\f143"; +} +.icon-play-circle:before { + content: "\f144"; +} +.icon-ticket:before { + content: "\f145"; +} +.icon-minus-square:before { + content: "\f146"; +} +.icon-minus-square-o:before { + content: "\f147"; +} +.icon-level-up:before { + content: "\f148"; +} +.icon-level-down:before { + content: "\f149"; +} +.icon-check-square:before { + content: "\f14a"; +} +.icon-pencil-square:before { + content: "\f14b"; +} +.icon-external-link-square:before { + content: "\f14c"; +} +.icon-share-square:before { + content: "\f14d"; +} +.icon-compass:before { + content: "\f14e"; +} +.icon-caret-square-o-down:before { + content: "\f150"; +} +.icon-toggle-down:before { + content: "\f150"; +} +.icon-caret-square-o-up:before { + content: "\f151"; +} +.icon-toggle-up:before { + content: "\f151"; +} +.icon-caret-square-o-right:before { + content: "\f152"; +} +.icon-toggle-right:before { + content: "\f152"; +} +.icon-eur:before { + content: "\f153"; +} +.icon-euro:before { + content: "\f153"; +} +.icon-gbp:before { + content: "\f154"; +} +.icon-dollar:before { + content: "\f155"; +} +.icon-usd:before { + content: "\f155"; +} +.icon-inr:before { + content: "\f156"; +} +.icon-rupee:before { + content: "\f156"; +} +.icon-cny:before { + content: "\f157"; +} +.icon-jpy:before { + content: "\f157"; +} +.icon-rmb:before { + content: "\f157"; +} +.icon-yen:before { + content: "\f157"; +} +.icon-rouble:before { + content: "\f158"; +} +.icon-rub:before { + content: "\f158"; +} +.icon-ruble:before { + content: "\f158"; +} +.icon-krw:before { + content: "\f159"; +} +.icon-won:before { + content: "\f159"; +} +.icon-bitcoin:before { + content: "\f15a"; +} +.icon-btc:before { + content: "\f15a"; +} +.icon-file:before { + content: "\f15b"; +} +.icon-file-text:before { + content: "\f15c"; +} +.icon-sort-alpha-asc:before { + content: "\f15d"; +} +.icon-sort-alpha-desc:before { + content: "\f15e"; +} +.icon-sort-amount-asc:before { + content: "\f160"; +} +.icon-sort-amount-desc:before { + content: "\f161"; +} +.icon-sort-numeric-asc:before { + content: "\f162"; +} +.icon-sort-numeric-desc:before { + content: "\f163"; +} +.icon-thumbs-up:before { + content: "\f164"; +} +.icon-thumbs-down:before { + content: "\f165"; +} +.icon-youtube-square:before { + content: "\f166"; +} +.icon-youtube:before { + content: "\f167"; +} +.icon-xing:before { + content: "\f168"; +} +.icon-xing-square:before { + content: "\f169"; +} +.icon-youtube-play:before { + content: "\f16a"; +} +.icon-dropbox:before { + content: "\f16b"; +} +.icon-stack-overflow:before { + content: "\f16c"; +} +.icon-instagram:before { + content: "\f16d"; +} +.icon-flickr:before { + content: "\f16e"; +} +.icon-adn:before { + content: "\f170"; +} +.icon-bitbucket:before { + content: "\f171"; +} +.icon-bitbucket-square:before { + content: "\f172"; +} +.icon-tumblr:before { + content: "\f173"; +} +.icon-tumblr-square:before { + content: "\f174"; +} +.icon-long-arrow-down:before { + content: "\f175"; +} +.icon-long-arrow-up:before { + content: "\f176"; +} +.icon-long-arrow-left:before { + content: "\f177"; +} +.icon-long-arrow-right:before { + content: "\f178"; +} +.icon-apple:before { + content: "\f179"; +} +.icon-windows:before { + content: "\f17a"; +} +.icon-android:before { + content: "\f17b"; +} +.icon-linux:before { + content: "\f17c"; +} +.icon-dribbble:before { + content: "\f17d"; +} +.icon-skype:before { + content: "\f17e"; +} +.icon-foursquare:before { + content: "\f180"; +} +.icon-trello:before { + content: "\f181"; +} +.icon-female:before { + content: "\f182"; +} +.icon-male:before { + content: "\f183"; +} +.icon-gittip:before { + content: "\f184"; +} +.icon-gratipay:before { + content: "\f184"; +} +.icon-sun-o:before { + content: "\f185"; +} +.icon-moon-o:before { + content: "\f186"; +} +.icon-archive:before { + content: "\f187"; +} +.icon-bug:before { + content: "\f188"; +} +.icon-vk:before { + content: "\f189"; +} +.icon-weibo:before { + content: "\f18a"; +} +.icon-renren:before { + content: "\f18b"; +} +.icon-pagelines:before { + content: "\f18c"; +} +.icon-stack-exchange:before { + content: "\f18d"; +} +.icon-arrow-circle-o-right:before { + content: "\f18e"; +} +.icon-arrow-circle-o-left:before { + content: "\f190"; +} +.icon-caret-square-o-left:before { + content: "\f191"; +} +.icon-toggle-left:before { + content: "\f191"; +} +.icon-dot-circle-o:before { + content: "\f192"; +} +.icon-wheelchair:before { + content: "\f193"; +} +.icon-vimeo-square:before { + content: "\f194"; +} +.icon-try:before { + content: "\f195"; +} +.icon-turkish-lira:before { + content: "\f195"; +} +.icon-plus-square-o:before { + content: "\f196"; +} +.icon-space-shuttle:before { + content: "\f197"; +} +.icon-slack:before { + content: "\f198"; +} +.icon-envelope-square:before { + content: "\f199"; +} +.icon-wordpress:before { + content: "\f19a"; +} +.icon-openid:before { + content: "\f19b"; +} +.icon-bank:before { + content: "\f19c"; +} +.icon-institution:before { + content: "\f19c"; +} +.icon-university:before { + content: "\f19c"; +} +.icon-graduation-cap:before { + content: "\f19d"; +} +.icon-mortar-board:before { + content: "\f19d"; +} +.icon-yahoo:before { + content: "\f19e"; +} +.icon-google:before { + content: "\f1a0"; +} +.icon-reddit:before { + content: "\f1a1"; +} +.icon-reddit-square:before { + content: "\f1a2"; +} +.icon-stumbleupon-circle:before { + content: "\f1a3"; +} +.icon-stumbleupon:before { + content: "\f1a4"; +} +.icon-delicious:before { + content: "\f1a5"; +} +.icon-digg:before { + content: "\f1a6"; +} +.icon-pied-piper:before { + content: "\f1a7"; +} +.icon-pied-piper-alt:before { + content: "\f1a8"; +} +.icon-drupal:before { + content: "\f1a9"; +} +.icon-joomla:before { + content: "\f1aa"; +} +.icon-language:before { + content: "\f1ab"; +} +.icon-fax:before { + content: "\f1ac"; +} +.icon-building:before { + content: "\f1ad"; +} +.icon-child:before { + content: "\f1ae"; +} +.icon-paw:before { + content: "\f1b0"; +} +.icon-spoon:before { + content: "\f1b1"; +} +.icon-cube:before { + content: "\f1b2"; +} +.icon-cubes:before { + content: "\f1b3"; +} +.icon-behance:before { + content: "\f1b4"; +} +.icon-behance-square:before { + content: "\f1b5"; +} +.icon-steam:before { + content: "\f1b6"; +} +.icon-steam-square:before { + content: "\f1b7"; +} +.icon-recycle:before { + content: "\f1b8"; +} +.icon-automobile:before { + content: "\f1b9"; +} +.icon-car:before { + content: "\f1b9"; +} +.icon-cab:before { + content: "\f1ba"; +} +.icon-taxi:before { + content: "\f1ba"; +} +.icon-tree:before { + content: "\f1bb"; +} +.icon-spotify:before { + content: "\f1bc"; +} +.icon-deviantart:before { + content: "\f1bd"; +} +.icon-soundcloud:before { + content: "\f1be"; +} +.icon-database2:before { + content: "\f1c0"; +} +.icon-file-pdf-o:before { + content: "\f1c1"; +} +.icon-file-word-o:before { + content: "\f1c2"; +} +.icon-file-excel-o:before { + content: "\f1c3"; +} +.icon-file-powerpoint-o:before { + content: "\f1c4"; +} +.icon-file-image-o:before { + content: "\f1c5"; +} +.icon-file-photo-o:before { + content: "\f1c5"; +} +.icon-file-picture-o:before { + content: "\f1c5"; +} +.icon-file-archive-o:before { + content: "\f1c6"; +} +.icon-file-zip-o:before { + content: "\f1c6"; +} +.icon-file-audio-o:before { + content: "\f1c7"; +} +.icon-file-sound-o:before { + content: "\f1c7"; +} +.icon-file-movie-o:before { + content: "\f1c8"; +} +.icon-file-video-o:before { + content: "\f1c8"; +} +.icon-file-code-o:before { + content: "\f1c9"; +} +.icon-vine:before { + content: "\f1ca"; +} +.icon-codepen:before { + content: "\f1cb"; +} +.icon-jsfiddle:before { + content: "\f1cc"; +} +.icon-life-bouy:before { + content: "\f1cd"; +} +.icon-life-buoy:before { + content: "\f1cd"; +} +.icon-life-ring:before { + content: "\f1cd"; +} +.icon-life-saver:before { + content: "\f1cd"; +} +.icon-support:before { + content: "\f1cd"; +} +.icon-circle-o-notch:before { + content: "\f1ce"; +} +.icon-ra:before { + content: "\f1d0"; +} +.icon-rebel:before { + content: "\f1d0"; +} +.icon-empire:before { + content: "\f1d1"; +} +.icon-ge:before { + content: "\f1d1"; +} +.icon-git-square:before { + content: "\f1d2"; +} +.icon-git:before { + content: "\f1d3"; +} +.icon-hacker-news:before { + content: "\f1d4"; +} +.icon-y-combinator-square:before { + content: "\f1d4"; +} +.icon-yc-square:before { + content: "\f1d4"; +} +.icon-tencent-weibo:before { + content: "\f1d5"; +} +.icon-qq:before { + content: "\f1d6"; +} +.icon-wechat:before { + content: "\f1d7"; +} +.icon-weixin:before { + content: "\f1d7"; +} +.icon-paper-plane:before { + content: "\f1d8"; +} +.icon-send:before { + content: "\f1d8"; +} +.icon-paper-plane-o:before { + content: "\f1d9"; +} +.icon-send-o:before { + content: "\f1d9"; +} +.icon-history:before { + content: "\f1da"; +} +.icon-circle-thin:before { + content: "\f1db"; +} +.icon-header:before { + content: "\f1dc"; +} +.icon-paragraph:before { + content: "\f1dd"; +} +.icon-sliders:before { + content: "\f1de"; +} +.icon-share-alt:before { + content: "\f1e0"; +} +.icon-share-alt-square:before { + content: "\f1e1"; +} +.icon-bomb:before { + content: "\f1e2"; +} +.icon-futbol-o:before { + content: "\f1e3"; +} +.icon-soccer-ball-o:before { + content: "\f1e3"; +} +.icon-tty:before { + content: "\f1e4"; +} +.icon-binoculars:before { + content: "\f1e5"; +} +.icon-plug:before { + content: "\f1e6"; +} +.icon-slideshare:before { + content: "\f1e7"; +} +.icon-twitch:before { + content: "\f1e8"; +} +.icon-yelp:before { + content: "\f1e9"; +} +.icon-newspaper-o:before { + content: "\f1ea"; +} +.icon-wifi:before { + content: "\f1eb"; +} +.icon-calculator2:before { + content: "\f1ec"; +} +.icon-paypal:before { + content: "\f1ed"; +} +.icon-google-wallet:before { + content: "\f1ee"; +} +.icon-cc-visa:before { + content: "\f1f0"; +} +.icon-cc-mastercard:before { + content: "\f1f1"; +} +.icon-cc-discover:before { + content: "\f1f2"; +} +.icon-cc-amex:before { + content: "\f1f3"; +} +.icon-cc-paypal:before { + content: "\f1f4"; +} +.icon-cc-stripe:before { + content: "\f1f5"; +} +.icon-bell-slash:before { + content: "\f1f6"; +} +.icon-bell-slash-o:before { + content: "\f1f7"; +} +.icon-trash:before { + content: "\f1f8"; +} +.icon-copyright:before { + content: "\f1f9"; +} +.icon-at:before { + content: "\f1fa"; +} +.icon-eyedropper:before { + content: "\f1fb"; +} +.icon-paint-brush:before { + content: "\f1fc"; +} +.icon-birthday-cake:before { + content: "\f1fd"; +} +.icon-area-chart:before { + content: "\f1fe"; +} +.icon-pie-chart:before { + content: "\f200"; +} +.icon-line-chart:before { + content: "\f201"; +} +.icon-lastfm:before { + content: "\f202"; +} +.icon-lastfm-square:before { + content: "\f203"; +} +.icon-toggle-off:before { + content: "\f204"; +} +.icon-toggle-on:before { + content: "\f205"; +} +.icon-bicycle:before { + content: "\f206"; +} +.icon-bus:before { + content: "\f207"; +} +.icon-ioxhost:before { + content: "\f208"; +} +.icon-angellist:before { + content: "\f209"; +} +.icon-cc:before { + content: "\f20a"; +} +.icon-ils:before { + content: "\f20b"; +} +.icon-shekel:before { + content: "\f20b"; +} +.icon-sheqel:before { + content: "\f20b"; +} +.icon-meanpath:before { + content: "\f20c"; +} +.icon-buysellads:before { + content: "\f20d"; +} +.icon-connectdevelop:before { + content: "\f20e"; +} +.icon-dashcube:before { + content: "\f210"; +} +.icon-forumbee:before { + content: "\f211"; +} +.icon-leanpub:before { + content: "\f212"; +} +.icon-sellsy:before { + content: "\f213"; +} +.icon-shirtsinbulk:before { + content: "\f214"; +} +.icon-simplybuilt:before { + content: "\f215"; +} +.icon-skyatlas:before { + content: "\f216"; +} +.icon-cart-plus:before { + content: "\f217"; +} +.icon-cart-arrow-down:before { + content: "\f218"; +} +.icon-diamond:before { + content: "\f219"; +} +.icon-ship:before { + content: "\f21a"; +} +.icon-user-secret:before { + content: "\f21b"; +} +.icon-motorcycle:before { + content: "\f21c"; +} +.icon-street-view:before { + content: "\f21d"; +} +.icon-heartbeat:before { + content: "\f21e"; +} +.icon-venus:before { + content: "\f221"; +} +.icon-mars:before { + content: "\f222"; +} +.icon-mercury:before { + content: "\f223"; +} +.icon-intersex:before { + content: "\f224"; +} +.icon-transgender:before { + content: "\f224"; +} +.icon-transgender-alt:before { + content: "\f225"; +} +.icon-venus-double:before { + content: "\f226"; +} +.icon-mars-double:before { + content: "\f227"; +} +.icon-venus-mars:before { + content: "\f228"; +} +.icon-mars-stroke:before { + content: "\f229"; +} +.icon-mars-stroke-v:before { + content: "\f22a"; +} +.icon-mars-stroke-h:before { + content: "\f22b"; +} +.icon-neuter:before { + content: "\f22c"; +} +.icon-genderless:before { + content: "\f22d"; +} +.icon-facebook-official:before { + content: "\f230"; +} +.icon-pinterest-p:before { + content: "\f231"; +} +.icon-whatsapp:before { + content: "\f232"; +} +.icon-server:before { + content: "\f233"; +} +.icon-user-plus2:before { + content: "\f234"; +} +.icon-user-times:before { + content: "\f235"; +} +.icon-bed:before { + content: "\f236"; +} +.icon-hotel:before { + content: "\f236"; +} +.icon-viacoin:before { + content: "\f237"; +} +.icon-train:before { + content: "\f238"; +} +.icon-subway:before { + content: "\f239"; +} +.icon-medium:before { + content: "\f23a"; +} +.icon-y-combinator:before { + content: "\f23b"; +} +.icon-yc:before { + content: "\f23b"; +} +.icon-optin-monster:before { + content: "\f23c"; +} +.icon-opencart:before { + content: "\f23d"; +} +.icon-expeditedssl:before { + content: "\f23e"; +} +.icon-battery-4:before { + content: "\f240"; +} +.icon-battery-full:before { + content: "\f240"; +} +.icon-battery-3:before { + content: "\f241"; +} +.icon-battery-three-quarters:before { + content: "\f241"; +} +.icon-battery-2:before { + content: "\f242"; +} +.icon-battery-half:before { + content: "\f242"; +} +.icon-battery-1:before { + content: "\f243"; +} +.icon-battery-quarter:before { + content: "\f243"; +} +.icon-battery-0:before { + content: "\f244"; +} +.icon-battery-empty:before { + content: "\f244"; +} +.icon-mouse-pointer:before { + content: "\f245"; +} +.icon-i-cursor:before { + content: "\f246"; +} +.icon-sticky-note:before { + content: "\f249"; +} +.icon-sticky-note-o:before { + content: "\f24a"; +} +.icon-cc-jcb:before { + content: "\f24b"; +} +.icon-cc-diners-club:before { + content: "\f24c"; +} +.icon-clone:before { + content: "\f24d"; +} +.icon-balance-scale:before { + content: "\f24e"; +} +.icon-hourglass-o:before { + content: "\f250"; +} +.icon-hourglass-1:before { + content: "\f251"; +} +.icon-hourglass-start:before { + content: "\f251"; +} +.icon-hourglass-2:before { + content: "\f252"; +} +.icon-hourglass-half:before { + content: "\f252"; +} +.icon-hourglass-3:before { + content: "\f253"; +} +.icon-hourglass-end:before { + content: "\f253"; +} +.icon-hourglass:before { + content: "\f254"; +} +.icon-hand-grab-o:before { + content: "\f255"; +} +.icon-hand-rock-o:before { + content: "\f255"; +} +.icon-hand-paper-o:before { + content: "\f256"; +} +.icon-hand-stop-o:before { + content: "\f256"; +} +.icon-hand-scissors-o:before { + content: "\f257"; +} +.icon-hand-lizard-o:before { + content: "\f258"; +} +.icon-hand-spock-o:before { + content: "\f259"; +} +.icon-hand-pointer-o:before { + content: "\f25a"; +} +.icon-hand-peace-o:before { + content: "\f25b"; +} +.icon-trademark:before { + content: "\f25c"; +} +.icon-registered:before { + content: "\f25d"; +} +.icon-creative-commons:before { + content: "\f25e"; +} +.icon-gg:before { + content: "\f260"; +} +.icon-gg-circle:before { + content: "\f261"; +} +.icon-tripadvisor:before { + content: "\f262"; +} +.icon-odnoklassniki:before { + content: "\f263"; +} +.icon-odnoklassniki-square:before { + content: "\f264"; +} +.icon-get-pocket:before { + content: "\f265"; +} +.icon-wikipedia-w:before { + content: "\f266"; +} +.icon-safari:before { + content: "\f267"; +} +.icon-chrome:before { + content: "\f268"; +} +.icon-firefox:before { + content: "\f269"; +} +.icon-opera:before { + content: "\f26a"; +} +.icon-internet-explorer:before { + content: "\f26b"; +} +.icon-television:before { + content: "\f26c"; +} +.icon-tv:before { + content: "\f26c"; +} +.icon-contao:before { + content: "\f26d"; +} +.icon-500px:before { + content: "\f26e"; +} +.icon-amazon:before { + content: "\f270"; +} +.icon-calendar-plus-o:before { + content: "\f271"; +} +.icon-calendar-minus-o:before { + content: "\f272"; +} +.icon-calendar-times-o:before { + content: "\f273"; +} +.icon-calendar-check-o:before { + content: "\f274"; +} +.icon-industry:before { + content: "\f275"; +} +.icon-map-pin:before { + content: "\f276"; +} +.icon-map-signs:before { + content: "\f277"; +} +.icon-map-o:before { + content: "\f278"; +} +.icon-map:before { + content: "\f279"; +} +.icon-commenting:before { + content: "\f27a"; +} +.icon-commenting-o:before { + content: "\f27b"; +} +.icon-houzz:before { + content: "\f27c"; +} +.icon-vimeo:before { + content: "\f27d"; +} +.icon-black-tie:before { + content: "\f27e"; +} +.icon-fonticons:before { + content: "\f280"; +} +.icon-reddit-alien:before { + content: "\f281"; +} +.icon-edge:before { + content: "\f282"; +} +.icon-credit-card-alt:before { + content: "\f283"; +} +.icon-codiepie:before { + content: "\f284"; +} +.icon-modx:before { + content: "\f285"; +} +.icon-fort-awesome:before { + content: "\f286"; +} +.icon-usb:before { + content: "\f287"; +} +.icon-product-hunt:before { + content: "\f288"; +} +.icon-mixcloud:before { + content: "\f289"; +} +.icon-scribd:before { + content: "\f28a"; +} +.icon-pause-circle:before { + content: "\f28b"; +} +.icon-pause-circle-o:before { + content: "\f28c"; +} +.icon-stop-circle:before { + content: "\f28d"; +} +.icon-stop-circle-o:before { + content: "\f28e"; +} +.icon-shopping-bag:before { + content: "\f290"; +} +.icon-shopping-basket:before { + content: "\f291"; +} +.icon-hashtag:before { + content: "\f292"; +} +.icon-bluetooth:before { + content: "\f293"; +} +.icon-bluetooth-b:before { + content: "\f294"; +} +.icon-percent:before { + content: "\f295"; +} +.icon-search-plus:before { + content: "\f00e"; +} +.icon-search-minus:before { + content: "\f010"; +} +.icon-arrows:before { + content: "\f047"; +} +.icon-eye:before { + content: "\f06e"; +} +.icon-eye-slash:before { + content: "\f070"; +} +.icon-retweet:before { + content: "\f079"; +} +.icon-shopping-cart:before { + content: "\f07a"; +} +.icon-object-group:before { + content: "\f247"; +} +.icon-object-ungroup:before { + content: "\f248"; +} +.icon-anchor:before { + content: "\e902"; +} +.icon-file-symlink-directory:before { + content: "\e903"; +} +.icon-cart:before { + content: "\e901"; +} +.icon-link:before { + content: "\e904"; +} +.icon-coins:before { + content: "\e603"; +} +.icon-group:before { + content: "\e604"; +} +.icon-type:before { + content: "\e602"; +} +.icon-arrow-back:before { + content: "\e601"; +} +.icon-loudspeaker31:before { + content: "\e605"; +} +.icon-ecke:before { + content: "\e600"; +} +.icon-home:before { + content: "\e900"; +} +.icon-pencil:before { + content: "\e905"; +} +.icon-image:before { + content: "\e90d"; +} +.icon-images:before { + content: "\e90e"; +} +.icon-camera:before { + content: "\e90f"; +} +.icon-file-empty:before { + content: "\e924"; +} +.icon-files-empty:before { + content: "\e925"; +} +.icon-file-text2:before { + content: "\e926"; +} +.icon-file-picture:before { + content: "\e927"; +} +.icon-stack:before { + content: "\e92e"; +} +.icon-folder:before { + content: "\e92f"; +} +.icon-folder-open:before { + content: "\e930"; +} +.icon-folder-plus:before { + content: "\e931"; +} +.icon-calculator:before { + content: "\e940"; +} +.icon-envelop:before { + content: "\e945"; +} +.icon-display:before { + content: "\e956"; +} +.icon-drawer:before { + content: "\e95c"; +} +.icon-drawer2:before { + content: "\e95d"; +} +.icon-box-add:before { + content: "\e95e"; +} +.icon-upload:before { + content: "\e961"; +} +.icon-drive:before { + content: "\e963"; +} +.icon-database:before { + content: "\e964"; +} +.icon-redo2:before { + content: "\e968"; +} +.icon-bubble:before { + content: "\e96b"; +} +.icon-bubbles2:before { + content: "\e96d"; +} +.icon-bubbles4:before { + content: "\e970"; +} +.icon-users:before { + content: "\e972"; +} +.icon-user-plus:before { + content: "\e973"; +} +.icon-user-minus:before { + content: "\e974"; +} +.icon-hour-glass:before { + content: "\e979"; +} +.icon-zoom-in:before { + content: "\e987"; +} +.icon-lock:before { + content: "\e98f"; +} +.icon-unlocked:before { + content: "\e990"; +} +.icon-wrench:before { + content: "\e991"; +} +.icon-equalizer2:before { + content: "\e993"; +} +.icon-cog:before { + content: "\e994"; +} +.icon-cogs:before { + content: "\e995"; +} +.icon-bin:before { + content: "\e9ac"; +} +.icon-list2:before { + content: "\e9bb"; +} +.icon-menu:before { + content: "\e9bd"; +} +.icon-download2:before { + content: "\e9c5"; +} +.icon-plus:before { + content: "\ea0a"; +} +.icon-blocked:before { + content: "\ea0e"; +} +.icon-cross:before { + content: "\ea0f"; +} +.icon-checkmark:before { + content: "\ea10"; +} +.icon-checkmark2:before { + content: "\ea11"; +} +.icon-enter:before { + content: "\ea13"; +} +.icon-exit:before { + content: "\ea14"; +} +.icon-share:before { + content: "\ea7d"; +} +.icon-libreoffice:before { + content: "\eade"; +} + diff --git a/admin/assets/js/index.html b/admin/assets/js/index.html new file mode 100755 index 0000000..e69de29 diff --git a/admin/assets/js/jquery.min.js b/admin/assets/js/jquery.min.js new file mode 100755 index 0000000..a850f9f --- /dev/null +++ b/admin/assets/js/jquery.min.js @@ -0,0 +1,4 @@ +/*! jQuery v2.2.3 | (c) jQuery Foundation | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c; +}catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length",""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,la=/\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n(""}else"application/x-shockwave-flash"==e.source1mime?(f+='',e.poster&&(f+=''),f+=""):-1!=e.source1mime.indexOf("audio")?a.settings.audio_template_callback?f=a.settings.audio_template_callback(e):f+='":"script"==e.type?f+='':f=a.settings.video_template_callback?a.settings.video_template_callback(e):'"}return f}function h(a){var b={};return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",start:function(a,c){if(b.source1||"param"!=a||(b.source1=c.map.movie),("iframe"==a||"object"==a||"embed"==a||"video"==a||"audio"==a)&&(b.type||(b.type=a),b=tinymce.extend(c.map,b)),"script"==a){var e=d(c.map.src);if(!e)return;b={type:"script",source1:c.map.src,width:e.width,height:e.height}}"source"==a&&(b.source1?b.source2||(b.source2=c.map.src):b.source1=c.map.src),"img"!=a||b.poster||(b.poster=c.map.src)}}).parse(a),b.source1=b.source1||b.src||b.data,b.source2=b.source2||"",b.poster=b.poster||"",b}function i(b){return b.getAttribute("data-mce-object")?h(a.serializer.serialize(b,{selection:!0})):{}}function j(b){if(a.settings.media_filter_html===!1)return b;var c,d=new tinymce.html.Writer;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!1,special:"script,noscript",comment:function(a){d.comment(a)},cdata:function(a){d.cdata(a)},text:function(a,b){d.text(a,b)},start:function(b,e,f){if(c=!0,"script"!=b&&"noscript"!=b){for(var g=0;g=g&&(d(h,{src:b["source"+g],type:b["source"+g+"mime"]}),!b["source"+g]))return;break;case"img":if(!b.poster)return;e=!0}f.start(a,h,i)},end:function(a){if("video"==a&&c)for(var h=1;2>=h;h++)if(b["source"+h]){var i=[];i.map={},h>g&&(d(i,{src:b["source"+h],type:b["source"+h+"mime"]}),f.start("source",i,!0))}if(b.poster&&"object"==a&&c&&!e){var j=[];j.map={},d(j,{src:b.poster,width:b.width,height:b.height}),f.start("img",j,!0)}f.end(a)}},new tinymce.html.Schema({})).parse(a),f.getContent()}var l=[{regex:/youtu\.be\/([\w\-.]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$2",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowfullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$2?title=0&byline=0",allowfullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1}],m=tinymce.Env.ie&&tinymce.Env.ie<=8?"onChange":"onInput";a.on("ResolveName",function(a){var b;1==a.target.nodeType&&(b=a.target.getAttribute("data-mce-object"))&&(a.name=b)}),a.on("preInit",function(){var b=a.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(a){b[a]=new RegExp("]*>","gi")});var c=a.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(a){c[a]={}}),a.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(b,c){for(var e,f,g,h,i,j,k,l,m=b.length;m--;)if(f=b[m],f.parent&&("script"!=f.name||(l=d(f.attr("src"))))){for(g=new tinymce.html.Node("img",1),g.shortEnded=!0,l&&(l.width&&f.attr("width",l.width.toString()),l.height&&f.attr("height",l.height.toString())),j=f.attributes,e=j.length;e--;)h=j[e].name,i=j[e].value,"width"!==h&&"height"!==h&&"style"!==h&&(("data"==h||"src"==h)&&(i=a.convertURL(i,h)),g.attr("data-mce-p-"+h,i));k=f.firstChild&&f.firstChild.value,k&&(g.attr("data-mce-html",escape(k)),g.firstChild=null),g.attr({width:f.attr("width")||"300",height:f.attr("height")||("audio"==c?"30":"150"),style:f.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":c,"class":"mce-object mce-object-"+c}),f.replace(g)}}),a.serializer.addAttributeFilter("data-mce-object",function(a,b){for(var c,d,e,f,g,h,i,k=a.length;k--;)if(c=a[k],c.parent){for(i=c.attr(b),d=new tinymce.html.Node(i,1),"audio"!=i&&"script"!=i&&d.attr({width:c.attr("width"),height:c.attr("height")}),d.attr({style:c.attr("style")}),f=c.attributes,e=f.length;e--;){var l=f[e].name;0===l.indexOf("data-mce-p-")&&d.attr(l.substr(11),f[e].value)}"script"==i&&d.attr("type","text/javascript"),g=c.attr("data-mce-html"),g&&(h=new tinymce.html.Node("#text",3),h.raw=!0,h.value=j(unescape(g)),d.append(h)),c.replace(d)}})}),a.on("ObjectSelected",function(a){var b=a.target.getAttribute("data-mce-object");("audio"==b||"script"==b)&&a.preventDefault()}),a.on("objectResized",function(a){var b,c=a.target;c.getAttribute("data-mce-object")&&(b=c.getAttribute("data-mce-html"),b&&(b=unescape(b),c.setAttribute("data-mce-html",escape(k(b,{width:a.width,height:a.height})))))}),a.addButton("media",{tooltip:"Insert/edit video",onclick:e,stateSelector:["img[data-mce-object=video]","img[data-mce-object=iframe]"]}),a.addMenuItem("media",{icon:"media",text:"Insert/edit video",onclick:e,context:"insert",prependToContext:!0}),a.addCommand("mceMedia",e),this.showDialog=e}); \ No newline at end of file diff --git a/admin/assets/js/tinymce/plugins/nonbreaking/plugin.min.js b/admin/assets/js/tinymce/plugins/nonbreaking/plugin.min.js new file mode 100755 index 0000000..190dc33 --- /dev/null +++ b/admin/assets/js/tinymce/plugins/nonbreaking/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("nonbreaking",function(a){var b=a.getParam("nonbreaking_force_tab");if(a.addCommand("mceNonBreaking",function(){a.insertContent(a.plugins.visualchars&&a.plugins.visualchars.state?' ':" "),a.dom.setAttrib(a.dom.select("span.mce-nbsp"),"data-mce-bogus","1")}),a.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"}),a.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"}),b){var c=+b>1?+b:3;a.on("keydown",function(b){if(9==b.keyCode){if(b.shiftKey)return;b.preventDefault();for(var d=0;c>d;d++)a.execCommand("mceNonBreaking")}})}}); \ No newline at end of file diff --git a/admin/assets/js/tinymce/plugins/noneditable/plugin.min.js b/admin/assets/js/tinymce/plugins/noneditable/plugin.min.js new file mode 100755 index 0000000..747bed9 --- /dev/null +++ b/admin/assets/js/tinymce/plugins/noneditable/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("noneditable",function(a){function b(a){var b;if(1===a.nodeType){if(b=a.getAttribute(k),b&&"inherit"!==b)return b;if(b=a.contentEditable,"inherit"!==b)return b}return null}function c(a){for(var c;a;){if(c=b(a))return"false"===c?a:null;a=a.parentNode}}function d(){function d(a){for(;a;){if(a.id===n)return a;a=a.parentNode}}function e(a){var b;if(a)for(b=new i(a,a),a=b.current();a;a=b.next())if(3===a.nodeType)return a}function f(c,d){var e,f;return"false"===b(c)&&k.isBlock(c)?void m.select(c):(f=k.createRng(),"true"===b(c)&&(c.firstChild||c.appendChild(a.getDoc().createTextNode("\xa0")),c=c.firstChild,d=!0),e=k.create("span",{id:n,"data-mce-bogus":!0},o),d?c.parentNode.insertBefore(e,c):k.insertAfter(e,c),f.setStart(e.firstChild,1),f.collapse(!0),m.setRng(f),e)}function g(a){var b,c,d;if(a)b=m.getRng(!0),b.setStartBefore(a),b.setEndBefore(a),c=e(a),c&&c.nodeValue.charAt(0)==o&&(c=c.deleteData(0,1)),k.remove(a,!0),m.setRng(b);else for(;(a=k.get(n))&&a!==d;)c=e(a),c&&c.nodeValue.charAt(0)==o&&(c=c.deleteData(0,1)),k.remove(a,!0),d=a}function h(){function a(a,c){var d,e,f,g,h;if(d=j.startContainer,e=j.startOffset,3==d.nodeType){if(h=d.nodeValue.length,e>0&&h>e||(c?e==h:0===e))return}else{if(!(e0?e-1:e;d=d.childNodes[k],d.hasChildNodes()&&(d=d.firstChild)}for(f=new i(d,a);g=f[c?"prev":"next"]();){if(3===g.nodeType&&g.nodeValue.length>0)return;if("true"===b(g))return g}return a}var d,e,h,j,k;g(),h=m.isCollapsed(),d=c(m.getStart()),e=c(m.getEnd()),(d||e)&&(j=m.getRng(!0),h?(d=d||e,(k=a(d,!0))?f(k,!0):(k=a(d,!1))?f(k,!1):m.select(d)):(j=m.getRng(!0),d&&j.setStartBefore(d),e&&j.setEndAfter(e),m.setRng(j)))}function j(e){function f(a,b){for(;a=a[b?"previousSibling":"nextSibling"];)if(3!==a.nodeType||a.nodeValue.length>0)return a}function j(a,b){m.select(a),m.collapse(b)}function n(e){function f(a){for(var b=j;b;){if(b===a)return;b=b.parentNode}k.remove(a),h()}function g(){var d,g,h=a.schema.getNonEmptyElements();for(g=new tinymce.dom.TreeWalker(j,a.getBody());(d=e?g.prev():g.next())&&!h[d.nodeName.toLowerCase()]&&!(3===d.nodeType&&tinymce.trim(d.nodeValue).length>0);)if("false"===b(d))return f(d),!0;return c(d)?!0:!1}var i,j,l,n;if(m.isCollapsed()){if(i=m.getRng(!0),j=i.startContainer,l=i.startOffset,j=d(j)||j,n=c(j))return f(n),!1;if(3==j.nodeType&&(e?l>0:ls||s>124)&&s!=l.DELETE&&s!=l.BACKSPACE){if((tinymce.isMac?e.metaKey:e.ctrlKey)&&(67==s||88==s||86==s))return;if(e.preventDefault(),u)if(a.dom.isBlock(o)){var w=v?o.previousSibling:o.nextSibling;if(!w||w&&"false"===b(w)){var x=k.create("p",null," ");x.className="mceTmpParagraph";var y=v?o:w;y&&y.parentNode?y.parentNode.insertBefore(x,y):w||v||o.parentNode.appendChild(x),w=x}var z=new i(w,w),A=v?z.prev():z.next();j(A,!v)}else j(o,v)}else if(u||s==l.BACKSPACE||s==l.DELETE){if(p=d(q)){if(s==l.LEFT||s==l.BACKSPACE)if(o=f(p,!0),o&&"false"===b(o)){if(e.preventDefault(),s!=l.LEFT)return void k.remove(o);j(o,!0)}else g(p);if(s==l.RIGHT||s==l.DELETE)if(o=f(p,!0),o&&"false"===b(o)){if(e.preventDefault(),s!=l.RIGHT)return void k.remove(o);j(o,!1)}else g(p)}else{if(u&&t&&-1!==t.className.indexOf("mceTmpParagraph")&&t[v?"previousSibling":"nextSibling"]){var B=t[v?"previousSibling":"nextSibling"];" "===t.innerHTML||""===t.innerHTML||" "===t.innerHTML?k.remove(t):t.className=t.className.replace("mceTmpParagraph",""),j(B,!v)}var C=m.getRng(!0),D=C.endContainer;if(k.isBlock(D)&&k.isBlock(D.nextSibling)&&1==C.endOffset&&s==l.DELETE&&(o=c(D.nextSibling)),o&&(s==l.DELETE||s==l.BACKSPACE)&&k.isBlock(o))return e.preventDefault(),void k.remove(o)}if((s==l.BACKSPACE||s==l.DELETE)&&!n(s==l.BACKSPACE))return e.preventDefault(),!1}}var k=a.dom,m=a.selection,n="mce_noneditablecaret",o="\ufeff";a.on("mousedown",function(c){var d=a.selection.getNode();d&&-1!==d.className.indexOf("mceTmpParagraph")&&d!==c.target&&(" "===d.innerHTML||""===d.innerHTML||" "===d.innerHTML?k.remove(d):d.className=d.className.replace("mceTmpParagraph","")),"false"===b(d)&&d==c.target&&h()}),a.on("mouseup",h),a.on("keydown",j)}function e(b){var c=h.length,d=b.content,e=tinymce.trim(g);if("raw"!=b.format){for(;c--;)d=d.replace(h[c],function(b){var c=arguments,f=c[c.length-2];return f>0&&'"'==d.charAt(f-1)?b:''+a.dom.encode("string"==typeof c[1]?c[1]:c[0])+""});b.content=d}}var f,g,h,i=tinymce.dom.TreeWalker,j="contenteditable",k="data-mce-"+j,l=tinymce.util.VK;f=" "+tinymce.trim(a.getParam("noneditable_editable_class","mceEditable"))+" ",g=" "+tinymce.trim(a.getParam("noneditable_noneditable_class","mceNonEditable"))+" ",h=a.getParam("noneditable_regexp"),h&&!h.length&&(h=[h]),a.on("PreInit",function(){d(),h&&a.on("BeforeSetContent",e),a.parser.addAttributeFilter("class",function(a){for(var b,c,d=a.length;d--;)c=a[d],b=" "+c.attr("class")+" ",-1!==b.indexOf(f)?c.attr(k,"true"):-1!==b.indexOf(g)&&c.attr(k,"false")}),a.serializer.addAttributeFilter(k,function(a){for(var b,c=a.length;c--;)b=a[c],h&&b.attr("data-mce-content")?(b.name="#text",b.type=3,b.raw=!0,b.value=b.attr("data-mce-content")):(b.attr(j,null),b.attr(k,null))}),a.parser.addAttributeFilter(j,function(a){for(var b,c=a.length;c--;)b=a[c],b.attr(k,b.attr(j)),b.attr(j,null)})}),a.on("drop",function(a){c(a.target)&&a.preventDefault()})}); \ No newline at end of file diff --git a/admin/assets/js/tinymce/plugins/pagebreak/plugin.min.js b/admin/assets/js/tinymce/plugins/pagebreak/plugin.min.js new file mode 100755 index 0000000..2a69eba --- /dev/null +++ b/admin/assets/js/tinymce/plugins/pagebreak/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("pagebreak",function(a){var b="mce-pagebreak",c=a.getParam("pagebreak_separator",""),d=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(a){return"\\"+a}),"gi"),e='';a.addCommand("mcePageBreak",function(){a.settings.pagebreak_split_block?a.insertContent("

    "+e+"

    "):a.insertContent(e)}),a.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),a.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),a.on("ResolveName",function(c){"IMG"==c.target.nodeName&&a.dom.hasClass(c.target,b)&&(c.name="pagebreak")}),a.on("click",function(c){c=c.target,"IMG"===c.nodeName&&a.dom.hasClass(c,b)&&a.selection.select(c)}),a.on("BeforeSetContent",function(a){a.content=a.content.replace(d,e)}),a.on("PreInit",function(){a.serializer.addNodeFilter("img",function(b){for(var d,e,f=b.length;f--;)if(d=b[f],e=d.attr("class"),e&&-1!==e.indexOf("mce-pagebreak")){var g=d.parent;if(a.schema.getBlockElements()[g.name]&&a.settings.pagebreak_split_block){g.type=3,g.value=c,g.raw=!0,d.remove();continue}d.type=3,d.value=c,d.raw=!0}})})}); \ No newline at end of file diff --git a/admin/assets/js/tinymce/plugins/paste/plugin.min.js b/admin/assets/js/tinymce/plugins/paste/plugin.min.js new file mode 100755 index 0000000..1e9c4e3 --- /dev/null +++ b/admin/assets/js/tinymce/plugins/paste/plugin.min.js @@ -0,0 +1 @@ +!function(a,b){"use strict";function c(a,b){for(var c,d=[],f=0;f/g]),f(h.parse(e)),i}function f(a){function b(a,b,c){return b||c?"\xa0":" "}return a=d(a,[/^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g,/|/g,[/( ?)\u00a0<\/span>( ?)/g,b],/
    $/i])}return{filter:d,innerText:e,trimHtml:f}}),d("tinymce/pasteplugin/Clipboard",["tinymce/Env","tinymce/dom/RangeUtils","tinymce/util/VK","tinymce/pasteplugin/Utils"],function(a,b,c,d){return function(e){function f(a){var b,c=e.dom;if(b=e.fire("BeforePastePreProcess",{content:a}),b=e.fire("PastePreProcess",b),a=b.content,!b.isDefaultPrevented()){if(e.hasEventListeners("PastePostProcess")&&!b.isDefaultPrevented()){var d=c.add(e.getBody(),"div",{style:"display:none"},a);b=e.fire("PastePostProcess",{node:d}),c.remove(d),a=b.node.innerHTML}b.isDefaultPrevented()||e.insertContent(a,{merge:e.settings.paste_merge_formats!==!1,data:{paste:!0}})}}function g(a){a=e.dom.encode(a).replace(/\r\n/g,"\n");var b,c=e.dom.getParent(e.selection.getStart(),e.dom.isBlock),g=e.settings.forced_root_block;g&&(b=e.dom.createHTML(g,e.settings.forced_root_block_attrs),b=b.substr(0,b.length-3)+">"),c&&/^(PRE|DIV)$/.test(c.nodeName)||!g?a=d.filter(a,[[/\n/g,"
    "]]):(a=d.filter(a,[[/\n\n/g,"

    "+b],[/^(.*<\/p>)(

    )$/,b+"$1"],[/\n/g,"
    "]]),-1!=a.indexOf("

    ")&&(a=b+a)),f(a)}function h(){function b(a){var b,c,e,f=a.startContainer;if(b=a.getClientRects(),b.length)return b[0];if(a.collapsed&&1==f.nodeType){for(e=f.childNodes[v.startOffset];e&&3==e.nodeType&&!e.data.length;)e=e.nextSibling;if(e)return"BR"==e.tagName&&(c=d.doc.createTextNode("\ufeff"),e.parentNode.insertBefore(c,e),a=d.createRng(),a.setStartBefore(c),a.setEndAfter(c),b=a.getClientRects(),d.remove(c)),b.length?b[0]:void 0}}var c,d=e.dom,f=e.getBody(),g=e.dom.getViewPort(e.getWin()),h=g.y,i=20;if(v=e.selection.getRng(),e.inline&&(c=e.selection.getScrollContainer(),c&&c.scrollTop>0&&(h=c.scrollTop)),v.getClientRects){var j=b(v);if(j)i=h+(j.top-d.getPos(f).y);else{i=h;var k=v.startContainer;k&&(3==k.nodeType&&k.parentNode!=f&&(k=k.parentNode),1==k.nodeType&&(i=d.getPos(k,c||f).y))}}u=d.add(e.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: absolute; top: "+i+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},A),(a.ie||a.gecko)&&d.setStyle(u,"left","rtl"==d.getStyle(f,"direction",!0)?65535:-65535),d.bind(u,"beforedeactivate focusin focusout",function(a){a.stopPropagation()}),u.focus(),e.selection.select(u,!0)}function i(){if(u){for(var a;a=e.dom.get("mcepastebin");)e.dom.remove(a),e.dom.unbind(a);v&&e.selection.setRng(v)}u=v=null}function j(){var a,b,c,d,f="";for(a=e.dom.select("div[id=mcepastebin]"),b=0;b>8);return decodeURIComponent(escape(c))}function l(a){var b,c,d;return c="",b=a.indexOf(c),-1!==b&&(a=a.substr(b+c.length)),d="",b=a.indexOf(d),-1!==b&&(a=a.substr(0,b)),a}function m(a){var b={};if(a){if(a.getData){var c=a.getData("Text");c&&c.length>0&&-1==c.indexOf(B)&&(b["text/plain"]=c)}if(a.types)for(var d=0;d')}var g,h,i,j=!1;if(c)for(g=0;g0}function s(a){return c.metaKeyPressed(a)&&86==a.keyCode||a.shiftKey&&45==a.keyCode}function t(){e.on("keydown",function(b){function c(a){s(a)&&!a.isDefaultPrevented()&&i()}if(s(b)&&!b.isDefaultPrevented()){if(w=b.shiftKey&&86==b.keyCode,w&&a.webkit&&-1!=navigator.userAgent.indexOf("Version/"))return;if(b.stopImmediatePropagation(),y=(new Date).getTime(),a.ie&&w)return b.preventDefault(),void e.fire("paste",{ieFake:!0});i(),h(),e.once("keyup",c),e.once("paste",function(){e.off("keyup",c)})}}),e.on("paste",function(b){var c=(new Date).getTime(),k=n(b),l=(new Date).getTime()-c,m=(new Date).getTime()-y-l<1e3,q="text"==x.pasteFormat||w;return w=!1,b.isDefaultPrevented()||p(b)?void i():o(b)?void i():(m||b.preventDefault(),!a.ie||m&&!b.ieFake||(h(),e.dom.bind(u,"paste",function(a){a.stopPropagation()}),e.getDoc().execCommand("Paste",!1,null),k["text/html"]=j()),void setTimeout(function(){var a;return r(k,"text/html")?a=k["text/html"]:(a=j(),a==A&&(q=!0)),a=d.trimHtml(a),u&&u.firstChild&&"mcepastebin"===u.firstChild.id&&(q=!0),i(),a.length||(q=!0),q&&(a=r(k,"text/plain")&&-1==a.indexOf("

    ")?k["text/plain"]:d.innerText(a)),a==A?void(m||e.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.")):void(q?g(a):f(a))},0))}),e.on("dragstart dragend",function(a){z="dragstart"==a.type}),e.on("drop",function(a){var b=q(a);if(!a.isDefaultPrevented()&&!z&&!o(a,b)&&b&&e.settings.paste_filter_drop!==!1){var c=m(a.dataTransfer),h=c["mce-internal"]||c["text/html"]||c["text/plain"];h&&(a.preventDefault(),e.undoManager.transact(function(){c["mce-internal"]&&e.execCommand("Delete"),e.selection.setRng(b),h=d.trimHtml(h),c["text/html"]?f(h):g(h)}))}}),e.on("dragover dragend",function(a){e.settings.paste_data_images&&a.preventDefault()})}var u,v,w,x=this,y=0,z=!1,A="%MCEPASTEBIN%",B="data:text/mce-internal,";x.pasteHtml=f,x.pasteText=g,e.on("preInit",function(){t(),e.parser.addNodeFilter("img",function(b,c,d){function f(a){return a.data&&a.data.paste===!0}function g(b){b.attr("data-mce-object")||k===a.transparentSrc||b.remove()}function h(a){return 0===a.indexOf("webkit-fake-url")}function i(a){return 0===a.indexOf("data:")}if(!e.settings.paste_data_images&&f(d))for(var j=b.length;j--;){var k=b[j].attributes.map.src;k&&(h(k)?g(b[j]):!e.settings.allow_html_data_urls&&i(k)&&g(b[j]))}})})}}),d("tinymce/pasteplugin/WordFilter",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema","tinymce/html/Serializer","tinymce/html/Node","tinymce/pasteplugin/Utils"],function(a,b,c,d,e,f){function g(a){return/h?g&&(g=g.parent.parent):(j=g,g=null)),g&&g.name==b?g.append(a):(j=j||g,g=new e(b,1),f>1&&g.attr("start",""+f),a.wrap(g)),a.name="li",h>k&&j&&j.lastChild.append(g),k=h,d(a),c(a,/^\u00a0+/),c(a,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),c(a,/^\u00a0+/)}for(var g,j,k=1,l=[],m=a.firstChild;"undefined"!=typeof m&&null!==m;)if(l.push(m),m=m.walk(),null!==m)for(;"undefined"!=typeof m&&m.parent!==a;)m=m.walk();for(var n=0;n]+id="?docs-internal-[^>]*>/gi,""),q=q.replace(/
    /gi,""),o=k.paste_retain_style_properties,o&&(p=a.makeMap(o.split(/[, ]/))),k.paste_enable_default_filters!==!1&&g(l.content)){l.wordContent=!0,q=f.filter(q,[//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/([\s\u00a0]*)<\/span>/gi,function(a,b){return b.length>0?b.replace(/./," ").slice(Math.floor(b.length/2)).split("").join("\xa0"):""}]]);var r=k.paste_word_valid_elements;r||(r="-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody");var s=new c({valid_elements:r,valid_children:"-li[p]"});a.each(s.elements,function(a){a.attributes["class"]||(a.attributes["class"]={},a.attributesOrder.push("class")),a.attributes.style||(a.attributes.style={},a.attributesOrder.push("style"))});var t=new b({},s);t.addAttributeFilter("style",function(a){for(var b,c=a.length;c--;)b=a[c],b.attr("style",n(b,b.attr("style"))),"span"==b.name&&b.parent&&!b.attributes.length&&b.unwrap()}),t.addAttributeFilter("class",function(a){for(var b,c,d=a.length;d--;)b=a[d],c=b.attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(c)&&b.remove(),b.attr("class",null)}),t.addNodeFilter("del",function(a){for(var b=a.length;b--;)a[b].remove()}),t.addNodeFilter("a",function(a){for(var b,c,d,e=a.length;e--;)if(b=a[e],c=b.attr("href"),d=b.attr("name"),c&&-1!=c.indexOf("#_msocom_"))b.remove();else if(c&&0===c.indexOf("file://")&&(c=c.split("#")[1],c&&(c="#"+c)),c||d){if(d&&!/^_?(?:toc|edn|ftn)/i.test(d)){b.unwrap();continue}b.attr({href:c,name:d})}else b.unwrap()});var u=t.parse(q);k.paste_convert_word_fake_lists!==!1&&m(u),l.content=new d({validate:k.validate},s).serialize(u)}})}return j.isWordContent=g,j}),d("tinymce/pasteplugin/Quirks",["tinymce/Env","tinymce/util/Tools","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Utils"],function(a,b,c,d){return function(e){function f(a){e.on("BeforePastePreProcess",function(b){b.content=a(b.content)})}function g(a){if(!c.isWordContent(a))return a;var f=[];b.each(e.schema.getBlockElements(),function(a,b){f.push(b)});var g=new RegExp("(?:
     [\\s\\r\\n]+|
    )*(<\\/?("+f.join("|")+")[^>]*>)(?:
     [\\s\\r\\n]+|
    )*","g");return a=d.filter(a,[[g,"$1"]]),a=d.filter(a,[[/

    /g,"

    "],[/
    /g," "],[/

    /g,"
    "]])}function h(a){if(c.isWordContent(a))return a;var b=e.settings.paste_webkit_styles;if(e.settings.paste_remove_styles_if_webkit===!1||"all"==b)return a;if(b&&(b=b.split(/[, ]/)),b){var d=e.dom,f=e.selection.getNode();a=a.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(a,c,e,g){var h=d.parseStyle(e,"span"),i={};if("none"===b)return c+g;for(var j=0;j]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return a=a.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(a,b,c,d){return b+' style="'+c+'"'+d})}a.webkit&&f(h),a.ie&&f(g)}}),d("tinymce/pasteplugin/Plugin",["tinymce/PluginManager","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks"],function(a,b,c,d){var e;a.add("paste",function(a){function f(){"text"==g.pasteFormat?(this.active(!1),g.pasteFormat="html"):(g.pasteFormat="text",this.active(!0),e||(a.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),e=!0))}var g,h=this,i=a.settings;h.clipboard=g=new b(a),h.quirks=new d(a),h.wordFilter=new c(a),a.settings.paste_as_text&&(h.clipboard.pasteFormat="text"),i.paste_preprocess&&a.on("PastePreProcess",function(a){i.paste_preprocess.call(h,h,a)}),i.paste_postprocess&&a.on("PastePostProcess",function(a){i.paste_postprocess.call(h,h,a)}),a.addCommand("mceInsertClipboardContent",function(a,b){b.content&&h.clipboard.pasteHtml(b.content),b.text&&h.clipboard.pasteText(b.text)}),a.paste_block_drop&&a.on("dragend dragover draggesture dragdrop drop drag",function(a){a.preventDefault(),a.stopPropagation()}),a.settings.paste_data_images||a.on("drop",function(a){var b=a.dataTransfer;b&&b.files&&b.files.length>0&&a.preventDefault()}),a.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:f,active:"text"==h.clipboard.pasteFormat}),a.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:g.pasteFormat,onclick:f})})}),f(["tinymce/pasteplugin/Utils"])}(this); \ No newline at end of file diff --git a/admin/assets/js/tinymce/plugins/preview/plugin.min.js b/admin/assets/js/tinymce/plugins/preview/plugin.min.js new file mode 100755 index 0000000..10e57e2 --- /dev/null +++ b/admin/assets/js/tinymce/plugins/preview/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("preview",function(a){var b=a.settings,c=!tinymce.Env.ie;a.addCommand("mcePreview",function(){a.windowManager.open({title:"Preview",width:parseInt(a.getParam("plugin_preview_width","650"),10),height:parseInt(a.getParam("plugin_preview_height","500"),10),html:'",buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var d,e="";e+='',tinymce.each(a.contentCSS,function(b){e+=''});var f=b.body_id||"tinymce";-1!=f.indexOf("=")&&(f=a.getParam("body_id","","hash"),f=f[a.id]||f);var g=b.body_class||"";-1!=g.indexOf("=")&&(g=a.getParam("body_class","","hash"),g=g[a.id]||"");var h=a.settings.directionality?' dir="'+a.settings.directionality+'"':"";if(d=""+e+'"+a.getContent()+"",c)this.getEl("body").firstChild.src="data:text/html;charset=utf-8,"+encodeURIComponent(d);else{var i=this.getEl("body").firstChild.contentWindow.document;i.open(),i.write(d),i.close()}}})}),a.addButton("preview",{title:"Preview",cmd:"mcePreview"}),a.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})}); \ No newline at end of file diff --git a/admin/assets/js/tinymce/plugins/print/plugin.min.js b/admin/assets/js/tinymce/plugins/print/plugin.min.js new file mode 100755 index 0000000..e91ff54 --- /dev/null +++ b/admin/assets/js/tinymce/plugins/print/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("print",function(a){a.addCommand("mcePrint",function(){a.getWin().print()}),a.addButton("print",{title:"Print",cmd:"mcePrint"}),a.addShortcut("Meta+P","","mcePrint"),a.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Meta+P",context:"file"})}); \ No newline at end of file diff --git a/admin/assets/js/tinymce/plugins/save/plugin.min.js b/admin/assets/js/tinymce/plugins/save/plugin.min.js new file mode 100755 index 0000000..298404b --- /dev/null +++ b/admin/assets/js/tinymce/plugins/save/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("save",function(a){function b(){var b;return b=tinymce.DOM.getParent(a.id,"form"),!a.getParam("save_enablewhendirty",!0)||a.isDirty()?(tinymce.triggerSave(),a.getParam("save_onsavecallback")?void(a.execCallback("save_onsavecallback",a)&&(a.startContent=tinymce.trim(a.getContent({format:"raw"})),a.nodeChanged())):void(b?(a.isNotDirty=!0,(!b.onsubmit||b.onsubmit())&&("function"==typeof b.submit?b.submit():a.windowManager.alert("Error: Form submit field collision.")),a.nodeChanged()):a.windowManager.alert("Error: No form element found."))):void 0}function c(){var b=tinymce.trim(a.startContent);return a.getParam("save_oncancelcallback")?void a.execCallback("save_oncancelcallback",a):(a.setContent(b),a.undoManager.clear(),void a.nodeChanged())}function d(){var b=this;a.on("nodeChange",function(){b.disabled(a.getParam("save_enablewhendirty",!0)&&!a.isDirty())})}a.addCommand("mceSave",b),a.addCommand("mceCancel",c),a.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:d}),a.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:d}),a.addShortcut("Meta+S","","mceSave")}); \ No newline at end of file diff --git a/admin/assets/js/tinymce/plugins/searchreplace/plugin.min.js b/admin/assets/js/tinymce/plugins/searchreplace/plugin.min.js new file mode 100755 index 0000000..3ffe16f --- /dev/null +++ b/admin/assets/js/tinymce/plugins/searchreplace/plugin.min.js @@ -0,0 +1 @@ +!function(){function a(a,b,c,d,e){function f(a,b){if(b=b||0,!a[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var c=a.index;if(b>0){var d=a[b];if(!d)throw"Invalid capture group";c+=a[0].indexOf(d),a[0]=d}return[c,c+a[0].length,[a[0]]]}function g(a){var b;if(3===a.nodeType)return a.data;if(n[a.nodeName]&&!m[a.nodeName])return"";if(b="",(m[a.nodeName]||o[a.nodeName])&&(b+="\n"),a=a.firstChild)do b+=g(a);while(a=a.nextSibling);return b}function h(a,b,c){var d,e,f,g,h=[],i=0,j=a,k=b.shift(),l=0;a:for(;;){if((m[j.nodeName]||o[j.nodeName])&&i++,3===j.nodeType&&(!e&&j.length+i>=k[1]?(e=j,g=k[1]-i):d&&h.push(j),!d&&j.length+i>k[0]&&(d=j,f=k[0]-i),i+=j.length),d&&e){if(j=c({startNode:d,startNodeIndex:f,endNode:e,endNodeIndex:g,innerNodes:h,match:k[2],matchIndex:l}),i-=e.length-g,d=null,e=null,h=[],k=b.shift(),l++,!k)break}else{if((!n[j.nodeName]||m[j.nodeName])&&j.firstChild){j=j.firstChild;continue}if(j.nextSibling){j=j.nextSibling;continue}}for(;;){if(j.nextSibling){j=j.nextSibling;break}if(j.parentNode===a)break a;j=j.parentNode}}}function i(a){var b;if("function"!=typeof a){var c=a.nodeType?a:l.createElement(a);b=function(a,b){var d=c.cloneNode(!1);return d.setAttribute("data-mce-index",b),a&&d.appendChild(l.createTextNode(a)),d}}else b=a;return function(a){var c,d,e,f=a.startNode,g=a.endNode,h=a.matchIndex;if(f===g){var i=f;e=i.parentNode,a.startNodeIndex>0&&(c=l.createTextNode(i.data.substring(0,a.startNodeIndex)),e.insertBefore(c,i));var j=b(a.match[0],h);return e.insertBefore(j,i),a.endNodeIndexn;++n){var p=a.innerNodes[n],q=b(p.data,h);p.parentNode.replaceChild(q,p),m.push(q)}var r=b(g.data.substring(0,a.endNodeIndex),h);return e=f.parentNode,e.insertBefore(c,f),e.insertBefore(k,f),e.removeChild(f),e=g.parentNode,e.insertBefore(r,g),e.insertBefore(d,g),e.removeChild(g),r}}var j,k,l,m,n,o,p=[],q=0;if(l=b.ownerDocument,m=e.getBlockElements(),n=e.getWhiteSpaceElements(),o=e.getShortEndedElements(),k=g(b)){if(a.global)for(;j=a.exec(k);)p.push(f(j,d));else j=k.match(a),p.push(f(j,d));return p.length&&(q=p.length,h(b,p,i(c))),q}}function b(b){function c(){function a(){f.statusbar.find("#next").disabled(!g(l+1).length),f.statusbar.find("#prev").disabled(!g(l-1).length)}function c(){tinymce.ui.MessageBox.alert("Could not find the specified string.",function(){f.find("#find")[0].focus()})}var d,e={};d=tinymce.trim(b.selection.getContent({format:"text"}));var f=tinymce.ui.Factory.create({type:"window",layout:"flex",pack:"center",align:"center",onClose:function(){b.focus(),k.done()},onSubmit:function(b){var d,h,i,j;return b.preventDefault(),h=f.find("#case").checked(),j=f.find("#words").checked(),i=f.find("#find").value(),i.length?e.text==i&&e.caseState==h&&e.wholeWord==j?0===g(l+1).length?void c():(k.next(),void a()):(d=k.find(i,h,j),d||c(),f.statusbar.items().slice(1).disabled(0===d),a(),void(e={text:i,caseState:h,wholeWord:j})):(k.done(!1),void f.statusbar.items().slice(1).disabled(!0))},buttons:[{text:"Find",subtype:"primary",onclick:function(){f.submit()}},{text:"Replace",disabled:!0,onclick:function(){k.replace(f.find("#replace").value())||(f.statusbar.items().slice(1).disabled(!0),l=-1,e={})}},{text:"Replace all",disabled:!0,onclick:function(){k.replace(f.find("#replace").value(),!0,!0),f.statusbar.items().slice(1).disabled(!0),e={}}},{type:"spacer",flex:1},{text:"Prev",name:"prev",disabled:!0,onclick:function(){k.prev(),a()}},{text:"Next",name:"next",disabled:!0,onclick:function(){k.next(),a()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,items:[{type:"textbox",name:"find",size:40,label:"Find",value:d},{type:"textbox",name:"replace",size:40,label:"Replace with"},{type:"checkbox",name:"case",text:"Match case",label:" "},{type:"checkbox",name:"words",text:"Whole words",label:" "}]}}).renderTo().reflow()}function d(a){var b=a.getAttribute("data-mce-index");return"number"==typeof b?""+b:b}function e(c){var d,e;return e=b.dom.create("span",{"data-mce-bogus":1}),e.className="mce-match-marker",d=b.getBody(),k.done(!1),a(c,d,e,!1,b.schema)}function f(a){var b=a.parentNode;a.firstChild&&b.insertBefore(a.firstChild,a),a.parentNode.removeChild(a)}function g(a){var c,e=[];if(c=tinymce.toArray(b.getBody().getElementsByTagName("span")),c.length)for(var f=0;f0}var k=this,l=-1;k.init=function(a){a.addMenuItem("searchreplace",{text:"Find and replace",shortcut:"Meta+F",onclick:c,separator:"before",context:"edit"}),a.addButton("searchreplace",{tooltip:"Find and replace",shortcut:"Meta+F",onclick:c}),a.addCommand("SearchReplace",c),a.shortcuts.add("Meta+F","",c)},k.find=function(a,b,c){a=a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),a=c?"\\b"+a+"\\b":a;var d=e(new RegExp(a,b?"g":"gi"));return d&&(l=-1,l=h(!0)),d},k.next=function(){var a=h(!0);-1!==a&&(l=a)},k.prev=function(){var a=h(!1);-1!==a&&(l=a)},k.replace=function(a,c,e){var h,m,n,o,p,q,r=l;for(c=c!==!1,n=b.getBody(),m=tinymce.grep(tinymce.toArray(n.getElementsByTagName("span")),j),h=0;hl&&m[h].setAttribute("data-mce-index",p-1)}return b.undoManager.add(),l=r,c?(q=g(r+1).length>0,k.next()):(q=g(r-1).length>0,k.prev()),!e&&q},k.done=function(a){var c,e,g,h;for(e=tinymce.toArray(b.getBody().getElementsByTagName("span")),c=0;c=h.end?(e=k,g=h.end-j):d&&i.push(k),!d&&k.length+j>h.start&&(d=k,f=h.start-j),j+=k.length),d&&e){if(k=c({startNode:d,startNodeIndex:f,endNode:e,endNodeIndex:g,innerNodes:i,match:h.text,matchIndex:l}),j-=e.length-g,d=null,e=null,i=[],h=b.shift(),l++,!h)break}else{if((!x[k.nodeName]||w[k.nodeName])&&k.firstChild){k=k.firstChild;continue}if(k.nextSibling){k=k.nextSibling;continue}}for(;;){if(k.nextSibling){k=k.nextSibling;break}if(k.parentNode===a)break a;k=k.parentNode}}}function f(a){function b(b,c){var d=z[c];d.stencil||(d.stencil=a(d));var e=d.stencil.cloneNode(!1);return e.setAttribute("data-mce-index",c),b&&e.appendChild(A.doc.createTextNode(b)),e}return function(a){var c,d,e,f=a.startNode,g=a.endNode,h=a.matchIndex,i=A.doc;if(f===g){var j=f;e=j.parentNode,a.startNodeIndex>0&&(c=i.createTextNode(j.data.substring(0,a.startNodeIndex)),e.insertBefore(c,j));var k=b(a.match,h);return e.insertBefore(k,j),a.endNodeIndexn;++n){var p=a.innerNodes[n],q=b(p.data,h);p.parentNode.replaceChild(q,p),m.push(q)}var r=b(g.data.substring(0,a.endNodeIndex),h);return e=f.parentNode,e.insertBefore(c,f),e.insertBefore(l,f),e.removeChild(f),e=g.parentNode,e.insertBefore(r,g),e.insertBefore(d,g),e.removeChild(g),r}}function g(a){var b=a.parentNode;b.insertBefore(a.firstChild,a),a.parentNode.removeChild(a)}function h(b){var c=a.getElementsByTagName("*"),d=[];b="number"==typeof b?""+b:null;for(var e=0;eb&&a(z[b],b)!==!1;b++);return this}function l(b){return z.length&&e(a,z,f(b)),this}function m(a,b){if(v&&a.global)for(;u=a.exec(v);)z.push(c(u,b));return this}function n(a){var b,c=h(a?i(a):null);for(b=c.length;b--;)g(c[b]);return this}function o(a){return z[a.getAttribute("data-mce-index")]}function p(a){return h(i(a))[0]}function q(a,b,c){return z.push({start:a,end:a+b,text:v.substr(a,b),data:c}),this}function r(a){var c=h(i(a)),d=b.dom.createRng();return d.setStartBefore(c[0]),d.setEndAfter(c[c.length-1]),d}function s(a,c){var d=r(a);return d.deleteContents(),c.length>0&&d.insertNode(b.dom.doc.createTextNode(c)),d}function t(){return z.splice(0,z.length),n(),this}var u,v,w,x,y,z=[],A=b.dom;return w=b.schema.getBlockElements(),x=b.schema.getWhiteSpaceElements(),y=b.schema.getShortEndedElements(),v=d(a),{text:v,matches:z,each:k,filter:j,reset:t,matchFromElement:o,elementFromMatch:p,find:m,add:q,wrap:l,unwrap:n,replace:s,rangeFromMatch:r,indexOf:i}}}),d("tinymce/spellcheckerplugin/Plugin",["tinymce/spellcheckerplugin/DomTextMatcher","tinymce/PluginManager","tinymce/util/Tools","tinymce/ui/Menu","tinymce/dom/DOMUtils","tinymce/util/XHR","tinymce/util/URI","tinymce/util/JSON"],function(a,b,c,d,e,f,g,h){b.add("spellchecker",function(b,i){function j(){return E.textMatcher||(E.textMatcher=new a(b.getBody(),b)),E.textMatcher}function k(a,b){var d=[];return c.each(b,function(a){d.push({selectable:!0,text:a.name,data:a.value})}),d}function l(a){for(var b in a)return!1;return!0}function m(a,f){var g=[],h=A[a];c.each(h,function(a){g.push({text:a,onclick:function(){b.insertContent(b.dom.encode(a)),b.dom.remove(f),r()}})}),g.push({text:"-"}),D&&g.push({text:"Add to Dictionary",onclick:function(){s(a,f)}}),g.push.apply(g,[{text:"Ignore",onclick:function(){t(a,f)}},{text:"Ignore all",onclick:function(){t(a,f,!0)}}]),C=new d({items:g,context:"contextmenu",onautohide:function(a){-1!=a.target.className.indexOf("spellchecker")&&a.preventDefault()},onhide:function(){C.remove(),C=null}}),C.renderTo(document.body);var i=e.DOM.getPos(b.getContentAreaContainer()),j=b.dom.getPos(f[0]),k=b.dom.getRoot();"BODY"==k.nodeName?(j.x-=k.ownerDocument.documentElement.scrollLeft||k.scrollLeft,j.y-=k.ownerDocument.documentElement.scrollTop||k.scrollTop):(j.x-=k.scrollLeft,j.y-=k.scrollTop),i.x+=j.x,i.y+=j.y,C.moveTo(i.x,i.y+f[0].offsetHeight)}function n(){return b.getParam("spellchecker_wordchar_pattern")||new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e\xa0\u2002\u2003\u2009]+',"g")}function o(a,b,d,e){var j={method:a},k="";"spellcheck"==a&&(j.text=b,j.lang=F.spellchecker_language),"addToDictionary"==a&&(j.word=b),c.each(j,function(a,b){k&&(k+="&"),k+=b+"="+encodeURIComponent(a)}),f.send({url:new g(i).toAbsolute(F.spellchecker_rpc_url),type:"post",content_type:"application/x-www-form-urlencoded",data:k,success:function(a){a=h.parse(a),a?a.error?e(a.error):d(a):e("Sever response wasn't proper JSON.")},error:function(a,b){e("Spellchecker request error: "+b.status)}})}function p(a,b,c,d){var e=F.spellchecker_callback||o;e.call(E,a,b,c,d)}function q(){function a(a){b.windowManager.alert(a),b.setProgressState(!1),u()}u()||(b.setProgressState(!0),p("spellcheck",j().text,y,a),b.focus())}function r(){b.dom.select("span.mce-spellchecker-word").length||u()}function s(a,c){b.setProgressState(!0),p("addToDictionary",a,function(){b.setProgressState(!1),b.dom.remove(c,!0),r()},function(a){b.windowManager.alert(a),b.setProgressState(!1)})}function t(a,d,e){b.selection.collapse(),e?c.each(b.dom.select("span.mce-spellchecker-word"),function(c){c.getAttribute("data-mce-word")==a&&b.dom.remove(c,!0)}):b.dom.remove(d,!0),r()}function u(){return j().reset(),E.textMatcher=null,B?(B=!1,b.fire("SpellcheckEnd"),!0):void 0}function v(a){var b=a.getAttribute("data-mce-index");return"number"==typeof b?""+b:b}function w(a){var d,e=[];if(d=c.toArray(b.getBody().getElementsByTagName("span")),d.length)for(var f=0;f0){var e=b.dom.createRng();e.setStartBefore(d[0]),e.setEndAfter(d[d.length-1]),b.selection.setRng(e),m(c.getAttribute("data-mce-word"),d)}}}),b.addMenuItem("spellchecker",{text:"Spellcheck",context:"tools",onclick:q,selectable:!0,onPostRender:function(){var a=this;a.active(B),b.on("SpellcheckStart SpellcheckEnd",function(){a.active(B)})}});var H={tooltip:"Spellcheck",onclick:q,onPostRender:function(){var a=this;b.on("SpellcheckStart SpellcheckEnd",function(){a.active(B)})}};z.length>1&&(H.type="splitbutton",H.menu=z,H.onshow=x,H.onselect=function(a){F.spellchecker_language=a.control.settings.data}),b.addButton("spellchecker",H),b.addCommand("mceSpellCheck",q),b.on("remove",function(){C&&(C.remove(),C=null)}),b.on("change",r),this.getTextMatcher=j,this.getWordCharPattern=n,this.markErrors=y,this.getLanguage=function(){return F.spellchecker_language},F.spellchecker_language=F.spellchecker_language||F.language||"en"})}),f(["tinymce/spellcheckerplugin/DomTextMatcher"])}(this); \ No newline at end of file diff --git a/admin/assets/js/tinymce/plugins/tabfocus/plugin.min.js b/admin/assets/js/tinymce/plugins/tabfocus/plugin.min.js new file mode 100755 index 0000000..4fb883e --- /dev/null +++ b/admin/assets/js/tinymce/plugins/tabfocus/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("tabfocus",function(a){function b(a){9!==a.keyCode||a.ctrlKey||a.altKey||a.metaKey||a.preventDefault()}function c(b){function c(c){function f(a){return"BODY"===a.nodeName||"hidden"!=a.type&&"none"!=a.style.display&&"hidden"!=a.style.visibility&&f(a.parentNode)}function i(a){return/INPUT|TEXTAREA|BUTTON/.test(a.tagName)&&tinymce.get(b.id)&&-1!=a.tabIndex&&f(a)}if(h=d.select(":input:enabled,*[tabindex]:not(iframe)"),e(h,function(b,c){return b.id==a.id?(g=c,!1):void 0}),c>0){for(j=g+1;j=0;j--)if(i(h[j]))return h[j];return null}var g,h,i,j;if(!(9!==b.keyCode||b.ctrlKey||b.altKey||b.metaKey||b.isDefaultPrevented())&&(i=f(a.getParam("tab_focus",a.getParam("tabfocus_elements",":prev,:next"))),1==i.length&&(i[1]=i[0],i[0]=":prev"),h=b.shiftKey?":prev"==i[0]?c(-1):d.get(i[0]):":next"==i[1]?c(1):d.get(i[1]))){var k=tinymce.get(h.id||h.name);h.id&&k?k.focus():window.setTimeout(function(){tinymce.Env.webkit||window.focus(),h.focus()},10),b.preventDefault()}}var d=tinymce.DOM,e=tinymce.each,f=tinymce.explode;a.on("init",function(){a.inline&&tinymce.DOM.setAttrib(a.getBody(),"tabIndex",null),a.on("keyup",b),tinymce.Env.gecko?a.on("keypress keydown",c):a.on("keydown",c)})}); \ No newline at end of file diff --git a/admin/assets/js/tinymce/plugins/table/plugin.min.js b/admin/assets/js/tinymce/plugins/table/plugin.min.js new file mode 100755 index 0000000..0b779bb --- /dev/null +++ b/admin/assets/js/tinymce/plugins/table/plugin.min.js @@ -0,0 +1 @@ +!function(a,b){"use strict";function c(a,b){for(var c,d=[],g=0;g10)&&(b.innerHTML='
    ')}return{getSpanVal:b,paddCell:c}}),d("tinymce/tableplugin/TableGrid",["tinymce/util/Tools","tinymce/Env","tinymce/tableplugin/Utils"],function(a,c,d){var e=a.each,f=d.getSpanVal;return function(g,h){function i(a){return a===g.getBody()}function j(){var a=0;H=[],I=0,e(["thead","tbody","tfoot"],function(b){var c=N.select("> "+b+" tr",h);e(c,function(c,d){d+=a,e(N.select("> td, > th",c),function(a,c){var e,g,h,i;if(H[d])for(;H[d][c];)c++;for(h=f(a,"rowspan"),i=f(a,"colspan"),g=d;d+h>g;g++)for(H[g]||(H[g]=[]),e=c;c+i>e;e++)H[g][e]={part:b,real:g==d&&e==c,elm:a,rowspan:h,colspan:i};I=Math.max(I,c+1)})}),a+=c.length})}function k(a,b){return a=a.cloneNode(b),a.removeAttribute("id"),a}function l(a,b){var c;return c=H[b],c?c[a]:void 0}function m(a,b,c){a&&(c=parseInt(c,10),1===c?a.removeAttribute(b,1):a.setAttribute(b,c,1))}function n(a){return a&&(N.hasClass(a.elm,"mce-item-selected")||a==L)}function o(){var a=[];return e(h.rows,function(b){e(b.cells,function(c){return N.hasClass(c,"mce-item-selected")||L&&c==L.elm?(a.push(b),!1):void 0})}),a}function p(){var a=N.createRng();i(h)||(a.setStartAfter(h),a.setEndAfter(h),M.setRng(a),N.remove(h))}function q(b){var f,h={};return g.settings.table_clone_elements!==!1&&(h=a.makeMap((g.settings.table_clone_elements||"strong em b i span font h1 h2 h3 h4 h5 h6 p div").toUpperCase(),/[ ,]/)),a.walk(b,function(a){var d;return 3==a.nodeType?(e(N.getParents(a.parentNode,null,b).reverse(),function(a){h[a.nodeName]&&(a=k(a,!1),f?d&&d.appendChild(a):f=d=a,d=a)}),d&&(d.innerHTML=c.ie?" ":'
    '),!1):void 0},"childNodes"),b=k(b,!1),m(b,"rowSpan",1),m(b,"colSpan",1),f?b.appendChild(f):d.paddCell(b),b}function r(){var a,b=N.createRng();return e(N.select("tr",h),function(a){0===a.cells.length&&N.remove(a)}),0===N.select("tr",h).length?(b.setStartBefore(h),b.setEndBefore(h),M.setRng(b),void N.remove(h)):(e(N.select("thead,tbody,tfoot",h),function(a){0===a.rows.length&&N.remove(a)}),j(),void(J&&(a=H[Math.min(H.length-1,J.y)],a&&(M.select(a[Math.min(a.length-1,J.x)].elm,!0),M.collapse(!0)))))}function s(a,b,c,d){var e,f,g,h,i;for(e=H[b][a].elm.parentNode,g=1;c>=g;g++)if(e=N.getNext(e,"tr")){for(f=a;f>=0;f--)if(i=H[b+g][f].elm,i.parentNode==e){for(h=1;d>=h;h++)N.insertAfter(q(i),i);break}if(-1==f)for(h=1;d>=h;h++)e.insertBefore(q(e.cells[0]),e.cells[0])}}function t(){e(H,function(a,b){e(a,function(a,c){var d,e,g;if(n(a)&&(a=a.elm,d=f(a,"colspan"),e=f(a,"rowspan"),d>1||e>1)){for(m(a,"rowSpan",1),m(a,"colSpan",1),g=0;d-1>g;g++)N.insertAfter(q(a),a);s(c,b,e-1,d)}})})}function u(b,c,d){var f,g,h,i,k,o,p,q,s,u,v;if(b?(f=C(b),g=f.x,h=f.y,i=g+(c-1),k=h+(d-1)):(J=K=null,e(H,function(a,b){e(a,function(a,c){n(a)&&(J||(J={x:c,y:b}),K={x:c,y:b})})}),J&&(g=J.x,h=J.y,i=K.x,k=K.y)),q=l(g,h),s=l(i,k),q&&s&&q.part==s.part){for(t(),j(),q=l(g,h).elm,m(q,"colSpan",i-g+1),m(q,"rowSpan",k-h+1),p=h;k>=p;p++)for(o=g;i>=o;o++)H[p]&&H[p][o]&&(b=H[p][o].elm,b!=q&&(u=a.grep(b.childNodes),e(u,function(a){q.appendChild(a)}),u.length&&(u=a.grep(q.childNodes),v=0,e(u,function(a){"BR"==a.nodeName&&N.getAttrib(a,"data-mce-bogus")&&v++0&&H[c-1][h]&&(o=H[c-1][h].elm,p=f(o,"rowSpan"),p>1)){m(o,"rowSpan",p+1);continue}}else if(p=f(d,"rowspan"),p>1){m(d,"rowSpan",p+1);continue}l=q(d),m(l,"colSpan",d.colSpan),j.appendChild(l),g=d}j.hasChildNodes()&&(a?i.parentNode.insertBefore(j,i):N.insertAfter(j,i))}}function w(a){var b,c;e(H,function(c){return e(c,function(c,d){return n(c)&&(b=d,a)?!1:void 0}),a?!b:void 0}),e(H,function(d,e){var g,h,i;d[b]&&(g=d[b].elm,g!=c&&(i=f(g,"colspan"),h=f(g,"rowspan"),1==i?a?(g.parentNode.insertBefore(q(g),g),s(b,e,h-1,i)):(N.insertAfter(q(g),g),s(b,e,h-1,i)):m(g,"colSpan",g.colSpan+1),c=g))})}function x(){var b=[];i(h)&&1==H[0].length||(e(H,function(c){e(c,function(c,d){n(c)&&-1===a.inArray(b,d)&&(e(H,function(a){var b,c=a[d].elm;b=f(c,"colSpan"),b>1?m(c,"colSpan",b-1):N.remove(c)}),b.push(d))})}),r())}function y(){function a(a){var b,c;e(a.cells,function(a){var c=f(a,"rowSpan");c>1&&(m(a,"rowSpan",c-1),b=C(a),s(b.x,b.y,1,1))}),b=C(a.cells[0]),e(H[b.y],function(a){var b;a=a.elm,a!=c&&(b=f(a,"rowSpan"),1>=b?N.remove(a):m(a,"rowSpan",b-1),c=a)})}var b;b=o(),i(h)&&b.length==h.rows.length||(e(b.reverse(),function(b){a(b)}),r())}function z(){var a=o();if(!i(h)||a.length!=h.rows.length)return N.remove(a),r(),a}function A(){var a=o();return e(a,function(b,c){a[c]=k(b,!0)}),a}function B(a,b){var c=o(),d=c[b?0:c.length-1],f=d.cells.length;a&&(e(H,function(a){var b;return f=0,e(a,function(a){a.real&&(f+=a.colspan),a.elm.parentNode==d&&(b=1)}),b?!1:void 0}),b||a.reverse(),e(a,function(a){var c,e,g=a.cells.length;for(c=0;g>c;c++)e=a.cells[c],m(e,"colSpan",1),m(e,"rowSpan",1);for(c=g;f>c;c++)a.appendChild(q(a.cells[g-1]));for(c=f;g>c;c++)N.remove(a.cells[c]);b?d.parentNode.insertBefore(a,d):N.insertAfter(a,d)}),N.removeClass(N.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"))}function C(a){var b;return e(H,function(c,d){return e(c,function(c,e){return c.elm==a?(b={x:e,y:d},!1):void 0}),!b}),b}function D(a){J=C(a)}function E(){var a,b;return a=b=0,e(H,function(c,d){e(c,function(c,e){var f,g;n(c)&&(c=H[d][e],e>a&&(a=e),d>b&&(b=d),c.real&&(f=c.colspan-1,g=c.rowspan-1,f&&e+f>a&&(a=e+f),g&&d+g>b&&(b=d+g)))})}),{x:a,y:b}}function F(a){var b,c,d,e,f,g,h,i,j,k;if(K=C(a),J&&K){for(b=Math.min(J.x,K.x),c=Math.min(J.y,K.y),d=Math.max(J.x,K.x),e=Math.max(J.y,K.y),f=d,g=e,k=c;g>=k;k++)a=H[k][b],a.real||b-(a.colspan-1)=j;j++)a=H[c][j],a.real||c-(a.rowspan-1)=k;k++)for(j=b;d>=j;j++)a=H[k][j],a.real&&(h=a.colspan-1,i=a.rowspan-1,h&&j+h>f&&(f=j+h),i&&k+i>g&&(g=k+i));for(N.removeClass(N.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),k=c;g>=k;k++)for(j=b;f>=j;j++)H[k][j]&&N.addClass(H[k][j].elm,"mce-item-selected")}}function G(a,b){var c,d,e;c=C(a),d=c.y*I+c.x;do{if(d+=b,e=l(d%I,Math.floor(d/I)),!e)break;if(e.elm!=a)return M.select(e.elm,!0),N.isEmpty(e.elm)&&M.collapse(!0),!0}while(e.elm==a);return!1}var H,I,J,K,L,M=g.selection,N=M.dom;h=h||N.getParent(M.getStart(!0),"table"),j(),L=N.getParent(M.getStart(!0),"th,td"),L&&(J=C(L),K=E(),L=l(J.x,J.y)),a.extend(this,{deleteTable:p,split:t,merge:u,insertRow:v,insertCol:w,deleteCols:x,deleteRows:y,cutRows:z,copyRows:A,pasteRows:B,getPos:C,setStartCell:D,setEndCell:F,moveRelIdx:G,refresh:j})}}),d("tinymce/tableplugin/Quirks",["tinymce/util/VK","tinymce/Env","tinymce/util/Tools","tinymce/tableplugin/Utils"],function(a,b,c,d){var e=c.each,f=d.getSpanVal;return function(g){function h(){function b(b){function c(a,c){var e=a?"previousSibling":"nextSibling",f=g.dom.getParent(c,"tr"),h=f[e];if(h)return q(g,c,h,a),b.preventDefault(),!0;var k=g.dom.getParent(f,"table"),l=f.parentNode,m=l.nodeName.toLowerCase();if("tbody"===m||m===(a?"tfoot":"thead")){var n=d(a,k,l,"tbody");if(null!==n)return i(a,n,c)}return j(a,f,e,k)}function d(a,b,c,d){var e=g.dom.select(">"+d,b),f=e.indexOf(c);if(a&&0===f||!a&&f===e.length-1)return h(a,b);if(-1===f){var i="thead"===c.tagName.toLowerCase()?0:e.length-1;return e[i]}return e[f+(a?-1:1)]}function h(a,b){var c=a?"thead":"tfoot",d=g.dom.select(">"+c,b);return 0!==d.length?d[0]:null}function i(a,c,d){var e=k(c,a);return e&&q(g,d,e,a),b.preventDefault(),!0}function j(a,d,e,f){var h=f[e];if(h)return l(h),!0;var i=g.dom.getParent(f,"td,th");if(i)return c(a,i,b);var j=k(d,!a);return l(j),b.preventDefault(),!1}function k(a,b){var c=a&&a[b?"lastChild":"firstChild"];return c&&"BR"===c.nodeName?g.dom.getParent(c,"td,th"):c}function l(a){g.selection.setCursorLocation(a,0)}function m(){return t==a.UP||t==a.DOWN}function n(a){var b=a.selection.getNode(),c=a.dom.getParent(b,"tr");return null!==c}function o(a){for(var b=0,c=a;c.previousSibling;)c=c.previousSibling,b+=f(c,"colspan");return b}function p(a,b){var c=0,d=0;return e(a.children,function(a,e){return c+=f(a,"colspan"),d=e,c>b?!1:void 0}),d}function q(a,b,c,d){var e=o(g.dom.getParent(b,"td,th")),f=p(c,e),h=c.childNodes[f],i=k(h,d);l(i||h)}function r(a){var b=g.selection.getNode(),c=g.dom.getParent(b,"td,th"),d=g.dom.getParent(a,"td,th");return c&&c!==d&&s(c,d)}function s(a,b){return g.dom.getParent(a,"TABLE")===g.dom.getParent(b,"TABLE")}var t=b.keyCode;if(m()&&n(g)){var u=g.selection.getNode();setTimeout(function(){r(u)&&c(!b.shiftKey&&t===a.UP,u,b)},0)}}g.on("KeyDown",function(a){b(a)})}function i(){function a(a,b){var c,d=b.ownerDocument,e=d.createRange();return e.setStartBefore(b),e.setEnd(a.endContainer,a.endOffset),c=d.createElement("body"),c.appendChild(e.cloneContents()),0===c.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length}g.on("KeyDown",function(b){var c,d,e=g.dom;(37==b.keyCode||38==b.keyCode)&&(c=g.selection.getRng(),d=e.getParent(c.startContainer,"table"),d&&g.getBody().firstChild==d&&a(c,d)&&(c=e.createRng(),c.setStartBefore(d),c.setEndBefore(d),g.selection.setRng(c),b.preventDefault()))})}function j(){g.on("KeyDown SetContent VisualAid",function(){var a;for(a=g.getBody().lastChild;a;a=a.previousSibling)if(3==a.nodeType){if(a.nodeValue.length>0)break}else if(1==a.nodeType&&("BR"==a.tagName||!a.getAttribute("data-mce-bogus")))break;a&&"TABLE"==a.nodeName&&(g.settings.forced_root_block?g.dom.add(g.getBody(),g.settings.forced_root_block,g.settings.forced_root_block_attrs,b.ie&&b.ie<11?" ":'
    '):g.dom.add(g.getBody(),"br",{"data-mce-bogus":"1"}))}),g.on("PreProcess",function(a){var b=a.node.lastChild;b&&("BR"==b.nodeName||1==b.childNodes.length&&("BR"==b.firstChild.nodeName||"\xa0"==b.firstChild.nodeValue))&&b.previousSibling&&"TABLE"==b.previousSibling.nodeName&&g.dom.remove(b)})}function k(){function a(a,b,c,d){var e,f,g,h=3,i=a.dom.getParent(b.startContainer,"TABLE");return i&&(e=i.parentNode),f=b.startContainer.nodeType==h&&0===b.startOffset&&0===b.endOffset&&d&&("TR"==c.nodeName||c==e),g=("TD"==c.nodeName||"TH"==c.nodeName)&&!d,f||g}function b(){var b=g.selection.getRng(),c=g.selection.getNode(),d=g.dom.getParent(b.startContainer,"TD,TH");if(a(g,b,c,d)){d||(d=c);for(var e=d.lastChild;e.lastChild;)e=e.lastChild;3==e.nodeType&&(b.setEnd(e,e.data.length),g.selection.setRng(b))}}g.on("KeyDown",function(){b()}),g.on("MouseDown",function(a){2!=a.button&&b()})}function l(){function b(a){g.selection.select(a,!0),g.selection.collapse(!0)}function e(a){g.$(a).empty(),d.paddCell(a)}g.on("keydown",function(d){if((d.keyCode==a.DELETE||d.keyCode==a.BACKSPACE)&&!d.isDefaultPrevented()){var f,h,i,j;if(f=g.dom.getParent(g.selection.getStart(),"table")){if(h=g.dom.select("td,th",f),i=c.grep(h,function(a){return g.dom.hasClass(a,"mce-item-selected")}),0===i.length)return j=g.dom.getParent(g.selection.getStart(),"td,th"),void(g.selection.isCollapsed()&&j&&g.dom.isEmpty(j)&&(d.preventDefault(),e(j),b(j)));d.preventDefault(),g.undoManager.transact(function(){h.length==i.length?g.execCommand("mceTableDelete"):(c.each(i,e),b(i[0]))})}}})}l(),b.webkit&&(h(),k()),b.gecko&&(i(),j()),b.ie>10&&(i(),j())}}),d("tinymce/tableplugin/CellSelection",["tinymce/tableplugin/TableGrid","tinymce/dom/TreeWalker","tinymce/util/Tools"],function(a,b,c){return function(d){function e(a){d.getBody().style.webkitUserSelect="",(a||l)&&(d.dom.removeClass(d.dom.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),l=!1)}function f(b){var c,e,f=b.target;if(!j&&h&&(g||f!=h)&&("TD"==f.nodeName||"TH"==f.nodeName)){e=k.getParent(f,"table"),e==i&&(g||(g=new a(d,e),g.setStartCell(h),d.getBody().style.webkitUserSelect="none"),g.setEndCell(f),l=!0),c=d.selection.getSel();try{c.removeAllRanges?c.removeAllRanges():c.empty()}catch(m){}b.preventDefault()}}var g,h,i,j,k=d.dom,l=!0;return d.on("MouseDown",function(a){2==a.button||j||(e(),h=k.getParent(a.target,"td,th"),i=k.getParent(h,"table"))}),d.on("mouseover",f),d.on("remove",function(){k.unbind(d.getDoc(),"mouseover",f)}),d.on("MouseUp",function(){function a(a,d){var f=new b(a,a);do{if(3==a.nodeType&&0!==c.trim(a.nodeValue).length)return void(d?e.setStart(a,0):e.setEnd(a,a.nodeValue.length));if("BR"==a.nodeName)return void(d?e.setStartBefore(a):e.setEndBefore(a))}while(a=d?f.next():f.prev())}var e,f,j,l,m,n=d.selection;if(h){if(g&&(d.getBody().style.webkitUserSelect=""),f=k.select("td.mce-item-selected,th.mce-item-selected"),f.length>0){e=k.createRng(),l=f[0],e.setStartBefore(l),e.setEndAfter(l),a(l,1),j=new b(l,k.getParent(f[0],"table"));do if("TD"==l.nodeName||"TH"==l.nodeName){if(!k.hasClass(l,"mce-item-selected"))break;m=l}while(l=j.next());a(m),n.setRng(e)}d.nodeChanged(),h=g=i=null}}),d.on("KeyUp Drop SetContent",function(a){e("setcontent"==a.type),h=g=i=null,j=!1}),d.on("ObjectResizeStart ObjectResized",function(a){j="objectresized"!=a.type}),{clear:e}}}),d("tinymce/tableplugin/Dialogs",["tinymce/util/Tools","tinymce/Env"],function(a,b){var c=a.each;return function(d){function e(){var a=d.settings.color_picker_callback;return a?function(){var b=this;a.call(d,function(a){b.value(a).fire("change")},b.value())}:void 0}function f(a){return{title:"Advanced",type:"form",defaults:{onchange:function(){l(a,this.parents().reverse()[0],"style"==this.name())}},items:[{label:"Style",name:"style",type:"textbox"},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border color",type:"colorbox",name:"borderColor",onaction:e()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:e()}]}]}}function g(a){return a?a.replace(/px$/,""):""}function h(a){return/^[0-9]+$/.test(a)&&(a+="px"),a}function i(a){c("left center right".split(" "),function(b){d.formatter.remove("align"+b,{},a)})}function j(a){c("top middle bottom".split(" "),function(b){d.formatter.remove("valign"+b,{},a)})}function k(b,c,d){function e(b,d){return d=d||[],a.each(b,function(a){var b={text:a.text||a.title};a.menu?b.menu=e(a.menu):(b.value=a.value,c&&c(b)),d.push(b)}),d}return e(b,d||[])}function l(a,b,c){var d=b.toJSON(),e=a.parseStyle(d.style);c?(b.find("#borderColor").value(e["border-color"]||"")[0].fire("change"),b.find("#backgroundColor").value(e["background-color"]||"")[0].fire("change")):(e["border-color"]=d.borderColor,e["background-color"]=d.backgroundColor),b.find("#style").value(a.serializeStyle(a.parseStyle(a.serializeStyle(e))))}function m(a,b,c){var d=a.parseStyle(a.getAttrib(c,"style"));d["border-color"]&&(b.borderColor=d["border-color"]),d["background-color"]&&(b.backgroundColor=d["background-color"]),b.style=a.serializeStyle(d)}function n(a,b,d){var e=a.parseStyle(a.getAttrib(b,"style"));c(d,function(a){e[a.name]=a.value}),a.setAttrib(b,"style",a.serializeStyle(a.parseStyle(a.serializeStyle(e))))}var o=this;o.tableProps=function(){o.table(!0)},o.table=function(e){function j(){function c(a,b,d){if("TD"===a.tagName||"TH"===a.tagName)v.setStyle(a,b,d);else if(a.children)for(var e=0;e',p.insertBefore(e,p.firstChild)),i(p),w.align&&d.formatter.apply("align"+w.align,{},p),d.focus(),d.addVisual()})}function o(a,b){function c(a,c){for(var d=0;dc;c++){for(f+="",d=0;a>d;d++)f+=""+(g.ie?" ":"
    ")+"";f+=""}return f+="",e.undoManager.transact(function(){e.insertContent(f),h=e.dom.get("__mce"),e.dom.setAttrib(h,"id",null),e.dom.setAttribs(h,e.settings.table_default_attributes||{}),e.dom.setStyles(h,e.settings.table_default_styles||{})}),h}function i(a,b){function c(){a.disabled(!e.dom.getParent(e.selection.getStart(),b)),e.selection.selectorChanged(b,function(b){a.disabled(!b)})}e.initialized?c():e.on("init",c)}function k(){i(this,"table")}function l(){i(this,"td,th")}function m(){var a="";a='';for(var b=0;10>b;b++){a+="";for(var c=0;10>c;c++)a+='';a+=""}return a+="
    ",a+=''}function n(a,b,c){var d,f,g,h,i,j=c.getEl().getElementsByTagName("table")[0],k=c.isRtl()||"tl-tr"==c.parent().rel;for(j.nextSibling.innerHTML=a+1+" x "+(b+1),k&&(a=9-a),f=0;10>f;f++)for(d=0;10>d;d++)h=j.rows[f].childNodes[d].firstChild,i=(k?d>=a:a>=d)&&b>=f,e.dom.toggleClass(h,"mce-active",i),i&&(g=h);return g.parentNode}var o,p=this,q=new d(e);e.settings.table_grid===!1?e.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",onclick:q.table}):e.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(a){a.aria&&(this.parent().hideAll(),a.stopImmediatePropagation(),q.table())},onshow:function(){n(0,0,this.menu.items()[0])},onhide:function(){var a=this.menu.items()[0].getEl().getElementsByTagName("a");e.dom.removeClass(a,"mce-active"),e.dom.addClass(a[0],"mce-active")},menu:[{type:"container",html:m(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(a){var b,c,d=a.target;"A"==d.tagName.toUpperCase()&&(b=parseInt(d.getAttribute("data-mce-x"),10),c=parseInt(d.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"==this.parent().rel)&&(b=9-b),(b!==this.lastX||c!==this.lastY)&&(n(b,c,a.control),this.lastX=b,this.lastY=c))},onclick:function(a){var b=this;"A"==a.target.tagName.toUpperCase()&&(a.preventDefault(),a.stopPropagation(),b.parent().cancel(),e.undoManager.transact(function(){h(b.lastX+1,b.lastY+1)}),e.addVisual())}}]}),e.addMenuItem("tableprops",{text:"Table properties",context:"table",onPostRender:k,onclick:q.tableProps}),e.addMenuItem("deletetable",{text:"Delete table",context:"table",onPostRender:k,cmd:"mceTableDelete"}),e.addMenuItem("cell",{separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:f("mceTableCellProps"),onPostRender:l},{text:"Merge cells",onclick:f("mceTableMergeCells"),onPostRender:l},{text:"Split cell",onclick:f("mceTableSplitCells"),onPostRender:l}]}),e.addMenuItem("row",{text:"Row",context:"table",menu:[{text:"Insert row before",onclick:f("mceTableInsertRowBefore"),onPostRender:l},{text:"Insert row after",onclick:f("mceTableInsertRowAfter"),onPostRender:l},{text:"Delete row",onclick:f("mceTableDeleteRow"),onPostRender:l},{text:"Row properties",onclick:f("mceTableRowProps"),onPostRender:l},{text:"-"},{text:"Cut row",onclick:f("mceTableCutRow"),onPostRender:l},{text:"Copy row",onclick:f("mceTableCopyRow"),onPostRender:l},{text:"Paste row before",onclick:f("mceTablePasteRowBefore"),onPostRender:l},{text:"Paste row after",onclick:f("mceTablePasteRowAfter"),onPostRender:l}]}),e.addMenuItem("column",{text:"Column",context:"table",menu:[{text:"Insert column before",onclick:f("mceTableInsertColBefore"),onPostRender:l},{text:"Insert column after",onclick:f("mceTableInsertColAfter"),onPostRender:l},{text:"Delete column",onclick:f("mceTableDeleteCol"),onPostRender:l}]});var r=[];j("inserttable tableprops deletetable | cell row column".split(" "),function(a){"|"==a?r.push({text:"-"}):r.push(e.menuItems[a])}),e.addButton("table",{type:"menubutton",title:"Table",menu:r}),g.isIE||e.on("click",function(a){a=a.target,"TABLE"===a.nodeName&&(e.selection.select(a),e.nodeChanged())}),p.quirks=new b(e),e.on("Init",function(){p.cellSelection=new c(e)}),e.on("PreInit",function(){e.serializer.addAttributeFilter("data-mce-cell-padding,data-mce-border,data-mce-border-color",function(a,b){for(var c=a.length;c--;)a[c].attr(b,null)})}),j({mceTableSplitCells:function(a){a.split()},mceTableMergeCells:function(a){var b;b=e.dom.getParent(e.selection.getStart(),"th,td"),e.dom.select("td.mce-item-selected,th.mce-item-selected").length?a.merge():q.merge(a,b)},mceTableInsertRowBefore:function(a){a.insertRow(!0)},mceTableInsertRowAfter:function(a){a.insertRow()},mceTableInsertColBefore:function(a){a.insertCol(!0)},mceTableInsertColAfter:function(a){a.insertCol()},mceTableDeleteCol:function(a){a.deleteCols()},mceTableDeleteRow:function(a){a.deleteRows()},mceTableCutRow:function(a){o=a.cutRows()},mceTableCopyRow:function(a){o=a.copyRows()},mceTablePasteRowBefore:function(a){a.pasteRows(o,!0)},mceTablePasteRowAfter:function(a){a.pasteRows(o)},mceTableDelete:function(a){a.deleteTable()}},function(b,c){e.addCommand(c,function(){var c=new a(e);c&&(b(c),e.execCommand("mceRepaint"),p.cellSelection.clear())})}),j({mceInsertTable:q.table,mceTableProps:function(){q.table(!0)},mceTableRowProps:q.row,mceTableCellProps:q.cell},function(a,b){e.addCommand(b,function(b,c){a(c)})}),e.settings.table_tab_navigation!==!1&&e.on("keydown",function(b){var c,d,f;9==b.keyCode&&(c=e.dom.getParent(e.selection.getStart(),"th,td"),c&&(b.preventDefault(),d=new a(e),f=b.shiftKey?-1:1,e.undoManager.transact(function(){!d.moveRelIdx(c,f)&&f>0&&(d.insertRow(),d.refresh(),d.moveRelIdx(c,f))})))}),p.insertTable=h}var j=e.each;h.add("table",i)})}(this); \ No newline at end of file diff --git a/admin/assets/js/tinymce/plugins/template/plugin.min.js b/admin/assets/js/tinymce/plugins/template/plugin.min.js new file mode 100755 index 0000000..2f15d8e --- /dev/null +++ b/admin/assets/js/tinymce/plugins/template/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("template",function(a){function b(b){return function(){var c=a.settings.templates;"string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):b(c)}}function c(b){function c(b){function c(b){if(-1==b.indexOf("")){var c="";tinymce.each(a.contentCSS,function(b){c+=''}),b=""+c+""+b+""}b=f(b,"template_preview_replace_values");var e=d.find("iframe")[0].getEl().contentWindow.document;e.open(),e.write(b),e.close()}var g=b.control.value();g.url?tinymce.util.XHR.send({url:g.url,success:function(a){e=a,c(e)}}):(e=g.content,c(e)),d.find("#description")[0].text(b.control.value().description)}var d,e,h=[];return b&&0!==b.length?(tinymce.each(b,function(a){h.push({selected:!h.length,text:a.title,value:{url:a.url,content:a.content,description:a.description}})}),d=a.windowManager.open({title:"Insert template",layout:"flex",direction:"column",align:"stretch",padding:15,spacing:10,items:[{type:"form",flex:0,padding:0,items:[{type:"container",label:"Templates",items:{type:"listbox",label:"Templates",name:"template",values:h,onselect:c}}]},{type:"label",name:"description",label:"Description",text:"\xa0"},{type:"iframe",flex:1,border:1}],onsubmit:function(){g(!1,e)},width:a.getParam("template_popup_width",600),height:a.getParam("template_popup_height",500)}),void d.find("listbox")[0].fire("select")):void a.windowManager.alert("No templates defined")}function d(b,c){function d(a,b){if(a=""+a,a.length0&&(i=k.create("div",null),i.appendChild(j[0].cloneNode(!0))),h(k.select("*",i),function(b){g(b,a.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_cdate_format",a.getLang("template.cdate_format")))),g(b,a.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_mdate_format",a.getLang("template.mdate_format")))),g(b,a.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(b.innerHTML=l)}),e(i),a.execCommand("mceInsertContent",!1,i.innerHTML),a.addVisual()}var h=tinymce.each;a.addCommand("mceInsertTemplate",g),a.addButton("template",{title:"Insert template",onclick:b(c)}),a.addMenuItem("template",{text:"Insert template",onclick:b(c),context:"insert"}),a.on("PreProcess",function(b){var c=a.dom;h(c.select("div",b.node),function(b){c.hasClass(b,"mceTmpl")&&(h(c.select("*",b),function(b){c.hasClass(b,a.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_mdate_format",a.getLang("template.mdate_format"))))}),e(b))})})}); \ No newline at end of file diff --git a/admin/assets/js/tinymce/plugins/textcolor/plugin.min.js b/admin/assets/js/tinymce/plugins/textcolor/plugin.min.js new file mode 100755 index 0000000..7ca105a --- /dev/null +++ b/admin/assets/js/tinymce/plugins/textcolor/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("textcolor",function(a){function b(b){var c;return a.dom.getParents(a.selection.getStart(),function(a){var d;(d=a.style["forecolor"==b?"color":"background-color"])&&(c=d)}),c}function c(){var b,c,d=[];for(c=a.settings.textcolor_map||["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Red violet","FFFFFF","White","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum"],b=0;b
    '+(c?"×":"")+"
    "}var d,e,f,g,h,k,l,m=this,n=m._id,o=0;for(d=c(),d.push({text:tinymce.translate("No color"),color:"transparent"}),f='',g=d.length-1,k=0;j>k;k++){for(f+="",h=0;i>h;h++)l=k*i+h,l>g?f+="":(e=d[l],f+=b(e.color,e.text));f+=""}if(a.settings.color_picker_callback){for(f+='",f+="",h=0;i>h;h++)f+=b("","Custom color");f+=""}return f+="
    "}function e(b,c){a.undoManager.transact(function(){a.focus(),a.formatter.apply(b,{value:c}),a.nodeChanged()})}function f(b){a.undoManager.transact(function(){a.focus(),a.formatter.remove(b,{value:null},null,!0),a.nodeChanged()})}function g(c){function d(a){k.hidePanel(),k.color(a),e(k.settings.format,a)}function g(){k.hidePanel(),k.resetColor(),f(k.settings.format)}function h(a,b){a.style.background=b,a.setAttribute("data-mce-color",b)}var j,k=this.parent();tinymce.DOM.getParent(c.target,".mce-custom-color-btn")&&(k.hidePanel(),a.settings.color_picker_callback.call(a,function(a){var b,c,e,f=k.panel.getEl().getElementsByTagName("table")[0];for(b=tinymce.map(f.rows[f.rows.length-1].childNodes,function(a){return a.firstChild}),e=0;ee;e++)h(b[e],b[e+1].getAttribute("data-mce-color"));h(c,a),d(a)},b(k.settings.format))),j=c.target.getAttribute("data-mce-color"),j?(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),c.target.setAttribute("aria-selected",!0),this.lastId=c.target.id,"transparent"==j?g():d(j)):null!==j&&k.hidePanel()}function h(){var a=this;a._color?e(a.settings.format,a._color):f(a.settings.format)}var i,j;j=a.settings.textcolor_rows||5,i=a.settings.textcolor_cols||8,a.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h}),a.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h})}); \ No newline at end of file diff --git a/admin/assets/js/tinymce/plugins/textpattern/plugin.min.js b/admin/assets/js/tinymce/plugins/textpattern/plugin.min.js new file mode 100755 index 0000000..8af96cd --- /dev/null +++ b/admin/assets/js/tinymce/plugins/textpattern/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("textpattern",function(a){function b(){return j&&(i.sort(function(a,b){return a.start.length>b.start.length?-1:a.start.length'+a+"
    "}function f(){var a,b="";for(a in n)b+=a;return new RegExp("["+b+"]","g")}function g(){var a,b="";for(a in n)b&&(b+=","),b+="span.mce-"+n[a];return b}var h,i,j,k,l,m,n,o,p=a.getBody(),q=a.selection;if(n={"\xa0":"nbsp","\xad":"shy"},d=!d,e.state=d,a.fire("VisualChars",{state:d}),o=f(),b&&(m=q.getBookmark()),d)for(i=[],tinymce.walk(p,function(a){3==a.nodeType&&a.nodeValue&&o.test(a.nodeValue)&&i.push(a)},"childNodes"),j=0;j=0;j--)a.dom.remove(i[j],1);q.moveToBookmark(m)}function c(){var b=this;a.on("VisualChars",function(a){b.active(a.state)})}var d,e=this;a.addCommand("mceVisualChars",b),a.addButton("visualchars",{title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:c}),a.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:c,selectable:!0,context:"view",prependToContext:!0}),a.on("beforegetcontent",function(a){d&&"raw"!=a.format&&!a.draft&&(d=!0,b(!1))})}); \ No newline at end of file diff --git a/admin/assets/js/tinymce/plugins/wordcount/plugin.min.js b/admin/assets/js/tinymce/plugins/wordcount/plugin.min.js new file mode 100755 index 0000000..e0d43bb --- /dev/null +++ b/admin/assets/js/tinymce/plugins/wordcount/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("wordcount",function(a){function b(){a.theme.panel.find("#wordcount").text(["Words: {0}",e.getCount()])}var c,d,e=this;c=a.getParam("wordcount_countregex",/[\w\u2019\x27\-\u00C0-\u1FFF]+/g),d=a.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g),a.on("init",function(){var c=a.theme.panel&&a.theme.panel.find("#statusbar")[0];c&&window.setTimeout(function(){c.insert({type:"label",name:"wordcount",text:["Words: {0}",e.getCount()],classes:"wordcount",disabled:a.settings.readonly},0),a.on("setcontent beforeaddundo",b),a.on("keyup",function(a){32==a.keyCode&&b()})},0)}),e.getCount=function(){var b=a.getContent({format:"raw"}),e=0;if(b){b=b.replace(/\.\.\./g," "),b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," "),b=b.replace(/(\w+)(&#?[a-z0-9]+;)+(\w+)/i,"$1$3").replace(/&.+?;/g," "),b=b.replace(d,"");var f=b.match(c);f&&(e=f.length)}return e}}); \ No newline at end of file diff --git a/admin/assets/js/tinymce/skins/index.html b/admin/assets/js/tinymce/skins/index.html new file mode 100755 index 0000000..e69de29 diff --git a/admin/assets/js/tinymce/skins/light/content.inline.min.css b/admin/assets/js/tinymce/skins/light/content.inline.min.css new file mode 100755 index 0000000..e2ef130 --- /dev/null +++ b/admin/assets/js/tinymce/skins/light/content.inline.min.css @@ -0,0 +1 @@ +.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center} .mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}} .mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center} .mce-nbsp,.mce-shy{background:#AAA} .mce-shy::after{content:'-'} hr{cursor:default} .mce-match-marker{background:#AAA;color:#fff} .mce-match-marker-selected{background:#39f;color:#fff} .mce-spellchecker-word{border-bottom:2px solid red;cursor:default} .mce-spellchecker-grammar{border-bottom:2px solid green;cursor:default} .mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB} td.mce-item-selected,th.mce-item-selected{background-color:#39f!important} .mce-edit-focus{outline:1px dotted #333} \ No newline at end of file diff --git a/admin/assets/js/tinymce/skins/light/content.min.css b/admin/assets/js/tinymce/skins/light/content.min.css new file mode 100755 index 0000000..84cd4b6 --- /dev/null +++ b/admin/assets/js/tinymce/skins/light/content.min.css @@ -0,0 +1 @@ +body{background-color:#FFF;color:#000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center} .mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}} .mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center} .mce-nbsp,.mce-shy{background:#AAA} .mce-shy::after{content:'-'} hr{cursor:default} .mce-match-marker{background:#AAA;color:#fff} .mce-match-marker-selected{background:#39f;color:#fff} .mce-spellchecker-word{border-bottom:2px solid red;cursor:default} .mce-spellchecker-grammar{border-bottom:2px solid green;cursor:default} .mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB} td.mce-item-selected,th.mce-item-selected{background-color:#39f!important} .mce-edit-focus{outline:1px dotted #333} \ No newline at end of file diff --git a/admin/assets/js/tinymce/skins/light/fonts/tinymce-small.eot b/admin/assets/js/tinymce/skins/light/fonts/tinymce-small.eot new file mode 100755 index 0000000..c8abe59 Binary files /dev/null and b/admin/assets/js/tinymce/skins/light/fonts/tinymce-small.eot differ diff --git a/admin/assets/js/tinymce/skins/light/fonts/tinymce-small.json b/admin/assets/js/tinymce/skins/light/fonts/tinymce-small.json new file mode 100755 index 0000000..187ad8a --- /dev/null +++ b/admin/assets/js/tinymce/skins/light/fonts/tinymce-small.json @@ -0,0 +1,1194 @@ +{ + "IcoMoonType": "selection", + "icons": [ + { + "icon": { + "paths": [ + "M704 832v-37.004c151.348-61.628 256-193.82 256-346.996 0-212.078-200.576-384-448-384s-448 171.922-448 384c0 153.176 104.654 285.368 256 346.996v37.004h-192l-64-96v224h320v-222.812c-100.9-51.362-170.666-161.54-170.666-289.188 0-176.732 133.718-320 298.666-320 164.948 0 298.666 143.268 298.666 320 0 127.648-69.766 237.826-170.666 289.188v222.812h320v-224l-64 96h-192z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57376, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 0, + "order": 1, + "prevSize": 32, + "code": 57376, + "name": "charmap", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 0 + }, + { + "icon": { + "paths": [ + "M256 64v896l256-256 256 256v-896h-512zM704 789.49l-192-192-192 192v-661.49h384v661.49z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57363, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 1, + "order": 2, + "prevSize": 32, + "code": 57363, + "name": "bookmark", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 1 + }, + { + "icon": { + "paths": [ + "M927.274 230.216l-133.49-133.488c-21.104-21.104-49.232-32.728-79.198-32.728s-58.094 11.624-79.196 32.726l-165.492 165.49c-43.668 43.668-43.668 114.724 0 158.392l2.746 2.746 67.882-67.882-2.746-2.746c-6.132-6.132-6.132-16.494 0-22.626l165.492-165.492c4.010-4.008 8.808-4.608 11.312-4.608s7.302 0.598 11.312 4.61l133.49 133.488c6.132 6.134 6.132 16.498 0.002 22.628l-165.494 165.494c-4.008 4.008-8.806 4.608-11.31 4.608s-7.302-0.6-11.312-4.612l-2.746-2.746-67.88 67.884 2.742 2.742c21.106 21.108 49.23 32.728 79.2 32.728s58.094-11.624 79.196-32.726l165.494-165.492c43.662-43.666 43.662-114.72-0.004-158.39zM551.356 600.644l-67.882 67.882 2.746 2.746c4.008 4.008 4.61 8.806 4.61 11.31 0 2.506-0.598 7.302-4.606 11.314l-165.494 165.49c-4.010 4.010-8.81 4.61-11.314 4.61s-7.304-0.6-11.314-4.61l-133.492-133.486c-4.010-4.010-4.61-8.81-4.61-11.314s0.598-7.3 4.61-11.312l165.49-165.488c4.010-4.012 8.81-4.612 11.314-4.612s7.304 0.6 11.314 4.612l2.746 2.742 67.882-67.88-2.746-2.746c-21.104-21.104-49.23-32.726-79.196-32.726s-58.092 11.624-79.196 32.726l-165.488 165.486c-21.106 21.104-32.73 49.234-32.73 79.198s11.624 58.094 32.726 79.198l133.49 133.49c21.106 21.102 49.232 32.726 79.198 32.726s58.092-11.624 79.196-32.726l165.494-165.492c21.104-21.104 32.722-49.23 32.722-79.196s-11.624-58.094-32.726-79.196l-2.744-2.746zM800 838c-9.724 0-19.45-3.708-26.87-11.13l-128-127.998c-14.844-14.84-14.844-38.898 0-53.738 14.84-14.844 38.896-14.844 53.736 0l128 128c14.844 14.84 14.844 38.896 0 53.736-7.416 7.422-17.142 11.13-26.866 11.13zM608 960c-17.674 0-32-14.326-32-32v-128c0-17.674 14.326-32 32-32s32 14.326 32 32v128c0 17.674-14.326 32-32 32zM928 640h-128c-17.674 0-32-14.326-32-32s14.326-32 32-32h128c17.674 0 32 14.326 32 32s-14.326 32-32 32zM224 186c9.724 0 19.45 3.708 26.87 11.13l128 128c14.842 14.84 14.842 38.898 0 53.738-14.84 14.844-38.898 14.844-53.738 0l-128-128c-14.842-14.84-14.842-38.898 0-53.738 7.418-7.422 17.144-11.13 26.868-11.13zM416 64c17.674 0 32 14.326 32 32v128c0 17.674-14.326 32-32 32s-32-14.326-32-32v-128c0-17.674 14.326-32 32-32zM96 384h128c17.674 0 32 14.326 32 32s-14.326 32-32 32h-128c-17.674 0-32-14.326-32-32s14.326-32 32-32z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57362, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 2, + "order": 3, + "prevSize": 32, + "code": 57362, + "name": "link", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 2 + }, + { + "icon": { + "paths": [ + "M927.274 230.216l-133.49-133.488c-21.104-21.104-49.232-32.728-79.198-32.728s-58.094 11.624-79.196 32.726l-165.492 165.49c-43.668 43.668-43.668 114.724 0 158.392l2.746 2.746 67.882-67.882-2.746-2.746c-6.132-6.132-6.132-16.494 0-22.626l165.492-165.492c4.010-4.008 8.808-4.608 11.312-4.608s7.302 0.598 11.312 4.61l133.49 133.488c6.132 6.134 6.132 16.498 0.002 22.628l-165.494 165.494c-4.008 4.008-8.806 4.608-11.31 4.608s-7.302-0.6-11.312-4.612l-2.746-2.746-67.88 67.884 2.742 2.742c21.106 21.108 49.23 32.728 79.2 32.728s58.094-11.624 79.196-32.726l165.494-165.492c43.662-43.666 43.662-114.72-0.004-158.39zM551.356 600.644l-67.882 67.882 2.746 2.746c4.008 4.008 4.61 8.806 4.61 11.31 0 2.506-0.598 7.302-4.606 11.314l-165.494 165.49c-4.010 4.010-8.81 4.61-11.314 4.61s-7.304-0.6-11.314-4.61l-133.492-133.486c-4.010-4.010-4.61-8.81-4.61-11.314s0.598-7.3 4.61-11.312l165.49-165.488c4.010-4.012 8.81-4.612 11.314-4.612s7.304 0.6 11.314 4.612l2.746 2.742 67.882-67.88-2.746-2.746c-21.104-21.104-49.23-32.726-79.196-32.726s-58.092 11.624-79.196 32.726l-165.488 165.486c-21.106 21.104-32.73 49.234-32.73 79.198s11.624 58.094 32.726 79.198l133.49 133.49c21.106 21.102 49.232 32.726 79.198 32.726s58.092-11.624 79.196-32.726l165.494-165.492c21.104-21.104 32.722-49.23 32.722-79.196s-11.624-58.094-32.726-79.196l-2.744-2.746zM352 710c-9.724 0-19.45-3.71-26.87-11.128-14.84-14.84-14.84-38.898 0-53.738l320-320c14.84-14.84 38.896-14.84 53.736 0 14.844 14.84 14.844 38.9 0 53.74l-320 320c-7.416 7.416-17.142 11.126-26.866 11.126z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57361, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 3, + "order": 4, + "prevSize": 32, + "code": 57361, + "name": "unlink", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 3 + }, + { + "icon": { + "paths": [ + "M576 281.326v-217.326l336.002 336-336.002 336v-222.096c-390.906-9.17-315 247.096-256 446.096-288-320-212.092-690.874 256-678.674z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57360, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 4, + "order": 5, + "prevSize": 32, + "code": 57360, + "name": "redo", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 4 + }, + { + "icon": { + "paths": [ + "M704 960c59-199 134.906-455.266-256-446.096v222.096l-336.002-336 336.002-336v217.326c468.092-12.2 544 358.674 256 678.674z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57359, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 5, + "order": 6, + "prevSize": 32, + "code": 57359, + "name": "undo", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 5 + }, + { + "icon": { + "paths": [ + "M256.428 424.726c105.8 0 191.572 91.17 191.572 203.638 0 112.464-85.772 203.636-191.572 203.636-105.802 0-191.572-91.17-191.572-203.636l-0.856-29.092c0-224.93 171.54-407.272 383.144-407.272v116.364c-73.1 0-141.826 30.26-193.516 85.204-9.954 10.578-19.034 21.834-27.224 33.656 9.784-1.64 19.806-2.498 30.024-2.498zM768.428 424.726c105.8 0 191.572 91.17 191.572 203.638 0 112.464-85.772 203.636-191.572 203.636-105.802 0-191.572-91.17-191.572-203.636l-0.856-29.092c0-224.93 171.54-407.272 383.144-407.272v116.364c-73.1 0-141.826 30.26-193.516 85.204-9.956 10.578-19.036 21.834-27.224 33.656 9.784-1.64 19.806-2.498 30.024-2.498z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57358, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 6, + "order": 7, + "prevSize": 32, + "code": 57358, + "name": "blockquote", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 6 + }, + { + "icon": { + "paths": [ + "M64 192h896v128h-896zM384 576h576v128h-576zM384 384h576v128h-576zM64 768h896v128h-896zM64 384l224 160-224 160z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57356, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 7, + "order": 8, + "prevSize": 32, + "code": 57356, + "name": "indent", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 7 + }, + { + "icon": { + "paths": [ + "M64 192h896v128h-896zM64 576h576v128h-576zM64 384h576v128h-576zM64 768h896v128h-896zM960 384l-224 160 224 160z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57357, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 8, + "order": 9, + "prevSize": 32, + "code": 57357, + "name": "outdent", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 8 + }, + { + "icon": { + "paths": [ + "M384 128h576v128h-576zM384 448h576v128h-576zM384 768h576v128h-576zM320 530v-146h-64v-320h-128v64h64v256h-64v64h128v50l-128 60v146h128v64h-128v64h128v64h-128v64h192v-320h-128v-50z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57355, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 9, + "order": 10, + "prevSize": 32, + "code": 57355, + "name": "numlist", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 9 + }, + { + "icon": { + "paths": [ + "M384 128h576v128h-576zM384 448h576v128h-576zM384 768h576v128h-576zM128 192c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64zM128 512c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64zM128 832c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57354, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 10, + "order": 11, + "prevSize": 32, + "code": 57354, + "name": "bullist", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 10 + }, + { + "icon": { + "paths": [ + "M888 384h-56v-256h64v-64h-320v64h64v256h-256v-256h64v-64h-320v64h64v256h-56c-39.6 0-72 32.4-72 72v432c0 39.6 32.4 72 72 72h240c39.6 0 72-32.4 72-72v-312h128v312c0 39.6 32.4 72 72 72h240c39.6 0 72-32.4 72-72v-432c0-39.6-32.4-72-72-72zM348 896h-184c-19.8 0-36-14.4-36-32s16.2-32 36-32h184c19.8 0 36 14.4 36 32s-16.2 32-36 32zM544 512h-64c-17.6 0-32-14.4-32-32s14.4-32 32-32h64c17.6 0 32 14.4 32 32s-14.4 32-32 32zM860 896h-184c-19.8 0-36-14.4-36-32s16.2-32 36-32h184c19.8 0 36 14.4 36 32s-16.2 32-36 32z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57353, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 11, + "order": 12, + "prevSize": 32, + "code": 57353, + "name": "searchreplace", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 11 + }, + { + "icon": { + "paths": [ + "M704 384v-160c0-17.6-14.4-32-32-32h-160v-64c0-35.2-28.8-64-64-64h-128c-35.204 0-64 28.8-64 64v64h-160c-17.602 0-32 14.4-32 32v512c0 17.6 14.398 32 32 32h224v192h384l192-192v-384h-192zM320 128.114c0.034-0.038 0.072-0.078 0.114-0.114h127.768c0.042 0.036 0.082 0.076 0.118 0.114l0 63.886h-128v-63.886zM192 320v-64h384v64h-384zM704 869.49v-101.49h101.49l-101.49 101.49zM832 704h-192v192h-256v-448h448v256z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57352, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 12, + "order": 13, + "prevSize": 32, + "code": 57352, + "name": "paste", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 12 + }, + { + "icon": { + "paths": [ + "M832 320h-192v-64l-192-192h-384v704h384v192h576v-448l-192-192zM832 410.51l101.49 101.49h-101.49v-101.49zM448 154.51l101.49 101.49h-101.49v-101.49zM128 128h256v192h192v384h-448v-576zM960 896h-448v-128h128v-384h128v192h192v320z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57393, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 13, + "order": 14, + "prevSize": 32, + "code": 57393, + "name": "copy", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 13 + }, + { + "icon": { + "paths": [ + "M960 512h-265.876c-50.078-35.42-114.43-54.86-182.124-54.86-89.206 0-164.572-50.242-164.572-109.712 0-59.47 75.366-109.714 164.572-109.714 75.058 0 140.308 35.576 159.12 82.286h113.016c-7.93-50.644-37.58-97.968-84.058-132.826-50.88-38.16-117.676-59.174-188.078-59.174-70.404 0-137.196 21.014-188.074 59.174-54.788 41.090-86.212 99.502-86.212 160.254s31.424 119.164 86.212 160.254c1.956 1.466 3.942 2.898 5.946 4.316h-265.872v64h512.532c58.208 17.106 100.042 56.27 100.042 100.572 0 59.468-75.368 109.71-164.572 109.71-75.060 0-140.308-35.574-159.118-82.286h-113.016c7.93 50.64 37.582 97.968 84.060 132.826 50.876 38.164 117.668 59.18 188.072 59.18 70.402 0 137.198-21.016 188.074-59.174 54.79-41.090 86.208-99.502 86.208-160.254 0-35.298-10.654-69.792-30.294-100.572h204.012v-64z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57389, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 19, + "order": 15, + "prevSize": 32, + "code": 57389, + "name": "strikethrough", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 14 + }, + { + "icon": { + "paths": [ + "M192 832h576v64h-576v-64zM640 128v384c0 31.312-14.7 61.624-41.39 85.352-30.942 27.502-73.068 42.648-118.61 42.648-45.544 0-87.668-15.146-118.608-42.648-26.692-23.728-41.392-54.040-41.392-85.352v-384h-128v384c0 141.382 128.942 256 288 256s288-114.618 288-256v-384h-128z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57388, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 20, + "order": 16, + "prevSize": 32, + "code": 57388, + "name": "underline", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 15 + }, + { + "icon": { + "paths": [ + "M832 128v64h-144l-256 640h144v64h-448v-64h144l256-640h-144v-64h448z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57387, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 21, + "order": 17, + "prevSize": 32, + "code": 57387, + "name": "italic", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 16 + }, + { + "icon": { + "paths": [ + "M625.442 494.182c48.074-38.15 78.558-94.856 78.558-158.182 0-114.876-100.29-208-224-208h-224v768h288c123.712 0 224-93.124 224-208 0-88.196-59.118-163.562-142.558-193.818zM384 304c0-26.51 21.49-48 48-48h67.204c42.414 0 76.796 42.98 76.796 96s-34.382 96-76.796 96h-115.204v-144zM547.2 768h-115.2c-26.51 0-48-21.49-48-48v-144h163.2c42.418 0 76.8 42.98 76.8 96s-34.382 96-76.8 96z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57386, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 22, + "order": 18, + "prevSize": 32, + "code": 57386, + "name": "bold", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 17 + }, + { + "icon": { + "paths": [ + "M850.746 242.746l-133.492-133.49c-24.888-24.892-74.054-45.256-109.254-45.256h-416c-35.2 0-64 28.8-64 64v768c0 35.2 28.8 64 64 64h640c35.2 0 64-28.8 64-64v-544c0-35.2-20.366-84.364-45.254-109.254zM805.49 287.998c6.792 6.796 13.792 19.162 18.894 32.002h-184.384v-184.386c12.84 5.1 25.204 12.1 32 18.896l133.49 133.488zM831.884 896h-639.77c-0.040-0.034-0.082-0.076-0.114-0.116v-767.77c0.034-0.040 0.076-0.082 0.114-0.114h383.886v256h256v511.884c-0.034 0.040-0.076 0.082-0.116 0.116z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57345, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 23, + "order": 19, + "prevSize": 32, + "code": 57345, + "name": "newdocument", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 18 + }, + { + "icon": { + "paths": [ + "M960 880v-591.938l-223.938-224.062h-592.062c-44.182 0-80 35.816-80 80v736c0 44.184 35.818 80 80 80h736c44.184 0 80-35.816 80-80zM576 192h64v192h-64v-192zM704 832h-384v-255.882c0.034-0.042 0.076-0.082 0.116-0.118h383.77c0.040 0.036 0.082 0.076 0.116 0.118l-0.002 255.882zM832 832h-64v-256c0-35.2-28.8-64-64-64h-384c-35.2 0-64 28.8-64 64v256h-64v-640h64v192c0 35.2 28.8 64 64 64h320c35.2 0 64-28.8 64-64v-171.010l128 128.072v490.938z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57344, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 24, + "order": 20, + "prevSize": 32, + "code": 57344, + "name": "save", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 19 + }, + { + "icon": { + "paths": [ + "M64 192v704h896v-704h-896zM384 640v-128h256v128h-256zM640 704v128h-256v-128h256zM640 320v128h-256v-128h256zM320 320v128h-192v-128h192zM128 512h192v128h-192v-128zM704 512h192v128h-192v-128zM704 448v-128h192v128h-192zM128 704h192v128h-192v-128zM704 832v-128h192v128h-192z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57371, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 25, + "order": 21, + "prevSize": 32, + "code": 57371, + "name": "table", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 20 + }, + { + "icon": { + "paths": [ + "M512 140c99.366 0 192.782 38.694 263.042 108.956s108.958 163.678 108.958 263.044-38.696 192.782-108.958 263.042-163.676 108.958-263.042 108.958-192.782-38.696-263.044-108.958-108.956-163.676-108.956-263.042 38.694-192.782 108.956-263.044 163.678-108.956 263.044-108.956zM512 64c-247.424 0-448 200.576-448 448s200.576 448 448 448 448-200.576 448-448-200.576-448-448-448v0zM320 384c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64zM576 384c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64zM512 656c-101.84 0-192.56-36.874-251.166-94.328 23.126 117.608 126.778 206.328 251.166 206.328 124.388 0 228.040-88.72 251.168-206.328-58.608 57.454-149.328 94.328-251.168 94.328z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57377, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 26, + "order": 22, + "prevSize": 32, + "code": 57377, + "name": "emoticons", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 21 + }, + { + "icon": { + "paths": [ + "M480 384l-192-192 128-128h-352v352l128-128 192 192zM640 480l192-192 128 128v-352h-352l128 128-192 192zM544 640l192 192-128 128h352v-352l-128 128-192-192zM384 544l-192 192-128-128v352h352l-128-128 192-192z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57379, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 27, + "order": 23, + "prevSize": 32, + "code": 57379, + "name": "fullscreen", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 22 + }, + { + "icon": { + "paths": [ + "M64 448h896v128h-896z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57372, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 28, + "order": 24, + "prevSize": 32, + "code": 57372, + "name": "hr", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 23 + }, + { + "icon": { + "paths": [ + "M64 768h512v128h-512v-128zM768 192h-220.558l-183.766 512h-132.288l183.762-512h-223.15v-128h576v128zM929.774 896l-129.774-129.774-129.774 129.774-62.226-62.226 129.774-129.774-129.774-129.774 62.226-62.226 129.774 129.774 129.774-129.774 62.226 62.226-129.774 129.774 129.774 129.774-62.226 62.226z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57373, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 29, + "order": 25, + "prevSize": 32, + "code": 57373, + "name": "removefromat", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 24 + }, + { + "icon": { + "paths": [ + "M256 128h512v128h-512v-128zM896 320h-768c-35.2 0-64 28.8-64 64v256c0 35.2 28.796 64 64 64h128v192h512v-192h128c35.2 0 64-28.8 64-64v-256c0-35.2-28.8-64-64-64zM704 832h-384v-256h384v256zM910.4 416c0 25.626-20.774 46.4-46.398 46.4s-46.402-20.774-46.402-46.4 20.778-46.4 46.402-46.4c25.626 0 46.398 20.774 46.398 46.4z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57378, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 30, + "order": 26, + "prevSize": 32, + "code": 57378, + "name": "print", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 25 + }, + { + "icon": { + "paths": [ + "M384 128c-123.712 0-224 100.288-224 224s100.288 224 224 224v320h128v-640h64v640h128v-640h128v-128h-448z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57390, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 31, + "order": 27, + "prevSize": 32, + "code": 57390, + "name": "visualchars", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 26 + }, + { + "icon": { + "paths": [ + "M448 128c-123.712 0-224 100.288-224 224s100.288 224 224 224v320h128v-640h64v640h128v-640h128v-128h-448zM64 896l224-192-224-192z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57391, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 32, + "order": 28, + "prevSize": 32, + "code": 57391, + "name": "ltr", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 27 + }, + { + "icon": { + "paths": [ + "M416 704l-192-192 192-192-64-64-256 256 256 256zM672 256l-64 64 192 192-192 192 64 64 256-256z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57367, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 38, + "order": 29, + "prevSize": 32, + "code": 57367, + "name": "code", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 28 + }, + { + "icon": { + "paths": [ + "M448 704h128v128h-128v-128zM704 256c35.346 0 64 28.654 64 64v166l-228 154h-92v-64l192-128v-64h-320v-128h384zM512 64c-119.666 0-232.166 46.6-316.784 131.216-84.614 84.618-131.216 197.118-131.216 316.784 0 119.664 46.602 232.168 131.216 316.784 84.618 84.616 197.118 131.216 316.784 131.216 119.664 0 232.168-46.6 316.784-131.216 84.616-84.616 131.216-197.12 131.216-316.784 0-119.666-46.6-232.166-131.216-316.784-84.616-84.616-197.12-131.216-316.784-131.216z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57366, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 39, + "order": 30, + "prevSize": 32, + "code": 57366, + "name": "help", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 29 + }, + { + "icon": { + "paths": [ + "M896 128h-768c-35.2 0-64 28.8-64 64v640c0 35.2 28.8 64 64 64h768c35.2 0 64-28.8 64-64v-640c0-35.2-28.8-64-64-64zM896 831.884c-0.012 0.014-0.030 0.028-0.042 0.042l-191.958-319.926-160 128-224-288-191.968 479.916c-0.010-0.010-0.022-0.022-0.032-0.032v-639.77c0.034-0.040 0.076-0.082 0.114-0.114h767.77c0.040 0.034 0.082 0.076 0.116 0.116v639.768zM640 352c0 53.019 42.981 96 96 96s96-42.981 96-96c0-53.019-42.981-96-96-96-53.019 0-96 42.981-96 96z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57364, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 40, + "order": 31, + "prevSize": 32, + "code": 57364, + "name": "image", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 30 + }, + { + "icon": { + "paths": [ + "M896 128h-768c-35.2 0-64 28.8-64 64v640c0 35.2 28.8 64 64 64h768c35.2 0 64-28.8 64-64v-640c0-35.2-28.8-64-64-64zM256 832h-128v-128h128v128zM256 576h-128v-128h128v128zM256 320h-128v-128h128v128zM704 832h-384v-640h384v640zM896 832h-128v-128h128v128zM896 576h-128v-128h128v128zM896 320h-128v-128h128v128zM384 320v384l288-192z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57365, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 41, + "order": 32, + "prevSize": 32, + "code": 57365, + "name": "media", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 31 + }, + { + "icon": { + "paths": [ + "M77.798 304.624l81.414 50.882c50.802-81.114 128.788-143.454 221.208-174.246l-30.366-91.094c-113.748 37.898-209.728 114.626-272.256 214.458zM673.946 90.166l-30.366 91.094c92.422 30.792 170.404 93.132 221.208 174.248l81.412-50.882c-62.526-99.834-158.506-176.562-272.254-214.46zM607.974 704.008c-4.808 0-9.692-1.090-14.286-3.386l-145.688-72.844v-211.778c0-17.672 14.328-32 32-32s32 14.328 32 32v172.222l110.31 55.156c15.806 7.902 22.214 27.124 14.31 42.932-5.604 11.214-16.908 17.696-28.646 17.698zM512 192c-212.078 0-384 171.922-384 384s171.922 384 384 384c212.078 0 384-171.922 384-384 0-212.078-171.922-384-384-384zM512 864c-159.058 0-288-128.942-288-288s128.942-288 288-288c159.058 0 288 128.942 288 288 0 159.058-128.942 288-288 288z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57368, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 42, + "order": 33, + "prevSize": 32, + "code": 57368, + "name": "insertdatetime", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 32 + }, + { + "icon": { + "paths": [ + "M64 455.746c45.318-49.92 97.162-92.36 153.272-125.124 90.332-52.744 192.246-80.622 294.728-80.622 102.48 0 204.396 27.878 294.726 80.624 56.112 32.764 107.956 75.204 153.274 125.124v-117.432c-33.010-28.118-68.124-53.14-104.868-74.594-105.006-61.314-223.658-93.722-343.132-93.722s-238.128 32.408-343.134 93.72c-36.742 21.454-71.856 46.478-104.866 74.596v117.43zM512 320c-183.196 0-345.838 100.556-448 256 102.162 155.448 264.804 256 448 256 183.196 0 345.838-100.552 448-256-102.162-155.444-264.804-256-448-256zM512 512c0 35.346-28.654 64-64 64s-64-28.654-64-64c0-35.348 28.654-64 64-64s64 28.652 64 64zM728.066 696.662c-67.434 39.374-140.128 59.338-216.066 59.338s-148.632-19.964-216.066-59.338c-51.554-30.104-98.616-71.31-138.114-120.662 39.498-49.35 86.56-90.558 138.116-120.66 13.276-7.752 26.758-14.74 40.426-20.982-10.512 23.742-16.362 50.008-16.362 77.642 0 106.040 85.962 192 192 192 106.040 0 192-85.96 192-192 0-27.634-5.85-53.9-16.36-77.642 13.668 6.244 27.15 13.23 40.426 20.982 51.554 30.102 98.616 71.31 138.116 120.66-39.498 49.352-86.56 90.558-138.116 120.662z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57369, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 43, + "order": 34, + "prevSize": 32, + "code": 57369, + "name": "preview", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 33 + }, + { + "icon": { + "paths": [ + "M651.168 283.834c-24.612-81.962-28.876-91.834-107.168-91.834h-64c-79.618 0-82.664 10.152-108.418 96 0 0.002 0 0.002-0.002 0.004l-143.998 479.996h113.636l57.6-192h226.366l57.6 192h113.63l-145.246-484.166zM437.218 448l38.4-136c10.086-33.618 36.38-30 36.38-30s26.294-3.618 36.38 30h0.004l38.4 136h-149.564z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57370, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 44, + "order": 35, + "prevSize": 32, + "code": 57370, + "name": "forecolor", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 34 + }, + { + "icon": { + "paths": [ + "M576 64c247.424 0 448 200.576 448 448s-200.576 448-448 448v-96c94.024 0 182.418-36.614 248.902-103.098 66.484-66.484 103.098-154.878 103.098-248.902 0-94.022-36.614-182.418-103.098-248.902-66.484-66.484-154.878-103.098-248.902-103.098-94.022 0-182.418 36.614-248.902 103.098-51.14 51.138-84.582 115.246-97.306 184.902h186.208l-224 256-224-256h164.57c31.060-217.102 217.738-384 443.43-384zM768 448v128h-256v-320h128v192z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57384, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 45, + "order": 36, + "prevSize": 32, + "code": 57384, + "name": "restoredraft", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 35 + }, + { + "icon": { + "paths": [ + "M1024 592.458v-160.916l-159.144-15.914c-8.186-30.042-20.088-58.548-35.21-84.98l104.596-127.838-113.052-113.050-127.836 104.596c-26.434-15.124-54.942-27.026-84.982-35.208l-15.914-159.148h-160.916l-15.914 159.146c-30.042 8.186-58.548 20.086-84.98 35.208l-127.838-104.594-113.050 113.050 104.596 127.836c-15.124 26.432-27.026 54.94-35.21 84.98l-159.146 15.916v160.916l159.146 15.914c8.186 30.042 20.086 58.548 35.21 84.982l-104.596 127.836 113.048 113.048 127.838-104.596c26.432 15.124 54.94 27.028 84.98 35.21l15.916 159.148h160.916l15.914-159.144c30.042-8.186 58.548-20.088 84.982-35.21l127.836 104.596 113.048-113.048-104.596-127.836c15.124-26.434 27.028-54.942 35.21-84.98l159.148-15.92zM704 576l-128 128h-128l-128-128v-128l128-128h128l128 128v128z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57346, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 46, + "order": 37, + "prevSize": 32, + "code": 57346, + "name": "fullpage", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 36 + }, + { + "icon": { + "paths": [ + "M768 206v50h128v64h-192v-146l128-60v-50h-128v-64h192v146zM676 256h-136l-188 188-188-188h-136l256 256-256 256h136l188-188 188 188h136l-256-256z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57375, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 47, + "order": 38, + "prevSize": 32, + "code": 57375, + "name": "superscript", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 37 + }, + { + "icon": { + "paths": [ + "M768 910v50h128v64h-192v-146l128-60v-50h-128v-64h192v146zM676 256h-136l-188 188-188-188h-136l256 256-256 256h136l188-188 188 188h136l-256-256z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57374, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 48, + "order": 39, + "prevSize": 32, + "code": 57374, + "name": "subscript", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 38 + }, + { + "icon": { + "paths": [ + "M704 384v-160c0-17.6-14.4-32-32-32h-160v-64c0-35.2-28.8-64-64-64h-128c-35.204 0-64 28.8-64 64v64h-160c-17.602 0-32 14.4-32 32v512c0 17.6 14.398 32 32 32h224v192h576v-576h-192zM320 128.114c0.034-0.038 0.072-0.078 0.114-0.114h127.768c0.042 0.036 0.082 0.076 0.118 0.114l0 63.886h-128v-63.886zM192 320v-64h384v64h-384zM832 896h-448v-448h448v448zM448 512v128h32l32-64h64v192h-48v64h160v-64h-48v-192h64l32 64h32v-128z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "pastetext" + ], + "defaultCode": 57397, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 49, + "order": 40, + "prevSize": 32, + "code": 57397, + "name": "pastetext", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 39 + }, + { + "icon": { + "paths": [ + "M768 256h64v64h-64zM640 384h64v64h-64zM640 512h64v64h-64zM640 640h64v64h-64zM512 512h64v64h-64zM512 640h64v64h-64zM384 640h64v64h-64zM768 384h64v64h-64zM768 512h64v64h-64zM768 640h64v64h-64zM768 768h64v64h-64zM640 768h64v64h-64zM512 768h64v64h-64zM384 768h64v64h-64zM256 768h64v64h-64z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "resize", + "dots" + ], + "defaultCode": 57394, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 50, + "order": 41, + "prevSize": 32, + "code": 57394, + "name": "resize", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 40 + }, + { + "icon": { + "paths": [ + "M928 128h-416l-32-64h-352l-64 128h896zM840.34 704h87.66l32-448h-896l64 640h356.080c-104.882-37.776-180.080-138.266-180.080-256 0-149.982 122.018-272 272-272 149.98 0 272 122.018 272 272 0 21.678-2.622 43.15-7.66 64zM874.996 849.75l-134.496-110.692c17.454-28.922 27.5-62.814 27.5-99.058 0-106.040-85.96-192-192-192s-192 85.96-192 192 85.96 192 192 192c36.244 0 70.138-10.046 99.058-27.5l110.692 134.496c22.962 26.678 62.118 28.14 87.006 3.252l5.492-5.492c24.888-24.888 23.426-64.044-3.252-87.006zM576 764c-68.484 0-124-55.516-124-124s55.516-124 124-124 124 55.516 124 124-55.516 124-124 124z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "browse" + ], + "defaultCode": 57396, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 51, + "order": 42, + "prevSize": 32, + "code": 57396, + "name": "browse", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 41 + }, + { + "icon": { + "paths": [ + "M864.408 670.132c-46.47-46.47-106.938-68.004-161.082-62.806l-63.326-63.326 192-192c0 0 128-128 0-256l-320 320-320-320c-128 128 0 256 0 256l192 192-63.326 63.326c-54.144-5.198-114.61 16.338-161.080 62.806-74.98 74.98-85.112 186.418-22.626 248.9 62.482 62.482 173.92 52.354 248.9-22.626 46.47-46.468 68.002-106.938 62.806-161.080l63.326-63.326 63.328 63.328c-5.196 54.144 16.336 114.61 62.806 161.078 74.978 74.98 186.418 85.112 248.898 22.626 62.488-62.482 52.356-173.918-22.624-248.9zM353.124 758.578c-2.212 24.332-15.020 49.826-35.14 69.946-22.212 22.214-51.080 35.476-77.218 35.476-10.524 0-25.298-2.228-35.916-12.848-21.406-21.404-17.376-73.132 22.626-113.136 22.212-22.214 51.080-35.476 77.218-35.476 10.524 0 25.298 2.228 35.916 12.848 13.112 13.11 13.47 32.688 12.514 43.19zM512 608c-35.346 0-64-28.654-64-64s28.654-64 64-64 64 28.654 64 64-28.654 64-64 64zM819.152 851.152c-10.62 10.62-25.392 12.848-35.916 12.848-26.138 0-55.006-13.262-77.218-35.476-20.122-20.12-32.928-45.614-35.138-69.946-0.958-10.502-0.6-30.080 12.514-43.192 10.618-10.622 25.39-12.848 35.916-12.848 26.136 0 55.006 13.262 77.216 35.474 40.004 40.008 44.032 91.736 22.626 113.14z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57351, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 14, + "order": 43, + "prevSize": 32, + "code": 57351, + "name": "cut", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 42 + }, + { + "icon": { + "paths": [ + "M64 192h896v128h-896zM64 576h896v128h-896zM64 384h896v128h-896zM64 768h896v128h-896z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57350, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 15, + "order": 44, + "prevSize": 32, + "code": 57350, + "name": "alignjustify", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 43 + }, + { + "icon": { + "paths": [ + "M64 192h896v128h-896zM64 576h896v128h-896zM256 384h512v128h-512zM256 768h512v128h-512z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57348, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 16, + "order": 45, + "prevSize": 32, + "code": 57348, + "name": "aligncenter", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 44 + }, + { + "icon": { + "paths": [ + "M64 192h896v128h-896zM64 576h896v128h-896zM384 384h576v128h-576zM384 768h576v128h-576z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57349, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 17, + "order": 46, + "prevSize": 32, + "code": 57349, + "name": "alignright", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 45 + }, + { + "icon": { + "paths": [ + "M64 192h896v128h-896zM64 576h896v128h-896zM64 384h576v128h-576zM64 768h576v128h-576z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57347, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 18, + "order": 47, + "prevSize": 32, + "code": 57347, + "name": "alignleft", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 46 + }, + { + "icon": { + "paths": [ + "M320 128c-123.712 0-224 100.288-224 224s100.288 224 224 224v320h128v-640h64v640h128v-640h128v-128h-448zM960 512l-224 192 224 192z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57392, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 33, + "order": 48, + "prevSize": 32, + "code": 57392, + "name": "rtl", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 47 + }, + { + "icon": { + "paths": [ + "M512 384h128v64h-128zM512 768h128v64h-128zM576 576h128v64h-128zM768 576v192h-64v64h128v-256zM384 576h128v64h-128zM320 768h128v64h-128zM320 384h128v64h-128zM192 192v256h64v-192h64v-64zM704 448h128v-256h-64v192h-64zM64 64v896h896v-896h-896zM896 896h-768v-768h768v768zM192 576v256h64v-192h64v-64zM576 192h128v64h-128zM384 192h128v64h-128z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57382, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 34, + "order": 49, + "prevSize": 32, + "code": 57382, + "name": "template", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 48 + }, + { + "icon": { + "paths": [ + "M816 64l16 384h-640l16-384h32l16 320h512l16-320h32zM208 960l-16-320h640l-16 320h-32l-16-256h-512l-16 256h-32zM64 512h128v64h-128zM256 512h128v64h-128zM448 512h128v64h-128zM640 512h128v64h-128zM832 512h128v64h-128z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57383, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 35, + "order": 50, + "prevSize": 32, + "code": 57383, + "name": "pagebreak", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 49 + }, + { + "icon": { + "paths": [ + "M960 128v-64h-192c-35.202 0-64 28.8-64 64v320c0 15.856 5.858 30.402 15.496 41.614l-303.496 260.386-142-148-82 70 224 288 416-448h128v-64h-192v-320h192zM256 512h64v-384c0-35.2-28.8-64-64-64h-128c-35.2 0-64 28.8-64 64v384h64v-192h128v192zM128 256v-128h128v128h-128zM640 448v-96c0-35.2-8.8-64-44-64 35.2 0 44-28.8 44-64v-96c0-35.2-28.8-64-64-64h-192v448h192c35.2 0 64-28.8 64-64zM448 128h128v128h-128v-128zM448 320h128v128h-128v-128z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57380, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 36, + "order": 51, + "prevSize": 32, + "code": 57380, + "name": "spellcheck", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 50 + }, + { + "icon": { + "paths": [ + "M448 512h-128v-128h128v-128h128v128h128v128h-128v128h-128v-128zM960 576v320h-896v-320h128v192h640v-192h128z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57381, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 37, + "order": 52, + "prevSize": 32, + "code": 57381, + "name": "nonbreaking", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 51 + } + ], + "height": 1024, + "metadata": { + "name": "tinymce-small" + }, + "preferences": { + "showGlyphs": true, + "showQuickUse": true, + "showQuickUse2": true, + "showSVGs": true, + "fontPref": { + "prefix": "icon-", + "metadata": { + "fontFamily": "tinymce-small", + "majorVersion": 1, + "minorVersion": 0 + }, + "metrics": { + "emSize": 1024, + "baseline": 6.25, + "whitespace": 50 + }, + "showMetrics": false, + "showMetadata": false, + "showVersion": false + }, + "imagePref": { + "prefix": "icon-", + "png": true, + "useClassSelector": true, + "color": 4473924, + "bgColor": 16777215 + }, + "historySize": 100, + "showCodes": true + } +} \ No newline at end of file diff --git a/admin/assets/js/tinymce/skins/light/fonts/tinymce-small.svg b/admin/assets/js/tinymce/skins/light/fonts/tinymce-small.svg new file mode 100755 index 0000000..df07ee7 --- /dev/null +++ b/admin/assets/js/tinymce/skins/light/fonts/tinymce-small.svg @@ -0,0 +1,62 @@ + + + +Generated by IcoMoon + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/admin/assets/js/tinymce/skins/light/fonts/tinymce-small.ttf b/admin/assets/js/tinymce/skins/light/fonts/tinymce-small.ttf new file mode 100755 index 0000000..31554f6 Binary files /dev/null and b/admin/assets/js/tinymce/skins/light/fonts/tinymce-small.ttf differ diff --git a/admin/assets/js/tinymce/skins/light/fonts/tinymce-small.woff b/admin/assets/js/tinymce/skins/light/fonts/tinymce-small.woff new file mode 100755 index 0000000..6be9a1d Binary files /dev/null and b/admin/assets/js/tinymce/skins/light/fonts/tinymce-small.woff differ diff --git a/admin/assets/js/tinymce/skins/light/fonts/tinymce.eot b/admin/assets/js/tinymce/skins/light/fonts/tinymce.eot new file mode 100755 index 0000000..e116242 Binary files /dev/null and b/admin/assets/js/tinymce/skins/light/fonts/tinymce.eot differ diff --git a/admin/assets/js/tinymce/skins/light/fonts/tinymce.json b/admin/assets/js/tinymce/skins/light/fonts/tinymce.json new file mode 100755 index 0000000..e6d39c9 --- /dev/null +++ b/admin/assets/js/tinymce/skins/light/fonts/tinymce.json @@ -0,0 +1,1752 @@ +{ + "IcoMoonType": "selection", + "icons": [ + { + "icon": { + "paths": [ + "M928 128h-416l-32-64h-352l-64 128h896zM904.34 704h74.86l44.8-448h-1024l64 640h484.080c-104.882-37.776-180.080-138.266-180.080-256 0-149.982 122.018-272 272-272 149.98 0 272 122.018 272 272 0 21.678-2.622 43.15-7.66 64zM1002.996 913.75l-198.496-174.692c17.454-28.92 27.5-62.814 27.5-99.058 0-106.040-85.96-192-192-192s-192 85.96-192 192 85.96 192 192 192c36.244 0 70.138-10.046 99.058-27.5l174.692 198.496c22.962 26.678 62.118 28.14 87.006 3.252l5.492-5.492c24.888-24.888 23.426-64.044-3.252-87.006zM640 764c-68.484 0-124-55.516-124-124s55.516-124 124-124 124 55.516 124 124-55.516 124-124 124z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57396, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 0, + "order": 1, + "prevSize": 32, + "code": 57396, + "name": "browse", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 0 + }, + { + "icon": { + "paths": [ + "M768 256h64v64h-64zM640 384h64v64h-64zM640 512h64v64h-64zM640 640h64v64h-64zM512 512h64v64h-64zM512 640h64v64h-64zM384 640h64v64h-64zM768 384h64v64h-64zM768 512h64v64h-64zM768 640h64v64h-64zM768 768h64v64h-64zM640 768h64v64h-64zM512 768h64v64h-64zM384 768h64v64h-64zM256 768h64v64h-64z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "resize", + "dots" + ], + "defaultCode": 57394, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 1, + "order": 2, + "prevSize": 32, + "code": 57394, + "name": "resize", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 1 + }, + { + "icon": { + "paths": [ + "M832 256h-192v-64l-192-192h-448v768h384v256h640v-576l-192-192zM832 346.51l101.49 101.49h-101.49v-101.49zM448 90.51l101.49 101.49h-101.49v-101.49zM64 64h320v192h192v448h-512v-640zM960 960h-512v-192h192v-448h128v192h192v448z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "copy" + ], + "defaultCode": 57393, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 2, + "order": 3, + "prevSize": 32, + "code": 57393, + "name": "copy", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 2 + }, + { + "icon": { + "paths": [ + "M256 64h512v128h-128v768h-128v-768h-128v768h-128v-448c-123.712 0-224-100.288-224-224s100.288-224 224-224zM960 896l-256-224 256-224z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "rtl" + ], + "defaultCode": 57392, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 3, + "order": 4, + "prevSize": 32, + "code": 57392, + "name": "rtl", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 3 + }, + { + "icon": { + "paths": [ + "M448 64h512v128h-128v768h-128v-768h-128v768h-128v-448c-123.712 0-224-100.288-224-224s100.288-224 224-224zM64 448l256 224-256 224z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "ltr" + ], + "defaultCode": 57391, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 4, + "order": 5, + "prevSize": 32, + "code": 57391, + "name": "ltr", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 4 + }, + { + "icon": { + "paths": [ + "M384 64h512v128h-128v768h-128v-768h-128v768h-128v-448c-123.712 0-224-100.288-224-224s100.288-224 224-224z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "visualchars" + ], + "defaultCode": 57390, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 5, + "order": 6, + "prevSize": 32, + "code": 57390, + "name": "visualchars", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 5 + }, + { + "icon": { + "paths": [ + "M731.42 517.036c63.92 47.938 100.58 116.086 100.58 186.964s-36.66 139.026-100.58 186.964c-59.358 44.518-137.284 69.036-219.42 69.036-82.138 0-160.062-24.518-219.42-69.036-63.92-47.938-100.58-116.086-100.58-186.964h128c0 69.382 87.926 128 192 128 104.074 0 192-58.618 192-128 0-69.382-87.926-128-192-128-82.138 0-160.062-24.518-219.42-69.036-63.92-47.94-100.58-116.086-100.58-186.964 0-70.878 36.66-139.024 100.58-186.964 59.358-44.518 137.282-69.036 219.42-69.036 82.136 0 160.062 24.518 219.42 69.036 63.92 47.94 100.58 116.086 100.58 186.964h-128c0-69.382-87.926-128-192-128-104.074 0-192 58.618-192 128 0 69.382 87.926 128 192 128 82.136 0 160.062 24.518 219.42 69.036zM0 512h1024v64h-1024z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "strikethrough" + ], + "defaultCode": 57389, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 6, + "order": 7, + "prevSize": 32, + "code": 57389, + "name": "strikethrough", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 6 + }, + { + "icon": { + "paths": [ + "M704 64h128v416c0 159.058-143.268 288-320 288-176.73 0-320-128.942-320-288v-416h128v416c0 40.166 18.238 78.704 51.354 108.506 36.896 33.204 86.846 51.494 140.646 51.494 53.8 0 103.75-18.29 140.646-51.494 33.116-29.802 51.354-68.34 51.354-108.506v-416zM192 832h640v128h-640z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "underline" + ], + "defaultCode": 57388, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 7, + "order": 8, + "prevSize": 32, + "code": 57388, + "name": "underline", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 7 + }, + { + "icon": { + "paths": [ + "M896 64v64h-128l-320 768h128v64h-448v-64h128l320-768h-128v-64z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "italic" + ], + "defaultCode": 57387, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 8, + "order": 9, + "prevSize": 32, + "code": 57387, + "name": "italic", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 8 + }, + { + "icon": { + "paths": [ + "M707.88 484.652c37.498-44.542 60.12-102.008 60.12-164.652 0-141.16-114.842-256-256-256h-320v896h384c141.158 0 256-114.842 256-256 0-92.956-49.798-174.496-124.12-219.348zM384 192h101.5c55.968 0 101.5 57.42 101.5 128s-45.532 128-101.5 128h-101.5v-256zM543 832h-159v-256h159c58.45 0 106 57.42 106 128s-47.55 128-106 128z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "bold0" + ], + "defaultCode": 57386, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 9, + "order": 10, + "prevSize": 32, + "code": 57386, + "name": "bold", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 9 + }, + { + "icon": { + "paths": [ + "M576 64c247.424 0 448 200.576 448 448s-200.576 448-448 448v-96c94.024 0 182.418-36.614 248.902-103.098 66.484-66.484 103.098-154.878 103.098-248.902 0-94.022-36.614-182.418-103.098-248.902-66.484-66.484-154.878-103.098-248.902-103.098-94.022 0-182.418 36.614-248.902 103.098-51.14 51.138-84.582 115.246-97.306 184.902h186.208l-224 256-224-256h164.57c31.060-217.102 217.738-384 443.43-384zM768 448v128h-256v-320h128v192z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "restoredraft" + ], + "defaultCode": 57384, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 11, + "order": 11, + "prevSize": 32, + "code": 57384, + "name": "restoredraft", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 10 + }, + { + "icon": { + "paths": [ + "M0 512h128v64h-128zM192 512h192v64h-192zM448 512h128v64h-128zM640 512h192v64h-192zM896 512h128v64h-128zM880 0l16 448h-768l16-448h32l16 384h640l16-384zM144 1024l-16-384h768l-16 384h-32l-16-320h-640l-16 320z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "pagebreak" + ], + "defaultCode": 57383, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 12, + "order": 12, + "prevSize": 32, + "code": 57383, + "name": "pagebreak", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 11 + }, + { + "icon": { + "paths": [ + "M384 192h128v64h-128zM576 192h128v64h-128zM896 192v256h-192v-64h128v-128h-64v-64zM320 384h128v64h-128zM512 384h128v64h-128zM192 256v128h64v64h-128v-256h192v64zM384 576h128v64h-128zM576 576h128v64h-128zM896 576v256h-192v-64h128v-128h-64v-64zM320 768h128v64h-128zM512 768h128v64h-128zM192 640v128h64v64h-128v-256h192v64zM960 64h-896v896h896v-896zM1024 0v0 1024h-1024v-1024h1024z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "template" + ], + "defaultCode": 57382, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 13, + "order": 13, + "prevSize": 32, + "code": 57382, + "name": "template", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 12 + }, + { + "icon": { + "paths": [ + "M448 576h-192v-128h192v-192h128v192h192v128h-192v192h-128zM1024 640v384h-1024v-384h128v256h768v-256z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "nonbreaking" + ], + "defaultCode": 57381, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 14, + "order": 14, + "prevSize": 32, + "code": 57381, + "name": "nonbreaking", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 13 + }, + { + "icon": { + "paths": [ + "M128 256h128v192h64v-384c0-35.2-28.8-64-64-64h-128c-35.2 0-64 28.8-64 64v384h64v-192zM128 64h128v128h-128v-128zM960 64v-64h-192c-35.202 0-64 28.8-64 64v320c0 35.2 28.798 64 64 64h192v-64h-192v-320h192zM640 160v-96c0-35.2-28.8-64-64-64h-192v448h192c35.2 0 64-28.8 64-64v-96c0-35.2-8.8-64-44-64 35.2 0 44-28.8 44-64zM576 384h-128v-128h128v128zM576 192h-128v-128h128v128zM832 576l-416 448-224-288 82-70 142 148 352-302z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "spellchecker" + ], + "defaultCode": 57380, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 15, + "order": 15, + "prevSize": 32, + "code": 57380, + "name": "spellchecker", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 14 + }, + { + "icon": { + "paths": [ + "M704 896h256l64-128v256h-384v-214.214c131.112-56.484 224-197.162 224-361.786 0-214.432-157.598-382.266-352-382.266-194.406 0-352 167.832-352 382.266 0 164.624 92.886 305.302 224 361.786v214.214h-384v-256l64 128h256v-32.59c-187.63-66.46-320-227.402-320-415.41 0-247.424 229.23-448 512-448 282.77 0 512 200.576 512 448 0 188.008-132.37 348.95-320 415.41v32.59z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "charmap" + ], + "defaultCode": 57376, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 19, + "order": 16, + "prevSize": 32, + "code": 57376, + "name": "charmap", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 15 + }, + { + "icon": { + "paths": [ + "M768 206v50h128v64h-192v-146l128-60v-50h-128v-64h192v146zM676 256h-136l-188 188-188-188h-136l256 256-256 256h136l188-188 188 188h136l-256-256z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "sup" + ], + "defaultCode": 57375, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 20, + "order": 17, + "prevSize": 32, + "code": 57375, + "name": "sup", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 16 + }, + { + "icon": { + "paths": [ + "M768 910v50h128v64h-192v-146l128-60v-50h-128v-64h192v146zM676 256h-136l-188 188-188-188h-136l256 256-256 256h136l188-188 188 188h136l-256-256z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "sub" + ], + "defaultCode": 57374, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 21, + "order": 18, + "prevSize": 32, + "code": 57374, + "name": "sub", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 17 + }, + { + "icon": { + "paths": [ + "M0 896h576v128h-576zM192 0h704v128h-704zM277.388 832l204.688-784.164 123.85 32.328-196.25 751.836zM929.774 1024l-129.774-129.774-129.774 129.774-62.226-62.226 129.774-129.774-129.774-129.774 62.226-62.226 129.774 129.774 129.774-129.774 62.226 62.226-129.774 129.774 129.774 129.774z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "removeformat" + ], + "defaultCode": 57373, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 22, + "order": 19, + "prevSize": 32, + "code": 57373, + "name": "removeformat", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 18 + }, + { + "icon": { + "paths": [ + "M0 448h1024v128h-1024z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "hr" + ], + "defaultCode": 57372, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 23, + "order": 20, + "prevSize": 32, + "code": 57372, + "name": "hr", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 19 + }, + { + "icon": { + "paths": [ + "M0 64v896h1024v-896h-1024zM384 640v-192h256v192h-256zM640 704v192h-256v-192h256zM640 192v192h-256v-192h256zM320 192v192h-256v-192h256zM64 448h256v192h-256v-192zM704 448h256v192h-256v-192zM704 384v-192h256v192h-256zM64 704h256v192h-256v-192zM704 896v-192h256v192h-256z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "table" + ], + "defaultCode": 57371, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 24, + "order": 21, + "prevSize": 32, + "code": 57371, + "name": "table", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 20 + }, + { + "icon": { + "paths": [ + "M322.018 832l57.6-192h264.764l57.6 192h113.632l-191.996-640h-223.236l-192 640h113.636zM475.618 320h72.764l57.6 192h-187.964l57.6-192z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "forecolor" + ], + "defaultCode": 57370, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 25, + "order": 22, + "prevSize": 32, + "code": 57370, + "name": "forecolor", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 21 + }, + { + "icon": { + "paths": [ + "M512 320c-209.368 0-395.244 100.556-512 256 116.756 155.446 302.632 256 512 256 209.368 0 395.244-100.554 512-256-116.756-155.444-302.632-256-512-256zM448 448c35.346 0 64 28.654 64 64s-28.654 64-64 64-64-28.654-64-64 28.654-64 64-64zM773.616 705.296c-39.648 20.258-81.652 35.862-124.846 46.376-44.488 10.836-90.502 16.328-136.77 16.328-46.266 0-92.282-5.492-136.768-16.324-43.194-10.518-85.198-26.122-124.846-46.376-63.020-32.202-120.222-76.41-167.64-129.298 47.418-52.888 104.62-97.1 167.64-129.298 32.336-16.522 66.242-29.946 101.082-40.040-19.888 30.242-31.468 66.434-31.468 105.336 0 106.040 85.962 192 192 192 106.038 0 192-85.96 192-192 0-38.902-11.582-75.094-31.466-105.34 34.838 10.096 68.744 23.52 101.082 40.042 63.022 32.198 120.218 76.408 167.638 129.298-47.42 52.886-104.618 97.1-167.638 129.296zM860.918 243.722c-108.72-55.554-226.112-83.722-348.918-83.722-122.806 0-240.198 28.168-348.918 83.722-58.772 30.032-113.732 67.904-163.082 112.076v109.206c55.338-58.566 120.694-107.754 192.194-144.29 99.62-50.904 207.218-76.714 319.806-76.714s220.186 25.81 319.804 76.716c71.502 36.536 136.858 85.724 192.196 144.29v-109.206c-49.35-44.174-104.308-82.046-163.082-112.078z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "preview" + ], + "defaultCode": 57369, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 26, + "order": 23, + "prevSize": 32, + "code": 57369, + "name": "preview", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 22 + }, + { + "icon": { + "paths": [ + "M512 192c-212.076 0-384 171.922-384 384s171.922 384 384 384c212.074 0 384-171.922 384-384s-171.926-384-384-384zM715.644 779.646c-54.392 54.396-126.716 84.354-203.644 84.354s-149.25-29.958-203.646-84.354c-54.396-54.394-84.354-126.718-84.354-203.646s29.958-149.25 84.354-203.646c54.396-54.396 126.718-84.354 203.646-84.354s149.252 29.958 203.642 84.354c54.402 54.396 84.358 126.718 84.358 203.646s-29.958 149.252-84.356 203.646zM325.93 203.862l-42.94-85.878c-98.874 49.536-179.47 130.132-229.006 229.008l85.876 42.94c40.248-80.336 105.732-145.822 186.070-186.070zM884.134 389.93l85.878-42.938c-49.532-98.876-130.126-179.472-229.004-229.008l-42.944 85.878c80.338 40.248 145.824 105.732 186.070 186.068zM512 384h-64v192c0 10.11 4.7 19.11 12.022 24.972l-0.012 0.016 160 128 39.976-49.976-147.986-118.39v-176.622z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "inserttime" + ], + "defaultCode": 57368, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 27, + "order": 24, + "prevSize": 32, + "code": 57368, + "name": "inserttime", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 23 + }, + { + "icon": { + "paths": [ + "M320 256l-256 256 256 256h128l-256-256 256-256zM704 256h-128l256 256-256 256h128l256-256z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "code" + ], + "defaultCode": 57367, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 28, + "order": 25, + "prevSize": 32, + "code": 57367, + "name": "code", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 24 + }, + { + "icon": { + "paths": [ + "M448 704h128v128h-128zM704 256c35.346 0 64 28.654 64 64v192l-192 128h-128v-64l192-128v-64h-320v-128h384zM512 96c-111.118 0-215.584 43.272-294.156 121.844s-121.844 183.038-121.844 294.156c0 111.118 43.272 215.584 121.844 294.156 78.572 78.572 183.038 121.844 294.156 121.844 111.118 0 215.584-43.272 294.156-121.844 78.572-78.572 121.844-183.038 121.844-294.156 0-111.118-43.272-215.584-121.844-294.156-78.572-78.572-183.038-121.844-294.156-121.844zM512 0v0c282.77 0 512 229.23 512 512s-229.23 512-512 512c-282.77 0-512-229.23-512-512 0-282.77 229.23-512 512-512z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "help" + ], + "defaultCode": 57366, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 29, + "order": 26, + "prevSize": 32, + "code": 57366, + "name": "help", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 25 + }, + { + "icon": { + "paths": [ + "M0 128v768h1024v-768h-1024zM192 832h-128v-128h128v128zM192 576h-128v-128h128v128zM192 320h-128v-128h128v128zM768 832h-512v-640h512v640zM960 832h-128v-128h128v128zM960 576h-128v-128h128v128zM960 320h-128v-128h128v128zM384 320v384l256-192z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "media" + ], + "defaultCode": 57365, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 30, + "order": 27, + "prevSize": 32, + "code": 57365, + "name": "media", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 26 + }, + { + "icon": { + "paths": [ + "M0 128v832h1024v-832h-1024zM960 896h-896v-704h896v704zM704 352c0-53.019 42.981-96 96-96s96 42.981 96 96c0 53.019-42.981 96-96 96-53.019 0-96-42.981-96-96zM896 832h-768l192-512 256 320 128-96z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "image" + ], + "defaultCode": 57364, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 31, + "order": 28, + "prevSize": 32, + "code": 57364, + "name": "image", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 27 + }, + { + "icon": { + "paths": [ + "M192 0v1024l320-320 320 320v-1024h-640zM768 869.49l-256-256-256 256v-805.49h512v805.49z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "anchor" + ], + "defaultCode": 57363, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 32, + "order": 29, + "prevSize": 32, + "code": 57363, + "name": "anchor", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 28 + }, + { + "icon": { + "paths": [ + "M476.888 675.114c4.56 9.048 6.99 19.158 6.99 29.696 0 17.616-6.744 34.058-18.992 46.308l-163.38 163.38c-12.248 12.248-28.696 18.992-46.308 18.992s-34.060-6.744-46.308-18.992l-99.38-99.38c-12.248-12.25-18.992-28.696-18.992-46.308s6.744-34.060 18.992-46.308l163.38-163.382c12.248-12.246 28.696-18.992 46.308-18.992 10.538 0 20.644 2.43 29.696 6.988l65.338-65.336c-27.87-21.41-61.44-32.16-95.034-32.16-39.986 0-79.972 15.166-110.308 45.502l-163.38 163.382c-60.67 60.67-60.67 159.95 0 220.618l99.38 99.382c30.334 30.332 70.32 45.5 110.306 45.5 39.988 0 79.974-15.168 110.308-45.502l163.38-163.38c55.82-55.82 60.238-144.298 13.344-205.346l-65.34 65.338zM978.496 144.884l-99.38-99.382c-30.334-30.336-70.32-45.502-110.308-45.502-39.986 0-79.97 15.166-110.306 45.502l-163.382 163.382c-55.82 55.82-60.238 144.298-13.342 205.342l65.338-65.34c-4.558-9.050-6.988-19.16-6.988-29.694 0-17.616 6.744-34.060 18.992-46.308l163.382-163.382c12.246-12.248 28.694-18.994 46.306-18.994 17.616 0 34.060 6.746 46.308 18.994l99.38 99.382c12.248 12.248 18.992 28.694 18.992 46.308s-6.744 34.060-18.992 46.308l-163.38 163.382c-12.248 12.248-28.694 18.992-46.308 18.992-10.536 0-20.644-2.43-29.696-6.99l-65.338 65.338c27.872 21.41 61.44 32.16 95.034 32.16 39.988 0 79.974-15.168 110.308-45.504l163.38-163.38c60.672-60.666 60.672-159.944 0-220.614zM233.368 278.624l-191.994-191.994 45.256-45.256 191.994 191.994zM384 0h64v192h-64zM0 384h192v64h-192zM790.632 745.376l191.996 191.996-45.256 45.256-191.996-191.996zM576 832h64v192h-64zM832 576h192v64h-192z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "unlink" + ], + "defaultCode": 57362, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 33, + "order": 30, + "prevSize": 32, + "code": 57362, + "name": "unlink", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 29 + }, + { + "icon": { + "paths": [ + "M320 704c17.6 17.6 47.274 16.726 65.942-1.942l316.118-316.116c18.668-18.668 19.54-48.342 1.94-65.942s-47.274-16.726-65.942 1.942l-316.116 316.116c-18.668 18.668-19.542 48.342-1.942 65.942zM476.888 675.112c4.56 9.050 6.99 19.16 6.99 29.696 0 17.616-6.744 34.060-18.992 46.308l-163.382 163.382c-12.248 12.248-28.694 18.992-46.308 18.992s-34.060-6.744-46.308-18.992l-99.382-99.382c-12.248-12.248-18.992-28.694-18.992-46.308s6.744-34.060 18.992-46.308l163.382-163.382c12.248-12.248 28.694-18.994 46.308-18.994 10.536 0 20.644 2.43 29.696 6.99l65.338-65.338c-27.87-21.41-61.44-32.16-95.034-32.16-39.986 0-79.972 15.166-110.308 45.502l-163.382 163.382c-60.67 60.67-60.67 159.948 0 220.618l99.382 99.382c30.334 30.332 70.32 45.5 110.306 45.5 39.988 0 79.974-15.168 110.308-45.502l163.382-163.382c55.82-55.82 60.238-144.298 13.344-205.344l-65.34 65.34zM978.498 144.884l-99.382-99.382c-30.334-30.336-70.32-45.502-110.308-45.502-39.986 0-79.972 15.166-110.308 45.502l-163.382 163.382c-55.82 55.82-60.238 144.298-13.342 205.342l65.338-65.34c-4.558-9.050-6.988-19.16-6.988-29.694 0-17.616 6.744-34.060 18.992-46.308l163.382-163.382c12.248-12.248 28.694-18.994 46.308-18.994s34.060 6.746 46.308 18.994l99.382 99.382c12.248 12.248 18.992 28.694 18.992 46.308s-6.744 34.060-18.992 46.308l-163.382 163.382c-12.248 12.248-28.694 18.992-46.308 18.992-10.536 0-20.644-2.43-29.696-6.99l-65.338 65.338c27.872 21.41 61.44 32.16 95.034 32.16 39.988 0 79.974-15.168 110.308-45.502l163.382-163.382c60.67-60.666 60.67-159.944 0-220.614z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "link" + ], + "defaultCode": 57361, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 34, + "order": 31, + "prevSize": 32, + "code": 57361, + "name": "link", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 30 + }, + { + "icon": { + "paths": [ + "M0 64h1024v128h-1024zM384 256h640v128h-640zM384 448h640v128h-640zM384 640h640v128h-640zM0 832h1024v128h-1024zM256 320v384l-256-192z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "outdent" + ], + "defaultCode": 57357, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 38, + "order": 32, + "prevSize": 32, + "code": 57357, + "name": "outdent", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 31 + }, + { + "icon": { + "paths": [ + "M0 64h1024v128h-1024zM384 256h640v128h-640zM384 448h640v128h-640zM384 640h640v128h-640zM0 832h1024v128h-1024zM0 704v-384l256 192z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "indent" + ], + "defaultCode": 57356, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 39, + "order": 33, + "prevSize": 32, + "code": 57356, + "name": "indent", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 32 + }, + { + "icon": { + "paths": [ + "M384 832h640v128h-640zM384 448h640v128h-640zM384 64h640v128h-640zM192 0v256h-64v-192h-64v-64zM128 526v50h128v64h-192v-146l128-60v-50h-128v-64h192v146zM256 704v320h-192v-64h128v-64h-128v-64h128v-64h-128v-64z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "numlist" + ], + "defaultCode": 57355, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 40, + "order": 34, + "prevSize": 32, + "code": 57355, + "name": "numlist", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 33 + }, + { + "icon": { + "paths": [ + "M384 64h640v128h-640v-128zM384 448h640v128h-640v-128zM384 832h640v128h-640v-128zM0 128c0-70.692 57.308-128 128-128 70.692 0 128 57.308 128 128 0 70.692-57.308 128-128 128-70.692 0-128-57.308-128-128zM0 512c0-70.692 57.308-128 128-128 70.692 0 128 57.308 128 128 0 70.692-57.308 128-128 128-70.692 0-128-57.308-128-128zM0 896c0-70.692 57.308-128 128-128 70.692 0 128 57.308 128 128 0 70.692-57.308 128-128 128-70.692 0-128-57.308-128-128z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "bullist" + ], + "defaultCode": 57354, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 41, + "order": 35, + "prevSize": 32, + "code": 57354, + "name": "bullist", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 34 + }, + { + "icon": { + "paths": [ + "M64 0h384v64h-384zM576 0h384v64h-384zM952 320h-56v-256h-256v256h-256v-256h-256v256h-56c-39.6 0-72 32.4-72 72v560c0 39.6 32.4 72 72 72h304c39.6 0 72-32.4 72-72v-376h128v376c0 39.6 32.4 72 72 72h304c39.6 0 72-32.4 72-72v-560c0-39.6-32.4-72-72-72zM348 960h-248c-19.8 0-36-14.4-36-32s16.2-32 36-32h248c19.8 0 36 14.4 36 32s-16.2 32-36 32zM544 512h-64c-17.6 0-32-14.4-32-32s14.4-32 32-32h64c17.6 0 32 14.4 32 32s-14.4 32-32 32zM924 960h-248c-19.8 0-36-14.4-36-32s16.2-32 36-32h248c19.8 0 36 14.4 36 32s-16.2 32-36 32z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "searchreplace" + ], + "defaultCode": 57353, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 42, + "order": 36, + "prevSize": 32, + "code": 57353, + "name": "searchreplace", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 35 + }, + { + "icon": { + "paths": [ + "M832 320v-160c0-17.6-14.4-32-32-32h-224v-64c0-35.2-28.8-64-64-64h-128c-35.204 0-64 28.8-64 64v64h-224c-17.602 0-32 14.4-32 32v640c0 17.6 14.398 32 32 32h288v192h448l192-192v-512h-192zM384 64.114c0.034-0.038 0.072-0.078 0.114-0.114h127.768c0.042 0.036 0.082 0.076 0.118 0.114l0 63.886h-128v-63.886zM192 256v-64h512v64h-512zM832 933.49v-101.49h101.49l-101.49 101.49zM960 768h-192v192h-320v-576h512v384z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "paste" + ], + "defaultCode": 57352, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 43, + "order": 37, + "prevSize": 32, + "code": 57352, + "name": "paste", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 36 + }, + { + "icon": { + "paths": [ + "M890.774 709.154c-45.654-45.556-103.728-69.072-157.946-69.072h-29.112l-63.904-64.008 255.62-256.038c63.904-64.010 63.904-192.028 0-256.038l-383.43 384.056-383.432-384.054c-63.904 64.008-63.904 192.028 0 256.038l255.622 256.034-63.906 64.008h-29.114c-54.22 0-112.292 23.518-157.948 69.076-81.622 81.442-92.65 202.484-24.63 270.35 29.97 29.902 70.288 44.494 112.996 44.494 54.216 0 112.29-23.514 157.946-69.072 53.584-53.464 76.742-124 67.084-185.348l65.384-65.488 65.376 65.488c-9.656 61.348 13.506 131.882 67.084 185.348 45.662 45.558 103.732 69.072 157.948 69.072 42.708 0 83.024-14.592 112.994-44.496 68.020-67.866 56.988-188.908-24.632-270.35zM353.024 845.538c-7.698 17.882-19.010 34.346-33.626 48.926-14.636 14.604-31.172 25.918-49.148 33.624-16.132 6.916-32.96 10.568-48.662 10.568-15.146 0-36.612-3.402-52.862-19.612-16.136-16.104-19.52-37.318-19.52-52.288 0-15.542 3.642-32.21 10.526-48.212 7.7-17.884 19.014-34.346 33.626-48.926 14.634-14.606 31.172-25.914 49.15-33.624 16.134-6.914 32.96-10.568 48.664-10.568 15.146 0 36.612 3.4 52.858 19.614 16.134 16.098 19.522 37.316 19.522 52.284 0.002 15.542-3.638 32.216-10.528 48.214zM512.004 666.596c-49.914 0-90.376-40.532-90.376-90.526 0-49.992 40.462-90.52 90.376-90.52s90.372 40.528 90.372 90.52c0 49.998-40.46 90.526-90.372 90.526zM855.272 919.042c-16.248 16.208-37.712 19.612-52.86 19.612-15.704 0-32.53-3.652-48.666-10.568-17.972-7.706-34.508-19.020-49.142-33.624-14.614-14.58-25.926-31.042-33.626-48.926-6.886-15.998-10.526-32.672-10.526-48.212 0-14.966 3.384-36.188 19.52-52.286 16.246-16.208 37.712-19.614 52.86-19.614 15.7 0 32.53 3.654 48.66 10.568 17.978 7.708 34.516 19.018 49.15 33.624 14.61 14.58 25.924 31.042 33.626 48.926 6.884 15.998 10.526 32.67 10.526 48.212-0.002 14.97-3.39 36.186-19.522 52.288z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "cut" + ], + "defaultCode": 57351, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 44, + "order": 38, + "prevSize": 32, + "code": 57351, + "name": "cut", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 37 + }, + { + "icon": { + "paths": [ + "M0 64h1024v128h-1024zM0 256h1024v128h-1024zM0 448h1024v128h-1024zM0 640h1024v128h-1024zM0 832h1024v128h-1024z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "alignjustify" + ], + "defaultCode": 57350, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 45, + "order": 39, + "prevSize": 32, + "code": 57350, + "name": "alignjustify", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 38 + }, + { + "icon": { + "paths": [ + "M0 64h1024v128h-1024zM384 256h640v128h-640zM384 640h640v128h-640zM0 448h1024v128h-1024zM0 832h1024v128h-1024z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "alignright" + ], + "defaultCode": 57349, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 46, + "order": 40, + "prevSize": 32, + "code": 57349, + "name": "alignright", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 39 + }, + { + "icon": { + "paths": [ + "M0 64h1024v128h-1024zM192 256h640v128h-640zM192 640h640v128h-640zM0 448h1024v128h-1024zM0 832h1024v128h-1024z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "aligncenter" + ], + "defaultCode": 57348, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 47, + "order": 41, + "prevSize": 32, + "code": 57348, + "name": "aligncenter", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 40 + }, + { + "icon": { + "paths": [ + "M0 64h1024v128h-1024zM0 256h640v128h-640zM0 640h640v128h-640zM0 448h1024v128h-1024zM0 832h1024v128h-1024z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "alignleft" + ], + "defaultCode": 57347, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 48, + "order": 42, + "prevSize": 32, + "code": 57347, + "name": "alignleft", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 41 + }, + { + "icon": { + "paths": [ + "M1024 592.458v-160.916l-159.144-15.914c-8.186-30.042-20.088-58.548-35.21-84.98l104.596-127.838-113.052-113.050-127.836 104.596c-26.434-15.124-54.942-27.026-84.982-35.208l-15.914-159.148h-160.916l-15.914 159.146c-30.042 8.186-58.548 20.086-84.98 35.208l-127.838-104.594-113.050 113.050 104.596 127.836c-15.124 26.432-27.026 54.94-35.21 84.98l-159.146 15.916v160.916l159.146 15.914c8.186 30.042 20.086 58.548 35.21 84.982l-104.596 127.836 113.048 113.048 127.838-104.596c26.432 15.124 54.94 27.028 84.98 35.21l15.916 159.148h160.916l15.914-159.144c30.042-8.186 58.548-20.088 84.982-35.21l127.836 104.596 113.048-113.048-104.596-127.836c15.124-26.434 27.028-54.942 35.21-84.98l159.148-15.92zM704 576l-128 128h-128l-128-128v-128l128-128h128l128 128v128z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "fullpage" + ], + "defaultCode": 57346, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 49, + "order": 43, + "prevSize": 32, + "code": 57346, + "name": "fullpage", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 42 + }, + { + "icon": { + "paths": [ + "M903.432 199.43l-142.864-142.862c-31.112-31.112-92.568-56.568-136.568-56.568h-480c-44 0-80 36-80 80v864c0 44 36 80 80 80h736c44 0 80-36 80-80v-608c0-44-25.456-105.458-56.568-136.57zM858.178 244.686c3.13 3.13 6.25 6.974 9.28 11.314h-163.458v-163.456c4.34 3.030 8.184 6.15 11.314 9.28l142.864 142.862zM896 944c0 8.672-7.328 16-16 16h-736c-8.672 0-16-7.328-16-16v-864c0-8.672 7.328-16 16-16h480c4.832 0 10.254 0.61 16 1.704v254.296h254.296c1.094 5.746 1.704 11.166 1.704 16v608z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "newdocument" + ], + "defaultCode": 57345, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 50, + "order": 44, + "prevSize": 32, + "code": 57345, + "name": "newdocument", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 43 + }, + { + "icon": { + "paths": [ + "M896 0h-896v1024h1024v-896l-128-128zM512 128h128v256h-128v-256zM896 896h-768v-768h64v320h576v-320h74.978l53.022 53.018v714.982z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "save" + ], + "defaultCode": 57344, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 51, + "order": 45, + "prevSize": 32, + "code": 57344, + "name": "save", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 44 + }, + { + "icon": { + "paths": [ + "M128 544l288 288 480-480-128-128-352 352-160-160z" + ], + "attrs": [], + "isMulticolor": false, + "defaultCode": 57395, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 52, + "order": 46, + "prevSize": 32, + "code": 57395, + "name": "checkbox", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 45 + }, + { + "icon": { + "paths": [ + "M512 512v128h32l32-64h64v256h-48v64h224v-64h-48v-256h64l32 64h32v-128zM832 320v-160c0-17.6-14.4-32-32-32h-224v-64c0-35.2-28.8-64-64-64h-128c-35.204 0-64 28.8-64 64v64h-224c-17.602 0-32 14.4-32 32v640c0 17.6 14.398 32 32 32h288v192h640v-704h-192zM384 64.114c0.034-0.038 0.072-0.078 0.114-0.114h127.768c0.042 0.036 0.082 0.076 0.118 0.114l0 63.886h-128v-63.886zM192 256v-64h512v64h-512zM960 960h-512v-576h512v576z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "pastetext" + ], + "defaultCode": 57397, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 53, + "order": 47, + "prevSize": 32, + "code": 57397, + "name": "pastetext", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 46 + }, + { + "icon": { + "paths": [ + "M1024 0v384l-138.26-138.26-212 212-107.48-107.48 212-212-138.26-138.26zM245.74 138.26l212 212-107.48 107.48-212-212-138.26 138.26v-384h384zM885.74 778.26l138.26-138.26v384h-384l138.26-138.26-212-212 107.48-107.48zM457.74 673.74l-212 212 138.26 138.26h-384v-384l138.26 138.26 212-212z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "fullscreen" + ], + "defaultCode": 57379, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 16, + "order": 48, + "prevSize": 32, + "code": 57379, + "name": "fullscreen", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 47 + }, + { + "icon": { + "paths": [ + "M256 64h512v128h-512zM960 256h-896c-35.2 0-64 28.8-64 64v320c0 35.2 28.796 64 64 64h192v256h512v-256h192c35.2 0 64-28.8 64-64v-320c0-35.2-28.8-64-64-64zM704 896h-384v-320h384v320zM974.4 352c0 25.626-20.774 46.4-46.398 46.4-25.626 0-46.402-20.774-46.402-46.4s20.776-46.4 46.402-46.4c25.626 0 46.398 20.774 46.398 46.4z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "print" + ], + "defaultCode": 57378, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 17, + "order": 49, + "prevSize": 32, + "code": 57378, + "name": "print", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 48 + }, + { + "icon": { + "paths": [ + "M512 0c-282.77 0-512 229.228-512 512 0 282.77 229.228 512 512 512 282.77 0 512-229.23 512-512 0-282.772-229.23-512-512-512zM512 944c-238.586 0-432-193.412-432-432 0-238.586 193.414-432 432-432 238.59 0 432 193.414 432 432 0 238.588-193.41 432-432 432zM384 320c0 35.346-28.654 64-64 64s-64-28.654-64-64 28.654-64 64-64 64 28.654 64 64zM768 320c0 35.346-28.652 64-64 64s-64-28.654-64-64 28.652-64 64-64 64 28.654 64 64zM512 652c141.074 0 262.688-57.532 318.462-123.192-20.872 171.22-156.288 303.192-318.462 303.192-162.118 0-297.498-132.026-318.444-303.168 55.786 65.646 177.386 123.168 318.444 123.168z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "emoticons" + ], + "defaultCode": 57377, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 18, + "order": 50, + "prevSize": 32, + "code": 57377, + "name": "emoticons", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 49 + }, + { + "icon": { + "paths": [ + "M225 448c123.712 0 224 100.29 224 224 0 123.712-100.288 224-224 224-123.712 0-224-100.288-224-224l-1-32c0-247.424 200.576-448 448-448v128c-85.474 0-165.834 33.286-226.274 93.726-11.634 11.636-22.252 24.016-31.83 37.020 11.438-1.8 23.16-2.746 35.104-2.746zM801 448c123.71 0 224 100.29 224 224 0 123.712-100.29 224-224 224-123.71 0-224-100.288-224-224l-1-32c0-247.424 200.576-448 448-448v128c-85.474 0-165.834 33.286-226.274 93.726-11.636 11.636-22.254 24.016-31.832 37.020 11.44-1.8 23.16-2.746 35.106-2.746z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "blockquote" + ], + "defaultCode": 57358, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 37, + "order": 51, + "prevSize": 32, + "code": 57358, + "name": "blockquote", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 50 + }, + { + "icon": { + "paths": [ + "M761.862 1024c113.726-206.032 132.888-520.306-313.862-509.824v253.824l-384-384 384-384v248.372c534.962-13.942 594.57 472.214 313.862 775.628z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "undo" + ], + "defaultCode": 57359, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 36, + "order": 52, + "prevSize": 32, + "code": 57359, + "name": "undo", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 51 + }, + { + "icon": { + "paths": [ + "M576 248.372v-248.372l384 384-384 384v-253.824c-446.75-10.482-427.588 303.792-313.86 509.824-280.712-303.414-221.1-789.57 313.86-775.628z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "redo" + ], + "defaultCode": 57360, + "grid": 0 + }, + "attrs": [], + "properties": { + "id": 35, + "order": 53, + "prevSize": 32, + "code": 57360, + "name": "redo", + "ligatures": "" + }, + "setIdx": 0, + "setId": 4, + "iconIdx": 52 + }, + { + "icon": { + "paths": [ + "M768 544v352h-640v-640h352l128-128h-512c-52.8 0-96 43.2-96 96v704c0 52.8 43.2 96 96 96h704c52.798 0 96-43.2 96-96v-512l-128 128z", + "M864 0l-608 608v160h160l608-608c0-96-64-160-160-160zM416 640l-48-48 480-480 48 48-480 480z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "pencil", + "write", + "edit" + ], + "defaultCode": 57361, + "grid": 16 + }, + "attrs": [], + "properties": { + "id": 68, + "order": 54, + "prevSize": 32, + "code": 59668, + "ligatures": "pencil7, write7", + "name": "editimage" + }, + "setIdx": 1, + "setId": 3, + "iconIdx": 20 + }, + { + "icon": { + "paths": [ + "M704 64c-247.424 0-448 200.576-448 448h-224l288 288 288-288h-224c0-176.73 143.27-320 320-320 176.732 0 320 143.27 320 320 0 176.732-143.268 320-320 320v128c247.424 0 448-200.576 448-448s-200.576-448-448-448z" + ], + "width": 1152, + "attrs": [], + "isMulticolor": false, + "tags": [ + "rotate-ccw", + "ccw", + "arrow" + ], + "defaultCode": 60072, + "grid": 16 + }, + "attrs": [], + "properties": { + "id": 22, + "order": 8, + "prevSize": 32, + "code": 60072, + "ligatures": "rotate-ccw3, ccw4", + "name": "rotateleft" + }, + "setIdx": 1, + "setId": 3, + "iconIdx": 424 + }, + { + "icon": { + "paths": [ + "M448 64c247.424 0 448 200.576 448 448h224l-288 288-288-288h224c0-176.73-143.27-320-320-320-176.732 0-320 143.27-320 320 0 176.732 143.268 320 320 320v128c-247.424 0-448-200.576-448-448s200.576-448 448-448z" + ], + "width": 1152, + "attrs": [], + "isMulticolor": false, + "tags": [ + "rotate-cw", + "cw", + "arrow" + ], + "defaultCode": 60073, + "grid": 16 + }, + "attrs": [], + "properties": { + "order": 9, + "id": 1679, + "prevSize": 32, + "code": 60073, + "ligatures": "rotate-cw3, cw4", + "name": "rotateright" + }, + "setIdx": 1, + "setId": 3, + "iconIdx": 425 + }, + { + "icon": { + "paths": [ + "M0 384h1024v-384zM1024 960v-384h-1024z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "flip-vertical", + "mirror" + ], + "defaultCode": 57663, + "grid": 16 + }, + "attrs": [], + "properties": { + "id": 403, + "order": 60, + "prevSize": 32, + "code": 60074, + "ligatures": "flip-vertical, mirror", + "name": "flipv" + }, + "setIdx": 1, + "setId": 3, + "iconIdx": 426 + }, + { + "icon": { + "paths": [ + "M576 0v1024h384zM0 1024h384v-1024z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "flip-horizontal", + "mirror" + ], + "defaultCode": 57664, + "grid": 16 + }, + "attrs": [], + "properties": { + "id": 405, + "order": 61, + "prevSize": 32, + "code": 60076, + "ligatures": "flip-horizontal, mirror3", + "name": "fliph" + }, + "setIdx": 1, + "setId": 3, + "iconIdx": 428 + }, + { + "icon": { + "paths": [ + "M992.262 871.396l-242.552-206.294c-25.074-22.566-51.89-32.926-73.552-31.926 57.256-67.068 91.842-154.078 91.842-249.176 0-212.078-171.922-384-384-384-212.076 0-384 171.922-384 384 0 212.078 171.922 384 384 384 95.098 0 182.108-34.586 249.176-91.844-1 21.662 9.36 48.478 31.926 73.552l206.294 242.552c35.322 39.246 93.022 42.554 128.22 7.356s31.892-92.898-7.354-128.22zM384 640c-141.384 0-256-114.616-256-256s114.616-256 256-256 256 114.616 256 256-114.614 256-256 256zM448 192h-128v128h-128v128h128v128h128v-128h128v-128h-128z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "zoom-in", + "magnifier", + "magnifier-plus", + "enlarge" + ], + "defaultCode": 57788, + "grid": 16 + }, + "attrs": [], + "properties": { + "id": 534, + "order": 58, + "prevSize": 32, + "code": 60213, + "ligatures": "zoom-in3, magnifier9", + "name": "zoomin" + }, + "setIdx": 1, + "setId": 3, + "iconIdx": 565 + }, + { + "icon": { + "paths": [ + "M992.262 871.396l-242.552-206.294c-25.074-22.566-51.89-32.926-73.552-31.926 57.256-67.068 91.842-154.078 91.842-249.176 0-212.078-171.922-384-384-384-212.076 0-384 171.922-384 384 0 212.078 171.922 384 384 384 95.098 0 182.108-34.586 249.176-91.844-1 21.662 9.36 48.478 31.926 73.552l206.294 242.552c35.322 39.246 93.022 42.554 128.22 7.356s31.892-92.898-7.354-128.22zM384 640c-141.384 0-256-114.616-256-256s114.616-256 256-256 256 114.616 256 256-114.614 256-256 256zM192 320h384v128h-384z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "zoom-out", + "magnifier", + "magnifier-minus", + "reduce" + ], + "defaultCode": 57789, + "grid": 16 + }, + "attrs": [], + "properties": { + "id": 535, + "order": 59, + "prevSize": 32, + "code": 60214, + "ligatures": "zoom-out3, magnifier10", + "name": "zoomout" + }, + "setIdx": 1, + "setId": 3, + "iconIdx": 566 + }, + { + "icon": { + "paths": [ + "M64 192h896v192h-896zM64 448h896v192h-896zM64 704h896v192h-896z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "menu", + "list", + "options", + "lines", + "hamburger" + ], + "defaultCode": 58031, + "grid": 16 + }, + "attrs": [], + "properties": { + "order": 57, + "id": 1448, + "prevSize": 32, + "code": 60522, + "ligatures": "menu3, list4", + "name": "options" + }, + "setIdx": 1, + "setId": 3, + "iconIdx": 874 + }, + { + "icon": { + "paths": [ + "M512 832c35.346 0 64 28.654 64 64v64c0 35.346-28.654 64-64 64s-64-28.654-64-64v-64c0-35.346 28.654-64 64-64zM512 192c-35.346 0-64-28.654-64-64v-64c0-35.346 28.654-64 64-64s64 28.654 64 64v64c0 35.346-28.654 64-64 64zM960 448c35.346 0 64 28.654 64 64s-28.654 64-64 64h-64c-35.348 0-64-28.654-64-64s28.652-64 64-64h64zM192 512c0 35.346-28.654 64-64 64h-64c-35.346 0-64-28.654-64-64s28.654-64 64-64h64c35.346 0 64 28.654 64 64zM828.784 738.274l45.256 45.258c24.992 24.99 24.992 65.516 0 90.508-24.994 24.992-65.518 24.992-90.51 0l-45.256-45.256c-24.992-24.99-24.992-65.516 0-90.51 24.994-24.992 65.518-24.992 90.51-0zM195.216 285.726l-45.256-45.256c-24.994-24.994-24.994-65.516 0-90.51s65.516-24.994 90.51 0l45.256 45.256c24.994 24.994 24.994 65.516 0 90.51s-65.516 24.994-90.51 0zM828.784 285.726c-24.992 24.992-65.516 24.992-90.51 0-24.992-24.994-24.992-65.516 0-90.51l45.256-45.254c24.992-24.994 65.516-24.994 90.51 0 24.992 24.994 24.992 65.516 0 90.51l-45.256 45.254zM195.216 738.274c24.992-24.992 65.518-24.992 90.508 0 24.994 24.994 24.994 65.52 0 90.51l-45.254 45.256c-24.994 24.992-65.516 24.992-90.51 0s-24.994-65.518 0-90.508l45.256-45.258z", + "M512 256c-141.384 0-256 114.616-256 256 0 141.382 114.616 256 256 256 141.382 0 256-114.618 256-256 0-141.384-114.616-256-256-256zM512 672c-88.366 0-160-71.634-160-160s71.634-160 160-160 160 71.634 160 160-71.634 160-160 160z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "sun", + "weather" + ], + "defaultCode": 58094, + "grid": 16 + }, + "attrs": [], + "properties": { + "id": 844, + "order": 63, + "prevSize": 32, + "code": 60620, + "ligatures": "sun2, weather21", + "name": "sun" + }, + "setIdx": 1, + "setId": 3, + "iconIdx": 972 + }, + { + "icon": { + "paths": [ + "M715.812 64.48c-60.25-34.784-124.618-55.904-189.572-64.48 122.936 160.082 144.768 384.762 37.574 570.42-107.2 185.67-312.688 279.112-512.788 252.68 39.898 51.958 90.376 97.146 150.628 131.934 245.908 141.974 560.37 57.72 702.344-188.198 141.988-245.924 57.732-560.372-188.186-702.356z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "moon", + "night", + "sleep" + ], + "defaultCode": 58105, + "grid": 16 + }, + "attrs": [], + "properties": { + "id": 855, + "order": 64, + "prevSize": 32, + "code": 60621, + "ligatures": "moon, night", + "name": "moon" + }, + "setIdx": 1, + "setId": 3, + "iconIdx": 973 + }, + { + "icon": { + "paths": [ + "M672 1024l192-192-320-320 320-320-192-192-512 512z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "arrow-left", + "left", + "previous" + ], + "defaultCode": 58291, + "grid": 16 + }, + "attrs": [], + "properties": { + "id": 1056, + "order": 62, + "prevSize": 32, + "code": 60864, + "ligatures": "arrow-left, left4", + "name": "arrowleft" + }, + "setIdx": 1, + "setId": 3, + "iconIdx": 1216 + }, + { + "icon": { + "paths": [ + "M832 256l192-192-64-64-192 192h-448v-192h-128v192h-192v128h192v512h512v192h128v-192h192v-128h-192v-448zM320 320h320l-320 320v-320zM384 704l320-320v320h-320z" + ], + "attrs": [], + "isMulticolor": false, + "tags": [ + "crop", + "resize", + "cut" + ], + "defaultCode": 58428, + "grid": 16 + }, + "attrs": [], + "properties": { + "id": 1201, + "order": 5, + "prevSize": 32, + "code": 61048, + "ligatures": "crop, resize", + "name": "crop" + }, + "setIdx": 1, + "setId": 3, + "iconIdx": 1400 + } + ], + "height": 1024, + "metadata": { + "name": "tinymce" + }, + "preferences": { + "showGlyphs": true, + "showQuickUse": true, + "showQuickUse2": true, + "showSVGs": true, + "fontPref": { + "prefix": "icon-", + "metadata": { + "fontFamily": "tinymce", + "majorVersion": 1, + "minorVersion": 0 + }, + "metrics": { + "emSize": 1024, + "baseline": 6.25, + "whitespace": 50 + } + }, + "imagePref": { + "prefix": "icon-", + "png": true, + "useClassSelector": true, + "color": 4473924, + "bgColor": 16777215 + }, + "historySize": 100, + "showCodes": true, + "gridSize": 16 + } +} \ No newline at end of file diff --git a/admin/assets/js/tinymce/skins/light/fonts/tinymce.svg b/admin/assets/js/tinymce/skins/light/fonts/tinymce.svg new file mode 100755 index 0000000..a4c92e0 --- /dev/null +++ b/admin/assets/js/tinymce/skins/light/fonts/tinymce.svg @@ -0,0 +1,83 @@ + + + +Generated by IcoMoon + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/admin/assets/js/tinymce/skins/light/fonts/tinymce.ttf b/admin/assets/js/tinymce/skins/light/fonts/tinymce.ttf new file mode 100755 index 0000000..422ff56 Binary files /dev/null and b/admin/assets/js/tinymce/skins/light/fonts/tinymce.ttf differ diff --git a/admin/assets/js/tinymce/skins/light/fonts/tinymce.woff b/admin/assets/js/tinymce/skins/light/fonts/tinymce.woff new file mode 100755 index 0000000..bb780bd Binary files /dev/null and b/admin/assets/js/tinymce/skins/light/fonts/tinymce.woff differ diff --git a/admin/assets/js/tinymce/skins/light/img/anchor.gif b/admin/assets/js/tinymce/skins/light/img/anchor.gif new file mode 100755 index 0000000..606348c Binary files /dev/null and b/admin/assets/js/tinymce/skins/light/img/anchor.gif differ diff --git a/admin/assets/js/tinymce/skins/light/img/loader.gif b/admin/assets/js/tinymce/skins/light/img/loader.gif new file mode 100755 index 0000000..c69e937 Binary files /dev/null and b/admin/assets/js/tinymce/skins/light/img/loader.gif differ diff --git a/admin/assets/js/tinymce/skins/light/img/object.gif b/admin/assets/js/tinymce/skins/light/img/object.gif new file mode 100755 index 0000000..cccd7f0 Binary files /dev/null and b/admin/assets/js/tinymce/skins/light/img/object.gif differ diff --git a/admin/assets/js/tinymce/skins/light/img/trans.gif b/admin/assets/js/tinymce/skins/light/img/trans.gif new file mode 100755 index 0000000..3884865 Binary files /dev/null and b/admin/assets/js/tinymce/skins/light/img/trans.gif differ diff --git a/admin/assets/js/tinymce/skins/light/skin.ie7.min.css b/admin/assets/js/tinymce/skins/light/skin.ie7.min.css new file mode 100755 index 0000000..cd70408 --- /dev/null +++ b/admin/assets/js/tinymce/skins/light/skin.ie7.min.css @@ -0,0 +1 @@ +.mce-container,.mce-container *,.mce-widget,.mce-widget *,.mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:inherit !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid rgba(0,0,0,0.2);width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:#d9d9d9}.mce-grid td.mce-grid-cell div{border:1px solid #d6d6d6;width:15px;height:15px;margin:0px;cursor:pointer}.mce-grid td.mce-grid-cell div:focus{border-color:#3498db}.mce-grid td.mce-grid-cell div[disabled]{cursor:not-allowed}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover,.mce-grid a:focus{border-color:#3498db}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#3498db;background:#3498db}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%}.mce-colorbtn-trans div{text-align:center;vertical-align:middle;font-weight:bold;font-size:20px;line-height:16px;color:#707070}.mce-toolbar-grp{padding:2px 0}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-rtl .mce-wordcount{left:0;right:auto}.mce-croprect-container{position:absolute;top:0;left:0}.mce-croprect-handle{position:absolute;top:0;left:0;width:20px;height:20px;border:2px solid white}.mce-croprect-handle-nw{border-width:2px 0 0 2px;margin:-2px 0 0 -2px;cursor:nw-resize;top:100px;left:100px}.mce-croprect-handle-ne{border-width:2px 2px 0 0;margin:-2px 0 0 -20px;cursor:ne-resize;top:100px;left:200px}.mce-croprect-handle-sw{border-width:0 0 2px 2px;margin:-20px 2px 0 -2px;cursor:sw-resize;top:200px;left:100px}.mce-croprect-handle-se{border-width:0 2px 2px 0;margin:-20px 0 0 -20px;cursor:se-resize;top:200px;left:200px}.mce-croprect-handle-move{position:absolute;cursor:move;border:0}.mce-croprect-block{opacity:.3;filter:alpha(opacity=30);zoom:1;position:absolute;background:black}.mce-imagepanel{overflow:auto;background:black}.mce-imagepanel img{position:absolute}.mce-imagetool.mce-btn .mce-ico{display:block;width:20px;height:20px;text-align:center;line-height:20px;font-size:20px;padding:5px}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1}.mce-scroll{position:relative}.mce-panel{border:0 solid rgba(0,0,0,0.2);background-color:#f0f0f0}.mce-floatpanel{position:absolute}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;top:0;left:0;background:#fff;border:1px solid rgba(0,0,0,0.2);border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:rgba(0,0,0,0.2);border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#fff;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#adadad}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #c5c5c5}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window-body .mce-listbox{border-color:#ccc}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #b1b1b1;border-color:transparent transparent transparent transparent;position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);display:inline-block;*display:inline;*zoom:1;background-color:#f0f0f0}.mce-btn:hover,.mce-btn:focus{color:#333;background-color:#e3e3e3;border-color:#ccc}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#dbdbdb;border-color:#ccc}.mce-btn:active{background-color:#e0e0e0;border-color:#ccc}.mce-btn button{padding:4px 8px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px none}.mce-primary{min-width:50px;color:#fff;border:1px solid transparent;border-color:transparent;background-color:#2d8ac7}.mce-primary:hover,.mce-primary:focus{background-color:#257cb6;border-color:transparent}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#206ea1}.mce-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px none}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-btn-flat{border:0;background:transparent;filter:none}.mce-btn-flat:hover,.mce-btn-flat.mce-active,.mce-btn-flat:focus,.mce-btn-flat:active{border:0;background:#e6e6e6;filter:none}.mce-btn-has-text .mce-ico{padding-right:5px}.mce-rtl .mce-btn button{direction:rtl}.mce-btn-group .mce-btn{border-width:1px;margin:0;margin-left:2px}.mce-btn-group:not(:first-child){border-left:1px solid #d9d9d9;padding-left:3px;margin-left:3px}.mce-btn-group .mce-first{margin-left:0}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-rtl .mce-btn-group .mce-btn{margin-left:0;margin-right:2px}.mce-rtl .mce-btn-group .mce-first{margin-right:0}.mce-rtl .mce-btn-group:not(:first-child){border-left:none;border-right:1px solid #d9d9d9;padding-right:4px;margin-right:4px}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;background-color:#f0f0f0;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid rgba(82,168,236,0.8)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-checkbox .mce-label{vertical-align:middle}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.mce-combobox .mce-btn{border:1px solid #c5c5c5;border-left:0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-colorbox i{border:1px solid #c5c5c5;width:14px;height:14px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:6px;padding-left:6px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-17px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;padding-right:4px;border-left:1px solid transparent}.mce-colorbutton:hover .mce-open{border-color:#ccc}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:3px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;padding-left:2px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px;border-left:0}.mce-colorpicker{position:relative;width:250px;height:220px}.mce-colorpicker-sv{position:absolute;top:0;left:0;width:90%;height:100%;border:1px solid #c5c5c5;cursor:crosshair;overflow:hidden}.mce-colorpicker-h-chunk{width:100%}.mce-colorpicker-overlay1,.mce-colorpicker-overlay2{width:100%;height:100%;position:absolute;top:0;left:0}.mce-colorpicker-overlay1{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#ffffff', endColorstr='#00ffffff');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')";background:linear-gradient(to right, #fff, rgba(255,255,255,0))}.mce-colorpicker-overlay2{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#00000000', endColorstr='#000000');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')";background:linear-gradient(to bottom, rgba(0,0,0,0), #000)}.mce-colorpicker-selector1{background:none;position:absolute;width:12px;height:12px;margin:-8px 0 0 -8px;border:1px solid black;border-radius:50%}.mce-colorpicker-selector2{position:absolute;width:10px;height:10px;border:1px solid white;border-radius:50%}.mce-colorpicker-h{position:absolute;top:0;right:0;width:6.5%;height:100%;border:1px solid #c5c5c5;cursor:crosshair}.mce-colorpicker-h-marker{margin-top:-4px;position:absolute;top:0;left:-1px;width:100%;border:1px solid #333;background:#fff;height:4px;z-index:100}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid rgba(0,0,0,0.2);width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-label.mce-error{color:#a00}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;filter:none}.mce-menubar{border:1px solid rgba(217,217,217,0.52)}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:#ccc;background:#fff;filter:none}.mce-menubtn span{color:#333;margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text,.mce-menu-item:focus .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:#fff}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#3498db}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#fff}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item-normal.mce-active:focus .mce-text,.mce-menu-item-normal.mce-active:focus .mce-ico{color:#fff}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#2d8ac7}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:transparent;border-bottom:1px solid rgba(0,0,0,0.1);cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:-1px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(0,0,0,0.2);z-index:1002;max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.mce-slider{border:1px solid #aaa;background:#eee;width:100px;height:10px;position:relative;display:block}.mce-slider.mce-vertical{width:10px;height:100px}.mce-slider-handle{border:1px solid #bbb;background:#ddd;display:block;width:13px;height:13px;position:absolute;top:0;left:0;margin-left:-1px;margin-top:-2px}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#ccc}.mce-splitbtn button{padding-right:6px;padding-left:6px}.mce-splitbtn .mce-open{padding-right:4px;padding-left:4px}.mce-splitbtn .mce-open.mce-active{background-color:#dbdbdb;outline:1px solid #ccc}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:4px;padding-left:4px}.mce-rtl .mce-splitbtn .mce-open{border-left:0}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tabs,.mce-tabs+.mce-container-body{background:#fff}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;display:inline-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#333}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:#3498db}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center} .mce-throbber-inline{position:static;height:50px}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal} .mce-ico{font-family:'tinymce';font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:text-top;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#333;-ie7-icon:' '} .mce-btn-small .mce-ico{font-family:'tinymce-small'} .mce-ico,i.mce-i-checkbox{zoom:expression(this.runtimeStyle['zoom'] = '1', this.innerHTML = this.currentStyle['-ie7-icon'].substr(1, 1) + ' ')} .mce-i-save{-ie7-icon:"\e000"} .mce-i-newdocument{-ie7-icon:"\e001"} .mce-i-fullpage{-ie7-icon:"\e002"} .mce-i-alignleft{-ie7-icon:"\e003"} .mce-i-aligncenter{-ie7-icon:"\e004"} .mce-i-alignright{-ie7-icon:"\e005"} .mce-i-alignjustify{-ie7-icon:"\e006"} .mce-i-alignnone{-ie7-icon:"\e003"} .mce-i-cut{-ie7-icon:"\e007"} .mce-i-paste{-ie7-icon:"\e008"} .mce-i-searchreplace{-ie7-icon:"\e009"} .mce-i-bullist{-ie7-icon:"\e00a"} .mce-i-numlist{-ie7-icon:"\e00b"} .mce-i-indent{-ie7-icon:"\e00c"} .mce-i-outdent{-ie7-icon:"\e00d"} .mce-i-blockquote{-ie7-icon:"\e00e"} .mce-i-undo{-ie7-icon:"\e00f"} .mce-i-redo{-ie7-icon:"\e010"} .mce-i-link{-ie7-icon:"\e011"} .mce-i-unlink{-ie7-icon:"\e012"} .mce-i-anchor{-ie7-icon:"\e013"} .mce-i-image{-ie7-icon:"\e014"} .mce-i-media{-ie7-icon:"\e015"} .mce-i-help{-ie7-icon:"\e016"} .mce-i-code{-ie7-icon:"\e017"} .mce-i-insertdatetime{-ie7-icon:"\e018"} .mce-i-preview{-ie7-icon:"\e019"} .mce-i-forecolor{-ie7-icon:"\e01a"} .mce-i-backcolor{-ie7-icon:"\e01a"} .mce-i-table{-ie7-icon:"\e01b"} .mce-i-hr{-ie7-icon:"\e01c"} .mce-i-removeformat{-ie7-icon:"\e01d"} .mce-i-subscript{-ie7-icon:"\e01e"} .mce-i-superscript{-ie7-icon:"\e01f"} .mce-i-charmap{-ie7-icon:"\e020"} .mce-i-emoticons{-ie7-icon:"\e021"} .mce-i-print{-ie7-icon:"\e022"} .mce-i-fullscreen{-ie7-icon:"\e023"} .mce-i-spellchecker{-ie7-icon:"\e024"} .mce-i-nonbreaking{-ie7-icon:"\e025"} .mce-i-template{-ie7-icon:"\e026"} .mce-i-pagebreak{-ie7-icon:"\e027"} .mce-i-restoredraft{-ie7-icon:"\e028"} .mce-i-untitled{-ie7-icon:"\e029"} .mce-i-bold{-ie7-icon:"\e02a"} .mce-i-italic{-ie7-icon:"\e02b"} .mce-i-underline{-ie7-icon:"\e02c"} .mce-i-strikethrough{-ie7-icon:"\e02d"} .mce-i-visualchars{-ie7-icon:"\e02e"} .mce-i-ltr{-ie7-icon:"\e02f"} .mce-i-rtl{-ie7-icon:"\e030"} .mce-i-copy{-ie7-icon:"\e031"} .mce-i-resize{-ie7-icon:"\e032"} .mce-i-browse{-ie7-icon:"\e034"} .mce-i-pastetext{-ie7-icon:"\e035"} .mce-i-rotateleft{-ie7-icon:"\eaa8"} .mce-i-rotateright{-ie7-icon:"\eaa9"} .mce-i-crop{-ie7-icon:"\ee78"} .mce-i-editimage{-ie7-icon:"\e914"} .mce-i-options{-ie7-icon:"\ec6a"} .mce-i-flipv{-ie7-icon:"\eaaa"} .mce-i-fliph{-ie7-icon:"\eaac"} .mce-i-zoomin{-ie7-icon:"\eb35"} .mce-i-zoomout{-ie7-icon:"\eb36"} .mce-i-sun{-ie7-icon:"\eccc"} .mce-i-moon{-ie7-icon:"\eccd"} .mce-i-arrowleft{-ie7-icon:"\edc0"} .mce-i-arrowright{-ie7-icon:"\edb8"} .mce-i-drop{-ie7-icon:"\e934"} .mce-i-contrast{-ie7-icon:"\ecd4"} .mce-i-sharpen{-ie7-icon:"\eba7"} .mce-i-palette{-ie7-icon:"\e92a"} .mce-i-resize2{-ie7-icon:"\edf9"} .mce-i-orientation{-ie7-icon:"\e601"} .mce-i-invert{-ie7-icon:"\e602"} .mce-i-gamma{-ie7-icon:"\e600"} .mce-i-remove{-ie7-icon:"\ed6a"} .mce-i-checkbox,.mce-i-selected{-ie7-icon:"\e033"} .mce-i-selected{visibility:hidden} .mce-i-backcolor{background:#BBB} \ No newline at end of file diff --git a/admin/assets/js/tinymce/skins/light/skin.min.css b/admin/assets/js/tinymce/skins/light/skin.min.css new file mode 100755 index 0000000..e200385 --- /dev/null +++ b/admin/assets/js/tinymce/skins/light/skin.min.css @@ -0,0 +1,15 @@ +.mce-container,.mce-container *,.mce-widget,.mce-widget *,.mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:0 0;text-decoration:none;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:400;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container [unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:inherit!important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid rgba(0,0,0,.2);width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:#d9d9d9}.mce-grid td.mce-grid-cell div{border:1px solid #d6d6d6;width:15px;height:15px;margin:0;cursor:pointer}.mce-grid td.mce-grid-cell div:focus{border-color:#3498db}.mce-grid td.mce-grid-cell div[disabled]{cursor:not-allowed}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover,.mce-grid a:focus{border-color:#3498db}.mce-grid-border{margin:0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#3498db;background:#3498db}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%}.mce-colorbtn-trans div{text-align:center;vertical-align:middle;font-weight:700;font-size:20px;line-height:16px;color:#707070}.mce-toolbar-grp{padding:2px 0}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-rtl .mce-wordcount{left:0;right:auto}.mce-croprect-container{position:absolute;top:0;left:0}.mce-croprect-handle{position:absolute;top:0;left:0;width:20px;height:20px;border:2px solid #fff}.mce-croprect-handle-nw{border-width:2px 0 0 2px;margin:-2px 0 0 -2px;cursor:nw-resize;top:100px;left:100px}.mce-croprect-handle-ne{border-width:2px 2px 0 0;margin:-2px 0 0 -20px;cursor:ne-resize;top:100px;left:200px}.mce-croprect-handle-sw{border-width:0 0 2px 2px;margin:-20px 2px 0 -2px;cursor:sw-resize;top:200px;left:100px}.mce-croprect-handle-se{border-width:0 2px 2px 0;margin:-20px 0 0 -20px;cursor:se-resize;top:200px;left:200px}.mce-croprect-handle-move{position:absolute;cursor:move;border:0}.mce-croprect-block{opacity:.3;filter:alpha(opacity=30);zoom:1;position:absolute;background:#000}.mce-imagepanel{overflow:auto;background:#000}.mce-imagepanel img{position:absolute}.mce-imagetool.mce-btn .mce-ico{display:block;width:20px;height:20px;text-align:center;line-height:20px;font-size:20px;padding:5px}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,.6);width:5px;height:100%}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1}.mce-scroll{position:relative}.mce-panel{border:0 solid rgba(0,0,0,.2);background-color:#f0f0f0}.mce-floatpanel{position:absolute}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background:0 0;top:0;left:0;background:#fff;border:1px solid rgba(0,0,0,.2);border:1px solid rgba(0,0,0,.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:rgba(0,0,0,.2);border-bottom-color:rgba(0,0,0,.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background:0 0;background:#fff;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:700;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#adadad}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:700;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #c5c5c5}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window-body .mce-listbox{border-color:#ccc}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px;text-align:center;white-space:normal}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #b1b1b1;border-color:transparent;position:relative;text-shadow:0 1px 1px rgba(255,255,255,.75);display:inline-block;*display:inline;*zoom:1;background-color:#f0f0f0}.mce-btn:hover,.mce-btn:focus{color:#333;background-color:#e3e3e3;border-color:#ccc}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#dbdbdb;border-color:#ccc}.mce-btn:active{background-color:#e0e0e0;border-color:#ccc}.mce-btn button{padding:4px 8px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px none}.mce-primary{min-width:50px;color:#fff;border:1px solid transparent;border-color:transparent;background-color:#2d8ac7}.mce-primary:hover,.mce-primary:focus{background-color:#257cb6;border-color:transparent}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#206ea1}.mce-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px none}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-btn-flat{border:0;background:0 0;filter:none}.mce-btn-flat:hover,.mce-btn-flat.mce-active,.mce-btn-flat:focus,.mce-btn-flat:active{border:0;background:#e6e6e6;filter:none}.mce-btn-has-text .mce-ico{padding-right:5px}.mce-rtl .mce-btn button{direction:rtl}.mce-btn-group .mce-btn{border-width:1px;margin:0;margin-left:2px}.mce-btn-group:not(:first-child){border-left:1px solid #d9d9d9;padding-left:3px;margin-left:3px}.mce-btn-group .mce-first{margin-left:0}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-rtl .mce-btn-group .mce-btn{margin-left:0;margin-right:2px}.mce-rtl .mce-btn-group .mce-first{margin-right:0}.mce-rtl .mce-btn-group:not(:first-child){border-left:none;border-right:1px solid #d9d9d9;padding-right:4px;margin-right:4px}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;background-color:#f0f0f0;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid rgba(82,168,236,.8)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-checkbox .mce-label{vertical-align:middle}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.mce-combobox .mce-btn{border:1px solid #c5c5c5;border-left:0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-colorbox i{border:1px solid #c5c5c5;width:14px;height:14px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:6px;padding-left:6px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-17px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;padding-right:4px;border-left:1px solid transparent}.mce-colorbutton:hover .mce-open{border-color:#ccc}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:3px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;padding-left:2px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px;border-left:0}.mce-colorpicker{position:relative;width:250px;height:220px}.mce-colorpicker-sv{position:absolute;top:0;left:0;width:90%;height:100%;border:1px solid #c5c5c5;cursor:crosshair;overflow:hidden}.mce-colorpicker-h-chunk{width:100%}.mce-colorpicker-overlay1,.mce-colorpicker-overlay2{width:100%;height:100%;position:absolute;top:0;left:0}.mce-colorpicker-overlay1{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#ffffff', endColorstr='#00ffffff');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')";background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.mce-colorpicker-overlay2{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#00000000', endColorstr='#000000');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')";background:linear-gradient(to bottom,rgba(0,0,0,0),#000)}.mce-colorpicker-selector1{background:0 0;position:absolute;width:12px;height:12px;margin:-8px 0 0 -8px;border:1px solid #000;border-radius:50%}.mce-colorpicker-selector2{position:absolute;width:10px;height:10px;border:1px solid #fff;border-radius:50%}.mce-colorpicker-h{position:absolute;top:0;right:0;width:6.5%;height:100%;border:1px solid #c5c5c5;cursor:crosshair}.mce-colorpicker-h-marker{margin-top:-4px;position:absolute;top:0;left:-1px;width:100%;border:1px solid #333;background:#fff;height:4px;z-index:100}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid rgba(0,0,0,.2);width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,.75);overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-label.mce-error{color:#a00}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:0 0;filter:none}.mce-menubar{border:1px solid rgba(217,217,217,.52)}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:#ccc;background:#fff;filter:none}.mce-menubtn span{color:#333;margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:400;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text,.mce-menu-item:focus .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:#fff}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#3498db}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#fff}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item-normal.mce-active:focus .mce-text,.mce-menu-item-normal.mce-active:focus .mce-ico{color:#fff}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#2d8ac7}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:0 0;border-bottom:1px solid rgba(0,0,0,.1);cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background:0 0;z-index:1000;padding:5px 0;margin:-1px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(0,0,0,.2);z-index:1002;max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.mce-slider{border:1px solid #aaa;background:#eee;width:100px;height:10px;position:relative;display:block}.mce-slider.mce-vertical{width:10px;height:100px}.mce-slider-handle{border:1px solid #bbb;background:#ddd;display:block;width:13px;height:13px;position:absolute;top:0;left:0;margin-left:-1px;margin-top:-2px}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#ccc}.mce-splitbtn button{padding-right:6px;padding-left:6px}.mce-splitbtn .mce-open{padding-right:4px;padding-left:4px}.mce-splitbtn .mce-open.mce-active{background-color:#dbdbdb;outline:1px solid #ccc}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:4px;padding-left:4px}.mce-rtl .mce-splitbtn .mce-open{border-left:0}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tabs,.mce-tabs+.mce-container-body{background:#fff}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;display:inline-block;-webkit-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s;height:28px;resize:none;padding:0 4px;white-space:pre-wrap;*white-space:pre;color:#333}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:#3498db}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url(img/loader.gif) no-repeat center center} .mce-throbber-inline{position:static;height:50px}@font-face{font-family:tinymce;src:url(fonts/tinymce.eot);src:url(fonts/tinymce.eot?#iefix) format('embedded-opentype'),url(fonts/tinymce.woff) format('woff'),url(fonts/tinymce.ttf) format('truetype'),url(fonts/tinymce.svg#tinymce) format('svg');font-weight:400;font-style:normal}@font-face{font-family:tinymce-small;src:url(fonts/tinymce-small.eot);src:url(fonts/tinymce-small.eot?#iefix) format('embedded-opentype'),url(fonts/tinymce-small.woff) format('woff'),url(fonts/tinymce-small.ttf) format('truetype'),url(fonts/tinymce-small.svg#tinymce) format('svg');font-weight:400;font-style:normal} .mce-ico{font-family:tinymce,Arial;font-style:normal;font-weight:400;font-variant:normal;font-size:16px;line-height:16px;speak:none;vertical-align:text-top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;background:transparent center center;background-size:cover;width:16px;height:16px;color:#333} .mce-btn-small .mce-ico{font-family:tinymce-small,Arial} .mce-i-save:before{content:"\e000"} .mce-i-newdocument:before{content:"\e001"} .mce-i-fullpage:before{content:"\e002"} .mce-i-alignleft:before{content:"\e003"} .mce-i-aligncenter:before{content:"\e004"} .mce-i-alignright:before{content:"\e005"} .mce-i-alignjustify:before{content:"\e006"} .mce-i-alignnone:before{content:"\e003"} .mce-i-cut:before{content:"\e007"} .mce-i-paste:before{content:"\e008"} .mce-i-searchreplace:before{content:"\e009"} .mce-i-bullist:before{content:"\e00a"} .mce-i-numlist:before{content:"\e00b"} .mce-i-indent:before{content:"\e00c"} .mce-i-outdent:before{content:"\e00d"} .mce-i-blockquote:before{content:"\e00e"} .mce-i-undo:before{content:"\e00f"} .mce-i-redo:before{content:"\e010"} .mce-i-link:before{content:"\e011"} .mce-i-unlink:before{content:"\e012"} .mce-i-anchor:before{content:"\e013"} .mce-i-image:before{content:"\e014"} .mce-i-media:before{content:"\e015"} .mce-i-help:before{content:"\e016"} .mce-i-code:before{content:"\e017"} .mce-i-insertdatetime:before{content:"\e018"} .mce-i-preview:before{content:"\e019"} .mce-i-forecolor:before{content:"\e01a"} .mce-i-backcolor:before{content:"\e01a"} .mce-i-table:before{content:"\e01b"} .mce-i-hr:before{content:"\e01c"} .mce-i-removeformat:before{content:"\e01d"} .mce-i-subscript:before{content:"\e01e"} .mce-i-superscript:before{content:"\e01f"} .mce-i-charmap:before{content:"\e020"} .mce-i-emoticons:before{content:"\e021"} .mce-i-print:before{content:"\e022"} .mce-i-fullscreen:before{content:"\e023"} .mce-i-spellchecker:before{content:"\e024"} .mce-i-nonbreaking:before{content:"\e025"} .mce-i-template:before{content:"\e026"} .mce-i-pagebreak:before{content:"\e027"} .mce-i-restoredraft:before{content:"\e028"} .mce-i-untitled:before{content:"\e029"} .mce-i-bold:before{content:"\e02a"} .mce-i-italic:before{content:"\e02b"} .mce-i-underline:before{content:"\e02c"} .mce-i-strikethrough:before{content:"\e02d"} .mce-i-visualchars:before{content:"\e02e"} .mce-i-visualblocks:before{content:"\e02e"} .mce-i-ltr:before{content:"\e02f"} .mce-i-rtl:before{content:"\e030"} .mce-i-copy:before{content:"\e031"} .mce-i-resize:before{content:"\e032"} .mce-i-browse:before{content:"\e034"} .mce-i-pastetext:before{content:"\e035"} .mce-i-rotateleft:before{content:"\eaa8"} .mce-i-rotateright:before{content:"\eaa9"} .mce-i-crop:before{content:"\ee78"} .mce-i-editimage:before{content:"\e914"} .mce-i-options:before{content:"\ec6a"} .mce-i-flipv:before{content:"\eaaa"} .mce-i-fliph:before{content:"\eaac"} .mce-i-zoomin:before{content:"\eb35"} .mce-i-zoomout:before{content:"\eb36"} .mce-i-sun:before{content:"\eccc"} .mce-i-moon:before{content:"\eccd"} .mce-i-arrowleft:before{content:"\edc0"} .mce-i-arrowright:before{content:"\edb8"} .mce-i-drop:before{content:"\e934"} .mce-i-contrast:before{content:"\ecd4"} .mce-i-sharpen:before{content:"\eba7"} .mce-i-palette:before{content:"\e92a"} .mce-i-resize2:before{content:"\edf9"} .mce-i-orientation:before{content:"\e601"} .mce-i-invert:before{content:"\e602"} .mce-i-gamma:before{content:"\e600"} .mce-i-remove:before{content:"\ed6a"} .mce-i-checkbox:before,.mce-i-selected:before{content:"\e033"} .mce-i-selected{visibility:hidden} i.mce-i-backcolor{text-shadow:none;background:#bbb} + +/* mod */ +.mce-panel { background: #fff; border: 0; } +.mce-panel.mce-foot { border: 0 solid rgba(0,0,0,.2); } +.mce-panel.mce-menu { border: 1px solid #cbcbcb; } +.mce-toolbar .mce-btn { background: #fff; border: 0; } +.mce-toolbar .mce-btn i { color: #555; } +.mce-toolbar .mce-btn:hover i { color: #333; } +.mce-primary { background: #6ba72b; } +.mce-primary:hover { background: #68a029; } +.mce-btn-group:not(:first-child) { border-left: 3px solid #fff; } +.mce-menu-item:hover { background: #eee; } +.mce-menu-item.mce-disabled * { color: #ddd !important; } +.mce-edit-area { border: 0 solid #ddd; border-width: 1px !important; } diff --git a/admin/assets/js/tinymce/themes/index.html b/admin/assets/js/tinymce/themes/index.html new file mode 100755 index 0000000..e69de29 diff --git a/admin/assets/js/tinymce/themes/modern/index.html b/admin/assets/js/tinymce/themes/modern/index.html new file mode 100755 index 0000000..e69de29 diff --git a/admin/assets/js/tinymce/themes/modern/theme.min.js b/admin/assets/js/tinymce/themes/modern/theme.min.js new file mode 100755 index 0000000..202d39c --- /dev/null +++ b/admin/assets/js/tinymce/themes/modern/theme.min.js @@ -0,0 +1 @@ +tinymce.ThemeManager.add("modern",function(a){function b(b,c){var d,e=[];if(b)return n(b.split(/[ ,]/),function(b){function f(){function c(a){return function(c,d){for(var e,f=d.parents.length;f--&&(e=d.parents[f].nodeName,"OL"!=e&&"UL"!=e););b.active(c&&e==a)}}var d=a.selection;"bullist"==g&&d.selectorChanged("ul > li",c("UL")),"numlist"==g&&d.selectorChanged("ol > li",c("OL")),b.settings.stateSelector&&d.selectorChanged(b.settings.stateSelector,function(a){b.active(a)},!0),b.settings.disabledStateSelector&&d.selectorChanged(b.settings.disabledStateSelector,function(a){b.disabled(a)})}var g;"|"==b?d=null:m.has(b)?(b={type:b,size:c},e.push(b),d=null):(d||(d={type:"buttongroup",items:[]},e.push(d)),a.buttons[b]&&(g=b,b=a.buttons[g],"function"==typeof b&&(b=b()),b.type=b.type||"button",b.size=c,b=m.create(b),d.items.push(b),a.initialized?f():a.on("init",f)))}),{type:"toolbar",layout:"flow",items:e}}function c(a){function c(c){return c?(d.push(b(c,a)),!0):void 0}var d=[];if(tinymce.isArray(l.toolbar)){if(0===l.toolbar.length)return;tinymce.each(l.toolbar,function(a,b){l["toolbar"+(b+1)]=a}),delete l.toolbar}for(var e=1;10>e&&c(l["toolbar"+e]);e++);return d.length||l.toolbar===!1||c(l.toolbar||s),d.length?{type:"panel",layout:"stack",classes:"toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:d}:void 0}function d(){function b(b){var c;return"|"==b?{text:"|"}:c=a.menuItems[b]}function c(c){var d,e,f,g,h;if(h=tinymce.makeMap((l.removed_menuitems||"").split(/[ ,]/)),l.menu?(e=l.menu[c],g=!0):e=r[c],e){d={text:e.title},f=[],n((e.items||"").split(/[ ,]/),function(a){var c=b(a);c&&!h[a]&&f.push(b(a))}),g||n(a.menuItems,function(a){a.context==c&&("before"==a.separator&&f.push({text:"|"}),a.prependToContext?f.unshift(a):f.push(a),"after"==a.separator&&f.push({text:"|"}))});for(var i=0;i=0;d--)for(e=g.length-1;e>=0;e--)if(g[e].predicate(f[d]))return{toolbar:g[e],element:f[d]};return null}var l;a.on("click keyup",function(){window.setTimeout(function(){var b;a.removed||(b=k(a.selection.getNode()),b?i(b):j())},0)}),a.on("blur hide",j),a.on("ObjectResizeStart",function(){var b=k(a.selection.getNode());b&&b.toolbar.panel&&b.toolbar.panel.hide()}),a.on("nodeChange ResizeEditor ResizeWindow",g),a.on("remove",function(){tinymce.each(c(),function(a){a.panel&&a.panel.remove()}),a.contextToolbars={}})}function i(b){function f(){if(n&&n.moveRel&&n.visible()&&!n._fixed){var b=a.selection.getScrollContainer(),c=a.getBody(),d=0,e=0;if(b){var f=o.getPos(c),g=o.getPos(b);d=Math.max(0,g.x-f.x),e=Math.max(0,g.y-f.y)}n.fixed(!1).moveRel(c,a.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl","tr-br"]).moveBy(d,e)}}function g(){n&&(n.show(),f(),o.addClass(a.getBody(),"mce-edit-focus"))}function i(){n&&(n.hide(),q.hideAll(),o.removeClass(a.getBody(),"mce-edit-focus"))}function j(){return n?void(n.visible()||g()):(n=k.panel=m.create({type:p?"panel":"floatpanel",role:"application",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!!p,border:1,items:[l.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:d()},c(l.toolbar_items_size)]}),a.fire("BeforeRenderUI"),n.renderTo(p||document.body).reflow(),e(n),g(),h(),a.on("nodeChange",f),a.on("activate",g),a.on("deactivate",i),void a.nodeChanged())}var n,p;return l.fixed_toolbar_container&&(p=o.select(l.fixed_toolbar_container)[0]),l.content_editable=!0,a.on("focus",function(){b.skinUiCss?tinymce.DOM.styleSheetLoader.load(b.skinUiCss,j,j):j()}),a.on("blur hide",i),a.on("remove",function(){n&&(n.remove(),n=null)}),b.skinUiCss&&tinymce.DOM.styleSheetLoader.load(b.skinUiCss),{}}function j(b){var g,i,j;return b.skinUiCss&&tinymce.DOM.loadCSS(b.skinUiCss),g=k.panel=m.create({type:"panel",role:"application",classes:"tinymce",style:"visibility: hidden",layout:"stack",border:1,items:[l.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:d()},c(l.toolbar_items_size),{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",html:"",border:"1 0 0 0"}]}),l.resize!==!1&&(i={type:"resizehandle",direction:l.resize,onResizeStart:function(){var b=a.getContentAreaContainer().firstChild;j={width:b.clientWidth,height:b.clientHeight}},onResize:function(a){"both"==l.resize?f(j.width+a.deltaX,j.height+a.deltaY):f(null,j.height+a.deltaY)}}),l.statusbar!==!1&&g.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",ariaRoot:!0,items:[{type:"elementpath"},i]}),l.readonly&&g.find("*").disabled(!0),a.fire("BeforeRenderUI"),g.renderBefore(b.targetNode).reflow(),l.width&&tinymce.DOM.setStyle(g.getEl(),"width",l.width),a.on("remove",function(){g.remove(),g=null}),e(g),h(),{iframeContainer:g.find("#iframe")[0].getEl(),editorContainer:g.getEl()}}var k=this,l=a.settings,m=tinymce.ui.Factory,n=tinymce.each,o=tinymce.DOM,p=tinymce.ui.Rect,q=tinymce.ui.FloatPanel,r={file:{title:"File",items:"newdocument"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall"},insert:{title:"Insert",items:"|"},view:{title:"View",items:"visualaid |"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript | formats | removeformat"},table:{title:"Table"},tools:{title:"Tools"}},s="undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image";k.renderUI=function(b){var c=l.skin!==!1?l.skin||"lightgray":!1;if(c){var d=l.skin_url;d=d?a.documentBaseURI.toAbsolute(d):tinymce.baseURL+"/skins/"+c,tinymce.Env.documentMode<=7?b.skinUiCss=d+"/skin.ie7.min.css":b.skinUiCss=d+"/skin.min.css",a.contentCSS.push(d+"/content"+(a.inline?".inline":"")+".min.css")}return a.on("ProgressState",function(a){k.throbber=k.throbber||new tinymce.ui.Throbber(k.panel.getEl("body")),a.state?k.throbber.show(a.time):k.throbber.hide()}),l.inline?i(b):j(b)},k.resizeTo=f,k.resizeBy=g}); \ No newline at end of file diff --git a/admin/assets/js/tinymce/tinymce.min.js b/admin/assets/js/tinymce/tinymce.min.js new file mode 100755 index 0000000..c36b27f --- /dev/null +++ b/admin/assets/js/tinymce/tinymce.min.js @@ -0,0 +1,12 @@ +// 4.2.7 (2015-10-27) +!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;ir;r++)if(o=n[r],o&&o.func.call(o.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var a=this,s={},l,c,u,d,f;c=o+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},l=1,a.domLoaded=!1,a.events=s,a.bind=function(t,o,h,p){function m(e){i(n(e||_.event),g)}var g,v,y,b,x,C,w,_=window;if(t&&3!==t.nodeType&&8!==t.nodeType){for(t[c]?g=t[c]:(g=l++,t[c]=g,s[g]={}),p=p||t,o=o.split(" "),y=o.length;y--;)b=o[y],C=m,x=w=!1,"DOMContentLoaded"===b&&(b="ready"),a.domLoaded&&"ready"===b&&"complete"==t.readyState?h.call(p,n({type:b})):(d||(x=f[b],x&&(C=function(e){var t,r;if(t=e.currentTarget,r=e.relatedTarget,r&&t.contains)r=t.contains(r);else for(;r&&r!==t;)r=r.parentNode;r||(e=n(e||_.event),e.type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,i(e,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,x="focusin"===b?"focus":"blur",C=function(e){e=n(e||_.event),e.type="focus"===e.type?"focusin":"focusout",i(e,g)}),v=s[g][b],v?"ready"===b&&a.domLoaded?h({type:b}):v.push({func:h,scope:p}):(s[g][b]=v=[{func:h,scope:p}],v.fakeName=x,v.capture=w,v.nativeHandler=C,"ready"===b?r(t,C,a):e(t,x||b,C,w)));return t=v=0,h}},a.unbind=function(e,n,r){var i,o,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return a;if(i=e[c]){if(f=s[i],n){for(n=n.split(" "),l=n.length;l--;)if(d=n[l],o=f[d]){if(r)for(u=o.length;u--;)if(o[u].func===r){var h=o.nativeHandler,p=o.fakeName,m=o.capture;o=o.slice(0,u).concat(o.slice(u+1)),o.nativeHandler=h,o.fakeName=p,o.capture=m,f[d]=o}r&&0!==o.length||(delete f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture))}}else{for(d in f)o=f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture);f={}}for(d in f)return a;delete s[i];try{delete e[c]}catch(g){e[c]=null}}return a},a.fire=function(e,t,r){var o;if(!e||3===e.nodeType||8===e.nodeType)return a;r=n(null,r),r.type=t,r.target=e;do o=e[c],o&&i(r,o),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow;while(e&&!r.isPropagationStopped());return a},a.clean=function(e){var t,n,r=a.unbind;if(!e||3===e.nodeType||8===e.nodeType)return a;if(e[c]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),n=e.getElementsByTagName("*"),t=n.length;t--;)e=n[t],e[c]&&r(e);return a},a.destroy=function(){s={}},a.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var o="mce-data-",a=/^(?:mouse|contextmenu)|click/,s={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1};return i.Event=new i,i.Event.bind(window,"ready",function(){}),i}),r(c,[],function(){function e(e,t,n,r){var i,o,a,s,l,c,d,h,p,m;if((t?t.ownerDocument||t:z)!==D&&B(t),t=t||D,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(M&&!r){if(i=ve.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&I(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&C.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(a)),n}if(C.qsa&&(!H||!H.test(e))){if(h=d=F,p=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=N(e),(d=t.getAttribute("id"))?h=d.replace(be,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=c.length;l--;)c[l]=h+f(c[l]);p=ye.test(e)&&u(t.parentNode)||t,m=c.join(",")}if(m)try{return Z.apply(n,p.querySelectorAll(m)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return k(e.replace(se,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>w.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[F]=!0,e}function i(e){var t=D.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)w.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||Y)-(~e.sourceIndex||Y);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e){return e&&typeof e.getElementsByTagName!==K&&e}function d(){}function f(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=V++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c=[W,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[F]||(t[F]={}),(s=l[r])&&s[0]===W&&s[1]===o)return c[2]=s[2];if(l[r]=c,c[2]=e(t,n,a))return!0}}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(t,n,r){for(var i=0,o=n.length;o>i;i++)e(t,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),c&&t.push(s));return a}function v(e,t,n,i,o,a){return i&&!i[F]&&(i=v(i)),o&&!o[F]&&(o=v(o,a)),r(function(r,a,s,l){var c,u,d,f=[],h=[],p=a.length,v=r||m(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,f,e,s,l),b=n?o||(r?e:p||i)?[]:a:y;if(n&&n(y,b,s,l),i)for(c=g(b,h),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[h[u]]=!(y[h[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(y[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?te.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else b=g(b===a?b.splice(p,b.length):b),o?o(null,a,b,l):Z.apply(a,b)})}function y(e){for(var t,n,r,i=e.length,o=w.relative[e[0].type],a=o||w.relative[" "],s=o?1:0,l=h(function(e){return e===t},a,!0),c=h(function(e){return te.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==T)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=w.relative[e[s].type])u=[h(p(u),n)];else{if(n=w.filter[e[s].type].apply(null,e[s].matches),n[F]){for(r=++s;i>r&&!w.relative[e[r].type];r++);return v(s>1&&p(u),s>1&&f(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&f(e))}u.push(n)}return p(u)}function b(t,n){var i=n.length>0,o=t.length>0,a=function(r,a,s,l,c){var u,d,f,h=0,p="0",m=r&&[],v=[],y=T,b=r||o&&w.find.TAG("*",c),x=W+=null==y?1:Math.random()||.1,C=b.length;for(c&&(T=a!==D&&a);p!==C&&null!=(u=b[p]);p++){if(o&&u){for(d=0;f=t[d++];)if(f(u,a,s)){l.push(u);break}c&&(W=x)}i&&((u=!f&&u)&&h--,r&&m.push(u))}if(h+=p,i&&p!==h){for(d=0;f=n[d++];)f(m,v,a,s);if(r){if(h>0)for(;p--;)m[p]||v[p]||(v[p]=J.call(l));v=g(v)}Z.apply(l,v),c&&!r&&v.length>0&&h+n.length>1&&e.uniqueSort(l)}return c&&(W=x,T=y),m};return i?r(a):a}var x,C,w,_,E,N,S,k,T,R,A,B,D,L,M,H,P,O,I,F="sizzle"+-new Date,z=window.document,W=0,V=0,U=n(),$=n(),q=n(),j=function(e,t){return e===t&&(A=!0),0},K=typeof t,Y=1<<31,G={}.hasOwnProperty,X=[],J=X.pop,Q=X.push,Z=X.push,ee=X.slice,te=X.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},ne="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",re="[\\x20\\t\\r\\n\\f]",ie="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",oe="\\["+re+"*("+ie+")(?:"+re+"*([*^$|!~]?=)"+re+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+re+"*\\]",ae=":("+ie+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",se=new RegExp("^"+re+"+|((?:^|[^\\\\])(?:\\\\.)*)"+re+"+$","g"),le=new RegExp("^"+re+"*,"+re+"*"),ce=new RegExp("^"+re+"*([>+~]|"+re+")"+re+"*"),ue=new RegExp("="+re+"*([^\\]'\"]*?)"+re+"*\\]","g"),de=new RegExp(ae),fe=new RegExp("^"+ie+"$"),he={ID:new RegExp("^#("+ie+")"),CLASS:new RegExp("^\\.("+ie+")"),TAG:new RegExp("^("+ie+"|[*])"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+re+"*(even|odd|(([+-]|)(\\d*)n|)"+re+"*(?:([+-]|)"+re+"*(\\d+)|))"+re+"*\\)|)","i"),bool:new RegExp("^(?:"+ne+")$","i"),needsContext:new RegExp("^"+re+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+re+"*((?:-\\d)?\\d*)"+re+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,ge=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,be=/'|\\/g,xe=new RegExp("\\\\([\\da-f]{1,6}"+re+"?|("+re+")|.)","ig"),Ce=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Z.apply(X=ee.call(z.childNodes),z.childNodes),X[z.childNodes.length].nodeType}catch(we){Z={apply:X.length?function(e,t){Q.apply(e,ee.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}C=e.support={},E=e.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},B=e.setDocument=function(e){var t,n=e?e.ownerDocument||e:z,r=n.defaultView;return n!==D&&9===n.nodeType&&n.documentElement?(D=n,L=n.documentElement,M=!E(n),r&&r!==r.top&&(r.addEventListener?r.addEventListener("unload",function(){B()},!1):r.attachEvent&&r.attachEvent("onunload",function(){B()})),C.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),C.getElementsByTagName=i(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),C.getElementsByClassName=ge.test(n.getElementsByClassName),C.getById=i(function(e){return L.appendChild(e).id=F,!n.getElementsByName||!n.getElementsByName(F).length}),C.getById?(w.find.ID=function(e,t){if(typeof t.getElementById!==K&&M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},w.filter.ID=function(e){var t=e.replace(xe,Ce);return function(e){return e.getAttribute("id")===t}}):(delete w.find.ID,w.filter.ID=function(e){var t=e.replace(xe,Ce);return function(e){var n=typeof e.getAttributeNode!==K&&e.getAttributeNode("id");return n&&n.value===t}}),w.find.TAG=C.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==K?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},w.find.CLASS=C.getElementsByClassName&&function(e,t){return M?t.getElementsByClassName(e):void 0},P=[],H=[],(C.qsa=ge.test(n.querySelectorAll))&&(i(function(e){e.innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&H.push("[*^$]="+re+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||H.push("\\["+re+"*(?:value|"+ne+")"),e.querySelectorAll(":checked").length||H.push(":checked")}),i(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&H.push("name"+re+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||H.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),H.push(",.*:")})),(C.matchesSelector=ge.test(O=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){C.disconnectedMatch=O.call(e,"div"),O.call(e,"[s!='']:x"),P.push("!=",ae)}),H=H.length&&new RegExp(H.join("|")),P=P.length&&new RegExp(P.join("|")),t=ge.test(L.compareDocumentPosition),I=t||ge.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return A=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r?r:(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&r||!C.sortDetached&&t.compareDocumentPosition(e)===r?e===n||e.ownerDocument===z&&I(z,e)?-1:t===n||t.ownerDocument===z&&I(z,t)?1:R?te.call(R,e)-te.call(R,t):0:4&r?-1:1)}:function(e,t){if(e===t)return A=!0,0;var r,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(!o||!s)return e===n?-1:t===n?1:o?-1:s?1:R?te.call(R,e)-te.call(R,t):0;if(o===s)return a(e,t);for(r=e;r=r.parentNode;)l.unshift(r);for(r=t;r=r.parentNode;)c.unshift(r);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===z?-1:c[i]===z?1:0},n):D},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==D&&B(t),n=n.replace(ue,"='$1']"),C.matchesSelector&&M&&(!P||!P.test(n))&&(!H||!H.test(n)))try{var r=O.call(t,n);if(r||C.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return e(n,D,null,[t]).length>0},e.contains=function(e,t){return(e.ownerDocument||e)!==D&&B(e),I(e,t)},e.attr=function(e,n){(e.ownerDocument||e)!==D&&B(e);var r=w.attrHandle[n.toLowerCase()],i=r&&G.call(w.attrHandle,n.toLowerCase())?r(e,n,!M):t;return i!==t?i:C.attributes||!M?e.getAttribute(n):(i=e.getAttributeNode(n))&&i.specified?i.value:null},e.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},e.uniqueSort=function(e){var t,n=[],r=0,i=0;if(A=!C.detectDuplicates,R=!C.sortStable&&e.slice(0),e.sort(j),A){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return R=null,e},_=e.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=_(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=_(t);return n},w=e.selectors={cacheLength:50,createPseudo:r,match:he,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xe,Ce),e[3]=(e[3]||e[4]||e[5]||"").replace(xe,Ce),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=N(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(xe,Ce).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=U[e+" "];return t||(t=new RegExp("(^|"+re+")"+e+"("+re+"|$)"))&&U(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==K&&e.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,h,p,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(u=g[F]||(g[F]={}),c=u[e]||[],h=c[0]===W&&c[1],f=c[0]===W&&c[2],d=h&&g.childNodes[h];d=++h&&d&&d[m]||(f=h=0)||p.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[W,h,f];break}}else if(y&&(c=(t[F]||(t[F]={}))[e])&&c[0]===W)f=c[1];else for(;(d=++h&&d&&d[m]||(f=h=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[F]||(d[F]={}))[e]=[W,f]),d!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(t,n){var i,o=w.pseudos[t]||w.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[F]?o(n):o.length>1?(i=[t,t,"",n],w.setFilters.hasOwnProperty(t.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=te.call(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=S(e.replace(se,"$1"));return i[F]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(e){return e=e.replace(xe,Ce),function(t){return(t.textContent||t.innerText||_(t)).indexOf(e)>-1}}),lang:r(function(t){return fe.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(xe,Ce).toLowerCase(),function(e){var n;do if(n=M?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===L},focus:function(e){return e===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return me.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r2&&"ID"===(a=o[0]).type&&C.getById&&9===t.nodeType&&M&&w.relative[o[1].type]){if(t=(w.find.ID(a.matches[0].replace(xe,Ce),t)||[])[0],!t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=he.needsContext.test(e)?0:o.length;i--&&(a=o[i],!w.relative[s=a.type]);)if((l=w.find[s])&&(r=l(a.matches[0].replace(xe,Ce),ye.test(o[0].type)&&u(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&f(o),!e)return Z.apply(n,r),n;break}}return(c||S(e,d))(r,t,!M,n,ye.test(e)&&u(t.parentNode)||t),n},C.sortStable=F.split("").sort(j).join("")===F,C.detectDuplicates=!!A,B(),C.sortDetached=i(function(e){return 1&e.compareDocumentPosition(D.createElement("div"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),C.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(ne,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),e}),r(u,[],function(){var e=navigator,t=e.userAgent,n,r,i,o,a,s,l,c,u,d;n=window.opera&&window.opera.buildNumber,u=/Android/.test(t),r=/WebKit/.test(t),i=!r&&!n&&/MSIE/gi.test(t)&&/Explorer/gi.test(e.appName),i=i&&/MSIE (\w+)\./.exec(t)[1],o=-1==t.indexOf("Trident/")||-1==t.indexOf("rv:")&&-1==e.appName.indexOf("Netscape")?!1:11,a=-1==t.indexOf("Edge/")||i||o?!1:12,i=i||o||a,s=!r&&!o&&/Gecko/.test(t),l=-1!=t.indexOf("Mac"),c=/(iPad|iPhone)/.test(t),d="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,a&&(r=!1);var f=!c||d||t.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:n,webkit:r,ie:i,gecko:s,mac:l,iOS:c,android:u,contentEditable:f,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=i,range:window.getSelection&&"Range"in window,documentMode:i&&!a?document.documentMode||7:10,fileApi:d}}),r(d,[],function(){function e(e){var t=e,n,r;if(!s(e))for(t=[],n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function n(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function r(e,t){var r=[];return n(e,function(n,i){r.push(t(n,i,e))}),r}function i(e,t){var r=[];return n(e,function(e){(!t||t(e))&&r.push(e)}),r}function o(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function a(e,t,n,r){var i=0;for(arguments.length<3&&(n=e[0],i=1);ir;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function l(e,t,r,i){i=i||this,e&&(r&&(e=e[r]),n.each(e,function(e,n){return t.call(i,e,n,r)===!1?!1:void l(e,t,r,i)}))}function c(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;nn&&(t=t[e[n]],t);n++);return t}function d(e,t){return!e||i(e,"array")?e:n.map(e.split(t||","),r)}function f(t){var n=e.cacheSuffix;return n&&(t+=(-1===t.indexOf("?")?"?":"&")+n),t}var h=/^\s*|\s*$/g;return{trim:r,isArray:n.isArray,is:i,toArray:n.toArray,makeMap:o,each:n.each,map:n.map,grep:n.filter,inArray:n.indexOf,extend:s,create:a,walk:l,createNS:c,resolve:u,explode:d,_addCacheSuffix:f}}),r(h,[l,c,f,u],function(e,n,r,i){function o(e){return"undefined"!=typeof e}function a(e){return"string"==typeof e}function s(e){return e&&e==e.window}function l(e,t){var n,r,i;for(t=t||w,i=t.createElement("div"),n=t.createDocumentFragment(),i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return n}function c(e,t,n,r){var i;if(a(t))t=l(t,v(e[0]));else if(t.length&&!t.nodeType){if(t=f.makeArray(t),r)for(i=t.length-1;i>=0;i--)c(e,t[i],n,r);else for(i=0;ii&&(a=e[i],t.call(a,i,a)!==!1);i++);return e}function g(e,t){var n=[];return m(e,function(e,r){t(r,e)&&n.push(r)}),n}function v(e){return e?9==e.nodeType?e:e.ownerDocument:w}function y(e,n,r){var i=[],o=e[n];for("string"!=typeof r&&r instanceof f&&(r=r[0]);o&&9!==o.nodeType;){if(r!==t){if(o===r)break;if("string"==typeof r&&f(o).is(r))break}1===o.nodeType&&i.push(o),o=o[n]}return i}function b(e,n,r,i){var o=[];for(i instanceof f&&(i=i[0]);e;e=e[n])if(!r||e.nodeType===r){if(i!==t){if(e===i)break;if("string"==typeof i&&f(e).is(i))break}o.push(e)}return o}function x(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType==n)return e;return null}function C(e,t,n){m(n,function(n,r){e[n]=e[n]||{},e[n][t]=r})}var w=document,_=Array.prototype.push,E=Array.prototype.slice,N=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,S=e.Event,k,T=r.makeMap("children,contents,next,prev"),R=r.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),A=r.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),B={ +"for":"htmlFor","class":"className",readonly:"readOnly"},D={"float":"cssFloat"},L={},M={},H=/^\s*|\s*$/g;return f.fn=f.prototype={constructor:f,selector:"",context:null,length:0,init:function(e,t){var n=this,r,i;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(t&&t.nodeType)n.context=t;else{if(t)return f(e).attr(t);n.context=t=document}if(a(e)){if(n.selector=e,r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!r)return f(t).find(e);if(r[1])for(i=l(e,v(t)).firstChild;i;)_.call(n,i),i=i.nextSibling;else{if(i=v(t).getElementById(r[2]),!i)return n;if(i.id!==r[2])return n.find(e);n.length=1,n[0]=i}}else this.add(e,!1);return n},toArray:function(){return r.toArray(this)},add:function(e,t){var n=this,r,i;if(a(e))return n.add(f(e));if(t!==!1)for(r=f.unique(n.toArray().concat(f.makeArray(e))),n.length=r.length,i=0;it;t++)f.find(e,this[t],r);return f(r)},filter:function(e){return f("function"==typeof e?g(this.toArray(),function(t,n){return e(n,t)}):f.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof f&&(e=e[0]),this.each(function(n,r){for(;r;){if("string"==typeof e&&f(r).is(e)){t.push(r);break}if(r==e){t.push(r);break}r=r.parentNode}}),f(t)},offset:function(e){var t,n,r,i=0,o=0,a;return e?this.css(e):(t=this[0],t&&(n=t.ownerDocument,r=n.documentElement,t.getBoundingClientRect&&(a=t.getBoundingClientRect(),i=a.left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,o=a.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:o})},push:_,sort:[].sort,splice:[].splice},r.extend(f,{extend:r.extend,makeArray:function(e){return s(e)||e.nodeType?[e]:r.toArray(e)},inArray:h,isArray:r.isArray,each:m,trim:p,grep:g,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,contains:n.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!=t[r].nodeType&&t.splice(r,1);return t=1===t.length?f.find.matchesSelector(t[0],e)?[t[0]]:[]:f.find.matches(e,t)}}),m({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return y(e,"parentNode")},next:function(e){return x(e,"nextSibling",1)},prev:function(e){return x(e,"previousSibling",1)},children:function(e){return b(e.firstChild,"nextSibling",1)},contents:function(e){return r.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){f.fn[e]=function(n){var r=this,i=[];return r.each(function(){var e=t.call(i,this,n,i);e&&(f.isArray(e)?i.push.apply(i,e):i.push(e))}),this.length>1&&(T[e]||(i=f.unique(i)),0===e.indexOf("parents")&&(i=i.reverse())),i=f(i),n?i.filter(n):i}}),m({parentsUntil:function(e,t){return y(e,"parentNode",t)},nextUntil:function(e,t){return b(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return b(e,"previousSibling",1,t).slice(1)}},function(e,t){f.fn[e]=function(n,r){var i=this,o=[];return i.each(function(){var e=t.call(o,this,n,o);e&&(f.isArray(e)?o.push.apply(o,e):o.push(e))}),this.length>1&&(o=f.unique(o),(0===e.indexOf("parents")||"prevUntil"===e)&&(o=o.reverse())),o=f(o),r?o.filter(r):o}}),f.fn.is=function(e){return!!e&&this.filter(e).length>0},f.fn.init.prototype=f.fn,f.overrideDefaults=function(e){function t(r,i){return n=n||e(),0===arguments.length&&(r=n.element),i||(i=n.context),new t.fn.init(r,i)}var n;return f.extend(t,this),t},i.ie&&i.ie<8&&(C(L,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?k:t},size:function(e){var t=e.size;return 20===t?k:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?k:t}}),C(L,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),i.ie&&i.ie<9&&(D["float"]="styleFloat",C(M,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),f.attrHooks=L,f.cssHooks=M,f}),r(p,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d,f,h="\ufeff";for(e=e||{},t&&(d=t.getValidStyles(),f=t.getInvalidStyles()),u=("\\\" \\' \\; \\: ; : "+h).split(" "),l=0;l-1&&n||(m[e+t]=-1==l?s[0]:s.join(" "),delete m[e+"-top"+t],delete m[e+"-right"+t],delete m[e+"-bottom"+t],delete m[e+"-left"+t])}}function u(e){var t=m[e],n;if(t){for(t=t.split(" "),n=t.length;n--;)if(t[n]!==t[0])return!1;return m[e]=t[0],!0}}function d(e,t,n,r){u(t)&&u(n)&&u(r)&&(m[e]=m[t]+" "+m[n]+" "+m[r],delete m[t],delete m[n],delete m[r])}function f(e){return b=!0,c[e]}function h(e,t){return b&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return c[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function p(t,n,r,i,o,a){if(o=o||a)return o=h(o),"'"+o.replace(/\'/g,"\\'")+"'";if(n=h(n||r||i),!e.allow_script_urls){var s=n.replace(/[\s\r\n]+/,"");if(/(java|vb)script:/i.test(s))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(s))return""}return x&&(n=x.call(C,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"}var m={},g,v,y,b,x=e.url_converter,C=e.url_converter_scope||this;if(t){for(t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,f)});g=o.exec(t);){if(v=g[1].replace(a,"").toLowerCase(),y=g[2].replace(a,""),y=y.replace(/\\[0-9a-f]+/g,function(e){return String.fromCharCode(parseInt(e.substr(1),16))}),v&&y.length>0){if(!e.allow_script_urls&&("behavior"==v||/expression\s*\(|\/\*|\*\//.test(y)))continue;"font-weight"===v&&"700"===y?y="bold":("color"===v||"background-color"===v)&&(y=y.toLowerCase()),y=y.replace(r,n),y=y.replace(i,p),m[v]=b?h(y,!0):y}o.lastIndex=g.index+g[0].length}s("border","",!0),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border,"none"===m["border-image"]&&delete m["border-image"]}return m},serialize:function(e,t){function n(t){var n,r,o,a;if(n=d[t])for(r=0,o=n.length;o>r;r++)t=n[r],a=e[t],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+t+": "+a+";")}function r(e,t){var n;return n=f["*"],n&&n[e]?!1:(n=f[t],n&&n[e]?!1:!0)}var i="",o,a;if(t&&d)n("*"),n(t);else for(o in e)a=e[o],a!==s&&a.length>0&&(!f||r(o,t))&&(i+=(i.length>0?" ":"")+o+": "+a+";");return i}}}}),r(m,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}var r=e;this.current=function(){return r},this.next=function(e){return r=n(r,"firstChild","nextSibling",e)},this.prev=function(e){return r=n(r,"lastChild","previousSibling",e)}}}),r(g,[f],function(e){function t(n){function r(){return H.createDocumentFragment()}function i(e,t){_(F,e,t)}function o(e,t){_(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function u(e){e?(M[U]=M[V],M[$]=M[W]):(M[V]=M[U],M[W]=M[$]),M.collapsed=F}function d(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function h(e,t){var n=M[V],r=M[W],i=M[U],o=M[$],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function p(){E(I)}function m(){return E(P)}function g(){return E(O)}function v(e){var t=this[V],r=this[W],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=M.extractContents();M.insertNode(e),e.appendChild(t),M.selectNode(e)}function b(){return q(new t(n),{startContainer:M[V],startOffset:M[W],endContainer:M[U],endOffset:M[$],collapsed:M.collapsed,commonAncestorContainer:M.commonAncestorContainer})}function x(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function C(){return M[V]==M[U]&&M[W]==M[$]}function w(e,t,r,i){var o,a,s,l,c,u;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=r;u&&u.parentNode!=l;)u=u.parentNode;if(u||(u=l),c==u)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==u)return 1;s=s.nextSibling}}function _(e,t,r){var i,o;for(e?(M[V]=t,M[W]=r):(M[U]=t,M[$]=r),i=M[U];i.parentNode;)i=i.parentNode;for(o=M[V];o.parentNode;)o=o.parentNode;o==i?w(M[V],M[W],M[U],M[$])>0&&M.collapse(e):M.collapse(e),M.collapsed=C(),M.commonAncestorContainer=n.findCommonAncestor(M[V],M[U])}function E(e){var t,n=0,r=0,i,o,a,s,l,c;if(M[V]==M[U])return N(e);for(t=M[U],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[V])return S(t,e);++n}for(t=M[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[U])return k(t,e);++r}for(o=r-n,a=M[V];o>0;)a=a.parentNode,o--;for(s=M[U];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function N(e){var t,n,i,o,a,s,l,c,u;if(e!=I&&(t=r()),M[W]==M[$])return t;if(3==M[V].nodeType){if(n=M[V].nodeValue,i=n.substring(M[W],M[$]),e!=O&&(o=M[V],c=M[W],u=M[$]-M[W],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),M.collapse(F)),e==I)return;return i.length>0&&t.appendChild(H.createTextNode(i)),t}for(o=x(M[V],M[W]),a=M[$]-M[W];o&&a>0;)s=o.nextSibling,l=D(o,e),t&&t.appendChild(l),--a,o=s;return e!=O&&M.collapse(F),t}function S(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-M[W],0>=a)return t!=O&&(M.setEndBefore(e),M.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=D(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=O&&(M.setEndBefore(e),M.collapse(z)),n}function k(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=M[$]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=D(o,t),n&&n.appendChild(l),--a,o=s;return t!=O&&(M.setStartAfter(e),M.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,u;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=j(e),s=j(t),++a,l=s-a,c=e.nextSibling;l>0;)u=c.nextSibling,i=D(c,n),o&&o.appendChild(i),c=u,--l;return i=R(t,n),o&&o.appendChild(i),n!=O&&(M.setStartAfter(e),M.collapse(F)),o}function R(e,t){var n=x(M[U],M[$]-1),r,i,o,a,s,l=n!=M[U];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=x(M[V],M[W]),r=n!=M[V],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return D(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=M[W],a=o.substring(l),s=o.substring(0,l)):(l=M[$],a=o.substring(0,l),s=o.substring(l)),i!=O&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function D(e,t){return t!=I?t==O?n.clone(e,F):e:void e.parentNode.removeChild(e)}function L(){return n.create("body",null,g()).outerText}var M=this,H=n.doc,P=0,O=1,I=2,F=!0,z=!1,W="startOffset",V="startContainer",U="endContainer",$="endOffset",q=e.extend,j=n.nodeIndex;return q(M,{startContainer:H,startOffset:0,endContainer:H,endOffset:0,collapsed:F,commonAncestorContainer:H,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:u,selectNode:d,selectNodeContents:f,compareBoundaryPoints:h,deleteContents:p,extractContents:m,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:L}),M}return t.prototype.toString=function(){return this.toStringIE()},t}),r(v,[f],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,d={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(u,function(e,n){return n?(n="x"===n.charAt(0).toLowerCase()?parseInt(n.substr(1),16):parseInt(n,10),n>65535?(n-=65536,String.fromCharCode(55296+(n>>10),56320+(1023&n))):d[n]||String.fromCharCode(n)):a[e]||i[e]||t(e)})}};return f}),r(y,[f],function(e){return function(t,n){function r(e){t.getElementsByTagName("head")[0].appendChild(e)}function i(n,i,l){function c(){for(var e=y.passed,t=e.length;t--;)e[t]();y.status=2,y.passed=[],y.failed=[]}function u(){for(var e=y.failed,t=e.length;t--;)e[t]();y.status=3,y.passed=[],y.failed=[]}function d(){var e=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(e&&e[1]<536)}function f(e,t){e()||((new Date).getTime()-v0)return g=t.createElement("style"),g.textContent='@import "'+n+'"',p(),void r(g);h()}r(m),m.href=n}}var o=0,a={},s;n=n||{},s=n.maxLoadTime||5e3,this.load=i}}),r(b,[c,h,p,l,m,g,v,u,f,y],function(e,n,r,i,o,a,s,l,c,u){function d(e,t){var n={},r=t.keep_values,i;return i={set:function(n,r,i){t.url_converter&&(r=t.url_converter.call(t.url_converter_scope||e,r,i,n[0])),n.attr("data-mce-"+i,r).attr(i,r)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},n={style:{set:function(e,t){return null!==t&&"object"==typeof t?void e.css(t):(r&&e.attr("data-mce-style",t),void e.attr("style",t))},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return n=e.serializeStyle(e.parseStyle(n),t[0].nodeName)}}},r&&(n.href=n.src=i),n}function f(e,t){var n=t.attr("style");n=e.serializeStyle(e.parseStyle(n),t[0].nodeName),n||(n=null),t.attr("data-mce-style",n)}function h(e,t){var n=0,r,i;if(e)for(r=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)i=e.nodeType,(!t||3!=i||i!=r&&e.nodeValue.length)&&(n++,r=i);return n}function p(e,t){var o=this,a;o.doc=e,o.win=window,o.files={},o.counter=0,o.stdMode=!b||e.documentMode>=8,o.boxModel=!b||"CSS1Compat"==e.compatMode||o.stdMode,o.styleSheetLoader=new u(e),o.boundEvents=[],o.settings=t=t||{},o.schema=t.schema,o.styles=new r({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),o.fixDoc(e),o.events=t.ownEvents?new i(t.proxy):i.Event,o.attrHooks=d(o,t),a=t.schema?t.schema.getBlockElements():{},o.$=n.overrideDefaults(function(){return{context:e,element:o.getRoot()}}),o.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!a[e.nodeName]):!!a[e]}}var m=c.each,g=c.is,v=c.grep,y=c.trim,b=l.ie,x=/^([a-z0-9],?)+$/i,C=/^[ \t\r\n]*$/;return p.prototype={$$:function(e){return"string"==typeof e&&(e=this.get(e)),this.$(e)},root:null,fixDoc:function(e){var t=this.settings,n;if(b&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!b||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.settings.root_element||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),g(n,"string")&&(a=n,n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.settings.root_element||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(x.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}if(n.nodeType&&1!=n.nodeType)return!1;var o=n.nodeType?[n]:n;return e(r,o[0].ownerDocument||o[0],null,o).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=g(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&"undefined"!=typeof t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return e=this.$$(e),t?e.each(function(){for(var e;e=this.firstChild;)3==e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():e.remove(),e.length>1?e.toArray():e[0]},setStyle:function(e,t,n){e=this.$$(e).css(t,n),this.settings.update_styles&&f(this,e)},getStyle:function(e,n,r){return e=this.$$(e),r?e.css(n):(n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=l.ie&&l.ie<12?"styleFloat":"cssFloat"),e[0]&&e[0].style?e[0].style[n]:t)},setStyles:function(e,t){e=this.$$(e).css(t),this.settings.update_styles&&f(this,e)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r=this,i,o,a=r.settings;""===n&&(n=null),e=r.$$(e),i=e.attr(t),e.length&&(o=r.attrHooks[t],o&&o.set?o.set(e,n,t):e.attr(t,n),i!=n&&a.onSetAttrib&&a.onSetAttrib({attrElm:e,attrName:t,attrValue:n}))},setAttribs:function(e,t){var n=this;n.$$(e).each(function(e,r){m(t,function(e,t){n.setAttrib(r,t,e)})})},getAttrib:function(e,t,n){var r=this,i,o;return e=r.$$(e),e.length&&(i=r.attrHooks[t],o=i&&i.get?i.get(e,t):e.attr(t)),"undefined"==typeof o&&(o=n||""),o},getPos:function(e,t){var r=this,i=0,o=0,a,s=r.doc,l=s.body,c;if(e=r.get(e),t=t||l,e){if(t===l&&e.getBoundingClientRect&&"static"===n(l).css("position"))return c=e.getBoundingClientRect(),t=r.boxModel?s.documentElement:l,i=c.left+(s.documentElement.scrollLeft||l.scrollLeft)-t.clientLeft,o=c.top+(s.documentElement.scrollTop||l.scrollTop)-t.clientTop,{x:i,y:o};for(a=e;a&&a!=t&&a.nodeType;)i+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=e.parentNode;a&&a!=t&&a.nodeType;)i-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode}return{x:i,y:o}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==p.DOM&&n===document){var o=p.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,p.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==p.DOM&&n===document?void p.DOM.loadCSS(e):(e||(e=""),r=n.getElementsByTagName("head")[0],void m(e.split(","),function(e){var i;e=c._addCacheSuffix(e),t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),b&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}))},addClass:function(e,t){this.$$(e).addClass(t)},removeClass:function(e,t){this.toggleClass(e,t,!1)},hasClass:function(e,t){return this.$$(e).hasClass(t)},toggleClass:function(e,t,r){this.$$(e).toggleClass(t,r).each(function(){""===this.className&&n(this).attr("class",null)})},show:function(e){this.$$(e).show()},hide:function(e){this.$$(e).hide()},isHidden:function(e){return"none"==this.$$(e).css("display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){e=this.$$(e),b?e.each(function(e,r){if(r.canHaveHTML!==!1){for(;r.firstChild;)r.removeChild(r.firstChild);try{r.innerHTML="
    "+t,r.removeChild(r.firstChild)}catch(i){n("
    ").html("
    "+t).contents().slice(1).appendTo(r)}return t}}):e.html(t)},getOuterHTML:function(e){return e=this.get(e),1==e.nodeType&&"outerHTML"in e?e.outerHTML:n("
    ").append(n(e).clone()).html()},setOuterHTML:function(e,t){var r=this;r.$$(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}r.remove(n(this).html(t),!0)})},decode:s.decode,encode:s.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return g(t,"array")&&(e=e.cloneNode(!0)),n&&m(v(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(c.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],m(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(b){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi; +return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,i,a,s,l,c=0;if(e=e.firstChild){s=new o(e,e.parentNode),t=t||(n.schema?n.schema.getNonEmptyElements():null);do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(i=n.getAttribs(e),r=i.length;r--;)if(l=i[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!C.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new a(this)},nodeIndex:h,split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=y(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.replaceChild(n,t):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(c.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(c.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return e&&1==e.nodeType?(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null):null},getContentEditableParent:function(e){for(var t=this.getRoot(),n=null;e&&e!==t&&(n=this.getContentEditable(e),null===n);e=e.parentNode);return n},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},p.DOM=new p(document),p.nodeIndex=h,p}),r(x,[b,f],function(e,t){function n(){function e(e,n){function i(){a.remove(l),s&&(s.onreadystatechange=s.onload=s=null),n()}function o(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var a=r,s,l;l=a.uniqueId(),s=document.createElement("script"),s.id=l,s.type="text/javascript",s.src=t._addCacheSuffix(e),"onreadystatechange"in s?s.onreadystatechange=function(){/loaded|complete/.test(s.readyState)&&i()}:s.onload=i,s.onerror=o,(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}var n=0,a=1,s=2,l={},c=[],u={},d=[],f=0,h;this.isDone=function(e){return l[e]==s},this.markDone=function(e){l[e]=s},this.add=this.load=function(e,t,r){var i=l[e];i==h&&(c.push(e),l[e]=n),t&&(u[e]||(u[e]=[]),u[e].push({func:t,scope:r||this}))},this.loadQueue=function(e,t){this.loadScripts(c,e,t)},this.loadScripts=function(t,n,r){function c(e){i(u[e],function(e){e.func.call(e.scope)}),u[e]=h}var p;d.push({func:n,scope:r||this}),(p=function(){var n=o(t);t.length=0,i(n,function(t){return l[t]==s?void c(t):void(l[t]!=a&&(l[t]=a,f++,e(t,function(){l[t]=s,f--,c(t),p()})))}),f||(i(d,function(e){e.func.call(e.scope)}),d.length=0)})()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(C,[x,f],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t,n){var i=r.language;if(i&&r.languageLoad!==!1){if(n)if(n=","+n+",",-1!=n.indexOf(","+i.substr(0,2)+","))i=i.substr(0,2);else if(-1==n.indexOf(","+i+","))return;e.ScriptLoader.add(this.urls[t]+"/langs/"+i+".js")}},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&(s?a.call(s):a.call(e))}var c=this,u=o;c.urls[n]||("object"==typeof o&&(u=o.prefix+o.resource+o.suffix),0!==u.indexOf("/")&&-1==u.indexOf("://")&&(u=r.baseURL+"/"+u),c.urls[n]=u.substring(0,u.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(u,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(w,[f,m],function(e,t){function n(e,t){var n=e.childNodes;return t--,t>n.length-1?t=n.length-1:0>t&&(t=0),n[t]||e}function r(e){this.walk=function(t,r){function o(e){var t;return t=e[0],3===t.nodeType&&t===c&&u>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===f&&e.length>0&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e}function a(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function s(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function l(e,t,n){var i=n?"nextSibling":"previousSibling";for(g=e,v=g.parentNode;g&&g!=t;g=v)v=g.parentNode,y=a(g==e?g:g[i],i),y.length&&(n||y.reverse(),r(o(y)))}var c=t.startContainer,u=t.startOffset,d=t.endContainer,f=t.endOffset,h,p,m,g,v,y,b;if(b=e.select("td.mce-item-selected,th.mce-item-selected"),b.length>0)return void i(b,function(e){r([e])});if(1==c.nodeType&&c.hasChildNodes()&&(c=c.childNodes[u]),1==d.nodeType&&d.hasChildNodes()&&(d=n(d,f)),c==d)return r(o([c]));for(h=e.findCommonAncestor(c,d),g=c;g;g=g.parentNode){if(g===d)return l(c,h,!0);if(g===h)break}for(g=d;g;g=g.parentNode){if(g===c)return l(d,h);if(g===h)break}p=s(c,h)||c,m=s(d,h)||d,l(c,p,!0),y=a(p==c?p:p.nextSibling,"nextSibling",m==d?m.nextSibling:m),y.length&&r(o(y)),l(d,m)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&rr?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r0&&o0)return u=p,d=n?p.nodeValue.length:0,void(i=!0);if(e.isBlock(p)||m[p.nodeName.toLowerCase()])return;s=p}o&&s&&(u=s,i=!0,d=0)}var u,d,f,h=e.getRoot(),p,m,g,v;if(u=n[(r?"start":"end")+"Container"],d=n[(r?"start":"end")+"Offset"],v=1==u.nodeType&&d===u.childNodes.length,m=e.schema.getNonEmptyElements(),g=r,1==u.nodeType&&d>u.childNodes.length-1&&(g=!1),9===u.nodeType&&(u=e.getRoot(),d=0),u===h){if(g&&(p=u.childNodes[d>0?d-1:0],p&&(m[p.nodeName]||"TABLE"==p.nodeName)))return;if(u.hasChildNodes()&&(d=Math.min(!g&&d>0?d-1:d,u.childNodes.length-1),u=u.childNodes[d],d=0,u.hasChildNodes()&&!/TABLE/.test(u.nodeName))){p=u,f=new t(u,h);do{if(3===p.nodeType&&p.nodeValue.length>0){d=g?0:p.nodeValue.length,u=p,i=!0;break}if(m[p.nodeName.toLowerCase()]&&!a(p)){d=e.nodeIndex(p),u=p.parentNode,"IMG"!=p.nodeName||g||d++,i=!0;break}}while(p=g?f.next():f.prev())}}o&&(3===u.nodeType&&0===d&&c(!0),1===u.nodeType&&(p=u.childNodes[d],p||(p=u.childNodes[d-1]),!p||"BR"!==p.nodeName||l(p,"A")||s(p)||s(p,!0)||c(!0,p))),g&&!o&&3===u.nodeType&&d===u.nodeValue.length&&c(!1),i&&n["set"+(r?"Start":"End")](u,d)}var i,o;return o=n.collapsed,r(!0),o||r(),i&&o&&n.collapse(!0),i}}var i=e.each;return r.compareRanges=function(e,t){if(e&&t){if(!e.item&&!e.duplicate)return e.startContainer==t.startContainer&&e.startOffset==t.startOffset;if(e.item&&t.item&&e.item(0)===t.item(0))return!0;if(e.isEqual&&t.isEqual&&t.isEqual(e))return!0}return!1},r.getCaretRangeFromPoint=function(e,t,n){var r,i;if(n.caretPositionFromPoint)i=n.caretPositionFromPoint(e,t),r=n.createRange(),r.setStart(i.offsetNode,i.offset),r.collapse(!0);else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(n.body.createTextRange){r=n.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(o){r.collapse(t=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},r}),r(_,[w,u],function(e,t){return function(n){function r(e){var t,r;if(r=n.$(e).parentsUntil(n.getBody()).add(e),r.length===o.length){for(t=r.length;t>=0&&r[t]===o[t];t--);if(-1===t)return o=r,!0}return o=r,!1}var i,o=[];"onselectionchange"in n.getDoc()||n.on("NodeChange Click MouseUp KeyUp Focus",function(t){var r,o;r=n.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset},"nodechange"!=t.type&&e.compareRanges(o,i)||n.fire("SelectionChange"),i=o}),n.on("contextmenu",function(){n.fire("SelectionChange")}),n.on("SelectionChange",function(){var e=n.selection.getStart(!0);(t.range||!n.selection.isCollapsed())&&!r(e)&&n.dom.isChildOf(e,n.getBody())&&n.nodeChanged({selectionChange:!0})}),n.on("MouseUp",function(e){e.isDefaultPrevented()||("IMG"==n.selection.getNode().nodeName?setTimeout(function(){n.nodeChanged()},0):n.nodeChanged())}),this.nodeChanged=function(e){var t=n.selection,r,i,o;n.initialized&&t&&!n.settings.disable_nodechange&&!n.settings.readonly&&(o=n.getBody(),r=t.getStart()||o,r=r.ownerDocument!=n.getDoc()?n.getBody():r,"IMG"==r.nodeName&&t.isCollapsed()&&(r=r.parentNode),i=[],n.dom.getParent(r,function(e){return e===o?!0:void i.push(e)}),e=e||{},e.element=r,e.parents=i,n.fire("NodeChange",e))}}}),r(E,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(N,[f],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e,t){var n={},r,i;for(r=0,i=e.length;i>r;r++)n[e[r]]=t||{};return n}var s,c,u,d=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),c=3;co;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},l,c,u,d,f,h;return i[e]?i[e]:(l=t("id accesskey class dir lang style tabindex title"),c=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),u=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(l.push.apply(l,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),c.push.apply(c,t("article aside details dialog figure header footer hgroup section nav")),u.push.apply(u,t("audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(l.push("xml:lang"),h=t("acronym applet basefont big font strike tt"),u.push.apply(u,h),s(h,function(e){n(e,"",u)}),f=t("center dir isindex noframes"),c.push.apply(c,f),d=[].concat(c,u),s(f,function(e){n(e,"",d)})),d=d||[].concat(c,u),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",d),n("address dt dd div caption","",d),n("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",u),n("blockquote","cite",d),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",d),n("dl","","dt dd"),n("a","href target rel media hreflang type",u),n("q","cite",u),n("ins del","cite datetime",d),n("img","src sizes srcset alt usemap ismap width height"),n("iframe","src name width height",d),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",d,"param"),n("param","name value"),n("map","name",d,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",d),n("th","colspan rowspan headers scope abbr",d),n("form","accept-charset action autocomplete enctype method name novalidate target",d),n("fieldset","disabled form name",d,"legend"),n("label","form for",u),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?d:u),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",d,"li"),n("noscript","",d),"html4"!=e&&(n("wbr"),n("ruby","",u,"rt rp"),n("figcaption","",d),n("mark rt rp summary bdi","",u),n("canvas","width height",d),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",d,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",d,"track source"),n("picture","","img source"),n("source","src srcset type media sizes"),n("track","kind src srclang label default"),n("datalist","",u,"option"),n("article section nav aside header footer","",d),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",d,"figcaption"),n("time","datetime",u),n("dialog","open",d),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",u),n("progress","value max",u),n("meter","value min max low high optimum",u),n("details","open",d,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(r("script","language xml:space"),r("style","xml:space"),r("object","declare classid code codebase codetype archive standby align border hspace vspace"),r("embed","align name hspace vspace"),r("param","valuetype type"),r("a","charset name rev shape coords"),r("br","clear"),r("applet","codebase archive code object alt name width height align hspace vspace"),r("img","name longdesc align border hspace vspace"),r("iframe","longdesc frameborder marginwidth marginheight scrolling align"),r("font basefont","size color face"),r("input","usemap align"),r("select","onchange"),r("textarea"),r("h1 h2 h3 h4 h5 h6 div p legend caption","align"),r("ul","type compact"),r("li","type"),r("ol dl menu dir","compact"),r("pre","width xml:space"),r("hr","align noshade size width"),r("isindex","prompt"),r("table","summary width frame rules cellspacing cellpadding align bgcolor"),r("col","width align char charoff valign"),r("colgroup","width align char charoff valign"),r("thead","align char charoff valign"),r("tr","align char charoff valign bgcolor"),r("th","axis align char charoff valign nowrap bgcolor width height"),r("form","accept"),r("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),r("tfoot","align char charoff valign"),r("tbody","align char charoff valign"),r("area","nohref"),r("body","background bgcolor text link vlink alink")),"html4"!=e&&(r("input button select textarea","autofocus"),r("input textarea","placeholder"),r("a","download"),r("link script img","crossorigin"),r("iframe","sandbox seamless allowfullscreen")),s(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,delete a.script,i[e]=a,a)}function r(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),s(e,function(e,r){n[r]=n[r.toUpperCase()]="map"==t?a(e,/[, ]/):c(e,/[, ]/)})),n}var i={},o={},a=e.makeMap,s=e.each,l=e.extend,c=e.explode,u=e.inArray;return function(e){function o(t,n,r){var o=e[t];return o?o=a(o,/[, ]/,a(o.toUpperCase(),/[, ]/)):(o=i[t],o||(o=a(n," ",a(n.toUpperCase()," ")),o=l(o,r),i[t]=o)),o}function d(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function f(e){var n,r,i,o,s,l,c,f,h,p,m,g,v,b,C,w,_,E,N,S=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,k=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),y["@"]&&(w=y["@"].attributes,_=y["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=S.exec(e[n])){if(b=s[1],h=s[2],C=s[3],f=s[5],g={},v=[],l={attributes:g,attributesOrder:v},"#"===b&&(l.paddEmpty=!0),"-"===b&&(l.removeEmpty=!0),"!"===s[4]&&(l.removeEmptyAttrs=!0),w){for(E in w)g[E]=w[E];v.push.apply(v,_)}if(f)for(f=t(f,"|"),i=0,o=f.length;o>i;i++)if(s=k.exec(f[i])){if(c={},m=s[1],p=s[2].replace(/::/g,":"),b=s[3],N=s[4],"!"===m&&(l.attributesRequired=l.attributesRequired||[],l.attributesRequired.push(p),c.required=!0),"-"===m){delete g[p],v.splice(u(v,p),1);continue}b&&("="===b&&(l.attributesDefault=l.attributesDefault||[],l.attributesDefault.push({name:p,value:N}),c.defaultValue=N),":"===b&&(l.attributesForced=l.attributesForced||[],l.attributesForced.push({name:p,value:N}),c.forcedValue=N),"<"===b&&(c.validValues=a(N,"?"))),T.test(p)?(l.attributePatterns=l.attributePatterns||[],c.pattern=d(p),l.attributePatterns.push(c)):(g[p]||v.push(p),g[p]=c)}w||"@"!=h||(w=g,_=v),C&&(l.outputName=h,y[C]=l),T.test(h)?(l.pattern=d(h),x.push(l)):y[h]=l}}function h(e){y={},x=[],f(e),s(_,function(e,t){b[t]=e.children})}function p(e){var n=/^(~)?(.+)$/;e&&(i.text_block_elements=i.block_elements=null,s(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",o=t[2];if(b[o]=b[i],M[o]=i,r||(R[o.toUpperCase()]={},R[o]={}),!y[o]){var a=y[i];a=l({},a),delete a.removeEmptyAttrs,delete a.removeEmpty,y[o]=a}s(b,function(e,t){e[i]&&(b[t]=e=l({},b[t]),e[o]=e[i])})}))}function m(n){var r=/^([+\-]?)(\w+)\[([^\]]+)\]$/;i[e.schema]=null,n&&s(t(n,","),function(e){var n=r.exec(e),i,o;n&&(o=n[1],i=o?b[n[2]]:b[n[2]]={"#comment":{}},i=b[n[2]],s(t(n[3],"|"),function(e){"-"===o?delete i[e]:i[e]={}}))})}function g(e){var t=y[e],n;if(t)return t;for(n=x.length;n--;)if(t=x[n],t.pattern.test(e))return t}var v=this,y={},b={},x=[],C,w,_,E,N,S,k,T,R,A,B,D,L,M={},H={};e=e||{},_=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),C=r(e.valid_styles),w=r(e.invalid_styles,"map"),T=r(e.valid_classes,"map"),E=o("whitespace_elements","pre script noscript style textarea video audio iframe object"),N=o("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),S=o("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),k=o("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),A=o("non_empty_elements","td th iframe video audio object script",S),B=o("move_caret_before_on_enter_elements","table",A),D=o("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),R=o("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup",D),L=o("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),s((e.special||"script noscript style textarea").split(" "),function(e){H[e]=new RegExp("]*>","gi")}),e.valid_elements?h(e.valid_elements):(s(_,function(e,t){y[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},b[t]=e.children}),"html5"!=e.schema&&s(t("strong/b em/i"),function(e){e=t(e,"/"),y[e[1]].outputName=e[0]}),y.img.attributesDefault=[{name:"alt",value:""}],s(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){y[e]&&(y[e].removeEmpty=!0)}),s(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){y[e].paddEmpty=!0}),s(t("span"),function(e){y[e].removeEmptyAttrs=!0})),p(e.custom_elements),m(e.valid_children),f(e.extended_valid_elements),m("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&s(c(e.invalid_elements),function(e){y[e]&&delete y[e]}),g("span")||f("span[!data-mce-type|*]"),v.children=b,v.getValidStyles=function(){return C},v.getInvalidStyles=function(){return w},v.getValidClasses=function(){return T},v.getBoolAttrs=function(){return k},v.getBlockElements=function(){return R},v.getTextBlockElements=function(){return D},v.getTextInlineElements=function(){return L},v.getShortEndedElements=function(){return S},v.getSelfClosingElements=function(){return N},v.getNonEmptyElements=function(){return A},v.getMoveCaretBeforeOnEnterElements=function(){return B},v.getWhiteSpaceElements=function(){return E},v.getSpecialElements=function(){return H},v.isValidChild=function(e,t){var n=b[e];return!(!n||!n[t])},v.isValid=function(e,t){var n,r,i=g(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},v.getElementRule=g,v.getCustomElements=function(){return M},v.addValidElements=f,v.setValidElements=h,v.addCustomElements=p,v.addValidChildren=m,v.elements=y}}),r(S,[N,v,f],function(e,t,n){function r(e,t,n){var r=1,i,o,a,s;for(s=e.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g,a.lastIndex=i=n;o=a.exec(t);){if(i=a.lastIndex,"/"===o[1])r--;else if(!o[1]){if(o[2]in s)continue;r++}if(0===r)break}return i}function i(i,a){function s(){}var l=this;i=i||{},l.schema=a=a||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),o("comment cdata text start end pi doctype".split(" "),function(e){e&&(l[e]=i[e]||s)}),l.parse=function(e){function o(e){var t,n;for(t=h.length;t--&&h[t].name!==e;);if(t>=0){for(n=h.length-1;n>=t;n--)e=h[n],e.valid&&l.end(e.name);h.length=t}}function s(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in C?t:z(n||r||o||""),_&&!y&&0!==t.indexOf("data-")){if(a=T[t],!a&&R){for(s=R.length;s--&&(a=R[s],!a.pattern.test(t)););-1===s&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}if(V[t]&&!i.allow_script_urls){var c=n.replace(l,"");try{c=decodeURIComponent(c)}catch(u){c=unescape(c)}if(U.test(c))return;if(!i.allow_html_data_urls&&$.test(c)&&!/^data:image\//i.test(c))return}p.map[t]=n,p.push({name:t,value:n})}var l=this,c,u=0,d,f,h=[],p,m,g,v,y,b,x,C,w,_,E,N,S,k,T,R,A,B,D,L,M,H,P,O,I,F=0,z=t.decode,W,V=n.makeMap("src,href,data,background,formaction,poster"),U=/((java|vb)script|mhtml):/i,$=/^data:/i;for(H=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-_\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),P=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,x=a.getShortEndedElements(),M=i.self_closing_elements||a.getSelfClosingElements(),C=a.getBoolAttrs(),_=i.validate,b=i.remove_internals,W=i.fix_self_closing,O=a.getSpecialElements();c=H.exec(e);){if(u0&&h[h.length-1].name===d&&o(d),!_||(E=a.getElementRule(d))){if(N=!0,_&&(T=E.attributes,R=E.attributePatterns),(k=c[8])?(y=-1!==k.indexOf("data-mce-type"),y&&b&&(N=!1),p=[],p.map={},k.replace(P,s)):(p=[],p.map={}),_&&!y){if(A=E.attributesRequired,B=E.attributesDefault,D=E.attributesForced,L=E.removeEmptyAttrs,L&&!p.length&&(N=!1),D)for(m=D.length;m--;)S=D[m],v=S.name,I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I});if(B)for(m=B.length;m--;)S=B[m],v=S.name,v in p.map||(I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I}));if(A){for(m=A.length;m--&&!(A[m]in p.map););-1===m&&(N=!1)}if(S=p.map["data-mce-bogus"]){if("all"===S){u=r(a,e,H.lastIndex),H.lastIndex=u;continue}N=!1}}N&&l.start(d,p,w)}else N=!1;if(f=O[d]){f.lastIndex=u=c.index+c[0].length,(c=f.exec(e))?(N&&(g=e.substr(u,c.index-u)),u=c.index+c[0].length):(g=e.substr(u),u=e.length),N&&(g.length>0&&l.text(g,!0),l.end(d)),H.lastIndex=u;continue}w||(k&&k.indexOf("/")==k.length-1?N&&l.end(d):h.push({name:d,valid:N}))}else(d=c[1])?(">"===d.charAt(0)&&(d=" "+d),i.allow_conditional_comments||"[if"!==d.substr(0,3)||(d=" "+d),l.comment(d)):(d=c[2])?l.cdata(d):(d=c[3])?l.doctype(d):(d=c[4])&&l.pi(d,c[5]);u=c.index+c[0].length}for(u=0;m--)d=h[m],d.valid&&l.end(d.name)}}var o=n.each;return i.findEndTag=r,i}),r(k,[E,N,S,f],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,d,f,h,p,m,g,v,y,b;for(m=i("tr,td,th,tbody,thead,tfoot,table"),p=l.getNonEmptyElements(),g=l.getTextBlockElements(),v=l.getSpecialElements(),n=0;n1){for(a.reverse(),s=c=u.filterNode(a[0].clone()),h=0;h0)return void(t.value=r);if(n=t.next){if(3==n.type&&n.value.length){ +t=t.prev;continue}if(!o[n.name]&&"script"!=n.name&&"style"!=n.name){t=t.prev;continue}}i=t.prev,t.remove(),t=i}}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,x,C,w,_,E,N,S,k,T,R,A=[],B,D,L,M,H,P,O,I;if(o=o||{},h={},p={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),O=l.getNonEmptyElements(),P=l.children,k=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,H=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,D=/[ \t\r\n]+$/,L=/[ \t\r\n]+/g,M=/^[ \t\r\n]+$/,v=new n({validate:k,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(u("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(L," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=u("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(u("#comment",8)).value=e},pi:function(e,t){b.append(u(e,7)).value=t,m(b)},doctype:function(e){var t;t=b.append(u("#doctype",10)),t.value=e,m(b)},start:function(e,t,n){var r,i,o,a,s;if(o=k?l.getElementRule(e):{}){for(r=u(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=P[b.name],s&&P[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(N=p[a],N?N.push(r):p[a]=[r]);T[e]&&m(r),n||(b=r),!B&&H[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=k?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(D,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o}if(B&&H[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(O))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,T[b.name]?b.empty().remove():b.unwrap(),void(b=a);b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),k&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(S in h){for(N=d[S],x=h[S],_=x.length;_--;)x[_].parent||x.splice(_,1);for(C=0,w=N.length;w>C;C++)N[C](x,S,o)}for(C=0,w=f.length;w>C;C++)if(N=f[C],N.name in p){for(x=p[N.name],_=x.length;_--;)x[_].parent||x.splice(_,1);for(_=0,E=N.callbacks.length;E>_;_++)N.callbacks[_](x,N.name,o)}}return y},r.remove_trailing_brs&&u.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,u,d,f,h,p;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(d=i.prev;d;){if(f=d.name,"span"!==f||"bookmark"!==d.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}d=d.prev}i&&(i.remove(),c.isEmpty(a)&&(h=l.getElementRule(c.name),h&&(h.removeEmpty?c.remove():h.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(u=i;c&&c.firstChild===u&&c.lastChild===u&&(u=c,!o[c.name]);)c=c.parent;u===c&&(p=new e("#text",3),p.value="\xa0",i.replace(p))}}),r.allow_html_in_named_anchor||u.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}}),r.validate&&l.getValidClasses()&&u.addAttributeFilter("class",function(e){for(var t=e.length,n,r,i,o,a,s=l.getValidClasses(),c,u;t--;){for(n=e[t],r=n.attr("class").split(" "),a="",i=0;i0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,u=t.length;u>c;c++)d=t[c],r.push(" ",d.name,'="',s(d.value,!0),'"');!n||l?r[r.length]=">":r[r.length]=" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push(""),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("")},comment:function(e){r.push("")},pi:function(e,t){t?r.push(""):r.push(""),i&&r.push("\n")},doctype:function(e){r.push("",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(R,[T,N],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,u,d,f,h,p,m;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1&&(f=[],f.map={},m=r.getElementRule(e.name))){for(h=0,p=m.attributesOrder.length;p>h;h++)u=m.attributesOrder[h],u in c.map&&(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));for(h=0,p=c.length;p>h;h++)u=c[h].name,u in f.map||(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(A,[b,k,v,R,E,N,u,f],function(e,t,n,r,i,o,a,s){function l(e){function t(e){return e&&"br"===e.name}var n,r;n=e.lastChild,t(n)&&(r=n.prev,t(r)&&(n.remove(),r.remove()))}var c=s.each,u=s.trim,d=e.DOM;return function(e,i){var s,f,h;return i&&(s=i.dom,f=i.schema),s=s||d,f=f||new o(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,h=new t(e,f),h.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n=e.length,r;n--;)r=e[n],r.attr("tabindex",r.attributes.map["data-mce-tabindex"]),r.attr(t,null)}),h.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,l=e.url_converter,c=e.url_converter_scope,u;r--;)i=t[r],o=i.attributes.map[a],o!==u?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=s.serializeStyle(s.parseStyle(o),i.name):l&&(o=l.call(c,o,n,i.name)),i.attr(n,o.length>0?o:null))}),h.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class"),r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}),h.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),h.addNodeFilter("noscript",function(e){for(var t=e.length,r;t--;)r=e[t].firstChild,r&&(r.value=n.decode(r.value))}),h.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o,a;r--;)i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t?(a=i.attr("type"),a&&i.attr("type","mce-no/type"==a?null:a.replace(/^mce\-/,"")),o.length>0&&(i.firstChild.value="// ")):o.length>0&&(i.firstChild.value="")}),h.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),h.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&h.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,("ul"===r.name||"ol"===r.name)&&n.prev&&"li"===n.prev.name&&n.prev.append(n)}),h.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:f,addNodeFilter:h.addNodeFilter,addAttributeFilter:h.addAttributeFilter,serialize:function(t,n){var i=this,o,d,p,m,g,v;return a.ie&&s.select("script,style,select,map").length>0?(g=t.innerHTML,t=t.cloneNode(!1),s.setHTML(t,g)):t=t.cloneNode(!0),o=t.ownerDocument.implementation,o.createHTMLDocument&&(d=o.createHTMLDocument(""),c("BODY"==t.nodeName?t.childNodes:[t],function(e){d.body.appendChild(d.importNode(e,!0))}),t="BODY"!=t.nodeName?d.body.firstChild:d.body,p=s.doc,s.doc=d),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,i.onPreProcess(n)),v=h.parse(u(n.getInner?t.innerHTML:s.getOuterHTML(t)),n),l(v),m=new r(e,f),n.content=m.serialize(v),n.cleanup||(n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||i.onPostProcess(n),p&&(s.doc=p),n.node=null,n.content},addRules:function(e){f.addValidElements(e)},setRules:function(e){f.setValidElements(e)},onPreProcess:function(e){i&&i.fire("PreProcess",e)},onPostProcess:function(e){i&&i.fire("PostProcess",e)}}}}),r(B,[],function(){function e(e){function t(t,n){var r,i=0,o,a,s,l,c,u,d=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(u=Math.floor((i+o)/2),l=s[u],r.moveToElementText(l),d=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),d>0)o=u-1;else{if(!(0>d))return{node:l};i=u+1}if(0>d)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:d,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,u;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return void a[e?"setStart":"setEnd"](r,0);if(i===c)return void a[e?"setStartBefore":"setEndAfter"](r);if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return void a[e?"setStartAfter":"setEndAfter"](r);if(!i)return void(3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l));for(;l;){if(3==l.nodeType&&(u=l.nodeValue,s+=u.length,s>=i)){r=l,s-=i,s=u.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return void(3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l));for(;l;){if(3==l.nodeType&&(s+=l.nodeValue.length,s>=i)){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,u,d;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;d=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),u=c.parentElement(),u.innerHTML=u.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(d),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,d,p;a=i.create("a"),t=e?s:c,n=e?l:u,d=r.duplicate(),(t==f||t==f.documentElement)&&(t=h,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),d.moveToElementText(a),d.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",d)):(p=t.childNodes,p.length?(n>=p.length?i.insertAfter(a,p[p.length-1]):t.insertBefore(a,p[n]),d.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="",a=t.firstChild,d.moveToElementText(a),d.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",d),i.remove(a))}var r,a,s,l,c,u,d,f=e.dom.doc,h=f.body,p,m;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,r=h.createTextRange(),s==c&&1==s.nodeType){if(l==u&&!s.hasChildNodes()){if(s.canHaveHTML)return d=s.previousSibling,d&&!d.hasChildNodes()&&i.isBlock(d)?d.innerHTML="":d=null,s.innerHTML="",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",void(d&&(d.innerHTML=""));l=i.nodeIndex(s),s=s.parentNode}if(l==u-1)try{if(m=s.childNodes[l],a=h.createControlRange(),a.addElement(m),a.select(),p=e.getRng(),p.item&&m===p.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(D,[u],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(t){return e.mac?t.metaKey:t.ctrlKey&&!t.altKey}}}),r(L,[D,f,u],function(e,t,n){return function(r,i){function o(e){var t=i.settings.object_resizing;return t===!1||n.iOS?!1:("string"!=typeof t&&(t="table,img,div"),"false"===e.getAttribute("data-mce-resize")?!1:e==i.getBody()?!1:i.dom.is(e,t))}function a(t){var n,r,o,a,s;n=t.screenX-T,r=t.screenY-R,P=n*S[2]+D,O=r*S[3]+L,P=5>P?5:P,O=5>O?5:O,o="IMG"==w.nodeName&&i.settings.resize_img_proportional!==!1?!e.modifierPressed(t):e.modifierPressed(t)||"IMG"==w.nodeName&&S[2]*S[3]!==0,o&&(W(n)>W(r)?(O=V(P*M),P=V(O/M)):(P=V(O/M),O=V(P*M))),x.setStyles(_,{width:P,height:O}),a=S.startPos.x+n,s=S.startPos.y+r,a=a>0?a:0,s=s>0?s:0,x.setStyles(E,{left:a,top:s,display:"block"}),E.innerHTML=P+" × "+O,S[2]<0&&_.clientWidth<=P&&x.setStyle(_,"left",A+(D-P)),S[3]<0&&_.clientHeight<=O&&x.setStyle(_,"top",B+(L-O)),n=U.scrollWidth-$,r=U.scrollHeight-q,n+r!==0&&x.setStyles(E,{left:a-n,top:s-r}),H||(i.fire("ObjectResizeStart",{target:w,width:D,height:L}),H=!0)}function s(){function e(e,t){t&&(w.style[e]||!i.schema.isValid(w.nodeName.toLowerCase(),e)?x.setStyle(w,e,t):x.setAttrib(w,e,t))}H=!1,e("width",P),e("height",O),x.unbind(I,"mousemove",a),x.unbind(I,"mouseup",s),F!=I&&(x.unbind(F,"mousemove",a),x.unbind(F,"mouseup",s)),x.remove(_),x.remove(E),z&&"TABLE"!=w.nodeName||l(w),i.fire("ObjectResized",{target:w,width:P,height:O}),x.setAttrib(w,"style",x.getAttrib(w,"style")),i.nodeChanged()}function l(e,t,r){var l,u,d,f,h;g(),l=x.getPos(e,U),A=l.x,B=l.y,h=e.getBoundingClientRect(),u=h.width||h.right-h.left,d=h.height||h.bottom-h.top,w!=e&&(m(),w=e,P=O=0),f=i.fire("ObjectSelected",{target:e}),o(e)&&!f.isDefaultPrevented()?C(N,function(e,i){function o(t){T=t.screenX,R=t.screenY,D=w.clientWidth,L=w.clientHeight,M=L/D,S=e,e.startPos={x:u*e[0]+A,y:d*e[1]+B},$=U.scrollWidth,q=U.scrollHeight,_=w.cloneNode(!0),x.addClass(_,"mce-clonedresizable"),x.setAttrib(_,"data-mce-bogus","all"),_.contentEditable=!1,_.unSelectabe=!0,x.setStyles(_,{left:A,top:B,margin:0}),_.removeAttribute("data-mce-selected"),U.appendChild(_),x.bind(I,"mousemove",a),x.bind(I,"mouseup",s),F!=I&&(x.bind(F,"mousemove",a),x.bind(F,"mouseup",s)),E=x.add(U,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},D+" × "+L)}var l;return t?void(i==t&&o(r)):(l=x.get("mceResizeHandle"+i),l&&x.remove(l),l=x.add(U,"div",{id:"mceResizeHandle"+i,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+i+"-resize; margin:0; padding:0"}),n.ie&&(l.contentEditable=!1),x.bind(l,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),o(e)}),e.elm=l,void x.setStyles(l,{left:u*e[0]+A-l.offsetWidth/2,top:d*e[1]+B-l.offsetHeight/2}))}):c(),w.setAttribute("data-mce-selected","1")}function c(){var e,t;g(),w&&w.removeAttribute("data-mce-selected");for(e in N)t=x.get("mceResizeHandle"+e),t&&(x.unbind(t),x.remove(t))}function u(e){function t(e,t){if(e)do if(e===t)return!0;while(e=e.parentNode)}var n,o;if(!H&&!i.removed)return C(x.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),o="mousedown"==e.type?e.target:r.getNode(),o=x.$(o).closest(z?"table":"table,img,hr")[0],t(o,U)&&(v(),n=r.getStart(!0),t(n,o)&&t(r.getEnd(!0),o)&&(!z||o!=n&&"IMG"!==n.nodeName))?void l(o):void c()}function d(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function f(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function h(e){var t=e.srcElement,n,r,o,a,s,c,u;n=t.getBoundingClientRect(),c=k.clientX-n.left,u=k.clientY-n.top;for(r in N)if(o=N[r],a=t.offsetWidth*o[0],s=t.offsetHeight*o[1],W(a-c)<8&&W(s-u)<8){S=o;break}H=!0,i.fire("ObjectResizeStart",{target:w,width:w.clientWidth,height:w.clientHeight}),i.getDoc().selection.empty(),l(t,r,k)}function p(e){var t=e.srcElement;if(t!=w){if(i.fire("ObjectSelected",{target:t}),m(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);("IMG"==t.nodeName||"TABLE"==t.nodeName)&&(c(),w=t,d(t,"resizestart",h))}}function m(){f(w,"resizestart",h)}function g(){for(var e in N){var t=N[e];t.elm&&(x.unbind(t.elm),delete t.elm)}}function v(){try{i.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function y(e){var t;if(z){t=I.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function b(){w=_=null,z&&(m(),f(U,"controlselect",p))}var x=i.dom,C=t.each,w,_,E,N,S,k,T,R,A,B,D,L,M,H,P,O,I=i.getDoc(),F=document,z=n.ie&&n.ie<11,W=Math.abs,V=Math.round,U=i.getBody(),$,q;N={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var j=".mce-content-body";return i.contentStyles.push(j+" div.mce-resizehandle {position: absolute;border: 1px solid black;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+j+" .mce-resizehandle:hover {background: #000}"+j+" img[data-mce-selected], hr[data-mce-selected] {outline: 1px solid black;resize: none}"+j+" .mce-clonedresizable {position: absolute;"+(n.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+j+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}"),i.on("init",function(){z?(i.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(c(),y(e.target))}),d(U,"controlselect",p),i.on("mousedown",function(e){k=e})):(v(),n.ie>=11&&(i.on("mousedown click",function(e){var t=e.target.nodeName;!H&&/^(TABLE|IMG|HR)$/.test(t)&&(i.selection.select(e.target,"TABLE"==t),"mousedown"==e.type&&i.nodeChanged())}),i.dom.bind(U,"mscontrolselect",function(e){/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"==e.target.tagName&&window.setTimeout(function(){i.selection.select(e.target)},0))}))),i.on("nodechange ResizeEditor ResizeWindow drop",function(e){window.requestAnimationFrame?window.requestAnimationFrame(function(){u(e)}):u(e)}),i.on("keydown keyup",function(e){w&&"TABLE"==w.nodeName&&u(e)}),i.on("hide blur",c)}),i.on("remove",g),{isResizable:o,showResizeRect:l,hideResizeRect:c,updateResizeRect:u,controlSelect:y,destroy:b}}}),r(M,[u,f],function(e,t){function n(n){var r=n.dom;this.getBookmark=function(e,i){function o(e,n){var i=0;return t.each(r.select(e),function(e,t){e==n&&(i=t)}),i}function a(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function s(){function e(e,t){var n=e[t?"startContainer":"endContainer"],a=e[t?"startOffset":"endOffset"],s=[],l,c,u=0;if(3==n.nodeType){if(i)for(l=n.previousSibling;l&&3==l.nodeType;l=l.previousSibling)a+=l.nodeValue.length;s.push(a)}else c=n.childNodes,a>=c.length&&c.length&&(u=1,a=Math.max(0,c.length-1)),s.push(r.nodeIndex(c[a],i)+u);for(;n&&n!=o;n=n.parentNode)s.push(r.nodeIndex(n,i));return s}var t=n.getRng(!0),o=r.getRoot(),a={};return a.start=e(t,!0),n.isCollapsed()||(a.end=e(t)),a}var l,c,u,d,f,h,p="",m;if(2==e)return h=n.getNode(),f=h?h.nodeName:null,"IMG"==f?{name:f,index:o(f,h)}:n.tridentSel?n.tridentSel.getBookmark(e):s();if(e)return{rng:n.getRng()};if(l=n.getRng(),u=r.uniqueId(),d=n.isCollapsed(),m="overflow:hidden;line-height:0px",l.duplicate||l.item){if(l.item)return h=l.item(0),f=h.nodeName,{name:f,index:o(f,h)};c=l.duplicate();try{l.collapse(),l.pasteHTML(''+p+""),d||(c.collapse(!1),l.moveToElementText(c.parentElement()),0===l.compareEndPoints("StartToEnd",c)&&c.move("character",-1),c.pasteHTML(''+p+""))}catch(g){return null}}else{if(h=n.getNode(),f=h.nodeName,"IMG"==f)return{name:f,index:o(f,h)};c=a(l.cloneRange()),d||(c.collapse(!1),c.insertNode(r.create("span",{"data-mce-type":"bookmark",id:u+"_end",style:m},p))),l=a(l),l.collapse(!0),l.insertNode(r.create("span",{"data-mce-type":"bookmark",id:u+"_start",style:m},p))}return n.moveToBookmark({id:u,keep:1}),{id:u}},this.moveToBookmark=function(i){function o(e){var t=i[e?"start":"end"],n,r,o,a;if(t){for(o=t[0],r=c,n=t.length-1;n>=1;n--){if(a=r.childNodes,t[n]>a.length-1)return;r=a[t[n]]}3===r.nodeType&&(o=Math.min(t[0],r.nodeValue.length)),1===r.nodeType&&(o=Math.min(t[0],r.childNodes.length)),e?l.setStart(r,o):l.setEnd(r,o)}return!0}function a(n){var o=r.get(i.id+"_"+n),a,s,l,c,p=i.keep;if(o&&(a=o.parentNode,"start"==n?(p?(a=o.firstChild,s=1):s=r.nodeIndex(o),u=d=a,f=h=s):(p?(a=o.firstChild,s=1):s=r.nodeIndex(o),d=a,h=s),!p)){for(c=o.previousSibling,l=o.nextSibling,t.each(t.grep(o.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});o=r.get(i.id+"_"+n);)r.remove(o,1);c&&l&&c.nodeType==l.nodeType&&3==c.nodeType&&!e.opera&&(s=c.nodeValue.length,c.appendData(l.nodeValue),r.remove(l),"start"==n?(u=d=c,f=h=s):(d=c,h=s))}}function s(t){return!r.isBlock(t)||t.innerHTML||e.ie||(t.innerHTML='
    '),t}var l,c,u,d,f,h;if(i)if(i.start){if(l=r.createRng(),c=r.getRoot(),n.tridentSel)return n.tridentSel.moveToBookmark(i);o(!0)&&o()&&n.setRng(l)}else i.id?(a("start"),a("end"),u&&(l=r.createRng(),l.setStart(s(u),f),l.setEnd(s(d),h),n.setRng(l))):i.name?n.select(r.select(i.name)[i.index]):i.rng&&n.setRng(i.rng)}}return n.isBookmarkNode=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},n}),r(H,[m,B,L,w,M,u,f],function(e,n,r,i,o,a,s){function l(e,t,i,a){var s=this;s.dom=e,s.win=t,s.serializer=i,s.editor=a,s.bookmarkManager=new o(s),s.controlSelection=new r(s,a),s.win.getSelection||(s.tridentSel=new n(s))}var c=s.each,u=s.trim,d=a.ie;return l.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();e?(r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)):(n._moveEndPoint(r,n.editor.getBody(),!0),n.setRng(r))},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="
    "+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,e=t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='_',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('_'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(e){var t=this,n=t.getRng(),r,i,o,a;if(n.duplicate||n.item){if(n.item)return n.item(0);for(o=n.duplicate(),o.collapse(1),r=o.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),i=a=n.parentElement();a=a.parentNode;)if(a==r){r=i;break}return r}return r=n.startContainer,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[Math.min(r.childNodes.length-1,n.startOffset)])),r&&3==r.nodeType?r.parentNode:r},getEnd:function(e){var t=this,n=t.getRng(),r,i;return n.duplicate||n.item?n.item?n.item(0):(n=n.duplicate(),n.collapse(0),r=n.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),r&&"BODY"==r.nodeName?r.lastChild||r:r):(r=n.endContainer,i=n.endOffset,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[i>0?i-1:i])),r&&3==r.nodeType?r.parentNode:r)},getBookmark:function(e,t){return this.bookmarkManager.getBookmark(e,t)},moveToBookmark:function(e){return this.bookmarkManager.moveToBookmark(e)},select:function(e,t){var n=this,r=n.dom,i=r.createRng(),o;if(n.lastFocusBookmark=null,e){if(!t&&n.controlSelection.controlSelect(e))return;o=r.nodeIndex(e),i.setStart(e.parentNode,o),i.setEnd(e.parentNode,o+1),t&&(n._moveEndPoint(i,e,!0),n._moveEndPoint(i,e)),n.setRng(i)}return e},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){function t(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}}var n=this,r,i,o,a=n.win.document,s;if(!e&&n.lastFocusBookmark){var l=n.lastFocusBookmark;return l.startContainer?(i=a.createRange(),i.setStart(l.startContainer,l.startOffset),i.setEnd(l.endContainer,l.endOffset)):i=l,i}if(e&&n.tridentSel)return n.tridentSel.getRangeAt(0);try{(r=n.getSel())&&(i=r.rangeCount>0?r.getRangeAt(0):r.createRange?r.createRange():a.createRange())}catch(c){}if(d&&i&&i.setStart&&a.selection){try{s=a.selection.createRange()}catch(c){}s&&s.item&&(o=s.item(0),i=a.createRange(),i.setStartBefore(o),i.setEndAfter(o))}return i||(i=a.createRange?a.createRange():a.body.createTextRange()),i.setStart&&9===i.startContainer.nodeType&&i.collapsed&&(o=n.dom.getRoot(),i.setStart(o,0),i.setEnd(o,0)),n.selectedRange&&n.explicitRange&&(0===t(i.START_TO_START,i,n.selectedRange)&&0===t(i.END_TO_END,i,n.selectedRange)?i=n.explicitRange:(n.selectedRange=null,n.explicitRange=null)),i},setRng:function(e,t){var n=this,r,i;if(e)if(e.select)try{e.select()}catch(o){}else if(n.tridentSel){if(e.cloneRange)try{return void n.tridentSel.addRange(e)}catch(o){}}else{if(r=n.getSel()){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(o){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}e.collapsed||e.startContainer!=e.endContainer||!r.setBaseAndExtent||a.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(i=e.startContainer.childNodes[e.startOffset],i&&"IMG"==i.tagName&&n.getSel().setBaseAndExtent(i,0,i,1))}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset,l=t.dom.getRoot();return n?n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){var e=this,t=e.getRng();return a.range&&new i(e.dom).normalize(t)&&e.setRng(t,e.isForward()),t},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};c(n.selectorChangedData,function(e,t){c(o,function(n){return i.is(n,t)?(r[t]||(c(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),c(r,function(e,n){a[n]||(delete r[n],c(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e){function t(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var n,r,i=this,o=i.dom,a=o.getRoot(),s,l;if("BODY"!=a.nodeName){var c=i.getScrollContainer();if(c)return n=t(e).y-t(c).y,l=c.clientHeight,s=c.scrollTop,void((s>n||n+25>s+l)&&(c.scrollTop=s>n?n:n-l+25))}r=o.getViewPort(i.editor.getWin()),n=o.getPos(e).y,s=r.y,l=r.h,(ns+l)&&i.editor.getWin().scrollTo(0,s>n?n:n-l+25)},placeCaretAt:function(e,t){var n=this.editor.getDoc(),r,i;if(n.caretPositionFromPoint)i=n.caretPositionFromPoint(e,t), +r=n.createRange(),r.setStart(i.offsetNode,i.offset),r.collapse(!0);else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(n.body.createTextRange){r=n.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(o){r.collapse(t=e;e++)a.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);a.addShortcut("access+7","",["FormatBlock",!1,"p"]),a.addShortcut("access+8","",["FormatBlock",!1,"div"]),a.addShortcut("access+9","",["FormatBlock",!1,"address"])}function p(e){return e?$[e]:$}function m(e,t){e&&("string"!=typeof e?le(e,function(e,t){m(t,e)}):(t=t.length?t:[t],le(t,function(e){e.deep===re&&(e.deep=!e.selector),e.split===re&&(e.split=!e.selector||e.inline),e.remove===re&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),$[e]=t))}function g(e){return e&&$[e]&&delete $[e],$}function v(e){var t;return a.dom.getParent(e,function(e){return t=a.dom.getStyle(e,"text-decoration"),t&&"none"!==t}),t}function y(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=v(e.parentNode),a.dom.getStyle(e,"color")&&t?a.dom.setStyle(e,"text-decoration",t):a.dom.getStyle(e,"text-decoration")===t&&a.dom.setStyle(e,"text-decoration",null))}function b(t,n,r){function i(e,t){if(t=t||u,e){if(t.onformat&&t.onformat(e,t,n,r),le(t.styles,function(t,r){q.setStyle(e,r,D(t,n))}),t.styles){var i=q.getAttrib(e,"style");i&&e.setAttribute("data-mce-style",i)}le(t.attributes,function(t,r){q.setAttrib(e,r,D(t,n))}),le(t.classes,function(t){t=D(t,n),q.hasClass(e,t)||q.addClass(e,t)})}}function o(){function t(t,n){var i=new e(n);for(r=i.current();r;r=i.prev())if(r.childNodes.length>1||r==t||"BR"==r.tagName)return r}var n=a.selection.getRng(),i=n.startContainer,o=n.endContainer;if(i!=o&&0===n.endOffset){var s=t(i,o),l=3==s.nodeType?s.length:s.childNodes.length;n.setEnd(s,l)}return n}function l(e,r,o){var a=[],l,f,h=!0;l=u.inline||u.block,f=q.create(l),i(f),K.walk(e,function(e){function r(e){var g,v,y,b,x;return x=h,g=e.nodeName.toLowerCase(),v=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&ie(e)&&(x=h,h="true"===ie(e),b=!0),R(g,"br")?(p=0,void(u.block&&q.remove(e))):u.wrapper&&w(e,t,n)?void(p=0):h&&!b&&u.block&&!u.wrapper&&s(g)&&Y(v,l)?(e=q.rename(e,l),i(e),a.push(e),void(p=0)):u.selector&&(le(c,function(t){"collapsed"in t&&t.collapsed!==m||q.is(e,t.selector)&&!d(e)&&(i(e,t),y=!0)}),!u.inline||y)?void(p=0):void(!h||b||!Y(l,g)||!Y(v,l)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||d(e)||u.inline&&G(e)?(p=0,le(ce(e.childNodes),r),b&&(h=x),p=0):(p||(p=q.clone(f,ee),e.parentNode.insertBefore(p,e),a.push(p)),p.appendChild(e)))}var p;le(e,r)}),u.links===!0&&le(a,function(e){function t(e){"A"===e.nodeName&&i(e,u),le(ce(e.childNodes),t)}t(e)}),le(a,function(e){function r(e){var t=0;return le(e.childNodes,function(e){L(e)||se(e)||t++}),t}function o(e){var t,n;return le(e.childNodes,function(e){return 1!=e.nodeType||se(e)||d(e)?void 0:(t=e,ee)}),t&&!se(t)&&T(t,u)&&(n=q.clone(t,ee),i(n),q.replace(n,e,te),q.remove(t,1)),n||e}var s;if(s=r(e),(a.length>1||!G(e))&&0===s)return void q.remove(e,1);if(u.inline||u.wrapper){if(u.exact||1!==s||(e=o(e)),le(c,function(t){le(q.select(t.inline,e),function(e){se(e)||O(t,n,e,t.exact?e:null)})}),w(e.parentNode,t,n))return q.remove(e,1),e=0,te;u.merge_with_parents&&q.getParent(e.parentNode,function(r){return w(r,t,n)?(q.remove(e,1),e=0,te):void 0}),e&&u.merge_siblings!==!1&&(e=z(F(e),e),e=z(e,F(e,te)))}})}var c=p(t),u=c[0],f,h,m=!r&&j.isCollapsed();if(u)if(r)r.nodeType?(h=q.createRng(),h.setStartBefore(r),h.setEndAfter(r),l(H(h,c),null,!0)):l(r,null,!0);else if(m&&u.inline&&!q.select("td.mce-item-selected,th.mce-item-selected").length)V("apply",t,n);else{var g=a.selection.getNode();X||!c[0].defaultBlock||q.getParent(g,q.isBlock)||b(c[0].defaultBlock),a.selection.setRng(o()),f=j.getBookmark(),l(H(j.getRng(te),c),f),u.styles&&(u.styles.color||u.styles.textDecoration)&&(ue(g,y,"childNodes"),y(g)),j.moveToBookmark(f),U(j.getRng(te)),a.nodeChanged()}}function x(e,t,n,r){function i(e){var n,r,o,a,s;if(1===e.nodeType&&ie(e)&&(a=b,b="true"===ie(e),s=!0),n=ce(e.childNodes),b&&!s)for(r=0,o=h.length;o>r&&!O(h[r],t,e,e);r++);if(m.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(b=a)}}function o(n){var i;return le(u(n.parentNode).reverse(),function(n){var o;i||"_start"==n.id||"_end"==n.id||(o=w(n,e,t,r),o&&o.split!==!1&&(i=n))}),i}function s(e,n,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode,o=n.parentNode;o&&o!=u;o=o.parentNode){for(a=q.clone(o,ee),c=0;c=0;o--){if(a=t[o].selector,!a||t[o].defaultBlock)return te;for(i=r.length-1;i>=0;i--)if(q.is(r[i],a))return te}return ee}function S(e,t,n){var r;return ne||(ne={},r={},a.on("NodeChange",function(e){var t=u(e.element),n={};t=i.grep(t,function(e){return 1==e.nodeType&&!e.getAttribute("data-mce-bogus")}),le(ne,function(e,i){le(t,function(o){return w(o,i,{},e.similar)?(r[i]||(le(e,function(e){e(!0,{node:o,format:i,parents:t})}),r[i]=e),n[i]=e,!1):void 0})}),le(r,function(i,o){n[o]||(delete r[o],le(i,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),le(e.split(","),function(e){ne[e]||(ne[e]=[],ne[e].similar=n),ne[e].push(t)}),this}function k(e){return o.getCssText(a,e)}function T(e,t){return R(e,t.inline)?te:R(e,t.block)?te:t.selector?1==e.nodeType&&q.is(e,t.selector):void 0}function R(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function A(e,t){return B(q.getStyle(e,t),t)}function B(e,t){return("color"==t||"backgroundColor"==t)&&(e=q.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function D(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function L(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function M(e,t,n){var r=q.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function H(t,n,r){function i(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=q.getRoot(),3==r.nodeType&&!L(r)&&(e?v>0:bo?n:o,-1===n||r||n++):(n=a.indexOf(" ",t),o=a.indexOf("\xa0",t),n=-1!==n&&(-1===o||o>n)?n:o),n}var s,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(s=new e(t,q.getParent(t,G)||a.getBody());l=s[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(G(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function d(e,r){var i,o,a,s;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=u(e),o=0;oh?h:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(h=y.childNodes.length-1,y=y.childNodes[b>h?h:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=l(g),y=l(y),(se(g.parentNode)||se(g))&&(g=se(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(se(y.parentNode)||se(y))&&(y=se(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(m=c(g,v,!0),m&&(g=m.container,v=m.offset),m=c(y,b),m&&(y=m.container,b=m.offset)),p=o(y,b),p.node)){for(;p.node&&0===p.offset&&p.node.previousSibling;)p=o(p.node.previousSibling);p.node&&p.offset>0&&3===p.node.nodeType&&" "===p.node.nodeValue.charAt(p.offset-1)&&p.offset>1&&(y=p.node,y.splitText(p.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=i(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=i())),n[0].selector&&n[0].expand!==ee&&!n[0].inline&&(g=d(g,"previousSibling"),y=d(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(G(g)||(g=i(!0)),G(y)||(y=i()))),1==g.nodeType&&(v=J(g),g=g.parentNode),1==y.nodeType&&(b=J(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function P(e,t){return t.links&&"A"==e.tagName}function O(e,t,n,r){var i,o,a;if(!T(n,e)&&!P(n,e))return ee;if("all"!=e.remove)for(le(e.styles,function(i,o){i=B(D(i,t),o),"number"==typeof o&&(o=i,r=0),(e.remove_similar||!r||R(A(r,o),i))&&q.setStyle(n,o,""),a=1}),a&&""===q.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),le(e.attributes,function(e,i){var o;if(e=D(e,t),"number"==typeof i&&(i=e,r=0),!r||R(q.getAttrib(r,i),e)){if("class"==i&&(e=q.getAttrib(n,i),e&&(o="",le(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void q.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),Z.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),le(e.classes,function(e){e=D(e,t),(!r||q.hasClass(r,e))&&q.removeClass(n,e)}),o=q.getAttribs(n),i=0;io?o:i]),3===r.nodeType&&n&&i>=r.nodeValue.length&&(r=new e(r,a.getBody()).next()||r),3!==r.nodeType||n||0!==i||(r=new e(r,a.getBody()).prev()||r),r}function V(t,n,r,i){function o(e){var t=q.create("span",{id:g,"data-mce-bogus":!0,style:v?"color:red":""});return e&&t.appendChild(a.getDoc().createTextNode(Q)),t}function l(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==Q||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function c(e){for(;e;){if(e.id===g)return e;e=e.parentNode}}function u(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function d(e,t){var n,r;if(e)r=j.getRng(!0),l(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),q.remove(e)):(n=u(e),n.nodeValue.charAt(0)===Q&&(n.deleteData(0,1),r.startContainer==n&&r.startOffset>0&&r.setStart(n,r.startOffset-1),r.endContainer==n&&r.endOffset>0&&r.setEnd(n,r.endOffset-1)),q.remove(e,1)),j.setRng(r);else if(e=c(j.getStart()),!e)for(;e=q.get(g);)d(e,!1)}function f(){var e,t,i,a,s,l,d;e=j.getRng(!0),a=e.startOffset,l=e.startContainer,d=l.nodeValue,t=c(j.getStart()),t&&(i=u(t)),d&&a>0&&a=0;h--)u.appendChild(q.clone(f[h],!1)),u=u.firstChild;u.appendChild(q.doc.createTextNode(Q)),u=u.firstChild;var g=q.getParent(d,s);g&&q.isEmpty(g)?d.parentNode.replaceChild(m,d):q.insertAfter(m,d),j.setCursorLocation(u,1),q.isEmpty(d)&&q.remove(d)}}function m(){var e;e=c(j.getStart()),e&&!q.isEmpty(e)&&ue(e,function(e){1!=e.nodeType||e.id===g||q.isEmpty(e)||q.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var g="_mce_caret",v=a.settings.caret_debug;a._hasCaretEvents||(ae=function(){var e=[],t;if(l(c(j.getStart()),e))for(t=e.length;t--;)q.setAttrib(e[t],"data-mce-bogus","1")},oe=function(e){var t=e.keyCode;d(),8==t&&j.isCollapsed()&&j.getStart().innerHTML==Q&&d(c(j.getStart())),(37==t||39==t)&&d(c(j.getStart())),m()},a.on("SetContent",function(e){e.selection&&m()}),a._hasCaretEvents=!0),"apply"==t?f():h()}function U(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if((t.startContainer!=t.endContainer||!c(t.startContainer.childNodes[t.startOffset]))&&(3==n.nodeType&&r>=n.nodeValue.length&&(r=J(n),n=n.parentNode,i=!0),1==n.nodeType))for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,q.getParent(n,q.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!L(a))return l=q.create("a",{"data-mce-bogus":"all"},Q),a.parentNode.insertBefore(l,a),t.setStart(a,0),j.setRng(t),void q.remove(l)}var $={},q=a.dom,j=a.selection,K=new t(q),Y=a.schema.isValidChild,G=q.isBlock,X=a.settings.forced_root_block,J=q.nodeIndex,Q="\ufeff",Z=/^(src|href|style)$/,ee=!1,te=!0,ne,re,ie=q.getContentEditable,oe,ae,se=n.isBookmarkNode,le=i.each,ce=i.grep,ue=i.walk,de=i.extend;de(this,{get:p,register:m,unregister:g,apply:b,remove:x,toggle:C,match:_,matchAll:E,matchNode:w,canApply:N,formatChanged:S,getCssText:k}),f(),h(),a.on("BeforeGetContent",function(e){ae&&"raw"!=e.format&&ae()}),a.on("mouseup keydown",function(e){oe&&oe(e)})}}),r(F,[D,u,f,S],function(e,t,n,r){var i=n.trim,o;return o=new RegExp(["]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>",'\\s?data-mce-selected="[^"]+"'].join("|"),"gi"),function(e){function n(){var t=e.getContent({format:"raw",no_events:1}),n=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,a,s,l,c,u,d=e.schema;for(t=t.replace(o,""),u=d.getShortEndedElements();c=n.exec(t);)s=n.lastIndex,l=c[0].length,a=u[c[1]]?s:r.findEndTag(d,t,s),t=t.substring(0,s-l)+t.substring(a),n.lastIndex=s-l;return i(t)}function a(t){e.isNotDirty=!t}function s(e){l.typing=!1,l.add({},e)}var l=this,c=0,u=[],d,f,h=0;return e.on("init",function(){l.add()}),e.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&l.beforeChange()}),e.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&s(e)}),e.on("ObjectResizeStart Cut",function(){l.beforeChange()}),e.on("SaveContent ObjectResized blur",s),e.on("DragEnd",s),e.on("KeyUp",function(r){var i=r.keyCode;r.isDefaultPrevented()||((i>=33&&36>=i||i>=37&&40>=i||45==i||13==i||r.ctrlKey)&&(s(),e.nodeChanged()),(46==i||8==i||t.mac&&(91==i||93==i))&&e.nodeChanged(),f&&l.typing&&(e.isDirty()||(a(u[0]&&n()!=u[0].content),e.isNotDirty||e.fire("change",{level:u[0],lastLevel:null})),e.fire("TypingUndo"),f=!1,e.nodeChanged()))}),e.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented()){if(t>=33&&36>=t||t>=37&&40>=t||45==t)return void(l.typing&&s(e));var n=e.ctrlKey&&!e.altKey||e.metaKey;!(16>t||t>20)||224==t||91==t||l.typing||n||(l.beforeChange(),l.typing=!0,l.add({},e),f=!0)}}),e.on("MouseDown",function(e){l.typing&&s(e)}),e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo"),e.on("AddUndo Undo Redo ClearUndos",function(t){t.isDefaultPrevented()||e.nodeChanged()}),l={data:u,typing:!1,beforeChange:function(){h||(d=e.selection.getBookmark(2,!0))},add:function(t,r){var i,o=e.settings,s;if(t=t||{},t.content=n(),h||e.removed)return null;if(s=u[c],e.fire("BeforeAddUndo",{level:t,lastLevel:s,originalEvent:r}).isDefaultPrevented())return null;if(s&&s.content==t.content)return null;if(u[c]&&(u[c].beforeBookmark=d),o.custom_undo_redo_levels&&u.length>o.custom_undo_redo_levels){for(i=0;i0&&(a(!0),e.fire("change",l)),t},undo:function(){var t;return l.typing&&(l.add(),l.typing=!1),c>0&&(t=u[--c],0===c&&a(!1),e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.beforeBookmark),e.fire("undo",{level:t})),t},redo:function(){var t;return c0||l.typing&&u[0]&&n()!=u[0].content},hasRedo:function(){return cH)&&(u=a.create("br"),t.parentNode.insertBefore(u,t)),l.setStartBefore(t),l.setEndBefore(t)):(l.setStartAfter(t),l.setEndAfter(t)):(l.setStart(t,0),l.setEnd(t,0));s.setRng(l),a.remove(u),s.scrollIntoView(t)}}function y(e){var t=l.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&a.setAttribs(e,l.forced_root_block_attrs)}function b(e){e.innerHTML=r?"":'
    '}function x(e){var t=D,n,i,o,s=u.getTextInlineElements();if(e||"TABLE"==z?(n=a.create(e||V),y(n)):n=M.cloneNode(!1),o=n,l.keep_styles!==!1)do if(s[t.nodeName]){if("_mce_caret"==t.id)continue;i=t.cloneNode(!1),a.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(o=i,n.appendChild(i))}while(t=t.parentNode);return r||(o.innerHTML='
    '),n}function C(t){var n,r,i;if(3==D.nodeType&&(t?L>0:LD.childNodes.length-1,D=D.childNodes[Math.min(L,D.childNodes.length-1)]||D,L=U&&3==D.nodeType?D.nodeValue.length:0),B=S(D)){if(c.beforeChange(),!a.isBlock(B)&&B!=a.getRoot())return void((!V||P)&&E());if((V&&!P||!V&&P)&&(D=w(D,L)),M=a.getParent(D,a.isBlock),F=M?a.getParent(M.parentNode,a.isBlock):null,z=M?M.nodeName.toUpperCase():"",W=F?F.nodeName.toUpperCase():"","LI"!=W||o.ctrlKey||(M=F,z=W),/^(LI|DT|DD)$/.test(z)){if(!V&&P)return void E();if(a.isEmpty(M))return void _()}if("PRE"==z&&l.br_in_pre!==!1){if(!P)return void E()}else if(!V&&!P&&"LI"!=z||V&&P)return void E(); +V&&M===i.getBody()||(V=V||"P",C()?T():C(!0)?(O=M.parentNode.insertBefore(x(),M),m(O),v(M)):(A=R.cloneRange(),A.setEndAfter(M),I=A.extractContents(),N(I),O=I.firstChild,a.insertAfter(I,M),g(O),k(M),a.isEmpty(M)&&b(M),a.isEmpty(O)?(a.remove(O),T()):v(O)),a.setAttrib(O,"id",""),i.fire("NewBlock",{newBlock:O}),c.add())}}}var a=i.dom,s=i.selection,l=i.settings,c=i.undoManager,u=i.schema,d=u.getNonEmptyElements(),f=u.getMoveCaretBeforeOnEnterElements();i.on("keydown",function(e){13==e.keyCode&&o(e)!==!1&&e.preventDefault()})}}),r(W,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,h,p,m=-16777215,g,v,y,b,x;if(x=n.forced_root_block,t&&1===t.nodeType&&x){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(C){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",m),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",m)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,x.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){p=t,t=t.nextSibling,r.remove(p);continue}h||(h=r.create(x,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(h,t),g=!0),p=t,t=t.nextSibling,h.appendChild(p)}else h=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(C){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(V,[R,u,f,P,w,m],function(e,n,r,i,o,a){var s=r.each,l=r.extend,c=r.map,u=r.inArray,d=r.explode,f=n.gecko,h=n.ie,p=n.ie&&n.ie<11,m=!0,g=!1;return function(r){function v(e,t,n,i){var o,a,c=0;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||i&&i.skip_focus||r.focus(),i=l({},i),i=r.fire("BeforeExecCommand",{command:e,ui:t,value:n}),i.isDefaultPrevented())return!1;if(a=e.toLowerCase(),o=M.exec[a])return o(a,t,n),r.fire("ExecCommand",{command:e,ui:t,value:n}),!0;if(s(r.plugins,function(i){return i.execCommand&&i.execCommand(e,t,n)?(r.fire("ExecCommand",{command:e,ui:t,value:n}),c=!0,!1):void 0}),c)return c;if(r.theme&&r.theme.execCommand&&r.theme.execCommand(e,t,n))return r.fire("ExecCommand",{command:e,ui:t,value:n}),!0;try{c=r.getDoc().execCommand(e,t,n)}catch(u){}return c?(r.fire("ExecCommand",{command:e,ui:t,value:n}),!0):!1}function y(e){var t;if(!r._isHidden()){if(e=e.toLowerCase(),t=M.state[e])return t(e);try{return r.getDoc().queryCommandState(e)}catch(n){}return!1}}function b(e){var t;if(!r._isHidden()){if(e=e.toLowerCase(),t=M.value[e])return t(e);try{return r.getDoc().queryCommandValue(e)}catch(n){}}}function x(e,t){t=t||"exec",s(e,function(e,n){s(n.toLowerCase().split(","),function(n){M[t][n]=e})})}function C(e,t,n){e=e.toLowerCase(),M.exec[e]=function(e,i,o,a){return t.call(n||r,i,o,a)}}function w(e){if(e=e.toLowerCase(),M.exec[e])return!0;try{return r.getDoc().queryCommandSupported(e)}catch(t){}return!1}function _(e,t,n){e=e.toLowerCase(),M.state[e]=function(){return t.call(n||r)}}function E(e,t,n){e=e.toLowerCase(),M.value[e]=function(){return t.call(n||r)}}function N(e){return e=e.toLowerCase(),!!M.exec[e]}function S(e,n,i){return n===t&&(n=g),i===t&&(i=null),r.getDoc().execCommand(e,n,i)}function k(e){return L.match(e)}function T(e,n){L.toggle(e,n?{value:n}:t),r.nodeChanged()}function R(e){P=D.getBookmark(e)}function A(){D.moveToBookmark(P)}var B,D,L,M={state:{},exec:{},value:{}},H=r.settings,P;r.on("PreInit",function(){B=r.dom,D=r.selection,H=r.settings,L=r.formatter}),l(this,{execCommand:v,queryCommandState:y,queryCommandValue:b,queryCommandSupported:w,addCommands:x,addCommand:C,addQueryStateHandler:_,addQueryValueHandler:E,hasCustomCommand:N}),x({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){r.undoManager.add()},"Cut,Copy,Paste":function(e){var t=r.getDoc(),i;try{S(e)}catch(o){i=m}if(i||!t.queryCommandSupported(e)){var a=r.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");n.mac&&(a=a.replace(/Ctrl\+/g,"\u2318+")),r.windowManager.alert(a)}},unlink:function(){if(D.isCollapsed()){var e=D.getNode();return void("A"==e.tagName&&r.dom.remove(e,!0))}L.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"==t&&(t="justify"),s("left,center,right,justify".split(","),function(e){t!=e&&L.remove("align"+e)}),"none"!=t&&(T("align"+t),v("mceRepaint"))},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;S(e),t=B.getParent(D.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(R(),B.split(n,t),A()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){T(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){T(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=d(H.font_size_style_values),r=d(H.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),T(e,n)},RemoveFormat:function(e){L.remove(e)},mceBlockQuote:function(){T("blockquote")},FormatBlock:function(e,t,n){return T(n||"p")},mceCleanup:function(){var e=D.getBookmark();r.setContent(r.getContent({cleanup:m}),{cleanup:m}),D.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var i=n||D.getNode();i!=r.getBody()&&(R(),r.dom.remove(i,m),A())},mceSelectNodeDepth:function(e,t,n){var i=0;B.getParent(D.getNode(),function(e){return 1==e.nodeType&&i++==n?(D.select(e),g):void 0},r.getBody())},mceSelectNode:function(e,t,n){D.select(n)},mceInsertContent:function(t,n,o){function a(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=D.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i|)$/," "):t("nextSibling")||(e=e.replace(/( | )(
    |)$/," "))),e}function l(){var e,t,n;e=D.getRng(!0),t=e.startContainer,n=e.startOffset,3==t.nodeType&&e.collapsed&&("\xa0"===t.data[n]?(t.deleteData(n,1),/[\u00a0| ]$/.test(o)||(o+=" ")):"\xa0"===t.data[n-1]&&(t.deleteData(n-1,1),/[\u00a0| ]$/.test(o)||(o=" "+o)))}function c(e){if(_)for(x=e.firstChild;x;x=x.walk(!0))N[x.name]&&x.attr("data-mce-new","true")}function u(){if(_){var e=r.getBody(),t=new i(B);s(B.select("*[data-mce-new]"),function(n){n.removeAttribute("data-mce-new");for(var r=n.parentNode;r&&r!=e;r=r.parentNode)t.compare(r,n)&&B.remove(n,!0)})}}var d,f,p,m,g,v,y,b,x,C,w,_,E,N=r.schema.getTextInlineElements();"string"!=typeof o&&(_=o.merge,E=o.data,o=o.content),/^ | $/.test(o)&&(o=a(o)),d=r.parser,f=new e({validate:H.validate},r.schema),w='​',v={content:o,format:"html",selection:!0},r.fire("BeforeSetContent",v),o=v.content,-1==o.indexOf("{$caret}")&&(o+="{$caret}"),o=o.replace(/\{\$caret\}/,w),b=D.getRng();var S=b.startContainer||(b.parentElement?b.parentElement():null),k=r.getBody();S===k&&D.isCollapsed()&&B.isBlock(k.firstChild)&&B.isEmpty(k.firstChild)&&(b=B.createRng(),b.setStart(k.firstChild,0),b.setEnd(k.firstChild,0),D.setRng(b)),D.isCollapsed()||(r.getDoc().execCommand("Delete",!1,null),l()),p=D.getNode();var T={context:p.nodeName.toLowerCase(),data:E};if(g=d.parse(o,T),c(g),x=g.lastChild,"mce_marker"==x.attr("id"))for(y=x,x=x.prev;x;x=x.walk(!0))if(3==x.type||!B.isBlock(x.name)){r.schema.isValidChild(x.parent.name,"span")&&x.parent.insert(y,x,"br"===x.name);break}if(T.invalid){for(D.setContent(w),p=D.getNode(),m=r.getBody(),9==p.nodeType?p=x=m:x=p;x!==m;)p=x,x=x.parentNode;o=p==m?m.innerHTML:B.getOuterHTML(p),o=f.serialize(d.parse(o.replace(//i,function(){return f.serialize(g)}))),p==m?B.setHTML(m,o):B.setOuterHTML(p,o)}else o=f.serialize(g),x=p.firstChild,C=p.lastChild,!x||x===C&&"BR"===x.nodeName?B.setHTML(p,o):D.setContent(o);u(),y=B.get("mce_marker"),D.scrollIntoView(y),b=B.createRng(),x=y.previousSibling,x&&3==x.nodeType?(b.setStart(x,x.nodeValue.length),h||(C=y.nextSibling,C&&3==C.nodeType&&(x.appendData(C.data),C.parentNode.removeChild(C)))):(b.setStartBefore(y),b.setEndBefore(y)),B.remove(y),D.setRng(b),r.fire("SetContent",v),r.addVisual()},mceInsertRawHTML:function(e,t,n){D.setContent("tiny_mce_marker"),r.setContent(r.getContent().replace(/tiny_mce_marker/g,function(){return n}))},mceToggleFormat:function(e,t,n){T(n)},mceSetContent:function(e,t,n){r.setContent(n)},"Indent,Outdent":function(e){var t,n,i;t=H.indentation,n=/[a-z%]+$/i.exec(t),t=parseInt(t,10),y("InsertUnorderedList")||y("InsertOrderedList")?S(e):(H.forced_root_block||B.getParent(D.getNode(),B.isBlock)||L.apply("div"),s(D.getSelectedBlocks(),function(o){if("LI"!=o.nodeName){var a=r.getParam("indent_use_margin",!1)?"margin":"padding";a+="rtl"==B.getStyle(o,"direction",!0)?"Right":"Left","outdent"==e?(i=Math.max(0,parseInt(o.style[a]||0,10)-t),B.setStyle(o,a,i?i+n:"")):(i=parseInt(o.style[a]||0,10)+t+n,B.setStyle(o,a,i))}}))},mceRepaint:function(){if(f)try{R(m),D.getSel()&&D.getSel().selectAllChildren(r.getBody()),D.collapse(m),A()}catch(e){}},InsertHorizontalRule:function(){r.execCommand("mceInsertContent",!1,"
    ")},mceToggleVisualAid:function(){r.hasVisual=!r.hasVisual,r.addVisual()},mceReplaceContent:function(e,t,n){r.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,D.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=B.getParent(D.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||L.remove("link"),n.href&&L.apply("link",n,r)},selectAll:function(){var e=B.getRoot(),t;D.getRng().setStart?(t=B.createRng(),t.setStart(e,0),t.setEnd(e,e.childNodes.length),D.setRng(t)):(t=D.getRng(),t.item||(t.moveToElementText(e),t.select()))},"delete":function(){S("Delete");var e=r.getBody();B.isEmpty(e)&&(r.setContent(""),e.firstChild&&B.isBlock(e.firstChild)?r.selection.setCursorLocation(e.firstChild,0):r.selection.setCursorLocation(e,0))},mceNewDocument:function(){r.setContent("")},InsertLineBreak:function(e,t,n){function i(){for(var e=new a(h,v),t,n=r.schema.getNonEmptyElements();t=e.next();)if(n[t.nodeName.toLowerCase()]||t.length>0)return!0}var s=n,l,c,u,d=D.getRng(!0);new o(B).normalize(d);var f=d.startOffset,h=d.startContainer;if(1==h.nodeType&&h.hasChildNodes()){var g=f>h.childNodes.length-1;h=h.childNodes[Math.min(f,h.childNodes.length-1)]||h,f=g&&3==h.nodeType?h.nodeValue.length:0}var v=B.getParent(h,B.isBlock),y=v?v.nodeName.toUpperCase():"",b=v?B.getParent(v.parentNode,B.isBlock):null,x=b?b.nodeName.toUpperCase():"",C=s&&s.ctrlKey;"LI"!=x||C||(v=b,y=x),h&&3==h.nodeType&&f>=h.nodeValue.length&&(p||i()||(l=B.create("br"),d.insertNode(l),d.setStartAfter(l),d.setEndAfter(l),c=!0)),l=B.create("br"),d.insertNode(l);var w=B.doc.documentMode;return p&&"PRE"==y&&(!w||8>w)&&l.parentNode.insertBefore(B.doc.createTextNode("\r"),l),u=B.create("span",{}," "),l.parentNode.insertBefore(u,l),D.scrollIntoView(u),B.remove(u),c?(d.setStartBefore(l),d.setEndBefore(l)):(d.setStartAfter(l),d.setEndAfter(l)),D.setRng(d),r.undoManager.add(),m}}),x({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=D.isCollapsed()?[B.getParent(D.getNode(),B.isBlock)]:D.getSelectedBlocks(),r=c(n,function(e){return!!L.matchNode(e,t)});return-1!==u(r,m)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return k(e)},mceBlockQuote:function(){return k("blockquote")},Outdent:function(){var e;if(H.inline_styles){if((e=B.getParent(D.getStart(),B.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return m;if((e=B.getParent(D.getEnd(),B.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return m}return y("InsertUnorderedList")||y("InsertOrderedList")||!H.inline_styles&&!!B.getParent(D.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=B.getParent(D.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),x({"FontSize,FontName":function(e){var t=0,n;return(n=B.getParent(D.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),x({Undo:function(){r.undoManager.undo()},Redo:function(){r.undoManager.redo()}})}}),r(U,[f],function(e){function t(e,o){var a=this,s,l;if(e=r(e),o=a.settings=o||{},s=o.base_uri,/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(a.source=e);var c=0===e.indexOf("//");0!==e.indexOf("/")||c||(e=(s?s.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(l=o.base_uri?o.base_uri.path:new t(location.href).directory,""===o.base_uri.protocol?e="//mce_host"+a.toAbsPath(l,e):(e=/([^#?]*)([#?]?.*)/.exec(e),e=(s&&s.protocol||"http")+"://mce_host"+a.toAbsPath(l,e[1])+e[2])),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(i,function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),a[t]=r}),s&&(a.protocol||(a.protocol=s.protocol),a.userInfo||(a.userInfo=s.userInfo),a.port||"mce_host"!==a.host||(a.port=s.port),a.host&&"mce_host"!==a.host||(a.host=s.host),a.source=""),c&&(a.protocol="")}var n=e.each,r=e.trim,i="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),o={ftp:21,http:80,https:443,mailto:25};return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol&&""!==e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(n&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=o[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.lengtho;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return(!n.source||e)&&(t="",e||(t+=n.protocol?n.protocol+"://":"//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}},t}),r($,[f],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r=this;if(!o&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){t=t;for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(d in e)f=e[d],"function"==typeof f&&c[d]?u[d]=s(d,f):u[d]=f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r(q,[f],function(e){function t(t){function n(){return!1}function r(){return!0}function i(e,i){var o,s,l,c;if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=u),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=r},i.stopPropagation=function(){i.isPropagationStopped=r},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=r},i.isDefaultPrevented=n,i.isPropagationStopped=n,i.isImmediatePropagationStopped=n),t.beforeFire&&t.beforeFire(i),o=d[e])for(s=0,l=o.length;l>s;s++){if(c=o[s],c.once&&a(e,c.func),i.isImmediatePropagationStopped())return i.stopPropagation(),i;if(c.func.call(u,i)===!1)return i.preventDefault(),i}return i}function o(t,r,i,o){var a,s,l;if(r===!1&&(r=n),r)for(r={func:r},o&&e.extend(r,o),s=t.toLowerCase().split(" "),l=s.length;l--;)t=s[l],a=d[t],a||(a=d[t]=[],f(t,!0)),i?a.unshift(r):a.push(r);return c}function a(e,t){var n,r,i,o,a;if(e)for(o=e.toLowerCase().split(" "),n=o.length;n--;){if(e=o[n],r=d[e],!e){for(i in d)f(i,!1),delete d[i];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),d[e]=r);else r.length=0;r.length||(f(e,!1),delete d[e])}}else{for(e in d)f(e,!1);d={}}return c}function s(e,t,n){return o(e,t,n,{once:!0})}function l(e){return e=e.toLowerCase(),!(!d[e]||0===d[e].length)}var c=this,u,d={},f;t=t||{},u=t.scope||c,f=t.toggleEvent||n,c.fire=i,c.on=o,c.off=a,c.once=s,c.has=l}var n=e.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchend"," ");return t.isNative=function(e){return!!n[e.toLowerCase()]},t}),r(j,[],function(){function e(e){this.create=e.create}return e.create=function(t,n){return new e({create:function(e,r){function i(t){e.set(r,t.value)}function o(e){t.set(n,e.value)}var a;return e.on("change:"+r,o),t.on("change:"+n,i),a=e._bindings,a||(a=e._bindings=[],e.on("destroy",function(){for(var e=a.length;e--;)a[e]()})),a.push(function(){t.off("change:"+n,i)}),t.get(n)}})},e}),r(K,[q],function(e){function t(t){return t._eventDispatcher||(t._eventDispatcher=new e({scope:t,toggleEvent:function(n,r){e.isNative(n)&&t.toggleNativeEvent&&t.toggleNativeEvent(n,r)}})),t._eventDispatcher}return{fire:function(e,n,r){var i=this;if(i.removed&&"remove"!==e)return n;if(n=t(i).fire(e,n,r),r!==!1&&i.parent)for(var o=i.parent();o&&!n.isPropagationStopped();)o.fire(e,n,!1),o=o.parent();return n},on:function(e,n,r){return t(this).on(e,n,r)},off:function(e,n){return t(this).off(e,n)},once:function(e,n){return t(this).once(e,n)},hasEventListeners:function(e){return t(this).has(e)}}}),r(Y,[j,K,$,f],function(e,t,n,r){function i(e){return e.nodeType>0}function o(e,t){var n,a;if(e===t)return!0;if(null===e||null===t)return e===t;if("object"!=typeof e||"object"!=typeof t)return e===t;if(r.isArray(t)){if(e.length!==t.length)return!1;for(n=e.length;n--;)if(!o(e[n],t[n]))return!1}if(i(e)||i(t))return e===t;a={};for(n in t){if(!o(e[n],t[n]))return!1;a[n]=!0}for(n in e)if(!a[n]&&!o(e[n],t[n]))return!1;return!0}return n.extend({Mixins:[t],init:function(t){var n,r;t=t||{};for(n in t)r=t[n],r instanceof e&&(t[n]=r.create(this,n));this.data=t},set:function(t,n){var r,i,a=this.data[t];if(n instanceof e&&(n=n.create(this,t)),"object"==typeof t){for(r in t)this.set(r,t[r]);return this}return o(a,n)||(this.data[t]=n,i={target:this,name:t,value:n,oldValue:a},this.fire("change:"+t,i),this.fire("change",i)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:function(t){return e.create(this,t)},destroy:function(){this.fire("destroy")}})}),r(G,[$],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.classes.contains(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.psuedo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,h,p;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,p=e,h=0,i=o-1;i>=0;i--)for(c=a[i];p;){if(c.psuedo)for(f=p.parent().items(),u=d=f.length;u--&&f[u]!==p;);for(s=0,l=c.length;l>s;s++)if(!c[s](p,u,d)){s=l+1;break}if(s===l){h++;break}if(i===o-1)break;p=p.parent()}if(h===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(X,[f,G,$],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].classes.contains(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(e){return this.each(function(t){t.classes.add(e)})},removeClass:function(e){return this.each(function(t){t.classes.remove(e)})}},e.each("fire on off show hide append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(J,[f,b],function(e,t){var n=0;return{id:function(){return"mceu_"+n++},createFragment:function(e){return t.DOM.createFragment(e)},getWindowSize:function(){return t.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,n){return t.DOM.getPos(e,n)},getViewPort:function(e){return t.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,n){return t.DOM.addClass(e,n)},removeClass:function(e,n){return t.DOM.removeClass(e,n)},hasClass:function(e,n){return t.DOM.hasClass(e,n)},toggleClass:function(e,n,r){return t.DOM.toggleClass(e,n,r)},css:function(e,n,r){return t.DOM.setStyle(e,n,r)},getRuntimeStyle:function(e,n){return t.DOM.getStyle(e,n,!0)},on:function(e,n,r,i){return t.DOM.bind(e,n,r,i)},off:function(e,n,r){return t.DOM.unbind(e,n,r)},fire:function(e,n,r){return t.DOM.fire(e,n,r)},innerHtml:function(e,n){t.DOM.setHTML(e,n)}}}),r(Q,[],function(){return{parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}}}}),r(Z,[f],function(e){function t(){}function n(e){this.cls=[],this.cls._map={},this.onchange=e||t,this.prefix=""}return e.extend(n.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){for(var t=0;t0&&(e+=" "),e+=this.prefix+this.cls[t];return e},n}),r(ee,[],function(){function e(e,t){function n(e){window.setTimeout(e,0)}var r,i=window.requestAnimationFrame,o=["ms","moz","webkit"];for(r=0;r=i;o--)r=s[o],r.fire("mouseleave",{target:r.getEl()})}for(o=i;oo;o++)c=l[o]._eventsRoot;for(c||(c=l[l.length-1]||e),e._eventsRoot=c,s=o,o=0;s>o;o++)l[o]._eventsRoot=c;var p=c._delegates;p||(p=c._delegates={});for(d in u){if(!u)return!1;"wheel"!==d||h?("mouseenter"===d||"mouseleave"===d?c._hasMouseEnter||(a(c.getEl()).on("mouseleave",n).on("mouseover",r),c._hasMouseEnter=1):p[d]||(a(c.getEl()).on(d,t),p[d]=!0),u[d]=!1):f?a(e.getEl()).on("mousewheel",i):a(e.getEl()).on("DOMMouseScroll",i)}}}var f="onmousewheel"in document,h=!1,p="mce-",m,g=0,v={Statics:{classPrefix:p},isRtl:function(){return m.rtl},classPrefix:p,init:function(e){function n(e){var t;for(e=e.split(" "),t=0;tn.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=in.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=in.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=in.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH), +r=t._lastLayoutRect,(r.x!==n.x||r.y!==n.y||r.w!==n.w||r.h!==n.h)&&(l=m.repaintControls,l&&l.map&&!l.map[t._id]&&(l.push(t),l.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o,a=0,s=0,l,c,u;c=document.createRange?function(e){return e}:Math.round,t=e.getEl().style,i=e._layoutRect,l=e._lastRepaintRect||{},o=e.borderBox,a=o.left+o.right,s=o.top+o.bottom,i.x!==l.x&&(t.left=c(i.x)+"px",l.x=i.x),i.y!==l.y&&(t.top=c(i.y)+"px",l.y=i.y),i.w!==l.w&&(u=c(i.w-a),t.width=(u>=0?u:0)+"px",l.w=i.w),i.h!==l.h&&(u=c(i.h-s),t.height=(u>=0?u:0)+"px",l.h=i.h),e._hasBody&&i.innerW!==l.innerW&&(u=c(i.innerW),r=e.getEl("body"),r&&(n=r.style,n.width=(u>=0?u:0)+"px"),l.innerW=i.innerW),e._hasBody&&i.innerH!==l.innerH&&(u=c(i.innerH),r=r||e.getEl("body"),r&&(n=n||r.style,n.height=(u>=0?u:0)+"px"),l.innerH=i.innerH),e._lastRepaintRect=l,e.fire("repaint",{},!1)},on:function(e,t){function n(e){var t,n;return"string"!=typeof e?e:function(i){return t||r.parentsAndSelf().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t?t.call(n,i):(i.action=e,void this.fire("execute",i))}}var r=this;return u(r).on(e,n(t)),r},off:function(e,t){return u(this).off(e,t),this},fire:function(e,t,n){var r=this;if(t=t||{},t.control||(t.control=r),t=u(r).fire(e,t),n!==!1&&r.parent)for(var i=r.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return u(this).has(e)},parents:function(e){var t=this,n,r=new i;for(n=t.parent();n;n=n.parent())r.add(n);return e&&(r=r.filter(e)),r},parentsAndSelf:function(e){return new i(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=a("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl(n.ariaTarget);return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered")&&r.setAttribute("role"==e?e:"aria-"+e,t),n)},encode:function(e,t){return t!==!1&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return m.translate?m.translate(e):e},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),r,i;if(e.items){var o=e.items().toArray();for(i=o.length;i--;)o[i].remove()}n&&n.items&&(r=[],n.items().each(function(t){t!==e&&r.push(t)}),n.items().set(r),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&a(t).off();var s=e.getRoot().controlIdLookup;return s&&delete s[e._id],t&&t.parentNode&&t.parentNode.removeChild(t),e.state.set("rendered",!1),e.state.destroy(),e.fire("remove"),e},renderBefore:function(e){return a(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return a(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'
    '},postRender:function(){var e=this,t=e.settings,n,r,i,o,s;e.$el=a(e.getEl()),e.state.set("rendered",!0);for(o in t)0===o.indexOf("on")&&e.on(o.substr(2),t[o]);if(e._eventsRoot){for(i=e.parent();!s&&i;i=i.parent())s=i._eventsRoot;if(s)for(o in s._nativeEvents)e._nativeEvents[o]=!0}d(e),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e.settings.border&&(r=e.borderBox,e.$el.css({"border-top-width":r.top,"border-right-width":r.right,"border-bottom-width":r.bottom,"border-left-width":r.left}));var l=e.getRoot();l.controlIdLookup||(l.controlIdLookup={}),l.controlIdLookup[e._id]=e;for(var u in e._aria)e.aria(u,e._aria[u]);e.state.get("visible")===!1&&(e.getEl().style.display="none"),e.bindStates(),e.state.on("change:visible",function(t){var n=t.value,r;e.state.get("rendered")&&(e.getEl().style.display=n===!1?"none":"",e.getEl().getBoundingClientRect()),r=e.parent(),r&&(r._lastRect=null),e.fire(n?"show":"hide"),c.add(e)}),e.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);return i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},getRoot:function(){for(var e=this,t,n=[];e;){if(e.rootControl){t=e.rootControl;break}n.push(e),t=e,e=e.parent()}t||(t=this);for(var r=n.length;r--;)n[r].rootControl=t;return t},reflow:function(){c.remove(this);var e=this.parent();return e._layout&&!e._layout.isNative()&&e.reflow(),this}};return t.each("text title visible disabled active value".split(" "),function(e){v[e]=function(t){return 0===arguments.length?this.state.get(e):("undefined"!=typeof t&&this.state.set(e,t),this)}}),m=e.extend(v)}),r(ne,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(re,[],function(){return function(e){function t(e){return e&&1===e.nodeType}function n(e){return e=e||x,t(e)?e.getAttribute("role"):null}function r(e){for(var t,r=e||x;r=r.parentNode;)if(t=n(r))return t}function i(e){var n=x;return t(n)?n.getAttribute("aria-"+e):void 0}function o(e){var t=e.tagName.toUpperCase();return"INPUT"==t||"TEXTAREA"==t}function a(e){return o(e)&&!e.hidden?!0:/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell)$/.test(n(e))?!0:!1}function s(e){function t(e){if(1==e.nodeType&&"none"!=e.style.display){a(e)&&n.push(e);for(var r=0;re?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function d(e,t){var n=-1,r=l();t=t||s(r.getEl());for(var i=0;i=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,i,a=[];return o.isArray(t)||(t=[t]),o.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),i=o.extend({},n.settings.defaults,t),t.type=i.type=i.type||t.type||n.settings.defaultType||(i.defaults?i.defaults.type:null),t=r.create(i)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r;t.parent(e),t.state.get("rendered")||(r=e.getEl("body"),r.hasChildNodes()&&n<=r.childNodes.length-1?a(r.childNodes[n]).before(t.renderHtml()):a(r).append(t.renderHtml()),t.postRender(),l.add(t))}),e._layout.applyClasses(e.items().filter(":visible")),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t=0&&t
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e.state.set("rendered",!0),e.settings.style&&e.$el.css(e.settings.style),e.settings.border&&(t=e.borderBox,e.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e.parent()||(e.keyboardNav=new i({root:e})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t;if(l.remove(this),this.visible()){for(e.repaintControls=[],e.repaintControls.map={},this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(oe,[h],function(e){function t(e){var t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}function n(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n").css({position:"absolute",top:0,left:0,width:c.width,height:c.height,zIndex:2147483647,opacity:1e-4,cursor:m}).appendTo(s.body),e(s).on("mousemove touchmove",d).on("mouseup touchend",u),i.start(r)},d=function(e){return n(e),e.button!==l?u(e):(e.deltaX=e.screenX-f,e.deltaY=e.screenY-h,e.preventDefault(),void i.drag(e))},u=function(t){n(t),e(s).off("mousemove touchmove",d).off("mouseup touchend",u),a.remove(),i.stop&&i.stop(t)},this.destroy=function(){e(o()).off()},e(o()).on("mousedown touchstart",c)}}),r(ae,[h,oe],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,h,p,m,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),e(i.getEl("absend")).css(y,i.layoutRect()[l]-1),!c)return void e(f).css("display","none");e(f).css("display","block"),d=i.getEl("body"),h=i.getEl("scroll"+t+"t"),p=d["client"+s]-2*o,p-=n&&r?f["client"+u]:0,m=d["scroll"+s],g=p/m,v={},v[y]=d["offset"+a]+o,v[b]=p,e(f).css(v),v={},v[y]=d["scroll"+a]*g,v[b]=p*g,e(h).css(v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;e(i.getEl()).append('
    '),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e("#"+u).addClass(d+"active")},drag:function(e){var t,u,d,f,h=i.layoutRect();u=h.contentW>h.innerW,d=h.contentH>h.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e("#"+u).removeClass(d+"active")}})}i.classes.add("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e(i.getEl("body")).on("scroll",n)),n())}}}),r(se,[ie,ae],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='
    '+t.renderHtml(e)+"
    ":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'
    '+(e._preBodyHtml||"")+n+"
    "}})}),r(le,[J],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,h;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t.state.get("fixed")&&"static"==e.getRuntimeStyle(document.body,"position")&&(a-=f.x,s-=f.y),i=t.getEl(),h=e.getSize(i),l=h.width,c=h.height,h=e.getSize(n),u=h.width,d=h.height,r=(r||"").split(""),"b"===r[0]&&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o0&&a.x+a.w0&&a.y+a.hi.x&&a.x+a.wi.y&&a.y+a.he?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i.state.get("rendered")?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(ce,[J],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(ue,[se,le,ce,J,h],function(e,t,n,r,i){function o(e,t){for(;e;){if(e==t)return!0;e=e.parent()}}function a(e){for(var t=g.length;t--;){var n=g[t],r=n.getParentCtrl(e.target);if(n.settings.autohide){if(r&&(o(r,n)||n.parent()===r))continue;e=n.fire("autohide",{target:e.target}),e.isDefaultPrevented()||n.hide()}}}function s(){h||(h=function(e){2!=e.button&&a(e)},i(document).on("click touchstart",h))}function l(){p||(p=function(){var e;for(e=g.length;e--;)u(g[e])},i(window).on("scroll",p))}function c(){if(!m){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;m=function(){document.all&&t==e.clientWidth&&n==e.clientHeight||(t=e.clientWidth,n=e.clientHeight,b.hideAll())},i(window).on("resize",m)}}function u(e){function t(t,n){for(var r,i=0;in&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY
    ').appendTo(t.getContainerElm())),setTimeout(function(){n.addClass(r+"in"),i(t.getEl()).addClass(r+"in")},0),y=!0),d(!0,t)}}),t.on("show",function(){t.parents().each(function(e){return e.state.get("fixed")?(t.fixed(!0),!1):void 0})}),e.popover&&(t._preBodyHtml='
    ',t.classes.add("popover").add("bottom").add(t.isRtl()?"end":"start"))},fixed:function(e){var t=this;if(t.state.get("fixed")!=e){if(t.state.get("rendered")){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("fixed",e)}return t},show:function(){var e=this,t,n=e._super();for(t=g.length;t--&&g[t]!==e;);return-1===t&&g.push(e),n},hide:function(){return f(this),d(!1,this),this._super()},hideAll:function(){b.hideAll()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||(e.remove(),d(!1,e)),e},remove:function(){f(this),this._super()},postRender:function(){var e=this;return e.settings.bodyRole&&this.getEl("body").setAttribute("role",e.settings.bodyRole),e._super()}});return b.hideAll=function(){for(var e=g.length;e--;){var t=g[e];t&&t.settings.autohide&&(t.hide(),g.splice(e,1))}},b}),r(de,[ue,se,J,h,oe,Q,u],function(e,t,n,r,i,o,a){function s(e){var t="width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0",n=r("meta[name=viewport]")[0],i;a.overrideViewPort!==!1&&(n||(n=document.createElement("meta"),n.setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),i=n.getAttribute("content"),i&&"undefined"!=typeof d&&(d=i),n.setAttribute("content",e?t:d))}function l(e){for(var t=0;tr.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=e.settings.x||Math.max(0,a.w/2-t.w/2),t.y=e.settings.y||Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='
    '+e.encode(i.title)+'
    '),i.url&&(s=''),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'
    '+o+'
    '+s+"
    "+a+"
    "},fullscreen:function(e){var t=this,i=document.documentElement,a,s=t.classPrefix,l;if(e!=t._fullscreen)if(r(window).on("resize",function(){var e;if(t._fullscreen)if(a)t._timer||(t._timer=setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(a=!0)}}),l=t.layoutRect(),t._fullscreen=e,e){t._initial={x:l.x,y:l.y,w:l.w,h:l.h},t.borderBox=o.parseBox("0"),t.getEl("head").style.display="none",l.deltaH-=l.headerH+2,r([i,document.body]).addClass(s+"fullscreen"),t.classes.add("fullscreen");var c=n.getWindowSize();t.moveTo(0,0).resizeTo(c.w,c.h)}else t.borderBox=o.parseBox(t.settings.border),t.getEl("head").style.display="",l.deltaH+=l.headerH,r([i,document.body]).removeClass(s+"fullscreen"),t.classes.remove("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t;setTimeout(function(){e.classes.add("in")},0),e._super(),e.statusbar&&e.statusbar.postRender(),e.focus(),this.dragHelper=new i(e._id+"-dragh",{start:function(){t={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(n){e.moveTo(t.x+n.deltaX,t.y+n.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()}),u.push(e),s(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t;for(e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),t=u.length;t--;)u[t]===e&&u.splice(t,1);s(u.length>0),l(e.classPrefix)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});return a.desktop||c(),f}),r(fe,[de],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){function r(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),o(t)}}}var i,o=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:i=[r("Ok",!0,!0),r("Cancel",!1)];break;case t.YES_NO:case t.YES_NO_CANCEL:i=[r("Yes",1,!0),r("No",0)],n.buttons==t.YES_NO_CANCEL&&i.push(r("Cancel",-1));break;default:i=[r("Ok",!0,!0)]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:i,title:n.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:n.onClose,onCancel:function(){o(!1)}}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(he,[de,fe],function(e,t){return function(n){function r(){return o.length?o[o.length-1]:void 0}var i=this,o=[];i.windows=o,n.on("remove",function(){for(var e=o.length;e--;)o[e].close()}),i.open=function(t,r){var i;return n.editorManager.setActive(n),t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit()}},{text:"Cancel",onclick:function(){i.close()}}]),i=new e(t),o.push(i),i.on("close",function(){for(var e=o.length;e--;)o[e]===i&&o.splice(e,1);o.length||n.focus()}),t.data&&i.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),i.features=t||{},i.params=r||{},1===o.length&&n.nodeChanged(),i.renderTo().reflow()},i.alert=function(e,r,i){t.alert(e,function(){r?r.call(i||this):n.focus()})},i.confirm=function(e,n,r){t.confirm(e,function(e){n.call(r||this,e)})},i.close=function(){r()&&r().close()},i.getParams=function(){return r()?r().params:null},i.setParams=function(e){r()&&(r().params=e)},i.getWindows=function(){return o}}}),r(pe,[b],function(e){function t(t,n,r){for(var i=[];n&&n!=t;n=n.parentNode)i.push(e.nodeIndex(n,r));return i}function n(e,t){var n,r,i;for(r=e,n=t.length-1;n>=0;n--){if(i=r.childNodes,t[n]>i.length-1)return null;r=i[t[n]]}return r}return{create:t,resolve:n}}),r(me,[D,w,m,pe,E,v,u,f],function(e,t,n,r,i,o,a,s){return function(l){function c(e,t){try{l.getDoc().execCommand(e,!1,t)}catch(n){}}function u(){var e=l.getDoc().documentMode;return e?e:6}function d(e){return e.isDefaultPrevented()}function f(e){var t,n;e.dataTransfer&&(l.selection.isCollapsed()&&"IMG"==e.target.tagName&&J.select(e.target),t=l.selection.getContent(),t.length>0&&(n=ie+escape(l.id)+","+escape(t),e.dataTransfer.setData(oe,n)))}function h(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(oe),t&&t.indexOf(ie)>=0)?(t=t.substr(ie.length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null}function p(e){l.queryCommandSupported("mceInsertClipboardContent")?l.execCommand("mceInsertClipboardContent",!1,{content:e}):l.execCommand("mceInsertContent",!1,e)}function m(){function i(e){var t=b.schema.getBlockElements(),n=l.getBody();if("BR"!=e.nodeName)return!1;for(e=e;e!=n&&!t[e.nodeName];e=e.parentNode)if(e.nextSibling)return!1;return!0}function o(e,t){var n;for(n=e.nextSibling;n&&n!=t;n=n.nextSibling)if((3!=n.nodeType||0!==K.trim(n.data).length)&&n!==t)return!1;return n===t}function a(e,t,r){var o,a,s;for(s=b.schema.getNonEmptyElements(),o=new n(r||e,e);a=o[t?"next":"prev"]();){if(s[a.nodeName]&&!i(a))return a;if(3==a.nodeType&&a.data.length>0)return a}}function c(e){var n,r,i,o,s;if(!e.collapsed&&(n=b.getParent(t.getNode(e.startContainer,e.startOffset),b.isBlock),r=b.getParent(t.getNode(e.endContainer,e.endOffset),b.isBlock),s=l.schema.getTextBlockElements(),n!=r&&s[n.nodeName]&&s[r.nodeName]&&"false"!==b.getContentEditable(n)&&"false"!==b.getContentEditable(r)))return e.deleteContents(),i=a(n,!1),o=a(r,!0),b.isEmpty(r)||K(n).append(r.childNodes),K(r).remove(),i?1==i.nodeType?"BR"==i.nodeName?(e.setStartBefore(i),e.setEndBefore(i)):(e.setStartAfter(i),e.setEndAfter(i)):(e.setStart(i,i.data.length),e.setEnd(i,i.data.length)):o&&(1==o.nodeType?(e.setStartBefore(o),e.setEndBefore(o)):(e.setStart(o,0),e.setEnd(o,0))),x.setRng(e),!0}function u(e,n){var r,i,s,c,u,d;if(!e.collapsed)return e;if(u=e.startContainer,d=e.startOffset,3==u.nodeType)if(n){if(d0)return e;if(r=t.getNode(e.startContainer,e.startOffset),s=b.getParent(r,b.isBlock),i=a(l.getBody(),n,r),c=b.getParent(i,b.isBlock),!r||!i)return e;if(c&&s!=c)if(n){if(!o(s,c))return e;1==r.nodeType?"BR"==r.nodeName?e.setStartBefore(r):e.setStartAfter(r):e.setStart(r,r.data.length),1==i.nodeType?e.setEnd(i,0):e.setEndBefore(i)}else{if(!o(c,s))return e;1==i.nodeType?"BR"==i.nodeName?e.setStartBefore(i):e.setStartAfter(i):e.setStart(i,i.data.length),1==r.nodeType?e.setEnd(r,0):e.setEndBefore(r)}return e}function m(e){var t=x.getRng();return t=u(t,e),c(t)?!0:void 0}function g(e,t){function n(e,n){return m=K(n).parents().filter(function(e,t){return!!l.schema.getTextInlineElements()[t.nodeName]}),c=e.cloneNode(!1),m=s.map(m,function(e){return e=e.cloneNode(!1),c.hasChildNodes()?(e.appendChild(c.firstChild),c.appendChild(e)):c.appendChild(e),c.appendChild(e),e}),m.length?(p=b.create("br"),m[0].appendChild(p),b.replace(c,e),t.setStartBefore(p),t.setEndBefore(p),l.selection.setRng(t),p):null}function i(e){return e&&l.schema.getTextBlockElements()[e.tagName]}var o,a,c,u,d,f,h,p,m;if(t.collapsed&&(f=t.startContainer,h=t.startOffset,a=b.getParent(f,b.isBlock),i(a)))if(1==f.nodeType){if(f=f.childNodes[h],f&&"BR"!=f.tagName)return;if(d=e?a.nextSibling:a.previousSibling,b.isEmpty(a)&&i(d)&&b.isEmpty(d)&&n(a,f))return b.remove(d),!0}else if(3==f.nodeType){if(o=r.create(a,f),u=a.cloneNode(!0),f=r.resolve(u,o),e){if(h>=f.data.length)return;f.deleteData(h,1)}else{if(0>=h)return;f.deleteData(h-1,1)}if(b.isEmpty(u))return n(a,f)}}function v(e){var t,n,r;m(e)||(s.each(l.getBody().getElementsByTagName("*"),function(e){"SPAN"==e.tagName&&e.setAttribute("mce-data-marked",1),!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")&&l.dom.setAttrib(e,"style",l.dom.getAttrib(e,"style"))}),t=new C(function(){}),t.observe(l.getDoc(),{childList:!0,attributes:!0,subtree:!0,attributeFilter:["style"]}),l.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),n=l.selection.getRng(),r=n.startContainer.parentNode,s.each(t.takeRecords(),function(e){if(b.isChildOf(e.target,l.getBody())){ +if("style"==e.attributeName){var t=e.target.getAttribute("data-mce-style");t?e.target.setAttribute("style",t):e.target.removeAttribute("style")}s.each(e.addedNodes,function(e){if("SPAN"==e.nodeName&&!e.getAttribute("mce-data-marked")){var t,i;e==r&&(t=n.startOffset,i=e.firstChild),b.remove(e,!0),i&&(n.setStart(i,t),n.setEnd(i,t),l.selection.setRng(n))}})}}),t.disconnect(),s.each(l.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")}))}var y=l.getDoc(),b=l.dom,x=l.selection,C=window.MutationObserver,w,_;C||(w=!0,C=function(){function e(e){var t=e.relatedNode||e.target;n.push({target:t,addedNodes:[t]})}function t(e){var t=e.relatedNode||e.target;n.push({target:t,attributeName:e.attrName})}var n=[],r;this.observe=function(n){r=n,r.addEventListener("DOMSubtreeModified",e,!1),r.addEventListener("DOMNodeInsertedIntoDocument",e,!1),r.addEventListener("DOMNodeInserted",e,!1),r.addEventListener("DOMAttrModified",t,!1)},this.disconnect=function(){r.removeEventListener("DOMSubtreeModified",e,!1),r.removeEventListener("DOMNodeInsertedIntoDocument",e,!1),r.removeEventListener("DOMNodeInserted",e,!1),r.removeEventListener("DOMAttrModified",t,!1)},this.takeRecords=function(){return n}}),l.on("keydown",function(e){var t=e.keyCode==G,n=e.ctrlKey||e.metaKey;if(!d(e)&&(t||e.keyCode==Y)){var r=l.selection.getRng(),i=r.startContainer,o=r.startOffset;if(t&&e.shiftKey)return;if(g(t,r))return void e.preventDefault();if(!n&&r.collapsed&&3==i.nodeType&&(t?o0))return;e.preventDefault(),n&&l.selection.getSel().modify("extend",t?"forward":"backward",e.metaKey?"lineboundary":"word"),v(t)}}),l.on("keypress",function(t){if(!d(t)&&!x.isCollapsed()&&t.charCode>31&&!e.metaKeyPressed(t)){var n,r,i,o,a,s;n=l.selection.getRng(),s=String.fromCharCode(t.charCode),t.preventDefault(),r=K(n.startContainer).parents().filter(function(e,t){return!!l.schema.getTextInlineElements()[t.nodeName]}),v(!0),r=r.filter(function(e,t){return!K.contains(l.getBody(),t)}),r.length?(i=b.createFragment(),r.each(function(e,t){t=t.cloneNode(!1),i.hasChildNodes()?(t.appendChild(i.firstChild),i.appendChild(t)):(a=t,i.appendChild(t)),i.appendChild(t)}),a.appendChild(l.getDoc().createTextNode(s)),o=b.getParent(n.startContainer,b.isBlock),b.isEmpty(o)?K(o).empty().append(i):n.insertNode(i),n.setStart(a.firstChild,1),n.setEnd(a.firstChild,1),l.selection.setRng(n)):l.selection.setContent(s)}}),l.addCommand("Delete",function(){v()}),l.addCommand("ForwardDelete",function(){v(!0)}),w||(l.on("dragstart",function(e){_=x.getRng(),f(e)}),l.on("drop",function(e){if(!d(e)){var n=h(e);n&&(e.preventDefault(),window.setTimeout(function(){var r=t.getCaretRangeFromPoint(e.x,e.y,y);_&&(x.setRng(_),_=null),v(),x.setRng(r),p(n.html)},0))}}),l.on("cut",function(e){d(e)||!e.clipboardData||l.selection.isCollapsed()||(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/html",l.selection.getContent()),e.clipboardData.setData("text/plain",l.selection.getContent({format:"text"})),window.setTimeout(function(){v(!0)},0))}))}function g(){function e(e){var t=X.create("body"),n=e.cloneContents();return t.appendChild(n),J.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item)return!1;var r=n.duplicate();return r.moveToElementText(l.getBody()),t.compareRanges(n,r)}var i=e(n),o=X.createRng();o.selectNode(l.getBody());var a=e(o);return i===a}l.on("keydown",function(e){var t=e.keyCode,r,i;if(!d(e)&&(t==G||t==Y)){if(r=l.selection.isCollapsed(),i=l.getBody(),r&&!X.isEmpty(i))return;if(!r&&!n(l.selection.getRng()))return;e.preventDefault(),l.setContent(""),i.firstChild&&X.isBlock(i.firstChild)?l.selection.setCursorLocation(i.firstChild,0):l.selection.setCursorLocation(i,0),l.nodeChanged()}})}function v(){l.shortcuts.add("meta+a",null,"SelectAll")}function y(){l.settings.content_editable||(X.bind(l.getDoc(),"focusin",function(){J.setRng(J.getRng())}),X.bind(l.getDoc(),"mousedown mouseup",function(e){e.target==l.getDoc().documentElement&&(l.getBody().focus(),"mousedown"==e.type?J.placeCaretAt(e.clientX,e.clientY):J.setRng(J.getRng()))}))}function b(){l.on("keydown",function(e){if(!d(e)&&e.keyCode===Y){if(!l.getBody().getElementsByTagName("hr").length)return;if(J.isCollapsed()&&0===J.getRng(!0).startOffset){var t=J.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return X.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(X.remove(n),e.preventDefault())}}})}function x(){window.Range.prototype.getClientRects||l.on("mousedown",function(e){if(!d(e)&&"HTML"===e.target.nodeName){var t=l.getBody();t.blur(),setTimeout(function(){t.focus()},0)}})}function C(){l.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&(e.preventDefault(),J.getSel().setBaseAndExtent(t,0,t,1),l.nodeChanged()),"A"==t.nodeName&&X.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),J.select(t))})}function w(){function e(){var e=X.getAttribs(J.getStart().cloneNode(!1));return function(){var t=J.getStart();t!==l.getBody()&&(X.setAttrib(t,"style",null),j(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!J.isCollapsed()&&X.getParent(J.getStart(),X.isBlock)!=X.getParent(J.getEnd(),X.isBlock)}l.on("keypress",function(n){var r;return d(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),l.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),X.bind(l.getDoc(),"cut",function(n){var r;!d(n)&&t()&&(r=e(),setTimeout(function(){r()},0))})}function _(){document.body.setAttribute("role","application")}function E(){l.on("keydown",function(e){if(!d(e)&&e.keyCode===Y&&J.isCollapsed()&&0===J.getRng(!0).startOffset){var t=J.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function N(){u()>7||(c("RespectVisibilityInDesign",!0),l.contentStyles.push(".mceHideBrInPre pre br {display: none}"),X.addClass(l.getBody(),"mceHideBrInPre"),Z.addNodeFilter("pre",function(e){for(var t=e.length,n,r,o,a;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)o=n[r],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new i("#text",3),o,!0).value="\n"}),ee.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function S(){X.bind(l.getBody(),"mouseup",function(){var e,t=J.getNode();"IMG"==t.nodeName&&((e=X.getStyle(t,"width"))&&(X.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),X.setStyle(t,"width","")),(e=X.getStyle(t,"height"))&&(X.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),X.setStyle(t,"height","")))})}function k(){l.on("keydown",function(t){var n,r,i,o,a;if(!d(t)&&t.keyCode==e.BACKSPACE&&(n=J.getRng(),r=n.startContainer,i=n.startOffset,o=X.getRoot(),a=r,n.collapsed&&0===i)){for(;a&&a.parentNode&&a.parentNode.firstChild==a&&a.parentNode!=o;)a=a.parentNode;"BLOCKQUOTE"===a.tagName&&(l.formatter.toggle("blockquote",null,a),n=X.createRng(),n.setStart(r,0),n.setEnd(r,0),J.setRng(n))}})}function T(){function e(){l._refreshContentEditable(),c("StyleWithCSS",!1),c("enableInlineTableEditing",!1),Q.object_resizing||c("enableObjectResizing",!1)}Q.readonly||l.on("BeforeExecCommand MouseDown",e)}function R(){function e(){j(X.select("a"),function(e){var t=e.parentNode,n=X.getRoot();if(t.lastChild===e){for(;t&&!X.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}X.add(t,"br",{"data-mce-bogus":1})}})}l.on("SetContent ExecCommand",function(t){("setcontent"==t.type||"mceInsertLink"===t.command)&&e()})}function A(){Q.forced_root_block&&l.on("init",function(){c("DefaultParagraphSeparator",Q.forced_root_block)})}function B(){l.on("Undo Redo SetContent",function(e){e.initial||l.execCommand("mceRepaint")})}function D(){l.on("keydown",function(e){var t;d(e)||e.keyCode!=Y||(t=l.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),l.undoManager.beforeChange(),X.remove(t.item(0)),l.undoManager.add()))})}function L(){var e;u()>=10&&(e="",j("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),l.contentStyles.push(e+"{padding-right: 1px !important}"))}function M(){u()<9&&(Z.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),ee.addNodeFilter("noscript",function(e){for(var t=e.length,n,r,a;t--;)n=e[t],r=e[t].firstChild,r?r.value=o.decode(r.value):(a=n.attributes.map["data-mce-innertext"],a&&(n.attr("data-mce-innertext",null),r=new i("#text",3),r.value=a,r.raw=!0,n.append(r)))}))}function H(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),X.unbind(r,"mouseup",n),X.unbind(r,"mousemove",t),a=o=0}var r=X.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,X.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(X.bind(r,"mouseup",n),X.bind(r,"mousemove",t),X.getRoot().focus(),a.select())}})}function P(){l.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||J.normalize()},!0)}function O(){l.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function I(){l.inline||l.on("keydown",function(){document.activeElement==document.body&&l.getWin().focus()})}function F(){l.inline||(l.contentStyles.push("body {min-height: 150px}"),l.on("click",function(e){var t;if("HTML"==e.target.nodeName){if(a.ie>11)return void l.getBody().focus();t=l.selection.getRng(),l.getBody().focus(),l.selection.setRng(t),l.selection.normalize(),l.nodeChanged()}}))}function z(){a.mac&&l.on("keydown",function(t){!e.metaKeyPressed(t)||t.shiftKey||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),l.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","lineboundary"))})}function W(){c("AutoUrlDetect",!1)}function V(){l.on("click",function(e){var t=e.target;do if("A"===t.tagName)return void e.preventDefault();while(t=t.parentNode)}),l.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function U(){l.on("init",function(){l.dom.bind(l.getBody(),"submit",function(e){e.preventDefault()})})}function $(){Z.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"==e[t].attr("class")&&e[t].remove()})}function q(){l.on("dragstart",function(e){f(e)}),l.on("drop",function(e){if(!d(e)){var n=h(e);if(n&&n.id!=l.id){e.preventDefault();var r=t.getCaretRangeFromPoint(e.x,e.y,l.getDoc());J.setRng(r),p(n.html)}}})}var j=s.each,K=l.$,Y=e.BACKSPACE,G=e.DELETE,X=l.dom,J=l.selection,Q=l.settings,Z=l.parser,ee=l.serializer,te=a.gecko,ne=a.ie,re=a.webkit,ie="data:text/mce-internal,",oe=ne?"Text":"URL";k(),g(),P(),re&&(m(),y(),C(),A(),U(),E(),$(),a.iOS?(I(),F(),V()):v()),ne&&a.ie<11&&(b(),_(),N(),S(),D(),L(),M(),H()),a.ie>=11&&(F(),E()),a.ie&&(v(),W(),q()),te&&(b(),x(),w(),T(),R(),B(),O(),z(),E())}}),r(ge,[K,b,f],function(e,t,n){function r(e,t){return"selectionchange"==t?e.getDoc():!e.inline&&/^mouse|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=o.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()}function i(e,t){var n=r(e,t),i;if(e.delegates||(e.delegates={}),!e.delegates[t])if(e.settings.event_root){if(a||(a={},e.editorManager.on("removeEditor",function(){var t;if(!e.editorManager.activeEditor&&a){for(t in a)e.dom.unbind(r(e,t));a=null}})),a[t])return;i=function(n){for(var r=n.target,i=e.editorManager.editors,a=i.length;a--;){var s=i[a].getBody();(s===r||o.isChildOf(r,s))&&(i[a].hidden||i[a].fire(t,n))}},a[t]=i,o.bind(n,t,i)}else i=function(n){e.hidden||e.fire(t,n)},o.bind(n,t,i),e.delegates[t]=i}var o=t.DOM,a,s={bindPendingEventDelegates:function(){var e=this;n.each(e._pendingNativeEvents,function(t){i(e,t)})},toggleNativeEvent:function(e,t){var n=this;n.settings.readonly||"focus"!=e&&"blur"!=e&&(t?n.initialized?i(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(r(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e=this,t;if(e.delegates){for(t in e.delegates)e.dom.unbind(r(e,t),t,e.delegates[t]);delete e.delegates}e.inline||(e.getBody().onload=null,e.dom.unbind(e.getWin()),e.dom.unbind(e.getDoc())),e.dom.unbind(e.getBody()),e.dom.unbind(e.getContainer())}};return s=n.extend({},e,s)}),r(ve,[f,u],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122},o=e.makeMap("alt,ctrl,shift,meta,access");return function(a){function s(e,s,l,c){var u,d,f;f={func:l,scope:c||a,desc:a.translate(s)},n(r(e,"+"),function(e){e in o?f[e]=!0:/^[0-9]{2,}$/.test(e)?f.keyCode=parseInt(e,10):(f.charCode=e.charCodeAt(0),f.keyCode=i[e]||e.toUpperCase().charCodeAt(0))}),u=[f.keyCode];for(d in o)f[d]?u.push(d):f[d]=!1;return f.id=u.join(","),f.access&&(f.alt=!0,t.mac?f.ctrl=!0:f.shift=!0),f.meta&&(t.mac?f.meta=!0:(f.ctrl=!0,f.meta=!1)),f}var l=this,c={};a.on("keyup keypress keydown",function(e){(e.altKey||e.ctrlKey||e.metaKey)&&!e.isDefaultPrevented()&&n(c,function(t){return t.ctrl==e.ctrlKey&&t.meta==e.metaKey&&t.alt==e.altKey&&t.shift==e.shiftKey&&(e.keyCode==t.keyCode||e.charCode&&e.charCode==t.charCode)?(e.preventDefault(),"keydown"==e.type&&t.func.call(t.scope),!0):void 0})}),l.add=function(t,i,o,l){var u;return u=o,"string"==typeof o?o=function(){a.execCommand(u,!1,null)}:e.isArray(u)&&(o=function(){a.execCommand(u[0],u[1],u[2])}),n(r(t.toLowerCase()),function(e){var t=s(e,i,o,l);c[t.id]=t}),!0},l.remove=function(e){var t=s(e);return c[t.id]?(delete c[t.id],!0):!1}}}),r(ye,[],function(){function e(e,t){return function(){e.apply(t,arguments)}}function t(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(t,e(r,this),e(i,this))}function n(e){var t=this;return null===this._state?void this._deferreds.push(e):void l(function(){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return void(t._state?e.resolve:e.reject)(t._value);var r;try{r=n(t._value)}catch(i){return void e.reject(i)}e.resolve(r)})}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void s(e(n,t),e(r,this),e(i,this))}this._state=!0,this._value=t,o.call(this)}catch(a){i.call(this,a)}}function i(e){this._state=!1,this._value=e,o.call(this)}function o(){for(var e=0,t=this._deferreds.length;t>e;e++)n.call(this,this._deferreds[e]);this._deferreds=null}function a(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function s(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(i){if(r)return;r=!0,n(i)}}if(window.Promise)return window.Promise;var l=t.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)},c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return t.prototype["catch"]=function(e){return this.then(null,e)},t.prototype.then=function(e,r){var i=this;return new t(function(t,o){n.call(i,new a(e,r,t,o))})},t.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&c(arguments[0])?arguments[0]:arguments);return new t(function(t,n){function r(o,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){r(o,e)},n)}e[o]=a,0===--i&&t(e)}catch(l){n(l)}}if(0===e.length)return t([]);for(var i=e.length,o=0;or;r++)e[r].then(t,n)})},t}),r(be,[],function(){function e(e){return function(){return e}}return{constant:e}}),r(xe,[ye,f,be],function(e,t,n){return function(r){function i(e){var t,n;return n={"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"},t=n[e.blob().type.toLowerCase()]||"dat",e.id()+"."+t}function o(e,t){return e?e.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t}function a(e){return{id:e.id,blob:e.blob,base64:e.base64,filename:n.constant(i(e))}}function s(e,t,n){var a,s;a=new XMLHttpRequest,a.open("POST",r.url),a.withCredentials=r.credentials,a.onload=function(){var e;return 200!=a.status?void n("HTTP Error: "+a.status):(e=JSON.parse(a.responseText),e&&"string"==typeof e.location?void t(o(r.basePath,e.location)):void n("Invalid JSON: "+a.responseText))},s=new FormData,s.append("file",e.blob(),i(e)),a.send(s)}function l(n){function i(t){return new e(function(e){var n=r.handler;n(a(t),function(n){e({url:n,blobInfo:t,status:!0})},function(n){e({url:"",blobInfo:t,status:!1,error:n})})})}var o;return r.url||r.handler!==s?(o=t.map(n,function(e){var t,n=e.id();return c[n]?c[n]:(t=i(e).then(function(e){return delete c[n],e})["catch"](function(e){return delete c[n],e}),c[n]=t,t)}),e.all(o)):new e(function(e){e([])})}var c={};return r=t.extend({credentials:!1,handler:s},r),{upload:l}}}),r(Ce,[ye],function(e){function t(t){return new e(function(e){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="blob",n.onload=function(){200==this.status&&e(this.response)},n.send()})}function n(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}}function r(t){return new e(function(e){var r,i,o;t=n(t);try{r=atob(t.data)}catch(a){return void e(new Blob([]))}for(i=new Uint8Array(r.length),o=0;o",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o,ie7_compat:!0},t),r.language=t.language||"en",r.languageLoad=t.language_load,r.baseURL=i.baseURL,o.id=t.id=e,o.isNotDirty=!0,o.plugins={},o.documentBaseURI=new p(t.document_base_url||a,{base_uri:s}),o.baseURI=s,o.contentCSS=[],o.contentStyles=[],o.shortcuts=new E(o),o.loadedCSS={},o.editorCommands=new h(o),t.target&&(o.targetElm=t.target),o.suffix=i.suffix,o.editorManager=i,o.inline=t.inline,t.cache_suffix&&(C.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),t.override_viewport===!1&&(C.overrideViewPort=!1),i.fire("SetupEditor",o),o.execCallback("setup",o),o.$=n.overrideDefaults(function(){return{context:o.inline?o.getBody():o.getDoc(),element:o.getBody()}})}var k=e.DOM,T=r.ThemeManager,R=r.PluginManager,A=w.extend,B=w.each,D=w.explode,L=w.inArray,M=w.trim,H=w.resolve,P=g.Event,O=C.gecko,I=C.ie;return S.prototype={render:function(){function e(){k.unbind(window,"ready",e),n.render()}function t(){var e=m.ScriptLoader;if(r.language&&"en"!=r.language&&!r.language_url&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!T.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",T.load(r.theme,t)}w.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),B(r.external_plugins,function(e,t){R.load(t,e),r.plugins+=" "+t}),B(r.plugins.split(/[ ,]/),function(e){if(e=M(e),e&&!R.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=R.dependencies(e);B(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=R.createUrl(t,e),R.load(e.resource,e)})}else R.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!P.domLoaded)return void k.bind(window,"ready",e);if(n.getElement()&&C.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||k.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(k.insertAfter(k.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},k.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.isNotDirty=!0,a._mceOldSubmit(a)})),n.windowManager=new v(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=k.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),t()}},init:function(){function e(n){var r=R.get(n),i,o;i=R.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=M(n),r&&-1===L(m,n)&&(B(R.dependencies(n),function(t){e(t)}),o=new r(t,i,t.$),t.plugins[n]=o,o.init&&(o.init(t,i),m.push(n)))}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,h,p,m=[];if(this.editorManager.i18n.setCode(n.language),t.rtl=n.rtl_ui||this.editorManager.i18n.rtl,t.editorManager.add(t),n.aria_label=n.aria_label||k.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),c=T.get(n.theme),t.theme=new c(t,T.urls[n.theme]),t.theme.init&&t.theme.init(t,T.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""),t.$)):t.theme=n.theme),B(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,h=/^[0-9\.]+(|px)$/i,h.test(""+i)&&(i=Math.max(parseInt(i,10),100)),h.test(""+o)&&(o=Math.max(parseInt(o,10),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&B(D(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();for(t.iframeHTML=n.doctype+"",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+=''),!C.caretAfter&&n.ie7_compat&&(t.iframeHTML+=''),t.iframeHTML+='',p=0;p',t.loadedCSS[g]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),f=n.body_class||"",-1!=f.indexOf("=")&&(f=t.getParam("body_class","","hash"),f=f[t.id]||""),n.content_security_policy&&(t.iframeHTML+=''),t.iframeHTML+='
    ';var v='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';document.domain!=location.hostname&&C.ie&&C.ie<12&&(u=v);var y=k.create("iframe",{id:t.id+"_ifr",frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}});if(y.onload=function(){y.onload=null,t.fire("load")},k.setAttrib(y,"src",u||'javascript:""'),t.contentAreaContainer=l.iframeContainer,t.iframeElement=y,s=k.add(l.iframeContainer,y),I)try{t.getDoc()}catch(b){s.src=u=v}l.editorContainer&&(k.get(l.editorContainer).style.display=t.orgDisplay,t.hidden=k.isHidden(l.editorContainer)),t.getElement().style.display="none",k.setAttrib(t.id,"aria-hidden",!0),u||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,r=n.settings,s=n.getElement(),h=n.getDoc(),p,m;r.inline||(n.getElement().style.visibility=n.orgVisibility),t||r.content_editable||(h.open(),h.write(n.iframeHTML),h.close()),r.content_editable&&(n.on("remove",function(){var e=this.getBody();k.removeClass(e,"mce-content-body"),k.removeClass(e,"mce-edit-focus"),k.setAttrib(e,"contentEditable",null)}),k.addClass(s,"mce-content-body"),n.contentDocument=h=r.content_document||document,n.contentWindow=r.content_window||window,n.bodyElement=s,r.content_document=r.content_window=null,r.root_name=s.nodeName.toLowerCase()),p=n.getBody(),p.disabled=!0,r.readonly||(n.inline&&"static"==k.getStyle(p,"position",!0)&&(p.style.position="relative"),p.contentEditable=n.getParam("content_editable_state",!0)),p.disabled=!1,n.editorUpload=new N(n),n.schema=new y(r),n.dom=new e(h,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:r.force_hex_style_colors,class_filter:r.class_filter,update_styles:!0,root_element:n.inline?n.getBody():null,collect:r.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new b(r,n.schema),n.parser.addAttributeFilter("src,href,style,tabindex",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)if(i=e[r],a=i.attr(t),s="data-mce-"+t,!i.attributes.map[s]){if(0===a.indexOf("data:")||0===a.indexOf("blob:"))continue;"style"===t?(a=o.serializeStyle(o.parseStyle(a),i.name),a.length||(a=null),i.attr(s,a),i.attr(t,a)):"tabindex"===t?(i.attr(s,a),i.attr(t,null)):i.attr(s,n.convertURL(a,t,i.name))}}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("type")||"no/type",0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,r,i=n.schema.getNonEmptyElements();t--;)r=e[t],r.isEmpty(i)&&(r.append(new o("br",1)).shortEnded=!0)}),n.serializer=new a(r,n),n.selection=new l(n.dom,n.getWin(),n.serializer,n),n.formatter=new c(n),n.undoManager=new u(n),n.forceBlocks=new f(n),n.enterKey=new d(n),n._nodeChangeDispatcher=new i(n),n.fire("PreInit"),r.browser_spellcheck||r.gecko_spellcheck||(h.body.spellcheck=!1,k.setAttrib(p,"spellcheck","false")),n.fire("PostRender"),n.quirks=new x(n),r.directionality&&(p.dir=r.directionality),r.nowrap&&(p.style.whiteSpace="nowrap"),r.protect&&n.on("BeforeSetContent",function(e){ +B(r.protect,function(t){e.content=e.content.replace(t,function(e){return""})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),r.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
    [\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,n.bindPendingEventDelegates(),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.contentStyles.length>0&&(m="",B(n.contentStyles,function(e){m+=e+"\r\n"}),n.dom.addStyle(m)),B(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),r.auto_focus&&setTimeout(function(){var e;e=r.auto_focus===!0?n:n.editorManager.get(r.auto_focus),e.destroyed||e.focus()},100),s=h=p=null},focus:function(e){var t=this,n=t.selection,r=t.settings.content_editable,i,o,a=t.getDoc(),s;if(!e){if(i=n.getRng(),i.item&&(o=i.item(0)),t._refreshContentEditable(),r||(C.opera||t.getBody().focus(),t.getWin().focus()),O||r){if(s=t.getBody(),s.setActive)try{s.setActive()}catch(l){s.focus()}else s.focus();r&&n.normalize()}o&&o.ownerDocument==a&&(i=a.body.createControlRange(),i.addElement(o),i.select())}t.editorManager.setActive(t)},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?H(r):0,n=H(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?B(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(e){e=e.split("="),e.length>1?i[M(e[0])]=M(e[1]):i[M(e[0])]=M(e)}):i=r,i):r},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addContextToolbar:function(e,t){var n=this,r;n.contextToolbars=n.contextToolbars||[],"string"==typeof e&&(r=e,e=function(e){return n.dom.is(e,r)}),n.contextToolbars.push({predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){var e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable=!0:(k.show(e.getContainer()),k.hide(e.id)),e.load(),e.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(I&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e==e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(k.hide(e.getContainer()),k.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),"raw"==e.format&&t.fire("RawSaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(t.inline||(n.innerHTML=r),(i=k.getParent(t.id,"form"))&&B(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&(t.isNotDirty=!0),r},setContent:function(e,t){var n=this,r=n.getBody(),i,o;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(o=I&&11>I?"":'
    ',"TABLE"==r.nodeName?e=""+o+"":/^(UL|OL)$/.test(r.nodeName)&&(e="
  • "+o+"
  • "),i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=o,e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):I||e||(e='
    '),n.dom.setHTML(r,e),n.fire("SetContent",t)):("raw"!==t.format&&(e=new s({validate:n.validate},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=M(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?r.innerHTML:"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),"text"!=e.format?e.content=M(n):e.content=n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e,t){t&&(e=A({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},getContainer:function(){var e=this;return e.container||(e.container=k.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=k.get(this.id)),this.targetElm},getWin:function(){var e=this,t;return e.contentWindow||(t=e.iframeElement,t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),B(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||!n.hasVisual?i.removeClass(e,o):i.addClass(e,o));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o=r.visual_anchor_class||"mce-item-anchor",t&&n.hasVisual?i.addClass(e,o):i.removeClass(e,o)))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;e.removed||(e.save(),e.removed=1,e.unbindAllNativeEvents(),e.hasHiddenInput&&k.remove(e.getElement().nextSibling),e.inline||(I&&10>I&&e.getDoc().execCommand("SelectAll",!1,null),k.setStyle(e.id,"display",e.orgDisplay),e.getBody().onload=null),e.fire("remove"),e.editorManager.remove(e),k.remove(e.getContainer()),e.editorUpload.destroy(),e.destroy())},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),k.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()},_refreshContentEditable:function(){var e=this,t,n;e._isHidden()&&(t=e.getBody(),n=t.parentNode,n.removeChild(t),n.appendChild(t),t.focus())},_isHidden:function(){var e;return O?(e=this.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}},A(S.prototype,_),S}),r(Se,[],function(){var e={},t="en";return{setCode:function(e){e&&(t=e,this.rtl=this.data[e]?"rtl"===this.data[e]._dir:!1)},getCode:function(){return t},rtl:!1,add:function(t,n){var r=e[t];r||(e[t]=r={});for(var i in n)r[i]=n[i];this.setCode(t)},translate:function(n){var r;if(r=e[t],r||(r={}),"undefined"==typeof n)return n;if("string"!=typeof n&&n.raw)return n.raw;if(n.push){var i=n.slice(1);n=(r[n[0]]||n[0]).replace(/\{([0-9]+)\}/g,function(e,t){return i[t]})}return(r[n]||n).replace(/{context:\w+}$/,"")},data:e}}),r(ke,[b,u],function(e,t){function n(e){function s(){try{return document.activeElement}catch(e){return document.body}}function l(e,t){if(t&&t.startContainer){if(!e.isChildOf(t.startContainer,e.getRoot())||!e.isChildOf(t.endContainer,e.getRoot()))return;return{startContainer:t.startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset}}return t}function c(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function u(e){return!!a.getParent(e,n.isEditorUIElement)}function d(n){var d=n.editor;d.on("init",function(){(d.inline||t.ie)&&("onbeforedeactivate"in document&&t.ie<9?d.dom.bind(d.getBody(),"beforedeactivate",function(e){if(e.target==d.getBody())try{d.lastRng=d.selection.getRng()}catch(t){}}):d.on("nodechange mouseup keyup",function(e){var t=s();"nodechange"==e.type&&e.selectionChange||(t&&t.id==d.id+"_ifr"&&(t=d.getBody()),d.dom.isChildOf(t,d.getBody())&&(d.lastRng=d.selection.getRng()))}),t.webkit&&!r&&(r=function(){var t=e.activeEditor;if(t&&t.selection){var n=t.selection.getRng();n&&!n.collapsed&&(d.lastRng=n)}},a.bind(document,"selectionchange",r)))}),d.on("setcontent",function(){d.lastRng=null}),d.on("mousedown",function(){d.selection.lastFocusBookmark=null}),d.on("focusin",function(){var t=e.focusedEditor;d.selection.lastFocusBookmark&&(d.selection.setRng(c(d,d.selection.lastFocusBookmark)),d.selection.lastFocusBookmark=null),t!=d&&(t&&t.fire("blur",{focusedEditor:d}),e.setActive(d),e.focusedEditor=d,d.fire("focus",{blurredEditor:t}),d.focus(!0)),d.lastRng=null}),d.on("focusout",function(){window.setTimeout(function(){var t=e.focusedEditor;u(s())||t!=d||(d.fire("blur",{focusedEditor:null}),e.focusedEditor=null,d.selection&&(d.selection.lastFocusBookmark=null))},0)}),i||(i=function(t){var n=e.activeEditor;n&&t.target.ownerDocument==document&&(n.selection&&t.target!=n.getBody()&&(n.selection.lastFocusBookmark=l(n.dom,n.lastRng)),t.target==document.body||u(t.target)||e.focusedEditor!=n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},a.bind(document,"focusin",i)),d.inline&&!o&&(o=function(t){var n=e.activeEditor;if(n.inline&&!n.dom.isChildOf(t.target,n.getBody())){var r=n.selection.getRng();r.collapsed||(n.lastRng=r)}},a.bind(document,"mouseup",o))}function f(t){e.focusedEditor==t.editor&&(e.focusedEditor=null),e.activeEditor||(a.unbind(document,"selectionchange",r),a.unbind(document,"focusin",i),a.unbind(document,"mouseup",o),r=i=o=null)}e.on("AddEditor",d),e.on("RemoveEditor",f)}var r,i,o,a=e.DOM;return n.isEditorUIElement=function(e){return-1!==e.className.toString().indexOf("mce-")},n}),r(Te,[Ne,h,b,U,u,f,K,Se,ke],function(e,t,n,r,i,o,a,s,l){function c(e){m(b.editors,function(t){t.fire("ResizeWindow",e)})}function u(e,n){n!==x&&(n?t(window).on("resize",c):t(window).off("resize",c),x=n)}function d(e){var t=b.editors,n;delete t[e.id];for(var r=0;r0&&m(p(e),function(e){var n;(n=h.get(e))?r(e,t,n):m(document.forms,function(n){m(n.elements,function(n){n.name===e&&(e="mce_editor_"+v++,h.setAttrib(n,"id",e),r(e,t,n))})})});break;case"textareas":case"specific_textareas":m(h.select("textarea"),function(e){t.editor_deselector&&o(e,t.editor_deselector)||(!t.editor_selector||o(e,t.editor_selector))&&r(n(e),t,e)})}t.oninit&&(e=s=0,m(l,function(t){s++,t.initialized?e++:t.on("init",function(){e++,e==s&&i("oninit")}),e==s&&i("oninit")}))}var s=this,l=[];s.settings=t,h.bind(window,"ready",a)},get:function(e){return arguments.length?e in this.editors?this.editors[e]:null:this.editors},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),u(n,!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),y||(y=function(){t.fire("BeforeUnload")},h.bind(window,"beforeunload",y)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i;{if(e)return"string"==typeof e?(e=e.selector||e,void m(h.select(e),function(e){i=r[e.id],i&&t.remove(i)})):(i=e,r[i.id]?(d(i)&&t.fire("RemoveEditor",{editor:i}),r.length||h.unbind(window,"beforeunload",y),i.remove(),u(r,r.length>0),i):null);for(n=r.length-1;n>=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){m(this.editors,function(e){e.save()})},addI18n:function(e,t){s.add(e,t)},translate:function(e){return s.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!=e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},g(b,a),b.setup(),window.tinymce=window.tinyMCE=b,b}),r(Re,[Te,f],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(n,r){"html4"===t.settings.schema&&e(r,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(Ae,[K,f],function(e,t){var n={send:function(e){function r(){!e.async||4==i.readyState||o++>1e4?(e.success&&1e4>o&&200==i.status?e.success.call(e.success_scope,""+i.responseText,i,e):e.error&&e.error.call(e.error_scope,o>1e4?"TIMED_OUT":"GENERAL",i,e),i=null):setTimeout(r,10)}var i,o=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async===!1?!1:!0,e.data=e.data||"",i=new XMLHttpRequest){if(i.overrideMimeType&&i.overrideMimeType(e.content_type),i.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(i.withCredentials=!0),e.content_type&&i.setRequestHeader("content-Type",e.content_type),e.requestheaders&&t.each(e.requestheaders,function(e){i.setRequestHeader(e.key,e.value)}),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i=n.fire("beforeSend",{xhr:i,settings:e}).xhr,i.send(e.data),!e.async)return r();setTimeout(r,10)}}};return t.extend(n,e),n}),r(Be,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(De,[Be,Ae,f],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(Le,[b],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(Me,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(He,[b,l,x,C,f,u],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(Pe,[$,f],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t=this,n=t.settings,r,i,o,a;r=n.firstControlClass,i=n.lastControlClass,e.each(function(e){e.classes.remove(r).remove(i).add(n.controlClass),e.visible()&&(o||(o=e),a=e)}),o&&o.classes.add(r),a&&a.classes.add(i)},renderHtml:function(e){var t=this,n="";return t.applyClasses(e.items()),e.items().each(function(e){n+=e.renderHtml()}),n},recalc:function(){},postRender:function(){},isNative:function(){return!1}})}),r(Oe,[Pe],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'
    '+this._super(e)}})}),r(Ie,[te,le],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().lastChild.innerHTML=e.encode(t.value)}),e._super()},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(Fe,[te,Ie],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&(t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.classes.toggle("tooltip-n","bc-tc"==i),r.classes.toggle("tooltip-nw","bc-tl"==i),r.classes.toggle("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return n||(n=new t({type:"tooltip"}),n.renderTo()),n},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){function e(e){n.aria("disabled",e),n.classes.toggle("disabled",e)}function t(e){n.aria("pressed",e),n.classes.toggle("active",e)}var n=this;return n.state.on("change:disabled",function(t){e(t.value)}),n.state.on("change:active",function(e){t(e.value)}),n.state.get("disabled")&&e(!0),n.state.get("active")&&t(!0),n._super()},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(ze,[Fe],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t._super(e),e=t.settings,n=t.settings.size,t.on("click mousedown",function(e){e.preventDefault()}),t.on("touchstart",function(e){t.fire("click",e),e.preventDefault()}),e.subtype&&t.classes.add(e.subtype),n&&t.classes.add("btn-"+n),e.icon&&t.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e=this.getEl().firstChild,t;e&&(t=e.style,t.width=t.height="100%"),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("icon"),i,o=e.state.get("text");return i=e.settings.image,i?(r="none","string"!=typeof i&&(i=window.getSelection?i[0]:i[1]),i=" style=\"background-image: url('"+i+"')\""):i="",o&&e.classes.add("btn-has-text"),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'
    "},bindStates:function(){function e(e){for(var n=t.getEl().firstChild.firstChild;n;n=n.nextSibling)3==n.nodeType&&(n.data=t.translate(e));t.classes.toggle("btn-has-text",!!e)}var t=this;return t.state.on("change:text",function(t){e(t.value)}),t.state.on("change:icon",function(n){var r=n.value,i=t.classPrefix;t.settings.icon=r,r=r?i+"ico "+i+"i-"+t.settings.icon:"";var o=t.getEl().firstChild,a=o.getElementsByTagName("i")[0];r?(a&&a==o.firstChild||(a=document.createElement("i"),o.insertBefore(a,o.firstChild)),a.className=r):a&&o.removeChild(a),e(t.state.get("text"))}),t._super()}})}),r(We,[ie],function(e){return e.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(Ve,[Fe],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
    '+e.encode(e.state.get("text"))+"
    "},bindStates:function(){function e(e){t.classes.toggle("checked",e),t.aria("checked",e)}var t=this;return t.state.on("change:text",function(e){t.getEl("al").firstChild.data=t.translate(e.value)}),t.state.on("change:checked change:value",function(n){t.fire("change"),e(n.value)}),t.state.on("change:icon",function(e){var n=e.value,r=t.classPrefix;if("undefined"==typeof n)return t.settings.icon;t.settings.icon=n,n=n?r+"ico "+r+"i-"+t.settings.icon:"";var i=t.getEl().firstChild,o=i.getElementsByTagName("i")[0];n?(o&&o==i.firstChild||(o=document.createElement("i"),i.insertBefore(o,i.firstChild)),o.className=n):o&&i.removeChild(o)}),t.state.get("checked")&&e(!0),t._super()}})}),r(Ue,[Fe,ne,J,h],function(e,t,n,r){return e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.classes.add("combobox"),t.subinput=!0,t.ariaTarget="inp",e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",function(n){var i=n.target,o=t.getEl();if(r.contains(o,i)||i==o)for(;i&&i!=o;)i.id&&-1!=i.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),i=i.parentNode}),t.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&t.parents().reverse().each(function(n){var r=t.state.get("value"),i=t.getEl("inp").value;return e.preventDefault(),t.state.set("value",i),r!=i&&t.fire("change"),n.hasEventListeners("submit")&&n.toJSON?(n.fire("submit",{data:n.toJSON()}),!1):void 0})}),t.on("keyup",function(e){"INPUT"==e.target.nodeName&&t.state.set("value",e.target.value)})},showMenu:function(){var e=this,n=e.settings,r;e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()==e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"==t.target.tagName.toUpperCase()&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,t=e.getEl(),i=e.getEl("open"),o=e.layoutRect(),a,s;a=i?o.w-n.getSize(i).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(s=e.layoutRect().h-2+"px"),r(t.firstChild).css({width:a,lineHeight:s}),e._super(),e},postRender:function(){var e=this;return r(this.getEl("inp")).on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)}),e._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=e.state.get("value")||"",o,a,s="",l="";return"spellcheck"in n&&(l+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(l+=' maxlength="'+n.maxLength+'"'),n.size&&(l+=' size="'+n.size+'"'),n.subtype&&(l+=' type="'+n.subtype+'"'),e.disabled()&&(l+=' disabled="disabled"'),o=n.icon,o&&"caret"!=o&&(o=r+"ico "+r+"i-"+n.icon),a=e.state.get("text"),(o||a)&&(s='
    ",e.classes.add("has-open")),'
    '+s+"
    "},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl("inp").value!=t.value&&(e.getEl("inp").value=t.value)}),e.state.on("change:disabled",function(t){e.getEl("inp").disabled=t.value}),e._super()},remove:function(){r(this.getEl("inp")).off(),this._super()}})}),r($e,[Ue],function(e){return e.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl().getElementsByTagName("i")[0];if(t)try{t.style.background=e}catch(n){}},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e._rendered&&e.repaintColor(t.value)}),e._super()}})}),r(qe,[ze,ue],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.role=r.role||"dialog",r.popover=!0,r.autohide=!0,r.ariaRoot=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}})}),r(je,[qe,b],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null, +this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("text"),i=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"";return'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.aria&&"down"==r.aria.key||r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(Ke,[],function(){function e(e){function i(e,i,o){var a,s,l,c,u,d;return a=0,s=0,l=0,e/=255,i/=255,o/=255,u=t(e,t(i,o)),d=n(e,n(i,o)),u==d?(l=u,{h:0,s:0,v:100*l}):(c=e==u?i-o:o==u?e-i:o-e,a=e==u?3:o==u?1:5,a=60*(a-c/(d-u)),s=(d-u)/d,l=d,{h:r(a),s:r(100*s),v:r(100*l)})}function o(e,i,o){var a,s,l,c;if(e=(parseInt(e,10)||0)%360,i=parseInt(i,10)/100,o=parseInt(o,10)/100,i=n(0,t(i,1)),o=n(0,t(o,1)),0===i)return void(d=f=h=r(255*o));switch(a=e/60,s=o*i,l=s*(1-Math.abs(a%2-1)),c=o-s,Math.floor(a)){case 0:d=s,f=l,h=0;break;case 1:d=l,f=s,h=0;break;case 2:d=0,f=s,h=l;break;case 3:d=0,f=l,h=s;break;case 4:d=l,f=0,h=s;break;case 5:d=s,f=0,h=l;break;default:d=f=h=0}d=r(255*(d+c)),f=r(255*(f+c)),h=r(255*(h+c))}function a(){function e(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+e(d)+e(f)+e(h)}function s(){return{r:d,g:f,b:h}}function l(){return i(d,f,h)}function c(e){var t;return"object"==typeof e?"r"in e?(d=e.r,f=e.g,h=e.b):"v"in e&&o(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(d=parseInt(t[1],10),f=parseInt(t[2],10),h=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(d=parseInt(t[1],16),f=parseInt(t[2],16),h=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(d=parseInt(t[1]+t[1],16),f=parseInt(t[2]+t[2],16),h=parseInt(t[3]+t[3],16)),d=0>d?0:d>255?255:d,f=0>f?0:f>255?255:f,h=0>h?0:h>255?255:h,u}var u=this,d=0,f=0,h=0;e&&c(e),u.toRgb=s,u.toHsv=l,u.toHex=a,u.parse=c}var t=Math.min,n=Math.max,r=Math.round;return e}),r(Ye,[Fe,oe,J,Ke],function(e,t,n,r){return e.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){function e(e,t){var r=n.getPos(e),i,o;return i=t.pageX-r.x,o=t.pageY-r.y,i=Math.max(0,Math.min(i/e.clientWidth,1)),o=Math.max(0,Math.min(o/e.clientHeight,1)),{x:i,y:o}}function i(e,t){var i=(360-e.h)/360;n.css(d,{top:100*i+"%"}),t||n.css(h,{left:e.s+"%",top:100-e.v+"%"}),f.style.background=new r({s:100,v:100,h:e.h}).toHex(),s.color().parse({s:e.s,v:e.v,h:e.h})}function o(t){var n;n=e(f,t),c.s=100*n.x,c.v=100*(1-n.y),i(c),s.fire("change")}function a(t){var n;n=e(u,t),c=l.toHsv(),c.h=360*(1-n.y),i(c,!0),s.fire("change")}var s=this,l=s.color(),c,u,d,f,h;u=s.getEl("h"),d=s.getEl("hp"),f=s.getEl("sv"),h=s.getEl("svp"),s._repaint=function(){c=l.toHsv(),i(c)},s._super(),s._svdraghelper=new t(s._id+"-sv",{start:o,drag:o}),s._hdraghelper=new t(s._id+"-h",{start:a,drag:a}),s._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){var t=this;return arguments.length?(t.color().parse(e),void(t._rendered&&t._repaint())):t.color().toHex()},color:function(){return this._color||(this._color=new r),this._color},renderHtml:function(){function e(){var e,t,n="",i,a;for(i="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",a=o.split(","),e=0,t=a.length-1;t>e;e++)n+='
    ';return n}var t=this,n=t._id,r=t.classPrefix,i,o="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000",a="background: -ms-linear-gradient(top,"+o+");background: linear-gradient(to bottom,"+o+");";return i='
    '+e()+'
    ','
    '+i+"
    "}})}),r(Ge,[Fe],function(e){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.classes.add("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.row()[n],index:n})}),t.row(t.settings.row)},focus:function(){var e=this;return e.getEl().firstChild.focus(),e},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){var e=this;return'
    '+e._getDataPathHtml(e.state.get("row"))+"
    "},bindStates:function(){var e=this;return e.state.on("change:row",function(t){e.innerHtml(e._getDataPathHtml(t.value))}),e._super()},_getDataPathHtml:function(e){var t=this,n=e||[],r,i,o="",a=t.classPrefix;for(r=0,i=n.length;i>r;r++)o+=(r>0?'":"")+'
    '+n[r].name+"
    ";return o||(o='
    \xa0
    '),o}})}),r(Xe,[Ge,Te],function(e,t){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var n=this,r=t.activeEditor;return r.settings.elementpath!==!1&&(n.on("select",function(e){r.focus(),r.selection.select(this.row()[e.index].element),r.nodeChanged()}),r.on("nodeChange",function(t){for(var i=[],o=t.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=r.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});if(s.isDefaultPrevented()||i.push({name:s.name,element:o[a]}),s.isPropagationStopped())break}n.row(i)})),n._super()}})}),r(Je,[ie],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'
    '+(e.settings.title?'
    '+e.settings.title+"
    ":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(Qe,[ie,Je,f],function(e,t,n){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,r=e.items();e.settings.formItemDefaults||(e.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),r.each(function(r){var i,o=r.settings.label;o&&(i=new t(n.extend({items:{type:"label",id:r._id+"-l",text:o,flex:0,forId:r._id,disabled:r.disabled()}},e.settings.formItemDefaults)),i.type="formitem",r.aria("labelledby",r._id+"-l"),"undefined"==typeof r.settings.flex&&(r.settings.flex=1),e.replace(r,i),i.add(r))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.fromJSON(e.settings.data)},bindStates:function(){function e(){var e=0,n=[],r,i,o;if(t.settings.labelGapCalc!==!1)for(o="children"==t.settings.labelGapCalc?t.find("formitem"):t.items(),o.filter("formitem").each(function(t){var r=t.items()[0],i=r.getEl().clientWidth;e=i>e?i:e,n.push(r)}),i=t.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=e+i}var t=this;t._super(),t.on("show",e),e()}})}),r(Ze,[Qe],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'
    '+(e.settings.title?''+e.settings.title+"":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(et,[Ue,f],function(e,t){return e.extend({init:function(e){var n=this,r=tinymce.activeEditor,i=r.settings,o,a,s;e.spellcheck=!1,s=i.file_picker_types||i.file_browser_callback_types,s&&(s=t.makeMap(s,/[, ]/)),(!s||s[e.filetype])&&(a=i.file_picker_callback,!a||s&&!s[e.filetype]?(a=i.file_browser_callback,!a||s&&!s[e.filetype]||(o=function(){a(n.getEl("inp").id,n.value(),e.filetype,window)})):o=function(){var i=n.fire("beforecall").meta;i=t.extend({filetype:e.filetype},i),a.call(r,function(e,t){n.value(e).fire("change",{meta:t})},n.value(),i)}),o&&(e.icon="browse",e.onaction=o),n._super(e)}})}),r(tt,[Oe],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(nt,[Oe],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v=[],y,b,x,C,w,_,E,N,S,k,T,R,A,B,D,L,M,H,P,O,I,F,z=Math.max,W=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e.paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,("row-reversed"==f||"column-reverse"==f)&&(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(S="y",E="h",N="minH",k="maxH",R="innerH",T="top",A="deltaH",B="contentH",P="left",M="w",D="x",L="innerW",H="minW",O="right",I="deltaW",F="contentW"):(S="x",E="w",N="minW",k="maxW",R="innerW",T="left",A="deltaW",B="contentW",P="top",M="h",D="y",L="innerH",H="minH",O="bottom",I="deltaH",F="contentH"),d=i[R]-o[T]-o[T],_=u=0,t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),m=h.settings,g=m.flex,d-=n-1>t?c:0,g>0&&(u+=g,p[k]&&v.push(h),p.flex=g),d-=p[N],y=o[P]+p[H]+o[O],y>_&&(_=y);if(C={},0>d?C[N]=i[N]-d+i[A]:C[N]=i[R]-d+i[A],C[H]=_+i[I],C[B]=i[R]-d,C[F]=_,C.minW=W(C.minW,i.maxW),C.minH=W(C.minH,i.maxH),C.minW=z(C.minW,i.startMinWidth),C.minH=z(C.minH,i.startMinHeight),!i.autoResize||C.minW==i.minW&&C.minH==i.minH){for(x=d/u,t=0,n=v.length;n>t;t++)h=v[t],p=h.layoutRect(),b=p[k],y=p[N]+p.flex*x,y>b?(d-=p[k]-p[N],u-=p.flex,p.flex=0,p.maxFlexSize=b):p.maxFlexSize=0;for(x=d/u,w=o[T],C={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),C[D]=o[P],t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),y=p.maxFlexSize||p[N],"center"===s?C[D]=Math.round(i[L]/2-p[M]/2):"stretch"===s?(C[M]=z(p[H]||0,i[L]-o[P]-o[O]),C[D]=o[P]):"end"===s&&(C[D]=i[L]-p[M]-o.top),p.flex>0&&(y+=p.flex*x),C[E]=y,C[S]=w,h.layoutRect(C),h.recalc&&h.recalc(),w+=y+c}else if(C.w=C.minW,C.h=C.minH,e.layoutRect(C),this.recalc(e),null===e._lastRect){var V=e.parent();V&&(V._lastRect=null,V.recalc())}}})}),r(rt,[Pe],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})},isNative:function(){return!0}})}),r(it,[te,Fe,ue,f,Te,u],function(e,t,n,r,i,o){function a(e){function t(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;s(i.parents,function(e){return s(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function r(e){e=e.replace(/;$/,"").split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function i(){function t(e){var n=[];if(e)return s(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=t(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a,o.cmd=e.cmd}n.push(o)}),n}function n(){var n;return n=t(e.settings.style_formats_merge?e.settings.style_formats?o.concat(e.settings.style_formats):o:e.settings.style_formats||o)}var r=0,i=[],o=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];return e.on("init",function(){s(i,function(t){e.formatter.register(t.name,t)})}),{type:"menu",items:n(),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?e.formatter.getCssText(this.settings.format):void 0},onPostRender:function(){var t=this;t.parent().on("show",function(){var n,r;n=t.settings.format,n&&(t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))),r=t.settings.cmd,r&&t.active(e.queryCommandState(r))})},onclick:function(){this.settings.format&&c(this.settings.format),this.settings.cmd&&e.execCommand(this.settings.cmd)}}}}function o(){var t=this;e.formatter?e.formatter.formatChanged(name,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(name,function(e){t.active(e)})})}function a(t){return function(){function n(){return e.undoManager?e.undoManager[t]():!1}var r=this;t="redo"==t?"hasRedo":"hasUndo",r.disabled(!n()),e.on("Undo Redo AddUndo TypingUndo ClearUndos",function(){r.disabled(!n())})}}function l(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function c(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var u;u=i(),s({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:function(){o()},onclick:function(){c(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:function(){o()}})}),e.addButton("undo",{tooltip:"Undo",onPostRender:a("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:a("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:l,cmd:"mceToggleVisualAid"}),e.addButton("remove",{tooltip:"Remove",icon:"remove",cmd:"Delete"}),s({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:u}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return s(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:c,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",i=[],o=r(e.settings.font_formats||n);return s(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return s(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:u})}var s=r.each;i.on("AddEditor",function(t){t.editor.rtl&&(e.rtl=!0),a(t.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(ot,[Oe],function(e){return e.extend({recalc:function(e){var t=e.settings,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,x,C,w,_,E=[],N=[],S,k,T,R,A,B;t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,x=t.alignH||t.align,C=t.alignV||t.align,g=e.paddingBox,A="reverseRows"in t?t.reverseRows:e.isRtl(),x&&"string"==typeof x&&(x=[x]),C&&"string"==typeof C&&(C=[C]);for(d=0;r>d;d++)E.push(0);for(f=0;n>f;f++)N.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),S=c.minW,k=c.minH,E[d]=S>E[d]?S:E[d],N[f]=k>N[f]?k:N[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=E[d]+(d>0?y:0),T-=(d>0?y:0)+E[d];for(R=o.innerH-g.top-g.bottom,_=0,f=0;n>f;f++)_+=N[f]+(f>0?b:0),R-=(f>0?b:0)+N[f];if(w+=g.left+g.right,_+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=_+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var D;D="start"==t.packV?0:R>0?Math.floor(R/n):0;var L=0,M=t.flexWidths;if(M)for(d=0;dd;d++)E[d]+=M?M[d]*H:H;for(p=g.top,f=0;n>f;f++){for(h=g.left,s=N[f]+D,d=0;r>d&&(B=A?f*r+r-1-d:f*r+d,u=i[B],u);d++)m=u.settings,c=u.layoutRect(),a=Math.max(E[d],c.startMinWidth),c.x=h,c.y=p,v=m.alignH||(x?x[d]||x[0]:null),"center"==v?c.x=h+a/2-c.w/2:"right"==v?c.x=h+a-c.w:"stretch"==v&&(c.w=a),v=m.alignV||(C?C[d]||C[0]:null),"center"==v?c.y=p+s/2-c.h/2:"bottom"==v?c.y=p+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),h+=a+y,u.recalc&&u.recalc();p+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var P=e.parent();P&&(P._lastRect=null,P.recalc())}}})}),r(at,[Fe],function(e){return e.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,''},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,r=this.getEl().contentWindow.document.body;return r?(r.innerHTML=e,t&&t()):setTimeout(function(){n.html(e)},0),this}})}),r(st,[Fe,J],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.classes.add("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},renderHtml:function(){var e=this,t=e.settings.forId;return'"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.innerHtml(e.encode(t.value))}),e._super()}})}),r(lt,[ie],function(e){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.classes.add("toolbar")},postRender:function(){var e=this;return e.items().each(function(e){e.classes.add("toolbar-item")}),e._super()}})}),r(ct,[lt],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),r(ut,[ze,ne,ct],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(){var e=this,n;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(n=e.state.get("menu")||[],n.length?n={type:"menu",items:n}:n.type=n.type||"menu",n.renderTo?e.menu=n.parent(e).show().renderTo():e.menu=t.create(n).parent(e).renderTo(),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control.parent()===e.menu&&(t.stopPropagation(),e.focus(),e.hideMenu())}),e.menu.on("select",function(){e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type),e.aria("expanded","show"==t.type)}).fire("show")),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon,o,a=e.state.get("text");return o=e.settings.image,o?(i="none","string"!=typeof o&&(o=window.getSelection?o[0]:o[1]),o=" style=\"background-image: url('"+o+"')\""):o="",i=e.settings.icon?r+"ico "+r+"i-"+i:"",e.aria("role",e.parent()instanceof n?"menuitem":"button"),'
    '},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.aria&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}});return i}),r(dt,[Fe,ne,u],function(e,t,n){return e.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t=this,n;t._super(e),e=t.settings,t.classes.add("menu-item"),e.menu&&t.classes.add("menu-item-expand"),e.preview&&t.classes.add("menu-item-preview"),n=t.state.get("text"),("-"===n||"|"===n)&&(t.classes.add("menu-item-sep"),t.aria("role","separator"),t.state.set("text","-")),e.selectable&&(t.aria("role","menuitemcheckbox"),t.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||t.classes.add("menu-item-normal"),t.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&t.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e=this,n=e.settings,r,i=e.parent();if(i.items().each(function(t){t!==e&&t.hideMenu()}),n.menu){r=e.menu,r?r.show():(r=n.menu,r.length?r={type:"menu",items:r}:r.type=r.type||"menu",i.settings.itemDefaults&&(r.itemDefaults=i.settings.itemDefaults),r=e.menu=t.create(r).parent(e).renderTo(),r.reflow(),r.on("cancel",function(t){t.stopPropagation(),e.focus(),r.hide()}),r.on("show hide",function(e){e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),r.on("hide",function(t){t.control===r&&e.classes.remove("selected")}),r.submenu=!0),r._parentMenu=i,r.classes.add("menu-sub");var o=r.testMoveRel(e.getEl(),e.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);r.moveRel(e.getEl(),o),r.rel=o,o="menu-sub-"+o,r.classes.remove(r._lastRel).add(o),r._lastRel=o,e.classes.add("selected"),e.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){function e(e){var t,r,i={};for(i=n.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=e.split("+"),t=0;t'+("-"!==a?'\xa0":"")+("-"!==a?''+a+"":"")+(c?'
    '+c+"
    ":"")+(i.menu?'
    ':"")+""},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var r=e.getEl("text");r&&r.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),e.parent().hideAll()))}),e._super(),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(ft,[ue,dt,f],function(e,t,n){var r=e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,e.itemDefaults)for(var r=e.items,i=r.length;i--;)r[i]=n.extend({},e.itemDefaults,r[i]);t._super(e),t.classes.add("menu")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("select")},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.image||n.selectable?(e._hasIcons=!0,!1):void 0}),e._super()}});return r}),r(ht,[ut,ft],function(e,t){return e.extend({init:function(e){function t(r){for(var a=0;a0&&(o=r[0].text,n.state.set("value",r[0].value)),n.state.set("menu",r)),n.state.set("text",e.text||o||r[0].text),n.classes.add("listbox"),n.on("select",function(t){var r=t.control;a&&(t.lastControl=a),e.multiple?r.active(!r.active()):n.value(t.control.value()),a=r})},bindStates:function(){function e(e,n){e instanceof t&&e.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}function n(e,t){var r;if(e)for(var i=0;i=r.x&&o.x+o.w<=r.w+r.x&&o.y>=r.y&&o.y+o.h<=r.h+r.y)return i[a]}function n(e,t,n){return{x:e.x-t,y:e.y-n,w:e.w+2*t,h:e.h+2*n}}function r(e,t){var n,r,i,s;return n=a(e.x,t.x),r=a(e.y,t.y),i=o(e.x+e.w,t.x+t.w),s=o(e.y+e.h,t.y+t.h),0>i-n||0>s-r?null:{x:n,y:r,w:i-n,h:s-r}}function i(e,t,n){var r,i,o,s,l,c,u,d,f,h;return l=e.x,c=e.y,u=e.x+e.w,d=e.y+e.h,f=t.x+t.w,h=t.y+t.h,r=a(0,t.x-l),i=a(0,t.y-c),o=a(0,u-f),s=a(0,d-h),l+=r,c+=i,n&&(u+=r,d+=i,l-=o,c-=s),u-=o,d-=s,{x:l,y:c,w:u-l,h:d-c}}var o=Math.min,a=Math.max,s=Math.round;return{inflate:n,relativePosition:e,findBestRelativePosition:t,intersect:r,clamp:i}}),r(gt,[Fe,oe],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.classes.add("resizehandle"),"both"==e.settings.direction&&e.classes.add("resizehandle-both"),e.canFocus=!1,'
    '},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(vt,[Fe,oe,J],function(e,t,n){ +function r(e,t,n){return t>e&&(e=t),e>n&&(e=n),e}function i(e,t){var r,i,o,a,s;"v"==e.settings.orientation?(a="top",o="height",i="h"):(a="left",o="width",i="w"),r=(e.layoutRect()[i]||100)-n.getSize(e.getEl("handle"))[o],s=r*((t-e._minValue)/(e._maxValue-e._minValue))+"px",e.getEl("handle").style[a]=s,e.getEl("handle").style.height=e.layoutRect().h+"px"}return e.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"==e.orientation&&t.classes.add("vertical"),t._minValue=e.minValue||0,t._maxValue=e.maxValue||100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
    '},reset:function(){this.value(this._initValue).repaint()},postRender:function(){var e=this,i,o,a=0,s,l,c,u,d,f,h,p;l=e._minValue,c=e._maxValue,s=e.value(),"v"==e.settings.orientation?(d="screenY",f="top",h="height",p="h"):(d="screenX",f="left",h="width",p="w"),e._super(),e._dragHelper=new t(e._id,{handle:e._id+"-handle",start:function(t){i=t[d],o=parseInt(e.getEl("handle").style[f],10),u=(e.layoutRect()[p]||100)-n.getSize(e.getEl("handle"))[h],e.fire("dragstart",{value:s})},drag:function(t){var n=t[d]-i,h=e.getEl("handle");a=r(o+n,0,u),h.style[f]=a+"px",s=l+a/u*(c-l),e.value(s),e.tooltip().text(""+e.settings.previewFilter(s)).show().moveRel(h,"bc tc"),e.fire("drag",{value:s})},stop:function(){e.tooltip().hide(),e.fire("dragend",{value:s})}})},repaint:function(){this._super(),i(this,this.value())},bindStates:function(){var e=this;return e.state.on("change:value",function(t){i(e,t.value)}),e._super()}})}),r(yt,[Fe],function(e){return e.extend({renderHtml:function(){var e=this;return e.classes.add("spacer"),e.canFocus=!1,'
    '}})}),r(bt,[ut,J,h],function(e,t,n){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,r=e.getEl(),i=e.layoutRect(),o,a;return e._super(),o=r.firstChild,a=r.lastChild,n(o).css({width:i.w-t.getSize(a).width,height:i.h-2}),n(a).css({height:i.h-2}),e},activeMenu:function(e){var t=this;n(t.getEl().lastChild).toggleClass(t.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r,i=e.state.get("icon"),o=e.state.get("text");return r=e.settings.image,r?(i="none","string"!=typeof r&&(r=window.getSelection?r[0]:r[1]),r=" style=\"background-image: url('"+r+"')\""):r="",i=e.settings.icon?n+"ico "+n+"i-"+i:"",'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void(t&&t.call(this,e));n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(xt,[rt],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}})}),r(Ct,[se,h,J],function(e,t,n){return e.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t(n).removeClass(this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t(n).addClass(this.classPrefix+"active"),this.items()[e].show().fire("showtab"),this.reflow(),this.items().each(function(t,n){e!=n&&t.hide()})},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='"}),'
    '+n+'
    '+t.renderHtml(e)+"
    "},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,t,r,i;r=n.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(e){r=Math.max(r,e.layoutRect().minW),i=Math.max(i,e.layoutRect().minH)}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=n.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,t=e._super(),t.deltaH+=o,t.innerH=t.h-t.deltaH,t}})}),r(wt,[Fe],function(e){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("textbox"),e.multiline?t.classes.add("multiline"):(t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))}),t.on("keyup",function(e){t.state.set("value",e.target.value)}))},repaint:function(){var e=this,t,n,r,i=0,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e.borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.encode(e.state.get("value"),!1),i="";return"spellcheck"in n&&(i+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(i+=' maxlength="'+n.maxLength+'"'),n.size&&(i+=' size="'+n.size+'"'),n.subtype&&(i+=' type="'+n.subtype+'"'),e.disabled()&&(i+=' disabled="disabled"'),n.multiline?'":'"},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var e=this;e._super(),e.$el.on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)})},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl().value!=t.value&&(e.getEl().value=t.value)}),e.state.on("change:disabled",function(t){e.getEl().disabled=t.value}),e._super()},remove:function(){this.$el.off(),this._super()}})}),r(_t,[h,te],function(e,t){return function(n,r){var i=this,o,a=t.classPrefix;i.show=function(t,s){return i.hide(),o=!0,window.setTimeout(function(){o&&(e(n).append('
    '),s&&s())},t||0),i},i.hide=function(){var e=n.lastChild;return e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),o=!1,i}}}),a([l,c,u,f,h,p,m,v,b,x,C,w,E,N,S,k,T,R,A,D,L,M,H,I,F,V,U,$,q,K,G,X,ee,te,ne,re,ie,oe,ae,se,le,ce,ue,de,fe,he,ge,ve,ye,Ne,Se,ke,Te,Ae,Be,De,Le,Me,He,Pe,Oe,Ie,Fe,ze,We,Ve,Ue,$e,qe,je,Ke,Ye,Ge,Xe,Je,Qe,Ze,et,tt,nt,rt,it,ot,at,st,lt,ct,ut,dt,ft,ht,pt,mt,gt,vt,yt,bt,xt,Ct,wt,_t])}(this); \ No newline at end of file diff --git a/admin/assets/tinymce.css b/admin/assets/tinymce.css new file mode 100755 index 0000000..bf34386 --- /dev/null +++ b/admin/assets/tinymce.css @@ -0,0 +1,6 @@ +body { + font-family: sans-serif; + text-align: left; + color: #444; + font-size: 16px; + } \ No newline at end of file diff --git a/admin/general_config.php b/admin/general_config.php new file mode 100755 index 0000000..6ab1ee7 --- /dev/null +++ b/admin/general_config.php @@ -0,0 +1,103 @@ +get('general_config')); +tinymce(); + ?> +
    +
    +
    + +

    get('general_website_title');?> + +

    + +

    get('general_construction_mode');?> + '.$lang->get('general_end_construction_mode').''; + } else + { + echo ''.$lang->get('general_start_construction_mode').''; + } + ?> get('general_edit_message');?> +

    + + +

    get('general_version');?>

    +

    get('general_version_current');?>: + +

    +

    + versionNum > $MCONF['version_num']) + { + echo $lang->get('general_new_version').' ' . $version_remote->version . ' '.$lang->get('general_update').''; + } + else + { + echo $lang->get('general_version_current_new'); + } + ?> +

    + + +

    get('general_database');?>

    +

    + get('general_create_backup');?> + + get('general_go_phpmyadmin');?> +

    + '; + require $moduluri.$mod.'/'.$_CONF['general_conf']; + } + } + } + closedir($handle); + } + ?> + + + + '; +require_once '../inc/footer.php'; +?> \ No newline at end of file diff --git a/admin/index.html b/admin/index.html new file mode 100755 index 0000000..e69de29 diff --git a/admin/index.php b/admin/index.php new file mode 100755 index 0000000..4b05191 --- /dev/null +++ b/admin/index.php @@ -0,0 +1,59 @@ +get('dashboard_title')); + +if (file_exists('install.php')) +{ + if (unlink('install.php')) + { + echo $lang->get('delete_config_success'); + } +} + +if (hasPerm('view_dashboard')) +{ + echo '
    ' . substr(php_uname(), 0, strpos(php_uname(), ' ')) . ''.$lang->get('os').'
    '; + echo '
    ' . $_SERVER['SERVER_SOFTWARE'] . ''.$lang->get('server_software').'
    '; + echo '
    ' . str_replace(substr(PHP_VERSION, strpos(PHP_VERSION, '-')), '', PHP_VERSION) . ''.$lang->get('php_version').'
    '; + echo '
    ' . str_replace(substr($db->version(), strpos($db->version(), '-')), '', $db->version()) . ''.$lang->get('mysql_version').'
    '; + echo '
    ' . date('H:i:s') . ''.$lang->get('system_time').'
    '; + ?> +
    + get('general_config');?>
    +
    get('logfiles');?>
    +
    + + '; +//Find Dashboard files +$moduluri = '../apps/'; +if ($handle = opendir($moduluri)) +{ + while (false !== ($mod = readdir($handle))) + { + if ($mod != "." && $mod != ".." && is_dir($moduluri . $mod)) + { + require $moduluri . $mod . '/config.php'; + if(isset($_CONF['dashboard']) && $_CONF['dashboard'] != '') + { + if (file_exists($moduluri . $mod . '/' . $_CONF['dashboard'])) + { + echo '
    '; + require $moduluri . $mod . '/' . $_CONF['dashboard']; + echo '
    '; + } + } + $_CONF['dashboard'] = ''; + } + } + closedir($handle); +} +echo '
    '; +require_once '../inc/footer.php'; diff --git a/admin/install-dev.php b/admin/install-dev.php new file mode 100755 index 0000000..460f957 --- /dev/null +++ b/admin/install-dev.php @@ -0,0 +1,382 @@ +setLangFolder('lang/'); + +?> + + + Installation + + + + + +

    Installation

    +query('SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET time_zone = "+00:00"; + + +CREATE TABLE `'.$_POST['db_prefix'].'meta_meta` ( + `name` text NOT NULL, + `content` text NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `'.$_POST['db_prefix'].'sidebar_sidebar` ( + `active` tinyint(1) NOT NULL, + `content` text NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `'.$_POST['db_prefix'].'sidebar_sidebar` (`active`, `content`) VALUES +(0, \'\'); + +CREATE TABLE `'.$_POST['db_prefix'].'simplePages_pages` ( + `id` int(11) NOT NULL, + `title` text CHARACTER SET utf8 NOT NULL, + `alias` longtext CHARACTER SET utf8 NOT NULL, + `content` text CHARACTER SET utf8 NOT NULL, + `user` int(11) NOT NULL, + `status` int(11) NOT NULL, + `meta_description` text CHARACTER SET utf8 NOT NULL, + `meta_keywords` longtext CHARACTER SET utf8 NOT NULL, + `created` int(11) NOT NULL, + `lastedit` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `'.$_POST['db_prefix'].'simplePages_pages_confirm` ( + `id` int(11) NOT NULL, + `page_id` int(11) NOT NULL, + `title` text CHARACTER SET utf8 NOT NULL, + `alias` longtext CHARACTER SET utf8 NOT NULL, + `content` text CHARACTER SET utf8 NOT NULL, + `user` int(11) NOT NULL, + `status` int(11) NOT NULL, + `meta_description` text CHARACTER SET utf8 NOT NULL, + `meta_keywords` longtext CHARACTER SET utf8 NOT NULL, + `created` int(11) NOT NULL, + `lastedit` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `'.$_POST['db_prefix'].'simplePages_permissions` ( + `id` int(11) NOT NULL, + `page` int(11) NOT NULL, + `user` int(11) NOT NULL, + `lastedit` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +CREATE TABLE `'.$_POST['db_prefix'].'system_admins` ( + `id` int(11) NOT NULL, + `username` text NOT NULL, + `pass` text NOT NULL, + `lvl` text NOT NULL, + `mail` text NOT NULL, + `secret` text NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `'.$_POST['db_prefix'].'system_loggedin` ( + `id` int(11) NOT NULL, + `user` int(11) NOT NULL, + `user_agent` longtext NOT NULL, + `ip` text NOT NULL, + `time` int(11) NOT NULL, + `token` text NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `'.$_POST['db_prefix'].'system_roles` ( + `id` int(11) NOT NULL, + `name` text COLLATE utf8_unicode_ci NOT NULL, + `permissions` longtext COLLATE utf8_unicode_ci NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +ALTER TABLE `'.$_POST['db_prefix'].'simplePages_pages` + ADD PRIMARY KEY (`id`); + +ALTER TABLE `'.$_POST['db_prefix'].'simplePages_pages_confirm` + ADD PRIMARY KEY (`id`); + +ALTER TABLE `'.$_POST['db_prefix'].'simplePages_permissions` + ADD PRIMARY KEY (`id`); + +ALTER TABLE `'.$_POST['db_prefix'].'system_admins` + ADD PRIMARY KEY (`id`); + +ALTER TABLE `'.$_POST['db_prefix'].'system_loggedin` + ADD PRIMARY KEY (`id`); + +ALTER TABLE `'.$_POST['db_prefix'].'system_roles` + ADD PRIMARY KEY (`id`); + +ALTER TABLE `'.$_POST['db_prefix'].'simplePages_pages` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; + +ALTER TABLE `'.$_POST['db_prefix'].'simplePages_pages_confirm` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; + +ALTER TABLE `'.$_POST['db_prefix'].'simplePages_permissions` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; + +ALTER TABLE `'.$_POST['db_prefix'].'system_admins` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; + +ALTER TABLE `'.$_POST['db_prefix'].'system_loggedin` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; + +ALTER TABLE `'.$_POST['db_prefix'].'system_roles` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; +')) + { + echo msg('success', 'Created Tables successfully.'); + } + else + { + echo msg('fail', 'Failed Creating Tables'); + exit; + } + + //Admin group + $db->setCol('system_roles'); + $db->data['name'] = 'Admins'; + if($db->insert()) + { + echo msg('success', 'Successfully created admin group.'); + } + else + { + echo msg('fail', 'Error creating admin group.'); + exit; + } + + //Admin User + $db->setCol('system_admins'); + $db->data['username'] = $_POST['admin_name']; + $db->data['pass'] = password_hash($_POST['admin_pw1'], PASSWORD_DEFAULT); + $db->data['lvl'] = 1; + $db->data['mail'] = $_POST['admin_mail']; + if($db->insert()) + { + echo msg('success', 'Successfully created admin user.'); + } + else + { + echo msg('fail', 'Error creating admin user.'); + exit; + } + + //Page title + if(file_put_contents('../inc/System/page_title.txt', $_POST['general_page_title'])) + { + echo msg('succes', 'Page Title was successfully set.
    '); + } + else + { + echo msg('fail', 'Error setting page title.'); + exit; + } + + //htacces + $htacces = 'ErrorDocument 404 '.$_POST['general_home_url'].'index.php + + + +SetEnv gp_rewrite U9sL2S2 + +RewriteEngine On +RewriteBase "'.$_POST['general_home_url'].'" +RewriteRule ^index\.php$ - [L] +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d + +RewriteRule /?(.*) "'.$_POST['general_home_url'].'index.php?$1" [qsa,L] + + +RewriteRule . "'.$_POST['general_home_url'].'index.php" [L] + +'; + if(file_put_contents('../.htaccess', $htacces)) + { + echo msg('succes', '.htaccess was successfully set.
    '); + } + else + { + echo msg('fail', 'Error setting up .htaccess.
    '); + exit; + } + + //Apps + $modulurl = '../apps/'; + if ($handle = opendir($modulurl)) + { + while (false !== ($mod = readdir($handle))) + { + if ($mod != "." && $mod != ".." && is_dir($modulurl.$mod)) + { + require $modulurl.$mod.'/config.php'; + if(isset($_CONF['install']) && $_CONF['install']!='' && file_exists($modulurl.$mod.'/'.$_CONF['install'])) + { + require $modulurl.$mod.'/'.$_CONF['install']; + } + } + } + closedir($handle); + } + + //Write Config + $configfile = Yaml::dump($CONFIG); + if(file_put_contents('../inc/config.yml', $configfile)) + { + echo msg('succes', 'Configfile was successfully created.'); + } + else + { + echo msg('fail', 'Error creating configfile.'); + exit; + } + + echo msg('info', 'Installation successfully completed. Login'); + } + else + { + echo msg('info', 'Please fill in all fields!'); + } +} +else +{ +?> + +
    +
    +

    Language

    + Select your language: +

    + +

    Mysql

    + Host
    + Database
    + Username
    + Password
    + Confirm Password
    + Table prefix

    + +

    Website

    + Website Url
    + Home Url
    + Phpmyadmin Url
    + Page Title
    + Editor CSS
    + Template
    + +

    First Adminuser

    + Name
    + Email-Adress
    + Password
    + Confirm Password
    + +

    +
    + +
    + + + \ No newline at end of file diff --git a/admin/lang/lang.de.php b/admin/lang/lang.de.php new file mode 100755 index 0000000..29bd88f --- /dev/null +++ b/admin/lang/lang.de.php @@ -0,0 +1,190 @@ +Diese Aktion kann nicht Rückgängig gemacht werden!'; +$lang['admins_roles_user_delete_success'] = 'Der Nutzer wurde erfolgreich aus der Gruppe entfernt.'; +$lang['admins_roles_user_delete_fail'] = 'Fehler beim Entfernen des Nutzers.'; +$lang['admins_roles_user_delete_confirm'] = 'Möchten Sie den Nutzer wirklich löschen? Er wird daurch alle ihm zugewiesenen Rechte verlieren! Diese Aktion kann nicht Rückgängig gemacht werden!'; +$lang['admins_roles_members'] = 'Gruppenmitglieder'; +$lang['admins_roles_member_remove'] = 'Nutzer Entfernen'; +$lang['admins_roles_no_members_yet'] = 'Diese Gruppe hat noch keine Mitglieder.'; +$lang['admins_roles_already_all_members'] = 'Es sind alle Nutzer Mitglieder dieser Gruppe.'; +$lang['admins_roles_add_user'] = 'Nutzer hinzufügen'; +$lang['admins_roles_create_group_success'] = 'Die neue Gruppe wurde erfolgreich angelegt.'; +$lang['admins_roles_create_group_fail'] = 'Fehler beim Anlegen der neuen Gruppe.'; +$lang['admins_roles_create_group'] = 'Neue Gruppe anlegen'; +$lang['admins_roles_group_name'] = 'Gruppenname'; +$lang['admins_roles_group'] = 'Gruppe'; +$lang['admins_roles_level'] = 'Level'; +$lang['admins_roles_name'] = 'Name'; +//Admin Permissions +$lang['admins_perms_set_success'] = 'Die neuen Berechtigungen wurden erfolgreich vergeben.'; +$lang['admins_perms_set_fail'] = 'Fehler beim Vergeben der neuen Berechtigungen.'; +$lang['admins_perms_critical'] = 'Vergeben Sie diese Berechtigung nur an Vertrauenswürdige Personen, um Sicherheitsproblemen vorzubeugen'; +$lang['admins_perms_save'] = 'Berechtigungen ändern'; +//Create New User +$lang['admins_cn_success'] = '"%1$s" wurde erfolgreich neuer Nutzer registriert.'; +$lang['admins_cn_fail'] = 'Fehler beim Erstellen des neuen Benutzers.'; +$lang['admins_cn_name_already_in_use'] = 'Benutzername Schon vergeben.'; +$lang['admins_cn_pw_not_match'] = 'Die beiden Passwörtzer stimmen nicht überein.'; +$lang['admins_cn_username'] = 'Gewünschter Benutzername'; +$lang['admins_cn_password'] = 'Passwort'; +$lang['admins_cn_password_again'] = 'Passwort erneut eingeben'; +$lang['admins_cn_create'] = 'Benutzer erstellen'; +$lang['admins_cn_missing_inputs'] = 'Bitte alle Felder ausfüllen.'; + +//User Settings +$lang['user_settings_title'] = 'Benutzereinstellungen'; +$lang['user_settings_pw_not_empty'] = 'Das Passwort darf nicht Leer sein!'; +$lang['user_settings_pw_change_success'] = 'Das Passwort wurde erfolgreich geändert.'; +$lang['user_settings_pw_change_fail'] = 'Fehler beim Ä;ndern des Passworts.'; +$lang['user_settings_pw_not_match'] = 'Die beiden Passwörter stimmen nicht überein.'; +$lang['user_settings_new_pass'] = 'Neues Passwort eingeben'; +$lang['user_settings_new_pass_confirm'] = 'Neues Passwort bestätigen'; +$lang['user_settings_enter_current_pass'] = 'Geben Sie ihr aktuelles Passwort ein'; +$lang['user_settings_error_logout_all_devices'] = 'Fehler beim Ausloggen auf allen Geräten.'; +$lang['user_settings_current_sessions'] = 'Zurzeit offene Anmeldungen'; +$lang['user_settings_current_session'] = 'Aktuelle Anmeldung'; +$lang['user_settings_current_sessions_logout_all'] = 'Überall abmelden'; +$lang['user_settings_2fa'] = 'Anmeldung in zwei Schritten'; +$lang['user_settings_2fa_deactivate'] = 'Anmeldung in zwei Schritten deaktivieren'; +$lang['user_settings_2fa_deactivate_success'] = 'Die Anmeldung in zwei Schritten wurde erfolgreich deaktiviert.'; +$lang['user_settings_2fa_deactivate_fail'] = 'Fehler beim Deaktivieren der Anmeldung in zwei Schritten.'; +$lang['user_settings_2fa_deactivate_confirm'] = 'Sind sie sicher, die Anmeldung in zwei Schritten wirklich zu deaktivieren?'; +$lang['user_settings_2fa_activate'] = 'Anmeldung in zwei Schritten aktivieren'; +$lang['user_settings_2fa_activate_success'] = 'Die Anmeldung in zwei Schritten wurde erfolgreich eingerichtet.'; +$lang['user_settings_2fa_activate_fail'] = 'Fehler beim Einrichten der Anmeldung in zwei Schritten.'; +$lang['user_settings_2fa_activate_wrong_code'] = 'Falscher Code.'; +$lang['user_settings_2fa_activate_import_code'] = 'Importieren Sie diese Information in ihre Google-Authenticator-Anwendung (oder andere TOTP-Anwendung), indem Sie den unten bereitgestellten QR-Code verwendest oder den Code manuell eingeben.'; +$lang['user_settings_2fa_key'] = 'Schlüssel'; +$lang['user_settings_2fa_confirm_code'] = 'Nach einer einmaligen Überprüfung des Codes wird die Anmeldung in zwei Schritten für diesen Account aktiviert'; +$lang['user_settings_2fa_enter_code'] = 'Code eingeben...'; +$lang['user_settings_2fa_test'] = 'Überprüfen'; +$lang['user_settings_settings_success'] = 'Die Änderungen des Nutzers wurden erfolgreich gespeichert.'; +$lang['user_settings_settings_fail'] = 'Fehler beim Speichern der Änderungen des Nutzers.'; +$lang['user_settings_settings_pass'] = 'Passwort ändern'; +$lang['user_settings_last_login'] = 'Letzter Login'; +$lang['user_settings_show_current_sessions'] = 'Offene Anmeldungen anzeigen'; + +//Mail +$lang['mail_write'] = 'Email schreiben'; +$lang['mail_success'] = 'Die Email an "%1$s" wurde erfolgreich abgeschickt.'; +$lang['mail_write_to'] = 'Eine Email an %1$s Schreiben'; +$lang['mail_fail'] = 'Fehler beim Schreiben der Email'; +$lang['mail_subject'] = 'Betreff'; +$lang['mail_message'] = 'Nachricht'; +$lang['mail_send'] = 'Email abschicken'; + +//Action +$lang['action_backup_fail'] = 'Fehler beim Erstellen des Backups.'; +$lang['action_edit_content'] = 'Seite bearbeiten'; +$lang['action_construction_message_success'] = 'Die Meldung wurde erfolgreich geändert.'; +$lang['action_try_again_later'] = 'Fehler. Bitte versuchen Sie es später noch einmal.'; +$lang['action_construction_message_edit'] = 'Baustellen-Meldung bearbeiten'; +$lang['action_construction_success'] = 'Die Webseite wurde erfolgreich in den Baustellenzustand versetzt.'; +$lang['action_construction_confirm'] = 'Wollen Sie die Webseite wirklich in den Baustellenzustand verstzten?'; +$lang['action_construction_removed_success'] = 'Der Baustellenzustand wurde erfolgreich aufgehoben.'; +$lang['action_construction_remove'] = 'Wollen Sie den Baustellenzustand wirklich aufheben?'; +$lang['action_change_page_title_success'] = 'Die Änderungen des Seitentitels wurden erfolgreich gespeichert.'; +$lang['action_update_item_succss'] = '"%1$s" wurde erfolgreich upgedatet.'; +$lang['action_update_item_fail'] = 'Fehler beim Updaten von "%1$s"'; +$lang['action_update_succss'] = 'Das CMS wurde erfolgreich upgedatet.'; +$lang['action_update_fail'] = 'Fehler beim Updaten.'; +$lang['action_update_fail_unzip'] = 'Fehler beim Entpacken des Updates.'; +$lang['action_update_md5_fake'] = 'Die Heruntergeladene Datei ist vermutlich falsch.'; +$lang['action_update_fail_copy'] = 'Fehler beim Herunterladen des Updates. Hinweis: Der Nutzer, unter welchem der Webserver läuft, muss im Verzeichnis /admin Schreibrechte haben!'; \ No newline at end of file diff --git a/admin/lang/lang.en.php b/admin/lang/lang.en.php new file mode 100755 index 0000000..8ec8e1b --- /dev/null +++ b/admin/lang/lang.en.php @@ -0,0 +1,190 @@ +Diese Aktion kann nicht Rückgängig gemacht werden!'; +$lang['admins_roles_user_delete_success'] = 'Der Nutzer wurde erfolgreich aus der Gruppe entfernt.'; +$lang['admins_roles_user_delete_fail'] = 'Fehler beim Entfernen des Nutzers.'; +$lang['admins_roles_user_delete_confirm'] = 'Möchten Sie den Nutzer wirklich löschen? Er wird daurch alle ihm zugewiesenen Rechte verlieren! Diese Aktion kann nicht Rückgängig gemacht werden!'; +$lang['admins_roles_members'] = 'Gruppenmitglieder'; +$lang['admins_roles_member_remove'] = 'Nutzer Entfernen'; +$lang['admins_roles_no_members_yet'] = 'Diese Gruppe hat noch keine Mitglieder.'; +$lang['admins_roles_already_all_members'] = 'Es sind alle Nutzer Mitglieder dieser Gruppe.'; +$lang['admins_roles_add_user'] = 'Nutzer hinzufügen'; +$lang['admins_roles_create_group_success'] = 'Die neue Gruppe wurde erfolgreich angelegt.'; +$lang['admins_roles_create_group_fail'] = 'Fehler beim Anlegen der neuen Gruppe.'; +$lang['admins_roles_create_group'] = 'Neue Gruppe anlegen'; +$lang['admins_roles_group_name'] = 'Gruppenname'; +$lang['admins_roles_group'] = 'Gruppe'; +$lang['admins_roles_level'] = 'Level'; +$lang['admins_roles_name'] = 'Name'; +//Admin Permissions +$lang['admins_perms_set_success'] = 'Die neuen Berechtigungen wurden erfolgreich vergeben.'; +$lang['admins_perms_set_fail'] = 'Fehler beim Vergeben der neuen Berechtigungen.'; +$lang['admins_perms_critical'] = 'Vergeben Sie diese Berechtigung nur an Vertrauenswürdige Personen, um Sicherheitsproblemen vorzubeugen'; +$lang['admins_perms_save'] = 'Berechtigungen ändern'; +//Create New User +$lang['admins_cn_success'] = '"%1$s" wurde erfolgreich neuer Nutzer registriert.'; +$lang['admins_cn_fail'] = 'Fehler beim Erstellen des neuen Benutzers.'; +$lang['admins_cn_name_already_in_use'] = 'Benutzername Schon vergeben.'; +$lang['admins_cn_pw_not_match'] = 'Die beiden Passwörtzer stimmen nicht überein.'; +$lang['admins_cn_username'] = 'Gewünschter Benutzername'; +$lang['admins_cn_password'] = 'Passwort'; +$lang['admins_cn_password_again'] = 'Passwort erneut eingeben'; +$lang['admins_cn_create'] = 'Benutzer erstellen'; +$lang['admins_cn_missing_inputs'] = 'Bitte alle Felder ausfüllen.'; + +//User Settings +$lang['user_settings_title'] = 'Benutzereinstellungen'; +$lang['user_settings_pw_not_empty'] = 'Das Passwort darf nicht Leer sein!'; +$lang['user_settings_pw_change_success'] = 'Das Passwort wurde erfolgreich geändert.'; +$lang['user_settings_pw_change_fail'] = 'Fehler beim Ä;ndern des Passworts.'; +$lang['user_settings_pw_not_match'] = 'Die beiden Passwörter stimmen nicht überein.'; +$lang['user_settings_new_pass'] = 'Neues Passwort eingeben'; +$lang['user_settings_new_pass_confirm'] = 'Neues Passwort bestätigen'; +$lang['user_settings_enter_current_pass'] = 'Geben Sie ihr aktuelles Passwort ein'; +$lang['user_settings_error_logout_all_devices'] = 'Fehler beim Ausloggen auf allen Geräten.'; +$lang['user_settings_current_sessions'] = 'Zurzeit offene Anmeldungen'; +$lang['user_settings_current_session'] = 'Aktuelle Anmeldung'; +$lang['user_settings_current_sessions_logout_all'] = 'Überall abmelden'; +$lang['user_settings_2fa'] = 'Anmeldung in zwei Schritten'; +$lang['user_settings_2fa_deactivate'] = 'Anmeldung in zwei Schritten deaktivieren'; +$lang['user_settings_2fa_deactivate_success'] = 'Die Anmeldung in zwei Schritten wurde erfolgreich deaktiviert.'; +$lang['user_settings_2fa_deactivate_fail'] = 'Fehler beim Deaktivieren der Anmeldung in zwei Schritten.'; +$lang['user_settings_2fa_deactivate_confirm'] = 'Sind sie sicher, die Anmeldung in zwei Schritten wirklich zu deaktivieren?'; +$lang['user_settings_2fa_activate'] = 'Anmeldung in zwei Schritten aktivieren'; +$lang['user_settings_2fa_activate_success'] = 'Die Anmeldung in zwei Schritten wurde erfolgreich eingerichtet.'; +$lang['user_settings_2fa_activate_fail'] = 'Fehler beim Einrichten der Anmeldung in zwei Schritten.'; +$lang['user_settings_2fa_activate_wrong_code'] = 'Falscher Code.'; +$lang['user_settings_2fa_activate_import_code'] = 'Importieren Sie diese Information in ihre Google-Authenticator-Anwendung (oder andere TOTP-Anwendung), indem Sie den unten bereitgestellten QR-Code verwendest oder den Code manuell eingeben.'; +$lang['user_settings_2fa_key'] = 'Schlüssel'; +$lang['user_settings_2fa_confirm_code'] = 'Nach einer einmaligen Überprüfung des Codes wird die Anmeldung in zwei Schritten für diesen Account aktiviert'; +$lang['user_settings_2fa_enter_code'] = 'Code eingeben...'; +$lang['user_settings_2fa_test'] = 'Überprüfen'; +$lang['user_settings_settings_success'] = 'Die Änderungen des Nutzers wurden erfolgreich gespeichert.'; +$lang['user_settings_settings_fail'] = 'Fehler beim Speichern der Änderungen des Nutzers.'; +$lang['user_settings_settings_pass'] = 'Passwort ändern'; +$lang['user_settings_last_login'] = 'Letzter Login'; +$lang['user_settings_show_current_sessions'] = 'Offene Anmeldungen anzeigen'; + +//Mail +$lang['mail_write'] = 'Email schreiben'; +$lang['mail_success'] = 'Die Email an "%1$s" wurde erfolgreich abgeschickt.'; +$lang['mail_write_to'] = 'Eine Email an %1$s Schreiben'; +$lang['mail_fail'] = 'Fehler beim Schreiben der Email'; +$lang['mail_subject'] = 'Betreff'; +$lang['mail_message'] = 'Nachricht'; +$lang['mail_send'] = 'Email abschicken'; + +//Action +$lang['action_backup_fail'] = 'Fehler beim Erstellen des Backups.'; +$lang['action_edit_content'] = 'Seite bearbeiten'; +$lang['action_construction_message_success'] = 'Die Meldung wurde erfolgreich geändert.'; +$lang['action_try_again_later'] = 'Fehler. Bitte versuchen Sie es später noch einmal.'; +$lang['action_construction_message_edit'] = 'Baustellen-Meldung bearbeiten'; +$lang['action_construction_success'] = 'Die Webseite wurde erfolgreich in den Baustellenzustand versetzt.'; +$lang['action_construction_confirm'] = 'Wollen Sie die Webseite wirklich in den Baustellenzustand verstzten?'; +$lang['action_construction_removed_success'] = 'Der Baustellenzustand wurde erfolgreich aufgehoben.'; +$lang['action_construction_remove'] = 'Wollen Sie den Baustellenzustand wirklich aufheben?'; +$lang['action_change_page_title_success'] = 'Die Änderungen des Seitentitels wurden erfolgreich gespeichert.'; +$lang['action_update_item_succss'] = '"%1$s" wurde erfolgreich upgedatet.'; +$lang['action_update_item_fail'] = 'Fehler beim Updaten von "%1$s"'; +$lang['action_update_succss'] = 'Das CMS wurde erfolgreich upgedatet.'; +$lang['action_update_fail'] = 'Fehler beim Updaten.'; +$lang['action_update_fail_unzip'] = 'Fehler beim Entpacken des Updates.'; +$lang['action_update_md5_fake'] = 'Die Heruntergeladene Datei ist vermutlich falsch.'; +$lang['action_update_fail_copy'] = 'Fehler beim Herunterladen des Updates. Hinweis: Der Nutzer, unter welchem der Webserver läuft, muss im Verzeichnis /admin Schreibrechte haben!'; \ No newline at end of file diff --git a/admin/login.php b/admin/login.php new file mode 100755 index 0000000..2a42001 --- /dev/null +++ b/admin/login.php @@ -0,0 +1,79 @@ +setCol('system_admins'); +$db->data['username'] = $_POST['username']; +$db->get(); +if($db->data[0]['id'] != '') +{ + if(password_verify($_POST['pw'], $db->data[0]['pass'])) + { + session_regenerate_id(); + $uid = $db->data[0]['id']; + + //Token + $token = random(64); + $_SESSION['token'] = $token; + $db->clear(); + $db->setCol('system_loggedin'); + $db->data['user'] = $uid; + $db->data['user_agent'] = $_SERVER['HTTP_USER_AGENT']; + $db->data['ip'] = $_SERVER['REMOTE_ADDR']; + $db->data['time'] = time(); + $db->data['token'] = $token; + //if($db->insert()) echo 'token'; else echo 'hm'; + $db->insert(); + //echo $token; + + $db->clear(); + $db->setCol('system_admins'); + $db->data['id'] = $uid; + $db->get(); + if($db->data[0]['secret'] != '') + { + if(isset($_POST['2fa']) && $_POST['2fa'] == '') + { + echo '2fa'; + exit; + } + else + { + require_once '../inc/libs/2fa.php'; + $authenticator = new php2FA(); + + if($authenticator->verifyCode($db->data[0]['secret'], $_POST['2fa'], 3)) + { + echo 'success'; + } + else + { + echo '2fafail'; + exit; + } + } + } + else + { + echo 'success'; + } + + //Session + $_SESSION['user'] = $db->data[0]['username']; + $_SESSION['userid'] = $db->data[0]['id']; + $_SESSION['lvl'] = $db->data[0]['lvl']; + $_SESSION['mail'] = $db->data[0]['mail']; + $_SESSION['guestview'] = 'true'; + } + else + { + echo 'fail'; + } +} +else +{ + echo 'fail'; +} \ No newline at end of file diff --git a/admin/logout.php b/admin/logout.php new file mode 100755 index 0000000..a689186 --- /dev/null +++ b/admin/logout.php @@ -0,0 +1,11 @@ +setCol('system_loggedin'); +$db->data['token'] = $_SESSION['token']; +$db->delete(); + +session_destroy(); +header('Location: '.$MCONF['web_uri'].'admin/?msg=3'); diff --git a/admin/mail.php b/admin/mail.php new file mode 100755 index 0000000..237c6ae --- /dev/null +++ b/admin/mail.php @@ -0,0 +1,59 @@ +get('mail_write')); + +if (isset($_GET['to'])) +{ + if (isset($_POST['submit'])) + { + if ($_POST['from'] != "" && $_POST['mail'] != "" && $_POST['subject'] != "" && $_POST['message'] != "") + { + $header = 'From: ' . $_POST['from'] . ' <' . $_POST['mail'] . ">\n"; + $header .= 'Reply-To: ' . $_POST['mail'] . "\n"; + $header .= "Content-Type: text/html\n"; + + if (mail($_GET['to'], $_POST['subject'], $_POST['message'], $header)) + { + echo msg('success', sprintf($lang->get('mail_success'), $_GET['to'])); + } + else + { + echo msg('fail', $lang->get('mail_fail')); + } + } + else + { + echo msg('info', $lang->get('all_fields') . ' {back}'); + } + } + else + { + ?> +
    +

    get('mail_write_to'), $_GET['to']); ?>

    +
    +
    +

    get('admins_username'); ?>: + +

    +

    get('admins_mail'); ?>: + +

    +

    get('mail_subject'); ?>: + +

    +

    get('mail_message'); ?>:
    +

    + +
    +
    +
    + get('mail_success')); +} +require_once '../inc/footer.php'; +?> \ No newline at end of file diff --git a/admin/new_user.php b/admin/new_user.php new file mode 100755 index 0000000..3931dd3 --- /dev/null +++ b/admin/new_user.php @@ -0,0 +1,70 @@ +get('admins_create_new')); +if (hasPerm('manage_admins')) +{ + if (isset($_POST['userN'])) + { + if ($_POST['userN'] != '' && $_POST['pw1'] != '' && $_POST['pw2'] != '' && $_POST['mail'] != '') + { + require_once '../inc/libs/password.php'; + $pw1 = $_POST['pw1']; + $pw2 = $_POST['pw2']; + if ($pw1 === $pw2) + { + $pw = password_hash($pw1, PASSWORD_DEFAULT); + $db->setCol('system_admins'); + $db->data['username'] = $_POST['userN']; + $db->get(); + //var_dump($db->data[0]['id']); + + if (!isset($db->data[0]['id'])) + { + $db->clear(); + $db->setCol('system_admins'); + $db->data = ['username' => $_POST['userN'], 'pass' => $pw, 'mail' => $_POST['mail']]; + + if ($db->insert()) + { + echo msg('succes', sprintf($lang->get('admins_cn_success'), $_POST['userN']) . ' ' . $lang->get('back') . ''); + } else + { + echo msg('fail', $lang->get('admins_cn_fail') . ' {back}'); + } + } else + { + echo msg('fail', $lang->get('admins_cn_name_already_in_use') . ' {back}'); + } + } else + { + echo msg('fail', $lang->get('admins_cn_pw_not_match') . ' {back}'); + } + } else + { + echo msg('fail', $lang->get('admins_cn_missing_inputs') . ' {back}'); + } + } else + { + ?> +
    +
    +
    +

    get('admins_cn_username'); ?>: +

    +

    get('admins_cn_password'); ?>: +

    +

    get('admins_cn_password_again'); ?>:

    +

    get('admins_mail'); ?>:

    +

    +
    +
    +
    + get('missing_permission')); +} +require_once '../inc/footer.php'; +?> diff --git a/admin/permissions.json b/admin/permissions.json new file mode 100755 index 0000000..2a65452 --- /dev/null +++ b/admin/permissions.json @@ -0,0 +1,52 @@ +{ + "permissions": [ + { + "key": "view_dashboard", + "name": "Relevante Informationen auf dem Dashboard ansehen.", + "description": "", + "critical": false + }, + { + "key": "manage_system", + "name": "Systemeinstellungen vornehmen.", + "description": "", + "critical": true + }, + { + "key": "construction", + "name": "Baustellenzustand ändern", + "description": "Im Baustellenzustand wird Anstelle der Seite ein Text angezeigt.", + "critical": true + }, + { + "key": "update", + "name": "Systemupdate durchführen", + "description": "Nach neuen Versionen des Systems suchen und updaten.", + "critical": true + }, + { + "key": "db_dump", + "name": "Datenbanbackup herunterladen", + "description": "Ein komplettes Backup der Datenbank herunterladen.", + "critical": false + }, + { + "key": "manage_admins", + "name": "Administratoren verwalten", + "description": "", + "critical": true + }, + { + "key": "manage_groups", + "name": "Admingruppen verwalten", + "description": "", + "critical": true + }, + { + "key": "edit_permissions", + "name": "Adminberechtigungen verwalten", + "description": "", + "critical": true + } + ] +} \ No newline at end of file diff --git a/admin/permissions.php b/admin/permissions.php new file mode 100755 index 0000000..b6d5d20 --- /dev/null +++ b/admin/permissions.php @@ -0,0 +1,127 @@ +get('admins_permissions')); + +if (hasPerm('edit_permissions')) +{ + $db->setCol('system_roles'); + if (isset($_POST['smbt'])) + { + //Perms finden und in en Array tun + $permArr = []; + foreach ($_POST as $perm => $val) + { + if ($perm != 'smbt') + { + $perm_full = $perm; + $perm = explode('_', $perm); + $permArr[$perm[0]][$perm[1]][] = str_replace($perm[0].'_'.$perm[1].'_', '', $perm_full); + } + } + + //print_r($permArr); + foreach ($permArr as $lvl => $perms) + { + $db->data['permissions'] = json_encode($perms); + if ($db->update(['id' => $lvl])) + { + echo msg('success', $lang->get('admins_perms_set_success').' {back}'); + } + else + { + echo msg('fail', $lang->get('admins_perms_set_fail').' {back}'); + } + } + } else + { + echo '
    '; + //Admin Groups + $db->get(); + $role_names = []; + $role_perms = []; + $roles_descr = ''; + foreach ($db->data as $role_name) + { + $role_names[$role_name['id']] = $role_name['name']; + $roles_descr .= '' . $role_name['name'] . ''; + + //Already set permissions + $role_perms[$role_name['id']] = []; + $perms = []; + if ($role_name['permissions'] != '') $perms = json_decode($role_name['permissions'], true); + //print_r($perms); + + foreach ($perms as $apps => $perm) + { + foreach ($perm as $item) + { + $role_perms[$role_name['id']][] = $apps . '.' . $item; + } + } + } + + //print_r($role_perms); + + //Get All + $permsTotal = []; + $permsTotal['System'] = json_decode(file_get_contents('permissions.json'), true); + $permsTotal['System'] = $permsTotal['System']['permissions']; + $moduluri = '../apps/'; + if ($handle = opendir($moduluri)) + { + while (false !== ($mod = readdir($handle))) + { + if ($mod != "." && $mod != ".." && is_dir($moduluri . $mod)) + { + if (file_exists($moduluri . '/' . $mod . '/permissions.json')) + { + require $moduluri . '/' . $mod . '/config.php'; + $permsTotal[$_CONF['mod_name']] = json_decode(file_get_contents($moduluri . '/' . $mod . '/permissions.json'), true); + $permsTotal[$_CONF['mod_name']] = $permsTotal[$_CONF['mod_name']]['permissions']; + } + } + } + closedir($handle); + } + + //print_r($permsTotal); + + + foreach ($permsTotal as $title => $perms) + { + echo '' . $roles_descr . ''; + + foreach ($perms as $perm) + { + $critical = ''; + if ($perm['critical'] == true) $critical = ''; + + echo ''; + foreach ($role_names as $lvl => $name) + { + $disable = ''; + if ($lvl == 1) $disable = ' disabled="disabled"'; + + $checked = ''; + if ($lvl == 1) $checked = ' checked="checked"'; + if (in_array($title . '.' . $perm['key'], $role_perms[$lvl])) $checked = ' checked="checked"'; + + $id = $lvl . '.' . $title . '.' . $perm['key']; + echo ''; + //title="'.print_r($role_perms[$lvl], true).$title . '.' . $perm['key'].'" + } + + echo ''; + } + + echo '
    ' . $title . '
    ' . $critical . $perm['name'] . '
    '; + + } + + echo '
    '; + } +} else +{ + echo msg('info', $lang->get('missing_permission')); +} +require_once '../inc/footer.php'; diff --git a/admin/roles.php b/admin/roles.php new file mode 100755 index 0000000..450c65b --- /dev/null +++ b/admin/roles.php @@ -0,0 +1,212 @@ +get('admins_groups')); + +if (hasPerm('manage_groups')) +{ + //Mitglieder einer Gruppe anzeigen + if (isset($_GET['members'])) + { + $db->setCol('system_admins'); + if (isset($_POST['submit'])) + { + $db->data['lvl'] = $_GET['members']; + if ($db->update(['id' => $_POST['user']])) + { + echo msg('success', $lang->get('admins_roles_added_success').' '.$lang->get('back').''); + } else + { + echo msg('fail', $lang->get('admins_roles_added_fail').' '.$lang->get('back').''); + } + } elseif (isset($_GET['del'])) + { + if ($_GET['members'] == 1) + { + echo msg(null, $lang->get('admins_roles_delete_error').' '.$lang->get('back').''); + } else + { + if (isset($_POST['del'])) + { + $db->setCol('system_roles'); + if ($db->delete(['id' => $_GET['members']])) + { + echo msg('success', $lang->get('admins_roles_delete_success').' '.$lang->get('back').''); + } else + { + echo msg('fail', $lang->get('admins_roles_delete_fail').' '.$lang->get('back').''); + } + } else + { + ?> +
    +
    +

    get('admins_roles_delete_confirm');?>

    + + get('general_no');?> +
    +
    + setCol('system_admins'); + $db->data['lvl'] = 0; + if ($db->update(['id' => $_GET['deluser']])) + { + echo msg('success', $lang->get('admins_roles_user_delete_success').' '.$lang->get('back').''); + } else + { + echo msg('fail', $lang->get('admins_roles_user_delete_fail').' '.$lang->get('back').''); + } + } else + { + ?> +
    +
    +

    get('admins_roles_user_delete_confirm');?>

    + + get('general_no');?> +
    +
    + +
    +

    get('admins_roles_members');?>

    + + + + + + + + get(); + foreach ($db->data as $user) + { + if ($user['lvl'] == $_GET['members']) + { + ?> + + + + + + + '.$lang->get('admins_roles_no_members_yet').'

    '; + ?> +
    get('admins_id');?>get('admins_username');?>get('admins_mail');?> 
    '.$lang->get('admins_not_set').''; + } else + { + ?> + + get('settings');?> | + get('admins_roles_member_remove');?>
    + '.$lang->get('admins_roles_already_all_members').'

    '; + } else + { + ?> +
    + get('admins_roles_add_user');?>: + + +
    + '.$lang->get('admins_roles_delete_group').''; + ?> +
    + setCol('system_roles'); + $db->data['name'] = $_POST['group_name']; + if ($db->insert()) + { + echo msg('success', $lang->get('admins_roles_create_group_success').' '.$lang->get('back').''); + } else + { + echo msg('fail', $lang->get('admins_roles_create_group_fail').' '.$lang->get('back').''); + } + } else + { + ?> +
    +

    get('admins_roles_create_group');?>

    +
    +
    + +
    +
    + +
    + + + + + + + setCol('system_roles'); + $db->get(); + foreach ($db->data as $role) + { + ?> + + + + + + +
    get('admins_roles_level');?>get('admins_roles_name');?> 
    get('admins_roles_members');?>
    +

    get('admins_roles_create_group');?>

    +
    + get('missing_permission')); +} +require_once '../inc/footer.php'; diff --git a/admin/user_settings.php b/admin/user_settings.php new file mode 100755 index 0000000..35bda56 --- /dev/null +++ b/admin/user_settings.php @@ -0,0 +1,305 @@ +get('user_settings_title')); +require_once '../inc/libs/password.php'; + +$uid = $_SESSION['userid']; +if (isset($_GET['uid'])) $uid = $_GET['uid']; + +if (hasPerm('manage_admins') || $uid == $_SESSION['userid']) +{ + if (isset($_GET['pw_new'])) + { + if (isset($_POST['pw_new'])) + { + if ($_POST['pw_new'] == $_POST['pw_new2']) + { + if ($_POST['pw_new'] == '') + { + echo msg('fail', $lang->get('user_settings_pw_not_empty') . ' {back}'); + } else + { + $user = $_SESSION['userid']; + if (isset($_GET['uid'])) $user = $_GET['uid']; + + $db->setCol('system_admins'); + $db->data['pass'] = password_hash($_POST['pw_new'], PASSWORD_DEFAULT); + if ($db->update(['id' => $user])) + { + echo msg('succes', $lang->get('user_settings_pw_change_success') . ' ' . $lang->get('back_dashboard') . ''); + } else + { + echo msg('fail', $lang->get('user_settings_pw_change_fail') . ' {back}'); + } + } + } else + { + echo msg('fail', $lang->get('user_settings_pw_not_match') . ' {back}'); + } + } else + { + ?> +
    +
    +
    +
    + +
    +
    + clear(); + $db->setCol('system_admins'); + $db->data['id'] = $uid; + $db->get(); + if ($db->data[0]['id'] !== '') + { + if (password_verify($_POST['pw'], $db->data[0]['pass'])) + { + echo '

    ' . $lang->get('user_settings_new_pass') . '

    '; + ?> +
    +
    +
    + +
    +
    + get('wrong_pass') . ' {back}'); + } + } + } else + { + ?> +
    +
    +
    + +
    +
    + setCol('system_loggedin'); + if (isset($_POST['smbt'])) + { + if ($db->delete(['user' => $_SESSION['userid']])) + { + header('Location: ' . $MCONF['web_uri'] . 'admin/?msg=4'); + } else + { + echo msg('fail', $lang->get('user_settings_error_logout_all_devices')); + } + } else + { + echo '

    ' . $lang->get('user_settings_current_sessions') . '

    '; + $db->data['user'] = $_SESSION['userid']; + $db->get(); + echo ''; + foreach ($db->data as $data) + { + echo ''; + } + echo '
    ' . $lang->get('date') . '' . $lang->get('ip') . '' . $lang->get('user_agent') . '
    ' . date('d.m.Y H:i:s', $data['time']) . '' . $data['ip'] . '' . $data['user_agent']; + if ($data['token'] == $_SESSION['token']) echo ' ' . $lang->get('user_settings_current_session') . ''; + echo '
    '; + + ?> +
    +
    + '; + require_once '../inc/libs/2fa.php'; + $authenticator = new php2FA(); + $db->clear(); + $db->setCol('system_admins'); + $db->data['id'] = $_SESSION['userid']; + $db->get(); + //Wenn aktiviert, mgl zum Deaktivieren anzeigen + if (isset($db->data[0]['secret']) && $db->data[0]['secret'] != '') + { + echo '

    ' . $lang->get('user_settings_2fa_deactivate') . '

    '; + if (isset($_POST['confirm'])) + { + $db->clear(); + $db->setCol('system_admins'); + $db->data['secret'] = ''; + if ($db->update(['id' => $_SESSION['userid']])) + { + echo msg('success', $lang->get('user_settings_2fa_deactivate_success') . ' ' . $lang->get('back') . ''); + } else + { + echo msg('fail', $lang->get('user_settings_2fa_deactivate_fail') . ' {back}'); + } + } else + { + ?> +

    get('user_settings_2fa_deactivate_confirm'); ?>

    +

    +

    + + get('general_no'); ?> +
    +

    + ' . $lang->get('user_settings_2fa_activate') . ''; + if (isset($_POST['smbt'])) + { + if ($authenticator->verifyCode($_POST['secret'], $_POST['2fatest'], 3)) + { + $db->clear(); + $db->setCol('system_admins'); + $db->data['secret'] = $_POST['secret']; + if ($db->update(['id' => $_SESSION['userid']])) + { + echo msg('success', $lang->get('user_settings_2fa_activate_success') . ' ' . $lang->get('back') . ''); + } else + { + echo msg('fail', $lang->get('user_settings_2fa_activate_fail') . ' {back}'); + } + } else + { + echo msg('fail', $lang->get('user_settings_2fa_activate_wrong_code') . ' {back}'); + } + } else + { + echo '

    ' . $lang->get('user_settings_2fa_activate_import_code') . '

    '; + $secret = $authenticator->createSecret(); + echo '

    ' . $lang->get('user_settings_2fa_key') . ': ' . $secret . '

    '; + $website = $MCONF['title'] . ' - Admin'; + $title = $_SESSION['user']; + $qrCodeUrl = $authenticator->getSecretUrl($title, $secret, $website); + echo '

    '; + ?> +

    get('user_settings_2fa_confirm_code'); ?>:

    +
    +

    + + +

    +
    + '; + } else + { + $db->setCol('system_admins'); + if (isset($_POST['smbt'])) + { + $db->data['username'] = $_POST['username']; + $db->data['mail'] = $_POST['mail']; + if ($db->update(['id' => $uid])) + { + echo msg('success', $lang->get('user_settings_settings_success') . ' {back}'); + } else + { + echo msg('fail', $lang->get('user_settings_settings_fail') . ' {back}'); + } + } else + { + $db->data['id'] = $uid; + $db->get(); + //print_r($db->data); + if ($db->data[0]['username'] !== '') + { + ?> +
    +
    +

    get('username'); ?>: +

    +

    get('admins_mail'); ?>: +

    +

    get('password'); ?>:get('user_settings_settings_pass'); ?>

    +

    get('admins_roles_group'); ?>:data[0]['lvl']; + $db->setCol('system_roles'); + $db->data['id'] = $lvl; + $db->get(); + echo $db->data[0]['name'] ?>

    +

    get('user_settings_last_login'); ?>:setCol('system_loggedin'); + $db->data['user'] = $uid; + $db->get(); + if (isset($db->data[0]['time'])) + { + echo date('d.m.Y H:i:s', $db->data[0]['time']); + } else + { + $last_login = '' . $lang->get('never') . ''; + foreach ($db->data as $data) + { + $last_login = date('d.m.Y H:i:s', $data['time']); + } + echo $last_login; + } + + if ($uid == $_SESSION['userid']) + { + echo ' ' . $lang->get('user_settings_show_current_sessions') . ''; + ?>

    +

    get('user_settings_2fa'); ?>:clear(); + $db->setCol('system_admins'); + $db->data['id'] = $_SESSION['userid']; + $db->get(); + if (isset($db->data[0]['secret']) && $db->data[0]['secret'] != '') + { + echo $lang->get('general_active') . '. ' . $lang->get('general_deactivate') . ''; + } else + { + echo $lang->get('general_inactive') . '. ' . $lang->get('general_activate') . ''; + } + } + ?>

    +

    +

    +
    +
    + get('missing_permission')); +} +require_once '../inc/footer.php'; +?> \ No newline at end of file diff --git a/admin/users.php b/admin/users.php new file mode 100755 index 0000000..2022716 --- /dev/null +++ b/admin/users.php @@ -0,0 +1,53 @@ +get('admins_list')); +if(hasPerm('manage_admins')) +{ +?> +
    + + + + + + + + + setCol('system_admins'); + $db->get(); + foreach ($db->data as $user) + { + ?> + + + + + + + + +
    get('admins_id');?>get('admins_users');?>get('admins_permissions');?>get('admins_mail');?>
    '.$lang->get('admins_not_set').''; + } else + { + ?> + + get('settings');?>
    + get('missing_permission')); + } + ?> +
    + diff --git a/apps/Files/config.php b/apps/Files/config.php new file mode 100755 index 0000000..3bde177 --- /dev/null +++ b/apps/Files/config.php @@ -0,0 +1,9 @@ +set('Dateiverwaltung', 'files_title', 'de'); +$GLOBALS['lang']->set('Manage Files', 'files_title', 'en'); + +$_CONF['mod_name'] = 'Files'; +$_CONF['mod_desc'] = 'Ein Modul zum Anzeigen & Uploaden von Dateien'; +$_CONF['menu_top'] = ' '.$GLOBALS['lang']->get('files_title'); +$_CONF['menu'] = ['menu_top' => 'index.php']; +$_CONF['type'] = 'none'; diff --git a/apps/Files/index.php b/apps/Files/index.php new file mode 100755 index 0000000..145f333 --- /dev/null +++ b/apps/Files/index.php @@ -0,0 +1,674 @@ + '..', 'date' => '', 'type' => 'Ordner', 'size' => '', 'icon' => 'folder2']; + if (cleanUrl($dir) != '../../Files/') $files['files'][] = ['name' => '..', 'date' => '', 'type' => 'Ordner', 'size' => '-', 'icon' => 'folder2']; + + $handle = opendir($dir) or die (http_response_code(404)); + while (false !== ($datei = readdir($handle))) + { + if ($datei != "." && $datei != ".." && is_dir($dir . $datei)) + { + $files['files'][] = ['name' => $datei, 'date' => date("d.m.Y H:m:s", filemtime($dir . $datei)), 'type' => 'Ordner', 'size' => '-', 'icon' => 'folder2']; + } + } + + //Files auslesen + $files_sort = []; + $handle = opendir($dir) or die (http_response_code(404)); + while ($datei = readdir($handle)) + { + //dateityp + $dateityp = strrchr($datei, '.'); + $dateityp = str_replace('.', '', $dateityp); + if ($dateityp != '') + { + $icon = 'file'; + if (in_array($dateityp, $types_audio)) $icon = 'file-audio-o'; + if (in_array($dateityp, $types_video)) $icon = 'file-movie-o'; + if (in_array($dateityp, $types_images)) $icon = 'file-picture-o'; + if (in_array($dateityp, $types_archives)) $icon = 'file-archive-o'; + if (in_array($dateityp, $types_code)) $icon = 'file-code-o'; + if (in_array($dateityp, $types_word)) $icon = 'file-word-o'; + if (in_array($dateityp, $types_pp)) $icon = 'file-powerpoint-o'; + if ($dateityp == 'pdf') $icon = 'file-pdf-o'; + if ($dateityp == 'exe') $icon = 'file-excel-o'; + + $files['files'][] = ['name' => $datei, 'date' => date("d.m.Y H:m:s", filemtime($dir . $datei)), 'type' => $dateityp, 'size' => calc_filesize(filesize($dir . $datei)), 'icon' => $icon]; + } + } + + //Ausgeben + echo json_encode($files); + exit; + } +}//Downloaden +elseif (isset($_GET['dl'])) +{ + //echo $_GET['dl']; + if (checkFolder(str_replace($MCONF['web_uri'], '', $_GET['dl']))) + { + //$nixDw = ['doc', 'docx', 'rtf', 'odt', 'ppt', 'pptx', 'odp', 'uop', 'zip', 'rar', '7z', 'bzip', 'gzip', 'tar', 'tar.bz', 'wim', 'xz', 'psd', 'pdd', 'eps', 'ai', 'avi', 'flv']; + $nixDw = []; + //mime + $finfo = finfo_open(FILEINFO_MIME_TYPE); // gib den MIME-Typ nach Art der mimetype Extension zurück + $mime = finfo_file($finfo, '../../' . str_replace($MCONF['web_uri'], '', $_GET['dl'])); + finfo_close($finfo); + $name = explode('/', $_GET['dl']); + //echo $mime; + $dateityp = str_replace('.', '', strrchr(end($name), '.')); + + if (in_array($dateityp, $nixDw)) + { + header('Location: ' . $_GET['dl']); + } else + { + header('content-Description: File Transfer'); + header('content-Type: ' . $mime); + header('content-Disposition: attachment; filename="' . end($name) . '"'); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + header('content-Length: ' . filesize('../../' . str_replace($MCONF['web_uri'], '', $_GET['dl']))); + readfile('../../' . str_replace($MCONF['web_uri'], '', $_GET['dl'])); + } + } else + { + echo 'fail'; + } + exit; +}//Löschen +elseif (isset($_GET['del'], $_POST['file'])) +{ + if (hasPerm('delete')) + { + if (checkFolder($_POST['file'])) + { + if (is_dir('../../' . $_POST['file'])) + { + if (rrmdir('../../' . $_POST['file'])) + { + echo 'success'; + } else + { + echo 'fail'; + } + } else + { + if (unlink('../../' . $_POST['file'])) + { + echo 'success'; + } else + { + echo 'fail'; + } + } + } else + { + echo 'fail'; + } + } + exit; +}//Datei Hochladen +elseif (isset($_GET['upload'])) +{ + if (hasPerm('upload')) + { + /* + * In der php.ini: + * upload_max_filesize = 4000M + * post_max_size = 4000M + * müssen auf einen relativ hohen wert eingestellt sein, sonst kann es vorkommen, + * dass Dateien nicht komplett hochgeldaen werden - auch wenn ein Fortschritt angezeigt wird. + */ + set_time_limit(0); + if (isset($_FILES['file']) && hasPerm('upload')) + { + //print_r($_FILES); + $filename = str_replace(' ', '-', $_FILES['file']['name']); + $filename = str_replace('+', '_', $filename); + $filename = str_replace('/', '_', $filename); + $filename = str_replace("'", '_', $filename); + + if (file_exists('../../' . $_GET['upload']) && is_dir('../../' . $_GET['upload']) && checkFolder($_GET['upload'])) + { + if (move_uploaded_file($_FILES['file']['tmp_name'], '../../' . $_GET['upload'] . $filename)) + { + echo 'success'; + } else + { + echo 'fail'; + } + } else + { + echo 'fail'; + } + } + } + exit; +}//Neuer Ordner erstellen +elseif (isset($_GET['newFolder'])) +{ + if (hasPerm('create_folder')) + { + if (isset($_POST['name'], $_POST['dir']) && checkFolder($_POST['dir'])) + { + if (mkdir('../../' . $_POST['dir'] . str_replace(' ', '-', $_POST['name']))) + { + echo 'success'; + } else + { + echo 'fail'; + } + } + } + exit; +}//Maxfilsize, wie sie in der php.ini steht rausfinden, um uploads mit dieser größe zu ermöglichen +elseif (isset($_GET['max_file_size'])) +{ + echo file_upload_max_size(); + exit; +}//Header +else +{ + printHeader($lang->get('files_title')); +} +if (isset($_SESSION['user'])) +{ + if (hasPerm('manage_files')) + { + ?> +
    + + + + +   get('files_create_dir'); ?> + + + +
    + +
    +
    +
    + + + +
    +
    +
    + + + + + + + + \ No newline at end of file diff --git a/apps/Files/js/files.js b/apps/Files/js/files.js new file mode 100755 index 0000000..8f724ff --- /dev/null +++ b/apps/Files/js/files.js @@ -0,0 +1,360 @@ +function getFiles(folder) { + var filesContent = ''; + console.log(folder); + $.ajax({ + url: webUri + 'module/Files/index.php?json&folder=' + folder, + dataType: 'json', + success: function (data) { + msgDo(' '); + if (folder == '') folder = 'Files'; + if (data.displayUrl == 'Files/') { + $('#delFolder').hide(); + } + else { + $('#delFolder').show(); + //History + var title = $(document).find("title").text(); + historyc(webUri + 'module/Files/index.php?folder_view=' + data.displayUrl, title); + } + + $('#files').html('

    ' + data.displayUrl + '

    DateinameÄnderungsdatumTypGröße
    '); + $.each(data.files, function () { + if (this.name == '..') { + var name = ' ' + this.name; + } else { + var name = ' ' + this.name; + } + + var static_folder = ''; + if (this.icon == 'folder2') { + static_folder = ' class="static"'; + } + //$('#filesContent').append('' + name + '' + this.date + '' + this.type + '' + this.size + ''); + filesContent += '' + name + '' + this.date + '' + this.type + '' + this.size + ''; + }); + }, + timeout: 5000, + error: function (jqXHR, status, errorThrown) { + console.log(errorThrown, status); + var extra_info = status; + if(errorThrown == 'Not Found') extra_info = 'Der Ordner wurde nicht gefunden.'; + showMsg('Ein Fehler ist aufgetreten. (' + extra_info + ') Seite neu laden und erneut versuchen'); + } + }); + + //Tabelle Sortieren + setTimeout(function () { + $('#filesContent').html(filesContent); + $("table").tablesorter({ + widgets: ['staticRow'] + }); + $("table").trigger("sorton", [[[0, 0]]]); + $('#msgDoContainer').hide(); + }, 300); +} + +getFiles(''); + +function openFile(file, type, url) { + console.log(file, type); + if (type == 'folder2') { + var folder_curr = $('#displayUrl').html(); + getFiles(folder_curr + file); + } + else { + $('#extra').html(''); + if (type == 'file-audio-o') {//Audio + $('#content').html(''); + } + else if (type == 'file-movie-o') {//Video + $('#content').html(''); + //$('#content').html(''); + } + else if (type == 'file-picture-o') {//Bild oder Bild, alles was in einen iFrame passt + $('#content').html('
    '); + $('#content').css('margin-top', '32px'); + //Bild Zoom + var img = document.getElementById('imgZoom'); + console.log() + if (img.naturalHeight > 500 || img.naturalWidth > 984) { + $('#imgZoom').click(function () { + $('#imgZoom').toggleClass('zoomedin'); + }); + } + else { + $('#imgZoom').css('cursor', 'default'); + } + } + else if (type == 'file-pdf-o') {//Bild oder Bild, alles was in einen iFrame passt + $('#content').html(''); + $('#content').css('margin-top', '32px'); + } + else if (type == 'file-archive-o' || type == 'file-powerpoint-o' || type == 'file-word-o' || type == 'file-excel-o') {//Nix, weil die Datei nicht angezeigt werden kann -> Archive, Word, pp + + } + else {//Sonst text -> Wenn Sonst oder code + $('#content').html('
    '); + $('#text').load(url); + } + $('#content').append('

    URL:

    Herunterladen Löschen

    '); + + //uuund einbelnden + $(".overlay").fadeIn(250); + + //Rumschieben + //$('.window').drags(); + } +} + +function closeW() { + $(".overlay").fadeOut(200); + setTimeout(function () { + $('#extra').html(''); + }, 300); +} + +function uploadFileBtn() { + $("#upbutton").click(); +} + +//Neuen ordner +function newFolder() { + $('#extra').html(''); + $('#content').append('

    '); + $('#folderName').focus(); + //uuund einbelnden + $(".overlay").fadeIn(250); +} + +function newFolderSub() { + closeW(); + msgDo('Erstelle neuen Ordner...'); + var folder = $('#displayUrl').html(); + $.ajax({ + type: 'POST', + url: webUri + 'module/Files/index.php?newFolder', + data: 'name=' + $('#folderName').val() + '&dir=' + folder, + success: function (msg) { + console.log(msg); + if (msg == 'success') { + showMsg('Der neue Ordner wurde erfolgreich erstellt.'); + getFiles(folder); + $('#msgDoContainer').hide(); + } + else { + showMsg('Fehler beim erstellen des Ordners.'); + $('#msgDoContainer').hide(); + } + } + }); + return false; +} + +//Ordner löschen +function delFolder() { + var file = $('#displayUrl').html(); + $('#extra').html(''); + //uuund einbelnden + $(".overlay").fadeIn(250); +} + +//Datei Löschen +function deleteFile(file) { + $('#extra').html(''); + //uuund einbelnden + $(".overlay").fadeIn(250); +} + +function confirmDeleteFile(file, isdir) { + closeW(); + if (isdir) { + msgDo('Lösche Ordner...'); + } + else { + msgDo('Lösche Datei...'); + } + + $.ajax({ + type: 'POST', + url: webUri + 'module/Files/index.php?del', + data: 'file=' + file, + success: function (msg) { + console.log(msg); + if (msg == 'success') { + if (isdir) { + showMsg('Der Ordner "' + file + '" wurde erfolgreich gelöscht.'); + getFiles(''); + } + else { + showMsg('Die Datei "' + file + '" wurde erfolgreich gelöscht.'); + getFiles($('#displayUrl').html()); + } + $('#msgDoContainer').hide(); + } + else { + showMsg('Fehler beim Löschen der Datei.'); + $('#msgDoContainer').hide(); + } + } + }); +} + +//Upload +//Dropupload +var obj = $(document); +obj.on('dragenter', function (e) +{ + e.stopPropagation(); + e.preventDefault(); + //$(this).css('border', '2px solid #0B85A1'); + console.log('dragenter'); + $('#dropFileArea').show(); +}); + +obj.on('dragover', function (e) +{ + e.stopPropagation(); + e.preventDefault(); + //console.log('dragover'); + //$('#dropFileArea').show(); +}); + +obj.on('drop', function (e) +{ + $('#dropFileArea').hide(); + e.preventDefault(); + var files = e.originalEvent.dataTransfer.files; + + //We need to send dropped files to Server + handleFileUpload(files); +}); + +$('#upbutton').change(function () { + var file = this.files[0]; + var formData = new FormData($('form')[0]); + fileUpload(formData, file); +}); + +function handleFileUpload(files) +{ + for (var i = 0; i < files.length; i++) + { + var fd = new FormData(); + fd.append('file', files[i]); + + fileUpload(fd, files[i]); + } +} + +function fileUpload(formData, file){ + console.log(formData, file); + //max filesize + $.get(webUri + 'module/Files/index.php?max_file_size', function (data) { + if (file.size <= data) { + + var folder = $('#displayUrl').html(); + $.ajax({ + url: webUri + 'module/Files/index.php?upload=' + folder, //Server script to process data + type: 'POST', + xhr: function () { // Custom XMLHttpRequest + var myXhr = $.ajaxSettings.xhr(); + if (myXhr.upload) { // Check if upload property exists + myXhr.upload.addEventListener('progress', progressHandlingFunction, false); // For handling the progress of the upload + } + return myXhr; + }, + //Ajax events + beforeSend: beforeSendHandler, + success: completeHandler, + error: errorHandler, + // Form data + data: formData, + //Options to tell jQuery not to process data or worry about content-type. + cache: false, + contentType: false, + processData: false + }); + } + else { + showMsg('Die ausgewählte Datei ist zu groß!'); + } + }); +} + +function progressHandlingFunction(e) { + if (e.lengthComputable) { + var prozent = (e.loaded / e.total) * 100; + msgDo('Datei wird Hochgeladen... [' + Math.round(prozent * 100) / 100 + '%]
    '); + $('.progbar_btm').css('width', prozent + '%'); + $('#msgDo').css('width', '250px'); + if (prozent == 100) + { + $('#msgDo').css('width', '232px'); + $('#msgDo').html('Datei wird verarbeitet...'); + } + } +} + +function beforeSendHandler() { + console.log('ready'); + $('#upButton').prop("disabled", true); +} + +function completeHandler(msg) { + console.log('upload abgeschlossen', msg); + $('#msgDoContainer').hide(); + $('#upButton').prop("disabled", false); + if(msg == 'success') { + showMsg('Upload abgeschlossen.'); + var folder = $('#displayUrl').html(); + getFiles(folder); + } + else { + showMsg('Upload fehlgeschlagen.'); + } +} + +function errorHandler() { + console.log('upload fehlgeschlagen'); + $('#progressbox').hide(); + $('#msgDoContainer').hide(); + $('#upButton').prop("disabled", false); + showMsg('Upload fehlgeschlagen.'); +} + +//MsgDOO +function msgDo(msg) { + $('#msgDoContainer').css('display', 'inline-block'); + $('#msgDo').html(msg); +} + +//history +function historyc(url, title) { + //Histroy state + var State = History.getState(), $log = $('#log'); + History.Adapter.bind(window, 'statechange', function () { + var State = History.getState(); + }); + History.pushState({state: 1, rand: Math.random()}, title, url); +} + +//Wenn zurücktaste gedrückt +window.addEventListener('popstate', function (event) { + //Histroy state + var State = History.getState(), $log = $('#log'); + History.Adapter.bind(window, 'statechange', function () { + var State = History.getState(); + }); + var title = State.title; + + //Seite wieder zusammenbauen + var curr = $('#displayUrl').html(); + if (curr == 'Files/') { + History.pushState({state: 1, rand: Math.random()}, title, webUri + 'module/Files/index.php'); + getFiles(''); + } + else { + History.pushState({state: 1, rand: Math.random()}, title, webUri + 'module/Files/index.php?folder_view=' + curr); + getFiles(curr + '..'); + } +}); \ No newline at end of file diff --git a/apps/Files/js/jquery.history.js b/apps/Files/js/jquery.history.js new file mode 100755 index 0000000..d16813e --- /dev/null +++ b/apps/Files/js/jquery.history.js @@ -0,0 +1 @@ +(function(e,t){"use strict";var n=e.History=e.History||{},r=e.jQuery;if(typeof n.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");n.Adapter={bind:function(e,t,n){r(e).bind(t,n)},trigger:function(e,t,n){r(e).trigger(t,n)},extractEventData:function(e,n,r){var i=n&&n.originalEvent&&n.originalEvent[e]||r&&r[e]||t;return i},onDomLoad:function(e){r(e)}},typeof n.init!="undefined"&&n.init()})(window),function(e,t){"use strict";var n=e.console||t,r=e.document,i=e.navigator,s=!1,o=e.setTimeout,u=e.clearTimeout,a=e.setInterval,f=e.clearInterval,l=e.JSON,c=e.alert,h=e.History=e.History||{},p=e.history;try{s=e.sessionStorage,s.setItem("TEST","1"),s.removeItem("TEST")}catch(d){s=!1}l.stringify=l.stringify||l.encode,l.parse=l.parse||l.decode;if(typeof h.init!="undefined")throw new Error("History.js Core has already been loaded...");h.init=function(e){return typeof h.Adapter=="undefined"?!1:(typeof h.initCore!="undefined"&&h.initCore(),typeof h.initHtml4!="undefined"&&h.initHtml4(),!0)},h.initCore=function(d){if(typeof h.initCore.initialized!="undefined")return!1;h.initCore.initialized=!0,h.options=h.options||{},h.options.hashChangeInterval=h.options.hashChangeInterval||100,h.options.safariPollInterval=h.options.safariPollInterval||500,h.options.doubleCheckInterval=h.options.doubleCheckInterval||500,h.options.disableSuid=h.options.disableSuid||!1,h.options.storeInterval=h.options.storeInterval||1e3,h.options.busyDelay=h.options.busyDelay||250,h.options.debug=h.options.debug||!1,h.options.initialTitle=h.options.initialTitle||r.title,h.options.html4Mode=h.options.html4Mode||!1,h.options.delayInit=h.options.delayInit||!1,h.intervalList=[],h.clearAllIntervals=function(){var e,t=h.intervalList;if(typeof t!="undefined"&&t!==null){for(e=0;e")&&n[0]);return e>4?e:!1}();return e},h.isInternetExplorer=function(){var e=h.isInternetExplorer.cached=typeof h.isInternetExplorer.cached!="undefined"?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return e},h.options.html4Mode?h.emulated={pushState:!0,hashChange:!0}:h.emulated={pushState:!Boolean(e.history&&e.history.pushState&&e.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(i.userAgent)),hashChange:Boolean(!("onhashchange"in e||"onhashchange"in r)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},h.cloneObject=function(e){var t,n;return e?(t=l.stringify(e),n=l.parse(t)):n={},n},h.getRootUrl=function(){var e=r.location.protocol+"//"+(r.location.hostname||r.location.host);if(r.location.port||!1)e+=":"+r.location.port;return e+="/",e},h.getBaseHref=function(){var e=r.getElementsByTagName("base"),t=null,n="";return e.length===1&&(t=e[0],n=t.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},h.getBaseUrl=function(){var e=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return e},h.getPageUrl=function(){var e=h.getState(!1,!1),t=(e||{}).url||h.getLocationHref(),n;return n=t.replace(/\/+$/,"").replace(/[^\/]+$/,function(e,t,n){return/\./.test(e)?e:e+"/"}),n},h.getBasePageUrl=function(){var e=h.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(e,t,n){return/[^\/]$/.test(e)?"":e}).replace(/\/+$/,"")+"/";return e},h.getFullUrl=function(e,t){var n=e,r=e.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(e)||(r==="/"?n=h.getRootUrl()+e.replace(/^\/+/,""):r==="#"?n=h.getPageUrl().replace(/#.*/,"")+e:r==="?"?n=h.getPageUrl().replace(/[\?#].*/,"")+e:t?n=h.getBaseUrl()+e.replace(/^(\.\/)+/,""):n=h.getBasePageUrl()+e.replace(/^(\.\/)+/,"")),n.replace(/\#$/,"")},h.getShortUrl=function(e){var t=e,n=h.getBaseUrl(),r=h.getRootUrl();return h.emulated.pushState&&(t=t.replace(n,"")),t=t.replace(r,"/"),h.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},h.getLocationHref=function(e){return e=e||r,e.URL===e.location.href?e.location.href:e.location.href===decodeURIComponent(e.URL)?e.URL:e.location.hash&&decodeURIComponent(e.location.href.replace(/^[^#]+/,""))===e.location.hash?e.location.href:e.URL.indexOf("#")==-1&&e.location.href.indexOf("#")!=-1?e.location.href:e.URL||e.location.href},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(e,t){typeof e=="undefined"&&(e=!0),typeof t=="undefined"&&(t=!0);var n=h.getLastSavedState();return!n&&t&&(n=h.createStateObject()),e&&(n=h.cloneObject(n),n.url=n.cleanUrl||n.url),n},h.getIdByState=function(e){var t=h.extractId(e.url),n;if(!t){n=h.getStateString(e);if(typeof h.stateToId[n]!="undefined")t=h.stateToId[n];else if(typeof h.store.stateToId[n]!="undefined")t=h.store.stateToId[n];else{for(;;){t=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof h.idToState[t]=="undefined"&&typeof h.store.idToState[t]=="undefined")break}h.stateToId[n]=t,h.idToState[t]=e}}return t},h.normalizeState=function(e){var t,n;if(!e||typeof e!="object")e={};if(typeof e.normalized!="undefined")return e;if(!e.data||typeof e.data!="object")e.data={};return t={},t.normalized=!0,t.title=e.title||"",t.url=h.getFullUrl(e.url?e.url:h.getLocationHref()),t.hash=h.getShortUrl(t.url),t.data=h.cloneObject(e.data),t.id=h.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,n=!h.isEmptyObject(t.data),(t.title||n)&&h.options.disableSuid!==!0&&(t.hash=h.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id),t.hashedUrl=h.getFullUrl(t.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t},h.createStateObject=function(e,t,n){var r={data:e,title:t,url:n};return r=h.normalizeState(r),r},h.getStateById=function(e){e=String(e);var n=h.idToState[e]||h.store.idToState[e]||t;return n},h.getStateString=function(e){var t,n,r;return t=h.normalizeState(e),n={data:t.data,title:e.title,url:e.url},r=l.stringify(n),r},h.getStateId=function(e){var t,n;return t=h.normalizeState(e),n=t.id,n},h.getHashByState=function(e){var t,n;return t=h.normalizeState(e),n=t.hash,n},h.extractId=function(e){var t,n,r,i;return e.indexOf("#")!=-1?i=e.split("#")[0]:i=e,n=/(.*)\&_suid=([0-9]+)$/.exec(i),r=n?n[1]||e:e,t=n?String(n[2]||""):"",t||!1},h.isTraditionalAnchor=function(e){var t=!/[\/\?\.]/.test(e);return t},h.extractState=function(e,t){var n=null,r,i;return t=t||!1,r=h.extractId(e),r&&(n=h.getStateById(r)),n||(i=h.getFullUrl(e),r=h.getIdByUrl(i)||!1,r&&(n=h.getStateById(r)),!n&&t&&!h.isTraditionalAnchor(e)&&(n=h.createStateObject(null,null,i))),n},h.getIdByUrl=function(e){var n=h.urlToId[e]||h.store.urlToId[e]||t;return n},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||t},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||t},h.hasUrlDuplicate=function(e){var t=!1,n;return n=h.extractState(e.url),t=n&&n.id!==e.id,t},h.storeState=function(e){return h.urlToId[e.url]=e.id,h.storedStates.push(h.cloneObject(e)),e},h.isLastSavedState=function(e){var t=!1,n,r,i;return h.savedStates.length&&(n=e.id,r=h.getLastSavedState(),i=r.id,t=n===i),t},h.saveState=function(e){return h.isLastSavedState(e)?!1:(h.savedStates.push(h.cloneObject(e)),!0)},h.getStateByIndex=function(e){var t=null;return typeof e=="undefined"?t=h.savedStates[h.savedStates.length-1]:e<0?t=h.savedStates[h.savedStates.length+e]:t=h.savedStates[e],t},h.getCurrentIndex=function(){var e=null;return h.savedStates.length<1?e=0:e=h.savedStates.length-1,e},h.getHash=function(e){var t=h.getLocationHref(e),n;return n=h.getHashByUrl(t),n},h.unescapeHash=function(e){var t=h.normalizeHash(e);return t=decodeURIComponent(t),t},h.normalizeHash=function(e){var t=e.replace(/[^#]*#/,"").replace(/#.*/,"");return t},h.setHash=function(e,t){var n,i;return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:t}),!1):(h.busy(!0),n=h.extractState(e,!0),n&&!h.emulated.pushState?h.pushState(n.data,n.title,n.url,!1):h.getHash()!==e&&(h.bugs.setHash?(i=h.getPageUrl(),h.pushState(null,null,i+"#"+e,!1)):r.location.hash=e),h)},h.escapeHash=function(t){var n=h.normalizeHash(t);return n=e.encodeURIComponent(n),h.bugs.hashEscape||(n=n.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),n},h.getHashByUrl=function(e){var t=String(e).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=h.unescapeHash(t),t},h.setTitle=function(e){var t=e.title,n;t||(n=h.getStateByIndex(0),n&&n.url===e.url&&(t=n.title||h.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","<").replace(">",">").replace(" & "," & ")}catch(i){}return r.title=t,h},h.queues=[],h.busy=function(e){typeof e!="undefined"?h.busy.flag=e:typeof h.busy.flag=="undefined"&&(h.busy.flag=!1);if(!h.busy.flag){u(h.busy.timeout);var t=function(){var e,n,r;if(h.busy.flag)return;for(e=h.queues.length-1;e>=0;--e){n=h.queues[e];if(n.length===0)continue;r=n.shift(),h.fireQueueItem(r),h.busy.timeout=o(t,h.options.busyDelay)}};h.busy.timeout=o(t,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(e){return e.callback.apply(e.scope||h,e.args||[])},h.pushQueue=function(e){return h.queues[e.queue||0]=h.queues[e.queue||0]||[],h.queues[e.queue||0].push(e),h},h.queue=function(e,t){return typeof e=="function"&&(e={callback:e}),typeof t!="undefined"&&(e.queue=t),h.busy()?h.pushQueue(e):h.fireQueueItem(e),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(u(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(e){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=o(function(){return h.doubleCheckClear(),h.stateChanged||e(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var t=h.extractState(h.getLocationHref()),n;if(!h.isLastSavedState(t))return n=t,n||(n=h.createStateObject()),h.Adapter.trigger(e,"popstate"),h;return},h.back=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),p.go(-1),!0)},h.forward=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),p.go(1),!0)},h.go=function(e,t){var n;if(e>0)for(n=1;n<=e;++n)h.forward(t);else{if(!(e<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(n=-1;n>=e;--n)h.back(t)}return h};if(h.emulated.pushState){var v=function(){};h.pushState=h.pushState||v,h.replaceState=h.replaceState||v}else h.onPopState=function(t,n){var r=!1,i=!1,s,o;return h.doubleCheckComplete(),s=h.getHash(),s?(o=h.extractState(s||h.getLocationHref(),!0),o?h.replaceState(o.data,o.title,o.url,!1):(h.Adapter.trigger(e,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(r=h.Adapter.extractEventData("state",t,n)||!1,r?i=h.getStateById(r):h.expectedStateId?i=h.getStateById(h.expectedStateId):i=h.extractState(h.getLocationHref()),i||(i=h.createStateObject(null,null,h.getLocationHref())),h.expectedStateId=!1,h.isLastSavedState(i)?(h.busy(!1),!1):(h.storeState(i),h.saveState(i),h.setTitle(i),h.Adapter.trigger(e,"statechange"),h.busy(!1),!0))},h.Adapter.bind(e,"popstate",h.onPopState),h.pushState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.pushState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0},h.replaceState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.replaceState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0};if(s){try{h.store=l.parse(s.getItem("History.store"))||{}}catch(m){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(e,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(h.getLocationHref(),!0))),s&&(h.onUnload=function(){var e,t,n;try{e=l.parse(s.getItem("History.store"))||{}}catch(r){e={}}e.idToState=e.idToState||{},e.urlToId=e.urlToId||{},e.stateToId=e.stateToId||{};for(t in h.idToState){if(!h.idToState.hasOwnProperty(t))continue;e.idToState[t]=h.idToState[t]}for(t in h.urlToId){if(!h.urlToId.hasOwnProperty(t))continue;e.urlToId[t]=h.urlToId[t]}for(t in h.stateToId){if(!h.stateToId.hasOwnProperty(t))continue;e.stateToId[t]=h.stateToId[t]}h.store=e,h.normalizeStore(),n=l.stringify(e);try{s.setItem("History.store",n)}catch(i){if(i.code!==DOMException.QUOTA_EXCEEDED_ERR)throw i;s.length&&(s.removeItem("History.store"),s.setItem("History.store",n))}},h.intervalList.push(a(h.onUnload,h.options.storeInterval)),h.Adapter.bind(e,"beforeunload",h.onUnload),h.Adapter.bind(e,"unload",h.onUnload));if(!h.emulated.pushState){h.bugs.safariPoll&&h.intervalList.push(a(h.safariStatePoll,h.options.safariPollInterval));if(i.vendor==="Apple Computer, Inc."||(i.appCodeName||"")==="Mozilla")h.Adapter.bind(e,"hashchange",function(){h.Adapter.trigger(e,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(e,"hashchange")})}},(!h.options||!h.options.delayInit)&&h.init()}(window) \ No newline at end of file diff --git a/apps/Files/js/jquery.tablesorter.min.js b/apps/Files/js/jquery.tablesorter.min.js new file mode 100755 index 0000000..b8605df --- /dev/null +++ b/apps/Files/js/jquery.tablesorter.min.js @@ -0,0 +1,4 @@ + +(function($){$.extend({tablesorter:new +function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'/\.|\,/g',onRenderHeader:null,selectorHeaders:'thead th',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}if(table.tBodies.length==0)return;var rows=table.tBodies[0].rows;if(rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function checkHeaderOptionsSortingLocked(table,i){if((table.config.headers[i])&&(table.config.headers[i].lockedOrder))return table.config.headers[i].lockedOrder;return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i b["+i+"]) ? 1 : 0));";};function makeSortTextDesc(i){return"((b["+i+"] < a["+i+"]) ? -1 : ((b["+i+"] > a["+i+"]) ? 1 : 0));";};function makeSortNumeric(i){return"a["+i+"]-b["+i+"];";};function makeSortNumericDesc(i){return"b["+i+"]-a["+i+"];";};function sortText(a,b){if(table.config.sortLocaleCompare)return a.localeCompare(b);return((ab)?1:0));};function sortTextDesc(a,b){if(table.config.sortLocaleCompare)return b.localeCompare(a);return((ba)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$.data(this,"tablesorter",config);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){$this.trigger("sortStart");var $cell=$(this);var i=this.column;this.order=this.count++%2;if(this.lockedOrder)this.order=this.lockedOrder;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i=e){d.appendTo($("tbody",a))}else if(c==0){d.prependTo($("tbody",a))}else{d.insertBefore($("tbody tr:eq("+c+")",a))}}})}}}}) \ No newline at end of file diff --git a/apps/Files/lang/lang.de.php b/apps/Files/lang/lang.de.php new file mode 100755 index 0000000..bb22b74 --- /dev/null +++ b/apps/Files/lang/lang.de.php @@ -0,0 +1,47 @@ +Seite neu laden und erneut versuchen'; +$lang['files_url'] = 'URL'; +$lang['files_download'] = 'Herunterladen'; +$lang['files_delete'] = 'Löschen'; +$lang['files_abort'] = 'Abbrechen'; +$lang['files_enter_name'] = 'Namen eingeben...'; +$lang['files_creating_new_folder'] = 'Erstelle neuen Ordner...'; +$lang['files_create_dir_success'] = 'Der neue Ordner wurde erfolgreich erstellt.'; +$lang['files_create_dir_fail'] = 'Fehler beim erstellen des Ordners.'; +$lang['files_delete_file'] = 'löschen'; +$lang['files_delete_dir_confirm'] = 'Ordner wirklich löschen? Dies wird den gesamten Ordner mit Inhalt löschen! Dieser Vorgang kann nicht rückgängig gemacht werden!'; +$lang['files_delete_file_confirm'] = 'Datei wirklich löschen? Dieser Vorgang kann nicht rückgängig gemacht werden!'; +$lang['files_deleting_folder'] = 'Lösche Ordner...'; +$lang['files_deleting_file'] = 'Lösche Datei...'; +$lang['files_delete_dir_success'] = 'Der Ordner wurde erfolgreich gelöscht.'; +$lang['files_delete_file_success'] = 'Die Datei wurde erfolgreich gelöscht.'; +$lang['files_delete_error'] = 'Fehler beim Löschen der Datei.'; +$lang['files_too_large_file'] = 'Die ausgewählte Datei ist zu groß!'; +$lang['files_processing'] = 'Datei wird verarbeitet...'; +$lang['files_upload_finished'] = 'Upload abgeschlossen.'; +$lang['files_upload_failed'] = 'Upload fehlgeschlagen.'; \ No newline at end of file diff --git a/apps/Files/lang/lang.en.php b/apps/Files/lang/lang.en.php new file mode 100755 index 0000000..398f6a9 --- /dev/null +++ b/apps/Files/lang/lang.en.php @@ -0,0 +1,47 @@ +Seite neu laden und erneut versuchen'; +$lang['files_url'] = 'URL'; +$lang['files_download'] = 'Herunterladen'; +$lang['files_delete'] = 'Löschen'; +$lang['files_abort'] = 'Abbrechen'; +$lang['files_enter_name'] = 'Namen eingeben...'; +$lang['files_creating_new_folder'] = 'Erstelle neuen Ordner...'; +$lang['files_create_dir_success'] = 'Der neue Ordner wurde erfolgreich erstellt.'; +$lang['files_create_dir_fail'] = 'Fehler beim erstellen des Ordners.'; +$lang['files_delete_file'] = 'löschen'; +$lang['files_delete_dir_confirm'] = 'Ordner wirklich löschen? Dies wird den gesamten Ordner mit Inhalt löschen! Dieser Vorgang kann nicht rückgängig gemacht werden!'; +$lang['files_delete_file_confirm'] = 'Datei wirklich löschen? Dieser Vorgang kann nicht rückgängig gemacht werden!'; +$lang['files_deleting_folder'] = 'Lösche Ordner...'; +$lang['files_deleting_file'] = 'Lösche Datei...'; +$lang['files_delete_dir_success'] = 'Der Ordner wurde erfolgreich gelöscht.'; +$lang['files_delete_file_success'] = 'Die Datei wurde erfolgreich gelöscht.'; +$lang['files_delete_error'] = 'Fehler beim Löschen der Datei.'; +$lang['files_too_large_file'] = 'Die ausgewählte Datei ist zu groß!'; +$lang['files_processing'] = 'Datei wird verarbeitet...'; +$lang['files_upload_finished'] = 'Upload abgeschlossen.'; +$lang['files_upload_failed'] = 'Upload fehlgeschlagen.'; \ No newline at end of file diff --git a/apps/Files/permissions.json b/apps/Files/permissions.json new file mode 100755 index 0000000..d7e67b0 --- /dev/null +++ b/apps/Files/permissions.json @@ -0,0 +1,28 @@ +{ + "permissions": [ + { + "key": "manage_files", + "name": "Dateien verwalten", + "description": "Dateien ansehen & verwalten", + "critical": false + }, + { + "key": "upload", + "name": "Dateien hochladen", + "description": "", + "critical": false + }, + { + "key": "create_folder", + "name": "Neuen Ordner erstellen", + "description": "", + "critical": false + }, + { + "key": "delete", + "name": "Dateien löschen", + "description": "", + "critical": false + } + ] +} \ No newline at end of file diff --git a/apps/SimplePages/backend/confirm.ini b/apps/SimplePages/backend/confirm.ini new file mode 100755 index 0000000..54134b6 --- /dev/null +++ b/apps/SimplePages/backend/confirm.ini @@ -0,0 +1,3 @@ +confirmationRequierd = true +confirmationUser = 1 +confirmationUserMail = 'k@knt.li' \ No newline at end of file diff --git a/apps/SimplePages/backend/confirm.php b/apps/SimplePages/backend/confirm.php new file mode 100755 index 0000000..0f84f9c --- /dev/null +++ b/apps/SimplePages/backend/confirm.php @@ -0,0 +1,120 @@ +get('sp_confirm')); +if (isset($_GET['page'])) +{ + if ($_SESSION['userid'] == $confirmationUser) + { + //Get the new Content + $db->setCol('simplePages_pages_confirm'); + $db->data['page_id'] = $_GET['page']; + $db->get(); + + if (isset($db->data[0])) + { + $data_new = $db->data[0]; + + //If submitted, insert the new content + if(isset($_POST['confirm'])) + { + $db->setCol('simplePages_pages'); + $db->data = json_decode($_POST['contentToUpdate'], true); + if($db->update(['id' => $_GET['page']])) + { + //Delete the old data + $db->setCol('simplePages_pages_confirm'); + $db->data['page_id'] = $_GET['page']; + $db->delete(); + echo msg('success', $lang->get('sp_confirm_success').' '.$lang->get('back').''); + } + else + { + echo msg('fail', $lang->get('sp_confirm_fail').' '.$lang->get('back').''); + } + + }//If request to delete, delete it + elseif(isset($_POST['delete'])) + { + $db->setCol('simplePages_pages_confirm'); + $db->data['page_id'] = $_GET['page']; + if($db->delete()) + { + echo msg('success', $lang->get('sp_confirm_delete_success').' '.$lang->get('back').''); + } + else + { + echo msg('fail', $lang->get('sp_confirm_delete_fail').' '.$lang->get('back').''); + } + } + else + { + //Get the old Content + $db->setCol('simplePages_pages'); + $db->data['id'] = $_GET['page']; + $db->get(); + if (isset($db->data[0])) + { + $changed = false; + $data_old = $db->data[0]; + + //Find differences between them + $data_display = []; + foreach ($data_new as $key => $new_data) + { + if (array_key_exists($key, $data_old)) + { + if ($new_data != $data_old[$key] && $key != 'id' && $key != 'user' && $key != 'lastedit') + { + $changed = true; + $data_display[$key] = $new_data; + } + } + } + + //Only display differences if any found + if($changed) + { + echo '
    '; + echo '

    '.sprintf($lang->get('sp_confirm_changed'), date('d.m.Y \u\m H:i', $data_new['lastedit']), getUserByID($data_new['user'])).':

    '; + $msg = [ + 'title' => $lang->get('sp_edit_title'), + 'alias' => $lang->get('sp_edit_alias'), + 'content' => $lang->get('sp_edit_content'), + 'status' => $lang->get('sp_edit_status'), + 'meta_description' => $lang->get('sp_edit_description'), + 'meta_keywords' => $lang->get('sp_edit_keywords') + ]; + foreach ($data_display as $key => $data) + { + echo '

    ' . $msg[$key] . ':
    ' . $data . '

    '; + } + + $data_display['user'] = $data_new['user']; + $data_display['lastedit'] = $data_new['lastedit']; + + //echo '
    '.print_r($data_old, true).'
    '; + echo '
    '; + echo '
    '; + } + else + { + echo msg('info', $lang->get('sp_confirm_no_changes').' '.$lang->get('back').''); + } + } + else + { + echo msg('info', $lang->get('sp_confirm_no_changes').' '.$lang->get('back').''); + } + } + } + else + { + echo msg('info', $lang->get('sp_confirm_no_changes').' '.$lang->get('back').''); + } + } + else + { + echo msg('info', $lang->get('missing_permission').' '.$lang->get('back').''); + } +} +require_once '../../../inc/footer.php'; \ No newline at end of file diff --git a/apps/SimplePages/backend/dashboard.php b/apps/SimplePages/backend/dashboard.php new file mode 100755 index 0000000..752f2df --- /dev/null +++ b/apps/SimplePages/backend/dashboard.php @@ -0,0 +1,60 @@ +set('Seiten zum Freischalten', 'sp_pages_confirm', 'de'); + $lang->set('Seiten, die Sie editieren dürfen', 'sp_edit_pages_to_edit', 'de'); + + $lang->set('Seiten zum Freischalten', 'sp_pages_confirm', 'en'); + $lang->set('Seiten, die Sie editieren dürfen', 'sp_edit_pages_to_edit', 'en'); + + //If pages are available for confirmation, show them + $config = parse_ini_file('../apps/SimplePages/backend/confirm.ini'); + if ($_SESSION['userid'] == $config['confirmationUser']) + { + $db->setCol('simplePages_pages_confirm'); + $db->get(); + if(isset($db->data[0])) + { + echo '

    '.$lang->get('sp_edit_pages_to_confirm').':

    '; + + foreach($db->data as $pages) + { + echo ''.$pages['title'].'
    '; + } + } + } + + //Show all pages the user can edit + echo '

    '.$lang->get('sp_edit_pages_to_edit'). ':

    '; + $pages = []; + $db->setCol('simplePages_pages'); + $db->get(); + foreach($db->data as $page) + { + $pages[$page['id']] = $page['title']; + } + + if (hasPerm('admin_manage')) + { + foreach ($pages as $id => $title) + { + echo ' ' . $title . '
    '; + } + } + else + { + $hasPerms = []; + $db->setCol('simplePages_permissions'); + $db->data['user'] = $_SESSION['userid']; + $db->get(); + foreach ($db->data as $item) + { + $hasPerms[] = $item['page']; + } + + foreach ($pages as $id => $title) + { + if(in_array($id, $hasPerms)) echo ' ' . $title . '
    '; + } + } +} \ No newline at end of file diff --git a/apps/SimplePages/backend/edit.php b/apps/SimplePages/backend/edit.php new file mode 100755 index 0000000..ce2fed0 --- /dev/null +++ b/apps/SimplePages/backend/edit.php @@ -0,0 +1,317 @@ +get('sp_edit')); +if (hasPerm('manage_pages')) +{ + tinymce(); + if (isset($_GET['id']) || isset($_GET['new'])) + { + $db->setCol('simplePages_pages'); + if (isset($_POST['submit'])) + { + $content = $_POST['content']; + + $pos = strpos($content, 'EXEC'); + if ($pos !== false) + { + $content = strip_tags($content); + } + + /*if (!$confirmationRequierd) + { + $time = time(); + $seite = str_replace('-', ' ', $seite); + $seite = str_replace('ä', 'ä', $seite); + $seite = str_replace('ö', 'ö', $seite); + $seite = str_replace('ü', 'ü', $seite); + //echo $seite; + $stmt = $DBH->prepare("UPDATE " . $MCONF['db_prefix'] . "seiten SET inhalt=:inhalt, datel=:datel, userl=:userl WHERE name=:seite"); + $stmt->bindParam(':inhalt', $content); + $stmt->bindParam(':datel', $time); + $stmt->bindParam(':userl', $_SESSION['user']); + $stmt->bindParam(':seite', $seite); + + if ($stmt->execute()) + { + echo msg('succes', 'Die Seite "' . $seite . '" wurde erfolgreich geändert. Zurück'); + } else + { + echo msg('fail'); + } + } else + { + $bnutzrid = $_SESSION['user']; + //echo $seite; + $seite = str_replace('-', ' ', $seite); + $seite = str_replace('ä', 'ä', $seite); + $seite = str_replace('ö', 'ö', $seite); + $seite = str_replace('ü', 'ü', $seite); + //echo $seite; + if ($_SESSION['user'] === $confirmationUser) + { + $time = time(); + $STH = $DBH->prepare("UPDATE " . $MCONF['db_prefix'] . "seiten SET inhalt=:inhalt, datel=:datel, userl=:userl WHERE name=:seite"); + $STH->bindParam(':inhalt', $content); + $STH->bindParam(':datel', $time); + $STH->bindParam(':userl', $_SESSION['user']); + $STH->bindParam(':seite', $seite); + + if ($STH->execute()) + { + $STH2 = $DBH->prepare("DELETE FROM " . $MCONF['db_prefix'] . "seitenneu WHERE name=:name"); + $STH2->bindParam(':name', $seite); + if ($STH2->execute()) + { + echo msg('succes', 'Die Seite "' . $seite . '" wurde erfolgreich geändert. Zurück'); + } else + { + echo msg('fail'); + } + } else + { + echo msg('fail'); + } + } else + { + $time = time(); + $stmt2 = $DBH->prepare("INSERT INTO " . $MCONF['db_prefix'] . "seitenneu (name, inhalt, geaendertby, datum) VALUES (:name, :inhalt, :geaendertby, :datum)"); + $stmt2->bindParam(':name', $seite); + $stmt2->bindParam(':inhalt', $content); + $stmt2->bindParam(':geaendertby', $bnutzrid); + $stmt2->bindParam(':datum', $time); + + if ($stmt2->execute() and freischaltemail($seite)) + { + echo msg('succes', 'Die Seite ' . $seite . ' wurde erfolgreich geändert. Diese Änderungen werden öffentlich, sobald ' . $confirmationUser . ' sie Freigegeben hat. Zurück'); + } else + { + echo msg('fail'); + } + }*/ + // + $db->clear(); + //If a confirmation by user is requiered, insert it in another table and send an email + if($confirmationRequierd) + { + if($_SESSION['userid'] == $confirmationUser) + { + $db->setCol('simplePages_pages'); + } + else + { + //Delete old pages, we only want the newest version in the database + $db->clear(); + $db->setCol('simplePages_pages_confirm'); + $db->data['page_id'] = $_GET['id']; + $db->delete(); + + $db->setCol('simplePages_pages_confirm'); + $db->data['page_id'] = $_GET['id']; + } + } + else + { + $db->setCol('simplePages_pages'); + } + + $db->data['title'] = $_POST['title']; + $db->data['alias'] = str_replace(' ', '-', $_POST['alias']); + $db->data['content'] = $_POST['content']; + $db->data['user'] = $_SESSION['userid']; + $status = 0; + if (isset($_POST['status'])) $status = $_POST['status']; + $db->data['status'] = $status; + $db->data['meta_description'] = $_POST['meta_description']; + $db->data['meta_keywords'] = $_POST['meta_keywords']; + $db->data['lastedit'] = time(); + + //$db->update(['id' => $_GET['id']]); + $id = 0; + if (isset($_GET['new'])) + { + if(hasPerm('create_new')) + { + if ($db->insert()) + { + $id = $db->lastID(); + if($confirmationRequierd && ($_SESSION['userid'] != $confirmationUser)) + { + echo msg('succes', sprintf($lang->get('sp_edit_created'), $_POST['title']).' '.sprintf($lang->get('sp_edit_edited_need_confirm'), getUserByID($confirmationUser)).' '.$lang->get('back').''); + } + else + { + echo msg('succes', sprintf($lang->get('sp_edit_created'), $_POST['title']).' '.$lang->get('back').''); + } + } + else + { + echo msg('fail', $lang->get('sp_edit_edit_error')); + } + } + else + { + echo msg('info', $lang->get('missing_permission').' {back}'); + } + } + else + { + $id = $_GET['id']; + if($confirmationRequierd && ($_SESSION['userid'] != $confirmationUser)) + { + if ($db->insert()) + { + echo msg('succes', sprintf($lang->get('sp_edit_edited'), $_POST['title']).' '.sprintf($lang->get('sp_edit_edited_need_confirm'), getUserByID($confirmationUser)).' '.$lang->get('back').''); + } + else + { + echo msg('fail', $lang->get('sp_edit_edit_error')); + } + } + else + { + if ($db->update(['id' => $_GET['id']])) + { + echo msg('succes', sprintf($lang->get('sp_edit_edited'), $_POST['title']).' '.$lang->get('back').''); + } + else + { + echo msg('fail', $lang->get('sp_edit_edit_error')); + } + } + } + + //Send an email + if($confirmationRequierd && ($_SESSION['userid'] != $confirmationUser)) + { + $subject = sprintf($lang->get('sp_edit_confirm_subject'), $_POST['title']); + $message = sprintf($lang->get('sp_edit_confirm_message'), $_SESSION['user'], $_POST['title'], $MCONF['web_uri'] . 'apps/SimplePages/backend/confirm.php?page=' . $id); + $header = 'From: noreply@' . $_SERVER['SERVER_NAME'] . "\r\n" . + 'Reply-To: noreply@' . $_SERVER['SERVER_NAME'] . "\r\n" . + 'X-Mailer: PHP/' . phpversion() . + 'MIME-Version: 1.0' . "\r\n" . + 'content-type: text/html; charset=UTF-8' . "\r\n"; + mail($confirmationUserMail, $subject, $message, $header); + } + } + else + { + if (isset($_GET['del'])) + { + if (isset($_POST['confirm'])) + { + $db->data['id'] = $_GET['id']; + if ($db->delete()) + { + echo msg('succes', $lang->get('sp_edit_delete_success').' '.$lang->get('back').''); + } + else + { + echo msg('fail'); + } + } + else + { + echo '
    '; + $db->data['id'] = $_GET['id']; + $db->get(); + if (isset($db->data[0]['title'])) + { + echo '

    '.sprintf($lang->get('sp_edit_delete'), $db->data[0]['title']) . '

    +

    '.sprintf($lang->get('sp_edit_delete_confirm'), $db->data[0]['title']).'
    +

    + + '.$lang->get('general_no').' +
    '; + } + else + { + echo $lang->get('sp_edit_page_not_found').''; + } + } + } + else + { + if(!hasPerm('create_new') && isset($_GET['new'])) + { + echo msg('info', $lang->get('missing_permission').' {back}'); + exit; + } + echo '
    '; + + //If the page has unconfirmed changes, show a message + if(isset($_GET['id'])) + { + $db->clear(); + $db->setCol('simplePages_pages_confirm'); + $db->data['page_id'] = $_GET['id']; + $db->get(); + if (isset($db->data[0])) + { + echo '

    ' . sprintf($lang->get('sp_edit_edited_not_confirmed'), date('d.m.Y \u\m H:i', $db->data[0]['lastedit']), getUserByID($db->data[0]['user'])) . '

    '; + } + } + + $data[0] = ['title' => '', 'alias' => '', 'status' => '', 'meta_keywords' => '', 'meta_description' => '', 'content' => '']; + if (isset($_GET['id'])) + { + $db->setCol('simplePages_pages'); + $db->data['id'] = $_GET['id']; + $db->get(); + $data[0] = $db->data[0]; + } + + if (isset($db->data[0]['id']) || isset($_GET['new'])) + { + if (isset($_GET['new'])) + { + echo '

    '.$lang->get('sp_edit_create_new').'

    '; + } + else + { + echo '

    '.sprintf($lang->get('sp_edit_edit_page'), $data[0]['title']) . '

    '; + } + + if (isset($data[0]['user'], $data[0]['lastedit'])) echo '

    '.sprintf($lang->get('sp_edit_last_edited'), getUserByID($data[0]['user']), date('d.m.Y H:i', $data[0]['lastedit'])) . '

    '; + ?> + + +
    +

    get('sp_edit_title');?>: +

    +

    get('sp_edit_alias');?>: +

    +

    get('sp_edit_public');?>:/>

    +

    get('sp_edit_keywords');?>:

    +

    get('sp_edit_description');?>:

    +

    +

    get('sp_edit_content');?>:

    + + +
    + get('sp_edit_page_not_found'); + } + } + } + } else + { + echo $lang->get('sp_edit_no_page_defined'); + } + ?> +
    + get('missing_permission').' {back}'); +} +require_once '../../../inc/footer.php'; +?> \ No newline at end of file diff --git a/apps/SimplePages/backend/install - Kopie.php b/apps/SimplePages/backend/install - Kopie.php new file mode 100755 index 0000000..866919c --- /dev/null +++ b/apps/SimplePages/backend/install - Kopie.php @@ -0,0 +1,71 @@ +Installation erfolgreich

    Diese Meldung siehst du, wenn die Installation erfolgreich war. Jetzt geh schnell in den Adminbereich um die erste Seite vernünftig anzulegen.

    ', ''), +('Impressum', '

    Impressum

    Bitte schnellstmöglichst ein Impressum einfügen, z.B. hier.

    ', ''), +('Kontakt', '

    Hier können Kontaktdaten eingetragen werden, diese erscheinen dann oben über dem Kontaktforumlar.

    ', ''), +('Datenschutzerklaerung', '

    Datenschutzerklärung

    Geltungsbereich

    Diese Datenschutzerklärung klärt Nutzer über die Art, den Umfang und Zwecke der Erhebung und Verwendung personenbezogener Daten durch den verantwortlichen Anbieter [HIER BITTE IHREN NAMEN, ADRESSE, EMAIL UND TELEFONNUMMER EINTRAGEN] auf dieser Website (im folgenden “Angebot”) auf.
    +
    +Die rechtlichen Grundlagen des Datenschutzes finden sich im Bundesdatenschutzgesetz (BDSG) und dem Telemediengesetz (TMG).
    +
    +

    Zugriffsdaten/ Server-Logfiles

    Der Anbieter (beziehungsweise sein Webspace-Provider) erhebt Daten über jeden Zugriff auf das Angebot (so genannte Serverlogfiles). Zu den Zugriffsdaten gehören:
    +
    +Name der abgerufenen Webseite, Datei, Datum und Uhrzeit des Abrufs, übertragene Datenmenge, Meldung über erfolgreichen Abruf, Browsertyp nebst Version, das Betriebssystem des Nutzers, Referrer URL (die zuvor besuchte Seite), IP-Adresse und der anfragende Provider.
    +
    +Der Anbieter verwendet die Protokolldaten nur für statistische Auswertungen zum Zweck des Betriebs, der Sicherheit und der Optimierung des Angebotes. Der Anbieterbehält sich jedoch vor, die Protokolldaten nachträglich zu überprüfen, wenn aufgrund konkreter Anhaltspunkte der berechtigte Verdacht einer rechtswidrigen Nutzung besteht.

    Umgang mit personenbezogenen Daten

    Personenbezogene Daten sind Informationen, mit deren Hilfe eine Person bestimmbar ist, also Angaben, die zurück zu einer Person verfolgt werden können. Dazu gehören der Name, die Emailadresse oder die Telefonnummer. Aber auch Daten über Vorlieben, Hobbies, Mitgliedschaften oder welche Webseiten von jemandem angesehen wurden zählen zu personenbezogenen Daten.
    +
    +Personenbezogene Daten werden von dem Anbieter nur dann erhoben, genutzt und weiter gegeben, wenn dies gesetzlich erlaubt ist oder die Nutzer in die Datenerhebung einwilligen.

    Kontaktaufnahme

    Bei der Kontaktaufnahme mit dem Anbieter (zum Beispiel per Kontaktformular oder E-Mail) werden die Angaben des Nutzers zwecks Bearbeitung der Anfrage sowie für den Fall, dass Anschlussfragen entstehen, gespeichert.

    Kommentare und Beiträge

    Wenn Nutzer Kommentare im Blog oder sonstige Beiträge hinterlassen, werden ihre IP-Adressen gespeichert. Das erfolgt zur Sicherheit des Anbieters, falls jemand in Kommentaren und Beiträgen widerrechtliche Inhalte schreibt (Beleidigungen, verbotene politische Propaganda, etc.). In diesem Fall kann der Anbieter selbst für den Kommentar oder Beitrag belangt werden und ist daher an der Identität des Verfassers interessiert.

    Newsletter

    Mit dem Newsletter informieren wir Sie über uns und unsere Angebote.
    +
    +Wenn Sie den Newsletter empfangen möchten, benötigen wir von Ihnen eine valide Email-Adresse sowie Informationen, die uns die Überprüfung gestatten, dass Sie der Inhaber der angegebenen Email-Adresse sind bzw. deren Inhaber mit dem Empfang des Newsletters einverstanden ist. Weitere Daten werden nicht erhoben. Diese Daten werden nur für den Versand der Newsletter verwendet und werden nicht an Dritte weiter gegeben.
    +
    +Mit der Anmeldung zum Newsletter speichern wir Ihre IP-Adresse und das Datum der Anmeldung. Diese Speicherung dient alleine dem Nachweis im Fall, dass ein Dritter eine Emailadresse missbraucht und sich ohne Wissen des Berechtigten für den Newsletterempfang anmeldet.
    +
    +Ihre Einwilligung zur Speicherung der Daten, der Email-Adresse sowie deren Nutzung zum Versand des Newsletters können Sie jederzeit widerrufen. Der Widerruf kann über einen Link in den Newslettern selbst, in Ihrem Profilbereich oder per Mitteilung an die oben stehenden Kontaktmöglichkeiten erfolgen.
    +

    Einbindung von Diensten und Inhalten Dritter

    Es kann vorkommen, dass innerhalb dieses Onlineangebotes Inhalte Dritter, wie zum Beispiel Videos von YouTube, Kartenmaterial von Google-Maps, RSS-Feeds oder Grafiken von anderen Webseiten eingebunden werden. Dies setzt immer voraus, dass die Anbieter dieser Inhalte (nachfolgend bezeichnet als \"Dritt-Anbieter\") die IP-Adresse der Nutzer wahr nehmen. Denn ohne die IP-Adresse, könnten sie die Inhalte nicht an den Browser des jeweiligen Nutzers senden. Die IP-Adresse ist damit für die Darstellung dieser Inhalte erforderlich. Wir bemühen uns nur solche Inhalte zu verwenden, deren jeweilige Anbieter die IP-Adresse lediglich zur Auslieferung der Inhalte verwenden. Jedoch haben wir keinen Einfluss darauf, falls die Dritt-Anbieter die IP-Adresse z.B. für statistische Zwecke speichern. Soweit dies uns bekannt ist, klären wir die Nutzer darüber auf.
    +

    Cookies

    Cookies sind kleine Files, die es ermöglichen, auf dem Zugriffsgerät der Nutzer (PC, Smartphone o.ä.) spezifische, auf das Gerät bezogene Informationen zu speichern. Sie dienen zum einem der Benutzerfreundlichkeit von Webseiten und damit den Nutzern (z.B. Speicherung von Logindaten). Zum anderen dienen sie, um die statistische Daten der Webseitennutzung zu erfassen und sie zwecks Verbesserung des Angebotes analysieren zu können. Die Nutzer können auf den Einsatz der Cookies Einfluss nehmen. Die meisten Browser verfügen eine Option mit der das Speichern von Cookies eingeschränkt oder komplett verhindert wird. Allerdings wird darauf hingewiesen, dass die Nutzung und insbesondere der Nutzungskomfort ohne Cookies eingeschränkt werden.
    +
    +Sie können viele Online-Anzeigen-Cookies von Unternehmen über die US-amerikanische Seite http://www.aboutads.info/choices/ oder die EU-Seite http://www.youronlinechoices.com/uk/your-ad-choices/ verwalten.

    Widerruf, Änderungen, Berichtigungen und Aktualisierungen

    Der Nutzer hat das Recht, auf Antrag unentgeltlich Auskunft zu erhalten über die personenbezogenen Daten, die über ihn gespeichert wurden. Zusätzlich hat der Nutzer das Recht auf Berichtigung unrichtiger Daten, Sperrung und Löschung seiner personenbezogenen Daten, soweit dem keine gesetzliche Aufbewahrungspflicht entgegensteht.
    +

    Datenschutz-Muster von Rechtsanwalt Thomas Schwenke - I LAW it

    ', ''); + +CREATE TABLE IF NOT EXISTS `seitenneu` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` text NOT NULL, + `inhalt` longtext NOT NULL, + `geaendertby` text NOT NULL, + `datum` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;"; + $dbtables = $DBH->prepare($dbtables); + if($dbtables->execute()) + { + $configini = fopen('freischalt.ini', "w") or die("Unable to open file!"); + $txt = 'freischaltmailReq = '.$_POST['freischalt_y'].' \n mail_adresse_freischalttyp = "'.$_POST['freischalt_m'].'" \n freischalten_name = "'.$_POST['freischalt_n'].'"'; + fwrite($configini, $txt); + fclose($configini); + echo msg('succes', 'Das Seitenmodul wurde erfolgreich eingerichtet.
    '); + } + else + { + echo msg('fail', 'Fehler beim Einrichten des Seitenmoduls.'); + exit; + } +} +else +{ + echo 'Benötigt Freischaltung der Inhalte

    + Benutzername des Freischaltenden Benutzers

    + Mailadressen des Freischaltenden Benutzers

    '; +} +?> \ No newline at end of file diff --git a/apps/SimplePages/backend/install.php b/apps/SimplePages/backend/install.php new file mode 100755 index 0000000..82b7fe2 --- /dev/null +++ b/apps/SimplePages/backend/install.php @@ -0,0 +1,71 @@ +Installation erfolgreich

    Diese Meldung siehst du, wenn die Installation erfolgreich war. Jetzt geh schnell in den Adminbereich um die erste Seite vernünftig anzulegen.

    ', ''), +('Impressum', '

    Impressum

    Bitte schnellstmöglichst ein Impressum einfügen, z.B. hier.

    ', ''), +('Kontakt', '

    Hier können Kontaktdaten eingetragen werden, diese erscheinen dann oben über dem Kontaktforumlar.

    ', ''), +('Datenschutzerklaerung', '

    Datenschutzerklärung

    Geltungsbereich

    Diese Datenschutzerklärung klärt Nutzer über die Art, den Umfang und Zwecke der Erhebung und Verwendung personenbezogener Daten durch den verantwortlichen Anbieter [HIER BITTE IHREN NAMEN, ADRESSE, EMAIL UND TELEFONNUMMER EINTRAGEN] auf dieser Website (im folgenden “Angebot”) auf.
    +
    +Die rechtlichen Grundlagen des Datenschutzes finden sich im Bundesdatenschutzgesetz (BDSG) und dem Telemediengesetz (TMG).
    +
    +

    Zugriffsdaten/ Server-Logfiles

    Der Anbieter (beziehungsweise sein Webspace-Provider) erhebt Daten über jeden Zugriff auf das Angebot (so genannte Serverlogfiles). Zu den Zugriffsdaten gehören:
    +
    +Name der abgerufenen Webseite, Datei, Datum und Uhrzeit des Abrufs, übertragene Datenmenge, Meldung über erfolgreichen Abruf, Browsertyp nebst Version, das Betriebssystem des Nutzers, Referrer URL (die zuvor besuchte Seite), IP-Adresse und der anfragende Provider.
    +
    +Der Anbieter verwendet die Protokolldaten nur für statistische Auswertungen zum Zweck des Betriebs, der Sicherheit und der Optimierung des Angebotes. Der Anbieterbehält sich jedoch vor, die Protokolldaten nachträglich zu überprüfen, wenn aufgrund konkreter Anhaltspunkte der berechtigte Verdacht einer rechtswidrigen Nutzung besteht.

    Umgang mit personenbezogenen Daten

    Personenbezogene Daten sind Informationen, mit deren Hilfe eine Person bestimmbar ist, also Angaben, die zurück zu einer Person verfolgt werden können. Dazu gehören der Name, die Emailadresse oder die Telefonnummer. Aber auch Daten über Vorlieben, Hobbies, Mitgliedschaften oder welche Webseiten von jemandem angesehen wurden zählen zu personenbezogenen Daten.
    +
    +Personenbezogene Daten werden von dem Anbieter nur dann erhoben, genutzt und weiter gegeben, wenn dies gesetzlich erlaubt ist oder die Nutzer in die Datenerhebung einwilligen.

    Kontaktaufnahme

    Bei der Kontaktaufnahme mit dem Anbieter (zum Beispiel per Kontaktformular oder E-Mail) werden die Angaben des Nutzers zwecks Bearbeitung der Anfrage sowie für den Fall, dass Anschlussfragen entstehen, gespeichert.

    Kommentare und Beiträge

    Wenn Nutzer Kommentare im Blog oder sonstige Beiträge hinterlassen, werden ihre IP-Adressen gespeichert. Das erfolgt zur Sicherheit des Anbieters, falls jemand in Kommentaren und Beiträgen widerrechtliche Inhalte schreibt (Beleidigungen, verbotene politische Propaganda, etc.). In diesem Fall kann der Anbieter selbst für den Kommentar oder Beitrag belangt werden und ist daher an der Identität des Verfassers interessiert.

    Newsletter

    Mit dem Newsletter informieren wir Sie über uns und unsere Angebote.
    +
    +Wenn Sie den Newsletter empfangen möchten, benötigen wir von Ihnen eine valide Email-Adresse sowie Informationen, die uns die Überprüfung gestatten, dass Sie der Inhaber der angegebenen Email-Adresse sind bzw. deren Inhaber mit dem Empfang des Newsletters einverstanden ist. Weitere Daten werden nicht erhoben. Diese Daten werden nur für den Versand der Newsletter verwendet und werden nicht an Dritte weiter gegeben.
    +
    +Mit der Anmeldung zum Newsletter speichern wir Ihre IP-Adresse und das Datum der Anmeldung. Diese Speicherung dient alleine dem Nachweis im Fall, dass ein Dritter eine Emailadresse missbraucht und sich ohne Wissen des Berechtigten für den Newsletterempfang anmeldet.
    +
    +Ihre Einwilligung zur Speicherung der Daten, der Email-Adresse sowie deren Nutzung zum Versand des Newsletters können Sie jederzeit widerrufen. Der Widerruf kann über einen Link in den Newslettern selbst, in Ihrem Profilbereich oder per Mitteilung an die oben stehenden Kontaktmöglichkeiten erfolgen.
    +

    Einbindung von Diensten und Inhalten Dritter

    Es kann vorkommen, dass innerhalb dieses Onlineangebotes Inhalte Dritter, wie zum Beispiel Videos von YouTube, Kartenmaterial von Google-Maps, RSS-Feeds oder Grafiken von anderen Webseiten eingebunden werden. Dies setzt immer voraus, dass die Anbieter dieser Inhalte (nachfolgend bezeichnet als \"Dritt-Anbieter\") die IP-Adresse der Nutzer wahr nehmen. Denn ohne die IP-Adresse, könnten sie die Inhalte nicht an den Browser des jeweiligen Nutzers senden. Die IP-Adresse ist damit für die Darstellung dieser Inhalte erforderlich. Wir bemühen uns nur solche Inhalte zu verwenden, deren jeweilige Anbieter die IP-Adresse lediglich zur Auslieferung der Inhalte verwenden. Jedoch haben wir keinen Einfluss darauf, falls die Dritt-Anbieter die IP-Adresse z.B. für statistische Zwecke speichern. Soweit dies uns bekannt ist, klären wir die Nutzer darüber auf.
    +

    Cookies

    Cookies sind kleine Files, die es ermöglichen, auf dem Zugriffsgerät der Nutzer (PC, Smartphone o.ä.) spezifische, auf das Gerät bezogene Informationen zu speichern. Sie dienen zum einem der Benutzerfreundlichkeit von Webseiten und damit den Nutzern (z.B. Speicherung von Logindaten). Zum anderen dienen sie, um die statistische Daten der Webseitennutzung zu erfassen und sie zwecks Verbesserung des Angebotes analysieren zu können. Die Nutzer können auf den Einsatz der Cookies Einfluss nehmen. Die meisten Browser verfügen eine Option mit der das Speichern von Cookies eingeschränkt oder komplett verhindert wird. Allerdings wird darauf hingewiesen, dass die Nutzung und insbesondere der Nutzungskomfort ohne Cookies eingeschränkt werden.
    +
    +Sie können viele Online-Anzeigen-Cookies von Unternehmen über die US-amerikanische Seite http://www.aboutads.info/choices/ oder die EU-Seite http://www.youronlinechoices.com/uk/your-ad-choices/ verwalten.

    Widerruf, Änderungen, Berichtigungen und Aktualisierungen

    Der Nutzer hat das Recht, auf Antrag unentgeltlich Auskunft zu erhalten über die personenbezogenen Daten, die über ihn gespeichert wurden. Zusätzlich hat der Nutzer das Recht auf Berichtigung unrichtiger Daten, Sperrung und Löschung seiner personenbezogenen Daten, soweit dem keine gesetzliche Aufbewahrungspflicht entgegensteht.
    +

    Datenschutz-Muster von Rechtsanwalt Thomas Schwenke - I LAW it

    ', ''); + +CREATE TABLE IF NOT EXISTS `seitenneu` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` text NOT NULL, + `inhalt` longtext NOT NULL, + `geaendertby` text NOT NULL, + `datum` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;"; + $dbtables = $DBH->prepare($dbtables); + if($dbtables->execute()) + { + $configini = fopen('freischalt.ini', "w") or die("Unable to open file!"); + $txt = 'freischaltmailReq = '.$_POST['freischalt_y'].' \n mail_adresse_freischalttyp = "'.$_POST['freischalt_m'].'" \n freischalten_name = "'.$_POST['freischalt_n'].'"'; + fwrite($configini, $txt); + fclose($configini); + echo msg('succes', 'Das Seitenmodul wurde erfolgreich eingerichtet.
    '); + } + else + { + echo msg('fail', 'Fehler beim Einrichten des Seitenmoduls.'); + exit; + } +} +else +{ + echo '

    SimplePages

    Benötigt Freischaltung der Inhalte

    + Benutzername des Freischaltenden Benutzers

    + Mailadressen des Freischaltenden Benutzers

    '; +} +?> \ No newline at end of file diff --git a/apps/SimplePages/backend/management.php b/apps/SimplePages/backend/management.php new file mode 100755 index 0000000..1662ac4 --- /dev/null +++ b/apps/SimplePages/backend/management.php @@ -0,0 +1,91 @@ +get('sp_manage_pages')); +if (hasPerm('manage_pages')) +{ + ?> +
    +

      '.$lang->get('sp_create_new').'

    '; + } + ?>

    + + + + + + + + + + setCol('simplePages_pages'); + $db->get(); + foreach($db->data as $page) + { + $pages[$page['id']] = $page; + } + + if (hasPerm('admin_manage'))//If the User has the persmission to edit every page + { + foreach ($pages as $id => $pageitem) + { + echo ''; + echo ''; + if ($pageitem['lastedit'] != 0) + { + echo ''; + } + else + { + echo ''; + } + echo ''; + echo ''; + } + } + else + { + $hasPerms = []; + $db->setCol('simplePages_permissions'); + $db->data['user'] = $_SESSION['userid']; + $db->get(); + foreach ($db->data as $item) + { + $hasPerms[] = $item['page']; + } + + foreach ($pages as $id => $pageitem) + { + if(in_array($id, $hasPerms)) + { + echo ''; + echo ''; + if ($pageitem['lastedit'] != 0) + { + echo ''; + } + else + { + echo ''; + } + echo ''; + echo ''; + } + } + } + ?> + +
    get('sp_page');?>get('sp_last_edit');?>get('sp_action');?>
    ' . $pageitem['title'] . ''.sprintf($lang->get('sp_edited_by_date'), date('d.m.Y H:i:s', $pageitem['lastedit']), getUserByID($pageitem['user'])) . ''.$lang->get('sp_never').' '.$lang->get('sp_edit').' | '.$lang->get('sp_delete').' | '.$lang->get('sp_preview').'
    ' . $pageitem['title'] . ''.sprintf($lang->get('sp_edited_by_date'), date('d.m.Y H:i:s', $pageitem['lastedit']), getUserByID($pageitem['user'])) . ''.$lang->get('sp_never').' '.$lang->get('sp_edit').' | '.$lang->get('sp_delete').' | '.$lang->get('sp_preview').'
    +
    + get('missing_permission').' {back}'); +} +require_once '../../../inc/footer.php'; +?> \ No newline at end of file diff --git a/apps/SimplePages/backend/permissions.php b/apps/SimplePages/backend/permissions.php new file mode 100755 index 0000000..5ae3b3d --- /dev/null +++ b/apps/SimplePages/backend/permissions.php @@ -0,0 +1,121 @@ +get('sp_manage_permissions')); + +if (hasPerm('grant_permissions')) +{ + //Users + $db->setCol('system_admins'); + $db->get(); + $users_2 = $db->data; + $user = []; + foreach ($users_2 as $user_2) + { + $user[$user_2['id']] = ['username' => $user_2['username'], 'lvl' => $user_2['lvl']]; + } + + if (isset($_POST['submit'])) + { + if (isset($user[$_POST['user']])) + { + /*if ($user[$_POST['user']]['lvl'] === 'super') + { + echo msg(null, $user[$_POST['user']]['username'] . $lang->get('sp_').' ist ein Superuser, daher hat er Zugriff auf alle Seiten.'); + } + else + {*/ + $db->setCol('simplePages_permissions'); + $db->data['page'] = $_POST['page']; + $db->data['user'] = $_POST['user']; + $db->get(); + + if (isset($db->data[0]['id'])) + { + echo msg(null, sprintf($lang->get('sp_user_already_access'), $user[$_POST['user']]['username'])); + } + else + { + $db->data['page'] = $_POST['page']; + $db->data['user'] = $_POST['user']; + $db->data['lastedit'] = time(); + if ($db->insert()) + { + echo msg('succes', $lang->get('sp_grant_permissions_success')); + } else + { + echo msg('fail', $lang->get('sp_grant_permissions_fail')); + } + } + //} + } else + { + echo msg(null, $lang->get('sp_user_nexist')); + } + } else + { + ?> +
    + + + + + + + + setCol('simplePages_pages'); + $db->get(); + foreach ($db->data as $data) + { + echo ''; + ?> + + '; + } + ?> +
    get('sp_page');?>get('sp_preview');?>get('sp_permissions');?>get('sp_manage_permission');?>
    ' . $data['title'] . '' . $data['title'] . ' '; + + $user_count = 1; + $db->setCol('simplePages_permissions'); + $db->data['page'] = $data['id']; + $db->get(); + $perms = $db->data; + foreach ($perms as $perm) + { + if ($user_count > 1) + { + echo ', ' . $user[$perm['user']]['username']; + } else + { + echo $user[$perm['user']]['username']; + } + $user_count++; + } + echo ' +
    + + + +
    +
    + get('missing_permission').' {back}'); +} +?> +
    + \ No newline at end of file diff --git a/apps/SimplePages/config.php b/apps/SimplePages/config.php new file mode 100755 index 0000000..2dcf80b --- /dev/null +++ b/apps/SimplePages/config.php @@ -0,0 +1,40 @@ +set('Seiten', 'sp_pages', 'de'); +$GLOBALS['lang']->set('Seitenverwaltung', 'sp_manage_pages', 'de'); +$GLOBALS['lang']->set('Berechtigungen verwalten', 'sp_manage_permissions', 'de'); +$GLOBALS['lang']->set('Neue Seite erstellen', 'sp_create_new', 'de'); + +$GLOBALS['lang']->set('Pages', 'sp_pages', 'en'); +$GLOBALS['lang']->set('Manage Pages', 'sp_manage_pages', 'en'); +$GLOBALS['lang']->set('Manage Permissions', 'sp_manage_permissions', 'en'); +$GLOBALS['lang']->set('Create New Page', 'sp_create_new', 'en'); + +$_CONF['mod_name'] = 'SimplePages'; +$_CONF['mod_desc'] = 'Wird benutzt, um Einfache statische Seitn zu erzeugen und zu verwalten.'; +$_CONF['base_url'] = '/'; //Basisurl des moduls, wenn es über das Frontend aufgerufen wird +$_CONF['base_file'] = 'front/page.php'; //Datei, die angezeigt wird, wenn die basisurl aufgerufen wird +$_CONF['menu_top'] = ' '.$GLOBALS['lang']->get('sp_pages'); //Name des Moduls, wie es im Adminbereich im Hauptmenü auftaucht +$_CONF['menu'] = [' '.$GLOBALS['lang']->get('sp_manage_pages') => 'backend/management.php', + ' '.$GLOBALS['lang']->get('sp_manage_permissions') => 'backend/permissions.php', + ' '.$GLOBALS['lang']->get('sp_create_new') => 'backend/edit.php?new']; //Ein Array mit menüpunkten im adminbereich +$_CONF['dashboard'] = 'backend/dashboard.php'; +$_CONF['type'] = 'page'; +$_CONF['install'] = 'install.php'; + +$confirmationRequierd = false; +$iniFile = 'confirm.ini'; +if(strpos($_SERVER['SCRIPT_FILENAME'], '/apps/') === false) +{ + $iniFile = '../SimplePages/backend/confirm.ini'; +} + +if(file_exists($iniFile)) +{ + $config = parse_ini_file($iniFile); + $confirmationRequierd = $config['confirmationRequierd']; + $confirmationUserMail = $config['confirmationUserMail']; + $confirmationUser = $config['confirmationUser']; +} + +//print_r($config); \ No newline at end of file diff --git a/apps/SimplePages/front/page.php b/apps/SimplePages/front/page.php new file mode 100755 index 0000000..a9f5916 --- /dev/null +++ b/apps/SimplePages/front/page.php @@ -0,0 +1,42 @@ +setCol('simplePages_pages'); +$db->data['alias'] = urldecode($page->getUrl()); +$db->get(); + +if(isset($db->data[0]['title'])) +{ + if($db->data[0]['status'] == 1) + { + $page->setResponseCode(200); + $page->setTitle($db->data[0]['title']); + $meta = ''; + + //gucken ob das was auszuführren ist + $pos = strpos($db->data[0]['content'], 'EXEC '); + if ($pos !== false) + { + $file = str_replace('EXEC ', '', $db->data[0]['content']); + if (file_exists($file)) + { + require_once $file; + } else + { + $page->setContent($db->data[0]['content']); + + //Meta + if(isset($db->data[0]['meta_description']) && $db->data[0]['meta_description'] != '') $meta .= ' ' . "\n"; + if(isset($db->data[0]['meta_keywords']) && $db->data[0]['meta_keywords'] != '') $meta .= ' ' . "\n"; + } + } + else + { + $page->setContent($db->data[0]['content']); + + //Meta + if(isset($db->data[0]['meta_description']) && $db->data[0]['meta_description'] != '') $meta .= ' ' . "\n"; + if(isset($db->data[0]['meta_keywords']) && $db->data[0]['meta_keywords'] != '') $meta .= ' ' . "\n"; + } + + $page->assign('meta', $meta, true); + } +} \ No newline at end of file diff --git a/apps/SimplePages/index.html b/apps/SimplePages/index.html new file mode 100755 index 0000000..e69de29 diff --git a/apps/SimplePages/lang/lang.de.php b/apps/SimplePages/lang/lang.de.php new file mode 100755 index 0000000..72431d4 --- /dev/null +++ b/apps/SimplePages/lang/lang.de.php @@ -0,0 +1,77 @@ +Freischalten'; +$lang['sp_edit_delete_success'] = 'Die Seite wurde erfolgreich gelöscht.'; +$lang['sp_edit_delete'] = '"%1$s" löschen'; +$lang['sp_edit_delete_confirm'] = 'Soll die Seite "%1$s" wirklich gelöscht werden?
    Dieser Vorgang kann nicht rückgängig gemacht werden!'; +$lang['sp_edit_page_not_found'] = 'Diese Seite existiert nicht.'; +$lang['sp_edit_edited_not_confirmed'] = 'Diese Seite wurde am %1$s von %2$s geändert und noch nicht freigeschaltet.'; +$lang['sp_edit_create_new'] = 'Neue Seite erstellen'; +$lang['sp_edit_edit_page'] = '"%1$s" bearbeiten'; +$lang['sp_edit_last_edited'] = 'Zuletzt bearbeitet von %1$s am %2$s'; +$lang['sp_edit_save'] = 'Speichern'; +$lang['sp_edit_no_page_defined'] = 'Es ist keine Seite definiert.'; \ No newline at end of file diff --git a/apps/SimplePages/lang/lang.en.php b/apps/SimplePages/lang/lang.en.php new file mode 100755 index 0000000..648a28c --- /dev/null +++ b/apps/SimplePages/lang/lang.en.php @@ -0,0 +1,77 @@ +Freischalten'; +$lang['sp_edit_delete_success'] = 'Die Seite wurde erfolgreich gelöscht.'; +$lang['sp_edit_delete'] = '"%1$s" löschen'; +$lang['sp_edit_delete_confirm'] = 'Soll die Seite "%1$s" wirklich gelöscht werden?
    Dieser Vorgang kann nicht rückgängig gemacht werden!'; +$lang['sp_edit_page_not_found'] = 'Diese Seite existiert nicht.'; +$lang['sp_edit_edited_not_confirmed'] = 'Diese Seite wurde am %1$s von %2$s geändert und noch nicht freigeschaltet.'; +$lang['sp_edit_create_new'] = 'Neue Seite erstellen'; +$lang['sp_edit_edit_page'] = '"%1$s" bearbeiten'; +$lang['sp_edit_last_edited'] = 'Zuletzt bearbeitet von %1$s am %2$s'; +$lang['sp_edit_save'] = 'Speichern'; +$lang['sp_edit_no_page_defined'] = 'Es ist keine Seite definiert.'; \ No newline at end of file diff --git a/apps/SimplePages/permissions.json b/apps/SimplePages/permissions.json new file mode 100755 index 0000000..605d2f0 --- /dev/null +++ b/apps/SimplePages/permissions.json @@ -0,0 +1,34 @@ +{ + "permissions": [ + { + "key": "manage_pages", + "name": "Seiten verwalten", + "description": "", + "critical": false + }, + { + "key": "admin_manage", + "name": "Alle Seiten verwalten", + "description": "Administrativ alle Seiten verwalten. Nutzer ohne diese Berechtigung dürfen nur ihnen zugewiesene Seiten bearbeiten.", + "critical": false + }, + { + "key": "create_new", + "name": "Neue Seiten erstellen", + "description": "Darf der Nutzer neue Seiten erstellen?", + "critical": false + }, + { + "key": "grant_permissions", + "name": "Berechtigungen vergeben", + "description": "Anderen Nutzern erlauben, bestimmte Seiten zu bearbeiten.", + "critical": true + }, + { + "key": "view_dashboard", + "name": "Dashboard ansehen", + "description": "Auf dem Dashboard eine Liste von Seiten einsehen.", + "critical": false + } + ] +} \ No newline at end of file diff --git a/apps/index.html b/apps/index.html new file mode 100755 index 0000000..e69de29 diff --git a/apps/logfiles/Log.class.php b/apps/logfiles/Log.class.php new file mode 100755 index 0000000..d355240 --- /dev/null +++ b/apps/logfiles/Log.class.php @@ -0,0 +1,398 @@ +logDir=$logDir; + $this->logFile=$logFile; + if($countFile) $this->countFile=$this->logDir . "/$countFile"; + $this->headerTitle=$headerTitle; + $this->logMode=$logMode; + + + + //generate log number //es: genero el NRO DE LOG + //set counter file and log folder //es: seteo el archivo contador y la carpeta de logs + $countFile=$this->countFile; + $logDir=$this->logDir; + + //verify log folder existence //es: verifico que exista la carpeta de logs + //if it doesn't I create it //es: si no existe la creo + if(!is_dir($logDir)){ + if(mkdir($logDir)===FALSE){ + echo "Could not create log dir"; //es: 'No es posible crear el directorio de logs'; + } + } + + + //Counter INICILIZATION //es: INICIALIZACIÓN del Counter + if(file_exists($countFile)===FALSE){ + //if log counter file does not exist, I create it //es: si el archivo de conteo de logs no existe lo genero + touch($countFile); + + //inicializing file in 0 //es: inicializo el archivo en 0 + $initNumber=0; + $fp=fopen($countFile,"a"); + if(fwrite($fp,$initNumber)===FALSE){ + echo "Could not write Counter file"; //es: "No es posible escribir el archivo Contador"; + } + fclose($fp); + } + //------------------------------------------------------------ + + + //INCREMENT Counter //es: AUMENTO del Counter + //read counter //es: leo el contador + $logNumber=trim(file_get_contents($countFile)); + $logNumber++; //increment counter //es: incremento el contador + + //set log number in class var //es: seteo la variable de Clase con el nro de log + $this->logNumber=$logNumber; + + //write incremented counter value //es: escribo el contador aumentado en 1 + $fp=fopen($countFile,"w+"); + if(fwrite($fp,$logNumber)===FALSE){ + echo "Could not write Counter file"; //es: "No es posible escribir el archivo Contador"; + } + fclose($fp); + //----------------------------------------------------- + }//end function + + //----------------------------------------------------------------- + + /** + * @return void + * @param String $logString + * @desc + Recieves the string you want lo log. + This function is used by "logThis" function, + which offers simplified logging with + some practical functions. + + //spanish + Recibe la cadena a loggear en el archivo de logs. + Esta función es utilizada por "logThis", + función que ofrece un uso simplificado de logging + con varias funciones prácticas. + */ + function writeLogging($logString){ + global $logNumber; + + + //depending on selected log mode... //es: según el modo de log definido... + //use only one log file, or one file per log instance //es: uso un único archivo o un archivo por log + if($this->logMode=='oneFilePerLogging'){ + $logFile=$this->logDir . "/" . $this->logFile . $logNumber . '.log'; + } else { + //"oneFile" mode + $logFile=$this->logDir . "/" . $this->logFile . '.log'; + } + + //in case file does not exist //es: considero que el archivo no exista + if(file_exists($logFile)===FALSE){ + //if log file does not exist, I create it //es: si el archivo de log no existe lo genero + touch($logFile); + + //generate file header //es: genero el encabezado del archivo + $logHeader =$this->headerTitle . "\n"; //. " " . $logNumber . "\n"; + $logHeader.='--------------------------------------------------------------------' . "\n"; + + $fp=fopen($logFile,"w+"); + if(fwrite($fp,$logHeader)===FALSE){ + echo "Could not write LOG Header"; //es: "No es posible escribir el Header del archivo de LOG"; + } + fclose($fp); + }//end if fileExists + //----------------------------------- + + + + //write to log file //es: escribo el archivo de LOG + $fp=fopen($logFile,"a"); + if(fwrite($fp,$logString)===FALSE){ + echo "Could not write to LOG file"; //es: "No es posible escribir el archivo de LOG"; + } + fclose($fp); + }//end function + + //----------------------------------------------------------------- + + /** + * @return void + * @param String $string + * @param String $modifier + * @desc + Writes to LOG File each recieved value. + To write the log we use the function "writeLogging". + + Esta función va escribiendo en el archivo de LOG + a medida que recibe valores. + Para escribir el log se recurre a la función "writeLogging". + + Output: $this->writeLogging() + Will directly write to log file + */ + function logThis($string,$modifier="empty"){ + //provides a global counter //es: la función provee un contador global + global $logThisCounter; + + + + + //for logThisCounter to start in 1 //es: para que el logThisCounter comience en 1 + if(!isset($logThisCounter)){ + $logThisCounter=0; + } + + + //set "line" separator //es: seteo el separador "line" + $line="\n" . '--------------------------------------------------------------------' . "\n"; + + + + + //it uses modifiers only if a log function has not + //been passed + + //spanish + //uso los modificadores sólo si no se ha seteado el uso + //de una función de log en forma directa. + //se considera la posibilidad de pasar sólo una línea, por ej, + //como: logThis('f:line'), en tal caso no se usan modificadores + if(substr($string,0,2)!='f:'){ + //manejo distintos tipos de modificadores + switch($modifier){ + case 'empty': + $this->writeLogging($string . "\n"); + break; + + case 'n': + $this->writeLogging($string . "\n"); + break; + + case '2n': + $this->writeLogging($string . "\n\n"); + break; + + case '3n': + $this->writeLogging($string . "\n\n\n"); + break; + + case 'line': + $this->writeLogging($string . $line); + break; + + case '2line': + $this->writeLogging($string . $line . $line); + break; + + case 'nLine': + $this->writeLogging($string . "\n" . $line); + break; + + case '2nLine': + $this->writeLogging($string . "\n\n" . $line); + break; + + case 'n2Line': + $this->writeLogging($string . "\n" . $line . $line); + break; + }//end switch $modifier + } else { + //---------------- + //FUNCTIONS - "F:" + //-------------------------------------------------- + //using a log function passed in $string //es: aquí estoy utilizando una función de log pasada en $string + //example: logThis('f:line') + switch($string){ + case 'f:line': + $this->writeLogging($line); + break; + + case 'f:2line': + $this->writeLogging($line . $line); + break; + + case 'f:nl': + $this->writeLogging("\n"); + break; + + case 'f:2nl': + $this->writeLogging("\n\n"); + break; + + case 'f:logNumber': + $this->writeLogging('+ LOG Number: ' . $this->logNumber . "\n"); + break; + + case 'f:counter': + switch($modifier){ + case 'empty': + $logThisCounter++; + $this->writeLogging($logThisCounter); + break; + + default: + $logThisCounter++; + $this->writeLogging($modifier . $logThisCounter); + break; + }//end switch f:counter + break; + + case 'f:counter.nl': + switch($modifier){ + case 'empty': + $logThisCounter++; + $this->writeLogging($logThisCounter . "\n"); + break; + + default: + $logThisCounter++; + $this->writeLogging($modifier . $logThisCounter . "\n"); + break; + }//end switch f:counter + break; + + case 'f:nl.counter': + switch($modifier){ + case 'empty': + $logThisCounter++; + $this->writeLogging("\n" . $logThisCounter); + break; + + default: + $logThisCounter++; + $this->writeLogging("\n" . $modifier . $logThisCounter); + break; + }//end switch f:counter + break; + + case 'f:nl.counter.nl': + switch($modifier){ + case 'empty': + $logThisCounter++; + $this->writeLogging("\n" . $logThisCounter . "\n"); + break; + + default: + $logThisCounter++; + $this->writeLogging("\n" . $modifier . $logThisCounter . "\n"); + break; + }//end switch f:counter + break; + }//end switch $string + + }//end if "f:" + + + } + + //---------------------------------------------- + + /** + * @return String $fecha + * @desc + Return formatted actual date. + Example: 28.08.2005 - 01:14 + + + //spanish + Devuelve la fecha actual formateada. + */ + function get_formatted_date(){ + $fecha=date("d.m.Y - ") . (date("H")) . date(":i"); + + return $fecha; + } + + //----------------------------------------------------------------- + /** + * Delete a file, or a folder and its contents + * + * @author Aidan Lister + * @version 1.0.2 + * @param string $dirname Directory to delete + * @return bool Returns TRUE on success, FALSE on failure + */ + function rmdirr($dirname) + { + // Sanity check + if (!file_exists($dirname)) { + //echo 'dir not exist: ' . $dirname . "
    \n"; + return false; + } + + // Simple delete for a file + if (is_file($dirname)) { + return unlink($dirname); //delete files inside dir //acá elimina los archivos dentro del dir + //echo 'DELETED FILE: ' . $dirname . "
    \n"; + } + + + if(is_dir($dirname)){ + // Loop through the folder + $dir = dir($dirname); + while (false !== $entry = $dir->read()) { + // Skip pointers + if ($entry == '.' || $entry == '..') { + continue; + } + + // Recurse + $this->rmdirr("$dirname/$entry"); + } + + // Clean up + $dir->close(); + return rmdir($dirname); //delete empty dir //acá elimina el directorio que ya quedó vacío + //echo 'DELETED DIR : ' . $dirname . "
    \n"; + }//fin if is dir + + + + } + //----------------------------------------------------------------- + + /** + * @return void + * @desc + Deletes log dir and its contents. + + //spanish + Elimina el directorio de Loggings y su contenido + para comenzar un nuevo proceso de log desde cero. + */ + function clean(){ + $this->rmdirr($this->logDir); + } + + + +} //end class Logging + + + + + + +?> \ No newline at end of file diff --git a/apps/logfiles/config.php b/apps/logfiles/config.php new file mode 100755 index 0000000..4f6b944 --- /dev/null +++ b/apps/logfiles/config.php @@ -0,0 +1,15 @@ +set('Logfiles', 'log_title', 'de'); +$GLOBALS['lang']->set('Logfiles', 'log_title', 'en'); + +$_CONF['mod_name'] = 'Logfiles'; +$_CONF['mod_desc'] = 'Logfiles'; +//$_CONF['base_url'] = 'demomodul/'; //Basisurl des moduls, wenn es über das Frontend aufgerufen wird +$_CONF['base_file'] = 'log.php'; //Datei, die angezeigt wird, wenn die basisurl aufgerufen wird +$_CONF['menu_top'] = ' '.$GLOBALS['lang']->get('log_title'); //Name des Moduls, wie es im Adminbereich im Hauptmenü auftaucht +$_CONF['menu'] = ['menu_top' => 'index.php']; //Ein Array mit menüpunkten im Backoffice +//$_CONF['dashboard'] = 'dashboard.php'; //Optional, eine Datei, welche im admindashboard angezeigt wird +$_CONF['type'] = 'static'; +$_CONF['install'] = 'install.php'; +?> \ No newline at end of file diff --git a/apps/logfiles/index.html b/apps/logfiles/index.html new file mode 100755 index 0000000..e69de29 diff --git a/apps/logfiles/index.php b/apps/logfiles/index.php new file mode 100755 index 0000000..12547ef --- /dev/null +++ b/apps/logfiles/index.php @@ -0,0 +1,176 @@ + +
    + "Januar", + '02' => "Februar", + '03' => "März", + '04' => "April", + '05' => "Mai", + '06' => "Juni", + '07' => "Juli", + '08' => "August", + '09' => "September", + '10' => "Oktober", + '11' => "November", + '12' => "Dezember"); + if (isset($_GET['detail'])) + { + $logfile = $_GET['detail'] . '.log'; + $logN = explode('-', str_replace('.log', '', $logfile)); + echo '

    '. $lang->get('log_detail_title'). ' ' . $logN[2] . '. ' . $monate[$logN[1]] . ' ' . $logN[0] . '

    '; + //var_dump($_SERVER); + ?> +
    + + +
    + $line)//logfile ausgeben + { + if ($line_num > 1) + { + if (isset($_POST['filter']))//filtern + { + if (strpos($line, $_POST['filter']) !== false)//mit post + { + $line_s = explode(' ', $line); + echo ''.$line_s[0].' '.str_replace($line_s[0], '', $line). '
    '; + //echo $line . '
    '; + $i++; + } + } elseif (isset($_GET['filter']))//filtern + { + if (strpos($line, $_GET['filter']) !== false)//mit get + { + $line_s = explode(' ', $line); + echo ''.$line_s[0].' '.str_replace($line_s[0], '', $line). '
    '; + $i++; + } + } else//ungefiltert + { + $line_s = explode(' ', $line); + echo ''.$line_s[0].' '.str_replace($line_s[0], '', $line). '
    '; + $i++; + } + } + } + echo ''.$i . ' ' . $lang->get('log_views_total').''; + } else + { + echo '

    '.$lang->get('log_file_not_found').'

    '; + } + } elseif (isset($_GET['detailmon'])) + { + $logmon = $_GET['detailmon']; + $logmonN = explode('-', $logmon); + + echo '

    '.$lang->get('log_detail_title_from').' ' . $monate[$logmonN[0]] . ' ' . $logmonN[1] . '

    '; + ?> +
    + + +
    + $line)//ausgeben + { + if ($line_num > 1) + { + if (isset($_POST['filter']))//filtern + { + if (strpos($line, $_POST['filter']) !== false)//mit post + { + $line_s = explode(' ', $line); + echo ''.$line_s[0].' '.str_replace($line_s[0], '', $line). '
    '; + $i++; + } + } elseif (isset($_GET['filter']))//filtern + { + if (strpos($line, $_GET['filter']) !== false)//mit get + { + $line_s = explode(' ', $line); + echo ''.$line_s[0].' '.str_replace($line_s[0], '', $line). '
    '; + $i++; + } + } else//ungefiltert + { + $line_s = explode(' ', $line); + echo ''.$line_s[0].' '.str_replace($line_s[0], '', $line). '
    '; + $i++; + } + } + } + } + } + } + echo ''.$i . ' ' . $lang->get('log_views_total').''; + } else + { + echo '

    '.$lang->get('log_total_pageviews').' ' . file_get_contents('../../' . $MCONF['log_uri'] . '/count.counter') . '

    '; + $monatelogs = []; + //monatslogliste erstellen + if ($handle = opendir('../../' . $MCONF['log_uri'] . '')) + { + while (false !== ($file = readdir($handle))) + { + if ($file != "." && $file != ".." && $file != 'count.counter') + { + $strtiel = []; + $strtiel = explode('-', str_replace('.log', '', $file)); + $logsatr = $strtiel[0] . '-' . $strtiel[1]; + if (!in_array($logsatr, $monatelogs)) + { + $monatelogs[] = $strtiel[0] . '-' . $strtiel[1]; + } + //echo ''.$file.'
    '; + } + } + closedir($handle); + } + + //var_dump($monatelogs); + //monatsloglist ausgeben + asort($monatelogs); + foreach ($monatelogs as $log) + { + $logN = explode('-', $log); + echo '

    ' . $monate[$logN[1]] . ' ' . $logN[0] . '

    '; + if ($handle = opendir('../../' . $MCONF['log_uri'] . '')) + { + while (false !== ($file = readdir($handle))) + { + if ($file != "." && $file != ".." && strpos($file, $log) !== false) + { + echo '' . str_replace('.log', '', $file) . '
    '; + } + } + closedir($handle); + } + echo ''.sprintf($lang->get('log_show_full_logs'), $monate[$logN[1]], $logN[0]) . ''; + } + } +} else +{ + echo msg('info', $lang->get('missing_permission')); +} +?> +
    + \ No newline at end of file diff --git a/apps/logfiles/install.php b/apps/logfiles/install.php new file mode 100644 index 0000000..fd3bb56 --- /dev/null +++ b/apps/logfiles/install.php @@ -0,0 +1,13 @@ + +

    Logfiles

    + Log-Folder + + logThis($logstring); \ No newline at end of file diff --git a/apps/logfiles/permissions.json b/apps/logfiles/permissions.json new file mode 100755 index 0000000..a94705e --- /dev/null +++ b/apps/logfiles/permissions.json @@ -0,0 +1,10 @@ +{ + "permissions": [ + { + "key": "view_logfiles", + "name": "Logfiles ansehen", + "description": "", + "critical": false + } + ] +} \ No newline at end of file diff --git a/apps/meta/config.php b/apps/meta/config.php new file mode 100755 index 0000000..5c60170 --- /dev/null +++ b/apps/meta/config.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/apps/meta/genConf.php b/apps/meta/genConf.php new file mode 100755 index 0000000..d63be30 --- /dev/null +++ b/apps/meta/genConf.php @@ -0,0 +1,46 @@ +setCol('meta_meta'); + $db->delete(); + + $db->clear(); + $db->setCol('meta_meta'); + + foreach ($_POST['metaName'] as $pos => $metaName) + { + if($metaName!='' && $_POST['metaContent'][$pos]!='') + { + $db->data = ['name' => $metaName, 'content' => $_POST['metaContent'][$pos]]; + $db->insert(); + } + } +} +else +{ + echo '

    Metadaten

    Leere Metafelder werden nicht gespeichert.

    '; + $i = 1; + $db->setCol('meta_meta'); + $db->get(); + foreach ($db->data as $data) + { + echo '

    '.$data['name'].':

    '; + $i++; + } + echo '
    '; + ?> +

    Metafeld hinzufügen

    + + \ No newline at end of file diff --git a/apps/meta/index.html b/apps/meta/index.html new file mode 100755 index 0000000..e69de29 diff --git a/apps/meta/install - Kopie.php b/apps/meta/install - Kopie.php new file mode 100755 index 0000000..aa46501 --- /dev/null +++ b/apps/meta/install - Kopie.php @@ -0,0 +1,28 @@ +prepare($dbtables); + if($dbtables->execute()) + { + echo msg('succes', 'Das Metamodul wurde erfolgreich eingerichtet.
    '); + } + else + { + echo msg('fail', 'Fehler beim Einrichten des Metamoduls.'); + exit; + } +} +?> \ No newline at end of file diff --git a/apps/meta/install.php b/apps/meta/install.php new file mode 100755 index 0000000..aa46501 --- /dev/null +++ b/apps/meta/install.php @@ -0,0 +1,28 @@ +prepare($dbtables); + if($dbtables->execute()) + { + echo msg('succes', 'Das Metamodul wurde erfolgreich eingerichtet.
    '); + } + else + { + echo msg('fail', 'Fehler beim Einrichten des Metamoduls.'); + exit; + } +} +?> \ No newline at end of file diff --git a/apps/meta/meta.php b/apps/meta/meta.php new file mode 100755 index 0000000..1b0bb9d --- /dev/null +++ b/apps/meta/meta.php @@ -0,0 +1,11 @@ +setCol('meta_meta'); +$db->get(); + +foreach($db->data as $data) +{ + $meta .= ' ' . "\n"; +} + +$page->assign('meta', $meta, true); \ No newline at end of file diff --git a/apps/sidebar/config.php b/apps/sidebar/config.php new file mode 100755 index 0000000..d3fc9b0 --- /dev/null +++ b/apps/sidebar/config.php @@ -0,0 +1,7 @@ +setCol('sidebar_sidebar'); + $db->data = ['active' => $active, 'content' => $text]; + if ($db->update()) + { + echo msg('succes', 'Die Änderungen der Sidebar wurden erfolgreich gespeichert.'); + } + else + { + echo msg('fail'); + } +} +else +{ + echo '

    Sidebar

    '; + + $db->setCol('sidebar_sidebar'); + $db->get(); + + $active = ''; + if(!$db->data[0]['active']) $active = ' selected'; + ?> +

    Sidebar anzeigen: + +

    +
    +
    + Sidebar-Inhalt: +
    + +
    + + + \ No newline at end of file diff --git a/apps/sidebar/index.html b/apps/sidebar/index.html new file mode 100755 index 0000000..e69de29 diff --git a/apps/sidebar/install - Kopie.php b/apps/sidebar/install - Kopie.php new file mode 100755 index 0000000..b76d401 --- /dev/null +++ b/apps/sidebar/install - Kopie.php @@ -0,0 +1,23 @@ +Hier erscheint der Inhalt der Sidebar

    ');"; + $dbtables = $DBH->prepare($dbtables); + if($dbtables->execute()) + { + echo msg('succes', 'Das Sidebarmodul wurde erfolgreich eingerichtet.
    '); + } + else + { + echo msg('fail', 'Fehler beim Einrichten des Sidebarmoduls.'); + exit; + } +} +?> \ No newline at end of file diff --git a/apps/sidebar/install.php b/apps/sidebar/install.php new file mode 100755 index 0000000..b76d401 --- /dev/null +++ b/apps/sidebar/install.php @@ -0,0 +1,23 @@ +Hier erscheint der Inhalt der Sidebar

    ');"; + $dbtables = $DBH->prepare($dbtables); + if($dbtables->execute()) + { + echo msg('succes', 'Das Sidebarmodul wurde erfolgreich eingerichtet.
    '); + } + else + { + echo msg('fail', 'Fehler beim Einrichten des Sidebarmoduls.'); + exit; + } +} +?> \ No newline at end of file diff --git a/apps/sidebar/sidebar.php b/apps/sidebar/sidebar.php new file mode 100755 index 0000000..de2757f --- /dev/null +++ b/apps/sidebar/sidebar.php @@ -0,0 +1,14 @@ +setCol('sidebar_sidebar'); +$db->get(); + +if(isset($db->data[0])) +{ + if(isset($db->data[0]['active']) && $db->data[0]['active'] == 1) + { + $sidebar = ''; + } +} + +$page->assign('sidebar', $sidebar); \ No newline at end of file diff --git a/content/Bilder/bg.jpg b/content/Bilder/bg.jpg new file mode 100755 index 0000000..926d3e7 Binary files /dev/null and b/content/Bilder/bg.jpg differ diff --git a/content/Bilder/favicon.ico b/content/Bilder/favicon.ico new file mode 100755 index 0000000..c9614d2 Binary files /dev/null and b/content/Bilder/favicon.ico differ diff --git a/content/Bilder/index.html b/content/Bilder/index.html new file mode 100755 index 0000000..e69de29 diff --git a/content/css/index.html b/content/css/index.html new file mode 100755 index 0000000..e69de29 diff --git a/content/css/layout.css b/content/css/layout.css new file mode 100755 index 0000000..4dd60ee --- /dev/null +++ b/content/css/layout.css @@ -0,0 +1 @@ +@import "style.css"; \ No newline at end of file diff --git a/content/css/layout_print.css b/content/css/layout_print.css new file mode 100755 index 0000000..7330479 --- /dev/null +++ b/content/css/layout_print.css @@ -0,0 +1 @@ +@import "style_print.css"; \ No newline at end of file diff --git a/content/css/style.css b/content/css/style.css new file mode 100755 index 0000000..80c4ec8 --- /dev/null +++ b/content/css/style.css @@ -0,0 +1,164 @@ +/*Grundlegendes*/ +html { + height: 100%; +} + +* { + margin: 0; + padding: 0; +} + +body { + font-family: sans-serif; + text-align: center; + background: url(../Bilder/bg.jpg) repeat center fixed #fff; + color: #444; +} + +h1, h2, h3, h4, h5, h6 { + letter-spacing: 0em; + padding: 0 0 5px 0; +} + +h1, h2, h3 { + margin: 0 0 15px 0; + padding: 15px 0 5px 0; +} + +h2 { + font-size: 160%; + padding: 9px 0 5px 0; +} + +h3 { + font-size: 140%; + padding: 5px 0 0 0; +} + +h4, h6 { + color: #F67F00; + padding: 0 0 5px 0; +} + +h5, h6 { + color: #888; + letter-spacing: normal; + padding: 0 0 15px 0; +} + +a, a:hover { + outline: none; + text-decoration: underline; +} + +a:hover { + text-decoration: none; +} + +/*HTML5 Elemente für ältere Browser*/ +article, aside, figure, footer, header, hgroup, nav, section { + display: block; +} + +/*Seite*/ +.container { + text-align: left; + width: 957px; + margin: 0 auto 0 auto; +} + +.seite { + background: #fff; + padding: 5px; +} + +.sidebar { + float: right; + width: 200px; + padding: 5px; + margin: -5px; +} + +.menu ,.footer { + padding: 5px; + height: 35px; +} + +/*Menu*/ +ul.menu li { + display: inline; +} +/*footer*/ +.footer { + text-align: center; + padding: 10px; + height: 25px; + clear: both; +} + +.footer a { + text-decoration: none; +} + +.footer a:hover { + text-decoration: underline; +} + +ul,ol { + margin-left: 25px; +} + +/*Formular*/ +form span { + width: 200px; + float: left; +} + +form p { + margin: 5px 0; +} + +input,textarea { + display: inline-block; + margin: 5px; + padding: 4px; + transition: 0.3s ease; + -o-transition: 0.3s ease; + -webkit-transition: 0.3s ease; +} + +input:focus,textarea:focus { + outline: 0 none; +} + +textarea { + width: 480px; + height: 100px; +} + +a.button ,input[type=submit] { + text-decoration: none; + padding: 5px; + margin: 7px; + transition: 0.3s ease; + -o-transition: 0.3s ease; + -webkit-transition: 0.3s ease; +} + +a.button:hover,input[type=submit]:hover { + text-decoration: none; + cursor: pointer; +} + +/*Kommentare*/ +.kommentar{ + margin: 5px; + padding: 5px; +} + +.dtnm{ + display: block; + float: right; + font-size: 13px; + margin-left: 5px; +} \ No newline at end of file diff --git a/content/css/style_print.css b/content/css/style_print.css new file mode 100755 index 0000000..e69de29 diff --git a/content/css/tinymce.css b/content/css/tinymce.css new file mode 100755 index 0000000..d21407c --- /dev/null +++ b/content/css/tinymce.css @@ -0,0 +1,11 @@ +*{ + margin: 0; + padding: 0; +} + +body { + font-family: sans-serif; + text-align: left; + color: #444; + font-size: 16px; +} \ No newline at end of file diff --git a/content/index.html b/content/index.html new file mode 100755 index 0000000..e69de29 diff --git a/content/template.tpl.htm b/content/template.tpl.htm new file mode 100755 index 0000000..561cd0b --- /dev/null +++ b/content/template.tpl.htm @@ -0,0 +1,25 @@ + + + + {$title} + +{$meta} + + + + + +
    + {$menu} +
    + {$sidebar} + {$inhalt} + {$test} + {$test2} +
    + +
    + + \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100755 index 0000000..c9614d2 Binary files /dev/null and b/favicon.ico differ diff --git a/inc/System/404.txt b/inc/System/404.txt new file mode 100755 index 0000000..09a466f --- /dev/null +++ b/inc/System/404.txt @@ -0,0 +1,2 @@ +

    Fehler 404

    +

    Die Seite wurde nicht gefunden

    \ No newline at end of file diff --git a/inc/System/construction2.txt b/inc/System/construction2.txt new file mode 100755 index 0000000..c48c608 --- /dev/null +++ b/inc/System/construction2.txt @@ -0,0 +1 @@ +

    Baustelle

    \ No newline at end of file diff --git a/inc/System/index.html b/inc/System/index.html new file mode 100755 index 0000000..e69de29 diff --git a/inc/autoload.php b/inc/autoload.php new file mode 100755 index 0000000..be8f446 --- /dev/null +++ b/inc/autoload.php @@ -0,0 +1,32 @@ +setLangFolder( $path.'../../admin/lang/'); +if(file_exists($path.'lang/') && is_dir($path.'lang/')) +{ + $lang->setLangFolder( $path.'lang/'); +} + +//Require appsConfig +require_once $path.'config.php'; + +require_once $path.'../../inc/libs/functions.php'; diff --git a/inc/autoload_adm.php b/inc/autoload_adm.php new file mode 100755 index 0000000..7c333ec --- /dev/null +++ b/inc/autoload_adm.php @@ -0,0 +1,10 @@ +setLangFolder('lang/'); + +require_once '../inc/libs/functions.php'; \ No newline at end of file diff --git a/inc/config.php b/inc/config.php new file mode 100755 index 0000000..05bcab8 --- /dev/null +++ b/inc/config.php @@ -0,0 +1,49 @@ +
    + + + \ No newline at end of file diff --git a/inc/header.php b/inc/header.php new file mode 100755 index 0000000..e69de29 diff --git a/inc/index.html b/inc/index.html new file mode 100755 index 0000000..e69de29 diff --git a/inc/index.php b/inc/index.php new file mode 100755 index 0000000..1a13310 --- /dev/null +++ b/inc/index.php @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/inc/libs/2fa.php b/inc/libs/2fa.php new file mode 100755 index 0000000..2ed61b6 --- /dev/null +++ b/inc/libs/2fa.php @@ -0,0 +1,208 @@ +_getBase32LookupTable(); + unset($validChars[32]); + + $secret = ''; + for ($i = 0; $i < $secretLength; $i++) { + $secret .= $validChars[array_rand($validChars)]; + } + return $secret; + } + + /** + * Calculate the code, with given secret and point in time + * + * @param string $secret + * @param int|null $timeSlice + * @return string + */ + public function getCode($secret, $timeSlice = null) + { + if ($timeSlice === null) { + $timeSlice = floor(time() / 30); + } + + $secretkey = $this->_base32Decode($secret); + + // Pack time into binary string + $time = chr(0).chr(0).chr(0).chr(0).pack('N*', $timeSlice); + // Hash it with users secret key + $hm = hash_hmac('SHA1', $time, $secretkey, true); + // Use last nipple of result as index/offset + $offset = ord(substr($hm, -1)) & 0x0F; + // grab 4 bytes of the result + $hashpart = substr($hm, $offset, 4); + + // Unpak binary value + $value = unpack('N', $hashpart); + $value = $value[1]; + // Only 32 bits + $value = $value & 0x7FFFFFFF; + + $modulo = pow(10, $this->_codeLength); + return str_pad($value % $modulo, $this->_codeLength, '0', STR_PAD_LEFT); + } + + /** + * Get QR-Code URL for image, from google charts + * + * @param string $name + * @param string $secret + * @param string $title + * @return string + */ + public function getSecretUrl($name, $secret, $title = null) { + $urlencoded = urlencode('otpauth://totp/'.$name.'?secret='.$secret.''); + if(isset($title)) { + $urlencoded .= urlencode('&issuer='.urlencode($title)); + } + return $urlencoded; + } + + /** + * Check if the code is correct. This will accept codes starting from $discrepancy*30sec ago to $discrepancy*30sec from now + * + * @param string $secret + * @param string $code + * @param int $discrepancy This is the allowed time drift in 30 second units (8 means 4 minutes before or after) + * @param int|null $currentTimeSlice time slice if we want use other that time() + * @return bool + */ + public function verifyCode($secret, $code, $discrepancy = 1, $currentTimeSlice = null) + { + if ($currentTimeSlice === null) { + $currentTimeSlice = floor(time() / 30); + } + + for ($i = -$discrepancy; $i <= $discrepancy; $i++) { + $calculatedCode = $this->getCode($secret, $currentTimeSlice + $i); + if ($calculatedCode == $code ) { + return true; + } + } + + return false; + } + + /** + * Set the code length, should be >=6 + * + * @param int $length + * @return PHPGangsta_GoogleAuthenticator + */ + public function setCodeLength($length) + { + $this->_codeLength = $length; + return $this; + } + + /** + * Helper class to decode base32 + * + * @param $secret + * @return bool|string + */ + protected function _base32Decode($secret) + { + if (empty($secret)) return ''; + + $base32chars = $this->_getBase32LookupTable(); + $base32charsFlipped = array_flip($base32chars); + + $paddingCharCount = substr_count($secret, $base32chars[32]); + $allowedValues = array(6, 4, 3, 1, 0); + if (!in_array($paddingCharCount, $allowedValues)) return false; + for ($i = 0; $i < 4; $i++){ + if ($paddingCharCount == $allowedValues[$i] && + substr($secret, -($allowedValues[$i])) != str_repeat($base32chars[32], $allowedValues[$i])) return false; + } + $secret = str_replace('=','', $secret); + $secret = str_split($secret); + $binaryString = ""; + for ($i = 0; $i < count($secret); $i = $i+8) { + $x = ""; + if (!in_array($secret[$i], $base32chars)) return false; + for ($j = 0; $j < 8; $j++) { + $x .= str_pad(base_convert(@$base32charsFlipped[@$secret[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT); + } + $eightBits = str_split($x, 8); + for ($z = 0; $z < count($eightBits); $z++) { + $binaryString .= ( ($y = chr(base_convert($eightBits[$z], 2, 10))) || ord($y) == 48 ) ? $y:""; + } + } + return $binaryString; + } + + /** + * Helper class to encode base32 + * + * @param string $secret + * @param bool $padding + * @return string + */ + protected function _base32Encode($secret, $padding = true) + { + if (empty($secret)) return ''; + + $base32chars = $this->_getBase32LookupTable(); + + $secret = str_split($secret); + $binaryString = ""; + for ($i = 0; $i < count($secret); $i++) { + $binaryString .= str_pad(base_convert(ord($secret[$i]), 10, 2), 8, '0', STR_PAD_LEFT); + } + $fiveBitBinaryArray = str_split($binaryString, 5); + $base32 = ""; + $i = 0; + while ($i < count($fiveBitBinaryArray)) { + $base32 .= $base32chars[base_convert(str_pad($fiveBitBinaryArray[$i], 5, '0'), 2, 10)]; + $i++; + } + if ($padding && ($x = strlen($binaryString) % 40) != 0) { + if ($x == 8) $base32 .= str_repeat($base32chars[32], 6); + elseif ($x == 16) $base32 .= str_repeat($base32chars[32], 4); + elseif ($x == 24) $base32 .= str_repeat($base32chars[32], 3); + elseif ($x == 32) $base32 .= $base32chars[32]; + } + return $base32; + } + + /** + * Get array with all 32 characters for decoding from/encoding to base32 + * + * @return array + */ + protected function _getBase32LookupTable() + { + return array( + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 7 + 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 15 + 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 23 + 'Y', 'Z', '2', '3', '4', '5', '6', '7', // 31 + '=' // padding char + ); + } +} diff --git a/inc/libs/Smarty/Autoloader.php b/inc/libs/Smarty/Autoloader.php new file mode 100755 index 0000000..7d0c388 --- /dev/null +++ b/inc/libs/Smarty/Autoloader.php @@ -0,0 +1,124 @@ + 'Smarty.class.php', 'smartybc' => 'SmartyBC.class.php',); + + /** + * Registers Smarty_Autoloader backward compatible to older installations. + * + * @param bool $prepend Whether to prepend the autoloader or not. + */ + public static function registerBC($prepend = false) + { + /** + * register the class autoloader + */ + if (!defined('SMARTY_SPL_AUTOLOAD')) { + define('SMARTY_SPL_AUTOLOAD', 0); + } + if (SMARTY_SPL_AUTOLOAD && + set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false + ) { + $registeredAutoLoadFunctions = spl_autoload_functions(); + if (!isset($registeredAutoLoadFunctions['spl_autoload'])) { + spl_autoload_register(); + } + } else { + self::register($prepend); + } + } + + /** + * Registers Smarty_Autoloader as an SPL autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not. + */ + public static function register($prepend = false) + { + self::$SMARTY_DIR = defined('SMARTY_DIR') ? SMARTY_DIR : dirname(__FILE__) . DIRECTORY_SEPARATOR; + self::$SMARTY_SYSPLUGINS_DIR = defined('SMARTY_SYSPLUGINS_DIR') ? SMARTY_SYSPLUGINS_DIR : + self::$SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR; + if (version_compare(phpversion(), '5.3.0', '>=')) { + spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend); + } else { + spl_autoload_register(array(__CLASS__, 'autoload')); + } + } + + /** + * Handles auto loading of classes. + * + * @param string $class A class name. + */ + public static function autoload($class) + { + $_class = strtolower($class); + $file = self::$SMARTY_SYSPLUGINS_DIR . $_class . '.php'; + if (strpos($_class, 'smarty_internal_') === 0) { + if (strpos($_class, 'smarty_internal_compile_') === 0) { + if (is_file($file)) { + require $file; + } + return; + } + @include $file; + return; + } + if (preg_match('/^(smarty_(((template_(source|config|cache|compiled|resource_base))|((cached|compiled)?resource)|(variable|security)))|(smarty(bc)?)$)/', + $_class, $match)) { + if (!empty($match[3])) { + @include $file; + return; + } elseif (!empty($match[9]) && isset(self::$rootClasses[$_class])) { + $file = self::$rootClasses[$_class]; + require $file; + return; + } + } + if (0 !== strpos($_class, 'smarty')) { + return; + } + if (is_file($file)) { + require $file; + return; + } + return; + } +} diff --git a/inc/libs/Smarty/Smarty.class.php b/inc/libs/Smarty/Smarty.class.php new file mode 100755 index 0000000..a029f94 --- /dev/null +++ b/inc/libs/Smarty/Smarty.class.php @@ -0,0 +1,1482 @@ + + * @author Uwe Tews + * @author Rodney Rehm + * @package Smarty + * @version 3.1.29 + */ + +/** + * define shorthand directory separator constant + */ +if (!defined('DS')) { + define('DS', DIRECTORY_SEPARATOR); +} + +/** + * set SMARTY_DIR to absolute path to Smarty library files. + * Sets SMARTY_DIR only if user application has not already defined it. + */ +if (!defined('SMARTY_DIR')) { + define('SMARTY_DIR', dirname(__FILE__) . DS); +} + +/** + * set SMARTY_SYSPLUGINS_DIR to absolute path to Smarty internal plugins. + * Sets SMARTY_SYSPLUGINS_DIR only if user application has not already defined it. + */ +if (!defined('SMARTY_SYSPLUGINS_DIR')) { + define('SMARTY_SYSPLUGINS_DIR', SMARTY_DIR . 'sysplugins' . DS); +} +if (!defined('SMARTY_PLUGINS_DIR')) { + define('SMARTY_PLUGINS_DIR', SMARTY_DIR . 'plugins' . DS); +} +if (!defined('SMARTY_MBSTRING')) { + define('SMARTY_MBSTRING', function_exists('mb_get_info')); +} +if (!defined('SMARTY_RESOURCE_CHAR_SET')) { + // UTF-8 can only be done properly when mbstring is available! + /** + * @deprecated in favor of Smarty::$_CHARSET + */ + define('SMARTY_RESOURCE_CHAR_SET', SMARTY_MBSTRING ? 'UTF-8' : 'ISO-8859-1'); +} +if (!defined('SMARTY_RESOURCE_DATE_FORMAT')) { + /** + * @deprecated in favor of Smarty::$_DATE_FORMAT + */ + define('SMARTY_RESOURCE_DATE_FORMAT', '%b %e, %Y'); +} + +/** + * Try loading the Smarty_Internal_Data class + * If we fail we must load Smarty's autoloader. + * Otherwise we may have a global autoloader like Composer + */ +if (!class_exists('Smarty_Autoloader', false)) { + if (!class_exists('Smarty_Internal_Data', true)) { + require_once dirname(__FILE__) . '/Autoloader.php'; + Smarty_Autoloader::registerBC(); + } +} + +/** + * Load always needed external class files + */ +if (!class_exists('Smarty_Internal_Data', false)) { + require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_data.php'; +} +require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_extension_handler.php'; +require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_templatebase.php'; +require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_template.php'; +require_once SMARTY_SYSPLUGINS_DIR . 'smarty_resource.php'; +require_once SMARTY_SYSPLUGINS_DIR . 'smarty_variable.php'; +require_once SMARTY_SYSPLUGINS_DIR . 'smarty_template_source.php'; +require_once SMARTY_SYSPLUGINS_DIR . 'smarty_template_resource_base.php'; + +/** + * This is the main Smarty class + * + * @package Smarty + * + * @method int clearAllCache(int $exp_time = null, string $type = null) + * @method int clearCache(string $template_name, string $cache_id = null, string $compile_id = null, int $exp_time = null, string $type = null) + * @method int compileAllTemplates(Smarty $smarty, string $extension = '.tpl', bool $force_compile = false, int $time_limit = 0, int $max_errors = null) + * @method int compileAllConfig(Smarty $smarty, string $extension = '.conf', bool $force_compile = false, int $time_limit = 0, int $max_errors = null) + * + */ +class Smarty extends Smarty_Internal_TemplateBase +{ + /**#@+ + * constant definitions + */ + + /** + * smarty version + */ + const SMARTY_VERSION = '3.1.29'; + + /** + * define variable scopes + */ + const SCOPE_LOCAL = 0; + + const SCOPE_PARENT = 2; + + const SCOPE_TPL_ROOT = 4; + + const SCOPE_ROOT = 8; + + const SCOPE_SMARTY = 16; + + const SCOPE_GLOBAL = 32; + + const SCOPE_BUBBLE_UP = 64; + + /** + * define caching modes + */ + const CACHING_OFF = 0; + + const CACHING_LIFETIME_CURRENT = 1; + + const CACHING_LIFETIME_SAVED = 2; + + /** + * define constant for clearing cache files be saved expiration dates + */ + const CLEAR_EXPIRED = - 1; + + /** + * define compile check modes + */ + const COMPILECHECK_OFF = 0; + + const COMPILECHECK_ON = 1; + + const COMPILECHECK_CACHEMISS = 2; + + /** + * define debug modes + */ + const DEBUG_OFF = 0; + + const DEBUG_ON = 1; + + const DEBUG_INDIVIDUAL = 2; + + /** + * modes for handling of "" tags in templates. + */ + const PHP_PASSTHRU = 0; //-> print tags as plain text + + const PHP_QUOTE = 1; //-> escape tags as entities + + const PHP_REMOVE = 2; //-> escape tags as entities + + const PHP_ALLOW = 3; //-> escape tags as entities + + /** + * filter types + */ + const FILTER_POST = 'post'; + + const FILTER_PRE = 'pre'; + + const FILTER_OUTPUT = 'output'; + + const FILTER_VARIABLE = 'variable'; + + /** + * plugin types + */ + const PLUGIN_FUNCTION = 'function'; + + const PLUGIN_BLOCK = 'block'; + + const PLUGIN_COMPILER = 'compiler'; + + const PLUGIN_MODIFIER = 'modifier'; + + const PLUGIN_MODIFIERCOMPILER = 'modifiercompiler'; + + /** + * Resource caching modes + */ + const RESOURCE_CACHE_OFF = 0; + + const RESOURCE_CACHE_AUTOMATIC = 1; // cache template objects by rules + + const RESOURCE_CACHE_TEMPLATE = 2; // cache all template objects + + const RESOURCE_CACHE_ON = 4; // cache source and compiled resources + + /**#@-*/ + + /** + * assigned global tpl vars + */ + public static $global_tpl_vars = array(); + + /** + * error handler returned by set_error_handler() in Smarty::muteExpectedErrors() + */ + public static $_previous_error_handler = null; + + /** + * contains directories outside of SMARTY_DIR that are to be muted by muteExpectedErrors() + */ + public static $_muted_directories = array(); + + /** + * Flag denoting if Multibyte String functions are available + */ + public static $_MBSTRING = SMARTY_MBSTRING; + + /** + * The character set to adhere to (e.g. "UTF-8") + */ + public static $_CHARSET = SMARTY_RESOURCE_CHAR_SET; + + /** + * The date format to be used internally + * (accepts date() and strftime()) + */ + public static $_DATE_FORMAT = SMARTY_RESOURCE_DATE_FORMAT; + + /** + * Flag denoting if PCRE should run in UTF-8 mode + */ + public static $_UTF8_MODIFIER = 'u'; + + /** + * Flag denoting if operating system is windows + */ + public static $_IS_WINDOWS = false; + + /**#@+ + * variables + */ + + /** + * auto literal on delimiters with whitespace + * + * @var boolean + */ + public $auto_literal = true; + + /** + * display error on not assigned variables + * + * @var boolean + */ + public $error_unassigned = false; + + /** + * look up relative file path in include_path + * + * @var boolean + */ + public $use_include_path = false; + + /** + * template directory + * + * @var array + */ + private $template_dir = array('./templates/'); + + /** + * joined template directory string used in cache keys + * + * @var string + */ + public $_joined_template_dir = null; + + /** + * joined config directory string used in cache keys + * + * @var string + */ + public $_joined_config_dir = null; + + /** + * default template handler + * + * @var callable + */ + public $default_template_handler_func = null; + + /** + * default config handler + * + * @var callable + */ + public $default_config_handler_func = null; + + /** + * default plugin handler + * + * @var callable + */ + public $default_plugin_handler_func = null; + + /** + * compile directory + * + * @var string + */ + private $compile_dir = './templates_c/'; + + /** + * plugins directory + * + * @var array + */ + private $plugins_dir = null; + + /** + * cache directory + * + * @var string + */ + private $cache_dir = './cache/'; + + /** + * config directory + * + * @var array + */ + private $config_dir = array('./configs/'); + + /** + * force template compiling? + * + * @var boolean + */ + public $force_compile = false; + + /** + * check template for modifications? + * + * @var boolean + */ + public $compile_check = true; + + /** + * use sub dirs for compiled/cached files? + * + * @var boolean + */ + public $use_sub_dirs = false; + + /** + * allow ambiguous resources (that are made unique by the resource handler) + * + * @var boolean + */ + public $allow_ambiguous_resources = false; + + /** + * merge compiled includes + * + * @var boolean + */ + public $merge_compiled_includes = false; + + /** + * force cache file creation + * + * @var boolean + */ + public $force_cache = false; + + /** + * template left-delimiter + * + * @var string + */ + public $left_delimiter = "{"; + + /** + * template right-delimiter + * + * @var string + */ + public $right_delimiter = "}"; + + /**#@+ + * security + */ + /** + * class name + * This should be instance of Smarty_Security. + * + * @var string + * @see Smarty_Security + */ + public $security_class = 'Smarty_Security'; + + /** + * implementation of security class + * + * @var Smarty_Security + */ + public $security_policy = null; + + /** + * controls handling of PHP-blocks + * + * @var integer + */ + public $php_handling = self::PHP_PASSTHRU; + + /** + * controls if the php template file resource is allowed + * + * @var bool + */ + public $allow_php_templates = false; + + /**#@-*/ + /** + * debug mode + * Setting this to true enables the debug-console. + * + * @var boolean + */ + public $debugging = false; + + /** + * This determines if debugging is enable-able from the browser. + *
      + *
    • NONE => no debugging control allowed
    • + *
    • URL => enable debugging when SMARTY_DEBUG is found in the URL.
    • + *
    + * + * @var string + */ + public $debugging_ctrl = 'NONE'; + + /** + * Name of debugging URL-param. + * Only used when $debugging_ctrl is set to 'URL'. + * The name of the URL-parameter that activates debugging. + * + * @var string + */ + public $smarty_debug_id = 'SMARTY_DEBUG'; + + /** + * Path of debug template. + * + * @var string + */ + public $debug_tpl = null; + + /** + * When set, smarty uses this value as error_reporting-level. + * + * @var int + */ + public $error_reporting = null; + + /**#@+ + * config var settings + */ + + /** + * Controls whether variables with the same name overwrite each other. + * + * @var boolean + */ + public $config_overwrite = true; + + /** + * Controls whether config values of on/true/yes and off/false/no get converted to boolean. + * + * @var boolean + */ + public $config_booleanize = true; + + /** + * Controls whether hidden config sections/vars are read from the file. + * + * @var boolean + */ + public $config_read_hidden = false; + + /**#@-*/ + + /**#@+ + * resource locking + */ + + /** + * locking concurrent compiles + * + * @var boolean + */ + public $compile_locking = true; + + /** + * Controls whether cache resources should use locking mechanism + * + * @var boolean + */ + public $cache_locking = false; + + /** + * seconds to wait for acquiring a lock before ignoring the write lock + * + * @var float + */ + public $locking_timeout = 10; + + /**#@-*/ + + /** + * resource type used if none given + * Must be an valid key of $registered_resources. + * + * @var string + */ + public $default_resource_type = 'file'; + + /** + * caching type + * Must be an element of $cache_resource_types. + * + * @var string + */ + public $caching_type = 'file'; + + /** + * config type + * + * @var string + */ + public $default_config_type = 'file'; + + /** + * enable resource caching + * + * @var bool + */ + public $resource_cache_mode = 1; + + /** + * check If-Modified-Since headers + * + * @var boolean + */ + public $cache_modified_check = false; + + /** + * registered plugins + * + * @var array + */ + public $registered_plugins = array(); + + /** + * registered objects + * + * @var array + */ + public $registered_objects = array(); + + /** + * registered classes + * + * @var array + */ + public $registered_classes = array(); + + /** + * registered filters + * + * @var array + */ + public $registered_filters = array(); + + /** + * registered resources + * + * @var array + */ + public $registered_resources = array(); + + /** + * registered cache resources + * + * @var array + */ + public $registered_cache_resources = array(); + + /** + * autoload filter + * + * @var array + */ + public $autoload_filters = array(); + + /** + * default modifier + * + * @var array + */ + public $default_modifiers = array(); + + /** + * autoescape variable output + * + * @var boolean + */ + public $escape_html = false; + + /** + * start time for execution time calculation + * + * @var int + */ + public $start_time = 0; + + /** + * required by the compiler for BC + * + * @var string + */ + public $_current_file = null; + + /** + * internal flag to enable parser debugging + * + * @var bool + */ + public $_parserdebug = false; + + /** + * This object type (Smarty = 1, template = 2, data = 4) + * + * @var int + */ + public $_objType = 1; + + /** + * Debug object + * + * @var Smarty_Internal_Debug + */ + public $_debug = null; + + /** + * removed properties + * + * @var string[] + */ + private static $obsoleteProperties = array('resource_caching', 'template_resource_caching', + 'direct_access_security', '_dir_perms', '_file_perms', + 'plugin_search_order', 'inheritance_merge_compiled_includes'); + + /** + * List of private properties which will call getter/setter ona direct access + * + * @var array + */ + private static $accessMap = array('template_dir' => 'TemplateDir', 'config_dir' => 'ConfigDir', + 'plugins_dir' => 'PluginsDir', 'compile_dir' => 'CompileDir', + 'cache_dir' => 'CacheDir',); + + /**#@-*/ + + /** + * Initialize new Smarty object + */ + public function __construct() + { + parent::__construct(); + if (is_callable('mb_internal_encoding')) { + mb_internal_encoding(Smarty::$_CHARSET); + } + $this->start_time = microtime(true); + + if (isset($_SERVER['SCRIPT_NAME'])) { + Smarty::$global_tpl_vars['SCRIPT_NAME'] = new Smarty_Variable($_SERVER['SCRIPT_NAME']); + } + + // Check if we're running on windows + Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'; + + // let PCRE (preg_*) treat strings as ISO-8859-1 if we're not dealing with UTF-8 + if (Smarty::$_CHARSET !== 'UTF-8') { + Smarty::$_UTF8_MODIFIER = ''; + } + } + + /** + * Check if a template resource exists + * + * @param string $resource_name template name + * + * @return boolean status + */ + public function templateExists($resource_name) + { + // create source object + $source = Smarty_Template_Source::load(null, $this, $resource_name); + return $source->exists; + } + + /** + * Returns a single or all global variables + * + * @param string $varname variable name or null + * + * @return string variable value or or array of variables + */ + public function getGlobal($varname = null) + { + if (isset($varname)) { + if (isset(self::$global_tpl_vars[$varname])) { + return self::$global_tpl_vars[$varname]->value; + } else { + return ''; + } + } else { + $_result = array(); + foreach (self::$global_tpl_vars AS $key => $var) { + $_result[$key] = $var->value; + } + + return $_result; + } + } + + /** + * Loads security class and enables security + * + * @param string|Smarty_Security $security_class if a string is used, it must be class-name + * + * @return Smarty current Smarty instance for chaining + * @throws SmartyException when an invalid class name is provided + */ + public function enableSecurity($security_class = null) + { + Smarty_Security::enableSecurity($this, $security_class); + return $this; + } + + /** + * Disable security + * + * @return Smarty current Smarty instance for chaining + */ + public function disableSecurity() + { + $this->security_policy = null; + + return $this; + } + + /** + * Set template directory + * + * @param string|array $template_dir directory(s) of template sources + * @param bool $isConfig true for config_dir + * + * @return \Smarty current Smarty instance for chaining + */ + public function setTemplateDir($template_dir, $isConfig = false) + { + $type = $isConfig ? 'config_dir' : 'template_dir'; + $joined = '_joined_' . $type; + $this->{$type} = (array) $template_dir; + $this->{$joined} = join(' # ', $this->{$type}); + $this->_cache[$type . '_new'] = true; + $this->_cache[$type] = false; + return $this; + } + + /** + * Add template directory(s) + * + * @param string|array $template_dir directory(s) of template sources + * @param string $key of the array element to assign the template dir to + * @param bool $isConfig true for config_dir + * + * @return Smarty current Smarty instance for chaining + */ + public function addTemplateDir($template_dir, $key = null, $isConfig = false) + { + $type = $isConfig ? 'config_dir' : 'template_dir'; + $joined = '_joined_' . $type; + if (!isset($this->_cache[$type])) { + $this->{$type} = (array) $this->{$type}; + $this->{$joined} = join(' # ', $this->{$type}); + $this->_cache[$type . '_new'] = true; + $this->_cache[$type] = false; + } + $this->{$joined} .= ' # ' . join(' # ', (array) $template_dir); + $this->_addDir($type, $template_dir, $key); + return $this; + } + + /** + * Get template directories + * + * @param mixed $index index of directory to get, null to get all + * @param bool $isConfig true for config_dir + * + * @return array list of template directories, or directory of $index + */ + public function getTemplateDir($index = null, $isConfig = false) + { + $type = $isConfig ? 'config_dir' : 'template_dir'; + if (!isset($this->_cache[$type])) { + $joined = '_joined_' . $type; + $this->{$type} = (array) $this->{$type}; + $this->{$joined} = join(' # ', $this->{$type}); + $this->_cache[$type] = false; + } + if ($this->_cache[$type] == false) { + foreach ($this->{$type} as $k => $v) { + $this->{$type}[$k] = $this->_realpath($v . DS, true); + } + $this->_cache[$type . '_new'] = true; + $this->_cache[$type] = true; + } + if ($index !== null) { + return isset($this->{$type}[$index]) ? $this->{$type}[$index] : null; + } + return $this->{$type}; + } + + /** + * Set config directory + * + * @param $config_dir + * + * @return Smarty current Smarty instance for chaining + */ + public function setConfigDir($config_dir) + { + return $this->setTemplateDir($config_dir, true); + } + + /** + * Add config directory(s) + * + * @param string|array $config_dir directory(s) of config sources + * @param mixed $key key of the array element to assign the config dir to + * + * @return Smarty current Smarty instance for chaining + */ + public function addConfigDir($config_dir, $key = null) + { + return $this->addTemplateDir($config_dir, $key, true); + } + + /** + * Get config directory + * + * @param mixed $index index of directory to get, null to get all + * + * @return array configuration directory + */ + public function getConfigDir($index = null) + { + return $this->getTemplateDir($index, true); + } + + /** + * Set plugins directory + * + * @param string|array $plugins_dir directory(s) of plugins + * + * @return Smarty current Smarty instance for chaining + */ + public function setPluginsDir($plugins_dir) + { + $this->plugins_dir = (array) $plugins_dir; + if (isset($this->_cache['plugins_dir'])) { + unset($this->_cache['plugins_dir']); + } + return $this; + } + + /** + * Adds directory of plugin files + * + * @param $plugins_dir + * + * @return Smarty current Smarty instance for chaining + */ + public function addPluginsDir($plugins_dir) + { + if (!isset($this->plugins_dir)) { + $this->plugins_dir = array(SMARTY_PLUGINS_DIR); + } + $this->plugins_dir = array_merge((array) $this->plugins_dir, (array) $plugins_dir); + if (isset($this->_cache['plugins_dir'])) { + unset($this->_cache['plugins_dir']); + } + return $this; + } + + /** + * Get plugin directories + * + * @return array list of plugin directories + */ + public function getPluginsDir() + { + if (!isset($this->_cache['plugins_dir'])) { + if (!isset($this->plugins_dir)) { + $this->plugins_dir = array(SMARTY_PLUGINS_DIR); + } else { + $plugins_dir = (array) $this->plugins_dir; + $this->plugins_dir = array(); + foreach ($plugins_dir as $v) { + $this->plugins_dir[] = $this->_realpath($v . DS, true); + } + $this->plugins_dir = array_unique($this->plugins_dir); + } + $this->_cache['plugin_files'] = array(); + $this->_cache['plugins_dir'] = true; + } + return $this->plugins_dir; + } + + /** + * Set compile directory + * + * @param string $compile_dir directory to store compiled templates in + * + * @return Smarty current Smarty instance for chaining + */ + public function setCompileDir($compile_dir) + { + $this->compile_dir = $this->_realpath($compile_dir . DS, true); + if (!isset(Smarty::$_muted_directories[$this->compile_dir])) { + Smarty::$_muted_directories[$this->compile_dir] = null; + } + $this->_cache['compile_dir'] = true; + return $this; + } + + /** + * Get compiled directory + * + * @return string path to compiled templates + */ + public function getCompileDir() + { + if (!isset($this->_cache['compile_dir'])) { + $this->compile_dir = $this->_realpath($this->compile_dir . DS, true); + if (!isset(Smarty::$_muted_directories[$this->compile_dir])) { + Smarty::$_muted_directories[$this->compile_dir] = null; + } + $this->_cache['compile_dir'] = true; + } + return $this->compile_dir; + } + + /** + * Set cache directory + * + * @param string $cache_dir directory to store cached templates in + * + * @return Smarty current Smarty instance for chaining + */ + public function setCacheDir($cache_dir) + { + $this->cache_dir = $this->_realpath($cache_dir . DS, true); + if (!isset(Smarty::$_muted_directories[$this->cache_dir])) { + Smarty::$_muted_directories[$this->cache_dir] = null; + } + $this->_cache['cache_dir'] = true; + return $this; + } + + /** + * Get cache directory + * + * @return string path of cache directory + */ + public function getCacheDir() + { + if (!isset($this->_cache['cache_dir'])) { + $this->cache_dir = $this->_realpath($this->cache_dir . DS, true); + if (!isset(Smarty::$_muted_directories[$this->cache_dir])) { + Smarty::$_muted_directories[$this->cache_dir] = null; + } + $this->_cache['cache_dir'] = true; + } + return $this->cache_dir; + } + + /** + * add directories to given property name + * + * @param string $dirName directory property name + * @param string|array $dir directory string or array of strings + * @param mixed $key optional key + */ + private function _addDir($dirName, $dir, $key = null) + { + $rp = $this->_cache[$dirName]; + if (is_array($dir)) { + foreach ($dir as $k => $v) { + $path = $rp ? $this->_realpath($v . DS, true) : $v; + if (is_int($k)) { + // indexes are not merged but appended + $this->{$dirName}[] = $path; + } else { + // string indexes are overridden + $this->{$dirName}[$k] = $path; + } + } + } else { + $path = $rp ? $this->_realpath($dir . DS, true) : $dir; + if ($key !== null) { + // override directory at specified index + $this->{$dirName}[$key] = $path; + } else { + // append new directory + $this->{$dirName}[] = $path; + } + } + } + + /** + * creates a template object + * + * @param string $template the resource handle of the template file + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables + * @param boolean $do_clone flag is Smarty object shall be cloned + * + * @return object template object + */ + public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true) + { + if ($cache_id !== null && (is_object($cache_id) || is_array($cache_id))) { + $parent = $cache_id; + $cache_id = null; + } + if ($parent !== null && is_array($parent)) { + $data = $parent; + $parent = null; + } else { + $data = null; + } + if ($this->caching && + isset($this->_cache['isCached'][$_templateId = $this->_getTemplateId($template, $cache_id, $compile_id)]) + ) { + $tpl = $do_clone ? clone $this->_cache['isCached'][$_templateId] : $this->_cache['isCached'][$_templateId]; + $tpl->parent = $parent; + $tpl->tpl_vars = array(); + $tpl->config_vars = array(); + } else { + /* @var Smarty_Internal_Template $tpl */ + $tpl = new $this->template_class($template, $this, $parent, $cache_id, $compile_id, null, null); + } + if ($do_clone) { + $tpl->smarty = clone $tpl->smarty; + } elseif ($parent === null) { + $tpl->parent = $this; + } + // fill data if present + if (!empty($data) && is_array($data)) { + // set up variable values + foreach ($data as $_key => $_val) { + $tpl->tpl_vars[$_key] = new Smarty_Variable($_val); + } + } + if ($this->debugging || $this->debugging_ctrl == 'URL') { + $tpl->smarty->_debug = new Smarty_Internal_Debug(); + // check URL debugging control + if (!$this->debugging && $this->debugging_ctrl == 'URL') { + $tpl->smarty->_debug->debugUrl($tpl->smarty); + } + } + return $tpl; + } + + /** + * Takes unknown classes and loads plugin files for them + * class name format: Smarty_PluginType_PluginName + * plugin filename format: plugintype.pluginname.php + * + * @param string $plugin_name class plugin name to load + * @param bool $check check if already loaded + * + * @throws SmartyException + * @return string |boolean filepath of loaded file or false + */ + public function loadPlugin($plugin_name, $check = true) + { + return $this->ext->loadPlugin->loadPlugin($this, $plugin_name, $check); + } + + /** + * Get unique template id + * + * @param string $template_name + * @param null|mixed $cache_id + * @param null|mixed $compile_id + * @param null $caching + * + * @return string + */ + public function _getTemplateId($template_name, $cache_id = null, $compile_id = null, $caching = null) + { + $cache_id = $cache_id === null ? $this->cache_id : $cache_id; + $compile_id = $compile_id === null ? $this->compile_id : $compile_id; + $caching = (int) ($caching === null ? $this->caching : $caching); + + if ($this->allow_ambiguous_resources) { + $_templateId = + Smarty_Resource::getUniqueTemplateName($this, $template_name) . "#{$cache_id}#{$compile_id}#{$caching}"; + } else { + $_templateId = $this->_joined_template_dir . "#{$template_name}#{$cache_id}#{$compile_id}#{$caching}"; + } + if (isset($_templateId[150])) { + $_templateId = sha1($_templateId); + } + return $_templateId; + } + + /** + * Normalize path + * - remove /./ and /../ + * - make it absolute if required + * + * @param string $path file path + * @param bool $realpath leave $path relative + * + * @return string + */ + public function _realpath($path, $realpath = null) + { + static $pattern = null; + static $nds = null; + if ($pattern == null) { + $nds = DS == '/' ? '\\' : '/'; + $ds = '\\' . DS; + $pattern = + "#([{$ds}]+[^{$ds}]+[{$ds}]+[.]([{$ds}]+[.])*[.][{$ds}]+([.][{$ds}]+)*)|([{$ds}]+([.][{$ds}]+)+)|[{$ds}]{2,}#"; + } + // normalize DS + if (strpos($path, $nds) !== false) { + $path = str_replace($nds, DS, $path); + } + + if ($realpath === true && (($path[0] !== '/' && DS == '/') || ($path[1] !== ':' && DS != '/'))) { + $path = getcwd() . DS . $path; + } + while ((strpos($path, '.' . DS) !== false) || (strpos($path, DS . DS) !== false)) { + $path = preg_replace($pattern, DS, $path); + } + if ($realpath === false && ($path[0] == '/' || $path[1] == ':')) { + $path = str_ireplace(getcwd(), '.', $path); + } + return $path; + } + + /** + * @param boolean $compile_check + */ + public function setCompileCheck($compile_check) + { + $this->compile_check = $compile_check; + } + + /** + * @param boolean $use_sub_dirs + */ + public function setUseSubDirs($use_sub_dirs) + { + $this->use_sub_dirs = $use_sub_dirs; + } + + /** + * @param int $error_reporting + */ + public function setErrorReporting($error_reporting) + { + $this->error_reporting = $error_reporting; + } + + /** + * @param boolean $escape_html + */ + public function setEscapeHtml($escape_html) + { + $this->escape_html = $escape_html; + } + + /** + * @param boolean $auto_literal + */ + public function setAutoLiteral($auto_literal) + { + $this->auto_literal = $auto_literal; + } + + /** + * @param boolean $force_compile + */ + public function setForceCompile($force_compile) + { + $this->force_compile = $force_compile; + } + + /** + * @param boolean $merge_compiled_includes + */ + public function setMergeCompiledIncludes($merge_compiled_includes) + { + $this->merge_compiled_includes = $merge_compiled_includes; + } + + /** + * @param string $left_delimiter + */ + public function setLeftDelimiter($left_delimiter) + { + $this->left_delimiter = $left_delimiter; + } + + /** + * @param string $right_delimiter + */ + public function setRightDelimiter($right_delimiter) + { + $this->right_delimiter = $right_delimiter; + } + + /** + * @param boolean $debugging + */ + public function setDebugging($debugging) + { + $this->debugging = $debugging; + } + + /** + * @param boolean $config_overwrite + */ + public function setConfigOverwrite($config_overwrite) + { + $this->config_overwrite = $config_overwrite; + } + + /** + * @param boolean $config_booleanize + */ + public function setConfigBooleanize($config_booleanize) + { + $this->config_booleanize = $config_booleanize; + } + + /** + * @param boolean $config_read_hidden + */ + public function setConfigReadHidden($config_read_hidden) + { + $this->config_read_hidden = $config_read_hidden; + } + + /** + * @param boolean $compile_locking + */ + public function setCompileLocking($compile_locking) + { + $this->compile_locking = $compile_locking; + } + + /** + * @param string $default_resource_type + */ + public function setDefaultResourceType($default_resource_type) + { + $this->default_resource_type = $default_resource_type; + } + + /** + * @param string $caching_type + */ + public function setCachingType($caching_type) + { + $this->caching_type = $caching_type; + } + + /** + * Test install + * + * @param null $errors + */ + public function testInstall(&$errors = null) + { + Smarty_Internal_TestInstall::testInstall($this, $errors); + } + + /** + * Class destructor + */ + public function __destruct() + { + $i = 0;// intentionally left blank + } + + /** + * <> Generic getter. + * Calls the appropriate getter function. + * Issues an E_USER_NOTICE if no valid getter is found. + * + * @param string $name property name + * + * @return mixed + */ + public function __get($name) + { + + if (isset(self::$accessMap[$name])) { + $method = 'get' . self::$accessMap[$name]; + return $this->{$method}(); + } elseif (in_array($name, self::$obsoleteProperties)) { + return null; + } else { + trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE); + } + } + + /** + * <> Generic setter. + * Calls the appropriate setter function. + * Issues an E_USER_NOTICE if no valid setter is found. + * + * @param string $name property name + * @param mixed $value parameter passed to setter + */ + public function __set($name, $value) + { + if (isset(self::$accessMap[$name])) { + $method = 'set' . self::$accessMap[$name]; + $this->{$method}($value); + } elseif (in_array($name, self::$obsoleteProperties)) { + return; + } else { + if (is_object($value) && method_exists($value, $name)) { + $this->$name = $value; + } else { + trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE); + } + } + } + + /** + * Error Handler to mute expected messages + * + * @link http://php.net/set_error_handler + * + * @param integer $errno Error level + * @param $errstr + * @param $errfile + * @param $errline + * @param $errcontext + * + * @return boolean + */ + public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext) + { + $_is_muted_directory = false; + + // add the SMARTY_DIR to the list of muted directories + if (!isset(Smarty::$_muted_directories[SMARTY_DIR])) { + $smarty_dir = realpath(SMARTY_DIR); + if ($smarty_dir !== false) { + Smarty::$_muted_directories[SMARTY_DIR] = + array('file' => $smarty_dir, 'length' => strlen($smarty_dir),); + } + } + + // walk the muted directories and test against $errfile + foreach (Smarty::$_muted_directories as $key => &$dir) { + if (!$dir) { + // resolve directory and length for speedy comparisons + $file = realpath($key); + if ($file === false) { + // this directory does not exist, remove and skip it + unset(Smarty::$_muted_directories[$key]); + continue; + } + $dir = array('file' => $file, 'length' => strlen($file),); + } + if (!strncmp($errfile, $dir['file'], $dir['length'])) { + $_is_muted_directory = true; + break; + } + } + + // pass to next error handler if this error did not occur inside SMARTY_DIR + // or the error was within smarty but masked to be ignored + if (!$_is_muted_directory || ($errno && $errno & error_reporting())) { + if (Smarty::$_previous_error_handler) { + return call_user_func(Smarty::$_previous_error_handler, $errno, $errstr, $errfile, $errline, + $errcontext); + } else { + return false; + } + } + } + + /** + * Enable error handler to mute expected messages + * + * @return void + */ + public static function muteExpectedErrors() + { + /* + error muting is done because some people implemented custom error_handlers using + http://php.net/set_error_handler and for some reason did not understand the following paragraph: + + It is important to remember that the standard PHP error handler is completely bypassed for the + error types specified by error_types unless the callback function returns FALSE. + error_reporting() settings will have no effect and your error handler will be called regardless - + however you are still able to read the current value of error_reporting and act appropriately. + Of particular note is that this value will be 0 if the statement that caused the error was + prepended by the @ error-control operator. + + Smarty deliberately uses @filemtime() over file_exists() and filemtime() in some places. Reasons include + - @filemtime() is almost twice as fast as using an additional file_exists() + - between file_exists() and filemtime() a possible race condition is opened, + which does not exist using the simple @filemtime() approach. + */ + $error_handler = array('Smarty', 'mutingErrorHandler'); + $previous = set_error_handler($error_handler); + + // avoid dead loops + if ($previous !== $error_handler) { + Smarty::$_previous_error_handler = $previous; + } + } + + /** + * Disable error handler muting expected messages + * + * @return void + */ + public static function unmuteExpectedErrors() + { + restore_error_handler(); + } +} diff --git a/inc/libs/Smarty/debug.tpl b/inc/libs/Smarty/debug.tpl new file mode 100755 index 0000000..5526cbc --- /dev/null +++ b/inc/libs/Smarty/debug.tpl @@ -0,0 +1,160 @@ +{capture name='_smarty_debug' assign=debug_output} + + + + Smarty Debug Console + + + + +

    Smarty {Smarty::SMARTY_VERSION} Debug Console + - {if isset($template_name)}{$template_name|debug_print_var nofilter} {/if}{if !empty($template_data)}Total Time {$execution_time|string_format:"%.5f"}{/if}

    + + {if !empty($template_data)} +

    included templates & config files (load time in seconds)

    +
    + {foreach $template_data as $template} + {$template.name} +
       + (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"}) + +
    + {/foreach} +
    + {/if} + +

    assigned template variables

    + + + {foreach $assigned_vars as $vars} + + + + + {/foreach} +

    ${$vars@key}

    + {if isset($vars['nocache'])}Nocache
    {/if} + {if isset($vars['scope'])}Origin: {$vars['scope']|debug_print_var nofilter}{/if} +

    Value

    {$vars['value']|debug_print_var:10:80 nofilter}
    {if isset($vars['attributes'])}

    Attributes

    {$vars['attributes']|debug_print_var nofilter} {/if}
    + +

    assigned config file variables

    + + + {foreach $config_vars as $vars} + + + + + {/foreach} + +

    #{$vars@key}#

    + {if isset($vars['scope'])}Origin: {$vars['scope']|debug_print_var nofilter}{/if} +
    {$vars['value']|debug_print_var:10:80 nofilter}
    + + +{/capture} + diff --git a/inc/libs/Smarty/sysplugins/smarty_cacheresource.php b/inc/libs/Smarty/sysplugins/smarty_cacheresource.php new file mode 100755 index 0000000..14ab62f --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_cacheresource.php @@ -0,0 +1,223 @@ + 'smarty_internal_cacheresource_file.php',); + + /** + * populate Cached Object with meta data from Resource + * + * @param Smarty_Template_Cached $cached cached object + * @param Smarty_Internal_Template $_template template object + * + * @return void + */ + abstract public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template); + + /** + * populate Cached Object with timestamp and exists from Resource + * + * @param Smarty_Template_Cached $cached + * + * @return void + */ + abstract public function populateTimestamp(Smarty_Template_Cached $cached); + + /** + * Read the cached template and process header + * + * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Cached $cached cached object + * @param bool $update flag if called because cache update + * + * @return bool true or false if the cached content does not exist + */ + abstract public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached = null, $update = false); + + /** + * Write the rendered template output to cache + * + * @param Smarty_Internal_Template $_template template object + * @param string $content content to cache + * + * @return boolean success + */ + abstract public function writeCachedContent(Smarty_Internal_Template $_template, $content); + + /** + * Return cached content + * + * @param Smarty_Internal_Template $_template template object + * + * @return null|string + */ + public function getCachedContent(Smarty_Internal_Template $_template) + { + if ($_template->cached->handler->process($_template)) { + ob_start(); + $unifunc = $_template->cached->unifunc; + $unifunc($_template); + return ob_get_clean(); + } + + return null; + } + + /** + * Empty cache + * + * @param Smarty $smarty Smarty object + * @param integer $exp_time expiration time (number of seconds, not timestamp) + * + * @return integer number of cache files deleted + */ + abstract public function clearAll(Smarty $smarty, $exp_time = null); + + /** + * Empty cache for a specific template + * + * @param Smarty $smarty Smarty object + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time (number of seconds, not timestamp) + * + * @return integer number of cache files deleted + */ + abstract public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time); + + /** + * @param Smarty $smarty + * @param Smarty_Template_Cached $cached + * + * @return bool|null + */ + public function locked(Smarty $smarty, Smarty_Template_Cached $cached) + { + // theoretically locking_timeout should be checked against time_limit (max_execution_time) + $start = microtime(true); + $hadLock = null; + while ($this->hasLock($smarty, $cached)) { + $hadLock = true; + if (microtime(true) - $start > $smarty->locking_timeout) { + // abort waiting for lock release + return false; + } + sleep(1); + } + + return $hadLock; + } + + /** + * Check is cache is locked for this template + * + * @param Smarty $smarty + * @param Smarty_Template_Cached $cached + * + * @return bool + */ + public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached) + { + // check if lock exists + return false; + } + + /** + * Lock cache for this template + * + * @param Smarty $smarty + * @param Smarty_Template_Cached $cached + * + * @return bool + */ + public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached) + { + // create lock + return true; + } + + /** + * Unlock cache for this template + * + * @param Smarty $smarty + * @param Smarty_Template_Cached $cached + * + * @return bool + */ + public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached) + { + // release lock + return true; + } + + /** + * Load Cache Resource Handler + * + * @param Smarty $smarty Smarty object + * @param string $type name of the cache resource + * + * @throws SmartyException + * @return Smarty_CacheResource Cache Resource Handler + */ + public static function load(Smarty $smarty, $type = null) + { + if (!isset($type)) { + $type = $smarty->caching_type; + } + + // try smarty's cache + if (isset($smarty->_cache['cacheresource_handlers'][$type])) { + return $smarty->_cache['cacheresource_handlers'][$type]; + } + + // try registered resource + if (isset($smarty->registered_cache_resources[$type])) { + // do not cache these instances as they may vary from instance to instance + return $smarty->_cache['cacheresource_handlers'][$type] = $smarty->registered_cache_resources[$type]; + } + // try sysplugins dir + if (isset(self::$sysplugins[$type])) { + $cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($type); + return $smarty->_cache['cacheresource_handlers'][$type] = new $cache_resource_class(); + } + // try plugins dir + $cache_resource_class = 'Smarty_CacheResource_' . ucfirst($type); + if ($smarty->loadPlugin($cache_resource_class)) { + return $smarty->_cache['cacheresource_handlers'][$type] = new $cache_resource_class(); + } + // give up + throw new SmartyException("Unable to load cache resource '{$type}'"); + } + + /** + * Invalid Loaded Cache Files + * + * @param Smarty $smarty Smarty object + */ + public function invalidLoadedCache(Smarty $smarty) + { + $smarty->_cache['isCached'] = array(); + if (isset($smarty->ext->_subtemplate)) { + $smarty->ext->_subtemplate->tplObjects = array(); + } + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_cacheresource_custom.php b/inc/libs/Smarty/sysplugins/smarty_cacheresource_custom.php new file mode 100755 index 0000000..4e9606e --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_cacheresource_custom.php @@ -0,0 +1,281 @@ +cache_id) ? preg_replace('![^\w\|]+!', '_', $cached->cache_id) : null; + $_compile_id = isset($cached->compile_id) ? preg_replace('![^\w]+!', '_', $cached->compile_id) : null; + $path = $cached->source->filepath . $_cache_id . $_compile_id; + $cached->filepath = sha1($path); + if ($_template->smarty->cache_locking) { + $cached->lock_id = sha1('lock.' . $path); + } + $this->populateTimestamp($cached); + } + + /** + * populate Cached Object with timestamp and exists from Resource + * + * @param Smarty_Template_Cached $cached + * + * @return void + */ + public function populateTimestamp(Smarty_Template_Cached $cached) + { + $mtime = $this->fetchTimestamp($cached->filepath, $cached->source->name, $cached->cache_id, $cached->compile_id); + if ($mtime !== null) { + $cached->timestamp = $mtime; + $cached->exists = !!$cached->timestamp; + + return; + } + $timestamp = null; + $this->fetch($cached->filepath, $cached->source->name, $cached->cache_id, $cached->compile_id, $cached->content, $timestamp); + $cached->timestamp = isset($timestamp) ? $timestamp : false; + $cached->exists = !!$cached->timestamp; + } + + /** + * Read the cached template and process the header + * + * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Cached $cached cached object + * @param bool $update flag if called because cache update + * + * @return boolean true or false if the cached content does not exist + */ + public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached = null, $update = false) + { + if (!$cached) { + $cached = $_template->cached; + } + $content = $cached->content ? $cached->content : null; + $timestamp = $cached->timestamp ? $cached->timestamp : null; + if ($content === null || !$timestamp) { + $this->fetch($_template->cached->filepath, $_template->source->name, $_template->cache_id, $_template->compile_id, $content, $timestamp); + } + if (isset($content)) { + /** @var Smarty_Internal_Template $_smarty_tpl + * used in evaluated code + */ + $_smarty_tpl = $_template; + eval("?>" . $content); + $cached->content = null; + return true; + } + + return false; + } + + /** + * Write the rendered template output to cache + * + * @param Smarty_Internal_Template $_template template object + * @param string $content content to cache + * + * @return boolean success + */ + public function writeCachedContent(Smarty_Internal_Template $_template, $content) + { + return $this->save($_template->cached->filepath, $_template->source->name, $_template->cache_id, $_template->compile_id, $_template->cache_lifetime, $content); + } + + /** + * Read cached template from cache + * + * @param Smarty_Internal_Template $_template template object + * + * @return string content + */ + public function readCachedContent(Smarty_Internal_Template $_template) + { + $content = $_template->cached->content ? $_template->cached->content : null; + $timestamp = null; + if ($content === null) { + $timestamp = null; + $this->fetch($_template->cached->filepath, $_template->source->name, $_template->cache_id, $_template->compile_id, $content, $timestamp); + } + if (isset($content)) { + return $content; + } + return false; + } + + /** + * Empty cache + * + * @param Smarty $smarty Smarty object + * @param integer $exp_time expiration time (number of seconds, not timestamp) + * + * @return integer number of cache files deleted + */ + public function clearAll(Smarty $smarty, $exp_time = null) + { + return $this->delete(null, null, null, $exp_time); + } + + /** + * Empty cache for a specific template + * + * @param Smarty $smarty Smarty object + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time (number of seconds, not timestamp) + * + * @return integer number of cache files deleted + */ + public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time) + { + $cache_name = null; + + if (isset($resource_name)) { + $source = Smarty_Template_Source::load(null, $smarty, $resource_name); + if ($source->exists) { + $cache_name = $source->name; + } else { + return 0; + } + // remove from template cache + if (isset($smarty->_cache['template_objects'])) { + foreach ($smarty->_cache['template_objects'] as $key => $_tpl) { + if (isset($_tpl->cached) && $_tpl->source->uid == $source->uid) { + unset($smarty->_cache['template_objects'][$key]); + } + } + } + } + + return $this->delete($cache_name, $cache_id, $compile_id, $exp_time); + } + + /** + * Check is cache is locked for this template + * + * @param Smarty $smarty Smarty object + * @param Smarty_Template_Cached $cached cached object + * + * @return boolean true or false if cache is locked + */ + public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached) + { + $id = $cached->lock_id; + $name = $cached->source->name . '.lock'; + + $mtime = $this->fetchTimestamp($id, $name, $cached->cache_id, $cached->compile_id); + if ($mtime === null) { + $this->fetch($id, $name, $cached->cache_id, $cached->compile_id, $content, $mtime); + } + return $mtime && ($t = time()) - $mtime < $smarty->locking_timeout; + } + + /** + * Lock cache for this template + * + * @param Smarty $smarty Smarty object + * @param Smarty_Template_Cached $cached cached object + * + * @return bool|void + */ + public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached) + { + $cached->is_locked = true; + $id = $cached->lock_id; + $name = $cached->source->name . '.lock'; + $this->save($id, $name, $cached->cache_id, $cached->compile_id, $smarty->locking_timeout, ''); + } + + /** + * Unlock cache for this template + * + * @param Smarty $smarty Smarty object + * @param Smarty_Template_Cached $cached cached object + * + * @return bool|void + */ + public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached) + { + $cached->is_locked = false; + $name = $cached->source->name . '.lock'; + $this->delete($name, $cached->cache_id, $cached->compile_id, null); + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_cacheresource_keyvaluestore.php b/inc/libs/Smarty/sysplugins/smarty_cacheresource_keyvaluestore.php new file mode 100755 index 0000000..ee4021a --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_cacheresource_keyvaluestore.php @@ -0,0 +1,513 @@ +filepath = $_template->source->uid . '#' . $this->sanitize($cached->source->resource) . '#' . + $this->sanitize($cached->cache_id) . '#' . $this->sanitize($cached->compile_id); + + $this->populateTimestamp($cached); + } + + /** + * populate Cached Object with timestamp and exists from Resource + * + * @param Smarty_Template_Cached $cached cached object + * + * @return void + */ + public function populateTimestamp(Smarty_Template_Cached $cached) + { + if (!$this->fetch($cached->filepath, $cached->source->name, $cached->cache_id, $cached->compile_id, $content, $timestamp, $cached->source->uid)) { + return; + } + $cached->content = $content; + $cached->timestamp = (int) $timestamp; + $cached->exists = $cached->timestamp; + } + + /** + * Read the cached template and process the header + * + * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Cached $cached cached object + * @param bool $update flag if called because cache update + * + * @return boolean true or false if the cached content does not exist + */ + public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached = null, $update = false) + { + if (!$cached) { + $cached = $_template->cached; + } + $content = $cached->content ? $cached->content : null; + $timestamp = $cached->timestamp ? $cached->timestamp : null; + if ($content === null || !$timestamp) { + if (!$this->fetch($_template->cached->filepath, $_template->source->name, $_template->cache_id, $_template->compile_id, $content, $timestamp, $_template->source->uid)) { + return false; + } + } + if (isset($content)) { + /** @var Smarty_Internal_Template $_smarty_tpl + * used in evaluated code + */ + $_smarty_tpl = $_template; + eval("?>" . $content); + + return true; + } + + return false; + } + + /** + * Write the rendered template output to cache + * + * @param Smarty_Internal_Template $_template template object + * @param string $content content to cache + * + * @return boolean success + */ + public function writeCachedContent(Smarty_Internal_Template $_template, $content) + { + $this->addMetaTimestamp($content); + + return $this->write(array($_template->cached->filepath => $content), $_template->cache_lifetime); + } + + /** + * Read cached template from cache + * + * @param Smarty_Internal_Template $_template template object + * + * @return string content + */ + public function readCachedContent(Smarty_Internal_Template $_template) + { + $content = $_template->cached->content ? $_template->cached->content : null; + $timestamp = null; + if ($content === null) { + if (!$this->fetch($_template->cached->filepath, $_template->source->name, $_template->cache_id, $_template->compile_id, $content, $timestamp, $_template->source->uid)) { + return false; + } + } + if (isset($content)) { + return $content; + } + return false; + } + + /** + * Empty cache + * {@internal the $exp_time argument is ignored altogether }} + * + * @param Smarty $smarty Smarty object + * @param integer $exp_time expiration time [being ignored] + * + * @return integer number of cache files deleted [always -1] + * @uses purge() to clear the whole store + * @uses invalidate() to mark everything outdated if purge() is inapplicable + */ + public function clearAll(Smarty $smarty, $exp_time = null) + { + if (!$this->purge()) { + $this->invalidate(null); + } + // remove from template cache + if (isset($smarty->_cache['template_objects'])) { + foreach ($smarty->_cache['template_objects'] as $key => $tpl) { + if (isset($tpl->cached)) { + unset($smarty->_cache['template_objects'][$key]); + } + } + } + return - 1; + } + + /** + * Empty cache for a specific template + * {@internal the $exp_time argument is ignored altogether}} + * + * @param Smarty $smarty Smarty object + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time [being ignored] + * + * @return integer number of cache files deleted [always -1] + * @uses buildCachedFilepath() to generate the CacheID + * @uses invalidate() to mark CacheIDs parent chain as outdated + * @uses delete() to remove CacheID from cache + */ + public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time) + { + $uid = $this->getTemplateUid($smarty, $resource_name); + $cid = $uid . '#' . $this->sanitize($resource_name) . '#' . $this->sanitize($cache_id) . '#' . + $this->sanitize($compile_id); + $this->delete(array($cid)); + $this->invalidate($cid, $resource_name, $cache_id, $compile_id, $uid); + // remove from template cache + if (isset($resource_name) && isset($smarty->_cache['template_objects'])) { + if (isset($smarty->_cache['template_objects'])) { + foreach ($smarty->_cache['template_objects'] as $key => $tpl) { + if ($tpl->source->uid == $uid && isset($tpl->cached)) { + unset($smarty->_cache['template_objects'][$key]); + } + } + } + } + return - 1; + } + + /** + * Get template's unique ID + * + * @param Smarty $smarty Smarty object + * @param string $resource_name template name + * + * @return string filepath of cache file + * @throws \SmartyException + * + */ + protected function getTemplateUid(Smarty $smarty, $resource_name) + { + if (isset($resource_name)) { + $source = Smarty_Template_Source::load(null, $smarty, $resource_name); + if ($source->exists) { + return $source->uid; + } + } + return ''; + } + + /** + * Sanitize CacheID components + * + * @param string $string CacheID component to sanitize + * + * @return string sanitized CacheID component + */ + protected function sanitize($string) + { + $string = trim($string, '|'); + if (!$string) { + return null; + } + return preg_replace('#[^\w\|]+#S', '_', $string); + } + + /** + * Fetch and prepare a cache object. + * + * @param string $cid CacheID to fetch + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $content cached content + * @param integer &$timestamp cached timestamp (epoch) + * @param string $resource_uid resource's uid + * + * @return boolean success + */ + protected function fetch($cid, $resource_name = null, $cache_id = null, $compile_id = null, &$content = null, &$timestamp = null, $resource_uid = null) + { + $t = $this->read(array($cid)); + $content = !empty($t[$cid]) ? $t[$cid] : null; + $timestamp = null; + + if ($content && ($timestamp = $this->getMetaTimestamp($content))) { + $invalidated = $this->getLatestInvalidationTimestamp($cid, $resource_name, $cache_id, $compile_id, $resource_uid); + if ($invalidated > $timestamp) { + $timestamp = null; + $content = null; + } + } + + return !!$content; + } + + /** + * Add current microtime to the beginning of $cache_content + * {@internal the header uses 8 Bytes, the first 4 Bytes are the seconds, the second 4 Bytes are the microseconds}} + * + * @param string &$content the content to be cached + */ + protected function addMetaTimestamp(&$content) + { + $mt = explode(" ", microtime()); + $ts = pack("NN", $mt[1], (int) ($mt[0] * 100000000)); + $content = $ts . $content; + } + + /** + * Extract the timestamp the $content was cached + * + * @param string &$content the cached content + * + * @return float the microtime the content was cached + */ + protected function getMetaTimestamp(&$content) + { + extract(unpack('N1s/N1m/a*content', $content)); + return $s + ($m / 100000000); + } + + /** + * Invalidate CacheID + * + * @param string $cid CacheID + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $resource_uid source's uid + * + * @return void + */ + protected function invalidate($cid = null, $resource_name = null, $cache_id = null, $compile_id = null, $resource_uid = null) + { + $now = microtime(true); + $key = null; + // invalidate everything + if (!$resource_name && !$cache_id && !$compile_id) { + $key = 'IVK#ALL'; + } // invalidate all caches by template + else { + if ($resource_name && !$cache_id && !$compile_id) { + $key = 'IVK#TEMPLATE#' . $resource_uid . '#' . $this->sanitize($resource_name); + } // invalidate all caches by cache group + else { + if (!$resource_name && $cache_id && !$compile_id) { + $key = 'IVK#CACHE#' . $this->sanitize($cache_id); + } // invalidate all caches by compile id + else { + if (!$resource_name && !$cache_id && $compile_id) { + $key = 'IVK#COMPILE#' . $this->sanitize($compile_id); + } // invalidate by combination + else { + $key = 'IVK#CID#' . $cid; + } + } + } + } + $this->write(array($key => $now)); + } + + /** + * Determine the latest timestamp known to the invalidation chain + * + * @param string $cid CacheID to determine latest invalidation timestamp of + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $resource_uid source's filepath + * + * @return float the microtime the CacheID was invalidated + */ + protected function getLatestInvalidationTimestamp($cid, $resource_name = null, $cache_id = null, $compile_id = null, $resource_uid = null) + { + // abort if there is no CacheID + if (false && !$cid) { + return 0; + } + // abort if there are no InvalidationKeys to check + if (!($_cid = $this->listInvalidationKeys($cid, $resource_name, $cache_id, $compile_id, $resource_uid))) { + return 0; + } + + // there are no InValidationKeys + if (!($values = $this->read($_cid))) { + return 0; + } + // make sure we're dealing with floats + $values = array_map('floatval', $values); + + return max($values); + } + + /** + * Translate a CacheID into the list of applicable InvalidationKeys. + * Splits "some|chain|into|an|array" into array( '#clearAll#', 'some', 'some|chain', 'some|chain|into', ... ) + * + * @param string $cid CacheID to translate + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $resource_uid source's filepath + * + * @return array list of InvalidationKeys + * @uses $invalidationKeyPrefix to prepend to each InvalidationKey + */ + protected function listInvalidationKeys($cid, $resource_name = null, $cache_id = null, $compile_id = null, $resource_uid = null) + { + $t = array('IVK#ALL'); + $_name = $_compile = '#'; + if ($resource_name) { + $_name .= $resource_uid . '#' . $this->sanitize($resource_name); + $t[] = 'IVK#TEMPLATE' . $_name; + } + if ($compile_id) { + $_compile .= $this->sanitize($compile_id); + $t[] = 'IVK#COMPILE' . $_compile; + } + $_name .= '#'; + $cid = trim($cache_id, '|'); + if (!$cid) { + return $t; + } + $i = 0; + while (true) { + // determine next delimiter position + $i = strpos($cid, '|', $i); + // add complete CacheID if there are no more delimiters + if ($i === false) { + $t[] = 'IVK#CACHE#' . $cid; + $t[] = 'IVK#CID' . $_name . $cid . $_compile; + $t[] = 'IVK#CID' . $_name . $_compile; + break; + } + $part = substr($cid, 0, $i); + // add slice to list + $t[] = 'IVK#CACHE#' . $part; + $t[] = 'IVK#CID' . $_name . $part . $_compile; + // skip past delimiter position + $i ++; + } + + return $t; + } + + /** + * Check is cache is locked for this template + * + * @param Smarty $smarty Smarty object + * @param Smarty_Template_Cached $cached cached object + * + * @return boolean true or false if cache is locked + */ + public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached) + { + $key = 'LOCK#' . $cached->filepath; + $data = $this->read(array($key)); + + return $data && time() - $data[$key] < $smarty->locking_timeout; + } + + /** + * Lock cache for this template + * + * @param Smarty $smarty Smarty object + * @param Smarty_Template_Cached $cached cached object + * + * @return bool|void + */ + public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached) + { + $cached->is_locked = true; + $key = 'LOCK#' . $cached->filepath; + $this->write(array($key => time()), $smarty->locking_timeout); + } + + /** + * Unlock cache for this template + * + * @param Smarty $smarty Smarty object + * @param Smarty_Template_Cached $cached cached object + * + * @return bool|void + */ + public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached) + { + $cached->is_locked = false; + $key = 'LOCK#' . $cached->filepath; + $this->delete(array($key)); + } + + /** + * Read values for a set of keys from cache + * + * @param array $keys list of keys to fetch + * + * @return array list of values with the given keys used as indexes + */ + abstract protected function read(array $keys); + + /** + * Save values for a set of keys to cache + * + * @param array $keys list of values to save + * @param int $expire expiration time + * + * @return boolean true on success, false on failure + */ + abstract protected function write(array $keys, $expire = null); + + /** + * Remove values from cache + * + * @param array $keys list of keys to delete + * + * @return boolean true on success, false on failure + */ + abstract protected function delete(array $keys); + + /** + * Remove *all* values from cache + * + * @return boolean true on success, false on failure + */ + protected function purge() + { + return false; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_data.php b/inc/libs/Smarty/sysplugins/smarty_data.php new file mode 100755 index 0000000..7cf18a4 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_data.php @@ -0,0 +1,68 @@ +dataObjectName = 'Data_object ' . (isset($name) ? "'{$name}'" : self::$count); + $this->smarty = $smarty; + if (is_object($_parent)) { + // when object set up back pointer + $this->parent = $_parent; + } elseif (is_array($_parent)) { + // set up variable values + foreach ($_parent as $_key => $_val) { + $this->tpl_vars[$_key] = new Smarty_Variable($_val); + } + } elseif ($_parent != null) { + throw new SmartyException("Wrong type for template variables"); + } + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_cacheresource_file.php b/inc/libs/Smarty/sysplugins/smarty_internal_cacheresource_file.php new file mode 100755 index 0000000..64d02df --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_cacheresource_file.php @@ -0,0 +1,225 @@ +source->filepath); + $_cache_id = isset($_template->cache_id) ? preg_replace('![^\w\|]+!', '_', $_template->cache_id) : null; + $_compile_id = isset($_template->compile_id) ? preg_replace('![^\w]+!', '_', $_template->compile_id) : null; + $_filepath = $_template->source->uid; + // if use_sub_dirs, break file into directories + if ($_template->smarty->use_sub_dirs) { + $_filepath = substr($_filepath, 0, 2) . DS . substr($_filepath, 2, 2) . DS . substr($_filepath, 4, 2) . DS . + $_filepath; + } + $_compile_dir_sep = $_template->smarty->use_sub_dirs ? DS : '^'; + if (isset($_cache_id)) { + $_cache_id = str_replace('|', $_compile_dir_sep, $_cache_id) . $_compile_dir_sep; + } else { + $_cache_id = ''; + } + if (isset($_compile_id)) { + $_compile_id = $_compile_id . $_compile_dir_sep; + } else { + $_compile_id = ''; + } + $_cache_dir = $_template->smarty->getCacheDir(); + if ($_template->smarty->cache_locking) { + // create locking file name + // relative file name? + if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_cache_dir)) { + $_lock_dir = rtrim(getcwd(), '/\\') . DS . $_cache_dir; + } else { + $_lock_dir = $_cache_dir; + } + $cached->lock_id = $_lock_dir . sha1($_cache_id . $_compile_id . $_template->source->uid) . '.lock'; + } + $cached->filepath = $_cache_dir . $_cache_id . $_compile_id . $_filepath . '.' . basename($_source_file_path) . + '.php'; + $cached->timestamp = $cached->exists = is_file($cached->filepath); + if ($cached->exists) { + $cached->timestamp = filemtime($cached->filepath); + } + } + + /** + * populate Cached Object with timestamp and exists from Resource + * + * @param Smarty_Template_Cached $cached cached object + * + * @return void + */ + public function populateTimestamp(Smarty_Template_Cached $cached) + { + $cached->timestamp = $cached->exists = is_file($cached->filepath); + if ($cached->exists) { + $cached->timestamp = filemtime($cached->filepath); + } + } + + /** + * Read the cached template and process its header + * + * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Cached $cached cached object + * @param bool $update flag if called because cache update + * + * @return boolean true or false if the cached content does not exist + */ + public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached = null, $update = false) + { + /** @var Smarty_Internal_Template $_smarty_tpl + * used in included file + */ + $_smarty_tpl = $_template; + $_template->cached->valid = false; + if ($update && defined('HHVM_VERSION')) { + return $_template->smarty->ext->_hhvm->includeHhvm($_template, $_template->cached->filepath); + } else { + return @include $_template->cached->filepath; + } + } + + /** + * Write the rendered template output to cache + * + * @param Smarty_Internal_Template $_template template object + * @param string $content content to cache + * + * @return boolean success + */ + public function writeCachedContent(Smarty_Internal_Template $_template, $content) + { + if ($_template->smarty->ext->_writeFile->writeFile($_template->cached->filepath, $content, $_template->smarty) === true) { + if (function_exists('opcache_invalidate')) { + opcache_invalidate($_template->cached->filepath); + } + $cached = $_template->cached; + $cached->timestamp = $cached->exists = is_file($cached->filepath); + if ($cached->exists) { + $cached->timestamp = filemtime($cached->filepath); + return true; + } + } + return false; + } + + /** + * Read cached template from cache + * + * @param Smarty_Internal_Template $_template template object + * + * @return string content + */ + public function readCachedContent(Smarty_Internal_Template $_template) + { + if (is_file($_template->cached->filepath)) { + return file_get_contents($_template->cached->filepath); + } + return false; + } + + /** + * Empty cache + * + * @param Smarty $smarty + * @param integer $exp_time expiration time (number of seconds, not timestamp) + * + * @return integer number of cache files deleted + */ + public function clearAll(Smarty $smarty, $exp_time = null) + { + return Smarty_Internal_Extension_Clear::clear($smarty, null, null, null, $exp_time); + } + + /** + * Empty cache for a specific template + * + * @param Smarty $smarty + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time (number of seconds, not timestamp) + * + * @return integer number of cache files deleted + */ + public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time) + { + return Smarty_Internal_Extension_Clear::clear($smarty, $resource_name, $cache_id, $compile_id, $exp_time); + } + + /** + * Check is cache is locked for this template + * + * @param Smarty $smarty Smarty object + * @param Smarty_Template_Cached $cached cached object + * + * @return boolean true or false if cache is locked + */ + public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached) + { + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + clearstatcache(true, $cached->lock_id); + } else { + clearstatcache(); + } + if (is_file($cached->lock_id)) { + $t = @filemtime($cached->lock_id); + return $t && (time() - $t < $smarty->locking_timeout); + } else { + return false; + } + } + + /** + * Lock cache for this template + * + * @param Smarty $smarty Smarty object + * @param Smarty_Template_Cached $cached cached object + * + * @return bool|void + */ + public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached) + { + $cached->is_locked = true; + touch($cached->lock_id); + } + + /** + * Unlock cache for this template + * + * @param Smarty $smarty Smarty object + * @param Smarty_Template_Cached $cached cached object + * + * @return bool|void + */ + public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached) + { + $cached->is_locked = false; + @unlink($cached->lock_id); + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_append.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_append.php new file mode 100755 index 0000000..bd2ffe4 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_append.php @@ -0,0 +1,50 @@ +required_attributes = array('var', 'value'); + $this->shorttag_order = array('var', 'value'); + $this->optional_attributes = array('scope', 'index'); + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + // map to compile assign attributes + if (isset($_attr['index'])) { + $_params['smarty_internal_index'] = '[' . $_attr['index'] . ']'; + unset($_attr['index']); + } else { + $_params['smarty_internal_index'] = '[]'; + } + $_new_attr = array(); + foreach ($_attr as $key => $value) { + $_new_attr[] = array($key => $value); + } + // call compile assign + return parent::compile($_new_attr, $compiler, $_params); + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_assign.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_assign.php new file mode 100755 index 0000000..5e3fce3 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_assign.php @@ -0,0 +1,98 @@ + true, 'parent' => true, 'root' => true, 'global' => true, + 'smarty' => true, 'tpl_root' => true); + + /** + * Compiles code for the {assign} tag + * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter + * + * @return string compiled code + * @throws \SmartyCompilerException + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + { + // the following must be assigned at runtime because it will be overwritten in Smarty_Internal_Compile_Append + $this->required_attributes = array('var', 'value'); + $this->shorttag_order = array('var', 'value'); + $this->optional_attributes = array('scope', 'bubble_up'); + $_nocache = 'null'; + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + // nocache ? + if ($compiler->tag_nocache || $compiler->nocache) { + $_nocache = 'true'; + // create nocache var to make it know for further compiling + if (isset($compiler->template->tpl_vars[trim($_attr['var'], "'")])) { + $compiler->template->tpl_vars[trim($_attr['var'], "'")]->nocache = true; + } else { + $compiler->template->tpl_vars[trim($_attr['var'], "'")] = new Smarty_Variable(null, true); + } + } + // scope setup + $_scope = Smarty::SCOPE_LOCAL; + if (isset($_attr['scope'])) { + $_attr['scope'] = trim($_attr['scope'], "'\""); + if (!isset($this->valid_scopes[$_attr['scope']])) { + $compiler->trigger_template_error("illegal value '{$_attr['scope']}' for \"scope\" attribute", null, true); + } + if ($_attr['scope'] != 'local') { + if ($_attr['scope'] == 'parent') { + $_scope = Smarty::SCOPE_PARENT; + } elseif ($_attr['scope'] == 'root') { + $_scope = Smarty::SCOPE_ROOT; + } elseif ($_attr['scope'] == 'global') { + $_scope = Smarty::SCOPE_GLOBAL; + } elseif ($_attr['scope'] == 'smarty') { + $_scope = Smarty::SCOPE_SMARTY; + } elseif ($_attr['scope'] == 'tpl_root') { + $_scope = Smarty::SCOPE_TPL_ROOT; + } + $_scope += (isset($_attr['bubble_up']) && $_attr['bubble_up'] == 'false') ? 0 : Smarty::SCOPE_BUBBLE_UP; + } + } + // compiled output + if (isset($parameter['smarty_internal_index'])) { + $output = + "smarty->ext->_var->createLocalArrayVariable(\$_smarty_tpl, $_attr[var], $_nocache);\n\$_smarty_tpl->tpl_vars[$_attr[var]]->value$parameter[smarty_internal_index] = $_attr[value];"; + } else { + // implement Smarty2's behaviour of variables assigned by reference + if ($compiler->template->smarty instanceof SmartyBC) { + $output = + "tpl_vars[$_attr[var]])) {\$_smarty_tpl->tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]];"; + $output .= "\n\$_smarty_tpl->tpl_vars[$_attr[var]]->value = $_attr[value]; \$_smarty_tpl->tpl_vars[$_attr[var]]->nocache = $_nocache;"; + $output .= "\n} else \$_smarty_tpl->tpl_vars[$_attr[var]] = new Smarty_Variable($_attr[value], $_nocache);"; + } else { + $output = "tpl_vars[$_attr[var]] = new Smarty_Variable($_attr[value], $_nocache);"; + } + } + $output .= "\n\$_smarty_tpl->ext->_updateScope->updateScope(\$_smarty_tpl, $_attr[var], $_scope);"; + $output .= '?>'; + + return $output; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_block.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_block.php new file mode 100755 index 0000000..ab1fc6e --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_block.php @@ -0,0 +1,292 @@ + + */ +class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inheritance +{ + /** + * Attribute definition: Overwrites base class. + * + * @var array + * @see Smarty_Internal_CompileBase + */ + public $required_attributes = array('name'); + + /** + * Attribute definition: Overwrites base class. + * + * @var array + * @see Smarty_Internal_CompileBase + */ + public $shorttag_order = array('name'); + + /** + * Attribute definition: Overwrites base class. + * + * @var array + * @see Smarty_Internal_CompileBase + */ + public $option_flags = array('hide', 'nocache'); + + /** + * Attribute definition: Overwrites base class. + * + * @var array + * @see Smarty_Internal_CompileBase + */ + public $optional_attributes = array('assign'); + + /** + * nesting level of block tags + * + * @var int + */ + public static $blockTagNestingLevel = 0; + + /** + * Saved compiler object + * + * @var Smarty_Internal_TemplateCompilerBase + */ + public $compiler = null; + + /** + * Compiles code for the {block} tag + * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter + * + * @return bool true + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + { + if (!isset($compiler->_cache['blockNesting'])) { + $compiler->_cache['blockNesting'] = 0; + } + if ($compiler->_cache['blockNesting'] == 0) { + // make sure that inheritance gets initialized in template code + $this->registerInit($compiler); + $this->option_flags = array('hide', 'nocache', 'append', 'prepend'); + } else { + $this->option_flags = array('hide', 'nocache'); + } + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + $compiler->_cache['blockNesting'] ++; + $compiler->_cache['blockName'][$compiler->_cache['blockNesting']] = $_attr['name']; + $compiler->_cache['blockParams'][$compiler->_cache['blockNesting']][0] = 'block_' . preg_replace('![^\w]+!', '_', uniqid(rand(), true)); + $compiler->_cache['blockParams'][$compiler->_cache['blockNesting']][1] = false; + $this->openTag($compiler, 'block', array($_attr, $compiler->nocache, $compiler->parser->current_buffer, + $compiler->template->compiled->has_nocache_code, + $compiler->template->caching)); + // must whole block be nocache ? + if ($compiler->tag_nocache) { + $i = 0; + } + $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; + // $compiler->suppressNocacheProcessing = true; + if ($_attr['nocache'] === true) { + //$compiler->trigger_template_error('nocache option not allowed', $compiler->parser->lex->taglineno); + } + $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); + $compiler->template->compiled->has_nocache_code = false; + $compiler->suppressNocacheProcessing = true; + } + + /** + * Compile saved child block source + * + * @param \Smarty_Internal_TemplateCompilerBase compiler object + * @param string $_name optional name of child block + * + * @return string compiled code of child block + */ + static function compileChildBlock(Smarty_Internal_TemplateCompilerBase $compiler, $_name = null) + { + if (!isset($compiler->_cache['blockNesting'])) { + $compiler->trigger_template_error(' tag {$smarty.block.child} used outside {block} tags ', + $compiler->parser->lex->taglineno); + } + $compiler->has_code = true; + $compiler->suppressNocacheProcessing = true; + $compiler->_cache['blockParams'][$compiler->_cache['blockNesting']][1] = true; + $output = "ext->_inheritance->processBlock(\$_smarty_tpl, 2, {$compiler->_cache['blockName'][$compiler->_cache['blockNesting']]}, null, \$_blockParentStack);\n?>\n"; + return $output; + } + + /** + * Compile $smarty.block.parent + * + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param string $_name optional name of child block + * + * @return string compiled code of child block + */ + static function compileParentBlock(Smarty_Internal_TemplateCompilerBase $compiler, $_name = null) + { + if (!isset($compiler->_cache['blockNesting'])) { + $compiler->trigger_template_error(' tag {$smarty.block.parent} used outside {block} tags ', + $compiler->parser->lex->taglineno); + } + $compiler->suppressNocacheProcessing = true; + $compiler->has_code = true; + $output = "ext->_inheritance->processBlock(\$_smarty_tpl, 4, {$compiler->_cache['blockName'][$compiler->_cache['blockNesting']]}, null, \$_blockParentStack);\n?>\n"; + return $output; + } +} + +/** + * Smarty Internal Plugin Compile BlockClose Class + * + */ +class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_Inheritance +{ + /** + * Compiles code for the {/block} tag + * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter + * + * @return bool true + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + { + list($_attr, $_nocache, $_buffer, $_has_nocache_code, $_caching) = $this->closeTag($compiler, array('block')); + // init block parameter + $_block = $compiler->_cache['blockParams'][$compiler->_cache['blockNesting']]; + unset($compiler->_cache['blockParams'][$compiler->_cache['blockNesting']]); + $_block[2] = $_block[3] = 0; + $_name = trim($_attr['name'], "'\""); + $_assign = isset($_attr['assign']) ? $_attr['assign'] : null; + unset($_attr['assign'], $_attr['name']); + foreach ($_attr as $name => $stat) { + if ((is_bool($stat) && $stat !== false) || (!is_bool($stat) && $stat != 'false')) { + $_block[$name] = is_string($stat) ? trim($stat, "'\"") : $stat; + } + } + $_funcName = $_block[0]; + // get compiled block code + $_functionCode = $compiler->parser->current_buffer; + // setup buffer for template function code + $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); + + if ($compiler->template->compiled->has_nocache_code) { + // $compiler->parent_compiler->template->tpl_function[$_name]['call_name_caching'] = $_funcNameCaching; + $_block[6] = $_funcNameCaching = $_funcName . '_nocache'; + $output = "template->source->type}:{$compiler->template->source->name} */\n"; + $output .= "function {$_funcNameCaching} (\$_smarty_tpl, \$_blockParentStack) {\n"; + $output .= "/*/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\n"; + $output .= "\$_smarty_tpl->cached->hashes['{$compiler->template->compiled->nocache_hash}'] = true;\n"; + if (isset($_assign)) { + $output .= "ob_start();\n"; + } + $output .= "?>\n"; + $compiler->parser->current_buffer->append_subtree($compiler->parser, + new Smarty_Internal_ParseTree_Tag($compiler->parser, + $output)); + $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode); + $output = "tpl_vars[{$_assign}] = new Smarty_Variable(ob_get_clean());\n"; + } + $output .= "/*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\n"; + $output .= "}\n"; + $output .= "/* {/block '{$_name}'} */\n\n"; + $output .= "?>\n"; + $compiler->parser->current_buffer->append_subtree($compiler->parser, + new Smarty_Internal_ParseTree_Tag($compiler->parser, + $output)); + $compiler->blockOrFunctionCode .= $f = $compiler->parser->current_buffer->to_smarty_php($compiler->parser); + $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); + $this->compiler = $compiler; + $_functionCode = new Smarty_Internal_ParseTree_Tag($compiler->parser, + preg_replace_callback("/((<\?php )?echo '\/\*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%\*\/([\S\s]*?)\/\*\/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%\*\/';(\?>\n)?)/", + array($this, 'removeNocache'), + $_functionCode->to_smarty_php($compiler->parser))); + $this->compiler = null; + } + $output = "template->source->type}:{$compiler->template->source->name} */\n"; + $output .= "function {$_funcName}(\$_smarty_tpl, \$_blockParentStack) {\n"; + if (isset($_assign)) { + $output .= "ob_start();\n"; + } + $output .= "?>\n"; + $compiler->parser->current_buffer->append_subtree($compiler->parser, + new Smarty_Internal_ParseTree_Tag($compiler->parser, + $output)); + $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode); + $output = "tpl_vars[{$_assign}] = new Smarty_Variable(ob_get_clean());\n"; + } + $output .= "}\n"; + $output .= "/* {/block '{$_name}'} */\n\n"; + $output .= "?>\n"; + $compiler->parser->current_buffer->append_subtree($compiler->parser, + new Smarty_Internal_ParseTree_Tag($compiler->parser, + $output)); + $compiler->blockOrFunctionCode .= $compiler->parser->current_buffer->to_smarty_php($compiler->parser); + // nocache plugins must be copied + if (!empty($compiler->template->compiled->required_plugins['nocache'])) { + foreach ($compiler->template->compiled->required_plugins['nocache'] as $plugin => $tmp) { + foreach ($tmp as $type => $data) { + $compiler->parent_compiler->template->compiled->required_plugins['compiled'][$plugin][$type] = + $data; + } + } + } + + + // restore old status + $compiler->template->compiled->has_nocache_code = $_has_nocache_code; + $compiler->tag_nocache = $compiler->nocache; + $compiler->nocache = $_nocache; + $compiler->parser->current_buffer = $_buffer; + $output = "_cache['blockNesting'] == 1) { + $output .= "\$_smarty_tpl->ext->_inheritance->processBlock(\$_smarty_tpl, 0, {$compiler->_cache['blockName'][$compiler->_cache['blockNesting']]}, " . + var_export($_block, true) . ");\n"; + } else { + $output .= "\$_smarty_tpl->ext->_inheritance->processBlock(\$_smarty_tpl, 0, {$compiler->_cache['blockName'][$compiler->_cache['blockNesting']]}, " . + var_export($_block, true) . ", \$_blockParentStack);\n"; + + } + $output .= "?>\n"; + $compiler->_cache['blockNesting'] --; + if ($compiler->_cache['blockNesting'] == 0) { + unset($compiler->_cache['blockNesting']); + } + $compiler->has_code = true; + $compiler->suppressNocacheProcessing = true; + return $output; + } + + /** + * @param $match + * + * @return mixed + */ + function removeNocache($match) + { + $code = + preg_replace("/((<\?php )?echo '\/\*%%SmartyNocache:{$this->compiler->template->compiled->nocache_hash}%%\*\/)|(\/\*\/%%SmartyNocache:{$this->compiler->template->compiled->nocache_hash}%%\*\/';(\?>\n)?)/", + '', $match[0]); + $code = str_replace(array('\\\'', '\\\\\''), array('\'', '\\\''), $code); + return $code; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_break.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_break.php new file mode 100755 index 0000000..cbc73d3 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_break.php @@ -0,0 +1,77 @@ + true, 'foreach' => true, 'while' => true, 'section' => true); + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + + if ($_attr['nocache'] === true) { + $compiler->trigger_template_error('nocache option not allowed', null, true); + } + + if (isset($_attr['levels'])) { + if (!is_numeric($_attr['levels'])) { + $compiler->trigger_template_error('level attribute must be a numeric constant', null, true); + } + $_levels = $_attr['levels']; + } else { + $_levels = 1; + } + $level_count = $_levels; + $stack_count = count($compiler->_tag_stack) - 1; + while ($level_count > 0 && $stack_count >= 0) { + if (isset($_is_loopy[$compiler->_tag_stack[$stack_count][0]])) { + $level_count --; + } + $stack_count --; + } + if ($level_count != 0) { + $compiler->trigger_template_error("cannot break {$_levels} level(s)", null, true); + } + + return ""; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_call.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_call.php new file mode 100755 index 0000000..b7204be --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_call.php @@ -0,0 +1,89 @@ +getAttributes($compiler, $args); + // save possible attributes + if (isset($_attr['assign'])) { + // output will be stored in a smarty variable instead of being displayed + $_assign = $_attr['assign']; + } + //$_name = trim($_attr['name'], "'\""); + $_name = $_attr['name']; + unset($_attr['name'], $_attr['assign'], $_attr['nocache']); + // set flag (compiled code of {function} must be included in cache file + if (!$compiler->template->caching || $compiler->nocache || $compiler->tag_nocache) { + $_nocache = 'true'; + } else { + $_nocache = 'false'; + } + $_paramsArray = array(); + foreach ($_attr as $_key => $_value) { + if (is_int($_key)) { + $_paramsArray[] = "$_key=>$_value"; + } else { + $_paramsArray[] = "'$_key'=>$_value"; + } + } + $_params = 'array(' . implode(",", $_paramsArray) . ')'; + //$compiler->suppressNocacheProcessing = true; + // was there an assign attribute + if (isset($_assign)) { + $_output = + "smarty->ext->_tplFunction->callTemplateFunction(\$_smarty_tpl, {$_name}, {$_params}, {$_nocache});\n\$_smarty_tpl->assign({$_assign}, ob_get_clean());?>\n"; + } else { + $_output = + "smarty->ext->_tplFunction->callTemplateFunction(\$_smarty_tpl, {$_name}, {$_params}, {$_nocache});?>\n"; + } + return $_output; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_capture.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_capture.php new file mode 100755 index 0000000..be45f3e --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_capture.php @@ -0,0 +1,117 @@ +getAttributes($compiler, $args); + + $buffer = isset($_attr['name']) ? $_attr['name'] : "'default'"; + $assign = isset($_attr['assign']) ? $_attr['assign'] : 'null'; + $append = isset($_attr['append']) ? $_attr['append'] : 'null'; + + $compiler->_capture_stack[0][] = array($buffer, $assign, $append, $compiler->nocache); + // maybe nocache because of nocache variables + $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; + $_output = "_cache['capture_stack'][] = array($buffer, $assign, $append); ob_start(); ?>"; + + return $_output; + } + + /** + * Compiles code for the {$smarty.capture.xxx} + * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter + * + * @return string compiled code + * @throws \SmartyCompilerException + */ + public static function compileSpecialVariable($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + { + $tag = strtolower(trim($parameter[ 0 ], '"\'')); + $name = isset($parameter[ 1 ]) ? $compiler->getId($parameter[ 1 ]) : false; + if (!$name) { + $compiler->trigger_template_error("missing or illegal \$smarty.{$tag} name attribute", null, true); + } + return "(isset(\$_smarty_tpl->_cache['__smarty_capture']['{$name}']) ? \$_smarty_tpl->_cache['__smarty_capture']['{$name}'] : null)"; + } +} + +/** + * Smarty Internal Plugin Compile Captureclose Class + * + * @package Smarty + * @subpackage Compiler + */ +class Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase +{ + /** + * Compiles code for the {/capture} tag + * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * + * @return string compiled code + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) + { + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + // must endblock be nocache? + if ($compiler->nocache) { + $compiler->tag_nocache = true; + } + + list($buffer, $assign, $append, $compiler->nocache) = array_pop($compiler->_capture_stack[0]); + + $_output = "_cache['capture_stack']);\n"; + $_output .= "if (!empty(\$_capture_buffer)) {\n"; + $_output .= " if (isset(\$_capture_assign)) \$_smarty_tpl->assign(\$_capture_assign, ob_get_contents());\n"; + $_output .= " if (isset( \$_capture_append)) \$_smarty_tpl->append( \$_capture_append, ob_get_contents());\n"; + $_output .= "\$_smarty_tpl->_cache['__smarty_capture'][\$_capture_buffer]=ob_get_clean();\n"; + $_output .= "} else \$_smarty_tpl->capture_error();?>"; + + return $_output; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_config_load.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_config_load.php new file mode 100755 index 0000000..d2e50a0 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_config_load.php @@ -0,0 +1,104 @@ + true, 'parent' => true, 'root' => true, 'global' => true, + 'smarty' => true, 'tpl_root' => true); + + /** + * Compiles code for the {config_load} tag + * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * + * @return string compiled code + * @throws \SmartyCompilerException + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) + { + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + + if ($_attr['nocache'] === true) { + $compiler->trigger_template_error('nocache option not allowed', null, true); + } + + // save possible attributes + $conf_file = $_attr['file']; + if (isset($_attr['section'])) { + $section = $_attr['section']; + } else { + $section = 'null'; + } + $_scope = Smarty::SCOPE_LOCAL; + if (isset($_attr['scope'])) { + $_attr['scope'] = trim($_attr['scope'], "'\""); + if (!isset($this->valid_scopes[$_attr['scope']])) { + $compiler->trigger_template_error("illegal value '{$_attr['scope']}' for \"scope\" attribute", null, true); + } + if ($_attr['scope'] != 'local') { + if ($_attr['scope'] == 'parent') { + $_scope = Smarty::SCOPE_PARENT; + } elseif ($_attr['scope'] == 'root') { + $_scope = Smarty::SCOPE_ROOT; + } elseif ($_attr['scope'] == 'global') { + $_scope = Smarty::SCOPE_GLOBAL; + } elseif ($_attr['scope'] == 'smarty') { + $_scope = Smarty::SCOPE_SMARTY; + } elseif ($_attr['scope'] == 'tpl_root') { + $_scope = Smarty::SCOPE_TPL_ROOT; + } + $_scope += (isset($_attr['bubble_up']) && $_attr['bubble_up'] == 'false') ? 0 : Smarty::SCOPE_BUBBLE_UP; + } + } + + // create config object + $_output = + "smarty->ext->configLoad->_loadConfigFile(\$_smarty_tpl, {$conf_file}, {$section}, {$_scope});\n?>\n"; + + return $_output; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_continue.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_continue.php new file mode 100755 index 0000000..2ee04c9 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_continue.php @@ -0,0 +1,77 @@ + true, 'foreach' => true, 'while' => true, 'section' => true); + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + + if ($_attr['nocache'] === true) { + $compiler->trigger_template_error('nocache option not allowed', null, true); + } + + if (isset($_attr['levels'])) { + if (!is_numeric($_attr['levels'])) { + $compiler->trigger_template_error('level attribute must be a numeric constant', null, true); + } + $_levels = $_attr['levels']; + } else { + $_levels = 1; + } + $level_count = $_levels; + $stack_count = count($compiler->_tag_stack) - 1; + while ($level_count > 0 && $stack_count >= 0) { + if (isset($_is_loopy[$compiler->_tag_stack[$stack_count][0]])) { + $level_count --; + } + $stack_count --; + } + if ($level_count != 0) { + $compiler->trigger_template_error("cannot continue {$_levels} level(s)", null, true); + } + + return ""; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_debug.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_debug.php new file mode 100755 index 0000000..d73c81a --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_debug.php @@ -0,0 +1,41 @@ +getAttributes($compiler, $args); + + // compile always as nocache + $compiler->tag_nocache = true; + + // display debug template + $_output = "display_debug(\$_smarty_tpl);\n"; + $_output .= "unset(\$_smarty_debug);\n?>"; + return $_output; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_eval.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_eval.php new file mode 100755 index 0000000..407482f --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_eval.php @@ -0,0 +1,71 @@ +required_attributes = array('var'); + $this->optional_attributes = array('assign'); + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + if (isset($_attr['assign'])) { + // output will be stored in a smarty variable instead of being displayed + $_assign = $_attr['assign']; + } + + // create template object + $_output = "\$_template = new {$compiler->smarty->template_class}('eval:'." . $_attr['var'] . ", \$_smarty_tpl->smarty, \$_smarty_tpl);"; + //was there an assign attribute? + if (isset($_assign)) { + $_output .= "\$_smarty_tpl->assign($_assign,\$_template->fetch());"; + } else { + $_output .= "echo \$_template->fetch();"; + } + + return ""; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_extends.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_extends.php new file mode 100755 index 0000000..7ce3dcf --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_extends.php @@ -0,0 +1,134 @@ +getAttributes($compiler, $args); + if ($_attr['nocache'] === true) { + $compiler->trigger_template_error('nocache option not allowed', $compiler->parser->lex->line - 1); + } + if (strpos($_attr['file'], '$_tmp') !== false) { + $compiler->trigger_template_error('illegal value for file attribute', $compiler->parser->lex->line - 1); + } + // add code to initialize inheritance + $this->registerInit($compiler, true); + $file = trim($_attr['file'], '\'"'); + if (strlen($file) > 8 && substr($file, 0, 8) == 'extends:') { + // generate code for each template + $files = array_reverse(explode('|', substr($file, 8))); + $i = 0; + foreach ($files as $file) { + if ($file[0] == '"') { + $file = trim($file, '".'); + } else { + $file = "'{$file}'"; + } + $i ++; + if ($i == count($files) && isset($_attr['extends_resource'])) { + $this->compileEndChild($compiler); + } + $this->compileInclude($compiler, $file); + } + if (!isset($_attr['extends_resource'])) { + $this->compileEndChild($compiler); + } + } else { + $this->compileEndChild($compiler); + $this->compileInclude($compiler, $_attr['file']); + } + $compiler->has_code = false; + return ''; + } + + /** + * Add code for inheritance endChild() method to end of template + * + * @param \Smarty_Internal_TemplateCompilerBase $compiler + */ + private function compileEndChild(Smarty_Internal_TemplateCompilerBase $compiler) + { + $compiler->parser->template_postfix[] = new Smarty_Internal_ParseTree_Tag($compiler->parser, + "ext->_inheritance->endChild(\$_smarty_tpl);\n?>\n"); + } + + /** + * Add code for including subtemplate to end of template + * + * @param \Smarty_Internal_TemplateCompilerBase $compiler + * @param string $file subtemplate name + */ + private function compileInclude(Smarty_Internal_TemplateCompilerBase $compiler, $file) + { + $compiler->parser->template_postfix[] = new Smarty_Internal_ParseTree_Tag($compiler->parser, + $compiler->compileTag('include', + array($file, + array('scope' => 'parent')))); + } + + /** + * Create source code for {extends} from source components array + * + * @param []\Smarty_Internal_Template_Source $components + * + * @return string + */ + public static function extendsSourceArrayCode($components) + { + $resources = array(); + foreach ($components as $source) { + $resources[] = $source->resource; + } + return '{extends file=\'extends:' . join('|', $resources) . '\' extends_resource=true}'; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_for.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_for.php new file mode 100755 index 0000000..7b86d48 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_for.php @@ -0,0 +1,169 @@ +loopNesting++; + if ($parameter == 0) { + $this->required_attributes = array('start', 'to'); + $this->optional_attributes = array('max', 'step'); + } else { + $this->required_attributes = array('start', 'ifexp', 'var', 'step'); + $this->optional_attributes = array(); + } + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + + $output = "tpl_vars[$var] = new Smarty_Variable;\n"; + $output .= "\$_smarty_tpl->tpl_vars[$var]->value{$index} = {$_statement['value']};\n"; + } + if (is_array($_attr['var'])) { + $var = $_attr['var']['var']; + $index = $_attr['var']['smarty_internal_index']; + } else { + $var = $_attr['var']; + $index = ''; + } + $output .= "if ($_attr[ifexp]) {\nfor (\$_foo=true;$_attr[ifexp]; \$_smarty_tpl->tpl_vars[$var]->value{$index}$_attr[step]) {\n"; + } else { + $_statement = $_attr['start']; + if (is_array($_statement['var'])) { + $var = $_statement['var']['var']; + $index = $_statement['var']['smarty_internal_index']; + } else { + $var = $_statement['var']; + $index = ''; + } + $output .= "\$_smarty_tpl->tpl_vars[$var] = new Smarty_Variable;"; + if (isset($_attr['step'])) { + $output .= "\$_smarty_tpl->tpl_vars[$var]->step = $_attr[step];"; + } else { + $output .= "\$_smarty_tpl->tpl_vars[$var]->step = 1;"; + } + if (isset($_attr['max'])) { + $output .= "\$_smarty_tpl->tpl_vars[$var]->total = (int) min(ceil((\$_smarty_tpl->tpl_vars[$var]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\$_smarty_tpl->tpl_vars[$var]->step)),$_attr[max]);\n"; + } else { + $output .= "\$_smarty_tpl->tpl_vars[$var]->total = (int) ceil((\$_smarty_tpl->tpl_vars[$var]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\$_smarty_tpl->tpl_vars[$var]->step));\n"; + } + $output .= "if (\$_smarty_tpl->tpl_vars[$var]->total > 0) {\n"; + $output .= "for (\$_smarty_tpl->tpl_vars[$var]->value{$index} = $_statement[value], \$_smarty_tpl->tpl_vars[$var]->iteration = 1;\$_smarty_tpl->tpl_vars[$var]->iteration <= \$_smarty_tpl->tpl_vars[$var]->total;\$_smarty_tpl->tpl_vars[$var]->value{$index} += \$_smarty_tpl->tpl_vars[$var]->step, \$_smarty_tpl->tpl_vars[$var]->iteration++) {\n"; + $output .= "\$_smarty_tpl->tpl_vars[$var]->first = \$_smarty_tpl->tpl_vars[$var]->iteration == 1;"; + $output .= "\$_smarty_tpl->tpl_vars[$var]->last = \$_smarty_tpl->tpl_vars[$var]->iteration == \$_smarty_tpl->tpl_vars[$var]->total;"; + } + $output .= "?>"; + + $this->openTag($compiler, 'for', array('for', $compiler->nocache)); + // maybe nocache because of nocache variables + $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; + // return compiled code + return $output; + } +} + +/** + * Smarty Internal Plugin Compile Forelse Class + * + * @package Smarty + * @subpackage Compiler + */ +class Smarty_Internal_Compile_Forelse extends Smarty_Internal_CompileBase +{ + /** + * Compiles code for the {forelse} tag + * + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter + * + * @return string compiled code + */ + public function compile($args, $compiler, $parameter) + { + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + + list($openTag, $nocache) = $this->closeTag($compiler, array('for')); + $this->openTag($compiler, 'forelse', array('forelse', $nocache)); + + return ""; + } +} + +/** + * Smarty Internal Plugin Compile Forclose Class + * + * @package Smarty + * @subpackage Compiler + */ +class Smarty_Internal_Compile_Forclose extends Smarty_Internal_CompileBase +{ + /** + * Compiles code for the {/for} tag + * + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter + * + * @return string compiled code + */ + public function compile($args, $compiler, $parameter) + { + $compiler->loopNesting--; + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + // must endblock be nocache? + if ($compiler->nocache) { + $compiler->tag_nocache = true; + } + + list($openTag, $compiler->nocache) = $this->closeTag($compiler, array('for', 'forelse')); + + $output = "\n"; + return $output; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_foreach.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_foreach.php new file mode 100755 index 0000000..178a0a5 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_foreach.php @@ -0,0 +1,347 @@ +loopNesting ++; + // init + $this->isNamed = false; + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + $from = $_attr['from']; + $item = $compiler->getId($_attr['item']); + if ($item === false) { + $item = $compiler->getVariableName($_attr['item']); + } + $attributes = array('item' => $item); + if (isset($_attr['key'])) { + $key = $compiler->getId($_attr['key']); + if ($key === false) { + $key = $compiler->getVariableName($_attr['key']); + } + $attributes['key'] = $key; + } + if (isset($_attr['name'])) { + $this->isNamed = true; + $attributes['name'] = $compiler->getId($_attr['name']); + } + foreach ($attributes as $a => $v) { + if ($v === false) { + $compiler->trigger_template_error("'{$a}' attribute/variable has illegal value", null, true); + } + } + $fromName = $compiler->getVariableName($_attr['from']); + if ($fromName) { + foreach (array('item', 'key') as $a) { + if (isset($attributes[$a]) && $attributes[$a] == $fromName) { + $compiler->trigger_template_error("'{$a}' and 'from' may not have same variable name '{$fromName}'", + null, true); + } + } + } + + $itemVar = "\$_smarty_tpl->tpl_vars['{$item}']"; + $local = '$__foreach_' . (isset($attributes['name']) ? $attributes['name'] : $attributes['item']) . '_' . + $this->counter ++ . '_'; + $needIteration = false; + // search for used tag attributes + $itemAttr = array(); + $namedAttr = array(); + $this->scanForProperties($attributes, $compiler); + if (!empty($this->matchResults['item'])) { + $itemAttr = $this->matchResults['item']; + } + if (!empty($this->matchResults['named'])) { + $namedAttr = $this->matchResults['named']; + } + if (isset($itemAttr['last'])) { + $needIteration = true; + } + if (isset($namedAttr['last'])) { + $needIteration = true; + } + + $keyTerm = ''; + if (isset($itemAttr['key'])) { + $keyTerm = "{$itemVar}->key => "; + } elseif (isset($attributes['key'])) { + $keyTerm = "\$_smarty_tpl->tpl_vars['{$key}']->value => "; + } + + $saveVars = array(); + $restoreVars = array(); + if ($this->isNamed) { + $foreachVar = "\$_smarty_tpl->tpl_vars['__smarty_foreach_{$attributes['name']}']"; + if (!empty($namedAttr)) { + $saveVars['saved'] = "isset({$foreachVar}) ? {$foreachVar} : false;"; + $restoreVars[] = "if ({$local}saved) {\n{$foreachVar} = {$local}saved;\n}\n"; + } + } + foreach (array('item', 'key') as $a) { + if (isset($attributes[$a])) { + $saveVars['saved_' . $a] = + "isset(\$_smarty_tpl->tpl_vars['{$attributes[$a]}']) ? \$_smarty_tpl->tpl_vars['{$attributes[$a]}'] : false;"; + $restoreVars[] = + "if ({$local}saved_{$a}) {\n\$_smarty_tpl->tpl_vars['{$attributes[$a]}'] = {$local}saved_{$a};\n}\n"; + } + } + $this->openTag($compiler, 'foreach', + array('foreach', $compiler->nocache, $local, $restoreVars, $itemVar, true)); + // maybe nocache because of nocache variables + $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; + + // generate output code + $output = " $code) { + $output .= "{$local}{$k} = {$code}\n"; + } + if (isset($itemAttr['show']) || isset($itemAttr['total']) || isset($namedAttr['total']) || isset($namedAttr['show']) || isset($itemAttr['last']) || isset($namedAttr['last'])) { + $output .= "{$local}total = \$_smarty_tpl->smarty->ext->_foreach->count(\$_from);\n"; + } + $output .= "{$itemVar} = new Smarty_Variable();\n"; + if (isset($itemAttr['show'])) { + $output .= "{$itemVar}->show = ({$local}total > 0);\n"; + } + if (isset($itemAttr['total'])) { + $output .= "{$itemVar}->total= {$local}total;\n"; + } + if ($this->isNamed) { + $prop = array(); + if (isset($namedAttr['total'])) { + $prop['total'] = "'total' => {$local}total"; + } + if (isset($namedAttr['iteration'])) { + $prop['iteration'] = "'iteration' => 0"; + } + if (isset($namedAttr['index'])) { + $prop['index'] = "'index' => -1"; + } + if (isset($namedAttr['show'])) { + $prop['show'] = "'show' => ({$local}total > 0)"; + } + if (!empty($namedAttr)) { + $_vars = 'array(' . join(', ', $prop) . ')'; + $output .= "{$foreachVar} = new Smarty_Variable({$_vars});\n"; + } + } + if (isset($attributes['key'])) { + $output .= "\$_smarty_tpl->tpl_vars['{$key}'] = new Smarty_Variable();\n"; + } + if (isset($namedAttr['first']) || isset($itemAttr['first'])) { + $output .= "{$local}first = true;\n"; + } + if (isset($itemAttr['iteration'])) { + $output .= "{$itemVar}->iteration=0;\n"; + } + if (isset($itemAttr['index'])) { + $output .= "{$itemVar}->index=-1;\n"; + } + if ($needIteration) { + $output .= "{$local}iteration=0;\n"; + } + $output .= "{$itemVar}->_loop = false;\n"; + $output .= "foreach (\$_from as {$keyTerm}{$itemVar}->value) {\n"; + $output .= "{$itemVar}->_loop = true;\n"; + if (isset($attributes['key']) && isset($itemAttr['key'])) { + $output .= "\$_smarty_tpl->tpl_vars['{$key}']->value = {$itemVar}->key;\n"; + } + if (isset($itemAttr['iteration'])) { + $output .= "{$itemVar}->iteration++;\n"; + } + if (isset($itemAttr['index'])) { + $output .= "{$itemVar}->index++;\n"; + } + if ($needIteration) { + $output .= "{$local}iteration++;\n"; + } + if (isset($itemAttr['first'])) { + $output .= "{$itemVar}->first = {$local}first;\n"; + } + if (isset($itemAttr['last'])) { + $output .= "{$itemVar}->last = {$local}iteration == {$local}total;\n"; + } + if ($this->isNamed) { + if (isset($namedAttr['iteration'])) { + $output .= "{$foreachVar}->value['iteration']++;\n"; + } + if (isset($namedAttr['index'])) { + $output .= "{$foreachVar}->value['index']++;\n"; + } + if (isset($namedAttr['first'])) { + $output .= "{$foreachVar}->value['first'] = {$local}first;\n"; + } + if (isset($namedAttr['last'])) { + $output .= "{$foreachVar}->value['last'] = {$local}iteration == {$local}total;\n"; + } + } + if (isset($namedAttr['first']) || isset($itemAttr['first'])) { + $output .= "{$local}first = false;\n"; + } + $output .= "{$local}saved_local_item = {$itemVar};\n"; + $output .= "?>"; + + return $output; + } +} + +/** + * Smarty Internal Plugin Compile Foreachelse Class + * + * @package Smarty + * @subpackage Compiler + */ +class Smarty_Internal_Compile_Foreachelse extends Smarty_Internal_CompileBase +{ + /** + * Compiles code for the {foreachelse} tag + * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter + * + * @return string compiled code + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + { + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + + list($openTag, $nocache, $local, $restoreVars, $itemVar, $foo) = $this->closeTag($compiler, array('foreach')); + $this->openTag($compiler, 'foreachelse', array('foreachelse', $nocache, $local, $restoreVars, $itemVar, false)); + $output = "_loop) {\n?>"; + return $output; + } +} + +/** + * Smarty Internal Plugin Compile Foreachclose Class + * + * @package Smarty + * @subpackage Compiler + */ +class Smarty_Internal_Compile_Foreachclose extends Smarty_Internal_CompileBase +{ + /** + * Compiles code for the {/foreach} tag + * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter + * + * @return string compiled code + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + { + $compiler->loopNesting --; + // must endblock be nocache? + if ($compiler->nocache) { + $compiler->tag_nocache = true; + } + + list($openTag, $compiler->nocache, $local, $restoreVars, $itemVar, $restore) = + $this->closeTag($compiler, array('foreach', 'foreachelse')); + $output = ""; + + return $output; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_function.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_function.php new file mode 100755 index 0000000..28f3359 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_function.php @@ -0,0 +1,210 @@ +loopNesting++; + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + + if ($_attr['nocache'] === true) { + $compiler->trigger_template_error('nocache option not allowed', null, true); + } + unset($_attr['nocache']); + $_name = trim($_attr['name'], "'\""); + $compiler->parent_compiler->tpl_function[$_name] = $compiler->parent_compiler->template->tpl_function[$_name] = array(); + $save = array($_attr, $compiler->parser->current_buffer, $compiler->template->compiled->has_nocache_code, + $compiler->template->caching); + $this->openTag($compiler, 'function', $save); + // Init temporary context + $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); + $compiler->template->compiled->has_nocache_code = false; + return true; + } +} + +/** + * Smarty Internal Plugin Compile Functionclose Class + * + * @package Smarty + * @subpackage Compiler + */ +class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase +{ + + /** + * Compiler object + * + * @var object + */ + private $compiler = null; + + /** + * Compiles code for the {/function} tag + * + * @param array $args array with attributes from parser + * @param object|\Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter + * + * @return bool true + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + { + $compiler->loopNesting--; + $this->compiler = $compiler; + $saved_data = $this->closeTag($compiler, array('function')); + $_attr = $saved_data[0]; + $_name = trim($_attr['name'], "'\""); + $compiler->parent_compiler->tpl_function[$_name]['called_functions'] = $compiler->parent_compiler->template->tpl_function[$_name]['called_functions'] = $compiler->called_functions; + $compiler->parent_compiler->tpl_function[$_name]['compiled_filepath'] = $compiler->parent_compiler->template->tpl_function[$_name]['compiled_filepath'] = $compiler->parent_compiler->template->compiled->filepath; + $compiler->parent_compiler->tpl_function[$_name]['uid'] = $compiler->parent_compiler->template->tpl_function[$_name]['uid'] = $compiler->template->source->uid; + $compiler->called_functions = array(); + $_parameter = $_attr; + unset($_parameter['name']); + // default parameter + $_paramsArray = array(); + foreach ($_parameter as $_key => $_value) { + if (is_int($_key)) { + $_paramsArray[] = "$_key=>$_value"; + } else { + $_paramsArray[] = "'$_key'=>$_value"; + } + } + if (!empty($_paramsArray)) { + $_params = 'array(' . implode(",", $_paramsArray) . ')'; + $_paramsCode = "\$params = array_merge($_params, \$params);\n"; + } else { + $_paramsCode = ''; + } + $_functionCode = $compiler->parser->current_buffer; + // setup buffer for template function code + $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); + + $_funcName = "smarty_template_function_{$_name}_{$compiler->template->compiled->nocache_hash}"; + $_funcNameCaching = $_funcName . '_nocache'; + if ($compiler->template->compiled->has_nocache_code) { + $compiler->parent_compiler->tpl_function[$_name]['call_name_caching'] = $compiler->parent_compiler->template->tpl_function[$_name]['call_name_caching'] = $_funcNameCaching; + $output = "compiled->has_nocache_code = true;\n"; + $output .= $_paramsCode; + $output .= "\$_smarty_tpl->_cache['saved_tpl_vars'][] = \$_smarty_tpl->tpl_vars;\n"; + $output .= "foreach (\$params as \$key => \$value) {\n\$_smarty_tpl->tpl_vars[\$key] = new Smarty_Variable(\$value);\n}"; + $output .= "\$params = var_export(\$params, true);\n"; + $output .= "echo \"/*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/tpl_vars;\nforeach (\$params as \\\$key => \\\$value) {\n\\\$_smarty_tpl->tpl_vars[\\\$key] = new Smarty_Variable(\\\$value);\n}\n?>"; + $output .= "/*/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\n\";?>"; + $compiler->parser->current_buffer->append_subtree($compiler->parser, new Smarty_Internal_ParseTree_Tag($compiler->parser, $output)); + $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode); + $output = "template->compiled->nocache_hash}%%*/ \\\$value){\n"; + $output .= "if (!isset(\\\$_smarty_tpl->tpl_vars[\\\$key]) || \\\$_smarty_tpl->tpl_vars[\\\$key] === \\\$value) \\\$saved_tpl_vars[\\\$key] = \\\$value;\n}\n"; + $output .= "\\\$_smarty_tpl->tpl_vars = \\\$saved_tpl_vars;?>\n"; + $output .= "/*/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\";\n?>"; + $output .= "template->compiled->nocache_hash}', \$_smarty_tpl->compiled->nocache_hash, ob_get_clean());\n"; + $output .= "\$_smarty_tpl->tpl_vars = array_pop(\$_smarty_tpl->_cache['saved_tpl_vars']);\n}\n}\n"; + $output .= "/*/ {$_funcName}_nocache */\n\n"; + $output .= "?>\n"; + $compiler->parser->current_buffer->append_subtree($compiler->parser, new Smarty_Internal_ParseTree_Tag($compiler->parser, $output)); + $_functionCode = new Smarty_Internal_ParseTree_Tag($compiler->parser, preg_replace_callback("/((<\?php )?echo '\/\*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%\*\/([\S\s]*?)\/\*\/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%\*\/';(\?>\n)?)/", array($this, + 'removeNocache'), $_functionCode->to_smarty_php($compiler->parser))); + } + $compiler->parent_compiler->tpl_function[$_name]['call_name'] = $compiler->parent_compiler->template->tpl_function[$_name]['call_name'] = $_funcName; + $output = "tpl_vars;\n"; + $output .= $_paramsCode; + $output .= "foreach (\$params as \$key => \$value) {\n\$_smarty_tpl->tpl_vars[\$key] = new Smarty_Variable(\$value);\n}?>"; + $compiler->parser->current_buffer->append_subtree($compiler->parser, new Smarty_Internal_ParseTree_Tag($compiler->parser, $output)); + $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode); + $output = " \$value){\n"; + $output .= "if (!isset(\$_smarty_tpl->tpl_vars[\$key]) || \$_smarty_tpl->tpl_vars[\$key] === \$value) \$saved_tpl_vars[\$key] = \$value;\n}\n"; + $output .= "\$_smarty_tpl->tpl_vars = \$saved_tpl_vars;\n}\n}\n"; + $output .= "/*/ {$_funcName} */\n\n"; + $output .= "?>\n"; + $compiler->parser->current_buffer->append_subtree($compiler->parser, new Smarty_Internal_ParseTree_Tag($compiler->parser, $output)); + $compiler->parent_compiler->blockOrFunctionCode .= $compiler->parser->current_buffer->to_smarty_php($compiler->parser); + // nocache plugins must be copied + if (!empty($compiler->template->compiled->required_plugins['nocache'])) { + foreach ($compiler->template->compiled->required_plugins['nocache'] as $plugin => $tmp) { + foreach ($tmp as $type => $data) { + $compiler->parent_compiler->template->compiled->required_plugins['compiled'][$plugin][$type] = $data; + } + } + } + // restore old buffer + + $compiler->parser->current_buffer = $saved_data[1]; + // restore old status + $compiler->template->compiled->has_nocache_code = $saved_data[2]; + $compiler->template->caching = $saved_data[3]; + return true; + } + + /** + * @param $match + * + * @return mixed + */ + function removeNocache($match) + { + $code = preg_replace("/((<\?php )?echo '\/\*%%SmartyNocache:{$this->compiler->template->compiled->nocache_hash}%%\*\/)|(\/\*\/%%SmartyNocache:{$this->compiler->template->compiled->nocache_hash}%%\*\/';(\?>\n)?)/", '', $match[0]); + $code = str_replace(array('\\\'', '\\\\\''), array('\'', '\\\''), $code); + return $code; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_if.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_if.php new file mode 100755 index 0000000..541e218 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_if.php @@ -0,0 +1,252 @@ +getAttributes($compiler, $args); + $this->openTag($compiler, 'if', array(1, $compiler->nocache)); + // must whole block be nocache ? + $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; + + if (!array_key_exists("if condition", $parameter)) { + $compiler->trigger_template_error("missing if condition", null, true); + } + + if (is_array($parameter['if condition'])) { + if ($compiler->nocache) { + $_nocache = ',true'; + // create nocache var to make it know for further compiling + if (is_array($parameter['if condition']['var'])) { + $var = trim($parameter['if condition']['var']['var'], "'"); + } else { + $var = trim($parameter['if condition']['var'], "'"); + } + if (isset($compiler->template->tpl_vars[$var])) { + $compiler->template->tpl_vars[$var]->nocache = true; + } else { + $compiler->template->tpl_vars[$var] = new Smarty_Variable(null, true); + } + } else { + $_nocache = ''; + } + if (is_array($parameter['if condition']['var'])) { + $_output = "tpl_vars[" . $parameter['if condition']['var']['var'] . + "]) || !is_array(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . + "]->value)) \$_smarty_tpl->smarty->ext->_var->createLocalArrayVariable(\$_smarty_tpl, " . $parameter['if condition']['var']['var'] . + "$_nocache);\n"; + $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . + $parameter['if condition']['var']['smarty_internal_index'] . " = " . + $parameter['if condition']['value'] . ") {?>"; + } else { + $_output = "tpl_vars[" . $parameter['if condition']['var'] . + "])) \$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . + "] = new Smarty_Variable(null{$_nocache});"; + $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . + $parameter['if condition']['value'] . ") {?>"; + } + + return $_output; + } else { + return ""; + } + } +} + +/** + * Smarty Internal Plugin Compile Else Class + * + * @package Smarty + * @subpackage Compiler + */ +class Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase +{ + /** + * Compiles code for the {else} tag + * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter + * + * @return string compiled code + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + { + list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif')); + $this->openTag($compiler, 'else', array($nesting, $compiler->tag_nocache)); + + return ""; + } +} + +/** + * Smarty Internal Plugin Compile ElseIf Class + * + * @package Smarty + * @subpackage Compiler + */ +class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase +{ + /** + * Compiles code for the {elseif} tag + * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter + * + * @return string compiled code + * @throws \SmartyCompilerException + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + { + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + + list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif')); + + if (!array_key_exists("if condition", $parameter)) { + $compiler->trigger_template_error("missing elseif condition", null, true); + } + + if (is_array($parameter['if condition'])) { + $condition_by_assign = true; + if ($compiler->nocache) { + $_nocache = ',true'; + // create nocache var to make it know for further compiling + if (is_array($parameter['if condition']['var'])) { + $var = trim($parameter['if condition']['var']['var'], "'"); + } else { + $var = trim($parameter['if condition']['var'], "'"); + } + if (isset($compiler->template->tpl_vars[$var])) { + $compiler->template->tpl_vars[$var]->nocache = true; + } else { + $compiler->template->tpl_vars[$var] = new Smarty_Variable(null, true); + } + } else { + $_nocache = ''; + } + } else { + $condition_by_assign = false; + } + + if (empty($compiler->prefix_code)) { + if ($condition_by_assign) { + $this->openTag($compiler, 'elseif', array($nesting + 1, $compiler->tag_nocache)); + if (is_array($parameter['if condition']['var'])) { + $_output = "tpl_vars[" . + $parameter['if condition']['var']['var'] . "]) || !is_array(\$_smarty_tpl->tpl_vars[" . + $parameter['if condition']['var']['var'] . + "]->value)) \$_smarty_tpl->smarty->ext->_var->createLocalArrayVariable(\$_smarty_tpl, " . + $parameter['if condition']['var']['var'] . "$_nocache);\n"; + $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . + $parameter['if condition']['var']['smarty_internal_index'] . " = " . + $parameter['if condition']['value'] . ") {?>"; + } else { + $_output = "tpl_vars[" . + $parameter['if condition']['var'] . "])) \$_smarty_tpl->tpl_vars[" . + $parameter['if condition']['var'] . "] = new Smarty_Variable(null{$_nocache});"; + $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . + $parameter['if condition']['value'] . ") {?>"; + } + + return $_output; + } else { + $this->openTag($compiler, 'elseif', array($nesting, $compiler->tag_nocache)); + + return ""; + } + } else { + $tmp = ''; + foreach ($compiler->prefix_code as $code) { + $tmp = $compiler->appendCode($tmp, $code); + } + $compiler->prefix_code = array(); + $tmp = $compiler->appendCode("", $tmp); + $this->openTag($compiler, 'elseif', array($nesting + 1, $compiler->tag_nocache)); + if ($condition_by_assign) { + if (is_array($parameter['if condition']['var'])) { + $_output = $compiler->appendCode($tmp, "tpl_vars[" . + $parameter['if condition']['var']['var'] . + "]) || !is_array(\$_smarty_tpl->tpl_vars[" . + $parameter['if condition']['var']['var'] . + "]->value)) \$_smarty_tpl->smarty->ext->_var->createLocalArrayVariable(\$_smarty_tpl, " . + $parameter['if condition']['var']['var'] . "$_nocache);\n"); + $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . + $parameter['if condition']['var']['smarty_internal_index'] . " = " . + $parameter['if condition']['value'] . ") {?>"; + } else { + $_output = $compiler->appendCode($tmp, "tpl_vars[" . + $parameter['if condition']['var'] . + "])) \$_smarty_tpl->tpl_vars[" . + $parameter['if condition']['var'] . + "] = new Smarty_Variable(null{$_nocache});"); + $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . + $parameter['if condition']['value'] . ") {?>"; + } + + return $_output; + } else { + return $compiler->appendCode($tmp, ""); + } + } + } +} + +/** + * Smarty Internal Plugin Compile Ifclose Class + * + * @package Smarty + * @subpackage Compiler + */ +class Smarty_Internal_Compile_Ifclose extends Smarty_Internal_CompileBase +{ + /** + * Compiles code for the {/if} tag + * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter + * + * @return string compiled code + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + { + // must endblock be nocache? + if ($compiler->nocache) { + $compiler->tag_nocache = true; + } + list($nesting, $compiler->nocache) = $this->closeTag($compiler, array('if', 'else', 'elseif')); + $tmp = ''; + for ($i = 0; $i < $nesting; $i ++) { + $tmp .= '}'; + } + + return ""; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_include.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_include.php new file mode 100755 index 0000000..09fa11d --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_include.php @@ -0,0 +1,366 @@ + true, 'parent' => true, 'root' => true, 'global' => true, + 'smarty' => true, 'tpl_root' => true); + + /** + * Compiles code for the {include} tag + * + * @param array $args array with attributes from parser + * @param Smarty_Internal_SmartyTemplateCompiler $compiler compiler object + * @param array $parameter array with compilation parameter + * + * @throws SmartyCompilerException + * @return string compiled code + */ + public function compile($args, Smarty_Internal_SmartyTemplateCompiler $compiler, $parameter) + { + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + + $hashResourceName = $fullResourceName = $source_resource = $_attr['file']; + $variable_template = false; + $cache_tpl = false; + // parse resource_name + if (preg_match('/^([\'"])(([A-Za-z0-9_\-]{2,})[:])?(([^$()]+)|(.+))\1$/', $source_resource, $match)) { + $type = !empty($match[3]) ? $match[3] : $compiler->template->smarty->default_resource_type; + $name = !empty($match[5]) ? $match[5] : $match[6]; + $handler = Smarty_Resource::load($compiler->smarty, $type); + if ($handler->recompiled || $handler->uncompiled) { + $variable_template = true; + } + if (!$variable_template) { + if ($type != 'string') { + $fullResourceName = "{$type}:{$name}"; + $compiled = $compiler->parent_compiler->template->compiled; + if (isset($compiled->includes[$fullResourceName])) { + $compiled->includes[$fullResourceName] ++; + $cache_tpl = true; + } else { + $compiled->includes[$fullResourceName] = 1; + } + $fullResourceName = '"' . $fullResourceName . '"'; + } + } + if (empty($match[5])) { + $variable_template = true; + } + } else { + $variable_template = true; + } + + if (isset($_attr['assign'])) { + // output will be stored in a smarty variable instead of being displayed + $_assign = $_attr['assign']; + } + + // scope setup + $_scope = Smarty::SCOPE_LOCAL; + if (isset($_attr['scope'])) { + $_attr['scope'] = trim($_attr['scope'], "'\""); + if (!isset($this->valid_scopes[$_attr['scope']])) { + $compiler->trigger_template_error("illegal value '{$_attr['scope']}' for \"scope\" attribute", null, true); + } + if ($_attr['scope'] != 'local') { + if ($_attr['scope'] == 'parent') { + $_scope = Smarty::SCOPE_PARENT; + } elseif ($_attr['scope'] == 'root') { + $_scope = Smarty::SCOPE_ROOT; + } elseif ($_attr['scope'] == 'global') { + $_scope = Smarty::SCOPE_GLOBAL; + } elseif ($_attr['scope'] == 'smarty') { + $_scope = Smarty::SCOPE_SMARTY; + } elseif ($_attr['scope'] == 'tpl_root') { + $_scope = Smarty::SCOPE_TPL_ROOT; + } + if ($_attr['bubble_up'] === true) { + $_scope = $_scope + Smarty::SCOPE_BUBBLE_UP; + } + } + } + + // set flag to cache subtemplate object when called within loop or template name is variable. + if ($cache_tpl || $variable_template || $compiler->loopNesting > 0) { + $_cache_tpl = 'true'; + } else { + $_cache_tpl = 'false'; + } + // assume caching is off + $_caching = Smarty::CACHING_OFF; + + if ($_attr['nocache'] === true) { + $compiler->tag_nocache = true; + } + + $call_nocache = $compiler->tag_nocache || $compiler->nocache; + + // caching was on and {include} is not in nocache mode + if ($compiler->template->caching && !$compiler->nocache && !$compiler->tag_nocache) { + $_caching = self::CACHING_NOCACHE_CODE; + } + + // flag if included template code should be merged into caller + $merge_compiled_includes = ($compiler->smarty->merge_compiled_includes || $_attr['inline'] === true) && + !$compiler->template->source->handler->recompiled; + + if ($merge_compiled_includes && $_attr['inline'] !== true) { + // variable template name ? + if ($variable_template) { + $merge_compiled_includes = false; + if ($compiler->template->caching) { + // must use individual cache file + //$_attr['caching'] = 1; + } + } + // variable compile_id? + if (isset($_attr['compile_id'])) { + if (!((substr_count($_attr['compile_id'], '"') == 2 || substr_count($_attr['compile_id'], "'") == 2 || + is_numeric($_attr['compile_id']))) || substr_count($_attr['compile_id'], '(') != 0 || + substr_count($_attr['compile_id'], '$_smarty_tpl->') != 0 + ) { + $merge_compiled_includes = false; + if ($compiler->template->caching) { + // must use individual cache file + //$_attr['caching'] = 1; + } + } + } + } + + /* + * if the {include} tag provides individual parameter for caching or compile_id + * the subtemplate must not be included into the common cache file and is treated like + * a call in nocache mode. + * + */ + if ($_attr['nocache'] !== true && $_attr['caching']) { + $_caching = $_new_caching = (int) $_attr['caching']; + $call_nocache = true; + } else { + $_new_caching = Smarty::CACHING_LIFETIME_CURRENT; + } + if (isset($_attr['cache_lifetime'])) { + $_cache_lifetime = $_attr['cache_lifetime']; + $call_nocache = true; + $_caching = $_new_caching; + } else { + $_cache_lifetime = '$_smarty_tpl->cache_lifetime'; + } + if (isset($_attr['cache_id'])) { + $_cache_id = $_attr['cache_id']; + $call_nocache = true; + $_caching = $_new_caching; + } else { + $_cache_id = '$_smarty_tpl->cache_id'; + } + if (isset($_attr['compile_id'])) { + $_compile_id = $_attr['compile_id']; + } else { + $_compile_id = '$_smarty_tpl->compile_id'; + } + + // if subtemplate will be called in nocache mode do not merge + if ($compiler->template->caching && $call_nocache) { + $merge_compiled_includes = false; + } + + $has_compiled_template = false; + if ($merge_compiled_includes) { + $c_id = isset($_attr['compile_id']) ? $_attr['compile_id'] : $compiler->template->compile_id; + // we must observe different compile_id and caching + $t_hash = sha1($c_id . ($_caching ? '--caching' : '--nocaching')); + if (!isset($compiler->parent_compiler->mergedSubTemplatesData[$hashResourceName][$t_hash])) { + $has_compiled_template = + $this->compileInlineTemplate($compiler, $fullResourceName, $_caching, $hashResourceName, $t_hash, + $c_id); + } else { + $has_compiled_template = true; + } + } + // delete {include} standard attributes + unset($_attr['file'], $_attr['assign'], $_attr['cache_id'], $_attr['compile_id'], $_attr['cache_lifetime'], $_attr['nocache'], $_attr['caching'], $_attr['scope'], $_attr['inline'], $_attr['bubble_up']); + // remaining attributes must be assigned as smarty variable + $_vars_nc = ''; + if (!empty($_attr)) { + if ($_scope == Smarty::SCOPE_LOCAL) { + $_pairs = array(); + // create variables + foreach ($_attr as $key => $value) { + $_pairs[] = "'$key'=>$value"; + $_vars_nc .= "\$_smarty_tpl->tpl_vars['$key'] = new Smarty_Variable($value);\n"; + } + $_vars = 'array(' . join(',', $_pairs) . ')'; + } else { + $compiler->trigger_template_error('variable passing not allowed in parent/global scope', null, true); + } + } else { + $_vars = 'array()'; + } + $update_compile_id = $compiler->template->caching && !$compiler->tag_nocache && !$compiler->nocache && + $_compile_id != '$_smarty_tpl->compile_id'; + if ($has_compiled_template && !$call_nocache) { + $_output = "makeNocacheCode("\$_compile_id_save[] = \$_smarty_tpl->compile_id;\n\$_smarty_tpl->compile_id = {$_compile_id};\n"); + } + if (!empty($_vars_nc) && $_caching == 9999 && $compiler->template->caching) { + //$compiler->suppressNocacheProcessing = false; + $_output .= substr($compiler->processNocacheCode('\n", true), 6, - 3); + //$compiler->suppressNocacheProcessing = true; + } + if (isset($_assign)) { + $_output .= "ob_start();\n"; + } + $_output .= "\$_smarty_tpl->smarty->ext->_subtemplate->render(\$_smarty_tpl, {$fullResourceName}, {$_cache_id}, {$_compile_id}, {$_caching}, {$_cache_lifetime}, {$_vars}, {$_scope}, {$_cache_tpl}, '{$compiler->parent_compiler->mergedSubTemplatesData[$hashResourceName][$t_hash]['uid']}', '{$compiler->parent_compiler->mergedSubTemplatesData[$hashResourceName][$t_hash]['func']}');\n"; + if (isset($_assign)) { + $_output .= "\$_smarty_tpl->assign({$_assign}, ob_get_clean());\n"; + } + if ($update_compile_id) { + $_output .= $compiler->makeNocacheCode("\$_smarty_tpl->compile_id = array_pop(\$_compile_id_save);\n"); + } + $_output .= "?>\n"; + + return $_output; + } + + if ($call_nocache) { + $compiler->tag_nocache = true; + } + $_output = "compile_id;\n\$_smarty_tpl->compile_id = {$_compile_id};\n"; + } + // was there an assign attribute + if (isset($_assign)) { + $_output .= "ob_start();\n"; + } + $_output .= "\$_smarty_tpl->smarty->ext->_subtemplate->render(\$_smarty_tpl, {$fullResourceName}, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_scope, {$_cache_tpl});\n"; + if (isset($_assign)) { + $_output .= "\$_smarty_tpl->assign({$_assign}, ob_get_clean());\n"; + } + if ($update_compile_id) { + $_output .= "\$_smarty_tpl->compile_id = array_pop(\$_compile_id_save);\n"; + } + $_output .= "?>\n"; + return $_output; + } + + /** + * Compile inline sub template + * + * @param \Smarty_Internal_SmartyTemplateCompiler $compiler + * @param $fullResourceName + * @param $_caching + * @param $hashResourceName + * @param $t_hash + * @param $c_id + * + * @return bool + */ + public function compileInlineTemplate(Smarty_Internal_SmartyTemplateCompiler $compiler, $fullResourceName, + $_caching, $hashResourceName, $t_hash, $c_id) + { + $compiler->smarty->allow_ambiguous_resources = true; + /* @var Smarty_Internal_Template $tpl */ + $tpl = + new $compiler->smarty->template_class (trim($fullResourceName, '"\''), $compiler->smarty, $compiler->template, + $compiler->template->cache_id, $c_id, $_caching); + if (!($tpl->source->handler->uncompiled) && $tpl->source->exists) { + $compiler->parent_compiler->mergedSubTemplatesData[$hashResourceName][$t_hash]['uid'] = $tpl->source->uid; + if (isset($compiler->template->_inheritance)) { + $tpl->_inheritance = clone $compiler->template->_inheritance; + } + $tpl->compiled = new Smarty_Template_Compiled(); + $tpl->compiled->nocache_hash = $compiler->parent_compiler->template->compiled->nocache_hash; + $tpl->loadCompiler(); + // save unique function name + $compiler->parent_compiler->mergedSubTemplatesData[$hashResourceName][$t_hash]['func'] = + $tpl->compiled->unifunc = 'content_' . str_replace(array('.', ','), '_', uniqid('', true)); + // make sure whole chain gets compiled + $tpl->mustCompile = true; + $compiler->parent_compiler->mergedSubTemplatesData[$hashResourceName][$t_hash]['nocache_hash'] = + $tpl->compiled->nocache_hash; + // get compiled code + $compiled_code = "source->type}:{$tpl->source->name}\" =============================*/\n"; + $compiled_code .= "function {$tpl->compiled->unifunc} (\$_smarty_tpl) {\n"; + $compiled_code .= "?>\n" . $tpl->compiler->compileTemplateSource($tpl, null, $compiler->parent_compiler); + $compiled_code .= "\n"; + $compiled_code .= $tpl->compiler->postFilter($tpl->compiler->blockOrFunctionCode); + $compiled_code .= "source->type}:{$tpl->source->name}\" =============================*/\n"; + $compiled_code .= "?>"; + unset($tpl->compiler); + if ($tpl->compiled->has_nocache_code) { + // replace nocache_hash + $compiled_code = + str_replace("{$tpl->compiled->nocache_hash}", $compiler->template->compiled->nocache_hash, + $compiled_code); + $compiler->template->compiled->has_nocache_code = true; + } + $compiler->parent_compiler->mergedSubTemplatesCode[$tpl->compiled->unifunc] = $compiled_code; + return true; + } else { + return false; + } + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_include_php.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_include_php.php new file mode 100755 index 0000000..e7e6299 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_include_php.php @@ -0,0 +1,111 @@ +smarty instanceof SmartyBC)) { + throw new SmartyException("{include_php} is deprecated, use SmartyBC class to enable"); + } + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + + /** @var Smarty_Internal_Template $_smarty_tpl + * used in evaluated code + */ + $_smarty_tpl = $compiler->template; + $_filepath = false; + $_file = null; + eval('$_file = @' . $_attr['file'] . ';'); + if (!isset($compiler->smarty->security_policy) && file_exists($_file)) { + $_filepath = $compiler->smarty->_realpath($_file, true); + } else { + if (isset($compiler->smarty->security_policy)) { + $_dir = $compiler->smarty->security_policy->trusted_dir; + } else { + $_dir = $compiler->smarty->trusted_dir; + } + if (!empty($_dir)) { + foreach ((array) $_dir as $_script_dir) { + $_path = $compiler->smarty->_realpath($_script_dir . DS . $_file, true); + if (file_exists($_path)) { + $_filepath = $_path; + break; + } + } + } + } + if ($_filepath == false) { + $compiler->trigger_template_error("{include_php} file '{$_file}' is not readable", null, true); + } + + if (isset($compiler->smarty->security_policy)) { + $compiler->smarty->security_policy->isTrustedPHPDir($_filepath); + } + + if (isset($_attr['assign'])) { + // output will be stored in a smarty variable instead of being displayed + $_assign = $_attr['assign']; + } + $_once = '_once'; + if (isset($_attr['once'])) { + if ($_attr['once'] == 'false') { + $_once = ''; + } + } + + if (isset($_assign)) { + return "assign({$_assign},ob_get_clean());\n?>"; + } else { + return "\n"; + } + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_insert.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_insert.php new file mode 100755 index 0000000..2ebde16 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_insert.php @@ -0,0 +1,151 @@ +getAttributes($compiler, $args); + $nocacheParam = $compiler->template->caching && ($compiler->tag_nocache || $compiler->nocache); + if (!$nocacheParam) { + // do not compile as nocache code + $compiler->suppressNocacheProcessing = true; + } + $compiler->tag_nocache = true; + $_smarty_tpl = $compiler->template; + $_name = null; + $_script = null; + + $_output = 'template->tpl_vars[$var])) { + $compiler->template->tpl_vars[$var]->nocache = true; + } else { + $compiler->template->tpl_vars[$var] = new Smarty_Variable(null, true); + } + } + if (isset($_attr['script'])) { + // script which must be included + $_function = "smarty_insert_{$_name}"; + $_smarty_tpl = $compiler->template; + $_filepath = false; + eval('$_script = @' . $_attr['script'] . ';'); + if (!isset($compiler->smarty->security_policy) && file_exists($_script)) { + $_filepath = $_script; + } else { + if (isset($compiler->smarty->security_policy)) { + $_dir = $compiler->smarty->security_policy->trusted_dir; + } else { + $_dir = $compiler->smarty->trusted_dir; + } + if (!empty($_dir)) { + foreach ((array) $_dir as $_script_dir) { + $_script_dir = rtrim($_script_dir, '/\\') . DS; + if (file_exists($_script_dir . $_script)) { + $_filepath = $_script_dir . $_script; + break; + } + } + } + } + if ($_filepath == false) { + $compiler->trigger_template_error("{insert} missing script file '{$_script}'", null, true); + } + // code for script file loading + $_output .= "require_once '{$_filepath}' ;"; + require_once $_filepath; + if (!is_callable($_function)) { + $compiler->trigger_template_error(" {insert} function '{$_function}' is not callable in script file '{$_script}'", null, true); + } + } else { + $_filepath = 'null'; + $_function = "insert_{$_name}"; + // function in PHP script ? + if (!is_callable($_function)) { + // try plugin + if (!$_function = $compiler->getPlugin($_name, 'insert')) { + $compiler->trigger_template_error("{insert} no function or plugin found for '{$_name}'", null, true); + } + } + } + // delete {insert} standard attributes + unset($_attr['name'], $_attr['assign'], $_attr['script'], $_attr['nocache']); + // convert attributes into parameter array string + $_paramsArray = array(); + foreach ($_attr as $_key => $_value) { + $_paramsArray[] = "'$_key' => $_value"; + } + $_params = 'array(' . implode(", ", $_paramsArray) . ')'; + // call insert + if (isset($_assign)) { + if ($_smarty_tpl->caching && !$nocacheParam) { + $_output .= "echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \$_smarty_tpl, '{$_filepath}',{$_assign});?>"; + } else { + $_output .= "\$_smarty_tpl->assign({$_assign} , {$_function} ({$_params},\$_smarty_tpl), true);?>"; + } + } else { + $compiler->has_output = true; + if ($_smarty_tpl->caching && !$nocacheParam) { + $_output .= "echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \$_smarty_tpl, '{$_filepath}');?>"; + } else { + $_output .= "echo {$_function}({$_params},\$_smarty_tpl);?>"; + } + } + + return $_output; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_ldelim.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_ldelim.php new file mode 100755 index 0000000..8c6b701 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_ldelim.php @@ -0,0 +1,40 @@ +getAttributes($compiler, $args); + if ($_attr['nocache'] === true) { + $compiler->trigger_template_error('nocache option not allowed', null, true); + } + // this tag does not return compiled code + $compiler->has_code = true; + + return $compiler->smarty->left_delimiter; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_nocache.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_nocache.php new file mode 100755 index 0000000..b29a993 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_nocache.php @@ -0,0 +1,75 @@ +getAttributes($compiler, $args); + $this->openTag($compiler, 'nocache', array($compiler->nocache)); + // enter nocache mode + $compiler->nocache = true; + // this tag does not return compiled code + $compiler->has_code = false; + + return true; + } +} + +/** + * Smarty Internal Plugin Compile Nocacheclose Class + * + * @package Smarty + * @subpackage Compiler + */ +class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase +{ + /** + * Compiles code for the {/nocache} tag + * This tag does not generate compiled output. It only sets a compiler flag. + * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * + * @return bool + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) + { + $_attr = $this->getAttributes($compiler, $args); + // leave nocache mode + list($compiler->nocache) = $this->closeTag($compiler, array('nocache')); + // this tag does not return compiled code + $compiler->has_code = false; + + return true; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_block_plugin.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_block_plugin.php new file mode 100755 index 0000000..9e2eea2 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_block_plugin.php @@ -0,0 +1,89 @@ +getAttributes($compiler, $args); + if ($_attr['nocache'] === true) { + $compiler->tag_nocache = true; + } + unset($_attr['nocache']); + // convert attributes into parameter array string + $_paramsArray = array(); + foreach ($_attr as $_key => $_value) { + if (is_int($_key)) { + $_paramsArray[] = "$_key=>$_value"; + } else { + $_paramsArray[] = "'$_key'=>$_value"; + } + } + $_params = 'array(' . implode(",", $_paramsArray) . ')'; + + $this->openTag($compiler, $tag, array($_params, $compiler->nocache)); + // maybe nocache because of nocache variables or nocache plugin + $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; + // compile code + $output = "smarty->_cache['tag_stack'][] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; + } else { + // must endblock be nocache? + if ($compiler->nocache) { + $compiler->tag_nocache = true; + } + // closing tag of block plugin, restore nocache + list($_params, $compiler->nocache) = $this->closeTag($compiler, substr($tag, 0, - 5)); + // This tag does create output + $compiler->has_output = true; + // compile code + if (!isset($parameter['modifier_list'])) { + $mod_pre = $mod_post = ''; + } else { + $mod_pre = ' ob_start(); '; + $mod_post = 'echo ' . + $compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter['modifier_list'], + 'value' => 'ob_get_clean()')) . ';'; + } + $output = "smarty->_cache['tag_stack']);?>"; + } + + return $output . "\n"; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_foreachsection.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_foreachsection.php new file mode 100755 index 0000000..16f2333 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_foreachsection.php @@ -0,0 +1,220 @@ +propertyPreg = '~('; + $this->startOffset = 0; + $this->resultOffsets = array(); + $this->matchResults = array('named' => array(), 'item' => array()); + if ($this->isNamed) { + $this->buildPropertyPreg(true, $attributes); + } + if (isset($this->itemProperties)) { + if ($this->isNamed) { + $this->propertyPreg .= '|'; + } + $this->buildPropertyPreg(false, $attributes); + } + $this->propertyPreg .= ')\W~i'; + // Template source + $this->matchTemplateSource($compiler); + // Parent template source + $this->matchParentTemplateSource($compiler); + // {block} source + $this->matchBlockSource($compiler); + } + + /** + * Build property preg string + * + * @param bool $named + * @param array $attributes + */ + public function buildPropertyPreg($named, $attributes) + { + if ($named) { + $this->resultOffsets['named'] = $this->startOffset + 3; + $this->propertyPreg .= "([\$]smarty[.]{$this->tagName}[.]{$attributes['name']}[.]("; + $properties = $this->nameProperties; + } else { + $this->resultOffsets['item'] = $this->startOffset + 3; + $this->propertyPreg .= "([\$]{$attributes['item']}[@]("; + $properties = $this->itemProperties; + } + $this->startOffset += count($properties) + 2; + $propName = reset($properties); + while ($propName) { + $this->propertyPreg .= "({$propName})"; + $propName = next($properties); + if ($propName) { + $this->propertyPreg .= '|'; + } + } + $this->propertyPreg .= '))'; + } + + /** + * Find matches in source string + * + * @param string $source + */ + public function matchProperty($source) + { + preg_match_all($this->propertyPreg, $source, $match, PREG_SET_ORDER); + foreach ($this->resultOffsets as $key => $offset) { + foreach ($match as $m) { + if (isset($m[$offset]) && !empty($m[$offset])) { + $this->matchResults[$key][strtolower($m[$offset])] = true; + } + } + } + } + + /** + * Find matches in template source + * + * @param \Smarty_Internal_TemplateCompilerBase $compiler + */ + public function matchTemplateSource(Smarty_Internal_TemplateCompilerBase $compiler) + { + $this->matchProperty($compiler->parser->lex->data); + } + + /** + * Find matches in all parent template source + * + * @param \Smarty_Internal_TemplateCompilerBase $compiler + */ + public function matchParentTemplateSource(Smarty_Internal_TemplateCompilerBase $compiler) + { + // search parent compiler template source + $nextCompiler = $compiler; + while ($nextCompiler !== $nextCompiler->parent_compiler) { + $nextCompiler = $nextCompiler->parent_compiler; + if ($compiler !== $nextCompiler) { + // get template source + $_content = $nextCompiler->template->source->getContent(); + if ($_content != '') { + // run pre filter if required + if ((isset($nextCompiler->smarty->autoload_filters['pre']) || + isset($nextCompiler->smarty->registered_filters['pre']))) { + $_content = $nextCompiler->smarty->ext->_filter_Handler->runFilter('pre', $_content, $nextCompiler->template); + } + $this->matchProperty($_content); + } + } + } + } + + /** + * Find matches in {block} tag source + * + * @param \Smarty_Internal_TemplateCompilerBase $compiler + */ + public function matchBlockSource(Smarty_Internal_TemplateCompilerBase $compiler) + { + + } + + /** + * Compiles code for the {$smarty.foreach.xxx} or {$smarty.section.xxx}tag + * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter + * + * @return string compiled code + * @throws \SmartyCompilerException + */ + public function compileSpecialVariable($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + { + $tag = strtolower(trim($parameter[ 0 ], '"\'')); + $name = isset($parameter[ 1 ]) ? $compiler->getId($parameter[ 1 ]) : false; + if (!$name) { + $compiler->trigger_template_error("missing or illegal \$smarty.{$tag} name attribute", null, true); + } + $property = isset($parameter[ 2 ]) ? strtolower($compiler->getId($parameter[ 2 ])) : false; + if (!$property || !in_array($property, $this->nameProperties)) { + $compiler->trigger_template_error("missing or illegal \$smarty.{$tag} property attribute", null, true); + } + $tagVar = "'__smarty_{$tag}_{$name}'"; + return "(isset(\$_smarty_tpl->tpl_vars[{$tagVar}]->value['{$property}']) ? \$_smarty_tpl->tpl_vars[{$tagVar}]->value['{$property}'] : null)"; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_function_plugin.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_function_plugin.php new file mode 100755 index 0000000..0d0ab81 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_function_plugin.php @@ -0,0 +1,72 @@ +has_output = true; + + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + if ($_attr['nocache'] === true) { + $compiler->tag_nocache = true; + } + unset($_attr['nocache']); + // convert attributes into parameter array string + $_paramsArray = array(); + foreach ($_attr as $_key => $_value) { + if (is_int($_key)) { + $_paramsArray[] = "$_key=>$_value"; + } else { + $_paramsArray[] = "'$_key'=>$_value"; + } + } + $_params = 'array(' . implode(",", $_paramsArray) . ')'; + // compile code + $output = "\n"; + + return $output; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_modifier.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_modifier.php new file mode 100755 index 0000000..9594d2a --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_modifier.php @@ -0,0 +1,155 @@ +getAttributes($compiler, $args); + $output = $parameter['value']; + // loop over list of modifiers + foreach ($parameter['modifierlist'] as $single_modifier) { + $modifier = $single_modifier[0]; + $single_modifier[0] = $output; + $params = implode(',', $single_modifier); + // check if we know already the type of modifier + if (isset($compiler->known_modifier_type[$modifier])) { + $modifier_types = array($compiler->known_modifier_type[$modifier]); + } else { + $modifier_types = array(1, 2, 3, 4, 5, 6); + } + foreach ($modifier_types as $type) { + switch ($type) { + case 1: + // registered modifier + if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][$modifier])) { + $function = $compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][$modifier][0]; + if (!is_array($function)) { + $output = "{$function}({$params})"; + } else { + if (is_object($function[0])) { + $output = '$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][\'' . + $modifier . '\'][0][0]->' . $function[1] . '(' . $params . ')'; + } else { + $output = $function[0] . '::' . $function[1] . '(' . $params . ')'; + } + } + $compiler->known_modifier_type[$modifier] = $type; + break 2; + } + break; + case 2: + // registered modifier compiler + if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIERCOMPILER][$modifier][0])) { + $output = call_user_func($compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIERCOMPILER][$modifier][0], $single_modifier, $compiler->smarty); + $compiler->known_modifier_type[$modifier] = $type; + break 2; + } + break; + case 3: + // modifiercompiler plugin + if ($compiler->smarty->loadPlugin('smarty_modifiercompiler_' . $modifier)) { + // check if modifier allowed + if (!is_object($compiler->smarty->security_policy) || + $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler) + ) { + $plugin = 'smarty_modifiercompiler_' . $modifier; + $output = $plugin($single_modifier, $compiler); + } + $compiler->known_modifier_type[$modifier] = $type; + break 2; + } + break; + case 4: + // modifier plugin + if ($function = $compiler->getPlugin($modifier, Smarty::PLUGIN_MODIFIER)) { + // check if modifier allowed + if (!is_object($compiler->smarty->security_policy) || + $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler) + ) { + $output = "{$function}({$params})"; + } + $compiler->known_modifier_type[$modifier] = $type; + break 2; + } + break; + case 5: + // PHP function + if (is_callable($modifier)) { + // check if modifier allowed + if (!is_object($compiler->smarty->security_policy) || + $compiler->smarty->security_policy->isTrustedPhpModifier($modifier, $compiler) + ) { + $output = "{$modifier}({$params})"; + } + $compiler->known_modifier_type[$modifier] = $type; + break 2; + } + break; + case 6: + // default plugin handler + if (isset($compiler->default_handler_plugins[Smarty::PLUGIN_MODIFIER][$modifier]) || + (is_callable($compiler->smarty->default_plugin_handler_func) && + $compiler->getPluginFromDefaultHandler($modifier, Smarty::PLUGIN_MODIFIER)) + ) { + $function = $compiler->default_handler_plugins[Smarty::PLUGIN_MODIFIER][$modifier][0]; + // check if modifier allowed + if (!is_object($compiler->smarty->security_policy) || + $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler) + ) { + if (!is_array($function)) { + $output = "{$function}({$params})"; + } else { + if (is_object($function[0])) { + $output = '$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][\'' . + $modifier . '\'][0][0]->' . $function[1] . '(' . $params . ')'; + } else { + $output = $function[0] . '::' . $function[1] . '(' . $params . ')'; + } + } + } + if (isset($compiler->parent_compiler->template->compiled->required_plugins['nocache'][$modifier][Smarty::PLUGIN_MODIFIER]['file']) || + isset($compiler->parent_compiler->template->compiled->required_plugins['compiled'][$modifier][Smarty::PLUGIN_MODIFIER]['file']) + ) { + // was a plugin + $compiler->known_modifier_type[$modifier] = 4; + } else { + $compiler->known_modifier_type[$modifier] = $type; + } + break 2; + } + } + } + if (!isset($compiler->known_modifier_type[$modifier])) { + $compiler->trigger_template_error("unknown modifier \"" . $modifier . "\"", null, true); + } + } + + return $output; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_object_block_function.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_object_block_function.php new file mode 100755 index 0000000..d2bc5d6 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_object_block_function.php @@ -0,0 +1,91 @@ +getAttributes($compiler, $args); + if ($_attr['nocache'] === true) { + $compiler->tag_nocache = true; + } + unset($_attr['nocache']); + // convert attributes into parameter array string + $_paramsArray = array(); + foreach ($_attr as $_key => $_value) { + if (is_int($_key)) { + $_paramsArray[] = "$_key=>$_value"; + } else { + $_paramsArray[] = "'$_key'=>$_value"; + } + } + $_params = 'array(' . implode(",", $_paramsArray) . ')'; + + $this->openTag($compiler, $tag . '->' . $method, array($_params, $compiler->nocache)); + // maybe nocache because of nocache variables or nocache plugin + $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; + // compile code + $output = + "smarty->_cache['tag_stack'][] = array('{$tag}->{$method}', {$_params}); \$_block_repeat=true; echo \$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; + } else { + $base_tag = substr($tag, 0, - 5); + // must endblock be nocache? + if ($compiler->nocache) { + $compiler->tag_nocache = true; + } + // closing tag of block plugin, restore nocache + list($_params, $compiler->nocache) = $this->closeTag($compiler, $base_tag . '->' . $method); + // This tag does create output + $compiler->has_output = true; + // compile code + if (!isset($parameter['modifier_list'])) { + $mod_pre = $mod_post = ''; + } else { + $mod_pre = ' ob_start(); '; + $mod_post = 'echo ' . $compiler->compileTag('private_modifier', array(), + array('modifierlist' => $parameter['modifier_list'], + 'value' => 'ob_get_clean()')) . ';'; + } + $output = "smarty->registered_objects['{$base_tag}'][0]->{$method}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); " . + $mod_post . " } array_pop(\$_smarty_tpl->smarty->_cache['tag_stack']);?>"; + } + + return $output . "\n"; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_object_function.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_object_function.php new file mode 100755 index 0000000..e306e0f --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_object_function.php @@ -0,0 +1,84 @@ +getAttributes($compiler, $args); + if ($_attr['nocache'] === true) { + $compiler->tag_nocache = true; + } + unset($_attr['nocache']); + $_assign = null; + if (isset($_attr['assign'])) { + $_assign = $_attr['assign']; + unset($_attr['assign']); + } + // method or property ? + if (method_exists($compiler->smarty->registered_objects[$tag][0], $method)) { + // convert attributes into parameter array string + if ($compiler->smarty->registered_objects[$tag][2]) { + $_paramsArray = array(); + foreach ($_attr as $_key => $_value) { + if (is_int($_key)) { + $_paramsArray[] = "$_key=>$_value"; + } else { + $_paramsArray[] = "'$_key'=>$_value"; + } + } + $_params = 'array(' . implode(",", $_paramsArray) . ')'; + $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params},\$_smarty_tpl)"; + } else { + $_params = implode(",", $_attr); + $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params})"; + } + } else { + // object property + $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}"; + } + + if (empty($_assign)) { + // This tag does create output + $compiler->has_output = true; + $output = "\n"; + } else { + $output = "assign({$_assign},{$return});?>\n"; + } + + return $output; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_php.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_php.php new file mode 100755 index 0000000..3ca63a5 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_php.php @@ -0,0 +1,209 @@ +getAttributes($compiler, $args); + $compiler->has_code = false; + if ($_attr['type'] == 'xml') { + $compiler->tag_nocache = true; + $save = $compiler->template->compiled->has_nocache_code; + $output = addcslashes($_attr['code'], "'\\"); + $compiler->parser->current_buffer->append_subtree($compiler->parser, new Smarty_Internal_ParseTree_Tag($compiler->parser, $compiler->processNocacheCode("", $compiler, true))); + $compiler->template->compiled->has_nocache_code = $save; + return ''; + } + if ($_attr['type'] != 'tag') { + if ($compiler->php_handling == Smarty::PHP_REMOVE) { + return ''; + } elseif ($compiler->php_handling == Smarty::PHP_QUOTE) { + $output = preg_replace_callback('#(<\?(?:php|=)?)|(<%)|()|(\?>)|(%>)|(<\/script>)#i', array($this, + 'quote'), $_attr['code']); + $compiler->parser->current_buffer->append_subtree($compiler->parser, new Smarty_Internal_ParseTree_Text($output)); + return ''; + } elseif ($compiler->php_handling == Smarty::PHP_PASSTHRU || $_attr['type'] == 'unmatched') { + $compiler->tag_nocache = true; + $save = $compiler->template->compiled->has_nocache_code; + $output = addcslashes($_attr['code'], "'\\"); + $compiler->parser->current_buffer->append_subtree($compiler->parser, new Smarty_Internal_ParseTree_Tag($compiler->parser, $compiler->processNocacheCode("", $compiler, true))); + $compiler->template->compiled->has_nocache_code = $save; + return ''; + } elseif ($compiler->php_handling == Smarty::PHP_ALLOW) { + if (!($compiler->smarty instanceof SmartyBC)) { + $compiler->trigger_template_error('$smarty->php_handling PHP_ALLOW not allowed. Use SmartyBC to enable it', null, true); + } + $compiler->has_code = true; + return $_attr['code']; + } else { + $compiler->trigger_template_error('Illegal $smarty->php_handling value', null, true); + } + } else { + $compiler->has_code = true; + if (!($compiler->smarty instanceof SmartyBC)) { + $compiler->trigger_template_error('{php}{/php} tags not allowed. Use SmartyBC to enable them', null, true); + } + $ldel = preg_quote($compiler->smarty->left_delimiter, '#'); + $rdel = preg_quote($compiler->smarty->right_delimiter, '#'); + preg_match("#^({$ldel}php\\s*)((.)*?)({$rdel})#", $_attr['code'], $match); + if (!empty($match[2])) { + if ('nocache' == trim($match[2])) { + $compiler->tag_nocache = true; + } else { + $compiler->trigger_template_error("illegal value of option flag \"{$match[2]}\"", null, true); + } + } + return preg_replace(array("#^{$ldel}\\s*php\\s*(.)*?{$rdel}#", + "#{$ldel}\\s*/\\s*php\\s*{$rdel}$#"), array(''), $_attr['code']); + } + } + + /** + * Lexer code for PHP tags + * + * This code has been moved from lexer here fo easier debugging and maintenance + * + * @param $lex + */ + public function parsePhp($lex) + { + $lex->token = Smarty_Internal_Templateparser::TP_PHP; + $close = 0; + $lex->taglineno = $lex->line; + $closeTag = '?>'; + if (strpos($lex->value, 'is_xml = true; + $lex->token = Smarty_Internal_Templateparser::TP_NOCACHE; + return; + } elseif (strpos($lex->value, 'phpType = 'php'; + } elseif (strpos($lex->value, '<%') === 0) { + $lex->phpType = 'asp'; + $closeTag = '%>'; + } elseif (strpos($lex->value, '%>') === 0) { + $lex->phpType = 'unmatched'; + } elseif (strpos($lex->value, '?>') === 0) { + if ($lex->is_xml) { + $lex->is_xml = false; + $lex->token = Smarty_Internal_Templateparser::TP_NOCACHE; + return; + } + $lex->phpType = 'unmatched'; + } elseif (strpos($lex->value, 'phpType = 'script'; + $closeTag = ''; + } elseif (strpos($lex->value, $lex->smarty->left_delimiter) === 0) { + if ($lex->isAutoLiteral()) { + $lex->token = Smarty_Internal_Templateparser::TP_TEXT; + return; + } + $closeTag = "{$lex->smarty->left_delimiter}/php{$lex->smarty->right_delimiter}"; + if ($lex->value == $closeTag) { + $lex->compiler->trigger_template_error("unexpected closing tag '{$closeTag}'"); + } + $lex->phpType = 'tag'; + } + if ($lex->phpType == 'unmatched') { + return; + } + if (($lex->phpType == 'php' || $lex->phpType == 'asp') && + ($lex->compiler->php_handling == Smarty::PHP_PASSTHRU || $lex->compiler->php_handling == Smarty::PHP_QUOTE) + ) { + return; + } + $start = $lex->counter + strlen($lex->value); + $body = true; + if (preg_match('~' . preg_quote($closeTag, '~') . '~i', $lex->data, $match, PREG_OFFSET_CAPTURE, $start)) { + $close = $match[0][1]; + } else { + $lex->compiler->trigger_template_error("missing closing tag '{$closeTag}'"); + } + while ($body) { + if (preg_match('~([/][*])|([/][/][^\n]*)|(\'[^\'\\\\]*(?:\\.[^\'\\\\]*)*\')|("[^"\\\\]*(?:\\.[^"\\\\]*)*")~', $lex->data, $match, PREG_OFFSET_CAPTURE, $start)) { + $value = $match[0][0]; + $from = $pos = $match[0][1]; + if ($pos > $close) { + $body = false; + } else { + $start = $pos + strlen($value); + $phpCommentStart = $value == '/*'; + if ($phpCommentStart) { + $phpCommentEnd = preg_match('~([*][/])~', $lex->data, $match, PREG_OFFSET_CAPTURE, $start); + if ($phpCommentEnd) { + $pos2 = $match[0][1]; + $start = $pos2 + strlen($match[0][0]); + } + } + while ($close > $pos && $close < $start) { + if (preg_match('~' . preg_quote($closeTag, '~') . + '~i', $lex->data, $match, PREG_OFFSET_CAPTURE, $from)) { + $close = $match[0][1]; + $from = $close + strlen($match[0][0]); + } else { + $lex->compiler->trigger_template_error("missing closing tag '{$closeTag}'"); + } + } + if ($phpCommentStart && (!$phpCommentEnd || $pos2 > $close)) { + $lex->taglineno = $lex->line + substr_count(substr($lex->data, $lex->counter, $start), "\n"); + $lex->compiler->trigger_template_error("missing PHP comment closing tag '*/'"); + } + } + } else { + $body = false; + } + } + $lex->value = substr($lex->data, $lex->counter, $close + strlen($closeTag) - $lex->counter); + } + + /* + * Call back function for $php_handling = PHP_QUOTE + * + */ + /** + * @param $match + * + * @return string + */ + private function quote($match) + { + return htmlspecialchars($match[0], ENT_QUOTES); + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_print_expression.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_print_expression.php new file mode 100755 index 0000000..c0c089b --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_print_expression.php @@ -0,0 +1,156 @@ +getAttributes($compiler, $args); + // nocache option + if ($_attr['nocache'] === true) { + $compiler->tag_nocache = true; + } + if (isset($_attr['assign'])) { + // assign output to variable + $output = "assign({$_attr['assign']},{$parameter['value']});?>"; + } else { + // display value + $output = $parameter['value']; + // tag modifier + if (!empty($parameter['modifierlist'])) { + $output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter['modifierlist'], + 'value' => $output)); + } + if (!$_attr['nofilter']) { + // default modifier + if (!empty($compiler->smarty->default_modifiers)) { + if (empty($compiler->default_modifier_list)) { + $modifierlist = array(); + foreach ($compiler->smarty->default_modifiers as $key => $single_default_modifier) { + preg_match_all('/(\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'|"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|:|[^:]+)/', $single_default_modifier, $mod_array); + for ($i = 0, $count = count($mod_array[0]); $i < $count; $i ++) { + if ($mod_array[0][$i] != ':') { + $modifierlist[$key][] = $mod_array[0][$i]; + } + } + } + $compiler->default_modifier_list = $modifierlist; + } + $output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => $compiler->default_modifier_list, + 'value' => $output)); + } + // autoescape html + if ($compiler->template->smarty->escape_html) { + $output = "htmlspecialchars({$output}, ENT_QUOTES, '" . addslashes(Smarty::$_CHARSET) . "')"; + } + // loop over registered filters + if (!empty($compiler->template->smarty->registered_filters[Smarty::FILTER_VARIABLE])) { + foreach ($compiler->template->smarty->registered_filters[Smarty::FILTER_VARIABLE] as $key => + $function) { + if (!is_array($function)) { + $output = "{$function}({$output},\$_smarty_tpl)"; + } elseif (is_object($function[0])) { + $output = "\$_smarty_tpl->smarty->registered_filters[Smarty::FILTER_VARIABLE]['{$key}'][0]->{$function[1]}({$output},\$_smarty_tpl)"; + } else { + $output = "{$function[0]}::{$function[1]}({$output},\$_smarty_tpl)"; + } + } + } + // auto loaded filters + if (isset($compiler->smarty->autoload_filters[Smarty::FILTER_VARIABLE])) { + foreach ((array) $compiler->template->smarty->autoload_filters[Smarty::FILTER_VARIABLE] as $name) { + $result = $this->compile_output_filter($compiler, $name, $output); + if ($result !== false) { + $output = $result; + } else { + // not found, throw exception + throw new SmartyException("Unable to load filter '{$name}'"); + } + } + } + foreach ($compiler->variable_filters as $filter) { + if (count($filter) == 1 && + ($result = $this->compile_output_filter($compiler, $filter[0], $output)) !== false + ) { + $output = $result; + } else { + $output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => array($filter), + 'value' => $output)); + } + } + } + + $compiler->has_output = true; + $output = ""; + } + + return $output; + } + + /** + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param string $name name of variable filter + * @param string $output embedded output + * + * @return string + */ + private function compile_output_filter(Smarty_Internal_TemplateCompilerBase $compiler, $name, $output) + { + $plugin_name = "smarty_variablefilter_{$name}"; + $path = $compiler->smarty->loadPlugin($plugin_name, false); + if ($path) { + if ($compiler->template->caching) { + $compiler->parent_compiler->template->compiled->required_plugins['nocache'][$name][Smarty::FILTER_VARIABLE]['file'] = $path; + $compiler->parent_compiler->template->compiled->required_plugins['nocache'][$name][Smarty::FILTER_VARIABLE]['function'] = $plugin_name; + } else { + $compiler->parent_compiler->template->compiled->required_plugins['compiled'][$name][Smarty::FILTER_VARIABLE]['file'] = $path; + $compiler->parent_compiler->template->compiled->required_plugins['compiled'][$name][Smarty::FILTER_VARIABLE]['function'] = $plugin_name; + } + } else { + // not found + return false; + } + + return "{$plugin_name}({$output},\$_smarty_tpl)"; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_registered_block.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_registered_block.php new file mode 100755 index 0000000..78d95f7 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_registered_block.php @@ -0,0 +1,119 @@ +getAttributes($compiler, $args); + if ($_attr['nocache']) { + $compiler->tag_nocache = true; + } + unset($_attr['nocache']); + if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$tag])) { + $tag_info = $compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$tag]; + } else { + $tag_info = $compiler->default_handler_plugins[Smarty::PLUGIN_BLOCK][$tag]; + } + // convert attributes into parameter array string + $_paramsArray = array(); + foreach ($_attr as $_key => $_value) { + if (is_int($_key)) { + $_paramsArray[] = "$_key=>$_value"; + } elseif ($compiler->template->caching && in_array($_key, $tag_info[2])) { + $_value = str_replace("'", "^#^", $_value); + $_paramsArray[] = "'$_key'=>^#^.var_export($_value,true).^#^"; + } else { + $_paramsArray[] = "'$_key'=>$_value"; + } + } + $_params = 'array(' . implode(",", $_paramsArray) . ')'; + + $this->openTag($compiler, $tag, array($_params, $compiler->nocache)); + // maybe nocache because of nocache variables or nocache plugin + $compiler->nocache = !$tag_info[1] | $compiler->nocache | $compiler->tag_nocache; + $function = $tag_info[0]; + // compile code + if (!is_array($function)) { + $output = "smarty->_cache['tag_stack'][] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; + } elseif (is_object($function[0])) { + $output = "smarty->_cache['tag_stack'][] = array('{$tag}', {$_params}); \$_block_repeat=true; echo \$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0][0]->{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; + } else { + $output = "smarty->_cache['tag_stack'][] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function[0]}::{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; + } + } else { + // must endblock be nocache? + if ($compiler->nocache) { + $compiler->tag_nocache = true; + } + $base_tag = substr($tag, 0, - 5); + // closing tag of block plugin, restore nocache + list($_params, $compiler->nocache) = $this->closeTag($compiler, $base_tag); + // This tag does create output + $compiler->has_output = true; + if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$base_tag])) { + $function = $compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$base_tag][0]; + } else { + $function = $compiler->default_handler_plugins[Smarty::PLUGIN_BLOCK][$base_tag][0]; + } + // compile code + if (!isset($parameter['modifier_list'])) { + $mod_pre = $mod_post = ''; + } else { + $mod_pre = ' ob_start(); '; + $mod_post = 'echo ' . + $compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter['modifier_list'], + 'value' => 'ob_get_clean()')) . ';'; + } + if (!is_array($function)) { + $output = "smarty->_cache['tag_stack']);?>"; + } elseif (is_object($function[0])) { + $output = "smarty->registered_plugins['block']['{$base_tag}'][0][0]->{$function[1]}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); " . + $mod_post . "} array_pop(\$_smarty_tpl->smarty->_cache['tag_stack']);?>"; + } else { + $output = "smarty->_cache['tag_stack']);?>"; + } + } + + return $output . "\n"; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_registered_function.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_registered_function.php new file mode 100755 index 0000000..6bddc75 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_registered_function.php @@ -0,0 +1,79 @@ +has_output = true; + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + if ($_attr['nocache']) { + $compiler->tag_nocache = true; + } + unset($_attr['nocache']); + if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION][$tag])) { + $tag_info = $compiler->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION][$tag]; + } else { + $tag_info = $compiler->default_handler_plugins[Smarty::PLUGIN_FUNCTION][$tag]; + } + // not cachable? + $compiler->tag_nocache = $compiler->tag_nocache || !$tag_info[1]; + // convert attributes into parameter array string + $_paramsArray = array(); + foreach ($_attr as $_key => $_value) { + if (is_int($_key)) { + $_paramsArray[] = "$_key=>$_value"; + } elseif ($compiler->template->caching && in_array($_key, $tag_info[2])) { + $_value = str_replace("'", "^#^", $_value); + $_paramsArray[] = "'$_key'=>^#^.var_export($_value,true).^#^"; + } else { + $_paramsArray[] = "'$_key'=>$_value"; + } + } + $_params = 'array(' . implode(",", $_paramsArray) . ')'; + $function = $tag_info[0]; + // compile code + if (!is_array($function)) { + $output = "\n"; + } elseif (is_object($function[0])) { + $output = "smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['{$tag}'][0][0]->{$function[1]}({$_params},\$_smarty_tpl);?>\n"; + } else { + $output = "\n"; + } + + return $output; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_special_variable.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_special_variable.php new file mode 100755 index 0000000..b83e824 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_private_special_variable.php @@ -0,0 +1,126 @@ +getId($_index[ 0 ])); + if ($variable === false) { + $compiler->trigger_template_error("special \$Smarty variable name index can not be variable", null, true); + } + if (!isset($compiler->smarty->security_policy) || + $compiler->smarty->security_policy->isTrustedSpecialSmartyVar($variable, $compiler) + ) { + switch ($variable) { + case 'foreach': + case 'section': + if (!isset($compiler->_tag_objects[ $variable ])) { + $class = 'Smarty_Internal_Compile_' . ucfirst($variable); + $compiler->_tag_objects[ $variable ] = new $class; + } + return $compiler->_tag_objects[ $variable ]->compileSpecialVariable(array(), $compiler, $_index); + case 'capture': + if (class_exists('Smarty_Internal_Compile_Capture')) { + return Smarty_Internal_Compile_Capture::compileSpecialVariable(array(), $compiler, $_index); + } + return ''; + case 'now': + return 'time()'; + case 'cookies': + if (isset($compiler->smarty->security_policy) && + !$compiler->smarty->security_policy->allow_super_globals + ) { + $compiler->trigger_template_error("(secure mode) super globals not permitted"); + break; + } + $compiled_ref = '$_COOKIE'; + break; + case 'get': + case 'post': + case 'env': + case 'server': + case 'session': + case 'request': + if (isset($compiler->smarty->security_policy) && + !$compiler->smarty->security_policy->allow_super_globals + ) { + $compiler->trigger_template_error("(secure mode) super globals not permitted"); + break; + } + $compiled_ref = '$_' . strtoupper($variable); + break; + + case 'template': + return 'basename($_smarty_tpl->source->filepath)'; + + case 'template_object': + return '$_smarty_tpl'; + + case 'current_dir': + return 'dirname($_smarty_tpl->source->filepath)'; + + case 'version': + return "Smarty::SMARTY_VERSION"; + + case 'const': + if (isset($compiler->smarty->security_policy) && + !$compiler->smarty->security_policy->allow_constants + ) { + $compiler->trigger_template_error("(secure mode) constants not permitted"); + break; + } + if (strpos($_index[ 1 ], '$') === false && strpos($_index[ 1 ], '\'') === false) { + return "@constant('{$_index[1]}')"; + } else { + return "@constant({$_index[1]})"; + } + + case 'config': + if (isset($_index[ 2 ])) { + return "(is_array(\$tmp = \$_smarty_tpl->smarty->ext->configload->_getConfigVariable(\$_smarty_tpl, $_index[1])) ? \$tmp[$_index[2]] : null)"; + } else { + return "\$_smarty_tpl->smarty->ext->configload->_getConfigVariable(\$_smarty_tpl, $_index[1])"; + } + case 'ldelim': + return "\$_smarty_tpl->smarty->left_delimiter"; + case 'rdelim': + return "\$_smarty_tpl->smarty->right_delimiter"; + default: + $compiler->trigger_template_error('$smarty.' . trim($_index[ 0 ], "'") . ' is not defined'); + break; + } + if (isset($_index[ 1 ])) { + array_shift($_index); + foreach ($_index as $_ind) { + $compiled_ref = $compiled_ref . "[$_ind]"; + } + } + return $compiled_ref; + } + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_rdelim.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_rdelim.php new file mode 100755 index 0000000..22b33ea --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_rdelim.php @@ -0,0 +1,39 @@ +getAttributes($compiler, $args); + if ($_attr['nocache'] === true) { + $compiler->trigger_template_error('nocache option not allowed', null, true); + } + // this tag does not return compiled code + $compiler->has_code = true; + + return $compiler->smarty->right_delimiter; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_section.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_section.php new file mode 100755 index 0000000..40b297a --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_section.php @@ -0,0 +1,454 @@ +loopNesting++; + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + $attributes = array('name' => $compiler->getId($_attr['name'])); + unset($_attr['name']); + foreach ($attributes as $a => $v) { + if ($v === false) { + $compiler->trigger_template_error("'{$a}' attribute/variable has illegal value", null, true); + } + } + $local = "\$__section_{$attributes['name']}_" . $this->counter ++ . '_'; + $sectionVar = "\$_smarty_tpl->tpl_vars['__smarty_section_{$attributes['name']}']"; + $this->openTag($compiler, 'section', array('section', $compiler->nocache, $local, $sectionVar)); + // maybe nocache because of nocache variables + $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; + + $initLocal = array('saved' => "isset(\$_smarty_tpl->tpl_vars['__smarty_section_{$attributes['name']}']) ? \$_smarty_tpl->tpl_vars['__smarty_section_{$attributes['name']}'] : false",); + $initNamedProperty = array(); + $initFor = array(); + $incFor = array(); + $cmpFor = array(); + $propValue = array('index' => "{$sectionVar}->value['index']", 'show' => 'true', 'step' => 1, + 'iteration' => "{$local}iteration", + + ); + $propType = array('index' => 2, 'iteration' => 2, 'show' => 0, 'step' => 0,); + // search for used tag attributes + $this->scanForProperties($attributes, $compiler); + if (!empty($this->matchResults['named'])) { + $namedAttr = $this->matchResults['named']; + } + $namedAttr['index'] = true; + $output = " $attr_value) { + switch ($attr_name) { + case 'loop': + if (is_numeric($attr_value)) { + $v = (int) $attr_value; + $t = 0; + } else { + $v = "(is_array(@\$_loop=$attr_value) ? count(\$_loop) : max(0, (int) \$_loop))"; + $t = 1; + } + if (isset($namedAttr['loop'])) { + $initNamedProperty['loop'] = "'loop' => {$v}"; + if ($t == 1) { + $v = "{$sectionVar}->value['loop']"; + } + } elseif ($t == 1) { + $initLocal['loop'] = $v; + $v = "{$local}loop"; + } + break; + case 'show': + if (is_bool($attr_value)) { + $v = $attr_value ? 'true' : 'false'; + $t = 0; + } else { + $v = "(bool) $attr_value"; + $t = 3; + } + break; + case 'step': + if (is_numeric($attr_value)) { + $v = (int) $attr_value; + $v = ($v == 0) ? 1 : $v; + $t = 0; + break; + } + $initLocal['step'] = "((int)@$attr_value) == 0 ? 1 : (int)@$attr_value"; + $v = "{$local}step"; + $t = 2; + break; + + case 'max': + case 'start': + if (is_numeric($attr_value)) { + $v = (int) $attr_value; + $t = 0; + break; + } + $v = "(int)@$attr_value"; + $t = 3; + break; + } + if ($t == 3 && $compiler->getId($attr_value)) { + $t = 1; + } + $propValue[$attr_name] = $v; + $propType[$attr_name] = $t; + } + + if (isset($namedAttr['step'])) { + $initNamedProperty['step'] = $propValue['step']; + } + if (isset($namedAttr['iteration'])) { + $propValue['iteration'] = "{$sectionVar}->value['iteration']"; + } + $incFor['iteration'] = "{$propValue['iteration']}++"; + $initFor['iteration'] = "{$propValue['iteration']} = 1"; + + if ($propType['step'] == 0) { + if ($propValue['step'] == 1) { + $incFor['index'] = "{$sectionVar}->value['index']++"; + } elseif ($propValue['step'] > 1) { + $incFor['index'] = "{$sectionVar}->value['index'] += {$propValue['step']}"; + } else { + $incFor['index'] = "{$sectionVar}->value['index'] -= " . - $propValue['step']; + } + } else { + $incFor['index'] = "{$sectionVar}->value['index'] += {$propValue['step']}"; + } + + if (!isset($propValue['max'])) { + $propValue['max'] = $propValue['loop']; + $propType['max'] = $propType['loop']; + } elseif ($propType['max'] != 0) { + $propValue['max'] = "{$propValue['max']} < 0 ? {$propValue['loop']} : {$propValue['max']}"; + $propType['max'] = 1; + } else { + if ($propValue['max'] < 0) { + $propValue['max'] = $propValue['loop']; + $propType['max'] = $propType['loop']; + } + } + + if (!isset($propValue['start'])) { + $start_code = array(1 => "{$propValue['step']} > 0 ? ", 2 => '0', 3 => ' : ', 4 => $propValue['loop'], + 5 => ' - 1'); + if ($propType['loop'] == 0) { + $start_code[5] = ''; + $start_code[4] = $propValue['loop'] - 1; + } + if ($propType['step'] == 0) { + if ($propValue['step'] > 0) { + $start_code = array(1 => '0'); + $propType['start'] = 0; + } else { + $start_code[1] = $start_code[2] = $start_code[3] = ''; + $propType['start'] = $propType['loop']; + } + } else { + $propType['start'] = 1; + } + $propValue['start'] = join('', $start_code); + } else { + $start_code = array(1 => "{$propValue['start']} < 0 ? ", 2 => 'max(', 3 => "{$propValue['step']} > 0 ? ", + 4 => '0', 5 => ' : ', 6 => '-1', 7 => ', ', + 8 => "{$propValue['start']} + {$propValue['loop']}", 10 => ')', 11 => ' : ', + 12 => 'min(', 13 => $propValue['start'], 14 => ', ', + 15 => "{$propValue['step']} > 0 ? ", 16 => $propValue['loop'], 17 => ' : ', + 18 => $propType['loop'] == 0 ? $propValue['loop'] - 1 : "{$propValue['loop']} - 1", + 19 => ')'); + if ($propType['step'] == 0) { + $start_code[3] = $start_code[5] = $start_code[15] = $start_code[17] = ''; + if ($propValue['step'] > 0) { + $start_code[6] = $start_code[18] = ''; + } else { + $start_code[4] = $start_code[16] = ''; + } + } + if ($propType['start'] == 0) { + if ($propType['loop'] == 0) { + $start_code[8] = $propValue['start'] + $propValue['loop']; + } + $propType['start'] = $propType['step'] + $propType['loop']; + $start_code[1] = ''; + if ($propValue['start'] < 0) { + for ($i = 11; $i <= 19; $i ++) { + $start_code[$i] = ''; + } + if ($propType['start'] == 0) { + $start_code = array(max($propValue['step'] > 0 ? 0 : - 1, $propValue['start'] + + $propValue['loop'])); + } + } else { + for ($i = 1; $i <= 11; $i ++) { + $start_code[$i] = ''; + } + if ($propType['start'] == 0) { + $start_code = array(min($propValue['step'] > 0 ? $propValue['loop'] : $propValue['loop'] - + 1, $propValue['start'])); + } + } + } + $propValue['start'] = join('', $start_code); + } + if ($propType['start'] != 0) { + $initLocal['start'] = $propValue['start']; + $propValue['start'] = "{$local}start"; + } + + $initFor['index'] = "{$sectionVar}->value['index'] = {$propValue['start']}"; + + if (!isset($_attr['start']) && !isset($_attr['step']) && !isset($_attr['max'])) { + $propValue['total'] = $propValue['loop']; + $propType['total'] = $propType['loop']; + } else { + $propType['total'] = $propType['start'] + $propType['loop'] + $propType['step'] + $propType['max']; + if ($propType['total'] == 0) { + $propValue['total'] = min(ceil(($propValue['step'] > 0 ? $propValue['loop'] - + $propValue['start'] : (int) $propValue['start'] + 1) / + abs($propValue['step'])), $propValue['max']); + } else { + $total_code = array(1 => 'min(', 2 => 'ceil(', 3 => '(', 4 => "{$propValue['step']} > 0 ? ", + 5 => $propValue['loop'], 6 => ' - ', 7 => $propValue['start'], 8 => ' : ', + 9 => $propValue['start'], 10 => '+ 1', 11 => ')', 12 => '/ ', 13 => 'abs(', + 14 => $propValue['step'], 15 => ')', 16 => ')', 17 => ", {$propValue['max']})",); + if (!isset($propValue['max'])) { + $total_code[1] = $total_code[17] = ''; + } + if ($propType['loop'] + $propType['start'] == 0) { + $total_code[5] = $propValue['loop'] - $propValue['start']; + $total_code[6] = $total_code[7] = ''; + } + if ($propType['start'] == 0) { + $total_code[9] = (int) $propValue['start'] + 1; + $total_code[10] = ''; + } + if ($propType['step'] == 0) { + $total_code[13] = $total_code[15] = ''; + if ($propValue['step'] == 1 || $propValue['step'] == - 1) { + $total_code[2] = $total_code[12] = $total_code[14] = $total_code[16] = ''; + } elseif ($propValue['step'] < 0) { + $total_code[14] = - $propValue['step']; + } + $total_code[4] = ''; + if ($propValue['step'] > 0) { + $total_code[8] = $total_code[9] = $total_code[10] = ''; + } else { + $total_code[5] = $total_code[6] = $total_code[7] = $total_code[8] = ''; + } + } + $propValue['total'] = join('', $total_code); + } + } + + if (isset($namedAttr['total'])) { + $initNamedProperty['total'] = "'total' => {$propValue['total']}"; + if ($propType['total'] > 0) { + $propValue['total'] = "{$sectionVar}->value['total']"; + } + } elseif ($propType['total'] > 0) { + $initLocal['total'] = $propValue['total']; + $propValue['total'] = "{$local}total"; + } + + $cmpFor['iteration'] = "{$propValue['iteration']} <= {$propValue['total']}"; + + foreach ($initLocal as $key => $code) { + $output .= "{$local}{$key} = {$code};\n"; + } + + $_vars = 'array(' . join(', ', $initNamedProperty) . ')'; + $output .= "{$sectionVar} = new Smarty_Variable({$_vars});\n"; + $cond_code = "{$propValue['total']} != 0"; + if ($propType['total'] == 0) { + if ($propValue['total'] == 0) { + $cond_code = 'false'; + } else { + $cond_code = 'true'; + } + } + if ($propType['show'] > 0) { + $output .= "{$local}show = {$propValue['show']} ? {$cond_code} : false;\n"; + $output .= "if ({$local}show) {\n"; + } elseif ($propValue['show'] == 'true') { + $output .= "if ({$cond_code}) {\n"; + } else { + $output .= "if (false) {\n"; + } + $jinit = join(', ', $initFor); + $jcmp = join(', ', $cmpFor); + $jinc = join(', ', $incFor); + $output .= "for ({$jinit}; {$jcmp}; {$jinc}){\n"; + if (isset($namedAttr['rownum'])) { + $output .= "{$sectionVar}->value['rownum'] = {$propValue['iteration']};\n"; + } + if (isset($namedAttr['index_prev'])) { + $output .= "{$sectionVar}->value['index_prev'] = {$propValue['index']} - {$propValue['step']};\n"; + } + if (isset($namedAttr['index_next'])) { + $output .= "{$sectionVar}->value['index_next'] = {$propValue['index']} + {$propValue['step']};\n"; + } + if (isset($namedAttr['first'])) { + $output .= "{$sectionVar}->value['first'] = ({$propValue['iteration']} == 1);\n"; + } + if (isset($namedAttr['last'])) { + $output .= "{$sectionVar}->value['last'] = ({$propValue['iteration']} == {$propValue['total']});\n"; + } + $output .= "?>"; + + return $output; + } +} + +/** + * Smarty Internal Plugin Compile Sectionelse Class + * + * @package Smarty + * @subpackage Compiler + */ +class Smarty_Internal_Compile_Sectionelse extends Smarty_Internal_CompileBase +{ + /** + * Compiles code for the {sectionelse} tag + * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * + * @return string compiled code + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) + { + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + + list($openTag, $nocache, $local, $sectionVar) = $this->closeTag($compiler, array('section')); + $this->openTag($compiler, 'sectionelse', array('sectionelse', $nocache, $local, $sectionVar)); + + return ""; + } +} + +/** + * Smarty Internal Plugin Compile Sectionclose Class + * + * @package Smarty + * @subpackage Compiler + */ +class Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase +{ + /** + * Compiles code for the {/section} tag + * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * + * @return string compiled code + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) + { + $compiler->loopNesting--; + // must endblock be nocache? + if ($compiler->nocache) { + $compiler->tag_nocache = true; + } + + list($openTag, $compiler->nocache, $local, $sectionVar) = $this->closeTag($compiler, array('section', + 'sectionelse')); + + $output = ""; + + return $output; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_setfilter.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_setfilter.php new file mode 100755 index 0000000..b4932c1 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_setfilter.php @@ -0,0 +1,70 @@ +variable_filter_stack[] = $compiler->variable_filters; + $compiler->variable_filters = $parameter['modifier_list']; + // this tag does not return compiled code + $compiler->has_code = false; + + return true; + } +} + +/** + * Smarty Internal Plugin Compile Setfilterclose Class + * + * @package Smarty + * @subpackage Compiler + */ +class Smarty_Internal_Compile_Setfilterclose extends Smarty_Internal_CompileBase +{ + /** + * Compiles code for the {/setfilter} tag + * This tag does not generate compiled output. It resets variable filter. + * + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * + * @return string compiled code + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) + { + $_attr = $this->getAttributes($compiler, $args); + // reset variable filter to previous state + if (count($compiler->variable_filter_stack)) { + $compiler->variable_filters = array_pop($compiler->variable_filter_stack); + } else { + $compiler->variable_filters = array(); + } + // this tag does not return compiled code + $compiler->has_code = false; + + return true; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_shared_inheritance.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_shared_inheritance.php new file mode 100755 index 0000000..c7bf1f8 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_shared_inheritance.php @@ -0,0 +1,46 @@ +_cache['inheritanceInit'])) { + $compiler->registerPostCompileCallback(array('Smarty_Internal_Compile_Shared_Inheritance', 'postCompile'), + array($initChildSequence), 'inheritanceInit', $initChildSequence); + + $compiler->_cache['inheritanceInit'] = true; + } + } + + /** + * Compile inheritance initialization code as prefix + * + * @param \Smarty_Internal_TemplateCompilerBase $compiler + * @param bool|false $initChildSequence if true force child template + */ + static function postCompile(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false) + { + $compiler->prefixCompiledCode .= "ext->_inheritance->init(\$_smarty_tpl, " . + var_export($initChildSequence, true) . ");\n?>\n"; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compile_while.php b/inc/libs/Smarty/sysplugins/smarty_internal_compile_while.php new file mode 100755 index 0000000..bd31f66 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compile_while.php @@ -0,0 +1,108 @@ +loopNesting++; + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + $this->openTag($compiler, 'while', $compiler->nocache); + + if (!array_key_exists("if condition", $parameter)) { + $compiler->trigger_template_error("missing while condition", null, true); + } + + // maybe nocache because of nocache variables + $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; + $_output = "nocache) { + $_nocache = ',true'; + // create nocache var to make it know for further compiling + if (is_array($parameter['if condition']['var'])) { + $var = trim($parameter['if condition']['var']['var'], "'"); + } else { + $var = trim($parameter['if condition']['var'], "'"); + } + if (isset($compiler->template->tpl_vars[$var])) { + $compiler->template->tpl_vars[$var]->nocache = true; + } else { + $compiler->template->tpl_vars[$var] = new Smarty_Variable(null, true); + } + } else { + $_nocache = ''; + } + if (is_array($parameter['if condition']['var'])) { + $_output .= "if (!isset(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . + "]) || !is_array(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . + "]->value)) \$_smarty_tpl->smarty->ext->_var->createLocalArrayVariable(\$_smarty_tpl, " . $parameter['if condition']['var']['var'] . + "$_nocache);\n"; + $_output .= "while (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . + $parameter['if condition']['var']['smarty_internal_index'] . " = " . + $parameter['if condition']['value'] . ") {?>"; + } else { + $_output .= "if (!isset(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . + "])) \$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . + "] = new Smarty_Variable(null{$_nocache});"; + $_output .= "while (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . + $parameter['if condition']['value'] . ") {?>"; + } + } else { + $_output .= "while ({$parameter['if condition']}) {?>"; + } + return $_output; + } +} + +/** + * Smarty Internal Plugin Compile Whileclose Class + * + * @package Smarty + * @subpackage Compiler + */ +class Smarty_Internal_Compile_Whileclose extends Smarty_Internal_CompileBase +{ + /** + * Compiles code for the {/while} tag + * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * + * @return string compiled code + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) + { + $compiler->loopNesting--; + // must endblock be nocache? + if ($compiler->nocache) { + $compiler->tag_nocache = true; + } + $compiler->nocache = $this->closeTag($compiler, array('while')); + return "\n"; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_compilebase.php b/inc/libs/Smarty/sysplugins/smarty_internal_compilebase.php new file mode 100755 index 0000000..0803f27 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_compilebase.php @@ -0,0 +1,178 @@ + $mixed) { + // shorthand ? + if (!is_array($mixed)) { + // option flag ? + if (in_array(trim($mixed, '\'"'), $this->option_flags)) { + $_indexed_attr[trim($mixed, '\'"')] = true; + // shorthand attribute ? + } elseif (isset($this->shorttag_order[$key])) { + $_indexed_attr[$this->shorttag_order[$key]] = $mixed; + } else { + // too many shorthands + $compiler->trigger_template_error('too many shorthand attributes', null, true); + } + // named attribute + } else { + $kv = each($mixed); + // option flag? + if (in_array($kv['key'], $this->option_flags)) { + if (is_bool($kv['value'])) { + $_indexed_attr[$kv['key']] = $kv['value']; + } elseif (is_string($kv['value']) && in_array(trim($kv['value'], '\'"'), array('true', 'false'))) { + if (trim($kv['value']) == 'true') { + $_indexed_attr[$kv['key']] = true; + } else { + $_indexed_attr[$kv['key']] = false; + } + } elseif (is_numeric($kv['value']) && in_array($kv['value'], array(0, 1))) { + if ($kv['value'] == 1) { + $_indexed_attr[$kv['key']] = true; + } else { + $_indexed_attr[$kv['key']] = false; + } + } else { + $compiler->trigger_template_error("illegal value of option flag \"{$kv['key']}\"", null, true); + } + // must be named attribute + } else { + reset($mixed); + $_indexed_attr[key($mixed)] = $mixed[key($mixed)]; + } + } + } + // check if all required attributes present + foreach ($this->required_attributes as $attr) { + if (!array_key_exists($attr, $_indexed_attr)) { + $compiler->trigger_template_error("missing \"" . $attr . "\" attribute", null, true); + } + } + // check for not allowed attributes + if ($this->optional_attributes != array('_any')) { + $tmp_array = array_merge($this->required_attributes, $this->optional_attributes, $this->option_flags); + foreach ($_indexed_attr as $key => $dummy) { + if (!in_array($key, $tmp_array) && $key !== 0) { + $compiler->trigger_template_error("unexpected \"" . $key . "\" attribute", null, true); + } + } + } + // default 'false' for all option flags not set + foreach ($this->option_flags as $flag) { + if (!isset($_indexed_attr[$flag])) { + $_indexed_attr[$flag] = false; + } + } + + return $_indexed_attr; + } + + /** + * Push opening tag name on stack + * Optionally additional data can be saved on stack + * + * @param object $compiler compiler object + * @param string $openTag the opening tag's name + * @param mixed $data optional data saved + */ + public function openTag($compiler, $openTag, $data = null) + { + array_push($compiler->_tag_stack, array($openTag, $data)); + } + + /** + * Pop closing tag + * Raise an error if this stack-top doesn't match with expected opening tags + * + * @param object $compiler compiler object + * @param array|string $expectedTag the expected opening tag names + * + * @return mixed any type the opening tag's name or saved data + */ + public function closeTag($compiler, $expectedTag) + { + if (count($compiler->_tag_stack) > 0) { + // get stacked info + list($_openTag, $_data) = array_pop($compiler->_tag_stack); + // open tag must match with the expected ones + if (in_array($_openTag, (array) $expectedTag)) { + if (is_null($_data)) { + // return opening tag + return $_openTag; + } else { + // return restored data + return $_data; + } + } + // wrong nesting of tags + $compiler->trigger_template_error("unclosed {$compiler->smarty->left_delimiter}" . $_openTag . + "{$compiler->smarty->right_delimiter} tag"); + + return; + } + // wrong nesting of tags + $compiler->trigger_template_error("unexpected closing tag", null, true); + + return; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_config_file_compiler.php b/inc/libs/Smarty/sysplugins/smarty_internal_config_file_compiler.php new file mode 100755 index 0000000..56d3b06 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_config_file_compiler.php @@ -0,0 +1,194 @@ +smarty = $smarty; + // get required plugins + $this->lexer_class = $lexer_class; + $this->parser_class = $parser_class; + $this->smarty = $smarty; + $this->config_data['sections'] = array(); + $this->config_data['vars'] = array(); + } + + /** + * Method to compile Smarty config source. + * + * @param Smarty_Internal_Template $template + * + * @return bool true if compiling succeeded, false if it failed + */ + public function compileTemplate(Smarty_Internal_Template $template) + { + $this->template = $template; + $this->template->compiled->file_dependency[$this->template->source->uid] = array($this->template->source->filepath, + $this->template->source->getTimeStamp(), + $this->template->source->type); + if ($this->smarty->debugging) { + $this->smarty->_debug->start_compile($this->template); + } + // init the lexer/parser to compile the config file + /* @var Smarty_Internal_ConfigFileLexer $lex */ + $lex = new $this->lexer_class(str_replace(array("\r\n", "\r"), "\n", $template->source->getContent()) . + "\n", $this); + /* @var Smarty_Internal_ConfigFileParser $parser */ + $parser = new $this->parser_class($lex, $this); + + if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('ASCII'); + } else { + $mbEncoding = null; + } + + if ($this->smarty->_parserdebug) { + $parser->PrintTrace(); + } + // get tokens from lexer and parse them + while ($lex->yylex()) { + if ($this->smarty->_parserdebug) { + echo "
    Parsing {$parser->yyTokenName[$lex->token]} Token {$lex->value} Line {$lex->line} \n"; + } + $parser->doParse($lex->token, $lex->value); + } + // finish parsing process + $parser->doParse(0, 0); + + if ($mbEncoding) { + mb_internal_encoding($mbEncoding); + } + if ($this->smarty->debugging) { + $this->smarty->_debug->end_compile($this->template); + } + // template header code + $template_header = "template->source->filepath . "\" */ ?>\n"; + + $code = 'smarty->ext->configLoad->_loadConfigVars($_smarty_tpl, ' . + var_export($this->config_data, true) . '); ?>'; + return $template_header . $this->template->smarty->ext->_codeFrame->create($this->template, $code); + } + + /** + * display compiler error messages without dying + * If parameter $args is empty it is a parser detected syntax error. + * In this case the parser is called to obtain information about expected tokens. + * If parameter $args contains a string this is used as error message + * + * @param string $args individual error message or null + * + * @throws SmartyCompilerException + */ + public function trigger_config_file_error($args = null) + { + $this->lex = Smarty_Internal_Configfilelexer::instance(); + $this->parser = Smarty_Internal_Configfileparser::instance(); + // get config source line which has error + $line = $this->lex->line; + if (isset($args)) { + // $line--; + } + $match = preg_split("/\n/", $this->lex->data); + $error_text = "Syntax error in config file '{$this->template->source->filepath}' on line {$line} '{$match[$line - 1]}' "; + if (isset($args)) { + // individual error message + $error_text .= $args; + } else { + // expected token from parser + foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) { + $exp_token = $this->parser->yyTokenName[$token]; + if (isset($this->lex->smarty_token_names[$exp_token])) { + // token type from lexer + $expect[] = '"' . $this->lex->smarty_token_names[$exp_token] . '"'; + } else { + // otherwise internal token name + $expect[] = $this->parser->yyTokenName[$token]; + } + } + // output parser error message + $error_text .= ' - Unexpected "' . $this->lex->value . '", expected one of: ' . implode(' , ', $expect); + } + throw new SmartyCompilerException($error_text); + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_configfilelexer.php b/inc/libs/Smarty/sysplugins/smarty_internal_configfilelexer.php new file mode 100755 index 0000000..e62728c --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_configfilelexer.php @@ -0,0 +1,699 @@ + 'START', 2 => 'VALUE', 3 => 'NAKED_STRING_VALUE', 4 => 'COMMENT', 5 => 'SECTION', + 6 => 'TRIPPLE'); + + /** + * storage for assembled token patterns + * + * @var sring + */ + private $yy_global_pattern1 = null; + + private $yy_global_pattern2 = null; + + private $yy_global_pattern3 = null; + + private $yy_global_pattern4 = null; + + private $yy_global_pattern5 = null; + + private $yy_global_pattern6 = null; + + /** + * token names + * + * @var array + */ + public $smarty_token_names = array( // Text for parser error messages + ); + + /** + * constructor + * + * @param string $data template source + * @param Smarty_Internal_Config_File_Compiler $compiler + */ + function __construct($data, Smarty_Internal_Config_File_Compiler $compiler) + { + // set instance object + self::instance($this); + $this->data = $data . "\n"; //now all lines are \n-terminated + $this->counter = 0; + if (preg_match('/^\xEF\xBB\xBF/', $this->data, $match)) { + $this->counter += strlen($match[0]); + } + $this->line = 1; + $this->compiler = $compiler; + $this->smarty = $compiler->smarty; + $this->configBooleanize = $this->smarty->config_booleanize; + } + + public static function &instance($new_instance = null) + { + static $instance = null; + if (isset($new_instance) && is_object($new_instance)) { + $instance = $new_instance; + } + return $instance; + } + + public function PrintTrace() + { + $this->yyTraceFILE = fopen('php://output', 'w'); + $this->yyTracePrompt = '
    '; + } + + private $_yy_state = 1; + + private $_yy_stack = array(); + + public function yylex() + { + return $this->{'yylex' . $this->_yy_state}(); + } + + public function yypushstate($state) + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sState push %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); + } + array_push($this->_yy_stack, $this->_yy_state); + $this->_yy_state = $state; + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); + } + } + + public function yypopstate() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sState pop %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); + } + $this->_yy_state = array_pop($this->_yy_stack); + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); + } + } + + public function yybegin($state) + { + $this->_yy_state = $state; + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sState set %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); + } + } + + public function yylex1() + { + if (!isset($this->yy_global_pattern1)) { + $this->yy_global_pattern1 = "/\G(#|;)|\G(\\[)|\G(\\])|\G(=)|\G([ \t\r]+)|\G(\n)|\G([0-9]*[a-zA-Z_]\\w*)|\G([\S\s])/isS"; + } + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern1, $this->data, $yymatches, null, $this->counter)) { + $yysubmatches = $yymatches; + if (strlen($yysubmatches[0]) < 200) { + $yymatches = preg_grep("/(.|\s)+/", $yysubmatches); + } else { + $yymatches = array_filter($yymatches, 'strlen'); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state START'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r1_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + // skip this token + continue; + } + } else { + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]); + } + break; + } while (true); + } // end function + + const START = 1; + + function yy_r1_1() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_COMMENTSTART; + $this->yypushstate(self::COMMENT); + } + + function yy_r1_2() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_OPENB; + $this->yypushstate(self::SECTION); + } + + function yy_r1_3() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_CLOSEB; + } + + function yy_r1_4() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_EQUAL; + $this->yypushstate(self::VALUE); + } + + function yy_r1_5() + { + + return false; + } + + function yy_r1_6() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE; + } + + function yy_r1_7() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_ID; + } + + function yy_r1_8() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_OTHER; + } + + public function yylex2() + { + if (!isset($this->yy_global_pattern2)) { + $this->yy_global_pattern2 = "/\G([ \t\r]+)|\G(\\d+\\.\\d+(?=[ \t\r]*[\n#;]))|\G(\\d+(?=[ \t\r]*[\n#;]))|\G(\"\"\")|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*'(?=[ \t\r]*[\n#;]))|\G(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"(?=[ \t\r]*[\n#;]))|\G([a-zA-Z]+(?=[ \t\r]*[\n#;]))|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/isS"; + } + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern2, $this->data, $yymatches, null, $this->counter)) { + $yysubmatches = $yymatches; + if (strlen($yysubmatches[0]) < 200) { + $yymatches = preg_grep("/(.|\s)+/", $yysubmatches); + } else { + $yymatches = array_filter($yymatches, 'strlen'); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state VALUE'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r2_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + // skip this token + continue; + } + } else { + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]); + } + break; + } while (true); + } // end function + + const VALUE = 2; + + function yy_r2_1() + { + + return false; + } + + function yy_r2_2() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_FLOAT; + $this->yypopstate(); + } + + function yy_r2_3() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_INT; + $this->yypopstate(); + } + + function yy_r2_4() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES; + $this->yypushstate(self::TRIPPLE); + } + + function yy_r2_5() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_SINGLE_QUOTED_STRING; + $this->yypopstate(); + } + + function yy_r2_6() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_DOUBLE_QUOTED_STRING; + $this->yypopstate(); + } + + function yy_r2_7() + { + + if (!$this->configBooleanize || !in_array(strtolower($this->value), Array("true", "false", "on", "off", "yes", + "no")) + ) { + $this->yypopstate(); + $this->yypushstate(self::NAKED_STRING_VALUE); + return true; //reprocess in new state + } else { + $this->token = Smarty_Internal_Configfileparser::TPC_BOOL; + $this->yypopstate(); + } + } + + function yy_r2_8() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING; + $this->yypopstate(); + } + + function yy_r2_9() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING; + $this->value = ""; + $this->yypopstate(); + } + + public function yylex3() + { + if (!isset($this->yy_global_pattern3)) { + $this->yy_global_pattern3 = "/\G([^\n]+?(?=[ \t\r]*\n))/isS"; + } + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern3, $this->data, $yymatches, null, $this->counter)) { + $yysubmatches = $yymatches; + if (strlen($yysubmatches[0]) < 200) { + $yymatches = preg_grep("/(.|\s)+/", $yysubmatches); + } else { + $yymatches = array_filter($yymatches, 'strlen'); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state NAKED_STRING_VALUE'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r3_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + // skip this token + continue; + } + } else { + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]); + } + break; + } while (true); + } // end function + + const NAKED_STRING_VALUE = 3; + + function yy_r3_1() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING; + $this->yypopstate(); + } + + public function yylex4() + { + if (!isset($this->yy_global_pattern4)) { + $this->yy_global_pattern4 = "/\G([ \t\r]+)|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/isS"; + } + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern4, $this->data, $yymatches, null, $this->counter)) { + $yysubmatches = $yymatches; + if (strlen($yysubmatches[0]) < 200) { + $yymatches = preg_grep("/(.|\s)+/", $yysubmatches); + } else { + $yymatches = array_filter($yymatches, 'strlen'); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state COMMENT'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r4_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + // skip this token + continue; + } + } else { + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]); + } + break; + } while (true); + } // end function + + const COMMENT = 4; + + function yy_r4_1() + { + + return false; + } + + function yy_r4_2() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING; + } + + function yy_r4_3() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE; + $this->yypopstate(); + } + + public function yylex5() + { + if (!isset($this->yy_global_pattern5)) { + $this->yy_global_pattern5 = "/\G(\\.)|\G(.*?(?=[\.=[\]\r\n]))/isS"; + } + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern5, $this->data, $yymatches, null, $this->counter)) { + $yysubmatches = $yymatches; + if (strlen($yysubmatches[0]) < 200) { + $yymatches = preg_grep("/(.|\s)+/", $yysubmatches); + } else { + $yymatches = array_filter($yymatches, 'strlen'); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state SECTION'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r5_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + // skip this token + continue; + } + } else { + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]); + } + break; + } while (true); + } // end function + + const SECTION = 5; + + function yy_r5_1() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_DOT; + } + + function yy_r5_2() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_SECTION; + $this->yypopstate(); + } + + public function yylex6() + { + if (!isset($this->yy_global_pattern6)) { + $this->yy_global_pattern6 = "/\G(\"\"\"(?=[ \t\r]*[\n#;]))|\G([\S\s])/isS"; + } + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern6, $this->data, $yymatches, null, $this->counter)) { + $yysubmatches = $yymatches; + if (strlen($yysubmatches[0]) < 200) { + $yymatches = preg_grep("/(.|\s)+/", $yysubmatches); + } else { + $yymatches = array_filter($yymatches, 'strlen'); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state TRIPPLE'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r6_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + // skip this token + continue; + } + } else { + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]); + } + break; + } while (true); + } // end function + + const TRIPPLE = 6; + + function yy_r6_1() + { + + $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES_END; + $this->yypopstate(); + $this->yypushstate(self::START); + } + + function yy_r6_2() + { + + $to = strlen($this->data); + preg_match("/\"\"\"[ \t\r]*[\n#;]/", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter); + if (isset($match[0][1])) { + $to = $match[0][1]; + } else { + $this->compiler->trigger_template_error("missing or misspelled literal closing tag"); + } + $this->value = substr($this->data, $this->counter, $to - $this->counter); + $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_TEXT; + } + +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_configfileparser.php b/inc/libs/Smarty/sysplugins/smarty_internal_configfileparser.php new file mode 100755 index 0000000..69aaf99 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_configfileparser.php @@ -0,0 +1,1010 @@ +string = $s->string; + $this->metadata = $s->metadata; + } else { + $this->string = (string) $s; + if ($m instanceof TPC_yyToken) { + $this->metadata = $m->metadata; + } elseif (is_array($m)) { + $this->metadata = $m; + } + } + } + + public function __toString() + { + return $this->string; + } + + public function offsetExists($offset) + { + return isset($this->metadata[$offset]); + } + + public function offsetGet($offset) + { + return $this->metadata[$offset]; + } + + public function offsetSet($offset, $value) + { + if ($offset === null) { + if (isset($value[0])) { + $x = ($value instanceof TPC_yyToken) ? $value->metadata : $value; + $this->metadata = array_merge($this->metadata, $x); + + return; + } + $offset = count($this->metadata); + } + if ($value === null) { + return; + } + if ($value instanceof TPC_yyToken) { + if ($value->metadata) { + $this->metadata[$offset] = $value->metadata; + } + } elseif ($value) { + $this->metadata[$offset] = $value; + } + } + + public function offsetUnset($offset) + { + unset($this->metadata[$offset]); + } +} + +class TPC_yyStackEntry +{ + public $stateno; /* The state-number */ + public $major; /* The major token value. This is the code + ** number for the token at this stack level */ + public $minor; /* The user-supplied minor token value. This + ** is the value of the token */ +} + +; + +#line 12 "../smarty/lexer/smarty_internal_configfileparser.y" + +/** + * Smarty Internal Plugin Configfileparse + * + * This is the config file parser. + * It is generated from the smarty_internal_configfileparser.y file + * + * @package Smarty + * @subpackage Compiler + * @author Uwe Tews + */ +class Smarty_Internal_Configfileparser +{ + #line 25 "../smarty/lexer/smarty_internal_configfileparser.y" + + /** + * result status + * + * @var bool + */ + public $successful = true; + + /** + * return value + * + * @var mixed + */ + public $retvalue = 0; + + /** + * @var + */ + public $yymajor; + + /** + * lexer object + * + * @var Smarty_Internal_Configfilelexer + */ + private $lex; + + /** + * internal error flag + * + * @var bool + */ + private $internalError = false; + + /** + * compiler object + * + * @var Smarty_Internal_Config_File_Compiler + */ + public $compiler = null; + + /** + * smarty object + * + * @var Smarty + */ + public $smarty = null; + + /** + * copy of config_overwrite property + * + * @var bool + */ + private $configOverwrite = false; + + /** + * copy of config_read_hidden property + * + * @var bool + */ + private $configReadHidden = false; + + /** + * helper map + * + * @var array + */ + private static $escapes_single = Array('\\' => '\\', '\'' => '\''); + + /** + * constructor + * + * @param Smarty_Internal_Configfilelexer $lex + * @param Smarty_Internal_Config_File_Compiler $compiler + */ + function __construct(Smarty_Internal_Configfilelexer $lex, Smarty_Internal_Config_File_Compiler $compiler) + { + // set instance object + self::instance($this); + $this->lex = $lex; + $this->smarty = $compiler->smarty; + $this->compiler = $compiler; + $this->configOverwrite = $this->smarty->config_overwrite; + $this->configReadHidden = $this->smarty->config_read_hidden; + } + + /** + * @param null $new_instance + * + * @return null + */ + public static function &instance($new_instance = null) + { + static $instance = null; + if (isset($new_instance) && is_object($new_instance)) { + $instance = $new_instance; + } + return $instance; + } + + /** + * parse optional boolean keywords + * + * @param string $str + * + * @return bool + */ + private function parse_bool($str) + { + $str = strtolower($str); + if (in_array($str, array('on', 'yes', 'true'))) { + $res = true; + } else { + $res = false; + } + return $res; + } + + /** + * parse single quoted string + * remove outer quotes + * unescape inner quotes + * + * @param string $qstr + * + * @return string + */ + private static function parse_single_quoted_string($qstr) + { + $escaped_string = substr($qstr, 1, strlen($qstr) - 2); //remove outer quotes + + $ss = preg_split('/(\\\\.)/', $escaped_string, - 1, PREG_SPLIT_DELIM_CAPTURE); + + $str = ""; + foreach ($ss as $s) { + if (strlen($s) === 2 && $s[0] === '\\') { + if (isset(self::$escapes_single[$s[1]])) { + $s = self::$escapes_single[$s[1]]; + } + } + $str .= $s; + } + return $str; + } + + /** + * parse double quoted string + * + * @param string $qstr + * + * @return string + */ + private static function parse_double_quoted_string($qstr) + { + $inner_str = substr($qstr, 1, strlen($qstr) - 2); + return stripcslashes($inner_str); + } + + /** + * parse triple quoted string + * + * @param string $qstr + * + * @return string + */ + private static function parse_tripple_double_quoted_string($qstr) + { + return stripcslashes($qstr); + } + + /** + * set a config variable in target array + * + * @param array $var + * @param array $target_array + */ + private function set_var(Array $var, Array &$target_array) + { + $key = $var["key"]; + $value = $var["value"]; + + if ($this->configOverwrite || !isset($target_array['vars'][$key])) { + $target_array['vars'][$key] = $value; + } else { + settype($target_array['vars'][$key], 'array'); + $target_array['vars'][$key][] = $value; + } + } + + /** + * add config variable to global vars + * + * @param array $vars + */ + private function add_global_vars(Array $vars) + { + if (!isset($this->compiler->config_data['vars'])) { + $this->compiler->config_data['vars'] = Array(); + } + foreach ($vars as $var) { + $this->set_var($var, $this->compiler->config_data); + } + } + + /** + * add config variable to section + * + * @param string $section_name + * @param array $vars + */ + private function add_section_vars($section_name, Array $vars) + { + if (!isset($this->compiler->config_data['sections'][$section_name]['vars'])) { + $this->compiler->config_data['sections'][$section_name]['vars'] = Array(); + } + foreach ($vars as $var) { + $this->set_var($var, $this->compiler->config_data['sections'][$section_name]); + } + } + + const TPC_OPENB = 1; + + const TPC_SECTION = 2; + + const TPC_CLOSEB = 3; + + const TPC_DOT = 4; + + const TPC_ID = 5; + + const TPC_EQUAL = 6; + + const TPC_FLOAT = 7; + + const TPC_INT = 8; + + const TPC_BOOL = 9; + + const TPC_SINGLE_QUOTED_STRING = 10; + + const TPC_DOUBLE_QUOTED_STRING = 11; + + const TPC_TRIPPLE_QUOTES = 12; + + const TPC_TRIPPLE_TEXT = 13; + + const TPC_TRIPPLE_QUOTES_END = 14; + + const TPC_NAKED_STRING = 15; + + const TPC_OTHER = 16; + + const TPC_NEWLINE = 17; + + const TPC_COMMENTSTART = 18; + + const YY_NO_ACTION = 60; + + const YY_ACCEPT_ACTION = 59; + + const YY_ERROR_ACTION = 58; + + const YY_SZ_ACTTAB = 38; + + static public $yy_action = array(29, 30, 34, 33, 24, 13, 19, 25, 35, 21, 59, 8, 3, 1, 20, 12, 14, 31, 20, 12, 15, + 17, 23, 18, 27, 26, 4, 5, 6, 32, 2, 11, 28, 22, 16, 9, 7, 10,); + + static public $yy_lookahead = array(7, 8, 9, 10, 11, 12, 5, 27, 15, 16, 20, 21, 23, 23, 17, 18, 13, 14, 17, 18, 15, + 2, 17, 4, 25, 26, 6, 3, 3, 14, 23, 1, 24, 17, 2, 25, 22, 25,); + + const YY_SHIFT_USE_DFLT = - 8; + + const YY_SHIFT_MAX = 19; + + static public $yy_shift_ofst = array(- 8, 1, 1, 1, - 7, - 3, - 3, 30, - 8, - 8, - 8, 19, 5, 3, 15, 16, 24, 25, 32, + 20,); + + const YY_REDUCE_USE_DFLT = - 21; + + const YY_REDUCE_MAX = 10; + + static public $yy_reduce_ofst = array(- 10, - 1, - 1, - 1, - 20, 10, 12, 8, 14, 7, - 11,); + + static public $yyExpectedTokens = array(array(), array(5, 17, 18,), array(5, 17, 18,), array(5, 17, 18,), + array(7, 8, 9, 10, 11, 12, 15, 16,), array(17, 18,), array(17, 18,), array(1,), array(), array(), array(), + array(2, 4,), array(15, 17,), array(13, 14,), array(14,), array(17,), array(3,), array(3,), array(2,), + array(6,), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), + array(), array(), array(), array(), array(),); + + static public $yy_default = array(44, 37, 41, 40, 58, 58, 58, 36, 39, 44, 44, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 55, 54, 57, 56, 50, 45, 43, 42, 38, 46, 47, 52, 51, 49, 48, 53,); + + const YYNOCODE = 29; + + const YYSTACKDEPTH = 100; + + const YYNSTATE = 36; + + const YYNRULE = 22; + + const YYERRORSYMBOL = 19; + + const YYERRSYMDT = 'yy0'; + + const YYFALLBACK = 0; + + public static $yyFallback = array(); + + public function Trace($TraceFILE, $zTracePrompt) + { + if (!$TraceFILE) { + $zTracePrompt = 0; + } elseif (!$zTracePrompt) { + $TraceFILE = 0; + } + $this->yyTraceFILE = $TraceFILE; + $this->yyTracePrompt = $zTracePrompt; + } + + public function PrintTrace() + { + $this->yyTraceFILE = fopen('php://output', 'w'); + $this->yyTracePrompt = '
    '; + } + + public $yyTraceFILE; + + public $yyTracePrompt; + + public $yyidx; /* Index of top element in stack */ + public $yyerrcnt; /* Shifts left before out of the error */ + public $yystack = array(); /* The parser's stack */ + + public $yyTokenName = array('$', 'OPENB', 'SECTION', 'CLOSEB', 'DOT', 'ID', 'EQUAL', 'FLOAT', 'INT', 'BOOL', + 'SINGLE_QUOTED_STRING', 'DOUBLE_QUOTED_STRING', 'TRIPPLE_QUOTES', 'TRIPPLE_TEXT', 'TRIPPLE_QUOTES_END', + 'NAKED_STRING', 'OTHER', 'NEWLINE', 'COMMENTSTART', 'error', 'start', 'global_vars', 'sections', 'var_list', + 'section', 'newline', 'var', 'value',); + + public static $yyRuleName = array('start ::= global_vars sections', 'global_vars ::= var_list', + 'sections ::= sections section', 'sections ::=', 'section ::= OPENB SECTION CLOSEB newline var_list', + 'section ::= OPENB DOT SECTION CLOSEB newline var_list', 'var_list ::= var_list newline', + 'var_list ::= var_list var', 'var_list ::=', 'var ::= ID EQUAL value', 'value ::= FLOAT', 'value ::= INT', + 'value ::= BOOL', 'value ::= SINGLE_QUOTED_STRING', 'value ::= DOUBLE_QUOTED_STRING', + 'value ::= TRIPPLE_QUOTES TRIPPLE_TEXT TRIPPLE_QUOTES_END', 'value ::= TRIPPLE_QUOTES TRIPPLE_QUOTES_END', + 'value ::= NAKED_STRING', 'value ::= OTHER', 'newline ::= NEWLINE', 'newline ::= COMMENTSTART NEWLINE', + 'newline ::= COMMENTSTART NAKED_STRING NEWLINE',); + + public function tokenName($tokenType) + { + if ($tokenType === 0) { + return 'End of Input'; + } + if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) { + return $this->yyTokenName[$tokenType]; + } else { + return "Unknown"; + } + } + + public static function yy_destructor($yymajor, $yypminor) + { + switch ($yymajor) { + default: + break; /* If no destructor action specified: do nothing */ + } + } + + public function yy_pop_parser_stack() + { + if (empty($this->yystack)) { + return; + } + $yytos = array_pop($this->yystack); + if ($this->yyTraceFILE && $this->yyidx >= 0) { + fwrite($this->yyTraceFILE, $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] . "\n"); + } + $yymajor = $yytos->major; + self::yy_destructor($yymajor, $yytos->minor); + $this->yyidx --; + + return $yymajor; + } + + public function __destruct() + { + while ($this->yystack !== Array()) { + $this->yy_pop_parser_stack(); + } + if (is_resource($this->yyTraceFILE)) { + fclose($this->yyTraceFILE); + } + } + + public function yy_get_expected_tokens($token) + { + static $res3 = array(); + static $res4 = array(); + $state = $this->yystack[$this->yyidx]->stateno; + $expected = self::$yyExpectedTokens[$state]; + if (isset($res3[$state][$token])) { + if ($res3[$state][$token]) { + return $expected; + } + } else { + if ($res3[$state][$token] = in_array($token, self::$yyExpectedTokens[$state], true)) { + return $expected; + } + } + $stack = $this->yystack; + $yyidx = $this->yyidx; + do { + $yyact = $this->yy_find_shift_action($token); + if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { + // reduce action + $done = 0; + do { + if ($done ++ == 100) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // too much recursion prevents proper detection + // so give up + return array_unique($expected); + } + $yyruleno = $yyact - self::YYNSTATE; + $this->yyidx -= self::$yyRuleInfo[$yyruleno][1]; + $nextstate = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, self::$yyRuleInfo[$yyruleno][0]); + if (isset(self::$yyExpectedTokens[$nextstate])) { + $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]); + if (isset($res4[$nextstate][$token])) { + if ($res4[$nextstate][$token]) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return array_unique($expected); + } + } else { + if ($res4[$nextstate][$token] = in_array($token, self::$yyExpectedTokens[$nextstate], true)) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return array_unique($expected); + } + } + } + if ($nextstate < self::YYNSTATE) { + // we need to shift a non-terminal + $this->yyidx ++; + $x = new TPC_yyStackEntry; + $x->stateno = $nextstate; + $x->major = self::$yyRuleInfo[$yyruleno][0]; + $this->yystack[$this->yyidx] = $x; + continue 2; + } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // the last token was just ignored, we can't accept + // by ignoring input, this is in essence ignoring a + // syntax error! + return array_unique($expected); + } elseif ($nextstate === self::YY_NO_ACTION) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // input accepted, but not shifted (I guess) + return $expected; + } else { + $yyact = $nextstate; + } + } while (true); + } + break; + } while (true); + $this->yyidx = $yyidx; + $this->yystack = $stack; + + return array_unique($expected); + } + + public function yy_is_expected_token($token) + { + static $res = array(); + static $res2 = array(); + if ($token === 0) { + return true; // 0 is not part of this + } + $state = $this->yystack[$this->yyidx]->stateno; + if (isset($res[$state][$token])) { + if ($res[$state][$token]) { + return true; + } + } else { + if ($res[$state][$token] = in_array($token, self::$yyExpectedTokens[$state], true)) { + return true; + } + } + $stack = $this->yystack; + $yyidx = $this->yyidx; + do { + $yyact = $this->yy_find_shift_action($token); + if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { + // reduce action + $done = 0; + do { + if ($done ++ == 100) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // too much recursion prevents proper detection + // so give up + return true; + } + $yyruleno = $yyact - self::YYNSTATE; + $this->yyidx -= self::$yyRuleInfo[$yyruleno][1]; + $nextstate = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, self::$yyRuleInfo[$yyruleno][0]); + if (isset($res2[$nextstate][$token])) { + if ($res2[$nextstate][$token]) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return true; + } + } else { + if ($res2[$nextstate][$token] = (isset(self::$yyExpectedTokens[$nextstate]) && in_array($token, self::$yyExpectedTokens[$nextstate], true))) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return true; + } + } + if ($nextstate < self::YYNSTATE) { + // we need to shift a non-terminal + $this->yyidx ++; + $x = new TPC_yyStackEntry; + $x->stateno = $nextstate; + $x->major = self::$yyRuleInfo[$yyruleno][0]; + $this->yystack[$this->yyidx] = $x; + continue 2; + } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + if (!$token) { + // end of input: this is valid + return true; + } + // the last token was just ignored, we can't accept + // by ignoring input, this is in essence ignoring a + // syntax error! + return false; + } elseif ($nextstate === self::YY_NO_ACTION) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // input accepted, but not shifted (I guess) + return true; + } else { + $yyact = $nextstate; + } + } while (true); + } + break; + } while (true); + $this->yyidx = $yyidx; + $this->yystack = $stack; + + return true; + } + + public function yy_find_shift_action($iLookAhead) + { + $stateno = $this->yystack[$this->yyidx]->stateno; + + /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */ + if (!isset(self::$yy_shift_ofst[$stateno])) { + // no shift actions + return self::$yy_default[$stateno]; + } + $i = self::$yy_shift_ofst[$stateno]; + if ($i === self::YY_SHIFT_USE_DFLT) { + return self::$yy_default[$stateno]; + } + if ($iLookAhead == self::YYNOCODE) { + return self::YY_NO_ACTION; + } + $i += $iLookAhead; + if ($i < 0 || $i >= self::YY_SZ_ACTTAB || self::$yy_lookahead[$i] != $iLookAhead) { + if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) { + if ($this->yyTraceFILE) { + fwrite($this->yyTraceFILE, $this->yyTracePrompt . "FALLBACK " . $this->yyTokenName[$iLookAhead] . " => " . $this->yyTokenName[$iFallback] . "\n"); + } + + return $this->yy_find_shift_action($iFallback); + } + + return self::$yy_default[$stateno]; + } else { + return self::$yy_action[$i]; + } + } + + public function yy_find_reduce_action($stateno, $iLookAhead) + { + /* $stateno = $this->yystack[$this->yyidx]->stateno; */ + + if (!isset(self::$yy_reduce_ofst[$stateno])) { + return self::$yy_default[$stateno]; + } + $i = self::$yy_reduce_ofst[$stateno]; + if ($i == self::YY_REDUCE_USE_DFLT) { + return self::$yy_default[$stateno]; + } + if ($iLookAhead == self::YYNOCODE) { + return self::YY_NO_ACTION; + } + $i += $iLookAhead; + if ($i < 0 || $i >= self::YY_SZ_ACTTAB || self::$yy_lookahead[$i] != $iLookAhead) { + return self::$yy_default[$stateno]; + } else { + return self::$yy_action[$i]; + } + } + + public function yy_shift($yyNewState, $yyMajor, $yypMinor) + { + $this->yyidx ++; + if ($this->yyidx >= self::YYSTACKDEPTH) { + $this->yyidx --; + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sStack Overflow!\n", $this->yyTracePrompt); + } + while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } + #line 255 "../smarty/lexer/smarty_internal_configfileparser.y" + + $this->internalError = true; + $this->compiler->trigger_config_file_error("Stack overflow in configfile parser"); + + return; + } + $yytos = new TPC_yyStackEntry; + $yytos->stateno = $yyNewState; + $yytos->major = $yyMajor; + $yytos->minor = $yypMinor; + $this->yystack[] = $yytos; + if ($this->yyTraceFILE && $this->yyidx > 0) { + fprintf($this->yyTraceFILE, "%sShift %d\n", $this->yyTracePrompt, $yyNewState); + fprintf($this->yyTraceFILE, "%sStack:", $this->yyTracePrompt); + for ($i = 1; $i <= $this->yyidx; $i ++) { + fprintf($this->yyTraceFILE, " %s", $this->yyTokenName[$this->yystack[$i]->major]); + } + fwrite($this->yyTraceFILE, "\n"); + } + } + + public static $yyRuleInfo = array(array(0 => 20, 1 => 2), array(0 => 21, 1 => 1), array(0 => 22, 1 => 2), + array(0 => 22, 1 => 0), array(0 => 24, 1 => 5), array(0 => 24, 1 => 6), array(0 => 23, 1 => 2), + array(0 => 23, 1 => 2), array(0 => 23, 1 => 0), array(0 => 26, 1 => 3), array(0 => 27, 1 => 1), + array(0 => 27, 1 => 1), array(0 => 27, 1 => 1), array(0 => 27, 1 => 1), array(0 => 27, 1 => 1), + array(0 => 27, 1 => 3), array(0 => 27, 1 => 2), array(0 => 27, 1 => 1), array(0 => 27, 1 => 1), + array(0 => 25, 1 => 1), array(0 => 25, 1 => 2), array(0 => 25, 1 => 3),); + + public static $yyReduceMap = array(0 => 0, 2 => 0, 3 => 0, 19 => 0, 20 => 0, 21 => 0, 1 => 1, 4 => 4, 5 => 5, + 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, + 14 => 14, 15 => 15, 16 => 16, 17 => 17, 18 => 17,); + + #line 261 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r0() + { + $this->_retvalue = null; + } + + #line 266 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r1() + { + $this->add_global_vars($this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = null; + } + + #line 280 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r4() + { + $this->add_section_vars($this->yystack[$this->yyidx + - 3]->minor, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = null; + } + + #line 285 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r5() + { + if ($this->configReadHidden) { + $this->add_section_vars($this->yystack[$this->yyidx + - 3]->minor, $this->yystack[$this->yyidx + 0]->minor); + } + $this->_retvalue = null; + } + + #line 293 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r6() + { + $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor; + } + + #line 297 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r7() + { + $this->_retvalue = array_merge($this->yystack[$this->yyidx + - 1]->minor, Array($this->yystack[$this->yyidx + 0]->minor)); + } + + #line 301 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r8() + { + $this->_retvalue = Array(); + } + + #line 307 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r9() + { + $this->_retvalue = Array("key" => $this->yystack[$this->yyidx + - 2]->minor, + "value" => $this->yystack[$this->yyidx + 0]->minor); + } + + #line 312 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r10() + { + $this->_retvalue = (float) $this->yystack[$this->yyidx + 0]->minor; + } + + #line 316 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r11() + { + $this->_retvalue = (int) $this->yystack[$this->yyidx + 0]->minor; + } + + #line 320 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r12() + { + $this->_retvalue = $this->parse_bool($this->yystack[$this->yyidx + 0]->minor); + } + + #line 324 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r13() + { + $this->_retvalue = self::parse_single_quoted_string($this->yystack[$this->yyidx + 0]->minor); + } + + #line 328 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r14() + { + $this->_retvalue = self::parse_double_quoted_string($this->yystack[$this->yyidx + 0]->minor); + } + + #line 332 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r15() + { + $this->_retvalue = self::parse_tripple_double_quoted_string($this->yystack[$this->yyidx + - 1]->minor); + } + + #line 336 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r16() + { + $this->_retvalue = ''; + } + + #line 340 "../smarty/lexer/smarty_internal_configfileparser.y" + function yy_r17() + { + $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; + } + + private $_retvalue; + + public function yy_reduce($yyruleno) + { + if ($this->yyTraceFILE && $yyruleno >= 0 && $yyruleno < count(self::$yyRuleName)) { + fprintf($this->yyTraceFILE, "%sReduce (%d) [%s].\n", $this->yyTracePrompt, $yyruleno, self::$yyRuleName[$yyruleno]); + } + + $this->_retvalue = $yy_lefthand_side = null; + if (isset(self::$yyReduceMap[$yyruleno])) { + // call the action + $this->_retvalue = null; + $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}(); + $yy_lefthand_side = $this->_retvalue; + } + $yygoto = self::$yyRuleInfo[$yyruleno][0]; + $yysize = self::$yyRuleInfo[$yyruleno][1]; + $this->yyidx -= $yysize; + for ($i = $yysize; $i; $i --) { + // pop all of the right-hand side parameters + array_pop($this->yystack); + } + $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto); + if ($yyact < self::YYNSTATE) { + if (!$this->yyTraceFILE && $yysize) { + $this->yyidx ++; + $x = new TPC_yyStackEntry; + $x->stateno = $yyact; + $x->major = $yygoto; + $x->minor = $yy_lefthand_side; + $this->yystack[$this->yyidx] = $x; + } else { + $this->yy_shift($yyact, $yygoto, $yy_lefthand_side); + } + } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) { + $this->yy_accept(); + } + } + + public function yy_parse_failed() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sFail!\n", $this->yyTracePrompt); + } + while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } + } + + public function yy_syntax_error($yymajor, $TOKEN) + { + #line 248 "../smarty/lexer/smarty_internal_configfileparser.y" + + $this->internalError = true; + $this->yymajor = $yymajor; + $this->compiler->trigger_config_file_error(); + } + + public function yy_accept() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sAccept!\n", $this->yyTracePrompt); + } + while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } + #line 241 "../smarty/lexer/smarty_internal_configfileparser.y" + + $this->successful = !$this->internalError; + $this->internalError = false; + $this->retvalue = $this->_retvalue; + } + + public function doParse($yymajor, $yytokenvalue) + { + $yyerrorhit = 0; /* True if yymajor has invoked an error */ + + if ($this->yyidx === null || $this->yyidx < 0) { + $this->yyidx = 0; + $this->yyerrcnt = - 1; + $x = new TPC_yyStackEntry; + $x->stateno = 0; + $x->major = 0; + $this->yystack = array(); + $this->yystack[] = $x; + } + $yyendofinput = ($yymajor == 0); + + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sInput %s\n", $this->yyTracePrompt, $this->yyTokenName[$yymajor]); + } + + do { + $yyact = $this->yy_find_shift_action($yymajor); + if ($yymajor < self::YYERRORSYMBOL && !$this->yy_is_expected_token($yymajor)) { + // force a syntax error + $yyact = self::YY_ERROR_ACTION; + } + if ($yyact < self::YYNSTATE) { + $this->yy_shift($yyact, $yymajor, $yytokenvalue); + $this->yyerrcnt --; + if ($yyendofinput && $this->yyidx >= 0) { + $yymajor = 0; + } else { + $yymajor = self::YYNOCODE; + } + } elseif ($yyact < self::YYNSTATE + self::YYNRULE) { + $this->yy_reduce($yyact - self::YYNSTATE); + } elseif ($yyact == self::YY_ERROR_ACTION) { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sSyntax Error!\n", $this->yyTracePrompt); + } + if (self::YYERRORSYMBOL) { + if ($this->yyerrcnt < 0) { + $this->yy_syntax_error($yymajor, $yytokenvalue); + } + $yymx = $this->yystack[$this->yyidx]->major; + if ($yymx == self::YYERRORSYMBOL || $yyerrorhit) { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sDiscard input token %s\n", $this->yyTracePrompt, $this->yyTokenName[$yymajor]); + } + $this->yy_destructor($yymajor, $yytokenvalue); + $yymajor = self::YYNOCODE; + } else { + while ($this->yyidx >= 0 && $yymx != self::YYERRORSYMBOL && ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE) { + $this->yy_pop_parser_stack(); + } + if ($this->yyidx < 0 || $yymajor == 0) { + $this->yy_destructor($yymajor, $yytokenvalue); + $this->yy_parse_failed(); + $yymajor = self::YYNOCODE; + } elseif ($yymx != self::YYERRORSYMBOL) { + $u2 = 0; + $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2); + } + } + $this->yyerrcnt = 3; + $yyerrorhit = 1; + } else { + if ($this->yyerrcnt <= 0) { + $this->yy_syntax_error($yymajor, $yytokenvalue); + } + $this->yyerrcnt = 3; + $this->yy_destructor($yymajor, $yytokenvalue); + if ($yyendofinput) { + $this->yy_parse_failed(); + } + $yymajor = self::YYNOCODE; + } + } else { + $this->yy_accept(); + $yymajor = self::YYNOCODE; + } + } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0); + } +} + diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_data.php b/inc/libs/Smarty/sysplugins/smarty_internal_data.php new file mode 100755 index 0000000..bba95d3 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_data.php @@ -0,0 +1,240 @@ +ext = new Smarty_Internal_Extension_Handler(); + $this->ext->objType = $this->_objType; + } + + /** + * assigns a Smarty variable + * + * @param array|string $tpl_var the template variable name(s) + * @param mixed $value the value to assign + * @param boolean $nocache if true any output of this variable will be not cached + * + * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for + * chaining + */ + public function assign($tpl_var, $value = null, $nocache = false) + { + if (is_array($tpl_var)) { + foreach ($tpl_var as $_key => $_val) { + if ($_key != '') { + $this->tpl_vars[$_key] = new Smarty_Variable($_val, $nocache); + if ($this->_objType == 2 && $this->scope) { + $this->ext->_updateScope->updateScope($this, $_key); + } + } + } + } else { + if ($tpl_var != '') { + $this->tpl_vars[$tpl_var] = new Smarty_Variable($value, $nocache); + if ($this->_objType == 2 && $this->scope) { + $this->ext->_updateScope->updateScope($this, $tpl_var); + } + } + } + return $this; + } + + /** + * appends values to template variables + * + * @api Smarty::append() + * @link http://www.smarty.net/docs/en/api.append.tpl + * + * @param array|string $tpl_var the template variable name(s) + * @param mixed $value the value to append + * @param bool $merge flag if array elements shall be merged + * @param bool $nocache if true any output of this variable will + * be not cached + * + * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty + */ + public function append($tpl_var, $value = null, $merge = false, $nocache = false) + { + return $this->ext->append->append($this, $tpl_var, $value, $merge, $nocache); + } + + /** + * assigns a global Smarty variable + * + * @param string $varName the global variable name + * @param mixed $value the value to assign + * @param boolean $nocache if true any output of this variable will be not cached + * + * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty + */ + public function assignGlobal($varName, $value = null, $nocache = false) + { + return $this->ext->assignGlobal->assignGlobal($this, $varName, $value, $nocache); + } + + /** + * appends values to template variables by reference + * + * @param string $tpl_var the template variable name + * @param mixed &$value the referenced value to append + * @param boolean $merge flag if array elements shall be merged + * + * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty + */ + public function appendByRef($tpl_var, &$value, $merge = false) + { + return $this->ext->appendByRef->appendByRef($this, $tpl_var, $value, $merge); + } + + /** + * assigns values to template variables by reference + * + * @param string $tpl_var the template variable name + * @param $value + * @param boolean $nocache if true any output of this variable will be not cached + * + * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty + */ + public function assignByRef($tpl_var, &$value, $nocache = false) + { + return $this->ext->assignByRef->assignByRef($this, $tpl_var, $value, $nocache); + } + + /** + * Returns a single or all template variables + * + * @api Smarty::getTemplateVars() + * @link http://www.smarty.net/docs/en/api.get.template.vars.tpl + * + * @param string $varName variable name or null + * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $_ptr optional pointer to data object + * @param bool $searchParents include parent templates? + * + * @return mixed variable value or or array of variables + */ + public function getTemplateVars($varName = null, Smarty_Internal_Data $_ptr = null, $searchParents = true) + { + return $this->ext->getTemplateVars->getTemplateVars($this, $varName, $_ptr, $searchParents); + } + + /** + * gets the object of a Smarty variable + * + * @param string $variable the name of the Smarty variable + * @param Smarty_Internal_Data $_ptr optional pointer to data object + * @param boolean $searchParents search also in parent data + * @param bool $error_enable + * + * @return Smarty_Variable|Smarty_Undefined_Variable the object of the variable + * @deprecated since 3.1.28 please use Smarty_Internal_Data::getTemplateVars() instead. + */ + public function getVariable($variable = null, Smarty_Internal_Data $_ptr = null, $searchParents = true, $error_enable = true){ + return $this->ext->getTemplateVars->_getVariable($this, $variable, $_ptr, $searchParents, $error_enable); + } + + /** + * Follow the parent chain an merge template and config variables + * + * @param \Smarty_Internal_Data|null $data + */ + public function _mergeVars(Smarty_Internal_Data $data = null) + { + if (isset($data)) { + if (!empty($this->tpl_vars)) { + $data->tpl_vars = array_merge($this->tpl_vars, $data->tpl_vars); + } + if (!empty($this->config_vars)) { + $data->config_vars = array_merge($this->config_vars, $data->config_vars); + } + } else { + $data = $this; + } + if (isset($this->parent)) { + $this->parent->_mergeVars($data); + } + } + + /** + * Handle unknown class methods + * + * @param string $name unknown method-name + * @param array $args argument array + * + * @return mixed + * @throws SmartyException + */ + public function __call($name, $args) + { + return $this->ext->_callExternalMethod($this, $name, $args); + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_debug.php b/inc/libs/Smarty/sysplugins/smarty_internal_debug.php new file mode 100755 index 0000000..0cbd549 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_debug.php @@ -0,0 +1,430 @@ +index ++; + $this->offset ++; + $this->template_data[$this->index] = null; + } + $key = $this->get_key($template); + $this->template_data[$this->index][$key]['start_template_time'] = microtime(true); + } + + /** + * End logging of cache time + * + * @param \Smarty_Internal_Template $template cached template + */ + public function end_template(Smarty_Internal_Template $template) + { + $key = $this->get_key($template); + $this->template_data[$this->index][$key]['total_time'] += + microtime(true) - $this->template_data[$this->index][$key]['start_template_time']; + //$this->template_data[$this->index][$key]['properties'] = $template->properties; + } + + /** + * Start logging of compile time + * + * @param \Smarty_Internal_Template $template + */ + public function start_compile(Smarty_Internal_Template $template) + { + static $_is_stringy = array('string' => true, 'eval' => true); + if (!empty($template->compiler->trace_uid)) { + $key = $template->compiler->trace_uid; + if (!isset($this->template_data[$this->index][$key])) { + if (isset($_is_stringy[$template->source->type])) { + $this->template_data[$this->index][$key]['name'] = + '\'' . substr($template->source->name, 0, 25) . '...\''; + } else { + $this->template_data[$this->index][$key]['name'] = $template->source->filepath; + } + $this->template_data[$this->index][$key]['compile_time'] = 0; + $this->template_data[$this->index][$key]['render_time'] = 0; + $this->template_data[$this->index][$key]['cache_time'] = 0; + } + } else { + if (isset($this->ignore_uid[$template->source->uid])) { + return; + } + $key = $this->get_key($template); + } + $this->template_data[$this->index][$key]['start_time'] = microtime(true); + } + + /** + * End logging of compile time + * + * @param \Smarty_Internal_Template $template + */ + public function end_compile(Smarty_Internal_Template $template) + { + if (!empty($template->compiler->trace_uid)) { + $key = $template->compiler->trace_uid; + } else { + if (isset($this->ignore_uid[$template->source->uid])) { + return; + } + + $key = $this->get_key($template); + } + $this->template_data[$this->index][$key]['compile_time'] += + microtime(true) - $this->template_data[$this->index][$key]['start_time']; + } + + /** + * Start logging of render time + * + * @param \Smarty_Internal_Template $template + */ + public function start_render(Smarty_Internal_Template $template) + { + $key = $this->get_key($template); + $this->template_data[$this->index][$key]['start_time'] = microtime(true); + } + + /** + * End logging of compile time + * + * @param \Smarty_Internal_Template $template + */ + public function end_render(Smarty_Internal_Template $template) + { + $key = $this->get_key($template); + $this->template_data[$this->index][$key]['render_time'] += + microtime(true) - $this->template_data[$this->index][$key]['start_time']; + } + + /** + * Start logging of cache time + * + * @param \Smarty_Internal_Template $template cached template + */ + public function start_cache(Smarty_Internal_Template $template) + { + $key = $this->get_key($template); + $this->template_data[$this->index][$key]['start_time'] = microtime(true); + } + + /** + * End logging of cache time + * + * @param \Smarty_Internal_Template $template cached template + */ + public function end_cache(Smarty_Internal_Template $template) + { + $key = $this->get_key($template); + $this->template_data[$this->index][$key]['cache_time'] += + microtime(true) - $this->template_data[$this->index][$key]['start_time']; + } + + /** + * Register template object + * + * @param \Smarty_Internal_Template $template cached template + */ + public function register_template(Smarty_Internal_Template $template) + { + } + + /** + * Register data object + * + * @param \Smarty_Data $data data object + */ + public static function register_data(Smarty_Data $data) + { + } + + /** + * Opens a window for the Smarty Debugging Console and display the data + * + * @param Smarty_Internal_Template|Smarty $obj object to debug + * @param bool $full + */ + public function display_debug($obj, $full = false) + { + if (!$full) { + $this->offset ++; + $savedIndex = $this->index; + $this->index = 9999; + } + if ($obj->_objType == 1) { + $smarty = $obj; + } else { + $smarty = $obj->smarty; + } + // create fresh instance of smarty for displaying the debug console + // to avoid problems if the application did overload the Smarty class + $debObj = new Smarty(); + // copy the working dirs from application + $debObj->setCompileDir($smarty->getCompileDir()); + // init properties by hand as user may have edited the original Smarty class + $debObj->setPluginsDir(is_dir(__DIR__ . '/../plugins') ? __DIR__ . '/../plugins' : $smarty->getPluginsDir()); + $debObj->force_compile = false; + $debObj->compile_check = true; + $debObj->left_delimiter = '{'; + $debObj->right_delimiter = '}'; + $debObj->security_policy = null; + $debObj->debugging = false; + $debObj->debugging_ctrl = 'NONE'; + $debObj->error_reporting = E_ALL & ~E_NOTICE; + $debObj->debug_tpl = isset($smarty->debug_tpl) ? $smarty->debug_tpl : 'file:' . __DIR__ . '/../debug.tpl'; + $debObj->registered_plugins = array(); + $debObj->registered_resources = array(); + $debObj->registered_filters = array(); + $debObj->autoload_filters = array(); + $debObj->default_modifiers = array(); + $debObj->escape_html = true; + $debObj->caching = false; + $debObj->compile_id = null; + $debObj->cache_id = null; + // prepare information of assigned variables + $ptr = $this->get_debug_vars($obj); + $_assigned_vars = $ptr->tpl_vars; + ksort($_assigned_vars); + $_config_vars = $ptr->config_vars; + ksort($_config_vars); + $debugging = $smarty->debugging; + + $_template = new Smarty_Internal_Template($debObj->debug_tpl, $debObj); + if ($obj->_objType == 2) { + $_template->assign('template_name', $obj->source->type . ':' . $obj->source->name); + } + if ($obj->_objType == 1 || $full) { + $_template->assign('template_data', $this->template_data[$this->index]); + } else { + $_template->assign('template_data', null); + } + $_template->assign('assigned_vars', $_assigned_vars); + $_template->assign('config_vars', $_config_vars); + $_template->assign('execution_time', microtime(true) - $smarty->start_time); + $_template->assign('display_mode', $debugging == 2 || !$full); + $_template->assign('offset', $this->offset * 50); + echo $_template->fetch(); + if (isset($full)) { + $this->index --; + } + if (!$full) { + $this->index = $savedIndex; + } + } + + /** + * Recursively gets variables from all template/data scopes + * + * @param Smarty_Internal_Template|Smarty_Data $obj object to debug + * + * @return StdClass + */ + public function get_debug_vars($obj) + { + $config_vars = array(); + foreach ($obj->config_vars as $key => $var) { + $config_vars[$key]['value'] = $var; + if ($obj->_objType == 2) { + $config_vars[$key]['scope'] = $obj->source->type . ':' . $obj->source->name; + } elseif ($obj->_objType == 4) { + $tpl_vars[$key]['scope'] = $obj->dataObjectName; + } else { + $config_vars[$key]['scope'] = 'Smarty object'; + } + } + $tpl_vars = array(); + foreach ($obj->tpl_vars as $key => $var) { + foreach ($var as $varkey => $varvalue) { + if ($varkey == 'value') { + $tpl_vars[$key][$varkey] = $varvalue; + } else { + if ($varkey == 'nocache') { + if ($varvalue == true) { + $tpl_vars[$key][$varkey] = $varvalue; + } + } else { + if ($varkey != 'scope' || $varvalue !== 0) { + $tpl_vars[$key]['attributes'][$varkey] = $varvalue; + } + } + } + } + if ($obj->_objType == 2) { + $tpl_vars[$key]['scope'] = $obj->source->type . ':' . $obj->source->name; + } elseif ($obj->_objType == 4) { + $tpl_vars[$key]['scope'] = $obj->dataObjectName; + } else { + $tpl_vars[$key]['scope'] = 'Smarty object'; + } + } + + if (isset($obj->parent)) { + $parent = $this->get_debug_vars($obj->parent); + foreach ($parent->tpl_vars as $name => $pvar) { + if (isset($tpl_vars[$name]) && $tpl_vars[$name]['value'] === $pvar['value']) { + $tpl_vars[$name]['scope'] = $pvar['scope']; + } + } + $tpl_vars = array_merge($parent->tpl_vars, $tpl_vars); + + foreach ($parent->config_vars as $name => $pvar) { + if (isset($config_vars[$name]) && $config_vars[$name]['value'] === $pvar['value']) { + $config_vars[$name]['scope'] = $pvar['scope']; + } + } + $config_vars = array_merge($parent->config_vars, $config_vars); + } else { + foreach (Smarty::$global_tpl_vars as $key => $var) { + if (!array_key_exists($key, $tpl_vars)) { + foreach ($var as $varkey => $varvalue) { + if ($varkey == 'value') { + $tpl_vars[$key][$varkey] = $varvalue; + } else { + if ($varkey == 'nocache') { + if ($varvalue == true) { + $tpl_vars[$key][$varkey] = $varvalue; + } + } else { + if ($varkey != 'scope' || $varvalue !== 0) { + $tpl_vars[$key]['attributes'][$varkey] = $varvalue; + } + } + } + } + $tpl_vars[$key]['scope'] = 'Global'; + } + } + } + + return (object) array('tpl_vars' => $tpl_vars, 'config_vars' => $config_vars); + } + + /** + * Return key into $template_data for template + * + * @param \Smarty_Internal_Template $template template object + * + * @return string key into $template_data + */ + private function get_key(Smarty_Internal_Template $template) + { + static $_is_stringy = array('string' => true, 'eval' => true); + // calculate Uid if not already done + if ($template->source->uid == '') { + $template->source->filepath; + } + $key = $template->source->uid; + if (isset($this->template_data[$this->index][$key])) { + return $key; + } else { + if (isset($_is_stringy[$template->source->type])) { + $this->template_data[$this->index][$key]['name'] = + '\'' . substr($template->source->name, 0, 25) . '...\''; + } else { + $this->template_data[$this->index][$key]['name'] = $template->source->filepath; + } + $this->template_data[$this->index][$key]['compile_time'] = 0; + $this->template_data[$this->index][$key]['render_time'] = 0; + $this->template_data[$this->index][$key]['cache_time'] = 0; + $this->template_data[$this->index][$key]['total_time'] = 0; + + return $key; + } + } + + /** + * Ignore template + * + * @param \Smarty_Internal_Template $template + */ + public function ignore(Smarty_Internal_Template $template) + { + // calculate Uid if not already done + if ($template->source->uid == '') { + $template->source->filepath; + } + $this->ignore_uid[$template->source->uid] = true; + } + + /** + * handle 'URL' debugging mode + * + * @param Smarty $smarty + */ + public function debugUrl(Smarty $smarty) + { + if (isset($_SERVER['QUERY_STRING'])) { + $_query_string = $_SERVER['QUERY_STRING']; + } else { + $_query_string = ''; + } + if (false !== strpos($_query_string, $smarty->smarty_debug_id)) { + if (false !== strpos($_query_string, $smarty->smarty_debug_id . '=on')) { + // enable debugging for this browser session + setcookie('SMARTY_DEBUG', true); + $smarty->debugging = true; + } elseif (false !== strpos($_query_string, $smarty->smarty_debug_id . '=off')) { + // disable debugging for this browser session + setcookie('SMARTY_DEBUG', false); + $smarty->debugging = false; + } else { + // enable debugging for this page + $smarty->debugging = true; + } + } else { + if (isset($_COOKIE['SMARTY_DEBUG'])) { + $smarty->debugging = true; + } + } + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_extension_clear.php b/inc/libs/Smarty/sysplugins/smarty_internal_extension_clear.php new file mode 100755 index 0000000..00edc5a --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_extension_clear.php @@ -0,0 +1,126 @@ +clear() method file cache file resource + * + * @package Smarty + * @subpackage PluginsInternal + * @author Uwe Tews + */ +class Smarty_Internal_Extension_Clear +{ + /** + * Empty cache for a specific template + * + * @param Smarty $smarty + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time (number of seconds, not timestamp) + * + * @return integer number of cache files deleted + */ + public static function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time) + { + $_cache_id = isset($cache_id) ? preg_replace('![^\w\|]+!', '_', $cache_id) : null; + $_compile_id = isset($compile_id) ? preg_replace('![^\w]+!', '_', $compile_id) : null; + $_dir_sep = $smarty->use_sub_dirs ? '/' : '^'; + $_compile_id_offset = $smarty->use_sub_dirs ? 3 : 0; + $_dir = $smarty->getCacheDir(); + if ($_dir == '/') { //We should never want to delete this! + return 0; + } + $_dir_length = strlen($_dir); + if (isset($_cache_id)) { + $_cache_id_parts = explode('|', $_cache_id); + $_cache_id_parts_count = count($_cache_id_parts); + if ($smarty->use_sub_dirs) { + foreach ($_cache_id_parts as $id_part) { + $_dir .= $id_part . DS; + } + } + } + if (isset($resource_name)) { + $_save_stat = $smarty->caching; + $smarty->caching = true; + $tpl = new $smarty->template_class($resource_name, $smarty); + $smarty->caching = $_save_stat; + + // remove from template cache + $tpl->source; // have the template registered before unset() + + if ($tpl->source->exists) { + $_resourcename_parts = basename(str_replace('^', '/', $tpl->cached->filepath)); + } else { + return 0; + } + } + $_count = 0; + $_time = time(); + if (file_exists($_dir)) { + $_cacheDirs = new RecursiveDirectoryIterator($_dir); + $_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST); + foreach ($_cache as $_file) { + if (substr(basename($_file->getPathname()), 0, 1) == '.' || strpos($_file, '.svn') !== false) { + continue; + } + // directory ? + if ($_file->isDir()) { + if (!$_cache->isDot()) { + // delete folder if empty + @rmdir($_file->getPathname()); + } + } else { + $_parts = explode($_dir_sep, str_replace('\\', '/', substr((string) $_file, $_dir_length))); + $_parts_count = count($_parts); + // check name + if (isset($resource_name)) { + if ($_parts[$_parts_count - 1] != $_resourcename_parts) { + continue; + } + } + // check compile id + if (isset($_compile_id) && (!isset($_parts[$_parts_count - 2 - $_compile_id_offset]) || + $_parts[$_parts_count - 2 - $_compile_id_offset] != $_compile_id) + ) { + continue; + } + // check cache id + if (isset($_cache_id)) { + // count of cache id parts + $_parts_count = (isset($_compile_id)) ? $_parts_count - 2 - $_compile_id_offset : + $_parts_count - 1 - $_compile_id_offset; + if ($_parts_count < $_cache_id_parts_count) { + continue; + } + for ($i = 0; $i < $_cache_id_parts_count; $i ++) { + if ($_parts[$i] != $_cache_id_parts[$i]) { + continue 2; + } + } + } + // expired ? + if (isset($exp_time)) { + if ($exp_time < 0) { + preg_match('#\'cache_lifetime\' =>\s*(\d*)#', file_get_contents($_file), $match); + if ($_time < (@filemtime($_file) + $match[1])) { + continue; + } + } else { + if ($_time - @filemtime($_file) < $exp_time) { + continue; + } + } + } + $_count += @unlink((string) $_file) ? 1 : 0; + if (function_exists('opcache_invalidate')) { + opcache_invalidate((string) $_file); + } + } + } + } + return $_count; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_extension_handler.php b/inc/libs/Smarty/sysplugins/smarty_internal_extension_handler.php new file mode 100755 index 0000000..68012d8 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_extension_handler.php @@ -0,0 +1,157 @@ + 0, 'DefaultModifiers' => 0, 'ConfigVars' => 0, + 'DebugTemplate' => 0, 'RegisteredObject' => 0, 'StreamVariable' => 0, + 'TemplateVars' => 0,);# + + private $resolvedProperties = array(); + + /** + * Call external Method + * + * @param \Smarty_Internal_Data $data + * @param string $name external method names + * @param array $args argument array + * + * @return mixed + * @throws SmartyException + */ + public function _callExternalMethod(Smarty_Internal_Data $data, $name, $args) + { + /* @var Smarty $data ->smarty */ + $smarty = isset($data->smarty) ? $data->smarty : $data; + if (!isset($smarty->ext->$name)) { + $class = 'Smarty_Internal_Method_' . ucfirst($name); + if (preg_match('/^(set|get)([A-Z].*)$/', $name, $match)) { + if (!isset($this->_property_info[$prop = $match[2]])) { + // convert camel case to underscored name + $this->resolvedProperties[$prop] = $pn = strtolower(join('_', + preg_split('/([A-Z][^A-Z]*)/', $prop, - 1, + PREG_SPLIT_NO_EMPTY | + PREG_SPLIT_DELIM_CAPTURE))); + $this->_property_info[$prop] = property_exists($data, $pn) ? 1 : + ($data->_objType == 2 && property_exists($smarty, $pn) ? 2 : 0); + } + if ($this->_property_info[$prop]) { + $pn = $this->resolvedProperties[$prop]; + if ($match[1] == 'get') { + return $this->_property_info[$prop] == 1 ? $data->$pn : $data->smarty->$pn; + } else { + return $this->_property_info[$prop] == 1 ? $data->$pn = $args[0] : + $data->smarty->$pn = $args[0]; + } + } elseif (!class_exists($class)) { + throw new SmartyException("property '$pn' does not exist."); + } + } + if (class_exists($class)) { + $callback = array($smarty->ext->$name = new $class(), $name); + } + } else { + $callback = array($smarty->ext->$name, $name); + } + array_unshift($args, $data); + if (isset($callback) && $callback[0]->objMap | $data->_objType) { + return call_user_func_array($callback, $args); + } + return call_user_func_array(array(new Smarty_Internal_Undefined(), $name), $args); + } + + /** + * set extension property + * + * @param string $property_name property name + * @param mixed $value value + * + * @throws SmartyException + */ + public function __set($property_name, $value) + { + $this->$property_name = $value; + } + + /** + * get extension object + * + * @param string $property_name property name + * + * @return mixed|Smarty_Template_Cached + * @throws SmartyException + */ + public function __get($property_name) + { + // object properties of runtime template extensions will start with '_' + if ($property_name[0] == '_') { + $class = 'Smarty_Internal_Runtime_' . ucfirst(substr($property_name, 1)); + } else { + $class = 'Smarty_Internal_Method_' . ucfirst($property_name); + } + if (class_exists($class)) { + return $this->$property_name = new $class(); + } + return $this; + } + + /** + * Call error handler for undefined method + * + * @param string $name unknown method-name + * @param array $args argument array + * + * @return mixed + * @throws SmartyException + */ + public function __call($name, $args) + { + return call_user_func_array(array(new Smarty_Internal_Undefined(), $name), $args); + } + +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_addautoloadfilters.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_addautoloadfilters.php new file mode 100755 index 0000000..b739f0e --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_addautoloadfilters.php @@ -0,0 +1,51 @@ +smarty) ? $obj->smarty : $obj; + if ($type !== null) { + $this->_checkFilterType($type); + if (!empty($smarty->autoload_filters[$type])) { + $smarty->autoload_filters[$type] = array_merge($smarty->autoload_filters[$type], (array) $filters); + } else { + $smarty->autoload_filters[$type] = (array) $filters; + } + } else { + foreach ((array) $filters as $type => $value) { + $this->_checkFilterType($type); + if (!empty($smarty->autoload_filters[$type])) { + $smarty->autoload_filters[$type] = array_merge($smarty->autoload_filters[$type], (array) $value); + } else { + $smarty->autoload_filters[$type] = (array) $value; + } + } + } + return $obj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_adddefaultmodifiers.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_adddefaultmodifiers.php new file mode 100755 index 0000000..55d2c9e --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_adddefaultmodifiers.php @@ -0,0 +1,42 @@ +smarty) ? $obj->smarty : $obj; + if (is_array($modifiers)) { + $this->default_modifiers = array_merge($smarty->default_modifiers, $modifiers); + } else { + $smarty->default_modifiers[] = $modifiers; + } + return $obj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_append.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_append.php new file mode 100755 index 0000000..43df880 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_append.php @@ -0,0 +1,74 @@ + $_val) { + if ($_key != '') { + $this->append($data, $_key, $_val, $merge, $nocache); + } + } + } else { + if ($tpl_var != '' && isset($value)) { + if (!isset($data->tpl_vars[$tpl_var])) { + $tpl_var_inst = $data->ext->getTemplateVars->_getVariable($data, $tpl_var, null, true, false); + if ($tpl_var_inst instanceof Smarty_Undefined_Variable) { + $data->tpl_vars[$tpl_var] = new Smarty_Variable(null, $nocache); + } else { + $data->tpl_vars[$tpl_var] = clone $tpl_var_inst; + } + } + if (!(is_array($data->tpl_vars[$tpl_var]->value) || + $data->tpl_vars[$tpl_var]->value instanceof ArrayAccess) + ) { + settype($data->tpl_vars[$tpl_var]->value, 'array'); + } + if ($merge && is_array($value)) { + foreach ($value as $_mkey => $_mval) { + $data->tpl_vars[$tpl_var]->value[$_mkey] = $_mval; + } + } else { + $data->tpl_vars[$tpl_var]->value[] = $value; + } + } + if ($data->_objType == 2 && $data->scope) { + $data->ext->_updateScope->updateScope($data, $tpl_var); + } + } + return $data; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_appendbyref.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_appendbyref.php new file mode 100755 index 0000000..124bb80 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_appendbyref.php @@ -0,0 +1,50 @@ +tpl_vars[$tpl_var])) { + $data->tpl_vars[$tpl_var] = new Smarty_Variable(); + } + if (!is_array($data->tpl_vars[$tpl_var]->value)) { + settype($data->tpl_vars[$tpl_var]->value, 'array'); + } + if ($merge && is_array($value)) { + foreach ($value as $_key => $_val) { + $data->tpl_vars[$tpl_var]->value[$_key] = &$value[$_key]; + } + } else { + $data->tpl_vars[$tpl_var]->value[] = &$value; + } + if ($data->_objType == 2 && $data->scope) { + $data->ext->_updateScope->updateScope($data, $tpl_var); + } + } + return $data; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_assignbyref.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_assignbyref.php new file mode 100755 index 0000000..a97125e --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_assignbyref.php @@ -0,0 +1,36 @@ +tpl_vars[$tpl_var] = new Smarty_Variable(null, $nocache); + $data->tpl_vars[$tpl_var]->value = &$value; + if ($data->_objType == 2 && $data->scope) { + $data->ext->_updateScope->updateScope($data, $tpl_var); + } + } + return $data; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_assignglobal.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_assignglobal.php new file mode 100755 index 0000000..23b13b3 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_assignglobal.php @@ -0,0 +1,43 @@ +_objType == 2) { + $ptr->tpl_vars[$varName] = clone Smarty::$global_tpl_vars[$varName]; + $ptr = $ptr->parent; + } + } + return $data; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_clearallassign.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_clearallassign.php new file mode 100755 index 0000000..1e5fec4 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_clearallassign.php @@ -0,0 +1,37 @@ +tpl_vars = array(); + + return $data; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_clearallcache.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_clearallcache.php new file mode 100755 index 0000000..6ae0af1 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_clearallcache.php @@ -0,0 +1,40 @@ +invalidLoadedCache($smarty); + return $_cache_resource->clearAll($smarty, $exp_time); + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_clearassign.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_clearassign.php new file mode 100755 index 0000000..3a7bd1e --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_clearassign.php @@ -0,0 +1,44 @@ +tpl_vars[$curr_var]); + } + } else { + unset($data->tpl_vars[$tpl_var]); + } + + return $data; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_clearcache.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_clearcache.php new file mode 100755 index 0000000..063c57c --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_clearcache.php @@ -0,0 +1,43 @@ +invalidLoadedCache($smarty); + return $_cache_resource->clear($smarty, $template_name, $cache_id, $compile_id, $exp_time); + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_clearcompiledtemplate.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_clearcompiledtemplate.php new file mode 100755 index 0000000..cce8553 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_clearcompiledtemplate.php @@ -0,0 +1,124 @@ +getCompileDir(); + if ($_compile_dir == '/') { //We should never want to delete this! + return 0; + } + $_compile_id = isset($compile_id) ? preg_replace('![^\w]+!', '_', $compile_id) : null; + $_dir_sep = $smarty->use_sub_dirs ? DS : '^'; + if (isset($resource_name)) { + $_save_stat = $smarty->caching; + $smarty->caching = false; + /* @var Smarty_Internal_Template $tpl */ + $tpl = new $smarty->template_class($resource_name, $smarty); + $smarty->caching = $_save_stat; + if ($tpl->source->exists) { + // remove from compileds cache + $tpl->source->compileds = array(); + $_resource_part_1 = basename(str_replace('^', DS, $tpl->compiled->filepath)); + $_resource_part_1_length = strlen($_resource_part_1); + } else { + return 0; + } + $_resource_part_2 = str_replace('.php', '.cache.php', $_resource_part_1); + $_resource_part_2_length = strlen($_resource_part_2); + } + $_dir = $_compile_dir; + if ($smarty->use_sub_dirs && isset($_compile_id)) { + $_dir .= $_compile_id . $_dir_sep; + } + if (isset($_compile_id)) { + $_compile_id_part = $_compile_dir . $_compile_id . $_dir_sep; + $_compile_id_part_length = strlen($_compile_id_part); + } + $_count = 0; + try { + $_compileDirs = new RecursiveDirectoryIterator($_dir); + // NOTE: UnexpectedValueException thrown for PHP >= 5.3 + } + catch (Exception $e) { + return 0; + } + $_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST); + foreach ($_compile as $_file) { + if (substr(basename($_file->getPathname()), 0, 1) == '.' || strpos($_file, '.svn') !== false) { + continue; + } + + $_filepath = (string) $_file; + + if ($_file->isDir()) { + if (!$_compile->isDot()) { + // delete folder if empty + @rmdir($_file->getPathname()); + } + } else { + $unlink = false; + if ((!isset($_compile_id) || (isset($_filepath[$_compile_id_part_length]) && + $a = !strncmp($_filepath, $_compile_id_part, $_compile_id_part_length))) && + (!isset($resource_name) || (isset($_filepath[$_resource_part_1_length]) && + substr_compare($_filepath, $_resource_part_1, - $_resource_part_1_length, + $_resource_part_1_length) == 0) || + (isset($_filepath[$_resource_part_2_length]) && + substr_compare($_filepath, $_resource_part_2, - $_resource_part_2_length, + $_resource_part_2_length) == 0)) + ) { + if (isset($exp_time)) { + if (time() - @filemtime($_filepath) >= $exp_time) { + $unlink = true; + } + } else { + $unlink = true; + } + } + + if ($unlink && @unlink($_filepath)) { + $_count ++; + if (function_exists('opcache_invalidate')) { + opcache_invalidate($_filepath); + } + } + } + } + // clear template objects cache + $smarty->_cache['isCached'] = array(); + if (isset($smarty->ext->_subtemplate)) { + $smarty->ext->_subtemplate->tplObjects = array(); + } + return $_count; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_clearconfig.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_clearconfig.php new file mode 100755 index 0000000..9c6167f --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_clearconfig.php @@ -0,0 +1,41 @@ +config_vars[$name]); + } else { + $data->config_vars = array(); + } + return $data; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_compileallconfig.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_compileallconfig.php new file mode 100755 index 0000000..4d6be65 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_compileallconfig.php @@ -0,0 +1,32 @@ +compileAll($smarty, $extension, $force_compile, $time_limit, $max_errors, true); + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_compilealltemplates.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_compilealltemplates.php new file mode 100755 index 0000000..685fc0c --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_compilealltemplates.php @@ -0,0 +1,111 @@ +compileAll($smarty, $extension, $force_compile, $time_limit, $max_errors); + } + + /** + * Compile all template or config files + * + * @param \Smarty $smarty + * @param string $extension template file name extension + * @param bool $force_compile force all to recompile + * @param int $time_limit set maximum execution time + * @param int $max_errors set maximum allowed errors + * @param bool $isConfig flag true if called for config files + * + * @return int number of template files compiled + */ + protected function compileAll(Smarty $smarty, $extension, $force_compile, $time_limit, $max_errors, $isConfig = false) + { + // switch off time limit + if (function_exists('set_time_limit')) { + @set_time_limit($time_limit); + } + $_count = 0; + $_error_count = 0; + $sourceDir = $isConfig ? $smarty->getConfigDir() : $smarty->getTemplateDir(); + // loop over array of source directories + foreach ($sourceDir as $_dir) { + $_dir_1 = new RecursiveDirectoryIterator($_dir); + $_dir_2 = new RecursiveIteratorIterator($_dir_1); + foreach ($_dir_2 as $_fileinfo) { + $_file = $_fileinfo->getFilename(); + if (substr(basename($_fileinfo->getPathname()), 0, 1) == '.' || strpos($_file, '.svn') !== false) { + continue; + } + if (!substr_compare($_file, $extension, - strlen($extension)) == 0) { + continue; + } + if ($_fileinfo->getPath() == !substr($_dir, 0, - 1)) { + $_file = substr($_fileinfo->getPath(), strlen($_dir)) . DS . $_file; + } + echo "\n
    ", $_dir, '---', $_file; + flush(); + $_start_time = microtime(true); + $_smarty = clone $smarty; + $_smarty->force_compile = $force_compile; + try { + /* @var Smarty_Internal_Template $_tpl */ + $_tpl = new $smarty->template_class($_file, $_smarty); + $_tpl->caching = Smarty::CACHING_OFF; + $_tpl->source = $isConfig ? Smarty_Template_Config::load($_tpl) : Smarty_Template_Source::load($_tpl); + if ($_tpl->mustCompile()) { + $_tpl->compileTemplateSource(); + $_count ++; + echo ' compiled in ', microtime(true) - $_start_time, ' seconds'; + flush(); + } else { + echo ' is up to date'; + flush(); + } + } + catch (Exception $e) { + echo "\n
    ------>Error: ", $e->getMessage(), "

    \n"; + $_error_count ++; + } + // free memory + unset($_tpl); + $_smarty->_cache['template_objects'] = array(); + if ($max_errors !== null && $_error_count == $max_errors) { + echo "\n

    too many errors\n"; + exit(); + } + } + } + echo "\n
    "; + return $_count; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_configload.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_configload.php new file mode 100755 index 0000000..7b99e35 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_configload.php @@ -0,0 +1,182 @@ +_loadConfigFile($data, $config_file, $sections, 0); + return $data; + } + + /** + * load a config file, optionally load just selected sections + * + * @api Smarty::configLoad() + * @link http://www.smarty.net/docs/en/api.config.load.tpl + * + * @param \Smarty|\Smarty_Internal_Data|\Smarty_Internal_Template $data + * @param string $config_file filename + * @param mixed $sections array of section names, single + * section or null + * @param int $scope scope into which config variables + * shall be loaded + * + * @return \Smarty|\Smarty_Internal_Data|\Smarty_Internal_Template + * @throws \SmartyException + */ + public function _loadConfigFile(Smarty_Internal_Data $data, $config_file, $sections = null, $scope = 0) + { + /* @var \Smarty $smarty */ + $smarty = isset($data->smarty) ? $data->smarty : $data; + /* @var \Smarty_Internal_Template $confObj */ + $confObj = new Smarty_Internal_Template($config_file, $smarty, $data); + $confObj->caching = Smarty::CACHING_OFF; + $confObj->source = Smarty_Template_Config::load($confObj); + $confObj->source->config_sections = $sections; + $confObj->source->scope = $scope; + $confObj->compiled = Smarty_Template_Compiled::load($confObj); + $confObj->compiled->render($confObj); + if ($data->_objType == 2) { + $data->compiled->file_dependency[$confObj->source->uid] = + array($confObj->source->filepath, $confObj->source->getTimeStamp(), $confObj->source->type); + } + } + + /** + * load config variables into template object + * + * @param \Smarty_Internal_Template $tpl + * @param array $_config_vars + * + */ + public function _loadConfigVars(Smarty_Internal_Template $tpl, $_config_vars) + { + $this->_assignConfigVars($tpl->parent, $tpl, $_config_vars); + $scope = $tpl->source->scope; + if (!$scope && !$tpl->scope) { + return; + } + foreach (array($scope, $tpl->scope) as $s) { + $s = ($bubble_up = $s >= Smarty::SCOPE_BUBBLE_UP) ? $s - Smarty::SCOPE_BUBBLE_UP : $s; + if ($bubble_up && $s) { + $ptr = $tpl->parent->parent; + if (isset($ptr)) { + $this->_assignConfigVars($ptr, $tpl, $_config_vars); + $ptr = $ptr->parent; + } + if ($s == Smarty::SCOPE_PARENT) { + continue; + } + while (isset($ptr) && $ptr->_objType == 2) { + $this->_assignConfigVars($ptr, $tpl, $_config_vars); + $ptr = $ptr->parent; + } + if ($s == Smarty::SCOPE_TPL_ROOT) { + continue; + } elseif ($s == Smarty::SCOPE_SMARTY) { + $this->_assignConfigVars($tpl->smarty, $tpl, $_config_vars); + } elseif ($s == Smarty::SCOPE_GLOBAL) { + $this->_assignConfigVars($tpl->smarty, $tpl, $_config_vars); + } elseif ($s == Smarty::SCOPE_ROOT) { + while (isset($ptr->parent)) { + $ptr = $ptr->parent; + } + $this->_assignConfigVars($ptr, $tpl, $_config_vars); + } + } + } + } + + /** + * Assign all config variables in given scope + * + * @param \Smarty_Internal_Data $scope_ptr + * @param \Smarty_Internal_Template $tpl + * @param array $_config_vars + */ + public function _assignConfigVars(Smarty_Internal_Data $scope_ptr, Smarty_Internal_Template $tpl, $_config_vars) + { + // copy global config vars + foreach ($_config_vars['vars'] as $variable => $value) { + if ($tpl->smarty->config_overwrite || !isset($scope_ptr->config_vars[$variable])) { + $scope_ptr->config_vars[$variable] = $value; + } else { + $scope_ptr->config_vars[$variable] = + array_merge((array) $scope_ptr->config_vars[$variable], (array) $value); + } + } + // scan sections + $sections = $tpl->source->config_sections; + if (!empty($sections)) { + foreach ((array) $sections as $tpl_section) { + if (isset($_config_vars['sections'][$tpl_section])) { + foreach ($_config_vars['sections'][$tpl_section]['vars'] as $variable => $value) { + if ($tpl->smarty->config_overwrite || !isset($scope_ptr->config_vars[$variable])) { + $scope_ptr->config_vars[$variable] = $value; + } else { + $scope_ptr->config_vars[$variable] = + array_merge((array) $scope_ptr->config_vars[$variable], (array) $value); + } + } + } + } + } + } + + /** + * gets a config variable value + * + * @param \Smarty_Internal_Template $tpl template object + * @param string $varName the name of the config variable + * @param bool $errorEnable + * + * @return mixed the value of the config variable + */ + public function _getConfigVariable(Smarty_Internal_Template $tpl, $varName, $errorEnable = true) + { + $_ptr = $tpl; + while ($_ptr !== null) { + if (isset($_ptr->config_vars[$varName])) { + // found it, return it + return $_ptr->config_vars[$varName]; + } + // not found, try at parent + $_ptr = $_ptr->parent; + } + if ($tpl->smarty->error_unassigned && $errorEnable) { + // force a notice + $x = $$varName; + } + return null; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_createdata.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_createdata.php new file mode 100755 index 0000000..600bc77 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_createdata.php @@ -0,0 +1,44 @@ +smarty) ? $this->smarty : $obj; + $dataObj = new Smarty_Data($parent, $smarty, $name); + if ($smarty->debugging) { + Smarty_Internal_Debug::register_data($dataObj); + } + return $dataObj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_getautoloadfilters.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_getautoloadfilters.php new file mode 100755 index 0000000..e1a7801 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_getautoloadfilters.php @@ -0,0 +1,37 @@ + array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type + * was specified + */ + public function getAutoloadFilters(Smarty_Internal_TemplateBase $obj, $type = null) + { + $smarty = isset($obj->smarty) ? $obj->smarty : $obj; + if ($type !== null) { + $this->_checkFilterType($type); + return isset($smarty->autoload_filters[$type]) ? $smarty->autoload_filters[$type] : array(); + } + return $smarty->autoload_filters; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_getconfigvars.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_getconfigvars.php new file mode 100755 index 0000000..b156721 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_getconfigvars.php @@ -0,0 +1,58 @@ +config_vars[$varname])) { + return $_ptr->config_vars[$varname]; + } + } else { + $var_array = array_merge($_ptr->config_vars, $var_array); + } + // not found, try at parent + if ($search_parents) { + $_ptr = $_ptr->parent; + } else { + $_ptr = null; + } + } + if (isset($varname)) { + return ''; + } else { + return $var_array; + } + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_getdebugtemplate.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_getdebugtemplate.php new file mode 100755 index 0000000..3c3432c --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_getdebugtemplate.php @@ -0,0 +1,35 @@ +smarty) ? $obj->smarty : $obj; + return $smarty->debug_tpl; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_getdefaultmodifiers.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_getdefaultmodifiers.php new file mode 100755 index 0000000..32e0cc4 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_getdefaultmodifiers.php @@ -0,0 +1,35 @@ +smarty) ? $obj->smarty : $obj; + return $smarty->default_modifiers; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_getregisteredobject.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_getregisteredobject.php new file mode 100755 index 0000000..be0c0db --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_getregisteredobject.php @@ -0,0 +1,44 @@ +smarty) ? $obj->smarty : $obj; + if (!isset($smarty->registered_objects[$object_name])) { + throw new SmartyException("'$object_name' is not a registered object"); + } + if (!is_object($smarty->registered_objects[$object_name][0])) { + throw new SmartyException("registered '$object_name' is not an object"); + } + return $smarty->registered_objects[$object_name][0]; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_getstreamvariable.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_getstreamvariable.php new file mode 100755 index 0000000..b922fd0 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_getstreamvariable.php @@ -0,0 +1,51 @@ +smarty) ? $data->smarty : $data; + if ($smarty->error_unassigned) { + throw new SmartyException('Undefined stream variable "' . $variable . '"'); + } else { + return null; + } + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_gettags.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_gettags.php new file mode 100755 index 0000000..dd9e8d1 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_gettags.php @@ -0,0 +1,62 @@ +smarty) ? $this->smarty : $obj; + if ($obj->_objType == 2 && !isset($template)) { + $tpl = clone $obj; + } elseif (isset($template) && $template->_objType == 2) { + $tpl = clone $template; + } elseif (isset($template) && is_string($template)) { + /* @var Smarty_Internal_Template $tpl */ + $tpl = new $smarty->template_class($template, $smarty); + // checks if template exists + if (!$tpl->source->exists) { + throw new SmartyException("Unable to load template {$tpl->source->type} '{$tpl->source->name}'"); + } + } + if (isset($tpl)) { + $tpl->smarty = clone $tpl->smarty; + $tpl->smarty->_cache['get_used_tags'] = true; + $tpl->_cache['used_tags'] = array(); + $tpl->smarty->merge_compiled_includes = false; + $tpl->smarty->disableSecurity(); + $tpl->caching = false; + $tpl->loadCompiler(); + $tpl->compiler->compileTemplate($tpl); + return $tpl->_cache['used_tags']; + } + throw new SmartyException("Missing template specification"); + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_gettemplatevars.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_gettemplatevars.php new file mode 100755 index 0000000..235bece --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_gettemplatevars.php @@ -0,0 +1,114 @@ +_getVariable($data, $varName, $_ptr, $searchParents, false); + if (is_object($_var)) { + return $_var->value; + } else { + return null; + } + } else { + $_result = array(); + if ($_ptr === null) { + $_ptr = $data; + } + while ($_ptr !== null) { + foreach ($_ptr->tpl_vars AS $key => $var) { + if (!array_key_exists($key, $_result)) { + $_result[$key] = $var->value; + } + } + // not found, try at parent + if ($searchParents) { + $_ptr = $_ptr->parent; + } else { + $_ptr = null; + } + } + if ($searchParents && isset(Smarty::$global_tpl_vars)) { + foreach (Smarty::$global_tpl_vars AS $key => $var) { + if (!array_key_exists($key, $_result)) { + $_result[$key] = $var->value; + } + } + } + return $_result; + } + } + + /** + * gets the object of a Smarty variable + * + * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data + * @param string $varName the name of the Smarty variable + * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $_ptr optional pointer to data object + * @param bool $searchParents search also in parent data + * @param bool $errorEnable + * + * @return \Smarty_Variable + */ + public function _getVariable(Smarty_Internal_Data $data, $varName, Smarty_Internal_Data $_ptr = null, $searchParents = true, $errorEnable = true) + { + if ($_ptr === null) { + $_ptr = $data; + } + while ($_ptr !== null) { + if (isset($_ptr->tpl_vars[$varName])) { + // found it, return it + return $_ptr->tpl_vars[$varName]; + } + // not found, try at parent + if ($searchParents) { + $_ptr = $_ptr->parent; + } else { + $_ptr = null; + } + } + if (isset(Smarty::$global_tpl_vars[$varName])) { + // found it, return it + return Smarty::$global_tpl_vars[$varName]; + } + /* @var \Smarty $smarty */ + $smarty = isset($data->smarty) ? $data->smarty : $data; + if ($smarty->error_unassigned && $errorEnable) { + // force a notice + $x = $$varName; + } + + return new Smarty_Undefined_Variable; + } + +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_loadfilter.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_loadfilter.php new file mode 100755 index 0000000..7fb1117 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_loadfilter.php @@ -0,0 +1,77 @@ + true, 'post' => true, 'output' => true, 'variable' => true); + + /** + * load a filter of specified type and name + * + * @api Smarty::loadFilter() + * + * @link http://www.smarty.net/docs/en/api.load.filter.tpl + * + * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj + * @param string $type filter type + * @param string $name filter name + * + * @return bool + * @throws SmartyException if filter could not be loaded + */ + public function loadFilter(Smarty_Internal_TemplateBase $obj, $type, $name) + { + $smarty = isset($obj->smarty) ? $obj->smarty : $obj; + $this->_checkFilterType($type); + $_plugin = "smarty_{$type}filter_{$name}"; + $_filter_name = $_plugin; + if (is_callable($_plugin)) { + $smarty->registered_filters[$type][$_filter_name] = $_plugin; + return true; + } + if ($smarty->loadPlugin($_plugin)) { + if (class_exists($_plugin, false)) { + $_plugin = array($_plugin, 'execute'); + } + if (is_callable($_plugin)) { + $smarty->registered_filters[$type][$_filter_name] = $_plugin; + return true; + } + } + throw new SmartyException("{$type}filter \"{$name}\" not found or callable"); + } + + /** + * Check if filter type is valid + * + * @param string $type + * + * @throws \SmartyException + */ + public function _checkFilterType($type) + { + if (!isset($this->filterTypes[$type])) { + throw new SmartyException("Illegal filter type \"{$type}\""); + } + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_loadplugin.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_loadplugin.php new file mode 100755 index 0000000..c153f55 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_loadplugin.php @@ -0,0 +1,111 @@ +loadPlugin() method + * + * @package Smarty + * @subpackage PluginsInternal + * @author Uwe Tews + */ +class Smarty_Internal_Method_LoadPlugin +{ + /** + * Cache of searched plugin files + * + * @var array + */ + public $plugin_files = array(); + + /** + * Takes unknown classes and loads plugin files for them + * class name format: Smarty_PluginType_PluginName + * plugin filename format: plugintype.pluginname.php + * + * @param \Smarty $smarty + * @param string $plugin_name class plugin name to load + * @param bool $check check if already loaded + * + * @return bool|string + * @throws \SmartyException + */ + public function loadPlugin(Smarty $smarty, $plugin_name, $check) + { + // if function or class exists, exit silently (already loaded) + if ($check && (is_callable($plugin_name) || class_exists($plugin_name, false))) { + return true; + } + if (!preg_match('#^smarty_((internal)|([^_]+))_(.+)$#i', $plugin_name, $match)) { + throw new SmartyException("plugin {$plugin_name} is not a valid name format"); + } + if (!empty($match[2])) { + $file = SMARTY_SYSPLUGINS_DIR . strtolower($plugin_name) . '.php'; + if (isset($this->plugin_files[$file])) { + if ($this->plugin_files[$file] !== false) { + return $this->plugin_files[$file]; + } else { + return false; + } + } else { + if (is_file($file)) { + $this->plugin_files[$file] = $file; + require_once($file); + return $file; + } else { + $this->plugin_files[$file] = false; + return false; + } + } + } + // plugin filename is expected to be: [type].[name].php + $_plugin_filename = "{$match[1]}.{$match[4]}.php"; + $_lower_filename = strtolower($_plugin_filename); + if (isset($this->plugin_files)) { + if (isset($this->plugin_files['plugins_dir'][$_lower_filename])) { + if (!$smarty->use_include_path || $this->plugin_files['plugins_dir'][$_lower_filename] !== false) { + return $this->plugin_files['plugins_dir'][$_lower_filename]; + } + } + if (!$smarty->use_include_path || $smarty->ext->_getIncludePath->isNewIncludePath($smarty)) { + unset($this->plugin_files['include_path']); + } else { + if (isset($this->plugin_files['include_path'][$_lower_filename])) { + return $this->plugin_files['include_path'][$_lower_filename]; + } + } + } + $_file_names = array($_plugin_filename); + if ($_lower_filename != $_plugin_filename) { + $_file_names[] = $_lower_filename; + } + $_p_dirs = $smarty->getPluginsDir(); + if (!isset($this->plugin_files['plugins_dir'][$_lower_filename])) { + // loop through plugin dirs and find the plugin + foreach ($_p_dirs as $_plugin_dir) { + foreach ($_file_names as $name) { + $file = $_plugin_dir . $name; + if (is_file($file)) { + $this->plugin_files['plugins_dir'][$_lower_filename] = $file; + require_once($file); + return $file; + } + $this->plugin_files['plugins_dir'][$_lower_filename] = false; + } + } + } + if ($smarty->use_include_path) { + foreach ($_file_names as $_file_name) { + // try PHP include_path + $file = $smarty->ext->_getIncludePath->getIncludePath($_p_dirs, $_file_name, $smarty); + $this->plugin_files['include_path'][$_lower_filename] = $file; + if ($file !== false) { + require_once($file); + return $file; + } + } + } + // no plugin loaded + return false; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_mustcompile.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_mustcompile.php new file mode 100755 index 0000000..f28a68e --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_mustcompile.php @@ -0,0 +1,49 @@ +source->exists) { + if (isset($_template->parent) && $_template->parent->_objType == 2) { + $parent_resource = " in '$_template->parent->template_resource}'"; + } else { + $parent_resource = ''; + } + throw new SmartyException("Unable to load template {$_template->source->type} '{$_template->source->name}'{$parent_resource}"); + } + if ($_template->mustCompile === null) { + $_template->mustCompile = (!$_template->source->handler->uncompiled && + ($_template->smarty->force_compile || $_template->source->handler->recompiled || !$_template->compiled->exists || + ($_template->smarty->compile_check && $_template->compiled->getTimeStamp() < $_template->source->getTimeStamp()))); + } + + return $_template->mustCompile; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_registercacheresource.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_registercacheresource.php new file mode 100755 index 0000000..55c5090 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_registercacheresource.php @@ -0,0 +1,39 @@ +smarty) ? $obj->smarty : $obj; + $smarty->registered_cache_resources[$name] = $resource_handler; + return $obj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_registerclass.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_registerclass.php new file mode 100755 index 0000000..d2e5e20 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_registerclass.php @@ -0,0 +1,46 @@ +smarty) ? $obj->smarty : $obj; + // test if exists + if (!class_exists($class_impl)) { + throw new SmartyException("Undefined class '$class_impl' in register template class"); + } + // register the class + $smarty->registered_classes[$class_name] = $class_impl; + return $obj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_registerdefaultconfighandler.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_registerdefaultconfighandler.php new file mode 100755 index 0000000..370aa38 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_registerdefaultconfighandler.php @@ -0,0 +1,42 @@ +smarty) ? $obj->smarty : $obj; + if (is_callable($callback)) { + $smarty->default_config_handler_func = $callback; + } else { + throw new SmartyException("Default config handler not callable"); + } + return $obj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_registerdefaultpluginhandler.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_registerdefaultpluginhandler.php new file mode 100755 index 0000000..80b801c --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_registerdefaultpluginhandler.php @@ -0,0 +1,43 @@ +smarty) ? $obj->smarty : $obj; + if (is_callable($callback)) { + $smarty->default_plugin_handler_func = $callback; + } else { + throw new SmartyException("Default plugin handler '$callback' not callable"); + } + return $obj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_registerdefaulttemplatehandler.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_registerdefaulttemplatehandler.php new file mode 100755 index 0000000..40979e7 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_registerdefaulttemplatehandler.php @@ -0,0 +1,72 @@ +smarty) ? $obj->smarty : $obj; + if (is_callable($callback)) { + $smarty->default_template_handler_func = $callback; + } else { + throw new SmartyException("Default template handler not callable"); + } + return $obj; + } + + /** + * get default content from template or config resource handler + * + * @param Smarty_Template_Source $source + */ + public static function _getDefaultTemplate(Smarty_Template_Source $source) + { + if ($source->isConfig) { + $default_handler = $source->smarty->default_config_handler_func; + } else { + $default_handler = $source->smarty->default_template_handler_func; + } + $_content = $_timestamp = null; + $_return = call_user_func_array($default_handler, array($source->type, $source->name, &$_content, &$_timestamp, + $source->smarty)); + if (is_string($_return)) { + $source->exists = is_file($_return); + if ($source->exists) { + $source->timestamp = filemtime($_return); + } + $source->filepath = $_return; + } elseif ($_return === true) { + $source->content = $_content; + $source->timestamp = $_timestamp; + $source->exists = true; + $source->handler->recompiled = true; + $source->filepath = false; + } + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_registerfilter.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_registerfilter.php new file mode 100755 index 0000000..84b2c26 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_registerfilter.php @@ -0,0 +1,88 @@ + true, 'post' => true, 'output' => true, 'variable' => true); + + /** + * Registers a filter function + * + * @api Smarty::registerFilter() + * + * @link http://www.smarty.net/docs/en/api.register.filter.tpl + * + * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj + * @param string $type filter type + * @param callback $callback + * @param string|null $name optional filter name + * + * @return \Smarty|\Smarty_Internal_Template + * @throws \SmartyException + */ + public function registerFilter(Smarty_Internal_TemplateBase $obj, $type, $callback, $name = null) + { + $smarty = isset($obj->smarty) ? $obj->smarty : $obj; + $this->_checkFilterType($type); + $name = isset($name) ? $name : $this->_getFilterName($callback); + if (!is_callable($callback)) { + throw new SmartyException("{$type}filter \"{$name}\" not callable"); + } + $smarty->registered_filters[$type][$name] = $callback; + return $obj; + } + + /** + * Return internal filter name + * + * @param callback $function_name + * + * @return string internal filter name + */ + public function _getFilterName($function_name) + { + if (is_array($function_name)) { + $_class_name = (is_object($function_name[0]) ? get_class($function_name[0]) : $function_name[0]); + + return $_class_name . '_' . $function_name[1]; + } elseif (is_string($function_name)) { + return $function_name; + } else { + return 'closure'; + } + } + + /** + * Check if filter type is valid + * + * @param string $type + * + * @throws \SmartyException + */ + public function _checkFilterType($type) + { + if (!isset($this->filterTypes[$type])) { + throw new SmartyException("Illegal filter type \"{$type}\""); + } + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_registerobject.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_registerobject.php new file mode 100755 index 0000000..f27f172 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_registerobject.php @@ -0,0 +1,71 @@ +smarty) ? $obj->smarty : $obj; + // test if allowed methods callable + if (!empty($allowed_methods_properties)) { + foreach ((array) $allowed_methods_properties as $method) { + if (!is_callable(array($object, $method)) && !property_exists($object, $method)) { + throw new SmartyException("Undefined method or property '$method' in registered object"); + } + } + } + // test if block methods callable + if (!empty($block_methods)) { + foreach ((array) $block_methods as $method) { + if (!is_callable(array($object, $method))) { + throw new SmartyException("Undefined method '$method' in registered object"); + } + } + } + // register the object + $smarty->registered_objects[$object_name] = array($object, (array) $allowed_methods_properties, + (boolean) $format, (array) $block_methods); + return $obj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_registerplugin.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_registerplugin.php new file mode 100755 index 0000000..9581458 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_registerplugin.php @@ -0,0 +1,50 @@ +smarty) ? $obj->smarty : $obj; + if (isset($smarty->registered_plugins[$type][$name])) { + throw new SmartyException("Plugin tag \"{$name}\" already registered"); + } elseif (!is_callable($callback)) { + throw new SmartyException("Plugin \"{$name}\" not callable"); + } else { + $smarty->registered_plugins[$type][$name] = array($callback, (bool) $cacheable, (array) $cache_attr); + } + return $obj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_registerresource.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_registerresource.php new file mode 100755 index 0000000..43246ee --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_registerresource.php @@ -0,0 +1,44 @@ +smarty) ? $obj->smarty : $obj; + $smarty->registered_resources[$name] = $resource_handler instanceof + Smarty_Resource ? $resource_handler : array($resource_handler, false); + return $obj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_setautoloadfilters.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_setautoloadfilters.php new file mode 100755 index 0000000..b1f965c --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_setautoloadfilters.php @@ -0,0 +1,70 @@ + true, 'post' => true, 'output' => true, 'variable' => true); + + /** + * Set autoload filters + * + * @api Smarty::setAutoloadFilters() + * + * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj + * @param array $filters filters to load automatically + * @param string $type "pre", "output", … specify the + * filter type to set. Defaults to + * none treating $filters' keys as + * the appropriate types + * + * @return \Smarty|\Smarty_Internal_Template + */ + public function setAutoloadFilters(Smarty_Internal_TemplateBase $obj, $filters, $type = null) + { + $smarty = isset($obj->smarty) ? $obj->smarty : $obj; + if ($type !== null) { + $this->_checkFilterType($type); + $smarty->autoload_filters[$type] = (array) $filters; + } else { + foreach ((array) $filters as $type => $value) { + $this->_checkFilterType($type); + } + $smarty->autoload_filters = (array) $filters; + } + return $obj; + } + + /** + * Check if filter type is valid + * + * @param string $type + * + * @throws \SmartyException + */ + public function _checkFilterType($type) + { + if (!isset($this->filterTypes[$type])) { + throw new SmartyException("Illegal filter type \"{$type}\""); + } + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_setdebugtemplate.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_setdebugtemplate.php new file mode 100755 index 0000000..4ff5d7f --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_setdebugtemplate.php @@ -0,0 +1,41 @@ +smarty) ? $obj->smarty : $obj; + if (!is_readable($tpl_name)) { + throw new SmartyException("Unknown file '{$tpl_name}'"); + } + $smarty->debug_tpl = $tpl_name; + return $obj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_setdefaultmodifiers.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_setdefaultmodifiers.php new file mode 100755 index 0000000..5a70728 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_setdefaultmodifiers.php @@ -0,0 +1,38 @@ +smarty) ? $obj->smarty : $obj; + $smarty->default_modifiers = (array) $modifiers; + return $obj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_unloadfilter.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_unloadfilter.php new file mode 100755 index 0000000..e3d966e --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_unloadfilter.php @@ -0,0 +1,42 @@ +smarty) ? $obj->smarty : $obj; + $this->_checkFilterType($type); + if (isset($smarty->registered_filters[$type])) { + $_filter_name = "smarty_{$type}filter_{$name}"; + if (isset($smarty->registered_filters[$type][$_filter_name])) { + unset ($smarty->registered_filters[$type][$_filter_name]); + if (empty($smarty->registered_filters[$type])) { + unset($smarty->registered_filters[$type]); + } + } + } + return $obj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_unregistercacheresource.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_unregistercacheresource.php new file mode 100755 index 0000000..8038101 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_unregistercacheresource.php @@ -0,0 +1,40 @@ +smarty) ? $obj->smarty : $obj; + if (isset($smarty->registered_cache_resources[$name])) { + unset($smarty->registered_cache_resources[$name]); + } + return $obj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_unregisterfilter.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_unregisterfilter.php new file mode 100755 index 0000000..c80ae9a --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_unregisterfilter.php @@ -0,0 +1,42 @@ +smarty) ? $obj->smarty : $obj; + $this->_checkFilterType($type); + if (isset($smarty->registered_filters[$type])) { + $name = is_string($callback) ? $callback : $this->_getFilterName($callback); + if (isset($smarty->registered_filters[$type][$name])) { + unset($smarty->registered_filters[$type][$name]); + if (empty($smarty->registered_filters[$type])) { + unset($smarty->registered_filters[$type]); + } + } + } + return $obj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_unregisterobject.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_unregisterobject.php new file mode 100755 index 0000000..a943316 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_unregisterobject.php @@ -0,0 +1,40 @@ +smarty) ? $obj->smarty : $obj; + if (isset($smarty->registered_objects[$object_name])) { + unset($smarty->registered_objects[$object_name]); + } + return $obj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_unregisterplugin.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_unregisterplugin.php new file mode 100755 index 0000000..06cb2d3 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_unregisterplugin.php @@ -0,0 +1,41 @@ +smarty) ? $obj->smarty : $obj; + if (isset($smarty->registered_plugins[$type][$name])) { + unset($smarty->registered_plugins[$type][$name]); + } + return $obj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_method_unregisterresource.php b/inc/libs/Smarty/sysplugins/smarty_internal_method_unregisterresource.php new file mode 100755 index 0000000..767bd74 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_method_unregisterresource.php @@ -0,0 +1,40 @@ +smarty) ? $obj->smarty : $obj; + if (isset($smarty->registered_resources[$type])) { + unset($smarty->registered_resources[$type]); + } + return $obj; + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_nocache_insert.php b/inc/libs/Smarty/sysplugins/smarty_internal_nocache_insert.php new file mode 100755 index 0000000..b3d5fa8 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_nocache_insert.php @@ -0,0 +1,51 @@ +assign('{$_assign}' , {$_function} (" . var_export($_attr, true) . ",\$_smarty_tpl), true);?>"; + } else { + $_output .= "echo {$_function}(" . var_export($_attr, true) . ",\$_smarty_tpl);?>"; + } + $_tpl = $_template; + while (isset($_tpl->parent) && $_tpl->parent->_objType == 2) { + $_tpl = $_tpl->parent; + } + + return "/*%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/"; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_parsetree.php b/inc/libs/Smarty/sysplugins/smarty_internal_parsetree.php new file mode 100755 index 0000000..32c9df0 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_parsetree.php @@ -0,0 +1,54 @@ +data = null; + $this->subtrees = null; + } + +} + + diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_code.php b/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_code.php new file mode 100755 index 0000000..d0f0b3f --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_code.php @@ -0,0 +1,42 @@ +data = $data; + } + + /** + * Return buffer content in parentheses + * + * @param \Smarty_Internal_Templateparser $parser + * + * @return string content + */ + public function to_smarty_php(Smarty_Internal_Templateparser $parser) + { + return sprintf("(%s)", $this->data); + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_dq.php b/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_dq.php new file mode 100755 index 0000000..607389c --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_dq.php @@ -0,0 +1,88 @@ +subtrees[] = $subtree; + if ($subtree instanceof Smarty_Internal_ParseTree_Tag) { + $parser->block_nesting_level = count($parser->compiler->_tag_stack); + } + } + + /** + * Append buffer to subtree + * + * @param \Smarty_Internal_Templateparser $parser + * @param Smarty_Internal_ParseTree $subtree parse tree buffer + */ + public function append_subtree(Smarty_Internal_Templateparser $parser, Smarty_Internal_ParseTree $subtree) + { + $last_subtree = count($this->subtrees) - 1; + if ($last_subtree >= 0 && $this->subtrees[$last_subtree] instanceof Smarty_Internal_ParseTree_Tag && $this->subtrees[$last_subtree]->saved_block_nesting < $parser->block_nesting_level) { + if ($subtree instanceof Smarty_Internal_ParseTree_Code) { + $this->subtrees[$last_subtree]->data = $parser->compiler->appendCode($this->subtrees[$last_subtree]->data, 'data . ';?>'); + } elseif ($subtree instanceof Smarty_Internal_ParseTree_DqContent) { + $this->subtrees[$last_subtree]->data = $parser->compiler->appendCode($this->subtrees[$last_subtree]->data, 'data . '";?>'); + } else { + $this->subtrees[$last_subtree]->data = $parser->compiler->appendCode($this->subtrees[$last_subtree]->data, $subtree->data); + } + } else { + $this->subtrees[] = $subtree; + } + if ($subtree instanceof Smarty_Internal_ParseTree_Tag) { + $parser->block_nesting_level = count($parser->compiler->_tag_stack); + } + } + + /** + * Merge subtree buffer content together + * + * @param \Smarty_Internal_Templateparser $parser + * + * @return string compiled template code + */ + public function to_smarty_php(Smarty_Internal_Templateparser $parser) + { + $code = ''; + foreach ($this->subtrees as $subtree) { + if ($code !== "") { + $code .= "."; + } + if ($subtree instanceof Smarty_Internal_ParseTree_Tag) { + $more_php = $subtree->assign_to_var($parser); + } else { + $more_php = $subtree->to_smarty_php($parser); + } + + $code .= $more_php; + + if (!$subtree instanceof Smarty_Internal_ParseTree_DqContent) { + $parser->compiler->has_variable_string = true; + } + } + + return $code; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_dqcontent.php b/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_dqcontent.php new file mode 100755 index 0000000..a8ca389 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_dqcontent.php @@ -0,0 +1,42 @@ +data = $data; + } + + /** + * Return content as double quoted string + * + * @param \Smarty_Internal_Templateparser $parser + * + * @return string doubled quoted string + */ + public function to_smarty_php(Smarty_Internal_Templateparser $parser) + { + return '"' . $this->data . '"'; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_tag.php b/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_tag.php new file mode 100755 index 0000000..575c8c9 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_tag.php @@ -0,0 +1,69 @@ +data = $data; + $this->saved_block_nesting = $parser->block_nesting_level; + } + + /** + * Return buffer content + * + * @param \Smarty_Internal_Templateparser $parser + * + * @return string content + */ + public function to_smarty_php(Smarty_Internal_Templateparser $parser) + { + return $this->data; + } + + /** + * Return complied code that loads the evaluated output of buffer content into a temporary variable + * + * @param \Smarty_Internal_Templateparser $parser + * + * @return string template code + */ + public function assign_to_var(Smarty_Internal_Templateparser $parser) + { + $var = sprintf('$_tmp%d', ++ Smarty_Internal_Templateparser::$prefix_number); + $tmp = $parser->compiler->appendCode('', $this->data); + $tmp = $parser->compiler->appendCode($tmp, ""); + $parser->compiler->prefix_code[] = sprintf("%s", $tmp); + + return $var; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_template.php b/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_template.php new file mode 100755 index 0000000..623ae51 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_template.php @@ -0,0 +1,128 @@ +subtrees)) { + $this->subtrees = array_merge($this->subtrees, $subtree->subtrees); + } else { + if ($subtree->data !== '') { + $this->subtrees[] = $subtree; + } + } + } + + /** + * Append array to subtree + * + * @param \Smarty_Internal_Templateparser $parser + * @param \Smarty_Internal_ParseTree[] $array + */ + public function append_array(Smarty_Internal_Templateparser $parser, $array = array()) + { + if (!empty($array)) { + $this->subtrees = array_merge($this->subtrees, (array) $array); + } + } + + /** + * Prepend array to subtree + * + * @param \Smarty_Internal_Templateparser $parser + * @param \Smarty_Internal_ParseTree[] $array + */ + public function prepend_array(Smarty_Internal_Templateparser $parser, $array = array()) + { + if (!empty($array)) { + $this->subtrees = array_merge((array) $array, $this->subtrees); + } + } + + /** + * Sanitize and merge subtree buffers together + * + * @param \Smarty_Internal_Templateparser $parser + * + * @return string template code content + */ + public function to_smarty_php(Smarty_Internal_Templateparser $parser) + { + $code = ''; + for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key ++) { + if ($this->subtrees[$key] instanceof Smarty_Internal_ParseTree_Text) { + $subtree = $this->subtrees[$key]->to_smarty_php($parser); + while ($key + 1 < $cnt && ($this->subtrees[$key + 1] instanceof Smarty_Internal_ParseTree_Text || + $this->subtrees[$key + 1]->data == '')) { + $key ++; + if ($this->subtrees[$key]->data == '') { + continue; + } + $subtree .= $this->subtrees[$key]->to_smarty_php($parser); + } + if ($subtree == '') { + continue; + } + $code .= preg_replace('/((<%)|(%>)|(<\?php)|(<\?)|(\?>)|(<\/?script))/', "\n", + $subtree); + continue; + } + if ($this->subtrees[$key] instanceof Smarty_Internal_ParseTree_Tag) { + $subtree = $this->subtrees[$key]->to_smarty_php($parser); + while ($key + 1 < $cnt && ($this->subtrees[$key + 1] instanceof Smarty_Internal_ParseTree_Tag || + $this->subtrees[$key + 1]->data == '')) { + $key ++; + if ($this->subtrees[$key]->data == '') { + continue; + } + $subtree = $parser->compiler->appendCode($subtree, $this->subtrees[$key]->to_smarty_php($parser)); + } + if ($subtree == '') { + continue; + } + $code .= $subtree; + continue; + } + $code .= $this->subtrees[$key]->to_smarty_php($parser); + } + return $code; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_text.php b/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_text.php new file mode 100755 index 0000000..b3100fa --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_parsetree_text.php @@ -0,0 +1,40 @@ +data = $data; + } + + /** + * Return buffer content + * + * @param \Smarty_Internal_Templateparser $parser + * + * @return string text + */ + public function to_smarty_php(Smarty_Internal_Templateparser $parser) + { + return $this->data; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_resource_eval.php b/inc/libs/Smarty/sysplugins/smarty_internal_resource_eval.php new file mode 100755 index 0000000..aca7103 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_resource_eval.php @@ -0,0 +1,96 @@ +uid = $source->filepath = sha1($source->name); + $source->timestamp = false; + $source->exists = true; + } + + /** + * Load template's source from $resource_name into current template object + * + * @uses decode() to decode base64 and urlencoded template_resources + * + * @param Smarty_Template_Source $source source object + * + * @return string template source + */ + public function getContent(Smarty_Template_Source $source) + { + return $this->decode($source->name); + } + + /** + * decode base64 and urlencode + * + * @param string $string template_resource to decode + * + * @return string decoded template_resource + */ + protected function decode($string) + { + // decode if specified + if (($pos = strpos($string, ':')) !== false) { + if (!strncmp($string, 'base64', 6)) { + return base64_decode(substr($string, 7)); + } elseif (!strncmp($string, 'urlencode', 9)) { + return urldecode(substr($string, 10)); + } + } + + return $string; + } + + /** + * modify resource_name according to resource handlers specifications + * + * @param Smarty $smarty Smarty instance + * @param string $resource_name resource_name to make unique + * @param boolean $isConfig flag for config resource + * + * @return string unique resource name + */ + public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false) + { + return get_class($this) . '#' . $this->decode($resource_name); + } + + /** + * Determine basename for compiled filename + * + * @param Smarty_Template_Source $source source object + * + * @return string resource's basename + */ + public function getBasename(Smarty_Template_Source $source) + { + return ''; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_resource_extends.php b/inc/libs/Smarty/sysplugins/smarty_internal_resource_extends.php new file mode 100755 index 0000000..3d687dc --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_resource_extends.php @@ -0,0 +1,124 @@ +name); + $exists = true; + foreach ($components as $component) { + /* @var \Smarty_Template_Source $_s */ + $_s = Smarty_Template_Source::load(null, $source->smarty, $component); + if ($_s->type == 'php') { + throw new SmartyException("Resource type {$_s->type} cannot be used with the extends resource type"); + } + $sources[ $_s->uid ] = $_s; + $uid .= $_s->filepath; + if ($_template) { + $exists = $exists && $_s->exists; + } + } + $source->components = $sources; + $source->filepath = $_s->filepath; + $source->uid = sha1($uid); + $source->exists = $exists; + if ($_template) { + $source->timestamp = $_s->timestamp; + } + } + + /** + * populate Source Object with timestamp and exists from Resource + * + * @param Smarty_Template_Source $source source object + */ + public function populateTimestamp(Smarty_Template_Source $source) + { + $source->exists = true; + /* @var \Smarty_Template_Source $_s */ + foreach ($source->components as $_s) { + $source->exists = $source->exists && $_s->exists; + } + $source->timestamp = $source->exists ? $_s->getTimeStamp() : false; + } + + /** + * Load template's source from files into current template object + * + * @param Smarty_Template_Source $source source object + * + * @return string template source + * @throws SmartyException if source cannot be loaded + */ + public function getContent(Smarty_Template_Source $source) + { + if (!$source->exists) { + throw new SmartyException("Unable to read template {$source->type} '{$source->name}'"); + } + + $_components = array_reverse($source->components); + + $_content = ''; + /* @var \Smarty_Template_Source $_s */ + foreach ($_components as $_s) { + // read content + $_content .= $_s->getContent(); + } + return $_content; + } + + /** + * Determine basename for compiled filename + * + * @param Smarty_Template_Source $source source object + * + * @return string resource's basename + */ + public function getBasename(Smarty_Template_Source $source) + { + return str_replace(':', '.', basename($source->filepath)); + } + + /* + * Disable timestamp checks for extends resource. + * The individual source components will be checked. + * + * @return bool + */ + public function checkTimestamps() + { + return false; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_resource_file.php b/inc/libs/Smarty/sysplugins/smarty_internal_resource_file.php new file mode 100755 index 0000000..b15e3cc --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_resource_file.php @@ -0,0 +1,179 @@ +name; + // absolute file ? + if ($file[0] == '/' || $file[1] == ':') { + $file = $source->smarty->_realpath($file, true); + return is_file($file) ? $file : false; + } + // go relative to a given template? + if ($file[0] == '.' && $_template && isset($_template->parent) && $_template->parent->_objType == 2 && + preg_match('#^[.]{1,2}[\\\/]#', $file) + ) { + if ($_template->parent->source->type != 'file' && $_template->parent->source->type != 'extends' && + !isset($_template->parent->_cache['allow_relative_path']) + ) { + throw new SmartyException("Template '{$file}' cannot be relative to template of resource type '{$_template->parent->source->type}'"); + } + $path = dirname($_template->parent->source->filepath) . DS . $file; + // normalize path + $path = $source->smarty->_realpath($path); + // files relative to a template only get one shot + return is_file($path) ? $path : false; + } + // normalize DS + if (strpos($file, DS == '/' ? '\\' : '/') !== false) { + $file = str_replace(DS == '/' ? '\\' : '/', DS, $file); + } + + $_directories = $source->smarty->getTemplateDir(null, $source->isConfig); + // template_dir index? + if ($file[0] == '[' && preg_match('#^\[([^\]]+)\](.+)$#', $file, $fileMatch)) { + $file = $fileMatch[2]; + $_indices = explode(',', $fileMatch[1]); + $_index_dirs = array(); + foreach ($_indices as $index) { + $index = trim($index); + // try string indexes + if (isset($_directories[$index])) { + $_index_dirs[] = $_directories[$index]; + } elseif (is_numeric($index)) { + // try numeric index + $index = (int) $index; + if (isset($_directories[$index])) { + $_index_dirs[] = $_directories[$index]; + } else { + // try at location index + $keys = array_keys($_directories); + if (isset($_directories[$keys[$index]])) { + $_index_dirs[] = $_directories[$keys[$index]]; + } + } + } + } + if (empty($_index_dirs)) { + // index not found + return false; + } else { + $_directories = $_index_dirs; + } + } + + // relative file name? + foreach ($_directories as $_directory) { + $path = $_directory . $file; + if (is_file($path)) { + return (strpos($path, '.' . DS) !== false) ? $source->smarty->_realpath($path) : $path; + } + } + if (!isset($_index_dirs)) { + // Could be relative to cwd + $path = $source->smarty->_realpath($file, true); + if (is_file($path)) { + return $path; + } + } + // Use include path ? + if ($source->smarty->use_include_path) { + return $source->smarty->ext->_getIncludePath->getIncludePath($_directories, $file, $source->smarty); + } + return false; + } + + /** + * populate Source Object with meta data from Resource + * + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object + */ + public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null) + { + $source->filepath = $this->buildFilepath($source, $_template); + + if ($source->filepath !== false) { + if (isset($source->smarty->security_policy) && is_object($source->smarty->security_policy)) { + $source->smarty->security_policy->isTrustedResourceDir($source->filepath, $source->isConfig); + } + $source->exists = true; + $source->uid = sha1($source->filepath); + if ($source->smarty->compile_check == 1) { + $source->timestamp = filemtime($source->filepath); + } + } else { + $source->timestamp = false; + $source->exists = false; + } + } + + /** + * populate Source Object with timestamp and exists from Resource + * + * @param Smarty_Template_Source $source source object + */ + public function populateTimestamp(Smarty_Template_Source $source) + { + if (!$source->exists) { + $source->timestamp = $source->exists = is_file($source->filepath); + } + if ($source->exists) { + $source->timestamp = filemtime($source->filepath); + } + } + + /** + * Load template's source from file into current template object + * + * @param Smarty_Template_Source $source source object + * + * @return string template source + * @throws SmartyException if source cannot be loaded + */ + public function getContent(Smarty_Template_Source $source) + { + if ($source->exists) { + return file_get_contents($source->filepath); + } + throw new SmartyException('Unable to read ' . ($source->isConfig ? 'config' : 'template') . + " {$source->type} '{$source->name}'"); + } + + /** + * Determine basename for compiled filename + * + * @param Smarty_Template_Source $source source object + * + * @return string resource's basename + */ + public function getBasename(Smarty_Template_Source $source) + { + return basename($source->filepath); + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_resource_php.php b/inc/libs/Smarty/sysplugins/smarty_internal_resource_php.php new file mode 100755 index 0000000..6268062 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_resource_php.php @@ -0,0 +1,108 @@ +short_open_tag = ini_get('short_open_tag'); + } + + /** + * Load template's source from file into current template object + * + * @param Smarty_Template_Source $source source object + * + * @return string template source + * @throws SmartyException if source cannot be loaded + */ + public function getContent(Smarty_Template_Source $source) + { + if ($source->exists) { + return ''; + } + throw new SmartyException("Unable to read template {$source->type} '{$source->name}'"); + } + + /** + * Render and output the template (without using the compiler) + * + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object + * + * @return void + * @throws SmartyException if template cannot be loaded or allow_php_templates is disabled + */ + public function renderUncompiled(Smarty_Template_Source $source, Smarty_Internal_Template $_template) + { + if (!$source->smarty->allow_php_templates) { + throw new SmartyException("PHP templates are disabled"); + } + if (!$source->exists) { + if (isset($_template->parent) && $_template->parent->_objType == 2) { + $parent_resource = " in '{$_template->parent->template_resource}'"; + } else { + $parent_resource = ''; + } + throw new SmartyException("Unable to load template {$source->type} '{$source->name}'{$parent_resource}"); + } + + // prepare variables + extract($_template->getTemplateVars()); + + // include PHP template with short open tags enabled + ini_set('short_open_tag', '1'); + /** @var Smarty_Internal_Template $_smarty_template + * used in included file + */ + $_smarty_template = $_template; + include($source->filepath); + ini_set('short_open_tag', $this->short_open_tag); + } + + /** + * populate compiled object with compiled filepath + * + * @param Smarty_Template_Compiled $compiled compiled object + * @param Smarty_Internal_Template $_template template object (is ignored) + */ + public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template) + { + $compiled->filepath = false; + $compiled->timestamp = false; + $compiled->exists = false; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_resource_registered.php b/inc/libs/Smarty/sysplugins/smarty_internal_resource_registered.php new file mode 100755 index 0000000..69b396b --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_resource_registered.php @@ -0,0 +1,99 @@ +filepath = $source->type . ':' . $source->name; + $source->uid = sha1($source->filepath); + if ($source->smarty->compile_check) { + $source->timestamp = $this->getTemplateTimestamp($source); + $source->exists = !!$source->timestamp; + } + } + + /** + * populate Source Object with timestamp and exists from Resource + * + * @param Smarty_Template_Source $source source object + * + * @return void + */ + public function populateTimestamp(Smarty_Template_Source $source) + { + $source->timestamp = $this->getTemplateTimestamp($source); + $source->exists = !!$source->timestamp; + } + + /** + * Get timestamp (epoch) the template source was modified + * + * @param Smarty_Template_Source $source source object + * + * @return integer|boolean timestamp (epoch) the template was modified, false if resources has no timestamp + */ + public function getTemplateTimestamp(Smarty_Template_Source $source) + { + // return timestamp + $time_stamp = false; + call_user_func_array($source->smarty->registered_resources[$source->type][0][1], array($source->name, &$time_stamp, $source->smarty)); + + return is_numeric($time_stamp) ? (int) $time_stamp : $time_stamp; + } + + /** + * Load template's source by invoking the registered callback into current template object + * + * @param Smarty_Template_Source $source source object + * + * @return string template source + * @throws SmartyException if source cannot be loaded + */ + public function getContent(Smarty_Template_Source $source) + { + // return template string + $content = null; + $t = call_user_func_array($source->smarty->registered_resources[$source->type][0][0], array($source->name, &$content, $source->smarty)); + if (is_bool($t) && !$t) { + throw new SmartyException("Unable to read template {$source->type} '{$source->name}'"); + } + + return $content; + } + + /** + * Determine basename for compiled filename + * + * @param Smarty_Template_Source $source source object + * + * @return string resource's basename + */ + public function getBasename(Smarty_Template_Source $source) + { + return basename($source->name); + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_resource_stream.php b/inc/libs/Smarty/sysplugins/smarty_internal_resource_stream.php new file mode 100755 index 0000000..8a90226 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_resource_stream.php @@ -0,0 +1,81 @@ +resource, '://') !== false) { + $source->filepath = $source->resource; + } else { + $source->filepath = str_replace(':', '://', $source->resource); + } + $source->uid = false; + $source->content = $this->getContent($source); + $source->timestamp = false; + $source->exists = !!$source->content; + } + + /** + * Load template's source from stream into current template object + * + * @param Smarty_Template_Source $source source object + * + * @return string template source + * @throws SmartyException if source cannot be loaded + */ + public function getContent(Smarty_Template_Source $source) + { + $t = ''; + // the availability of the stream has already been checked in Smarty_Resource::fetch() + $fp = fopen($source->filepath, 'r+'); + if ($fp) { + while (!feof($fp) && ($current_line = fgets($fp)) !== false) { + $t .= $current_line; + } + fclose($fp); + + return $t; + } else { + return false; + } + } + + /** + * modify resource_name according to resource handlers specifications + * + * @param Smarty $smarty Smarty instance + * @param string $resource_name resource_name to make unique + * @param boolean $isConfig flag for config resource + * + * @return string unique resource name + */ + public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false) + { + return get_class($this) . '#' . $resource_name; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_resource_string.php b/inc/libs/Smarty/sysplugins/smarty_internal_resource_string.php new file mode 100755 index 0000000..75e99e6 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_resource_string.php @@ -0,0 +1,97 @@ +uid = $source->filepath = sha1($source->name); + $source->timestamp = 0; + $source->exists = true; + } + + /** + * Load template's source from $resource_name into current template object + * + * @uses decode() to decode base64 and urlencoded template_resources + * + * @param Smarty_Template_Source $source source object + * + * @return string template source + */ + public function getContent(Smarty_Template_Source $source) + { + return $this->decode($source->name); + } + + /** + * decode base64 and urlencode + * + * @param string $string template_resource to decode + * + * @return string decoded template_resource + */ + protected function decode($string) + { + // decode if specified + if (($pos = strpos($string, ':')) !== false) { + if (!strncmp($string, 'base64', 6)) { + return base64_decode(substr($string, 7)); + } elseif (!strncmp($string, 'urlencode', 9)) { + return urldecode(substr($string, 10)); + } + } + + return $string; + } + + /** + * modify resource_name according to resource handlers specifications + * + * @param Smarty $smarty Smarty instance + * @param string $resource_name resource_name to make unique + * @param boolean $isConfig flag for config resource + * + * @return string unique resource name + */ + public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false) + { + return get_class($this) . '#' . $this->decode($resource_name); + } + + /** + * Determine basename for compiled filename + * Always returns an empty string. + * + * @param Smarty_Template_Source $source source object + * + * @return string resource's basename + */ + public function getBasename(Smarty_Template_Source $source) + { + return ''; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_runtime_cachemodify.php b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_cachemodify.php new file mode 100755 index 0000000..4e2fb83 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_cachemodify.php @@ -0,0 +1,67 @@ +isCached() && !$_template->compiled->has_nocache_code; + $_last_modified_date = + @substr($_SERVER['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_SERVER['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3); + if ($_isCached && $cached->timestamp <= strtotime($_last_modified_date)) { + switch (PHP_SAPI) { + case 'cgi': // php-cgi < 5.3 + case 'cgi-fcgi': // php-cgi >= 5.3 + case 'fpm-fcgi': // php-fpm >= 5.3.3 + header('Status: 304 Not Modified'); + break; + + case 'cli': + if ( /* ^phpunit */ + !empty($_SERVER['SMARTY_PHPUNIT_DISABLE_HEADERS']) /* phpunit$ */ + ) { + $_SERVER['SMARTY_PHPUNIT_HEADERS'][] = '304 Not Modified'; + } + break; + + default: + if ( /* ^phpunit */ + !empty($_SERVER['SMARTY_PHPUNIT_DISABLE_HEADERS']) /* phpunit$ */ + ) { + $_SERVER['SMARTY_PHPUNIT_HEADERS'][] = '304 Not Modified'; + } else { + header($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified'); + } + break; + } + } else { + switch (PHP_SAPI) { + case 'cli': + if ( /* ^phpunit */ + !empty($_SERVER['SMARTY_PHPUNIT_DISABLE_HEADERS']) /* phpunit$ */ + ) { + $_SERVER['SMARTY_PHPUNIT_HEADERS'][] = + 'Last-Modified: ' . gmdate('D, d M Y H:i:s', $cached->timestamp) . ' GMT'; + } + break; + default: + header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $cached->timestamp) . ' GMT'); + break; + } + echo $content; + } + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_runtime_codeframe.php b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_codeframe.php new file mode 100755 index 0000000..ce67497 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_codeframe.php @@ -0,0 +1,94 @@ +compiled->has_nocache_code; + $properties[ 'version' ] = Smarty::SMARTY_VERSION; + $properties[ 'unifunc' ] = 'content_' . str_replace(array('.', ','), '_', uniqid('', true)); + if (!$cache) { + $properties[ 'file_dependency' ] = $_template->compiled->file_dependency; + $properties[ 'includes' ] = $_template->compiled->includes; + if (!empty($compiler->tpl_function)) { + $properties[ 'tpl_function' ] = $compiler->tpl_function; + } + } else { + $properties[ 'file_dependency' ] = $_template->cached->file_dependency; + $properties[ 'cache_lifetime' ] = $_template->cache_lifetime; + if (!empty($_template->tpl_function)) { + $properties[ 'tpl_function' ] = $_template->tpl_function; + } + } + $output = "source->filepath . "\" */\n\n"; + + $dec = "\$_smarty_tpl->smarty->ext->_validateCompiled->decodeProperties(\$_smarty_tpl, " . + var_export($properties, true) . ',' . ($cache ? 'true' : 'false') . ")"; + $output .= "if ({$dec}) {\n"; + $output .= "function {$properties['unifunc']} (\$_smarty_tpl) {\n"; + // include code for plugins + if (!$cache) { + if (!empty($_template->compiled->required_plugins[ 'compiled' ])) { + foreach ($_template->compiled->required_plugins[ 'compiled' ] as $tmp) { + foreach ($tmp as $data) { + $file = addslashes($data[ 'file' ]); + if (is_array($data[ 'function' ])) { + $output .= "if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) require_once '{$file}';\n"; + } else { + $output .= "if (!is_callable('{$data['function']}')) require_once '{$file}';\n"; + } + } + } + } + if ($_template->caching && !empty($_template->compiled->required_plugins[ 'nocache' ])) { + $_template->compiled->has_nocache_code = true; + $output .= "echo '/*%%SmartyNocache:{$_template->compiled->nocache_hash}%%*/smarty; "; + foreach ($_template->compiled->required_plugins[ 'nocache' ] as $tmp) { + foreach ($tmp as $data) { + $file = addslashes($data[ 'file' ]); + if (is_Array($data[ 'function' ])) { + $output .= addslashes("if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) require_once '{$file}';\n"); + } else { + $output .= addslashes("if (!is_callable('{$data['function']}')) require_once '{$file}';\n"); + } + } + } + $output .= "?>/*/%%SmartyNocache:{$_template->compiled->nocache_hash}%%*/';\n"; + } + } + $output .= "?>\n"; + $output .= $content; + $output .= ""; + $output .= $functions; + $output .= "[\n]?<\?php\s*/', '/\?>\s*$/'), array("\n", ''), $output); + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_runtime_filterhandler.php b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_filterhandler.php new file mode 100755 index 0000000..9af2667 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_filterhandler.php @@ -0,0 +1,69 @@ +smarty->autoload_filters[$type])) { + foreach ((array) $template->smarty->autoload_filters[$type] as $name) { + $plugin_name = "Smarty_{$type}filter_{$name}"; + if (function_exists($plugin_name)) { + $callback = $plugin_name; + } elseif (class_exists($plugin_name, false) && is_callable(array($plugin_name, 'execute'))) { + $callback = array($plugin_name, 'execute'); + } elseif ($template->smarty->loadPlugin($plugin_name, false)) { + if (function_exists($plugin_name)) { + // use loaded Smarty2 style plugin + $callback = $plugin_name; + } elseif (class_exists($plugin_name, false) && is_callable(array($plugin_name, 'execute'))) { + // loaded class of filter plugin + $callback = array($plugin_name, 'execute'); + } else { + throw new SmartyException("Auto load {$type}-filter plugin method \"{$plugin_name}::execute\" not callable"); + } + } else { + // nothing found, throw exception + throw new SmartyException("Unable to auto load {$type}-filter plugin \"{$plugin_name}\""); + } + $content = call_user_func($callback, $content, $template); + } + } + // loop over registered filters of specified type + if (!empty($template->smarty->registered_filters[$type])) { + foreach ($template->smarty->registered_filters[$type] as $key => $name) { + $content = call_user_func($template->smarty->registered_filters[$type][$key], $content, $template); + } + } + // return filtered output + return $content; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_runtime_foreach.php b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_foreach.php new file mode 100755 index 0000000..689636a --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_foreach.php @@ -0,0 +1,47 @@ +getIterator()); + } elseif ($value instanceof Iterator) { + if ($value instanceof Generator) { + return 1; + } + return iterator_count($value); + } elseif ($value instanceof PDOStatement) { + return $value->rowCount(); + } elseif ($value instanceof Traversable) { + return iterator_count($value); + } elseif ($value instanceof ArrayAccess) { + if ($value->offsetExists(0)) { + return 1; + } + } elseif (is_object($value)) { + return count($value); + } + return 0; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_runtime_getincludepath.php b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_getincludepath.php new file mode 100755 index 0000000..72149cd --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_getincludepath.php @@ -0,0 +1,180 @@ +_include_path != $_i_path) { + $this->_include_dirs = array(); + $this->_include_path = $_i_path; + $_dirs = (array) explode(PATH_SEPARATOR, $_i_path); + foreach ($_dirs as $_path) { + if (is_dir($_path)) { + $this->_include_dirs[] = $smarty->_realpath($_path . DS, true); + } + } + return true; + } + return false; + } + + /** + * return array with include path directories + * + * @param \Smarty $smarty + * + * @return array + */ + public function getIncludePathDirs(Smarty $smarty) + { + $this->isNewIncludePath($smarty); + return $this->_include_dirs; + } + + /** + * Return full file path from PHP include_path + * + * @param string[] $dirs + * @param string $file + * @param \Smarty $smarty + * + * @return bool|string full filepath or false + * + */ + public function getIncludePath($dirs, $file, Smarty $smarty) + { + //if (!(isset($this->_has_stream_include) ? $this->_has_stream_include : $this->_has_stream_include = false)) { + if (!(isset($this->_has_stream_include) ? $this->_has_stream_include : $this->_has_stream_include = function_exists('stream_resolve_include_path'))) { + $this->isNewIncludePath($smarty); + } + // try PHP include_path + foreach ($dirs as $dir) { + $dir_n = isset($this->number[$dir]) ? $this->number[$dir] : $this->number[$dir] = $this->counter ++; + if (isset($this->isFile[$dir_n][$file])) { + if ($this->isFile[$dir_n][$file]) { + return $this->isFile[$dir_n][$file]; + } else { + continue; + } + } + if (isset($this->_user_dirs[$dir_n])) { + if (false === $this->_user_dirs[$dir_n]) { + continue; + } else { + $dir = $this->_user_dirs[$dir_n]; + } + } else { + if ($dir[0] == '/' || $dir[1] == ':') { + $dir = str_ireplace(getcwd(), '.', $dir); + if ($dir[0] == '/' || $dir[1] == ':') { + $this->_user_dirs[$dir_n] = false; + continue; + } + } + $dir = substr($dir, 2); + $this->_user_dirs[$dir_n] = $dir; + } + if ($this->_has_stream_include) { + $path = stream_resolve_include_path($dir . (isset($file) ? $file : '')); + if ($path) { + return $this->isFile[$dir_n][$file] = $path; + } + } else { + foreach ($this->_include_dirs as $key => $_i_path) { + $path = isset($this->isPath[$key][$dir_n]) ? $this->isPath[$key][$dir_n] : $this->isPath[$key][$dir_n] = is_dir($_dir_path = $_i_path . + $dir) ? $_dir_path : false; + if ($path === false) { + continue; + } + if (isset($file)) { + $_file = $this->isFile[$dir_n][$file] = (is_file($path . $file)) ? $path . $file : false; + if ($_file) { + return $_file; + } + } else { + // no file was given return directory path + return $path; + } + } + } + } + return false; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_runtime_hhvm.php b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_hhvm.php new file mode 100755 index 0000000..117cd81 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_hhvm.php @@ -0,0 +1,30 @@ +blockNesting || $this->state == 3)) { + $tpl->ext->_inheritance = new Smarty_Internal_Runtime_Inheritance(); + $tpl->ext->_inheritance->init($tpl, $initChild, $blockNames); + return; + } + // start of child sub template(s) + if ($initChild) { + $this->state = 1; + if (!$this->inheritanceLevel) { + //grab any output of child templates + ob_start(); + } + $this->inheritanceLevel ++; + } + // in parent state {include} will not increment template index + if ($this->state != 3) { + $this->tplIndex ++; + } + // if state was waiting for parent change state to parent + if ($this->state == 2) { + $this->state = 3; + } + } + + /** + * End of child template(s) + * - if outer level is reached flush output buffer and switch to wait for parent template state + * + * @param \Smarty_Internal_Template $tpl template object of caller + */ + public function endChild(Smarty_Internal_Template $tpl) + { + $this->inheritanceLevel --; + if (!$this->inheritanceLevel) { + ob_end_clean(); + $this->state = 2; + } + } + + /** + * Process inheritance {block} tag + * + * $type 0 = {block}: + * - search in inheritance template hierarchy for child blocks + * if found call it, otherwise call current block + * - ignored for outer level blocks in child templates + * + * $type 1 = {block}: + * - nested {block} + * - search in inheritance template hierarchy for child blocks + * if found call it, otherwise call current block + * + * $type 2 = {$smarty.block.child}: + * - search in inheritance template hierarchy for child blocks + * if found call it, otherwise ignore + * + * $type 3 = {block append} {block prepend}: + * - call parent block + * + * $type 4 = {$smarty.block.parent}: + * - call parent block + * + * @param \Smarty_Internal_Template $tpl template object of caller + * @param int $type call type see above + * @param string $name block name + * @param array $block block parameter + * @param array $callStack call stack with block parameters + * + * @throws \SmartyException + */ + public function processBlock(Smarty_Internal_Template $tpl, $type = 0, $name, $block, $callStack = array()) + { + if (!isset($this->blockParameter[ $name ])) { + $this->blockParameter[ $name ] = array(); + } + if ($this->state == 1) { + $block[ 2 ] = count($this->blockParameter[ $name ]); + $block[ 3 ] = $this->tplIndex; + $this->blockParameter[ $name ][] = $block; + return; + } + if ($type == 3) { + if (!empty($callStack)) { + $block = array_shift($callStack); + } else { + return; + } + } elseif ($type == 4) { + if (!empty($callStack)) { + array_shift($callStack); + if (empty($callStack)) { + throw new SmartyException("inheritance: tag {\$smarty.block.parent} used in parent template block '{$name}'"); + } + $block = array_shift($callStack); + } else { + return; + } + } else { + $index = 0; + $blockParameter = &$this->blockParameter[ $name ]; + if ($type == 0) { + $index = $block[ 2 ] = count($blockParameter); + $block[ 3 ] = $this->tplIndex; + $callStack = array(&$block); + } elseif ($type == 1) { + $block[ 3 ] = $callStack[ 0 ][ 3 ]; + for ($i = 0; $i < count($blockParameter); $i ++) { + if ($blockParameter[ $i ][ 3 ] <= $block[ 3 ]) { + $index = $blockParameter[ $i ][ 2 ]; + } + } + $block[ 2 ] = $index; + $callStack = array(&$block); + } elseif ($type == 2) { + $index = $callStack[ 0 ][ 2 ]; + if ($index == 0) { + return; + } + $callStack = $block = array(1 => false); + } + $index --; + // find lowest level child block + while ($index >= 0 && ($type || !$block[ 1 ])) { + $block = &$blockParameter[ $index ]; + array_unshift($callStack, $block); + if ($block[ 1 ]) { + break; + } + $index --; + } + if (isset($block[ 'hide' ]) && $index <= 0) { + return; + } + } + $this->blockNesting ++; + // {block append} ? + if (isset($block[ 'append' ])) { + $appendStack = $callStack; + if ($type == 0) { + array_shift($appendStack); + } + $this->processBlock($tpl, 3, $name, null, $appendStack); + } + // call block of current stack level + if (isset($block[6])) { + $block[6]($tpl, $callStack); + } else { + $block[0]($tpl, $callStack); + } + // {block prepend} ? + if (isset($block[ 'prepend' ])) { + $prependStack = $callStack; + if ($type == 0) { + array_shift($prependStack); + } + $this->processBlock($tpl, 3, $name, null, $prependStack); + } + $this->blockNesting --; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_runtime_subtemplate.php b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_subtemplate.php new file mode 100755 index 0000000..2c7623f --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_subtemplate.php @@ -0,0 +1,203 @@ +tplObjects) ? $parent->smarty->_getTemplateId($template, $cache_id, $compile_id, $caching) : + null; + // already in template cache? + /* @var Smarty_Internal_Template $tpl */ + if (isset($_templateId) && isset($this->tplObjects[$_templateId])) { + // clone cached template object because of possible recursive call + $tpl = clone $this->tplObjects[$_templateId]; + $tpl->parent = $parent; + // if $caching mode changed the compiled resource is invalid + if ((bool) $tpl->caching !== (bool) $caching) { + unset($tpl->compiled); + } + // get variables from calling scope + $tpl->tpl_vars = $parent->tpl_vars; + $tpl->config_vars = $parent->config_vars; + // get template functions + $tpl->tpl_function = $parent->tpl_function; + // copy inheritance object? + if (isset($parent->ext->_inheritance)) { + $tpl->ext->_inheritance = $parent->ext->_inheritance; + } else { + unset($tpl->ext->_inheritance); + } + } else { + $tpl = clone $parent; + $tpl->parent = $parent; + if (!isset($tpl->templateId) || $tpl->templateId !== $_templateId) { + $tpl->templateId = $_templateId; + $tpl->template_resource = $template; + $tpl->cache_id = $cache_id; + $tpl->compile_id = $compile_id; + if (isset($uid)) { + // for inline templates we can get all resource information from file dependency + if (isset($tpl->compiled->file_dependency[$uid])) { + list($filepath, $timestamp, $resource) = $tpl->compiled->file_dependency[$uid]; + $tpl->source = + new Smarty_Template_Source(isset($tpl->smarty->_cache['resource_handlers'][$resource]) ? + $tpl->smarty->_cache['resource_handlers'][$resource] : + Smarty_Resource::load($tpl->smarty, $resource), $tpl->smarty, + $filepath, $resource, $filepath); + $tpl->source->filepath = $filepath; + $tpl->source->timestamp = $timestamp; + $tpl->source->exists = true; + $tpl->source->uid = $uid; + } else { + $tpl->source = null; + } + } else { + $tpl->source = null; + } + if (!isset($tpl->source)) { + $tpl->source = Smarty_Template_Source::load($tpl); + unset($tpl->compiled); + } + unset($tpl->cached); + } + } + $tpl->caching = $caching; + $tpl->cache_lifetime = $cache_lifetime; + if ($caching == 9999) { + $tpl->cached = $parent->cached; + } + // set template scope + $tpl->scope = $scope; + $scopePtr = false; + if ($scope & ~Smarty::SCOPE_BUBBLE_UP) { + if ($scope == Smarty::SCOPE_GLOBAL) { + $tpl->tpl_vars = Smarty::$global_tpl_vars; + $tpl->config_vars = $tpl->smarty->config_vars; + $scopePtr = true; + } else { + if ($scope == Smarty::SCOPE_PARENT) { + $scopePtr = $parent; + } elseif ($scope == Smarty::SCOPE_SMARTY) { + $scopePtr = $tpl->smarty; + } else { + $scopePtr = $tpl; + while (isset($scopePtr->parent)) { + if ($scopePtr->parent->_objType != 2 && $scope & Smarty::SCOPE_TPL_ROOT) { + break; + } + $scopePtr = $scopePtr->parent; + } + } + $tpl->tpl_vars = $scopePtr->tpl_vars; + $tpl->config_vars = $scopePtr->config_vars; + } + } + + if (!isset($this->tplObjects[$tpl->_getTemplateId()]) && !$tpl->source->handler->recompiled) { + // if template is called multiple times set flag to to cache template objects + $forceTplCache = $forceTplCache || + (isset($this->subTplInfo[$tpl->template_resource]) && $this->subTplInfo[$tpl->template_resource] > 1); + // check if template object should be cached + if ($tpl->parent->_objType == 2 && isset($this->tplObjects[$tpl->parent->templateId]) || + ($forceTplCache && $tpl->smarty->resource_cache_mode & Smarty::RESOURCE_CACHE_AUTOMATIC) || + ($tpl->smarty->resource_cache_mode & Smarty::RESOURCE_CACHE_ON) + ) { + $this->tplObjects[$tpl->_getTemplateId()] = $tpl; + } + } + + if (!empty($data)) { + // set up variable values + foreach ($data as $_key => $_val) { + $tpl->tpl_vars[$_key] = new Smarty_Variable($_val); + } + } + if (isset($uid)) { + if ($parent->smarty->debugging) { + $parent->smarty->_debug->start_template($tpl); + $parent->smarty->_debug->start_render($tpl); + } + $tpl->compiled->getRenderedTemplateCode($tpl, $content_func); + if ($parent->smarty->debugging) { + $parent->smarty->_debug->end_template($tpl); + $parent->smarty->_debug->end_render($tpl); + } + if ($tpl->caching == 9999 && $tpl->compiled->has_nocache_code) { + $parent->cached->hashes[$tpl->compiled->nocache_hash] = true; + } + } else { + if (isset($tpl->compiled)) { + $tpl->compiled->render($tpl); + } else { + $tpl->render(); + } + } + if ($scopePtr) { + if ($scope == Smarty::SCOPE_GLOBAL) { + Smarty::$global_tpl_vars = $tpl->tpl_vars; + $tpl->smarty->config_vars = $tpl->config_vars; + } else { + $scopePtr->tpl_vars = $tpl->tpl_vars; + $scopePtr->config_vars = $tpl->config_vars; + } + } + } + + /** + * Get called subtemplates from compiled template and save call count + * + * @param \Smarty_Internal_Template $tpl + */ + public function registerSubTemplates(Smarty_Internal_Template $tpl) + { + foreach ($tpl->compiled->includes as $name => $count) { + if (isset($this->subTplInfo[$name])) { + $this->subTplInfo[$name] += $count; + } else { + $this->subTplInfo[$name] = $count; + } + } + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_runtime_tplfunction.php b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_tplfunction.php new file mode 100755 index 0000000..634ed5d --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_tplfunction.php @@ -0,0 +1,97 @@ +tpl_function[$name])) { + if (!$tpl->caching || ($tpl->caching && $nocache)) { + $function = $tpl->tpl_function[$name]['call_name']; + } else { + if (isset($tpl->tpl_function[$name]['call_name_caching'])) { + $function = $tpl->tpl_function[$name]['call_name_caching']; + } else { + $function = $tpl->tpl_function[$name]['call_name']; + } + } + if (function_exists($function)) { + $function ($tpl, $params); + return; + } + // try to load template function dynamically + if ($this->addTplFuncToCache($tpl, $name, $function)) { + $function ($tpl, $params); + return; + } + } + throw new SmartyException("Unable to find template function '{$name}'"); + } + + /** + * + * Add template function to cache file for nocache calls + * + * @param Smarty_Internal_Template $tpl + * @param string $_name template function name + * @param string $_function PHP function name + * + * @return bool + */ + public function addTplFuncToCache(Smarty_Internal_Template $tpl, $_name, $_function) + { + $funcParam = $tpl->tpl_function[$_name]; + if (is_file($funcParam['compiled_filepath'])) { + // read compiled file + $code = file_get_contents($funcParam['compiled_filepath']); + // grab template function + if (preg_match("/\/\* {$_function} \*\/([\S\s]*?)\/\*\/ {$_function} \*\//", $code, $match)) { + // grab source info from file dependency + preg_match("/\s*'{$funcParam['uid']}'([\S\s]*?)\),/", $code, $match1); + unset($code); + // make PHP function known + eval($match[0]); + if (function_exists($_function)) { + // search cache file template + $tplPtr = $tpl; + while (!isset($tplPtr->cached) && isset($tplPtr->parent)) { + $tplPtr = $tplPtr->parent; + } + // add template function code to cache file + if (isset($tplPtr->cached)) { + $cache = $tplPtr->cached; + $content = $cache->read($tplPtr); + if ($content) { + // check if we must update file dependency + if (!preg_match("/'{$funcParam['uid']}'(.*?)'nocache_hash'/", $content, $match2)) { + $content = preg_replace("/('file_dependency'(.*?)\()/", "\\1{$match1[0]}", $content); + } + $tplPtr->smarty->ext->_updateCache->write($cache, $tplPtr, preg_replace('/\s*\?>\s*$/', "\n", $content) . "\n" . + preg_replace(array('/^\s*<\?php\s+/', '/\s*\?>\s*$/'), "\n", + $match[0])); + } + } + return true; + } + } + } + return false; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_runtime_updatecache.php b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_updatecache.php new file mode 100755 index 0000000..a895a30 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_updatecache.php @@ -0,0 +1,170 @@ +hashes[$_template->compiled->nocache_hash]); + if (!empty($cached->hashes)) { + $hash_array = array(); + foreach ($cached->hashes as $hash => $foo) { + $hash_array[] = "/{$hash}/"; + } + $content = preg_replace($hash_array, $_template->compiled->nocache_hash, $content); + } + $_template->cached->has_nocache_code = false; + // get text between non-cached items + $cache_split = + preg_split("!/\*%%SmartyNocache:{$_template->compiled->nocache_hash}%%\*\/(.+?)/\*/%%SmartyNocache:{$_template->compiled->nocache_hash}%%\*/!s", + $content); + // get non-cached items + preg_match_all("!/\*%%SmartyNocache:{$_template->compiled->nocache_hash}%%\*\/(.+?)/\*/%%SmartyNocache:{$_template->compiled->nocache_hash}%%\*/!s", + $content, $cache_parts); + $content = ''; + // loop over items, stitch back together + foreach ($cache_split as $curr_idx => $curr_split) { + // escape PHP tags in template content + $content .= preg_replace('/(<%|%>|<\?php|<\?|\?>|)/', + "\n", $curr_split); + if (isset($cache_parts[0][$curr_idx])) { + $_template->cached->has_nocache_code = true; + $content .= $cache_parts[1][$curr_idx]; + } + } + if (!$no_output_filter && !$_template->compiled->has_nocache_code && + (isset($_template->smarty->autoload_filters['output']) || + isset($_template->smarty->registered_filters['output'])) + ) { + $content = $_template->smarty->ext->_filterHandler->runFilter('output', $content, $_template); + } + // write cache file content + $this->writeCachedContent($cached, $_template, $content); + } + + /** + * Cache was invalid , so render from compiled and write to cache + * + * @param \Smarty_Template_Cached $cached + * @param \Smarty_Internal_Template $_template + * @param $no_output_filter + * + * @throws \Exception + */ + public function updateCache(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $no_output_filter) + { + if ($_template->source->handler->uncompiled) { + ob_start(); + $_template->source->render($_template); + } else { + ob_start(); + if (!isset($_template->compiled)) { + $_template->loadCompiled(); + } + $_template->compiled->render($_template); + } + if ($_template->smarty->debugging) { + $_template->smarty->_debug->start_cache($_template); + } + $this->removeNoCacheHash($cached, $_template, $no_output_filter); + $compile_check = $_template->smarty->compile_check; + $_template->smarty->compile_check = false; + if (isset($_template->parent) && $_template->parent->_objType == 2) { + $_template->compiled->unifunc = $_template->parent->compiled->unifunc; + } + if (!$_template->cached->processed) { + $_template->cached->process($_template, true); + } + $_template->smarty->compile_check = $compile_check; + $cached->getRenderedTemplateCode($_template); + if ($_template->smarty->debugging) { + $_template->smarty->_debug->end_cache($_template); + } + } + + /** + * Writes the content to cache resource + * + * @param \Smarty_Template_Cached $cached + * @param Smarty_Internal_Template $_template + * @param string $content + * + * @return bool + */ + public function writeCachedContent(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content) + { + if ($_template->source->handler->recompiled || !($_template->caching == Smarty::CACHING_LIFETIME_CURRENT || + $_template->caching == Smarty::CACHING_LIFETIME_SAVED) + ) { + // don't write cache file + return false; + } + $content = $_template->smarty->ext->_codeFrame->create($_template, $content, '', true); + return $this->write($cached, $_template, $content); + } + + /** + * Write this cache object to handler + * + * @param \Smarty_Template_Cached $cached + * @param Smarty_Internal_Template $_template template object + * @param string $content content to cache + * + * @return bool success + */ + public function write(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content) + { + if (!$_template->source->handler->recompiled) { + if ($cached->handler->writeCachedContent($_template, $content)) { + $cached->content = null; + $cached->timestamp = time(); + $cached->exists = true; + $cached->valid = true; + $cached->cache_lifetime = $_template->cache_lifetime; + $cached->processed = false; + if ($_template->smarty->cache_locking) { + $cached->handler->releaseLock($_template->smarty, $cached); + } + + return true; + } + $cached->content = null; + $cached->timestamp = false; + $cached->exists = false; + $cached->valid = false; + $cached->processed = false; + } + + return false; + } + +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_runtime_updatescope.php b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_updatescope.php new file mode 100755 index 0000000..5a125a4 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_updatescope.php @@ -0,0 +1,55 @@ +scope) { + return; + } + foreach (array($scope, $tpl->scope) as $s) { + $s = ($bubble_up = $s >= Smarty::SCOPE_BUBBLE_UP) ? $s - Smarty::SCOPE_BUBBLE_UP : $s; + if ($bubble_up && $s) { + $ptr = $tpl->parent; + if (isset($ptr)) { + $ptr->tpl_vars[$varName] = $tpl->tpl_vars[$varName]; + $ptr = $ptr->parent; + } + if ($s == Smarty::SCOPE_PARENT) { + continue; + } + while (isset($ptr) && $ptr->_objType == 2) { + $ptr->tpl_vars[$varName] = $tpl->tpl_vars[$varName]; + $ptr = $ptr->parent; + } + if ($s == Smarty::SCOPE_TPL_ROOT) { + continue; + } elseif ($s == Smarty::SCOPE_SMARTY) { + $tpl->smarty->tpl_vars[$varName] = $tpl->tpl_vars[$varName]; + } elseif ($s == Smarty::SCOPE_GLOBAL) { + Smarty::$global_tpl_vars[$varName] = $tpl->tpl_vars[$varName]; + } elseif ($s == Smarty::SCOPE_ROOT) { + while (isset($ptr->parent)) { + $ptr = $ptr->parent; + } + $ptr->tpl_vars[$varName] = $tpl->tpl_vars[$varName]; + } + } + } + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_runtime_validatecompiled.php b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_validatecompiled.php new file mode 100755 index 0000000..7defd6c --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_validatecompiled.php @@ -0,0 +1,86 @@ +smarty->compile_check) || $tpl->smarty->compile_check == 1) + ) { + // check file dependencies at compiled code + foreach ($properties['file_dependency'] as $_file_to_check) { + if ($_file_to_check[2] == 'file' || $_file_to_check[2] == 'extends' || $_file_to_check[2] == 'php') { + if ($tpl->source->filepath == $_file_to_check[0]) { + // do not recheck current template + continue; + //$mtime = $tpl->source->getTimeStamp(); + } else { + // file and php types can be checked without loading the respective resource handlers + $mtime = is_file($_file_to_check[0]) ? filemtime($_file_to_check[0]) : false; + } + } elseif ($_file_to_check[2] == 'string') { + continue; + } else { + $handler = Smarty_Resource::load($tpl->smarty, $_file_to_check[2]); + if ($handler->checkTimestamps()) { + $source = Smarty_Template_Source::load($tpl, $tpl->smarty, $_file_to_check[ 0 ]); + $mtime = $source->getTimeStamp(); + } else { + continue; + } + } + if (!$mtime || $mtime > $_file_to_check[1]) { + $is_valid = false; + break; + } + } + } + if ($cache) { + // CACHING_LIFETIME_SAVED cache expiry has to be validated here since otherwise we'd define the unifunc + if ($tpl->caching === Smarty::CACHING_LIFETIME_SAVED && $properties['cache_lifetime'] >= 0 && + (time() > ($tpl->cached->timestamp + $properties['cache_lifetime'])) + ) { + $is_valid = false; + } + $tpl->cached->cache_lifetime = $properties['cache_lifetime']; + $tpl->cached->valid = $is_valid; + $resource = $tpl->cached; + } else { + $tpl->mustCompile = !$is_valid; + $resource = $tpl->compiled; + $resource->includes = isset($properties['includes']) ? $properties['includes'] : array(); + } + if ($is_valid) { + $resource->unifunc = $properties['unifunc']; + $resource->has_nocache_code = $properties['has_nocache_code']; + // $tpl->compiled->nocache_hash = $properties['nocache_hash']; + $resource->file_dependency = $properties['file_dependency']; + if (isset($properties['tpl_function'])) { + $tpl->tpl_function = $properties['tpl_function']; + } + } + return $is_valid && !function_exists($properties['unifunc']); + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_runtime_var.php b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_var.php new file mode 100755 index 0000000..8e09108 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_var.php @@ -0,0 +1,33 @@ +tpl_vars[$varName])) { + $tpl->tpl_vars[$varName] = new Smarty_Variable(array(), $nocache); + } else { + $tpl->tpl_vars[$varName] = clone $tpl->tpl_vars[$varName]; + if (!(is_array($tpl->tpl_vars[$varName]->value) || + $tpl->tpl_vars[$varName]->value instanceof ArrayAccess) + ) { + settype($tpl->tpl_vars[$varName]->value, 'array'); + } + } + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_runtime_writefile.php b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_writefile.php new file mode 100755 index 0000000..05c9737 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_runtime_writefile.php @@ -0,0 +1,90 @@ +_file_perms : 0644; + $_dir_perms = property_exists($smarty, '_dir_perms') ? (isset($smarty->_dir_perms) ? $smarty->_dir_perms : 0777) : 0771; + if ($_file_perms !== null) { + $old_umask = umask(0); + } + + $_dirpath = dirname($_filepath); + // if subdirs, create dir structure + if ($_dirpath !== '.' && !file_exists($_dirpath)) { + mkdir($_dirpath, $_dir_perms, true); + } + + // write to tmp file, then move to overt file lock race condition + $_tmp_file = $_dirpath . DS . str_replace(array('.', ','), '_', uniqid('wrt', true)); + if (!file_put_contents($_tmp_file, $_contents)) { + error_reporting($_error_reporting); + throw new SmartyException("unable to write file {$_tmp_file}"); + } + + /* + * Windows' rename() fails if the destination exists, + * Linux' rename() properly handles the overwrite. + * Simply unlink()ing a file might cause other processes + * currently reading that file to fail, but linux' rename() + * seems to be smart enough to handle that for us. + */ + if (Smarty::$_IS_WINDOWS) { + // remove original file + if (is_file($_filepath)) { + @unlink($_filepath); + } + // rename tmp file + $success = @rename($_tmp_file, $_filepath); + } else { + // rename tmp file + $success = @rename($_tmp_file, $_filepath); + if (!$success) { + // remove original file + if (is_file($_filepath)) { + @unlink($_filepath); + } + // rename tmp file + $success = @rename($_tmp_file, $_filepath); + } + } + if (!$success) { + error_reporting($_error_reporting); + throw new SmartyException("unable to write file {$_filepath}"); + } + if ($_file_perms !== null) { + // set file permissions + chmod($_filepath, $_file_perms); + umask($old_umask); + } + error_reporting($_error_reporting); + + return true; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_smartytemplatecompiler.php b/inc/libs/Smarty/sysplugins/smarty_internal_smartytemplatecompiler.php new file mode 100755 index 0000000..116bbea --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_smartytemplatecompiler.php @@ -0,0 +1,169 @@ +lexer_class = $lexer_class; + $this->parser_class = $parser_class; + } + + /** + * method to compile a Smarty template + * + * @param mixed $_content template source + * @param bool $isTemplateSource + * + * @return bool true if compiling succeeded, false if it failed + * @throws \SmartyCompilerException + */ + protected function doCompile($_content, $isTemplateSource = false) + { + /* here is where the compiling takes place. Smarty + tags in the templates are replaces with PHP code, + then written to compiled files. */ + // init the lexer/parser to compile the template + $this->parser = + new $this->parser_class(new $this->lexer_class(str_replace(array("\r\n", "\r"), "\n", $_content), $this), + $this); + if ($isTemplateSource && $this->template->caching) { + $this->parser->insertPhpCode("compiled->nocache_hash = '{$this->nocache_hash}';\n?>\n"); + } + if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('ASCII'); + } else { + $mbEncoding = null; + } + + if ($this->smarty->_parserdebug) { + $this->parser->PrintTrace(); + $this->parser->lex->PrintTrace(); + } + // get tokens from lexer and parse them + while ($this->parser->lex->yylex()) { + if ($this->smarty->_parserdebug) { + echo "
    Line {$this->parser->lex->line} Parsing  {$this->parser->yyTokenName[$this->parser->lex->token]} Token " .
    +                    htmlentities($this->parser->lex->value) . "
    "; + } + $this->parser->doParse($this->parser->lex->token, $this->parser->lex->value); + } + + // finish parsing process + $this->parser->doParse(0, 0); + if ($mbEncoding) { + mb_internal_encoding($mbEncoding); + } + // check for unclosed tags + if (count($this->_tag_stack) > 0) { + // get stacked info + list($openTag, $_data) = array_pop($this->_tag_stack); + $this->trigger_template_error("unclosed {$this->smarty->left_delimiter}" . $openTag . + "{$this->smarty->right_delimiter} tag"); + } + // call post compile callbacks + foreach ($this->postCompileCallbacks as $cb) { + $parameter = $cb; + $parameter[0] = $this; + call_user_func_array($cb[0], $parameter); + } + // return compiled code + return $this->prefixCompiledCode . $this->parser->retvalue . $this->postfixCompiledCode; + } + + /** + * Register a post compile callback + * - when the callback is called after template compiling the compiler object will be inserted as first parameter + * + * @param callback $callback + * @param array $parameter optional parameter array + * @param string $key optional key for callback + * @param bool $replace if true replace existing keyed callback + */ + public function registerPostCompileCallback($callback, $parameter = array(), $key = null, $replace = false) + { + array_unshift($parameter, $callback); + if (isset($key)) { + if ($replace || !isset($this->postCompileCallbacks[$key])) { + $this->postCompileCallbacks[$key] = $parameter; + } + } else { + $this->postCompileCallbacks[] = $parameter; + } + } + + /** + * Remove a post compile callback + * + * @param string $key callback key + */ + public function unregisterPostCompileCallback($key) + { + unset($this->postCompileCallbacks[$key]); + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_template.php b/inc/libs/Smarty/sysplugins/smarty_internal_template.php new file mode 100755 index 0000000..7c16a53 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_template.php @@ -0,0 +1,376 @@ +smarty = &$smarty; + // Smarty parameter + $this->cache_id = $_cache_id === null ? $this->smarty->cache_id : $_cache_id; + $this->compile_id = $_compile_id === null ? $this->smarty->compile_id : $_compile_id; + $this->caching = $_caching === null ? $this->smarty->caching : $_caching; + if ($this->caching === true) { + $this->caching = Smarty::CACHING_LIFETIME_CURRENT; + } + $this->cache_lifetime = $_cache_lifetime === null ? $this->smarty->cache_lifetime : $_cache_lifetime; + $this->parent = $_parent; + // Template resource + $this->template_resource = $template_resource; + $this->source = Smarty_Template_Source::load($this); + parent::__construct(); + } + + /** + * render template + * + * @param bool $merge_tpl_vars if true parent template variables merged in to local scope + * @param bool $no_output_filter if true do not run output filter + * @param bool $display true: display, false: fetch null: subtemplate + * + * @throws Exception + * @throws SmartyException + * @return string rendered template output + */ + public function render($no_output_filter = true, $display = null) + { + $parentIsTpl = isset($this->parent) && $this->parent->_objType == 2; + if ($this->smarty->debugging) { + $this->smarty->_debug->start_template($this, $display); + } + // checks if template exists + if (!$this->source->exists) { + if ($parentIsTpl) { + $parent_resource = " in '{$this->parent->template_resource}'"; + } else { + $parent_resource = ''; + } + throw new SmartyException("Unable to load template {$this->source->type} '{$this->source->name}'{$parent_resource}"); + } + // disable caching for evaluated code + if ($this->source->handler->recompiled) { + $this->caching = false; + } + // read from cache or render + $isCacheTpl = + $this->caching == Smarty::CACHING_LIFETIME_CURRENT || $this->caching == Smarty::CACHING_LIFETIME_SAVED; + if ($isCacheTpl) { + if (!isset($this->cached)) { + $this->loadCached(); + } + $this->cached->render($this, $no_output_filter); + } elseif ($this->source->handler->uncompiled) { + $this->source->render($this); + } else { + if (!isset($this->compiled)) { + $this->loadCompiled(); + } + $this->compiled->render($this); + } + + // display or fetch + if ($display) { + if ($this->caching && $this->smarty->cache_modified_check) { + $this->smarty->ext->_cachemodify->cacheModifiedCheck($this->cached, $this, + isset($content) ? $content : ob_get_clean()); + } else { + if ((!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) && + !$no_output_filter && (isset($this->smarty->autoload_filters['output']) || + isset($this->smarty->registered_filters['output'])) + ) { + echo $this->smarty->ext->_filterHandler->runFilter('output', ob_get_clean(), $this); + } else { + ob_end_flush(); + flush(); + } + } + if ($this->smarty->debugging) { + $this->smarty->_debug->end_template($this); + // debug output + $this->smarty->_debug->display_debug($this, true); + } + return ''; + } else { + if ($this->smarty->debugging) { + $this->smarty->_debug->end_template($this); + if ($this->smarty->debugging === 2 && $display === false) { + $this->smarty->_debug->display_debug($this, true); + } + } + if ($parentIsTpl) { + if (!empty($this->tpl_function)) { + $this->parent->tpl_function = array_merge($this->parent->tpl_function, $this->tpl_function); + } + foreach ($this->compiled->required_plugins as $code => $tmp1) { + foreach ($tmp1 as $name => $tmp) { + foreach ($tmp as $type => $data) { + $this->parent->compiled->required_plugins[$code][$name][$type] = $data; + } + } + } + } + if (!$no_output_filter && + (!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) && + (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output'])) + ) { + return $this->smarty->ext->_filterHandler->runFilter('output', ob_get_clean(), $this); + } + // return cache content + return null; + } + } + + /** + * Compiles the template + * If the template is not evaluated the compiled template is saved on disk + */ + public function compileTemplateSource() + { + return $this->compiled->compileTemplateSource($this); + } + + /** + * Writes the content to cache resource + * + * @param string $content + * + * @return bool + */ + public function writeCachedContent($content) + { + return $this->smarty->ext->_updateCache->writeCachedContent($this->cached, $this, $content); + } + + /** + * Get unique template id + * + * @return string + */ + public function _getTemplateId() + { + return isset($this->templateId) ? $this->templateId : $this->templateId = + $this->smarty->_getTemplateId($this->template_resource, $this->cache_id, $this->compile_id); + } + + /** + * runtime error not matching capture tags + */ + public function capture_error() + { + throw new SmartyException("Not matching {capture} open/close in \"{$this->template_resource}\""); + } + + /** + * Load compiled object + * + */ + public function loadCompiled() + { + if (!isset($this->compiled)) { + $this->compiled = Smarty_Template_Compiled::load($this); + } + } + + /** + * Load cached object + * + */ + public function loadCached() + { + if (!isset($this->cached)) { + $this->cached = Smarty_Template_Cached::load($this); + } + } + + /** + * Load compiler object + * + * @throws \SmartyException + */ + public function loadCompiler() + { + if (!class_exists($this->source->handler->compiler_class)) { + $this->smarty->loadPlugin($this->source->handler->compiler_class); + } + $this->compiler = new $this->source->handler->compiler_class($this->source->handler->template_lexer_class, + $this->source->handler->template_parser_class, + $this->smarty); + } + + /** + * Handle unknown class methods + * + * @param string $name unknown method-name + * @param array $args argument array + * + * @return mixed + * @throws SmartyException + */ + public function __call($name, $args) + { + // method of Smarty object? + if (method_exists($this->smarty, $name)) { + return call_user_func_array(array($this->smarty, $name), $args); + } + // parent + return parent::__call($name, $args); + } + + /** + * set Smarty property in template context + * + * @param string $property_name property name + * @param mixed $value value + * + * @throws SmartyException + */ + public function __set($property_name, $value) + { + switch ($property_name) { + case 'compiled': + case 'cached': + case 'compiler': + $this->$property_name = $value; + return; + default: + // Smarty property ? + if (property_exists($this->smarty, $property_name)) { + $this->smarty->$property_name = $value; + return; + } + } + throw new SmartyException("invalid template property '$property_name'."); + } + + /** + * get Smarty property in template context + * + * @param string $property_name property name + * + * @return mixed|Smarty_Template_Cached + * @throws SmartyException + */ + public function __get($property_name) + { + switch ($property_name) { + case 'compiled': + $this->loadCompiled(); + return $this->compiled; + + case 'cached': + $this->loadCached(); + return $this->cached; + + case 'compiler': + $this->loadCompiler(); + return $this->compiler; + default: + // Smarty property ? + if (property_exists($this->smarty, $property_name)) { + return $this->smarty->$property_name; + } + } + throw new SmartyException("template property '$property_name' does not exist."); + } + + /** + * Template data object destructor + */ + public function __destruct() + { + if ($this->smarty->cache_locking && isset($this->cached) && $this->cached->is_locked) { + $this->cached->handler->releaseLock($this->smarty, $this->cached); + } + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_templatebase.php b/inc/libs/Smarty/sysplugins/smarty_internal_templatebase.php new file mode 100755 index 0000000..9b4953d --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_templatebase.php @@ -0,0 +1,316 @@ +_execute($template, $cache_id, $compile_id, $parent, 0); + return $result === null ? ob_get_clean() : $result; + } + + /** + * displays a Smarty template + * + * @param string $template the resource handle of the template file or template object + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables + */ + public function display($template = null, $cache_id = null, $compile_id = null, $parent = null) + { + // display template + $this->_execute($template, $cache_id, $compile_id, $parent, 1); + } + + /** + * test if cache is valid + * + * @api Smarty::isCached() + * @link http://www.smarty.net/docs/en/api.is.cached.tpl + * + * @param null|string|\Smarty_Internal_Template $template the resource handle of the template file or template object + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables + * + * @return boolean cache status + */ + public function isCached($template = null, $cache_id = null, $compile_id = null, $parent = null) + { + return $this->_execute($template, $cache_id, $compile_id, $parent, 2); + } + + /** + * fetches a rendered Smarty template + * + * @param string $template the resource handle of the template file or template object + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables + * @param string $function function type 0 = fetch, 1 = display, 2 = isCache + * + * @return mixed + * @throws \Exception + * @throws \SmartyException + */ + private function _execute($template, $cache_id, $compile_id, $parent, $function) + { + $smarty = $this->_objType == 1 ? $this : $this->smarty; + if ($template === null) { + if ($this->_objType != 2) { + throw new SmartyException($function . '():Missing \'$template\' parameter'); + } else { + $template = clone $this; + } + } elseif (is_object($template)) { + if (!isset($template->_objType) || $template->_objType != 2) { + throw new SmartyException($function . '():Template object expected'); + } else { + /* @var Smarty_Internal_Template $template */ + $template = clone $template; + } + } else { + // get template object + /* @var Smarty_Internal_Template $template */ + $template = $smarty->createTemplate($template, $cache_id, $compile_id, $parent, false); + if ($this->_objType == 1) { + // set caching in template object + $template->caching = $this->caching; + } + } + // fetch template content + $level = ob_get_level(); + try { + $_smarty_old_error_level = + ($this->_objType == 1 && isset($smarty->error_reporting)) ? error_reporting($smarty->error_reporting) : + null; + if ($function == 2) { + if ($template->caching) { + // return cache status of template + if (!isset($template->cached)) { + $template->loadCached(); + } + $result = $template->cached->isCached($template); + $template->smarty->_cache['isCached'][$template->_getTemplateId()] = $template; + } else { + return false; + } + } else { + ob_start(); + $template->_mergeVars(); + if (!empty(Smarty::$global_tpl_vars)) { + $template->tpl_vars = array_merge(Smarty::$global_tpl_vars, $template->tpl_vars); + } + $result = $template->render(false, $function); + } + if (isset($_smarty_old_error_level)) { + error_reporting($_smarty_old_error_level); + } + return $result; + } + catch (Exception $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + throw $e; + } + } + + /** + * Registers plugin to be used in templates + * + * @api Smarty::registerPlugin() + * @link http://www.smarty.net/docs/en/api.register.plugin.tpl + * + * @param string $type plugin type + * @param string $name name of template tag + * @param callback $callback PHP callback to register + * @param bool $cacheable if true (default) this function is cache able + * @param mixed $cache_attr caching attributes if any + * + * @return \Smarty|\Smarty_Internal_Template + * @throws SmartyException when the plugin tag is invalid + */ + public function registerPlugin($type, $name, $callback, $cacheable = true, $cache_attr = null) + { + return $this->ext->registerPlugin->registerPlugin($this, $type, $name, $callback, $cacheable, $cache_attr); + } + + /** + * load a filter of specified type and name + * + * @api Smarty::loadFilter() + * @link http://www.smarty.net/docs/en/api.load.filter.tpl + * + * @param string $type filter type + * @param string $name filter name + * + * @return bool + * @throws SmartyException if filter could not be loaded + */ + public function loadFilter($type, $name) + { + return $this->ext->loadFilter->loadFilter($this, $type, $name); + } + + /** + * Registers a filter function + * + * @api Smarty::registerFilter() + * @link http://www.smarty.net/docs/en/api.register.filter.tpl + * + * @param string $type filter type + * @param callback $callback + * @param string|null $name optional filter name + * + * @return \Smarty|\Smarty_Internal_Template + * @throws \SmartyException + */ + public function registerFilter($type, $callback, $name = null) + { + return $this->ext->registerFilter->registerFilter($this, $type, $callback, $name); + } + + /** + * Registers object to be used in templates + * + * @api Smarty::registerObject() + * @link http://www.smarty.net/docs/en/api.register.object.tpl + * + * @param string $object_name + * @param object $object the referenced PHP object to register + * @param array $allowed_methods_properties list of allowed methods (empty = all) + * @param bool $format smarty argument format, else traditional + * @param array $block_methods list of block-methods + * + * @return \Smarty|\Smarty_Internal_Template + * @throws \SmartyException + */ + public function registerObject($object_name, $object, $allowed_methods_properties = array(), $format = true, + $block_methods = array()) + { + return $this->ext->registerObject->registerObject($this, $object_name, $object, $allowed_methods_properties, + $format, $block_methods); + } + + /** + * @param boolean $caching + */ + public function setCaching($caching) + { + $this->caching = $caching; + } + + /** + * @param int $cache_lifetime + */ + public function setCacheLifetime($cache_lifetime) + { + $this->cache_lifetime = $cache_lifetime; + } + + /** + * @param string $compile_id + */ + public function setCompileId($compile_id) + { + $this->compile_id = $compile_id; + } + + /** + * @param string $cache_id + */ + public function setCacheId($cache_id) + { + $this->cache_id = $cache_id; + } + +} + diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_templatecompilerbase.php b/inc/libs/Smarty/sysplugins/smarty_internal_templatecompilerbase.php new file mode 100755 index 0000000..6c3ea5f --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_templatecompilerbase.php @@ -0,0 +1,1170 @@ +smarty = $smarty; + $this->nocache_hash = str_replace(array('.', ','), '_', uniqid(rand(), true)); + } + + /** + * Method to compile a Smarty template + * + * @param Smarty_Internal_Template $template template object to compile + * @param bool $nocache true is shall be compiled in nocache mode + * @param null|Smarty_Internal_TemplateCompilerBase $parent_compiler + * + * @return bool true if compiling succeeded, false if it failed + * @throws \Exception + */ + public function compileTemplate(Smarty_Internal_Template $template, $nocache = null, + Smarty_Internal_TemplateCompilerBase $parent_compiler = null) + { + // get code frame of compiled template + $_compiled_code = $template->smarty->ext->_codeFrame->create($template, + $this->compileTemplateSource($template, $nocache, + $parent_compiler), + $this->postFilter($this->blockOrFunctionCode) . + join('', $this->mergedSubTemplatesCode), false, + $this); + return $_compiled_code; + } + + /** + * Compile template source and run optional post filter + * + * @param \Smarty_Internal_Template $template + * @param null|bool $nocache flag if template must be compiled in nocache mode + * @param \Smarty_Internal_TemplateCompilerBase $parent_compiler + * + * @return string + * @throws \Exception + */ + public function compileTemplateSource(Smarty_Internal_Template $template, $nocache = null, + Smarty_Internal_TemplateCompilerBase $parent_compiler = null) + { + try { + // save template object in compiler class + $this->template = $template; + if (property_exists($this->template->smarty, 'plugin_search_order')) { + $this->plugin_search_order = $this->template->smarty->plugin_search_order; + } + if ($this->smarty->debugging) { + $this->smarty->_debug->start_compile($this->template); + } + if (isset($this->template->smarty->security_policy)) { + $this->php_handling = $this->template->smarty->security_policy->php_handling; + } else { + $this->php_handling = $this->template->smarty->php_handling; + } + $this->parent_compiler = $parent_compiler ? $parent_compiler : $this; + $nocache = isset($nocache) ? $nocache : false; + if (empty($template->compiled->nocache_hash)) { + $template->compiled->nocache_hash = $this->nocache_hash; + } else { + $this->nocache_hash = $template->compiled->nocache_hash; + } + // flag for nocache sections + $this->nocache = $nocache; + $this->tag_nocache = false; + // reset has nocache code flag + $this->template->compiled->has_nocache_code = false; + $this->has_variable_string = false; + $this->prefix_code = array(); + // add file dependency + $this->parent_compiler->template->compiled->file_dependency[ $this->template->source->uid ] = + array($this->template->source->filepath, $this->template->source->getTimeStamp(), + $this->template->source->type); + $this->smarty->_current_file = $this->template->source->filepath; + // get template source + if (!empty($this->template->source->components)) { + // we have array of inheritance templates by extends: resource + // generate corresponding source code sequence + $_content = + Smarty_Internal_Compile_Extends::extendsSourceArrayCode($this->template->source->components); + } else { + // get template source + $_content = $this->template->source->getContent(); + } + $_compiled_code = $this->postFilter($this->doCompile($this->preFilter($_content), true)); + } + catch (Exception $e) { + if ($this->smarty->debugging) { + $this->smarty->_debug->end_compile($this->template); + } + $this->_tag_stack = array(); + $this->_tag_objects = array(); + // free memory + $this->parent_compiler = null; + $this->template = null; + $this->parser = null; + throw $e; + } + if ($this->smarty->debugging) { + $this->smarty->_debug->end_compile($this->template); + } + $this->parent_compiler = null; + $this->template = null; + $this->parser = null; + return $_compiled_code; + } + + /** + * Optionally process compiled code by post filter + * + * @param string $code compiled code + * + * @return string + * @throws \SmartyException + */ + public function postFilter($code) + { + // run post filter if on code + if (!empty($code) && + (isset($this->smarty->autoload_filters[ 'post' ]) || isset($this->smarty->registered_filters[ 'post' ])) + ) { + return $this->smarty->ext->_filterHandler->runFilter('post', $code, $this->template); + } else { + return $code; + } + } + + /** + * Run optional prefilter + * + * @param string $_content template source + * + * @return string + * @throws \SmartyException + */ + public function preFilter($_content) + { + // run pre filter if required + if ($_content != '' && + ((isset($this->smarty->autoload_filters[ 'pre' ]) || isset($this->smarty->registered_filters[ 'pre' ]))) + ) { + return $this->smarty->ext->_filterHandler->runFilter('pre', $_content, $this->template); + } else { + return $_content; + } + } + + /** + * Compile Tag + * This is a call back from the lexer/parser + * + * Save current prefix code + * Compile tag + * Merge tag prefix code with saved one + * (required nested tags in attributes) + * + * @param string $tag tag name + * @param array $args array with tag attributes + * @param array $parameter array with compilation parameter + * + * @throws SmartyCompilerException + * @throws SmartyException + * @return string compiled code + */ + public function compileTag($tag, $args, $parameter = array()) + { + $this->prefixCodeStack[] = $this->prefix_code; + $this->prefix_code = array(); + $result = $this->compileTag2($tag, $args, $parameter); + $this->prefix_code = array_merge($this->prefix_code, array_pop($this->prefixCodeStack)); + return $result; + } + + /** + * Compile Tag + * + * @param string $tag tag name + * @param array $args array with tag attributes + * @param array $parameter array with compilation parameter + * + * @throws SmartyCompilerException + * @throws SmartyException + * @return string compiled code + */ + private function compileTag2($tag, $args, $parameter) + { + $plugin_type = ''; + // $args contains the attributes parsed and compiled by the lexer/parser + // assume that tag does compile into code, but creates no HTML output + $this->has_code = true; + $this->has_output = false; + // log tag/attributes + if (isset($this->smarty->_cache[ 'get_used_tags' ])) { + $this->template->_cache[ 'used_tags' ][] = array($tag, $args); + } + // check nocache option flag + if (in_array("'nocache'", $args) || in_array(array('nocache' => 'true'), $args) || + in_array(array('nocache' => '"true"'), $args) || in_array(array('nocache' => "'true'"), $args) + ) { + $this->tag_nocache = true; + } + // compile the smarty tag (required compile classes to compile the tag are auto loaded) + if (($_output = $this->callTagCompiler($tag, $args, $parameter)) === false) { + if (isset($this->parent_compiler->template->tpl_function[ $tag ])) { + // template defined by {template} tag + $args[ '_attr' ][ 'name' ] = "'" . $tag . "'"; + $_output = $this->callTagCompiler('call', $args, $parameter); + } + } + if ($_output !== false) { + if ($_output !== true) { + // did we get compiled code + if ($this->has_code) { + // Does it create output? + if ($this->has_output) { + $_output .= "\n"; + } + // return compiled code + return $_output; + } + } + // tag did not produce compiled code + return null; + } else { + // map_named attributes + if (isset($args[ '_attr' ])) { + foreach ($args[ '_attr' ] as $key => $attribute) { + if (is_array($attribute)) { + $args = array_merge($args, $attribute); + } + } + } + // not an internal compiler tag + if (strlen($tag) < 6 || substr($tag, - 5) != 'close') { + // check if tag is a registered object + if (isset($this->smarty->registered_objects[ $tag ]) && isset($parameter[ 'object_method' ])) { + $method = $parameter[ 'object_method' ]; + if (!in_array($method, $this->smarty->registered_objects[ $tag ][ 3 ]) && + (empty($this->smarty->registered_objects[ $tag ][ 1 ]) || + in_array($method, $this->smarty->registered_objects[ $tag ][ 1 ])) + ) { + return $this->callTagCompiler('private_object_function', $args, $parameter, $tag, $method); + } elseif (in_array($method, $this->smarty->registered_objects[ $tag ][ 3 ])) { + return $this->callTagCompiler('private_object_block_function', $args, $parameter, $tag, + $method); + } else { + // throw exception + $this->trigger_template_error('not allowed method "' . $method . '" in registered object "' . + $tag . '"', null, true); + } + } + // check if tag is registered + foreach (array(Smarty::PLUGIN_COMPILER, Smarty::PLUGIN_FUNCTION, Smarty::PLUGIN_BLOCK) as $plugin_type) + { + if (isset($this->smarty->registered_plugins[ $plugin_type ][ $tag ])) { + // if compiler function plugin call it now + if ($plugin_type == Smarty::PLUGIN_COMPILER) { + $new_args = array(); + foreach ($args as $key => $mixed) { + if (is_array($mixed)) { + $new_args = array_merge($new_args, $mixed); + } else { + $new_args[ $key ] = $mixed; + } + } + if (!$this->smarty->registered_plugins[ $plugin_type ][ $tag ][ 1 ]) { + $this->tag_nocache = true; + } + $function = $this->smarty->registered_plugins[ $plugin_type ][ $tag ][ 0 ]; + if (!is_array($function)) { + return $function($new_args, $this); + } elseif (is_object($function[ 0 ])) { + return $this->smarty->registered_plugins[ $plugin_type ][ $tag ][ 0 ][ 0 ]->{$function[ 1 ]}($new_args, + $this); + } else { + return call_user_func_array($function, array($new_args, $this)); + } + } + // compile registered function or block function + if ($plugin_type == Smarty::PLUGIN_FUNCTION || $plugin_type == Smarty::PLUGIN_BLOCK) { + return $this->callTagCompiler('private_registered_' . $plugin_type, $args, $parameter, + $tag); + } + } + } + // check plugins from plugins folder + foreach ($this->plugin_search_order as $plugin_type) { + if ($plugin_type == Smarty::PLUGIN_COMPILER && + $this->smarty->loadPlugin('smarty_compiler_' . $tag) && + (!isset($this->smarty->security_policy) || + $this->smarty->security_policy->isTrustedTag($tag, $this)) + ) { + $plugin = 'smarty_compiler_' . $tag; + if (is_callable($plugin)) { + // convert arguments format for old compiler plugins + $new_args = array(); + foreach ($args as $key => $mixed) { + if (is_array($mixed)) { + $new_args = array_merge($new_args, $mixed); + } else { + $new_args[ $key ] = $mixed; + } + } + + return $plugin($new_args, $this->smarty); + } + if (class_exists($plugin, false)) { + $plugin_object = new $plugin; + if (method_exists($plugin_object, 'compile')) { + return $plugin_object->compile($args, $this); + } + } + throw new SmartyException("Plugin \"{$tag}\" not callable"); + } else { + if ($function = $this->getPlugin($tag, $plugin_type)) { + if (!isset($this->smarty->security_policy) || + $this->smarty->security_policy->isTrustedTag($tag, $this) + ) { + return $this->callTagCompiler('private_' . $plugin_type . '_plugin', $args, $parameter, + $tag, $function); + } + } + } + } + if (is_callable($this->smarty->default_plugin_handler_func)) { + $found = false; + // look for already resolved tags + foreach ($this->plugin_search_order as $plugin_type) { + if (isset($this->default_handler_plugins[ $plugin_type ][ $tag ])) { + $found = true; + break; + } + } + if (!$found) { + // call default handler + foreach ($this->plugin_search_order as $plugin_type) { + if ($this->getPluginFromDefaultHandler($tag, $plugin_type)) { + $found = true; + break; + } + } + } + if ($found) { + // if compiler function plugin call it now + if ($plugin_type == Smarty::PLUGIN_COMPILER) { + $new_args = array(); + foreach ($args as $mixed) { + $new_args = array_merge($new_args, $mixed); + } + $function = $this->default_handler_plugins[ $plugin_type ][ $tag ][ 0 ]; + if (!is_array($function)) { + return $function($new_args, $this); + } elseif (is_object($function[ 0 ])) { + return $this->default_handler_plugins[ $plugin_type ][ $tag ][ 0 ][ 0 ]->$function[ 1 ]($new_args, + $this); + } else { + return call_user_func_array($function, array($new_args, $this)); + } + } else { + return $this->callTagCompiler('private_registered_' . $plugin_type, $args, $parameter, + $tag); + } + } + } + } else { + // compile closing tag of block function + $base_tag = substr($tag, 0, - 5); + // check if closing tag is a registered object + if (isset($this->smarty->registered_objects[ $base_tag ]) && isset($parameter[ 'object_method' ])) { + $method = $parameter[ 'object_method' ]; + if (in_array($method, $this->smarty->registered_objects[ $base_tag ][ 3 ])) { + return $this->callTagCompiler('private_object_block_function', $args, $parameter, $tag, + $method); + } else { + // throw exception + $this->trigger_template_error('not allowed closing tag method "' . $method . + '" in registered object "' . $base_tag . '"', null, true); + } + } + // registered block tag ? + if (isset($this->smarty->registered_plugins[ Smarty::PLUGIN_BLOCK ][ $base_tag ]) || + isset($this->default_handler_plugins[ Smarty::PLUGIN_BLOCK ][ $base_tag ]) + ) { + return $this->callTagCompiler('private_registered_block', $args, $parameter, $tag); + } + // registered function tag ? + if (isset($this->smarty->registered_plugins[ Smarty::PLUGIN_FUNCTION ][ $tag ])) { + return $this->callTagCompiler('private_registered_function', $args, $parameter, $tag); + } + // block plugin? + if ($function = $this->getPlugin($base_tag, Smarty::PLUGIN_BLOCK)) { + return $this->callTagCompiler('private_block_plugin', $args, $parameter, $tag, $function); + } + // function plugin? + if ($function = $this->getPlugin($tag, Smarty::PLUGIN_FUNCTION)) { + if (!isset($this->smarty->security_policy) || + $this->smarty->security_policy->isTrustedTag($tag, $this) + ) { + return $this->callTagCompiler('private_function_plugin', $args, $parameter, $tag, $function); + } + } + // registered compiler plugin ? + if (isset($this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ])) { + // if compiler function plugin call it now + $args = array(); + if (!$this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 1 ]) { + $this->tag_nocache = true; + } + $function = $this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 0 ]; + if (!is_array($function)) { + return $function($args, $this); + } elseif (is_object($function[ 0 ])) { + return $this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 0 ][ 0 ]->$function[ 1 ]($args, + $this); + } else { + return call_user_func_array($function, array($args, $this)); + } + } + if ($this->smarty->loadPlugin('smarty_compiler_' . $tag)) { + $plugin = 'smarty_compiler_' . $tag; + if (is_callable($plugin)) { + return $plugin($args, $this->smarty); + } + if (class_exists($plugin, false)) { + $plugin_object = new $plugin; + if (method_exists($plugin_object, 'compile')) { + return $plugin_object->compile($args, $this); + } + } + throw new SmartyException("Plugin \"{$tag}\" not callable"); + } + } + $this->trigger_template_error("unknown tag \"" . $tag . "\"", null, true); + } + } + + /** + * compile variable + * + * @param string $variable + * + * @return string + */ + public function compileVariable($variable) + { + if (strpos($variable, '(') == 0) { + // not a variable variable + $var = trim($variable, '\''); + $this->tag_nocache = $this->tag_nocache | + $this->template->ext->getTemplateVars->_getVariable($this->template, $var, null, true, false)->nocache; + // todo $this->template->compiled->properties['variables'][$var] = $this->tag_nocache | $this->nocache; + } + return '$_smarty_tpl->tpl_vars[' . $variable . ']->value'; + } + + /** + * compile config variable + * + * @param string $variable + * + * @return string + */ + public function compileConfigVariable($variable) + { + // return '$_smarty_tpl->config_vars[' . $variable . ']'; + return '$_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, ' . $variable . ')'; + } + + /** + * This method is called from parser to process a text content section + * - remove text from inheritance child templates as they may generate output + * - strip text if strip is enabled + * + * @param string $text + * + * @return null|\Smarty_Internal_ParseTree_Text + */ + public function processText($text) + { + if ((string) $text != '') { + $store = array(); + $_store = 0; + $_offset = 0; + if ($this->parser->strip) { + if (strpos($text, '<') !== false) { + // capture html elements not to be messed with + $_offset = 0; + if (preg_match_all('#(]*>.*?]*>)|(]*>.*?]*>)|(]*>.*?]*>)#is', + $text, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { + foreach ($matches as $match) { + $store[] = $match[ 0 ][ 0 ]; + $_length = strlen($match[ 0 ][ 0 ]); + $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@'; + $text = substr_replace($text, $replace, $match[ 0 ][ 1 ] - $_offset, $_length); + + $_offset += $_length - strlen($replace); + $_store ++; + } + } + + $expressions = array(// replace multiple spaces between tags by a single space + // can't remove them entirely, becaue that might break poorly implemented CSS display:inline-block elements + '#(:SMARTY@!@|>)\s+(?=@!@SMARTY:|<)#s' => '\1 \2', + // remove spaces between attributes (but not in attribute values!) + '#(([a-z0-9]\s*=\s*("[^"]*?")|(\'[^\']*?\'))|<[a-z0-9_]+)\s+([a-z/>])#is' => '\1 \5', + '#^\s+<#Ss' => '<', + '#>\s+$#Ss' => '>', + $this->stripRegEx => ''); + + $text = preg_replace(array_keys($expressions), array_values($expressions), $text); + $_offset = 0; + if (preg_match_all('#@!@SMARTY:([0-9]+):SMARTY@!@#is', $text, $matches, + PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { + foreach ($matches as $match) { + $_length = strlen($match[ 0 ][ 0 ]); + $replace = $store[ $match[ 1 ][ 0 ] ]; + $text = substr_replace($text, $replace, $match[ 0 ][ 1 ] + $_offset, $_length); + + $_offset += strlen($replace) - $_length; + $_store ++; + } + } + } else { + $text = preg_replace($this->stripRegEx, '', $text); + } + } + return new Smarty_Internal_ParseTree_Text($text); + } + return null; + } + + /** + * lazy loads internal compile plugin for tag and calls the compile method + * compile objects cached for reuse. + * class name format: Smarty_Internal_Compile_TagName + * plugin filename format: Smarty_Internal_TagName.php + * + * @param string $tag tag name + * @param array $args list of tag attributes + * @param mixed $param1 optional parameter + * @param mixed $param2 optional parameter + * @param mixed $param3 optional parameter + * + * @return string compiled code + */ + public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null) + { + // re-use object if already exists + if (!isset($this->_tag_objects[ $tag ])) { + // lazy load internal compiler plugin + $_tag = explode('_', $tag); + $_tag = array_map('ucfirst', $_tag); + $class_name = 'Smarty_Internal_Compile_' . implode('_', $_tag); + if (class_exists($class_name) && + (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this)) + ) { + $this->_tag_objects[ $tag ] = new $class_name; + } else { + $this->_tag_objects[ $tag ] = false; + return false; + } + } + // compile this tag + return $this->_tag_objects[ $tag ] === false ? false : + $this->_tag_objects[ $tag ]->compile($args, $this, $param1, $param2, $param3); + } + + /** + * Check for plugins and return function name + * + * @param $plugin_name + * @param string $plugin_type type of plugin + * + * @return string call name of function + */ + public function getPlugin($plugin_name, $plugin_type) + { + $function = null; + if ($this->template->caching && ($this->nocache || $this->tag_nocache)) { + if (isset($this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ])) { + $function = + $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ]; + } elseif (isset($this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ])) { + $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ] = + $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ]; + $function = + $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ]; + } + } else { + if (isset($this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ])) { + $function = + $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'function' ]; + } elseif (isset($this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ])) { + $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ] = + $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ]; + $function = + $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'function' ]; + } + } + if (isset($function)) { + if ($plugin_type == 'modifier') { + $this->modifier_plugins[ $plugin_name ] = true; + } + + return $function; + } + // loop through plugin dirs and find the plugin + $function = 'smarty_' . $plugin_type . '_' . $plugin_name; + $file = $this->smarty->loadPlugin($function, false); + + if (is_string($file)) { + if ($this->template->caching && ($this->nocache || $this->tag_nocache)) { + $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'file' ] = + $file; + $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ] = + $function; + } else { + $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'file' ] = + $file; + $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'function' ] = + $function; + } + if ($plugin_type == 'modifier') { + $this->modifier_plugins[ $plugin_name ] = true; + } + + return $function; + } + if (is_callable($function)) { + // plugin function is defined in the script + return $function; + } + + return false; + } + + /** + * Check for plugins by default plugin handler + * + * @param string $tag name of tag + * @param string $plugin_type type of plugin + * + * @return boolean true if found + */ + public function getPluginFromDefaultHandler($tag, $plugin_type) + { + $callback = null; + $script = null; + $cacheable = true; + $result = call_user_func_array($this->smarty->default_plugin_handler_func, + array($tag, $plugin_type, $this->template, &$callback, &$script, &$cacheable)); + if ($result) { + $this->tag_nocache = $this->tag_nocache || !$cacheable; + if ($script !== null) { + if (is_file($script)) { + if ($this->template->caching && ($this->nocache || $this->tag_nocache)) { + $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $tag ][ $plugin_type ][ 'file' ] = + $script; + $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $tag ][ $plugin_type ][ 'function' ] = + $callback; + } else { + $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $tag ][ $plugin_type ][ 'file' ] = + $script; + $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $tag ][ $plugin_type ][ 'function' ] = + $callback; + } + require_once $script; + } else { + $this->trigger_template_error("Default plugin handler: Returned script file \"{$script}\" for \"{$tag}\" not found"); + } + } + if (!is_string($callback) && + !(is_array($callback) && is_string($callback[ 0 ]) && is_string($callback[ 1 ])) + ) { + $this->trigger_template_error("Default plugin handler: Returned callback for \"{$tag}\" must be a static function name or array of class and function name"); + } + if (is_callable($callback)) { + $this->default_handler_plugins[ $plugin_type ][ $tag ] = array($callback, true, array()); + + return true; + } else { + $this->trigger_template_error("Default plugin handler: Returned callback for \"{$tag}\" not callable"); + } + } + + return false; + } + + /** + * Append code segments and remove unneeded ?> \s*$/', $left) && preg_match('/^\s*<\?php\s+/', $right)) { + $left = preg_replace('/\s*\?>\s*$/', "\n", $left); + $left .= preg_replace('/^\s*<\?php\s+/', '', $right); + } else { + $left .= $right; + } + return $left; + } + + /** + * Inject inline code for nocache template sections + * This method gets the content of each template element from the parser. + * If the content is compiled code and it should be not cached the code is injected + * into the rendered output. + * + * @param string $content content of template element + * @param boolean $is_code true if content is compiled code + * + * @return string content + */ + public function processNocacheCode($content, $is_code) + { + // If the template is not evaluated and we have a nocache section and or a nocache tag + if ($is_code && !empty($content)) { + // generate replacement code + if ((!($this->template->source->handler->recompiled) || $this->forceNocache) && $this->template->caching && + !$this->suppressNocacheProcessing && ($this->nocache || $this->tag_nocache) + ) { + $this->template->compiled->has_nocache_code = true; + $_output = addcslashes($content, '\'\\'); + $_output = str_replace("^#^", "'", $_output); + $_output = "nocache_hash}%%*/" . $_output . + "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\n"; + // make sure we include modifier plugins for nocache code + foreach ($this->modifier_plugins as $plugin_name => $dummy) { + if (isset($this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ 'modifier' ])) { + $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ 'modifier' ] = + $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ 'modifier' ]; + } + } + } else { + $_output = $content; + } + } else { + $_output = $content; + } + $this->modifier_plugins = array(); + $this->suppressNocacheProcessing = false; + $this->tag_nocache = false; + + return $_output; + } + + /** + * Get Id + * + * @param string $input + * + * @return bool|string + */ + public function getId($input) + { + if (preg_match('~^[\'"]*([0-9]*[a-zA-Z_]\w*)[\'"]*$~', $input, $match)) { + return $match[ 1 ]; + } + return false; + } + + /** + * Get variable name from string + * + * @param string $input + * + * @return bool|string + */ + public function getVariableName($input) + { + if (preg_match('~^[$]_smarty_tpl->tpl_vars\[[\'"]*([0-9]*[a-zA-Z_]\w*)[\'"]*\]->value$~', $input, $match)) { + return $match[ 1 ]; + } + return false; + } + + /** + * Generate nocache code string + * + * @param string $code PHP code + * + * @return string + */ + public function makeNocacheCode($code) + { + return "echo '/*%%SmartyNocache:{$this->nocache_hash}%%*//*/%%SmartyNocache:{$this->nocache_hash}%%*/';\n"; + } + + /** + * display compiler error messages without dying + * If parameter $args is empty it is a parser detected syntax error. + * In this case the parser is called to obtain information about expected tokens. + * If parameter $args contains a string this is used as error message + * + * @param string $args individual error message or null + * @param string $line line-number + * @param null|bool $tagline if true the line number of last tag + * + * @throws \SmartyCompilerException when an unexpected token is found + */ + public function trigger_template_error($args = null, $line = null, $tagline = null) + { + $lex = $this->parser->lex; + if ($tagline === true) { + // get line number of Tag + $line = $lex->taglineno; + } elseif (!isset($line)) { + // get template source line which has error + $line = $lex->line; + } else { + $line = (int) $line; + } + + if (in_array($this->template->source->type, array('eval', 'string'))) { + $templateName = $this->template->source->type . ':' . trim(preg_replace('![\t\r\n]+!', ' ', + strlen($lex->data) > 40 ? + substr($lex->data, 0, 40) . + '...' : $lex->data)); + } else { + $templateName = $this->template->source->type . ':' . $this->template->source->filepath; + } + + // $line += $this->trace_line_offset; + $match = preg_split("/\n/", $lex->data); + $error_text = + 'Syntax error in template "' . (empty($this->trace_filepath) ? $templateName : $this->trace_filepath) . + '" on line ' . ($line + $this->trace_line_offset) . ' "' . + trim(preg_replace('![\t\r\n]+!', ' ', $match[ $line - 1 ])) . '" '; + if (isset($args)) { + // individual error message + $error_text .= $args; + } else { + $expect = array(); + // expected token from parser + $error_text .= ' - Unexpected "' . $lex->value . '"'; + if (count($this->parser->yy_get_expected_tokens($this->parser->yymajor)) <= 4) { + foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) { + $exp_token = $this->parser->yyTokenName[ $token ]; + if (isset($lex->smarty_token_names[ $exp_token ])) { + // token type from lexer + $expect[] = '"' . $lex->smarty_token_names[ $exp_token ] . '"'; + } else { + // otherwise internal token name + $expect[] = $this->parser->yyTokenName[ $token ]; + } + } + $error_text .= ', expected one of: ' . implode(' , ', $expect); + } + } + $e = new SmartyCompilerException($error_text); + $e->line = $line; + $e->source = trim(preg_replace('![\t\r\n]+!', ' ', $match[ $line - 1 ])); + $e->desc = $args; + $e->template = $this->template->source->filepath; + throw $e; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_templatelexer.php b/inc/libs/Smarty/sysplugins/smarty_internal_templatelexer.php new file mode 100755 index 0000000..993b7be --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_templatelexer.php @@ -0,0 +1,1135 @@ + + */ +class Smarty_Internal_Templatelexer +{ + /** + * Source + * + * @var string + */ + public $data; + + /** + * byte counter + * + * @var int + */ + public $counter; + + /** + * token number + * + * @var int + */ + public $token; + + /** + * token value + * + * @var string + */ + public $value; + + /** + * current line + * + * @var int + */ + public $line; + + /** + * tag start line + * + * @var + */ + public $taglineno; + + /** + * php code type + * + * @var string + */ + public $phpType = ''; + + /** + * escaped left delimiter + * + * @var string + */ + public $ldel = ''; + + /** + * escaped left delimiter length + * + * @var int + */ + public $ldel_length = 0; + + /** + * escaped right delimiter + * + * @var string + */ + public $rdel = ''; + + /** + * escaped right delimiter length + * + * @var int + */ + public $rdel_length = 0; + + /** + * state number + * + * @var int + */ + public $state = 1; + + /** + * Smarty object + * + * @var Smarty + */ + public $smarty = null; + + /** + * compiler object + * + * @var Smarty_Internal_TemplateCompilerBase + */ + public $compiler = null; + + /** + * literal tag nesting level + * + * @var int + */ + private $literal_cnt = 0; + + /** + * PHP start tag string + * + * @var string + */ + + /** + * trace file + * + * @var resource + */ + public $yyTraceFILE; + + /** + * trace prompt + * + * @var string + */ + public $yyTracePrompt; + + /** + * XML flag true while processing xml + * + * @var bool + */ + public $is_xml = false; + + /** + * state names + * + * @var array + */ + public $state_name = array(1 => 'TEXT', 2 => 'TAG', 3 => 'TAGBODY', 4 => 'LITERAL', 5 => 'DOUBLEQUOTEDSTRING',); + + /** + * storage for assembled token patterns + * + * @var string + */ + private $yy_global_pattern1 = null; + + private $yy_global_pattern2 = null; + + private $yy_global_pattern3 = null; + + private $yy_global_pattern4 = null; + + private $yy_global_pattern5 = null; + + /** + * token names + * + * @var array + */ + public $smarty_token_names = array( // Text for parser error messages + 'NOT' => '(!,not)', 'OPENP' => '(', 'CLOSEP' => ')', + 'OPENB' => '[', 'CLOSEB' => ']', 'PTR' => '->', 'APTR' => '=>', + 'EQUAL' => '=', 'NUMBER' => 'number', 'UNIMATH' => '+" , "-', + 'MATH' => '*" , "/" , "%', 'INCDEC' => '++" , "--', + 'SPACE' => ' ', 'DOLLAR' => '$', 'SEMICOLON' => ';', + 'COLON' => ':', 'DOUBLECOLON' => '::', 'AT' => '@', 'HATCH' => '#', + 'QUOTE' => '"', 'BACKTICK' => '`', 'VERT' => '"|" modifier', + 'DOT' => '.', 'COMMA' => '","', 'QMARK' => '"?"', + 'ID' => 'id, name', 'TEXT' => 'text', + 'LDELSLASH' => '{/..} closing tag', 'LDEL' => '{...} Smarty tag', + 'COMMENT' => 'comment', 'AS' => 'as', 'TO' => 'to', + 'PHP' => '" '"<", "==" ... logical operator', + 'TLOGOP' => '"lt", "eq" ... logical operator; "is div by" ... if condition', + 'SCOND' => '"is even" ... if condition',); + + /** + * constructor + * + * @param string $data template source + * @param Smarty_Internal_TemplateCompilerBase $compiler + */ + function __construct($data, Smarty_Internal_TemplateCompilerBase $compiler) + { + $this->data = $data; + $this->counter = 0; + if (preg_match('~^\xEF\xBB\xBF~i', $this->data, $match)) { + $this->counter += strlen($match[ 0 ]); + } + $this->line = 1; + $this->smarty = $compiler->smarty; + $this->compiler = $compiler; + $this->ldel = preg_quote($this->smarty->left_delimiter, '~'); + $this->ldel_length = strlen($this->smarty->left_delimiter); + $this->rdel = preg_quote($this->smarty->right_delimiter, '~'); + $this->rdel_length = strlen($this->smarty->right_delimiter); + $this->smarty_token_names[ 'LDEL' ] = $this->smarty->left_delimiter; + $this->smarty_token_names[ 'RDEL' ] = $this->smarty->right_delimiter; + } + + public function PrintTrace() + { + $this->yyTraceFILE = fopen('php://output', 'w'); + $this->yyTracePrompt = '
    '; + } + + /* + * Check if this tag is autoliteral + */ + public function isAutoLiteral() + { + return $this->smarty->auto_literal && isset($this->value[ $this->ldel_length ]) ? + strpos(" \n\t\r", $this->value[ $this->ldel_length ]) !== false : false; + } + + private $_yy_state = 1; + + private $_yy_stack = array(); + + public function yylex() + { + return $this->{'yylex' . $this->_yy_state}(); + } + + public function yypushstate($state) + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sState push %s\n", $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : + $this->_yy_state); + } + array_push($this->_yy_stack, $this->_yy_state); + $this->_yy_state = $state; + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : + $this->_yy_state); + } + } + + public function yypopstate() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sState pop %s\n", $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : + $this->_yy_state); + } + $this->_yy_state = array_pop($this->_yy_stack); + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : + $this->_yy_state); + } + } + + public function yybegin($state) + { + $this->_yy_state = $state; + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sState set %s\n", $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : + $this->_yy_state); + } + } + + public function yylex1() + { + if (!isset($this->yy_global_pattern1)) { + $this->yy_global_pattern1 = + "/\G([{][}])|\G(" . $this->ldel . "[*])|\G((" . $this->ldel . "\\s*php(.*?)" . $this->rdel . ")|(" . + $this->ldel . "\\s*[\/]php" . $this->rdel . "))|\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . + ")|\G(" . $this->ldel . "\\s*)|\G(\\s*" . $this->rdel . + ")|\G((<[?]((php\\s+|=)|\\s+))|(<[%])|(<[?]xml\\s+)|()|([?][>])|([%][>]))|\G([\S\s])/isS"; + } + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern1, $this->data, $yymatches, null, $this->counter)) { + $yysubmatches = $yymatches; + if (strlen($yysubmatches[ 0 ]) < 200) { + $yymatches = preg_grep("/(.|\s)+/", $yysubmatches); + } else { + $yymatches = array_filter($yymatches, 'strlen'); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . + substr($this->data, $this->counter, 5) . '... state TEXT'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r1_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + // skip this token + continue; + } + } else { + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[ $this->counter ]); + } + break; + } while (true); + } // end function + + const TEXT = 1; + + function yy_r1_1() + { + + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + + function yy_r1_2() + { + + preg_match("~[*]{$this->rdel}~", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter); + if (isset($match[ 0 ][ 1 ])) { + $to = $match[ 0 ][ 1 ] + strlen($match[ 0 ][ 0 ]); + } else { + $this->compiler->trigger_template_error("missing or misspelled comment closing tag '*{$this->smarty->right_delimiter}'"); + } + $this->value = substr($this->data, $this->counter, $to - $this->counter); + return false; + } + + function yy_r1_3() + { + + $obj = new Smarty_Internal_Compile_Private_Php(); + $obj->parsePhp($this); + } + + function yy_r1_7() + { + + if ($this->smarty->auto_literal && isset($this->value[ $this->ldel_length ]) ? + strpos(" \n\t\r", $this->value[ $this->ldel_length ]) !== false : false + ) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } else { + $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART; + $this->yypushstate(self::LITERAL); + } + } + + function yy_r1_8() + { + + if ($this->smarty->auto_literal && isset($this->value[ $this->ldel_length ]) ? + strpos(" \n\t\r", $this->value[ $this->ldel_length ]) !== false : false + ) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } else { + $this->yypushstate(self::TAG); + return true; + } + } + + function yy_r1_9() + { + + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + + function yy_r1_10() + { + + $obj = new Smarty_Internal_Compile_Private_Php(); + $obj->parsePhp($this); + } + + function yy_r1_19() + { + + $to = strlen($this->data); + preg_match("~($this->ldel)|(<[?]((php\s+|=)|\s+))|(<[%])|(<[?]xml\s+)|()|([?][>])|([%][>])~i", + $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter); + if (isset($match[ 0 ][ 1 ])) { + $to = $match[ 0 ][ 1 ]; + } + $this->value = substr($this->data, $this->counter, $to - $this->counter); + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + + public function yylex2() + { + if (!isset($this->yy_global_pattern2)) { + $this->yy_global_pattern2 = + "/\G(" . $this->ldel . "\\s*(if|elseif|else if|while)\\s+)|\G(" . $this->ldel . "\\s*for\\s+)|\G(" . + $this->ldel . "\\s*foreach(?![^\s]))|\G(" . $this->ldel . "\\s*setfilter\\s+)|\G(" . $this->ldel . + "\\s*[0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*" . $this->rdel . ")|\G(" . $this->ldel . + "\\s*[\/](?:(?!block)[0-9]*[a-zA-Z_]\\w*)\\s*" . $this->rdel . ")|\G(" . $this->ldel . + "\\s*[$][0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/])|\G(" . + $this->ldel . "\\s*)/isS"; + } + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern2, $this->data, $yymatches, null, $this->counter)) { + $yysubmatches = $yymatches; + if (strlen($yysubmatches[ 0 ]) < 200) { + $yymatches = preg_grep("/(.|\s)+/", $yysubmatches); + } else { + $yymatches = array_filter($yymatches, 'strlen'); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . + substr($this->data, $this->counter, 5) . '... state TAG'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r2_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + // skip this token + continue; + } + } else { + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[ $this->counter ]); + } + break; + } while (true); + } // end function + + const TAG = 2; + + function yy_r2_1() + { + + $this->token = Smarty_Internal_Templateparser::TP_LDELIF; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + + function yy_r2_3() + { + + $this->token = Smarty_Internal_Templateparser::TP_LDELFOR; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + + function yy_r2_4() + { + + $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + + function yy_r2_5() + { + + $this->token = Smarty_Internal_Templateparser::TP_LDELSETFILTER; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + + function yy_r2_6() + { + + $this->yypopstate(); + $this->token = Smarty_Internal_Templateparser::TP_SIMPLETAG; + $this->taglineno = $this->line; + } + + function yy_r2_8() + { + + $this->yypopstate(); + $this->token = Smarty_Internal_Templateparser::TP_CLOSETAG; + $this->taglineno = $this->line; + } + + function yy_r2_9() + { + + if ($this->_yy_stack[ count($this->_yy_stack) - 1 ] == self::TEXT) { + $this->yypopstate(); + $this->token = Smarty_Internal_Templateparser::TP_SIMPELOUTPUT; + $this->taglineno = $this->line; + } else { + $this->value = $this->smarty->left_delimiter; + $this->token = Smarty_Internal_Templateparser::TP_LDEL; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + } + + function yy_r2_11() + { + + $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + + function yy_r2_12() + { + + $this->token = Smarty_Internal_Templateparser::TP_LDEL; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + + public function yylex3() + { + if (!isset($this->yy_global_pattern3)) { + $this->yy_global_pattern3 = "/\G(\\s*" . $this->rdel . ")|\G(" . $this->ldel . + "\\s*)|\G([\"])|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G([$]smarty\\.block\\.(child|parent))|\G([$][0-9]*[a-zA-Z_]\\w*)|\G([$])|\G(\\s+is\\s+in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*(([!=][=]{1,2})|([<][=>]?)|([>][=]?)|[&|]{2})\\s*)|\G(\\s+(eq|ne|neq|gt|ge|gte|lt|le|lte|mod|and|or|xor|(is\\s+(not\\s+)?(odd|even|div)\\s+by))\\s+)|\G(\\s+is\\s+(not\\s+)?(odd|even))|\G(([!]\\s*)|(not\\s+))|\G([(](int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)[)]\\s*)|\G(\\s*[(]\\s*)|\G(\\s*[)])|\G(\\[\\s*)|\G(\\s*\\])|\G(\\s*[-][>]\\s*)|\G(\\s*[=][>]\\s*)|\G(\\s*[=]\\s*)|\G(([+]|[-]){2})|\G(\\s*([+]|[-])\\s*)|\G(\\s*([*]{1,2}|[%\/^&]|[<>]{2})\\s*)|\G([@])|\G([#])|\G(\\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\\s*[=]\\s*)|\G(([0-9]*[a-zA-Z_]\\w*)?(\\\\[0-9]*[a-zA-Z_]\\w*)+)|\G([0-9]*[a-zA-Z_]\\w*)|\G(\\d+)|\G([`])|\G([|])|\G([.])|\G(\\s*[,]\\s*)|\G(\\s*[;]\\s*)|\G([:]{2})|\G(\\s*[:]\\s*)|\G(\\s*[?]\\s*)|\G(0[xX][0-9a-fA-F]+)|\G(\\s+)|\G([\S\s])/isS"; + } + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern3, $this->data, $yymatches, null, $this->counter)) { + $yysubmatches = $yymatches; + if (strlen($yysubmatches[ 0 ]) < 200) { + $yymatches = preg_grep("/(.|\s)+/", $yysubmatches); + } else { + $yymatches = array_filter($yymatches, 'strlen'); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . + substr($this->data, $this->counter, 5) . '... state TAGBODY'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r3_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + // skip this token + continue; + } + } else { + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[ $this->counter ]); + } + break; + } while (true); + } // end function + + const TAGBODY = 3; + + function yy_r3_1() + { + + $this->token = Smarty_Internal_Templateparser::TP_RDEL; + $this->yypopstate(); + } + + function yy_r3_2() + { + + if ($this->smarty->auto_literal && isset($this->value[ $this->ldel_length ]) ? + strpos(" \n\t\r", $this->value[ $this->ldel_length ]) !== false : false + ) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } else { + $this->yypushstate(self::TAG); + return true; + } + } + + function yy_r3_3() + { + + $this->token = Smarty_Internal_Templateparser::TP_QUOTE; + $this->yypushstate(self::DOUBLEQUOTEDSTRING); + } + + function yy_r3_4() + { + + $this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING; + } + + function yy_r3_5() + { + + $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILDPARENT; + $this->taglineno = $this->line; + } + + function yy_r3_7() + { + + $this->token = Smarty_Internal_Templateparser::TP_DOLLARID; + } + + function yy_r3_8() + { + + $this->token = Smarty_Internal_Templateparser::TP_DOLLAR; + } + + function yy_r3_9() + { + + $this->token = Smarty_Internal_Templateparser::TP_ISIN; + } + + function yy_r3_10() + { + + $this->token = Smarty_Internal_Templateparser::TP_AS; + } + + function yy_r3_11() + { + + $this->token = Smarty_Internal_Templateparser::TP_TO; + } + + function yy_r3_12() + { + + $this->token = Smarty_Internal_Templateparser::TP_STEP; + } + + function yy_r3_13() + { + + $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF; + } + + function yy_r3_14() + { + + $this->token = Smarty_Internal_Templateparser::TP_LOGOP; + } + + function yy_r3_19() + { + + $this->token = Smarty_Internal_Templateparser::TP_TLOGOP; + } + + function yy_r3_24() + { + + $this->token = Smarty_Internal_Templateparser::TP_SINGLECOND; + } + + function yy_r3_27() + { + + $this->token = Smarty_Internal_Templateparser::TP_NOT; + } + + function yy_r3_30() + { + + $this->token = Smarty_Internal_Templateparser::TP_TYPECAST; + } + + function yy_r3_34() + { + + $this->token = Smarty_Internal_Templateparser::TP_OPENP; + } + + function yy_r3_35() + { + + $this->token = Smarty_Internal_Templateparser::TP_CLOSEP; + } + + function yy_r3_36() + { + + $this->token = Smarty_Internal_Templateparser::TP_OPENB; + } + + function yy_r3_37() + { + + $this->token = Smarty_Internal_Templateparser::TP_CLOSEB; + } + + function yy_r3_38() + { + + $this->token = Smarty_Internal_Templateparser::TP_PTR; + } + + function yy_r3_39() + { + + $this->token = Smarty_Internal_Templateparser::TP_APTR; + } + + function yy_r3_40() + { + + $this->token = Smarty_Internal_Templateparser::TP_EQUAL; + } + + function yy_r3_41() + { + + $this->token = Smarty_Internal_Templateparser::TP_INCDEC; + } + + function yy_r3_43() + { + + $this->token = Smarty_Internal_Templateparser::TP_UNIMATH; + } + + function yy_r3_45() + { + + $this->token = Smarty_Internal_Templateparser::TP_MATH; + } + + function yy_r3_47() + { + + $this->token = Smarty_Internal_Templateparser::TP_AT; + } + + function yy_r3_48() + { + + $this->token = Smarty_Internal_Templateparser::TP_HATCH; + } + + function yy_r3_49() + { + + // resolve conflicts with shorttag and right_delimiter starting with '=' + if (substr($this->data, $this->counter + strlen($this->value) - 1, $this->rdel_length) == + $this->smarty->right_delimiter + ) { + preg_match("~\s+~", $this->value, $match); + $this->value = $match[ 0 ]; + $this->token = Smarty_Internal_Templateparser::TP_SPACE; + } else { + $this->token = Smarty_Internal_Templateparser::TP_ATTR; + } + } + + function yy_r3_50() + { + + $this->token = Smarty_Internal_Templateparser::TP_NAMESPACE; + } + + function yy_r3_53() + { + + $this->token = Smarty_Internal_Templateparser::TP_ID; + } + + function yy_r3_54() + { + + $this->token = Smarty_Internal_Templateparser::TP_INTEGER; + } + + function yy_r3_55() + { + + $this->token = Smarty_Internal_Templateparser::TP_BACKTICK; + $this->yypopstate(); + } + + function yy_r3_56() + { + + $this->token = Smarty_Internal_Templateparser::TP_VERT; + } + + function yy_r3_57() + { + + $this->token = Smarty_Internal_Templateparser::TP_DOT; + } + + function yy_r3_58() + { + + $this->token = Smarty_Internal_Templateparser::TP_COMMA; + } + + function yy_r3_59() + { + + $this->token = Smarty_Internal_Templateparser::TP_SEMICOLON; + } + + function yy_r3_60() + { + + $this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON; + } + + function yy_r3_61() + { + + $this->token = Smarty_Internal_Templateparser::TP_COLON; + } + + function yy_r3_62() + { + + $this->token = Smarty_Internal_Templateparser::TP_QMARK; + } + + function yy_r3_63() + { + + $this->token = Smarty_Internal_Templateparser::TP_HEX; + } + + function yy_r3_64() + { + + $this->token = Smarty_Internal_Templateparser::TP_SPACE; + } + + function yy_r3_65() + { + + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + + public function yylex4() + { + if (!isset($this->yy_global_pattern4)) { + $this->yy_global_pattern4 = + "/\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/]literal\\s*" . + $this->rdel . ")|\G([\S\s])/isS"; + } + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern4, $this->data, $yymatches, null, $this->counter)) { + $yysubmatches = $yymatches; + if (strlen($yysubmatches[ 0 ]) < 200) { + $yymatches = preg_grep("/(.|\s)+/", $yysubmatches); + } else { + $yymatches = array_filter($yymatches, 'strlen'); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . + substr($this->data, $this->counter, 5) . '... state LITERAL'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r4_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + // skip this token + continue; + } + } else { + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[ $this->counter ]); + } + break; + } while (true); + } // end function + + const LITERAL = 4; + + function yy_r4_1() + { + + $this->literal_cnt ++; + $this->token = Smarty_Internal_Templateparser::TP_LITERAL; + } + + function yy_r4_2() + { + + if ($this->literal_cnt) { + $this->literal_cnt --; + $this->token = Smarty_Internal_Templateparser::TP_LITERAL; + } else { + $this->token = Smarty_Internal_Templateparser::TP_LITERALEND; + $this->yypopstate(); + } + } + + function yy_r4_3() + { + + $to = strlen($this->data); + preg_match("~{$this->ldel}[/]?literal{$this->rdel}~i", $this->data, $match, PREG_OFFSET_CAPTURE, + $this->counter); + if (isset($match[ 0 ][ 1 ])) { + $to = $match[ 0 ][ 1 ]; + } else { + $this->compiler->trigger_template_error("missing or misspelled literal closing tag"); + } + $this->value = substr($this->data, $this->counter, $to - $this->counter); + $this->token = Smarty_Internal_Templateparser::TP_LITERAL; + } + + public function yylex5() + { + if (!isset($this->yy_global_pattern5)) { + $this->yy_global_pattern5 = + "/\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/]literal\\s*" . + $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/])|\G(" . $this->ldel . "\\s*[0-9]*[a-zA-Z_]\\w*)|\G(" . + $this->ldel . + "\\s*)|\G([\"])|\G([`][$])|\G([$][0-9]*[a-zA-Z_]\\w*)|\G([$])|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=(" . + $this->ldel . "|\\$|`\\$|\")))|\G([\S\s])/isS"; + } + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern5, $this->data, $yymatches, null, $this->counter)) { + $yysubmatches = $yymatches; + if (strlen($yysubmatches[ 0 ]) < 200) { + $yymatches = preg_grep("/(.|\s)+/", $yysubmatches); + } else { + $yymatches = array_filter($yymatches, 'strlen'); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . ' an empty string. Input "' . + substr($this->data, $this->counter, 5) . '... state DOUBLEQUOTEDSTRING'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r5_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= strlen($this->data)) { + return false; // end of input + } + // skip this token + continue; + } + } else { + throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[ $this->counter ]); + } + break; + } while (true); + } // end function + + const DOUBLEQUOTEDSTRING = 5; + + function yy_r5_1() + { + + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + + function yy_r5_2() + { + + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + + function yy_r5_3() + { + + if ($this->smarty->auto_literal && isset($this->value[ $this->ldel_length ]) ? + strpos(" \n\t\r", $this->value[ $this->ldel_length ]) !== false : false + ) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } else { + $this->yypushstate(self::TAG); + return true; + } + } + + function yy_r5_4() + { + + if ($this->smarty->auto_literal && isset($this->value[ $this->ldel_length ]) ? + strpos(" \n\t\r", $this->value[ $this->ldel_length ]) !== false : false + ) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } else { + $this->yypushstate(self::TAG); + return true; + } + } + + function yy_r5_5() + { + + if ($this->smarty->auto_literal && isset($this->value[ $this->ldel_length ]) ? + strpos(" \n\t\r", $this->value[ $this->ldel_length ]) !== false : false + ) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } else { + $this->token = Smarty_Internal_Templateparser::TP_LDEL; + $this->taglineno = $this->line; + $this->yypushstate(self::TAGBODY); + } + } + + function yy_r5_6() + { + + $this->token = Smarty_Internal_Templateparser::TP_QUOTE; + $this->yypopstate(); + } + + function yy_r5_7() + { + + $this->token = Smarty_Internal_Templateparser::TP_BACKTICK; + $this->value = substr($this->value, 0, - 1); + $this->yypushstate(self::TAGBODY); + $this->taglineno = $this->line; + } + + function yy_r5_8() + { + + $this->token = Smarty_Internal_Templateparser::TP_DOLLARID; + } + + function yy_r5_9() + { + + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + + function yy_r5_10() + { + + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + + function yy_r5_14() + { + + $to = strlen($this->data); + $this->value = substr($this->data, $this->counter, $to - $this->counter); + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + +} + + \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_templateparser.php b/inc/libs/Smarty/sysplugins/smarty_internal_templateparser.php new file mode 100755 index 0000000..a745d1d --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_templateparser.php @@ -0,0 +1,2833 @@ +string = $s->string; + $this->metadata = $s->metadata; + } else { + $this->string = (string) $s; + if ($m instanceof TP_yyToken) { + $this->metadata = $m->metadata; + } elseif (is_array($m)) { + $this->metadata = $m; + } + } + } + + public function __toString() + { + return $this->string; + } + + public function offsetExists($offset) + { + return isset($this->metadata[ $offset ]); + } + + public function offsetGet($offset) + { + return $this->metadata[ $offset ]; + } + + public function offsetSet($offset, $value) + { + if ($offset === null) { + if (isset($value[ 0 ])) { + $x = ($value instanceof TP_yyToken) ? $value->metadata : $value; + $this->metadata = array_merge($this->metadata, $x); + + return; + } + $offset = count($this->metadata); + } + if ($value === null) { + return; + } + if ($value instanceof TP_yyToken) { + if ($value->metadata) { + $this->metadata[ $offset ] = $value->metadata; + } + } elseif ($value) { + $this->metadata[ $offset ] = $value; + } + } + + public function offsetUnset($offset) + { + unset($this->metadata[ $offset ]); + } +} + +class TP_yyStackEntry +{ + public $stateno; /* The state-number */ + public $major; /* The major token value. This is the code + ** number for the token at this stack level */ + public $minor; /* The user-supplied minor token value. This + ** is the value of the token */ +} + +; + +#line 11 "../smarty/lexer/smarty_internal_templateparser.y" + +/** + * Smarty Template Parser Class + * + * This is the template parser. + * It is generated from the smarty_internal_templateparser.y file + * + * @author Uwe Tews + */ +class Smarty_Internal_Templateparser +{ + #line 23 "../smarty/lexer/smarty_internal_templateparser.y" + + const Err1 = "Security error: Call to private object member not allowed"; + + const Err2 = "Security error: Call to dynamic object member not allowed"; + + const Err3 = "PHP in template not allowed. Use SmartyBC to enable it"; + + /** + * result status + * + * @var bool + */ + public $successful = true; + + /** + * return value + * + * @var mixed + */ + public $retvalue = 0; + + /** + * counter for prefix code + * + * @var int + */ + public static $prefix_number = 0; + + /** + * @var + */ + public $yymajor; + + /** + * last index of array variable + * + * @var mixed + */ + public $last_index; + + /** + * last variable name + * + * @var string + */ + public $last_variable; + + /** + * root parse tree buffer + * + * @var Smarty_Internal_ParseTree + */ + public $root_buffer; + + /** + * current parse tree object + * + * @var Smarty_Internal_ParseTree + */ + public $current_buffer; + + /** + * lexer object + * + * @var Smarty_Internal_Templatelexer + */ + public $lex; + + /** + * internal error flag + * + * @var bool + */ + private $internalError = false; + + /** + * {strip} status + * + * @var bool + */ + public $strip = false; + + /** + * compiler object + * + * @var Smarty_Internal_TemplateCompilerBase + */ + public $compiler = null; + + /** + * smarty object + * + * @var Smarty + */ + public $smarty = null; + + /** + * template object + * + * @var Smarty_Internal_Template + */ + public $template = null; + + /** + * block nesting level + * + * @var int + */ + public $block_nesting_level = 0; + + /** + * security object + * + * @var Smarty_Security + */ + public $security = null; + + /** + * template prefix array + * + * @var \Smarty_Internal_ParseTree[] + */ + public $template_prefix = array(); + + /** + * security object + * + * @var \Smarty_Internal_ParseTree[] + */ + public $template_postfix = array(); + + /** + * constructor + * + * @param Smarty_Internal_Templatelexer $lex + * @param Smarty_Internal_TemplateCompilerBase $compiler + */ + function __construct(Smarty_Internal_Templatelexer $lex, Smarty_Internal_TemplateCompilerBase $compiler) + { + $this->lex = $lex; + $this->compiler = $compiler; + $this->template = $this->compiler->template; + $this->smarty = $this->template->smarty; + $this->security = isset($this->smarty->security_policy) ? $this->smarty->security_policy : false; + $this->current_buffer = $this->root_buffer = new Smarty_Internal_ParseTree_Template(); + } + + /** + * insert PHP code in current buffer + * + * @param string $code + */ + public function insertPhpCode($code) + { + $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Tag($this, $code)); + } + + /** + * merge PHP code with prefix code and return parse tree tag object + * + * @param string $code + * + * @return Smarty_Internal_ParseTree_Tag + */ + public function mergePrefixCode($code) + { + $tmp = ''; + foreach ($this->compiler->prefix_code as $preCode) { + $tmp .= $preCode; + } + $this->compiler->prefix_code = array(); + $tmp .= $code; + return new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp, true)); + } + + const TP_VERT = 1; + + const TP_COLON = 2; + + const TP_PHP = 3; + + const TP_NOCACHE = 4; + + const TP_TEXT = 5; + + const TP_STRIPON = 6; + + const TP_STRIPOFF = 7; + + const TP_LITERALSTART = 8; + + const TP_LITERALEND = 9; + + const TP_LITERAL = 10; + + const TP_RDEL = 11; + + const TP_SIMPELOUTPUT = 12; + + const TP_LDEL = 13; + + const TP_DOLLARID = 14; + + const TP_EQUAL = 15; + + const TP_SIMPLETAG = 16; + + const TP_ID = 17; + + const TP_PTR = 18; + + const TP_LDELIF = 19; + + const TP_LDELFOR = 20; + + const TP_SEMICOLON = 21; + + const TP_INCDEC = 22; + + const TP_TO = 23; + + const TP_STEP = 24; + + const TP_LDELFOREACH = 25; + + const TP_SPACE = 26; + + const TP_AS = 27; + + const TP_APTR = 28; + + const TP_LDELSETFILTER = 29; + + const TP_SMARTYBLOCKCHILDPARENT = 30; + + const TP_CLOSETAG = 31; + + const TP_LDELSLASH = 32; + + const TP_ATTR = 33; + + const TP_INTEGER = 34; + + const TP_COMMA = 35; + + const TP_OPENP = 36; + + const TP_CLOSEP = 37; + + const TP_MATH = 38; + + const TP_UNIMATH = 39; + + const TP_ISIN = 40; + + const TP_INSTANCEOF = 41; + + const TP_QMARK = 42; + + const TP_NOT = 43; + + const TP_TYPECAST = 44; + + const TP_HEX = 45; + + const TP_DOT = 46; + + const TP_SINGLEQUOTESTRING = 47; + + const TP_DOUBLECOLON = 48; + + const TP_NAMESPACE = 49; + + const TP_AT = 50; + + const TP_HATCH = 51; + + const TP_OPENB = 52; + + const TP_CLOSEB = 53; + + const TP_DOLLAR = 54; + + const TP_LOGOP = 55; + + const TP_TLOGOP = 56; + + const TP_SINGLECOND = 57; + + const TP_QUOTE = 58; + + const TP_BACKTICK = 59; + + const YY_NO_ACTION = 527; + + const YY_ACCEPT_ACTION = 526; + + const YY_ERROR_ACTION = 525; + + const YY_SZ_ACTTAB = 2021; + + static public $yy_action = array(242, 10, 131, 178, 255, 76, 157, 5, 83, 293, 12, 149, 152, 116, 292, 93, 331, 217, + 284, 295, 221, 331, 226, 36, 21, 169, 35, 43, 308, 99, 26, 42, 39, 294, 235, 244, + 30, 200, 187, 80, 1, 251, 320, 206, 442, 123, 53, 242, 10, 130, 98, 255, 194, 399, + 5, 83, 442, 240, 298, 107, 116, 310, 174, 220, 217, 36, 295, 221, 399, 208, 135, + 21, 26, 161, 43, 399, 8, 174, 42, 39, 294, 235, 218, 331, 200, 187, 80, 1, 312, + 320, 11, 290, 313, 53, 242, 10, 133, 306, 255, 205, 187, 5, 83, 264, 266, 267, 211, + 116, 353, 220, 52, 217, 298, 295, 221, 206, 226, 220, 21, 290, 290, 43, 321, 36, + 249, 42, 39, 294, 235, 244, 26, 200, 206, 80, 1, 11, 320, 283, 52, 52, 53, 242, 10, + 132, 248, 255, 205, 455, 5, 83, 84, 301, 151, 455, 116, 323, 92, 36, 217, 2, 295, + 221, 331, 226, 26, 21, 290, 304, 43, 137, 36, 111, 42, 39, 294, 235, 244, 26, 200, + 187, 80, 1, 225, 320, 320, 52, 123, 53, 242, 10, 133, 98, 255, 193, 175, 5, 83, + 177, 280, 273, 234, 116, 310, 23, 278, 217, 13, 295, 221, 320, 203, 223, 21, 290, + 442, 43, 138, 187, 326, 42, 39, 294, 235, 244, 216, 200, 442, 80, 1, 4, 320, 329, + 52, 15, 53, 242, 10, 134, 91, 255, 205, 176, 5, 83, 293, 12, 16, 90, 116, 292, 300, + 99, 217, 241, 295, 221, 320, 226, 215, 28, 213, 201, 43, 105, 187, 286, 42, 39, + 294, 235, 244, 215, 200, 214, 80, 1, 105, 320, 11, 135, 285, 53, 242, 10, 133, 8, + 255, 205, 164, 5, 83, 442, 215, 19, 239, 116, 99, 105, 331, 217, 6, 295, 221, 442, + 192, 311, 21, 182, 289, 43, 308, 443, 32, 42, 39, 294, 235, 244, 296, 200, 17, 80, + 1, 443, 320, 262, 107, 26, 53, 242, 10, 133, 122, 255, 191, 172, 5, 83, 183, 188, + 148, 231, 116, 223, 168, 331, 217, 181, 295, 221, 331, 226, 206, 21, 331, 141, 43, + 308, 206, 38, 42, 39, 294, 235, 244, 331, 200, 188, 80, 1, 187, 320, 155, 206, 308, + 53, 242, 10, 133, 25, 255, 198, 188, 5, 83, 206, 145, 160, 308, 116, 228, 146, 206, + 217, 180, 295, 221, 331, 226, 286, 21, 331, 359, 43, 179, 289, 38, 42, 39, 294, + 235, 244, 250, 200, 271, 80, 1, 272, 320, 122, 94, 103, 53, 242, 10, 129, 3, 255, + 205, 144, 5, 83, 185, 289, 170, 99, 116, 270, 322, 331, 217, 184, 295, 221, 331, + 226, 99, 7, 171, 35, 43, 308, 89, 105, 42, 39, 294, 235, 244, 120, 200, 328, 80, 1, + 187, 320, 82, 223, 4, 53, 242, 10, 134, 142, 255, 205, 107, 5, 83, 309, 324, 302, + 20, 116, 316, 206, 291, 217, 290, 295, 221, 33, 226, 277, 28, 399, 243, 43, 257, + 219, 189, 42, 39, 294, 235, 244, 110, 200, 140, 80, 399, 147, 320, 253, 327, 258, + 53, 399, 14, 236, 220, 207, 154, 113, 65, 108, 319, 159, 238, 311, 98, 471, 471, + 330, 237, 279, 471, 210, 325, 245, 299, 310, 86, 308, 143, 268, 263, 259, 260, 269, + 177, 204, 287, 136, 242, 10, 150, 87, 255, 320, 139, 5, 83, 293, 12, 22, 195, 116, + 292, 247, 258, 217, 153, 295, 221, 220, 207, 36, 126, 50, 104, 109, 112, 88, 26, + 98, 246, 397, 330, 237, 85, 212, 210, 325, 245, 258, 310, 102, 299, 299, 220, 207, + 397, 113, 65, 108, 320, 299, 134, 397, 98, 222, 442, 330, 237, 299, 299, 210, 325, + 245, 258, 310, 299, 299, 442, 220, 207, 299, 126, 69, 108, 299, 288, 31, 299, 98, + 299, 299, 330, 237, 299, 299, 210, 325, 245, 80, 310, 299, 320, 299, 258, 299, 299, + 209, 299, 220, 207, 299, 126, 69, 108, 206, 299, 299, 455, 98, 299, 206, 330, 237, + 455, 365, 210, 325, 245, 299, 310, 355, 227, 258, 299, 299, 299, 199, 220, 207, 36, + 126, 64, 104, 299, 214, 36, 26, 98, 299, 442, 330, 237, 26, 299, 210, 325, 245, + 258, 310, 471, 471, 442, 220, 207, 471, 126, 69, 108, 293, 12, 299, 299, 98, 292, + 299, 330, 237, 299, 299, 210, 325, 245, 36, 310, 163, 299, 258, 299, 299, 26, 202, + 220, 207, 299, 126, 44, 108, 471, 299, 299, 299, 98, 299, 299, 330, 237, 299, 299, + 210, 325, 245, 299, 310, 299, 299, 258, 134, 299, 299, 252, 220, 207, 206, 126, 72, + 108, 299, 299, 299, 299, 98, 299, 396, 330, 237, 299, 299, 210, 325, 245, 258, 310, + 299, 299, 299, 220, 207, 396, 126, 74, 108, 254, 299, 80, 396, 98, 320, 299, 330, + 237, 299, 297, 210, 325, 245, 299, 310, 299, 242, 9, 299, 299, 255, 299, 258, 5, + 83, 299, 299, 220, 207, 116, 126, 68, 108, 217, 299, 295, 221, 98, 299, 299, 330, + 237, 299, 299, 210, 325, 245, 299, 310, 299, 258, 299, 299, 299, 299, 220, 207, + 299, 100, 70, 108, 299, 303, 29, 299, 98, 299, 299, 330, 237, 299, 297, 210, 325, + 245, 299, 310, 299, 242, 9, 299, 299, 255, 299, 299, 5, 83, 299, 299, 299, 299, + 116, 299, 299, 258, 217, 299, 295, 221, 220, 207, 299, 126, 66, 108, 299, 299, 299, + 299, 98, 293, 12, 330, 237, 299, 292, 210, 325, 245, 299, 310, 258, 299, 299, 305, + 29, 220, 207, 299, 126, 60, 108, 299, 293, 12, 299, 98, 299, 292, 330, 237, 299, + 299, 210, 325, 245, 299, 310, 232, 299, 258, 299, 206, 299, 299, 220, 207, 299, + 126, 49, 108, 299, 299, 299, 299, 98, 299, 299, 330, 237, 299, 230, 210, 325, 245, + 299, 310, 258, 167, 299, 299, 299, 220, 207, 299, 126, 58, 108, 299, 41, 40, 37, + 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 258, 299, 256, 275, 282, + 220, 97, 299, 81, 45, 106, 299, 299, 299, 299, 98, 299, 299, 330, 237, 299, 299, + 210, 325, 245, 299, 310, 299, 299, 258, 299, 206, 299, 299, 220, 207, 299, 126, 63, + 108, 299, 186, 299, 299, 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, + 258, 299, 299, 299, 299, 220, 197, 299, 114, 59, 108, 299, 41, 40, 37, 98, 299, + 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 258, 299, 256, 275, 282, 220, + 207, 299, 126, 55, 108, 299, 299, 299, 299, 98, 299, 299, 330, 237, 299, 299, 210, + 325, 245, 299, 310, 299, 299, 258, 299, 206, 299, 299, 220, 207, 299, 126, 57, 108, + 299, 41, 40, 37, 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 258, + 299, 256, 275, 282, 220, 95, 299, 81, 48, 106, 233, 41, 40, 37, 98, 299, 299, 330, + 237, 299, 299, 210, 325, 245, 299, 310, 258, 299, 256, 275, 282, 220, 207, 299, + 126, 78, 108, 299, 299, 299, 299, 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, + 299, 310, 299, 299, 258, 299, 206, 18, 299, 220, 207, 299, 96, 61, 108, 299, 299, + 299, 299, 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 258, 299, 299, + 299, 299, 220, 207, 299, 126, 47, 108, 299, 41, 40, 37, 98, 299, 299, 330, 237, + 299, 299, 210, 325, 245, 299, 310, 258, 299, 256, 275, 282, 220, 207, 299, 126, 75, + 108, 299, 299, 299, 299, 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, + 299, 299, 258, 299, 206, 299, 299, 220, 207, 299, 126, 64, 108, 299, 299, 299, 299, + 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 258, 299, 299, 299, 299, + 220, 207, 299, 126, 56, 108, 317, 41, 40, 37, 98, 299, 299, 330, 237, 299, 299, + 210, 325, 245, 299, 310, 258, 299, 256, 275, 282, 220, 207, 299, 115, 46, 108, 299, + 299, 299, 299, 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 299, 299, + 258, 299, 206, 299, 299, 220, 207, 299, 126, 79, 108, 299, 190, 299, 299, 98, 299, + 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 258, 299, 299, 299, 299, 220, + 207, 299, 126, 62, 108, 299, 41, 40, 37, 98, 299, 299, 330, 237, 299, 299, 210, + 325, 245, 299, 310, 258, 299, 256, 275, 282, 220, 207, 299, 126, 71, 108, 299, 299, + 299, 299, 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 299, 299, 258, + 299, 206, 299, 299, 220, 207, 299, 101, 67, 108, 299, 318, 299, 299, 98, 299, 299, + 330, 237, 299, 299, 210, 325, 245, 299, 310, 258, 299, 299, 299, 299, 220, 207, + 299, 126, 77, 108, 299, 41, 40, 37, 98, 299, 299, 330, 237, 299, 299, 210, 325, + 245, 299, 310, 258, 299, 256, 275, 282, 220, 196, 299, 126, 54, 108, 299, 299, 299, + 299, 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 299, 299, 258, 299, + 206, 299, 299, 220, 207, 299, 126, 73, 108, 299, 274, 299, 299, 98, 299, 299, 330, + 237, 299, 299, 210, 325, 245, 299, 310, 258, 299, 299, 299, 299, 220, 224, 299, + 118, 299, 108, 299, 41, 40, 37, 98, 299, 299, 299, 261, 299, 299, 210, 325, 245, + 299, 310, 258, 299, 256, 275, 282, 220, 224, 299, 128, 299, 108, 299, 299, 299, + 299, 98, 299, 299, 229, 315, 206, 299, 210, 325, 245, 299, 310, 299, 471, 471, 307, + 27, 299, 471, 455, 526, 51, 265, 266, 267, 211, 299, 299, 220, 299, 36, 299, 409, + 409, 299, 299, 299, 26, 299, 299, 299, 299, 41, 40, 37, 206, 299, 455, 299, 455, + 299, 471, 299, 455, 299, 299, 299, 299, 299, 256, 275, 282, 229, 299, 299, 117, + 299, 442, 299, 409, 409, 409, 471, 471, 299, 299, 299, 471, 455, 442, 299, 299, 41, + 40, 37, 299, 409, 409, 409, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 256, + 275, 282, 299, 299, 299, 299, 455, 299, 455, 258, 471, 299, 455, 281, 220, 224, + 299, 127, 299, 108, 299, 299, 299, 299, 98, 299, 299, 299, 299, 299, 299, 210, 325, + 245, 258, 310, 206, 156, 299, 220, 224, 175, 121, 299, 108, 299, 299, 331, 299, 98, + 23, 278, 299, 299, 299, 299, 210, 325, 245, 34, 310, 36, 299, 299, 187, 299, 299, + 299, 26, 299, 299, 258, 299, 41, 40, 37, 220, 224, 299, 125, 299, 108, 299, 299, + 299, 299, 98, 299, 299, 229, 256, 275, 282, 210, 325, 245, 299, 310, 299, 471, 471, + 258, 31, 299, 471, 455, 220, 224, 299, 124, 299, 108, 299, 299, 299, 299, 98, 299, + 299, 299, 299, 299, 299, 210, 325, 245, 258, 310, 206, 299, 299, 220, 224, 455, + 119, 455, 108, 471, 299, 455, 299, 98, 299, 299, 229, 299, 299, 24, 210, 325, 245, + 299, 310, 299, 471, 471, 299, 471, 471, 471, 455, 299, 471, 455, 206, 41, 40, 37, + 299, 299, 299, 471, 471, 299, 299, 299, 471, 455, 299, 299, 276, 299, 256, 275, + 282, 299, 299, 299, 455, 36, 455, 455, 471, 455, 455, 471, 26, 455, 299, 206, 403, + 41, 40, 37, 206, 455, 299, 455, 299, 471, 403, 455, 403, 299, 299, 403, 299, 299, + 256, 275, 282, 299, 403, 299, 403, 299, 403, 299, 299, 299, 299, 299, 299, 299, + 299, 223, 41, 40, 37, 299, 299, 41, 40, 37, 299, 299, 299, 299, 299, 299, 299, 299, + 173, 256, 275, 282, 175, 314, 256, 275, 282, 299, 331, 166, 299, 23, 278, 175, 162, + 299, 299, 299, 175, 331, 299, 299, 23, 278, 331, 187, 299, 23, 278, 158, 299, 299, + 299, 175, 299, 299, 187, 299, 299, 331, 165, 187, 23, 278, 175, 299, 299, 299, 299, + 299, 331, 299, 299, 23, 278, 299, 187, 299, 299, 299, 299, 299, 299, 299, 299, 299, + 299, 187,); + + static public $yy_lookahead = array(12, 13, 14, 80, 16, 17, 71, 19, 20, 12, 13, 71, 91, 25, 17, 75, 81, 29, 30, 31, + 32, 81, 34, 26, 36, 28, 15, 39, 93, 18, 33, 43, 44, 45, 46, 47, 28, 49, 98, 51, + 52, 70, 54, 1, 36, 74, 58, 12, 13, 14, 79, 16, 17, 11, 19, 20, 48, 86, 64, 48, + 25, 90, 75, 69, 29, 26, 31, 32, 26, 34, 46, 36, 33, 71, 39, 33, 52, 75, 43, 44, + 45, 46, 47, 81, 49, 98, 51, 52, 53, 54, 35, 22, 37, 58, 12, 13, 14, 103, 16, 17, + 98, 19, 20, 63, 64, 65, 66, 25, 11, 69, 41, 29, 64, 31, 32, 1, 34, 69, 36, 22, + 22, 39, 53, 26, 95, 43, 44, 45, 46, 47, 33, 49, 1, 51, 52, 35, 54, 37, 41, 41, + 58, 12, 13, 14, 14, 16, 17, 46, 19, 20, 102, 103, 71, 52, 25, 11, 75, 26, 29, + 36, 31, 32, 81, 34, 33, 36, 22, 17, 39, 14, 26, 48, 43, 44, 45, 46, 47, 33, 49, + 98, 51, 52, 70, 54, 54, 41, 74, 58, 12, 13, 14, 79, 16, 17, 75, 19, 20, 8, 9, + 10, 50, 25, 90, 84, 85, 29, 13, 31, 32, 54, 34, 46, 36, 22, 36, 39, 14, 98, 53, + 43, 44, 45, 46, 47, 46, 49, 48, 51, 52, 36, 54, 53, 41, 21, 58, 12, 13, 14, 36, + 16, 17, 75, 19, 20, 12, 13, 15, 35, 25, 17, 59, 18, 29, 22, 31, 32, 54, 34, 74, + 36, 76, 77, 39, 79, 98, 99, 43, 44, 45, 46, 47, 74, 49, 76, 51, 52, 79, 54, 35, + 46, 37, 58, 12, 13, 14, 52, 16, 17, 71, 19, 20, 36, 74, 15, 76, 25, 18, 79, 81, + 29, 35, 31, 32, 48, 34, 92, 36, 94, 95, 39, 93, 36, 15, 43, 44, 45, 46, 47, 53, + 49, 26, 51, 52, 48, 54, 89, 48, 33, 58, 12, 13, 14, 96, 16, 17, 71, 19, 20, 14, + 98, 71, 17, 25, 46, 71, 81, 29, 75, 31, 32, 81, 34, 1, 36, 81, 71, 39, 93, 1, 2, + 43, 44, 45, 46, 47, 81, 49, 98, 51, 52, 98, 54, 91, 1, 93, 58, 12, 13, 14, 28, + 16, 17, 98, 19, 20, 1, 91, 71, 93, 25, 18, 71, 1, 29, 80, 31, 32, 81, 34, 99, + 36, 81, 11, 39, 94, 95, 2, 43, 44, 45, 46, 47, 89, 49, 65, 51, 52, 68, 54, 96, + 80, 79, 58, 12, 13, 14, 36, 16, 17, 71, 19, 20, 94, 95, 71, 18, 25, 53, 96, 81, + 29, 75, 31, 32, 81, 34, 18, 36, 74, 15, 39, 93, 91, 79, 43, 44, 45, 46, 47, 17, + 49, 17, 51, 52, 98, 54, 17, 46, 36, 58, 12, 13, 14, 51, 16, 17, 48, 19, 20, 17, + 34, 17, 42, 25, 17, 1, 34, 29, 22, 31, 32, 23, 34, 37, 36, 11, 17, 39, 5, 17, + 17, 43, 44, 45, 46, 47, 17, 49, 51, 51, 26, 27, 54, 11, 53, 64, 58, 33, 13, 14, + 69, 70, 17, 72, 73, 74, 53, 91, 81, 92, 79, 12, 13, 82, 83, 9, 17, 86, 87, 88, + 104, 90, 79, 93, 91, 3, 4, 5, 6, 7, 8, 100, 101, 79, 12, 13, 91, 79, 16, 54, 91, + 19, 20, 12, 13, 13, 14, 25, 17, 17, 64, 29, 91, 31, 32, 69, 70, 26, 72, 73, 74, + 78, 76, 79, 33, 79, 34, 11, 82, 83, 79, 15, 86, 87, 88, 64, 90, 67, 104, 104, + 69, 70, 26, 72, 73, 74, 54, 104, 14, 33, 79, 17, 36, 82, 83, 104, 104, 86, 87, + 88, 64, 90, 104, 104, 48, 69, 70, 104, 72, 73, 74, 104, 101, 15, 104, 79, 104, + 104, 82, 83, 104, 104, 86, 87, 88, 51, 90, 104, 54, 104, 64, 104, 104, 97, 104, + 69, 70, 104, 72, 73, 74, 1, 104, 104, 46, 79, 104, 1, 82, 83, 52, 11, 86, 87, + 88, 104, 90, 11, 18, 64, 104, 104, 104, 97, 69, 70, 26, 72, 73, 74, 104, 76, 26, + 33, 79, 104, 36, 82, 83, 33, 104, 86, 87, 88, 64, 90, 12, 13, 48, 69, 70, 17, + 72, 73, 74, 12, 13, 104, 104, 79, 17, 104, 82, 83, 104, 104, 86, 87, 88, 26, 90, + 28, 104, 64, 104, 104, 33, 97, 69, 70, 104, 72, 73, 74, 50, 104, 104, 104, 79, + 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104, 64, 14, 104, 104, 17, + 69, 70, 1, 72, 73, 74, 104, 104, 104, 104, 79, 104, 11, 82, 83, 104, 104, 86, + 87, 88, 64, 90, 104, 104, 104, 69, 70, 26, 72, 73, 74, 49, 104, 51, 33, 79, 54, + 104, 82, 83, 104, 5, 86, 87, 88, 104, 90, 104, 12, 13, 14, 104, 16, 104, 64, 19, + 20, 104, 104, 69, 70, 25, 72, 73, 74, 29, 104, 31, 32, 79, 104, 104, 82, 83, + 104, 104, 86, 87, 88, 104, 90, 104, 64, 104, 104, 104, 104, 69, 70, 104, 72, 73, + 74, 104, 58, 59, 104, 79, 104, 104, 82, 83, 104, 5, 86, 87, 88, 104, 90, 104, + 12, 13, 14, 104, 16, 104, 104, 19, 20, 104, 104, 104, 104, 25, 104, 104, 64, 29, + 104, 31, 32, 69, 70, 104, 72, 73, 74, 104, 104, 104, 104, 79, 12, 13, 82, 83, + 104, 17, 86, 87, 88, 104, 90, 64, 104, 104, 58, 59, 69, 70, 104, 72, 73, 74, + 104, 12, 13, 104, 79, 104, 17, 82, 83, 104, 104, 86, 87, 88, 104, 90, 50, 104, + 64, 104, 1, 104, 104, 69, 70, 104, 72, 73, 74, 104, 104, 104, 104, 79, 104, 104, + 82, 83, 104, 50, 86, 87, 88, 104, 90, 64, 27, 104, 104, 104, 69, 70, 104, 72, + 73, 74, 104, 38, 39, 40, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, + 64, 104, 55, 56, 57, 69, 70, 104, 72, 73, 74, 104, 104, 104, 104, 79, 104, 104, + 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 1, 104, 104, 69, 70, + 104, 72, 73, 74, 104, 11, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, + 104, 90, 64, 104, 104, 104, 104, 69, 70, 104, 72, 73, 74, 104, 38, 39, 40, 79, + 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 64, 104, 55, 56, 57, 69, 70, + 104, 72, 73, 74, 104, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, + 104, 90, 104, 104, 64, 104, 1, 104, 104, 69, 70, 104, 72, 73, 74, 104, 38, 39, + 40, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 64, 104, 55, 56, 57, + 69, 70, 104, 72, 73, 74, 37, 38, 39, 40, 79, 104, 104, 82, 83, 104, 104, 86, 87, + 88, 104, 90, 64, 104, 55, 56, 57, 69, 70, 104, 72, 73, 74, 104, 104, 104, 104, + 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 1, 2, + 104, 69, 70, 104, 72, 73, 74, 104, 104, 104, 104, 79, 104, 104, 82, 83, 104, + 104, 86, 87, 88, 104, 90, 64, 104, 104, 104, 104, 69, 70, 104, 72, 73, 74, 104, + 38, 39, 40, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 64, 104, 55, + 56, 57, 69, 70, 104, 72, 73, 74, 104, 104, 104, 104, 79, 104, 104, 82, 83, 104, + 104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 1, 104, 104, 69, 70, 104, 72, 73, + 74, 104, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 64, + 104, 104, 104, 104, 69, 70, 104, 72, 73, 74, 37, 38, 39, 40, 79, 104, 104, 82, + 83, 104, 104, 86, 87, 88, 104, 90, 64, 104, 55, 56, 57, 69, 70, 104, 72, 73, 74, + 104, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, + 104, 64, 104, 1, 104, 104, 69, 70, 104, 72, 73, 74, 104, 11, 104, 104, 79, 104, + 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 64, 104, 104, 104, 104, 69, 70, 104, + 72, 73, 74, 104, 38, 39, 40, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, + 90, 64, 104, 55, 56, 57, 69, 70, 104, 72, 73, 74, 104, 104, 104, 104, 79, 104, + 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 1, 104, 104, 69, + 70, 104, 72, 73, 74, 104, 11, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, + 88, 104, 90, 64, 104, 104, 104, 104, 69, 70, 104, 72, 73, 74, 104, 38, 39, 40, + 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 64, 104, 55, 56, 57, 69, + 70, 104, 72, 73, 74, 104, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, + 88, 104, 90, 104, 104, 64, 104, 1, 104, 104, 69, 70, 104, 72, 73, 74, 104, 11, + 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 64, 104, 104, + 104, 104, 69, 70, 104, 72, 104, 74, 104, 38, 39, 40, 79, 104, 104, 104, 83, 104, + 104, 86, 87, 88, 104, 90, 64, 104, 55, 56, 57, 69, 70, 104, 72, 104, 74, 104, + 104, 104, 104, 79, 104, 104, 2, 83, 1, 104, 86, 87, 88, 104, 90, 104, 12, 13, + 11, 15, 104, 17, 18, 61, 62, 63, 64, 65, 66, 104, 104, 69, 104, 26, 104, 1, 2, + 104, 104, 104, 33, 104, 104, 104, 104, 38, 39, 40, 1, 104, 46, 104, 48, 104, 50, + 104, 52, 104, 104, 104, 104, 104, 55, 56, 57, 2, 104, 104, 21, 104, 36, 104, 38, + 39, 40, 12, 13, 104, 104, 104, 17, 18, 48, 104, 104, 38, 39, 40, 104, 55, 56, + 57, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 55, 56, 57, 104, 104, 104, + 104, 46, 104, 48, 64, 50, 104, 52, 53, 69, 70, 104, 72, 104, 74, 104, 104, 104, + 104, 79, 104, 104, 104, 104, 104, 104, 86, 87, 88, 64, 90, 1, 71, 104, 69, 70, + 75, 72, 104, 74, 104, 104, 81, 104, 79, 84, 85, 104, 104, 104, 104, 86, 87, 88, + 24, 90, 26, 104, 104, 98, 104, 104, 104, 33, 104, 104, 64, 104, 38, 39, 40, 69, + 70, 104, 72, 104, 74, 104, 104, 104, 104, 79, 104, 104, 2, 55, 56, 57, 86, 87, + 88, 104, 90, 104, 12, 13, 64, 15, 104, 17, 18, 69, 70, 104, 72, 104, 74, 104, + 104, 104, 104, 79, 104, 104, 104, 104, 104, 104, 86, 87, 88, 64, 90, 1, 104, + 104, 69, 70, 46, 72, 48, 74, 50, 104, 52, 104, 79, 104, 104, 2, 104, 104, 2, 86, + 87, 88, 104, 90, 104, 12, 13, 104, 12, 13, 17, 18, 104, 17, 18, 1, 38, 39, 40, + 104, 104, 104, 12, 13, 104, 104, 104, 17, 18, 104, 104, 53, 104, 55, 56, 57, + 104, 104, 104, 46, 26, 48, 46, 50, 48, 52, 50, 33, 52, 104, 1, 11, 38, 39, 40, + 1, 46, 104, 48, 104, 50, 21, 52, 23, 104, 104, 26, 104, 104, 55, 56, 57, 104, + 33, 104, 35, 104, 37, 104, 104, 104, 104, 104, 104, 104, 104, 46, 38, 39, 40, + 104, 104, 38, 39, 40, 104, 104, 104, 104, 104, 104, 104, 104, 71, 55, 56, 57, + 75, 59, 55, 56, 57, 104, 81, 71, 104, 84, 85, 75, 71, 104, 104, 104, 75, 81, + 104, 104, 84, 85, 81, 98, 104, 84, 85, 71, 104, 104, 104, 75, 104, 104, 98, 104, + 104, 81, 71, 98, 84, 85, 75, 104, 104, 104, 104, 104, 81, 104, 104, 84, 85, 104, + 98, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 98,); + + const YY_SHIFT_USE_DFLT = - 13; + + const YY_SHIFT_MAX = 236; + + static public $yy_shift_ofst = array(542, 364, 82, 82, 82, 411, 364, 411, 35, - 12, - 12, 82, 82, 82, 82, 82, 82, + 176, 82, 82, 129, 82, 82, 82, 317, 82, 82, 82, 82, 82, 82, 270, 82, 82, 82, 82, + 176, 223, 223, 458, 458, 458, 458, 458, 1734, 1603, 1862, 1862, 1862, 1862, + 1862, 542, 749, 803, 1897, 1448, 1531, 1199, 1643, 1826, 1365, 950, 1282, 1033, + 1116, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 660, + 1902, 1089, 1089, 594, 666, 131, 202, 865, - 3, 703, 551, 551, 233, 202, 202, + 131, 131, 357, 97, 484, 144, 920, 505, 42, 768, 189, 232, 11, 232, 278, 324, + 428, 39, 372, 324, 39, 351, 384, 391, 294, 155, 114, 114, 114, 114, 417, 417, + 114, 114, 114, 114, - 13, 1786, 1659, 1600, 1844, 1841, 1858, 552, 897, 519, + 618, 24, 101, 39, 101, 24, 39, 24, 39, 130, 39, 39, 24, 39, 24, 24, 193, 24, + 39, 39, 39, 24, 39, 39, 39, 130, 39, 39, 39, 130, 39, 130, 39, 231, 39, 39, + 114, 114, 114, 526, 404, 417, 404, 114, 417, 390, 114, 417, - 13, - 13, - 13, + - 13, - 13, 1630, 1888, 576, 178, 694, 191, 69, 8, 100, 275, 212, 243, 297, + 265, 255, 150, 98, 165, 55, 123, 493, 479, 468, 456, 434, 482, 483, 473, 461, + 502, 489, 457, 452, 466, 422, 421, 449, 442, 444, 462, 432, 467, 440, 464, 446, + 390,); + + const YY_REDUCE_USE_DFLT = - 80; + + const YY_REDUCE_MAX = 190; + + static public $yy_reduce_ofst = array(1558, 451, 556, 640, 586, 506, 531, 615, 995, 939, 1078, 723, 1244, 968, 856, + 912, 1354, 1134, 1105, 1161, 1051, 1217, 1022, 1188, 1300, 1466, 1383, 1271, + 1327, 1437, 1410, 757, 698, 669, 885, 829, 785, 1493, 1520, 1761, 1706, 1669, + 1644, 1736, 1880, 1665, 1896, 1911, 1665, 1891, 1922, 40, - 29, 48, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 81, 119, 119, 119, 112, 2, - 60, 184, - 6, 264, 358, + - 65, 217, 213, 218, 197, 284, 269, 166, 363, - 13, 363, 295, 342, - 13, - 13, + 349, 281, 310, 295, 310, 323, 310, 316, 272, 236, 273, - 13, - 13, - 13, 320, + 374, - 13, - 13, 366, - 13, 338, 310, - 13, - 13, - 13, - 13, - 13, 465, 465, + 465, 465, 465, 465, 474, 450, 465, 465, 437, 469, 447, 453, 437, 447, 437, + 447, 463, 447, 447, 437, 447, 437, 437, 481, 437, 447, 447, 447, 437, 447, + 447, 447, 478, 447, 447, 447, 511, 447, 504, 447, 503, 447, 447, 241, 241, + 241, 530, 300, 29, 300, 241, 29, 361, 241, 29, - 79, - 77, 314, 340, 436,); + + static public $yyExpectedTokens = array(array(3, 4, 5, 6, 7, 8, 12, 13, 16, 19, 20, 25, 29, 31, 32,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 53, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 30, 31, 32, 34, 36, 39, 43, 44, + 45, 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 30, 31, 32, 34, 36, 39, 43, 44, + 45, 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 52, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 54, 58,), + array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, + 46, 47, 49, 51, 54, 58,), + array(1, 24, 26, 33, 38, 39, 40, 55, 56, 57,), + array(1, 11, 26, 33, 38, 39, 40, 55, 56, 57,), + array(1, 26, 33, 38, 39, 40, 55, 56, 57,), + array(1, 26, 33, 38, 39, 40, 55, 56, 57,), + array(1, 26, 33, 38, 39, 40, 55, 56, 57,), + array(1, 26, 33, 38, 39, 40, 55, 56, 57,), + array(1, 26, 33, 38, 39, 40, 55, 56, 57,), + array(3, 4, 5, 6, 7, 8, 12, 13, 16, 19, 20, 25, 29, 31, 32,), + array(14, 17, 49, 51, 54,), + array(5, 12, 13, 14, 16, 19, 20, 25, 29, 31, 32, 58, 59,), + array(1, 38, 39, 40, 55, 56, 57, 59,), + array(1, 11, 38, 39, 40, 55, 56, 57,), + array(1, 11, 38, 39, 40, 55, 56, 57,), array(1, 2, 38, 39, 40, 55, 56, 57,), + array(1, 21, 38, 39, 40, 55, 56, 57,), + array(1, 38, 39, 40, 53, 55, 56, 57,), + array(1, 11, 38, 39, 40, 55, 56, 57,), + array(1, 27, 38, 39, 40, 55, 56, 57,), + array(1, 37, 38, 39, 40, 55, 56, 57,), + array(1, 11, 38, 39, 40, 55, 56, 57,), + array(1, 37, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,), + array(1, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,), + array(1, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,), + array(1, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,), + array(1, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,), + array(1, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,), + array(1, 11, 18, 26, 33, 36, 48,), array(1, 38, 39, 40, 55, 56, 57,), + array(38, 39, 40, 55, 56, 57,), array(38, 39, 40, 55, 56, 57,), + array(14, 17, 51, 54,), array(1, 11, 26, 33,), array(1, 26, 33,), + array(14, 36, 54,), + array(5, 12, 13, 14, 16, 19, 20, 25, 29, 31, 32, 58, 59,), + array(12, 13, 17, 26, 28, 33,), array(12, 13, 17, 26, 28, 33,), + array(12, 13, 17, 26, 33,), array(12, 13, 17, 26, 33,), array(18, 46, 52,), + array(14, 36, 54,), array(14, 36, 54,), array(1, 26, 33,), + array(1, 26, 33,), array(1, 2,), array(11, 22, 26, 33, 41,), + array(1, 11, 26, 27, 33,), array(11, 22, 26, 33, 41,), + array(12, 13, 17, 50,), array(13, 14, 17, 54,), array(1, 11, 26, 33,), + array(1, 11, 26, 33,), array(8, 9, 10,), array(12, 13, 17,), + array(15, 18, 48,), array(12, 13, 17,), array(15, 18, 48,), array(14, 17,), + array(18, 48,), array(26, 33,), array(1, 18,), array(14, 17,), + array(26, 33,), array(1, 28,), array(1, 53,), array(1, 11,), array(26, 33,), + array(14, 54,), array(1,), array(1,), array(1,), array(1,), array(18,), + array(18,), array(1,), array(1,), array(1,), array(1,), array(), + array(2, 12, 13, 15, 17, 18, 46, 48, 50, 52,), + array(2, 12, 13, 17, 18, 46, 48, 50, 52, 53,), + array(2, 12, 13, 15, 17, 18, 46, 48, 50, 52,), + array(2, 12, 13, 17, 18, 46, 48, 50, 52,), + array(2, 12, 13, 17, 18, 46, 48, 50, 52,), + array(12, 13, 17, 18, 46, 48, 50, 52,), array(13, 14, 17, 34, 54,), + array(12, 13, 17, 50,), array(12, 13, 17,), array(15, 46, 52,), + array(46, 52,), array(46, 52,), array(26, 33,), array(46, 52,), + array(46, 52,), array(26, 33,), array(46, 52,), array(26, 33,), + array(14, 54,), array(26, 33,), array(26, 33,), array(46, 52,), + array(26, 33,), array(46, 52,), array(46, 52,), array(13, 36,), + array(46, 52,), array(26, 33,), array(26, 33,), array(26, 33,), + array(46, 52,), array(26, 33,), array(26, 33,), array(26, 33,), + array(14, 54,), array(26, 33,), array(26, 33,), array(26, 33,), + array(14, 54,), array(26, 33,), array(14, 54,), array(26, 33,), + array(15, 22,), array(26, 33,), array(26, 33,), array(1,), array(1,), + array(1,), array(9,), array(2,), array(18,), array(2,), array(1,), + array(18,), array(36,), array(1,), array(18,), array(), array(), array(), + array(), array(), array(1, 2, 36, 38, 39, 40, 48, 55, 56, 57,), + array(11, 21, 23, 26, 33, 35, 37, 46,), array(11, 15, 26, 33, 36, 48,), + array(36, 46, 48, 53,), array(12, 13, 17, 50,), array(22, 41, 59,), + array(22, 41, 53,), array(28, 36, 48,), array(35, 37,), array(36, 48,), + array(21, 35,), array(35, 37,), array(15, 46,), array(35, 53,), + array(36, 48,), array(17, 50,), array(22, 41,), array(46, 53,), + array(35, 37,), array(36, 48,), array(5,), array(17,), array(23,), + array(37,), array(15,), array(17,), array(17,), array(53,), array(53,), + array(11,), array(17,), array(51,), array(34,), array(22,), array(51,), + array(46,), array(17,), array(17,), array(17,), array(17,), array(36,), + array(17,), array(42,), array(17,), array(34,), array(36,), array(), + array(), array(), array(), array(), array(), array(), array(), array(), + array(), array(), array(), array(), array(), array(), array(), array(), + array(), array(), array(), array(), array(), array(), array(), array(), + array(), array(), array(), array(), array(), array(), array(), array(), + array(), array(), array(), array(), array(), array(), array(), array(), + array(), array(), array(), array(), array(), array(), array(), array(), + array(), array(), array(), array(), array(), array(), array(), array(), + array(), array(), array(), array(), array(), array(), array(), array(), + array(), array(), array(), array(), array(), array(), array(), array(), + array(), array(), array(), array(), array(), array(), array(), array(), + array(), array(), array(), array(), array(), array(), array(), array(), + array(), array(), array(), array(), array(), array(),); + + static public $yy_default = array(335, 510, 490, 490, 490, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 393, 525, 360, 393, + 357, 393, 369, 332, 525, 525, 525, 525, 525, 525, 525, 525, 525, 398, 525, 525, + 525, 513, 405, 395, 404, 489, 398, 374, 400, 511, 488, 414, 432, 512, 421, 420, + 525, 407, 393, 525, 525, 393, 393, 393, 393, 502, 525, 525, 393, 393, 383, 422, + 407, 422, 455, 525, 407, 407, 525, 455, 445, 455, 445, 525, 445, 393, 387, 525, + 371, 407, 407, 407, 393, 525, 417, 425, 389, 410, 499, 445, 423, 411, 407, 424, + 497, 444, 444, 444, 444, 444, 444, 525, 457, 455, 471, 449, 448, 366, 450, 451, + 379, 453, 378, 525, 368, 367, 452, 364, 483, 480, 455, 481, 358, 380, 362, 482, + 373, 356, 361, 525, 382, 370, 377, 525, 372, 525, 354, 525, 381, 376, 439, 413, + 384, 348, 492, 477, 491, 388, 503, 455, 390, 500, 455, 496, 496, 496, 455, 432, + 428, 432, 432, 456, 422, 422, 432, 525, 440, 525, 525, 428, 525, 432, 525, 422, + 428, 525, 525, 340, 525, 401, 525, 525, 525, 525, 435, 525, 525, 525, 525, 430, + 422, 525, 428, 525, 525, 525, 525, 501, 525, 434, 525, 525, 471, 412, 391, 402, + 418, 375, 352, 394, 435, 436, 460, 459, 471, 479, 437, 419, 442, 351, 443, 363, + 504, 342, 438, 341, 343, 416, 441, 339, 334, 333, 336, 337, 338, 344, 468, 349, + 347, 350, 476, 505, 469, 406, 415, 345, 346, 466, 506, 486, 385, 487, 495, 508, + 509, 478, 426, 429, 474, 475, 427, 386, 507, 524, 523, 520, 518, 517, 493, 514, + 494, 515, 516, 522, 473, 446, 447, 454, 470, 485, 519, 498, 458, 434, 461, 464, + 472, 467, 484, 521, 431, 433, 465, 463, 409, 462, 408, 392,); + + const YYNOCODE = 105; + + const YYSTACKDEPTH = 500; + + const YYNSTATE = 332; + + const YYNRULE = 193; + + const YYERRORSYMBOL = 60; + + const YYERRSYMDT = 'yy0'; + + const YYFALLBACK = 0; + + public static $yyFallback = array(); + + public function Trace($TraceFILE, $zTracePrompt) + { + if (!$TraceFILE) { + $zTracePrompt = 0; + } elseif (!$zTracePrompt) { + $TraceFILE = 0; + } + $this->yyTraceFILE = $TraceFILE; + $this->yyTracePrompt = $zTracePrompt; + } + + public function PrintTrace() + { + $this->yyTraceFILE = fopen('php://output', 'w'); + $this->yyTracePrompt = '
    '; + } + + public $yyTraceFILE; + + public $yyTracePrompt; + + public $yyidx; /* Index of top element in stack */ + public $yyerrcnt; /* Shifts left before out of the error */ + public $yystack = array(); /* The parser's stack */ + + public $yyTokenName = array('$', 'VERT', 'COLON', 'PHP', 'NOCACHE', 'TEXT', 'STRIPON', 'STRIPOFF', 'LITERALSTART', + 'LITERALEND', 'LITERAL', 'RDEL', 'SIMPELOUTPUT', 'LDEL', 'DOLLARID', 'EQUAL', + 'SIMPLETAG', 'ID', 'PTR', 'LDELIF', 'LDELFOR', 'SEMICOLON', 'INCDEC', 'TO', 'STEP', + 'LDELFOREACH', 'SPACE', 'AS', 'APTR', 'LDELSETFILTER', 'SMARTYBLOCKCHILDPARENT', + 'CLOSETAG', 'LDELSLASH', 'ATTR', 'INTEGER', 'COMMA', 'OPENP', 'CLOSEP', 'MATH', + 'UNIMATH', 'ISIN', 'INSTANCEOF', 'QMARK', 'NOT', 'TYPECAST', 'HEX', 'DOT', + 'SINGLEQUOTESTRING', 'DOUBLECOLON', 'NAMESPACE', 'AT', 'HATCH', 'OPENB', 'CLOSEB', + 'DOLLAR', 'LOGOP', 'TLOGOP', 'SINGLECOND', 'QUOTE', 'BACKTICK', 'error', 'start', + 'template', 'template_element', 'smartytag', 'literal', 'text_content', + 'literal_elements', 'literal_element', 'tag', 'variable', 'attributes', 'value', 'expr', + 'varindexed', 'modifierlist', 'statement', 'statements', 'foraction', 'varvar', + 'modparameters', 'attribute', 'ternary', 'array', 'lop', 'scond', 'ns1', 'function', + 'doublequoted_with_quotes', 'static_class_access', 'object', 'arrayindex', 'indexdef', + 'varvarele', 'objectchain', 'objectelement', 'method', 'params', 'modifier', + 'modparameter', 'arrayelements', 'arrayelement', 'doublequoted', + 'doublequotedcontent',); + + public static $yyRuleName = array('start ::= template', 'template ::= template_element', + 'template ::= template template_element', 'template ::=', + 'template_element ::= smartytag', 'template_element ::= literal', + 'template_element ::= PHP', 'template_element ::= NOCACHE', + 'template_element ::= text_content', 'text_content ::= TEXT', + 'text_content ::= text_content TEXT', 'template_element ::= STRIPON', + 'template_element ::= STRIPOFF', 'literal ::= LITERALSTART LITERALEND', + 'literal ::= LITERALSTART literal_elements LITERALEND', + 'literal_elements ::= literal_elements literal_element', 'literal_elements ::=', + 'literal_element ::= literal', 'literal_element ::= LITERAL', + 'smartytag ::= tag RDEL', 'smartytag ::= SIMPELOUTPUT', 'tag ::= LDEL variable', + 'tag ::= LDEL variable attributes', 'tag ::= LDEL value', + 'tag ::= LDEL value attributes', 'tag ::= LDEL expr', + 'tag ::= LDEL expr attributes', 'tag ::= LDEL DOLLARID EQUAL value', + 'tag ::= LDEL DOLLARID EQUAL expr', 'tag ::= LDEL DOLLARID EQUAL expr attributes', + 'tag ::= LDEL varindexed EQUAL expr attributes', 'smartytag ::= SIMPLETAG', + 'tag ::= LDEL ID attributes', 'tag ::= LDEL ID', + 'tag ::= LDEL ID modifierlist attributes', 'tag ::= LDEL ID PTR ID attributes', + 'tag ::= LDEL ID PTR ID modifierlist attributes', 'tag ::= LDELIF expr', + 'tag ::= LDELIF expr attributes', 'tag ::= LDELIF statement', + 'tag ::= LDELIF statement attributes', + 'tag ::= LDELFOR statements SEMICOLON expr SEMICOLON varindexed foraction attributes', + 'foraction ::= EQUAL expr', 'foraction ::= INCDEC', + 'tag ::= LDELFOR statement TO expr attributes', + 'tag ::= LDELFOR statement TO expr STEP expr attributes', + 'tag ::= LDELFOREACH attributes', + 'tag ::= LDELFOREACH SPACE value AS varvar attributes', + 'tag ::= LDELFOREACH SPACE value AS varvar APTR varvar attributes', + 'tag ::= LDELFOREACH SPACE expr AS varvar attributes', + 'tag ::= LDELFOREACH SPACE expr AS varvar APTR varvar attributes', + 'tag ::= LDELSETFILTER ID modparameters', + 'tag ::= LDELSETFILTER ID modparameters modifierlist', + 'tag ::= LDEL SMARTYBLOCKCHILDPARENT', 'smartytag ::= CLOSETAG', + 'tag ::= LDELSLASH ID', 'tag ::= LDELSLASH ID modifierlist', + 'tag ::= LDELSLASH ID PTR ID', 'tag ::= LDELSLASH ID PTR ID modifierlist', + 'attributes ::= attributes attribute', 'attributes ::= attribute', + 'attributes ::=', 'attribute ::= SPACE ID EQUAL ID', 'attribute ::= ATTR expr', + 'attribute ::= ATTR value', 'attribute ::= SPACE ID', 'attribute ::= SPACE expr', + 'attribute ::= SPACE value', 'attribute ::= SPACE INTEGER EQUAL expr', + 'statements ::= statement', 'statements ::= statements COMMA statement', + 'statement ::= DOLLARID EQUAL INTEGER', 'statement ::= DOLLARID EQUAL expr', + 'statement ::= varindexed EQUAL expr', 'statement ::= OPENP statement CLOSEP', + 'expr ::= value', 'expr ::= ternary', 'expr ::= DOLLARID COLON ID', + 'expr ::= expr MATH value', 'expr ::= expr UNIMATH value', 'expr ::= array', + 'expr ::= expr modifierlist', 'expr ::= expr lop expr', 'expr ::= expr scond', + 'expr ::= expr ISIN array', 'expr ::= expr ISIN value', + 'expr ::= variable INSTANCEOF ns1', 'expr ::= variable INSTANCEOF variable', + 'ternary ::= OPENP expr CLOSEP QMARK DOLLARID COLON expr', + 'ternary ::= OPENP expr CLOSEP QMARK expr COLON expr', 'value ::= variable', + 'value ::= UNIMATH value', 'value ::= NOT value', 'value ::= TYPECAST value', + 'value ::= variable INCDEC', 'value ::= HEX', 'value ::= INTEGER', + 'value ::= INTEGER DOT INTEGER', 'value ::= INTEGER DOT', 'value ::= DOT INTEGER', + 'value ::= ID', 'value ::= function', 'value ::= OPENP expr CLOSEP', + 'value ::= SINGLEQUOTESTRING', 'value ::= doublequoted_with_quotes', + 'value ::= varindexed DOUBLECOLON static_class_access', 'value ::= smartytag', + 'value ::= value modifierlist', 'value ::= NAMESPACE', + 'value ::= ns1 DOUBLECOLON static_class_access', 'ns1 ::= ID', + 'ns1 ::= NAMESPACE', 'variable ::= DOLLARID', 'variable ::= varindexed', + 'variable ::= varvar AT ID', 'variable ::= object', 'variable ::= HATCH ID HATCH', + 'variable ::= HATCH ID HATCH arrayindex', 'variable ::= HATCH variable HATCH', + 'variable ::= HATCH variable HATCH arrayindex', + 'varindexed ::= DOLLARID arrayindex', 'varindexed ::= varvar arrayindex', + 'arrayindex ::= arrayindex indexdef', 'arrayindex ::=', + 'indexdef ::= DOT DOLLARID', 'indexdef ::= DOT varvar', + 'indexdef ::= DOT varvar AT ID', 'indexdef ::= DOT ID', + 'indexdef ::= DOT INTEGER', 'indexdef ::= DOT LDEL expr RDEL', + 'indexdef ::= OPENB ID CLOSEB', 'indexdef ::= OPENB ID DOT ID CLOSEB', + 'indexdef ::= OPENB SINGLEQUOTESTRING CLOSEB', + 'indexdef ::= OPENB INTEGER CLOSEB', 'indexdef ::= OPENB DOLLARID CLOSEB', + 'indexdef ::= OPENB variable CLOSEB', 'indexdef ::= OPENB value CLOSEB', + 'indexdef ::= OPENB expr CLOSEB', 'indexdef ::= OPENB CLOSEB', + 'varvar ::= DOLLARID', 'varvar ::= DOLLAR', 'varvar ::= varvar varvarele', + 'varvarele ::= ID', 'varvarele ::= SIMPELOUTPUT', 'varvarele ::= LDEL expr RDEL', + 'object ::= varindexed objectchain', 'objectchain ::= objectelement', + 'objectchain ::= objectchain objectelement', + 'objectelement ::= PTR ID arrayindex', 'objectelement ::= PTR varvar arrayindex', + 'objectelement ::= PTR LDEL expr RDEL arrayindex', + 'objectelement ::= PTR ID LDEL expr RDEL arrayindex', + 'objectelement ::= PTR method', 'function ::= ns1 OPENP params CLOSEP', + 'method ::= ID OPENP params CLOSEP', 'method ::= DOLLARID OPENP params CLOSEP', + 'params ::= params COMMA expr', 'params ::= expr', 'params ::=', + 'modifierlist ::= modifierlist modifier modparameters', + 'modifierlist ::= modifier modparameters', 'modifier ::= VERT AT ID', + 'modifier ::= VERT ID', 'modparameters ::= modparameters modparameter', + 'modparameters ::=', 'modparameter ::= COLON value', + 'modparameter ::= COLON array', 'static_class_access ::= method', + 'static_class_access ::= method objectchain', 'static_class_access ::= ID', + 'static_class_access ::= DOLLARID arrayindex', + 'static_class_access ::= DOLLARID arrayindex objectchain', 'lop ::= LOGOP', + 'lop ::= TLOGOP', 'scond ::= SINGLECOND', 'array ::= OPENB arrayelements CLOSEB', + 'arrayelements ::= arrayelement', + 'arrayelements ::= arrayelements COMMA arrayelement', 'arrayelements ::=', + 'arrayelement ::= value APTR expr', 'arrayelement ::= ID APTR expr', + 'arrayelement ::= expr', 'doublequoted_with_quotes ::= QUOTE QUOTE', + 'doublequoted_with_quotes ::= QUOTE doublequoted QUOTE', + 'doublequoted ::= doublequoted doublequotedcontent', + 'doublequoted ::= doublequotedcontent', + 'doublequotedcontent ::= BACKTICK variable BACKTICK', + 'doublequotedcontent ::= BACKTICK expr BACKTICK', + 'doublequotedcontent ::= DOLLARID', 'doublequotedcontent ::= LDEL variable RDEL', + 'doublequotedcontent ::= LDEL expr RDEL', 'doublequotedcontent ::= smartytag', + 'doublequotedcontent ::= TEXT',); + + public function tokenName($tokenType) + { + if ($tokenType === 0) { + return 'End of Input'; + } + if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) { + return $this->yyTokenName[ $tokenType ]; + } else { + return "Unknown"; + } + } + + public static function yy_destructor($yymajor, $yypminor) + { + switch ($yymajor) { + default: + break; /* If no destructor action specified: do nothing */ + } + } + + public function yy_pop_parser_stack() + { + if (empty($this->yystack)) { + return; + } + $yytos = array_pop($this->yystack); + if ($this->yyTraceFILE && $this->yyidx >= 0) { + fwrite($this->yyTraceFILE, $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[ $yytos->major ] . "\n"); + } + $yymajor = $yytos->major; + self::yy_destructor($yymajor, $yytos->minor); + $this->yyidx --; + + return $yymajor; + } + + public function __destruct() + { + while ($this->yystack !== Array()) { + $this->yy_pop_parser_stack(); + } + if (is_resource($this->yyTraceFILE)) { + fclose($this->yyTraceFILE); + } + } + + public function yy_get_expected_tokens($token) + { + static $res3 = array(); + static $res4 = array(); + $state = $this->yystack[ $this->yyidx ]->stateno; + $expected = self::$yyExpectedTokens[ $state ]; + if (isset($res3[ $state ][ $token ])) { + if ($res3[ $state ][ $token ]) { + return $expected; + } + } else { + if ($res3[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) { + return $expected; + } + } + $stack = $this->yystack; + $yyidx = $this->yyidx; + do { + $yyact = $this->yy_find_shift_action($token); + if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { + // reduce action + $done = 0; + do { + if ($done ++ == 100) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // too much recursion prevents proper detection + // so give up + return array_unique($expected); + } + $yyruleno = $yyact - self::YYNSTATE; + $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ]; + $nextstate = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, + self::$yyRuleInfo[ $yyruleno ][ 0 ]); + if (isset(self::$yyExpectedTokens[ $nextstate ])) { + $expected = array_merge($expected, self::$yyExpectedTokens[ $nextstate ]); + if (isset($res4[ $nextstate ][ $token ])) { + if ($res4[ $nextstate ][ $token ]) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return array_unique($expected); + } + } else { + if ($res4[ $nextstate ][ $token ] = + in_array($token, self::$yyExpectedTokens[ $nextstate ], true) + ) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return array_unique($expected); + } + } + } + if ($nextstate < self::YYNSTATE) { + // we need to shift a non-terminal + $this->yyidx ++; + $x = new TP_yyStackEntry; + $x->stateno = $nextstate; + $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ]; + $this->yystack[ $this->yyidx ] = $x; + continue 2; + } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // the last token was just ignored, we can't accept + // by ignoring input, this is in essence ignoring a + // syntax error! + return array_unique($expected); + } elseif ($nextstate === self::YY_NO_ACTION) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // input accepted, but not shifted (I guess) + return $expected; + } else { + $yyact = $nextstate; + } + } while (true); + } + break; + } while (true); + $this->yyidx = $yyidx; + $this->yystack = $stack; + + return array_unique($expected); + } + + public function yy_is_expected_token($token) + { + static $res = array(); + static $res2 = array(); + if ($token === 0) { + return true; // 0 is not part of this + } + $state = $this->yystack[ $this->yyidx ]->stateno; + if (isset($res[ $state ][ $token ])) { + if ($res[ $state ][ $token ]) { + return true; + } + } else { + if ($res[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) { + return true; + } + } + $stack = $this->yystack; + $yyidx = $this->yyidx; + do { + $yyact = $this->yy_find_shift_action($token); + if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { + // reduce action + $done = 0; + do { + if ($done ++ == 100) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // too much recursion prevents proper detection + // so give up + return true; + } + $yyruleno = $yyact - self::YYNSTATE; + $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ]; + $nextstate = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, + self::$yyRuleInfo[ $yyruleno ][ 0 ]); + if (isset($res2[ $nextstate ][ $token ])) { + if ($res2[ $nextstate ][ $token ]) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return true; + } + } else { + if ($res2[ $nextstate ][ $token ] = (isset(self::$yyExpectedTokens[ $nextstate ]) && + in_array($token, self::$yyExpectedTokens[ $nextstate ], true)) + ) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return true; + } + } + if ($nextstate < self::YYNSTATE) { + // we need to shift a non-terminal + $this->yyidx ++; + $x = new TP_yyStackEntry; + $x->stateno = $nextstate; + $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ]; + $this->yystack[ $this->yyidx ] = $x; + continue 2; + } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + if (!$token) { + // end of input: this is valid + return true; + } + // the last token was just ignored, we can't accept + // by ignoring input, this is in essence ignoring a + // syntax error! + return false; + } elseif ($nextstate === self::YY_NO_ACTION) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // input accepted, but not shifted (I guess) + return true; + } else { + $yyact = $nextstate; + } + } while (true); + } + break; + } while (true); + $this->yyidx = $yyidx; + $this->yystack = $stack; + + return true; + } + + public function yy_find_shift_action($iLookAhead) + { + $stateno = $this->yystack[ $this->yyidx ]->stateno; + + /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */ + if (!isset(self::$yy_shift_ofst[ $stateno ])) { + // no shift actions + return self::$yy_default[ $stateno ]; + } + $i = self::$yy_shift_ofst[ $stateno ]; + if ($i === self::YY_SHIFT_USE_DFLT) { + return self::$yy_default[ $stateno ]; + } + if ($iLookAhead == self::YYNOCODE) { + return self::YY_NO_ACTION; + } + $i += $iLookAhead; + if ($i < 0 || $i >= self::YY_SZ_ACTTAB || self::$yy_lookahead[ $i ] != $iLookAhead) { + if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) && + ($iFallback = self::$yyFallback[ $iLookAhead ]) != 0 + ) { + if ($this->yyTraceFILE) { + fwrite($this->yyTraceFILE, + $this->yyTracePrompt . "FALLBACK " . $this->yyTokenName[ $iLookAhead ] . " => " . + $this->yyTokenName[ $iFallback ] . "\n"); + } + + return $this->yy_find_shift_action($iFallback); + } + + return self::$yy_default[ $stateno ]; + } else { + return self::$yy_action[ $i ]; + } + } + + public function yy_find_reduce_action($stateno, $iLookAhead) + { + /* $stateno = $this->yystack[$this->yyidx]->stateno; */ + + if (!isset(self::$yy_reduce_ofst[ $stateno ])) { + return self::$yy_default[ $stateno ]; + } + $i = self::$yy_reduce_ofst[ $stateno ]; + if ($i == self::YY_REDUCE_USE_DFLT) { + return self::$yy_default[ $stateno ]; + } + if ($iLookAhead == self::YYNOCODE) { + return self::YY_NO_ACTION; + } + $i += $iLookAhead; + if ($i < 0 || $i >= self::YY_SZ_ACTTAB || self::$yy_lookahead[ $i ] != $iLookAhead) { + return self::$yy_default[ $stateno ]; + } else { + return self::$yy_action[ $i ]; + } + } + + public function yy_shift($yyNewState, $yyMajor, $yypMinor) + { + $this->yyidx ++; + if ($this->yyidx >= self::YYSTACKDEPTH) { + $this->yyidx --; + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sStack Overflow!\n", $this->yyTracePrompt); + } + while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } + #line 214 "../smarty/lexer/smarty_internal_templateparser.y" + + $this->internalError = true; + $this->compiler->trigger_template_error("Stack overflow in template parser"); + + return; + } + $yytos = new TP_yyStackEntry; + $yytos->stateno = $yyNewState; + $yytos->major = $yyMajor; + $yytos->minor = $yypMinor; + $this->yystack[] = $yytos; + if ($this->yyTraceFILE && $this->yyidx > 0) { + fprintf($this->yyTraceFILE, "%sShift %d\n", $this->yyTracePrompt, $yyNewState); + fprintf($this->yyTraceFILE, "%sStack:", $this->yyTracePrompt); + for ($i = 1; $i <= $this->yyidx; $i ++) { + fprintf($this->yyTraceFILE, " %s", $this->yyTokenName[ $this->yystack[ $i ]->major ]); + } + fwrite($this->yyTraceFILE, "\n"); + } + } + + public static $yyRuleInfo = array(array(0 => 61, 1 => 1), array(0 => 62, 1 => 1), array(0 => 62, 1 => 2), + array(0 => 62, 1 => 0), array(0 => 63, 1 => 1), array(0 => 63, 1 => 1), + array(0 => 63, 1 => 1), array(0 => 63, 1 => 1), array(0 => 63, 1 => 1), + array(0 => 66, 1 => 1), array(0 => 66, 1 => 2), array(0 => 63, 1 => 1), + array(0 => 63, 1 => 1), array(0 => 65, 1 => 2), array(0 => 65, 1 => 3), + array(0 => 67, 1 => 2), array(0 => 67, 1 => 0), array(0 => 68, 1 => 1), + array(0 => 68, 1 => 1), array(0 => 64, 1 => 2), array(0 => 64, 1 => 1), + array(0 => 69, 1 => 2), array(0 => 69, 1 => 3), array(0 => 69, 1 => 2), + array(0 => 69, 1 => 3), array(0 => 69, 1 => 2), array(0 => 69, 1 => 3), + array(0 => 69, 1 => 4), array(0 => 69, 1 => 4), array(0 => 69, 1 => 5), + array(0 => 69, 1 => 5), array(0 => 64, 1 => 1), array(0 => 69, 1 => 3), + array(0 => 69, 1 => 2), array(0 => 69, 1 => 4), array(0 => 69, 1 => 5), + array(0 => 69, 1 => 6), array(0 => 69, 1 => 2), array(0 => 69, 1 => 3), + array(0 => 69, 1 => 2), array(0 => 69, 1 => 3), array(0 => 69, 1 => 8), + array(0 => 78, 1 => 2), array(0 => 78, 1 => 1), array(0 => 69, 1 => 5), + array(0 => 69, 1 => 7), array(0 => 69, 1 => 2), array(0 => 69, 1 => 6), + array(0 => 69, 1 => 8), array(0 => 69, 1 => 6), array(0 => 69, 1 => 8), + array(0 => 69, 1 => 3), array(0 => 69, 1 => 4), array(0 => 69, 1 => 2), + array(0 => 64, 1 => 1), array(0 => 69, 1 => 2), array(0 => 69, 1 => 3), + array(0 => 69, 1 => 4), array(0 => 69, 1 => 5), array(0 => 71, 1 => 2), + array(0 => 71, 1 => 1), array(0 => 71, 1 => 0), array(0 => 81, 1 => 4), + array(0 => 81, 1 => 2), array(0 => 81, 1 => 2), array(0 => 81, 1 => 2), + array(0 => 81, 1 => 2), array(0 => 81, 1 => 2), array(0 => 81, 1 => 4), + array(0 => 77, 1 => 1), array(0 => 77, 1 => 3), array(0 => 76, 1 => 3), + array(0 => 76, 1 => 3), array(0 => 76, 1 => 3), array(0 => 76, 1 => 3), + array(0 => 73, 1 => 1), array(0 => 73, 1 => 1), array(0 => 73, 1 => 3), + array(0 => 73, 1 => 3), array(0 => 73, 1 => 3), array(0 => 73, 1 => 1), + array(0 => 73, 1 => 2), array(0 => 73, 1 => 3), array(0 => 73, 1 => 2), + array(0 => 73, 1 => 3), array(0 => 73, 1 => 3), array(0 => 73, 1 => 3), + array(0 => 73, 1 => 3), array(0 => 82, 1 => 7), array(0 => 82, 1 => 7), + array(0 => 72, 1 => 1), array(0 => 72, 1 => 2), array(0 => 72, 1 => 2), + array(0 => 72, 1 => 2), array(0 => 72, 1 => 2), array(0 => 72, 1 => 1), + array(0 => 72, 1 => 1), array(0 => 72, 1 => 3), array(0 => 72, 1 => 2), + array(0 => 72, 1 => 2), array(0 => 72, 1 => 1), array(0 => 72, 1 => 1), + array(0 => 72, 1 => 3), array(0 => 72, 1 => 1), array(0 => 72, 1 => 1), + array(0 => 72, 1 => 3), array(0 => 72, 1 => 1), array(0 => 72, 1 => 2), + array(0 => 72, 1 => 1), array(0 => 72, 1 => 3), array(0 => 86, 1 => 1), + array(0 => 86, 1 => 1), array(0 => 70, 1 => 1), array(0 => 70, 1 => 1), + array(0 => 70, 1 => 3), array(0 => 70, 1 => 1), array(0 => 70, 1 => 3), + array(0 => 70, 1 => 4), array(0 => 70, 1 => 3), array(0 => 70, 1 => 4), + array(0 => 74, 1 => 2), array(0 => 74, 1 => 2), array(0 => 91, 1 => 2), + array(0 => 91, 1 => 0), array(0 => 92, 1 => 2), array(0 => 92, 1 => 2), + array(0 => 92, 1 => 4), array(0 => 92, 1 => 2), array(0 => 92, 1 => 2), + array(0 => 92, 1 => 4), array(0 => 92, 1 => 3), array(0 => 92, 1 => 5), + array(0 => 92, 1 => 3), array(0 => 92, 1 => 3), array(0 => 92, 1 => 3), + array(0 => 92, 1 => 3), array(0 => 92, 1 => 3), array(0 => 92, 1 => 3), + array(0 => 92, 1 => 2), array(0 => 79, 1 => 1), array(0 => 79, 1 => 1), + array(0 => 79, 1 => 2), array(0 => 93, 1 => 1), array(0 => 93, 1 => 1), + array(0 => 93, 1 => 3), array(0 => 90, 1 => 2), array(0 => 94, 1 => 1), + array(0 => 94, 1 => 2), array(0 => 95, 1 => 3), array(0 => 95, 1 => 3), + array(0 => 95, 1 => 5), array(0 => 95, 1 => 6), array(0 => 95, 1 => 2), + array(0 => 87, 1 => 4), array(0 => 96, 1 => 4), array(0 => 96, 1 => 4), + array(0 => 97, 1 => 3), array(0 => 97, 1 => 1), array(0 => 97, 1 => 0), + array(0 => 75, 1 => 3), array(0 => 75, 1 => 2), array(0 => 98, 1 => 3), + array(0 => 98, 1 => 2), array(0 => 80, 1 => 2), array(0 => 80, 1 => 0), + array(0 => 99, 1 => 2), array(0 => 99, 1 => 2), array(0 => 89, 1 => 1), + array(0 => 89, 1 => 2), array(0 => 89, 1 => 1), array(0 => 89, 1 => 2), + array(0 => 89, 1 => 3), array(0 => 84, 1 => 1), array(0 => 84, 1 => 1), + array(0 => 85, 1 => 1), array(0 => 83, 1 => 3), array(0 => 100, 1 => 1), + array(0 => 100, 1 => 3), array(0 => 100, 1 => 0), array(0 => 101, 1 => 3), + array(0 => 101, 1 => 3), array(0 => 101, 1 => 1), array(0 => 88, 1 => 2), + array(0 => 88, 1 => 3), array(0 => 102, 1 => 2), array(0 => 102, 1 => 1), + array(0 => 103, 1 => 3), array(0 => 103, 1 => 3), array(0 => 103, 1 => 1), + array(0 => 103, 1 => 3), array(0 => 103, 1 => 3), array(0 => 103, 1 => 1), + array(0 => 103, 1 => 1),); + + public static $yyReduceMap = array(0 => 0, 1 => 1, 2 => 2, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, + 17 => 9, 18 => 9, 43 => 9, 66 => 9, 67 => 9, 75 => 9, 76 => 9, 80 => 9, 90 => 9, + 95 => 9, 96 => 9, 101 => 9, 103 => 9, 104 => 9, 108 => 9, 110 => 9, 115 => 9, + 176 => 9, 181 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, 16 => 13, 14 => 14, + 74 => 14, 15 => 15, 91 => 15, 93 => 15, 94 => 15, 122 => 15, 19 => 19, 20 => 20, + 21 => 21, 23 => 21, 25 => 21, 22 => 22, 24 => 22, 26 => 22, 27 => 27, 28 => 27, + 29 => 29, 30 => 30, 31 => 31, 32 => 32, 33 => 33, 34 => 34, 35 => 35, 36 => 36, + 37 => 37, 38 => 38, 40 => 38, 39 => 39, 41 => 41, 42 => 42, 44 => 44, 45 => 45, + 46 => 46, 47 => 47, 49 => 47, 48 => 48, 50 => 48, 51 => 51, 52 => 52, 53 => 53, + 54 => 54, 55 => 55, 56 => 56, 57 => 57, 58 => 58, 59 => 59, 60 => 60, 69 => 60, + 157 => 60, 161 => 60, 165 => 60, 166 => 60, 61 => 61, 158 => 61, 164 => 61, + 62 => 62, 63 => 63, 64 => 63, 65 => 65, 142 => 65, 68 => 68, 70 => 70, 71 => 71, + 72 => 71, 73 => 73, 77 => 77, 78 => 78, 79 => 78, 81 => 81, 107 => 81, 82 => 82, + 83 => 83, 84 => 84, 85 => 85, 86 => 86, 87 => 86, 88 => 88, 89 => 89, 92 => 92, + 97 => 97, 98 => 98, 99 => 99, 100 => 100, 102 => 102, 105 => 105, 106 => 106, + 109 => 109, 111 => 111, 112 => 112, 113 => 113, 114 => 114, 116 => 116, + 117 => 117, 118 => 118, 119 => 119, 120 => 120, 121 => 121, 123 => 123, + 178 => 123, 124 => 124, 125 => 125, 126 => 126, 127 => 127, 128 => 128, + 129 => 129, 137 => 129, 130 => 130, 131 => 131, 132 => 132, 133 => 132, + 135 => 132, 136 => 132, 134 => 134, 138 => 138, 139 => 139, 140 => 140, + 182 => 140, 141 => 141, 143 => 143, 144 => 144, 145 => 145, 146 => 146, + 147 => 147, 148 => 148, 149 => 149, 150 => 150, 151 => 151, 152 => 152, + 153 => 153, 154 => 154, 155 => 155, 156 => 156, 159 => 159, 160 => 160, + 162 => 162, 163 => 163, 167 => 167, 168 => 168, 169 => 169, 170 => 170, + 171 => 171, 172 => 172, 173 => 173, 174 => 174, 175 => 175, 177 => 177, + 179 => 179, 180 => 180, 183 => 183, 184 => 184, 185 => 185, 186 => 186, + 187 => 186, 189 => 186, 188 => 188, 190 => 190, 191 => 191, 192 => 192,); + + #line 225 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r0() + { + $this->root_buffer->prepend_array($this, $this->template_prefix); + $this->root_buffer->append_array($this, $this->template_postfix); + $this->_retvalue = $this->root_buffer->to_smarty_php($this); + } + + #line 235 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r1() + { + if ($this->yystack[ $this->yyidx + 0 ]->minor != null) { + $this->current_buffer->append_subtree($this, $this->yystack[ $this->yyidx + 0 ]->minor); + } + } + + #line 242 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r2() + { + if ($this->yystack[ $this->yyidx + 0 ]->minor != null) { + // because of possible code injection + $this->current_buffer->append_subtree($this, $this->yystack[ $this->yyidx + 0 ]->minor); + } + } + + #line 256 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r4() + { + if ($this->compiler->has_code) { + $this->_retvalue = $this->mergePrefixCode($this->yystack[ $this->yyidx + 0 ]->minor); + } else { + $this->_retvalue = null; + } + $this->compiler->has_variable_string = false; + $this->block_nesting_level = count($this->compiler->_tag_stack); + } + + #line 267 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r5() + { + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this->yystack[ $this->yyidx + 0 ]->minor); + } + + #line 271 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r6() + { + $code = $this->compiler->compileTag('private_php', + array(array('code' => $this->yystack[ $this->yyidx + 0 ]->minor), + array('type' => $this->lex->phpType)), array()); + if ($this->compiler->has_code && !empty($code)) { + $tmp = ''; + foreach ($this->compiler->prefix_code as $code) { + $tmp .= $code; + } + $this->compiler->prefix_code = array(); + $this->_retvalue = + new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp . $code, true)); + } else { + $this->_retvalue = null; + } + } + + #line 282 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r7() + { + $this->compiler->tag_nocache = true; + $save = $this->template->compiled->has_nocache_code; + $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, + $this->compiler->processNocacheCode("yystack[$this->yyidx + 0]->minor}';?>\n", + $this->compiler, + true)); + $this->template->compiled->has_nocache_code = $save; + } + + #line 289 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r8() + { + $this->_retvalue = $this->compiler->processText($this->yystack[ $this->yyidx + 0 ]->minor); + } + + #line 293 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r9() + { + $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 297 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r10() + { + $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 302 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r11() + { + $this->strip = true; + } + + #line 306 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r12() + { + $this->strip = false; + } + + #line 311 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r13() + { + $this->_retvalue = ''; + } + + #line 315 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r14() + { + $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor; + } + + #line 319 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r15() + { + $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 335 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r19() + { + $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor; + } + + #line 341 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r20() + { + $var = + trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->lex->ldel_length, - $this->lex->rdel_length), + ' $'); + if (preg_match('/^(.*)(\s+nocache)$/', $var, $match)) { + $this->_retvalue = $this->compiler->compileTag('private_print_expression', array('nocache'), + array('value' => $this->compiler->compileVariable('\'' . + $match[ 1 ] . + '\''))); + } else { + $this->_retvalue = $this->compiler->compileTag('private_print_expression', array(), + array('value' => $this->compiler->compileVariable('\'' . + $var . + '\''))); + } + } + + #line 351 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r21() + { + $this->_retvalue = $this->compiler->compileTag('private_print_expression', array(), + array('value' => $this->yystack[ $this->yyidx + 0 ]->minor)); + } + + #line 355 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r22() + { + $this->_retvalue = + $this->compiler->compileTag('private_print_expression', $this->yystack[ $this->yyidx + 0 ]->minor, + array('value' => $this->yystack[ $this->yyidx + - 1 ]->minor)); + } + + #line 378 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r27() + { + $this->_retvalue = $this->compiler->compileTag('assign', array(array('value' => $this->yystack[ $this->yyidx + + 0 ]->minor), array('var' => '\'' . substr($this->yystack[ $this->yyidx + - 2 ]->minor, 1) . '\''))); + } + + #line 386 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r29() + { + $this->_retvalue = $this->compiler->compileTag('assign', + array_merge(array(array('value' => $this->yystack[ $this->yyidx + + - 1 ]->minor), array('var' => '\'' . + substr($this->yystack[ $this->yyidx + - 3 ]->minor, 1) . + '\'')), $this->yystack[ $this->yyidx + 0 ]->minor)); + } + + #line 390 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r30() + { + $this->_retvalue = $this->compiler->compileTag('assign', + array_merge(array(array('value' => $this->yystack[ $this->yyidx + + - 1 ]->minor), array('var' => $this->yystack[ $this->yyidx + + - 3 ]->minor[ 'var' ])), + $this->yystack[ $this->yyidx + 0 ]->minor), + array('smarty_internal_index' => $this->yystack[ $this->yyidx + + - 3 ]->minor[ 'smarty_internal_index' ])); + } + + #line 395 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r31() + { + $tag = + trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->lex->ldel_length, - $this->lex->rdel_length)); + if ($tag == 'strip') { + $this->strip = true; + $this->_retvalue = null;; + } else { + if (defined($tag)) { + if ($this->security) { + $this->security->isTrustedConstant($tag, $this->compiler); + } + $this->_retvalue = + $this->compiler->compileTag('private_print_expression', array(), array('value' => $tag)); + } else { + if (preg_match('/^(.*)(\s+nocache)$/', $tag, $match)) { + $this->_retvalue = $this->compiler->compileTag($match[ 1 ], array("'nocache'")); + } else { + $this->_retvalue = $this->compiler->compileTag($tag, array()); + } + } + } + } + + #line 417 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r32() + { + if (defined($this->yystack[ $this->yyidx + - 1 ]->minor)) { + if ($this->security) { + $this->security->isTrustedConstant($this->yystack[ $this->yyidx + - 1 ]->minor, $this->compiler); + } + $this->_retvalue = + $this->compiler->compileTag('private_print_expression', $this->yystack[ $this->yyidx + 0 ]->minor, + array('value' => $this->yystack[ $this->yyidx + - 1 ]->minor)); + } else { + $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + - 1 ]->minor, + $this->yystack[ $this->yyidx + 0 ]->minor); + } + } + + #line 427 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r33() + { + if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { + if ($this->security) { + $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler); + } + $this->_retvalue = $this->compiler->compileTag('private_print_expression', array(), + array('value' => $this->yystack[ $this->yyidx + 0 ]->minor)); + } else { + $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + 0 ]->minor, array()); + } + } + + #line 440 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r34() + { + if (defined($this->yystack[ $this->yyidx + - 2 ]->minor)) { + if ($this->security) { + $this->security->isTrustedConstant($this->yystack[ $this->yyidx + - 2 ]->minor, $this->compiler); + } + $this->_retvalue = + $this->compiler->compileTag('private_print_expression', $this->yystack[ $this->yyidx + 0 ]->minor, + array('value' => $this->yystack[ $this->yyidx + - 2 ]->minor, + 'modifierlist' => $this->yystack[ $this->yyidx + - 1 ]->minor)); + } else { + $this->_retvalue = '' . + $this->compiler->compileTag($this->yystack[ $this->yyidx + - 2 ]->minor, + $this->yystack[ $this->yyidx + 0 ]->minor) . '_retvalue .= $this->compiler->compileTag('private_modifier', array(), + array('modifierlist' => $this->yystack[ $this->yyidx + + - 1 ]->minor, 'value' => 'ob_get_clean()')) . ';?>'; + } + } + + #line 453 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r35() + { + $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + - 3 ]->minor, + $this->yystack[ $this->yyidx + 0 ]->minor, + array('object_method' => $this->yystack[ $this->yyidx + + - 1 ]->minor)); + } + + #line 458 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r36() + { + $this->_retvalue = '' . + $this->compiler->compileTag($this->yystack[ $this->yyidx + - 4 ]->minor, + $this->yystack[ $this->yyidx + 0 ]->minor, + array('object_method' => $this->yystack[ $this->yyidx + - 2 ]->minor)) . + '_retvalue .= $this->compiler->compileTag('private_modifier', array(), + array('modifierlist' => $this->yystack[ $this->yyidx + + - 1 ]->minor, 'value' => 'ob_get_clean()')) . ';?>'; + } + + #line 464 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r37() + { + $tag = trim(substr($this->yystack[ $this->yyidx + - 1 ]->minor, $this->lex->ldel_length)); + $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, array(), + array('if condition' => $this->yystack[ $this->yyidx + + 0 ]->minor)); + } + + #line 469 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r38() + { + $tag = trim(substr($this->yystack[ $this->yyidx + - 2 ]->minor, $this->lex->ldel_length)); + $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, + $this->yystack[ $this->yyidx + 0 ]->minor, + array('if condition' => $this->yystack[ $this->yyidx + + - 1 ]->minor)); + } + + #line 474 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r39() + { + $tag = trim(substr($this->yystack[ $this->yyidx + - 1 ]->minor, $this->lex->ldel_length)); + $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, array(), + array('if condition' => $this->yystack[ $this->yyidx + + 0 ]->minor)); + } + + #line 485 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r41() + { + $this->_retvalue = $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, + array(array('start' => $this->yystack[ $this->yyidx + + - 6 ]->minor), + array('ifexp' => $this->yystack[ $this->yyidx + + - 4 ]->minor), + array('var' => $this->yystack[ $this->yyidx + + - 2 ]->minor), + array('step' => $this->yystack[ $this->yyidx + + - 1 ]->minor))), 1); + } + + #line 489 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r42() + { + $this->_retvalue = '=' . $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 497 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r44() + { + $this->_retvalue = $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, + array(array('start' => $this->yystack[ $this->yyidx + + - 3 ]->minor), + array('to' => $this->yystack[ $this->yyidx + + - 1 ]->minor))), 0); + } + + #line 501 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r45() + { + $this->_retvalue = $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, + array(array('start' => $this->yystack[ $this->yyidx + + - 5 ]->minor), + array('to' => $this->yystack[ $this->yyidx + + - 3 ]->minor), + array('step' => $this->yystack[ $this->yyidx + + - 1 ]->minor))), 0); + } + + #line 506 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r46() + { + $this->_retvalue = $this->compiler->compileTag('foreach', $this->yystack[ $this->yyidx + 0 ]->minor); + } + + #line 511 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r47() + { + $this->_retvalue = $this->compiler->compileTag('foreach', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, + array(array('from' => $this->yystack[ $this->yyidx + + - 3 ]->minor), + array('item' => $this->yystack[ $this->yyidx + + - 1 ]->minor)))); + } + + #line 515 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r48() + { + $this->_retvalue = $this->compiler->compileTag('foreach', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, + array(array('from' => $this->yystack[ $this->yyidx + + - 5 ]->minor), + array('item' => $this->yystack[ $this->yyidx + + - 1 ]->minor), + array('key' => $this->yystack[ $this->yyidx + + - 3 ]->minor)))); + } + + #line 528 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r51() + { + $this->_retvalue = $this->compiler->compileTag('setfilter', array(), + array('modifier_list' => array(array_merge(array($this->yystack[ $this->yyidx + + - 1 ]->minor), $this->yystack[ $this->yyidx + 0 ]->minor)))); + } + + #line 532 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r52() + { + $this->_retvalue = $this->compiler->compileTag('setfilter', array(), + array('modifier_list' => array_merge(array(array_merge(array($this->yystack[ $this->yyidx + + - 2 ]->minor), $this->yystack[ $this->yyidx + - 1 ]->minor)), + $this->yystack[ $this->yyidx + + 0 ]->minor))); + } + + #line 537 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r53() + { + $j = strrpos($this->yystack[ $this->yyidx + 0 ]->minor, '.'); + if ($this->yystack[ $this->yyidx + 0 ]->minor[ $j + 1 ] == 'c') { + // {$smarty.block.child} + $this->_retvalue = SMARTY_INTERNAL_COMPILE_BLOCK::compileChildBlock($this->compiler); + } else { + // {$smarty.block.parent} + $this->_retvalue = SMARTY_INTERNAL_COMPILE_BLOCK::compileParentBlock($this->compiler); + } + } + + #line 550 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r54() + { + $tag = + trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->lex->ldel_length, - $this->lex->rdel_length), + ' /'); + if ($tag == 'strip') { + $this->strip = false; + $this->_retvalue = null; + } else { + $this->_retvalue = $this->compiler->compileTag($tag . 'close', array()); + } + } + + #line 559 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r55() + { + $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + 0 ]->minor . 'close', array()); + } + + #line 563 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r56() + { + $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + - 1 ]->minor . 'close', array(), + array('modifier_list' => $this->yystack[ $this->yyidx + + 0 ]->minor)); + } + + #line 568 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r57() + { + $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + - 2 ]->minor . 'close', array(), + array('object_method' => $this->yystack[ $this->yyidx + + 0 ]->minor)); + } + + #line 572 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r58() + { + $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + - 3 ]->minor . 'close', array(), + array('object_method' => $this->yystack[ $this->yyidx + + - 1 ]->minor, 'modifier_list' => $this->yystack[ $this->yyidx + + 0 ]->minor)); + } + + #line 580 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r59() + { + $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor; + $this->_retvalue[] = $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 586 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r60() + { + $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor); + } + + #line 591 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r61() + { + $this->_retvalue = array(); + } + + #line 596 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r62() + { + if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { + if ($this->security) { + $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler); + } + $this->_retvalue = + array($this->yystack[ $this->yyidx + - 2 ]->minor => $this->yystack[ $this->yyidx + 0 ]->minor); + } else { + $this->_retvalue = + array($this->yystack[ $this->yyidx + - 2 ]->minor => '\'' . $this->yystack[ $this->yyidx + 0 ]->minor . + '\''); + } + } + + #line 607 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r63() + { + $this->_retvalue = + array(trim($this->yystack[ $this->yyidx + - 1 ]->minor, " =\n\r\t") => $this->yystack[ $this->yyidx + + 0 ]->minor); + } + + #line 615 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r65() + { + $this->_retvalue = '\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\''; + } + + #line 627 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r68() + { + $this->_retvalue = + array($this->yystack[ $this->yyidx + - 2 ]->minor => $this->yystack[ $this->yyidx + 0 ]->minor); + } + + #line 640 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r70() + { + $this->yystack[ $this->yyidx + - 2 ]->minor[] = $this->yystack[ $this->yyidx + 0 ]->minor; + $this->_retvalue = $this->yystack[ $this->yyidx + - 2 ]->minor; + } + + #line 645 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r71() + { + $this->_retvalue = array('var' => '\'' . substr($this->yystack[ $this->yyidx + - 2 ]->minor, 1) . '\'', + 'value' => $this->yystack[ $this->yyidx + 0 ]->minor); + } + + #line 652 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r73() + { + $this->_retvalue = array('var' => $this->yystack[ $this->yyidx + - 2 ]->minor, + 'value' => $this->yystack[ $this->yyidx + 0 ]->minor); + } + + #line 676 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r77() + { + $this->_retvalue = + '$_smarty_tpl->getStreamVariable(\'' . substr($this->yystack[ $this->yyidx + - 2 ]->minor, 1) . '://' . + $this->yystack[ $this->yyidx + 0 ]->minor . '\')'; + } + + #line 681 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r78() + { + $this->_retvalue = + $this->yystack[ $this->yyidx + - 2 ]->minor . trim($this->yystack[ $this->yyidx + - 1 ]->minor) . + $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 695 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r81() + { + $this->_retvalue = $this->compiler->compileTag('private_modifier', array(), + array('value' => $this->yystack[ $this->yyidx + - 1 ]->minor, + 'modifierlist' => $this->yystack[ $this->yyidx + + 0 ]->minor)); + } + + #line 701 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r82() + { + $this->_retvalue = (isset($this->yystack[ $this->yyidx + - 1 ]->minor[ 'pre' ]) ? + $this->yystack[ $this->yyidx + - 1 ]->minor[ 'pre' ] : '') . + $this->yystack[ $this->yyidx + - 2 ]->minor . $this->yystack[ $this->yyidx + - 1 ]->minor[ 'op' ] . + $this->yystack[ $this->yyidx + 0 ]->minor . + (isset($this->yystack[ $this->yyidx + - 1 ]->minor[ 'pre' ]) ? ')' : ''); + } + + #line 704 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r83() + { + $this->_retvalue = + $this->yystack[ $this->yyidx + 0 ]->minor . $this->yystack[ $this->yyidx + - 1 ]->minor . ')'; + } + + #line 708 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r84() + { + $this->_retvalue = 'in_array(' . $this->yystack[ $this->yyidx + - 2 ]->minor . ',' . + $this->yystack[ $this->yyidx + 0 ]->minor . ')'; + } + + #line 712 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r85() + { + $this->_retvalue = 'in_array(' . $this->yystack[ $this->yyidx + - 2 ]->minor . ',(array)' . + $this->yystack[ $this->yyidx + 0 ]->minor . ')'; + } + + #line 716 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r86() + { + $this->_retvalue = $this->yystack[ $this->yyidx + - 2 ]->minor . $this->yystack[ $this->yyidx + - 1 ]->minor . + $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 728 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r88() + { + $this->_retvalue = $this->yystack[ $this->yyidx + - 5 ]->minor . ' ? ' . + $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + - 2 ]->minor, 1) . '\'') . + ' : ' . $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 732 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r89() + { + $this->_retvalue = + $this->yystack[ $this->yyidx + - 5 ]->minor . ' ? ' . $this->yystack[ $this->yyidx + - 2 ]->minor . ' : ' . + $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 747 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r92() + { + $this->_retvalue = '!' . $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 768 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r97() + { + $this->_retvalue = + $this->yystack[ $this->yyidx + - 2 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 772 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r98() + { + $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor . '.'; + } + + #line 776 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r99() + { + $this->_retvalue = '.' . $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 781 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r100() + { + if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { + if ($this->security) { + $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler); + } + $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; + } else { + $this->_retvalue = '\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\''; + } + } + + #line 798 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r102() + { + $this->_retvalue = "(" . $this->yystack[ $this->yyidx + - 1 ]->minor . ")"; + } + + #line 813 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r105() + { + self::$prefix_number ++; + if ($this->yystack[ $this->yyidx + - 2 ]->minor[ 'var' ] == '\'smarty\'') { + $this->compiler->prefix_code[] = 'compiler->compileTag('private_special_variable', array(), + $this->yystack[ $this->yyidx + - 2 ]->minor[ 'smarty_internal_index' ]) . + ';?>'; + } else { + $this->compiler->prefix_code[] = 'compiler->compileVariable($this->yystack[ $this->yyidx + - 2 ]->minor[ 'var' ]) . + $this->yystack[ $this->yyidx + - 2 ]->minor[ 'smarty_internal_index' ] . ';?>'; + } + $this->_retvalue = '$_tmp' . self::$prefix_number . '::' . $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . + $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; + } + + #line 824 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r106() + { + self::$prefix_number ++; + $tmp = $this->compiler->appendCode('', $this->yystack[ $this->yyidx + 0 ]->minor); + $this->compiler->prefix_code[] = + $this->compiler->appendCode($tmp, ''); + $this->_retvalue = '$_tmp' . self::$prefix_number; + } + + #line 841 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r109() + { + if (!in_array(strtolower($this->yystack[ $this->yyidx + - 2 ]->minor), array('self', 'parent')) && + (!$this->security || + $this->security->isTrustedStaticClassAccess($this->yystack[ $this->yyidx + - 2 ]->minor, + $this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler)) + ) { + if (isset($this->smarty->registered_classes[ $this->yystack[ $this->yyidx + - 2 ]->minor ])) { + $this->_retvalue = + $this->smarty->registered_classes[ $this->yystack[ $this->yyidx + - 2 ]->minor ] . '::' . + $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; + } else { + $this->_retvalue = $this->yystack[ $this->yyidx + - 2 ]->minor . '::' . + $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; + } + } else { + $this->compiler->trigger_template_error("static class '" . $this->yystack[ $this->yyidx + - 2 ]->minor . + "' is undefined or not allowed by security setting"); + } + } + + #line 860 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r111() + { + $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 871 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r112() + { + $this->_retvalue = + $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\''); + } + + #line 874 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r113() + { + if ($this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ] == '\'smarty\'') { + $smarty_var = $this->compiler->compileTag('private_special_variable', array(), + $this->yystack[ $this->yyidx + + 0 ]->minor[ 'smarty_internal_index' ]); + $this->_retvalue = $smarty_var; + } else { + // used for array reset,next,prev,end,current + $this->last_variable = $this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ]; + $this->last_index = $this->yystack[ $this->yyidx + 0 ]->minor[ 'smarty_internal_index' ]; + $this->_retvalue = $this->compiler->compileVariable($this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ]) . + $this->yystack[ $this->yyidx + 0 ]->minor[ 'smarty_internal_index' ]; + } + } + + #line 887 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r114() + { + $this->_retvalue = '$_smarty_tpl->tpl_vars[' . $this->yystack[ $this->yyidx + - 2 ]->minor . ']->' . + $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 897 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r116() + { + $this->_retvalue = + $this->compiler->compileConfigVariable("'" . $this->yystack[ $this->yyidx + - 1 ]->minor . "'"); + } + + #line 901 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r117() + { + $this->_retvalue = '(is_array($tmp = ' . + $this->compiler->compileConfigVariable("'" . $this->yystack[ $this->yyidx + - 2 ]->minor . "'") . + ') ? $tmp' . $this->yystack[ $this->yyidx + 0 ]->minor . ' :null)'; + } + + #line 905 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r118() + { + $this->_retvalue = $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + - 1 ]->minor); + } + + #line 909 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r119() + { + $this->_retvalue = + '(is_array($tmp = ' . $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + - 2 ]->minor) . + ') ? $tmp' . $this->yystack[ $this->yyidx + 0 ]->minor . ' : null)'; + } + + #line 913 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r120() + { + $this->_retvalue = array('var' => '\'' . substr($this->yystack[ $this->yyidx + - 1 ]->minor, 1) . '\'', + 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor); + } + + #line 916 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r121() + { + $this->_retvalue = array('var' => $this->yystack[ $this->yyidx + - 1 ]->minor, + 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor); + } + + #line 929 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r123() + { + return; + } + + #line 935 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r124() + { + $this->_retvalue = + '[' . $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\'') . + ']'; + } + + #line 938 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r125() + { + $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + 0 ]->minor) . ']'; + } + + #line 942 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r126() + { + $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + - 2 ]->minor) . '->' . + $this->yystack[ $this->yyidx + 0 ]->minor . ']'; + } + + #line 946 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r127() + { + if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { + if ($this->security) { + $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler); + } + $this->_retvalue = '[' . $this->yystack[ $this->yyidx + 0 ]->minor . ']'; + } else { + $this->_retvalue = "['" . $this->yystack[ $this->yyidx + 0 ]->minor . "']"; + } + } + + #line 957 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r128() + { + $this->_retvalue = '[' . $this->yystack[ $this->yyidx + 0 ]->minor . ']'; + } + + #line 962 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r129() + { + $this->_retvalue = '[' . $this->yystack[ $this->yyidx + - 1 ]->minor . ']'; + } + + #line 967 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r130() + { + $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', array(), '[\'section\'][\'' . + $this->yystack[ $this->yyidx + + - 1 ]->minor . + '\'][\'index\']') . ']'; + } + + #line 971 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r131() + { + $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', array(), '[\'section\'][\'' . + $this->yystack[ $this->yyidx + + - 3 ]->minor . '\'][\'' . + $this->yystack[ $this->yyidx + + - 1 ]->minor . '\']') . ']'; + } + + #line 974 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r132() + { + $this->_retvalue = '[' . $this->yystack[ $this->yyidx + - 1 ]->minor . ']'; + } + + #line 980 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r134() + { + $this->_retvalue = '[' . + $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + - 1 ]->minor, 1) . '\'') . + ']';; + } + + #line 996 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r138() + { + $this->_retvalue = '[]'; + } + + #line 1006 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r139() + { + $this->_retvalue = '\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\''; + } + + #line 1010 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r140() + { + $this->_retvalue = "''"; + } + + #line 1015 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r141() + { + $this->_retvalue = + $this->yystack[ $this->yyidx + - 1 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 1023 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r143() + { + $var = + trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->lex->ldel_length, - $this->lex->rdel_length), + ' $'); + $this->_retvalue = $this->compiler->compileVariable('\'' . $var . '\''); + } + + #line 1029 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r144() + { + $this->_retvalue = '(' . $this->yystack[ $this->yyidx + - 1 ]->minor . ')'; + } + + #line 1036 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r145() + { + if ($this->yystack[ $this->yyidx + - 1 ]->minor[ 'var' ] == '\'smarty\'') { + $this->_retvalue = $this->compiler->compileTag('private_special_variable', array(), + $this->yystack[ $this->yyidx + + - 1 ]->minor[ 'smarty_internal_index' ]) . + $this->yystack[ $this->yyidx + 0 ]->minor; + } else { + $this->_retvalue = $this->compiler->compileVariable($this->yystack[ $this->yyidx + - 1 ]->minor[ 'var' ]) . + $this->yystack[ $this->yyidx + - 1 ]->minor[ 'smarty_internal_index' ] . + $this->yystack[ $this->yyidx + 0 ]->minor; + } + } + + #line 1045 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r146() + { + $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 1050 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r147() + { + $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 1055 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r148() + { + if ($this->security && substr($this->yystack[ $this->yyidx + - 1 ]->minor, 0, 1) == '_') { + $this->compiler->trigger_template_error(self::Err1); + } + $this->_retvalue = + '->' . $this->yystack[ $this->yyidx + - 1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 1062 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r149() + { + if ($this->security) { + $this->compiler->trigger_template_error(self::Err2); + } + $this->_retvalue = '->{' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + - 1 ]->minor) . + $this->yystack[ $this->yyidx + 0 ]->minor . '}'; + } + + #line 1069 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r150() + { + if ($this->security) { + $this->compiler->trigger_template_error(self::Err2); + } + $this->_retvalue = + '->{' . $this->yystack[ $this->yyidx + - 2 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor . '}'; + } + + #line 1076 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r151() + { + if ($this->security) { + $this->compiler->trigger_template_error(self::Err2); + } + $this->_retvalue = '->{\'' . $this->yystack[ $this->yyidx + - 4 ]->minor . '\'.' . + $this->yystack[ $this->yyidx + - 2 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor . '}'; + } + + #line 1084 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r152() + { + $this->_retvalue = '->' . $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 1092 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r153() + { + if (!$this->security || + $this->security->isTrustedPhpFunction($this->yystack[ $this->yyidx + - 3 ]->minor, $this->compiler) + ) { + if (strcasecmp($this->yystack[ $this->yyidx + - 3 ]->minor, 'isset') === 0 || + strcasecmp($this->yystack[ $this->yyidx + - 3 ]->minor, 'empty') === 0 || + strcasecmp($this->yystack[ $this->yyidx + - 3 ]->minor, 'array') === 0 || + is_callable($this->yystack[ $this->yyidx + - 3 ]->minor) + ) { + $func_name = strtolower($this->yystack[ $this->yyidx + - 3 ]->minor); + if ($func_name == 'isset') { + if (count($this->yystack[ $this->yyidx + - 1 ]->minor) == 0) { + $this->compiler->trigger_template_error('Illegal number of paramer in "isset()"'); + } + $par = implode(',', $this->yystack[ $this->yyidx + - 1 ]->minor); + if (strncasecmp($par, '$_smarty_tpl->smarty->ext->_config->_getConfigVariable', + strlen('$_smarty_tpl->smarty->ext->_config->_getConfigVariable')) === 0 + ) { + self::$prefix_number ++; + $this->compiler->prefix_code[] = + ''; + $isset_par = '$_tmp' . self::$prefix_number; + } else { + $isset_par = str_replace("')->value", "',null,true,false)->value", $par); + } + $this->_retvalue = $this->yystack[ $this->yyidx + - 3 ]->minor . "(" . $isset_par . ")"; + } elseif (in_array($func_name, array('empty', 'reset', 'current', 'end', 'prev', 'next'))) { + if (count($this->yystack[ $this->yyidx + - 1 ]->minor) != 1) { + $this->compiler->trigger_template_error('Illegal number of paramer in "empty()"'); + } + if ($func_name == 'empty') { + $this->_retvalue = $func_name . '(' . str_replace("')->value", "',null,true,false)->value", + $this->yystack[ $this->yyidx + + - 1 ]->minor[ 0 ]) . ')'; + } else { + $this->_retvalue = $func_name . '(' . $this->yystack[ $this->yyidx + - 1 ]->minor[ 0 ] . ')'; + } + } else { + $this->_retvalue = $this->yystack[ $this->yyidx + - 3 ]->minor . "(" . + implode(',', $this->yystack[ $this->yyidx + - 1 ]->minor) . ")"; + } + } else { + $this->compiler->trigger_template_error("unknown function \"" . + $this->yystack[ $this->yyidx + - 3 ]->minor . "\""); + } + } + } + + #line 1131 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r154() + { + if ($this->security && substr($this->yystack[ $this->yyidx + - 3 ]->minor, 0, 1) == '_') { + $this->compiler->trigger_template_error(self::Err1); + } + $this->_retvalue = $this->yystack[ $this->yyidx + - 3 ]->minor . "(" . + implode(',', $this->yystack[ $this->yyidx + - 1 ]->minor) . ")"; + } + + #line 1138 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r155() + { + if ($this->security) { + $this->compiler->trigger_template_error(self::Err2); + } + self::$prefix_number ++; + $this->compiler->prefix_code[] = 'compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + - 3 ]->minor, 1) . '\'') . + ';?>'; + $this->_retvalue = + '$_tmp' . self::$prefix_number . '(' . implode(',', $this->yystack[ $this->yyidx + - 1 ]->minor) . ')'; + } + + #line 1149 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r156() + { + $this->_retvalue = + array_merge($this->yystack[ $this->yyidx + - 2 ]->minor, array($this->yystack[ $this->yyidx + 0 ]->minor)); + } + + #line 1166 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r159() + { + $this->_retvalue = array_merge($this->yystack[ $this->yyidx + - 2 ]->minor, + array(array_merge($this->yystack[ $this->yyidx + - 1 ]->minor, + $this->yystack[ $this->yyidx + 0 ]->minor))); + } + + #line 1170 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r160() + { + $this->_retvalue = + array(array_merge($this->yystack[ $this->yyidx + - 1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor)); + } + + #line 1178 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r162() + { + $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor); + } + + #line 1186 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r163() + { + $this->_retvalue = + array_merge($this->yystack[ $this->yyidx + - 1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor); + } + + #line 1205 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r167() + { + $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor, '', 'method'); + } + + #line 1210 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r168() + { + $this->_retvalue = + array($this->yystack[ $this->yyidx + - 1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'method'); + } + + #line 1215 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r169() + { + $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor, ''); + } + + #line 1220 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r170() + { + $this->_retvalue = + array($this->yystack[ $this->yyidx + - 1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'property'); + } + + #line 1225 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r171() + { + $this->_retvalue = array($this->yystack[ $this->yyidx + - 2 ]->minor, + $this->yystack[ $this->yyidx + - 1 ]->minor . + $this->yystack[ $this->yyidx + 0 ]->minor, 'property'); + } + + #line 1231 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r172() + { + $this->_retvalue[ 'op' ] = ' ' . trim($this->yystack[ $this->yyidx + 0 ]->minor) . ' '; + } + + #line 1235 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r173() + { + static $lops = array('eq' => array('op' => ' == ', 'pre' => null), + 'ne' => array('op' => ' != ', 'pre' => null), + 'neq' => array('op' => ' != ', 'pre' => null), + 'gt' => array('op' => ' > ', 'pre' => null), + 'ge' => array('op' => ' >= ', 'pre' => null), + 'gte' => array('op' => ' >= ', 'pre' => null), + 'lt' => array('op' => ' < ', 'pre' => null), + 'le' => array('op' => ' <= ', 'pre' => null), + 'lte' => array('op' => ' <= ', 'pre' => null), + 'mod' => array('op' => ' % ', 'pre' => null), + 'and' => array('op' => ' && ', 'pre' => null), + 'or' => array('op' => ' || ', 'pre' => null), + 'xor' => array('op' => ' xor ', 'pre' => null), + 'isdivby' => array('op' => ' % ', 'pre' => '!('), + 'isnotdivby' => array('op' => ' % ', 'pre' => '('), + 'isevenby' => array('op' => ' / ', 'pre' => '!(1 & '), + 'isnotevenby' => array('op' => ' / ', 'pre' => '(1 & '), + 'isoddby' => array('op' => ' / ', 'pre' => '(1 & '), + 'isnotoddby' => array('op' => ' / ', 'pre' => '!(1 & '),); + $op = strtolower(preg_replace('/\s*/', '', $this->yystack[ $this->yyidx + 0 ]->minor)); + $this->_retvalue = $lops[ $op ]; + } + + #line 1261 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r174() + { + static $scond = + array('iseven' => '!(1 & ', 'isnoteven' => '(1 & ', 'isodd' => '(1 & ', 'isnotodd' => '!(1 & ',); + $op = strtolower(str_replace(' ', '', $this->yystack[ $this->yyidx + 0 ]->minor)); + $this->_retvalue = $scond[ $op ]; + } + + #line 1275 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r175() + { + $this->_retvalue = 'array(' . $this->yystack[ $this->yyidx + - 1 ]->minor . ')'; + } + + #line 1283 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r177() + { + $this->_retvalue = + $this->yystack[ $this->yyidx + - 2 ]->minor . ',' . $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 1291 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r179() + { + $this->_retvalue = + $this->yystack[ $this->yyidx + - 2 ]->minor . '=>' . $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 1295 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r180() + { + $this->_retvalue = + '\'' . $this->yystack[ $this->yyidx + - 2 ]->minor . '\'=>' . $this->yystack[ $this->yyidx + 0 ]->minor; + } + + #line 1311 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r183() + { + $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor->to_smarty_php($this); + } + + #line 1316 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r184() + { + $this->yystack[ $this->yyidx + - 1 ]->minor->append_subtree($this, $this->yystack[ $this->yyidx + 0 ]->minor); + $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor; + } + + #line 1321 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r185() + { + $this->_retvalue = new Smarty_Internal_ParseTree_Dq($this, $this->yystack[ $this->yyidx + 0 ]->minor); + } + + #line 1325 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r186() + { + $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)' . $this->yystack[ $this->yyidx + - 1 ]->minor); + } + + #line 1333 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r188() + { + $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)$_smarty_tpl->tpl_vars[\'' . + substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . + '\']->value'); + } + + #line 1341 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r190() + { + $this->_retvalue = + new Smarty_Internal_ParseTree_Code('(string)(' . $this->yystack[ $this->yyidx + - 1 ]->minor . ')'); + } + + #line 1345 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r191() + { + $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->yystack[ $this->yyidx + 0 ]->minor); + } + + #line 1349 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r192() + { + $this->_retvalue = new Smarty_Internal_ParseTree_DqContent($this->yystack[ $this->yyidx + 0 ]->minor); + } + + private $_retvalue; + + public function yy_reduce($yyruleno) + { + if ($this->yyTraceFILE && $yyruleno >= 0 && $yyruleno < count(self::$yyRuleName)) { + fprintf($this->yyTraceFILE, "%sReduce (%d) [%s].\n", $this->yyTracePrompt, $yyruleno, + self::$yyRuleName[ $yyruleno ]); + } + + $this->_retvalue = $yy_lefthand_side = null; + if (isset(self::$yyReduceMap[ $yyruleno ])) { + // call the action + $this->_retvalue = null; + $this->{'yy_r' . self::$yyReduceMap[ $yyruleno ]}(); + $yy_lefthand_side = $this->_retvalue; + } + $yygoto = self::$yyRuleInfo[ $yyruleno ][ 0 ]; + $yysize = self::$yyRuleInfo[ $yyruleno ][ 1 ]; + $this->yyidx -= $yysize; + for ($i = $yysize; $i; $i --) { + // pop all of the right-hand side parameters + array_pop($this->yystack); + } + $yyact = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, $yygoto); + if ($yyact < self::YYNSTATE) { + if (!$this->yyTraceFILE && $yysize) { + $this->yyidx ++; + $x = new TP_yyStackEntry; + $x->stateno = $yyact; + $x->major = $yygoto; + $x->minor = $yy_lefthand_side; + $this->yystack[ $this->yyidx ] = $x; + } else { + $this->yy_shift($yyact, $yygoto, $yy_lefthand_side); + } + } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) { + $this->yy_accept(); + } + } + + public function yy_parse_failed() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sFail!\n", $this->yyTracePrompt); + } + while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } + } + + public function yy_syntax_error($yymajor, $TOKEN) + { + #line 207 "../smarty/lexer/smarty_internal_templateparser.y" + + $this->internalError = true; + $this->yymajor = $yymajor; + $this->compiler->trigger_template_error(); + } + + public function yy_accept() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sAccept!\n", $this->yyTracePrompt); + } + while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } + #line 200 "../smarty/lexer/smarty_internal_templateparser.y" + + $this->successful = !$this->internalError; + $this->internalError = false; + $this->retvalue = $this->_retvalue; + } + + public function doParse($yymajor, $yytokenvalue) + { + $yyerrorhit = 0; /* True if yymajor has invoked an error */ + + if ($this->yyidx === null || $this->yyidx < 0) { + $this->yyidx = 0; + $this->yyerrcnt = - 1; + $x = new TP_yyStackEntry; + $x->stateno = 0; + $x->major = 0; + $this->yystack = array(); + $this->yystack[] = $x; + } + $yyendofinput = ($yymajor == 0); + + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sInput %s\n", $this->yyTracePrompt, $this->yyTokenName[ $yymajor ]); + } + + do { + $yyact = $this->yy_find_shift_action($yymajor); + if ($yymajor < self::YYERRORSYMBOL && !$this->yy_is_expected_token($yymajor)) { + // force a syntax error + $yyact = self::YY_ERROR_ACTION; + } + if ($yyact < self::YYNSTATE) { + $this->yy_shift($yyact, $yymajor, $yytokenvalue); + $this->yyerrcnt --; + if ($yyendofinput && $this->yyidx >= 0) { + $yymajor = 0; + } else { + $yymajor = self::YYNOCODE; + } + } elseif ($yyact < self::YYNSTATE + self::YYNRULE) { + $this->yy_reduce($yyact - self::YYNSTATE); + } elseif ($yyact == self::YY_ERROR_ACTION) { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sSyntax Error!\n", $this->yyTracePrompt); + } + if (self::YYERRORSYMBOL) { + if ($this->yyerrcnt < 0) { + $this->yy_syntax_error($yymajor, $yytokenvalue); + } + $yymx = $this->yystack[ $this->yyidx ]->major; + if ($yymx == self::YYERRORSYMBOL || $yyerrorhit) { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sDiscard input token %s\n", $this->yyTracePrompt, + $this->yyTokenName[ $yymajor ]); + } + $this->yy_destructor($yymajor, $yytokenvalue); + $yymajor = self::YYNOCODE; + } else { + while ($this->yyidx >= 0 && $yymx != self::YYERRORSYMBOL && + ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE) { + $this->yy_pop_parser_stack(); + } + if ($this->yyidx < 0 || $yymajor == 0) { + $this->yy_destructor($yymajor, $yytokenvalue); + $this->yy_parse_failed(); + $yymajor = self::YYNOCODE; + } elseif ($yymx != self::YYERRORSYMBOL) { + $u2 = 0; + $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2); + } + } + $this->yyerrcnt = 3; + $yyerrorhit = 1; + } else { + if ($this->yyerrcnt <= 0) { + $this->yy_syntax_error($yymajor, $yytokenvalue); + } + $this->yyerrcnt = 3; + $this->yy_destructor($yymajor, $yytokenvalue); + if ($yyendofinput) { + $this->yy_parse_failed(); + } + $yymajor = self::YYNOCODE; + } + } else { + $this->yy_accept(); + $yymajor = self::YYNOCODE; + } + } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0); + } +} + diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_testinstall.php b/inc/libs/Smarty/sysplugins/smarty_internal_testinstall.php new file mode 100755 index 0000000..72d9a52 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_testinstall.php @@ -0,0 +1,604 @@ +\n"; + echo "Smarty Installation test...\n"; + echo "Testing template directory...\n"; + } + + $_stream_resolve_include_path = function_exists('stream_resolve_include_path'); + + // test if all registered template_dir are accessible + foreach ($smarty->getTemplateDir() as $template_dir) { + $_template_dir = $template_dir; + $template_dir = realpath($template_dir); + // resolve include_path or fail existence + if (!$template_dir) { + if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_template_dir)) { + // try PHP include_path + if ($_stream_resolve_include_path) { + $template_dir = stream_resolve_include_path($_template_dir); + } else { + $template_dir = $smarty->ext->_getIncludePath->getIncludePath($_template_dir, null, $smarty); + } + + if ($template_dir !== false) { + if ($errors === null) { + echo "$template_dir is OK.\n"; + } + + continue; + } else { + $status = false; + $message = + "FAILED: $_template_dir does not exist (and couldn't be found in include_path either)"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'template_dir' ] = $message; + } + + continue; + } + } else { + $status = false; + $message = "FAILED: $_template_dir does not exist"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'template_dir' ] = $message; + } + + continue; + } + } + + if (!is_dir($template_dir)) { + $status = false; + $message = "FAILED: $template_dir is not a directory"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'template_dir' ] = $message; + } + } elseif (!is_readable($template_dir)) { + $status = false; + $message = "FAILED: $template_dir is not readable"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'template_dir' ] = $message; + } + } else { + if ($errors === null) { + echo "$template_dir is OK.\n"; + } + } + } + + if ($errors === null) { + echo "Testing compile directory...\n"; + } + + // test if registered compile_dir is accessible + $__compile_dir = $smarty->getCompileDir(); + $_compile_dir = realpath($__compile_dir); + if (!$_compile_dir) { + $status = false; + $message = "FAILED: {$__compile_dir} does not exist"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'compile_dir' ] = $message; + } + } elseif (!is_dir($_compile_dir)) { + $status = false; + $message = "FAILED: {$_compile_dir} is not a directory"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'compile_dir' ] = $message; + } + } elseif (!is_readable($_compile_dir)) { + $status = false; + $message = "FAILED: {$_compile_dir} is not readable"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'compile_dir' ] = $message; + } + } elseif (!is_writable($_compile_dir)) { + $status = false; + $message = "FAILED: {$_compile_dir} is not writable"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'compile_dir' ] = $message; + } + } else { + if ($errors === null) { + echo "{$_compile_dir} is OK.\n"; + } + } + + if ($errors === null) { + echo "Testing plugins directory...\n"; + } + + // test if all registered plugins_dir are accessible + // and if core plugins directory is still registered + $_core_plugins_dir = realpath(dirname(__FILE__) . '/../plugins'); + $_core_plugins_available = false; + foreach ($smarty->getPluginsDir() as $plugin_dir) { + $_plugin_dir = $plugin_dir; + $plugin_dir = realpath($plugin_dir); + // resolve include_path or fail existence + if (!$plugin_dir) { + if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) { + // try PHP include_path + if ($_stream_resolve_include_path) { + $plugin_dir = stream_resolve_include_path($_plugin_dir); + } else { + $plugin_dir = $smarty->ext->_getIncludePath->getIncludePath($_plugin_dir, null, $smarty); + } + + if ($plugin_dir !== false) { + if ($errors === null) { + echo "$plugin_dir is OK.\n"; + } + + continue; + } else { + $status = false; + $message = "FAILED: $_plugin_dir does not exist (and couldn't be found in include_path either)"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'plugins_dir' ] = $message; + } + + continue; + } + } else { + $status = false; + $message = "FAILED: $_plugin_dir does not exist"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'plugins_dir' ] = $message; + } + + continue; + } + } + + if (!is_dir($plugin_dir)) { + $status = false; + $message = "FAILED: $plugin_dir is not a directory"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'plugins_dir' ] = $message; + } + } elseif (!is_readable($plugin_dir)) { + $status = false; + $message = "FAILED: $plugin_dir is not readable"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'plugins_dir' ] = $message; + } + } elseif ($_core_plugins_dir && $_core_plugins_dir == realpath($plugin_dir)) { + $_core_plugins_available = true; + if ($errors === null) { + echo "$plugin_dir is OK.\n"; + } + } else { + if ($errors === null) { + echo "$plugin_dir is OK.\n"; + } + } + } + if (!$_core_plugins_available) { + $status = false; + $message = "WARNING: Smarty's own libs/plugins is not available"; + if ($errors === null) { + echo $message . ".\n"; + } elseif (!isset($errors[ 'plugins_dir' ])) { + $errors[ 'plugins_dir' ] = $message; + } + } + + if ($errors === null) { + echo "Testing cache directory...\n"; + } + + // test if all registered cache_dir is accessible + $__cache_dir = $smarty->getCacheDir(); + $_cache_dir = realpath($__cache_dir); + if (!$_cache_dir) { + $status = false; + $message = "FAILED: {$__cache_dir} does not exist"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'cache_dir' ] = $message; + } + } elseif (!is_dir($_cache_dir)) { + $status = false; + $message = "FAILED: {$_cache_dir} is not a directory"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'cache_dir' ] = $message; + } + } elseif (!is_readable($_cache_dir)) { + $status = false; + $message = "FAILED: {$_cache_dir} is not readable"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'cache_dir' ] = $message; + } + } elseif (!is_writable($_cache_dir)) { + $status = false; + $message = "FAILED: {$_cache_dir} is not writable"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'cache_dir' ] = $message; + } + } else { + if ($errors === null) { + echo "{$_cache_dir} is OK.\n"; + } + } + + if ($errors === null) { + echo "Testing configs directory...\n"; + } + + // test if all registered config_dir are accessible + foreach ($smarty->getConfigDir() as $config_dir) { + $_config_dir = $config_dir; + // resolve include_path or fail existence + if (!$config_dir) { + if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_config_dir)) { + // try PHP include_path + if ($_stream_resolve_include_path) { + $config_dir = stream_resolve_include_path($_config_dir); + } else { + $config_dir = $smarty->ext->_getIncludePath->getIncludePath($_config_dir, null, $smarty); + } + + if ($config_dir !== false) { + if ($errors === null) { + echo "$config_dir is OK.\n"; + } + + continue; + } else { + $status = false; + $message = "FAILED: $_config_dir does not exist (and couldn't be found in include_path either)"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'config_dir' ] = $message; + } + + continue; + } + } else { + $status = false; + $message = "FAILED: $_config_dir does not exist"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'config_dir' ] = $message; + } + + continue; + } + } + + if (!is_dir($config_dir)) { + $status = false; + $message = "FAILED: $config_dir is not a directory"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'config_dir' ] = $message; + } + } elseif (!is_readable($config_dir)) { + $status = false; + $message = "FAILED: $config_dir is not readable"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'config_dir' ] = $message; + } + } else { + if ($errors === null) { + echo "$config_dir is OK.\n"; + } + } + } + + if ($errors === null) { + echo "Testing sysplugin files...\n"; + } + // test if sysplugins are available + $source = SMARTY_SYSPLUGINS_DIR; + if (is_dir($source)) { + $expectedSysplugins = array('smartycompilerexception.php' => true, + 'smartyexception.php' => true, + 'smarty_cacheresource.php' => true, + 'smarty_cacheresource_custom.php' => true, + 'smarty_cacheresource_keyvaluestore.php' => true, + 'smarty_data.php' => true, + 'smarty_internal_cacheresource_file.php' => true, + 'smarty_internal_compilebase.php' => true, + 'smarty_internal_compile_append.php' => true, + 'smarty_internal_compile_assign.php' => true, + 'smarty_internal_compile_block.php' => true, + 'smarty_internal_compile_break.php' => true, + 'smarty_internal_compile_call.php' => true, + 'smarty_internal_compile_capture.php' => true, + 'smarty_internal_compile_config_load.php' => true, + 'smarty_internal_compile_continue.php' => true, + 'smarty_internal_compile_debug.php' => true, + 'smarty_internal_compile_eval.php' => true, + 'smarty_internal_compile_extends.php' => true, + 'smarty_internal_compile_for.php' => true, + 'smarty_internal_compile_foreach.php' => true, + 'smarty_internal_compile_function.php' => true, + 'smarty_internal_compile_if.php' => true, + 'smarty_internal_compile_include.php' => true, + 'smarty_internal_compile_include_php.php' => true, + 'smarty_internal_compile_insert.php' => true, + 'smarty_internal_compile_ldelim.php' => true, + 'smarty_internal_compile_nocache.php' => true, + 'smarty_internal_compile_private_block_plugin.php' => true, + 'smarty_internal_compile_private_foreachsection.php' => true, + 'smarty_internal_compile_private_function_plugin.php' => true, + 'smarty_internal_compile_private_modifier.php' => true, + 'smarty_internal_compile_private_object_block_function.php' => true, + 'smarty_internal_compile_private_object_function.php' => true, + 'smarty_internal_compile_private_php.php' => true, + 'smarty_internal_compile_private_print_expression.php' => true, + 'smarty_internal_compile_private_registered_block.php' => true, + 'smarty_internal_compile_private_registered_function.php' => true, + 'smarty_internal_compile_private_special_variable.php' => true, + 'smarty_internal_compile_rdelim.php' => true, + 'smarty_internal_compile_section.php' => true, + 'smarty_internal_compile_setfilter.php' => true, + 'smarty_internal_compile_shared_inheritance.php' => true, + 'smarty_internal_compile_while.php' => true, + 'smarty_internal_configfilelexer.php' => true, + 'smarty_internal_configfileparser.php' => true, + 'smarty_internal_config_file_compiler.php' => true, + 'smarty_internal_data.php' => true, + 'smarty_internal_debug.php' => true, + 'smarty_internal_extension_clear.php' => true, + 'smarty_internal_extension_handler.php' => true, + 'smarty_internal_method_addautoloadfilters.php' => true, + 'smarty_internal_method_adddefaultmodifiers.php' => true, + 'smarty_internal_method_append.php' => true, + 'smarty_internal_method_appendbyref.php' => true, + 'smarty_internal_method_assignbyref.php' => true, + 'smarty_internal_method_assignglobal.php' => true, + 'smarty_internal_method_clearallassign.php' => true, + 'smarty_internal_method_clearallcache.php' => true, + 'smarty_internal_method_clearassign.php' => true, + 'smarty_internal_method_clearcache.php' => true, + 'smarty_internal_method_clearcompiledtemplate.php' => true, + 'smarty_internal_method_clearconfig.php' => true, + 'smarty_internal_method_compileallconfig.php' => true, + 'smarty_internal_method_compilealltemplates.php' => true, + 'smarty_internal_method_configload.php' => true, + 'smarty_internal_method_createdata.php' => true, + 'smarty_internal_method_getautoloadfilters.php' => true, + 'smarty_internal_method_getconfigvars.php' => true, + 'smarty_internal_method_getdebugtemplate.php' => true, + 'smarty_internal_method_getdefaultmodifiers.php' => true, + 'smarty_internal_method_getregisteredobject.php' => true, + 'smarty_internal_method_getstreamvariable.php' => true, + 'smarty_internal_method_gettags.php' => true, + 'smarty_internal_method_gettemplatevars.php' => true, + 'smarty_internal_method_loadfilter.php' => true, + 'smarty_internal_method_loadplugin.php' => true, + 'smarty_internal_method_mustcompile.php' => true, + 'smarty_internal_method_registercacheresource.php' => true, + 'smarty_internal_method_registerclass.php' => true, + 'smarty_internal_method_registerdefaultconfighandler.php' => true, + 'smarty_internal_method_registerdefaultpluginhandler.php' => true, + 'smarty_internal_method_registerdefaulttemplatehandler.php' => true, + 'smarty_internal_method_registerfilter.php' => true, + 'smarty_internal_method_registerobject.php' => true, + 'smarty_internal_method_registerplugin.php' => true, + 'smarty_internal_method_registerresource.php' => true, + 'smarty_internal_method_setautoloadfilters.php' => true, + 'smarty_internal_method_setdebugtemplate.php' => true, + 'smarty_internal_method_setdefaultmodifiers.php' => true, + 'smarty_internal_method_unloadfilter.php' => true, + 'smarty_internal_method_unregistercacheresource.php' => true, + 'smarty_internal_method_unregisterfilter.php' => true, + 'smarty_internal_method_unregisterobject.php' => true, + 'smarty_internal_method_unregisterplugin.php' => true, + 'smarty_internal_method_unregisterresource.php' => true, + 'smarty_internal_nocache_insert.php' => true, + 'smarty_internal_parsetree.php' => true, + 'smarty_internal_parsetree_code.php' => true, + 'smarty_internal_parsetree_dq.php' => true, + 'smarty_internal_parsetree_dqcontent.php' => true, + 'smarty_internal_parsetree_tag.php' => true, + 'smarty_internal_parsetree_template.php' => true, + 'smarty_internal_parsetree_text.php' => true, + 'smarty_internal_resource_eval.php' => true, + 'smarty_internal_resource_extends.php' => true, + 'smarty_internal_resource_file.php' => true, + 'smarty_internal_resource_php.php' => true, + 'smarty_internal_resource_registered.php' => true, + 'smarty_internal_resource_stream.php' => true, + 'smarty_internal_resource_string.php' => true, + 'smarty_internal_runtime_cachemodify.php' => true, + 'smarty_internal_runtime_codeframe.php' => true, + 'smarty_internal_runtime_filterhandler.php' => true, + 'smarty_internal_runtime_foreach.php' => true, + 'smarty_internal_runtime_getincludepath.php' => true, + 'smarty_internal_runtime_hhvm.php' => true, + 'smarty_internal_runtime_inheritance.php' => true, + 'smarty_internal_runtime_subtemplate.php' => true, + 'smarty_internal_runtime_tplfunction.php' => true, + 'smarty_internal_runtime_updatecache.php' => true, + 'smarty_internal_runtime_updatescope.php' => true, + 'smarty_internal_runtime_validatecompiled.php' => true, + 'smarty_internal_runtime_var.php' => true, + 'smarty_internal_runtime_writefile.php' => true, + 'smarty_internal_smartytemplatecompiler.php' => true, + 'smarty_internal_template.php' => true, + 'smarty_internal_templatebase.php' => true, + 'smarty_internal_templatecompilerbase.php' => true, + 'smarty_internal_templatelexer.php' => true, + 'smarty_internal_templateparser.php' => true, + 'smarty_internal_testinstall.php' => true, + 'smarty_internal_undefined.php' => true, + 'smarty_resource.php' => true, + 'smarty_resource_custom.php' => true, + 'smarty_resource_recompiled.php' => true, + 'smarty_resource_uncompiled.php' => true, + 'smarty_security.php' => true, + 'smarty_template_cached.php' => true, + 'smarty_template_compiled.php' => true, + 'smarty_template_config.php' => true, + 'smarty_template_resource_base.php' => true, + 'smarty_template_source.php' => true, + 'smarty_undefined_variable.php' => true, + 'smarty_variable.php' => true,); + $iterator = new DirectoryIterator($source); + foreach ($iterator as $file) { + if (!$file->isDot()) { + $filename = $file->getFilename(); + if (isset($expectedSysplugins[ $filename ])) { + unset($expectedSysplugins[ $filename ]); + } + } + } + if ($expectedSysplugins) { + $status = false; + $message = "FAILED: files missing from libs/sysplugins: " . join(', ', array_keys($expectedSysplugins)); + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'sysplugins' ] = $message; + } + } elseif ($errors === null) { + echo "... OK\n"; + } + } else { + $status = false; + $message = "FAILED: " . SMARTY_SYSPLUGINS_DIR . ' is not a directory'; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'sysplugins_dir_constant' ] = $message; + } + } + + if ($errors === null) { + echo "Testing plugin files...\n"; + } + // test if core plugins are available + $source = SMARTY_PLUGINS_DIR; + if (is_dir($source)) { + $expectedPlugins = + array('block.textformat.php' => true, 'function.counter.php' => true, + 'function.cycle.php' => true, 'function.fetch.php' => true, + 'function.html_checkboxes.php' => true, 'function.html_image.php' => true, + 'function.html_options.php' => true, 'function.html_radios.php' => true, + 'function.html_select_date.php' => true, 'function.html_select_time.php' => true, + 'function.html_table.php' => true, 'function.mailto.php' => true, + 'function.math.php' => true, 'modifier.capitalize.php' => true, + 'modifier.date_format.php' => true, 'modifier.debug_print_var.php' => true, + 'modifier.escape.php' => true, 'modifier.regex_replace.php' => true, + 'modifier.replace.php' => true, 'modifier.spacify.php' => true, + 'modifier.truncate.php' => true, 'modifiercompiler.cat.php' => true, + 'modifiercompiler.count_characters.php' => true, 'modifiercompiler.count_paragraphs.php' => true, + 'modifiercompiler.count_sentences.php' => true, 'modifiercompiler.count_words.php' => true, + 'modifiercompiler.default.php' => true, 'modifiercompiler.escape.php' => true, + 'modifiercompiler.from_charset.php' => true, 'modifiercompiler.indent.php' => true, + 'modifiercompiler.lower.php' => true, 'modifiercompiler.noprint.php' => true, + 'modifiercompiler.string_format.php' => true, 'modifiercompiler.strip.php' => true, + 'modifiercompiler.strip_tags.php' => true, 'modifiercompiler.to_charset.php' => true, + 'modifiercompiler.unescape.php' => true, 'modifiercompiler.upper.php' => true, + 'modifiercompiler.wordwrap.php' => true, 'outputfilter.trimwhitespace.php' => true, + 'shared.escape_special_chars.php' => true, 'shared.literal_compiler_param.php' => true, + 'shared.make_timestamp.php' => true, 'shared.mb_str_replace.php' => true, + 'shared.mb_unicode.php' => true, 'shared.mb_wordwrap.php' => true, + 'variablefilter.htmlspecialchars.php' => true,); + $iterator = new DirectoryIterator($source); + foreach ($iterator as $file) { + if (!$file->isDot()) { + $filename = $file->getFilename(); + if (isset($expectedPlugins[ $filename ])) { + unset($expectedPlugins[ $filename ]); + } + } + } + if ($expectedPlugins) { + $status = false; + $message = "FAILED: files missing from libs/plugins: " . join(', ', array_keys($expectedPlugins)); + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'plugins' ] = $message; + } + } elseif ($errors === null) { + echo "... OK\n"; + } + } else { + $status = false; + $message = "FAILED: " . SMARTY_PLUGINS_DIR . ' is not a directory'; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'plugins_dir_constant' ] = $message; + } + } + + if ($errors === null) { + echo "Tests complete.\n"; + echo "\n"; + } + + return $status; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_internal_undefined.php b/inc/libs/Smarty/sysplugins/smarty_internal_undefined.php new file mode 100755 index 0000000..93fca8e --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_internal_undefined.php @@ -0,0 +1,48 @@ +cached->valid = false; + } else { + $tpl->mustCompile = true; + } + return false; + } + + /** + * Call error handler for undefined method + * + * @param string $name unknown method-name + * @param array $args argument array + * + * @return mixed + * @throws SmartyException + */ + public function __call($name, $args) + { + throw new SmartyException(get_class($args[0]) . "->{$name}() undefined method"); + } +} \ No newline at end of file diff --git a/inc/libs/Smarty/sysplugins/smarty_resource.php b/inc/libs/Smarty/sysplugins/smarty_resource.php new file mode 100755 index 0000000..93d9fa7 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_resource.php @@ -0,0 +1,270 @@ + 'smarty_internal_resource_file.php', + 'string' => 'smarty_internal_resource_string.php', + 'extends' => 'smarty_internal_resource_extends.php', + 'stream' => 'smarty_internal_resource_stream.php', + 'eval' => 'smarty_internal_resource_eval.php', + 'php' => 'smarty_internal_resource_php.php'); + + /** + * Flag if resource does implement populateCompiledFilepath() method + * + * @var bool + */ + public $hasCompiledHandler = false; + + /** + * Name of the Class to compile this resource's contents with + * + * @var string + */ + public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler'; + + /** + * Name of the Class to tokenize this resource's contents with + * + * @var string + */ + public $template_lexer_class = 'Smarty_Internal_Templatelexer'; + + /** + * Name of the Class to parse this resource's contents with + * + * @var string + */ + public $template_parser_class = 'Smarty_Internal_Templateparser'; + + /** + * Load template's source into current template object + * + * @param Smarty_Template_Source $source source object + * + * @return string template source + * @throws SmartyException if source cannot be loaded + */ + abstract public function getContent(Smarty_Template_Source $source); + + /** + * populate Source Object with meta data from Resource + * + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object + */ + abstract public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null); + + /** + * populate Source Object with timestamp and exists from Resource + * + * @param Smarty_Template_Source $source source object + */ + public function populateTimestamp(Smarty_Template_Source $source) + { + // intentionally left blank + } + + /** + * modify resource_name according to resource handlers specifications + * + * @param Smarty $smarty Smarty instance + * @param string $resource_name resource_name to make unique + * @param boolean $isConfig flag for config resource + * + * @return string unique resource name + */ + public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false) + { + if ($isConfig) { + if (!isset($smarty->_joined_config_dir)) { + $smarty->getTemplateDir(null, true); + } + return get_class($this) . '#' . $smarty->_joined_config_dir . '#' . $resource_name; + } else { + if (!isset($smarty->_joined_template_dir)) { + $smarty->getTemplateDir(); + } + return get_class($this) . '#' . $smarty->_joined_template_dir . '#' . $resource_name; + } + } + + /** + * Determine basename for compiled filename + * + * @param Smarty_Template_Source $source source object + * + * @return string resource's basename + */ + public function getBasename(Smarty_Template_Source $source) + { + return null; + } + + /** + * Load Resource Handler + * + * @param Smarty $smarty smarty object + * @param string $type name of the resource + * + * @throws SmartyException + * @return Smarty_Resource Resource Handler + */ + public static function load(Smarty $smarty, $type) + { + // try smarty's cache + if (isset($smarty->_cache['resource_handlers'][$type])) { + return $smarty->_cache['resource_handlers'][$type]; + } + + // try registered resource + if (isset($smarty->registered_resources[$type])) { + return $smarty->_cache['resource_handlers'][$type] = + $smarty->registered_resources[$type] instanceof Smarty_Resource ? $smarty->registered_resources[$type] : + new Smarty_Internal_Resource_Registered(); + } + + // try sysplugins dir + if (isset(self::$sysplugins[$type])) { + $_resource_class = 'Smarty_Internal_Resource_' . ucfirst($type); + return $smarty->_cache['resource_handlers'][$type] = new $_resource_class(); + } + + // try plugins dir + $_resource_class = 'Smarty_Resource_' . ucfirst($type); + if ($smarty->loadPlugin($_resource_class)) { + if (class_exists($_resource_class, false)) { + return $smarty->_cache['resource_handlers'][$type] = new $_resource_class(); + } else { + $smarty->registerResource($type, + array("smarty_resource_{$type}_source", "smarty_resource_{$type}_timestamp", + "smarty_resource_{$type}_secure", "smarty_resource_{$type}_trusted")); + // give it another try, now that the resource is registered properly + return self::load($smarty, $type); + } + } + + // try streams + $_known_stream = stream_get_wrappers(); + if (in_array($type, $_known_stream)) { + // is known stream + if (is_object($smarty->security_policy)) { + $smarty->security_policy->isTrustedStream($type); + } + return $smarty->_cache['resource_handlers'][$type] = new Smarty_Internal_Resource_Stream(); + } + + // TODO: try default_(template|config)_handler + + // give up + throw new SmartyException("Unknown resource type '{$type}'"); + } + + /** + * extract resource_type and resource_name from template_resource and config_resource + * @note "C:/foo.tpl" was forced to file resource up till Smarty 3.1.3 (including). + * + * @param string $resource_name template_resource or config_resource to parse + * @param string $default_resource the default resource_type defined in $smarty + * + * @return array with parsed resource name and type + */ + public static function parseResourceName($resource_name, $default_resource) + { + if (preg_match('/^([A-Za-z0-9_\-]{2,})[:]/', $resource_name, $match)) { + $type = $match[1]; + $name = substr($resource_name, strlen($match[0])); + } else { + // no resource given, use default + // or single character before the colon is not a resource type, but part of the filepath + $type = $default_resource; + $name = $resource_name; + } + return array($name, $type); + } + + /** + * modify template_resource according to resource handlers specifications + * + * @param \Smarty_Internal_Template|\Smarty $obj Smarty instance + * @param string $template_resource template_resource to extract resource handler and name of + * + * @return string unique resource name + */ + public static function getUniqueTemplateName($obj, $template_resource) + { + $smarty = $obj->_objType == 2 ? $obj->smarty : $obj; + list($name, $type) = self::parseResourceName($template_resource, $smarty->default_resource_type); + // TODO: optimize for Smarty's internal resource types + $resource = Smarty_Resource::load($smarty, $type); + // go relative to a given template? + $_file_is_dotted = $name[0] == '.' && ($name[1] == '.' || $name[1] == '/'); + if ($obj->_objType == 2 && $_file_is_dotted && + ($obj->source->type == 'file' || $obj->parent->source->type == 'extends') + ) { + $name = dirname($obj->source->filepath) . DS . $name; + } + return $resource->buildUniqueResourceName($smarty, $name); + } + + /* + * Check if resource must check time stamps when when loading complied or cached templates. + * Resources like 'extends' which use source components my disable timestamp checks on own resource. + * + * @return bool + */ + public function checkTimestamps() { + return true; + } + + /** + * initialize Source Object for given resource + * wrapper for backward compatibility to versions < 3.1.22 + * Either [$_template] or [$smarty, $template_resource] must be specified + * + * @param Smarty_Internal_Template $_template template object + * @param Smarty $smarty smarty object + * @param string $template_resource resource identifier + * + * @return Smarty_Template_Source Source Object + */ + public static function source(Smarty_Internal_Template $_template = null, Smarty $smarty = null, + $template_resource = null) + { + return Smarty_Template_Source::load($_template, $smarty, $template_resource); + } +} + diff --git a/inc/libs/Smarty/sysplugins/smarty_resource_custom.php b/inc/libs/Smarty/sysplugins/smarty_resource_custom.php new file mode 100755 index 0000000..619f2d6 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_resource_custom.php @@ -0,0 +1,95 @@ +filepath = $source->type . ':' . $source->name; + $source->uid = sha1($source->type . ':' . $source->name); + + $mtime = $this->fetchTimestamp($source->name); + if ($mtime !== null) { + $source->timestamp = $mtime; + } else { + $this->fetch($source->name, $content, $timestamp); + $source->timestamp = isset($timestamp) ? $timestamp : false; + if (isset($content)) { + $source->content = $content; + } + } + $source->exists = !!$source->timestamp; + } + + /** + * Load template's source into current template object + * + * @param Smarty_Template_Source $source source object + * + * @return string template source + * @throws SmartyException if source cannot be loaded + */ + public function getContent(Smarty_Template_Source $source) + { + $this->fetch($source->name, $content, $timestamp); + if (isset($content)) { + return $content; + } + + throw new SmartyException("Unable to read template {$source->type} '{$source->name}'"); + } + + /** + * Determine basename for compiled filename + * + * @param Smarty_Template_Source $source source object + * + * @return string resource's basename + */ + public function getBasename(Smarty_Template_Source $source) + { + return basename($source->name); + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_resource_recompiled.php b/inc/libs/Smarty/sysplugins/smarty_resource_recompiled.php new file mode 100755 index 0000000..cfd7340 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_resource_recompiled.php @@ -0,0 +1,47 @@ +filepath = false; + $compiled->timestamp = false; + $compiled->exists = false; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_resource_uncompiled.php b/inc/libs/Smarty/sysplugins/smarty_resource_uncompiled.php new file mode 100755 index 0000000..88d2bba --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_resource_uncompiled.php @@ -0,0 +1,79 @@ +filepath = false; + $compiled->timestamp = false; + $compiled->exists = false; + } + + /** + * render compiled template code + * + * @param Smarty_Internal_Template $_template + * + * @return string + * @throws Exception + */ + public function render($_template) + { + $level = ob_get_level(); + ob_start(); + try { + $this->renderUncompiled($_template->source, $_template); + return ob_get_clean(); + } + catch (Exception $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + throw $e; + } + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_security.php b/inc/libs/Smarty/sysplugins/smarty_security.php new file mode 100755 index 0000000..9d48bcb --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_security.php @@ -0,0 +1,715 @@ +" tags in templates. + * possible values: + *
      + *
    • Smarty::PHP_PASSTHRU -> echo PHP tags as they are
    • + *
    • Smarty::PHP_QUOTE -> escape tags as entities
    • + *
    • Smarty::PHP_REMOVE -> remove php tags
    • + *
    • Smarty::PHP_ALLOW -> execute php tags
    • + *
    + * + * @var integer + */ + public $php_handling = Smarty::PHP_PASSTHRU; + + /** + * This is the list of template directories that are considered secure. + * $template_dir is in this list implicitly. + * + * @var array + */ + public $secure_dir = array(); + + /** + * This is an array of directories where trusted php scripts reside. + * {@link $security} is disabled during their inclusion/execution. + * + * @var array + */ + public $trusted_dir = array(); + + /** + * List of regular expressions (PCRE) that include trusted URIs + * + * @var array + */ + public $trusted_uri = array(); + + /** + * List of trusted constants names + * + * @var array + */ + public $trusted_constants = array(); + + /** + * This is an array of trusted static classes. + * If empty access to all static classes is allowed. + * If set to 'none' none is allowed. + * + * @var array + */ + public $static_classes = array(); + + /** + * This is an nested array of trusted classes and static methods. + * If empty access to all static classes and methods is allowed. + * Format: + * array ( + * 'class_1' => array('method_1', 'method_2'), // allowed methods listed + * 'class_2' => array(), // all methods of class allowed + * ) + * If set to null none is allowed. + * + * @var array + */ + public $trusted_static_methods = array(); + + /** + * This is an array of trusted static properties. + * If empty access to all static classes and properties is allowed. + * Format: + * array ( + * 'class_1' => array('prop_1', 'prop_2'), // allowed properties listed + * 'class_2' => array(), // all properties of class allowed + * ) + * If set to null none is allowed. + * + * @var array + */ + public $trusted_static_properties = array(); + + /** + * This is an array of trusted PHP functions. + * If empty all functions are allowed. + * To disable all PHP functions set $php_functions = null. + * + * @var array + */ + public $php_functions = array('isset', 'empty', 'count', 'sizeof', 'in_array', 'is_array', 'time',); + + /** + * This is an array of trusted PHP modifiers. + * If empty all modifiers are allowed. + * To disable all modifier set $php_modifiers = null. + * + * @var array + */ + public $php_modifiers = array('escape', 'count', 'nl2br',); + + /** + * This is an array of allowed tags. + * If empty no restriction by allowed_tags. + * + * @var array + */ + public $allowed_tags = array(); + + /** + * This is an array of disabled tags. + * If empty no restriction by disabled_tags. + * + * @var array + */ + public $disabled_tags = array(); + + /** + * This is an array of allowed modifier plugins. + * If empty no restriction by allowed_modifiers. + * + * @var array + */ + public $allowed_modifiers = array(); + + /** + * This is an array of disabled modifier plugins. + * If empty no restriction by disabled_modifiers. + * + * @var array + */ + public $disabled_modifiers = array(); + + /** + * This is an array of disabled special $smarty variables. + * + * @var array + */ + public $disabled_special_smarty_vars = array(); + + /** + * This is an array of trusted streams. + * If empty all streams are allowed. + * To disable all streams set $streams = null. + * + * @var array + */ + public $streams = array('file'); + + /** + * + flag if constants can be accessed from template + * + * @var boolean + */ + public $allow_constants = true; + + /** + * + flag if super globals can be accessed from template + * + * @var boolean + */ + public $allow_super_globals = true; + + /** + * max template nesting level + * + * @var int + */ + public $max_template_nesting = 0; + + /** + * current template nesting level + * + * @var int + */ + private $_current_template_nesting = 0; + + /** + * Cache for $resource_dir lookup + * + * @var array + */ + protected $_resource_dir = array(); + + /** + * Cache for $template_dir lookup + * + * @var array + */ + protected $_template_dir = array(); + + /** + * Cache for $config_dir lookup + * + * @var array + */ + protected $_config_dir = array(); + + /** + * Cache for $secure_dir lookup + * + * @var array + */ + protected $_secure_dir = array(); + + /** + * Cache for $php_resource_dir lookup + * + * @var array + */ + protected $_php_resource_dir = null; + + /** + * Cache for $trusted_dir lookup + * + * @var array + */ + protected $_trusted_dir = null; + + /** + * Cache for include path status + * + * @var bool + */ + protected $_include_path_status = false; + + /** + * Cache for $_include_array lookup + * + * @var array + */ + protected $_include_dir = array(); + + /** + * @param Smarty $smarty + */ + public function __construct($smarty) + { + $this->smarty = $smarty; + } + + /** + * Check if PHP function is trusted. + * + * @param string $function_name + * @param object $compiler compiler object + * + * @return boolean true if function is trusted + * @throws SmartyCompilerException if php function is not trusted + */ + public function isTrustedPhpFunction($function_name, $compiler) + { + if (isset($this->php_functions) && + (empty($this->php_functions) || in_array($function_name, $this->php_functions)) + ) { + return true; + } + + $compiler->trigger_template_error("PHP function '{$function_name}' not allowed by security setting"); + + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if static class is trusted. + * + * @param string $class_name + * @param object $compiler compiler object + * + * @return boolean true if class is trusted + * @throws SmartyCompilerException if static class is not trusted + */ + public function isTrustedStaticClass($class_name, $compiler) + { + if (isset($this->static_classes) && + (empty($this->static_classes) || in_array($class_name, $this->static_classes)) + ) { + return true; + } + + $compiler->trigger_template_error("access to static class '{$class_name}' not allowed by security setting"); + + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if static class method/property is trusted. + * + * @param string $class_name + * @param string $params + * @param object $compiler compiler object + * + * @return boolean true if class method is trusted + * @throws SmartyCompilerException if static class method is not trusted + */ + public function isTrustedStaticClassAccess($class_name, $params, $compiler) + { + if (!isset($params[2])) { + // fall back + return $this->isTrustedStaticClass($class_name, $compiler); + } + if ($params[2] == 'method') { + $allowed = $this->trusted_static_methods; + $name = substr($params[0], 0, strpos($params[0], '(')); + } else { + $allowed = $this->trusted_static_properties; + // strip '$' + $name = substr($params[0], 1); + } + if (isset($allowed)) { + if (empty($allowed)) { + // fall back + return $this->isTrustedStaticClass($class_name, $compiler); + } + if (isset($allowed[$class_name]) && + (empty($allowed[$class_name]) || in_array($name, $allowed[$class_name])) + ) { + return true; + } + } + $compiler->trigger_template_error("access to static class '{$class_name}' {$params[2]} '{$name}' not allowed by security setting"); + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if PHP modifier is trusted. + * + * @param string $modifier_name + * @param object $compiler compiler object + * + * @return boolean true if modifier is trusted + * @throws SmartyCompilerException if modifier is not trusted + */ + public function isTrustedPhpModifier($modifier_name, $compiler) + { + if (isset($this->php_modifiers) && + (empty($this->php_modifiers) || in_array($modifier_name, $this->php_modifiers)) + ) { + return true; + } + + $compiler->trigger_template_error("modifier '{$modifier_name}' not allowed by security setting"); + + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if tag is trusted. + * + * @param string $tag_name + * @param object $compiler compiler object + * + * @return boolean true if tag is trusted + * @throws SmartyCompilerException if modifier is not trusted + */ + public function isTrustedTag($tag_name, $compiler) + { + // check for internal always required tags + if (in_array($tag_name, array('assign', 'call', 'private_filter', 'private_block_plugin', + 'private_function_plugin', 'private_object_block_function', + 'private_object_function', 'private_registered_function', + 'private_registered_block', 'private_special_variable', + 'private_print_expression', 'private_modifier'))) { + return true; + } + // check security settings + if (empty($this->allowed_tags)) { + if (empty($this->disabled_tags) || !in_array($tag_name, $this->disabled_tags)) { + return true; + } else { + $compiler->trigger_template_error("tag '{$tag_name}' disabled by security setting", null, true); + } + } elseif (in_array($tag_name, $this->allowed_tags) && !in_array($tag_name, $this->disabled_tags)) { + return true; + } else { + $compiler->trigger_template_error("tag '{$tag_name}' not allowed by security setting", null, true); + } + + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if special $smarty variable is trusted. + * + * @param string $var_name + * @param object $compiler compiler object + * + * @return boolean true if tag is trusted + * @throws SmartyCompilerException if modifier is not trusted + */ + public function isTrustedSpecialSmartyVar($var_name, $compiler) + { + if (!in_array($var_name, $this->disabled_special_smarty_vars)) { + return true; + } else { + $compiler->trigger_template_error("special variable '\$smarty.{$var_name}' not allowed by security setting", null, true); + } + + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if modifier plugin is trusted. + * + * @param string $modifier_name + * @param object $compiler compiler object + * + * @return boolean true if tag is trusted + * @throws SmartyCompilerException if modifier is not trusted + */ + public function isTrustedModifier($modifier_name, $compiler) + { + // check for internal always allowed modifier + if (in_array($modifier_name, array('default'))) { + return true; + } + // check security settings + if (empty($this->allowed_modifiers)) { + if (empty($this->disabled_modifiers) || !in_array($modifier_name, $this->disabled_modifiers)) { + return true; + } else { + $compiler->trigger_template_error("modifier '{$modifier_name}' disabled by security setting", null, true); + } + } elseif (in_array($modifier_name, $this->allowed_modifiers) && + !in_array($modifier_name, $this->disabled_modifiers) + ) { + return true; + } else { + $compiler->trigger_template_error("modifier '{$modifier_name}' not allowed by security setting", null, true); + } + + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if constants are enabled or trusted + * + * @param string $const constant name + * @param object $compiler compiler object + * + * @return bool + */ + public function isTrustedConstant($const, $compiler) + { + if (in_array($const, array('true', 'false', 'null'))) { + return true; + } + if (!empty($this->trusted_constants)) { + if (!in_array($const, $this->trusted_constants)) { + $compiler->trigger_template_error("Security: access to constant '{$const}' not permitted"); + return false; + } + return true; + } + if ($this->allow_constants) { + return true; + } + $compiler->trigger_template_error("Security: access to constants not permitted"); + return false; + } + + /** + * Check if stream is trusted. + * + * @param string $stream_name + * + * @return boolean true if stream is trusted + * @throws SmartyException if stream is not trusted + */ + public function isTrustedStream($stream_name) + { + if (isset($this->streams) && (empty($this->streams) || in_array($stream_name, $this->streams))) { + return true; + } + + throw new SmartyException("stream '{$stream_name}' not allowed by security setting"); + } + + /** + * Check if directory of file resource is trusted. + * + * @param string $filepath + * @param null|bool $isConfig + * + * @return bool true if directory is trusted + * @throws \SmartyException if directory is not trusted + */ + public function isTrustedResourceDir($filepath, $isConfig = null) + { + if ($this->_include_path_status !== $this->smarty->use_include_path) { + foreach ($this->_include_dir as $directory) { + unset($this->_resource_dir[$directory]); + } + if ($this->smarty->use_include_path) { + $this->_include_dir = array(); + $_dirs = $this->smarty->ext->_getIncludePath->getIncludePathDirs($this->smarty); + foreach ($_dirs as $directory) { + $this->_include_dir[] = $directory; + $this->_resource_dir[$directory] = true; + } + } + $this->_include_path_status = $this->smarty->use_include_path; + } + if ($isConfig !== true && + (!isset($this->smarty->_cache['template_dir_new']) || $this->smarty->_cache['template_dir_new']) + ) { + $_dir = $this->smarty->getTemplateDir(); + if ($this->_template_dir !== $_dir) { + foreach ($this->_template_dir as $directory) { + unset($this->_resource_dir[$directory]); + } + foreach ($_dir as $directory) { + $this->_resource_dir[$directory] = true; + } + $this->_template_dir = $_dir; + } + $this->smarty->_cache['template_dir_new'] = false; + } + if ($isConfig !== false && + (!isset($this->smarty->_cache['config_dir_new']) || $this->smarty->_cache['config_dir_new']) + ) { + $_dir = $this->smarty->getConfigDir(); + if ($this->_config_dir !== $_dir) { + foreach ($this->_config_dir as $directory) { + unset($this->_resource_dir[$directory]); + } + foreach ($_dir as $directory) { + $this->_resource_dir[$directory] = true; + } + $this->_config_dir = $_dir; + } + $this->smarty->_cache['config_dir_new'] = false; + } + if ($this->_secure_dir !== (array) $this->secure_dir) { + foreach ($this->_secure_dir as $directory) { + unset($this->_resource_dir[$directory]); + } + foreach ((array) $this->secure_dir as $directory) { + $directory = $this->smarty->_realpath($directory . DS, true); + $this->_resource_dir[$directory] = true; + } + $this->_secure_dir = (array) $this->secure_dir; + } + $this->_resource_dir = $this->_checkDir($filepath, $this->_resource_dir); + return true; + } + + /** + * Check if URI (e.g. {fetch} or {html_image}) is trusted + * To simplify things, isTrustedUri() resolves all input to "{$PROTOCOL}://{$HOSTNAME}". + * So "http://username:password@hello.world.example.org:8080/some-path?some=query-string" + * is reduced to "http://hello.world.example.org" prior to applying the patters from {@link $trusted_uri}. + * + * @param string $uri + * + * @return boolean true if URI is trusted + * @throws SmartyException if URI is not trusted + * @uses $trusted_uri for list of patterns to match against $uri + */ + public function isTrustedUri($uri) + { + $_uri = parse_url($uri); + if (!empty($_uri['scheme']) && !empty($_uri['host'])) { + $_uri = $_uri['scheme'] . '://' . $_uri['host']; + foreach ($this->trusted_uri as $pattern) { + if (preg_match($pattern, $_uri)) { + return true; + } + } + } + + throw new SmartyException("URI '{$uri}' not allowed by security setting"); + } + + /** + * Check if directory of file resource is trusted. + * + * @param string $filepath + * + * @return boolean true if directory is trusted + * @throws SmartyException if PHP directory is not trusted + */ + public function isTrustedPHPDir($filepath) + { + if (empty($this->trusted_dir)) { + throw new SmartyException("directory '{$filepath}' not allowed by security setting (no trusted_dir specified)"); + } + + // check if index is outdated + if (!$this->_trusted_dir || $this->_trusted_dir !== $this->trusted_dir) { + $this->_php_resource_dir = array(); + + $this->_trusted_dir = $this->trusted_dir; + foreach ((array) $this->trusted_dir as $directory) { + $directory = $this->smarty->_realpath($directory . DS, true); + $this->_php_resource_dir[$directory] = true; + } + } + + $this->_php_resource_dir = $this->_checkDir($this->smarty->_realpath($filepath, true), $this->_php_resource_dir); + return true; + } + + /** + * Start template processing + * + * @param $template + * + * @throws SmartyException + */ + public function startTemplate($template) + { + if ($this->max_template_nesting > 0 && $this->_current_template_nesting ++ >= $this->max_template_nesting) { + throw new SmartyException("maximum template nesting level of '{$this->max_template_nesting}' exceeded when calling '{$template->template_resource}'"); + } + } + + /** + * Exit template processing + * + * @internal param $template + */ + public function exitTemplate() + { + if ($this->max_template_nesting > 0) { + $this->_current_template_nesting --; + } + } + + /** + * Check if file is inside a valid directory + * + * @param string $filepath + * @param array $dirs valid directories + * + * @return array + * @throws \SmartyException + */ + private function _checkDir($filepath, $dirs) + { + $directory = dirname($filepath) . DS; + $_directory = array(); + while (true) { + // remember the directory to add it to _resource_dir in case we're successful + $_directory[$directory] = true; + // test if the directory is trusted + if (isset($dirs[$directory])) { + // merge sub directories of current $directory into _resource_dir to speed up subsequent lookup + $dirs = array_merge($dirs, $_directory); + + return $dirs; + } + // abort if we've reached root + if (!preg_match('#[\\\/][^\\\/]+[\\\/]$#', $directory)) { + break; + } + // bubble up one level + $directory = preg_replace('#[\\\/][^\\\/]+[\\\/]$#', DS, $directory); + } + + // give up + throw new SmartyException("directory '{$filepath}' not allowed by security setting"); + } + + /** + * Loads security class and enables security + * + * @param \Smarty $smarty + * @param string|Smarty_Security $security_class if a string is used, it must be class-name + * + * @return \Smarty current Smarty instance for chaining + * @throws \SmartyException when an invalid class name is provided + */ + public static function enableSecurity(Smarty $smarty, $security_class) + { + if ($security_class instanceof Smarty_Security) { + $smarty->security_policy = $security_class; + return; + } elseif (is_object($security_class)) { + throw new SmartyException("Class '" . get_class($security_class) . "' must extend Smarty_Security."); + } + if ($security_class == null) { + $security_class = $smarty->security_class; + } + if (!class_exists($security_class)) { + throw new SmartyException("Security class '$security_class' is not defined"); + } elseif ($security_class !== 'Smarty_Security' && !is_subclass_of($security_class, 'Smarty_Security')) { + throw new SmartyException("Class '$security_class' must extend Smarty_Security."); + } else { + $smarty->security_policy = new $security_class($smarty); + } + return; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_template_cached.php b/inc/libs/Smarty/sysplugins/smarty_template_cached.php new file mode 100755 index 0000000..cecf429 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_template_cached.php @@ -0,0 +1,246 @@ +compile_id = $_template->compile_id; + $this->cache_id = $_template->cache_id; + $this->source = $_template->source; + if (!class_exists('Smarty_CacheResource', false)) { + require SMARTY_SYSPLUGINS_DIR . 'smarty_cacheresource.php'; + } + $this->handler = Smarty_CacheResource::load($_template->smarty); + } + + /** + * @param Smarty_Internal_Template $_template + * + * @return Smarty_Template_Cached + */ + static function load(Smarty_Internal_Template $_template) + { + $_template->cached = new Smarty_Template_Cached($_template); + $_template->cached->handler->populate($_template->cached, $_template); + // caching enabled ? + if (!($_template->caching == Smarty::CACHING_LIFETIME_CURRENT || + $_template->caching == Smarty::CACHING_LIFETIME_SAVED) || $_template->source->handler->recompiled + ) { + $_template->cached->valid = false; + } + return $_template->cached; + } + + /** + * Render cache template + * + * @param \Smarty_Internal_Template $_template + * @param bool $no_output_filter + * + * @throws \Exception + */ + public function render(Smarty_Internal_Template $_template, $no_output_filter = true) + { + if ($this->isCached($_template)) { + if ($_template->smarty->debugging) { + $_template->smarty->_debug->start_cache($_template); + } + if (!$this->processed) { + $this->process($_template); + } + $this->getRenderedTemplateCode($_template); + if ($_template->smarty->debugging) { + $_template->smarty->_debug->end_cache($_template); + } + return; + } else { + $_template->smarty->ext->_updateCache->updateCache($this, $_template, $no_output_filter); + } + } + + /** + * Check if cache is valid, lock cache if required + * + * @param \Smarty_Internal_Template $_template + * + * @return bool flag true if cache is valid + */ + public function isCached(Smarty_Internal_Template $_template) + { + if ($this->valid !== null) { + return $this->valid; + } + while (true) { + while (true) { + if ($this->exists === false || $_template->smarty->force_compile || $_template->smarty->force_cache) { + $this->valid = false; + } else { + $this->valid = true; + } + if ($this->valid && $_template->caching == Smarty::CACHING_LIFETIME_CURRENT && + $_template->cache_lifetime >= 0 && time() > ($this->timestamp + $_template->cache_lifetime) + ) { + // lifetime expired + $this->valid = false; + } + if ($this->valid && $_template->smarty->compile_check == 1 && + $_template->source->getTimeStamp() > $this->timestamp + ) { + $this->valid = false; + } + if ($this->valid || !$_template->smarty->cache_locking) { + break; + } + if (!$this->handler->locked($_template->smarty, $this)) { + $this->handler->acquireLock($_template->smarty, $this); + break 2; + } + $this->handler->populate($this, $_template); + } + if ($this->valid) { + if (!$_template->smarty->cache_locking || $this->handler->locked($_template->smarty, $this) === null) { + // load cache file for the following checks + if ($_template->smarty->debugging) { + $_template->smarty->_debug->start_cache($_template); + } + if ($this->handler->process($_template, $this) === false) { + $this->valid = false; + } else { + $this->processed = true; + } + if ($_template->smarty->debugging) { + $_template->smarty->_debug->end_cache($_template); + } + } else { + $this->is_locked = true; + continue; + } + } else { + return $this->valid; + } + if ($this->valid && $_template->caching === Smarty::CACHING_LIFETIME_SAVED && + $_template->cached->cache_lifetime >= 0 && + (time() > ($_template->cached->timestamp + $_template->cached->cache_lifetime)) + ) { + $this->valid = false; + } + if ($_template->smarty->cache_locking) { + if (!$this->valid) { + $this->handler->acquireLock($_template->smarty, $this); + } elseif ($this->is_locked) { + $this->handler->releaseLock($_template->smarty, $this); + } + } + return $this->valid; + } + return $this->valid; + } + + /** + * Process cached template + * + * @param Smarty_Internal_Template $_template template object + * @param bool $update flag if called because cache update + */ + public function process(Smarty_Internal_Template $_template, $update = false) + { + if ($this->handler->process($_template, $this, $update) === false) { + $this->valid = false; + } + if ($this->valid) { + $this->processed = true; + } else { + $this->processed = false; + } + } + + /** + * Read cache content from handler + * + * @param Smarty_Internal_Template $_template template object + * + * @return string content + */ + public function read(Smarty_Internal_Template $_template) + { + if (!$_template->source->handler->recompiled) { + return $this->handler->readCachedContent($_template); + } + return false; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_template_compiled.php b/inc/libs/Smarty/sysplugins/smarty_template_compiled.php new file mode 100755 index 0000000..e7710f8 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_template_compiled.php @@ -0,0 +1,297 @@ +source->handler->recompiled && + ($_template->smarty->resource_cache_mode & Smarty::RESOURCE_CACHE_ON) + ) { + $_cache_key = $_template->source->unique_resource . '#'; + if ($_template->caching) { + $_cache_key .= 'caching#'; + } + $_cache_key .= $_template->compile_id; + if (isset($_template->source->compileds[$_cache_key])) { + return $_template->source->compileds[$_cache_key]; + } + } + $compiled = new Smarty_Template_Compiled(); + if ($_template->source->handler->hasCompiledHandler) { + $_template->source->handler->populateCompiledFilepath($compiled, $_template); + } else { + $compiled->populateCompiledFilepath($_template); + } + // runtime cache + if (!$_template->source->handler->recompiled && + ($_template->smarty->resource_cache_mode & Smarty::RESOURCE_CACHE_ON) + ) { + $_template->source->compileds[$_cache_key] = $compiled; + } + return $compiled; + } + + /** + * populate Compiled Object with compiled filepath + * + * @param Smarty_Internal_Template $_template template object + **/ + public function populateCompiledFilepath(Smarty_Internal_Template $_template) + { + $_compile_id = isset($_template->compile_id) ? preg_replace('![^\w]+!', '_', $_template->compile_id) : null; + if ($_template->source->isConfig) { + $_flag = '_' . + ((int) $_template->smarty->config_read_hidden + (int) $_template->smarty->config_booleanize * 2 + + (int) $_template->smarty->config_overwrite * 4); + } else { + $_flag = + '_' . ((int) $_template->smarty->merge_compiled_includes + (int) $_template->smarty->escape_html * 2); + } + $_filepath = $_template->source->uid . $_flag; + // if use_sub_dirs, break file into directories + if ($_template->smarty->use_sub_dirs) { + $_filepath = substr($_filepath, 0, 2) . DS . substr($_filepath, 2, 2) . DS . substr($_filepath, 4, 2) . DS . + $_filepath; + } + $_compile_dir_sep = $_template->smarty->use_sub_dirs ? DS : '^'; + if (isset($_compile_id)) { + $_filepath = $_compile_id . $_compile_dir_sep . $_filepath; + } + // caching token + if ($_template->caching) { + $_cache = '.cache'; + } else { + $_cache = ''; + } + $_compile_dir = $_template->smarty->getCompileDir(); + // set basename if not specified + $_basename = $_template->source->handler->getBasename($_template->source); + if ($_basename === null) { + $_basename = basename(preg_replace('![^\w]+!', '_', $_template->source->name)); + } + // separate (optional) basename by dot + if ($_basename) { + $_basename = '.' . $_basename; + } + + $this->filepath = $_compile_dir . $_filepath . '.' . $_template->source->type . $_basename . $_cache . '.php'; + $this->exists = is_file($this->filepath); + if (!$this->exists) { + $this->timestamp = false; + } + } + + /** + * load compiled template or compile from source + * + * @param Smarty_Internal_Template $_template + * + * @throws Exception + */ + public function process(Smarty_Internal_Template $_template) + { + $_smarty_tpl = $_template; + if ($_template->source->handler->recompiled || !$_template->compiled->exists || + $_template->smarty->force_compile || ($_template->smarty->compile_check && + $_template->source->getTimeStamp() > $_template->compiled->getTimeStamp()) + ) { + $this->compileTemplateSource($_template); + $compileCheck = $_template->smarty->compile_check; + $_template->smarty->compile_check = false; + if ($_template->source->handler->recompiled) { + $level = ob_get_level(); + ob_start(); + try { + eval("?>" . $this->content); + } + catch (Exception $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + throw $e; + } + ob_get_clean(); + $this->content = null; + } else { + $this->loadCompiledTemplate($_template); + } + $_template->smarty->compile_check = $compileCheck; + } else { + $_template->mustCompile = true; + @include($_template->compiled->filepath); + if ($_template->mustCompile) { + $this->compileTemplateSource($_template); + $compileCheck = $_template->smarty->compile_check; + $_template->smarty->compile_check = false; + $this->loadCompiledTemplate($_template); + $_template->smarty->compile_check = $compileCheck; + } + } + $_template->smarty->ext->_subTemplate->registerSubTemplates($_template); + + $this->processed = true; + } + + /** + * Load fresh compiled template by including the PHP file + * HHVM requires a work around because of a PHP incompatibility + * + * @param \Smarty_Internal_Template $_template + */ + private function loadCompiledTemplate(Smarty_Internal_Template $_template) + { + if (function_exists('opcache_invalidate')) { + opcache_invalidate($_template->compiled->filepath); + } + $_smarty_tpl = $_template; + if (defined('HHVM_VERSION')) { + $_template->smarty->ext->_hhvm->includeHhvm($_template, $_template->compiled->filepath); + } else { + include($_template->compiled->filepath); + } + } + + /** + * render compiled template code + * + * @param Smarty_Internal_Template $_template + * + * @return string + * @throws Exception + */ + public function render(Smarty_Internal_Template $_template) + { + if ($_template->smarty->debugging) { + $_template->smarty->_debug->start_render($_template); + } + if (!$this->processed) { + $this->process($_template); + } + if (isset($_template->cached)) { + $_template->cached->file_dependency = + array_merge($_template->cached->file_dependency, $this->file_dependency); + } + $this->getRenderedTemplateCode($_template); + if ($_template->caching && $this->has_nocache_code) { + $_template->cached->hashes[$this->nocache_hash] = true; + } + if (isset($_template->parent) && $_template->parent->_objType == 2 && !empty($_template->tpl_function)) { + $_template->parent->tpl_function = array_merge($_template->parent->tpl_function, $_template->tpl_function); + } + if ($_template->smarty->debugging) { + $_template->smarty->_debug->end_render($_template); + } + } + + /** + * compile template from source + * + * @param Smarty_Internal_Template $_template + * + * @return string + * @throws Exception + */ + public function compileTemplateSource(Smarty_Internal_Template $_template) + { + $_template->source->compileds = array(); + $this->file_dependency = array(); + $this->tpl_function = array(); + $this->includes = array(); + $this->nocache_hash = null; + $this->unifunc = null; + // compile locking + if (!$_template->source->handler->recompiled) { + if ($saved_timestamp = $_template->compiled->getTimeStamp()) { + touch($_template->compiled->filepath); + } + } + // call compiler + try { + $_template->loadCompiler(); + $code = $_template->compiler->compileTemplate($_template); + } + catch (Exception $e) { + // restore old timestamp in case of error + if (!$_template->source->handler->recompiled && $saved_timestamp) { + touch($_template->compiled->filepath, $saved_timestamp); + } + throw $e; + } + // compiling succeeded + if ($_template->compiler->write_compiled_code) { + // write compiled template + $this->write($_template, $code); + $code = ''; + } + // release compiler object to free memory + unset($_template->compiler); + return $code; + } + + /** + * Write compiled code by handler + * + * @param Smarty_Internal_Template $_template template object + * @param string $code compiled code + * + * @return boolean success + */ + public function write(Smarty_Internal_Template $_template, $code) + { + if (!$_template->source->handler->recompiled) { + if ($_template->smarty->ext->_writeFile->writeFile($this->filepath, $code, $_template->smarty) === true) { + $this->timestamp = $this->exists = is_file($this->filepath); + if ($this->exists) { + $this->timestamp = filemtime($this->filepath); + return true; + } + } + return false; + } else { + $this->content = $code; + } + $this->timestamp = time(); + $this->exists = true; + return true; + } + + /** + * Read compiled content from handler + * + * @param Smarty_Internal_Template $_template template object + * + * @return string content + */ + public function read(Smarty_Internal_Template $_template) + { + if (!$_template->source->handler->recompiled) { + return file_get_contents($this->filepath); + } + return isset($this->content) ? $this->content : false; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_template_config.php b/inc/libs/Smarty/sysplugins/smarty_template_config.php new file mode 100755 index 0000000..f0fff50 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_template_config.php @@ -0,0 +1,97 @@ +handler = clone $handler; // Note: prone to circular references + $this->handler->compiler_class = 'Smarty_Internal_Config_File_Compiler'; + $this->handler->template_lexer_class = 'Smarty_Internal_Configfilelexer'; + $this->handler->template_parser_class = 'Smarty_Internal_Configfileparser'; + $this->resource = $resource; + $this->type = $type; + $this->name = $name; + $this->smarty = $smarty; + } + + /** + * initialize Source Object for given resource + * Either [$_template] or [$smarty, $template_resource] must be specified + * + * @param Smarty_Internal_Template $_template template object + * @param Smarty $smarty smarty object + * @param string $template_resource resource identifier + * + * @return Smarty_Template_Config Source Object + * @throws SmartyException + */ + public static function load(Smarty_Internal_Template $_template = null, Smarty $smarty = null, $template_resource = null) + { + static $_incompatible_resources = array('extends' => true, 'php' => true); + $template_resource = $_template->template_resource; + if (empty($template_resource)) { + throw new SmartyException('Missing config name'); + } + // parse resource_name, load resource handler + list($name, $type) = Smarty_Resource::parseResourceName($template_resource, $_template->smarty->default_config_type); + // make sure configs are not loaded via anything smarty can't handle + if (isset($_incompatible_resources[$type])) { + throw new SmartyException ("Unable to use resource '{$type}' for config"); + } + $resource = Smarty_Resource::load($_template->smarty, $type); + $source = new Smarty_Template_Config($resource, $_template->smarty, $template_resource, $type, $name); + $resource->populate($source, $_template); + if (!$source->exists && isset($_template->smarty->default_config_handler_func)) { + Smarty_Internal_Method_RegisterDefaultTemplateHandler::_getDefaultTemplate($source); + } + $source->unique_resource = $resource->buildUniqueResourceName($_template->smarty, $name, true); + return $source; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_template_resource_base.php b/inc/libs/Smarty/sysplugins/smarty_template_resource_base.php new file mode 100755 index 0000000..0911feb --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_template_resource_base.php @@ -0,0 +1,155 @@ +unifunc; + $level = ob_get_level(); + try { + if (empty($unifunc) || !is_callable($unifunc)) { + throw new SmartyException("Invalid compiled template for '{$_template->template_resource}'"); + } + if (isset($_template->smarty->security_policy)) { + $_template->smarty->security_policy->startTemplate($_template); + } + // + // render compiled or saved template code + // + if (!isset($_template->_cache['capture_stack'])) { + $_template->_cache['capture_stack'] = array(); + } + $_saved_capture_level = count($_template->_cache['capture_stack']); + $unifunc($_template); + // any unclosed {capture} tags ? + if ($_saved_capture_level != count($_template->_cache['capture_stack'])) { + $_template->capture_error(); + } + if (isset($_template->smarty->security_policy)) { + $_template->smarty->security_policy->exitTemplate(); + } + return null; + } + catch (Exception $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + if (isset($_template->smarty->security_policy)) { + $_template->smarty->security_policy->exitTemplate(); + } + throw $e; + } + } + + /** + * Get compiled time stamp + * + * @return int + */ + public function getTimeStamp() + { + if ($this->exists && !isset($this->timestamp)) { + $this->timestamp = @filemtime($this->filepath); + } + return $this->timestamp; + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_template_source.php b/inc/libs/Smarty/sysplugins/smarty_template_source.php new file mode 100755 index 0000000..be5b628 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_template_source.php @@ -0,0 +1,267 @@ +handler = $handler; // Note: prone to circular references + $this->smarty = $smarty; + $this->resource = $resource; + $this->type = $type; + $this->name = $name; + } + + /** + * initialize Source Object for given resource + * Either [$_template] or [$smarty, $template_resource] must be specified + * + * @param Smarty_Internal_Template $_template template object + * @param Smarty $smarty smarty object + * @param string $template_resource resource identifier + * + * @return Smarty_Template_Source Source Object + * @throws SmartyException + */ + public static function load(Smarty_Internal_Template $_template = null, Smarty $smarty = null, + $template_resource = null) + { + if ($_template) { + $smarty = $_template->smarty; + $template_resource = $_template->template_resource; + } + if (empty($template_resource)) { + throw new SmartyException('Missing template name'); + } + // parse resource_name, load resource handler, identify unique resource name + if (preg_match('/^([A-Za-z0-9_\-]{2,})[:]([\s\S]*)$/', $template_resource, $match)) { + $type = $match[1]; + $name = $match[2]; + } else { + // no resource given, use default + // or single character before the colon is not a resource type, but part of the filepath + $type = $smarty->default_resource_type; + $name = $template_resource; + } + + $handler = isset($smarty->_cache['resource_handlers'][$type]) ? + $smarty->_cache['resource_handlers'][$type] : + Smarty_Resource::load($smarty, $type); + // if resource is not recompiling and resource name is not dotted we can check the source cache + if (($smarty->resource_cache_mode & Smarty::RESOURCE_CACHE_ON) && !$handler->recompiled && + !(isset($name[1]) && $name[0] == '.' && ($name[1] == '.' || $name[1] == '/')) + ) { + $unique_resource = $handler->buildUniqueResourceName($smarty, $name); + if (isset($smarty->_cache['source_objects'][$unique_resource])) { + return $smarty->_cache['source_objects'][$unique_resource]; + } + } else { + $unique_resource = null; + } + // create new source object + $source = new Smarty_Template_Source($handler, $smarty, $template_resource, $type, $name); + $handler->populate($source, $_template); + if (!$source->exists && isset($_template->smarty->default_template_handler_func)) { + Smarty_Internal_Method_RegisterDefaultTemplateHandler::_getDefaultTemplate($source); + } + // on recompiling resources we are done + if (($smarty->resource_cache_mode & Smarty::RESOURCE_CACHE_ON) && !$handler->recompiled) { + // may by we have already $unique_resource + $is_relative = false; + if (!isset($unique_resource)) { + $is_relative = isset($name[1]) && $name[0] == '.' && ($name[1] == '.' || $name[1] == '/') && + ($type == 'file' || + (isset($_template->parent->source) && $_template->parent->source->type == 'extends')); + $unique_resource = + $handler->buildUniqueResourceName($smarty, $is_relative ? $source->filepath . $name : $name); + } + $source->unique_resource = $unique_resource; + // save in runtime cache if not relative + if (!$is_relative) { + $smarty->_cache['source_objects'][$unique_resource] = $source; + } + } + return $source; + } + + /** + * render the uncompiled source + * + * @param Smarty_Internal_Template $_template template object + * + * @return string + * @throws \Exception + */ + public function renderUncompiled(Smarty_Internal_Template $_template) + { + $this->handler->renderUncompiled($_template->source, $_template); + } + + /** + * Render uncompiled source + * + * @param \Smarty_Internal_Template $_template + */ + public function render(Smarty_Internal_Template $_template) + { + if ($_template->source->handler->uncompiled) { + if ($_template->smarty->debugging) { + $_template->smarty->_debug->start_render($_template); + } + $this->handler->renderUncompiled($_template->source, $_template); + if (isset($_template->parent) && $_template->parent->_objType == 2 && !empty($_template->tpl_function)) { + $_template->parent->tpl_function = + array_merge($_template->parent->tpl_function, $_template->tpl_function); + } + if ($_template->smarty->debugging) { + $_template->smarty->_debug->end_render($_template); + } + } + } + + /** + * Get source time stamp + * + * @return int + */ + public function getTimeStamp() + { + if (!isset($this->timestamp)) { + $this->handler->populateTimestamp($this); + } + return $this->timestamp; + } + + /** + * Get source content + * + * @return string + */ + public function getContent() + { + return isset($this->content) ? $this->content : $this->handler->getContent($this); + } +} diff --git a/inc/libs/Smarty/sysplugins/smarty_undefined_variable.php b/inc/libs/Smarty/sysplugins/smarty_undefined_variable.php new file mode 100755 index 0000000..88bc6f6 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smarty_undefined_variable.php @@ -0,0 +1,37 @@ +value = $value; + $this->nocache = $nocache; + } + + /** + * <> String conversion + * + * @return string + */ + public function __toString() + { + return (string) $this->value; + } +} + diff --git a/inc/libs/Smarty/sysplugins/smartycompilerexception.php b/inc/libs/Smarty/sysplugins/smartycompilerexception.php new file mode 100755 index 0000000..4d5d778 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smartycompilerexception.php @@ -0,0 +1,39 @@ + Smarty Compiler: ' . $this->message . ' <-- '; + } + + /** + * The line number of the template error + * + * @type int|null + */ + public $line = null; + /** + * The template source snippet relating to the error + * + * @type string|null + */ + public $source = null; + /** + * The raw text of the error message + * + * @type string|null + */ + public $desc = null; + /** + * The resource identifier or template name + * + * @type string|null + */ + public $template = null; +} diff --git a/inc/libs/Smarty/sysplugins/smartyexception.php b/inc/libs/Smarty/sysplugins/smartyexception.php new file mode 100755 index 0000000..3da16c2 --- /dev/null +++ b/inc/libs/Smarty/sysplugins/smartyexception.php @@ -0,0 +1,15 @@ + Smarty: ' . (self::$escape ? htmlentities($this->message) : $this->message) . ' <-- '; + } +} diff --git a/inc/libs/YAML/Dumper.php b/inc/libs/YAML/Dumper.php new file mode 100755 index 0000000..10ffe82 --- /dev/null +++ b/inc/libs/YAML/Dumper.php @@ -0,0 +1,114 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +/** + * Dumper dumps PHP variables to YAML strings. + * + * @author Fabien Potencier + */ +class Dumper +{ + /** + * The amount of spaces to use for indentation of nested nodes. + * + * @var int + */ + protected $indentation; + + /** + * @param int $indentation + */ + public function __construct($indentation = 4) + { + if ($indentation < 1) { + throw new \InvalidArgumentException('The indentation must be greater than zero.'); + } + + $this->indentation = $indentation; + } + + /** + * Sets the indentation. + * + * @param int $num The amount of spaces to use for indentation of nested nodes + */ + public function setIndentation($num) + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 3.1 and will be removed in 4.0. Pass the indentation to the constructor instead.', E_USER_DEPRECATED); + + $this->indentation = (int) $num; + } + + /** + * Dumps a PHP value to YAML. + * + * @param mixed $input The PHP value + * @param int $inline The level where you switch to inline YAML + * @param int $indent The level of indentation (used internally) + * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string + * + * @return string The YAML representation of the PHP value + */ + public function dump($input, $inline = 0, $indent = 0, $flags = 0) + { + if (is_bool($flags)) { + @trigger_error('Passing a boolean flag to toggle exception handling is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE flag instead.', E_USER_DEPRECATED); + + if ($flags) { + $flags = Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE; + } else { + $flags = 0; + } + } + + if (func_num_args() >= 5) { + @trigger_error('Passing a boolean flag to toggle object support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::DUMP_OBJECT flag instead.', E_USER_DEPRECATED); + + if (func_get_arg(4)) { + $flags |= Yaml::DUMP_OBJECT; + } + } + + $output = ''; + $prefix = $indent ? str_repeat(' ', $indent) : ''; + + if ($inline <= 0 || !is_array($input) || empty($input)) { + $output .= $prefix.Inline::dump($input, $flags); + } else { + $isAHash = Inline::isHash($input); + + foreach ($input as $key => $value) { + if ($inline > 1 && Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && is_string($value) && false !== strpos($value, "\n")) { + $output .= sprintf("%s%s%s |\n", $prefix, $isAHash ? Inline::dump($key, $flags).':' : '-', ''); + + foreach (preg_split('/\n|\r\n/', $value) as $row) { + $output .= sprintf("%s%s%s\n", $prefix, str_repeat(' ', $this->indentation), $row); + } + + continue; + } + + $willBeInlined = $inline - 1 <= 0 || !is_array($value) || empty($value); + + $output .= sprintf('%s%s%s%s', + $prefix, + $isAHash ? Inline::dump($key, $flags).':' : '-', + $willBeInlined ? ' ' : "\n", + $this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $flags) + ).($willBeInlined ? "\n" : ''); + } + } + + return $output; + } +} diff --git a/inc/libs/YAML/Escaper.php b/inc/libs/YAML/Escaper.php new file mode 100755 index 0000000..a74f14d --- /dev/null +++ b/inc/libs/YAML/Escaper.php @@ -0,0 +1,99 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +/** + * Escaper encapsulates escaping rules for single and double-quoted + * YAML strings. + * + * @author Matthew Lewinski + * + * @internal + */ +class Escaper +{ + // Characters that would cause a dumped string to require double quoting. + const REGEX_CHARACTER_TO_ESCAPE = "[\\x00-\\x1f]|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9"; + + // Mapping arrays for escaping a double quoted string. The backslash is + // first to ensure proper escaping because str_replace operates iteratively + // on the input arrays. This ordering of the characters avoids the use of strtr, + // which performs more slowly. + private static $escapees = array('\\', '\\\\', '\\"', '"', + "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", + "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", + "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", + "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", + "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9"); + private static $escaped = array('\\\\', '\\"', '\\\\', '\\"', + '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', + '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', + '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', + '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', + '\\N', '\\_', '\\L', '\\P'); + + /** + * Determines if a PHP value would require double quoting in YAML. + * + * @param string $value A PHP value + * + * @return bool True if the value would require double quotes + */ + public static function requiresDoubleQuoting($value) + { + return preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value); + } + + /** + * Escapes and surrounds a PHP value with double quotes. + * + * @param string $value A PHP value + * + * @return string The quoted, escaped string + */ + public static function escapeWithDoubleQuotes($value) + { + return sprintf('"%s"', str_replace(self::$escapees, self::$escaped, $value)); + } + + /** + * Determines if a PHP value would require single quoting in YAML. + * + * @param string $value A PHP value + * + * @return bool True if the value would require single quotes + */ + public static function requiresSingleQuoting($value) + { + // Determines if a PHP value is entirely composed of a value that would + // require single quoting in YAML. + if (in_array(strtolower($value), array('null', '~', 'true', 'false', 'y', 'n', 'yes', 'no', 'on', 'off'))) { + return true; + } + + // Determines if the PHP value contains any single characters that would + // cause it to require single quoting in YAML. + return preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value); + } + + /** + * Escapes and surrounds a PHP value with single quotes. + * + * @param string $value A PHP value + * + * @return string The quoted, escaped string + */ + public static function escapeWithSingleQuotes($value) + { + return sprintf("'%s'", str_replace('\'', '\'\'', $value)); + } +} diff --git a/inc/libs/YAML/Inline.php b/inc/libs/YAML/Inline.php new file mode 100755 index 0000000..0f66091 --- /dev/null +++ b/inc/libs/YAML/Inline.php @@ -0,0 +1,711 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +use Symfony\Component\Yaml\Exception\ParseException; +use Symfony\Component\Yaml\Exception\DumpException; + +/** + * Inline implements a YAML parser/dumper for the YAML inline syntax. + * + * @author Fabien Potencier + * + * @internal + */ +class Inline +{ + const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\']*(?:\'\'[^\']*)*)\')'; + + private static $exceptionOnInvalidType = false; + private static $objectSupport = false; + private static $objectForMap = false; + private static $constantSupport = false; + + /** + * Converts a YAML string to a PHP array. + * + * @param string $value A YAML string + * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior + * @param array $references Mapping of variable names to values + * + * @return array A PHP array representing the YAML string + * + * @throws ParseException + */ + public static function parse($value, $flags = 0, $references = array()) + { + if (is_bool($flags)) { + @trigger_error('Passing a boolean flag to toggle exception handling is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE flag instead.', E_USER_DEPRECATED); + + if ($flags) { + $flags = Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE; + } else { + $flags = 0; + } + } + + if (func_num_args() >= 3 && !is_array($references)) { + @trigger_error('Passing a boolean flag to toggle object support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::PARSE_OBJECT flag instead.', E_USER_DEPRECATED); + + if ($references) { + $flags |= Yaml::PARSE_OBJECT; + } + + if (func_num_args() >= 4) { + @trigger_error('Passing a boolean flag to toggle object for map support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::PARSE_OBJECT_FOR_MAP flag instead.', E_USER_DEPRECATED); + + if (func_get_arg(3)) { + $flags |= Yaml::PARSE_OBJECT_FOR_MAP; + } + } + + if (func_num_args() >= 5) { + $references = func_get_arg(4); + } else { + $references = array(); + } + } + + self::$exceptionOnInvalidType = (bool) (Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE & $flags); + self::$objectSupport = (bool) (Yaml::PARSE_OBJECT & $flags); + self::$objectForMap = (bool) (Yaml::PARSE_OBJECT_FOR_MAP & $flags); + self::$constantSupport = (bool) (Yaml::PARSE_CONSTANT & $flags); + + $value = trim($value); + + if ('' === $value) { + return ''; + } + + if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) { + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('ASCII'); + } + + $i = 0; + switch ($value[0]) { + case '[': + $result = self::parseSequence($value, $flags, $i, $references); + ++$i; + break; + case '{': + $result = self::parseMapping($value, $flags, $i, $references); + ++$i; + break; + default: + $result = self::parseScalar($value, $flags, null, array('"', "'"), $i, true, $references); + } + + // some comments are allowed at the end + if (preg_replace('/\s+#.*$/A', '', substr($value, $i))) { + throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i))); + } + + if (isset($mbEncoding)) { + mb_internal_encoding($mbEncoding); + } + + return $result; + } + + /** + * Dumps a given PHP variable to a YAML string. + * + * @param mixed $value The PHP variable to convert + * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string + * + * @return string The YAML string representing the PHP array + * + * @throws DumpException When trying to dump PHP resource + */ + public static function dump($value, $flags = 0) + { + if (is_bool($flags)) { + @trigger_error('Passing a boolean flag to toggle exception handling is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE flag instead.', E_USER_DEPRECATED); + + if ($flags) { + $flags = Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE; + } else { + $flags = 0; + } + } + + if (func_num_args() >= 3) { + @trigger_error('Passing a boolean flag to toggle object support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::DUMP_OBJECT flag instead.', E_USER_DEPRECATED); + + if (func_get_arg(2)) { + $flags |= Yaml::DUMP_OBJECT; + } + } + + switch (true) { + case is_resource($value): + if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) { + throw new DumpException(sprintf('Unable to dump PHP resources in a YAML file ("%s").', get_resource_type($value))); + } + + return 'null'; + case $value instanceof \DateTimeInterface: + return $value->format('c'); + case is_object($value): + if (Yaml::DUMP_OBJECT & $flags) { + return '!php/object:'.serialize($value); + } + + if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \stdClass || $value instanceof \ArrayObject)) { + return self::dumpArray((array) $value, $flags); + } + + if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) { + throw new DumpException('Object support when dumping a YAML file has been disabled.'); + } + + return 'null'; + case is_array($value): + return self::dumpArray($value, $flags); + case null === $value: + return 'null'; + case true === $value: + return 'true'; + case false === $value: + return 'false'; + case ctype_digit($value): + return is_string($value) ? "'$value'" : (int) $value; + case is_numeric($value): + $locale = setlocale(LC_NUMERIC, 0); + if (false !== $locale) { + setlocale(LC_NUMERIC, 'C'); + } + if (is_float($value)) { + $repr = (string) $value; + if (is_infinite($value)) { + $repr = str_ireplace('INF', '.Inf', $repr); + } elseif (floor($value) == $value && $repr == $value) { + // Preserve float data type since storing a whole number will result in integer value. + $repr = '!!float '.$repr; + } + } else { + $repr = is_string($value) ? "'$value'" : (string) $value; + } + if (false !== $locale) { + setlocale(LC_NUMERIC, $locale); + } + + return $repr; + case '' == $value: + return "''"; + case self::isBinaryString($value): + return '!!binary '.base64_encode($value); + case Escaper::requiresDoubleQuoting($value): + return Escaper::escapeWithDoubleQuotes($value); + case Escaper::requiresSingleQuoting($value): + case preg_match('{^[0-9]+[_0-9]*$}', $value): + case preg_match(self::getHexRegex(), $value): + case preg_match(self::getTimestampRegex(), $value): + return Escaper::escapeWithSingleQuotes($value); + default: + return $value; + } + } + + /** + * Check if given array is hash or just normal indexed array. + * + * @internal + * + * @param array $value The PHP array to check + * + * @return bool true if value is hash array, false otherwise + */ + public static function isHash(array $value) + { + $expectedKey = 0; + + foreach ($value as $key => $val) { + if ($key !== $expectedKey++) { + return true; + } + } + + return false; + } + + /** + * Dumps a PHP array to a YAML string. + * + * @param array $value The PHP array to dump + * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string + * + * @return string The YAML string representing the PHP array + */ + private static function dumpArray($value, $flags) + { + // array + if ($value && !self::isHash($value)) { + $output = array(); + foreach ($value as $val) { + $output[] = self::dump($val, $flags); + } + + return sprintf('[%s]', implode(', ', $output)); + } + + // hash + $output = array(); + foreach ($value as $key => $val) { + $output[] = sprintf('%s: %s', self::dump($key, $flags), self::dump($val, $flags)); + } + + return sprintf('{ %s }', implode(', ', $output)); + } + + /** + * Parses a scalar to a YAML string. + * + * @param string $scalar + * @param int $flags + * @param string $delimiters + * @param array $stringDelimiters + * @param int &$i + * @param bool $evaluate + * @param array $references + * + * @return string A YAML string + * + * @throws ParseException When malformed inline YAML string is parsed + * + * @internal + */ + public static function parseScalar($scalar, $flags = 0, $delimiters = null, $stringDelimiters = array('"', "'"), &$i = 0, $evaluate = true, $references = array()) + { + if (in_array($scalar[$i], $stringDelimiters)) { + // quoted scalar + $output = self::parseQuotedScalar($scalar, $i); + + if (null !== $delimiters) { + $tmp = ltrim(substr($scalar, $i), ' '); + if (!in_array($tmp[0], $delimiters)) { + throw new ParseException(sprintf('Unexpected characters (%s).', substr($scalar, $i))); + } + } + } else { + // "normal" string + if (!$delimiters) { + $output = substr($scalar, $i); + $i += strlen($output); + + // remove comments + if (preg_match('/[ \t]+#/', $output, $match, PREG_OFFSET_CAPTURE)) { + $output = substr($output, 0, $match[0][1]); + } + } elseif (preg_match('/^(.+?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) { + $output = $match[1]; + $i += strlen($output); + } else { + throw new ParseException(sprintf('Malformed inline YAML string (%s).', $scalar)); + } + + // a non-quoted string cannot start with @ or ` (reserved) nor with a scalar indicator (| or >) + if ($output && ('@' === $output[0] || '`' === $output[0] || '|' === $output[0] || '>' === $output[0])) { + throw new ParseException(sprintf('The reserved indicator "%s" cannot start a plain scalar; you need to quote the scalar.', $output[0])); + } + + if ($output && '%' === $output[0]) { + @trigger_error('Not quoting a scalar starting with the "%" indicator character is deprecated since Symfony 3.1 and will throw a ParseException in 4.0.', E_USER_DEPRECATED); + } + + if ($evaluate) { + $output = self::evaluateScalar($output, $flags, $references); + } + } + + return $output; + } + + /** + * Parses a quoted scalar to YAML. + * + * @param string $scalar + * @param int &$i + * + * @return string A YAML string + * + * @throws ParseException When malformed inline YAML string is parsed + */ + private static function parseQuotedScalar($scalar, &$i) + { + if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) { + throw new ParseException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i))); + } + + $output = substr($match[0], 1, strlen($match[0]) - 2); + + $unescaper = new Unescaper(); + if ('"' == $scalar[$i]) { + $output = $unescaper->unescapeDoubleQuotedString($output); + } else { + $output = $unescaper->unescapeSingleQuotedString($output); + } + + $i += strlen($match[0]); + + return $output; + } + + /** + * Parses a sequence to a YAML string. + * + * @param string $sequence + * @param int $flags + * @param int &$i + * @param array $references + * + * @return string A YAML string + * + * @throws ParseException When malformed inline YAML string is parsed + */ + private static function parseSequence($sequence, $flags, &$i = 0, $references = array()) + { + $output = array(); + $len = strlen($sequence); + ++$i; + + // [foo, bar, ...] + while ($i < $len) { + switch ($sequence[$i]) { + case '[': + // nested sequence + $output[] = self::parseSequence($sequence, $flags, $i, $references); + break; + case '{': + // nested mapping + $output[] = self::parseMapping($sequence, $flags, $i, $references); + break; + case ']': + return $output; + case ',': + case ' ': + break; + default: + $isQuoted = in_array($sequence[$i], array('"', "'")); + $value = self::parseScalar($sequence, $flags, array(',', ']'), array('"', "'"), $i, true, $references); + + // the value can be an array if a reference has been resolved to an array var + if (is_string($value) && !$isQuoted && false !== strpos($value, ': ')) { + // embedded mapping? + try { + $pos = 0; + $value = self::parseMapping('{'.$value.'}', $flags, $pos, $references); + } catch (\InvalidArgumentException $e) { + // no, it's not + } + } + + $output[] = $value; + + --$i; + } + + ++$i; + } + + throw new ParseException(sprintf('Malformed inline YAML string %s', $sequence)); + } + + /** + * Parses a mapping to a YAML string. + * + * @param string $mapping + * @param int $flags + * @param int &$i + * @param array $references + * + * @return string A YAML string + * + * @throws ParseException When malformed inline YAML string is parsed + */ + private static function parseMapping($mapping, $flags, &$i = 0, $references = array()) + { + $output = array(); + $len = strlen($mapping); + ++$i; + + // {foo: bar, bar:foo, ...} + while ($i < $len) { + switch ($mapping[$i]) { + case ' ': + case ',': + ++$i; + continue 2; + case '}': + if (self::$objectForMap) { + return (object) $output; + } + + return $output; + } + + // key + $key = self::parseScalar($mapping, $flags, array(':', ' '), array('"', "'"), $i, false); + + // value + $done = false; + + while ($i < $len) { + switch ($mapping[$i]) { + case '[': + // nested sequence + $value = self::parseSequence($mapping, $flags, $i, $references); + // Spec: Keys MUST be unique; first one wins. + // Parser cannot abort this mapping earlier, since lines + // are processed sequentially. + if (!isset($output[$key])) { + $output[$key] = $value; + } + $done = true; + break; + case '{': + // nested mapping + $value = self::parseMapping($mapping, $flags, $i, $references); + // Spec: Keys MUST be unique; first one wins. + // Parser cannot abort this mapping earlier, since lines + // are processed sequentially. + if (!isset($output[$key])) { + $output[$key] = $value; + } + $done = true; + break; + case ':': + case ' ': + break; + default: + $value = self::parseScalar($mapping, $flags, array(',', '}'), array('"', "'"), $i, true, $references); + // Spec: Keys MUST be unique; first one wins. + // Parser cannot abort this mapping earlier, since lines + // are processed sequentially. + if (!isset($output[$key])) { + $output[$key] = $value; + } + $done = true; + --$i; + } + + ++$i; + + if ($done) { + continue 2; + } + } + } + + throw new ParseException(sprintf('Malformed inline YAML string %s', $mapping)); + } + + /** + * Evaluates scalars and replaces magic values. + * + * @param string $scalar + * @param int $flags + * @param array $references + * + * @return string A YAML string + * + * @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved + */ + private static function evaluateScalar($scalar, $flags, $references = array()) + { + $scalar = trim($scalar); + $scalarLower = strtolower($scalar); + + if (0 === strpos($scalar, '*')) { + if (false !== $pos = strpos($scalar, '#')) { + $value = substr($scalar, 1, $pos - 2); + } else { + $value = substr($scalar, 1); + } + + // an unquoted * + if (false === $value || '' === $value) { + throw new ParseException('A reference must contain at least one character.'); + } + + if (!array_key_exists($value, $references)) { + throw new ParseException(sprintf('Reference "%s" does not exist.', $value)); + } + + return $references[$value]; + } + + switch (true) { + case 'null' === $scalarLower: + case '' === $scalar: + case '~' === $scalar: + return; + case 'true' === $scalarLower: + return true; + case 'false' === $scalarLower: + return false; + // Optimise for returning strings. + case $scalar[0] === '+' || $scalar[0] === '-' || $scalar[0] === '.' || $scalar[0] === '!' || is_numeric($scalar[0]): + switch (true) { + case 0 === strpos($scalar, '!str'): + return (string) substr($scalar, 5); + case 0 === strpos($scalar, '! '): + return (int) self::parseScalar(substr($scalar, 2), $flags); + case 0 === strpos($scalar, '!php/object:'): + if (self::$objectSupport) { + return unserialize(substr($scalar, 12)); + } + + if (self::$exceptionOnInvalidType) { + throw new ParseException('Object support when parsing a YAML file has been disabled.'); + } + + return; + case 0 === strpos($scalar, '!!php/object:'): + if (self::$objectSupport) { + @trigger_error('The !!php/object tag to indicate dumped PHP objects is deprecated since version 3.1 and will be removed in 4.0. Use the !php/object tag instead.', E_USER_DEPRECATED); + + return unserialize(substr($scalar, 13)); + } + + if (self::$exceptionOnInvalidType) { + throw new ParseException('Object support when parsing a YAML file has been disabled.'); + } + + return; + case 0 === strpos($scalar, '!php/const:'): + if (self::$constantSupport) { + if (defined($const = substr($scalar, 11))) { + return constant($const); + } + + throw new ParseException(sprintf('The constant "%s" is not defined.', $const)); + } + if (self::$exceptionOnInvalidType) { + throw new ParseException(sprintf('The string "%s" could not be parsed as a constant. Have you forgotten to pass the "Yaml::PARSE_CONSTANT" flag to the parser?', $scalar)); + } + + return; + case 0 === strpos($scalar, '!!float '): + return (float) substr($scalar, 8); + case preg_match('{^[+-]?[0-9][0-9_]*$}', $scalar): + $scalar = str_replace('_', '', (string) $scalar); + // omitting the break / return as integers are handled in the next case + case ctype_digit($scalar): + $raw = $scalar; + $cast = (int) $scalar; + + return '0' == $scalar[0] ? octdec($scalar) : (((string) $raw == (string) $cast) ? $cast : $raw); + case '-' === $scalar[0] && ctype_digit(substr($scalar, 1)): + $raw = $scalar; + $cast = (int) $scalar; + + return '0' == $scalar[1] ? octdec($scalar) : (((string) $raw === (string) $cast) ? $cast : $raw); + case is_numeric($scalar): + case preg_match(self::getHexRegex(), $scalar): + $scalar = str_replace('_', '', $scalar); + + return '0x' === $scalar[0].$scalar[1] ? hexdec($scalar) : (float) $scalar; + case '.inf' === $scalarLower: + case '.nan' === $scalarLower: + return -log(0); + case '-.inf' === $scalarLower: + return log(0); + case 0 === strpos($scalar, '!!binary '): + return self::evaluateBinaryScalar(substr($scalar, 9)); + case preg_match('/^(-|\+)?[0-9][0-9,]*(\.[0-9_]+)?$/', $scalar): + case preg_match('/^(-|\+)?[0-9][0-9_]*(\.[0-9_]+)?$/', $scalar): + if (false !== strpos($scalar, ',')) { + @trigger_error('Using the comma as a group separator for floats is deprecated since version 3.2 and will be removed in 4.0.', E_USER_DEPRECATED); + } + + return (float) str_replace(array(',', '_'), '', $scalar); + case preg_match(self::getTimestampRegex(), $scalar): + if (Yaml::PARSE_DATETIME & $flags) { + return new \DateTime($scalar, new \DateTimeZone('UTC')); + } + + $timeZone = date_default_timezone_get(); + date_default_timezone_set('UTC'); + $time = strtotime($scalar); + date_default_timezone_set($timeZone); + + return $time; + } + default: + return (string) $scalar; + } + } + + /** + * @param string $scalar + * + * @return string + * + * @internal + */ + public static function evaluateBinaryScalar($scalar) + { + $parsedBinaryData = self::parseScalar(preg_replace('/\s/', '', $scalar)); + + if (0 !== (strlen($parsedBinaryData) % 4)) { + throw new ParseException(sprintf('The normalized base64 encoded data (data without whitespace characters) length must be a multiple of four (%d bytes given).', strlen($parsedBinaryData))); + } + + if (!preg_match('#^[A-Z0-9+/]+={0,2}$#i', $parsedBinaryData)) { + throw new ParseException(sprintf('The base64 encoded data (%s) contains invalid characters.', $parsedBinaryData)); + } + + return base64_decode($parsedBinaryData, true); + } + + private static function isBinaryString($value) + { + return !preg_match('//u', $value) || preg_match('/[^\x09-\x0d\x20-\xff]/', $value); + } + + /** + * Gets a regex that matches a YAML date. + * + * @return string The regular expression + * + * @see http://www.yaml.org/spec/1.2/spec.html#id2761573 + */ + private static function getTimestampRegex() + { + return <<[0-9][0-9][0-9][0-9]) + -(?P[0-9][0-9]?) + -(?P[0-9][0-9]?) + (?:(?:[Tt]|[ \t]+) + (?P[0-9][0-9]?) + :(?P[0-9][0-9]) + :(?P[0-9][0-9]) + (?:\.(?P[0-9]*))? + (?:[ \t]*(?PZ|(?P[-+])(?P[0-9][0-9]?) + (?::(?P[0-9][0-9]))?))?)? + $~x +EOF; + } + + /** + * Gets a regex that matches a YAML number in hexadecimal notation. + * + * @return string + */ + private static function getHexRegex() + { + return '~^0x[0-9a-f_]++$~i'; + } +} diff --git a/inc/libs/YAML/Parser.php b/inc/libs/YAML/Parser.php new file mode 100755 index 0000000..5cf5a88 --- /dev/null +++ b/inc/libs/YAML/Parser.php @@ -0,0 +1,856 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +use Symfony\Component\Yaml\Exception\ParseException; + +/** + * Parser parses YAML strings to convert them to PHP arrays. + * + * @author Fabien Potencier + */ +class Parser +{ + const TAG_PATTERN = '((?P![\w!.\/:-]+) +)?'; + const BLOCK_SCALAR_HEADER_PATTERN = '(?P\||>)(?P\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P +#.*)?'; + + private $offset = 0; + private $totalNumberOfLines; + private $lines = array(); + private $currentLineNb = -1; + private $currentLine = ''; + private $refs = array(); + private $skippedLineNumbers = array(); + private $locallySkippedLineNumbers = array(); + + /** + * Constructor. + * + * @param int $offset The offset of YAML document (used for line numbers in error messages) + * @param int|null $totalNumberOfLines The overall number of lines being parsed + * @param int[] $skippedLineNumbers Number of comment lines that have been skipped by the parser + */ + public function __construct($offset = 0, $totalNumberOfLines = null, array $skippedLineNumbers = array()) + { + $this->offset = $offset; + $this->totalNumberOfLines = $totalNumberOfLines; + $this->skippedLineNumbers = $skippedLineNumbers; + } + + /** + * Parses a YAML string to a PHP value. + * + * @param string $value A YAML string + * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior + * + * @return mixed A PHP value + * + * @throws ParseException If the YAML is not valid + */ + public function parse($value, $flags = 0) + { + if (is_bool($flags)) { + @trigger_error('Passing a boolean flag to toggle exception handling is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE flag instead.', E_USER_DEPRECATED); + + if ($flags) { + $flags = Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE; + } else { + $flags = 0; + } + } + + if (func_num_args() >= 3) { + @trigger_error('Passing a boolean flag to toggle object support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::PARSE_OBJECT flag instead.', E_USER_DEPRECATED); + + if (func_get_arg(2)) { + $flags |= Yaml::PARSE_OBJECT; + } + } + + if (func_num_args() >= 4) { + @trigger_error('Passing a boolean flag to toggle object for map support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::PARSE_OBJECT_FOR_MAP flag instead.', E_USER_DEPRECATED); + + if (func_get_arg(3)) { + $flags |= Yaml::PARSE_OBJECT_FOR_MAP; + } + } + + if (!preg_match('//u', $value)) { + throw new ParseException('The YAML value does not appear to be valid UTF-8.'); + } + $this->currentLineNb = -1; + $this->currentLine = ''; + $value = $this->cleanup($value); + $this->lines = explode("\n", $value); + + if (null === $this->totalNumberOfLines) { + $this->totalNumberOfLines = count($this->lines); + } + + if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) { + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('UTF-8'); + } + + $data = array(); + $context = null; + $allowOverwrite = false; + while ($this->moveToNextLine()) { + if ($this->isCurrentLineEmpty()) { + continue; + } + + // tab? + if ("\t" === $this->currentLine[0]) { + throw new ParseException('A YAML file cannot contain tabs as indentation.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + + $isRef = $mergeNode = false; + if (preg_match('#^\-((?P\s+)(?P.+?))?\s*$#u', $this->currentLine, $values)) { + if ($context && 'mapping' == $context) { + throw new ParseException('You cannot define a sequence item when in a mapping', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + $context = 'sequence'; + + if (isset($values['value']) && preg_match('#^&(?P[^ ]+) *(?P.*)#u', $values['value'], $matches)) { + $isRef = $matches['ref']; + $values['value'] = $matches['value']; + } + + // array + if (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { + $data[] = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(null, true), $flags); + } else { + if (isset($values['leadspaces']) + && preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P.+?))?\s*$#u', $values['value'], $matches) + ) { + // this is a compact notation element, add to next block and parse + $block = $values['value']; + if ($this->isNextLineIndented()) { + $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + strlen($values['leadspaces']) + 1); + } + + $data[] = $this->parseBlock($this->getRealCurrentLineNb(), $block, $flags); + } else { + $data[] = $this->parseValue($values['value'], $flags, $context); + } + } + if ($isRef) { + $this->refs[$isRef] = end($data); + } + } elseif (preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{].*?) *\:(\s+(?P.+?))?\s*$#u', $this->currentLine, $values) && (false === strpos($values['key'], ' #') || in_array($values['key'][0], array('"', "'")))) { + if ($context && 'sequence' == $context) { + throw new ParseException('You cannot define a mapping item when in a sequence', $this->currentLineNb + 1, $this->currentLine); + } + $context = 'mapping'; + + // force correct settings + Inline::parse(null, $flags, $this->refs); + try { + $key = Inline::parseScalar($values['key']); + } catch (ParseException $e) { + $e->setParsedLine($this->getRealCurrentLineNb() + 1); + $e->setSnippet($this->currentLine); + + throw $e; + } + + // Convert float keys to strings, to avoid being converted to integers by PHP + if (is_float($key)) { + $key = (string) $key; + } + + if ('<<' === $key) { + $mergeNode = true; + $allowOverwrite = true; + if (isset($values['value']) && 0 === strpos($values['value'], '*')) { + $refName = substr($values['value'], 1); + if (!array_key_exists($refName, $this->refs)) { + throw new ParseException(sprintf('Reference "%s" does not exist.', $refName), $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + + $refValue = $this->refs[$refName]; + + if (!is_array($refValue)) { + throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + + foreach ($refValue as $key => $value) { + if (!isset($data[$key])) { + $data[$key] = $value; + } + } + } else { + if (isset($values['value']) && $values['value'] !== '') { + $value = $values['value']; + } else { + $value = $this->getNextEmbedBlock(); + } + $parsed = $this->parseBlock($this->getRealCurrentLineNb() + 1, $value, $flags); + + if (!is_array($parsed)) { + throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + + if (isset($parsed[0])) { + // If the value associated with the merge key is a sequence, then this sequence is expected to contain mapping nodes + // and each of these nodes is merged in turn according to its order in the sequence. Keys in mapping nodes earlier + // in the sequence override keys specified in later mapping nodes. + foreach ($parsed as $parsedItem) { + if (!is_array($parsedItem)) { + throw new ParseException('Merge items must be arrays.', $this->getRealCurrentLineNb() + 1, $parsedItem); + } + + foreach ($parsedItem as $key => $value) { + if (!isset($data[$key])) { + $data[$key] = $value; + } + } + } + } else { + // If the value associated with the key is a single mapping node, each of its key/value pairs is inserted into the + // current mapping, unless the key already exists in it. + foreach ($parsed as $key => $value) { + if (!isset($data[$key])) { + $data[$key] = $value; + } + } + } + } + } elseif (isset($values['value']) && preg_match('#^&(?P[^ ]+) *(?P.*)#u', $values['value'], $matches)) { + $isRef = $matches['ref']; + $values['value'] = $matches['value']; + } + + if ($mergeNode) { + // Merge keys + } elseif (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { + // hash + // if next line is less indented or equal, then it means that the current value is null + if (!$this->isNextLineIndented() && !$this->isNextLineUnIndentedCollection()) { + // Spec: Keys MUST be unique; first one wins. + // But overwriting is allowed when a merge node is used in current block. + if ($allowOverwrite || !isset($data[$key])) { + $data[$key] = null; + } + } else { + $value = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(), $flags); + // Spec: Keys MUST be unique; first one wins. + // But overwriting is allowed when a merge node is used in current block. + if ($allowOverwrite || !isset($data[$key])) { + $data[$key] = $value; + } + } + } else { + $value = $this->parseValue($values['value'], $flags, $context); + // Spec: Keys MUST be unique; first one wins. + // But overwriting is allowed when a merge node is used in current block. + if ($allowOverwrite || !isset($data[$key])) { + $data[$key] = $value; + } + } + if ($isRef) { + $this->refs[$isRef] = $data[$key]; + } + } else { + // multiple documents are not supported + if ('---' === $this->currentLine) { + throw new ParseException('Multiple documents are not supported.', $this->currentLineNb + 1, $this->currentLine); + } + + // 1-liner optionally followed by newline(s) + if (is_string($value) && $this->lines[0] === trim($value)) { + try { + $value = Inline::parse($this->lines[0], $flags, $this->refs); + } catch (ParseException $e) { + $e->setParsedLine($this->getRealCurrentLineNb() + 1); + $e->setSnippet($this->currentLine); + + throw $e; + } + + if (is_array($value)) { + $first = reset($value); + if (is_string($first) && 0 === strpos($first, '*')) { + $data = array(); + foreach ($value as $alias) { + $data[] = $this->refs[substr($alias, 1)]; + } + $value = $data; + } + } + + if (isset($mbEncoding)) { + mb_internal_encoding($mbEncoding); + } + + return $value; + } + + switch (preg_last_error()) { + case PREG_INTERNAL_ERROR: + $error = 'Internal PCRE error.'; + break; + case PREG_BACKTRACK_LIMIT_ERROR: + $error = 'pcre.backtrack_limit reached.'; + break; + case PREG_RECURSION_LIMIT_ERROR: + $error = 'pcre.recursion_limit reached.'; + break; + case PREG_BAD_UTF8_ERROR: + $error = 'Malformed UTF-8 data.'; + break; + case PREG_BAD_UTF8_OFFSET_ERROR: + $error = 'Offset doesn\'t correspond to the begin of a valid UTF-8 code point.'; + break; + default: + $error = 'Unable to parse.'; + } + + throw new ParseException($error, $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + } + + if (isset($mbEncoding)) { + mb_internal_encoding($mbEncoding); + } + + if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && !is_object($data) && 'mapping' === $context) { + $object = new \stdClass(); + + foreach ($data as $key => $value) { + $object->$key = $value; + } + + $data = $object; + } + + return empty($data) ? null : $data; + } + + private function parseBlock($offset, $yaml, $flags) + { + $skippedLineNumbers = $this->skippedLineNumbers; + + foreach ($this->locallySkippedLineNumbers as $lineNumber) { + if ($lineNumber < $offset) { + continue; + } + + $skippedLineNumbers[] = $lineNumber; + } + + $parser = new self($offset, $this->totalNumberOfLines, $skippedLineNumbers); + $parser->refs = &$this->refs; + + return $parser->parse($yaml, $flags); + } + + /** + * Returns the current line number (takes the offset into account). + * + * @return int The current line number + */ + private function getRealCurrentLineNb() + { + $realCurrentLineNumber = $this->currentLineNb + $this->offset; + + foreach ($this->skippedLineNumbers as $skippedLineNumber) { + if ($skippedLineNumber > $realCurrentLineNumber) { + break; + } + + ++$realCurrentLineNumber; + } + + return $realCurrentLineNumber; + } + + /** + * Returns the current line indentation. + * + * @return int The current line indentation + */ + private function getCurrentLineIndentation() + { + return strlen($this->currentLine) - strlen(ltrim($this->currentLine, ' ')); + } + + /** + * Returns the next embed block of YAML. + * + * @param int $indentation The indent level at which the block is to be read, or null for default + * @param bool $inSequence True if the enclosing data structure is a sequence + * + * @return string A YAML string + * + * @throws ParseException When indentation problem are detected + */ + private function getNextEmbedBlock($indentation = null, $inSequence = false) + { + $oldLineIndentation = $this->getCurrentLineIndentation(); + $blockScalarIndentations = array(); + + if ($this->isBlockScalarHeader()) { + $blockScalarIndentations[] = $this->getCurrentLineIndentation(); + } + + if (!$this->moveToNextLine()) { + return; + } + + if (null === $indentation) { + $newIndent = $this->getCurrentLineIndentation(); + + $unindentedEmbedBlock = $this->isStringUnIndentedCollectionItem(); + + if (!$this->isCurrentLineEmpty() && 0 === $newIndent && !$unindentedEmbedBlock) { + throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + } else { + $newIndent = $indentation; + } + + $data = array(); + if ($this->getCurrentLineIndentation() >= $newIndent) { + $data[] = substr($this->currentLine, $newIndent); + } else { + $this->moveToPreviousLine(); + + return; + } + + if ($inSequence && $oldLineIndentation === $newIndent && isset($data[0][0]) && '-' === $data[0][0]) { + // the previous line contained a dash but no item content, this line is a sequence item with the same indentation + // and therefore no nested list or mapping + $this->moveToPreviousLine(); + + return; + } + + $isItUnindentedCollection = $this->isStringUnIndentedCollectionItem(); + + if (empty($blockScalarIndentations) && $this->isBlockScalarHeader()) { + $blockScalarIndentations[] = $this->getCurrentLineIndentation(); + } + + $previousLineIndentation = $this->getCurrentLineIndentation(); + + while ($this->moveToNextLine()) { + $indent = $this->getCurrentLineIndentation(); + + // terminate all block scalars that are more indented than the current line + if (!empty($blockScalarIndentations) && $indent < $previousLineIndentation && trim($this->currentLine) !== '') { + foreach ($blockScalarIndentations as $key => $blockScalarIndentation) { + if ($blockScalarIndentation >= $this->getCurrentLineIndentation()) { + unset($blockScalarIndentations[$key]); + } + } + } + + if (empty($blockScalarIndentations) && !$this->isCurrentLineComment() && $this->isBlockScalarHeader()) { + $blockScalarIndentations[] = $this->getCurrentLineIndentation(); + } + + $previousLineIndentation = $indent; + + if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem() && $newIndent === $indent) { + $this->moveToPreviousLine(); + break; + } + + if ($this->isCurrentLineBlank()) { + $data[] = substr($this->currentLine, $newIndent); + continue; + } + + // we ignore "comment" lines only when we are not inside a scalar block + if (empty($blockScalarIndentations) && $this->isCurrentLineComment()) { + // remember ignored comment lines (they are used later in nested + // parser calls to determine real line numbers) + // + // CAUTION: beware to not populate the global property here as it + // will otherwise influence the getRealCurrentLineNb() call here + // for consecutive comment lines and subsequent embedded blocks + $this->locallySkippedLineNumbers[] = $this->getRealCurrentLineNb(); + + continue; + } + + if ($indent >= $newIndent) { + $data[] = substr($this->currentLine, $newIndent); + } elseif (0 == $indent) { + $this->moveToPreviousLine(); + + break; + } else { + throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + } + + return implode("\n", $data); + } + + /** + * Moves the parser to the next line. + * + * @return bool + */ + private function moveToNextLine() + { + if ($this->currentLineNb >= count($this->lines) - 1) { + return false; + } + + $this->currentLine = $this->lines[++$this->currentLineNb]; + + return true; + } + + /** + * Moves the parser to the previous line. + * + * @return bool + */ + private function moveToPreviousLine() + { + if ($this->currentLineNb < 1) { + return false; + } + + $this->currentLine = $this->lines[--$this->currentLineNb]; + + return true; + } + + /** + * Parses a YAML value. + * + * @param string $value A YAML value + * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior + * @param string $context The parser context (either sequence or mapping) + * + * @return mixed A PHP value + * + * @throws ParseException When reference does not exist + */ + private function parseValue($value, $flags, $context) + { + if (0 === strpos($value, '*')) { + if (false !== $pos = strpos($value, '#')) { + $value = substr($value, 1, $pos - 2); + } else { + $value = substr($value, 1); + } + + if (!array_key_exists($value, $this->refs)) { + throw new ParseException(sprintf('Reference "%s" does not exist.', $value), $this->currentLineNb + 1, $this->currentLine); + } + + return $this->refs[$value]; + } + + if (preg_match('/^'.self::TAG_PATTERN.self::BLOCK_SCALAR_HEADER_PATTERN.'$/', $value, $matches)) { + $modifiers = isset($matches['modifiers']) ? $matches['modifiers'] : ''; + + $data = $this->parseBlockScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), (int) abs($modifiers)); + + if (isset($matches['tag']) && '!!binary' === $matches['tag']) { + return Inline::evaluateBinaryScalar($data); + } + + return $data; + } + + try { + $parsedValue = Inline::parse($value, $flags, $this->refs); + + if ('mapping' === $context && is_string($parsedValue) && '"' !== $value[0] && "'" !== $value[0] && '[' !== $value[0] && '{' !== $value[0] && '!' !== $value[0] && false !== strpos($parsedValue, ': ')) { + throw new ParseException('A colon cannot be used in an unquoted mapping value.'); + } + + return $parsedValue; + } catch (ParseException $e) { + $e->setParsedLine($this->getRealCurrentLineNb() + 1); + $e->setSnippet($this->currentLine); + + throw $e; + } + } + + /** + * Parses a block scalar. + * + * @param string $style The style indicator that was used to begin this block scalar (| or >) + * @param string $chomping The chomping indicator that was used to begin this block scalar (+ or -) + * @param int $indentation The indentation indicator that was used to begin this block scalar + * + * @return string The text value + */ + private function parseBlockScalar($style, $chomping = '', $indentation = 0) + { + $notEOF = $this->moveToNextLine(); + if (!$notEOF) { + return ''; + } + + $isCurrentLineBlank = $this->isCurrentLineBlank(); + $blockLines = array(); + + // leading blank lines are consumed before determining indentation + while ($notEOF && $isCurrentLineBlank) { + // newline only if not EOF + if ($notEOF = $this->moveToNextLine()) { + $blockLines[] = ''; + $isCurrentLineBlank = $this->isCurrentLineBlank(); + } + } + + // determine indentation if not specified + if (0 === $indentation) { + if (preg_match('/^ +/', $this->currentLine, $matches)) { + $indentation = strlen($matches[0]); + } + } + + if ($indentation > 0) { + $pattern = sprintf('/^ {%d}(.*)$/', $indentation); + + while ( + $notEOF && ( + $isCurrentLineBlank || + preg_match($pattern, $this->currentLine, $matches) + ) + ) { + if ($isCurrentLineBlank && strlen($this->currentLine) > $indentation) { + $blockLines[] = substr($this->currentLine, $indentation); + } elseif ($isCurrentLineBlank) { + $blockLines[] = ''; + } else { + $blockLines[] = $matches[1]; + } + + // newline only if not EOF + if ($notEOF = $this->moveToNextLine()) { + $isCurrentLineBlank = $this->isCurrentLineBlank(); + } + } + } elseif ($notEOF) { + $blockLines[] = ''; + } + + if ($notEOF) { + $blockLines[] = ''; + $this->moveToPreviousLine(); + } elseif (!$notEOF && !$this->isCurrentLineLastLineInDocument()) { + $blockLines[] = ''; + } + + // folded style + if ('>' === $style) { + $text = ''; + $previousLineIndented = false; + $previousLineBlank = false; + + for ($i = 0; $i < count($blockLines); ++$i) { + if ('' === $blockLines[$i]) { + $text .= "\n"; + $previousLineIndented = false; + $previousLineBlank = true; + } elseif (' ' === $blockLines[$i][0]) { + $text .= "\n".$blockLines[$i]; + $previousLineIndented = true; + $previousLineBlank = false; + } elseif ($previousLineIndented) { + $text .= "\n".$blockLines[$i]; + $previousLineIndented = false; + $previousLineBlank = false; + } elseif ($previousLineBlank || 0 === $i) { + $text .= $blockLines[$i]; + $previousLineIndented = false; + $previousLineBlank = false; + } else { + $text .= ' '.$blockLines[$i]; + $previousLineIndented = false; + $previousLineBlank = false; + } + } + } else { + $text = implode("\n", $blockLines); + } + + // deal with trailing newlines + if ('' === $chomping) { + $text = preg_replace('/\n+$/', "\n", $text); + } elseif ('-' === $chomping) { + $text = preg_replace('/\n+$/', '', $text); + } + + return $text; + } + + /** + * Returns true if the next line is indented. + * + * @return bool Returns true if the next line is indented, false otherwise + */ + private function isNextLineIndented() + { + $currentIndentation = $this->getCurrentLineIndentation(); + $EOF = !$this->moveToNextLine(); + + while (!$EOF && $this->isCurrentLineEmpty()) { + $EOF = !$this->moveToNextLine(); + } + + if ($EOF) { + return false; + } + + $ret = false; + if ($this->getCurrentLineIndentation() > $currentIndentation) { + $ret = true; + } + + $this->moveToPreviousLine(); + + return $ret; + } + + /** + * Returns true if the current line is blank or if it is a comment line. + * + * @return bool Returns true if the current line is empty or if it is a comment line, false otherwise + */ + private function isCurrentLineEmpty() + { + return $this->isCurrentLineBlank() || $this->isCurrentLineComment(); + } + + /** + * Returns true if the current line is blank. + * + * @return bool Returns true if the current line is blank, false otherwise + */ + private function isCurrentLineBlank() + { + return '' == trim($this->currentLine, ' '); + } + + /** + * Returns true if the current line is a comment line. + * + * @return bool Returns true if the current line is a comment line, false otherwise + */ + private function isCurrentLineComment() + { + //checking explicitly the first char of the trim is faster than loops or strpos + $ltrimmedLine = ltrim($this->currentLine, ' '); + + return '' !== $ltrimmedLine && $ltrimmedLine[0] === '#'; + } + + private function isCurrentLineLastLineInDocument() + { + return ($this->offset + $this->currentLineNb) >= ($this->totalNumberOfLines - 1); + } + + /** + * Cleanups a YAML string to be parsed. + * + * @param string $value The input YAML string + * + * @return string A cleaned up YAML string + */ + private function cleanup($value) + { + $value = str_replace(array("\r\n", "\r"), "\n", $value); + + // strip YAML header + $count = 0; + $value = preg_replace('#^\%YAML[: ][\d\.]+.*\n#u', '', $value, -1, $count); + $this->offset += $count; + + // remove leading comments + $trimmedValue = preg_replace('#^(\#.*?\n)+#s', '', $value, -1, $count); + if ($count == 1) { + // items have been removed, update the offset + $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); + $value = $trimmedValue; + } + + // remove start of the document marker (---) + $trimmedValue = preg_replace('#^\-\-\-.*?\n#s', '', $value, -1, $count); + if ($count == 1) { + // items have been removed, update the offset + $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); + $value = $trimmedValue; + + // remove end of the document marker (...) + $value = preg_replace('#\.\.\.\s*$#', '', $value); + } + + return $value; + } + + /** + * Returns true if the next line starts unindented collection. + * + * @return bool Returns true if the next line starts unindented collection, false otherwise + */ + private function isNextLineUnIndentedCollection() + { + $currentIndentation = $this->getCurrentLineIndentation(); + $notEOF = $this->moveToNextLine(); + + while ($notEOF && $this->isCurrentLineEmpty()) { + $notEOF = $this->moveToNextLine(); + } + + if (false === $notEOF) { + return false; + } + + $ret = false; + if ( + $this->getCurrentLineIndentation() == $currentIndentation + && + $this->isStringUnIndentedCollectionItem() + ) { + $ret = true; + } + + $this->moveToPreviousLine(); + + return $ret; + } + + /** + * Returns true if the string is un-indented collection item. + * + * @return bool Returns true if the string is un-indented collection item, false otherwise + */ + private function isStringUnIndentedCollectionItem() + { + return '-' === rtrim($this->currentLine) || 0 === strpos($this->currentLine, '- '); + } + + /** + * Tests whether or not the current line is the header of a block scalar. + * + * @return bool + */ + private function isBlockScalarHeader() + { + return (bool) preg_match('~'.self::BLOCK_SCALAR_HEADER_PATTERN.'$~', $this->currentLine); + } +} diff --git a/inc/libs/YAML/Unescaper.php b/inc/libs/YAML/Unescaper.php new file mode 100755 index 0000000..6e863e1 --- /dev/null +++ b/inc/libs/YAML/Unescaper.php @@ -0,0 +1,142 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +use Symfony\Component\Yaml\Exception\ParseException; + +/** + * Unescaper encapsulates unescaping rules for single and double-quoted + * YAML strings. + * + * @author Matthew Lewinski + * + * @internal + */ +class Unescaper +{ + /** + * Regex fragment that matches an escaped character in a double quoted string. + */ + const REGEX_ESCAPED_CHARACTER = '\\\\(x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|.)'; + + /** + * Unescapes a single quoted string. + * + * @param string $value A single quoted string + * + * @return string The unescaped string + */ + public function unescapeSingleQuotedString($value) + { + return str_replace('\'\'', '\'', $value); + } + + /** + * Unescapes a double quoted string. + * + * @param string $value A double quoted string + * + * @return string The unescaped string + */ + public function unescapeDoubleQuotedString($value) + { + $callback = function ($match) { + return $this->unescapeCharacter($match[0]); + }; + + // evaluate the string + return preg_replace_callback('/'.self::REGEX_ESCAPED_CHARACTER.'/u', $callback, $value); + } + + /** + * Unescapes a character that was found in a double-quoted string. + * + * @param string $value An escaped character + * + * @return string The unescaped character + */ + private function unescapeCharacter($value) + { + switch ($value[1]) { + case '0': + return "\x0"; + case 'a': + return "\x7"; + case 'b': + return "\x8"; + case 't': + return "\t"; + case "\t": + return "\t"; + case 'n': + return "\n"; + case 'v': + return "\xB"; + case 'f': + return "\xC"; + case 'r': + return "\r"; + case 'e': + return "\x1B"; + case ' ': + return ' '; + case '"': + return '"'; + case '/': + return '/'; + case '\\': + return '\\'; + case 'N': + // U+0085 NEXT LINE + return "\xC2\x85"; + case '_': + // U+00A0 NO-BREAK SPACE + return "\xC2\xA0"; + case 'L': + // U+2028 LINE SEPARATOR + return "\xE2\x80\xA8"; + case 'P': + // U+2029 PARAGRAPH SEPARATOR + return "\xE2\x80\xA9"; + case 'x': + return self::utf8chr(hexdec(substr($value, 2, 2))); + case 'u': + return self::utf8chr(hexdec(substr($value, 2, 4))); + case 'U': + return self::utf8chr(hexdec(substr($value, 2, 8))); + default: + throw new ParseException(sprintf('Found unknown escape character "%s".', $value)); + } + } + + /** + * Get the UTF-8 character for the given code point. + * + * @param int $c The unicode code point + * + * @return string The corresponding UTF-8 character + */ + private static function utf8chr($c) + { + if (0x80 > $c %= 0x200000) { + return chr($c); + } + if (0x800 > $c) { + return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F); + } + if (0x10000 > $c) { + return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); + } + + return chr(0xF0 | $c >> 18).chr(0x80 | $c >> 12 & 0x3F).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); + } +} diff --git a/inc/libs/YAML/Yaml.php b/inc/libs/YAML/Yaml.php new file mode 100755 index 0000000..46e6ef5 --- /dev/null +++ b/inc/libs/YAML/Yaml.php @@ -0,0 +1,119 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +use Symfony\Component\Yaml\Exception\ParseException; + +/** + * Yaml offers convenience methods to load and dump YAML. + * + * @author Fabien Potencier + */ +class Yaml +{ + const DUMP_OBJECT = 1; + const PARSE_EXCEPTION_ON_INVALID_TYPE = 2; + const PARSE_OBJECT = 4; + const PARSE_OBJECT_FOR_MAP = 8; + const DUMP_EXCEPTION_ON_INVALID_TYPE = 16; + const PARSE_DATETIME = 32; + const DUMP_OBJECT_AS_MAP = 64; + const DUMP_MULTI_LINE_LITERAL_BLOCK = 128; + const PARSE_CONSTANT = 256; + + /** + * Parses YAML into a PHP value. + * + * Usage: + * + * $array = Yaml::parse(file_get_contents('config.yml')); + * print_r($array); + * + * + * @param string $input A string containing YAML + * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior + * + * @return mixed The YAML converted to a PHP value + * + * @throws ParseException If the YAML is not valid + */ + public static function parse($input, $flags = 0) + { + if (is_bool($flags)) { + @trigger_error('Passing a boolean flag to toggle exception handling is deprecated since version 3.1 and will be removed in 4.0. Use the PARSE_EXCEPTION_ON_INVALID_TYPE flag instead.', E_USER_DEPRECATED); + + if ($flags) { + $flags = self::PARSE_EXCEPTION_ON_INVALID_TYPE; + } else { + $flags = 0; + } + } + + if (func_num_args() >= 3) { + @trigger_error('Passing a boolean flag to toggle object support is deprecated since version 3.1 and will be removed in 4.0. Use the PARSE_OBJECT flag instead.', E_USER_DEPRECATED); + + if (func_get_arg(2)) { + $flags |= self::PARSE_OBJECT; + } + } + + if (func_num_args() >= 4) { + @trigger_error('Passing a boolean flag to toggle object for map support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::PARSE_OBJECT_FOR_MAP flag instead.', E_USER_DEPRECATED); + + if (func_get_arg(3)) { + $flags |= self::PARSE_OBJECT_FOR_MAP; + } + } + + $yaml = new Parser(); + + return $yaml->parse($input, $flags); + } + + /** + * Dumps a PHP value to a YAML string. + * + * The dump method, when supplied with an array, will do its best + * to convert the array into friendly YAML. + * + * @param mixed $input The PHP value + * @param int $inline The level where you switch to inline YAML + * @param int $indent The amount of spaces to use for indentation of nested nodes + * @param int $flags A bit field of DUMP_* constants to customize the dumped YAML string + * + * @return string A YAML string representing the original PHP value + */ + public static function dump($input, $inline = 2, $indent = 4, $flags = 0) + { + if (is_bool($flags)) { + @trigger_error('Passing a boolean flag to toggle exception handling is deprecated since version 3.1 and will be removed in 4.0. Use the DUMP_EXCEPTION_ON_INVALID_TYPE flag instead.', E_USER_DEPRECATED); + + if ($flags) { + $flags = self::DUMP_EXCEPTION_ON_INVALID_TYPE; + } else { + $flags = 0; + } + } + + if (func_num_args() >= 5) { + @trigger_error('Passing a boolean flag to toggle object support is deprecated since version 3.1 and will be removed in 4.0. Use the DUMP_OBJECT flag instead.', E_USER_DEPRECATED); + + if (func_get_arg(4)) { + $flags |= self::DUMP_OBJECT; + } + } + + $yaml = new Dumper($indent); + + return $yaml->dump($input, $inline, 0, $flags); + } +} diff --git a/inc/libs/YAML/autoload.php b/inc/libs/YAML/autoload.php new file mode 100755 index 0000000..190c3c5 --- /dev/null +++ b/inc/libs/YAML/autoload.php @@ -0,0 +1,5 @@ +host = $host; + $this->dbname = $dbname; + $this->usr = $usr; + $this->pass = $pass; + $this->prefix = $prefix; + + try + { + $this->dbh = new PDO('mysql:host=' . $host . ';dbname=' . $dbname, $usr, $pass); + } + catch(PDOException $e) { + echo $e->getMessage(); + exit; + } + + //UTF-8 + $this->dbh->exec("SET NAMES 'utf8'"); + $this->dbh->exec("SET CHARACTER SET 'utf8'"); + } + + private $col = null; + + public function setCol($col) + { + $this->clear(); + $this->col = $col; + } + + //Daten holen + public function get($where = [], $link = 'AND') + { + if (isset($this->col)) + { + //Entweder übergebene Daten oder in $this->data vorhandene nutzen + if (empty($where)) + { + if (empty($this->data)) + { + $where = []; + } else + { + $where = $this->data; + } + } + + //Where zusamenbauen + $whereCl = ''; + $whereAr = []; + if (!empty($where)) + { + $i = 1; + $whereCount = count($where); + $whereCl = ' WHERE '; + foreach ($where as $col => $val) + { + $whereCl .= $col . ' = ?'; + $whereAr[] = $val; + if ($i < $whereCount) $whereCl .= ' ' . $link . ' '; + $i++; + } + } + + //print_r($whereAr); + + $stmt = $this->dbh->prepare('SELECT * FROM ' . $this->prefix . $this->col . $whereCl); + $stmt->execute($whereAr); + + $all = []; + while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) + { + $all[] = $row; + } + + $this->data = ''; + /*$cnt = count($all); + + if ($cnt == 1) + { + $this->data = $all[0]; + return $all[0]; + } else + {*/ + $this->data = $all; + return $all; + //} + } + } + + //Daten einfügen + public function insert($args = []) + { + if (isset($this->col)) + { + //Entweder übergebene Daten oder in $this->data vorhandene nutzen + if (empty($args)) + { + if (empty($this->data)) + { + $args = []; + } else + { + $args = $this->data; + } + } + + if (!empty($args)) + { + $stmt = 'INSERT INTO ' . $this->prefix . $this->col . ' (`'; + $i = 1; + $vals = []; + $valCnt = ''; + foreach ($args as $key => $val) + { + $stmt .= $key.'`'; + //$vals[] = utf8_encode($val); + $vals[] = $val; + $valCnt .= '?'; + if ($i < count($args)) + { + $stmt .= ', `'; + $valCnt .= ', '; + } + $i++; + } + $stmt .= ') VALUES (' . $valCnt . ')'; + //echo $stmt; + + $insert = $this->dbh->prepare($stmt); + return $insert->execute($vals); + } + } + } + + public function lastID() + { + return $this->dbh->lastInsertId(); + } + + //Daten Updaten + public function update($where = [], $dataToUpdate = [], $link = 'AND') + { + if (isset($this->col)) + { + //Entweder übergebene Daten oder in $this->data vorhandene nutzen + if (empty($dataToUpdate)) + { + if (empty($this->data)) + { + $dataToUpdate = []; + } else + { + $dataToUpdate = $this->data; + } + } + + + //echo mb_detect_encoding($dataToUpdate['alias']); + //print_r($dataToUpdate); + + $stmt = 'UPDATE ' . $this->prefix . $this->col . ' SET '; + $vals = []; + $i = 1; + foreach ($dataToUpdate as $key => $val) + { + $stmt .= $key . ' = ?'; + //$val = utf8_encode($val); + //$vals[] = utf8_encode($val); + $vals[] = $val; + //echo mb_detect_encoding($val).' -> '.$val; + if ($i < count($dataToUpdate)) $stmt .= ', '; + $i++; + } + + //Where zusamenbauen + $whereCl = ''; + $whereAr = []; + if (!empty($where)) + { + $i = 1; + $whereCount = count($where); + $whereCl = ' WHERE '; + foreach ($where as $col => $val) + { + $whereCl .= $col . ' = ?'; + $vals[] = $val; + if ($i < $whereCount) $whereCl .= ' ' . $link . ' '; + $i++; + } + } + $stmt .= $whereCl; + + //secho $stmt; + $update = $this->dbh->prepare($stmt); + return $update->execute($vals); + } + else + { + return false; + } + } + + //Daten Löschen + public function delete($where = [], $link = 'AND') + { + if (isset($this->col)) + { + //Entweder übergebene Daten oder in $this->data vorhandene nutzen + if (empty($where)) + { + if (empty($this->data)) + { + $where = []; + } else + { + $where = $this->data; + } + } + + $stmt = 'DELETE FROM ' . $this->prefix . $this->col; + //Where zusamenbauen + $whereCl = ''; + $whereAr = []; + $vals = []; + if (!empty($where)) + { + $i = 1; + $whereCount = count($where); + $whereCl = ' WHERE '; + foreach ($where as $col => $val) + { + $whereCl .= $col . ' = ?'; + $vals[] = $val; + if ($i < $whereCount) $whereCl .= ' ' . $link . ' '; + $i++; + } + } + $stmt .= $whereCl; + + //echo $stmt; + $delete = $this->dbh->prepare($stmt); + return $delete->execute($vals); + } + } + + //Create Table + public function createCol($name, $rows) + { + $dataTypes = ['int' => 'bigint(11) NOT NULL', 'string' => 'text CHARACTER SET utf8 NOT NULL', 'longstring' => 'longtext CHARACTER SET utf8 NOT NULL', 'boolean' => 'tinyint(1) NOT NULL']; + $stmt = 'CREATE TABLE '.$name.'('; + foreach ($rows as $colname => $coldata) + { + if(array_key_exists($coldata, $dataTypes)) + { + $stmt .= $colname . ' ' . $dataTypes[$coldata] . ','; + } + } + $stmt = substr($stmt, 0, strlen($stmt) - 1); + $stmt .= ')'; + return $this->dbh->exec($stmt); + } + + //Version + public function version() + { + $STH = $this->dbh->query('SELECT VERSION( ) AS version'); + $STH->setFetchMode(PDO::FETCH_OBJ); + if ($row = $STH->fetch()) + { + return $row->version; + } + } + + //Aufräumen + public function clear() + { + $this->col = null; + $this->data = ''; + } + + //Query + public function query($query) + { + $STH = $this->dbh->prepare($query); + return $STH->execute(); + } +} \ No newline at end of file diff --git a/inc/libs/dbbackup.php b/inc/libs/dbbackup.php new file mode 100755 index 0000000..3411344 --- /dev/null +++ b/inc/libs/dbbackup.php @@ -0,0 +1,227 @@ +'my_host', 'driver'=>'bd_type(mysql)', 'user'=>'db_user', 'password'=>'db_password', 'database'=>'db_name')); + */ + public function DBBackup($args){ + if(!$args['host']) $this->error[] = 'Parameter host missing'; + if(!$args['user']) $this->error[] = 'Parameter user missing'; + if(!isset($args['password'])) $this->error[] = 'Parameter password missing'; + if(!$args['database']) $this->error[] = 'Parameter database missing'; + if(!$args['driver']) $this->error[] = 'Parameter driver missing'; + + if(count($this->error)>0){ + return; + } + + $this->host = $args['host']; + $this->driver = $args['driver']; + $this->user = $args['user']; + $this->password = $args['password']; + $this->dbName = $args['database']; + + $this->final = 'CREATE DATABASE ' . $this->dbName.";\n\n"; + + if($this->host=='localhost'){ + // We have a little issue in unix systems when you set the host as localhost + $this->host = '127.0.0.1'; + } + $this->dsn = $this->driver.':host='.$this->host.';dbname='.$this->dbName; + + $this->connect(); + $this->getTables(); + $this->generate(); + } + + /** + * + * Call this function to get the database backup + * @example DBBackup::backup(); + */ + public function backup(){ + //return $this->final; + if(count($this->error)>0){ + return array('error'=>true, 'msg'=>$this->error); + } + return array('error'=>false, 'msg'=>$this->final); + } + + /** + * + * Generate backup string + * @uses Private use + */ + private function generate(){ + foreach ($this->tables as $tbl) { + $this->final .= '--Tabelle '.$tbl['name']." erstellen\n"; + $this->final .= $tbl['create'] . ";\n\n"; + $this->final .= '--Daten fuer die Tabelle '.$tbl['name']."\n"; + $this->final .= $tbl['data']."\n\n\n"; + } + $this->final .= '-- Ende'."\n\n"; + } + + /** + * + * Connect to a database + * @uses Private use + */ + private function connect(){ + try { + $this->handler = new PDO($this->dsn, $this->user, $this->password); + } catch (PDOException $e) { + $this->handler = null; + $this->error[] = $e->getMessage(); + return false; + } + } + + /** + * + * Get the list of tables + * @uses Private use + */ + private function getTables(){ + try { + $stmt = $this->handler->query('SHOW TABLES'); + $tbs = $stmt->fetchAll(); + $i=0; + foreach($tbs as $table){ + $this->tables[$i]['name'] = $this->db_prefix.$table[0]; + $this->tables[$i]['create'] = $this->getColumns($table[0]); + $this->tables[$i]['data'] = $this->getData($table[0]); + $i++; + } + unset($stmt); + unset($tbs); + unset($i); + + return true; + } catch (PDOException $e) { + $this->handler = null; + $this->error[] = $e->getMessage(); + return false; + } + } + + /** + * + * Get the list of Columns + * @uses Private use + */ + private function getColumns($tableName){ + try { + $stmt = $this->handler->query('SHOW CREATE TABLE '.$tableName); + $q = $stmt->fetchAll(); + $q[0][1] = preg_replace("/AUTO_INCREMENT=[\w]*./", '', $q[0][1]); + return $q[0][1]; + } catch (PDOException $e){ + $this->handler = null; + $this->error[] = $e->getMessage(); + return false; + } + } + + /** + * + * Get the insert data of tables + * @uses Private use + */ + private function getData($tableName){ + try { + $stmt = $this->handler->query('SELECT * FROM '.$tableName); + $q = $stmt->fetchAll(PDO::FETCH_NUM); + $data = ''; + foreach ($q as $pieces){ + foreach($pieces as &$value){ + //$value = htmlentities(addslashes($value)); + $value = addslashes($value); + } + $data .= 'INSERT INTO '. $tableName .' VALUES (\'' . implode('\',\'', $pieces) . '\');'."\n"; + } + return $data; + } catch (PDOException $e){ + $this->handler = null; + $this->error[] = $e->getMessage(); + return false; + } + } +} diff --git a/inc/libs/functions.php b/inc/libs/functions.php new file mode 100755 index 0000000..35d9367 --- /dev/null +++ b/inc/libs/functions.php @@ -0,0 +1,677 @@ +Zurück', $msg); + if ($typ == 'succes' || $typ == 'success') + { + if (!isset($msg)) $msg = 'Die Operation wurde erfolgreich durchgeführt.'; + return '
    ' . $msg . '
    '; + } elseif ($typ == 'fail') + { + if (!isset($msg)) $msg = 'Fehler. ' . $GLOBALS['texte'][2]; + return '
    ' . $msg . '
    '; + } else + { + return '
    ' . $msg . '
    '; + } +} + +//datum rückwärts +function datum_ruck($timestamp) +{ + $diff = time() - $timestamp; + if ($diff < 30) + { + return 'vor kurzem'; + } + if ($diff < 60) + { + return 'vor weniger als einer Minute'; + } + if ($diff < 3600) + { + return 'vor ' . round(($diff / 60)) . ' Minuten'; + } + if ($diff < 86400) + { + return 'vor ' . round((($diff / 60) / 60)) . ' Stunden'; + } + if ($diff < 2592000) + { + return 'vor ' . round(((($diff / 60) / 60) / 24)) . ' Tagen'; + } + if ($diff < 31104000) + { + return 'vor ' . round((((($diff / 60) / 60) / 24) / 12)) . ' Monaten'; + } + if ($diff > 30693600) + { + return 'vor ' . round(($diff / 31536000)) . ' Jahren'; + } + + return $diff; +} + +//nichtleeren ordner löschen +function rrmdir($dir) +{ + if (is_dir($dir)) + { + $objects = scandir($dir); + foreach ($objects as $object) + { + if ($object != "." && $object != "..") + { + if (filetype($dir . "/" . $object) == "dir") rrmdir($dir . "/" . $object); else unlink($dir . "/" . $object); + } + } + reset($objects); + return rmdir($dir); + } + else + { + return false; + } +} + +//Simple Image +class SimpleImage +{ + + var $image; + var $image_type; + + function load($filename) + { + + $image_info = getimagesize($filename); + $this->image_type = $image_info[2]; + if ($this->image_type == IMAGETYPE_JPEG) + { + + $this->image = imagecreatefromjpeg($filename); + } elseif ($this->image_type == IMAGETYPE_GIF) + { + + $this->image = imagecreatefromgif($filename); + } elseif ($this->image_type == IMAGETYPE_PNG) + { + + $this->image = imagecreatefrompng($filename); + } + } + + function save($filename, $image_type = IMAGETYPE_JPEG, $compression = 95, $permissions = null) + { + + if ($image_type == IMAGETYPE_JPEG) + { + imagejpeg($this->image, $filename, $compression); + } elseif ($image_type == IMAGETYPE_GIF) + { + + imagegif($this->image, $filename); + } elseif ($image_type == IMAGETYPE_PNG) + { + + imagepng($this->image, $filename); + } + if ($permissions != null) + { + + chmod($filename, $permissions); + } + } + + function output($image_type = IMAGETYPE_JPEG) + { + + if ($image_type == IMAGETYPE_JPEG) + { + imagejpeg($this->image); + } elseif ($image_type == IMAGETYPE_GIF) + { + + imagegif($this->image); + } elseif ($image_type == IMAGETYPE_PNG) + { + + imagepng($this->image); + } + } + + function getWidth() + { + + return imagesx($this->image); + } + + function getHeight() + { + + return imagesy($this->image); + } + + function resizeToHeight($height) + { + + $ratio = $height / $this->getHeight(); + $width = $this->getWidth() * $ratio; + $this->resize($width, $height); + } + + function resizeToWidth($width) + { + $ratio = $width / $this->getWidth(); + $height = $this->getheight() * $ratio; + $this->resize($width, $height); + } + + function scale($scale) + { + $width = $this->getWidth() * $scale / 100; + $height = $this->getheight() * $scale / 100; + $this->resize($width, $height); + } + + function resize($width, $height) + { + $new_image = imagecreatetruecolor($width, $height); + imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight()); + $this->image = $new_image; + } +} + +//Tinymce +function tinymce($css = '../../css/tinymce.css', $edit_area = '#editor') +{ + echo ' + '; +} + +function random($lange) +{ + $zahlen_und_buchstaben = array('a', 'A', 'b', 'B', 'c', 'C', 'd', 'D', 'e', 'E', 'f', 'F', 'G', 'g', 'h', 'H', 'i', 'I', 'j', 'J', 'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N', 'o', 'O', 'p', 'P', 'q', 'Q', 'r', 'R', 's', 'S', 't', 'T', 'u', 'U', 'v', 'V', 'w', 'W', 'x', 'X', 'y', 'Y', 'z', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'); + for ($i = 0, $random = ''; $i < $lange; $i++) + { + $random .= $zahlen_und_buchstaben[array_rand($zahlen_und_buchstaben)]; + } + return $random; +} + +function calc_filesize($bytes) +{ + $symbol = ' B '; + if ($bytes > 1024) + { + $symbol = ' KB'; + $bytes /= 1024; + } + if ($bytes > 1024) + { + $symbol = ' MB'; + $bytes /= 1024; + } + if ($bytes > 1024) + { + $symbol = ' GB'; + $bytes /= 1024; + } + $bytes = round($bytes, 2); + return $bytes . $symbol; +} + +//User eingeloggt? +function is_loggedin() +{ + if(isset($_SESSION['user'], $_SESSION['token'])) + { + + $GLOBALS['db']->setCol('system_loggedin'); + $GLOBALS['db']->data['token'] = $_SESSION['token']; + $GLOBALS['db']->data['user'] = $_SESSION['userid']; + $GLOBALS['db']->get(); + if(isset($GLOBALS['db']->data[0]['token'])) + { + $token = $GLOBALS['db']->data[0]['token']; + $GLOBALS['db']->clear(); + if ($token != '') + { + if ($token == $_SESSION['token']) + { + //Session nach 30 min inaktivität löschen + if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 1800)) + { + $GLOBALS['db']->setCol('system_loggedin'); + $GLOBALS['db']->data['token'] = $_SESSION['token']; + $GLOBALS['db']->data['user'] = $_SESSION['userid']; + $GLOBALS['db']->delete(); + + // last request was more than 30 minutes ago + session_unset(); // unset $_SESSION variable for the run-time + session_destroy(); // destroy session data in storage + + return false; + } + else + { + $_SESSION['LAST_ACTIVITY'] = time(); + return true; + } + } + else + { + return false; + } + } + else + { + return false; + } + } + else + { + return false; + } + } + else + { + return false; + } +} + +//Print header +function printHeader($title) +{ + if (!is_loggedin()) + { + $title = $GLOBALS['lang']->get('login'); + } + + // + echo ' + + + + ' . $title . ' | '.$GLOBALS['lang']->get('admin_title').' | ' . $GLOBALS['MCONF']['title'] . ' + + + + + +'; + if (is_loggedin()) + { + echo '
    + ' . $title . ' + +
    + + + + +
    '; + } + else + { + ?> + + + + 0 && $upload_max < $max_size) { + $max_size = $upload_max; + } + } + } + return $max_size; +} + +function parse_size($size) +{ + $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size. + $size = preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size. + if ($unit) + { + // Find the position of the unit in the ordered string which is the power of magnitude to multiply a kilobyte by. + return round($size * pow(1024, stripos('bkmgtpezy', $unit[0]))); + } else + { + return round($size); + } +} + +//Permissions +function hasPerm($permkey, $scope = '') +{ + if (isset($_SESSION['userid'])) + { + if($_SESSION['lvl'] == 1) + { + return true; + } + else + { + $scopeUri = ''; + $pos = strpos($_SERVER['REQUEST_URI'], '/apps/'); + if ($pos !== false) + { + //$scopeUri = '../'; + $rel = explode('/', str_replace($GLOBALS['MCONF']['home_uri'] . 'apps/', '', $_SERVER['REQUEST_URI'])); + $count = count($rel); + $count = $count - 1; + + $i = 1; + while ($i < $count) + { + $scopeUri .= '../'; + $i++; + } + + } + + if($scope == 'System') $scopeUri .= '../admin/'; + + //echo $moduluri; + + if (file_exists($scopeUri.'permissions.json')) + { + $perms = json_decode(file_get_contents($scopeUri.'permissions.json'), true); + $permsTotal = []; + foreach ($perms['permissions'] as $perm) + { + $permsTotal[] = $perm['key']; + } + + if (in_array($permkey, $permsTotal)) + { + $GLOBALS['db']->setCol('system_roles'); + $GLOBALS['db']->data['id'] = $_SESSION['lvl']; + $GLOBALS['db']->get(); + if (isset($GLOBALS['db']->data[0])) + { + $perms = json_decode($GLOBALS['db']->data[0]['permissions'], true); + + $perms_f = []; + $pos = strpos($_SERVER['REQUEST_URI'], '/apps/'); + if ($pos !== false) + { + require $scopeUri . 'config.php'; + if(array_key_exists($_CONF['mod_name'], $perms)) $perms_f = $perms[$_CONF['mod_name']]; + } + else + { + $perms_f = $perms['System']; + } + if (in_array($permkey, $perms_f)) + { + return true; + } + else + { + return false; + } + } else + { + return false; + } + } else + { + return false; + } + } else + { + return false; + } + } + } + else + { + return false; + } +} + +//Get Username based on its ID +function getUserByID($userid) +{ + if($userid == $_SESSION['userid']) + { + return $_SESSION['user']; + } + else + { + $GLOBALS['db']->setCol('system_admins'); + $GLOBALS['db']->data['id'] = $userid; + $GLOBALS['db']->get(); + if (isset($GLOBALS['db']->data[0])) + { + return $GLOBALS['db']->data[0]['username']; + } + else + { + return $userid; + } + } +} + +//Test mail +function smail($mailaddr, $subject, $message, $header) +{ + $mail = 'To: '.$mailaddr."\n"; + $mail .= 'Subject: '.$subject."\n"; + $mail .= $header."\n\n"; + $mail .= $message; + + if(file_put_contents('mail_'.$mailaddr.'_'.time().'.txt', $mail)) + { + return true; + } + else + { + return false; + } +} +?> \ No newline at end of file diff --git a/inc/libs/lang.class.php b/inc/libs/lang.class.php new file mode 100755 index 0000000..6f561c3 --- /dev/null +++ b/inc/libs/lang.class.php @@ -0,0 +1,126 @@ +default = $default; + $this->lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); + $this->langfiles = []; + } + + //Change the current Language + function setCurrentLang($lang) + { + $this->lang = $lang; + } + + //Get Langfiles by Folder + public function setLangFolder($folder) + { + //If langfolder exists... + if (file_exists($folder) && is_dir($folder)) + { + //Loop through it... + if ($handle = opendir($folder)) + { + while (false !== ($langfile = readdir($handle))) + { + if (strpos($langfile, 'lang') !== false) + { + //and put all langfiles in an array + $lang = []; + require $folder . $langfile; + if (isset($this->langfiles[$lang['__LangCode__']]['langstrings'])) $langstrings = $this->langfiles[$lang['__LangCode__']]['langstrings']; + foreach ($lang as $langKey => $langString) + { + $langstrings[$langKey] = $langString; + } + + //echo '
    '.print_r($langstrings, true).'
    '; + $this->langfiles[$lang['__LangCode__']] = ['Lang' => $lang['__Lang__'], 'countrycode' => $lang['__Countrycode__'], 'file' => $folder . $langfile, 'langstrings' => $langstrings]; + } + } + closedir($handle); + } + } + } + + //Get Langfiles by direct declaration + public function setLang($langfile, $langC) + { + $lang = []; + require $langfile; + if (isset($this->langfiles[$lang['__LangCode__']]['langstrings'])) $langstrings = $this->langfiles[$lang['__LangCode__']]['langstrings']; + foreach ($lang as $langKey => $langString) + { + $langstrings[$langKey] = $langString; + } + + $this->langfiles[$lang['__LangCode__']] = ['Lang' => $lang['__Lang__'], 'countrycode' => $lang['__Countrycode__'], 'file' => $langfile, 'langstrings' => $langstrings]; + } + + //Get all available languages + public function getAll() + { + return $this->langfiles; + } + + //Get langstrings + public function get($identifier) + { + //If Langueage exists... + if (array_key_exists($this->lang, $this->langfiles)) + { + $array_key = array_search($identifier, $this->langfiles[$this->default]['langstrings']); + //...and a value for the corresponding key... + if (array_key_exists($identifier, $this->langfiles[$this->lang]['langstrings'])) + { + //Output it + return $this->langfiles[$this->lang]['langstrings'][$identifier]; + }//...or find String by the defaults languagestring + elseif($array_key !== false) + { + //Output it + return $this->langfiles[$this->lang]['langstrings'][$array_key]; + } + else + { + //If not, fallback to the default language + if (array_key_exists($identifier, $this->langfiles[$this->default]['langstrings'])) + { + return $this->langfiles[$this->default]['langstrings'][$identifier]; + } + else + { + //If this doesn't exists, return the identifier + return $identifier; + } + } + } + //Fallback to the default language + else + { + if (array_key_exists($identifier, $this->langfiles[$this->default]['langstrings'])) + { + return $this->langfiles[$this->default]['langstrings'][$identifier]; + } + else + { + //If this doesn't exists, return the identifier + return $identifier; + } + } + } + + //Set Langstrings + function set($string, $identifier, $lang) + { + $this->langfiles[$lang]['langstrings'][$identifier] = $string; + } +} \ No newline at end of file diff --git a/inc/libs/multicookie.php b/inc/libs/multicookie.php new file mode 100755 index 0000000..88f7c2a --- /dev/null +++ b/inc/libs/multicookie.php @@ -0,0 +1,109 @@ +setValue('test', "gedöns");//Speichert wert "gedöns" mit key "test ab, um ihn später wiederzufinden + * $cookie->setValue('testMitArray', ['booo', 'easaf', 'Lorem' => 'IUpsum']); + * $cookie->updateCookie();//Updated den Cookie, wenn er noch nicht existerite wird er angelegt, ansonsten werden die einzelnen Werte überschrieben. Gibt true oder false zurück. + * $cookie->getAllValues(); //Gibt alle Werte des Cookies als Array zuück + * $cookie->getValue('test'); // Hohlt den Wert, welcher dem Key "test" zugeordnet ist + * $cookie->isValue($key); // Gibt true zurück, wenn für $key ein Wert existiert + * $cookie->deleteCookie(); // Löscht den Cookie. Gibt true oder false zurück. + * + */ + +class multicookie +{ + private $cookieContent; + private $cookieName; + private $cookieTime; + + //Initialiesierung + function __construct($cookie = 'multicookie', $time = 2592000) + { + $this->cookieName = $cookie; + $this->cookieContent = [$cookie => []]; + if(isset($_COOKIE[$this->cookieName])) + { + $this->cookieContent = json_decode($_COOKIE[$this->cookieName], true); + } + $this->cookieTime = time() + $time; + } + + //Vars einpflegen + public function setValue($key, $val) + { + $this->cookieContent[$this->cookieName][$key] = $val; + } + + //Vars holen + public function getValue($key) + { + if(isset($_COOKIE[$this->cookieName])) + { + $vars = json_decode($_COOKIE[$this->cookieName], true); + foreach ($vars[$this->cookieName] as $k => $v) + { + if ($k == $key) + { + return $v; + } + } + } + else + { + return null; + } + } + + //Existiert ein Wert? + public function isValue($key) + { + if($this->getValue($key) === null) + { + return false; + } + else + { + return true; + } + } + + //Alle vars ausgeben + public function getAllValues() + { + if(isset($_COOKIE[$this->cookieName])) + { + $varsAlle = []; + $vars = json_decode($_COOKIE[$this->cookieName], true); + foreach ($vars[$this->cookieName] as $k => $v) + { + $varsAlle[$k] = $v; + } + return $varsAlle; + } + else + { + return null; + } + } + + //Cookie Löschen + public function deleteCookie() + { + return setcookie($this->cookieName, false, time() - 30759000, '/'); + } + + //Den Cookie updaten/setzen + public function updateCookie() + { + //$this->deleteCookie(); + return setcookie($this->cookieName, json_encode($this->cookieContent), $this->cookieTime, '/'); + } +} + +?> \ No newline at end of file diff --git a/inc/libs/password.php b/inc/libs/password.php new file mode 100755 index 0000000..e8ec028 --- /dev/null +++ b/inc/libs/password.php @@ -0,0 +1,279 @@ + + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @copyright 2012 The Authors + */ + +namespace { + +if (!defined('PASSWORD_DEFAULT')) { + + define('PASSWORD_BCRYPT', 1); + define('PASSWORD_DEFAULT', PASSWORD_BCRYPT); + + /** + * Hash the password using the specified algorithm + * + * @param string $password The password to hash + * @param int $algo The algorithm to use (Defined by PASSWORD_* constants) + * @param array $options The options for the algorithm to use + * + * @return string|false The hashed password, or false on error. + */ + function password_hash($password, $algo, array $options = array()) { + if (!function_exists('crypt')) { + trigger_error("Crypt must be loaded for password_hash to function", E_USER_WARNING); + return null; + } + if (!is_string($password)) { + trigger_error("password_hash(): Password must be a string", E_USER_WARNING); + return null; + } + if (!is_int($algo)) { + trigger_error("password_hash() expects parameter 2 to be long, " . gettype($algo) . " given", E_USER_WARNING); + return null; + } + $resultLength = 0; + switch ($algo) { + case PASSWORD_BCRYPT: + // Note that this is a C constant, but not exposed to PHP, so we don't define it here. + $cost = 10; + if (isset($options['cost'])) { + $cost = $options['cost']; + if ($cost < 4 || $cost > 31) { + trigger_error(sprintf("password_hash(): Invalid bcrypt cost parameter specified: %d", $cost), E_USER_WARNING); + return null; + } + } + // The length of salt to generate + $raw_salt_len = 16; + // The length required in the final serialization + $required_salt_len = 22; + $hash_format = sprintf("$2y$%02d$", $cost); + // The expected length of the final crypt() output + $resultLength = 60; + break; + default: + trigger_error(sprintf("password_hash(): Unknown password hashing algorithm: %s", $algo), E_USER_WARNING); + return null; + } + $salt_requires_encoding = false; + if (isset($options['salt'])) { + switch (gettype($options['salt'])) { + case 'NULL': + case 'boolean': + case 'integer': + case 'double': + case 'string': + $salt = (string) $options['salt']; + break; + case 'object': + if (method_exists($options['salt'], '__tostring')) { + $salt = (string) $options['salt']; + break; + } + case 'array': + case 'resource': + default: + trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING); + return null; + } + if (PasswordCompat\binary\_strlen($salt) < $required_salt_len) { + trigger_error(sprintf("password_hash(): Provided salt is too short: %d expecting %d", PasswordCompat\binary\_strlen($salt), $required_salt_len), E_USER_WARNING); + return null; + } elseif (0 == preg_match('#^[a-zA-Z0-9./]+$#D', $salt)) { + $salt_requires_encoding = true; + } + } else { + $buffer = ''; + $buffer_valid = false; + if (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) { + $buffer = mcrypt_create_iv($raw_salt_len, MCRYPT_DEV_URANDOM); + if ($buffer) { + $buffer_valid = true; + } + } + if (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) { + $buffer = openssl_random_pseudo_bytes($raw_salt_len); + if ($buffer) { + $buffer_valid = true; + } + } + if (!$buffer_valid && @is_readable('/dev/urandom')) { + $f = fopen('/dev/urandom', 'r'); + $read = PasswordCompat\binary\_strlen($buffer); + while ($read < $raw_salt_len) { + $buffer .= fread($f, $raw_salt_len - $read); + $read = PasswordCompat\binary\_strlen($buffer); + } + fclose($f); + if ($read >= $raw_salt_len) { + $buffer_valid = true; + } + } + if (!$buffer_valid || PasswordCompat\binary\_strlen($buffer) < $raw_salt_len) { + $bl = PasswordCompat\binary\_strlen($buffer); + for ($i = 0; $i < $raw_salt_len; $i++) { + if ($i < $bl) { + $buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255)); + } else { + $buffer .= chr(mt_rand(0, 255)); + } + } + } + $salt = $buffer; + $salt_requires_encoding = true; + } + if ($salt_requires_encoding) { + // encode string with the Base64 variant used by crypt + $base64_digits = + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + $bcrypt64_digits = + './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + + $base64_string = base64_encode($salt); + $salt = strtr(rtrim($base64_string, '='), $base64_digits, $bcrypt64_digits); + } + $salt = PasswordCompat\binary\_substr($salt, 0, $required_salt_len); + + $hash = $hash_format . $salt; + + $ret = crypt($password, $hash); + + if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != $resultLength) { + return false; + } + + return $ret; + } + + /** + * Get information about the password hash. Returns an array of the information + * that was used to generate the password hash. + * + * array( + * 'algo' => 1, + * 'algoName' => 'bcrypt', + * 'options' => array( + * 'cost' => 10, + * ), + * ) + * + * @param string $hash The password hash to extract info from + * + * @return array The array of information about the hash. + */ + function password_get_info($hash) { + $return = array( + 'algo' => 0, + 'algoName' => 'unknown', + 'options' => array(), + ); + if (PasswordCompat\binary\_substr($hash, 0, 4) == '$2y$' && PasswordCompat\binary\_strlen($hash) == 60) { + $return['algo'] = PASSWORD_BCRYPT; + $return['algoName'] = 'bcrypt'; + list($cost) = sscanf($hash, "$2y$%d$"); + $return['options']['cost'] = $cost; + } + return $return; + } + + /** + * Determine if the password hash needs to be rehashed according to the options provided + * + * If the answer is true, after validating the password using password_verify, rehash it. + * + * @param string $hash The hash to test + * @param int $algo The algorithm used for new password hashes + * @param array $options The options array passed to password_hash + * + * @return boolean True if the password needs to be rehashed. + */ + function password_needs_rehash($hash, $algo, array $options = array()) { + $info = password_get_info($hash); + if ($info['algo'] != $algo) { + return true; + } + switch ($algo) { + case PASSWORD_BCRYPT: + $cost = isset($options['cost']) ? $options['cost'] : 10; + if ($cost != $info['options']['cost']) { + return true; + } + break; + } + return false; + } + + /** + * Verify a password against a hash using a timing attack resistant approach + * + * @param string $password The password to verify + * @param string $hash The hash to verify against + * + * @return boolean If the password matches the hash + */ + function password_verify($password, $hash) { + if (!function_exists('crypt')) { + trigger_error("Crypt must be loaded for password_verify to function", E_USER_WARNING); + return false; + } + $ret = crypt($password, $hash); + if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != PasswordCompat\binary\_strlen($hash) || PasswordCompat\binary\_strlen($ret) <= 13) { + return false; + } + + $status = 0; + for ($i = 0; $i < PasswordCompat\binary\_strlen($ret); $i++) { + $status |= (ord($ret[$i]) ^ ord($hash[$i])); + } + + return $status === 0; + } +} + +} + +namespace PasswordCompat\binary { + /** + * Count the number of bytes in a string + * + * We cannot simply use strlen() for this, because it might be overwritten by the mbstring extension. + * In this case, strlen() will count the number of *characters* based on the internal encoding. A + * sequence of bytes might be regarded as a single multibyte character. + * + * @param string $binary_string The input string + * + * @internal + * @return int The number of bytes + */ + function _strlen($binary_string) { + if (function_exists('mb_strlen')) { + return mb_strlen($binary_string, '8bit'); + } + return strlen($binary_string); + } + + /** + * Get a substring based on byte limits + * + * @see _strlen() + * + * @param string $binary_string The input string + * @param int $start + * @param int $length + * + * @internal + * @return string The substring + */ + function _substr($binary_string, $start, $length) { + if (function_exists('mb_substr')) { + return mb_substr($binary_string, $start, $length, '8bit'); + } + return substr($binary_string, $start, $length); + } + +} diff --git a/inc/page.php b/inc/page.php new file mode 100755 index 0000000..1322808 --- /dev/null +++ b/inc/page.php @@ -0,0 +1,118 @@ +url = $url; + } + + public function getUrl() + { + //echo parse_url($this->url, PHP_URL_PATH); + //print_r($_GET); + return parse_url($this->url, PHP_URL_PATH); + } + + //baseUrl + public function setBaseUrl($baseUrl) + { + $this->baseUrl = $baseUrl; + } + + public function getBaseUrl() + { + return $this->baseUrl; + } + + //content + public function setContent($content) + { + $this->content .= $content; + } + + public function getContent() + { + return $this->content; + } + + //responseCode + public function setResponseCode($responseCode) + { + $this->responseCode = $responseCode; + } + + public function getResponseCode() + { + return $this->responseCode; + } + + ///title + public function setTitle($title) + { + $this->title = $title; + } + + public function getTitle() + { + return $this->title; + } + + //templatekram + /*public function assign($key, $value, $add = false) + { + if (array_key_exists($key, $this->tplAssign) && $add) + { + $this->tplAssign[$key] .= $value; + }elseif (array_key_exists($key, $this->tplAssign) && !$add) + { + $this->tplAssign[$key] = $value; + } elseif (!array_key_exists($key, $this->tplAssign)) + { + $this->tplAssign[$key] = $value; + } + }*/ + + public function getTplAssign() + { + return $this->tplAssign; + } + + //Template Parsen + public function setTemplateFile($templateFile) + { + $this->templateFile = $templateFile; + } + + public function parseTpl() + { + $tplFile = file_get_contents($this->templateFile); + $tplKeys = $this->getTplAssign(); + function page_key($key) + { + $tplKeys = $GLOBALS['page']->getTplAssign(); + $key_tpl = $key[0]; + $key_tpl = str_replace('{', '', $key_tpl); + $key_tpl = str_replace('}', '', $key_tpl); + if (array_key_exists($key_tpl, $tplKeys)) + { + return $tplKeys[$key_tpl]; + } + else + { + return ''; + } + } + + echo preg_replace_callback('/{[A-Za-z0-9_:,\-\|]+}/', 'page_key', $tplFile); + } +} \ No newline at end of file diff --git a/index.php b/index.php new file mode 100755 index 0000000..fc17403 --- /dev/null +++ b/index.php @@ -0,0 +1,102 @@ +caching = false; + $page->error_reporting = E_ALL & ~E_NOTICE; + + //Set Url + $page->setUrl(str_replace($MCONF['home_uri'], '', $_SERVER['REQUEST_URI'])); + $base = explode('/', str_replace($MCONF['home_uri'], '', $_SERVER['REQUEST_URI'])); + $page->setBaseUrl('/'); + if(count($base)>1) + { + $page->setBaseUrl($base[0].'/'); + } + $page->setResponseCode(404); + + //Search apps and execute them if necessary + $appdir = 'apps/'; + if ($handle = opendir($appdir)) + { + while (false !== ($app = readdir($handle))) + { + if ($app != "." && $app != ".." && !is_file($appdir . $app)) + { + $appUri = $appdir.$app; + if (file_exists($appUri.'/config.php')) + { + require $appUri.'/config.php'; + if(isset($_CONF['type']))//typ vorhanden? + { + if($_CONF['type'] == 'page')//Seite, die inhalte ausgibt + { + if(isset($_CONF['base_url_file'])) + { + if($_CONF['base_url'] == $page->getUrl()) + { + require $appUri.'/' . $_CONF['base_url_file']; + } + } + if(isset($_CONF['base_url']) && file_exists($appUri.'/' . $_CONF['base_file'])) + { + if($_CONF['base_url'] == $page->getBaseUrl()) + { + require $appUri.'/' . $_CONF['base_file']; + } + } + } + if($_CONF['type'] == 'static' && isset($_CONF['base_file']) && file_exists($appUri.'/'.$_CONF['base_file'])) + { + require $appUri.'/'.$_CONF['base_file']; + } + } + $_CONF = []; + } + } + } + closedir($handle); + } + + if($page->getResponseCode() == 404) + { + $page->setTitle('404'); + $page->setContent(file_get_contents('inc/System/404.txt')); + } + + //Copyright bauen + $founded = date('Y', filemtime('inc/config.php')); + $copy = $founded; + if($founded != date('Y')) + { + $copy = $founded.' - '.date('Y'); + } + $page->assign('copyright', $copy); + + // dat ganze ausgeben + http_response_code($page->getresponseCode()); + $page->assign($MCONF['tpl_title'], $page->getTitle(). ' | ' . $MCONF['title']); + $page->assign($MCONF['tpl_content'], $page->getContent()); + $page->assign($MCONF['tpl_webUri'], $MCONF['web_uri']); + $page->display($MCONF['template']); + } +} +else +{ + header('Location: admin/install.php'); +} \ No newline at end of file diff --git a/robots.txt b/robots.txt new file mode 100755 index 0000000..0b02ff9 --- /dev/null +++ b/robots.txt @@ -0,0 +1,7 @@ +User-Agent: * +Disallow: /admin/ +Disallow: /apps/ +Disallow: /cache/ +Disallow: /Files/ +Disallow: /inc/ +Disallow: /templates_c/ \ No newline at end of file