Initial commit
Also available on GetSimple repository
17
.gitattributes
vendored
@ -1,17 +0,0 @@
|
|||||||
# Auto detect text files and perform LF normalization
|
|
||||||
* text=auto
|
|
||||||
|
|
||||||
# Custom for Visual Studio
|
|
||||||
*.cs diff=csharp
|
|
||||||
|
|
||||||
# Standard to msysgit
|
|
||||||
*.doc diff=astextplain
|
|
||||||
*.DOC diff=astextplain
|
|
||||||
*.docx diff=astextplain
|
|
||||||
*.DOCX diff=astextplain
|
|
||||||
*.dot diff=astextplain
|
|
||||||
*.DOT diff=astextplain
|
|
||||||
*.pdf diff=astextplain
|
|
||||||
*.PDF diff=astextplain
|
|
||||||
*.rtf diff=astextplain
|
|
||||||
*.RTF diff=astextplain
|
|
43
.gitignore
vendored
@ -1,43 +0,0 @@
|
|||||||
# Windows image file caches
|
|
||||||
Thumbs.db
|
|
||||||
ehthumbs.db
|
|
||||||
|
|
||||||
# Folder config file
|
|
||||||
Desktop.ini
|
|
||||||
|
|
||||||
# Recycle Bin used on file shares
|
|
||||||
$RECYCLE.BIN/
|
|
||||||
|
|
||||||
# Windows Installer files
|
|
||||||
*.cab
|
|
||||||
*.msi
|
|
||||||
*.msm
|
|
||||||
*.msp
|
|
||||||
|
|
||||||
# Windows shortcuts
|
|
||||||
*.lnk
|
|
||||||
|
|
||||||
# =========================
|
|
||||||
# Operating System Files
|
|
||||||
# =========================
|
|
||||||
|
|
||||||
# OSX
|
|
||||||
# =========================
|
|
||||||
|
|
||||||
.DS_Store
|
|
||||||
.AppleDouble
|
|
||||||
.LSOverride
|
|
||||||
|
|
||||||
# Thumbnails
|
|
||||||
._*
|
|
||||||
|
|
||||||
# Files that might appear on external disk
|
|
||||||
.Spotlight-V100
|
|
||||||
.Trashes
|
|
||||||
|
|
||||||
# Directories potentially created on remote AFP share
|
|
||||||
.AppleDB
|
|
||||||
.AppleDesktop
|
|
||||||
Network Trash Folder
|
|
||||||
Temporary Items
|
|
||||||
.apdisk
|
|
61
.htaccess
@ -1,61 +0,0 @@
|
|||||||
#
|
|
||||||
# GetSimple CMS htaccess ROOT file
|
|
||||||
# apache 2.4
|
|
||||||
#
|
|
||||||
|
|
||||||
# The following require certain allow overrides, if getting 500 error comment them out one by one
|
|
||||||
# can be resolved in apache httpd.conf to ensure security alternatives
|
|
||||||
|
|
||||||
# override charset
|
|
||||||
AddDefaultCharset UTF-8
|
|
||||||
|
|
||||||
# prevent directory listings
|
|
||||||
Options -Indexes
|
|
||||||
|
|
||||||
# Follow symbolink links, This is required for rewrites on some hosts
|
|
||||||
Options +FollowSymLinks
|
|
||||||
|
|
||||||
# Set the default handler.
|
|
||||||
DirectoryIndex index.php
|
|
||||||
|
|
||||||
# blocks direct access to the XML files - they hold all the data!
|
|
||||||
<Files ~ "\.xml$">
|
|
||||||
<IfModule !mod_authz_core.c>
|
|
||||||
Deny from all
|
|
||||||
</IfModule>
|
|
||||||
<IfModule mod_access_compat.c>
|
|
||||||
Deny from all
|
|
||||||
</IfModule>
|
|
||||||
<IfModule mod_authz_core.c>
|
|
||||||
<IfModule !mod_access_compat.c>
|
|
||||||
Require all denied
|
|
||||||
</IfModule>
|
|
||||||
</IfModule>
|
|
||||||
</Files>
|
|
||||||
|
|
||||||
<Files sitemap.xml>
|
|
||||||
<IfModule !mod_authz_core.c>
|
|
||||||
Allow from all
|
|
||||||
</IfModule>
|
|
||||||
<IfModule mod_access_compat.c>
|
|
||||||
Allow from all
|
|
||||||
</IfModule>
|
|
||||||
<IfModule mod_authz_core.c>
|
|
||||||
<IfModule !mod_access_compat.c>
|
|
||||||
Require all granted
|
|
||||||
</IfModule>
|
|
||||||
</IfModule>
|
|
||||||
</Files>
|
|
||||||
|
|
||||||
# handle rewrites for fancy urls
|
|
||||||
<IfModule mod_rewrite.c>
|
|
||||||
RewriteEngine on
|
|
||||||
|
|
||||||
# Usually RewriteBase is just '/', but
|
|
||||||
# replace it with your subdirectory path
|
|
||||||
RewriteBase /GetSimpleThemes/lcars/
|
|
||||||
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
|
||||||
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
|
|
||||||
</IfModule>
|
|
@ -1,58 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* GetSimple API Handler
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage API
|
|
||||||
*/
|
|
||||||
include('inc/common.php');
|
|
||||||
include('inc/api.class.php');
|
|
||||||
|
|
||||||
#step 1 - check for post
|
|
||||||
if (empty($_POST)) exit;
|
|
||||||
if (!defined('GSEXTAPI')) exit;
|
|
||||||
|
|
||||||
#step 1 - check post for data
|
|
||||||
if (!isset($_POST['data'])) {
|
|
||||||
$message = array('status' => 'error', 'message' => i18n_r('API_ERR_MISSINGPARAM'));
|
|
||||||
echo json_encode($message);
|
|
||||||
exit;
|
|
||||||
};
|
|
||||||
|
|
||||||
#step 2 - setup request
|
|
||||||
$in = simplexml_load_string($_POST['data'], 'SimpleXMLExtended', LIBXML_NOCDATA);
|
|
||||||
$request = new API_Request();
|
|
||||||
$request->add_data($in);
|
|
||||||
|
|
||||||
#step 3 - verify a compatible method was provided
|
|
||||||
$methods = array('page_read', 'page_save', 'all_pages_read', 'all_files_read', 'file_upload', 'settings_read' );
|
|
||||||
if (!in_array($in->method, $methods)) {
|
|
||||||
$message = array('status' => 'error', 'message' => sprintf(i18n_r('API_ERR_BADMETHOD'), $in->method));
|
|
||||||
echo json_encode($message);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
#step 4 - process request
|
|
||||||
$method = (string)$in->method;
|
|
||||||
echo call_user_func(array($request, $method), '');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
exit;
|
|
||||||
|
|
||||||
/*
|
|
||||||
----------------------------
|
|
||||||
EXAMPLE XML FILE COMING IN
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
<request>
|
|
||||||
<key>ABCDE12345</key>
|
|
||||||
<method>page_read</method>
|
|
||||||
<data>
|
|
||||||
<field1></field1>
|
|
||||||
<field2></field2>
|
|
||||||
<field3></field3>
|
|
||||||
</data>
|
|
||||||
</request>
|
|
||||||
|
|
||||||
*/
|
|
Before Width: | Height: | Size: 1.6 KiB |
@ -1,98 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Archive
|
|
||||||
*
|
|
||||||
* Displays and starts the website archives
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Backups
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
|
|
||||||
// Include common.php
|
|
||||||
include('inc/common.php');
|
|
||||||
|
|
||||||
// Variable Settings
|
|
||||||
login_cookie_check();
|
|
||||||
$table = '';
|
|
||||||
|
|
||||||
// if a backup needs to be created
|
|
||||||
if(isset($_GET['do'])) {
|
|
||||||
|
|
||||||
// check for csrf
|
|
||||||
if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) {
|
|
||||||
$nonce = $_GET['nonce'];
|
|
||||||
if(!check_nonce($nonce, "create")) {
|
|
||||||
die("CSRF detected!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exec_action('archive-backup');
|
|
||||||
redirect('zip.php?s='.$SESSIONHASH);
|
|
||||||
}
|
|
||||||
|
|
||||||
// if a backup has just been created
|
|
||||||
if(isset($_GET['done'])) {
|
|
||||||
$success = i18n_r('SUCC_WEB_ARCHIVE');
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($_GET['nozip'])) {
|
|
||||||
$error = i18n_r('NO_ZIPARCHIVE'). ' - <a href="health-check.php">'.i18n_r('WEB_HEALTH_CHECK').'</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
get_template('header', cl($SITENAME).' » '.i18n_r('BAK_MANAGEMENT').' » '.i18n_r('WEBSITE_ARCHIVES'));
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php include('template/include-nav.php'); ?>
|
|
||||||
|
|
||||||
<div class="bodycontent clearfix">
|
|
||||||
|
|
||||||
<div id="maincontent">
|
|
||||||
<div class="main" >
|
|
||||||
<h3 class="floated"><?php i18n('WEBSITE_ARCHIVES');?></h3>
|
|
||||||
<div class="edit-nav clearfix" >
|
|
||||||
<a id="waittrigger" href="archive.php?do&nonce=<?php echo get_nonce("create"); ?>" accesskey="<?php echo find_accesskey(i18n_r('ASK_CREATE_ARC'));?>" title="<?php i18n('CREATE_NEW_ARC');?>" ><?php i18n('ASK_CREATE_ARC');?></a>
|
|
||||||
</div>
|
|
||||||
<p style="display:none" id="waiting" ><?php i18n('CREATE_ARC_WAIT');?></p>
|
|
||||||
|
|
||||||
<table class="highlight paginate">
|
|
||||||
<tr><th><?php i18n('ARCHIVE_DATE'); ?></th><th style="text-align:right;" ><?php i18n('FILE_SIZE'); ?></th><th></th></tr>
|
|
||||||
<?php
|
|
||||||
$count="0";
|
|
||||||
$path = tsl(GSBACKUPSPATH .'zip/');
|
|
||||||
|
|
||||||
$filenames = getFiles($path);
|
|
||||||
|
|
||||||
natsort($filenames);
|
|
||||||
rsort($filenames);
|
|
||||||
|
|
||||||
foreach ($filenames as $file) {
|
|
||||||
if($file[0] != "." ) {
|
|
||||||
$timestamp = explode('_', $file);
|
|
||||||
$name = lngDate($timestamp[0]);
|
|
||||||
clearstatcache();
|
|
||||||
$ss = stat($path . $file);
|
|
||||||
$size = fSize($ss['size']);
|
|
||||||
echo '<tr>
|
|
||||||
<td><a title="'.i18n_r('DOWNLOAD').' '. $name .'" href="download.php?file='. $path . $file .'&nonce='.get_nonce("archive", "download.php").'">'.$name .'</a></td>
|
|
||||||
<td style="width:70px;text-align:right;" ><span>'.$size.'</span></td>
|
|
||||||
<td class="delete" ><a class="delconfirm" title="'.i18n_r('DELETE_ARCHIVE').': '. $name .'?" href="deletefile.php?zip='. $file .'&nonce='.get_nonce("delete", "deletefile.php").'">×</a></td>
|
|
||||||
</tr>';
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
</table>
|
|
||||||
<p><em><b><span id="pg_counter"><?php echo $count; ?></span></b> <?php i18n('TOTAL_ARCHIVES');?></em></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="sidebar" >
|
|
||||||
<?php include('template/sidebar-backups.php'); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php get_template('footer'); ?>
|
|
@ -1,169 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Edit Backups
|
|
||||||
*
|
|
||||||
* View the current backup of a given page
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Backups
|
|
||||||
*/
|
|
||||||
|
|
||||||
# setup
|
|
||||||
$load['plugin'] = true;
|
|
||||||
include('inc/common.php');
|
|
||||||
$userid = login_cookie_check();
|
|
||||||
|
|
||||||
# get page url to display
|
|
||||||
if ($_GET['id'] != '') {
|
|
||||||
$id = $_GET['id'];
|
|
||||||
$file = $id .".bak.xml";
|
|
||||||
$path = GSBACKUPSPATH .'pages/';
|
|
||||||
|
|
||||||
$data = getXML($path . $file);
|
|
||||||
$title = htmldecode($data->title);
|
|
||||||
$pubDate = $data->pubDate;
|
|
||||||
$parent = $data->parent;
|
|
||||||
$metak = htmldecode($data->meta);
|
|
||||||
$metad = htmldecode($data->metad);
|
|
||||||
$url = $data->url;
|
|
||||||
$content = htmldecode($data->content);
|
|
||||||
$private = $data->private;
|
|
||||||
$template = $data->template;
|
|
||||||
$menu = htmldecode($data->menu);
|
|
||||||
$menuStatus = $data->menuStatus;
|
|
||||||
$menuOrder = $data->menuOrder;
|
|
||||||
} else {
|
|
||||||
redirect('backups.php?upd=bak-err');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($private != '' ) { $private = '<span style="color:#cc0000">('.i18n_r('PRIVATE_SUBTITLE').')</span>'; } else { $private = ''; }
|
|
||||||
if ($menuStatus == '' ) { $menuStatus = i18n_r('NO'); } else { $menuStatus = i18n_r('YES'); }
|
|
||||||
|
|
||||||
// are we going to do anything with this backup?
|
|
||||||
if ($_GET['p'] != '') {
|
|
||||||
$p = $_GET['p'];
|
|
||||||
} else {
|
|
||||||
redirect('backups.php?upd=bak-err');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($p == 'delete') {
|
|
||||||
// check for csrf
|
|
||||||
if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) {
|
|
||||||
$nonce = $_GET['nonce'];
|
|
||||||
if(!check_nonce($nonce, "delete", "backup-edit.php")) {
|
|
||||||
die("CSRF detected!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete_bak($id);
|
|
||||||
redirect("backups.php?upd=bak-success&id=".$id);
|
|
||||||
}
|
|
||||||
|
|
||||||
elseif ($p == 'restore') {
|
|
||||||
// check for csrf
|
|
||||||
if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) {
|
|
||||||
$nonce = $_GET['nonce'];
|
|
||||||
if(!check_nonce($nonce, "restore", "backup-edit.php")) {
|
|
||||||
die("CSRF detected!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isset($_GET['new'])) {
|
|
||||||
updateSlugs($_GET['new'], $id);
|
|
||||||
restore_bak($id);
|
|
||||||
$existing = GSDATAPAGESPATH . $_GET['new'] .".xml";
|
|
||||||
$bakfile = GSBACKUPSPATH."pages/". $_GET['new'] .".bak.xml";
|
|
||||||
copy($existing, $bakfile);
|
|
||||||
unlink($existing);
|
|
||||||
redirect("edit.php?id=". $id ."&old=".$_GET['new']."&upd=edit-success&type=restore");
|
|
||||||
} else {
|
|
||||||
restore_bak($id);
|
|
||||||
redirect("edit.php?id=". $id ."&upd=edit-success&type=restore");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
get_template('header', cl($SITENAME).' » '. i18n_r('BAK_MANAGEMENT').' » '.i18n_r('VIEWPAGE_TITLE'));
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php include('template/include-nav.php'); ?>
|
|
||||||
|
|
||||||
<div class="bodycontent clearfix">
|
|
||||||
|
|
||||||
<div id="maincontent">
|
|
||||||
<div class="main" >
|
|
||||||
<h3 class="floated"><?php i18n('BACKUP_OF');?> ‘<em><?php echo $url; ?></em>’</h3>
|
|
||||||
|
|
||||||
<div class="edit-nav" >
|
|
||||||
<a href="backup-edit.php?p=restore&id=<?php echo var_out($id); ?>&nonce=<?php echo get_nonce("restore", "backup-edit.php"); ?>"
|
|
||||||
accesskey="<?php echo find_accesskey(i18n_r('ASK_RESTORE'));?>" ><?php i18n('ASK_RESTORE');?></a>
|
|
||||||
<a href="backup-edit.php?p=delete&id=<?php echo var_out($id); ?>&nonce=<?php echo get_nonce("delete", "backup-edit.php"); ?>"
|
|
||||||
title="<?php i18n('DELETEPAGE_TITLE'); ?>: <?php echo $title; ?>?"
|
|
||||||
id="delback"
|
|
||||||
accesskey="<?php echo find_accesskey(i18n_r('ASK_DELETE'));?>"
|
|
||||||
class="delconfirm noajax" ><?php i18n('ASK_DELETE');?></a>
|
|
||||||
<div class="clear"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<table class="simple highlight" >
|
|
||||||
<tr><td class="title" ><?php i18n('PAGE_TITLE');?>:</td><td><b><?php echo cl($title); ?></b> <?php echo $private; ?></td></tr>
|
|
||||||
<tr><td class="title" ><?php i18n('BACKUP_OF');?>:</td><td>
|
|
||||||
<?php
|
|
||||||
if(isset($id)) {
|
|
||||||
echo '<a target="_blank" href="'. find_url($url, $parent) .'">'. find_url($url, $parent) .'</a>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td></tr>
|
|
||||||
<tr><td class="title" ><?php i18n('DATE');?>:</td><td><?php echo lngDate($pubDate); ?></td></tr>
|
|
||||||
<tr><td class="title" ><?php i18n('TAG_KEYWORDS');?>:</td><td><em><?php echo $metak; ?></em></td></tr>
|
|
||||||
<tr><td class="title" ><?php i18n('META_DESC');?>:</td><td><em><?php echo $metad; ?></em></td></tr>
|
|
||||||
<tr><td class="title" ><?php i18n('MENU_TEXT');?>:</td><td><?php echo $menu; ?></td></tr>
|
|
||||||
<tr><td class="title" ><?php i18n('PRIORITY');?>:</td><td><?php echo $menuOrder; ?></td></tr>
|
|
||||||
<tr><td class="title" ><?php i18n('ADD_TO_MENU');?></td><td><?php echo $menuStatus; ?></td></tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<textarea id="codetext" wrap='off' style="background:#f4f4f4;padding:4px;width:635px;color:#444;border:1px solid #666;" readonly ><?php echo strip_decode($content); ?></textarea>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php if ($HTMLEDITOR != '') { ?>
|
|
||||||
<script type="text/javascript" src="template/js/ckeditor/ckeditor.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
var editor = CKEDITOR.replace( 'codetext', {
|
|
||||||
skin : 'getsimple',
|
|
||||||
language : '<?php echo $EDLANG; ?>',
|
|
||||||
defaultLanguage : '<?php echo $EDLANG; ?>',
|
|
||||||
<?php if (file_exists(GSTHEMESPATH .$TEMPLATE."/editor.css")) {
|
|
||||||
$fullpath = suggest_site_path();
|
|
||||||
?>
|
|
||||||
contentsCss: '<?php echo $fullpath; ?>theme/<?php echo $TEMPLATE; ?>/editor.css',
|
|
||||||
<?php } ?>
|
|
||||||
entities : false,
|
|
||||||
uiColor : '#FFFFFF',
|
|
||||||
height: '<?php echo $EDHEIGHT; ?>',
|
|
||||||
baseHref : '<?php echo $SITEURL; ?>',
|
|
||||||
toolbar : [['Source']],
|
|
||||||
removePlugins: 'image,link,elementspath,resize'
|
|
||||||
});
|
|
||||||
// set editor to read only mode
|
|
||||||
editor.on('mode', function (ev) {
|
|
||||||
if (ev.editor.mode == 'source') {
|
|
||||||
$('#cke_contents_codetext .cke_source').attr("readonly", "readonly");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var bodyelement = ev.editor.document.$.body;
|
|
||||||
bodyelement.setAttribute("contenteditable", false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="sidebar" >
|
|
||||||
<?php include('template/sidebar-backups.php'); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php get_template('footer'); ?>
|
|
@ -1,121 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* All Backups
|
|
||||||
*
|
|
||||||
* Displays all available page backups.
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Backups
|
|
||||||
* @link http://get-simple.info/docs/restore-page-backup
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
|
|
||||||
// Include common.php
|
|
||||||
include('inc/common.php');
|
|
||||||
|
|
||||||
// Variable settings
|
|
||||||
login_cookie_check();
|
|
||||||
$path = GSBACKUPSPATH.'pages/';
|
|
||||||
$counter = '0';
|
|
||||||
$table = '';
|
|
||||||
|
|
||||||
|
|
||||||
// delete all backup files if the ?deleteall session parameter is set
|
|
||||||
if (isset($_GET['deleteall'])){
|
|
||||||
// check for csrf
|
|
||||||
if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) {
|
|
||||||
$nonce = $_GET['nonce'];
|
|
||||||
if(!check_nonce($nonce, "deleteall")) {
|
|
||||||
die("CSRF detected!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$filenames = getFiles($path);
|
|
||||||
|
|
||||||
foreach ($filenames as $file) {
|
|
||||||
if (file_exists($path . $file) ) {
|
|
||||||
if (isFile($file, $path, 'bak')) {
|
|
||||||
unlink($path . $file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$success = i18n_r('ER_FILE_DEL_SUC');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//display all page backups
|
|
||||||
$filenames = getFiles($path);
|
|
||||||
$count="0";
|
|
||||||
$pagesArray_tmp = array();
|
|
||||||
$pagesSorted=array();
|
|
||||||
|
|
||||||
if (count($filenames) != 0)
|
|
||||||
{
|
|
||||||
foreach ($filenames as $file)
|
|
||||||
{
|
|
||||||
if (isFile($file, $path, 'bak'))
|
|
||||||
{
|
|
||||||
$data = getXML($path .$file);
|
|
||||||
$status = $data->menuStatus;
|
|
||||||
$pagesArray_tmp[$count]['title'] = html_entity_decode($data->title, ENT_QUOTES, 'UTF-8');
|
|
||||||
$pagesArray_tmp[$count]['url'] = $data->url;
|
|
||||||
$pagesArray_tmp[$count]['date'] = $data->pubDate;
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$pagesSorted = subval_sort($pagesArray_tmp,'title');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count($pagesSorted) != 0)
|
|
||||||
{
|
|
||||||
foreach ($pagesSorted as $page)
|
|
||||||
{
|
|
||||||
$counter++;
|
|
||||||
$table .= '<tr id="tr-'.$page['url'] .'" >';
|
|
||||||
|
|
||||||
if ($page['title'] == '' ) { $page['title'] = '[No Title] » <em>'. $page['url'] .'</em>'; }
|
|
||||||
|
|
||||||
$table .= '<td class="pagetitle"><a title="'.i18n_r('VIEWPAGE_TITLE').' '. cl($page['title']) .'" href="backup-edit.php?p=view&id='. $page['url'] .'">'. cl($page['title']) .'</a></td>';
|
|
||||||
$table .= '<td style="width:80px;text-align:right;" ><span>'. shtDate($page['date']) .'</span></td>';
|
|
||||||
$table .= '<td class="delete" ><a class="delconfirm" title="'.i18n_r('DELETEPAGE_TITLE').' '. cl($page['title']) .'?" href="backup-edit.php?p=delete&id='. $page['url'] .'&nonce='.get_nonce("delete", "backup-edit.php").'">×</a></td>';
|
|
||||||
$table .= '</tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
get_template('header', cl($SITENAME).' » '.i18n_r('BAK_MANAGEMENT'));
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php include('template/include-nav.php'); ?>
|
|
||||||
|
|
||||||
<div class="bodycontent clearfix">
|
|
||||||
|
|
||||||
<div id="maincontent">
|
|
||||||
<div class="main" >
|
|
||||||
<h3 class="floated"><?php i18n('PAGE_BACKUPS');?></h3>
|
|
||||||
|
|
||||||
<?php if ($counter > 0) { ?>
|
|
||||||
<div class="edit-nav clearfix" ><a href="#" id="filtertable" accesskey="<?php echo find_accesskey(i18n_r('FILTER'));?>" ><?php i18n('FILTER'); ?></a> <a href="backups.php?deleteall&nonce=<?php echo get_nonce("deleteall"); ?>" title="<?php i18n('DELETE_ALL_BAK');?>" accesskey="<?php echo find_accesskey(i18n_r('ASK_DELETE_ALL'));?>" class="confirmation" ><?php i18n('ASK_DELETE_ALL');?></a></div>
|
|
||||||
<div id="filter-search">
|
|
||||||
<form><input type="text" autocomplete="off" class="text" id="q" placeholder="<?php echo strip_tags(lowercase(i18n_r('FILTER'))); ?>..." /> <a href="pages.php" class="cancel"><?php i18n('CANCEL'); ?></a></form>
|
|
||||||
</div>
|
|
||||||
<table id="editpages" class="highlight paginate">
|
|
||||||
<tr><th><?php i18n('PAGE_TITLE'); ?></th><th style="text-align:right;" ><?php i18n('DATE'); ?></th><th></th></tr>
|
|
||||||
<?php echo $table; ?>
|
|
||||||
</table>
|
|
||||||
<?php } else { ?>
|
|
||||||
<div class="clearfix" style="height:40px;"></div>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<p><em><b><span id="pg_counter"><?php echo $counter; ?></span></b> <?php echo i18n_r('PAGE_BACKUPS');?></em></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="sidebar" >
|
|
||||||
<?php include('template/sidebar-backups.php'); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php get_template('footer'); ?>
|
|
@ -1,207 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Page Edit Action
|
|
||||||
*
|
|
||||||
* Code to either create or edit a page. This is the action page
|
|
||||||
* for the form on edit.php
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Page-Edit
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
|
|
||||||
// Include common.php
|
|
||||||
include('inc/common.php');
|
|
||||||
|
|
||||||
$autoSaveDraft = false; // auto save to autosave drafts
|
|
||||||
|
|
||||||
// check form referrer - needs siteurl and edit.php in it.
|
|
||||||
if (isset($_SERVER['HTTP_REFERER'])) {
|
|
||||||
if ( !(strpos(str_replace('http://www.', '', $SITEURL), $_SERVER['HTTP_REFERER']) === false) || !(strpos("edit.php", $_SERVER['HTTP_REFERER']) === false)) {
|
|
||||||
echo "<b>Invalid Referer</b><br />-------<br />";
|
|
||||||
echo 'Invalid Referer: ' . htmlentities($_SERVER['HTTP_REFERER'], ENT_QUOTES);
|
|
||||||
die('Invalid Referer');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
login_cookie_check();
|
|
||||||
|
|
||||||
if (isset($_POST['submitted'])) {
|
|
||||||
|
|
||||||
// check for csrf
|
|
||||||
if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) {
|
|
||||||
$nonce = $_POST['nonce'];
|
|
||||||
if(!check_nonce($nonce, "edit", "edit.php")) {
|
|
||||||
die("CSRF detected!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( trim($_POST['post-title']) == '' ) {
|
|
||||||
redirect("edit.php?upd=edit-error&type=".urlencode(i18n_r('CANNOT_SAVE_EMPTY')));
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$url="";$title="";$metad=""; $metak=""; $cont="";
|
|
||||||
|
|
||||||
// is a slug provided?
|
|
||||||
if ($_POST['post-id']) {
|
|
||||||
$url = trim($_POST['post-id']);
|
|
||||||
if (isset($i18n['TRANSLITERATION']) && is_array($translit=$i18n['TRANSLITERATION']) && count($translit>0)) {
|
|
||||||
$url = str_replace(array_keys($translit),array_values($translit),$url);
|
|
||||||
}
|
|
||||||
$url = to7bit($url, "UTF-8");
|
|
||||||
$url = clean_url($url); //old way
|
|
||||||
} else {
|
|
||||||
if ($_POST['post-title']) {
|
|
||||||
$url = trim($_POST['post-title']);
|
|
||||||
if (isset($i18n['TRANSLITERATION']) && is_array($translit=$i18n['TRANSLITERATION']) && count($translit>0)) {
|
|
||||||
$url = str_replace(array_keys($translit),array_values($translit),$url);
|
|
||||||
}
|
|
||||||
$url = to7bit($url, "UTF-8");
|
|
||||||
$url = clean_url($url); //old way
|
|
||||||
} else {
|
|
||||||
$url = "temp";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//check again to see if the URL is empty
|
|
||||||
if ( trim($url) == '' ) {
|
|
||||||
$url = 'temp';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// was the slug changed on an existing page?
|
|
||||||
if ( isset($_POST['existing-url']) ) {
|
|
||||||
if ($_POST['post-id'] != $_POST['existing-url']){
|
|
||||||
// dont change the index page's slug
|
|
||||||
if ($_POST['existing-url'] == 'index') {
|
|
||||||
$url = $_POST['existing-url'];
|
|
||||||
redirect("edit.php?id=". urlencode($_POST['existing-url']) ."&upd=edit-index&type=edit");
|
|
||||||
} else {
|
|
||||||
exec_action('changedata-updateslug');
|
|
||||||
updateSlugs($_POST['existing-url']);
|
|
||||||
$file = GSDATAPAGESPATH . $url .".xml";
|
|
||||||
$existing = GSDATAPAGESPATH . $_POST['existing-url'] .".xml";
|
|
||||||
$bakfile = GSBACKUPSPATH."pages/". $_POST['existing-url'] .".bak.xml";
|
|
||||||
copy($existing, $bakfile);
|
|
||||||
unlink($existing);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$file = GSDATAPAGESPATH . $url .".xml";
|
|
||||||
|
|
||||||
// format and clean the responses
|
|
||||||
if(isset($_POST['post-title'])) { $title = safe_slash_html($_POST['post-title']); }
|
|
||||||
if(isset($_POST['post-metak'])) { $metak = safe_slash_html($_POST['post-metak']); }
|
|
||||||
if(isset($_POST['post-metad'])) { $metad = safe_slash_html($_POST['post-metad']); }
|
|
||||||
if(isset($_POST['post-author'])) { $author = safe_slash_html($_POST['post-author']); }
|
|
||||||
if(isset($_POST['post-template'])) { $template = $_POST['post-template']; }
|
|
||||||
if(isset($_POST['post-parent'])) { $parent = $_POST['post-parent']; }
|
|
||||||
if(isset($_POST['post-menu'])) { $menu = safe_slash_html($_POST['post-menu']); }
|
|
||||||
if(isset($_POST['post-menu-enable'])) { $menuStatus = "Y"; } else { $menuStatus = ""; }
|
|
||||||
if(isset($_POST['post-private']) ) { $private = safe_slash_html($_POST['post-private']); }
|
|
||||||
if(isset($_POST['post-content'])) { $content = safe_slash_html($_POST['post-content']); }
|
|
||||||
if(isset($_POST['post-menu-order'])) {
|
|
||||||
if (is_numeric($_POST['post-menu-order']))
|
|
||||||
{
|
|
||||||
$menuOrder = $_POST['post-menu-order'];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$menuOrder = "0";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// If saving a new file do not overwrite existing, get next incremental filename, file-count.xml
|
|
||||||
if ( (file_exists($file) && $url != $_POST['existing-url']) || in_array($url,$reservedSlugs) ) {
|
|
||||||
$count = "1";
|
|
||||||
$file = GSDATAPAGESPATH . $url ."-".$count.".xml";
|
|
||||||
while ( file_exists($file) ) {
|
|
||||||
$count++;
|
|
||||||
$file = GSDATAPAGESPATH . $url ."-".$count.".xml";
|
|
||||||
}
|
|
||||||
$url = $url .'-'. $count;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// if we are editing an existing page, create a backup
|
|
||||||
if ( file_exists($file) )
|
|
||||||
{
|
|
||||||
$bakfile = GSBACKUPSPATH."pages/". $url .".bak.xml";
|
|
||||||
copy($file, $bakfile);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><item></item>');
|
|
||||||
$xml->addChild('pubDate', date('r'));
|
|
||||||
|
|
||||||
$note = $xml->addChild('title');
|
|
||||||
$note->addCData($title);
|
|
||||||
|
|
||||||
$note = $xml->addChild('url');
|
|
||||||
$note->addCData($url);
|
|
||||||
|
|
||||||
$note = $xml->addChild('meta');
|
|
||||||
$note->addCData($metak);
|
|
||||||
|
|
||||||
$note = $xml->addChild('metad');
|
|
||||||
$note->addCData($metad);
|
|
||||||
|
|
||||||
$note = $xml->addChild('menu');
|
|
||||||
$note->addCData($menu);
|
|
||||||
|
|
||||||
$note = $xml->addChild('menuOrder');
|
|
||||||
$note->addCData($menuOrder);
|
|
||||||
|
|
||||||
$note = $xml->addChild('menuStatus');
|
|
||||||
$note->addCData($menuStatus);
|
|
||||||
|
|
||||||
$note = $xml->addChild('template');
|
|
||||||
$note->addCData($template);
|
|
||||||
|
|
||||||
$note = $xml->addChild('parent');
|
|
||||||
$note->addCData($parent);
|
|
||||||
|
|
||||||
$note = $xml->addChild('content');
|
|
||||||
$note->addCData($content);
|
|
||||||
|
|
||||||
$note = $xml->addChild('private');
|
|
||||||
$note->addCData($private);
|
|
||||||
|
|
||||||
$note = $xml->addChild('author');
|
|
||||||
$note->addCData($author);
|
|
||||||
|
|
||||||
exec_action('changedata-save');
|
|
||||||
if (isset($_POST['autosave']) && $_POST['autosave'] == 'true' && $autoSaveDraft == true) {
|
|
||||||
XMLsave($xml, GSAUTOSAVEPATH.$url);
|
|
||||||
} else {
|
|
||||||
XMLsave($xml, $file);
|
|
||||||
}
|
|
||||||
|
|
||||||
//ending actions
|
|
||||||
exec_action('changedata-aftersave');
|
|
||||||
generate_sitemap();
|
|
||||||
|
|
||||||
// redirect user back to edit page
|
|
||||||
if (isset($_POST['autosave']) && $_POST['autosave'] == 'true') {
|
|
||||||
echo 'OK';
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if ($_POST['redirectto']!='') {
|
|
||||||
$redirect_url = $_POST['redirectto'];
|
|
||||||
} else {
|
|
||||||
$redirect_url = 'edit.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($url == $_POST['existing-url']) {
|
|
||||||
redirect($redirect_url."?id=". $url ."&upd=edit-success&type=edit");
|
|
||||||
} else {
|
|
||||||
redirect($redirect_url."?id=". $url ."&old=".$_POST['existing-url']."&upd=edit-success&type=edit");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
redirect('pages.php');
|
|
||||||
}
|
|
@ -1,162 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Components
|
|
||||||
*
|
|
||||||
* Displays and creates static components
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Components
|
|
||||||
* @link http://get-simple.info/docs/what-are-components
|
|
||||||
*/
|
|
||||||
|
|
||||||
# setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
include('inc/common.php');
|
|
||||||
|
|
||||||
# variable settings
|
|
||||||
$userid = login_cookie_check();
|
|
||||||
$file = "components.xml";
|
|
||||||
$path = GSDATAOTHERPATH;
|
|
||||||
$bakpath = GSBACKUPSPATH .'other/';
|
|
||||||
$update = ''; $table = ''; $list='';
|
|
||||||
|
|
||||||
# check to see if form was submitted
|
|
||||||
if (isset($_POST['submitted'])){
|
|
||||||
$value = $_POST['val'];
|
|
||||||
$slug = $_POST['slug'];
|
|
||||||
$title = $_POST['title'];
|
|
||||||
$ids = $_POST['id'];
|
|
||||||
|
|
||||||
// check for csrf
|
|
||||||
if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) {
|
|
||||||
$nonce = $_POST['nonce'];
|
|
||||||
if(!check_nonce($nonce, "modify_components")) {
|
|
||||||
die("CSRF detected!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# create backup file for undo
|
|
||||||
createBak($file, $path, $bakpath);
|
|
||||||
|
|
||||||
# start creation of top of components.xml file
|
|
||||||
$xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><channel></channel>');
|
|
||||||
if (count($ids) != 0) {
|
|
||||||
|
|
||||||
$ct = 0; $coArray = array();
|
|
||||||
foreach ($ids as $id) {
|
|
||||||
if ($title[$ct] != null) {
|
|
||||||
if ( $slug[$ct] == null ) {
|
|
||||||
$slug_tmp = to7bit($title[$ct], 'UTF-8');
|
|
||||||
$slug[$ct] = clean_url($slug_tmp);
|
|
||||||
$slug_tmp = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$coArray[$ct]['id'] = $ids[$ct];
|
|
||||||
$coArray[$ct]['slug'] = $slug[$ct];
|
|
||||||
$coArray[$ct]['title'] = safe_slash_html($title[$ct]);
|
|
||||||
$coArray[$ct]['value'] = safe_slash_html($value[$ct]);
|
|
||||||
|
|
||||||
}
|
|
||||||
$ct++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$ids = subval_sort($coArray,'title');
|
|
||||||
|
|
||||||
$count = 0;
|
|
||||||
foreach ($ids as $comp) {
|
|
||||||
# create the body of components.xml file
|
|
||||||
$components = $xml->addChild('item');
|
|
||||||
$c_note = $components->addChild('title');
|
|
||||||
$c_note->addCData($comp['title']);
|
|
||||||
$components->addChild('slug', $comp['slug']);
|
|
||||||
$c_note = $components->addChild('value');
|
|
||||||
$c_note->addCData($comp['value']);
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exec_action('component-save');
|
|
||||||
XMLsave($xml, $path . $file);
|
|
||||||
redirect('components.php?upd=comp-success');
|
|
||||||
}
|
|
||||||
|
|
||||||
# if undo was invoked
|
|
||||||
if (isset($_GET['undo'])) {
|
|
||||||
|
|
||||||
# check for csrf
|
|
||||||
$nonce = $_GET['nonce'];
|
|
||||||
if(!check_nonce($nonce, "undo")) {
|
|
||||||
die("CSRF detected!");
|
|
||||||
}
|
|
||||||
|
|
||||||
# perform the undo
|
|
||||||
undo($file, $path, $bakpath);
|
|
||||||
redirect('components.php?upd=comp-restored');
|
|
||||||
}
|
|
||||||
|
|
||||||
# create components form html
|
|
||||||
$data = getXML($path . $file);
|
|
||||||
$componentsec = $data->item;
|
|
||||||
$count= 0;
|
|
||||||
if (count($componentsec) != 0) {
|
|
||||||
foreach ($componentsec as $component) {
|
|
||||||
$table .= '<div class="compdiv" id="section-'.$count.'"><table class="comptable" ><tr><td><b title="'.i18n_r('DOUBLE_CLICK_EDIT').'" class="editable">'. stripslashes($component->title) .'</b></td>';
|
|
||||||
$table .= '<td style="text-align:right;" ><code><?php get_component(<span class="compslugcode">\''.$component->slug.'\'</span>); ?></code></td><td class="delete" >';
|
|
||||||
$table .= '<a href="#" title="'.i18n_r('DELETE_COMPONENT').': '. cl($component->title).'?" class="delcomponent" rel="'.$count.'" >×</a></td></tr></table>';
|
|
||||||
$table .= '<textarea name="val[]">'. stripslashes($component->value) .'</textarea>';
|
|
||||||
$table .= '<input type="hidden" class="compslug" name="slug[]" value="'. $component->slug .'" />';
|
|
||||||
$table .= '<input type="hidden" class="comptitle" name="title[]" value="'. stripslashes($component->title) .'" />';
|
|
||||||
$table .= '<input type="hidden" name="id[]" value="'. $count .'" />';
|
|
||||||
exec_action('component-extras');
|
|
||||||
$table .= '</div>';
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# create list to show on sidebar for easy access
|
|
||||||
$listc = ''; $submitclass = '';
|
|
||||||
if($count > 1) {
|
|
||||||
$item = 0;
|
|
||||||
foreach($componentsec as $component) {
|
|
||||||
$listc .= '<a id="divlist-' . $item . '" href="#section-' . $item . '" class="component">' . $component->title . '</a>';
|
|
||||||
$item++;
|
|
||||||
}
|
|
||||||
} elseif ($count == 0) {
|
|
||||||
$submitclass = 'hidden';
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
get_template('header', cl($SITENAME).' » '.i18n_r('COMPONENTS'));
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php include('template/include-nav.php'); ?>
|
|
||||||
|
|
||||||
<div class="bodycontent clearfix">
|
|
||||||
|
|
||||||
<div id="maincontent">
|
|
||||||
<div class="main">
|
|
||||||
<h3 class="floated"><?php echo i18n('EDIT_COMPONENTS');?></h3>
|
|
||||||
<div class="edit-nav" >
|
|
||||||
<a href="#" id="addcomponent" accesskey="<?php echo find_accesskey(i18n_r('ADD_COMPONENT'));?>" ><?php i18n('ADD_COMPONENT');?></a>
|
|
||||||
<div class="clear"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form class="manyinputs" action="<?php myself(); ?>" method="post" accept-charset="utf-8" >
|
|
||||||
<input type="hidden" id="id" value="<?php echo $count; ?>" />
|
|
||||||
<input type="hidden" id="nonce" name="nonce" value="<?php echo get_nonce("modify_components"); ?>" />
|
|
||||||
|
|
||||||
<div id="divTxt"></div>
|
|
||||||
<?php echo $table; ?>
|
|
||||||
<p id="submit_line" class="<?php echo $submitclass; ?>" >
|
|
||||||
<span><input type="submit" class="submit" name="submitted" id="button" value="<?php i18n('SAVE_COMPONENTS');?>" /></span> <?php i18n('OR'); ?> <a class="cancel" href="components.php?cancel"><?php i18n('CANCEL'); ?></a>
|
|
||||||
</p>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="sidebar">
|
|
||||||
<?php include('template/sidebar-theme.php'); ?>
|
|
||||||
<?php if ($listc != '') { echo '<div class="compdivlist">'.$listc .'</div>'; } ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php get_template('footer'); ?>
|
|
@ -1,5 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* cron.php removed in version 3.1
|
|
||||||
*/
|
|
||||||
?>
|
|
@ -1,72 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Delete File
|
|
||||||
*
|
|
||||||
* Deletes Files based on what is passed to it
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Delete-Files
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
|
|
||||||
// Include common.php
|
|
||||||
include('inc/common.php');
|
|
||||||
login_cookie_check();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// check for csrf
|
|
||||||
if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) {
|
|
||||||
$nonce = $_GET['nonce'];
|
|
||||||
if(!check_nonce($nonce, "delete", "deletefile.php")) {
|
|
||||||
die("CSRF detected!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// are we deleting pages?
|
|
||||||
if (isset($_GET['id'])) {
|
|
||||||
$id = $_GET['id'];
|
|
||||||
|
|
||||||
if ($id == 'index') {
|
|
||||||
redirect('pages.php?upd=edit-error&type='.urlencode(i18n_r('HOMEPAGE_DELETE_ERROR')));
|
|
||||||
} else {
|
|
||||||
updateSlugs($id);
|
|
||||||
$status = delete_file($id);
|
|
||||||
generate_sitemap();
|
|
||||||
exec_action('page-delete');
|
|
||||||
redirect("pages.php?upd=edit-".$status."&id=". $id ."&type=delete");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// are we deleting archives?
|
|
||||||
if (isset($_GET['zip'])) {
|
|
||||||
$zip = $_GET['zip'];
|
|
||||||
$status = delete_zip($zip);
|
|
||||||
|
|
||||||
redirect("archive.php?upd=del-". $status ."&id=". $zip);
|
|
||||||
}
|
|
||||||
|
|
||||||
// are we deleting uploads?
|
|
||||||
if (isset($_GET['file'])) {
|
|
||||||
$path = (isset($_GET['path'])) ? $_GET['path'] : "";
|
|
||||||
$file = $_GET['file'];
|
|
||||||
$status = delete_upload($file, $path);
|
|
||||||
|
|
||||||
redirect("upload.php?upd=del-".$status."&id=". $file . "&path=" . $path);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// are we deleting a folder?
|
|
||||||
if (isset($_GET['folder'])) {
|
|
||||||
$path = (isset($_GET['path'])) ? $_GET['path'] : "";
|
|
||||||
$folder = $_GET['folder'];
|
|
||||||
$target = GSDATAUPLOADPATH . $path . $folder;
|
|
||||||
if (path_is_safe($target,GSDATAUPLOADPATH) && file_exists($target)) {
|
|
||||||
rmdir($target);
|
|
||||||
// delete thumbs folder
|
|
||||||
rmdir(GSTHUMBNAILPATH . $path . $folder);
|
|
||||||
redirect("upload.php?upd=del-success&id=". $folder . "&path=".$path);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,63 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Download Files
|
|
||||||
*
|
|
||||||
* Forces the download of file types
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Download
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
|
|
||||||
// Include common.php
|
|
||||||
include('inc/common.php');
|
|
||||||
login_cookie_check();
|
|
||||||
|
|
||||||
# check if all variables are set
|
|
||||||
if(isset($_GET['file'])) {
|
|
||||||
|
|
||||||
$file = removerelativepath($_GET['file']);
|
|
||||||
|
|
||||||
if(!filepath_is_safe($file,GSDATAUPLOADPATH) && !filepath_is_safe($file,GSBACKUPSPATH.DIRECTORY_SEPARATOR.'zip')) die();
|
|
||||||
|
|
||||||
$extention = pathinfo($file,PATHINFO_EXTENSION);
|
|
||||||
header("Content-disposition: attachment; filename=".$file);
|
|
||||||
|
|
||||||
# set content headers
|
|
||||||
if ($extention == 'zip') {
|
|
||||||
header("Content-type: application/octet-stream");
|
|
||||||
} elseif ($extention == 'gz') {
|
|
||||||
header("Content-type: application/x-gzip");
|
|
||||||
} elseif ($extention == 'mpg') {
|
|
||||||
header("Content-type: video/mpeg");
|
|
||||||
} elseif ($extention == 'jpg' || $extention == 'jpeg' ) {
|
|
||||||
header("Content-type: image/jpeg");
|
|
||||||
} elseif ($extention == 'txt' || $extention == 'log' ) {
|
|
||||||
header("Content-type: text/plain");
|
|
||||||
} elseif ($extention == 'xml' ) {
|
|
||||||
header("Content-type: text/xml");
|
|
||||||
} elseif ($extention == 'js' ) {
|
|
||||||
header("Content-type: text/javascript");
|
|
||||||
} elseif ($extention == 'pdf' ) {
|
|
||||||
header("Content-type: text/pdf");
|
|
||||||
} elseif ($extention == 'css' ) {
|
|
||||||
header("Content-type: text/css");
|
|
||||||
}
|
|
||||||
|
|
||||||
# plugin hook
|
|
||||||
exec_action('download-file');
|
|
||||||
|
|
||||||
# get file
|
|
||||||
if (file_exists($file)) {
|
|
||||||
readfile($file, 'r');
|
|
||||||
}
|
|
||||||
exit;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
echo 'No such file found';
|
|
||||||
die;
|
|
||||||
}
|
|
||||||
|
|
||||||
exit;
|
|
479
admin/edit.php
@ -1,479 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Page Edit
|
|
||||||
*
|
|
||||||
* Edit or create new pages for the website.
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Page-Edit
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
|
|
||||||
// Include common.php
|
|
||||||
include('inc/common.php');
|
|
||||||
|
|
||||||
// Variable settings
|
|
||||||
$userid = login_cookie_check();
|
|
||||||
|
|
||||||
// Get passed variables
|
|
||||||
$id = isset($_GET['id']) ? var_out( $_GET['id'] ): null;
|
|
||||||
$uri = isset($_GET['uri']) ? var_out( $_GET['uri'] ): null;
|
|
||||||
$ptype = isset($_GET['type']) ? var_out( $_GET['type'] ): null;
|
|
||||||
$nonce = isset($_GET['nonce']) ? var_out( $_GET['nonce'] ): null;
|
|
||||||
$path = GSDATAPAGESPATH;
|
|
||||||
|
|
||||||
// Page variables reset
|
|
||||||
$theme_templates = '';
|
|
||||||
$parents_list = '';
|
|
||||||
$keytags = '';
|
|
||||||
$parent = '';
|
|
||||||
$template = '';
|
|
||||||
$menuStatus = '';
|
|
||||||
$private = '';
|
|
||||||
$menu = '';
|
|
||||||
$content = '';
|
|
||||||
$author = '';
|
|
||||||
$title = '';
|
|
||||||
$url = '';
|
|
||||||
$metak = '';
|
|
||||||
$metad = '';
|
|
||||||
|
|
||||||
if ($id){
|
|
||||||
// get saved page data
|
|
||||||
$file = $id .'.xml';
|
|
||||||
|
|
||||||
if (!file_exists($path . $file)){
|
|
||||||
redirect('pages.php?error='.urlencode(i18n_r('PAGE_NOTEXIST')));
|
|
||||||
}
|
|
||||||
|
|
||||||
$data_edit = getXML($path . $file);
|
|
||||||
$title = stripslashes($data_edit->title);
|
|
||||||
$pubDate = $data_edit->pubDate;
|
|
||||||
$metak = stripslashes($data_edit->meta);
|
|
||||||
$metad = stripslashes($data_edit->metad);
|
|
||||||
$url = $data_edit->url;
|
|
||||||
$content = stripslashes($data_edit->content);
|
|
||||||
$template = $data_edit->template;
|
|
||||||
$parent = $data_edit->parent;
|
|
||||||
$author = $data_edit->author;
|
|
||||||
$menu = stripslashes($data_edit->menu);
|
|
||||||
$private = $data_edit->private;
|
|
||||||
$menuStatus = $data_edit->menuStatus;
|
|
||||||
$menuOrder = $data_edit->menuOrder;
|
|
||||||
$buttonname = i18n_r('BTN_SAVEUPDATES');
|
|
||||||
} else {
|
|
||||||
// prefill fields is provided
|
|
||||||
$title = isset( $_GET['title'] ) ? var_out( $_GET['title'] ) : '';
|
|
||||||
$template = isset( $_GET['template'] ) ? var_out( $_GET['template'] ) : '';
|
|
||||||
$parent = isset( $_GET['parent'] ) ? var_out( $_GET['parent'] ) : '';
|
|
||||||
$menu = isset( $_GET['menu'] ) ? var_out( $_GET['menu'] ) : '';
|
|
||||||
$private = isset( $_GET['private'] ) ? var_out( $_GET['private'] ) : '';
|
|
||||||
$menuStatus = isset( $_GET['menuStatus'] ) ? var_out( $_GET['menuStatus'] ) : '';
|
|
||||||
$menuOrder = isset( $_GET['menuOrder'] ) ? var_out( $_GET['menuOrder'] ) : '';
|
|
||||||
$buttonname = i18n_r('BTN_SAVEPAGE');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// MAKE SELECT BOX OF AVAILABLE TEMPLATES
|
|
||||||
if ($template == '') { $template = 'template.php'; }
|
|
||||||
|
|
||||||
$themes_path = GSTHEMESPATH . $TEMPLATE;
|
|
||||||
$themes_handle = opendir($themes_path) or die("Unable to open ". GSTHEMESPATH);
|
|
||||||
while ($file = readdir($themes_handle)) {
|
|
||||||
if( isFile($file, $themes_path, 'php') ) {
|
|
||||||
if ($file != 'functions.php' && substr(strtolower($file),-8) !='.inc.php' && substr($file,0,1)!=='.') {
|
|
||||||
$templates[] = $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sort($templates);
|
|
||||||
|
|
||||||
foreach ($templates as $file){
|
|
||||||
if ($template == $file) {
|
|
||||||
$sel="selected";
|
|
||||||
} else{
|
|
||||||
$sel="";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($file == 'template.php'){
|
|
||||||
$templatename=i18n_r('DEFAULT_TEMPLATE');
|
|
||||||
} else {
|
|
||||||
$templatename=$file;
|
|
||||||
}
|
|
||||||
|
|
||||||
$theme_templates .= '<option '.$sel.' value="'.$file.'" >'.$templatename.'</option>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// SETUP CHECKBOXES
|
|
||||||
$sel_m = ($menuStatus != '') ? 'checked' : '' ;
|
|
||||||
$sel_p = ($private == 'Y') ? 'selected' : '' ;
|
|
||||||
if ($menu == '') { $menu = $title; }
|
|
||||||
|
|
||||||
get_template('header', cl($SITENAME).' » '.i18n_r('EDIT').' '.$title);
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<noscript><style>#metadata_window {display:block !important} </style></noscript>
|
|
||||||
|
|
||||||
<?php include('template/include-nav.php'); ?>
|
|
||||||
|
|
||||||
<div class="bodycontent clearfix">
|
|
||||||
|
|
||||||
<div id="maincontent">
|
|
||||||
<div class="main">
|
|
||||||
|
|
||||||
<h3 class="floated"><?php if(isset($data_edit)) { i18n('PAGE_EDIT_MODE'); } else { i18n('CREATE_NEW_PAGE'); } ?></h3>
|
|
||||||
|
|
||||||
<!-- pill edit navigation -->
|
|
||||||
<div class="edit-nav" >
|
|
||||||
<?php
|
|
||||||
if(isset($id)) {
|
|
||||||
echo '<a href="', find_url($url, $parent) ,'" target="_blank" accesskey="', find_accesskey(i18n_r('VIEW')), '" >', i18n_r('VIEW'), ' </a>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<a href="#" id="metadata_toggle" accesskey="<?php echo find_accesskey(i18n_r('PAGE_OPTIONS'));?>" ><?php i18n('PAGE_OPTIONS'); ?></a>
|
|
||||||
<div class="clear" ></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form class="largeform" id="editform" action="changedata.php" method="post" accept-charset="utf-8" >
|
|
||||||
<input id="nonce" name="nonce" type="hidden" value="<?php echo get_nonce("edit", "edit.php"); ?>" />
|
|
||||||
<input id="author" name="post-author" type="hidden" value="<?php echo $USR; ?>" />
|
|
||||||
|
|
||||||
<!-- page title toggle screen -->
|
|
||||||
<p id="edit_window">
|
|
||||||
<label for="post-title" style="display:none;"><?php i18n('PAGE_TITLE'); ?></label>
|
|
||||||
<input class="text title" id="post-title" name="post-title" type="text" value="<?php echo $title; ?>" placeholder="<?php i18n('PAGE_TITLE'); ?>" />
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- metadata toggle screen -->
|
|
||||||
<div style="display:none;" id="metadata_window" >
|
|
||||||
<div class="leftopt">
|
|
||||||
<p class="inline clearfix" id="post-private-wrap" >
|
|
||||||
<label for="post-private" ><?php i18n('KEEP_PRIVATE'); ?>: </label>
|
|
||||||
<select id="post-private" name="post-private" class="text autowidth" >
|
|
||||||
<option value="" ><?php i18n('NORMAL'); ?></option>
|
|
||||||
<option value="Y" <?php echo $sel_p; ?> ><?php echo ucwords(i18n_r('PRIVATE_SUBTITLE')); ?></option>
|
|
||||||
</select>
|
|
||||||
</p>
|
|
||||||
<p class="inline clearfix" >
|
|
||||||
<label for="post-parent"><?php i18n('PARENT_PAGE'); ?>:</label>
|
|
||||||
<select class="text autowidth" id="post-parent" name="post-parent">
|
|
||||||
<?php
|
|
||||||
getPagesXmlValues();
|
|
||||||
$count = 0;
|
|
||||||
foreach ($pagesArray as $page) {
|
|
||||||
if ($page['parent'] != '') {
|
|
||||||
$parentTitle = returnPageField($page['parent'], "title");
|
|
||||||
$sort = $parentTitle .' '. $page['title'];
|
|
||||||
} else {
|
|
||||||
$sort = $page['title'];
|
|
||||||
}
|
|
||||||
$page = array_merge($page, array('sort' => $sort));
|
|
||||||
$pagesArray_tmp[$count] = $page;
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
// $pagesArray = $pagesArray_tmp;
|
|
||||||
$pagesSorted = subval_sort($pagesArray_tmp,'sort');
|
|
||||||
$ret=get_pages_menu_dropdown('','',0);
|
|
||||||
$ret=str_replace('value="'.$id.'"', 'value="'.$id.'" disabled', $ret);
|
|
||||||
|
|
||||||
// handle 'no parents' correctly
|
|
||||||
if ($parent == '') {
|
|
||||||
$none='selected';
|
|
||||||
$noneText='< '.i18n_r('NO_PARENT').' >';
|
|
||||||
} else {
|
|
||||||
$none=null;
|
|
||||||
$noneText='< '.i18n_r('NO_PARENT').' >';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create base option
|
|
||||||
echo '<option '.$none.' value="" >'.$noneText.'</option>';
|
|
||||||
echo $ret;
|
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
</p>
|
|
||||||
<p class="inline clearfix" >
|
|
||||||
<label for="post-template"><?php i18n('TEMPLATE'); ?>:</label>
|
|
||||||
<select class="text autowidth" id="post-template" name="post-template" >
|
|
||||||
<?php echo $theme_templates; ?>
|
|
||||||
</select>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p class="inline post-menu clearfix">
|
|
||||||
<input type="checkbox" id="post-menu-enable" name="post-menu-enable" <?php echo $sel_m; ?> /> <label for="post-menu-enable" ><?php i18n('ADD_TO_MENU'); ?></label><a href="navigation.php" class="viewlink" rel="facybox" ><img src="template/images/search.png" id="tick" alt="<?php echo strip_tags(i18n_r('VIEW')); ?>" /></a>
|
|
||||||
</p>
|
|
||||||
<div id="menu-items">
|
|
||||||
<img src="template/images/tick.png" id="tick" />
|
|
||||||
<span style="float:left;width:81%;" ><label for="post-menu"><?php i18n('MENU_TEXT'); ?></label></span><span style="float:left;width:10%;" ><label for="post-menu-order"><?php i18n('PRIORITY'); ?></label></span>
|
|
||||||
<div class="clear"></div>
|
|
||||||
<input class="text" style="width:73%;" id="post-menu" name="post-menu" type="text" value="<?php echo $menu; ?>" /> <select class="text" style="width:16%" id="post-menu-order" name="post-menu-order" >
|
|
||||||
<?php if(isset($menuOrder)) {
|
|
||||||
if($menuOrder == 0) {
|
|
||||||
echo '<option value="" selected>-</option>';
|
|
||||||
} else {
|
|
||||||
echo '<option value="'.$menuOrder.'" selected>'.$menuOrder.'</option>';
|
|
||||||
}
|
|
||||||
} ?>
|
|
||||||
<option value="">-</option>
|
|
||||||
<?php
|
|
||||||
$i = 1;
|
|
||||||
while ($i <= 30) {
|
|
||||||
echo '<option value="'.$i.'">'.$i.'</option>';
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="rightopt">
|
|
||||||
<p>
|
|
||||||
<label for="post-id"><?php i18n('SLUG_URL'); ?>:</label>
|
|
||||||
<input class="text short" type="text" id="post-id" name="post-id" value="<?php echo $url; ?>" <?php echo ($url=='index'?'readonly="readonly" ':''); ?>/>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<label for="post-metak"><?php i18n('TAG_KEYWORDS'); ?>:</label>
|
|
||||||
<input class="text short" id="post-metak" name="post-metak" type="text" value="<?php echo $metak; ?>" />
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<label for="post-metad" class="clearfix"><?php i18n('META_DESC'); ?>: <span id="countdownwrap"><strong id="countdown" ></strong> <?php i18n('REMAINING'); ?></span></label>
|
|
||||||
<textarea class="text" id="post-metad" name="post-metad" ><?php echo $metad; ?></textarea>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="clear"></div>
|
|
||||||
<?php exec_action('edit-extras'); ?>
|
|
||||||
|
|
||||||
</div> <!-- / metadata toggle screen -->
|
|
||||||
|
|
||||||
|
|
||||||
<!-- page body -->
|
|
||||||
<p>
|
|
||||||
<label for="post-content" style="display:none;"><?php i18n('LABEL_PAGEBODY'); ?></label>
|
|
||||||
<textarea id="post-content" name="post-content"><?php echo $content; ?></textarea>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<?php exec_action('edit-content'); ?>
|
|
||||||
|
|
||||||
<?php if(isset($data_edit)) {
|
|
||||||
echo '<input type="hidden" name="existing-url" value="'. $url .'" />';
|
|
||||||
} ?>
|
|
||||||
|
|
||||||
<span class="editing"><?php echo i18n_r('EDITPAGE_TITLE') .': ' . $title; ?></span>
|
|
||||||
<div id="submit_line" >
|
|
||||||
<input type="hidden" name="redirectto" value="" />
|
|
||||||
|
|
||||||
<span><input id="page_submit" class="submit" type="submit" name="submitted" value="<?php echo $buttonname; ?>" /></span>
|
|
||||||
|
|
||||||
<div id="dropdown">
|
|
||||||
<h6 class="dropdownaction"><?php i18n('ADDITIONAL_ACTIONS'); ?></h6>
|
|
||||||
<ul class="dropdownmenu">
|
|
||||||
<li id="save-close" ><a href="#" ><?php i18n('SAVE_AND_CLOSE'); ?></a></li>
|
|
||||||
<?php if($url != '') { ?>
|
|
||||||
<li><a href="pages.php?id=<?php echo $url; ?>&action=clone&nonce=<?php echo get_nonce("clone","pages.php"); ?>" ><?php i18n('CLONE'); ?></a></li>
|
|
||||||
<?php } ?>
|
|
||||||
<li id="cancel-updates" class="alertme"><a href="pages.php?cancel" ><?php i18n('CANCEL'); ?></a></li>
|
|
||||||
<?php if($url != 'index' && $url != '') { ?>
|
|
||||||
<li class="alertme" ><a href="deletefile.php?id=<?php echo $url; ?>&nonce=<?php echo get_nonce("delete","deletefile.php"); ?>" ><?php echo strip_tags(i18n_r('ASK_DELETE')); ?></a></li>
|
|
||||||
<?php } ?>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php if($url != '') { ?>
|
|
||||||
<p class="backuplink" ><?php
|
|
||||||
if (isset($pubDate)) {
|
|
||||||
echo sprintf(i18n_r('LAST_SAVED'), '<em>'.$author.'</em>').' '. lngDate($pubDate).' ';
|
|
||||||
}
|
|
||||||
if ( file_exists(GSBACKUPSPATH.'pages/'.$url.'.bak.xml') ) {
|
|
||||||
echo '• <a href="backup-edit.php?p=view&id='.$url.'" target="_blank" >'.i18n_r('BACKUP_AVAILABLE').'</a>';
|
|
||||||
}
|
|
||||||
?></p>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
|
|
||||||
if(isset($EDTOOL)) $EDTOOL = returnJsArray($EDTOOL);
|
|
||||||
if(isset($toolbar)) $toolbar = returnJsArray($toolbar); // handle plugins that corrupt this
|
|
||||||
|
|
||||||
else if(strpos(trim($EDTOOL),'[[')!==0 && strpos(trim($EDTOOL),'[')===0){ $EDTOOL = "[$EDTOOL]"; }
|
|
||||||
|
|
||||||
if(isset($toolbar) && strpos(trim($toolbar),'[[')!==0 && strpos($toolbar,'[')===0){ $toolbar = "[$toolbar]"; }
|
|
||||||
$toolbar = isset($EDTOOL) ? ",toolbar: ".trim($EDTOOL,",") : '';
|
|
||||||
$options = isset($EDOPTIONS) ? ','.trim($EDOPTIONS,",") : '';
|
|
||||||
|
|
||||||
?>
|
|
||||||
<?php if ($HTMLEDITOR != '') { ?>
|
|
||||||
<script type="text/javascript" src="template/js/ckeditor/ckeditor.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
|
|
||||||
var editor = CKEDITOR.replace( 'post-content', {
|
|
||||||
skin : 'getsimple',
|
|
||||||
forcePasteAsPlainText : true,
|
|
||||||
language : '<?php echo $EDLANG; ?>',
|
|
||||||
defaultLanguage : 'en',
|
|
||||||
<?php if (file_exists(GSTHEMESPATH .$TEMPLATE."/editor.css")) {
|
|
||||||
$fullpath = suggest_site_path();
|
|
||||||
?>
|
|
||||||
contentsCss: '<?php echo $fullpath; ?>theme/<?php echo $TEMPLATE; ?>/editor.css',
|
|
||||||
<?php } ?>
|
|
||||||
entities : false,
|
|
||||||
uiColor : '#FFFFFF',
|
|
||||||
height: '<?php echo $EDHEIGHT; ?>',
|
|
||||||
baseHref : '<?php echo $SITEURL; ?>',
|
|
||||||
tabSpaces:10,
|
|
||||||
filebrowserBrowseUrl : 'filebrowser.php?type=all',
|
|
||||||
filebrowserImageBrowseUrl : 'filebrowser.php?type=images',
|
|
||||||
filebrowserWindowWidth : '730',
|
|
||||||
filebrowserWindowHeight : '500'
|
|
||||||
<?php echo $toolbar; ?>
|
|
||||||
<?php echo $options; ?>
|
|
||||||
});
|
|
||||||
CKEDITOR.instances["post-content"].on("instanceReady", InstanceReadyEvent);
|
|
||||||
function InstanceReadyEvent() {
|
|
||||||
this.document.on("keyup", function () {
|
|
||||||
$('#editform #post-content').trigger('change');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
# CKEditor setup functions
|
|
||||||
ckeditor_add_page_link();
|
|
||||||
exec_action('html-editor-init');
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
/* Warning for unsaved Data */
|
|
||||||
var yourText = null;
|
|
||||||
var warnme = false;
|
|
||||||
var pageisdirty = false;
|
|
||||||
|
|
||||||
$('#cancel-updates').hide();
|
|
||||||
|
|
||||||
window.onbeforeunload = function () {
|
|
||||||
if (warnme || pageisdirty == true) {
|
|
||||||
return "<?php i18n('UNSAVED_INFORMATION'); ?>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#editform').submit(function(){
|
|
||||||
warnme = false;
|
|
||||||
return checkTitle();
|
|
||||||
});
|
|
||||||
|
|
||||||
checkTitle = function(){
|
|
||||||
if($.trim($("#post-title").val()).length == 0){
|
|
||||||
alert("<?php i18n('CANNOT_SAVE_EMPTY'); ?>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
jQuery(document).ready(function() {
|
|
||||||
|
|
||||||
<?php if (defined('GSAUTOSAVE') && (int)GSAUTOSAVE != 0) { /* IF AUTOSAVE IS TURNED ON via GSCONFIG.PHP */ ?>
|
|
||||||
|
|
||||||
$('#pagechangednotify').hide();
|
|
||||||
$('#autosavenotify').show();
|
|
||||||
$('#autosavenotify').html('Autosaving is <b>ON</b> (<?php echo (int)GSAUTOSAVE; ?> s)');
|
|
||||||
|
|
||||||
function autoSaveIntvl(){
|
|
||||||
// console.log('autoSaveIntvl called, isdirty:' + pageisdirty);
|
|
||||||
if(pageisdirty == true){
|
|
||||||
autoSave();
|
|
||||||
pageisdirty = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function autoSave() {
|
|
||||||
$('input[type=submit]').attr('disabled', 'disabled');
|
|
||||||
|
|
||||||
// we are using ajax, so ckeditor wont copy data to our textarea for us, so we do it manually
|
|
||||||
if(typeof(editor)!='undefined'){ $('#post-content').val(CKEDITOR.instances["post-content"].getData()); }
|
|
||||||
|
|
||||||
var dataString = $("#editform").serialize();
|
|
||||||
|
|
||||||
// not internalionalized or using GS date format!
|
|
||||||
var currentTime = new Date();
|
|
||||||
var hours = currentTime.getHours();
|
|
||||||
var minutes = currentTime.getMinutes();
|
|
||||||
if (minutes < 10){ minutes = "0" + minutes; }
|
|
||||||
if(hours > 11){ daypart = "PM"; } else { daypart = "AM"; }
|
|
||||||
if(hours > 12){ hours-=12; }
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
type: "POST",
|
|
||||||
url: "changedata.php",
|
|
||||||
data: dataString+'&autosave=true&submitted=true',
|
|
||||||
success: function(msg) {
|
|
||||||
if (msg.toString()=='OK') {
|
|
||||||
$('#autosavenotify').text("<?php i18n('AUTOSAVE_NOTIFY'); ?> "+ hours +":"+minutes+" "+daypart);
|
|
||||||
$('#pagechangednotify').hide();
|
|
||||||
$('#pagechangednotify').text('');
|
|
||||||
$('input[type=submit]').attr('disabled', false);
|
|
||||||
$('input[type=submit]').css('border-color','#ABABAB');
|
|
||||||
warnme = false;
|
|
||||||
$('#cancel-updates').hide();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
pageisdirty=true;
|
|
||||||
$('#autosavenotify').text("<?php i18n('AUTOSAVE_FAILED'); ?>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// We register title and slug changes with change() which only fires when you lose focus to prevent midchange saves.
|
|
||||||
$('#post-title, #post-id').change(function () {
|
|
||||||
$('#editform #post-content').trigger('change');
|
|
||||||
});
|
|
||||||
|
|
||||||
// We register all other form elements to detect changes of any type by using bind
|
|
||||||
$('#editform input,#editform textarea,#editform select').not('#post-title').not('#post-id').bind('change keypress paste textInput input',function(){
|
|
||||||
pageisdirty = true;
|
|
||||||
warnme = true;
|
|
||||||
autoSaveInd();
|
|
||||||
});
|
|
||||||
|
|
||||||
setInterval(autoSaveIntvl, <?php echo (int)GSAUTOSAVE*1000; ?>);
|
|
||||||
|
|
||||||
<?php } else { /* AUTOSAVE IS NOT TURNED ON */ ?>
|
|
||||||
$('#editform').bind('change keypress paste focus textInput input',function(){
|
|
||||||
warnme = true;
|
|
||||||
pageisdirty = false;
|
|
||||||
autoSaveInd();
|
|
||||||
});
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
function autoSaveInd(){
|
|
||||||
$('#pagechangednotify').show();
|
|
||||||
$('#pagechangednotify').text("<?php i18n('PAGE_UNSAVED')?>");
|
|
||||||
$('input[type=submit]').css('border-color','#CC0000');
|
|
||||||
$('#cancel-updates').show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</div>
|
|
||||||
</div><!-- end maincontent -->
|
|
||||||
|
|
||||||
|
|
||||||
<div id="sidebar" >
|
|
||||||
<?php include('template/sidebar-pages.php'); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php get_template('footer'); ?>
|
|
Before Width: | Height: | Size: 557 B |
@ -1,202 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Basic File Browser for CKEditor
|
|
||||||
*
|
|
||||||
* Displays and selects file link to insert into CKEditor
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Files
|
|
||||||
*
|
|
||||||
* Version: 1.1 (2011-03-12)
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Setup inclusions
|
|
||||||
include('inc/common.php');
|
|
||||||
login_cookie_check();
|
|
||||||
|
|
||||||
$filesSorted=null;$dirsSorted=null;
|
|
||||||
|
|
||||||
$path = (isset($_GET['path'])) ? "../data/uploads/".$_GET['path'] : "../data/uploads/";
|
|
||||||
$subPath = (isset($_GET['path'])) ? $_GET['path'] : "";
|
|
||||||
if(!path_is_safe($path,GSDATAUPLOADPATH)) die();
|
|
||||||
$returnid = isset($_GET['returnid']) ? var_out($_GET['returnid']) : "";
|
|
||||||
$func = (isset($_GET['func'])) ? $_GET['func'] : "";
|
|
||||||
$path = tsl($path);
|
|
||||||
// check if host uses Linux (used for displaying permissions
|
|
||||||
$isUnixHost = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? false : true);
|
|
||||||
$CKEditorFuncNum = isset($_GET['CKEditorFuncNum']) ? var_out($_GET['CKEditorFuncNum']) : '';
|
|
||||||
$sitepath = suggest_site_path();
|
|
||||||
$fullPath = $sitepath . "data/uploads/";
|
|
||||||
$type = isset($_GET['type']) ? var_out($_GET['type']) : '';
|
|
||||||
|
|
||||||
global $LANG;
|
|
||||||
$LANG_header = preg_replace('/(?:(?<=([a-z]{2}))).*/', '', $LANG);
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="<?php echo $LANG_header; ?>">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
||||||
<title><?php echo i18n_r('FILE_BROWSER'); ?></title>
|
|
||||||
<link rel="shortcut icon" href="favicon.png" type="image/x-icon" />
|
|
||||||
<link rel="stylesheet" type="text/css" href="template/style.php?v=<?php echo GSVERSION; ?>" media="screen" />
|
|
||||||
<style>
|
|
||||||
.wrapper, #maincontent, #imageTable { width: 100% }
|
|
||||||
</style>
|
|
||||||
<script type='text/javascript'>
|
|
||||||
|
|
||||||
function submitLink($funcNum, $url) {
|
|
||||||
<?php if (isset($_GET['returnid'])){ ?>
|
|
||||||
if(window.opener){
|
|
||||||
window.opener.document.getElementById('<?php echo $returnid; ?>').focus();
|
|
||||||
window.opener.document.getElementById('<?php echo $returnid; ?>').value=$url;
|
|
||||||
}
|
|
||||||
<?php
|
|
||||||
if (isset($_GET['func'])){
|
|
||||||
$func = @$_GET['func'];
|
|
||||||
?>
|
|
||||||
if(window.opener){
|
|
||||||
if(typeof window.opener.<?php echo $func; ?> == 'function') {
|
|
||||||
window.opener.<?php echo $func; ?>('<?php echo $returnid; ?>');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else { ?>
|
|
||||||
if(window.opener){
|
|
||||||
window.opener.CKEDITOR.tools.callFunction($funcNum, $url);
|
|
||||||
}
|
|
||||||
<?php } ?>
|
|
||||||
window.close();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body id="filebrowser" >
|
|
||||||
<div class="wrapper">
|
|
||||||
<div id="maincontent">
|
|
||||||
<div class="main" style="border:none;">
|
|
||||||
<h3><?php echo i18n('UPLOADED_FILES'); ?><span id="filetypetoggle"> / <?php echo ($type == 'images' ? i18n('IMAGES') : i18n('SHOW_ALL') ); ?></span></h3>
|
|
||||||
<?php
|
|
||||||
$count="0";
|
|
||||||
$dircount="0";
|
|
||||||
$counter = "0";
|
|
||||||
$totalsize = 0;
|
|
||||||
$filesArray = array();
|
|
||||||
$dirsArray = array();
|
|
||||||
|
|
||||||
$filenames = getFiles($path);
|
|
||||||
if (count($filenames) != 0) {
|
|
||||||
foreach ($filenames as $file) {
|
|
||||||
if ($file == "." || $file == ".." || $file == ".htaccess" ){
|
|
||||||
// not a upload file
|
|
||||||
} elseif (is_dir($path . $file)) {
|
|
||||||
$dirsArray[$dircount]['name'] = $file;
|
|
||||||
$dircount++;
|
|
||||||
} else {
|
|
||||||
$filesArray[$count]['name'] = $file;
|
|
||||||
$ext = substr($file, strrpos($file, '.') + 1);
|
|
||||||
$extention = get_FileType($ext);
|
|
||||||
$filesArray[$count]['type'] = $extention;
|
|
||||||
clearstatcache();
|
|
||||||
$ss = @stat($path . $file);
|
|
||||||
$filesArray[$count]['date'] = @date('M j, Y',$ss['ctime']);
|
|
||||||
$filesArray[$count]['size'] = fSize($ss['size']);
|
|
||||||
$totalsize = $totalsize + $ss['size'];
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$filesSorted = subval_sort($filesArray,'name');
|
|
||||||
$dirsSorted = subval_sort($dirsArray,'name');
|
|
||||||
}
|
|
||||||
|
|
||||||
$pathParts=explode("/",$subPath);
|
|
||||||
$urlPath="";
|
|
||||||
|
|
||||||
echo '<div class="h5">/ <a href="?CKEditorFuncNum='.$CKEditorFuncNum.'&type='.$type.'">uploads</a> / ';
|
|
||||||
foreach ($pathParts as $pathPart){
|
|
||||||
if ($pathPart!=''){
|
|
||||||
$urlPath.=$pathPart."/";
|
|
||||||
echo '<a href="?path='.$urlPath.'&CKEditorFuncNum='.$CKEditorFuncNum.'&type='.$type.'&func='.$func.'">'.$pathPart.'</a> / ';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo "</div>";
|
|
||||||
|
|
||||||
echo '<table class="highlight" id="imageTable">';
|
|
||||||
|
|
||||||
if (count($dirsSorted) != 0) {
|
|
||||||
foreach ($dirsSorted as $upload) {
|
|
||||||
echo '<tr class="All" >';
|
|
||||||
echo '<td class="" colspan="5">';
|
|
||||||
$adm = substr($path . $upload['name'] , 16);
|
|
||||||
if ($returnid!='') {
|
|
||||||
$returnlink = '&returnid='.$returnid;
|
|
||||||
} else {
|
|
||||||
$returnlink='';
|
|
||||||
}
|
|
||||||
if ($func!='') {
|
|
||||||
$funct = '&func='.$func;
|
|
||||||
} else {
|
|
||||||
$funct='';
|
|
||||||
}
|
|
||||||
echo '<img src="template/images/folder.png" width="11" /> <a href="filebrowser.php?path='.$adm.'&CKEditorFuncNum='.$CKEditorFuncNum.'&type='.$type.$returnlink.'&'.$funct.'" title="'. $upload['name'] .'" ><strong>'.$upload['name'].'</strong></a>';
|
|
||||||
echo '</td>';
|
|
||||||
echo '</tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count($filesSorted) != 0) {
|
|
||||||
foreach ($filesSorted as $upload) {
|
|
||||||
$upload['name'] = rawurlencode($upload['name']);
|
|
||||||
$thumb = null; $thumbnailLink = null;
|
|
||||||
$subDir = ($subPath == '' ? '' : $subPath.'/');
|
|
||||||
$selectLink = 'title="'.i18n_r('SELECT_FILE').': '. htmlspecialchars($upload['name']) .'" href="javascript:void(0)" onclick="submitLink('.$CKEditorFuncNum.',\''.$fullPath.$subDir.$upload['name'].'\')"';
|
|
||||||
|
|
||||||
if ($type == 'images') {
|
|
||||||
if ($upload['type'] == i18n_r('IMAGES') .' Images') {
|
|
||||||
# get internal thumbnail to show beside link in table
|
|
||||||
$thumb = '<td class="imgthumb" style="display:table-cell" >';
|
|
||||||
$thumbLink = $urlPath.'thumbsm.'.$upload['name'];
|
|
||||||
if (file_exists('../data/thumbs/'.$thumbLink)) {
|
|
||||||
$imgSrc='<img src="../data/thumbs/'. $thumbLink .'" />';
|
|
||||||
} else {
|
|
||||||
$imgSrc='<img src="inc/thumb.php?src='. $urlPath . $upload['name'] .'&dest='. $thumbLink .'&x=65&f=1" />';
|
|
||||||
}
|
|
||||||
$thumb .= '<a '.$selectLink.' >'.$imgSrc.'</a>';
|
|
||||||
$thumb .= '</td>';
|
|
||||||
|
|
||||||
# get external thumbnail link
|
|
||||||
$thumbLinkExternal = 'data/thumbs/'.$urlPath.'thumbnail.'.$upload['name'];
|
|
||||||
if (file_exists('../'.$thumbLinkExternal)) {
|
|
||||||
$thumbnailLink = '<span> – </span><a href="javascript:void(0)" onclick="submitLink('.$CKEditorFuncNum.',\''.$sitepath.$thumbLinkExternal.'\')">'.i18n_r('THUMBNAIL').'</a>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else { continue; }
|
|
||||||
}
|
|
||||||
|
|
||||||
$counter++;
|
|
||||||
|
|
||||||
echo '<tr class="All '.$upload['type'].'" >';
|
|
||||||
echo ($thumb=='' ? '<td style="display: none"></td>' : $thumb);
|
|
||||||
echo '<td><a '.$selectLink.' class="primarylink">'.htmlspecialchars($upload['name']) .'</a>'.$thumbnailLink.'</td>';
|
|
||||||
echo '<td style="width:80px;text-align:right;" ><span>'. $upload['size'] .'</span></td>';
|
|
||||||
|
|
||||||
// get the file permissions.
|
|
||||||
if ($isUnixHost && isDebug() && function_exists('posix_getpwuid')) {
|
|
||||||
$filePerms = substr(sprintf('%o', fileperms($path.$upload['name'])), -4);
|
|
||||||
$fileOwner = posix_getpwuid(fileowner($path.$upload['name']));
|
|
||||||
echo '<td style="width:70px;text-align:right;"><span>'.$fileOwner['name'].'/'.$filePerms.'</span></td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '<td style="width:85px;text-align:right;" ><span>'. shtDate($upload['date']) .'</span></td>';
|
|
||||||
echo '</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
echo '</table>';
|
|
||||||
echo '<p><em><b>'. $counter .'</b> '.i18n_r('TOTAL_FILES').' ('. fSize($totalsize) .')</em></p>';
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,378 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Health Check
|
|
||||||
*
|
|
||||||
* Displays the status and health check of your installation
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Support
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
|
|
||||||
// Include common.php
|
|
||||||
include('inc/common.php');
|
|
||||||
login_cookie_check();
|
|
||||||
$php_modules = get_loaded_extensions();
|
|
||||||
|
|
||||||
get_template('header', cl($SITENAME).' » '.i18n_r('SUPPORT').' » '.i18n_r('WEB_HEALTH_CHECK'));
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php include('template/include-nav.php'); ?>
|
|
||||||
|
|
||||||
<div class="bodycontent clearfix">
|
|
||||||
|
|
||||||
<div id="maincontent">
|
|
||||||
<div class="main">
|
|
||||||
<h3><?php echo $site_full_name; ?></h3>
|
|
||||||
<table class="highlight healthcheck">
|
|
||||||
<?php
|
|
||||||
|
|
||||||
# check to see if there is a core update needed
|
|
||||||
$data = get_api_details();
|
|
||||||
if ($data) {
|
|
||||||
$apikey = json_decode($data);
|
|
||||||
$verstatus = $apikey->status;
|
|
||||||
} else {
|
|
||||||
$verstatus = null;
|
|
||||||
}
|
|
||||||
if ($verstatus == '0') {
|
|
||||||
$ver = '<span class="ERRmsg" ><b>'.$site_version_no.'</b><br /> '. i18n_r('UPG_NEEDED').' (<b>'.$apikey->latest .'</b>)<br /><a href="http://get-simple.info/download/">'. i18n_r('DOWNLOAD').'</a></span>';
|
|
||||||
} elseif ($verstatus == '1') {
|
|
||||||
$ver = '<span class="OKmsg" ><b>'.$site_version_no.'</b><br />'. i18n_r('LATEST_VERSION').'</span>';
|
|
||||||
} elseif ($verstatus == '2') {
|
|
||||||
$ver = '<span class="INFOmsg" ><b>'.$site_version_no.'</b><br /> '. i18n_r('BETA').'</span>';
|
|
||||||
} else {
|
|
||||||
$ver = '<span class="WARNmsg" ><b>'.$site_version_no.'</b><br />'. i18n_r('CANNOT_CHECK').'<br /><a href="http://get-simple.info/download">'. i18n_r('DOWNLOAD').'</a></span>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<tr><td style="width:445px;" ><?php echo $site_full_name; ?> <?php i18n('VERSION');?></td><td><?php echo $ver; ?></td></tr>
|
|
||||||
<?php
|
|
||||||
if(defined('GSADMIN') && GSADMIN!='admin') echo '<tr><td>GSADMIN</td><td><span class="hint">'.GSADMIN.'</span></td></tr>';
|
|
||||||
|
|
||||||
if(defined('GSLOGINSALT') && GSLOGINSALT!='') echo '<tr><td>GSLOGINSALT</td><td><span class="hint">'. i18n_r('YES').'</span></td></tr>';
|
|
||||||
else echo '<tr><td>GSLOGINSALT</td><td><span class="hint">'. i18n_r('NO').'</span></td></tr>';
|
|
||||||
|
|
||||||
if(defined('GSUSECUSTOMSALT') && GSUSECUSTOMSALT!='') echo '<tr><td>GSUSECUSTOMSALT</td><td><span class="hint">'. i18n_r('YES').'</span></td></tr>';
|
|
||||||
else echo '<tr><td>GSUSECUSTOMSALT</td><td><span class="hint">'. i18n_r('NO').'</span></td></tr>';
|
|
||||||
?>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<h3><?php i18n('SERVER_SETUP');?></h3>
|
|
||||||
<table class="highlight healthcheck">
|
|
||||||
<tr><td style="width:445px;" >
|
|
||||||
<?php
|
|
||||||
|
|
||||||
if (version_compare(PHP_VERSION, "5.2", "<")) {
|
|
||||||
echo 'PHP '.i18n_r('VERSION').'</td><td><span class="ERRmsg" ><b>'. PHP_VERSION.'</b> - PHP 5.2 '.i18n_r('OR_GREATER_REQ').' - '.i18n_r('ERROR').'</span></td></tr>';
|
|
||||||
} else {
|
|
||||||
echo 'PHP '.i18n_r('VERSION').'</td><td><span class="OKmsg" ><b>'. PHP_VERSION.'</b> - '.i18n_r('OK').'</span></td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (in_arrayi('curl', $php_modules) && function_exists('curl_init') && function_exists('curl_exec')) {
|
|
||||||
echo '<tr><td>cURL Module</td><td><span class="OKmsg" >'.i18n_r('INSTALLED').' - '.i18n_r('OK').'</span></td></tr>';
|
|
||||||
} else{
|
|
||||||
echo '<tr><td>cURL Module</td><td><span class="WARNmsg" >'.i18n_r('NOT_INSTALLED').' - '.i18n_r('WARNING').'</span></td></tr>';
|
|
||||||
}
|
|
||||||
if (in_arrayi('gd', $php_modules) ) {
|
|
||||||
echo '<tr><td>GD Library</td><td><span class="OKmsg" >'.i18n_r('INSTALLED').' - '.i18n_r('OK').'</span></td></tr>';
|
|
||||||
} else{
|
|
||||||
echo '<tr><td>GD Library</td><td><span class="WARNmsg" >'.i18n_r('NOT_INSTALLED').' - '.i18n_r('WARNING').'</span></td></tr>';
|
|
||||||
}
|
|
||||||
if (in_arrayi('zip', $php_modules) ) {
|
|
||||||
echo '<tr><td>ZipArchive</td><td><span class="OKmsg" >'.i18n_r('INSTALLED').' - '.i18n_r('OK').'</span></td></tr>';
|
|
||||||
} else{
|
|
||||||
echo '<tr><td>ZipArchive</td><td><span class="WARNmsg" >'.i18n_r('NOT_INSTALLED').' - '.i18n_r('WARNING').'</span></td></tr>';
|
|
||||||
}
|
|
||||||
if (! in_arrayi('SimpleXML', $php_modules) ) {
|
|
||||||
echo '<tr><td>SimpleXML Module</td><td><span class="ERRmsg" >'.i18n_r('NOT_INSTALLED').' - '.i18n_r('ERROR').'</span></td></tr>';
|
|
||||||
} else {
|
|
||||||
echo '<tr><td>SimpleXML Module</td><td><span class="OKmsg" >'.i18n_r('INSTALLED').' - '.i18n_r('OK').'</span></td></tr>';
|
|
||||||
}
|
|
||||||
if (!function_exists('chmod') ) {
|
|
||||||
echo '<tr><td>chmod</td><td><span class="ERRmsg" >'.i18n_r('NOT_INSTALLED').' - '.i18n_r('ERROR').'</span></td></tr>';
|
|
||||||
} else {
|
|
||||||
echo '<tr><td>chmod</td><td><span class="OKmsg" >chmod - '.i18n_r('OK').'</span></td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (server_is_apache()) {
|
|
||||||
echo '<tr><td>Apache Web Server</td><td><span class="OKmsg" >'.$_SERVER['SERVER_SOFTWARE'].' - '.i18n_r('OK').'</span></td></tr>';
|
|
||||||
if ( function_exists('apache_get_modules') ) {
|
|
||||||
if(! in_arrayi('mod_rewrite',apache_get_modules())) {
|
|
||||||
echo '<tr><td>Apache Mod Rewrite</td><td><span class="WARNmsg" >'.i18n_r('NOT_INSTALLED').' - '.i18n_r('WARNING').'</span></td></tr>';
|
|
||||||
} else {
|
|
||||||
echo '<tr><td>Apache Mod Rewrite</td><td><span class="OKmsg" >'.i18n_r('INSTALLED').' - '.i18n_r('OK').'</span></td></tr>';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
echo '<tr><td>Apache Mod Rewrite</td><td><span class="OKmsg" >'.i18n_r('INSTALLED').' - '.i18n_r('OK').'</span></td></tr>';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!defined('GSNOAPACHECHECK') || GSNOAPACHECHECK == false) {
|
|
||||||
echo '<tr><td>Apache web server</td><td><span class="ERRmsg" >'.$_SERVER['SERVER_SOFTWARE'].' - <b>'.i18n_r('ERROR').'</b></span></td></tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$disabled_funcs = ini_get('disable_functions');
|
|
||||||
if(!empty($disabled_funcs)) echo '<tr><td colspan=2>PHP disable_functions<span class="hint"> ' . $disabled_funcs . '</span></td></tr>';
|
|
||||||
?>
|
|
||||||
</table>
|
|
||||||
<p class="hint"><?php echo sprintf(i18n_r('REQS_MORE_INFO'), "http://get-simple.info/docs/requirements"); ?></p>
|
|
||||||
|
|
||||||
<h3><?php i18n('DATA_FILE_CHECK');?></h3>
|
|
||||||
<table class="highlight healthcheck">
|
|
||||||
<?php
|
|
||||||
$path = GSDATAPAGESPATH;
|
|
||||||
$data = getFiles($path);
|
|
||||||
sort($data);
|
|
||||||
foreach($data as $file) {
|
|
||||||
if( isFile($file, $path) ) {
|
|
||||||
echo '<tr><td style="width:445px;" >/data/pages/' . $file .'</td><td>' . valid_xml($path . $file) .'</td></tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$path = GSDATAOTHERPATH;
|
|
||||||
$data = getFiles($path);
|
|
||||||
sort($data);
|
|
||||||
foreach($data as $file) {
|
|
||||||
if( isFile($file, $path) ) {
|
|
||||||
echo '<tr><td>/data/other/' . $file .'</td><td>' . valid_xml($path . $file) .'</td></tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$path = GSDATAOTHERPATH.'logs/';
|
|
||||||
$data = getFiles($path);
|
|
||||||
sort($data);
|
|
||||||
foreach($data as $file) {
|
|
||||||
if( isFile($file, $path, '.log') ) {
|
|
||||||
echo '<tr><td>/data/other/logs/' . $file .'</td><td>' . valid_xml($path . $file) .'</td></tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$path = GSUSERSPATH;
|
|
||||||
$data = getFiles($path);
|
|
||||||
sort($data);
|
|
||||||
foreach($data as $file) {
|
|
||||||
if( isFile($file, $path) ) {
|
|
||||||
echo '<tr><td>/backups/users/' . $file .'</td><td>' . valid_xml($path . $file) .'</td></tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<h3><?php i18n('DIR_PERMISSIONS');?></h3>
|
|
||||||
<table class="highlight healthcheck">
|
|
||||||
<?php $me = check_perms(GSDATAOTHERPATH.'plugins.xml'); ?><tr><td><?php i18n('FILE_NAME'); ?>: /data/other/plugins.xml</td><td><?php if( $me >= '0644' ) { echo '<span class="OKmsg" >'. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').'</span>'; } else { echo '<span class="ERRmsg" >'. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!</span>'; } ?></td></tr>
|
|
||||||
<?php $me = check_perms(GSDATAPAGESPATH); ?><tr><td style="width:445px;" >/data/pages/</td><td><?php if( $me >= '0755' ) { echo '<span class="OKmsg" >'. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').'</span>'; } else { echo '<span class="ERRmsg" >'. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!</span>'; } ?></td></tr>
|
|
||||||
<?php $me = check_perms(GSDATAOTHERPATH); ?><tr><td>/data/other/</td><td><?php if( $me >= '0755' ) { echo '<span class="OKmsg" >'. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').'</span>'; } else { echo '<span class="ERRmsg" >'. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!</span>'; } ?></td></tr>
|
|
||||||
<?php $me = check_perms(GSDATAOTHERPATH.'logs/'); ?><tr><td>/data/other/logs/</td><td><?php if( $me >= '0755' ) { echo '<span class="OKmsg" >'. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').'</span>'; } else { echo '<span class="ERRmsg" >'. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!</span>'; } ?></td></tr>
|
|
||||||
<?php $me = check_perms(GSTHUMBNAILPATH); ?><tr><td>/data/thumbs/</td><td><?php if( $me >= '0755' ) { echo '<span class="OKmsg" >'. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').'</span>'; } else { echo '<span class="ERRmsg" >'. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!</span>'; } ?></td></tr>
|
|
||||||
<?php $me = check_perms(GSDATAUPLOADPATH); ?><tr><td>/data/uploads/</td><td><?php if( $me >= '0755' ) { echo '<span class="OKmsg" >'. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').'</span>'; } else { echo '<span class="ERRmsg" >'. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!</span>'; } ?></td></tr>
|
|
||||||
<?php $me = check_perms(GSUSERSPATH); ?><tr><td>/data/users/</td><td><?php if( $me >= '0755' ) { echo '<span class="OKmsg" >'. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').'</span>'; } else { echo '<span class="ERRmsg" >'. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!</span>'; } ?></td></tr>
|
|
||||||
<?php $me = check_perms(GSCACHEPATH); ?><tr><td>/data/cache/</td><td><?php if( $me >= '0755' ) { echo '<span class="OKmsg" >'. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').'</span>'; } else { echo '<span class="ERRmsg" >'. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!</span>'; } ?></td></tr>
|
|
||||||
<?php $me = check_perms(GSBACKUPSPATH.'zip/'); ?><tr><td>/backups/zip/</td><td><?php if( $me >= '0755' ) { echo '<span class="OKmsg" >'. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').'</span>'; } else { echo '<span class="ERRmsg" >'. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!</span>'; } ?></td></tr>
|
|
||||||
<?php $me = check_perms(GSBACKUPSPATH.'pages/'); ?><tr><td>/backups/pages/</td><td><?php if( $me >= '0755' ) { echo '<span class="OKmsg" >'. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').'</span>'; } else { echo '<span class="ERRmsg" >'. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!</span>'; } ?></td></tr>
|
|
||||||
<?php $me = check_perms(GSBACKUPSPATH.'other/'); ?><tr><td>/backups/other/</td><td><?php if( $me >= '0755' ) { echo '<span class="OKmsg" >'. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').'</span>'; } else { echo '<span class="ERRmsg" >'. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!</span>'; } ?></td></tr>
|
|
||||||
<?php $me = check_perms(GSBACKUSERSPATH); ?><tr><td>/backups/users/</td><td><?php if( $me >= '0755' ) { echo '<span class="OKmsg" >'. $me .' '.i18n_r('WRITABLE').' - '.i18n_r('OK').'</span>'; } else { echo '<span class="ERRmsg" >'. $me .' '.i18n_r('NOT_WRITABLE').' - '.i18n_r('ERROR').'!</span>'; } ?></td></tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
|
|
||||||
<h3><?php echo sprintf(i18n_r('EXISTANCE'), '.htaccess');?></h3>
|
|
||||||
<table class="highlight healthcheck">
|
|
||||||
<tr><td style="width:445px;" >/data/</td><td>
|
|
||||||
<?php
|
|
||||||
$file = GSDATAPATH.".htaccess";
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
copy (GSADMININCPATH.'tmp/tmp.deny.htaccess', $file);
|
|
||||||
}
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
echo '<span class="WARNmsg" >'.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
$res = file_get_contents($file);
|
|
||||||
if ( !strstr($res, 'Deny from all')) {
|
|
||||||
echo '<span class="WARNmsg" >'.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
echo '<span class="OKmsg" >'.i18n_r('GOOD_D_FILE').' - '.i18n_r('OK').'</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td></tr>
|
|
||||||
|
|
||||||
<tr><td>/data/uploads/</td><td>
|
|
||||||
<?php
|
|
||||||
$file = GSDATAUPLOADPATH.".htaccess";
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
copy (GSADMININCPATH.'tmp/tmp.allow.htaccess', $file);
|
|
||||||
}
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
echo ' <span class="WARNmsg" >'.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
$res = file_get_contents($file);
|
|
||||||
if ( !strstr($res, 'Allow from all')) {
|
|
||||||
echo ' <span class="WARNmsg" >'.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
echo ' <span class="OKmsg" >'.i18n_r('GOOD_A_FILE').' - '.i18n_r('OK').'</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td></tr>
|
|
||||||
|
|
||||||
<tr><td>/data/users/</td><td>
|
|
||||||
<?php
|
|
||||||
$file = GSUSERSPATH.".htaccess";
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
copy (GSADMININCPATH.'tmp/tmp.deny.htaccess', $file);
|
|
||||||
}
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
echo '<span class="WARNmsg" >'.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
$res = file_get_contents($file);
|
|
||||||
if ( !strstr($res, 'Deny from all')) {
|
|
||||||
echo '<span class="WARNmsg" >'.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
echo '<span class="OKmsg" >'.i18n_r('GOOD_D_FILE').' - '.i18n_r('OK').'</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td></tr>
|
|
||||||
|
|
||||||
<tr><td>/data/cache/</td><td>
|
|
||||||
<?php
|
|
||||||
$file = GSCACHEPATH.".htaccess";
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
copy (GSADMININCPATH.'tmp/tmp.deny.htaccess', $file);
|
|
||||||
}
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
echo '<span class="WARNmsg" >'.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
$res = file_get_contents($file);
|
|
||||||
if ( !strstr($res, 'Deny from all')) {
|
|
||||||
echo '<span class="WARNmsg" >'.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
echo '<span class="OKmsg" >'.i18n_r('GOOD_D_FILE').' - '.i18n_r('OK').'</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td></tr>
|
|
||||||
|
|
||||||
<tr><td>/data/thumbs/</td><td>
|
|
||||||
<?php
|
|
||||||
$file = GSTHUMBNAILPATH.".htaccess";
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
copy (GSADMININCPATH.'tmp/tmp.allow.htaccess', $file);
|
|
||||||
}
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
echo ' <span class="WARNmsg" >'.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
$res = file_get_contents($file);
|
|
||||||
if ( !strstr($res, 'Allow from all')) {
|
|
||||||
echo ' <span class="WARNmsg" >'.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
echo ' <span class="OKmsg" >'.i18n_r('GOOD_A_FILE').' - '.i18n_r('OK').'</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td></tr>
|
|
||||||
|
|
||||||
<tr><td>/data/pages/</td><td>
|
|
||||||
<?php
|
|
||||||
$file = GSDATAPAGESPATH.".htaccess";
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
copy (GSADMININCPATH.'tmp/tmp.deny.htaccess', $file);
|
|
||||||
}
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
echo ' <span class="WARNmsg" >'.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
$res = file_get_contents($file);
|
|
||||||
if ( !strstr($res, 'Deny from all')) {
|
|
||||||
echo ' <span class="WARNmsg" >'.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
echo ' <span class="OKmsg" >'.i18n_r('GOOD_D_FILE').' - '.i18n_r('OK').'</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td></tr>
|
|
||||||
|
|
||||||
<tr><td>/plugins/</td><td>
|
|
||||||
<?php
|
|
||||||
$file = GSPLUGINPATH.".htaccess";
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
copy (GSADMININCPATH.'tmp/tmp.deny.htaccess', $file);
|
|
||||||
}
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
echo ' <span class="WARNmsg" >'.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
$res = file_get_contents($file);
|
|
||||||
if ( !strstr($res, 'Deny from all')) {
|
|
||||||
echo ' <span class="WARNmsg" >'.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
echo ' <span class="OKmsg" >'.i18n_r('GOOD_D_FILE').' - '.i18n_r('OK').'</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td></tr>
|
|
||||||
|
|
||||||
<tr><td>/data/other/</td><td>
|
|
||||||
<?php
|
|
||||||
$file = GSDATAOTHERPATH.".htaccess";
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
copy (GSADMININCPATH.'tmp/tmp.deny.htaccess', $file);
|
|
||||||
}
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
echo ' <span class="WARNmsg" >'.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
$res = file_get_contents($file);
|
|
||||||
if ( !strstr($res, 'Deny from all')) {
|
|
||||||
echo ' <span class="WARNmsg" >'.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
echo ' <span class="OKmsg" >'.i18n_r('GOOD_D_FILE').' - '.i18n_r('OK').'</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td></tr>
|
|
||||||
|
|
||||||
<tr><td>/data/other/logs/</td><td>
|
|
||||||
<?php
|
|
||||||
$file = GSDATAOTHERPATH."logs/.htaccess";
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
copy (GSADMININCPATH.'tmp/tmp.deny.htaccess', $file);
|
|
||||||
}
|
|
||||||
if (! file_exists($file)) {
|
|
||||||
echo ' <span class="WARNmsg" >'.i18n_r('MISSING_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
$res = file_get_contents($file);
|
|
||||||
if ( !strstr($res, 'Deny from all')) {
|
|
||||||
echo ' <span class="WARNmsg" >'.i18n_r('BAD_FILE').' - '.i18n_r('WARNING').'</span>';
|
|
||||||
} else {
|
|
||||||
echo ' <span class="OKmsg" >'.i18n_r('GOOD_D_FILE').' - '.i18n_r('OK').'</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td></tr>
|
|
||||||
|
|
||||||
<tr><td>/theme/</td><td>
|
|
||||||
<?php
|
|
||||||
$file = GSTHEMESPATH.".htaccess";
|
|
||||||
if (file_exists($file)) {
|
|
||||||
unlink($file);
|
|
||||||
}
|
|
||||||
if (file_exists($file)) {
|
|
||||||
echo ' <span class="ERRmsg" >'.i18n_r('CANNOT_DEL_FILE').' - '.i18n_r('ERROR').'</span>';
|
|
||||||
} else {
|
|
||||||
echo ' <span class="OKmsg" >'.i18n_r('NO_FILE').' - '.i18n_r('OK').'</span>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td></tr>
|
|
||||||
</table>
|
|
||||||
<?php exec_action('healthcheck-extras'); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="sidebar" >
|
|
||||||
<?php include('template/sidebar-support.php'); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php get_template('footer'); ?>
|
|
@ -1,31 +0,0 @@
|
|||||||
/* TEAM */
|
|
||||||
Founder & Developer: Chris Cagle
|
|
||||||
Forum Handle: ccagle8
|
|
||||||
Site: http://chriscagle.me/
|
|
||||||
Twitter: @ccagle8
|
|
||||||
Location: Pittsburgh, Pennsylvania, USA
|
|
||||||
|
|
||||||
Developer: Mike Swan
|
|
||||||
Forum Handle: n00dles101
|
|
||||||
Site: http://www.digimute.com/
|
|
||||||
Twitter: @digimute
|
|
||||||
Location: Dublin, Ireland
|
|
||||||
|
|
||||||
Developer: Matthew Phillips
|
|
||||||
Forum Handle: OWS_Matthew
|
|
||||||
Site: http://www.owassowebsolutions.com/
|
|
||||||
Location: Owasso, Oklahoma, USA
|
|
||||||
|
|
||||||
Developer: Shawn Alverson
|
|
||||||
Forum Handle: shawn_a
|
|
||||||
Site: http://shawnalverson.com/
|
|
||||||
Location: Tennessee, USA
|
|
||||||
|
|
||||||
/* THANKS */
|
|
||||||
Carlos Navarro (cnb)
|
|
||||||
Joshas
|
|
||||||
Connie Connie Müller-Gödecke (Connie)
|
|
||||||
Thorsten Panknin (polyfragmented)
|
|
||||||
Mike Henken (MikeH)
|
|
||||||
Martijn van der Ven (Zegnåt)
|
|
||||||
...and the countless others on the forums and SVN that help us make this amazing product possible.
|
|
147
admin/image.php
@ -1,147 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Images
|
|
||||||
*
|
|
||||||
* Displays information on the passed image
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Images
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
|
|
||||||
// Include common.php
|
|
||||||
include('inc/common.php');
|
|
||||||
|
|
||||||
// Variable Settings
|
|
||||||
login_cookie_check();
|
|
||||||
|
|
||||||
$subPath = (isset($_GET['path'])) ? $_GET['path'] : "";
|
|
||||||
if ($subPath != '') $subPath = tsl($subPath);
|
|
||||||
|
|
||||||
$src = strippath($_GET['i']);
|
|
||||||
$thumb_folder = GSTHUMBNAILPATH.$subPath;
|
|
||||||
$src_folder = '../data/uploads/';
|
|
||||||
$thumb_folder_rel = '../data/thumbs/'.$subPath;
|
|
||||||
if (!is_file($src_folder . $subPath .$src)) redirect("upload.php");
|
|
||||||
|
|
||||||
// handle jcrop thumbnail creation
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
|
||||||
require_once('inc/imagemanipulation.php');
|
|
||||||
$objImage = new ImageManipulation($src_folder . $subPath .$src);
|
|
||||||
if ( $objImage->imageok ) {
|
|
||||||
$objImage->setCrop($_POST['x'], $_POST['y'], $_POST['w'], $_POST['h']);
|
|
||||||
//$objImage->show();
|
|
||||||
$objImage->save($thumb_folder . 'thumbnail.' .$src);
|
|
||||||
$success = i18n_r('THUMB_SAVED');
|
|
||||||
} else {
|
|
||||||
i18n('ERROR');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$thumb_exists = $thwidth = $thheight = $thtype = $athttr = '';
|
|
||||||
|
|
||||||
list($imgwidth, $imgheight, $imgtype, $imgattr) = getimagesize($src_folder .$subPath. $src);
|
|
||||||
|
|
||||||
if (file_exists($thumb_folder . 'thumbnail.' . $src)) {
|
|
||||||
list($thwidth, $thheight, $thtype, $athttr) = getimagesize($thumb_folder . 'thumbnail.'.$src);
|
|
||||||
$thumb_exists = ' | <a href="'.$thumb_folder_rel . 'thumbnail.'. rawurlencode($src) .'" rel="facybox_i" >'.i18n_r('CURRENT_THUMBNAIL').'</a> <code>'.$thwidth.'x'.$thheight.'</code>';
|
|
||||||
}else{
|
|
||||||
// if thumb is missing recreate it
|
|
||||||
require_once('inc/imagemanipulation.php');
|
|
||||||
if(genStdThumb($subPath,$src)){
|
|
||||||
list($thwidth, $thheight, $thtype, $athttr) = getimagesize($thumb_folder . 'thumbnail.'.$src);
|
|
||||||
$thumb_exists = ' | <a href="'.$thumb_folder_rel . 'thumbnail.'. rawurlencode($src) .'" rel="facybox_i" >'.i18n_r('CURRENT_THUMBNAIL').'</a> <code>'.$thwidth.'x'.$thheight.'</code>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
get_template('header', cl($SITENAME).' » '.i18n_r('FILE_MANAGEMENT').' » '.i18n_r('IMAGES'));
|
|
||||||
|
|
||||||
include('template/include-nav.php'); ?>
|
|
||||||
|
|
||||||
<div class="bodycontent clearfix">
|
|
||||||
<div id="maincontent">
|
|
||||||
|
|
||||||
<div class="main">
|
|
||||||
<h3><?php i18n('IMG_CONTROl_PANEL');?></h3>
|
|
||||||
|
|
||||||
<?php echo '<p><a href="'.$src_folder . $subPath .rawurlencode($src).'" rel="facybox_i" >'.i18n_r('ORIGINAL_IMG').'</a> <code>'.$imgwidth.'x'.$imgheight .'</code>'. $thumb_exists .'</p>'; ?>
|
|
||||||
|
|
||||||
<form>
|
|
||||||
<select class="text" id="img-info" style="width:50%" >
|
|
||||||
<option selected value="code-img-link" ><?php i18n('LINK_ORIG_IMG');?></option>
|
|
||||||
<option value="code-img-html" ><?php i18n('HTML_ORIG_IMG');?></option>
|
|
||||||
<?php if(!empty($thumb_exists)) { ?>
|
|
||||||
<option value="code-thumb-html" ><?php i18n('HTML_THUMBNAIL');?></option>
|
|
||||||
<option value="code-thumb-link" ><?php i18n('LINK_THUMBNAIL');?></option>
|
|
||||||
<option value="code-imgthumb-html" ><?php i18n('HTML_THUMB_ORIG');?></option>
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
<textarea class="copykit" ><?php echo tsl($SITEURL) .'data/uploads/'. $subPath. rawurlencode($src); ?></textarea>
|
|
||||||
<p style="color:#666;font-size:11px;margin:-10px 0 0 0"><a href="#" class="select-all" ><?php i18n('CLIPBOARD_INSTR');?></a></p>
|
|
||||||
</form>
|
|
||||||
<div class="toggle">
|
|
||||||
<p id="code-img-html"><img src="<?php echo tsl($SITEURL) .'data/uploads/'. $subPath. rawurlencode($src); ?>" class="gs_image" height="<?php echo $imgheight; ?>" width="<?php echo $imgwidth; ?>" alt=""></p>
|
|
||||||
<p id="code-img-link"><?php echo tsl($SITEURL) .'data/uploads/'. $subPath. rawurlencode($src); ?></p>
|
|
||||||
<?php if(!empty($thumb_exists)) { ?>
|
|
||||||
<p id="code-thumb-html"><img src="<?php echo tsl($SITEURL) .'data/thumbs/'.$subPath.'thumbnail.'. rawurlencode($src); ?>" class="gs_image gs_thumb" height="<?php echo $thheight; ?>" width="<?php echo $thwidth; ?>" alt=""></p>
|
|
||||||
<p id="code-thumb-link"><?php echo tsl($SITEURL) .'data/thumbs/'.$subPath.'thumbnail.'.rawurlencode($src); ?></p>
|
|
||||||
<p id="code-imgthumb-html"><a href="<?php echo tsl($SITEURL) .'data/uploads/'. $subPath. rawurlencode($src); ?>" class="gs_image_link" ><img src="<?php echo tsl($SITEURL) .'data/thumbs/'.$subPath.'thumbnail.'.rawurlencode($src); ?>" class="gs_thumb" height="<?php echo $thheight; ?>" width="<?php echo $thwidth; ?>" alt="" /></a></p>
|
|
||||||
<?php } ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$jcrop = !empty($thumb_exists);
|
|
||||||
if($jcrop){ ?>
|
|
||||||
<div id="jcrop_open" class="main">
|
|
||||||
<img src="<?php echo $src_folder . $subPath.rawurlencode($src); ?>" id="cropbox" />
|
|
||||||
<div id="handw" class="toggle" ><?php i18n('SELECT_DIMENTIONS'); ?><br /><span id="picw"></span> x <span id="pich"></span></div>
|
|
||||||
<!-- This is the form that our event handler fills -->
|
|
||||||
<form id="jcropform" action="<?php myself(); ?>?i=<?php echo rawurlencode($src); ?>&path=<?php echo $subPath; ?>" method="post" onsubmit="return checkCoords();">
|
|
||||||
<input type="hidden" id="x" name="x" />
|
|
||||||
<input type="hidden" id="y" name="y" />
|
|
||||||
<input type="hidden" id="w" name="w" />
|
|
||||||
<input type="hidden" id="h" name="h" />
|
|
||||||
<input type="submit" class="submit" value="<?php i18n('CREATE_THUMBNAIL');?>" /> <span style="color:#666;font-size:11px;"><?php i18n('CROP_INSTR_NEW');?></span>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="sidebar" >
|
|
||||||
<?php include('template/sidebar-files.php'); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
jQuery(document).ready(function() {
|
|
||||||
|
|
||||||
$(window).load(function(){
|
|
||||||
var api = $.Jcrop('#cropbox',{
|
|
||||||
onChange: updateCoords,
|
|
||||||
onSelect: updateCoords,
|
|
||||||
boxWidth: 585,
|
|
||||||
boxHeight: 500
|
|
||||||
});
|
|
||||||
var isCtrl = false;
|
|
||||||
$(document).keyup(function (e) {
|
|
||||||
api.setOptions({ aspectRatio: 0 });
|
|
||||||
api.focus();
|
|
||||||
if(e.which == 17) isCtrl=false;
|
|
||||||
}).keydown(function (e) {
|
|
||||||
if(e.which == 17) isCtrl=true;
|
|
||||||
if(e.which == 66 && isCtrl == true) {
|
|
||||||
api.setOptions({ aspectRatio: 1 });
|
|
||||||
api.focus();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php get_template('footer'); ?>
|
|
@ -1,804 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* This class implements PHP's zip module. It is usefull if zip module is not available.
|
|
||||||
* Requires zip and unzip binaries.
|
|
||||||
*
|
|
||||||
* @author vadik56
|
|
||||||
* SVN: $Id: ZipArchive.php 2 2009-03-06 00:52:03Z vadik56 $
|
|
||||||
*/
|
|
||||||
class ZipArchive {
|
|
||||||
const CREATE = 1;
|
|
||||||
const EXCL = 2;
|
|
||||||
const CHECKCONS = 4;
|
|
||||||
const OVERWRITE = 8;
|
|
||||||
|
|
||||||
const FL_NOCASE = 1;
|
|
||||||
const FL_NODIR = 2;
|
|
||||||
const FL_COMPRESSED = 4;
|
|
||||||
const FL_UNCHANGED = 8;
|
|
||||||
|
|
||||||
const CM_DEFAULT = -1;
|
|
||||||
const CM_STORE = 0;
|
|
||||||
const CM_SHRINK = 1;
|
|
||||||
const CM_REDUCE_1 = 2;
|
|
||||||
const CM_REDUCE_2 = 3;
|
|
||||||
const CM_REDUCE_3 = 4;
|
|
||||||
const CM_REDUCE_4 = 5;
|
|
||||||
const CM_IMPLODE = 6;
|
|
||||||
const CM_DEFLATE = 8;
|
|
||||||
const CM_DEFLATE64 = 9;
|
|
||||||
const CM_PKWARE_IMPLODE = 10;
|
|
||||||
|
|
||||||
const ER_OK = 0;
|
|
||||||
const ER_MULTIDISK = 1;
|
|
||||||
const ER_RENAME = 2;
|
|
||||||
const ER_CLOSE = 3;
|
|
||||||
const ER_SEEK = 4;
|
|
||||||
const ER_READ = 5;
|
|
||||||
const ER_WRITE = 6;
|
|
||||||
const ER_CRC = 7;
|
|
||||||
const ER_ZIPCLOSED = 8;
|
|
||||||
const ER_NOENT = 9;
|
|
||||||
const ER_EXISTS = 10;
|
|
||||||
const ER_OPEN = 11;
|
|
||||||
const ER_TMPOPEN = 12;
|
|
||||||
const ER_ZLIB = 13;
|
|
||||||
const ER_MEMORY = 14;
|
|
||||||
const ER_CHANGED = 15;
|
|
||||||
const ER_COMPNOTSUPP = 16;
|
|
||||||
const ER_EOF = 17;
|
|
||||||
const ER_INVAL = 18;
|
|
||||||
const ER_NOZIP = 19;
|
|
||||||
const ER_INTERNAL = 20;
|
|
||||||
const ER_INCONS = 21;
|
|
||||||
const ER_REMOVE = 22;
|
|
||||||
const ER_DELETED = 23;
|
|
||||||
|
|
||||||
|
|
||||||
private static $unzip_exec="unzip"; //path to unzip executable
|
|
||||||
private static $zip_exec="zip"; //path to zip executable
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Absolute path to requested zip file.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $zipFilePath;
|
|
||||||
/**
|
|
||||||
* Directory containing temporary zip directory structure(absolute path).
|
|
||||||
* It should not contain trailing slash.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $tempDirPath;
|
|
||||||
private $zip_is_open=false;
|
|
||||||
|
|
||||||
private $fileIndex = array();
|
|
||||||
|
|
||||||
|
|
||||||
public static function setup(){
|
|
||||||
if( defined(ZIP_MODULE_IMPLEMENTATION_PATH) ){
|
|
||||||
$possible_zip_locations = explode(":", ZIP_MODULE_IMPLEMENTATION_PATH);
|
|
||||||
//try to find zip executable
|
|
||||||
foreach($possible_zip_locations as $loc){
|
|
||||||
if( is_executable($loc.DIRECTORY_SEPARATOR."zip") ){
|
|
||||||
self::$zip_exec = $loc.DIRECTORY_SEPARATOR."zip";
|
|
||||||
}else if( is_executable($loc.DIRECTORY_SEPARATOR."unzip") ){
|
|
||||||
self::$unzip_exec = $loc.DIRECTORY_SEPARATOR."unzip";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Open a ZIP file archive
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-open.php
|
|
||||||
* @param filename string <p>
|
|
||||||
* The file name of the ZIP archive to open.
|
|
||||||
* </p>
|
|
||||||
* @param flags int[optional] <p>
|
|
||||||
* The mode to use to open the archive.
|
|
||||||
* <p>
|
|
||||||
* ZIPARCHIVE::OVERWRITE
|
|
||||||
* </p>
|
|
||||||
* @return mixed Error codes
|
|
||||||
* <p>
|
|
||||||
* Returns true on success or the error code.
|
|
||||||
* <p>
|
|
||||||
* ZIPARCHIVE::ER_EXISTS
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* ZIPARCHIVE::ER_INCONS
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* ZIPARCHIVE::ER_INVAL
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* ZIPARCHIVE::ER_MEMORY
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* ZIPARCHIVE::ER_NOENT
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* ZIPARCHIVE::ER_NOZIP
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* ZIPARCHIVE::ER_OPEN
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* ZIPARCHIVE::ER_READ
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* ZIPARCHIVE::ER_SEEK
|
|
||||||
* </p>
|
|
||||||
* </p>
|
|
||||||
*/
|
|
||||||
public function open ($filename, $flags = null) {
|
|
||||||
|
|
||||||
if( is_dir($filename) ){
|
|
||||||
return self::ER_NOZIP;
|
|
||||||
}
|
|
||||||
|
|
||||||
//if zip file exists already exists
|
|
||||||
if( is_file($filename) ){
|
|
||||||
|
|
||||||
if( !is_readable($filename) ){
|
|
||||||
return self::ER_READ;
|
|
||||||
}
|
|
||||||
|
|
||||||
//if user asked for error then return it
|
|
||||||
if( $flags & self::EXCL ){
|
|
||||||
return self::ER_EXISTS;
|
|
||||||
}
|
|
||||||
//if need to create new file but overwrite flag is not defined
|
|
||||||
if(($flags & self::CREATE) && !($flags & self::OVERWRITE) ){
|
|
||||||
return self::ER_EXISTS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//if overwrite then remove file
|
|
||||||
if($flags & self::OVERWRITE){
|
|
||||||
if( is_file($filename) ){
|
|
||||||
if ( !(@unlink($filename)) ){
|
|
||||||
return self::ER_READ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//create/extract directory layout in temporary folder
|
|
||||||
|
|
||||||
|
|
||||||
//create temp dir
|
|
||||||
$tempDir = sys_get_temp_dir();
|
|
||||||
if( $tempDir[strlen($tempDir)-1] != DIRECTORY_SEPARATOR ){
|
|
||||||
$tempDir = $tempDir . DIRECTORY_SEPARATOR;
|
|
||||||
}
|
|
||||||
$this->tempDirPath = $tempDir.__CLASS__. uniqid();
|
|
||||||
if( @mkdir($this->tempDirPath) !== true ) {
|
|
||||||
return self::ER_OPEN;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( is_file($filename) ){
|
|
||||||
//extract zip file to tempDir
|
|
||||||
if( !$this->__extractTo($filename,$this->tempDirPath) ){
|
|
||||||
return self::ER_OPEN;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($filename[0] == '/'){
|
|
||||||
$this->zipFilePath = $filename;
|
|
||||||
}else{
|
|
||||||
$this->zipFilePath = getcwd() .DIRECTORY_SEPARATOR. $filename;
|
|
||||||
}
|
|
||||||
$this->zip_is_open = true;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close the active archive (opened or newly created)
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-close.php
|
|
||||||
* @return bool Returns true on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function close () {
|
|
||||||
if(!$this->zip_is_open){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if( strtolower(substr($this->zipFilePath, strlen($this->zipFilePath)-4)) == ".zip" ){
|
|
||||||
//if $this->zipFilePath has .zip in the end then use this path for zip
|
|
||||||
$target_zip_file = $this->zipFilePath;
|
|
||||||
}else{
|
|
||||||
//else use {$this->tempDirPath}.zip as zip file and then move it to final location
|
|
||||||
$target_zip_file = $this->tempDirPath . ".zip";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$currentWorkingDir = getcwd();
|
|
||||||
if( @chdir($this->tempDirPath) !== True){
|
|
||||||
//unable to chdir to temp directory
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
exec(self::$zip_exec." -m -r {$target_zip_file} * 2>&1", $output, $return_value);
|
|
||||||
chdir($currentWorkingDir);
|
|
||||||
|
|
||||||
if($target_zip_file != $this->zipFilePath){
|
|
||||||
if( @rename($target_zip_file, $this->zipFilePath) !== true){
|
|
||||||
//if unable to copy zip to final destination then return false
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($return_value != 0){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//remove trailing tempdir
|
|
||||||
@rmdir($this->tempDirPath);
|
|
||||||
|
|
||||||
//do cleanup
|
|
||||||
$this->zip_is_open = false;
|
|
||||||
$this->zipFilePath = "";
|
|
||||||
$this->tempDirPath = "";
|
|
||||||
$this->fileIndex = array();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a new directory
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-addemptydir.php
|
|
||||||
* @param dirname string <p>
|
|
||||||
* The directory to add.
|
|
||||||
* </p>
|
|
||||||
* @return bool Returns true on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function addEmptyDir ($dirname) {
|
|
||||||
if(!$this->zip_is_open){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return mkdir($this->tempDirPath .DIRECTORY_SEPARATOR. $dirname );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a file to a ZIP archive using its contents
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-addfromstring.php
|
|
||||||
* @param localname string <p>
|
|
||||||
* The name of the entry to create.
|
|
||||||
* </p>
|
|
||||||
* @param contents string <p>
|
|
||||||
* The contents to use to create the entry. It is used in a binary
|
|
||||||
* safe mode.
|
|
||||||
* </p>
|
|
||||||
* @return bool Returns true on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function addFromString ($localname, $contents) {
|
|
||||||
if(!$this->zip_is_open){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$target_dir = $this->tempDirPath .DIRECTORY_SEPARATOR. dirname($localname);
|
|
||||||
$taget_file = basename($localname);
|
|
||||||
|
|
||||||
//create directory if it does not exist
|
|
||||||
if( ! is_dir($target_dir) ){
|
|
||||||
if(! mkdir($target_dir,0777,true) ){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//create file from string
|
|
||||||
if( file_put_contents($target_dir.DIRECTORY_SEPARATOR.$taget_file,$contents) === False){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds a file to a ZIP archive from the given path
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-addfile.php
|
|
||||||
* @param filename string <p>
|
|
||||||
* The path to the file to add.
|
|
||||||
* </p>
|
|
||||||
* @param localname string[optional] <p>
|
|
||||||
* local name inside ZIP archive.
|
|
||||||
* </p>
|
|
||||||
* @return bool Returns true on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function addFile ($filename, $localname = null) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renames an entry defined by its index
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-renameindex.php
|
|
||||||
* @param index int <p>
|
|
||||||
* Index of the entry to rename.
|
|
||||||
* </p>
|
|
||||||
* @param newname string <p>
|
|
||||||
* New name.
|
|
||||||
* </p>
|
|
||||||
* @return bool Returns true on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function renameIndex ($index, $newname) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renames an entry defined by its name
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-renamename.php
|
|
||||||
* @param name string <p>
|
|
||||||
* Name of the entry to rename.
|
|
||||||
* </p>
|
|
||||||
* @param newname string <p>
|
|
||||||
* New name.
|
|
||||||
* </p>
|
|
||||||
* @return bool Returns true on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function renameName ($name, $newname) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the comment of a ZIP archive
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-setarchivecomment.php
|
|
||||||
* @param comment string <p>
|
|
||||||
* The contents of the comment.
|
|
||||||
* </p>
|
|
||||||
* @return mixed Returns true on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function setArchiveComment ($comment) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the Zip archive comment
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-getarchivecomment.php
|
|
||||||
* @return string the Zip archive comment or false on failure.
|
|
||||||
*/
|
|
||||||
public function getArchiveComment () {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the comment of an entry defined by its index
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-setcommentindex.php
|
|
||||||
* @param index int <p>
|
|
||||||
* Index of the entry.
|
|
||||||
* </p>
|
|
||||||
* @param comment string <p>
|
|
||||||
* The contents of the comment.
|
|
||||||
* </p>
|
|
||||||
* @return mixed Returns true on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function setCommentIndex ($index, $comment) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the comment of an entry defined by its name
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-setCommentName.php
|
|
||||||
* @param name string <p>
|
|
||||||
* Name of the entry.
|
|
||||||
* </p>
|
|
||||||
* @param comment string <p>
|
|
||||||
* The contents of the comment.
|
|
||||||
* </p>
|
|
||||||
* @return mixed Returns true on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function setCommentName ($name, $comment) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the comment of an entry using the entry index
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-getcommentindex.php
|
|
||||||
* @param index int <p>
|
|
||||||
* Index of the entry
|
|
||||||
* </p>
|
|
||||||
* @param flags int[optional] <p>
|
|
||||||
* If flags is set to ZIPARCHIVE::FL_UNCHANGED, the original unchanged
|
|
||||||
* comment is returned.
|
|
||||||
* </p>
|
|
||||||
* @return string the comment on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function getCommentIndex ($index, $flags = null) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the comment of an entry using the entry name
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-getcommentname.php
|
|
||||||
* @param name string <p>
|
|
||||||
* Name of the entry
|
|
||||||
* </p>
|
|
||||||
* @param flags int[optional] <p>
|
|
||||||
* If flags is set to ZIPARCHIVE::FL_UNCHANGED, the original unchanged
|
|
||||||
* comment is returned.
|
|
||||||
* </p>
|
|
||||||
* @return string the comment on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function getCommentName ($name, $flags = null) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* delete an entry in the archive using its index
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-deleteindex.php
|
|
||||||
* @param index int <p>
|
|
||||||
* Index of the entry to delete.
|
|
||||||
* </p>
|
|
||||||
* @return bool Returns true on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function deleteIndex ($index) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* delete an entry in the archive using its name
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-deletename.php
|
|
||||||
* @param name string <p>
|
|
||||||
* Name of the entry to delete.
|
|
||||||
* </p>
|
|
||||||
* @return bool Returns true on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function deleteName ($name) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the details of an entry defined by its name.
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-statname.php
|
|
||||||
* @param name name <p>
|
|
||||||
* Name of the entry
|
|
||||||
* </p>
|
|
||||||
* @param flags int[optional] <p>
|
|
||||||
* The flags argument specifies how the name lookup should be done.
|
|
||||||
* Also, ZIPARCHIVE::FL_UNCHANGED may be ORed to it to request
|
|
||||||
* information about the original file in the archive,
|
|
||||||
* ignoring any changes made.
|
|
||||||
* <p>
|
|
||||||
* ZIPARCHIVE::FL_NOCASE
|
|
||||||
* </p>
|
|
||||||
* @return mixed an array containing the entry details or false on failure.
|
|
||||||
*/
|
|
||||||
public function statName ($name, $flags = null) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the details of an entry defined by its index.
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-statindex.php
|
|
||||||
* @param index int <p>
|
|
||||||
* Index of the entry
|
|
||||||
* </p>
|
|
||||||
* @param flags int[optional] <p>
|
|
||||||
* ZIPARCHIVE::FL_UNCHANGED may be ORed to it to request
|
|
||||||
* information about the original file in the archive,
|
|
||||||
* ignoring any changes made.
|
|
||||||
* </p>
|
|
||||||
* @return mixed an array containing the entry details or false on failure.
|
|
||||||
*/
|
|
||||||
public function statIndex ($index, $flags = null) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the index of the entry in the archive
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-locatename.php
|
|
||||||
* @param name string <p>
|
|
||||||
* The name of the entry to look up
|
|
||||||
* </p>
|
|
||||||
* @param flags int[optional] <p>
|
|
||||||
* The function returns the index of the file named fname in
|
|
||||||
* archive. The flags are specified by ORing the following values,
|
|
||||||
* or 0 for none of them.
|
|
||||||
* <p>
|
|
||||||
* ZIPARCHIVE::FL_NOCASE
|
|
||||||
* </p>
|
|
||||||
* @return mixed the index of the entry on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function locateName ($name, $flags = null) {
|
|
||||||
if(!$this->zip_is_open){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$noDir = ($flags & self::FL_NODIR) ? true:false;
|
|
||||||
$noCase = ($flags & self::FL_NOCASE) ? true:false;
|
|
||||||
|
|
||||||
$loopFile = ($noDir) ? basename($name) : $name ;
|
|
||||||
if($noCase){
|
|
||||||
$search = strtolower($search);
|
|
||||||
}
|
|
||||||
foreach($this->fileIndex as $ind => $fileRelPath){
|
|
||||||
$loopFile = ($noDir) ? basename($fileRelPath) : $fileRelPath ;
|
|
||||||
if($noCase){
|
|
||||||
$loopFile = strtolower($loopFile);
|
|
||||||
}
|
|
||||||
if( $loopFile == $search ){
|
|
||||||
return $ind;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the name of an entry using its index
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-getnameindex.php
|
|
||||||
* @param index int <p>
|
|
||||||
* Index of the entry.
|
|
||||||
* </p>
|
|
||||||
* @return string the name on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function getNameIndex ($index) {
|
|
||||||
if(!$this->zip_is_open){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if(! is_set($this->fileIndex[$index]) ){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return $this->fileIndex[$index];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Revert all global changes done in the archive.
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-unchangearchive.php
|
|
||||||
* @return mixed Returns true on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function unchangeArchive () {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Undo all changes done in the archive.
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-unchangeall.php
|
|
||||||
* @return mixed Returns true on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function unchangeAll () {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Revert all changes done to an entry at the given index.
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-unchangeindex.php
|
|
||||||
* @param index int <p>
|
|
||||||
* Index of the entry.
|
|
||||||
* </p>
|
|
||||||
* @return mixed Returns true on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function unchangeIndex ($index) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Revert all changes done to an entry with the given name.
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-unchangename.php
|
|
||||||
* @param name string <p>
|
|
||||||
* Name of the entry.
|
|
||||||
* </p>
|
|
||||||
* @return mixed Returns true on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function unchangeName ($name) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Extract the archive contents
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-extractto.php
|
|
||||||
* @param destination string <p>
|
|
||||||
* Location where to extract the files.
|
|
||||||
* </p>
|
|
||||||
* @param entries mixed[optional] <p>
|
|
||||||
* The entries to extract. It accepts either a single entry name or
|
|
||||||
* an array of names.
|
|
||||||
* </p>
|
|
||||||
* @return mixed Returns true on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function extractTo ($destination, $entries = null) {
|
|
||||||
if(!$this->zip_is_open){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return $this->__extractTo($this->zipFilePath, $destination, $entries);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function __extractTo($zip_path, $destination, $entries = null) {
|
|
||||||
$return_value=0;
|
|
||||||
$output = array();
|
|
||||||
|
|
||||||
//determine list of files to extract
|
|
||||||
$list = "";
|
|
||||||
if( is_string($entries) ){
|
|
||||||
$list = "'$entries'";
|
|
||||||
}
|
|
||||||
if(is_array($entries)){
|
|
||||||
$list = "'".implode("' '", $entries)."'";
|
|
||||||
}
|
|
||||||
|
|
||||||
exec(self::$unzip_exec." -o {$zip_path} -d {$destination} {$list} 2>&1", $output, $return_value);
|
|
||||||
|
|
||||||
if($return_value != 0){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Returns the entry contents using its name.
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-getfromname.php
|
|
||||||
* @param name string <p>
|
|
||||||
* Name of the entry
|
|
||||||
* </p>
|
|
||||||
* @param flags int[optional] <p>
|
|
||||||
* The flags to use to open the archive. the following values may
|
|
||||||
* be ORed to it.
|
|
||||||
* <p>
|
|
||||||
* ZIPARCHIVE::FL_UNCHANGED
|
|
||||||
* </p>
|
|
||||||
* @return mixed the contents of the entry on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function getFromName ($name, $flags = null) {
|
|
||||||
if(!$this->zip_is_open){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return @file_get_contents($this->tempDirPath .DIRECTORY_SEPARATOR. $name );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the entry contents using its index.
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-getfromindex.php
|
|
||||||
* @param index int <p>
|
|
||||||
* Index of the entry
|
|
||||||
* </p>
|
|
||||||
* @param flags int[optional] <p>
|
|
||||||
* The flags to use to open the archive. the following values may
|
|
||||||
* be ORed to it.
|
|
||||||
* <p>
|
|
||||||
* ZIPARCHIVE::FL_UNCHANGED
|
|
||||||
* </p>
|
|
||||||
* @return mixed the contents of the entry on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function getFromIndex ($index, $flags = null) {
|
|
||||||
if(!$this->zip_is_open){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$localFilePath = $this->getNameIndex($index);
|
|
||||||
if($localFilePath === false){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return $this->getFromName($localFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a file handler to the entry defined by its name (read only).
|
|
||||||
* @link http://php.net/manual/en/function.ziparchive-getstream.php
|
|
||||||
* @param name string <p>
|
|
||||||
* The name of the entry to use.
|
|
||||||
* </p>
|
|
||||||
* @return resource a file pointer (resource) on success or false on failure.
|
|
||||||
*/
|
|
||||||
public function getStream ($name) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param $dir_path absolute path to zip directory
|
|
||||||
*/
|
|
||||||
private function __indexDirRec($dir_path){
|
|
||||||
$dirEntries = scandir($dir_path);
|
|
||||||
|
|
||||||
foreach($dirEntries as $dirEntriy){
|
|
||||||
if( $dirEntriy == "." || $dirEntriy == ".."){
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$subject = $dir_path .DIRECTORY_SEPARATOR. $dirEntriy;
|
|
||||||
|
|
||||||
//if this is directory then index its contents
|
|
||||||
if( is_dir($subject) ){
|
|
||||||
$this->__indexDirRec($subject);
|
|
||||||
}else{
|
|
||||||
//save path as relative path inside zip
|
|
||||||
$this->fileIndex[] = str_replace($this->tempDirPath.DIRECTORY_SEPARATOR, "", $subject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ZipArchive::setup(); //try to find locations of zip/unzip binaries
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Open a ZIP file archive
|
|
||||||
* @link http://php.net/manual/en/function.zip-open.php
|
|
||||||
* @param filename string <p>
|
|
||||||
* The file name of the ZIP archive to open.
|
|
||||||
* </p>
|
|
||||||
* @return mixed a resource handle for later use with
|
|
||||||
* zip_read and zip_close
|
|
||||||
* or returns the number of error if filename does not
|
|
||||||
* exist or in case of other error.
|
|
||||||
*/
|
|
||||||
function zip_open ($filename) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close a ZIP file archive
|
|
||||||
* @link http://php.net/manual/en/function.zip-close.php
|
|
||||||
* @param zip resource <p>
|
|
||||||
* A ZIP file previously opened with zip_open.
|
|
||||||
* </p>
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function zip_close ($zip) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read next entry in a ZIP file archive
|
|
||||||
* @link http://php.net/manual/en/function.zip-read.php
|
|
||||||
* @param zip resource <p>
|
|
||||||
* A ZIP file previously opened with zip_open.
|
|
||||||
* </p>
|
|
||||||
* @return mixed a directory entry resource for later use with the
|
|
||||||
* zip_entry_... functions or false if
|
|
||||||
* there's no more entries to read or number of error in case of other error.
|
|
||||||
*/
|
|
||||||
function zip_read ($zip) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Open a directory entry for reading
|
|
||||||
* @link http://php.net/manual/en/function.zip-entry-open.php
|
|
||||||
* @param zip resource <p>
|
|
||||||
* A valid resource handle returned by zip_open.
|
|
||||||
* </p>
|
|
||||||
* @param zip_entry resource <p>
|
|
||||||
* A directory entry returned by zip_read.
|
|
||||||
* </p>
|
|
||||||
* @param mode string[optional] <p>
|
|
||||||
* Any of the modes specified in the documentation of
|
|
||||||
* fopen.
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* Currently, mode is ignored and is always
|
|
||||||
* "rb". This is due to the fact that zip support
|
|
||||||
* in PHP is read only access.
|
|
||||||
* </p>
|
|
||||||
* @return bool Returns true on success or false on failure.
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* Unlike fopen and other similar functions,
|
|
||||||
* the return value of zip_entry_open only
|
|
||||||
* indicates the result of the operation and is not needed for
|
|
||||||
* reading or closing the directory entry.
|
|
||||||
*/
|
|
||||||
function zip_entry_open ($zip, $zip_entry, $mode = null) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close a directory entry
|
|
||||||
* @link http://php.net/manual/en/function.zip-entry-close.php
|
|
||||||
* @param zip_entry resource <p>
|
|
||||||
* A directory entry previously opened zip_entry_open.
|
|
||||||
* </p>
|
|
||||||
* @return bool Returns true on success or false on failure.
|
|
||||||
*/
|
|
||||||
function zip_entry_close ($zip_entry) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read from an open directory entry
|
|
||||||
* @link http://php.net/manual/en/function.zip-entry-read.php
|
|
||||||
* @param zip_entry resource <p>
|
|
||||||
* A directory entry returned by zip_read.
|
|
||||||
* </p>
|
|
||||||
* @param length int[optional] <p>
|
|
||||||
* The number of bytes to return. If not specified, this function will
|
|
||||||
* attempt to read 1024 bytes.
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* This should be the uncompressed length you wish to read.
|
|
||||||
* </p>
|
|
||||||
* @return string the data read, or false if the end of the file is
|
|
||||||
* reached.
|
|
||||||
*/
|
|
||||||
function zip_entry_read ($zip_entry, $length = null) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve the actual file size of a directory entry
|
|
||||||
* @link http://php.net/manual/en/function.zip-entry-filesize.php
|
|
||||||
* @param zip_entry resource <p>
|
|
||||||
* A directory entry returned by zip_read.
|
|
||||||
* </p>
|
|
||||||
* @return int The size of the directory entry.
|
|
||||||
*/
|
|
||||||
function zip_entry_filesize ($zip_entry) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve the name of a directory entry
|
|
||||||
* @link http://php.net/manual/en/function.zip-entry-name.php
|
|
||||||
* @param zip_entry resource <p>
|
|
||||||
* A directory entry returned by zip_read.
|
|
||||||
* </p>
|
|
||||||
* @return string The name of the directory entry.
|
|
||||||
*/
|
|
||||||
function zip_entry_name ($zip_entry) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve the compressed size of a directory entry
|
|
||||||
* @link http://php.net/manual/en/function.zip-entry-compressedsize.php
|
|
||||||
* @param zip_entry resource <p>
|
|
||||||
* A directory entry returned by zip_read.
|
|
||||||
* </p>
|
|
||||||
* @return int The compressed size.
|
|
||||||
*/
|
|
||||||
function zip_entry_compressedsize ($zip_entry) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve the compression method of a directory entry
|
|
||||||
* @link http://php.net/manual/en/function.zip-entry-compressionmethod.php
|
|
||||||
* @param zip_entry resource <p>
|
|
||||||
* A directory entry returned by zip_read.
|
|
||||||
* </p>
|
|
||||||
* @return string The compression method.
|
|
||||||
*/
|
|
||||||
function zip_entry_compressionmethod ($zip_entry) {}
|
|
||||||
|
|
@ -1,76 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display Available Themes
|
|
||||||
*
|
|
||||||
* This file spits out a list of available themes to the control panel.
|
|
||||||
* This is provided thru an ajax call.
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Available-Themes
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Include common.php
|
|
||||||
include('common.php');
|
|
||||||
login_cookie_check();
|
|
||||||
|
|
||||||
// JSON output of pages for ckeditor select
|
|
||||||
if(isset($_REQUEST['list_pages_json'])) {
|
|
||||||
include_once('plugin_functions.php');
|
|
||||||
include_once('caching_functions.php');
|
|
||||||
getPagesXmlValues();
|
|
||||||
header('Content-type: application/json');
|
|
||||||
echo list_pages_json();
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make sure register globals don't make this hackable again.
|
|
||||||
if (isset($TEMPLATE)) unset($TEMPLATE);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sanitise first
|
|
||||||
* @todo Maybe use Anti-XSS on this instead?
|
|
||||||
*/
|
|
||||||
if (isset($_GET['dir'])) {
|
|
||||||
$TEMPLATE = '';
|
|
||||||
$segments = explode('/',implode('/',explode('\\',$_GET['dir'])));
|
|
||||||
foreach ($segments as $part) if ($part !== '..') $TEMPLATE .= $part.'/';
|
|
||||||
$TEMPLATE = preg_replace('/\/+/','/',$TEMPLATE);
|
|
||||||
if (strlen($TEMPLATE)<=0||$TEMPLATE=='/') unset($TEMPLATE);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send back list of theme files from a certain directory for theme-edit.php
|
|
||||||
if (isset($TEMPLATE)) {
|
|
||||||
$TEMPLATE_FILE = ''; $template = ''; $theme_templates = '';
|
|
||||||
|
|
||||||
if ($template == '') { $template = 'template.php'; }
|
|
||||||
|
|
||||||
if(!filepath_is_safe(GSTHEMESPATH . $TEMPLATE,GSTHEMESPATH)) die();
|
|
||||||
|
|
||||||
$templates = directoryToArray(GSTHEMESPATH . $TEMPLATE . '/', true);
|
|
||||||
$allowed_extensions=array('php','css','js','html','htm');
|
|
||||||
$theme_templates .= '<select class="text" id="theme_files" style="width:425px;" name="f" >';
|
|
||||||
foreach ($templates as $file) {
|
|
||||||
$extension=pathinfo($file,PATHINFO_EXTENSION);
|
|
||||||
if (in_array($extension, $allowed_extensions)){
|
|
||||||
$filename=pathinfo($file,PATHINFO_BASENAME);
|
|
||||||
$filenamefull=substr(strstr($file,'/theme/'.$TEMPLATE.'/'),strlen('/theme/'.$TEMPLATE.'/'));
|
|
||||||
if ($TEMPLATE_FILE == $filename){
|
|
||||||
$sel="selected";
|
|
||||||
} else {
|
|
||||||
$sel="";
|
|
||||||
}
|
|
||||||
if ($filename == 'template.php'){
|
|
||||||
$templatename=i18n_r('DEFAULT_TEMPLATE');
|
|
||||||
} else {
|
|
||||||
$templatename=$filenamefull;
|
|
||||||
}
|
|
||||||
$theme_templates .= '<option '.$sel.' value="'.$templatename.'" >'.$templatename.'</option>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$theme_templates .= "</select>";
|
|
||||||
|
|
||||||
echo $theme_templates;
|
|
||||||
}
|
|
||||||
?>
|
|
@ -1,178 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
* Application Programming Interface Plugin
|
|
||||||
*
|
|
||||||
* @author Chris Cagle
|
|
||||||
*/
|
|
||||||
|
|
||||||
class API_Request {
|
|
||||||
|
|
||||||
var $xml;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Authenticate
|
|
||||||
*
|
|
||||||
* @param string
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
private function auth() {
|
|
||||||
$appid_file = getXML(GSDATAOTHERPATH.'appid.xml');
|
|
||||||
if ($appid_file->status == 'true') {
|
|
||||||
if ( (string)$appid_file->key == (string)$this->xml->key) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
$message = array('status' => 'error', 'message' => i18n_r('API_ERR_AUTHFAILED'));
|
|
||||||
echo json_encode($message);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$message = array('status' => 'error', 'message' => i18n_r('API_ERR_AUTHDISABLED'));
|
|
||||||
echo json_encode($message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function add_data($array) {
|
|
||||||
$this->xml = $array;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Read Page
|
|
||||||
*
|
|
||||||
* @return json
|
|
||||||
*/
|
|
||||||
public function page_read() {
|
|
||||||
if($this->auth()) {
|
|
||||||
$id = (string)$this->xml->data->slug;
|
|
||||||
if (file_exists(GSDATAPAGESPATH.$id.'.xml')) {
|
|
||||||
$page = getXML(GSDATAPAGESPATH.$id.'.xml');
|
|
||||||
$page->content = strip_decode($page->content);
|
|
||||||
$page->metak = strip_decode($page->metak);
|
|
||||||
$page->metad = strip_decode($page->metad);
|
|
||||||
$page->title = strip_decode($page->title);
|
|
||||||
$wrapper = array('status' => 'success', 'message' => 'page_read ok', 'response' => $page);
|
|
||||||
return json_encode($wrapper);
|
|
||||||
} else {
|
|
||||||
$error = array('status' => 'error', 'message' => sprintf(i18n_r('API_ERR_NOPAGE'), $id));
|
|
||||||
return json_encode($error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Read Settings
|
|
||||||
*
|
|
||||||
* @return json
|
|
||||||
*/
|
|
||||||
public function settings_read() {
|
|
||||||
if($this->auth()) {
|
|
||||||
$settings = getXML(GSDATAOTHERPATH.'website.xml');
|
|
||||||
$wrapper = array('status' => 'success', 'message' => 'settings_read ok', 'response' => $settings);
|
|
||||||
return json_encode($wrapper);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Read All Pages
|
|
||||||
*
|
|
||||||
* @return json
|
|
||||||
*/
|
|
||||||
public function all_pages_read() {
|
|
||||||
if($this->auth()) {
|
|
||||||
$pages = get_available_pages();
|
|
||||||
$wrapper = array('status' => 'success', 'message' => 'all_pages_read ok', 'response' => $pages);
|
|
||||||
return json_encode($wrapper);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Upload File
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function file_upload() {
|
|
||||||
if($this->auth()) {
|
|
||||||
|
|
||||||
$patho = (string)$this->xml->data->path;
|
|
||||||
$path = tsl(GSDATAUPLOADPATH . $patho);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Save Page
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function page_save() {
|
|
||||||
if($this->auth()) {
|
|
||||||
$id = (string)$this->xml->data->slug;
|
|
||||||
$thisfile = GSDATAPAGESPATH.$id.'.xml';
|
|
||||||
if (file_exists($thisfile)) {
|
|
||||||
$page = getXML($thisfile);
|
|
||||||
$page->content = safe_slash_html($this->xml->data->content);
|
|
||||||
$page->title = safe_slash_html($this->xml->data->title);
|
|
||||||
$page->pubDate = date('r');
|
|
||||||
$bakfile = GSBACKUPSPATH."pages/". $id .".bak.xml";
|
|
||||||
copy($thisfile, $bakfile);
|
|
||||||
$status = XMLsave($page, $thisfile);
|
|
||||||
if ($status) {
|
|
||||||
touch($thisfile);
|
|
||||||
$wrapper = array('status' => 'success', 'message' => 'page_save ok', 'response' => $page);
|
|
||||||
} else {
|
|
||||||
$wrapper = array('status' => 'error', 'message' => 'There was an error saving your page');
|
|
||||||
}
|
|
||||||
return json_encode($wrapper);
|
|
||||||
} else {
|
|
||||||
$error = array('status' => 'error', 'message' => sprintf(i18n_r('API_ERR_NOPAGE'), $id));
|
|
||||||
return json_encode($error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Read Files
|
|
||||||
*
|
|
||||||
* @return json
|
|
||||||
*/
|
|
||||||
public function all_files_read() {
|
|
||||||
if($this->auth()) {
|
|
||||||
$patho = (string)$this->xml->data->path;
|
|
||||||
$path = tsl(GSDATAUPLOADPATH . $patho);
|
|
||||||
$filesArray = array();
|
|
||||||
$count =0;
|
|
||||||
global $SITEURL;
|
|
||||||
|
|
||||||
$filenames = getFiles($path);
|
|
||||||
if (count($filenames) != 0) {
|
|
||||||
foreach ($filenames as $file) {
|
|
||||||
if ($file == "." || $file == ".." || $file == ".htaccess" ){
|
|
||||||
// not a upload file
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$filesArray[$count]['name'] = $file;
|
|
||||||
if (is_dir($path . $file)) {
|
|
||||||
$filesArray[$count]['type'] = 'folder';
|
|
||||||
} else {
|
|
||||||
$filesArray[$count]['type'] = 'file';
|
|
||||||
$filesArray[$count]['url'] = tsl($SITEURL.'data/uploads/'.$patho).$file;
|
|
||||||
$ext = pathinfo($file,PATHINFO_EXTENSION);
|
|
||||||
$extention = get_FileType($ext);
|
|
||||||
$filesArray[$count]['category'] = $extention;
|
|
||||||
clearstatcache();
|
|
||||||
$ss = stat($path . $file);
|
|
||||||
$filesArray[$count]['date'] = date('c',$ss['ctime']);
|
|
||||||
$filesArray[$count]['size'] = $ss['size'];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$filesArray = subval_sort($filesArray, 'name');
|
|
||||||
$filesArray = subval_sort($filesArray, 'type');
|
|
||||||
$wrapper = array('status' => 'success', 'message' => 'all_files_read ok', 'response' => $filesArray);
|
|
||||||
return json_encode($wrapper);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // end of class
|
|
||||||
?>
|
|
@ -1,104 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
Plugin Name: GetSimple API
|
|
||||||
Description: Connect to your site from an external application
|
|
||||||
Version: 0.1
|
|
||||||
Author: Chris Cagle
|
|
||||||
Author URI: http://www.cagintranet.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
# get correct id for plugin
|
|
||||||
$thisfileapi=basename(__FILE__, ".php");
|
|
||||||
|
|
||||||
|
|
||||||
# register plugin
|
|
||||||
register_plugin(
|
|
||||||
$thisfileapi,
|
|
||||||
'GetSimple API',
|
|
||||||
'0.1',
|
|
||||||
'Chris Cagle',
|
|
||||||
'http://www.cagintranet.com/',
|
|
||||||
'Connect to your site from an external application',
|
|
||||||
'settings',
|
|
||||||
'gsapi_display_cp'
|
|
||||||
);
|
|
||||||
|
|
||||||
# activate hooks
|
|
||||||
add_action('settings-sidebar','createSideMenu',array($thisfileapi, i18n_r('API_CONFIGURATION')));
|
|
||||||
|
|
||||||
function gsapi_display_cp() {
|
|
||||||
$thisdatafile = GSDATAOTHERPATH.'appid.xml';
|
|
||||||
|
|
||||||
# if form as submitted
|
|
||||||
if (isset($_POST['submit'])) {
|
|
||||||
if (isset($_POST['regenerate'])) {
|
|
||||||
$api_key = strtoupper(substr(md5(uniqid(rand(), true)),0,10));
|
|
||||||
} else {
|
|
||||||
$api_key = $_POST['apikey'];
|
|
||||||
}
|
|
||||||
if (isset($_POST['status'])) {
|
|
||||||
$api_status = $_POST['status'];
|
|
||||||
} else {
|
|
||||||
$api_status = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><item></item>');
|
|
||||||
$xml->addChild('status', $api_status);
|
|
||||||
$xml->addChild('key', $api_key);
|
|
||||||
XMLsave($xml, $thisdatafile);
|
|
||||||
}
|
|
||||||
|
|
||||||
# if the api file does not exist
|
|
||||||
if (!file_exists($thisdatafile)) {
|
|
||||||
$xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><item></item>');
|
|
||||||
$xml->addChild('status', 'false');
|
|
||||||
$xml->addChild('key', strtoupper(substr(md5(uniqid(rand(), true)),0,10)) );
|
|
||||||
XMLsave($xml, $thisdatafile);
|
|
||||||
}
|
|
||||||
|
|
||||||
# get data to show in control panel
|
|
||||||
$api=getXML($thisdatafile);
|
|
||||||
$enabled_status = null;
|
|
||||||
if ($api->status == 'true') {
|
|
||||||
$enabled_status = 'checked';
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
<script>
|
|
||||||
jQuery(document).ready(function() {
|
|
||||||
$('a[rel="regenerate"]').live("click", function($e) {
|
|
||||||
$e.preventDefault();
|
|
||||||
$('#regeneratewrap').slideToggle();
|
|
||||||
});
|
|
||||||
$('a.cancel[rel="regenerate"]').live("click", function($e) {
|
|
||||||
$e.preventDefault();
|
|
||||||
$('#regenerate').attr('checked', false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
#regeneratewrap {padding:10px 10px 0 10px;background:#f6f6f6;border:1px solid #e5e5e5;margin-bottom:20px;}
|
|
||||||
code#apicode {font-size:26px;font-weight:bold;color:#cc0000;}
|
|
||||||
</style>
|
|
||||||
<h3>GetSimple <?php i18n('API_CONFIGURATION'); ?></h3>
|
|
||||||
|
|
||||||
<form method="post" action="<?php echo $_SERVER ['REQUEST_URI']?>">
|
|
||||||
<p>
|
|
||||||
<label><input type="checkbox" name="status" value="true" <?php echo $enabled_status; ?> /> <?php i18n('API_ENABLE'); ?> *</label>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<code id="apicode">
|
|
||||||
<?php echo $api->key; ?>
|
|
||||||
<input type="hidden" name="apikey" value="<?php echo $api->key; ?>" />
|
|
||||||
</code> <small><a href="#" rel="regenerate" ><?php i18n('API_REGENKEY'); ?></a></small>
|
|
||||||
</p>
|
|
||||||
<div class="toggle" id="regeneratewrap" >
|
|
||||||
<p><strong><?php i18n('API_CONFIRM'); ?></strong><br /><?php i18n('API_REGEN_DISCLAIMER'); ?> <a href="#" class="cancel" rel="regenerate" ><?php i18n('CANCEL'); ?></a></p>
|
|
||||||
<p><label><?php i18n('API_REGENKEY'); ?>: <input type="checkbox" id="regenerate" name="regenerate" value="true" /></label></p>
|
|
||||||
</div>
|
|
||||||
<p class="submit"><input type="submit" id="submit" class="submit" name="submit" value="<?php i18n('BTN_SAVESETTINGS'); ?>" /></p>
|
|
||||||
</form>
|
|
||||||
<p><span class="hint">* <?php i18n('API_DISCLAIMER'); ?></span></p>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
1273
admin/inc/basic.php
@ -1,326 +0,0 @@
|
|||||||
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
|
|
||||||
/****************************************************
|
|
||||||
*
|
|
||||||
* @File: caching_functions.php
|
|
||||||
* @Package: GetSimple
|
|
||||||
* @since 3.1
|
|
||||||
* @Action: Plugin to create pages.xml and new functions
|
|
||||||
*
|
|
||||||
*****************************************************/
|
|
||||||
|
|
||||||
$pagesArray = array();
|
|
||||||
|
|
||||||
add_action('index-header','getPagesXmlValues',array(false)); // make $pagesArray available to the front
|
|
||||||
add_action('header', 'getPagesXmlValues',array(get_filename_id() != 'pages')); // make $pagesArray available to the back
|
|
||||||
add_action('page-delete', 'create_pagesxml',array(true)); // Create pages.array if page deleted
|
|
||||||
add_action('changedata-aftersave', 'create_pagesxml',array(true)); // Create pages.array if page is updated
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Page Content
|
|
||||||
*
|
|
||||||
* Retrieve and display the content of the requested page.
|
|
||||||
* As the Content is not cahed the file is read in.
|
|
||||||
*
|
|
||||||
* @since 2.0
|
|
||||||
* @param $page - slug of the page to retrieve content
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function getPageContent($page,$field='content'){
|
|
||||||
$thisfile = file_get_contents(GSDATAPAGESPATH.$page.'.xml');
|
|
||||||
$data = simplexml_load_string($thisfile);
|
|
||||||
$content = stripslashes(htmlspecialchars_decode($data->$field, ENT_QUOTES));
|
|
||||||
if ($field=='content'){
|
|
||||||
$content = exec_filter('content',$content);
|
|
||||||
}
|
|
||||||
echo $content;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Page Field
|
|
||||||
*
|
|
||||||
* Retrieve and display the requested field from the given page.
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @param $page - slug of the page to retrieve content
|
|
||||||
* @param $field - the Field to display
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function getPageField($page,$field){
|
|
||||||
global $pagesArray;
|
|
||||||
if(!$pagesArray) getPagesXmlValues();
|
|
||||||
|
|
||||||
if ($field=="content"){
|
|
||||||
getPageContent($page);
|
|
||||||
} else {
|
|
||||||
if (array_key_exists($field, $pagesArray[(string)$page])){
|
|
||||||
echo strip_decode($pagesArray[(string)$page][(string)$field]);
|
|
||||||
} else {
|
|
||||||
getPageContent($page,$field);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Echo Page Field
|
|
||||||
*
|
|
||||||
* Retrieve and display the requested field from the given page.
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @param $page - slug of the page to retrieve content
|
|
||||||
* @param $field - the Field to display
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function echoPageField($page,$field){
|
|
||||||
getPageField($page,$field);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return Page Content
|
|
||||||
*
|
|
||||||
* Return the content of the requested page.
|
|
||||||
* As the Content is not cahed the file is read in.
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @param $page - slug of the page to retrieve content
|
|
||||||
* @param $raw false - if true return raw xml
|
|
||||||
* @param $nofilter false - if true skip content filter execution
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function returnPageContent($page, $field='content', $raw = false, $nofilter = false){
|
|
||||||
$thisfile = file_get_contents(GSDATAPAGESPATH.$page.'.xml');
|
|
||||||
$data = simplexml_load_string($thisfile);
|
|
||||||
$content = $data->$field;
|
|
||||||
if(!$raw) $content = stripslashes(htmlspecialchars_decode($content, ENT_QUOTES));
|
|
||||||
if ($field=='content' and !$nofilter){
|
|
||||||
$content = exec_filter('content',$content);
|
|
||||||
}
|
|
||||||
return $content;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Page Field
|
|
||||||
*
|
|
||||||
* Retrieve and display the requested field from the given page.
|
|
||||||
* If the field is "content" it will call returnPageContent()
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @param $page - slug of the page to retrieve content
|
|
||||||
* @param $field - the Field to display
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function returnPageField($page,$field){
|
|
||||||
global $pagesArray;
|
|
||||||
if(!$pagesArray) getPagesXmlValues();
|
|
||||||
|
|
||||||
if ($field=="content"){
|
|
||||||
$ret=returnPageContent($page);
|
|
||||||
} else {
|
|
||||||
if (array_key_exists($field, $pagesArray[(string)$page])){
|
|
||||||
$ret=strip_decode(@$pagesArray[(string)$page][(string)$field]);
|
|
||||||
} else {
|
|
||||||
$ret = returnPageContent($page,$field);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Page Children
|
|
||||||
*
|
|
||||||
* Return an Array of pages that are children of the requested page/slug
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @param $page - slug of the page to retrieve content
|
|
||||||
*
|
|
||||||
* @returns - Array of slug names
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function getChildren($page){
|
|
||||||
global $pagesArray;
|
|
||||||
if(!$pagesArray) getPagesXmlValues();
|
|
||||||
$returnArray = array();
|
|
||||||
foreach ($pagesArray as $key => $value) {
|
|
||||||
if ($pagesArray[$key]['parent']==$page){
|
|
||||||
$returnArray[]=$key;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $returnArray;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Page Children - returns multi fields
|
|
||||||
*
|
|
||||||
* Return an Array of pages that are children of the requested page/slug with optional fields.
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @param $page - slug of the page to retrieve content
|
|
||||||
* @param options - array of optional fields to return
|
|
||||||
*
|
|
||||||
* @returns - Array of slug names and optional fields.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
function getChildrenMulti($page,$options=array()){
|
|
||||||
global $pagesArray;
|
|
||||||
if(!$pagesArray) getPagesXmlValues();
|
|
||||||
$count=0;
|
|
||||||
$returnArray = array();
|
|
||||||
foreach ($pagesArray as $key => $value) {
|
|
||||||
if ($pagesArray[$key]['parent']==$page){
|
|
||||||
$returnArray[$count]=array();
|
|
||||||
$returnArray[$count]['url']=$key;
|
|
||||||
foreach ($options as $option){
|
|
||||||
$returnArray[$count][$option]=returnPageField($key,$option);
|
|
||||||
}
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $returnArray;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Cached Pages XML Values
|
|
||||||
*
|
|
||||||
* Loads the Cached XML data into the Array $pagesArray
|
|
||||||
* If the file does not exist it is created the first time.
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function getPagesXmlValues($chkcount=false){
|
|
||||||
global $pagesArray;
|
|
||||||
|
|
||||||
// debugLog(__FUNCTION__.": chkcount - " .(int)$chkcount);
|
|
||||||
|
|
||||||
// if page cache not load load it
|
|
||||||
if(!$pagesArray){
|
|
||||||
$pagesArray=array();
|
|
||||||
$file=GSDATAOTHERPATH."pages.xml";
|
|
||||||
if (file_exists($file)){
|
|
||||||
// load the xml file and setup the array.
|
|
||||||
// debugLog(__FUNCTION__.": load pages.xml");
|
|
||||||
$thisfile = file_get_contents($file);
|
|
||||||
$data = simplexml_load_string($thisfile);
|
|
||||||
$pages = $data->item;
|
|
||||||
foreach ($pages as $page) {
|
|
||||||
$key=$page->url;
|
|
||||||
$pagesArray[(string)$key]=array();
|
|
||||||
foreach ($page->children() as $opt=>$val) {
|
|
||||||
$pagesArray[(string)$key][(string)$opt]=(string)$val;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// no page cache, regen and then load it
|
|
||||||
// debugLog(__FUNCTION__.": pages.xml not exist");
|
|
||||||
if(create_pagesxml(true)) getPagesXmlValues(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// if checking cache sync, regen cache if pages differ.
|
|
||||||
if ($chkcount==true){
|
|
||||||
$path = GSDATAPAGESPATH;
|
|
||||||
$dir_handle = @opendir($path) or die("getPageXmlValues: Unable to open $path");
|
|
||||||
$filenames = array();
|
|
||||||
while ($filename = readdir($dir_handle)) {
|
|
||||||
$ext = substr($filename, strrpos($filename, '.') + 1);
|
|
||||||
if ($ext=="xml"){
|
|
||||||
$filenames[] = $filename;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (count($pagesArray)!=count($filenames)) {
|
|
||||||
// debugLog(__FUNCTION__.": count differs regen pages.xml");
|
|
||||||
if(create_pagesxml(true)) getPagesXmlValues(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create the Cached Pages XML file
|
|
||||||
*
|
|
||||||
* Reads in each page of the site and creates a single XML file called
|
|
||||||
* data/pages/pages.array
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function create_pagesxml($flag){
|
|
||||||
global $pagesArray;
|
|
||||||
|
|
||||||
$success = '';
|
|
||||||
|
|
||||||
// debugLog("create_pagesxml: " . $flag);
|
|
||||||
if ((isset($_GET['upd']) && $_GET['upd']=="edit-success") || $flag===true || $flag=='true'){
|
|
||||||
$pagesArray = array();
|
|
||||||
// debugLog("create_pagesxml proceeding");
|
|
||||||
$menu = '';
|
|
||||||
$filem=GSDATAOTHERPATH."pages.xml";
|
|
||||||
|
|
||||||
$path = GSDATAPAGESPATH;
|
|
||||||
$dir_handle = @opendir($path) or die("create_pagesxml: Unable to open $path");
|
|
||||||
$filenames = array();
|
|
||||||
while ($filename = readdir($dir_handle)) {
|
|
||||||
$ext = substr($filename, strrpos($filename, '.') + 1);
|
|
||||||
if ($ext=="xml"){
|
|
||||||
$filenames[] = $filename;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$count=0;
|
|
||||||
$xml = @new SimpleXMLExtended('<channel></channel>');
|
|
||||||
if (count($filenames) != 0) {
|
|
||||||
foreach ($filenames as $file) {
|
|
||||||
if ($file == "." || $file == ".." || is_dir(GSDATAPAGESPATH.$file) || $file == ".htaccess" ) {
|
|
||||||
// not a page data file
|
|
||||||
} else {
|
|
||||||
$thisfile = file_get_contents($path.$file);
|
|
||||||
$data = simplexml_load_string($thisfile);
|
|
||||||
$count++;
|
|
||||||
$id=$data->url;
|
|
||||||
|
|
||||||
$pages = $xml->addChild('item');
|
|
||||||
// $pages->addChild('url', $id);
|
|
||||||
// $pagesArray[(string)$id]['url']=(string)$id;
|
|
||||||
|
|
||||||
foreach ($data->children() as $item => $itemdata) {
|
|
||||||
if ($item!="content"){
|
|
||||||
$note = $pages->addChild($item);
|
|
||||||
$note->addCData($itemdata);
|
|
||||||
$pagesArray[(string)$id][$item]=(string)$itemdata;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$note = $pages->addChild('slug');
|
|
||||||
$note->addCData($id);
|
|
||||||
$pagesArray[(string)$id]['slug']=(string)$id;
|
|
||||||
|
|
||||||
$pagesArray[(string)$id]['filename']=$file;
|
|
||||||
$note = $pages->addChild('filename');
|
|
||||||
$note->addCData($file);
|
|
||||||
|
|
||||||
} // else
|
|
||||||
} // end foreach
|
|
||||||
} // endif
|
|
||||||
if ($flag===true || $flag == 'true'){
|
|
||||||
|
|
||||||
// Plugin Authors should add custom fields etc.. here
|
|
||||||
$xml = exec_filter('pagecache',$xml);
|
|
||||||
|
|
||||||
// sanity check in case the filter does not come back properly or returns null
|
|
||||||
if($xml){
|
|
||||||
$success = $xml->asXML($filem);
|
|
||||||
}
|
|
||||||
// debugLog("create_pagesxml saved: ". $success);
|
|
||||||
exec_action('pagecache-aftersave');
|
|
||||||
return $success;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
@ -1,339 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Common Setup File
|
|
||||||
*
|
|
||||||
* This file initializes up most variables for the site. It is also where most files
|
|
||||||
* are included from. It also reads and stores certain variables.
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage init
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Headers
|
|
||||||
*/
|
|
||||||
|
|
||||||
// charset utf-8
|
|
||||||
header('content-type: text/html; charset=utf-8');
|
|
||||||
|
|
||||||
// no-cache headers
|
|
||||||
if(!isset($base)){
|
|
||||||
$timestamp = gmdate("D, d M Y H:i:s") . " GMT";
|
|
||||||
header("Expires: " . $timestamp);
|
|
||||||
header("Last-Modified: " . $timestamp);
|
|
||||||
header("Pragma: no-cache");
|
|
||||||
header("Cache-Control: no-cache, must-revalidate");
|
|
||||||
}
|
|
||||||
|
|
||||||
define('IN_GS', TRUE); // GS enviroment flag
|
|
||||||
|
|
||||||
// GS Debugger
|
|
||||||
global $GS_debug; // GS debug trace array
|
|
||||||
if(!isset($GS_debug)) $GS_debug = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Debug Console Log
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
*
|
|
||||||
* @param $txt string
|
|
||||||
*/
|
|
||||||
function debugLog($txt = '') {
|
|
||||||
global $GS_debug;
|
|
||||||
array_push($GS_debug,$txt);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set PHP enviroment
|
|
||||||
*/
|
|
||||||
if(function_exists('mb_internal_encoding')) mb_internal_encoding("UTF-8"); // set multibyte encoding
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GSCONFIG definitions
|
|
||||||
*/
|
|
||||||
if(!defined('GSSTYLEWIDE')) define('GSSTYLEWIDE','wide'); // wide style sheet
|
|
||||||
if(!defined('GSSTYLE_SBFIXED')) define('GSSTYLE_SBFIXED','sbfixed'); // fixed sidebar
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bad stuff protection
|
|
||||||
*/
|
|
||||||
include_once('security_functions.php');
|
|
||||||
|
|
||||||
if (version_compare(PHP_VERSION, "5") >= 0) {
|
|
||||||
foreach ($_GET as &$xss) $xss = antixss($xss);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Basic file inclusions
|
|
||||||
*/
|
|
||||||
include('basic.php');
|
|
||||||
include('template_functions.php');
|
|
||||||
include('logging.class.php');
|
|
||||||
|
|
||||||
define('GSROOTPATH', get_root_path());
|
|
||||||
|
|
||||||
if(!is_frontend()){
|
|
||||||
if (file_exists(GSROOTPATH . 'gsconfig.php')) {
|
|
||||||
require_once(GSROOTPATH . 'gsconfig.php');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (defined('GSADMIN')) {
|
|
||||||
$GSADMIN = GSADMIN;
|
|
||||||
} else {
|
|
||||||
$GSADMIN = 'admin';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define some constants
|
|
||||||
*/
|
|
||||||
define('GSADMINPATH', get_admin_path());
|
|
||||||
define('GSADMININCPATH', GSADMINPATH. 'inc/');
|
|
||||||
define('GSPLUGINPATH', GSROOTPATH. 'plugins/');
|
|
||||||
define('GSLANGPATH', GSADMINPATH. 'lang/');
|
|
||||||
define('GSDATAPATH', GSROOTPATH. 'data/');
|
|
||||||
define('GSDATAOTHERPATH', GSROOTPATH. 'data/other/');
|
|
||||||
define('GSDATAPAGESPATH', GSROOTPATH. 'data/pages/');
|
|
||||||
define('GSDATAUPLOADPATH', GSROOTPATH. 'data/uploads/');
|
|
||||||
define('GSTHUMBNAILPATH', GSROOTPATH. 'data/thumbs/');
|
|
||||||
define('GSBACKUPSPATH', GSROOTPATH. 'backups/');
|
|
||||||
define('GSTHEMESPATH', GSROOTPATH. 'theme/');
|
|
||||||
define('GSUSERSPATH', GSROOTPATH. 'data/users/');
|
|
||||||
define('GSBACKUSERSPATH', GSROOTPATH. 'backups/users/');
|
|
||||||
define('GSCACHEPATH', GSROOTPATH. 'data/cache/');
|
|
||||||
define('GSAUTOSAVEPATH', GSROOTPATH. 'data/pages/autosave/');
|
|
||||||
|
|
||||||
$reservedSlugs = array($GSADMIN,'data','theme','plugins','backups');
|
|
||||||
|
|
||||||
require_once(GSADMININCPATH.'configuration.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Debugging
|
|
||||||
*/
|
|
||||||
if ( isDebug() ) {
|
|
||||||
error_reporting(-1);
|
|
||||||
ini_set('display_errors', 1);
|
|
||||||
} else if( getDef('SUPRESSERRORS',true) ) {
|
|
||||||
error_reporting(0);
|
|
||||||
ini_set('display_errors', 0);
|
|
||||||
}
|
|
||||||
ini_set('log_errors', 1);
|
|
||||||
ini_set('error_log', GSDATAOTHERPATH .'logs/errorlog.txt');
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Variable check to prevent debugging going off
|
|
||||||
* @todo some of these may not even be needed anymore
|
|
||||||
*/
|
|
||||||
$admin_relative = (isset($admin_relative)) ? $admin_relative : '';
|
|
||||||
$lang_relative = (isset($lang_relative)) ? $lang_relative : '';
|
|
||||||
$load['login'] = (isset($load['login'])) ? $load['login'] : '';
|
|
||||||
$load['plugin'] = (isset($load['plugin'])) ? $load['plugin'] : '';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Pull data from storage
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** grab website data */
|
|
||||||
$thisfilew = GSDATAOTHERPATH .'website.xml';
|
|
||||||
if (file_exists($thisfilew)) {
|
|
||||||
$dataw = getXML($thisfilew);
|
|
||||||
$SITENAME = stripslashes($dataw->SITENAME);
|
|
||||||
$SITEURL = $dataw->SITEURL;
|
|
||||||
$TEMPLATE = $dataw->TEMPLATE;
|
|
||||||
$PRETTYURLS = $dataw->PRETTYURLS;
|
|
||||||
$PERMALINK = $dataw->PERMALINK;
|
|
||||||
} else {
|
|
||||||
$SITENAME = '';
|
|
||||||
$SITEURL = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** grab user data */
|
|
||||||
if (isset($_COOKIE['GS_ADMIN_USERNAME'])) {
|
|
||||||
$cookie_user_id = _id($_COOKIE['GS_ADMIN_USERNAME']);
|
|
||||||
if (file_exists(GSUSERSPATH . $cookie_user_id.'.xml')) {
|
|
||||||
$datau = getXML(GSUSERSPATH . $cookie_user_id.'.xml');
|
|
||||||
$USR = stripslashes($datau->USR);
|
|
||||||
$HTMLEDITOR = $datau->HTMLEDITOR;
|
|
||||||
$TIMEZONE = $datau->TIMEZONE;
|
|
||||||
$LANG = $datau->LANG;
|
|
||||||
} else {
|
|
||||||
$USR = null;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$USR = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Language control
|
|
||||||
*/
|
|
||||||
if(!isset($LANG) || $LANG == '') {
|
|
||||||
$filenames = glob(GSLANGPATH.'*.php');
|
|
||||||
$cntlang = count($filenames);
|
|
||||||
if ($cntlang == 1) {
|
|
||||||
// assign lang to only existing file
|
|
||||||
$LANG = basename($filenames[0], ".php");
|
|
||||||
} elseif($cntlang > 1 && in_array(GSLANGPATH .'en_US.php',$filenames)) {
|
|
||||||
// fallback to en_US if it exists
|
|
||||||
$LANG = 'en_US';
|
|
||||||
} elseif(isset($filenames[0])) {
|
|
||||||
// fallback to first lang found
|
|
||||||
$LANG=basename($filenames[0], ".php");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
i18n_merge(null); // load $LANG file into $i18n
|
|
||||||
|
|
||||||
// Merge in default lang to avoid empty lang tokens
|
|
||||||
// if GSMERGELANG is undefined or false merge en_US else merge custom
|
|
||||||
if(getDef('GSMERGELANG', true) !== false and !getDef('GSMERGELANG', true) ){
|
|
||||||
if($LANG !='en_US') i18n_merge(null,"en_US");
|
|
||||||
} else{
|
|
||||||
// merge GSMERGELANG defined lang if not the same as $LANG
|
|
||||||
if($LANG !=getDef('GSMERGELANG') ) i18n_merge(null,getDef('GSMERGELANG'));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Init Editor globals
|
|
||||||
* @uses $EDHEIGHT
|
|
||||||
* @uses $EDLANG
|
|
||||||
* @uses $EDTOOL js array string | php array | 'none' | ck toolbar_ name
|
|
||||||
* @uses $EDOPTIONS js obj param strings, comma delimited
|
|
||||||
*/
|
|
||||||
if (defined('GSEDITORHEIGHT')) { $EDHEIGHT = GSEDITORHEIGHT .'px'; } else { $EDHEIGHT = '500px'; }
|
|
||||||
if (defined('GSEDITORLANG')) { $EDLANG = GSEDITORLANG; } else { $EDLANG = i18n_r('CKEDITOR_LANG'); }
|
|
||||||
if (defined('GSEDITORTOOL') and !isset($EDTOOL)) { $EDTOOL = GSEDITORTOOL; }
|
|
||||||
if (defined('GSEDITOROPTIONS') and !isset($EDOPTIONS) && trim(GSEDITOROPTIONS)!="" ) $EDOPTIONS = GSEDITOROPTIONS;
|
|
||||||
|
|
||||||
if(!isset($EDTOOL)) $EDTOOL = 'basic'; // default gs toolbar
|
|
||||||
|
|
||||||
if($EDTOOL == "none") $EDTOOL = null; // toolbar to use cke default
|
|
||||||
$EDTOOL = returnJsArray($EDTOOL);
|
|
||||||
// if($EDTOOL === null) $EDTOOL = 'null'; // not supported in cke 3.x
|
|
||||||
// at this point $EDTOOL should always be a valid js nested array ([[ ]]) or escaped toolbar id ('toolbar_id')
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Timezone setup
|
|
||||||
*/
|
|
||||||
|
|
||||||
// set defined timezone from config if not set on user
|
|
||||||
if( (!isset($TIMEZONE) || trim($TIMEZONE) == '' ) && defined('GSTIMEZONE') ){
|
|
||||||
$TIMEZONE = GSTIMEZONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($TIMEZONE) && function_exists('date_default_timezone_set') && ($TIMEZONE != "" || stripos($TIMEZONE, '--')) ) {
|
|
||||||
date_default_timezone_set($TIMEZONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Variable Globalization
|
|
||||||
*/
|
|
||||||
global $SITENAME, $SITEURL, $TEMPLATE, $TIMEZONE, $LANG, $SALT, $i18n, $USR, $PERMALINK, $GSADMIN, $components, $EDTOOL, $EDOPTIONS, $EDLANG, $EDHEIGHT;
|
|
||||||
|
|
||||||
/** grab authorization and security data */
|
|
||||||
if (defined('GSUSECUSTOMSALT')) {
|
|
||||||
// use GSUSECUSTOMSALT
|
|
||||||
$SALT = sha1(GSUSECUSTOMSALT);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// use from authorization.xml
|
|
||||||
if (file_exists(GSDATAOTHERPATH .'authorization.xml')) {
|
|
||||||
$dataa = getXML(GSDATAOTHERPATH .'authorization.xml');
|
|
||||||
$SALT = stripslashes($dataa->apikey);
|
|
||||||
} else {
|
|
||||||
if($SITEURL !='' && get_filename_id() != 'install' && get_filename_id() != 'setup' && get_filename_id() != 'update' && get_filename_id() != 'style'){
|
|
||||||
die(i18n_r('KILL_CANT_CONTINUE')."<br/>".i18n_r('MISSING_FILE').": "."authorization.xml");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$SESSIONHASH = sha1($SALT . $SITENAME);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* $base is if the site is being viewed from the front-end
|
|
||||||
*/
|
|
||||||
if(isset($base)) {
|
|
||||||
include_once(GSADMININCPATH.'theme_functions.php');
|
|
||||||
}
|
|
||||||
|
|
||||||
function serviceUnavailable(){
|
|
||||||
GLOBAL $base;
|
|
||||||
if(isset($base)){
|
|
||||||
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
|
||||||
header('Status: 503 Service Temporarily Unavailable');
|
|
||||||
header('Retry-After: 7200'); // in seconds
|
|
||||||
i18n('SERVICE_UNAVAILABLE');
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check to make sure site is already installed
|
|
||||||
*/
|
|
||||||
if (get_filename_id() != 'install' && get_filename_id() != 'setup' && get_filename_id() != 'update') {
|
|
||||||
$fullpath = suggest_site_path();
|
|
||||||
|
|
||||||
# if there is no SITEURL set, then it's a fresh install. Start installation process
|
|
||||||
# siteurl check is not good for pre 3.0 since it will be empty, so skip and run update first.
|
|
||||||
if ($SITEURL == '' && get_gs_version() >= 3.0) {
|
|
||||||
serviceUnavailable();
|
|
||||||
redirect($fullpath . $GSADMIN.'/install.php');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
# if an update file was included in the install package, redirect there first
|
|
||||||
if (file_exists(GSADMINPATH.'update.php') && !isset($_GET['updated']) && !getDef('GSDEBUGINSTALL')) {
|
|
||||||
serviceUnavailable();
|
|
||||||
redirect($fullpath . $GSADMIN.'/update.php');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!getDef('GSDEBUGINSTALL',true)){
|
|
||||||
# if you've made it this far, the site is already installed so remove the installation files
|
|
||||||
$filedeletionstatus=true;
|
|
||||||
if (file_exists(GSADMINPATH.'install.php')) {
|
|
||||||
$filedeletionstatus = unlink(GSADMINPATH.'install.php');
|
|
||||||
}
|
|
||||||
if (file_exists(GSADMINPATH.'setup.php')) {
|
|
||||||
$filedeletionstatus = unlink(GSADMINPATH.'setup.php');
|
|
||||||
}
|
|
||||||
if (file_exists(GSADMINPATH.'update.php')) {
|
|
||||||
$filedeletionstatus = unlink(GSADMINPATH.'update.php');
|
|
||||||
}
|
|
||||||
if (!$filedeletionstatus) {
|
|
||||||
$error = sprintf(i18n_r('ERR_CANNOT_DELETE'), '<code>/'.$GSADMIN.'/install.php</code>, <code>/'.$GSADMIN.'/setup.php</code> or <code>/'.$GSADMIN.'/update.php</code>');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Include other files depending if they are needed or not
|
|
||||||
*/
|
|
||||||
include_once(GSADMININCPATH.'cookie_functions.php');
|
|
||||||
if(isset($load['plugin']) && $load['plugin']){
|
|
||||||
# remove the pages.php plugin if it exists.
|
|
||||||
if (file_exists(GSPLUGINPATH.'pages.php')) {
|
|
||||||
unlink(GSPLUGINPATH.'pages.php');
|
|
||||||
}
|
|
||||||
include_once(GSADMININCPATH.'plugin_functions.php');
|
|
||||||
if(get_filename_id()=='settings' || get_filename_id()=='load') {
|
|
||||||
/* this core plugin only needs to be visible when you are viewing the
|
|
||||||
settings page since that is where its sidebar item is. */
|
|
||||||
if (defined('GSEXTAPI') && GSEXTAPI==1) {
|
|
||||||
include_once('api.plugin.php');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# include core plugin for page caching
|
|
||||||
include_once('caching_functions.php');
|
|
||||||
|
|
||||||
# main hook for common.php
|
|
||||||
exec_action('common');
|
|
||||||
|
|
||||||
}
|
|
||||||
if(isset($load['login']) && $load['login']){ include_once(GSADMININCPATH.'login_functions.php'); }
|
|
||||||
?>
|
|
@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Configuration File
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Config
|
|
||||||
*/
|
|
||||||
|
|
||||||
$site_full_name = 'GetSimple';
|
|
||||||
$site_version_no = '3.3.2';
|
|
||||||
$name_url_clean = lowercase(str_replace(' ','-',$site_full_name));
|
|
||||||
$ver_no_clean = str_replace('.','',$site_version_no);
|
|
||||||
$site_link_back_url = 'http://get-simple.info/';
|
|
||||||
|
|
||||||
$cookie_name = lowercase($name_url_clean) .'_cookie_'. $ver_no_clean;
|
|
||||||
$cookie_login = 'index.php';
|
|
||||||
$cookie_time = '10800'; // in seconds, 3 hours
|
|
||||||
|
|
||||||
$api_url = 'http://get-simple.info/api/start/v3.php';
|
|
||||||
# $api_timeout = 800; // time in ms defaults to 500
|
|
||||||
|
|
||||||
|
|
||||||
if (isset($_GET['redirect'])){
|
|
||||||
$cookie_redirect = $_GET['redirect'];
|
|
||||||
} else {
|
|
||||||
$cookie_redirect = 'pages.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!defined('GSVERSION')) define('GSVERSION', $site_version_no);
|
|
||||||
|
|
||||||
?>
|
|
@ -1,101 +0,0 @@
|
|||||||
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
|
|
||||||
/**
|
|
||||||
* Cookie Functions
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Login
|
|
||||||
*/
|
|
||||||
require_once(GSADMININCPATH.'configuration.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create Cookie
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses $USR
|
|
||||||
* @uses $SALT
|
|
||||||
* @uses $cookie_time
|
|
||||||
* @uses $cookie_name
|
|
||||||
*/
|
|
||||||
function create_cookie() {
|
|
||||||
global $USR,$SALT,$cookie_time,$cookie_name;
|
|
||||||
$saltUSR = $USR.$SALT;
|
|
||||||
$saltCOOKIE = sha1($cookie_name.$SALT);
|
|
||||||
setcookie($saltCOOKIE, sha1($saltUSR), time() + $cookie_time,'/');
|
|
||||||
setcookie('GS_ADMIN_USERNAME', $USR, time() + $cookie_time,'/');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Kill Cookie
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses $SALT
|
|
||||||
*
|
|
||||||
* @params string $identifier Name of the cookie to kill
|
|
||||||
*/
|
|
||||||
function kill_cookie($identifier) {
|
|
||||||
global $SALT;
|
|
||||||
$saltCOOKIE = sha1($identifier.$SALT);
|
|
||||||
setcookie('GS_ADMIN_USERNAME', 'null', time() - 3600,'/');
|
|
||||||
if (isset($_COOKIE[$saltCOOKIE])) {
|
|
||||||
$_COOKIE[$saltCOOKIE] = FALSE;
|
|
||||||
setcookie($saltCOOKIE, FALSE, time() - 3600,'/');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Cookie Checker
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses $SALT
|
|
||||||
* @uses $USR
|
|
||||||
* @uses $cookie_name
|
|
||||||
* @uses GSCOOKIEISSITEWIDE
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
function cookie_check() {
|
|
||||||
global $USR,$SALT,$cookie_name;
|
|
||||||
$saltUSR = $USR.$SALT;
|
|
||||||
$saltCOOKIE = sha1($cookie_name.$SALT);
|
|
||||||
if(isset($_COOKIE[$saltCOOKIE])&&$_COOKIE[$saltCOOKIE]==sha1($saltUSR)) {
|
|
||||||
return TRUE; // Cookie proves logged in status.
|
|
||||||
} else {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check Login Cookie
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses $cookie_login
|
|
||||||
* @uses cookie_check
|
|
||||||
* @uses redirect
|
|
||||||
*/
|
|
||||||
function login_cookie_check() {
|
|
||||||
global $cookie_login;
|
|
||||||
if(cookie_check()) {
|
|
||||||
create_cookie();
|
|
||||||
} else {
|
|
||||||
$qstring = filter_queryString(array('id'));
|
|
||||||
$redirect_url = $cookie_login.'?redirect='.myself(FALSE).'?'.$qstring;
|
|
||||||
redirect($redirect_url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Cookie
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @global $_COOKIE
|
|
||||||
* @uses cookie_check
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
function get_cookie($cookie_name) {
|
|
||||||
if(cookie_check($cookie_name)==TRUE) {
|
|
||||||
return $_COOKIE[$cookie_name];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
@ -1,212 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Thumbnail Class for Image Generator
|
|
||||||
*
|
|
||||||
* @link //www.zubrag.com/scripts/
|
|
||||||
* @version 1.3
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Images
|
|
||||||
*/
|
|
||||||
|
|
||||||
class Zubrag_image {
|
|
||||||
|
|
||||||
var $save_to_file = true;
|
|
||||||
var $image_type = -1;
|
|
||||||
var $quality = 100;
|
|
||||||
var $max_x = 100;
|
|
||||||
var $max_y = 100;
|
|
||||||
var $cut_x = 0;
|
|
||||||
var $cut_y = 0;
|
|
||||||
|
|
||||||
function SaveImage($im, $filename) {
|
|
||||||
|
|
||||||
$res = null;
|
|
||||||
|
|
||||||
// ImageGIF is not included into some GD2 releases, so it might not work
|
|
||||||
// output png if gifs are not supported
|
|
||||||
if(($this->image_type == 1) && !function_exists('imagegif')) $this->image_type = 3;
|
|
||||||
|
|
||||||
switch ($this->image_type) {
|
|
||||||
case 1:
|
|
||||||
if ($this->save_to_file) {
|
|
||||||
header("Content-type: image/gif");
|
|
||||||
$res = ImageGIF($im,$filename);
|
|
||||||
$res = ImageGIF($im,NULL);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
header("Content-type: image/gif");
|
|
||||||
$res = ImageGIF($im,$filename);
|
|
||||||
$res = ImageGIF($im,NULL);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
if ($this->save_to_file) {
|
|
||||||
header("Content-type: image/jpeg");
|
|
||||||
$res = ImageJPEG($im,$filename,$this->quality);
|
|
||||||
$res = ImageJPEG($im,NULL,$this->quality);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
header("Content-type: image/jpeg");
|
|
||||||
$res = ImageJPEG($im,$filename,$this->quality);
|
|
||||||
$res = ImageJPEG($im,NULL,$this->quality);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
if (PHP_VERSION >= '5.1.2') {
|
|
||||||
// Convert to PNG quality.
|
|
||||||
// PNG quality: 0 (best quality, bigger file) to 9 (worst quality, smaller file)
|
|
||||||
$quality = 9 - min( round($this->quality / 10), 9 );
|
|
||||||
if ($this->save_to_file) {
|
|
||||||
header("Content-type: image/png");
|
|
||||||
$res = ImagePNG($im, $filename, $quality);
|
|
||||||
$res = ImagePNG($im, NULL, $quality);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
header("Content-type: image/png");
|
|
||||||
$res = ImagePNG($im, $filename, $quality);
|
|
||||||
$res = ImagePNG($im, NULL, $quality);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if ($this->save_to_file) {
|
|
||||||
header("Content-type: image/png");
|
|
||||||
$res = ImagePNG($im, $filename);
|
|
||||||
$res = ImagePNG($im);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
header("Content-type: image/png");
|
|
||||||
$res = ImagePNG($im, $filename);
|
|
||||||
$res = ImagePNG($im);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $res;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function ImageCreateFromType($type,$filename) {
|
|
||||||
$im = null;
|
|
||||||
switch ($type) {
|
|
||||||
case 1:
|
|
||||||
$im = ImageCreateFromGif($filename);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$im = ImageCreateFromJpeg($filename);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
$im = ImageCreateFromPNG($filename);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $im;
|
|
||||||
}
|
|
||||||
|
|
||||||
// generate thumb from image and save it
|
|
||||||
function GenerateThumbFile($from_name, $to_name) {
|
|
||||||
|
|
||||||
// if src is URL then download file first
|
|
||||||
$temp = false;
|
|
||||||
if (substr($from_name,0,7) == 'http://') {
|
|
||||||
$tmpfname = tempnam("tmp/", "TmP-");
|
|
||||||
$temp = @fopen($tmpfname, "w");
|
|
||||||
if ($temp) {
|
|
||||||
@fwrite($temp, @file_get_contents($from_name)) or die("Cannot download image");
|
|
||||||
@fclose($temp);
|
|
||||||
$from_name = $tmpfname;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
die("Cannot create temp file");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if file exists
|
|
||||||
if (!file_exists($from_name)) die("Source image does not exist!");
|
|
||||||
|
|
||||||
// get source image size (width/height/type)
|
|
||||||
// orig_img_type 1 = GIF, 2 = JPG, 3 = PNG
|
|
||||||
list($orig_x, $orig_y, $orig_img_type, $img_sizes) = @GetImageSize($from_name);
|
|
||||||
|
|
||||||
// cut image if specified by user
|
|
||||||
if ($this->cut_x > 0) $orig_x = min($this->cut_x, $orig_x);
|
|
||||||
if ($this->cut_y > 0) $orig_y = min($this->cut_y, $orig_y);
|
|
||||||
|
|
||||||
// should we override thumb image type?
|
|
||||||
$this->image_type = ($this->image_type != -1 ? $this->image_type : $orig_img_type);
|
|
||||||
|
|
||||||
// check for allowed image types
|
|
||||||
if ($orig_img_type < 1 or $orig_img_type > 3) die("Image type not supported");
|
|
||||||
|
|
||||||
if ($orig_x > $this->max_x or $orig_y > $this->max_y) {
|
|
||||||
|
|
||||||
// resize
|
|
||||||
$per_x = $orig_x / $this->max_x;
|
|
||||||
$per_y = $orig_y / $this->max_y;
|
|
||||||
if ($per_y > $per_x) {
|
|
||||||
$this->max_x = $orig_x / $per_y;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$this->max_y = $orig_y / $per_x;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// keep original sizes, i.e. just copy
|
|
||||||
if ($this->save_to_file) {
|
|
||||||
@copy($from_name, $to_name);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
switch ($this->image_type) {
|
|
||||||
case 1:
|
|
||||||
header("Content-type: image/gif");
|
|
||||||
readfile($from_name);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
header("Content-type: image/jpeg");
|
|
||||||
readfile($from_name);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
header("Content-type: image/png");
|
|
||||||
readfile($from_name);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->image_type == 1) {
|
|
||||||
// should use this function for gifs (gifs are palette images)
|
|
||||||
$ni = imagecreate($this->max_x, $this->max_y);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// Create a new true color image
|
|
||||||
$ni = ImageCreateTrueColor($this->max_x,$this->max_y);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fill image with white background (255,255,255)
|
|
||||||
$white = imagecolorallocate($ni, 255, 255, 255);
|
|
||||||
imagefilledrectangle( $ni, 0, 0, $this->max_x, $this->max_y, $white);
|
|
||||||
// Create a new image from source file
|
|
||||||
$im = $this->ImageCreateFromType($orig_img_type,$from_name);
|
|
||||||
// Copy the palette from one image to another
|
|
||||||
imagepalettecopy($ni,$im);
|
|
||||||
// Copy and resize part of an image with resampling
|
|
||||||
imagecopyresampled(
|
|
||||||
$ni, $im, // destination, source
|
|
||||||
0, 0, 0, 0, // dstX, dstY, srcX, srcY
|
|
||||||
$this->max_x, $this->max_y, // dstW, dstH
|
|
||||||
$orig_x, $orig_y); // srcW, srcH
|
|
||||||
|
|
||||||
// save thumb file
|
|
||||||
$this->SaveImage($ni, $to_name);
|
|
||||||
|
|
||||||
if($temp) {
|
|
||||||
unlink($tmpfname); // this removes the file
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
@ -1,312 +0,0 @@
|
|||||||
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate standard thumbnails
|
|
||||||
* @param string $path path to image
|
|
||||||
* @param string $name file name
|
|
||||||
* @uses GD
|
|
||||||
*/
|
|
||||||
|
|
||||||
function genStdThumb($path,$name){
|
|
||||||
|
|
||||||
//gd check
|
|
||||||
$php_modules = get_loaded_extensions();
|
|
||||||
if(!in_arrayi('gd', $php_modules)) return;
|
|
||||||
|
|
||||||
if (!defined('GSIMAGEWIDTH')) {
|
|
||||||
$width = 200; //New width of image
|
|
||||||
} else {
|
|
||||||
$width = GSIMAGEWIDTH;
|
|
||||||
}
|
|
||||||
|
|
||||||
$ext = lowercase(pathinfo($name,PATHINFO_EXTENSION));
|
|
||||||
|
|
||||||
if ($ext == 'jpg' || $ext == 'jpeg' || $ext == 'gif' || $ext == 'png' ) {
|
|
||||||
|
|
||||||
$thumbsPath = GSTHUMBNAILPATH.$path;
|
|
||||||
|
|
||||||
if (!(file_exists($thumbsPath))) {
|
|
||||||
if (defined('GSCHMOD')) {
|
|
||||||
$chmod_value = GSCHMOD;
|
|
||||||
} else {
|
|
||||||
$chmod_value = 0755;
|
|
||||||
}
|
|
||||||
echo $thumbsPath;
|
|
||||||
mkdir($thumbsPath, $chmod_value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$targetFile = GSDATAUPLOADPATH.$path.$name;
|
|
||||||
|
|
||||||
//thumbnail for post
|
|
||||||
$imgsize = getimagesize($targetFile);
|
|
||||||
|
|
||||||
switch($ext){
|
|
||||||
case "jpeg":
|
|
||||||
case "jpg":
|
|
||||||
$image = imagecreatefromjpeg($targetFile);
|
|
||||||
break;
|
|
||||||
case "png":
|
|
||||||
$image = imagecreatefrompng($targetFile);
|
|
||||||
break;
|
|
||||||
case "gif":
|
|
||||||
$image = imagecreatefromgif($targetFile);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$height = $imgsize[1]/$imgsize[0]*$width; //This maintains proportions
|
|
||||||
|
|
||||||
$src_w = $imgsize[0];
|
|
||||||
$src_h = $imgsize[1];
|
|
||||||
|
|
||||||
$picture = imagecreatetruecolor($width, $height);
|
|
||||||
imagealphablending($picture, false);
|
|
||||||
imagesavealpha($picture, true);
|
|
||||||
$bool = imagecopyresampled($picture, $image, 0, 0, 0, 0, $width, $height, $src_w, $src_h);
|
|
||||||
|
|
||||||
if($bool) {
|
|
||||||
$thumbnailFile = $thumbsPath . "thumbnail." . $name;
|
|
||||||
|
|
||||||
switch(lowercase(substr($targetFile, -3))) {
|
|
||||||
case "jpg":
|
|
||||||
$bool2 = imagejpeg($picture,$thumbnailFile,85);
|
|
||||||
break;
|
|
||||||
case "png":
|
|
||||||
imagepng($picture,$thumbnailFile);
|
|
||||||
break;
|
|
||||||
case "gif":
|
|
||||||
imagegif($picture,$thumbnailFile);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
imagedestroy($picture);
|
|
||||||
imagedestroy($image);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ImageManipulation
|
|
||||||
*
|
|
||||||
* @author Tech @ Talk In Code
|
|
||||||
* @link http://www.talkincode.com/
|
|
||||||
* @version 1.0
|
|
||||||
* @copyright 2009 Talk In Code
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Images
|
|
||||||
* @uses GD
|
|
||||||
*/
|
|
||||||
class ImageManipulation {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An array to hold the settings for the image. Default values for
|
|
||||||
* images are set here.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
public $image = array('targetx'=>0,
|
|
||||||
'targety'=>0,
|
|
||||||
'quality'=>75);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A boolean value to detect if an image has not been created. This
|
|
||||||
* can be used to validate that an image is viable before trying
|
|
||||||
* resize or crop.
|
|
||||||
*
|
|
||||||
* @var boolean
|
|
||||||
*/
|
|
||||||
public $imageok = false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Contructor method. Will create a new image from the target file.
|
|
||||||
* Accepts an image filename as a string. Method also works out how
|
|
||||||
* big the image is and stores this in the $image array.
|
|
||||||
*
|
|
||||||
* @param string $imgFile The image filename.
|
|
||||||
*/
|
|
||||||
public function ImageManipulation($imgfile)
|
|
||||||
{
|
|
||||||
//detect image format
|
|
||||||
$this->image["format"] = preg_replace("/.*\.(.*)$/", "\\1", $imgfile);
|
|
||||||
$this->image["format"] = strtoupper($this->image["format"]);
|
|
||||||
|
|
||||||
// convert image into usable format.
|
|
||||||
if ( $this->image["format"] == "JPG" || $this->image["format"] == "JPEG" ) {
|
|
||||||
//JPEG
|
|
||||||
$this->image["format"] = "JPEG";
|
|
||||||
$this->image["src"] = ImageCreateFromJPEG($imgfile);
|
|
||||||
} elseif( $this->image["format"] == "PNG" ){
|
|
||||||
//PNG
|
|
||||||
$this->image["format"] = "PNG";
|
|
||||||
$this->image["src"] = imagecreatefrompng($imgfile);
|
|
||||||
} elseif( $this->image["format"] == "GIF" ){
|
|
||||||
//GIF
|
|
||||||
$this->image["format"] = "GIF";
|
|
||||||
$this->image["src"] = ImageCreateFromGif($imgfile);
|
|
||||||
} elseif ( $this->image["format"] == "WBMP" ){
|
|
||||||
//WBMP
|
|
||||||
$this->image["format"] = "WBMP";
|
|
||||||
$this->image["src"] = ImageCreateFromWBMP($imgfile);
|
|
||||||
} else {
|
|
||||||
//DEFAULT
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Image is ok
|
|
||||||
$this->imageok = true;
|
|
||||||
|
|
||||||
// Work out image size
|
|
||||||
$this->image["sizex"] = imagesx($this->image["src"]);
|
|
||||||
$this->image["sizey"] = imagesy($this->image["src"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the height of the image to be created. The width of the image
|
|
||||||
* is worked out depending on the value of the height.
|
|
||||||
*
|
|
||||||
* @param int $height The height of the image.
|
|
||||||
*/
|
|
||||||
public function setImageHeight($height=100)
|
|
||||||
{
|
|
||||||
//height
|
|
||||||
$this->image["sizey_thumb"] = $height;
|
|
||||||
$this->image["sizex_thumb"] = ($this->image["sizey_thumb"]/$this->image["sizey"])*$this->image["sizex"];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the width of the image to be created. The height of the image
|
|
||||||
* is worked out depending on the value of the width.
|
|
||||||
*
|
|
||||||
* @param int $size The width of the image.
|
|
||||||
*/
|
|
||||||
public function setImageWidth($width=100)
|
|
||||||
{
|
|
||||||
//width
|
|
||||||
$this->image["sizex_thumb"] = $width;
|
|
||||||
$this->image["sizey_thumb"] = ($this->image["sizex_thumb"]/$this->image["sizex"])*$this->image["sizey"];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method automatically sets the width and height depending
|
|
||||||
* on the dimensions of the image up to a maximum value.
|
|
||||||
*
|
|
||||||
* @param int $size The maximum size of the image.
|
|
||||||
*/
|
|
||||||
public function resize($size=100)
|
|
||||||
{
|
|
||||||
if ( $this->image["sizex"] >= $this->image["sizey"] ) {
|
|
||||||
$this->image["sizex_thumb"] = $size;
|
|
||||||
$this->image["sizey_thumb"] = ($this->image["sizex_thumb"]/$this->image["sizex"])*$this->image["sizey"];
|
|
||||||
} else {
|
|
||||||
$this->image["sizey_thumb"] = $size;
|
|
||||||
$this->image["sizex_thumb"] = ($this->image["sizey_thumb"]/$this->image["sizey"])*$this->image["sizex"];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method sets the cropping values of the image. Be sure
|
|
||||||
* to set the height and with of the image if you want the
|
|
||||||
* image to be a certain size after cropping.
|
|
||||||
*
|
|
||||||
* @param int $x The x coordinates to start cropping from.
|
|
||||||
* @param int $y The y coordinates to start cropping from.
|
|
||||||
* @param int $w The width of the crop from the x and y coordinates.
|
|
||||||
* @param int $h The height of the crop from the x and y coordinates.
|
|
||||||
*/
|
|
||||||
public function setCrop($x, $y, $w, $h)
|
|
||||||
{
|
|
||||||
$this->image["targetx"] = $x;
|
|
||||||
$this->image["targety"] = $y;
|
|
||||||
$this->image["sizex"] = $w;
|
|
||||||
$this->image["sizey"] = $h;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the JPEG output quality.
|
|
||||||
*
|
|
||||||
* @param int $quality The quality of the JPEG image.
|
|
||||||
*/
|
|
||||||
public function setJpegQuality($quality=75)
|
|
||||||
{
|
|
||||||
//jpeg quality
|
|
||||||
$this->image["quality"] = $quality;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shows the image to a browser. Sets the correct image format in a header.
|
|
||||||
*/
|
|
||||||
public function show()
|
|
||||||
{
|
|
||||||
//show thumb
|
|
||||||
header("Content-Type: image/".$this->image["format"]);
|
|
||||||
|
|
||||||
$this->createResampledImage();
|
|
||||||
|
|
||||||
if ( $this->image["format"]=="JPG" || $this->image["format"]=="JPEG" ) {
|
|
||||||
//JPEG
|
|
||||||
imageJPEG($this->image["des"], "", $this->image["quality"]);
|
|
||||||
} elseif ( $this->image["format"] == "PNG" ) {
|
|
||||||
//PNG
|
|
||||||
imagePNG($this->image["des"]);
|
|
||||||
} elseif ( $this->image["format"] == "GIF" ) {
|
|
||||||
//GIF
|
|
||||||
imageGIF($this->image["des"]);
|
|
||||||
} elseif ( $this->image["format"] == "WBMP" ) {
|
|
||||||
//WBMP
|
|
||||||
imageWBMP($this->image["des"]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Private method to run the imagecopyresampled() function with the parameters that have been set up.
|
|
||||||
* This method is used by the save() and show() methods.
|
|
||||||
*/
|
|
||||||
private function createResampledImage()
|
|
||||||
{
|
|
||||||
/* change ImageCreateTrueColor to ImageCreate if your GD not supported ImageCreateTrueColor function*/
|
|
||||||
if ( isset($this->image["sizex_thumb"]) && isset($this->image["sizey_thumb"]) ) {
|
|
||||||
$this->image["des"] = ImageCreateTrueColor($this->image["sizex_thumb"], $this->image["sizey_thumb"]);
|
|
||||||
imagecopyresampled($this->image["des"], $this->image["src"], 0, 0, $this->image["targetx"], $this->image["targety"], $this->image["sizex_thumb"], $this->image["sizey_thumb"], $this->image["sizex"], $this->image["sizey"]);
|
|
||||||
} else {
|
|
||||||
$this->image["des"] = ImageCreateTrueColor($this->image["sizex"], $this->image["sizey"]);
|
|
||||||
imagecopyresampled($this->image["des"], $this->image["src"], 0, 0, $this->image["targetx"], $this->image["targety"], $this->image["sizex"], $this->image["sizey"], $this->image["sizex"], $this->image["sizey"]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Saves the image to a given filename, if no filename is given then a default is created.
|
|
||||||
*
|
|
||||||
* @param string $save The new image filename.
|
|
||||||
*/
|
|
||||||
public function save($save="")
|
|
||||||
{
|
|
||||||
//save thumb
|
|
||||||
if ( empty($save) ) {
|
|
||||||
$save = strtolower("./thumb.".$this->image["format"]);
|
|
||||||
}
|
|
||||||
header("Content-Type: image/".$this->image["format"]);
|
|
||||||
$this->createResampledImage();
|
|
||||||
|
|
||||||
if ( $this->image["format"] == "JPG" || $this->image["format"] == "JPEG" ) {
|
|
||||||
//JPEG
|
|
||||||
imageJPEG($this->image["des"], $save, $this->image["quality"]);
|
|
||||||
} elseif ( $this->image["format"] == "PNG" ) {
|
|
||||||
//PNG
|
|
||||||
imagePNG($this->image["des"], $save);
|
|
||||||
} elseif ( $this->image["format"] == "GIF" ) {
|
|
||||||
//GIF
|
|
||||||
imageGIF($this->image["des"], $save);
|
|
||||||
} elseif ( $this->image["format"] == "WBMP" ) {
|
|
||||||
//WBMP
|
|
||||||
imageWBMP($this->image["des"], $save);
|
|
||||||
}
|
|
||||||
|
|
||||||
header("Content-Type: text/html");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,134 +0,0 @@
|
|||||||
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Logging Class for GetSimple
|
|
||||||
*
|
|
||||||
* Writes log records to log files in data/other/logs
|
|
||||||
* Deletes Log Files
|
|
||||||
* No methods for reading log files ATM
|
|
||||||
*
|
|
||||||
* @author Shawn Alverson
|
|
||||||
*
|
|
||||||
* @requires basic.php
|
|
||||||
*
|
|
||||||
* @uses SimpleXMLExtended
|
|
||||||
* @uses XMLSave
|
|
||||||
* @uses addCData
|
|
||||||
* @uses GSDATAOTHERPATH
|
|
||||||
*
|
|
||||||
* @param string $filename - filename.log
|
|
||||||
* @param bool $logdefaults=true - logs default info, see defaults()
|
|
||||||
*
|
|
||||||
* example
|
|
||||||
* $class= new GS_Logging_Class('logfilename.log'); // new log record for logfile (filename)
|
|
||||||
* $class->add('field','value'); // add record entries to log record
|
|
||||||
* $class->save(); // write log record to file
|
|
||||||
* $class->clear(); // removes log file
|
|
||||||
*/
|
|
||||||
|
|
||||||
class GS_Logging_Class {
|
|
||||||
|
|
||||||
private $_xml;
|
|
||||||
private $_xmlfile;
|
|
||||||
private $_entry;
|
|
||||||
|
|
||||||
function __construct($filename,$logdefaults=true) {
|
|
||||||
// check filename, must be .log
|
|
||||||
|
|
||||||
if($this->validFilename($filename)){
|
|
||||||
$this->_xmlfile = GSDATAOTHERPATH.'logs/'.$filename;
|
|
||||||
if ( file_exists($this->_xmlfile) ) {
|
|
||||||
$xml = file_get_contents($this->_xmlfile);
|
|
||||||
if($xml) $this->_xml = simplexml_load_string($xml, 'SimpleXMLExtended', LIBXML_NOCDATA);
|
|
||||||
else $this->_xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><channel></channel>');
|
|
||||||
} else {
|
|
||||||
$this->_xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><channel></channel>');
|
|
||||||
}
|
|
||||||
|
|
||||||
// create entry and add date
|
|
||||||
$thislog = $this->_xml->addChild('entry');
|
|
||||||
$thislog->addChild('date', date('r'));
|
|
||||||
$this->_entry = $thislog;
|
|
||||||
|
|
||||||
if($logdefaults==true) $this->defaults();
|
|
||||||
}
|
|
||||||
else return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Checks valid filenames
|
|
||||||
* Filename must have extension .log and not have path info
|
|
||||||
*
|
|
||||||
* @thows Exception
|
|
||||||
* @returns bool success
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static function validFilename($filename){
|
|
||||||
$pathinfo=pathinfo($filename);
|
|
||||||
if(!isset($pathinfo['extension']) || strtolower($pathinfo['extension']) != 'log' || $pathinfo['dirname']!='.'){
|
|
||||||
throw new Exception("Filename is not valid in GS_Logging_Class");
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Add default fields to log
|
|
||||||
* Adds Username(If logged in),IP Address
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private function defaults(){
|
|
||||||
GLOBAL $USR;
|
|
||||||
|
|
||||||
if(isset($USR)){
|
|
||||||
$cdata = $this->_entry->addChild('Username');
|
|
||||||
$cdata->addCData(htmlentities($USR, ENT_QUOTES));
|
|
||||||
}
|
|
||||||
|
|
||||||
$cdata = $this->_entry->addChild('IP_Address');
|
|
||||||
$ip = getenv("REMOTE_ADDR");
|
|
||||||
$cdata->addCData(htmlentities($ip, ENT_QUOTES));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Save Log Record
|
|
||||||
* Writes file
|
|
||||||
*
|
|
||||||
* @return success
|
|
||||||
*/
|
|
||||||
public function save(){
|
|
||||||
return XMLsave($this->_xml, $this->_xmlfile);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Clear Log File
|
|
||||||
* Deletes Log File
|
|
||||||
*
|
|
||||||
* @return success
|
|
||||||
*/
|
|
||||||
public function clear(){
|
|
||||||
if (is_file($this->_xmlfile)) {
|
|
||||||
$res = unlink($this->_xmlfile);
|
|
||||||
exec_action('logfile_delete');
|
|
||||||
return $res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Add Log Record Field
|
|
||||||
*
|
|
||||||
* @param string $field
|
|
||||||
* @param string $value
|
|
||||||
*
|
|
||||||
* @return success
|
|
||||||
*/
|
|
||||||
public function add($field,$value){
|
|
||||||
if(isset($field) && isset($value) && isset($this->_entry)){
|
|
||||||
$cdata = $this->_entry->addChild(htmlentities($field, ENT_QUOTES));
|
|
||||||
$cdata->addCData(safe_slash_html($value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // end of class
|
|
||||||
|
|
||||||
?>
|
|
@ -1,83 +0,0 @@
|
|||||||
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
|
|
||||||
/**
|
|
||||||
* Login Functions
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Login
|
|
||||||
*/
|
|
||||||
|
|
||||||
$MSG = null;
|
|
||||||
# if the login cookie is already set, redirect user to control panel
|
|
||||||
if(cookie_check()) {
|
|
||||||
redirect($cookie_redirect);
|
|
||||||
}
|
|
||||||
|
|
||||||
# was the form submitted?
|
|
||||||
if(isset($_POST['submitted'])) {
|
|
||||||
|
|
||||||
# initial variable setup
|
|
||||||
$user_xml = GSUSERSPATH . _id($_POST['userid']).'.xml';
|
|
||||||
$userid = strtolower($_POST['userid']);
|
|
||||||
$password = $_POST['pwd'];
|
|
||||||
$error = null;
|
|
||||||
|
|
||||||
# check the username or password fields
|
|
||||||
if ( !$userid || !$password ) {
|
|
||||||
$error = i18n_r('FILL_IN_REQ_FIELD');
|
|
||||||
}
|
|
||||||
|
|
||||||
# check for any errors
|
|
||||||
if ( !$error ) {
|
|
||||||
|
|
||||||
exec_action('successful-login-start');
|
|
||||||
|
|
||||||
# hash the given password
|
|
||||||
$password = passhash($password);
|
|
||||||
|
|
||||||
# does this user exist?
|
|
||||||
if (file_exists($user_xml)) {
|
|
||||||
|
|
||||||
# pull the data from the user's data file
|
|
||||||
$data = getXML($user_xml);
|
|
||||||
$PASSWD = $data->PWD;
|
|
||||||
$USR = strtolower($data->USR);
|
|
||||||
|
|
||||||
# do the username and password match?
|
|
||||||
if ( ($userid == $USR) && ($password == $PASSWD) ) {
|
|
||||||
$authenticated = true;
|
|
||||||
} else {
|
|
||||||
$authenticated = false;
|
|
||||||
|
|
||||||
# add login failure to failed logins log
|
|
||||||
$logFailed = new GS_Logging_Class('failedlogins.log');
|
|
||||||
$logFailed->add('Username',$userid);
|
|
||||||
$logFailed->add('Reason','Invalid Password');
|
|
||||||
|
|
||||||
} # end password match check
|
|
||||||
|
|
||||||
} else {
|
|
||||||
# user doesnt exist in this system
|
|
||||||
$authenticated = false;
|
|
||||||
|
|
||||||
# add login failure to failed logins log
|
|
||||||
$logFailed = new GS_Logging_Class('failedlogins.log');
|
|
||||||
$logFailed->add('Username',$userid);
|
|
||||||
$logFailed->add('Reason','Invalid User');
|
|
||||||
}
|
|
||||||
|
|
||||||
# is this successful?
|
|
||||||
if( $authenticated ) {
|
|
||||||
# YES - set the login cookie, then redirect user to secure panel
|
|
||||||
create_cookie();
|
|
||||||
exec_action('successful-login-end');
|
|
||||||
redirect($cookie_redirect);
|
|
||||||
} else {
|
|
||||||
# NO - show error message
|
|
||||||
$error = i18n_r('LOGIN_FAILED');
|
|
||||||
$logFailed->save();
|
|
||||||
} # end authenticated check
|
|
||||||
|
|
||||||
} # end error check
|
|
||||||
|
|
||||||
} # end submission check
|
|
||||||
?>
|
|
@ -1 +0,0 @@
|
|||||||
<?php /* functions moved to security.php */ ?>
|
|
@ -1,670 +0,0 @@
|
|||||||
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
|
|
||||||
/**
|
|
||||||
* Plugin Functions
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Plugin-Functions
|
|
||||||
*/
|
|
||||||
|
|
||||||
$plugins = array(); // used for option names
|
|
||||||
$plugins_info = array();
|
|
||||||
$filters = array();
|
|
||||||
$live_plugins = array(); // used for enablie/disable functions
|
|
||||||
$GS_scripts = array(); // used for queing Scripts
|
|
||||||
$GS_styles = array(); // used for queing Styles
|
|
||||||
|
|
||||||
// constants
|
|
||||||
|
|
||||||
define('GSFRONT',1);
|
|
||||||
define('GSBACK',2);
|
|
||||||
define('GSBOTH',3);
|
|
||||||
if ($SITEURL==""){
|
|
||||||
$SITEURL=suggest_site_path();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$GS_script_assets = array(); // defines asset scripts
|
|
||||||
$GS_style_assets = array(); // defines asset styles
|
|
||||||
|
|
||||||
$GS_asset_objects = array(); // holds asset js object names
|
|
||||||
$GS_asset_objects['jquery'] = 'jQuery';
|
|
||||||
$GS_asset_objects['jquery-ui'] = 'jQuery.ui';
|
|
||||||
|
|
||||||
// jquery
|
|
||||||
$jquery_ver = '1.7.1';
|
|
||||||
$jquery_ui_ver = '1.8.17';
|
|
||||||
|
|
||||||
$GS_script_assets['jquery']['cdn']['url'] = '//ajax.googleapis.com/ajax/libs/jquery/'.$jquery_ver.'/jquery.min.js';
|
|
||||||
$GS_script_assets['jquery']['cdn']['ver'] = $jquery_ver;
|
|
||||||
|
|
||||||
$GS_script_assets['jquery']['local']['url'] = $SITEURL.$GSADMIN.'/template/js/jquery.min.js';
|
|
||||||
$GS_script_assets['jquery']['local']['ver'] = $jquery_ver;
|
|
||||||
|
|
||||||
// jquery-ui
|
|
||||||
$GS_script_assets['jquery-ui']['cdn']['url'] = '//ajax.googleapis.com/ajax/libs/jqueryui/'.$jquery_ui_ver.'/jquery-ui.min.js';
|
|
||||||
$GS_script_assets['jquery-ui']['cdn']['ver'] = $jquery_ui_ver;
|
|
||||||
|
|
||||||
$GS_script_assets['jquery-ui']['local']['url'] = $SITEURL.$GSADMIN.'/template/js/jquery-ui.min.js';
|
|
||||||
$GS_script_assets['jquery-ui']['local']['ver'] = $jquery_ui_ver;
|
|
||||||
|
|
||||||
// misc
|
|
||||||
$GS_script_assets['fancybox']['local']['url'] = $SITEURL.$GSADMIN.'/template/js/fancybox/jquery.fancybox.pack.js';
|
|
||||||
$GS_script_assets['fancybox']['local']['ver'] = '2.0.4';
|
|
||||||
|
|
||||||
$GS_style_assets['fancybox']['local']['url'] = $SITEURL.$GSADMIN.'/template/js/fancybox/jquery.fancybox.css';
|
|
||||||
$GS_style_assets['fancybox']['local']['ver'] = '2.0.4';
|
|
||||||
|
|
||||||
// scrolltofixed
|
|
||||||
$GS_script_assets['scrolltofixed']['local']['url'] = $SITEURL.$GSADMIN.'/template/js/jquery-scrolltofixed.js';
|
|
||||||
$GS_script_assets['scrolltofixed']['local']['ver'] = '0.0.1';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register shared javascript/css scripts for loading into the header
|
|
||||||
*/
|
|
||||||
if (!getDef('GSNOCDN',true)){
|
|
||||||
register_script('jquery', $GS_script_assets['jquery']['cdn']['url'], $GS_script_assets['jquery']['cdn']['ver'], FALSE);
|
|
||||||
register_script('jquery-ui',$GS_script_assets['jquery-ui']['cdn']['url'],$GS_script_assets['jquery-ui']['cdn']['ver'],FALSE);
|
|
||||||
} else {
|
|
||||||
register_script('jquery', $GS_script_assets['jquery']['local']['url'], $GS_script_assets['jquery']['local']['ver'], FALSE);
|
|
||||||
register_script('jquery-ui',$GS_script_assets['jquery-ui']['local']['url'],$GS_script_assets['jquery-ui']['local']['ver'],FALSE);
|
|
||||||
}
|
|
||||||
register_script('fancybox', $GS_script_assets['fancybox']['local']['url'], $GS_script_assets['fancybox']['local']['ver'],FALSE);
|
|
||||||
register_style('fancybox-css', $GS_style_assets['fancybox']['local']['url'], $GS_style_assets['fancybox']['local']['ver'], 'screen');
|
|
||||||
|
|
||||||
register_script('scrolltofixed', $GS_script_assets['scrolltofixed']['local']['url'], $GS_script_assets['scrolltofixed']['local']['ver'],FALSE);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Queue our scripts and styles for the backend
|
|
||||||
*/
|
|
||||||
queue_script('jquery', GSBACK);
|
|
||||||
queue_script('jquery-ui', GSBACK);
|
|
||||||
queue_script('fancybox', GSBACK);
|
|
||||||
queue_script('scrolltofixed', GSBACK);
|
|
||||||
|
|
||||||
queue_style('fancybox-css',GSBACK);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Include any plugins, depending on where the referring
|
|
||||||
* file that calls it we need to set the correct paths.
|
|
||||||
*/
|
|
||||||
if (file_exists(GSPLUGINPATH)){
|
|
||||||
$pluginfiles = getFiles(GSPLUGINPATH);
|
|
||||||
}
|
|
||||||
|
|
||||||
$pluginsLoaded=false;
|
|
||||||
|
|
||||||
|
|
||||||
// Check if data\other\plugins.xml exists
|
|
||||||
if (!file_exists(GSDATAOTHERPATH."plugins.xml")){
|
|
||||||
create_pluginsxml();
|
|
||||||
}
|
|
||||||
|
|
||||||
read_pluginsxml(); // get the live plugins into $live_plugins array
|
|
||||||
|
|
||||||
if(!is_frontend()) create_pluginsxml(); // check that plugins have not been removed or added to the directory
|
|
||||||
|
|
||||||
// load each of the plugins
|
|
||||||
foreach ($live_plugins as $file=>$en) {
|
|
||||||
$pluginsLoaded=true;
|
|
||||||
# debugLog("plugin: $file" . " exists: " . file_exists(GSPLUGINPATH . $file) ." enabled: " . $en);
|
|
||||||
if ($en=='true' && file_exists(GSPLUGINPATH . $file)){
|
|
||||||
require_once(GSPLUGINPATH . $file);
|
|
||||||
} else {
|
|
||||||
if(!is_frontend() and get_filename_id() == 'plugins'){
|
|
||||||
$apiback = get_api_details('plugin', $file);
|
|
||||||
$response = json_decode($apiback);
|
|
||||||
if ($response and $response->status == 'successful') {
|
|
||||||
register_plugin( pathinfo_filename($file), $file, 'disabled', $response->owner, '', i18n_r('PLUGIN_DISABLED'), '', '');
|
|
||||||
} else {
|
|
||||||
register_plugin( pathinfo_filename($file), $file, 'disabled', 'Unknown', '', i18n_r('PLUGIN_DISABLED'), '', '');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
register_plugin( pathinfo_filename($file), $file, 'disabled', 'Unknown', '', i18n_r('PLUGIN_DISABLED'), '', '');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* change_plugin
|
|
||||||
*
|
|
||||||
* Enable/Disable a plugin
|
|
||||||
*
|
|
||||||
* @since 2.04
|
|
||||||
* @uses $live_plugins
|
|
||||||
*
|
|
||||||
* @param $name
|
|
||||||
* @param $active bool default=null, sets plugin active | inactive else toggle
|
|
||||||
*/
|
|
||||||
function change_plugin($name,$active=null){
|
|
||||||
global $live_plugins;
|
|
||||||
if (isset($live_plugins[$name])){
|
|
||||||
|
|
||||||
// set plugin active | inactive
|
|
||||||
if(isset($active) and is_bool($active)) {
|
|
||||||
$live_plugins[$name] = $active ? 'true' : 'false';
|
|
||||||
create_pluginsxml(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// else we toggle
|
|
||||||
if ($live_plugins[$name]=="true"){
|
|
||||||
$live_plugins[$name]="false";
|
|
||||||
} else {
|
|
||||||
$live_plugins[$name]="true";
|
|
||||||
}
|
|
||||||
|
|
||||||
create_pluginsxml(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* read_pluginsxml
|
|
||||||
*
|
|
||||||
* Read in the plugins.xml file and populate the $live_plugins array
|
|
||||||
*
|
|
||||||
* @since 2.04
|
|
||||||
* @uses $live_plugins
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function read_pluginsxml(){
|
|
||||||
global $live_plugins;
|
|
||||||
|
|
||||||
$data = getXML(GSDATAOTHERPATH . "plugins.xml");
|
|
||||||
if($data){
|
|
||||||
$componentsec = $data->item;
|
|
||||||
if (count($componentsec) != 0) {
|
|
||||||
foreach ($componentsec as $component) {
|
|
||||||
$live_plugins[trim((string)$component->plugin)]=trim((string)$component->enabled);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* create_pluginsxml
|
|
||||||
*
|
|
||||||
* If the plugins.xml file does not exists, read in each plugin
|
|
||||||
* and add it to the file.
|
|
||||||
* read_pluginsxml() is called again to repopulate $live_plugins
|
|
||||||
*
|
|
||||||
* @since 2.04
|
|
||||||
* @uses $live_plugins
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function create_pluginsxml($force=false){
|
|
||||||
global $live_plugins;
|
|
||||||
if (file_exists(GSPLUGINPATH)){
|
|
||||||
$pluginfiles = getFiles(GSPLUGINPATH);
|
|
||||||
}
|
|
||||||
$phpfiles = array();
|
|
||||||
foreach ($pluginfiles as $fi) {
|
|
||||||
if (lowercase(pathinfo($fi, PATHINFO_EXTENSION))=='php') {
|
|
||||||
$phpfiles[] = $fi;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!$force) {
|
|
||||||
$livekeys = array_keys($live_plugins);
|
|
||||||
if (count(array_diff($livekeys, $phpfiles))>0 || count(array_diff($phpfiles, $livekeys))>0) {
|
|
||||||
$force = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($force) {
|
|
||||||
$xml = @new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><channel></channel>');
|
|
||||||
foreach ($phpfiles as $fi) {
|
|
||||||
$plugins = $xml->addChild('item');
|
|
||||||
$p_note = $plugins->addChild('plugin');
|
|
||||||
$p_note->addCData($fi);
|
|
||||||
$p_note = $plugins->addChild('enabled');
|
|
||||||
if (isset($live_plugins[(string)$fi])){
|
|
||||||
$p_note->addCData($live_plugins[(string)$fi]);
|
|
||||||
} else {
|
|
||||||
$p_note->addCData('false');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
XMLsave($xml, GSDATAOTHERPATH."plugins.xml");
|
|
||||||
read_pluginsxml();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add Action
|
|
||||||
*
|
|
||||||
* @since 2.0
|
|
||||||
* @uses $plugins
|
|
||||||
* @uses $live_plugins
|
|
||||||
*
|
|
||||||
* @param string $hook_name
|
|
||||||
* @param string $added_function
|
|
||||||
* @param array $args
|
|
||||||
*/
|
|
||||||
function add_action($hook_name, $added_function, $args = array()) {
|
|
||||||
global $plugins;
|
|
||||||
global $live_plugins;
|
|
||||||
|
|
||||||
$bt = debug_backtrace();
|
|
||||||
$shift=count($bt) - 4; // plugin name should be
|
|
||||||
$caller = array_shift($bt);
|
|
||||||
$realPathName=pathinfo_filename($caller['file']);
|
|
||||||
$realLineNumber=$caller['line'];
|
|
||||||
while ($shift > 0) {
|
|
||||||
$caller = array_shift($bt);
|
|
||||||
$shift--;
|
|
||||||
}
|
|
||||||
$pathName= pathinfo_filename($caller['file']);
|
|
||||||
|
|
||||||
if ((isset ($live_plugins[$pathName.'.php']) && $live_plugins[$pathName.'.php']=='true') || $shift<0 ){
|
|
||||||
if ($realPathName!=$pathName) {
|
|
||||||
$pathName=$realPathName;
|
|
||||||
$lineNumber=$realLineNumber;
|
|
||||||
} else {
|
|
||||||
$lineNumber=$caller['line'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$plugins[] = array(
|
|
||||||
'hook' => $hook_name,
|
|
||||||
'function' => $added_function,
|
|
||||||
'args' => (array) $args,
|
|
||||||
'file' => $pathName.'.php',
|
|
||||||
'line' => $caller['line']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute Action
|
|
||||||
*
|
|
||||||
* @since 2.0
|
|
||||||
* @uses $plugins
|
|
||||||
*
|
|
||||||
* @param string $a Name of hook to execute
|
|
||||||
*/
|
|
||||||
function exec_action($a) {
|
|
||||||
global $plugins;
|
|
||||||
|
|
||||||
foreach ($plugins as $hook) {
|
|
||||||
if ($hook['hook'] == $a) {
|
|
||||||
call_user_func_array($hook['function'], $hook['args']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create Side Menu
|
|
||||||
*
|
|
||||||
* This adds a side level link to a control panel's section
|
|
||||||
*
|
|
||||||
* @since 2.0
|
|
||||||
* @uses $plugins
|
|
||||||
*
|
|
||||||
* @param string $id ID of the link you are adding
|
|
||||||
* @param string $txt Text to add to tabbed link
|
|
||||||
*/
|
|
||||||
|
|
||||||
function createSideMenu($id, $txt, $action=null, $always=true){
|
|
||||||
$current = false;
|
|
||||||
if (isset($_GET['id']) && $_GET['id'] == $id && (!$action || isset($_GET[$action]))) {
|
|
||||||
$current = true;
|
|
||||||
}
|
|
||||||
if ($always || $current) {
|
|
||||||
echo '<li id="sb_'.$id.'" class="plugin_sb"><a href="load.php?id='.$id.($action ? '&'.$action : '').'" '.($current ? 'class="current"' : '').' >'.$txt.'</a></li>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create Navigation Tab
|
|
||||||
*
|
|
||||||
* This adds a top level tab to the control panel
|
|
||||||
*
|
|
||||||
* @since 2.0
|
|
||||||
* @uses $plugins
|
|
||||||
*
|
|
||||||
* @param string $id Id of current page
|
|
||||||
* @param string $txt Text to add to tabbed link
|
|
||||||
* @param string $klass class to add to a element
|
|
||||||
*/
|
|
||||||
function createNavTab($tabname, $id, $txt, $action=null) {
|
|
||||||
global $plugin_info;
|
|
||||||
$current = false;
|
|
||||||
if (basename($_SERVER['PHP_SELF']) == 'load.php') {
|
|
||||||
$plugin_id = @$_GET['id'];
|
|
||||||
if ($plugin_info[$plugin_id]['page_type'] == $tabname) $current = true;
|
|
||||||
}
|
|
||||||
echo '<li id="nav_'.$id.'" class="plugin_tab"><a href="load.php?id='.$id.($action ? '&'.$action : '').'" '.($current ? 'class="current"' : '').' >'.$txt.'</a></li>';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register Plugin
|
|
||||||
*
|
|
||||||
* @since 2.0
|
|
||||||
* @uses $plugin_info
|
|
||||||
*
|
|
||||||
* @param string $id Unique ID of your plugin
|
|
||||||
* @param string $name Name of the plugin
|
|
||||||
* @param string $ver Optional, default is null.
|
|
||||||
* @param string $auth Optional, default is null.
|
|
||||||
* @param string $auth_url Optional, default is null.
|
|
||||||
* @param string $desc Optional, default is null.
|
|
||||||
* @param string $type Optional, default is null. This is the page type your plugin is classifying itself
|
|
||||||
* @param string $loaddata Optional, default is null. This is the function that run on load
|
|
||||||
*/
|
|
||||||
function register_plugin($id, $name, $ver=null, $auth=null, $auth_url=null, $desc=null, $type=null, $loaddata=null) {
|
|
||||||
global $plugin_info;
|
|
||||||
|
|
||||||
$plugin_info[$id] = array(
|
|
||||||
'name' => $name,
|
|
||||||
'version' => $ver,
|
|
||||||
'author' => $auth,
|
|
||||||
'author_url' => $auth_url,
|
|
||||||
'description' => $desc,
|
|
||||||
'page_type' => $type,
|
|
||||||
'load_data' => $loaddata
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add Filter
|
|
||||||
*
|
|
||||||
* @since 2.0
|
|
||||||
* @uses $filters
|
|
||||||
* @uses $live_plugins
|
|
||||||
*
|
|
||||||
* @param string $id Id of current page
|
|
||||||
* @param string $txt Text to add to tabbed link
|
|
||||||
*/
|
|
||||||
function add_filter($filter_name, $added_function) {
|
|
||||||
global $filters;
|
|
||||||
global $live_plugins;
|
|
||||||
$bt = debug_backtrace();
|
|
||||||
$caller = array_shift($bt);
|
|
||||||
$pathName= pathinfo_filename($caller['file']);
|
|
||||||
$filters[] = array(
|
|
||||||
'filter' => $filter_name,
|
|
||||||
'function' => $added_function
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute Filter
|
|
||||||
*
|
|
||||||
* Allows changing of the passed variable
|
|
||||||
*
|
|
||||||
* @since 2.0
|
|
||||||
* @uses $filters
|
|
||||||
*
|
|
||||||
* @param string $script Filter name to execute
|
|
||||||
* @param array $data
|
|
||||||
*/
|
|
||||||
function exec_filter($script,$data=array()) {
|
|
||||||
global $filters;
|
|
||||||
foreach ($filters as $filter) {
|
|
||||||
if ($filter['filter'] == $script) {
|
|
||||||
$data = call_user_func_array($filter['function'], array($data));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register Script
|
|
||||||
*
|
|
||||||
* Register a script to include in Themes
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @uses $GS_scripts
|
|
||||||
*
|
|
||||||
* @param string $handle name for the script
|
|
||||||
* @param string $src location of the src for loading
|
|
||||||
* @param string $ver script version
|
|
||||||
* @param boolean $in_footer load the script in the footer if true
|
|
||||||
*/
|
|
||||||
function register_script($handle, $src, $ver, $in_footer=FALSE){
|
|
||||||
global $GS_scripts;
|
|
||||||
$GS_scripts[$handle] = array(
|
|
||||||
'name' => $handle,
|
|
||||||
'src' => $src,
|
|
||||||
'ver' => $ver,
|
|
||||||
'in_footer' => $in_footer,
|
|
||||||
'where' => 0
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* De-Register Script
|
|
||||||
*
|
|
||||||
* Deregisters a script
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @uses $GS_scripts
|
|
||||||
*
|
|
||||||
* @param string $handle name for the script to remove
|
|
||||||
*/
|
|
||||||
function deregister_script($handle){
|
|
||||||
global $GS_scripts;
|
|
||||||
if (array_key_exists($handle, $GS_scripts)){
|
|
||||||
unset($GS_scripts[$handle]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Queue Script
|
|
||||||
*
|
|
||||||
* Queue a script for loading
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @uses $GS_scripts
|
|
||||||
*
|
|
||||||
* @param string $handle name for the script to load
|
|
||||||
*/
|
|
||||||
function queue_script($handle,$where){
|
|
||||||
global $GS_scripts;
|
|
||||||
if (array_key_exists($handle, $GS_scripts)){
|
|
||||||
$GS_scripts[$handle]['load']=true;
|
|
||||||
$GS_scripts[$handle]['where']=$GS_scripts[$handle]['where'] | $where;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* De-Queue Script
|
|
||||||
*
|
|
||||||
* Remove a queued script
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @uses $GS_scripts
|
|
||||||
*
|
|
||||||
* @param string $handle name for the script to load
|
|
||||||
*/
|
|
||||||
function dequeue_script($handle, $where){
|
|
||||||
global $GS_scripts;
|
|
||||||
if (array_key_exists($handle, $GS_scripts)){
|
|
||||||
$GS_scripts[$handle]['load']=false;
|
|
||||||
$GS_scripts[$handle]['where']=$GS_scripts[$handle]['where'] & ~ $where;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Scripts
|
|
||||||
*
|
|
||||||
* Echo and load scripts
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @uses $GS_scripts
|
|
||||||
*
|
|
||||||
* @param boolean $footer Load only script with footer flag set
|
|
||||||
*/
|
|
||||||
function get_scripts_frontend($footer=FALSE){
|
|
||||||
global $GS_scripts;
|
|
||||||
if (!$footer){
|
|
||||||
get_styles_frontend();
|
|
||||||
}
|
|
||||||
foreach ($GS_scripts as $script){
|
|
||||||
if ($script['where'] & GSFRONT ){
|
|
||||||
if (!$footer){
|
|
||||||
if ($script['load']==TRUE && $script['in_footer']==FALSE ){
|
|
||||||
echo '<script src="'.$script['src'].'?v='.$script['ver'].'"></script>';
|
|
||||||
cdn_fallback($script);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($script['load']==TRUE && $script['in_footer']==TRUE ){
|
|
||||||
echo '<script src="'.$script['src'].'?v='.$script['ver'].'"></script>';
|
|
||||||
cdn_fallback($script);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Scripts
|
|
||||||
*
|
|
||||||
* Echo and load scripts
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @uses $GS_scripts
|
|
||||||
*
|
|
||||||
* @param boolean $footer Load only script with footer flag set
|
|
||||||
*/
|
|
||||||
function get_scripts_backend($footer=FALSE){
|
|
||||||
global $GS_scripts;
|
|
||||||
if (!$footer){
|
|
||||||
get_styles_backend();
|
|
||||||
}
|
|
||||||
|
|
||||||
# debugLog($GS_scripts);
|
|
||||||
foreach ($GS_scripts as $script){
|
|
||||||
if ($script['where'] & GSBACK ){
|
|
||||||
if (!$footer){
|
|
||||||
if ($script['load']==TRUE && $script['in_footer']==FALSE ){
|
|
||||||
echo '<script src="'.$script['src'].'?v='.$script['ver'].'"></script>';
|
|
||||||
cdn_fallback($script);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($script['load']==TRUE && $script['in_footer']==TRUE ){
|
|
||||||
echo '<script src="'.$script['src'].'?v='.$script['ver'].'"></script>';
|
|
||||||
cdn_fallback($script);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add javascript for cdn fallback to local
|
|
||||||
* get_scripts_backend helper
|
|
||||||
* @param array $script gsscript array
|
|
||||||
*/
|
|
||||||
function cdn_fallback($script){
|
|
||||||
GLOBAL $GS_script_assets, $GS_asset_objects;
|
|
||||||
if (getDef('GSNOCDN',true)) return; // if nocdn skip
|
|
||||||
if($script['name'] == 'jquery' || $script['name'] == 'jquery-ui'){
|
|
||||||
echo "<script>";
|
|
||||||
echo "window.".$GS_asset_objects[$script['name']]." || ";
|
|
||||||
echo "document.write('<!-- CDN FALLING BACK --><script src=\"".$GS_script_assets[$script['name']]['local']['url'].'?v='.$GS_script_assets[$script['name']]['local']['ver']."\"><\/script>');";
|
|
||||||
echo "</script>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Queue Style
|
|
||||||
*
|
|
||||||
* Queue a Style for loading
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @uses $GS_styles
|
|
||||||
*
|
|
||||||
* @param string $handle name for the Style to load
|
|
||||||
*/
|
|
||||||
function queue_style($handle,$where=1){
|
|
||||||
global $GS_styles;
|
|
||||||
if (array_key_exists($handle, $GS_styles)){
|
|
||||||
$GS_styles[$handle]['load']=true;
|
|
||||||
$GS_styles[$handle]['where']=$GS_styles[$handle]['where'] | $where;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* De-Queue Style
|
|
||||||
*
|
|
||||||
* Remove a queued Style
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @uses $GS_styles
|
|
||||||
*
|
|
||||||
* @param string $handle name for the Style to load
|
|
||||||
*/
|
|
||||||
function dequeue_style($handle,$where){
|
|
||||||
global $GS_styles;
|
|
||||||
if (array_key_exists($handle, $GS_styles)){
|
|
||||||
$GS_styles[$handle]['load']=false;
|
|
||||||
$GS_styles[$handle]['where']=$GS_styles[$handle]['where'] & ~$where;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register Style
|
|
||||||
*
|
|
||||||
* Register a Style to include in Themes
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @uses $GS_scripts
|
|
||||||
*
|
|
||||||
* @param string $handle name for the Style
|
|
||||||
* @param string $src location of the src for loading
|
|
||||||
* @param string $ver Style version
|
|
||||||
* @param string $media load the Style in the footer if true
|
|
||||||
*/
|
|
||||||
function register_style($handle, $src, $ver, $media){
|
|
||||||
global $GS_styles;
|
|
||||||
$GS_styles[$handle] = array(
|
|
||||||
'name' => $handle,
|
|
||||||
'src' => $src,
|
|
||||||
'ver' => $ver,
|
|
||||||
'media' => $media,
|
|
||||||
'where' => 0
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Styles Frontend
|
|
||||||
*
|
|
||||||
* Echo and load Styles in the Theme header
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @uses $GS_styles
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function get_styles_frontend(){
|
|
||||||
global $GS_styles;
|
|
||||||
foreach ($GS_styles as $style){
|
|
||||||
if ($style['where'] & GSFRONT ){
|
|
||||||
if ($style['load']==TRUE){
|
|
||||||
echo '<link href="'.$style['src'].'?v='.$style['ver'].'" rel="stylesheet" media="'.$style['media'].'">';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Get Styles Backend
|
|
||||||
*
|
|
||||||
* Echo and load Styles on Admin
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @uses $GS_styles
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function get_styles_backend(){
|
|
||||||
global $GS_styles;
|
|
||||||
foreach ($GS_styles as $style){
|
|
||||||
if ($style['where'] & GSBACK ){
|
|
||||||
if ($style['load']==TRUE){
|
|
||||||
echo '<link href="'.$style['src'].'?v='.$style['ver'].'" rel="stylesheet" media="'.$style['media'].'">';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
@ -1,227 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Security
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage init
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* File and File MIME-TYPE Blacklist arrays
|
|
||||||
*/
|
|
||||||
$mime_type_blacklist = array(
|
|
||||||
# HTML may contain cookie-stealing JavaScript and web bugs
|
|
||||||
'text/html', 'text/javascript', 'text/x-javascript', 'application/x-shellscript',
|
|
||||||
# PHP scripts may execute arbitrary code on the server
|
|
||||||
'application/x-php', 'text/x-php',
|
|
||||||
# Other types that may be interpreted by some servers
|
|
||||||
'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
|
|
||||||
# Client-side hazards on Internet Explorer
|
|
||||||
'text/scriptlet', 'application/x-msdownload',
|
|
||||||
# Windows metafile, client-side vulnerability on some systems
|
|
||||||
'application/x-msmetafile',
|
|
||||||
# MS Office OpenXML and other Open Package Conventions files are zip files
|
|
||||||
# and thus blacklisted just as other zip files
|
|
||||||
'application/x-opc+zip'
|
|
||||||
);
|
|
||||||
$file_ext_blacklist = array(
|
|
||||||
# HTML may contain cookie-stealing JavaScript and web bugs
|
|
||||||
'html', 'htm', 'js', 'jsb', 'mhtml', 'mht',
|
|
||||||
# PHP scripts may execute arbitrary code on the server
|
|
||||||
'php', 'phtml', 'php3', 'php4', 'php5', 'phps',
|
|
||||||
# Other types that may be interpreted by some servers
|
|
||||||
'shtml', 'jhtml', 'pl', 'py', 'cgi', 'sh', 'ksh', 'bsh', 'c', 'htaccess', 'htpasswd',
|
|
||||||
# May contain harmful executables for Windows victims
|
|
||||||
'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl'
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Anti-XSS
|
|
||||||
*
|
|
||||||
* Attempts to clean variables from XSS attacks
|
|
||||||
* @since 2.03
|
|
||||||
*
|
|
||||||
* @author Martijn van der Ven
|
|
||||||
*
|
|
||||||
* @param string $str The string to be stripped of XSS attempts
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function antixss($str){
|
|
||||||
// attributes blacklist:
|
|
||||||
$attr = array('style','on[a-z]+');
|
|
||||||
// elements blacklist:
|
|
||||||
$elem = array('script','iframe','embed','object');
|
|
||||||
// extermination:
|
|
||||||
$str = preg_replace('#<!--.*?-->?#', '', $str);
|
|
||||||
$str = preg_replace('#<!--#', '', $str);
|
|
||||||
$str = preg_replace('#(<[a-z]+(\s+[a-z][a-z\-]+\s*=\s*(\'[^\']*\'|"[^"]*"|[^\'">][^\s>]*))*)\s+href\s*=\s*(\'javascript:[^\']*\'|"javascript:[^"]*"|javascript:[^\s>]*)((\s+[a-z][a-z\-]*\s*=\s*(\'[^\']*\'|"[^"]*"|[^\'">][^\s>]*))*\s*>)#is', '$1$5', $str);
|
|
||||||
foreach($attr as $a) {
|
|
||||||
$regex = '(<[a-z]+(\s+[a-z][a-z\-]+\s*=\s*(\'[^\']*\'|"[^"]*"|[^\'">][^\s>]*))*)\s+'.$a.'\s*=\s*(\'[^\']*\'|"[^"]*"|[^\'">][^\s>]*)((\s+[a-z][a-z\-]*\s*=\s*(\'[^\']*\'|"[^"]*"|[^\'">][^\s>]*))*\s*>)';
|
|
||||||
$str = preg_replace('#'.$regex.'#is', '$1$5', $str);
|
|
||||||
}
|
|
||||||
foreach($elem as $e) {
|
|
||||||
$regex = '<'.$e.'(\s+[a-z][a-z\-]*\s*=\s*(\'[^\']*\'|"[^"]*"|[^\'">][^\s>]*))*\s*>.*?<\/'.$e.'\s*>';
|
|
||||||
$str = preg_replace('#'.$regex.'#is', '', $str);
|
|
||||||
}
|
|
||||||
return $str;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Nonce
|
|
||||||
*
|
|
||||||
* @since 2.03
|
|
||||||
* @author tankmiche
|
|
||||||
* @uses $USR
|
|
||||||
* @uses $SALT
|
|
||||||
*
|
|
||||||
* @param string $action Id of current page
|
|
||||||
* @param string $file Optional, default is empty string
|
|
||||||
* @param bool $last
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function get_nonce($action, $file = "", $last = false) {
|
|
||||||
global $USR;
|
|
||||||
global $SALT;
|
|
||||||
|
|
||||||
if($file == "")
|
|
||||||
$file = $_SERVER['PHP_SELF'];
|
|
||||||
|
|
||||||
// using user agent since ip can change on proxys
|
|
||||||
$uid = $_SERVER['HTTP_USER_AGENT'];
|
|
||||||
|
|
||||||
// Limits Nonce to one hour
|
|
||||||
$time = $last ? time() - 3600: time();
|
|
||||||
|
|
||||||
// Mix with a little salt
|
|
||||||
$hash=sha1($action.$file.$uid.$USR.$SALT.@date('YmdH',$time));
|
|
||||||
|
|
||||||
return $hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check Nonce
|
|
||||||
*
|
|
||||||
* @since 2.03
|
|
||||||
* @author tankmiche
|
|
||||||
* @uses get_nonce
|
|
||||||
*
|
|
||||||
* @param string $nonce
|
|
||||||
* @param string $action
|
|
||||||
* @param string $file Optional, default is empty string
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
function check_nonce($nonce, $action, $file = ""){
|
|
||||||
return ( $nonce === get_nonce($action, $file) || $nonce === get_nonce($action, $file, true) );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Validate Safe File
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
* @uses file_mime_type
|
|
||||||
* @uses $mime_type_blacklist
|
|
||||||
* @uses $file_ext_blacklist
|
|
||||||
*
|
|
||||||
* @param string $file, absolute path
|
|
||||||
* @param string $name, default null
|
|
||||||
* @param string $type, default 'upload'
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
function validate_safe_file($file, $name, $mime){
|
|
||||||
global $mime_type_blacklist, $file_ext_blacklist, $mime_type_whitelist, $file_ext_whitelist;
|
|
||||||
|
|
||||||
include(GSADMININCPATH.'configuration.php');
|
|
||||||
|
|
||||||
$file_extention = pathinfo($name,PATHINFO_EXTENSION);
|
|
||||||
$file_mime_type = $mime;
|
|
||||||
|
|
||||||
if ($mime_type_whitelist && in_arrayi($file_mime_type, $mime_type_whitelist)) {
|
|
||||||
return true;
|
|
||||||
} elseif ($file_ext_whitelist && $in_arrayi($file_extention, $file_ext_whitelist)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// skip blackist checks if whitelists exist
|
|
||||||
if($mime_type_whitelist || $file_ext_whitelist) return false;
|
|
||||||
|
|
||||||
if (in_arrayi($file_mime_type, $mime_type_blacklist)) {
|
|
||||||
return false;
|
|
||||||
} elseif (in_arrayi($file_extention, $file_ext_blacklist)) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks that an existing filepath is safe to use by checking canonicalized absolute pathname.
|
|
||||||
*
|
|
||||||
* @since 3.1.3
|
|
||||||
*
|
|
||||||
* @param string $path Unknown Path to file to check for safety
|
|
||||||
* @param string $pathmatch Known Path to parent folder to check against
|
|
||||||
* @param bool $subdir allow path to be a deeper subfolder
|
|
||||||
* @return bool Returns true if files path resolves to your known path
|
|
||||||
*/
|
|
||||||
function filepath_is_safe($path,$pathmatch,$subdir = true){
|
|
||||||
$realpath = realpath($path);
|
|
||||||
$realpathmatch = realpath($pathmatch);
|
|
||||||
if($subdir) return strpos(dirname($realpath),$realpathmatch) === 0;
|
|
||||||
return dirname($realpath) == $realpathmatch;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks that an existing path is safe to use by checking canonicalized absolute path
|
|
||||||
*
|
|
||||||
* @since 3.1.3
|
|
||||||
*
|
|
||||||
* @param string $path Unknown Path to check for safety
|
|
||||||
* @param string $pathmatch Known Path to check against
|
|
||||||
* @param bool $subdir allow path to be a deeper subfolder
|
|
||||||
* @return bool Returns true if $path is direct subfolder of $pathmatch
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function path_is_safe($path,$pathmatch,$subdir = true){
|
|
||||||
$realpath = realpath($path);
|
|
||||||
$realpathmatch = realpath($pathmatch);
|
|
||||||
if($subdir) return strpos($realpath,$realpathmatch) === 0;
|
|
||||||
return $realpath == $realpathmatch;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if server is Apache
|
|
||||||
*
|
|
||||||
* @returns bool
|
|
||||||
*/
|
|
||||||
function server_is_apache() {
|
|
||||||
return( strpos(strtolower($_SERVER['SERVER_SOFTWARE']),'apache') !== false );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Performs filtering on variable, falls back to htmlentities
|
|
||||||
*
|
|
||||||
* @since 3.3.0
|
|
||||||
* @param string $var var to filter
|
|
||||||
* @param string $filter filter type
|
|
||||||
* @return string return filtered string
|
|
||||||
*/
|
|
||||||
function var_out($var,$filter = "special"){
|
|
||||||
if(function_exists( "filter_var") ){
|
|
||||||
$aryFilter = array(
|
|
||||||
"string" => FILTER_SANITIZE_STRING,
|
|
||||||
"int" => FILTER_SANITIZE_NUMBER_INT,
|
|
||||||
"float" => FILTER_SANITIZE_NUMBER_FLOAT,
|
|
||||||
"url" => FILTER_SANITIZE_URL,
|
|
||||||
"email" => FILTER_SANITIZE_EMAIL,
|
|
||||||
"special" => FILTER_SANITIZE_SPECIAL_CHARS,
|
|
||||||
);
|
|
||||||
if(isset($aryFilter[$filter])) return filter_var( $var, $aryFilter[$filter]);
|
|
||||||
return filter_var( $var, FILTER_SANITIZE_SPECIAL_CHARS);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return htmlentities($var);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,646 +0,0 @@
|
|||||||
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
|
|
||||||
/**
|
|
||||||
* Theme Functions
|
|
||||||
*
|
|
||||||
* These functions are used within the front-end of a GetSimple installation
|
|
||||||
*
|
|
||||||
* @link http://get-simple.info/docs/theme-codex/
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Theme-Functions
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Page Content
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses $content
|
|
||||||
* @uses exec_action
|
|
||||||
* @uses exec_filter
|
|
||||||
* @uses strip_decode
|
|
||||||
*
|
|
||||||
* @return string Echos.
|
|
||||||
*/
|
|
||||||
function get_page_content() {
|
|
||||||
global $content;
|
|
||||||
exec_action('content-top');
|
|
||||||
$content = strip_decode($content);
|
|
||||||
$content = exec_filter('content',$content);
|
|
||||||
echo $content;
|
|
||||||
exec_action('content-bottom');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Page Excerpt
|
|
||||||
*
|
|
||||||
* @since 2.0
|
|
||||||
* @uses $content
|
|
||||||
* @uses exec_filter
|
|
||||||
* @uses strip_decode
|
|
||||||
*
|
|
||||||
* @param string $n Optional, default is 200.
|
|
||||||
* @param bool $striphtml Optional, default false, true will strip html from $content
|
|
||||||
* @param string $ellipsis Optional, Default '...', specify an ellipsis
|
|
||||||
* @return string Echos.
|
|
||||||
*/
|
|
||||||
function get_page_excerpt($len=200, $striphtml=true, $ellipsis = '...') {
|
|
||||||
GLOBAL $content;
|
|
||||||
if ($len<1) return '';
|
|
||||||
$content_e = strip_decode($content);
|
|
||||||
$content_e = exec_filter('content',$content_e);
|
|
||||||
echo getExcerpt($content_e, $len, $striphtml, $ellipsis);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Page Meta Keywords
|
|
||||||
*
|
|
||||||
* @since 2.0
|
|
||||||
* @uses $metak
|
|
||||||
* @uses strip_decode
|
|
||||||
*
|
|
||||||
* @param bool $echo Optional, default is true. False will 'return' value
|
|
||||||
* @return string Echos or returns based on param $echo
|
|
||||||
*/
|
|
||||||
function get_page_meta_keywords($echo=true) {
|
|
||||||
global $metak;
|
|
||||||
$myVar = encode_quotes(strip_decode($metak));
|
|
||||||
|
|
||||||
if ($echo) {
|
|
||||||
echo $myVar;
|
|
||||||
} else {
|
|
||||||
return $myVar;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Page Meta Description
|
|
||||||
*
|
|
||||||
* @since 2.0
|
|
||||||
* @uses $metad
|
|
||||||
* @uses strip_decode
|
|
||||||
*
|
|
||||||
* @param bool $echo Optional, default is true. False will 'return' value
|
|
||||||
* @return string Echos or returns based on param $echo
|
|
||||||
*/
|
|
||||||
function get_page_meta_desc($echo=true) {
|
|
||||||
global $metad;
|
|
||||||
$myVar = encode_quotes(strip_decode($metad));
|
|
||||||
|
|
||||||
if ($echo) {
|
|
||||||
echo $myVar;
|
|
||||||
} else {
|
|
||||||
return $myVar;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Page Title
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses $title
|
|
||||||
*
|
|
||||||
* @param bool $echo Optional, default is true. False will 'return' value
|
|
||||||
* @return string Echos or returns based on param $echo
|
|
||||||
*/
|
|
||||||
function get_page_title($echo=true) {
|
|
||||||
global $title;
|
|
||||||
$myVar = strip_decode($title);
|
|
||||||
|
|
||||||
if ($echo) {
|
|
||||||
echo $myVar;
|
|
||||||
} else {
|
|
||||||
return $myVar;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Page Clean Title
|
|
||||||
*
|
|
||||||
* This will remove all HTML from the title before returning
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses $title
|
|
||||||
*
|
|
||||||
* @param bool $echo Optional, default is true. False will 'return' value
|
|
||||||
* @return string Echos or returns based on param $echo
|
|
||||||
*/
|
|
||||||
function get_page_clean_title($echo=true) {
|
|
||||||
global $title;
|
|
||||||
$myVar = strip_tags(strip_decode($title));
|
|
||||||
|
|
||||||
if ($echo) {
|
|
||||||
echo $myVar;
|
|
||||||
} else {
|
|
||||||
return $myVar;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Page Slug
|
|
||||||
*
|
|
||||||
* This will return the slug value of a particular page
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses $url
|
|
||||||
*
|
|
||||||
* @param bool $echo Optional, default is true. False will 'return' value
|
|
||||||
* @return string Echos or returns based on param $echo
|
|
||||||
*/
|
|
||||||
function get_page_slug($echo=true) {
|
|
||||||
global $url;
|
|
||||||
$myVar = $url;
|
|
||||||
|
|
||||||
if ($echo) {
|
|
||||||
echo $myVar;
|
|
||||||
} else {
|
|
||||||
return $myVar;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Page Parent Slug
|
|
||||||
*
|
|
||||||
* This will return the slug value of a particular page's parent
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses $parent
|
|
||||||
*
|
|
||||||
* @param bool $echo Optional, default is true. False will 'return' value
|
|
||||||
* @return string Echos or returns based on param $echo
|
|
||||||
*/
|
|
||||||
function get_parent($echo=true) {
|
|
||||||
global $parent;
|
|
||||||
$myVar = $parent;
|
|
||||||
|
|
||||||
if ($echo) {
|
|
||||||
echo $myVar;
|
|
||||||
} else {
|
|
||||||
return $myVar;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Page Date
|
|
||||||
*
|
|
||||||
* This will return the page's updated date/timestamp
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses $date
|
|
||||||
* @uses $TIMEZONE
|
|
||||||
*
|
|
||||||
* @param string $i Optional, default is "l, F jS, Y - g:i A"
|
|
||||||
* @param bool $echo Optional, default is true. False will 'return' value
|
|
||||||
* @return string Echos or returns based on param $echo
|
|
||||||
*/
|
|
||||||
function get_page_date($i = "l, F jS, Y - g:i A", $echo=true) {
|
|
||||||
global $date;
|
|
||||||
global $TIMEZONE;
|
|
||||||
if ($TIMEZONE != '') {
|
|
||||||
if (function_exists('date_default_timezone_set')) {
|
|
||||||
date_default_timezone_set($TIMEZONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$myVar = date($i, strtotime($date));
|
|
||||||
|
|
||||||
if ($echo) {
|
|
||||||
echo $myVar;
|
|
||||||
} else {
|
|
||||||
return $myVar;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Page Full URL
|
|
||||||
*
|
|
||||||
* This will return the full url
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses $parent
|
|
||||||
* @uses $url
|
|
||||||
* @uses $SITEURL
|
|
||||||
* @uses $PRETTYURLS
|
|
||||||
* @uses find_url
|
|
||||||
*
|
|
||||||
* @param bool $echo Optional, default is false. True will 'return' value
|
|
||||||
* @return string Echos or returns based on param $echo
|
|
||||||
*/
|
|
||||||
function get_page_url($echo=false) {
|
|
||||||
global $url;
|
|
||||||
global $SITEURL;
|
|
||||||
global $PRETTYURLS;
|
|
||||||
global $parent;
|
|
||||||
|
|
||||||
if (!$echo) {
|
|
||||||
echo find_url($url, $parent);
|
|
||||||
} else {
|
|
||||||
return find_url($url, $parent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Page Header HTML
|
|
||||||
*
|
|
||||||
* This will return header html for a particular page. This will include the
|
|
||||||
* meta desriptions & keywords, canonical and title tags
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses exec_action
|
|
||||||
* @uses get_page_url
|
|
||||||
* @uses strip_quotes
|
|
||||||
* @uses get_page_meta_desc
|
|
||||||
* @uses get_page_meta_keywords
|
|
||||||
* @uses $metad
|
|
||||||
* @uses $title
|
|
||||||
* @uses $content
|
|
||||||
* @uses $site_full_name from configuration.php
|
|
||||||
* @uses GSADMININCPATH
|
|
||||||
*
|
|
||||||
* @return string HTML for template header
|
|
||||||
*/
|
|
||||||
function get_header($full=true) {
|
|
||||||
global $metad;
|
|
||||||
global $title;
|
|
||||||
global $content;
|
|
||||||
include(GSADMININCPATH.'configuration.php');
|
|
||||||
|
|
||||||
// meta description
|
|
||||||
if ($metad != '') {
|
|
||||||
$description = get_page_meta_desc(FALSE);
|
|
||||||
}
|
|
||||||
else if(getDef('GSAUTOMETAD',true))
|
|
||||||
{
|
|
||||||
// get meta from content excerpt
|
|
||||||
if (function_exists('mb_substr')) {
|
|
||||||
$description = trim(mb_substr(strip_tags(strip_decode($content)), 0, 160));
|
|
||||||
} else {
|
|
||||||
$description = trim(substr(strip_tags(strip_decode($content)), 0, 160));
|
|
||||||
}
|
|
||||||
|
|
||||||
$description = str_replace('"','', $description);
|
|
||||||
$description = str_replace("'",'', $description);
|
|
||||||
$description = preg_replace('/\n/', " ", $description);
|
|
||||||
$description = preg_replace('/\r/', " ", $description);
|
|
||||||
$description = preg_replace('/\t/', " ", $description);
|
|
||||||
$description = preg_replace('/ +/', " ", $description);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!empty($description)) echo '<meta name="description" content="'.$description.'" />'."\n";
|
|
||||||
|
|
||||||
// meta keywords
|
|
||||||
$keywords = get_page_meta_keywords(FALSE);
|
|
||||||
if ($keywords != '') echo '<meta name="keywords" content="'.$keywords.'" />'."\n";
|
|
||||||
|
|
||||||
if ($full) {
|
|
||||||
echo '<link rel="canonical" href="'. get_page_url(true) .'" />'."\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
// script queue
|
|
||||||
get_scripts_frontend();
|
|
||||||
|
|
||||||
exec_action('theme-header');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Page Footer HTML
|
|
||||||
*
|
|
||||||
* This will return footer html for a particular page. Right now
|
|
||||||
* this function only executes a plugin hook so developers can hook into
|
|
||||||
* the bottom of a site's template.
|
|
||||||
*
|
|
||||||
* @since 2.0
|
|
||||||
* @uses exec_action
|
|
||||||
*
|
|
||||||
* @return string HTML for template header
|
|
||||||
*/
|
|
||||||
function get_footer() {
|
|
||||||
get_scripts_frontend(TRUE);
|
|
||||||
exec_action('theme-footer');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Site URL
|
|
||||||
*
|
|
||||||
* This will return the site's full base URL
|
|
||||||
* This is the value set in the control panel
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses $SITEURL
|
|
||||||
*
|
|
||||||
* @param bool $echo Optional, default is true. False will 'return' value
|
|
||||||
* @return string Echos or returns based on param $echo
|
|
||||||
*/
|
|
||||||
function get_site_url($echo=true) {
|
|
||||||
global $SITEURL;
|
|
||||||
|
|
||||||
if ($echo) {
|
|
||||||
echo $SITEURL;
|
|
||||||
} else {
|
|
||||||
return $SITEURL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Theme URL
|
|
||||||
*
|
|
||||||
* This will return the current active theme's full URL
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses $SITEURL
|
|
||||||
* @uses $TEMPLATE
|
|
||||||
*
|
|
||||||
* @param bool $echo Optional, default is true. False will 'return' value
|
|
||||||
* @return string Echos or returns based on param $echo
|
|
||||||
*/
|
|
||||||
function get_theme_url($echo=true) {
|
|
||||||
global $SITEURL;
|
|
||||||
global $TEMPLATE;
|
|
||||||
$myVar = trim($SITEURL . "theme/" . $TEMPLATE);
|
|
||||||
|
|
||||||
if ($echo) {
|
|
||||||
echo $myVar;
|
|
||||||
} else {
|
|
||||||
return $myVar;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Site's Name
|
|
||||||
*
|
|
||||||
* This will return the value set in the control panel
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses $SITENAME
|
|
||||||
*
|
|
||||||
* @param bool $echo Optional, default is true. False will 'return' value
|
|
||||||
* @return string Echos or returns based on param $echo
|
|
||||||
*/
|
|
||||||
function get_site_name($echo=true) {
|
|
||||||
global $SITENAME;
|
|
||||||
$myVar = cl($SITENAME);
|
|
||||||
|
|
||||||
if ($echo) {
|
|
||||||
echo $myVar;
|
|
||||||
} else {
|
|
||||||
return $myVar;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Administrator's Email Address
|
|
||||||
*
|
|
||||||
* This will return the value set in the control panel
|
|
||||||
*
|
|
||||||
* @depreciated as of 3.0
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses $EMAIL
|
|
||||||
*
|
|
||||||
* @param bool $echo Optional, default is true. False will 'return' value
|
|
||||||
* @return string Echos or returns based on param $echo
|
|
||||||
*/
|
|
||||||
function get_site_email($echo=true) {
|
|
||||||
global $EMAIL;
|
|
||||||
$myVar = trim(stripslashes($EMAIL));
|
|
||||||
|
|
||||||
if ($echo) {
|
|
||||||
echo $myVar;
|
|
||||||
} else {
|
|
||||||
return $myVar;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Site Credits
|
|
||||||
*
|
|
||||||
* This will return HTML that displays 'Powered by GetSimple X.XX'
|
|
||||||
* It will always be nice if developers left this in their templates
|
|
||||||
* to help promote GetSimple.
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses $site_link_back_url from configuration.php
|
|
||||||
* @uses $site_full_name from configuration.php
|
|
||||||
* @uses GSVERSION
|
|
||||||
* @uses GSADMININCPATH
|
|
||||||
*
|
|
||||||
* @param string $text Optional, default is 'Powered by'
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function get_site_credits($text ='Powered by ') {
|
|
||||||
include(GSADMININCPATH.'configuration.php');
|
|
||||||
|
|
||||||
$site_credit_link = '<a href="'.$site_link_back_url.'" target="_blank" >'.$text.' '.$site_full_name.'</a>';
|
|
||||||
echo stripslashes($site_credit_link);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Menu Data
|
|
||||||
*
|
|
||||||
* This will return data to be used in custom navigation functions
|
|
||||||
*
|
|
||||||
* @since 2.0
|
|
||||||
* @uses GSDATAPAGESPATH
|
|
||||||
* @uses find_url
|
|
||||||
* @uses getXML
|
|
||||||
* @uses subval_sort
|
|
||||||
*
|
|
||||||
* @param bool $xml Optional, default is false.
|
|
||||||
* True will return value in XML format. False will return an array
|
|
||||||
* @return array|string Type 'string' in this case will be XML
|
|
||||||
*/
|
|
||||||
function menu_data($id = null,$xml=false) {
|
|
||||||
$menu_extract = '';
|
|
||||||
|
|
||||||
global $pagesArray;
|
|
||||||
$pagesSorted = subval_sort($pagesArray,'menuOrder');
|
|
||||||
if (count($pagesSorted) != 0) {
|
|
||||||
$count = 0;
|
|
||||||
if (!$xml){
|
|
||||||
foreach ($pagesSorted as $page) {
|
|
||||||
$text = (string)$page['menu'];
|
|
||||||
$pri = (string)$page['menuOrder'];
|
|
||||||
$parent = (string)$page['parent'];
|
|
||||||
$title = (string)$page['title'];
|
|
||||||
$slug = (string)$page['url'];
|
|
||||||
$menuStatus = (string)$page['menuStatus'];
|
|
||||||
$private = (string)$page['private'];
|
|
||||||
$pubDate = (string)$page['pubDate'];
|
|
||||||
|
|
||||||
$url = find_url($slug,$parent);
|
|
||||||
|
|
||||||
$specific = array("slug"=>$slug,"url"=>$url,"parent_slug"=>$parent,"title"=>$title,"menu_priority"=>$pri,"menu_text"=>$text,"menu_status"=>$menuStatus,"private"=>$private,"pub_date"=>$pubDate);
|
|
||||||
|
|
||||||
if ($id == $slug) {
|
|
||||||
return $specific;
|
|
||||||
exit;
|
|
||||||
} else {
|
|
||||||
$menu_extract[] = $specific;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $menu_extract;
|
|
||||||
} else {
|
|
||||||
$xml = '<?xml version="1.0" encoding="UTF-8"?><channel>';
|
|
||||||
foreach ($pagesSorted as $page) {
|
|
||||||
$text = $page['menu'];
|
|
||||||
$pri = $page['menuOrder'];
|
|
||||||
$parent = $page['parent'];
|
|
||||||
$title = $page['title'];
|
|
||||||
$slug = $page['url'];
|
|
||||||
$pubDate = $page['pubDate'];
|
|
||||||
$menuStatus = $page['menuStatus'];
|
|
||||||
$private = $page['private'];
|
|
||||||
|
|
||||||
$url = find_url($slug,$parent);
|
|
||||||
|
|
||||||
$xml.="<item>";
|
|
||||||
$xml.="<slug><![CDATA[".$slug."]]></slug>";
|
|
||||||
$xml.="<pubDate><![CDATA[".$pubDate."]]></pubDate>";
|
|
||||||
$xml.="<url><![CDATA[".$url."]]></url>";
|
|
||||||
$xml.="<parent><![CDATA[".$parent."]]></parent>";
|
|
||||||
$xml.="<title><![CDATA[".$title."]]></title>";
|
|
||||||
$xml.="<menuOrder><![CDATA[".$pri."]]></menuOrder>";
|
|
||||||
$xml.="<menu><![CDATA[".$text."]]></menu>";
|
|
||||||
$xml.="<menuStatus><![CDATA[".$menuStatus."]]></menuStatus>";
|
|
||||||
$xml.="<private><![CDATA[".$private."]]></private>";
|
|
||||||
$xml.="</item>";
|
|
||||||
}
|
|
||||||
$xml.="</channel>";
|
|
||||||
return $xml;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Component
|
|
||||||
*
|
|
||||||
* This will return the component requested.
|
|
||||||
* Components are parsed for PHP within them.
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses GSDATAOTHERPATH
|
|
||||||
* @uses getXML
|
|
||||||
* @modified mvlcek 6/12/2011
|
|
||||||
*
|
|
||||||
* @param string $id This is the ID of the component you want to display
|
|
||||||
* True will return value in XML format. False will return an array
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function get_component($id) {
|
|
||||||
global $components;
|
|
||||||
if (!$components) {
|
|
||||||
if (file_exists(GSDATAOTHERPATH.'components.xml')) {
|
|
||||||
$data = getXML(GSDATAOTHERPATH.'components.xml');
|
|
||||||
$components = $data->item;
|
|
||||||
} else {
|
|
||||||
$components = array();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (count($components) > 0) {
|
|
||||||
foreach ($components as $component) {
|
|
||||||
if ($id == $component->slug) {
|
|
||||||
eval("?>" . strip_decode($component->value) . "<?php ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Main Navigation
|
|
||||||
*
|
|
||||||
* This will return unordered list of main navigation
|
|
||||||
* This function uses the menu opitions listed within the 'Edit Page' control panel screen
|
|
||||||
*
|
|
||||||
* @since 1.0
|
|
||||||
* @uses GSDATAOTHERPATH
|
|
||||||
* @uses getXML
|
|
||||||
* @uses subval_sort
|
|
||||||
* @uses find_url
|
|
||||||
* @uses strip_quotes
|
|
||||||
* @uses exec_filter
|
|
||||||
*
|
|
||||||
* @param string $currentpage This is the ID of the current page the visitor is on
|
|
||||||
* @param string $classPrefix Prefix that gets added to the parent and slug classnames
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function get_navigation($currentpage,$classPrefix = "") {
|
|
||||||
|
|
||||||
$menu = '';
|
|
||||||
|
|
||||||
global $pagesArray;
|
|
||||||
|
|
||||||
$pagesSorted = subval_sort($pagesArray,'menuOrder');
|
|
||||||
if (count($pagesSorted) != 0) {
|
|
||||||
foreach ($pagesSorted as $page) {
|
|
||||||
$sel = ''; $classes = '';
|
|
||||||
$url_nav = $page['url'];
|
|
||||||
|
|
||||||
if ($page['menuStatus'] == 'Y') {
|
|
||||||
$parentClass = !empty($page['parent']) ? $classPrefix.$page['parent'] . " " : "";
|
|
||||||
$classes = trim( $parentClass.$classPrefix.$url_nav);
|
|
||||||
if ("$currentpage" == "$url_nav") $classes .= " current active";
|
|
||||||
if ($page['menu'] == '') { $page['menu'] = $page['title']; }
|
|
||||||
if ($page['title'] == '') { $page['title'] = $page['menu']; }
|
|
||||||
$menu .= '<li class="'. $classes .'"><a href="'. find_url($page['url'],$page['parent']) . '" title="'. encode_quotes(cl($page['title'])) .'">'.strip_decode($page['menu']).'</a></li>'."\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
echo exec_filter('menuitems',$menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if a user is logged in
|
|
||||||
*
|
|
||||||
* This will return true if user is logged in
|
|
||||||
*
|
|
||||||
* @since 3.2
|
|
||||||
* @uses get_cookie();
|
|
||||||
* @uses $USR
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
function is_logged_in(){
|
|
||||||
global $USR;
|
|
||||||
if (isset($USR) && $USR == get_cookie('GS_ADMIN_USERNAME')) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @depreciated as of 2.04
|
|
||||||
*/
|
|
||||||
function return_page_title() {
|
|
||||||
return get_page_title(FALSE);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @depreciated as of 2.04
|
|
||||||
*/
|
|
||||||
function return_parent() {
|
|
||||||
return get_parent(FALSE);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @depreciated as of 2.04
|
|
||||||
*/
|
|
||||||
function return_page_slug() {
|
|
||||||
return get_page_slug(FALSE);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @depreciated as of 2.04
|
|
||||||
*/
|
|
||||||
function return_site_ver() {
|
|
||||||
return get_site_version(FALSE);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @depreciated as of 2.03
|
|
||||||
*/
|
|
||||||
if(!function_exists('set_contact_page')) {
|
|
||||||
function set_contact_page() {
|
|
||||||
#removed functionality
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
@ -1,144 +0,0 @@
|
|||||||
<?php
|
|
||||||
include('common.php');
|
|
||||||
login_cookie_check();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Thumbnail Image Generator
|
|
||||||
*
|
|
||||||
* REQUIREMENTS:
|
|
||||||
* - PHP 4.0.6 and GD 2.0.1 or later
|
|
||||||
* - May not work with GIFs if GD2 library installed on your server
|
|
||||||
* - does not support GIF functions in full
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* - src - path to source image
|
|
||||||
* - dest - path to thumb (where to save it)
|
|
||||||
* - x - max width
|
|
||||||
* - y - max height
|
|
||||||
* - q - quality (applicable only to JPG, 1 to 100, 100 - best)
|
|
||||||
* - t - thumb type. "-1" - same as source, 1 = GIF, 2 = JPG, 3 = PNG
|
|
||||||
* - f - save to file (1) or output to browser (0).
|
|
||||||
*
|
|
||||||
* Sample usage:
|
|
||||||
* 1. save thumb on server:
|
|
||||||
* http://www.zubrag.com/thumb.php?src=test.jpg&dest=thumb.jpg&x=100&y=50
|
|
||||||
* 2. output thumb to browser:
|
|
||||||
* http://www.zubrag.com/thumb.php?src=test.jpg&x=50&y=50&f=0
|
|
||||||
*
|
|
||||||
* @link //www.zubrag.com/scripts/
|
|
||||||
* @version 1.3
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Images
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Below are default values (if parameter is not passed)
|
|
||||||
|
|
||||||
// save to file (true) or output to browser (false)
|
|
||||||
$save_to_file = true;
|
|
||||||
|
|
||||||
// Quality for JPEG and PNG.
|
|
||||||
// 0 (worst quality, smaller file) to 100 (best quality, bigger file)
|
|
||||||
// Note: PNG quality is only supported starting PHP 5.1.2
|
|
||||||
$image_quality = 65;
|
|
||||||
|
|
||||||
// resulting image type (1 = GIF, 2 = JPG, 3 = PNG)
|
|
||||||
// enter code of the image type if you want override it
|
|
||||||
// or set it to -1 to determine automatically
|
|
||||||
$image_type = -1;
|
|
||||||
|
|
||||||
// maximum thumb side size
|
|
||||||
$max_x = 65;
|
|
||||||
$max_y = 130;
|
|
||||||
|
|
||||||
// cut image before resizing. Set to 0 to skip this.
|
|
||||||
$cut_x = 0;
|
|
||||||
$cut_y = 0;
|
|
||||||
|
|
||||||
// Folder where source images are stored (thumbnails will be generated from these images).
|
|
||||||
// MUST end with slash.
|
|
||||||
$images_folder = GSDATAUPLOADPATH;
|
|
||||||
|
|
||||||
// Folder to save thumbnails, full path from the root folder, MUST end with slash.
|
|
||||||
// Only needed if you save generated thumbnails on the server.
|
|
||||||
// Sample for windows: c:/wwwroot/thumbs/
|
|
||||||
// Sample for unix/linux: /home/site.com/htdocs/thumbs/
|
|
||||||
$thumbs_folder = GSTHUMBNAILPATH;
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////
|
|
||||||
/////////////// DO NOT EDIT BELOW
|
|
||||||
///////////////////////////////////////////////////
|
|
||||||
|
|
||||||
$to_name = '';
|
|
||||||
|
|
||||||
if (isset($_REQUEST['f'])) {
|
|
||||||
$save_to_file = intval($_REQUEST['f']) == 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_REQUEST['src'])) {
|
|
||||||
$from_name = str_replace('../','', urldecode($_REQUEST['src']));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
die("Source file name must be specified.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_REQUEST['dest'])) {
|
|
||||||
$to_name = str_replace('../','', urldecode($_REQUEST['dest']));
|
|
||||||
}
|
|
||||||
else if ($save_to_file) {
|
|
||||||
die("Thumbnail file name must be specified.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_REQUEST['q'])) {
|
|
||||||
$image_quality = intval($_REQUEST['q']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_REQUEST['t'])) {
|
|
||||||
$image_type = intval($_REQUEST['t']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_REQUEST['x'])) {
|
|
||||||
$max_x = intval($_REQUEST['x']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_REQUEST['y'])) {
|
|
||||||
$max_y = intval($_REQUEST['y']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$path_parts = pathinfo($from_name);
|
|
||||||
|
|
||||||
if (!file_exists($images_folder)) die('Images folder does not exist (update $images_folder in the script)');
|
|
||||||
if ($save_to_file && !file_exists($thumbs_folder)) die('Thumbnails folder does not exist (update $thumbs_folder in the script)');
|
|
||||||
|
|
||||||
$dirs=explode('/' ,$path_parts['dirname']);
|
|
||||||
$folder=$thumbs_folder;
|
|
||||||
foreach ($dirs as $dir){
|
|
||||||
$folder.=DIRECTORY_SEPARATOR.$dir;
|
|
||||||
if (!is_dir($folder)){
|
|
||||||
mkdir ($folder);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Allocate all necessary memory for the image.
|
|
||||||
// Special thanks to Alecos for providing the code.
|
|
||||||
ini_set('memory_limit', '100M');
|
|
||||||
|
|
||||||
// include image processing code
|
|
||||||
include('image.class.php');
|
|
||||||
|
|
||||||
$img = new Zubrag_image;
|
|
||||||
|
|
||||||
// initialize
|
|
||||||
$img->max_x = $max_x;
|
|
||||||
$img->max_y = $max_y;
|
|
||||||
$img->cut_x = $cut_x;
|
|
||||||
$img->cut_y = $cut_y;
|
|
||||||
$img->quality = $image_quality;
|
|
||||||
$img->save_to_file = $save_to_file;
|
|
||||||
$img->image_type = $image_type;
|
|
||||||
|
|
||||||
// generate thumbnail
|
|
||||||
$img->GenerateThumbFile($images_folder . $from_name, $thumbs_folder . $to_name);
|
|
||||||
|
|
||||||
?>
|
|
@ -1,87 +0,0 @@
|
|||||||
<option value="Kwajalein">(GMT-12:00) International Date Line West</option>
|
|
||||||
<option value="Pacific/Samoa">(GMT-11:00) Midway Island, Samoa</option>
|
|
||||||
<option value="Pacific/Honolulu">(GMT-10:00) Hawaii</option>
|
|
||||||
<option value="America/Anchorage">(GMT-09:00) Alaska</option>
|
|
||||||
<option value="America/Los_Angeles">(GMT-08:00) Pacific Time (US & Canada)</option>
|
|
||||||
<option value="America/Tijuana">(GMT-08:00) Tijuana, Baja California</option>
|
|
||||||
<option value="America/Denver">(GMT-07:00) Mountain Time (US & Canada)</option>
|
|
||||||
<option value="America/Chihuahua">(GMT-07:00) Chihuahua, La Paz, Mazatlan</option>
|
|
||||||
<option value="America/Phoenix">(GMT-07:00) Arizona</option>
|
|
||||||
<option value="America/Regina">(GMT-06:00) Saskatchewan</option>
|
|
||||||
<option value="America/Tegucigalpa">(GMT-06:00) Central America</option>
|
|
||||||
<option value="America/Chicago">(GMT-06:00) Central Time (US & Canada)</option>
|
|
||||||
<option value="America/Mexico_City">(GMT-06:00) Guadalajara, Mexico City, Monterrey</option>
|
|
||||||
<option value="America/New_York">(GMT-05:00) Eastern Time (US & Canada)</option>
|
|
||||||
<option value="America/Bogota">(GMT-05:00) Bogota, Lima, Quito, Rio Branco</option>
|
|
||||||
<option value="America/Indiana/Indianapolis">(GMT-05:00) Indiana (East)</option>
|
|
||||||
<option value="America/Caracas">(GMT-04:30) Caracas</option>
|
|
||||||
<option value="America/Halifax">(GMT-04:00) Atlantic Time (Canada)</option>
|
|
||||||
<option value="America/Manaus">(GMT-04:00) Manaus</option>
|
|
||||||
<option value="America/Santiago">(GMT-04:00) Santiago</option>
|
|
||||||
<option value="America/La_Paz">(GMT-04:00) La Paz</option>
|
|
||||||
<option value="America/St_Johns">(GMT-03:30) Newfoundland</option>
|
|
||||||
<option value="America/Argentina/Buenos_Aires">(GMT-03:00) Buenos Aires</option>
|
|
||||||
<option value="America/Sao_Paulo">(GMT-03:00) Brasilia</option>
|
|
||||||
<option value="America/Godthab">(GMT-03:00) Greenland</option>
|
|
||||||
<option value="America/Montevideo">(GMT-03:00) Montevideo</option>
|
|
||||||
<option value="America/Argentina/Buenos_Aires">(GMT-03:00) Georgetown</option>
|
|
||||||
<option value="Atlantic/South_Georgia">(GMT-02:00) Mid-Atlantic</option>
|
|
||||||
<option value="Atlantic/Azores">(GMT-01:00) Azores</option>
|
|
||||||
<option value="Atlantic/Cape_Verde">(GMT-01:00) Cape Verde Is.</option>
|
|
||||||
<option value="Europe/London">(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London</option>
|
|
||||||
<option value="Atlantic/Reykjavik">(GMT) Monrovia, Reykjavik</option>
|
|
||||||
<option value="Africa/Casablanca">(GMT) Casablanca</option>
|
|
||||||
<option value="Europe/Belgrade">(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague</option>
|
|
||||||
<option value="Europe/Sarajevo">(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb</option>
|
|
||||||
<option value="Europe/Brussels">(GMT+01:00) Brussels, Copenhagen, Madrid, Paris</option>
|
|
||||||
<option value="Africa/Algiers">(GMT+01:00) West Central Africa</option>
|
|
||||||
<option value="Europe/Amsterdam">(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna</option>
|
|
||||||
<option value="Europe/Minsk">(GMT+02:00) Minsk</option>
|
|
||||||
<option value="Africa/Cairo">(GMT+02:00) Cairo</option>
|
|
||||||
<option value="Europe/Helsinki">(GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius</option>
|
|
||||||
<option value="Europe/Athens">(GMT+02:00) Athens, Bucharest, Istanbul</option>
|
|
||||||
<option value="Asia/Jerusalem">(GMT+02:00) Jerusalem</option>
|
|
||||||
<option value="Asia/Amman">(GMT+02:00) Amman</option>
|
|
||||||
<option value="Asia/Beirut">(GMT+02:00) Beirut</option>
|
|
||||||
<option value="Africa/Windhoek">(GMT+02:00) Windhoek</option>
|
|
||||||
<option value="Africa/Harare">(GMT+02:00) Harare, Pretoria</option>
|
|
||||||
<option value="Asia/Kuwait">(GMT+03:00) Kuwait, Riyadh</option>
|
|
||||||
<option value="Asia/Baghdad">(GMT+03:00) Baghdad</option>
|
|
||||||
<option value="Africa/Nairobi">(GMT+03:00) Nairobi</option>
|
|
||||||
<option value="Asia/Tbilisi">(GMT+03:00) Tbilisi</option>
|
|
||||||
<option value="Asia/Tehran">(GMT+03:30) Tehran</option>
|
|
||||||
<option value="Asia/Muscat">(GMT+04:00) Abu Dhabi, Muscat</option>
|
|
||||||
<option value="Asia/Baku">(GMT+04:00) Baku</option>
|
|
||||||
<option value="Europe/Moscow">(GMT+04:00) Moscow, St. Petersburg, Volgograd</option>
|
|
||||||
<option value="Asia/Yerevan">(GMT+04:00) Yerevan</option>
|
|
||||||
<option value="Asia/Yekaterinburg">(GMT+05:00) Ekaterinburg</option>
|
|
||||||
<option value="Asia/Karachi">(GMT+05:00) Islamabad, Karachi</option>
|
|
||||||
<option value="Asia/Tashkent">(GMT+05:00) Tashkent</option>
|
|
||||||
<option value="Asia/Kolkata">(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi</option>
|
|
||||||
<option value="Asia/Colombo">(GMT+05:30) Sri Jayawardenepura</option>
|
|
||||||
<option value="Asia/Katmandu">(GMT+05:45) Kathmandu</option>
|
|
||||||
<option value="Asia/Dhaka">(GMT+06:00) Astana, Dhaka</option>
|
|
||||||
<option value="Asia/Novosibirsk">(GMT+06:00) Almaty, Novosibirsk</option>
|
|
||||||
<option value="Asia/Rangoon">(GMT+06:30) Yangon (Rangoon)</option>
|
|
||||||
<option value="Asia/Krasnoyarsk">(GMT+07:00) Krasnoyarsk</option>
|
|
||||||
<option value="Asia/Bangkok">(GMT+07:00) Bangkok, Hanoi, Jakarta</option>
|
|
||||||
<option value="Asia/Beijing">(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi</option>
|
|
||||||
<option value="Asia/Ulaanbaatar">(GMT+08:00) Irkutsk, Ulaan Bataar</option>
|
|
||||||
<option value="Asia/Kuala_Lumpur">(GMT+08:00) Kuala Lumpur, Singapore</option>
|
|
||||||
<option value="Asia/Taipei">(GMT+08:00) Taipei</option>
|
|
||||||
<option value="Australia/Perth">(GMT+08:00) Perth</option>
|
|
||||||
<option value="Asia/Seoul">(GMT+09:00) Seoul</option>
|
|
||||||
<option value="Asia/Tokyo">(GMT+09:00) Osaka, Sapporo, Tokyo</option>
|
|
||||||
<option value="Asia/Yakutsk">(GMT+09:00) Yakutsk</option>
|
|
||||||
<option value="Australia/Darwin">(GMT+09:30) Darwin</option>
|
|
||||||
<option value="Australia/Adelaide">(GMT+09:30) Adelaide</option>
|
|
||||||
<option value="Australia/Sydney">(GMT+10:00) Canberra, Melbourne, Sydney</option>
|
|
||||||
<option value="Australia/Brisbane">(GMT+10:00) Brisbane</option>
|
|
||||||
<option value="Australia/Hobart">(GMT+10:00) Hobart</option>
|
|
||||||
<option value="Asia/Vladivostok">(GMT+10:00) Vladivostok</option>
|
|
||||||
<option value="Pacific/Guam">(GMT+10:00) Guam, Port Moresby</option>
|
|
||||||
<option value="Asia/Magadan">(GMT+11:00) Magadan, Solomon Is., New Caledonia</option>
|
|
||||||
<option value="Pacific/Fiji">(GMT+12:00) Fiji, Kamchatka, Marshall Is.</option>
|
|
||||||
<option value="Pacific/Auckland">(GMT+12:00) Auckland, Wellington</option>
|
|
||||||
<option value="Pacific/Tongatapu">(GMT+13:00) Nuku'alofa</option>
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<item><pubDate>Sun, 02 Aug 2009 11:19:32 -0700</pubDate><title><![CDATA[Oops! Page not found!]]></title><url><![CDATA[404]]></url><meta><![CDATA[error]]></meta><menu></menu><menuOrder><![CDATA[0]]></menuOrder><menuStatus></menuStatus><template><![CDATA[template.php]]></template><parent></parent><content><![CDATA[<p>We are sorry, but the page you are looking for does not exist.</p>]]></content><private></private></item>
|
|
@ -1,58 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<!--
|
|
||||||
|
|
||||||
This XML document is meant to change the colors within the GetSimple 3.0 Administrative Console
|
|
||||||
******************************************************************************************************
|
|
||||||
A few things to make note of:
|
|
||||||
1. There are a couple images within `/admin/template/images` that might need to change as a result
|
|
||||||
2. This is to be placed in the root of `/themes/` as `admin.xml`
|
|
||||||
3. Colors need the hash in front of the numbers. eg: #333333
|
|
||||||
4. Do not use shortcut hex values. eg. #333
|
|
||||||
5. Only works with GetSimple version 3.0
|
|
||||||
|
|
||||||
-->
|
|
||||||
<item>
|
|
||||||
<title>GetSimple Default Admin</title>
|
|
||||||
<author>Chris Cagle</author>
|
|
||||||
<link>http://www.cagintranet.com/</link>
|
|
||||||
<primary>
|
|
||||||
<darkest>
|
|
||||||
<!-- tab hover background, link hover -->
|
|
||||||
#0E1316
|
|
||||||
</darkest>
|
|
||||||
<darker>
|
|
||||||
<!-- non-active tab background, active main tab text hover -->
|
|
||||||
#182227
|
|
||||||
</darker>
|
|
||||||
<dark>
|
|
||||||
<!-- header bottom fade color -->
|
|
||||||
#283840
|
|
||||||
</dark>
|
|
||||||
<middle>
|
|
||||||
<!-- separators, active main tab text -->
|
|
||||||
#415A66
|
|
||||||
</middle>
|
|
||||||
<light>
|
|
||||||
<!-- header top fade color -->
|
|
||||||
#618899
|
|
||||||
</light>
|
|
||||||
<lighter>
|
|
||||||
<!-- site name link color -->
|
|
||||||
#E8EDF0
|
|
||||||
</lighter>
|
|
||||||
<lightest>
|
|
||||||
<!-- non-active tab text, separators -->
|
|
||||||
#AFC5CF
|
|
||||||
</lightest>
|
|
||||||
</primary>
|
|
||||||
<secondary>
|
|
||||||
<darkest>
|
|
||||||
<!-- side tab active shadow -->
|
|
||||||
#9F2C04
|
|
||||||
</darkest>
|
|
||||||
<lightest>
|
|
||||||
<!-- side tab active background, page subtitles -->
|
|
||||||
#CF3805
|
|
||||||
</lightest>
|
|
||||||
</secondary>
|
|
||||||
</item>
|
|
@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<channel><item><title><![CDATA[Sidebar]]></title><slug>sidebar</slug><value><![CDATA[<h2>GetSimple Features</h2>
|
|
||||||
<ul>
|
|
||||||
<li>XML based data storage</li>
|
|
||||||
<li>Best-in-Class User Interface</li>
|
|
||||||
<li>\'Undo\' protection &amp; backups</li>
|
|
||||||
<li>Easy to theme</li>
|
|
||||||
<li>Great documentation</li>
|
|
||||||
<li>Growing community</li>
|
|
||||||
</ul>
|
|
||||||
<p>This is your sidebar text. Please change me in <em>Theme -> Edit Components</em></p>
|
|
||||||
<p><a href=\"http://get-simple.info/download/\">Download the Latest GetSimple</a></p>]]></value></item><item><title><![CDATA[Tagline]]></title><slug>tagline</slug><value><![CDATA[Just Another GetSimple Website]]></value></item></channel>
|
|
@ -1,27 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<item><pubDate>Tue, 01 Sep 2009 18:35:53 -0700</pubDate><title><![CDATA[Welcome to GetSimple!]]></title><url><![CDATA[index]]></url><meta><![CDATA[getsimple, easy, content management system]]></meta><metad></metad><menu><![CDATA[Home]]></menu><menuOrder><![CDATA[1]]></menuOrder><menuStatus><![CDATA[Y]]></menuStatus><template><![CDATA[template.php]]></template><parent></parent><content><![CDATA[<p>Thank you for using GetSimple CMS. This is your homepage, so please change this text to be what you want.</p>
|
|
||||||
<ul>
|
|
||||||
<li><a href=\"http://get-simple.info/docs/\">GetSimple CMS Documentation</a>
|
|
||||||
<ul>
|
|
||||||
<li><a href=\"http://get-simple.info/docs/theme-creation\">How to Create a GetSimple Theme</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li><a href=\"http://get-simple.info/forums/\">GetSimple Support Forums</a></li>
|
|
||||||
</ul>
|
|
||||||
<h2>Header 2</h2>
|
|
||||||
<p>Lorem ipsum <em>dolor sit amet</em>, <strong>consectetur adipiscing elit</strong>. Donec <code>this is code</code> venenatis augue. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Integer vulputate pretium augue.</p>
|
|
||||||
<h3>Header 3</h3>
|
|
||||||
<pre><code>#header h1 a {
|
|
||||||
display: block;
|
|
||||||
width: 300px;
|
|
||||||
height: 80px;
|
|
||||||
}</code></pre>
|
|
||||||
<h4>Header 4</h4>
|
|
||||||
<ol>
|
|
||||||
<li>Lorem ipsum dolor sit amet</li>
|
|
||||||
<li>Consectetur adipiscing elit</li>
|
|
||||||
<li>Donec ut est risus, placerat venenatis augue</li>
|
|
||||||
</ol>
|
|
||||||
|
|
||||||
<blockquote>A blockquote. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut est risus, placerat venenatis augue. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</blockquote>
|
|
||||||
]]></content><private></private></item>
|
|
@ -1,24 +0,0 @@
|
|||||||
#
|
|
||||||
# GetSimple CMS htaccess ALLOW file
|
|
||||||
#
|
|
||||||
|
|
||||||
# prevent breaking plugin htaccess, prefer compat, since require is not overridable by order
|
|
||||||
|
|
||||||
# apache < 2.3
|
|
||||||
<IfModule !mod_authz_core.c>
|
|
||||||
Allow from all
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
# apache > 2.3 with mod_access_compat
|
|
||||||
<IfModule mod_access_compat.c>
|
|
||||||
Allow from all
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
# apache > 2.3 without mod_access_compat
|
|
||||||
<IfModule mod_authz_core.c>
|
|
||||||
|
|
||||||
<IfModule !mod_access_compat.c>
|
|
||||||
Require all granted
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
</IfModule>
|
|
@ -1,24 +0,0 @@
|
|||||||
#
|
|
||||||
# GetSimple CMS htaccess DENY file
|
|
||||||
#
|
|
||||||
|
|
||||||
# prevent breaking plugin htaccess, prefer compat, since require is not overridable by order
|
|
||||||
|
|
||||||
# apache < 2.3
|
|
||||||
<IfModule !mod_authz_core.c>
|
|
||||||
Deny from all
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
# apache > 2.3 with mod_access_compat
|
|
||||||
<IfModule mod_access_compat.c>
|
|
||||||
Deny from all
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
# apache > 2.3 without mod_access_compat
|
|
||||||
<IfModule mod_authz_core.c>
|
|
||||||
|
|
||||||
<IfModule !mod_access_compat.c>
|
|
||||||
Require all denied
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
</IfModule>
|
|
@ -1 +0,0 @@
|
|||||||
<?php /* functions moved to security.php */ ?>
|
|
@ -1,42 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Login
|
|
||||||
*
|
|
||||||
* Allows access to the GetSimple control panel
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Login
|
|
||||||
*/
|
|
||||||
|
|
||||||
# Setup inclusions
|
|
||||||
$load['login'] = true;
|
|
||||||
$load['plugin'] = true;
|
|
||||||
|
|
||||||
// wrap all include and header output in output buffering to prevent sending before headers.
|
|
||||||
ob_start();
|
|
||||||
include('inc/common.php');
|
|
||||||
get_template('header', cl($SITENAME).' » '.i18n_r('LOGIN'));
|
|
||||||
ob_end_flush();
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="wrapper">
|
|
||||||
<?php include('template/error_checking.php'); ?>
|
|
||||||
<div class="bodycontent clearfix">
|
|
||||||
<div id="maincontent">
|
|
||||||
<div class="main" >
|
|
||||||
<h3><?php echo cl($SITENAME); ?></h3>
|
|
||||||
<?php exec_action('index-login'); ?>
|
|
||||||
<form class="login" action="<?php echo myself(false).'?'. htmlentities($_SERVER['QUERY_STRING'], ENT_QUOTES); ?>" method="post">
|
|
||||||
<p><b><?php i18n('USERNAME'); ?>:</b><br /><input type="text" class="text" id="userid" name="userid" /></p>
|
|
||||||
<p><b><?php i18n('PASSWORD'); ?>:</b><br /><input type="password" class="text" id="pwd" name="pwd" /></p>
|
|
||||||
<p><input type="submit" name="submitted" class="submit" value="<?php i18n('LOGIN'); ?>" /></p>
|
|
||||||
</form>
|
|
||||||
<p class="cta" ><b>«</b> <a href="<?php echo $SITEURL; ?>"><?php i18n('BACK_TO_WEBSITE'); ?></a> | <a href="resetpassword.php"><?php i18n('FORGOT_PWD'); ?></a> »</p>
|
|
||||||
<div class="reqs" ><?php exec_action('login-reqs'); ?></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php get_template('footer'); ?>
|
|
@ -1,542 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* English Language File
|
|
||||||
*
|
|
||||||
* Date: 6 December 2011
|
|
||||||
* Revision: Dec 2013
|
|
||||||
* Version: GetSimple 3.3.0
|
|
||||||
* Traductors: Chris Cagle
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Language
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
$i18n = array(
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: install.php
|
|
||||||
*/
|
|
||||||
"PHPVER_ERROR" => "<b>Unable to continue:</b> PHP 5.1.3 or greater is required, you have ",
|
|
||||||
"SIMPLEXML_ERROR" => "<b>Unable to continue:</b> <em>SimpleXML</em> is not installed",
|
|
||||||
"CURL_WARNING" => "<b>Warning:</b> <em>cURL</em> Not Installed",
|
|
||||||
"TZ_WARNING" => "<b>Warning:</b> <em>date_default_timezone_set</em> is missing",
|
|
||||||
"WEBSITENAME_ERROR" => "<b>Error:</b> There was a problem with your website title",
|
|
||||||
"WEBSITEURL_ERROR" => "<b>Error:</b> There was a problem with your website URL",
|
|
||||||
"USERNAME_ERROR" => "<b>Error:</b> Username was not set",
|
|
||||||
"EMAIL_ERROR" => "<b>Error:</b> There was a problem with your email address",
|
|
||||||
"CHMOD_ERROR" => "<b>Unable to continue:</b> Unable to write the configuration file. CHMOD 755 or 777 the <code>/data</code>, <code>/backups</code> folders & sub-folders and retry.",
|
|
||||||
"EMAIL_COMPLETE" => "Setup Complete",
|
|
||||||
"EMAIL_USERNAME" => "Your username is",
|
|
||||||
"EMAIL_PASSWORD" => "Your new password is",
|
|
||||||
"EMAIL_LOGIN" => "Login here",
|
|
||||||
"EMAIL_THANKYOU" => "Thank you for using",
|
|
||||||
"NOTE_REGISTRATION" => "Your registration information has been sent to",
|
|
||||||
"NOTE_REGERROR" => "<b>Error:</b> There was a problem sending out the registration information via email. Please make note of the password below",
|
|
||||||
"NOTE_USERNAME" => "Your username is",
|
|
||||||
"NOTE_PASSWORD" => "and your password is",
|
|
||||||
"INSTALLATION" => "Installation",
|
|
||||||
"LABEL_WEBSITE" => "Website Name",
|
|
||||||
"LABEL_BASEURL" => "Website URL",
|
|
||||||
"LABEL_SUGGESTION" => "Our suggestion is",
|
|
||||||
"LABEL_USERNAME" => "Username",
|
|
||||||
"LABEL_DISPNAME" => "Display Name",
|
|
||||||
"LABEL_EMAIL" => "Email Address",
|
|
||||||
"LABEL_INSTALL" => "Install Now!",
|
|
||||||
"SELECT_LANGUAGE" => "Select your language",
|
|
||||||
"CONTINUE_SETUP" => "Continue with Setup",
|
|
||||||
"DOWNLOAD_LANG" => "Download Languages",
|
|
||||||
"SITE_UPDATED" => "Your site has been updated",
|
|
||||||
"SERVICE_UNAVAILABLE" => "This page is temporarily unavailable",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: pages.php
|
|
||||||
*/
|
|
||||||
"MENUITEM_SUBTITLE" => "menu item",
|
|
||||||
"HOMEPAGE_SUBTITLE" => "homepage",
|
|
||||||
"PRIVATE_SUBTITLE" => "private",
|
|
||||||
"EDITPAGE_TITLE" => "Edit Page",
|
|
||||||
"VIEWPAGE_TITLE" => "View Page",
|
|
||||||
"DELETEPAGE_TITLE" => "Delete Page",
|
|
||||||
"PAGE_MANAGEMENT" => "Page Management",
|
|
||||||
"TOGGLE_STATUS" => "Toggle Stat<em>u</em>s",
|
|
||||||
"TOTAL_PAGES" => "total pages",
|
|
||||||
"ALL_PAGES" => "Pages",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: edit.php
|
|
||||||
*/
|
|
||||||
"PAGE_NOTEXIST" => "The requested page does not exist",
|
|
||||||
"BTN_SAVEPAGE" => "Save Page",
|
|
||||||
"BTN_SAVEUPDATES" => "Save Updates",
|
|
||||||
"DEFAULT_TEMPLATE" => "Default Template",
|
|
||||||
"NONE" => "None",
|
|
||||||
"PAGE" => "Page",
|
|
||||||
"NEW_PAGE" => "New Page",
|
|
||||||
"PAGE_EDIT_MODE" => "Edit Page",
|
|
||||||
"CREATE_NEW_PAGE" => "Add New Page",
|
|
||||||
"VIEW" => "<em>V</em>iew",
|
|
||||||
"PAGE_OPTIONS" => "Page Optio<em>n</em>s",
|
|
||||||
"SLUG_URL" => "Custom URL (Slug)",
|
|
||||||
"TAG_KEYWORDS" => "Tags & Keywords",
|
|
||||||
"PARENT_PAGE" => "Page Parent",
|
|
||||||
"TEMPLATE" => "Page Template",
|
|
||||||
"KEEP_PRIVATE" => "Page Visibility",
|
|
||||||
"ADD_TO_MENU" => "Add this page to the menu",
|
|
||||||
"PRIORITY" => "Priority",
|
|
||||||
"MENU_TEXT" => "Menu Text",
|
|
||||||
"LABEL_PAGEBODY" => "Page Body",
|
|
||||||
"CANCEL" => "Cancel",
|
|
||||||
"BACKUP_AVAILABLE" => "Backup Available",
|
|
||||||
"MAX_FILE_SIZE" => "Max file size",
|
|
||||||
"LAST_SAVED" => "Page last saved by %s on",
|
|
||||||
"FILE_UPLOAD" => "File Upload",
|
|
||||||
"OR" => "or",
|
|
||||||
"SAVE_AND_CLOSE" => "Save & Close",
|
|
||||||
"PAGE_UNSAVED" => "Page has unsaved changes",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: upload.php
|
|
||||||
*/
|
|
||||||
"ERROR_UPLOAD" => "There was a problem with the file upload",
|
|
||||||
"FILE_SUCCESS_MSG" => "Success! File location",
|
|
||||||
"FILE_MANAGEMENT" => "File Management",
|
|
||||||
"UPLOADED_FILES" => "Uploaded Files",
|
|
||||||
"SHOW_ALL" => "Show All",
|
|
||||||
"VIEW_FILE" => "View File",
|
|
||||||
"DELETE_FILE" => "Delete File",
|
|
||||||
"TOTAL_FILES" => "total files & folders",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: logout.php
|
|
||||||
*/
|
|
||||||
"MSG_LOGGEDOUT" => "You are now logged out.",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: index.php
|
|
||||||
*/
|
|
||||||
"LOGIN" => "Login",
|
|
||||||
"USERNAME" => "Username",
|
|
||||||
"PASSWORD" => "Password",
|
|
||||||
"FORGOT_PWD" => "Forgot your password?",
|
|
||||||
"CONTROL_PANEL" => "Control Panel Login",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: navigation.php
|
|
||||||
*/
|
|
||||||
"CURRENT_MENU" => "Current Menu",
|
|
||||||
"NO_MENU_PAGES" => "There are no pages that are set to appear within the main menu",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: theme-edit.php
|
|
||||||
*/
|
|
||||||
"TEMPLATE_FILE" => "Template file <b>%s</b> has successfully been updated!",
|
|
||||||
"THEME_MANAGEMENT" => "Theme Management",
|
|
||||||
"EDIT_THEME" => "Theme Editor",
|
|
||||||
"EDITING_FILE" => "Editing File",
|
|
||||||
"BTN_SAVECHANGES" => "Save Changes",
|
|
||||||
"EDIT" => "Edit",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: support.php
|
|
||||||
*/
|
|
||||||
"SETTINGS_UPDATED" => "Your settings have been updated",
|
|
||||||
"UNDO" => "Undo",
|
|
||||||
"SUPPORT" => "Support",
|
|
||||||
"SETTINGS" => "Settings",
|
|
||||||
"ERROR" => "Error",
|
|
||||||
"BTN_SAVESETTINGS" => "Save Settings",
|
|
||||||
"VIEW_FAILED_LOGIN" => "View Failed Login Attempts",
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: log.php
|
|
||||||
*/
|
|
||||||
"MSG_HAS_BEEN_CLR" => " has been cleared",
|
|
||||||
"LOGS" => "Logs",
|
|
||||||
"VIEWING" => "Viewing",
|
|
||||||
"LOG_FILE" => "Log File",
|
|
||||||
"CLEAR_ALL_DATA" => "Clear all data from",
|
|
||||||
"CLEAR_THIS_LOG" => "<em>C</em>lear This Log",
|
|
||||||
"LOG_FILE_ENTRY" => "LOG FILE ENTRY",
|
|
||||||
"THIS_COMPUTER" => "This Computer",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: backup-edit.php
|
|
||||||
*/
|
|
||||||
"BAK_MANAGEMENT" => "Backup Management",
|
|
||||||
"ASK_CANCEL" => "<em>C</em>ancel", // 'c' is the accesskey identifier
|
|
||||||
"ASK_RESTORE" => "<em>R</em>estore", // 'r' is the accesskey identifier
|
|
||||||
"ASK_DELETE" => "<em>D</em>elete", // 'd' is the accesskey identifier
|
|
||||||
"BACKUP_OF" => "Backup of",
|
|
||||||
"PAGE_TITLE" => "Page Title",
|
|
||||||
"YES" => "Yes",
|
|
||||||
"NO" => "No",
|
|
||||||
"DATE" => "Date",
|
|
||||||
"PERMS" => "Perms",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: components.php
|
|
||||||
*/
|
|
||||||
"COMPONENTS" => "Components",
|
|
||||||
"DELETE_COMPONENT" => "Delete Component",
|
|
||||||
"EDIT" => "Edit",
|
|
||||||
"ADD_COMPONENT" => "<em>A</em>dd Component", // 'a' is the accesskey identifier
|
|
||||||
"SAVE_COMPONENTS" => "Save Components",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: sitemap.php
|
|
||||||
*/
|
|
||||||
"SITEMAP_CREATED" => "Sitemap Created! We also successfully pinged 4 search engines of the update",
|
|
||||||
"SITEMAP_ERRORPING" => "Sitemap Created, however there was an error pinging one or more of the search engines",
|
|
||||||
"SITEMAP_ERROR" => "Your sitemap could not be generated",
|
|
||||||
"SITEMAP_WAIT" => "<b>Please Wait:</b> Creating website sitemap",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: theme.php
|
|
||||||
*/
|
|
||||||
"THEME_CHANGED" => "Your theme has been changed successfully",
|
|
||||||
"CHOOSE_THEME" => "Choose Your Theme",
|
|
||||||
"ACTIVATE_THEME" => "Activate Theme",
|
|
||||||
"THEME_SCREENSHOT" => "Theme Screenshot",
|
|
||||||
"THEME_PATH" => "Theme Folder Location",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: resetpassword.php
|
|
||||||
*/
|
|
||||||
"RESET_PASSWORD" => "Reset Password",
|
|
||||||
"YOUR_NEW" => "Your new",
|
|
||||||
"PASSWORD_IS" => "password is",
|
|
||||||
"ATTEMPT" => "Attempt",
|
|
||||||
"MSG_PLEASE_EMAIL" => "Please enter the username registered on this system, and a new password will be sent to its email address.",
|
|
||||||
"SEND_NEW_PWD" => "Send New Password",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: settings.php
|
|
||||||
*/
|
|
||||||
"GENERAL_SETTINGS" => "General Settings",
|
|
||||||
"WEBSITE_SETTINGS" => "Website Settings",
|
|
||||||
"LOCAL_TIMEZONE" => "Local Timezone",
|
|
||||||
"LANGUAGE" => "Language",
|
|
||||||
"USE_FANCY_URLS" => "Use Fancy URLs - <b style=\"font-weight:100\">Requires that your host has <code>mod_rewrite</code> enabled</b>",
|
|
||||||
"ENABLE_HTML_ED" => "<b>Enable the HTML editor</b>",
|
|
||||||
"WARN_EMAILINVALID" => "WARNING: This email address does not look valid!",
|
|
||||||
"ONLY_NEW_PASSWORD" => "Only provide a password below if you want to change your current one",
|
|
||||||
"NEW_PASSWORD" => "New Password",
|
|
||||||
"CONFIRM_PASSWORD" => "Confirm Password",
|
|
||||||
"PASSWORD_NO_MATCH" => "Passwords do not match",
|
|
||||||
"PERMALINK" => "Custom Permalink Structure",
|
|
||||||
"MORE" => "more",
|
|
||||||
"HELP" => "help",
|
|
||||||
"FLUSHCACHE" => "Flush All Caches",
|
|
||||||
"FLUSHCACHE-SUCCESS"=> "Caches Flushed Successfully",
|
|
||||||
"DISPLAY_NAME" => "A name for public display that is not your username",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: health-check.php
|
|
||||||
*/
|
|
||||||
"WEB_HEALTH_CHECK" => "Website Health Check",
|
|
||||||
"VERSION" => "Version",
|
|
||||||
"UPG_NEEDED" => "Upgrade Recommended",
|
|
||||||
"CANNOT_CHECK" => "Upgrade Check Failed !",
|
|
||||||
"LATEST_VERSION" => "Latest version installed",
|
|
||||||
"SERVER_SETUP" => "Server Setup",
|
|
||||||
"OR_GREATER_REQ" => "or greater is required",
|
|
||||||
"OK" => "OK",
|
|
||||||
"INSTALLED" => "Installed",
|
|
||||||
"NOT_INSTALLED" => "Not Installed",
|
|
||||||
"WARNING" => "Warning",
|
|
||||||
"DATA_FILE_CHECK" => "Data File Integrity Check",
|
|
||||||
"DIR_PERMISSIONS" => "Directory Permissions",
|
|
||||||
"EXISTANCE" => "%s Existence",
|
|
||||||
"MISSING_FILE" => "Missing file",
|
|
||||||
"BAD_FILE" => "Bad file",
|
|
||||||
"NO_FILE" => "No file",
|
|
||||||
"GOOD_D_FILE" => "Good 'Deny' file",
|
|
||||||
"GOOD_A_FILE" => "Good 'Allow' file",
|
|
||||||
"CANNOT_DEL_FILE" => "Cannot Delete File",
|
|
||||||
"DOWNLOAD" => "Download",
|
|
||||||
"WRITABLE" => "Writable",
|
|
||||||
"NOT_WRITABLE" => "Not Writable",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: footer.php
|
|
||||||
*/
|
|
||||||
"POWERED_BY" => "Powered by",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: backups.php
|
|
||||||
*/
|
|
||||||
"PAGE_BACKUPS" => "Page Backups",
|
|
||||||
"ASK_DELETE_ALL" => "<em>D</em>elete All",
|
|
||||||
"DELETE_ALL_BAK" => "Delete all backups?",
|
|
||||||
"TOTAL_BACKUPS" => "total backups",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: archive.php
|
|
||||||
*/
|
|
||||||
"SUCC_WEB_ARCHIVE" => "An archive of your website has been successfully created",
|
|
||||||
"SUCC_WEB_ARC_DEL" => "The seleted archive has been successfully deleted",
|
|
||||||
"WEBSITE_ARCHIVES" => "Website Archives",
|
|
||||||
"ARCHIVE_DELETED" => "Archive deleted successfully",
|
|
||||||
"CREATE_NEW_ARC" => "Create a New Archive",
|
|
||||||
"ASK_CREATE_ARC" => "<em>C</em>reate New Archive Now",
|
|
||||||
"CREATE_ARC_WAIT" => "<b>Please Wait:</b> Creating website archive...",
|
|
||||||
"DOWNLOAD_ARCHIVES" => "Download Archive",
|
|
||||||
"DELETE_ARCHIVE" => "Delete Archive",
|
|
||||||
"TOTAL_ARCHIVES" => "total archives",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: include-nav.php
|
|
||||||
*/
|
|
||||||
"WELCOME" => "Welcome", // used as 'Welcome USERNAME!'
|
|
||||||
"TAB_PAGES" => "<em>P</em>ages",
|
|
||||||
"TAB_FILES" => "F<em>i</em>les",
|
|
||||||
"TAB_THEME" => "<em>T</em>heme",
|
|
||||||
"TAB_BACKUPS" => "<em>B</em>ackups",
|
|
||||||
"PLUGINS_NAV" => "Plu<em>g</em>ins",
|
|
||||||
"TAB_SETTINGS" => "<em>S</em>ettings",
|
|
||||||
"TAB_SUPPORT" => "Supp<em>o</em>rt",
|
|
||||||
"TAB_LOGOUT" => "<em>L</em>ogout",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: sidebar-files.php
|
|
||||||
*/
|
|
||||||
"BROWSE_COMPUTER" => "Browse Your Computer",
|
|
||||||
"UPLOAD" => "Upload",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: sidebar-support.php
|
|
||||||
*/
|
|
||||||
"SIDE_SUPPORT_LOG" => "Supp<em>o</em>rt",
|
|
||||||
"SIDE_HEALTH_CHK" => "Website <em>H</em>ealth Check",
|
|
||||||
"SIDE_DOCUMENTATION"=> "Wiki Documentation",
|
|
||||||
"SIDE_VIEW_LOG"=> "<em>V</em>iew Log",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: sidebar-theme.php
|
|
||||||
*/
|
|
||||||
"SIDE_VIEW_SITEMAP" => "<em>V</em>iew Sitemap",
|
|
||||||
"SIDE_GEN_SITEMAP" => "Generate Site<em>m</em>ap",
|
|
||||||
"SIDE_COMPONENTS" => "<em>E</em>dit Components",
|
|
||||||
"SIDE_EDIT_THEME" => "Edit T<em>h</em>eme",
|
|
||||||
"SIDE_CHOOSE_THEME" => "Choose <em>T</em>heme",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: sidebar-pages.php
|
|
||||||
*/
|
|
||||||
"SIDE_CREATE_NEW" => "<em>C</em>reate New Page",
|
|
||||||
"SIDE_VIEW_PAGES" => "View All <em>P</em>ages",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: sidebar-settings.php
|
|
||||||
*/
|
|
||||||
"SIDE_GEN_SETTINGS" => "General <em>S</em>ettings",
|
|
||||||
"SIDE_USER_PROFILE" => "<em>U</em>ser Profile",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: sidebar-backups.php
|
|
||||||
*/
|
|
||||||
"SIDE_VIEW_BAK" => "View Page Backup",
|
|
||||||
"SIDE_WEB_ARCHIVES" => "<em>W</em>ebsite Archives",
|
|
||||||
"SIDE_PAGE_BAK" => "Page <em>B</em>ackups",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: error_checking.php
|
|
||||||
*/
|
|
||||||
"ER_PWD_CHANGE" => "Don't forget to <a href=\"settings.php#profile\">change your password</a> from that random generated one you have now...",
|
|
||||||
"ER_BAKUP_DELETED" => "The backup has been deleted for <b>%s</b>",
|
|
||||||
"ER_REQ_PROC_FAIL" => "The requested process failed",
|
|
||||||
"ER_YOUR_CHANGES" => "Your changes to <b>%s</b> have been saved",
|
|
||||||
"ER_HASBEEN_REST" => "<b>%s</b> has been restored",
|
|
||||||
"ER_HASBEEN_DEL" => "<b>%s</b> has been deleted",
|
|
||||||
"ER_CANNOT_INDEX" => "You cannot change the URL of the index page",
|
|
||||||
"ER_SETTINGS_UPD" => "Your settings have been updated",
|
|
||||||
"ER_OLD_RESTORED" => "Your old settings have been restored",
|
|
||||||
"ER_NEW_PWD_SENT" => "A new password has been sent to the email address provided",
|
|
||||||
"ER_SENDMAIL_ERR" => "There was a problem sending the email. Please try again",
|
|
||||||
"ER_FILE_DEL_SUC" => "File deleted successfully",
|
|
||||||
"ER_PROBLEM_DEL" => "There was a problem deleting the file",
|
|
||||||
"ER_COMPONENT_SAVE" => "Your components have been saved",
|
|
||||||
"ER_COMPONENT_REST" => "Your components have been restored",
|
|
||||||
"ER_CANCELLED_FAIL" => "<b>Cancelled:</b> This update has been cancelled",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: changedata.php
|
|
||||||
*/
|
|
||||||
"CANNOT_SAVE_EMPTY" => "You cannot save a page with an empty title",
|
|
||||||
"META_DESC" => "Meta Description",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: template_functions.php
|
|
||||||
*/
|
|
||||||
"FTYPE_COMPRESSED" => "Compressed", //a file-type
|
|
||||||
"FTYPE_VECTOR" => "Vector", //a file-type
|
|
||||||
"FTYPE_FLASH" => "Flash", //a file-type
|
|
||||||
"FTYPE_VIDEO" => "Video", //a file-type
|
|
||||||
"FTYPE_AUDIO" => "Audio", //a file-type
|
|
||||||
"FTYPE_WEB" => "Web", //a file-type
|
|
||||||
"FTYPE_DOCUMENTS" => "Documents", //a file-type
|
|
||||||
"FTYPE_SYSTEM" => "System", //a file-type
|
|
||||||
"FTYPE_MISC" => "Misc", //a file-type
|
|
||||||
"IMAGES" => "Images",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: login_functions.php
|
|
||||||
*/
|
|
||||||
"FILL_IN_REQ_FIELD" => "Please fill in all the required fields",
|
|
||||||
"LOGIN_FAILED" => "Login failed. Please double check your Username and Password",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: Date Format
|
|
||||||
*/
|
|
||||||
"DATE_FORMAT" => "M j, Y", //please keep short
|
|
||||||
"DATE_AND_TIME_FORMAT" => "F jS, Y - g:i A", //date and time
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: support.php
|
|
||||||
*/
|
|
||||||
"WELCOME_MSG" => "Thank you for choosing GetSimple as your content management system!",
|
|
||||||
"WELCOME_P" => "GetSimple makes managing a website as simple as possible with its best-in-class user interface. We strive to keep the system easy enough for anyone to use, yet powerful enough for a developer to enable all the features that are needed.</p><p><strong>Some first steps that might be useful:</strong></p>",
|
|
||||||
"GETTING_STARTED" => "Getting Started",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: image.php
|
|
||||||
*/
|
|
||||||
|
|
||||||
"CURRENT_THUMBNAIL" => "Current Thumbnail",
|
|
||||||
"RECREATE" => "recreate",
|
|
||||||
"CREATE_ONE" => "create one",
|
|
||||||
"IMG_CONTROl_PANEL" => "Image Control Panel",
|
|
||||||
"ORIGINAL_IMG" => "Original Image",
|
|
||||||
"CLIPBOARD_INSTR" => "Select All",
|
|
||||||
"CREATE_THUMBNAIL" => "Create Thumbnail",
|
|
||||||
"CROP_INSTR_NEW" => "<em>ctrl-B</em> or <em>command-B</em> for square",
|
|
||||||
"SELECT_DIMENTIONS" => "Selection Dimentions",
|
|
||||||
"HTML_ORIG_IMG" => "Original Image HTML",
|
|
||||||
"LINK_ORIG_IMG" => "Original Image Link",
|
|
||||||
"HTML_THUMBNAIL" => "Thumbnail HTML",
|
|
||||||
"LINK_THUMBNAIL" => "Thumbnail Link",
|
|
||||||
"HTML_THUMB_ORIG" => "Thumbnail-to-Image HTML",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: plugins.php
|
|
||||||
*/
|
|
||||||
|
|
||||||
"PLUGINS_MANAGEMENT"=> "Plugin Management",
|
|
||||||
"PLUGINS_INSTALLED" => "plugins installed",
|
|
||||||
"PLUGIN_DISABLED" => "Disabled Plugin",
|
|
||||||
"SHOW_PLUGINS" => "Installed Plu<em>g</em>ins",
|
|
||||||
"PLUGIN_NAME" => "Plugin",
|
|
||||||
"PLUGIN_DESC" => "Description",
|
|
||||||
"PLUGIN_VER" => "Version",
|
|
||||||
"PLUGIN_UPDATED" => "Plugin Updated",
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************************
|
|
||||||
* SINCE Version 3.0
|
|
||||||
***********************************************************************************/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: setup.php
|
|
||||||
*/
|
|
||||||
|
|
||||||
"ROOT_HTACCESS_ERROR" => "Failed to create .htaccess in root! Please copy <code>%s</code> to <code>.htaccess</code> and change <code>%s</code> to <code>%s</code>",
|
|
||||||
"REMOVE_TEMPCONFIG_ERROR" => "Failed to remove <code>%s</code>! Please do it manually.",
|
|
||||||
"MOVE_TEMPCONFIG_ERROR" => "Failed to rename <code>%s</code> to <code>%s</code>! Please do it manually.",
|
|
||||||
"KILL_CANT_CONTINUE" => "Cannot continue. Please fix errors and try again.",
|
|
||||||
"REFRESH" => "Refresh",
|
|
||||||
"BETA"=> "Beta / Bleeding Edge",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Misc Cleanup Work
|
|
||||||
*/
|
|
||||||
|
|
||||||
# new to 3.0
|
|
||||||
"HOMEPAGE_DELETE_ERROR" => "You cannot delete your homepage", //deletefile
|
|
||||||
"NO_ZIPARCHIVE" => "ZipArchive extension is not installed. Unable to continue", //zip
|
|
||||||
"REDIRECT_MSG"=> "If your browser does not redirect you, click <a href=\"%s\">here</a>", //basic
|
|
||||||
"REDIRECT"=> "Redirect", //basic
|
|
||||||
"DENIED"=> "Denied", //sitemap
|
|
||||||
"DEBUG_MODE"=> "DEBUG MODE", //nav-include
|
|
||||||
"DOUBLE_CLICK_EDIT"=> "Double Click to Edit", //components
|
|
||||||
"THUMB_SAVED"=> "Thumbnail Saved", //image
|
|
||||||
"EDIT_COMPONENTS" => "Edit Components", //components
|
|
||||||
"REQS_MORE_INFO"=> "For more information on the required modules, visit the <a href=\"%s\" target=\"_blank\" >requirements page</a>.", //install & health-check
|
|
||||||
"SYSTEM_UPDATE" => "System Update", // update.php
|
|
||||||
"AUTHOR" => "Author", //plugins.php
|
|
||||||
"ENABLE" => "Activate", //plugins.php
|
|
||||||
"DISABLE" => "Deactivate", //plugins.php
|
|
||||||
"NO_THEME_SCREENSHOT" => "Your theme does not have a screenshot preview", //theme.php
|
|
||||||
"UNSAVED_INFORMATION" => "You are about to leave this page and will lose any unsaved information.", //edit.php
|
|
||||||
"BACK_TO_WEBSITE" => "Back to Website", //index & resetpassword
|
|
||||||
"SUPPORT_FORUM" => "Support Forum", //support.php
|
|
||||||
"FILTER" => "Filte<em>r</em>", //pages.php
|
|
||||||
"UPLOADIFY_BUTTON" => "Upload files and/or images...", //upload.php
|
|
||||||
"FILE_BROWSER" => "File Browser", //filebrowser.php
|
|
||||||
"SELECT_FILE" => "Select file", //filebrowser.php
|
|
||||||
"CREATE_FOLDER" => "Create Folder", //upload.php
|
|
||||||
"THUMBNAIL" => "Thumbnail", //filebrowser.php
|
|
||||||
"ERROR_FOLDER_EXISTS" => "The folder you are trying to create already exists", //upload.php
|
|
||||||
"FOLDER_CREATED" => "The new folder was successfully created: <b>%s</b>", //upload.php
|
|
||||||
"ERROR_CREATING_FOLDER" => "There was an error creating the new folder", //upload.php
|
|
||||||
"DELETE_FOLDER" => "Delete Folder", //upload.php
|
|
||||||
"FILE_NAME" => "File Name", //multiple tr header rows
|
|
||||||
"FILE_SIZE" => "Size", //multiple tr header rows
|
|
||||||
"ARCHIVE_DATE" => "Archive Date", //archive.php
|
|
||||||
"CKEDITOR_LANG" => "en", // edit.php ; set CKEditor language, don't forget to include CKEditor language file in translation zip
|
|
||||||
|
|
||||||
# new to 3.1
|
|
||||||
"XML_INVALID" => "XML Invalid", //template-functions.php
|
|
||||||
"XML_VALID" => "XML Valid",
|
|
||||||
"UPDATE_AVAILABLE" => "Update to", //plugins.php
|
|
||||||
"STATUS" => "Status", //plugins.php
|
|
||||||
"CLONE" => "Clone", //edit.php
|
|
||||||
"CLONE_SUCCESS" => "Successfully created %s", //pages.php
|
|
||||||
"COPY" => "Copy", //pages.php
|
|
||||||
"CLONE_ERROR" => "There was a problem trying to clone <b>%s</b>", //pages.php
|
|
||||||
"AUTOSAVE_NOTIFY" => 'Page autosaved at', //edit.php
|
|
||||||
"MENU_MANAGER" => '<em>M</em>enu Manager', //edit.php
|
|
||||||
"GET_PLUGINS_LINK" => 'Download <em>M</em>ore Plugins',
|
|
||||||
"SITEMAP_REFRESHED" => "Your sitemap has been refreshed", //edit.php
|
|
||||||
"LOG_FILE_EMPTY" => "This log file is empty", //log.php
|
|
||||||
"SHARE" => "Share", //footer.php
|
|
||||||
"NO_PARENT" => "No Parent", //edit.php
|
|
||||||
"REMAINING" => "characters remaining", //edit.php
|
|
||||||
"NORMAL" => "Normal", //edit.php
|
|
||||||
"ERR_CANNOT_DELETE" => "Cannot delete %s. Please do this manually.", //common.php
|
|
||||||
"ADDITIONAL_ACTIONS" => "Other Actions", //edit.php
|
|
||||||
"ITEMS" => "items", //upload.php
|
|
||||||
"SAVE_MENU_ORDER" => "Save Menu Order", //menu-manager.php
|
|
||||||
"MENU_MANAGER_DESC" => "Drag-and-drop the menu items around until you have the order you want, then click the <strong>'Save Menu Order'</strong> button.", //menu-manager.php
|
|
||||||
"MENU_MANAGER_SUCCESS" => "The new menu order has been saved", //menu-manager.php
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For: api related pages
|
|
||||||
*/
|
|
||||||
"API_ERR_MISSINGPARAM" => 'parameter data does not exist',
|
|
||||||
"API_ERR_BADMETHOD" => 'method %s does not exist',
|
|
||||||
"API_ERR_AUTHFAILED" => 'authentication failed',
|
|
||||||
"API_ERR_AUTHDISABLED" => 'authentication disabled',
|
|
||||||
"API_ERR_NOPAGE" => 'requested page %s does not exist',
|
|
||||||
"API_CONFIGURATION" => 'API Configuration',
|
|
||||||
"API_ENABLE" => 'Enable the API',
|
|
||||||
"API_REGENKEY" => 'Regenerate Key',
|
|
||||||
"API_DISCLAIMER" => "By enabling this API you are allowing any external application that has a copy of your key to have access to your website's data. <b>Only share this key with applications you trust.</b>",
|
|
||||||
"API_REGEN_DISCLAIMER" => "When you regenerate your API Key, you will need to enter the new key into any external application using this API to connect to your website.",
|
|
||||||
"API_CONFIRM" => "ARE YOU SURE?",
|
|
||||||
|
|
||||||
|
|
||||||
"X" => "not translated",
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Additions for 3.1
|
|
||||||
*/
|
|
||||||
"DEBUG_CONSOLE" => 'Debug Console'
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
?>
|
|
@ -1,3 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
die("This functionality is deprecated");
|
|
@ -1,59 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Load Plugin
|
|
||||||
*
|
|
||||||
* Displays the plugin file passed to it
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Plugins
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
# Setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
include('inc/common.php');
|
|
||||||
login_cookie_check();
|
|
||||||
|
|
||||||
global $plugin_info;
|
|
||||||
|
|
||||||
# verify a plugin was passed to this page
|
|
||||||
if (empty($_GET['id']) || !isset($plugin_info[$_GET['id']])) {
|
|
||||||
redirect('plugins.php');
|
|
||||||
}
|
|
||||||
|
|
||||||
# include the plugin
|
|
||||||
$plugin_id = $_GET['id'];
|
|
||||||
|
|
||||||
get_template('header', cl($SITENAME).' » '. $plugin_info[$plugin_id]['name']);
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php include('template/include-nav.php'); ?>
|
|
||||||
|
|
||||||
<div class="bodycontent clearfix">
|
|
||||||
|
|
||||||
<div id="maincontent">
|
|
||||||
<div class="main">
|
|
||||||
|
|
||||||
<?php
|
|
||||||
call_user_func_array($plugin_info[$plugin_id]['load_data'],array());
|
|
||||||
?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="sidebar" >
|
|
||||||
<?php
|
|
||||||
$res = (@include('template/sidebar-'.$plugin_info[$plugin_id]['page_type'].'.php'));
|
|
||||||
if (!$res) {
|
|
||||||
?>
|
|
||||||
<ul class="snav">
|
|
||||||
<?php exec_action($plugin_info[$plugin_id]['page_type']."-sidebar"); ?>
|
|
||||||
</ul>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php get_template('footer'); ?>
|
|
@ -1,3 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
die("This functionality is deprecated");
|
|
119
admin/log.php
@ -1,119 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* View Log
|
|
||||||
*
|
|
||||||
* Displays the log file passed to it
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Support
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
// Setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
include('inc/common.php');
|
|
||||||
|
|
||||||
// Variable Settings
|
|
||||||
login_cookie_check();
|
|
||||||
|
|
||||||
$log_name = isset($_GET['log']) ? $_GET['log'] : '';
|
|
||||||
$log_path = GSDATAOTHERPATH.'logs/';
|
|
||||||
$log_file = $log_path . $log_name;
|
|
||||||
|
|
||||||
$whois_url = 'http://whois.arin.net/rest/ip/';
|
|
||||||
|
|
||||||
// filepath_is_safe returns false if file does nt exist
|
|
||||||
if(!isset($log_name) || !filepath_is_safe($log_file,$log_path)) $log_data = false;
|
|
||||||
|
|
||||||
if (isset($_GET['action']) && $_GET['action'] == 'delete' && strlen($log_name)>0) {
|
|
||||||
// check for csrf
|
|
||||||
if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) {
|
|
||||||
$nonce = $_GET['nonce'];
|
|
||||||
if(!check_nonce($nonce, "delete")) {
|
|
||||||
die("CSRF detected!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
unlink($log_file);
|
|
||||||
exec_action('logfile_delete');
|
|
||||||
redirect('support.php?success='.urlencode('Log '.$log_name . i18n_r('MSG_HAS_BEEN_CLR')));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($log_data)) $log_data = getXML($log_file);
|
|
||||||
|
|
||||||
get_template('header', cl($SITENAME).' » '.i18n_r('SUPPORT').' » '.i18n_r('LOGS'));
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php include('template/include-nav.php'); ?>
|
|
||||||
|
|
||||||
<div class="bodycontent clearfix">
|
|
||||||
|
|
||||||
<div id="maincontent">
|
|
||||||
<div class="main">
|
|
||||||
<h3 class="floated"><?php i18n('VIEWING');?> <?php i18n('LOG_FILE');?>: ‘<em><?php echo var_out($log_name); ?></em>’</h3>
|
|
||||||
<div class="edit-nav" >
|
|
||||||
<a href="log.php?log=<?php echo $log_name; ?>&action=delete&nonce=<?php echo get_nonce("delete"); ?>" accesskey="<?php echo find_accesskey(i18n_r('CLEAR_ALL_DATA'));?>" title="<?php i18n('CLEAR_ALL_DATA');?> <?php echo $log_name; ?>?" /><?php i18n('CLEAR_THIS_LOG');?></a>
|
|
||||||
<div class="clear"></div>
|
|
||||||
</div>
|
|
||||||
<?php if (!$log_data) echo '<p><em>'.i18n_r('LOG_FILE_EMPTY').'</em></p>'; ?>
|
|
||||||
<ol class="more" >
|
|
||||||
<?php
|
|
||||||
$count = 1;
|
|
||||||
|
|
||||||
if ($log_data) {
|
|
||||||
foreach ($log_data as $log) {
|
|
||||||
echo '<li><p style="font-size:11px;line-height:15px;" ><b style="line-height:20px;" >'.i18n_r('LOG_FILE_ENTRY').'</b><br />';
|
|
||||||
foreach($log->children() as $child) {
|
|
||||||
$name = $child->getName();
|
|
||||||
echo '<b>'. stripslashes(ucwords($name)) .'</b>: ';
|
|
||||||
|
|
||||||
$d = $log->$name;
|
|
||||||
$n = lowercase($child->getName());
|
|
||||||
$ip_regex = '/^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$/';
|
|
||||||
$url_regex = @"((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)";
|
|
||||||
|
|
||||||
|
|
||||||
//check if its an url address
|
|
||||||
if (do_reg($d, $url_regex)) {
|
|
||||||
$d = '<a href="'. $d .'" target="_blank" >'.$d.'</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
//check if its an ip address
|
|
||||||
if (do_reg($d, $ip_regex)) {
|
|
||||||
if ($d == $_SERVER['REMOTE_ADDR']) {
|
|
||||||
$d = i18n_r('THIS_COMPUTER').' (<a href="'. $whois_url . $d.'" target="_blank" >'.$d.'</a>)';
|
|
||||||
} else {
|
|
||||||
$d = '<a href="'. $whois_url . $d.'" target="_blank" >'.$d.'</a>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//check if its an email address
|
|
||||||
if (check_email_address($d)) {
|
|
||||||
$d = '<a href="mailto:'.$d.'">'.$d.'</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
//check if its a date
|
|
||||||
if ($n === 'date') {
|
|
||||||
$d = lngDate($d);
|
|
||||||
}
|
|
||||||
|
|
||||||
echo stripslashes($d);
|
|
||||||
echo ' <br />';
|
|
||||||
}
|
|
||||||
echo "</p></li>";
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="sidebar" >
|
|
||||||
<?php include('template/sidebar-support.php'); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php get_template('footer'); ?>
|
|
@ -1,25 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Logout
|
|
||||||
*
|
|
||||||
* Logs the user out of the GetSimple control panel
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Login
|
|
||||||
*/
|
|
||||||
|
|
||||||
# Setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
|
|
||||||
ob_start();
|
|
||||||
include('inc/common.php');
|
|
||||||
|
|
||||||
# end it all :'(
|
|
||||||
kill_cookie($cookie_name);
|
|
||||||
exec_action('logout');
|
|
||||||
|
|
||||||
# send back to login screen
|
|
||||||
redirect('index.php?logout');
|
|
||||||
ob_end_flush();
|
|
||||||
|
|
||||||
?>
|
|
@ -1,104 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Menu Manager
|
|
||||||
*
|
|
||||||
* Allows you to edit the current main menu hierarchy
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Page-Edit
|
|
||||||
*/
|
|
||||||
|
|
||||||
# Setup
|
|
||||||
$load['plugin'] = true;
|
|
||||||
include('inc/common.php');
|
|
||||||
login_cookie_check();
|
|
||||||
|
|
||||||
# save page priority order
|
|
||||||
if (isset($_POST['menuOrder'])) {
|
|
||||||
$menuOrder = explode(',',$_POST['menuOrder']);
|
|
||||||
$priority = 0;
|
|
||||||
foreach ($menuOrder as $slug) {
|
|
||||||
$file = GSDATAPAGESPATH . $slug . '.xml';
|
|
||||||
if (file_exists($file)) {
|
|
||||||
$data = getXML($file);
|
|
||||||
if ($priority != (int) $data->menuOrder) {
|
|
||||||
unset($data->menuOrder);
|
|
||||||
$data->addChild('menuOrder')->addCData($priority);
|
|
||||||
XMLsave($data,$file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$priority++;
|
|
||||||
}
|
|
||||||
create_pagesxml('true');
|
|
||||||
$success = i18n_r('MENU_MANAGER_SUCCESS');
|
|
||||||
}
|
|
||||||
|
|
||||||
# get pages
|
|
||||||
getPagesXmlValues();
|
|
||||||
$pagesSorted = subval_sort($pagesArray,'menuOrder');
|
|
||||||
|
|
||||||
get_template('header', cl($SITENAME).' » '.i18n_r('PAGE_MANAGEMENT').' » '.str_replace(array('<em>','</em>'), '', i18n_r('MENU_MANAGER')));
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php include('template/include-nav.php'); ?>
|
|
||||||
|
|
||||||
<div class="bodycontent clearfix">
|
|
||||||
|
|
||||||
<div id="maincontent">
|
|
||||||
<div class="main" >
|
|
||||||
<h3><?php echo str_replace(array('<em>','</em>'), '', i18n_r('MENU_MANAGER')); ?></h3>
|
|
||||||
<p><?php i18n('MENU_MANAGER_DESC'); ?></p>
|
|
||||||
<?php
|
|
||||||
if (count($pagesSorted) != 0) {
|
|
||||||
echo '<form method="post" action="menu-manager.php">';
|
|
||||||
echo '<ul id="menu-order" >';
|
|
||||||
foreach ($pagesSorted as $page) {
|
|
||||||
$sel = '';
|
|
||||||
if ($page['menuStatus'] != '') {
|
|
||||||
|
|
||||||
if ($page['menuOrder'] == '') {
|
|
||||||
$page['menuOrder'] = "N/A";
|
|
||||||
}
|
|
||||||
if ($page['menu'] == '') {
|
|
||||||
$page['menu'] = $page['title'];
|
|
||||||
}
|
|
||||||
echo '<li class="clearfix" rel="'.$page['slug'].'">
|
|
||||||
<strong>#'.$page['menuOrder'].'</strong>
|
|
||||||
'. $page['menu'] .' <em>'. $page['title'] .'</em>
|
|
||||||
</li>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo '</ul>';
|
|
||||||
echo '<input type="hidden" name="menuOrder" value=""><input class="submit" type="submit" value="'. i18n_r("SAVE_MENU_ORDER").'" />';
|
|
||||||
echo '</form>';
|
|
||||||
} else {
|
|
||||||
echo '<p>'.i18n_r('NO_MENU_PAGES').'.</p>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
$("#menu-order").sortable({
|
|
||||||
cursor: 'move',
|
|
||||||
placeholder: "placeholder-menu",
|
|
||||||
update: function() {
|
|
||||||
var order = '';
|
|
||||||
$('#menu-order li').each(function(index) {
|
|
||||||
var cat = $(this).attr('rel');
|
|
||||||
order = order+','+cat;
|
|
||||||
});
|
|
||||||
$('[name=menuOrder]').val(order);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$("#menu-order").disableSelection();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="sidebar" >
|
|
||||||
<?php include('template/sidebar-pages.php'); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php get_template('footer'); ?>
|
|
@ -1,74 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Menu Preview
|
|
||||||
*
|
|
||||||
* Previews the current main menu hierarchy
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Page-Edit
|
|
||||||
*/
|
|
||||||
|
|
||||||
# Setup
|
|
||||||
$load['plugin'] = true;
|
|
||||||
include('inc/common.php');
|
|
||||||
login_cookie_check();
|
|
||||||
|
|
||||||
# get pages
|
|
||||||
getPagesXmlValues();
|
|
||||||
$pagesSorted = subval_sort($pagesArray,'menuOrder');
|
|
||||||
|
|
||||||
global $LANG; $LANG_header = preg_replace('/(?:(?<=([a-z]{2}))).*/', '', $LANG);
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Share GetSimple</title>
|
|
||||||
<style>
|
|
||||||
.navigate {
|
|
||||||
padding:20px;
|
|
||||||
width:400px;
|
|
||||||
background:#f6f6f6;
|
|
||||||
}
|
|
||||||
table {border-collapse:collapse;font-family:arial;font-size:12px;margin:0;color:#333;width:100%;}
|
|
||||||
td, th {padding:5px 20px 5px 5px;text-shadow:1px 1px 0 #fff;}
|
|
||||||
tr th {text-align:left;font-size:11px;text-transform:uppercase;color:#666;border-bottom:1px dotted #ccc;}
|
|
||||||
h1 {font-size:18px;color:#111;margin:0 0 20px;font-family:georgia, garamond;font-weight:normal;text-shadow:1px 1px 0 #fff;}
|
|
||||||
p.edit {text-align:right;margin-top:15px;color:#666;}
|
|
||||||
p a:link, p a:visited {color:#CF3805;font-weight:bold;text-decoration:underline}
|
|
||||||
p a:focus, p a:hover {color:#333;font-weight:bold;text-decoration:underline}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="navigate">
|
|
||||||
<?php
|
|
||||||
if (count($pagesSorted) != 0) {
|
|
||||||
echo '<h1>'.i18n_r('CURRENT_MENU').'</h1>
|
|
||||||
<table>';
|
|
||||||
echo '<tr ><th>'.i18n_r('PRIORITY').'</th><th>'.i18n_r('MENU_TEXT').'</th><th>'.i18n_r('PAGE_TITLE').'</th></tr>';
|
|
||||||
foreach ($pagesSorted as $page) {
|
|
||||||
$sel = '';
|
|
||||||
if ($page['menuStatus'] != '') {
|
|
||||||
|
|
||||||
if ($page['menuOrder'] == '') {
|
|
||||||
$page['menuOrder'] = "N/A";
|
|
||||||
}
|
|
||||||
if ($page['menu'] == '') {
|
|
||||||
$page['menu'] = $page['title'];
|
|
||||||
}
|
|
||||||
echo '<tr>
|
|
||||||
<td><strong>#'.$page['menuOrder'].'</strong></td>
|
|
||||||
<td>'. $page['menu'] .'</td>
|
|
||||||
<td>'. $page['title'] .'</td>
|
|
||||||
</tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo '</table>';
|
|
||||||
} else {
|
|
||||||
echo '<p>'.i18n_r('NO_MENU_PAGES').'.</p>';
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
<p class="edit"><a href="menu-manager.php" target="_blank" ><?php echo str_replace(array('<em>','</em>'), '', i18n_r('MENU_MANAGER')); ?> »</a></p>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
123
admin/pages.php
@ -1,123 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* All Pages
|
|
||||||
*
|
|
||||||
* Displays all pages
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Page-Edit
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
|
|
||||||
// Include common.php
|
|
||||||
include('inc/common.php');
|
|
||||||
|
|
||||||
// Variable settings
|
|
||||||
login_cookie_check();
|
|
||||||
$id = isset($_GET['id']) ? $_GET['id'] : null;
|
|
||||||
$ptype = isset($_GET['type']) ? $_GET['type'] : null;
|
|
||||||
$path = GSDATAPAGESPATH;
|
|
||||||
$counter = '0';
|
|
||||||
$table = '';
|
|
||||||
|
|
||||||
# clone attempt happening
|
|
||||||
if ( isset($_GET['action']) && isset($_GET['id']) && $_GET['action'] == 'clone') {
|
|
||||||
|
|
||||||
// check for csrf
|
|
||||||
if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) {
|
|
||||||
$nonce = $_GET['nonce'];
|
|
||||||
if(!check_nonce($nonce, "clone", "pages.php")) {
|
|
||||||
die("CSRF detected!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# check to not overwrite
|
|
||||||
$count = 1;
|
|
||||||
$newfile = GSDATAPAGESPATH . $_GET['id'] ."-".$count.".xml";
|
|
||||||
if (file_exists($newfile)) {
|
|
||||||
while ( file_exists($newfile) ) {
|
|
||||||
$count++;
|
|
||||||
$newfile = GSDATAPAGESPATH . $_GET['id'] ."-".$count.".xml";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$newurl = $_GET['id'] .'-'. $count;
|
|
||||||
|
|
||||||
# do the copy
|
|
||||||
$status = copy($path.$_GET['id'].'.xml', $path.$newurl.'.xml');
|
|
||||||
if ($status) {
|
|
||||||
$newxml = getXML($path.$newurl.'.xml');
|
|
||||||
$newxml->url = $newurl;
|
|
||||||
$newxml->title = $newxml->title.' ['.i18n_r('COPY').']';
|
|
||||||
$newxml->pubDate = date('r');
|
|
||||||
$status = XMLsave($newxml, $path.$newurl.'.xml');
|
|
||||||
if ($status) {
|
|
||||||
create_pagesxml('true');
|
|
||||||
header('Location: pages.php?upd=clone-success&id='.$newurl);
|
|
||||||
} else {
|
|
||||||
$error = sprintf(i18n_r('CLONE_ERROR'), $_GET['id']);
|
|
||||||
header('Location: pages.php?error='.$error);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$error = sprintf(i18n_r('CLONE_ERROR'), $_GET['id']);
|
|
||||||
header('Location: pages.php?error='.$error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
getPagesXmlValues(true);
|
|
||||||
|
|
||||||
$count = 0;
|
|
||||||
foreach ($pagesArray as $page) {
|
|
||||||
if ($page['parent'] != '') {
|
|
||||||
$parentTitle = returnPageField($page['parent'], "title");
|
|
||||||
$sort = $parentTitle .' '. $page['title'];
|
|
||||||
$sort = $parentTitle .' '. $page['title'];
|
|
||||||
} else {
|
|
||||||
$sort = $page['title'];
|
|
||||||
}
|
|
||||||
$page = array_merge($page, array('sort' => $sort));
|
|
||||||
$pagesArray_tmp[$count] = $page;
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
// $pagesArray = $pagesArray_tmp;
|
|
||||||
$pagesSorted = subval_sort($pagesArray_tmp,'sort');
|
|
||||||
$table = get_pages_menu('','',0);
|
|
||||||
|
|
||||||
get_template('header', cl($SITENAME).' » '.i18n_r('PAGE_MANAGEMENT'));
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php include('template/include-nav.php'); ?>
|
|
||||||
|
|
||||||
<div class="bodycontent clearfix">
|
|
||||||
|
|
||||||
<div id="maincontent">
|
|
||||||
<?php exec_action('pages-main'); ?>
|
|
||||||
<div class="main">
|
|
||||||
<h3 class="floated"><?php i18n('PAGE_MANAGEMENT'); ?></h3>
|
|
||||||
<div class="edit-nav clearfix" >
|
|
||||||
<a href="#" id="filtertable" accesskey="<?php echo find_accesskey(i18n_r('FILTER'));?>" ><?php i18n('FILTER'); ?></a>
|
|
||||||
<a href="#" id="show-characters" accesskey="<?php echo find_accesskey(i18n_r('TOGGLE_STATUS'));?>" ><?php i18n('TOGGLE_STATUS'); ?></a>
|
|
||||||
</div>
|
|
||||||
<div id="filter-search">
|
|
||||||
<form><input type="text" autocomplete="off" class="text" id="q" placeholder="<?php echo strip_tags(lowercase(i18n_r('FILTER'))); ?>..." /> <a href="pages.php" class="cancel"><?php i18n('CANCEL'); ?></a></form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<table id="editpages" class="edittable highlight paginate">
|
|
||||||
<tr><th><?php i18n('PAGE_TITLE'); ?></th><th style="text-align:right;" ><?php i18n('DATE'); ?></th><th></th><th></th></tr>
|
|
||||||
<?php echo $table; ?>
|
|
||||||
</table>
|
|
||||||
<p><em><b><span id="pg_counter"><?php echo $count; ?></span></b> <?php i18n('TOTAL_PAGES'); ?></em></p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div><!-- end maincontent -->
|
|
||||||
|
|
||||||
|
|
||||||
<div id="sidebar" >
|
|
||||||
<?php include('template/sidebar-pages.php'); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php get_template('footer'); ?>
|
|
@ -1,124 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* All Plugins
|
|
||||||
*
|
|
||||||
* Displays all installed plugins
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Plugins
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
|
|
||||||
// Include common.php
|
|
||||||
include('inc/common.php');
|
|
||||||
|
|
||||||
$pluginid = isset($_GET['set']) ? $_GET['set'] : null;
|
|
||||||
$nonce = isset($_GET['nonce']) ? $_GET['nonce'] : null;
|
|
||||||
|
|
||||||
if ($pluginid){
|
|
||||||
if(check_nonce($nonce, "set", "plugins.php")) {
|
|
||||||
$plugin=antixss($pluginid);
|
|
||||||
change_plugin($plugin);
|
|
||||||
redirect('plugins.php');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Variable settings
|
|
||||||
login_cookie_check();
|
|
||||||
$counter = 0; $table = null;
|
|
||||||
|
|
||||||
$pluginfiles = getFiles(GSPLUGINPATH);
|
|
||||||
natcasesort($pluginfiles);
|
|
||||||
$needsupdate = false;
|
|
||||||
foreach ($pluginfiles as $fi) {
|
|
||||||
$pathExt = pathinfo($fi,PATHINFO_EXTENSION );
|
|
||||||
$pathName = pathinfo_filename($fi);
|
|
||||||
$setNonce='&nonce='.get_nonce("set","plugins.php");
|
|
||||||
|
|
||||||
if ($pathExt=="php") {
|
|
||||||
if ($live_plugins[$fi]=='true') {
|
|
||||||
$cls_Enabled = 'hidden';
|
|
||||||
$cls_Disabled = '';
|
|
||||||
$trclass='enabled';
|
|
||||||
} else {
|
|
||||||
$cls_Enabled = '';
|
|
||||||
$cls_Disabled = 'hidden';
|
|
||||||
$trclass='disabled';
|
|
||||||
}
|
|
||||||
$api_data = json_decode(get_api_details('plugin', $fi));
|
|
||||||
$updatelink = null;
|
|
||||||
if (is_object($api_data) && $api_data->status == 'successful') {
|
|
||||||
if ($api_data->version > $plugin_info[$pathName]['version']) {
|
|
||||||
$updatelink = '<br /><a class="updatelink" href="'.$api_data->path.'" target="_blank">'.i18n_r('UPDATE_AVAILABLE').' '.$api_data->version.'</a>';
|
|
||||||
$needsupdate = true;
|
|
||||||
}
|
|
||||||
$plugin_title = '<a href="'.$api_data->path.'" target="_blank">'.$api_data->name.'</a>';
|
|
||||||
} else {
|
|
||||||
$plugin_title = $plugin_info[$pathName]['name'];
|
|
||||||
}
|
|
||||||
$table .= '<tr id="tr-'.$counter.'" class="'.$trclass.'" >';
|
|
||||||
$table .= '<td style="width:150px" ><b>'.$plugin_title.'</b></td>';
|
|
||||||
$table .= '<td><span>'.$plugin_info[$pathName]['description'];
|
|
||||||
if ($plugin_info[$pathName]['version']!='disabled'){
|
|
||||||
$table .= '<br /><b>'.i18n_r('PLUGIN_VER') .' '. $plugin_info[$pathName]['version'].'</b> — '.i18n_r('AUTHOR').': <a href="'.$plugin_info[$pathName]['author_url'].'" target="_blank">'.$plugin_info[$pathName]['author'].'</a></span>';
|
|
||||||
}
|
|
||||||
$table.= $updatelink.'</td><td style="width:60px;" class="status" >
|
|
||||||
<a href="plugins.php?set='.$fi.$setNonce.'" class="toggleEnable '.$cls_Enabled.'" style="padding: 1px 3px;" title="'.i18n_r('ENABLE').': '.$plugin_info[$pathName]['name'] .'" >'.i18n_r('ENABLE').'</a>
|
|
||||||
<a href="plugins.php?set='.$fi.$setNonce.'" class="cancel toggleEnable '.$cls_Disabled.'" title="'.i18n_r('DISABLE').': '.$plugin_info[$pathName]['name'] .'" >'.i18n_r('DISABLE').'</a>
|
|
||||||
</td>';
|
|
||||||
$table .= "</tr>\n";
|
|
||||||
$counter++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# set trigger for plugin update notification
|
|
||||||
if ($needsupdate) {
|
|
||||||
touch(GSCACHEPATH.'plugin-update.trigger');
|
|
||||||
} else {
|
|
||||||
if (file_exists(GSCACHEPATH.'plugin-update.trigger')) {
|
|
||||||
unlink(GSCACHEPATH.'plugin-update.trigger');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exec_action('plugin-hook');
|
|
||||||
get_template('header', cl($SITENAME).' » '.i18n_r('PLUGINS_MANAGEMENT'));
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php include('template/include-nav.php'); ?>
|
|
||||||
|
|
||||||
<div class="bodycontent clearfix">
|
|
||||||
|
|
||||||
<div id="maincontent">
|
|
||||||
<div class="main" >
|
|
||||||
<h3><?php i18n('PLUGINS_MANAGEMENT'); ?></h3>
|
|
||||||
|
|
||||||
<?php if ($counter > 0) { ?>
|
|
||||||
<table class="edittable">
|
|
||||||
<tr><th><?php i18n('PLUGIN_NAME'); ?></th><th><?php i18n('PLUGIN_DESC'); ?></th><th><?php i18n('STATUS'); ?></th></tr>
|
|
||||||
<?php echo $table; ?>
|
|
||||||
</table>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
|
|
||||||
<p><em><b><span id="pg_counter"><?php echo $counter; ?></span></b> <?php i18n('PLUGINS_INSTALLED'); ?>
|
|
||||||
<?php
|
|
||||||
if ($counter == 0) {
|
|
||||||
echo ' - <a href="http://get-simple.info/extend/" target="_blank" >'. str_replace(array('<em>','</em>'), '', i18n_r('GET_PLUGINS_LINK')) .'</a>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</em></p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="sidebar" >
|
|
||||||
<?php include('template/sidebar-plugins.php'); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php get_template('footer'); ?>
|
|
@ -1,110 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Reset Password
|
|
||||||
*
|
|
||||||
* Resets the password for GetSimple control panel access
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Login
|
|
||||||
*/
|
|
||||||
|
|
||||||
# setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
include('inc/common.php');
|
|
||||||
|
|
||||||
if(isset($_POST['submitted'])){
|
|
||||||
|
|
||||||
// check for csrf
|
|
||||||
if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) {
|
|
||||||
$nonce = $_POST['nonce'];
|
|
||||||
if(!check_nonce($nonce, "reset_password")) {
|
|
||||||
die("CSRF detected!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$randSleep = rand(250000,2000000); // random sleep for .25 to 2 seconds
|
|
||||||
|
|
||||||
if(isset($_POST['username']) and !empty($_POST['username'])) {
|
|
||||||
|
|
||||||
# user filename
|
|
||||||
$file = _id($_POST['username']).'.xml';
|
|
||||||
|
|
||||||
# get user information from existing XML file
|
|
||||||
|
|
||||||
if (filepath_is_safe(GSUSERSPATH . $file,GSUSERSPATH)) {
|
|
||||||
$data = simplexml_load_file(GSUSERSPATH . $file);
|
|
||||||
$USR = strtolower($data->USR);
|
|
||||||
$EMAIL = $data->EMAIL;
|
|
||||||
|
|
||||||
if(strtolower($_POST['username']) == $USR) {
|
|
||||||
# create new random password
|
|
||||||
$random = createRandomPassword();
|
|
||||||
// $random = '1234';
|
|
||||||
|
|
||||||
# create backup
|
|
||||||
createBak($file, GSUSERSPATH, GSBACKUSERSPATH);
|
|
||||||
|
|
||||||
# create password change trigger file
|
|
||||||
$flagfile = GSUSERSPATH . _id($USR).".xml.reset";
|
|
||||||
copy(GSUSERSPATH . $file, $flagfile);
|
|
||||||
|
|
||||||
# change password and resave xml file
|
|
||||||
$data->PWD = passhash($random);
|
|
||||||
$status = XMLsave($data, GSUSERSPATH . $file);
|
|
||||||
|
|
||||||
# send the email with the new password
|
|
||||||
$subject = $site_full_name .' '. i18n_r('RESET_PASSWORD') .' '. i18n_r('ATTEMPT');
|
|
||||||
$message = "<p>". cl($SITENAME) ." ". i18n_r('RESET_PASSWORD') ." ". i18n_r('ATTEMPT').'</p>';
|
|
||||||
$message .= "<p>". i18n_r('LABEL_USERNAME').": <strong>". $USR."</strong>";
|
|
||||||
$message .= "<br>". i18n_r('NEW_PASSWORD').": <strong>". $random."</strong>";
|
|
||||||
$message .= '<br>'. i18n_r('EMAIL_LOGIN') .': <a href="'.$SITEURL . $GSADMIN.'/">'.$SITEURL . $GSADMIN.'/</a></p>';
|
|
||||||
exec_action('resetpw-success');
|
|
||||||
$status = sendmail($EMAIL,$subject,$message);
|
|
||||||
# show the result of the reset attempt
|
|
||||||
usleep($randSleep);
|
|
||||||
$status = 'success';
|
|
||||||
redirect("resetpassword.php?upd=pwd-".$status);
|
|
||||||
} else{
|
|
||||||
# username doesnt match listed xml username
|
|
||||||
exec_action('resetpw-error');
|
|
||||||
usleep($randSleep);
|
|
||||||
redirect("resetpassword.php?upd=pwd-success");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
# no user exists for this username, but do not show this to the submitter
|
|
||||||
usleep($randSleep);
|
|
||||||
redirect("resetpassword.php?upd=pwd-success");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
# no username was submitted
|
|
||||||
redirect("resetpassword.php?upd=pwd-error");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
get_template('header', cl($SITENAME).' » '.i18n_r('RESET_PASSWORD'));
|
|
||||||
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="wrapper clearfix">
|
|
||||||
|
|
||||||
<?php include('template/error_checking.php'); ?>
|
|
||||||
|
|
||||||
<div id="maincontent">
|
|
||||||
<div class="main" >
|
|
||||||
|
|
||||||
<h3><?php i18n('RESET_PASSWORD'); ?></h3>
|
|
||||||
<p class="desc"><?php i18n('MSG_PLEASE_EMAIL'); ?></p>
|
|
||||||
|
|
||||||
<form class="login" action="<?php myself(); ?>" method="post" >
|
|
||||||
<input name="nonce" id="nonce" type="hidden" value="<?php echo get_nonce("reset_password");?>"/>
|
|
||||||
<p><b><?php i18n('LABEL_USERNAME'); ?>:</b><br /><input class="text" name="username" type="text" value="" /></p>
|
|
||||||
<p><input class="submit" type="submit" name="submitted" value="<?php echo i18n('SEND_NEW_PWD'); ?>" /></p>
|
|
||||||
</form>
|
|
||||||
<p class="cta" ><b>«</b> <a href="<?php echo $SITEURL; ?>"><?php i18n('BACK_TO_WEBSITE'); ?></a> | <a href="index.php"><?php i18n('CONTROL_PANEL'); ?></a> »</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php get_template('footer'); ?>
|
|
@ -1,297 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Settings
|
|
||||||
*
|
|
||||||
* Displays and changes website settings
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Settings
|
|
||||||
*/
|
|
||||||
|
|
||||||
# setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
include('inc/common.php');
|
|
||||||
|
|
||||||
# variable settings
|
|
||||||
login_cookie_check();
|
|
||||||
$fullpath = suggest_site_path();
|
|
||||||
$file = _id($USR) .'.xml';
|
|
||||||
$wfile = 'website.xml';
|
|
||||||
$data = getXML(GSUSERSPATH . $file);
|
|
||||||
$USR = stripslashes($data->USR);
|
|
||||||
$PASSWD = $data->PWD;
|
|
||||||
$EMAIL = $data->EMAIL;
|
|
||||||
$NAME = $data->NAME;
|
|
||||||
|
|
||||||
$lang_array = getFiles(GSLANGPATH);
|
|
||||||
|
|
||||||
# initialize these all as null
|
|
||||||
$pwd1 = $error = $success = $pwd2 = $editorchck = $prettychck = null;
|
|
||||||
|
|
||||||
# if the flush cache command was invoked
|
|
||||||
if (isset($_GET['flushcache'])) {
|
|
||||||
delete_cache();
|
|
||||||
$update = 'flushcache-success';
|
|
||||||
}
|
|
||||||
|
|
||||||
# if the undo command was invoked
|
|
||||||
if (isset($_GET['undo'])) {
|
|
||||||
|
|
||||||
# first check for csrf
|
|
||||||
if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) {
|
|
||||||
$nonce = $_GET['nonce'];
|
|
||||||
if(!check_nonce($nonce, "undo")) {
|
|
||||||
die("CSRF detected!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# perform undo
|
|
||||||
undo($file, GSUSERSPATH, GSBACKUSERSPATH);
|
|
||||||
undo($wfile, GSDATAOTHERPATH, GSBACKUPSPATH.'other/');
|
|
||||||
generate_sitemap();
|
|
||||||
|
|
||||||
# redirect back to yourself to show the new restored data
|
|
||||||
redirect('settings.php?restored=true');
|
|
||||||
}
|
|
||||||
|
|
||||||
# was this page restored?
|
|
||||||
if (isset($_GET['restored'])) {
|
|
||||||
$restored = 'true';
|
|
||||||
} else {
|
|
||||||
$restored = 'false';
|
|
||||||
}
|
|
||||||
|
|
||||||
# was the form submitted?
|
|
||||||
if(isset($_POST['submitted'])) {
|
|
||||||
|
|
||||||
# first check for csrf
|
|
||||||
if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) {
|
|
||||||
$nonce = $_POST['nonce'];
|
|
||||||
if(!check_nonce($nonce, "save_settings")) {
|
|
||||||
die("CSRF detected!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# website-specific fields
|
|
||||||
if(isset($_POST['sitename'])) {
|
|
||||||
$SITENAME = htmlentities($_POST['sitename'], ENT_QUOTES, 'UTF-8');
|
|
||||||
}
|
|
||||||
if(isset($_POST['siteurl'])) {
|
|
||||||
$SITEURL = tsl($_POST['siteurl']);
|
|
||||||
}
|
|
||||||
if(isset($_POST['permalink'])) {
|
|
||||||
$PERMALINK = var_out(trim($_POST['permalink']));
|
|
||||||
}
|
|
||||||
if(isset($_POST['template'])) {
|
|
||||||
$TEMPLATE = $_POST['template'];
|
|
||||||
}
|
|
||||||
if(isset($_POST['prettyurls'])) {
|
|
||||||
$PRETTYURLS = $_POST['prettyurls'];
|
|
||||||
} else {
|
|
||||||
$PRETTYURLS = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
# user-specific fields
|
|
||||||
if(isset($_POST['user'])) {
|
|
||||||
$USR = strtolower($_POST['user']);
|
|
||||||
}
|
|
||||||
if(isset($_POST['name'])) {
|
|
||||||
$NAME = var_out($_POST['name']);
|
|
||||||
}
|
|
||||||
if(isset($_POST['email'])) {
|
|
||||||
$EMAIL = var_out($_POST['email'],'email');
|
|
||||||
}
|
|
||||||
if(isset($_POST['timezone'])) {
|
|
||||||
$TIMEZONE = var_out($_POST['timezone']);
|
|
||||||
}
|
|
||||||
if(isset($_POST['lang'])) {
|
|
||||||
$LANG = var_out($_POST['lang']);
|
|
||||||
}
|
|
||||||
if(isset($_POST['show_htmleditor'])) {
|
|
||||||
$HTMLEDITOR = var_out($_POST['show_htmleditor']);
|
|
||||||
} else {
|
|
||||||
$HTMLEDITOR = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# check to see if passwords are changing
|
|
||||||
if(isset($_POST['sitepwd'])) { $pwd1 = $_POST['sitepwd']; }
|
|
||||||
if(isset($_POST['sitepwd_confirm'])) { $pwd2 = $_POST['sitepwd_confirm']; }
|
|
||||||
if ($pwd1 != $pwd2) {
|
|
||||||
#passwords do not match
|
|
||||||
$error = i18n_r('PASSWORD_NO_MATCH');
|
|
||||||
} else {
|
|
||||||
# password cannot be null
|
|
||||||
if ( $pwd1 != '' ) {
|
|
||||||
$PASSWD = passhash($pwd1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// check valid lang files
|
|
||||||
if(!in_array($LANG.'.php', $lang_array) and !in_array($LANG.'.PHP', $lang_array)) die();
|
|
||||||
|
|
||||||
# create user xml file
|
|
||||||
createBak($file, GSUSERSPATH, GSBACKUSERSPATH);
|
|
||||||
if (file_exists(GSUSERSPATH . _id($USR).'.xml.reset')) { unlink(GSUSERSPATH . _id($USR).'.xml.reset'); }
|
|
||||||
$xml = new SimpleXMLElement('<item></item>');
|
|
||||||
$xml->addChild('USR', $USR);
|
|
||||||
$xml->addChild('NAME', $NAME);
|
|
||||||
$xml->addChild('PWD', $PASSWD);
|
|
||||||
$xml->addChild('EMAIL', $EMAIL);
|
|
||||||
$xml->addChild('HTMLEDITOR', $HTMLEDITOR);
|
|
||||||
$xml->addChild('TIMEZONE', $TIMEZONE);
|
|
||||||
$xml->addChild('LANG', $LANG);
|
|
||||||
|
|
||||||
exec_action('settings-user');
|
|
||||||
|
|
||||||
if (! XMLsave($xml, GSUSERSPATH . $file) ) {
|
|
||||||
$error = i18n_r('CHMOD_ERROR');
|
|
||||||
}
|
|
||||||
|
|
||||||
# create website xml file
|
|
||||||
createBak($wfile, GSDATAOTHERPATH, GSBACKUPSPATH.'other/');
|
|
||||||
$xmls = new SimpleXMLExtended('<item></item>');
|
|
||||||
$note = $xmls->addChild('SITENAME');
|
|
||||||
$note->addCData($SITENAME);
|
|
||||||
$note = $xmls->addChild('SITEURL');
|
|
||||||
$note->addCData($SITEURL);
|
|
||||||
$note = $xmls->addChild('TEMPLATE');
|
|
||||||
$note->addCData($TEMPLATE);
|
|
||||||
$xmls->addChild('PRETTYURLS', $PRETTYURLS);
|
|
||||||
$xmls->addChild('PERMALINK', $PERMALINK);
|
|
||||||
|
|
||||||
exec_action('settings-website');
|
|
||||||
|
|
||||||
if (! XMLsave($xmls, GSDATAOTHERPATH . $wfile) ) {
|
|
||||||
$error = i18n_r('CHMOD_ERROR');
|
|
||||||
}
|
|
||||||
|
|
||||||
# see new language file immediately
|
|
||||||
include(GSLANGPATH.$LANG.'.php');
|
|
||||||
|
|
||||||
if (!$error) {
|
|
||||||
$success = i18n_r('ER_SETTINGS_UPD').'. <a href="settings.php?undo&nonce='.get_nonce("undo").'">'.i18n_r('UNDO').'</a>';
|
|
||||||
generate_sitemap();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# are any of the control panel checkboxes checked?
|
|
||||||
if ($HTMLEDITOR != '' ) { $editorchck = 'checked'; }
|
|
||||||
if ($PRETTYURLS != '' ) { $prettychck = 'checked'; }
|
|
||||||
|
|
||||||
# get all available language files
|
|
||||||
if ($LANG == ''){ $LANG = 'en_US'; }
|
|
||||||
|
|
||||||
if (count($lang_array) != 0) {
|
|
||||||
sort($lang_array);
|
|
||||||
$sel = ''; $langs = '';
|
|
||||||
foreach ($lang_array as $lfile){
|
|
||||||
$lfile = basename($lfile,".php");
|
|
||||||
if ($LANG == $lfile) { $sel="selected"; }
|
|
||||||
$langs .= '<option '.$sel.' value="'.$lfile.'" >'.$lfile.'</option>';
|
|
||||||
$sel = '';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$langs = '<option value="" selected="selected" >-- '.i18n_r('NONE').' --</option>';
|
|
||||||
}
|
|
||||||
|
|
||||||
get_template('header', cl($SITENAME).' » '.i18n_r('GENERAL_SETTINGS'));
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php include('template/include-nav.php'); ?>
|
|
||||||
|
|
||||||
<div class="bodycontent clearfix">
|
|
||||||
|
|
||||||
<div id="maincontent">
|
|
||||||
<form class="largeform" action="<?php myself(); ?>" method="post" accept-charset="utf-8" >
|
|
||||||
<input id="nonce" name="nonce" type="hidden" value="<?php echo get_nonce("save_settings"); ?>" />
|
|
||||||
|
|
||||||
<div class="main">
|
|
||||||
<h3><?php i18n('WEBSITE_SETTINGS');?></h3>
|
|
||||||
|
|
||||||
<div class="leftsec">
|
|
||||||
<p><label for="sitename" ><?php i18n('LABEL_WEBSITE');?>:</label><input class="text" id="sitename" name="sitename" type="text" value="<?php if(isset($SITENAME1)) { echo stripslashes($SITENAME1); } else { echo stripslashes($SITENAME); } ?>" /></p>
|
|
||||||
</div>
|
|
||||||
<div class="rightsec">
|
|
||||||
<p><label for="siteurl" ><?php i18n('LABEL_BASEURL');?>:</label><input class="text" id="siteurl" name="siteurl" type="url" value="<?php if(isset($SITEURL1)) { echo $SITEURL1; } else { echo $SITEURL; } ?>" /></p>
|
|
||||||
<?php if ( $fullpath != $SITEURL ) { echo '<p style="margin:-15px 0 20px 0;color:#D94136;font-size:11px;" >'.i18n_r('LABEL_SUGGESTION').': <code>'.$fullpath.'</code></p>'; } ?>
|
|
||||||
</div>
|
|
||||||
<div class="clear"></div>
|
|
||||||
|
|
||||||
<p class="inline" ><input name="prettyurls" id="prettyurls" type="checkbox" value="1" <?php echo $prettychck; ?> /> <label for="prettyurls" ><?php i18n('USE_FANCY_URLS');?></label></p>
|
|
||||||
|
|
||||||
<div class="leftsec">
|
|
||||||
<p><label for="permalink" class="clearfix"><?php i18n('PERMALINK');?>: <span class="right"><a href="http://get-simple.info/docs/pretty_urls" target="_blank" ><?php i18n('MORE');?></a></span></label><input class="text" name="permalink" id="permalink" type="text" placeholder="%parent%/%slug%/" value="<?php if(isset($PERMALINK)) { echo $PERMALINK; } ?>" /></p>
|
|
||||||
<a id="flushcache" class="button" href="?flushcache"><?php i18n('FLUSHCACHE'); ?></a>
|
|
||||||
</div>
|
|
||||||
<div class="clear"></div>
|
|
||||||
|
|
||||||
|
|
||||||
<?php exec_action('settings-website-extras'); ?>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="profile" class="section" >
|
|
||||||
<h3><?php i18n('SIDE_USER_PROFILE');?></h3>
|
|
||||||
<div class="leftsec">
|
|
||||||
<p><label for="user" ><?php i18n('LABEL_USERNAME');?>:</label><input class="text" id="user" name="user" type="text" readonly value="<?php if(isset($USR1)) { echo $USR1; } else { echo $USR; } ?>" /></p>
|
|
||||||
</div>
|
|
||||||
<div class="rightsec">
|
|
||||||
<p><label for="email" ><?php i18n('LABEL_EMAIL');?>:</label><input class="text" id="email" name="email" type="email" value="<?php if(isset($EMAIL1)) { echo $EMAIL1; } else { echo $EMAIL; } ?>" /></p>
|
|
||||||
<?php if (! check_email_address($EMAIL)) {
|
|
||||||
echo '<p style="margin:-15px 0 20px 0;color:#D94136;font-size:11px;" >'.i18n_r('WARN_EMAILINVALID').'</p>';
|
|
||||||
}?>
|
|
||||||
</div>
|
|
||||||
<div class="clear"></div>
|
|
||||||
<div class="leftsec">
|
|
||||||
<p><label for="name" ><?php i18n('LABEL_DISPNAME');?>:</label>
|
|
||||||
<span style="margin:0px 0 5px 0;font-size:12px;color:#999;" ><?php i18n('DISPLAY_NAME');?></span>
|
|
||||||
<input class="text" id="name" name="name" type="text" value="<?php if(isset($NAME1)) { echo $NAME1; } else { echo $NAME; } ?>" /></p>
|
|
||||||
</div>
|
|
||||||
<div class="clear"></div>
|
|
||||||
<div class="leftsec">
|
|
||||||
<p><label for="timezone" ><?php i18n('LOCAL_TIMEZONE');?>:</label>
|
|
||||||
<?php if( (isset($_POST['timezone'])) ) { $TIMEZONE = $_POST['timezone']; } ?>
|
|
||||||
<select class="text" id="timezone" name="timezone">
|
|
||||||
<?php if ($TIMEZONE == '') { echo '<option value="" selected="selected" >-- '.i18n_r('NONE').' --</option>'; } else { echo '<option selected="selected" value="'. $TIMEZONE .'">'. $TIMEZONE .'</option>'; } ?>
|
|
||||||
<?php include('inc/timezone_options.txt'); ?>
|
|
||||||
</select>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="rightsec">
|
|
||||||
<p><label for="lang" ><?php i18n('LANGUAGE');?>: <span class="right"><a href="http://get-simple.info/docs/languages" target="_blank" ><?php i18n('MORE');?></a></span></label>
|
|
||||||
<select name="lang" id="lang" class="text">
|
|
||||||
<?php echo $langs; ?>
|
|
||||||
</select>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="clear"></div>
|
|
||||||
<p class="inline" ><input name="show_htmleditor" id="show_htmleditor" type="checkbox" value="1" <?php echo $editorchck; ?> /> <label for="show_htmleditor" ><?php i18n('ENABLE_HTML_ED');?></label></p>
|
|
||||||
|
|
||||||
<?php exec_action('settings-user-extras'); ?>
|
|
||||||
|
|
||||||
<p style="margin:0px 0 5px 0;font-size:12px;color:#999;" ><?php i18n('ONLY_NEW_PASSWORD');?>:</p>
|
|
||||||
<div class="leftsec">
|
|
||||||
<p><label for="sitepwd" ><?php i18n('NEW_PASSWORD');?>:</label><input autocomplete="off" class="text" id="sitepwd" name="sitepwd" type="password" value="" /></p>
|
|
||||||
</div>
|
|
||||||
<div class="rightsec">
|
|
||||||
<p><label for="sitepwd_confirm" ><?php i18n('CONFIRM_PASSWORD');?>:</label><input autocomplete="off" class="text" id="sitepwd_confirm" name="sitepwd_confirm" type="password" value="" /></p>
|
|
||||||
</div>
|
|
||||||
<div class="clear"></div>
|
|
||||||
|
|
||||||
<p id="submit_line" >
|
|
||||||
<span><input class="submit" type="submit" name="submitted" value="<?php i18n('BTN_SAVESETTINGS');?>" /></span> <?php i18n('OR'); ?> <a class="cancel" href="settings.php?cancel"><?php i18n('CANCEL'); ?></a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</div><!-- /section -->
|
|
||||||
</div><!-- /main -->
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="sidebar" >
|
|
||||||
<?php include('template/sidebar-settings.php'); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php get_template('footer'); ?>
|
|
@ -1,53 +0,0 @@
|
|||||||
<?php
|
|
||||||
if(isset($_GET['term'])) {
|
|
||||||
$term = ( function_exists( "filter_var") ) ? filter_var ( $_GET['term'], FILTER_SANITIZE_SPECIAL_CHARS) : htmlentities($_GET['term']);
|
|
||||||
}
|
|
||||||
if ($term = '{SHARE}') {
|
|
||||||
$term = 'Share';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Share GetSimple</title>
|
|
||||||
<style>
|
|
||||||
.share {
|
|
||||||
margin:0;
|
|
||||||
width:345px;
|
|
||||||
background:#f6f6f6;
|
|
||||||
}
|
|
||||||
.share .inner {padding:20px 20px 10px 20px;}
|
|
||||||
.share h1 {font-size:18px;color:#111;margin:0 0 20px;font-family:georgia, garamond;font-weight:normal;text-shadow:1px 1px 0 #fff;}
|
|
||||||
.share p {font-size:11px;line-height:20px;color:#999;margin-top:10px;margin-bottom:20px;}
|
|
||||||
.share a:link, a:visited {text-decoration:underline;color:#CF3805;font-weight:bold;font-size:12px;}
|
|
||||||
.share a:focus, a:hover {text-decoration:underline;color:#222;font-weight:bold;font-size:12px;}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="share">
|
|
||||||
<div class="inner">
|
|
||||||
<h1><?php echo $term; ?> GetSimple CMS:</h1>
|
|
||||||
<div style="float:left;width:100px;height:65px;" >
|
|
||||||
<iframe src="//www.facebook.com/plugins/like.php?app_id=171087202956642&href=http%3A%2F%2Fwww.facebook.com%2FGetSimpleCMS&send=false&layout=box_count&width=100&show_faces=false&action=recommend&colorscheme=light&font&height=90" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:90px;" allowTransparency="true"></iframe>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div style="float:left;width:65px;" >
|
|
||||||
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
|
|
||||||
<g:plusone size="tall" href="http://get-simple.info/" ></g:plusone>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div style="float:left;width:68px;" >
|
|
||||||
<a href="//twitter.com/share" class="twitter-share-button" data-url="http://get-simple.info/" data-text="Check out GetSimple CMS!" data-count="vertical" data-via="get_simple" data-related="buydealsin:Daily Deals">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div style="float:left;width:55px;" >
|
|
||||||
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
|
|
||||||
<script type="IN/Share" data-url="get-simple.info" data-counter="top"></script>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div style="clear:both"></div>
|
|
||||||
<p><a href="//www.facebook.com/GetSimpleCMS" target="_blank" >Find us on Facebook</a> | <a href="http://twitter.com/get_simple" target="_blank" >Follow us on Twitter</a></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,54 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* View Sitemap
|
|
||||||
*
|
|
||||||
* Displays your site's sitemap
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Theme
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
include('inc/common.php');
|
|
||||||
login_cookie_check();
|
|
||||||
|
|
||||||
$sitemap = generate_sitemap();
|
|
||||||
if ($sitemap !== true) {
|
|
||||||
$error = $sitemap;
|
|
||||||
} else {
|
|
||||||
if (isset($_GET['refresh'])) {
|
|
||||||
$success = i18n_r('SITEMAP_REFRESHED');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
get_template('header', cl($SITENAME).' » '.strip_tags(i18n_r('SIDE_VIEW_SITEMAP')));
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php include('template/include-nav.php'); ?>
|
|
||||||
|
|
||||||
<div class="bodycontent clearfix">
|
|
||||||
<div id="maincontent">
|
|
||||||
<div class="main" >
|
|
||||||
<h3 class="floated"><?php echo i18n('SIDE_VIEW_SITEMAP'); ?></h3>
|
|
||||||
<div class="edit-nav clearfix" >
|
|
||||||
<a href="../sitemap.xml" target="_blank" accesskey="<?php echo find_accesskey(i18n_r('VIEW'));?>" ><?php i18n('VIEW'); ?></a>
|
|
||||||
<a href="sitemap.php?refresh" accesskey="<?php echo find_accesskey(i18n_r('REFRESH'));?>" ><?php i18n('REFRESH'); ?></a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="unformatted"><code><?php
|
|
||||||
if (file_exists('../sitemap.xml')) {
|
|
||||||
echo htmlentities(formatXmlString(file_get_contents('../sitemap.xml')));
|
|
||||||
}
|
|
||||||
?></code></div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="sidebar" >
|
|
||||||
<?php include('template/sidebar-theme.php'); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php get_template('footer'); ?>
|
|
@ -1,61 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Support
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
* @subpackage Support
|
|
||||||
*/
|
|
||||||
|
|
||||||
# Setup inclusions
|
|
||||||
$load['plugin'] = true;
|
|
||||||
include('inc/common.php');
|
|
||||||
login_cookie_check();
|
|
||||||
|
|
||||||
get_template('header', cl($SITENAME).' » '.i18n_r('SUPPORT') );
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php include('template/include-nav.php'); ?>
|
|
||||||
|
|
||||||
<div class="bodycontent clearfix">
|
|
||||||
|
|
||||||
<div id="maincontent">
|
|
||||||
<div class="main">
|
|
||||||
|
|
||||||
<h3><?php i18n('GETTING_STARTED');?></h3>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li><a href="http://get-simple.info/docs/" target="_blank" ><?php i18n('SIDE_DOCUMENTATION'); ?></a></li>
|
|
||||||
<li><a href="http://get-simple.info/forum/" target="_blank" ><?php i18n('SUPPORT_FORUM'); ?></a></li>
|
|
||||||
<li><a href="http://get-simple.info/extend/" target="_blank" ><?php echo str_replace(array('<em>','</em>'), '', i18n_r('GET_PLUGINS_LINK')); ?></a></li>
|
|
||||||
<li><a href="share.php?term=<?php i18n('SHARE'); ?>" rel="facybox" ><?php i18n('SHARE'); ?> GetSimple</a></li>
|
|
||||||
<li><a href="https://github.com/GetSimpleCMS" target="_blank">Github SVN</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p><?php i18n('WELCOME_MSG'); ?> <?php i18n('WELCOME_P'); ?></p>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li><a href="health-check.php"><?php i18n('WEB_HEALTH_CHECK'); ?></a></li>
|
|
||||||
<li><a href="edit.php"><?php i18n('CREATE_NEW_PAGE'); ?></a></li>
|
|
||||||
<li><a href="upload.php"><?php i18n('UPLOADIFY_BUTTON'); ?></a></li>
|
|
||||||
<li><a href="settings.php"><?php i18n('GENERAL_SETTINGS'); ?></a></li>
|
|
||||||
<li><a href="theme.php"><?php i18n('CHOOSE_THEME'); ?></a></li>
|
|
||||||
<?php exec_action('welcome-link'); ?>
|
|
||||||
<?php exec_action('welcome-doc-link'); ?>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h3><?php i18n('SUPPORT');?></h3>
|
|
||||||
<ul>
|
|
||||||
<li><p><a href="log.php?log=failedlogins.log"><?php i18n('VIEW_FAILED_LOGIN');?></a></p></li>
|
|
||||||
<?php exec_action('support-extras'); ?>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="sidebar" >
|
|
||||||
<?php include('template/sidebar-support.php'); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php get_template('footer'); ?>
|
|
@ -1,43 +0,0 @@
|
|||||||
/** CSS **/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* CSS wide
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
.wrapper{
|
|
||||||
/* main wrapper */
|
|
||||||
width:99%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrapper .nav{
|
|
||||||
/* top header nav wrapper */
|
|
||||||
width:99%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrapper .nav li:first-child {
|
|
||||||
/* breathing space for tabs */
|
|
||||||
margin-left: 35px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrapper table {
|
|
||||||
/* tables in wrapper, eg page management lists */
|
|
||||||
width:99%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#maincontent{
|
|
||||||
/* wrapper for admin inputs */
|
|
||||||
width:80%;
|
|
||||||
}
|
|
||||||
|
|
||||||
textarea, form input.title{
|
|
||||||
/* resize backend textareas */
|
|
||||||
/* outline backend administrative input fields for emphasis */
|
|
||||||
width:99% ;
|
|
||||||
}
|
|
||||||
|
|
||||||
form.manyinputs textarea{
|
|
||||||
/* resize backend textareas for components */
|
|
||||||
width:100% ;
|
|
||||||
}
|
|
@ -1,100 +0,0 @@
|
|||||||
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
|
|
||||||
/**
|
|
||||||
* Error Checking
|
|
||||||
*
|
|
||||||
* Displays error and success messages
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
*
|
|
||||||
* Modified by Jorge H. [ http://www.jorgehoya.es ] on 07/09/2011
|
|
||||||
*
|
|
||||||
* Modified by Shawn_a 8/01/2012
|
|
||||||
* You can pass $update(global) directly if not using a redirrect and querystring
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ( file_exists(GSUSERSPATH._id($USR).".xml.reset") && get_filename_id()!='index' && get_filename_id()!='resetpassword' ) {
|
|
||||||
echo '<div class="error"><p>'.i18n_r('ER_PWD_CHANGE').'</p></div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((!defined('GSNOAPACHECHECK') || GSNOAPACHECHECK == false) and !server_is_apache()) {
|
|
||||||
echo '<div class="error">'.i18n_r('WARNING').': <a href="health-check.php">'.i18n_r('SERVER_SETUP').' non-Apache</a></div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!isset($update)) $update = '';
|
|
||||||
$err = '';
|
|
||||||
$restored = '';
|
|
||||||
if(isset($_GET['upd'])) $update = ( function_exists( "filter_var") ) ? filter_var ( $_GET['upd'], FILTER_SANITIZE_SPECIAL_CHARS) : htmlentities($_GET['upd']);
|
|
||||||
if(isset($_GET['success'])) $success = ( function_exists( "filter_var") ) ? filter_var ( $_GET['success'], FILTER_SANITIZE_SPECIAL_CHARS) : htmlentities($_GET['success']);
|
|
||||||
if(isset($_GET['error'])) $error = ( function_exists( "filter_var") ) ? filter_var ( $_GET['error'], FILTER_SANITIZE_SPECIAL_CHARS) : htmlentities($_GET['error']);
|
|
||||||
if(isset($_GET['err'])) $err = ( function_exists( "filter_var") ) ? filter_var ( $_GET['err'], FILTER_SANITIZE_SPECIAL_CHARS) : htmlentities($_GET['err']);
|
|
||||||
if(isset($_GET['id'])) $errid = ( function_exists( "filter_var") ) ? filter_var ( $_GET['id'], FILTER_SANITIZE_SPECIAL_CHARS) : htmlentities($_GET['id']);
|
|
||||||
if(isset($_GET['updated']) && $_GET['updated'] ==1) $success = i18n_r('SITE_UPDATED');
|
|
||||||
|
|
||||||
switch ( $update ) {
|
|
||||||
case 'bak-success':
|
|
||||||
echo '<div class="updated"><p>'. sprintf(i18n_r('ER_BAKUP_DELETED'), $errid) .'</p></div>';
|
|
||||||
break;
|
|
||||||
case 'bak-err':
|
|
||||||
echo '<div class="error"><p><b>'.i18n_r('ERROR').':</b> '.i18n_r('ER_REQ_PROC_FAIL').'</p></div>';
|
|
||||||
break;
|
|
||||||
case 'edit-success':
|
|
||||||
echo '<div class="updated"><p>';
|
|
||||||
if ($ptype == 'edit') {
|
|
||||||
echo sprintf(i18n_r('ER_YOUR_CHANGES'), $id) .'. <a href="backup-edit.php?p=restore&id='. $id .'&nonce='.get_nonce("restore", "backup-edit.php").'">'.i18n_r('UNDO').'</a>';
|
|
||||||
} elseif ($ptype == 'restore') {
|
|
||||||
echo sprintf(i18n_r('ER_HASBEEN_REST'), $id);
|
|
||||||
} elseif ($ptype == 'delete') {
|
|
||||||
echo sprintf(i18n_r('ER_HASBEEN_DEL'), $errid) .'. <a href="backup-edit.php?p=restore&id='. $errid .'&nonce='.get_nonce("restore", "backup-edit.php").'">'.i18n_r('UNDO').'</a>';
|
|
||||||
}
|
|
||||||
echo '</p></div>';
|
|
||||||
break;
|
|
||||||
case 'clone-success':
|
|
||||||
echo '<div class="updated"><p>'.sprintf(i18n_r('CLONE_SUCCESS'), '<a href="edit.php?id='.$errid.'">'.$errid.'</a>').'.</p></div>';
|
|
||||||
break;
|
|
||||||
case 'edit-index':
|
|
||||||
echo '<div class="error"><p><b>'.i18n_r('ERROR').':</b> '.i18n_r('ER_CANNOT_INDEX').'.</p></div>';
|
|
||||||
break;
|
|
||||||
case 'edit-error':
|
|
||||||
echo '<div class="error"><p><b>'.i18n_r('ERROR').':</b> '. var_out($ptype) .'.</p></div>';
|
|
||||||
break;
|
|
||||||
case 'pwd-success':
|
|
||||||
echo '<div class="updated"><p>'.i18n_r('ER_NEW_PWD_SENT').'. <a href="index.php">'.i18n_r('LOGIN').'</a></p></div>';
|
|
||||||
break;
|
|
||||||
case 'pwd-error':
|
|
||||||
echo '<div class="error"><p><b>'.i18n_r('ERROR').':</b> '.i18n_r('ER_SENDMAIL_ERR').'.</p></div>';
|
|
||||||
break;
|
|
||||||
case 'del-success':
|
|
||||||
echo '<div class="updated"><p>'.i18n_r('ER_FILE_DEL_SUC').': <b>'.$errid.'</b></p></div>';
|
|
||||||
break;
|
|
||||||
case 'flushcache-success':
|
|
||||||
echo '<div class="updated"><p>'.i18n_r('FLUSHCACHE-SUCCESS').'</p></div>';
|
|
||||||
break;
|
|
||||||
case 'del-error':
|
|
||||||
echo '<div class="error"><p><b>'.i18n_r('ERROR').':</b> '.i18n_r('ER_PROBLEM_DEL').'.</p></div>';
|
|
||||||
break;
|
|
||||||
case 'comp-success':
|
|
||||||
echo '<div class="updated"><p>'.i18n_r('ER_COMPONENT_SAVE').'. <a href="components.php?undo&nonce='.get_nonce("undo").'">'.i18n_r('UNDO').'</a></p></div>';
|
|
||||||
break;
|
|
||||||
case 'comp-restored':
|
|
||||||
echo '<div class="updated"><p>'.i18n_r('ER_COMPONENT_REST').'. <a href="components.php?undo&nonce='.get_nonce("undo").'">'.i18n_r('UNDO').'</a></p></div>';
|
|
||||||
break;
|
|
||||||
|
|
||||||
/**/
|
|
||||||
default:
|
|
||||||
if ( isset( $error ) ) echo '<div class="error"><p><b>'.i18n_r('ERROR').':</b> '. $error .'</div>';
|
|
||||||
else if ($restored == 'true') echo '<div class="updated"><p>'.i18n_r('ER_OLD_RESTORED').'. <a href="settings.php?undo&nonce='.get_nonce("undo").'">'.i18n_r('UNDO').'</a></p></div>';
|
|
||||||
else if ( isset($_GET['rest']) && $_GET['rest']=='true' )
|
|
||||||
echo '<div class="updated"><p>'.i18n_r('ER_OLD_RESTORED').'. <a href="support.php?undo&nonce='.get_nonce("undo", "support.php").'">'.i18n_r('UNDO').'</a></p></div>';
|
|
||||||
elseif (isset($_GET['cancel'])) echo '<div class="error"><p>'.i18n_r('ER_CANCELLED_FAIL').'</p></div>';
|
|
||||||
elseif (isset($error)) echo '<div class="error"><p>'.$error.'</div>';
|
|
||||||
elseif (!empty($err)) echo '<div class="error"><p><b>'.i18n_r('ERROR').':</b> '.$err.'</p></div>';
|
|
||||||
elseif (isset($success)) echo '<div class="updated"><p>'.$success.'</p></div>';
|
|
||||||
elseif ( $restored == 'true')
|
|
||||||
echo '<div class="updated"><p>'.i18n_r('ER_OLD_RESTORED').'. <a href="settings.php?undo&nonce='.get_nonce("undo").'">'.i18n_r('UNDO').'</a></p></div>';
|
|
||||||
break;
|
|
||||||
/**/
|
|
||||||
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Footer Admin Template
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
*/
|
|
||||||
|
|
||||||
?>
|
|
||||||
<div id="footer">
|
|
||||||
<div class="footer-left" >
|
|
||||||
<?php
|
|
||||||
include(GSADMININCPATH ."configuration.php");
|
|
||||||
if (cookie_check()) {
|
|
||||||
echo '<p><a href="pages.php">'.i18n_r('PAGE_MANAGEMENT').'</a> • <a href="upload.php">'.i18n_r('FILE_MANAGEMENT').'</a> • <a href="theme.php">'.i18n_r('THEME_MANAGEMENT').'</a> • <a href="backups.php">'.i18n_r('BAK_MANAGEMENT').'</a> • <a href="plugins.php">'.i18n_r('PLUGINS_MANAGEMENT').'</a> • <a href="settings.php">'.i18n_r('GENERAL_SETTINGS').'</a> • <a href="support.php">'.i18n_r('SUPPORT').'</a> • <a href="share.php?term='.i18n_r('SHARE').'" rel="facybox_s" >'.i18n_r('SHARE').'</a></p>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!isAuthPage()){ ?>
|
|
||||||
<p>© 2009-<?php echo date('Y'); ?> <a href="http://get-simple.info/" target="_blank" >GetSimple CMS</a>
|
|
||||||
<?php echo '– '. i18n_r('VERSION') .' '. $site_version_no; ?>
|
|
||||||
</p>
|
|
||||||
</div> <!-- end .footer-left -->
|
|
||||||
<div class="gslogo" >
|
|
||||||
<a href="http://get-simple.info/" target="_blank" ><img src="template/images/getsimple_logo.gif" alt="GetSimple Content Management System" /></a>
|
|
||||||
</div>
|
|
||||||
<div class="clear"></div>
|
|
||||||
<?php
|
|
||||||
get_scripts_backend(TRUE);
|
|
||||||
exec_action('footer');
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
</div><!-- end #footer -->
|
|
||||||
<?php
|
|
||||||
if(!isAuthPage()) {
|
|
||||||
if (isDebug()){
|
|
||||||
global $GS_debug;
|
|
||||||
echo '<h2>'.i18n_r('DEBUG_CONSOLE').'</h2><div id="gsdebug">';
|
|
||||||
echo '<pre>';
|
|
||||||
foreach ($GS_debug as $log){
|
|
||||||
if(is_array($log)) print_r($log).'<br/>';
|
|
||||||
else print($log.'<br/>');
|
|
||||||
}
|
|
||||||
echo '</pre>';
|
|
||||||
echo '</div>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</div><!-- end .wrapper -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,92 +0,0 @@
|
|||||||
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
|
|
||||||
/**
|
|
||||||
* Header Admin Template
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
*/
|
|
||||||
|
|
||||||
global $SITENAME, $SITEURL;
|
|
||||||
|
|
||||||
$GSSTYLE = getDef('GSSTYLE') ? GSSTYLE : '';
|
|
||||||
|
|
||||||
$bodyclass="class=\"";
|
|
||||||
if( in_array('sbfixed',explode(',',$GSSTYLE)) ) $bodyclass .= " sbfixed";
|
|
||||||
if( in_array('wide',explode(',',$GSSTYLE)) ) $bodyclass .= " wide";
|
|
||||||
$bodyclass .="\"";
|
|
||||||
|
|
||||||
if(get_filename_id()!='index') exec_action('admin-pre-header');
|
|
||||||
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="<?php echo get_site_lang(true); ?>">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
||||||
<title><?php echo $title ?></title>
|
|
||||||
<?php if(!isAuthPage()) { ?> <meta name="generator" content="GetSimple - <?php echo GSVERSION; ?>" />
|
|
||||||
<link rel="shortcut icon" href="favicon.png" type="image/x-icon" />
|
|
||||||
<link rel="author" href="humans.txt" />
|
|
||||||
<link rel="apple-touch-icon" href="apple-touch-icon.png"/>
|
|
||||||
<?php } ?>
|
|
||||||
<meta name="robots" content="noindex, nofollow">
|
|
||||||
<link rel="stylesheet" type="text/css" href="template/style.php?<?php echo 's='.$GSSTYLE.'&v='.GSVERSION; ?>" media="screen" />
|
|
||||||
<!--[if IE 6]><link rel="stylesheet" type="text/css" href="template/ie6.css?v=<?php echo GSVERSION; ?>" media="screen" /><![endif]-->
|
|
||||||
<?php get_scripts_backend(); ?>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="template/js/jquery-scrolltofixed.js?v=<?php echo GSVERSION; ?>"></script>
|
|
||||||
<script type="text/javascript" src="template/js/jquery.getsimple.js?v=<?php echo GSVERSION; ?>"></script>
|
|
||||||
|
|
||||||
<!--[if lt IE 9]><script type="text/javascript" src="//html5shiv.googlecode.com/svn/trunk/html5.js" ></script><![endif]-->
|
|
||||||
<?php if( ((get_filename_id()=='upload') || (get_filename_id()=='image')) && (!defined('GSNOUPLOADIFY')) ) { ?>
|
|
||||||
<script type="text/javascript" src="template/js/uploadify/jquery.uploadify.js?v=3.0"></script>
|
|
||||||
<?php } ?>
|
|
||||||
<?php if(get_filename_id()=='image') { ?>
|
|
||||||
<script type="text/javascript" src="template/js/jcrop/jquery.Jcrop.min.js"></script>
|
|
||||||
<link rel="stylesheet" type="text/css" href="template/js/jcrop/jquery.Jcrop.css" media="screen" />
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
# Plugin hook to allow insertion of stuff into the header
|
|
||||||
if(!isAuthPage()) exec_action('header');
|
|
||||||
|
|
||||||
function doVerCheck(){
|
|
||||||
return !isAuthPage() && !getDef('GSNOVERCHECK');
|
|
||||||
}
|
|
||||||
|
|
||||||
if( doVerCheck() ) { ?>
|
|
||||||
<script type="text/javascript">
|
|
||||||
// check to see if core update is needed
|
|
||||||
jQuery(document).ready(function() {
|
|
||||||
<?php
|
|
||||||
$data = get_api_details();
|
|
||||||
if ($data) {
|
|
||||||
$apikey = json_decode($data);
|
|
||||||
|
|
||||||
if(isset($apikey->status)) {
|
|
||||||
$verstatus = $apikey->status;
|
|
||||||
?>
|
|
||||||
var verstatus = <?php echo $verstatus; ?>;
|
|
||||||
if(verstatus != 1) {
|
|
||||||
<?php if(isBeta()){ ?> $('a.support').parent('li').append('<span class="info">i</span>');
|
|
||||||
<?php } else { ?> $('a.support').parent('li').append('<span class="warning">!</span>'); <?php } ?>
|
|
||||||
$('a.support').attr('href', 'health-check.php');
|
|
||||||
}
|
|
||||||
<?php }} ?>
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
// init gs namespace and i18n
|
|
||||||
var GS = {};
|
|
||||||
GS.i18n = new Array();
|
|
||||||
GS.i18n['PLUGIN_UPDATED'] = '<?php i18n("PLUGIN_UPDATED"); ?>';
|
|
||||||
GS.i18n['ERROR'] = '<?php i18n("ERROR"); ?>';
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body <?php filename_id(); echo ' '.$bodyclass; ?> >
|
|
||||||
<div class="header" id="header" >
|
|
||||||
<div class="wrapper clearfix">
|
|
||||||
<?php exec_action('header-body'); ?>
|
|
@ -1,29 +0,0 @@
|
|||||||
/* IE6 CSS Document for GetSimple CMS */
|
|
||||||
#sidebar .snav li.upload {
|
|
||||||
padding:5px 15px 5px 15px !important;
|
|
||||||
margin-left:0 !important;
|
|
||||||
}
|
|
||||||
#sidebar .snav li a {
|
|
||||||
margin-bottom:-15px;
|
|
||||||
padding:5px 15px 5px 15px !important;
|
|
||||||
margin-left:0 !important;
|
|
||||||
}
|
|
||||||
#sidebar .snav li a:link, #sidebar .snav li a:visited {
|
|
||||||
background-image: none !important!;
|
|
||||||
padding:5px 15px 5px 15px !important;
|
|
||||||
margin-left:0 !important;
|
|
||||||
}
|
|
||||||
#sidebar .snav li a.current {
|
|
||||||
color:#FFF !important;
|
|
||||||
background-image: none !important!
|
|
||||||
padding:5px 15px 5px 15px !important;
|
|
||||||
margin-left:0 !important;
|
|
||||||
}
|
|
||||||
#sidebar .snav li a:hover {
|
|
||||||
background-image: none !important!;
|
|
||||||
padding:5px 15px 5px 15px !important;
|
|
||||||
margin-left:0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* still a problem with the page options toggle */
|
|
Before Width: | Height: | Size: 406 B |
Before Width: | Height: | Size: 576 B |
Before Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 256 B |
Before Width: | Height: | Size: 576 B |
Before Width: | Height: | Size: 394 B |
Before Width: | Height: | Size: 213 B |
Before Width: | Height: | Size: 264 B |
Before Width: | Height: | Size: 202 B |
Before Width: | Height: | Size: 217 B |
Before Width: | Height: | Size: 359 B |
Before Width: | Height: | Size: 255 B |
Before Width: | Height: | Size: 224 B |
@ -1,47 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Navigation Include Template
|
|
||||||
*
|
|
||||||
* @package GetSimple
|
|
||||||
*/
|
|
||||||
|
|
||||||
$debugInfoUrl = 'http://get-simple.info/docs/debugging';
|
|
||||||
|
|
||||||
if (cookie_check()) {
|
|
||||||
echo '<ul id="pill"><li class="leftnav"><a href="logout.php" accesskey="'. find_accesskey(i18n_r('TAB_LOGOUT')).'" >'.i18n_r('TAB_LOGOUT').'</a></li>';
|
|
||||||
if (isDebug()) {
|
|
||||||
echo '<li class="debug"><a href="'.$debugInfoUrl.'" target="_blank">'.i18n_r('DEBUG_MODE').'</a></li>';
|
|
||||||
}
|
|
||||||
echo '<li class="rightnav" ><a href="settings.php#profile">'.i18n_r('WELCOME').' <strong>'.$USR.'</strong>!</a></li></ul>';
|
|
||||||
}
|
|
||||||
|
|
||||||
//determine page type if plugin is being shown
|
|
||||||
if (get_filename_id() == 'load') {
|
|
||||||
$plugin_class = $plugin_info[$plugin_id]['page_type'];
|
|
||||||
} else {
|
|
||||||
$plugin_class = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
<h1><a href="<?php echo $SITEURL; ?>" target="_blank" ><?php echo cl($SITENAME); ?></a></h1>
|
|
||||||
<ul class="nav <?php echo $plugin_class; ?>">
|
|
||||||
<li id="nav_pages" ><a class="pages" href="pages.php" accesskey="<?php echo find_accesskey(i18n_r('TAB_PAGES'));?>" ><?php i18n('TAB_PAGES');?></a></li>
|
|
||||||
<li id="nav_upload" ><a class="files" href="upload.php" accesskey="<?php echo find_accesskey(i18n_r('TAB_FILES'));?>" ><?php i18n('TAB_FILES');?></a></li>
|
|
||||||
<li id="nav_theme" ><a class="theme" href="theme.php" accesskey="<?php echo find_accesskey(i18n_r('TAB_THEME'));?>" ><?php i18n('TAB_THEME');?></a></li>
|
|
||||||
<li id="nav_backups" ><a class="backups" href="backups.php" accesskey="<?php echo find_accesskey(i18n_r('TAB_BACKUPS'));?>" ><?php i18n('TAB_BACKUPS');?></a></li>
|
|
||||||
<li id="nav_plugins" ><a class="plugins" href="plugins.php" accesskey="<?php echo find_accesskey(i18n_r('PLUGINS_NAV'));?>" ><?php i18n('PLUGINS_NAV');?></a></li>
|
|
||||||
|
|
||||||
<?php exec_action('nav-tab'); ?>
|
|
||||||
|
|
||||||
<li id="nav_loaderimg" ><img class="toggle" id="loader" src="template/images/ajax.gif" alt="" /></li>
|
|
||||||
<li class="rightnav" ><a class="settings first" href="settings.php" accesskey="<?php echo find_accesskey(i18n_r('TAB_SETTINGS'));?>" ><?php i18n('TAB_SETTINGS');?></a></li>
|
|
||||||
<li class="rightnav" ><a class="support last" href="support.php" accesskey="<?php echo find_accesskey(i18n_r('TAB_SUPPORT'));?>" ><?php i18n('TAB_SUPPORT');?></a></li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wrapper">
|
|
||||||
|
|
||||||
<?php include('template/error_checking.php'); ?>
|
|
@ -1,24 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
|
|
||||||
# For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# On some specific Linux installations you could face problems with Firefox.
|
|
||||||
# It could give you errors when loading the editor saying that some illegal
|
|
||||||
# characters were found (three strange chars in the beginning of the file).
|
|
||||||
# This could happen if you map the .js or .css files to PHP, for example.
|
|
||||||
#
|
|
||||||
# Those characters are the Byte Order Mask (BOM) of the Unicode encoded files.
|
|
||||||
# All FCKeditor files are Unicode encoded.
|
|
||||||
#
|
|
||||||
|
|
||||||
AddType application/x-javascript .js
|
|
||||||
AddType text/css .css
|
|
||||||
|
|
||||||
#
|
|
||||||
# If PHP is mapped to handle XML files, you could have some issues. The
|
|
||||||
# following will disable it.
|
|
||||||
#
|
|
||||||
|
|
||||||
AddType text/xml .xml
|
|
153
admin/template/js/ckeditor/ckeditor.js
vendored
@ -1,153 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
|
||||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function(){if(window.CKEDITOR&&window.CKEDITOR.dom)return;if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'D03G5XL',version:'3.6.6',revision:'7689',rnd:Math.floor(Math.random()*900)+100,_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break;}}}if(d.indexOf(':/')==-1)if(d.indexOf('/')===0)d=location.href.match(/^.*?:\/\/[^\/]*/)[0]+d;else d=location.href.match(/^[^\?]*\/(?:)/)[0]+d;if(!d)throw 'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';return d;})(),getUrl:function(d){if(d.indexOf(':/')==-1&&d.indexOf('/')!==0)d=this.basePath+d;if(this.timestamp&&d.charAt(d.length-1)!='/'&&!/[&?]t=/.test(d))d+=(d.indexOf('?')>=0?'&':'?')+'t='+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})();var a=CKEDITOR;if(!a.event){a.event=function(){};a.event.implementOn=function(b){var c=a.event.prototype;for(var d in c){if(b[d]==undefined)b[d]=c[d];}};a.event.prototype=(function(){var b=function(d){var e=d.getPrivate&&d.getPrivate()||d._||(d._={});return e.events||(e.events={});},c=function(d){this.name=d;this.listeners=[];};c.prototype={getListenerIndex:function(d){for(var e=0,f=this.listeners;e<f.length;e++){if(f[e].fn==d)return e;}return-1;}};return{on:function(d,e,f,g,h){var i=b(this),j=i[d]||(i[d]=new c(d));if(j.getListenerIndex(e)<0){var k=j.listeners;if(!f)f=this;if(isNaN(h))h=10;var l=this,m=function(o,p,q,r){var s={name:d,sender:this,editor:o,data:p,listenerData:g,stop:q,cancel:r,removeListener:function(){l.removeListener(d,e);}};e.call(f,s);return s.data;};m.fn=e;m.priority=h;for(var n=k.length-1;n>=0;n--){if(k[n].priority<=h){k.splice(n+1,0,m);return;}}k.unshift(m);}},fire:(function(){var d=false,e=function(){d=true;},f=false,g=function(){f=true;};return function(h,i,j){var k=b(this)[h],l=d,m=f;d=f=false;if(k){var n=k.listeners;if(n.length){n=n.slice(0);for(var o=0;o<n.length;o++){var p=n[o].call(this,j,i,e,g);if(typeof p!='undefined')i=p;if(d||f)break;}}}var q=f||(typeof i=='undefined'?false:i);d=l;f=m;return q;};})(),fireOnce:function(d,e,f){var g=this.fire(d,e,f);delete b(this)[d];return g;},removeListener:function(d,e){var f=b(this)[d];if(f){var g=f.getListenerIndex(e);
|
|
||||||
if(g>=0)f.listeners.splice(g,1);}},hasListeners:function(d){var e=b(this)[d];return e&&e.listeners.length>0;}};})();}if(!a.editor){a.ELEMENT_MODE_NONE=0;a.ELEMENT_MODE_REPLACE=1;a.ELEMENT_MODE_APPENDTO=2;a.editor=function(b,c,d,e){var f=this;f._={instanceConfig:b,element:c,data:e};f.elementMode=d||0;a.event.call(f);f._init();};a.editor.replace=function(b,c){var d=b;if(typeof d!='object'){d=document.getElementById(b);if(d&&d.tagName.toLowerCase() in {style:1,script:1,base:1,link:1,meta:1,title:1})d=null;if(!d){var e=0,f=document.getElementsByName(b);while((d=f[e++])&&d.tagName.toLowerCase()!='textarea'){}}if(!d)throw '[CKEDITOR.editor.replace] The element with id or name "'+b+'" was not found.';}d.style.visibility='hidden';return new a.editor(c,d,1);};a.editor.appendTo=function(b,c,d){var e=b;if(typeof e!='object'){e=document.getElementById(b);if(!e)throw '[CKEDITOR.editor.appendTo] The element with id "'+b+'" was not found.';}return new a.editor(c,e,2,d);};a.editor.prototype={_init:function(){var b=a.editor._pending||(a.editor._pending=[]);b.push(this);},fire:function(b,c){return a.event.prototype.fire.call(this,b,c,this);},fireOnce:function(b,c){return a.event.prototype.fireOnce.call(this,b,c,this);}};a.event.implementOn(a.editor.prototype,true);}if(!a.env)a.env=(function(){var b=navigator.userAgent.toLowerCase(),c=window.opera,d={ie:/*@cc_on!@*/false,opera:!!c&&c.version,webkit:b.indexOf(' applewebkit/')>-1,air:b.indexOf(' adobeair/')>-1,mac:b.indexOf('macintosh')>-1,quirks:document.compatMode=='BackCompat',mobile:b.indexOf('mobile')>-1,iOS:/(ipad|iphone|ipod)/.test(b),isCustomDomain:function(){if(!this.ie)return false;var g=document.domain,h=window.location.hostname;return g!=h&&g!='['+h+']';},secure:location.protocol=='https:'};d.gecko=navigator.product=='Gecko'&&!d.webkit&&!d.opera;var e=0;if(d.ie){e=parseFloat(b.match(/msie (\d+)/)[1]);d.ie8=!!document.documentMode;d.ie8Compat=document.documentMode==8;d.ie9Compat=document.documentMode==9;d.ie7Compat=e==7&&!document.documentMode||document.documentMode==7;d.ie6Compat=e<7||d.quirks;}if(d.gecko){var f=b.match(/rv:([\d\.]+)/);if(f){f=f[1].split('.');e=f[0]*10000+(f[1]||0)*100+ +(f[2]||0);}}if(d.opera)e=parseFloat(c.version());if(d.air)e=parseFloat(b.match(/ adobeair\/(\d+)/)[1]);if(d.webkit)e=parseFloat(b.match(/ applewebkit\/(\d+)/)[1]);d.version=e;d.isCompatible=d.iOS&&e>=534||!d.mobile&&(d.ie&&e>=6||d.gecko&&e>=10801||d.opera&&e>=9.5||d.air&&e>=1||d.webkit&&e>=522||false);d.cssClass='cke_browser_'+(d.ie?'ie':d.gecko?'gecko':d.opera?'opera':d.webkit?'webkit':'unknown');
|
|
||||||
if(d.quirks)d.cssClass+=' cke_browser_quirks';if(d.ie){d.cssClass+=' cke_browser_ie'+(d.version<7?'6':d.version>=8?document.documentMode:'7');if(d.quirks)d.cssClass+=' cke_browser_iequirks';if(document.documentMode&&document.documentMode>=9)d.cssClass+=' cke_browser_ie9plus';}if(d.gecko&&e<10900)d.cssClass+=' cke_browser_gecko18';if(d.air)d.cssClass+=' cke_browser_air';return d;})();var b=a.env;var c=b.ie;if(a.status=='unloaded')(function(){a.event.implementOn(a);a.loadFullCore=function(){if(a.status!='basic_ready'){a.loadFullCore._load=1;return;}delete a.loadFullCore;var e=document.createElement('script');e.type='text/javascript';e.src=a.basePath+'ckeditor.js';document.getElementsByTagName('head')[0].appendChild(e);};a.loadFullCoreTimeout=0;a.replaceClass='ckeditor';a.replaceByClassEnabled=1;var d=function(e,f,g,h){if(b.isCompatible){if(a.loadFullCore)a.loadFullCore();var i=g(e,f,h);a.add(i);return i;}return null;};a.replace=function(e,f){return d(e,f,a.editor.replace);};a.appendTo=function(e,f,g){return d(e,f,a.editor.appendTo,g);};a.add=function(e){var f=this._.pending||(this._.pending=[]);f.push(e);};a.replaceAll=function(){var e=document.getElementsByTagName('textarea');for(var f=0;f<e.length;f++){var g=null,h=e[f];if(!h.name&&!h.id)continue;if(typeof arguments[0]=='string'){var i=new RegExp('(?:^|\\s)'+arguments[0]+'(?:$|\\s)');if(!i.test(h.className))continue;}else if(typeof arguments[0]=='function'){g={};if(arguments[0](h,g)===false)continue;}this.replace(h,g);}};(function(){var e=function(){var f=a.loadFullCore,g=a.loadFullCoreTimeout;if(a.replaceByClassEnabled)a.replaceAll(a.replaceClass);a.status='basic_ready';if(f&&f._load)f();else if(g)setTimeout(function(){if(a.loadFullCore)a.loadFullCore();},g*1000);};if(window.addEventListener)window.addEventListener('load',e,false);else if(window.attachEvent)window.attachEvent('onload',e);})();a.status='basic_loaded';})();a.dom={};var d=a.dom;(function(){var e=[];a.on('reset',function(){e=[];});a.tools={arrayCompare:function(f,g){if(!f&&!g)return true;if(!f||!g||f.length!=g.length)return false;for(var h=0;h<f.length;h++){if(f[h]!=g[h])return false;}return true;},clone:function(f){var g;if(f&&f instanceof Array){g=[];for(var h=0;h<f.length;h++)g[h]=this.clone(f[h]);return g;}if(f===null||typeof f!='object'||f instanceof String||f instanceof Number||f instanceof Boolean||f instanceof Date||f instanceof RegExp)return f;g=new f.constructor();for(var i in f){var j=f[i];g[i]=this.clone(j);}return g;},capitalize:function(f){return f.charAt(0).toUpperCase()+f.substring(1).toLowerCase();
|
|
||||||
},extend:function(f){var g=arguments.length,h,i;if(typeof (h=arguments[g-1])=='boolean')g--;else if(typeof (h=arguments[g-2])=='boolean'){i=arguments[g-1];g-=2;}for(var j=1;j<g;j++){var k=arguments[j];for(var l in k){if(h===true||f[l]==undefined)if(!i||l in i)f[l]=k[l];}}return f;},prototypedCopy:function(f){var g=function(){};g.prototype=f;return new g();},isArray:function(f){return!!f&&f instanceof Array;},isEmpty:function(f){for(var g in f){if(f.hasOwnProperty(g))return false;}return true;},cssStyleToDomStyle:(function(){var f=document.createElement('div').style,g=typeof f.cssFloat!='undefined'?'cssFloat':typeof f.styleFloat!='undefined'?'styleFloat':'float';return function(h){if(h=='float')return g;else return h.replace(/-./g,function(i){return i.substr(1).toUpperCase();});};})(),buildStyleHtml:function(f){f=[].concat(f);var g,h=[];for(var i=0;i<f.length;i++){g=f[i];if(/@import|[{}]/.test(g))h.push('<style>'+g+'</style>');else h.push('<link type="text/css" rel=stylesheet href="'+g+'">');}return h.join('');},htmlEncode:function(f){var g=function(k){var l=new d.element('span');l.setText(k);return l.getHtml();},h=g('\n').toLowerCase()=='<br>'?function(k){return g(k).replace(/<br>/gi,'\n');}:g,i=g('>')=='>'?function(k){return h(k).replace(/>/g,'>');}:h,j=g(' ')==' '?function(k){return i(k).replace(/ /g,' ');}:i;this.htmlEncode=j;return this.htmlEncode(f);},htmlEncodeAttr:function(f){return f.replace(/"/g,'"').replace(/</g,'<').replace(/>/g,'>');},getNextNumber:(function(){var f=0;return function(){return++f;};})(),getNextId:function(){return 'cke_'+this.getNextNumber();},override:function(f,g){return g(f);},setTimeout:function(f,g,h,i,j){if(!j)j=window;if(!h)h=j;return j.setTimeout(function(){if(i)f.apply(h,[].concat(i));else f.apply(h);},g||0);},trim:(function(){var f=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(g){return g.replace(f,'');};})(),ltrim:(function(){var f=/^[ \t\n\r]+/g;return function(g){return g.replace(f,'');};})(),rtrim:(function(){var f=/[ \t\n\r]+$/g;return function(g){return g.replace(f,'');};})(),indexOf:Array.prototype.indexOf?function(f,g){return f.indexOf(g);}:function(f,g){for(var h=0,i=f.length;h<i;h++){if(f[h]===g)return h;}return-1;},bind:function(f,g){return function(){return f.apply(g,arguments);};},createClass:function(f){var g=f.$,h=f.base,i=f.privates||f._,j=f.proto,k=f.statics;if(i){var l=g;g=function(){var p=this;var m=p._||(p._={});for(var n in i){var o=i[n];m[n]=typeof o=='function'?a.tools.bind(o,p):o;
|
|
||||||
}l.apply(p,arguments);};}if(h){g.prototype=this.prototypedCopy(h.prototype);g.prototype['constructor']=g;g.prototype.base=function(){this.base=h.prototype.base;h.apply(this,arguments);this.base=arguments.callee;};}if(j)this.extend(g.prototype,j,true);if(k)this.extend(g,k,true);return g;},addFunction:function(f,g){return e.push(function(){return f.apply(g||this,arguments);})-1;},removeFunction:function(f){e[f]=null;},callFunction:function(f){var g=e[f];return g&&g.apply(window,Array.prototype.slice.call(arguments,1));},cssLength:(function(){return function(f){return f+(!f||isNaN(Number(f))?'':'px');};})(),convertToPx:(function(){var f;return function(g){if(!f){f=d.element.createFromHtml('<div style="position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"></div>',a.document);a.document.getBody().append(f);}if(!/%$/.test(g)){f.setStyle('width',g);return f.$.clientWidth;}return g;};})(),repeat:function(f,g){return new Array(g+1).join(f);},tryThese:function(){var f;for(var g=0,h=arguments.length;g<h;g++){var i=arguments[g];try{f=i();break;}catch(j){}}return f;},genKey:function(){return Array.prototype.slice.call(arguments).join('-');},normalizeCssText:function(f,g){var h=[],i,j=a.tools.parseCssText(f,true,g);for(i in j)h.push(i+':'+j[i]);h.sort();return h.length?h.join(';')+';':'';},convertRgbToHex:function(f){return f.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi,function(g,h,i,j){var k=[h,i,j];for(var l=0;l<3;l++)k[l]=('0'+parseInt(k[l],10).toString(16)).slice(-2);return '#'+k.join('');});},parseCssText:function(f,g,h){var i={};if(h){var j=new d.element('span');j.setAttribute('style',f);f=a.tools.convertRgbToHex(j.getAttribute('style')||'');}if(!f||f==';')return i;f.replace(/"/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(k,l,m){if(g){l=l.toLowerCase();if(l=='font-family')m=m.toLowerCase().replace(/["']/g,'').replace(/\s*,\s*/g,',');m=a.tools.trim(m);}i[l]=m;});return i;}};})();var e=a.tools;a.dtd=(function(){var f=e.extend,g={isindex:1,fieldset:1},h={input:1,button:1,select:1,textarea:1,label:1},i=f({a:1},h),j=f({iframe:1},i),k={hr:1,ul:1,menu:1,div:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,mark:1,time:1,meter:1,command:1,keygen:1,output:1,progress:1,audio:1,video:1,details:1,datagrid:1,datalist:1,blockquote:1,noscript:1,table:1,center:1,address:1,dir:1,pre:1,h5:1,dl:1,h4:1,noframes:1,h6:1,ol:1,h1:1,h3:1,h2:1},l={ins:1,del:1,script:1,style:1},m=f({b:1,acronym:1,bdo:1,'var':1,'#':1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,dfn:1,span:1,wbr:1},l),n=f({sub:1,img:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1,mark:1},m),o=f({p:1},n),p=f({iframe:1},n,h),q={img:1,noscript:1,br:1,kbd:1,center:1,button:1,basefont:1,h5:1,h4:1,samp:1,h6:1,ol:1,h1:1,h3:1,h2:1,form:1,font:1,'#':1,select:1,menu:1,ins:1,abbr:1,label:1,code:1,table:1,script:1,cite:1,input:1,iframe:1,strong:1,textarea:1,noframes:1,big:1,small:1,span:1,hr:1,sub:1,bdo:1,'var':1,div:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,mark:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,audio:1,video:1,details:1,datagrid:1,datalist:1,object:1,sup:1,strike:1,dir:1,map:1,dl:1,applet:1,del:1,isindex:1,fieldset:1,ul:1,b:1,acronym:1,a:1,blockquote:1,i:1,u:1,s:1,tt:1,address:1,q:1,pre:1,p:1,em:1,dfn:1},r=f({a:1},p),s={tr:1},t={'#':1},u=f({param:1},q),v=f({form:1},g,j,k,o),w={li:1},x={style:1,script:1},y={base:1,link:1,meta:1,title:1},z=f(y,x),A={head:1,body:1},B={html:1},C={address:1,blockquote:1,center:1,dir:1,div:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,audio:1,video:1,details:1,datagrid:1,datalist:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1};
|
|
||||||
return{$nonBodyContent:f(B,A,y),$block:C,$blockLimit:{body:1,div:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,audio:1,video:1,details:1,datagrid:1,datalist:1,td:1,th:1,caption:1,form:1},$inline:r,$body:f({script:1,style:1},C),$cdata:{script:1,style:1},$empty:{area:1,base:1,br:1,col:1,hr:1,img:1,input:1,link:1,meta:1,param:1,wbr:1},$listItem:{dd:1,dt:1,li:1},$list:{ul:1,ol:1,dl:1},$nonEditable:{applet:1,button:1,embed:1,iframe:1,map:1,object:1,option:1,script:1,textarea:1,param:1,audio:1,video:1},$captionBlock:{caption:1,legend:1},$removeEmpty:{abbr:1,acronym:1,address:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1,mark:1},$tabIndex:{a:1,area:1,button:1,input:1,object:1,select:1,textarea:1},$tableContent:{caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1},html:A,head:z,style:t,script:t,body:v,base:{},link:{},meta:{},title:t,col:{},tr:{td:1,th:1},img:{},colgroup:{col:1},noscript:v,td:v,br:{},wbr:{},th:v,center:v,kbd:r,button:f(o,k),basefont:{},h5:r,h4:r,samp:r,h6:r,ol:w,h1:r,h3:r,option:t,h2:r,form:f(g,j,k,o),select:{optgroup:1,option:1},font:r,ins:r,menu:w,abbr:r,label:r,table:{thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1},code:r,tfoot:s,cite:r,li:v,input:{},iframe:v,strong:r,textarea:t,noframes:v,big:r,small:r,span:r,hr:{},dt:r,sub:r,optgroup:{option:1},param:{},bdo:r,'var':r,div:v,object:u,sup:r,dd:v,strike:r,area:{},dir:w,map:f({area:1,form:1,p:1},g,l,k),applet:u,dl:{dt:1,dd:1},del:r,isindex:{},fieldset:f({legend:1},q),thead:s,ul:w,acronym:r,b:r,a:p,blockquote:v,caption:r,i:r,u:r,tbody:s,s:r,address:f(j,o),tt:r,legend:r,q:r,pre:f(m,i),p:r,em:r,dfn:r,section:v,header:v,footer:v,nav:v,article:v,aside:v,figure:v,dialog:v,hgroup:v,mark:r,time:r,meter:r,menu:r,command:r,keygen:r,output:r,progress:u,audio:u,video:u,details:u,datagrid:u,datalist:u};})();var f=a.dtd;d.event=function(g){this.$=g;};d.event.prototype={getKey:function(){return this.$.keyCode||this.$.which;},getKeystroke:function(){var h=this;var g=h.getKey();if(h.$.ctrlKey||h.$.metaKey)g+=1114112;if(h.$.shiftKey)g+=2228224;if(h.$.altKey)g+=4456448;return g;},preventDefault:function(g){var h=this.$;if(h.preventDefault)h.preventDefault();else h.returnValue=false;if(g)this.stopPropagation();},stopPropagation:function(){var g=this.$;if(g.stopPropagation)g.stopPropagation();else g.cancelBubble=true;
|
|
||||||
},getTarget:function(){var g=this.$.target||this.$.srcElement;return g?new d.node(g):null;},getPageOffset:function(){var j=this;var g=j.getTarget().getDocument().$,h=j.$.pageX||j.$.clientX+(g.documentElement.scrollLeft||g.body.scrollLeft),i=j.$.pageY||j.$.clientY+(g.documentElement.scrollTop||g.body.scrollTop);return{x:h,y:i};}};a.CTRL=1114112;a.SHIFT=2228224;a.ALT=4456448;d.domObject=function(g){if(g)this.$=g;};d.domObject.prototype=(function(){var g=function(h,i){return function(j){if(typeof a!='undefined')h.fire(i,new d.event(j));};};return{getPrivate:function(){var h;if(!(h=this.getCustomData('_')))this.setCustomData('_',h={});return h;},on:function(h){var k=this;var i=k.getCustomData('_cke_nativeListeners');if(!i){i={};k.setCustomData('_cke_nativeListeners',i);}if(!i[h]){var j=i[h]=g(k,h);if(k.$.addEventListener)k.$.addEventListener(h,j,!!a.event.useCapture);else if(k.$.attachEvent)k.$.attachEvent('on'+h,j);}return a.event.prototype.on.apply(k,arguments);},removeListener:function(h){var k=this;a.event.prototype.removeListener.apply(k,arguments);if(!k.hasListeners(h)){var i=k.getCustomData('_cke_nativeListeners'),j=i&&i[h];if(j){if(k.$.removeEventListener)k.$.removeEventListener(h,j,false);else if(k.$.detachEvent)k.$.detachEvent('on'+h,j);delete i[h];}}},removeAllListeners:function(){var k=this;var h=k.getCustomData('_cke_nativeListeners');for(var i in h){var j=h[i];if(k.$.detachEvent)k.$.detachEvent('on'+i,j);else if(k.$.removeEventListener)k.$.removeEventListener(i,j,false);delete h[i];}}};})();(function(g){var h={};a.on('reset',function(){h={};});g.equals=function(i){return i&&i.$===this.$;};g.setCustomData=function(i,j){var k=this.getUniqueId(),l=h[k]||(h[k]={});l[i]=j;return this;};g.getCustomData=function(i){var j=this.$['data-cke-expando'],k=j&&h[j];return k&&k[i];};g.removeCustomData=function(i){var j=this.$['data-cke-expando'],k=j&&h[j],l=k&&k[i];if(typeof l!='undefined')delete k[i];return l||null;};g.clearCustomData=function(){this.removeAllListeners();var i=this.$['data-cke-expando'];i&&delete h[i];};g.getUniqueId=function(){return this.$['data-cke-expando']||(this.$['data-cke-expando']=e.getNextNumber());};a.event.implementOn(g);})(d.domObject.prototype);d.window=function(g){d.domObject.call(this,g);};d.window.prototype=new d.domObject();e.extend(d.window.prototype,{focus:function(){if(b.webkit&&this.$.parent)this.$.parent.focus();this.$.focus();},getViewPaneSize:function(){var g=this.$.document,h=g.compatMode=='CSS1Compat';return{width:(h?g.documentElement.clientWidth:g.body.clientWidth)||0,height:(h?g.documentElement.clientHeight:g.body.clientHeight)||0};
|
|
||||||
},getScrollPosition:function(){var g=this.$;if('pageXOffset' in g)return{x:g.pageXOffset||0,y:g.pageYOffset||0};else{var h=g.document;return{x:h.documentElement.scrollLeft||h.body.scrollLeft||0,y:h.documentElement.scrollTop||h.body.scrollTop||0};}}});d.document=function(g){d.domObject.call(this,g);};var g=d.document;g.prototype=new d.domObject();e.extend(g.prototype,{appendStyleSheet:function(h){if(this.$.createStyleSheet)this.$.createStyleSheet(h);else{var i=new d.element('link');i.setAttributes({rel:'stylesheet',type:'text/css',href:h});this.getHead().append(i);}},appendStyleText:function(h){var k=this;if(k.$.createStyleSheet){var i=k.$.createStyleSheet('');i.cssText=h;}else{var j=new d.element('style',k);j.append(new d.text(h,k));k.getHead().append(j);}},createElement:function(h,i){var j=new d.element(h,this);if(i){if(i.attributes)j.setAttributes(i.attributes);if(i.styles)j.setStyles(i.styles);}return j;},createText:function(h){return new d.text(h,this);},focus:function(){this.getWindow().focus();},getById:function(h){var i=this.$.getElementById(h);return i?new d.element(i):null;},getByAddress:function(h,i){var j=this.$.documentElement;for(var k=0;j&&k<h.length;k++){var l=h[k];if(!i){j=j.childNodes[l];continue;}var m=-1;for(var n=0;n<j.childNodes.length;n++){var o=j.childNodes[n];if(i===true&&o.nodeType==3&&o.previousSibling&&o.previousSibling.nodeType==3)continue;m++;if(m==l){j=o;break;}}}return j?new d.node(j):null;},getElementsByTag:function(h,i){if(!(c&&!(document.documentMode>8))&&i)h=i+':'+h;return new d.nodeList(this.$.getElementsByTagName(h));},getHead:function(){var h=this.$.getElementsByTagName('head')[0];if(!h)h=this.getDocumentElement().append(new d.element('head'),true);else h=new d.element(h);return(this.getHead=function(){return h;})();},getBody:function(){var h=new d.element(this.$.body);return(this.getBody=function(){return h;})();},getDocumentElement:function(){var h=new d.element(this.$.documentElement);return(this.getDocumentElement=function(){return h;})();},getWindow:function(){var h=new d.window(this.$.parentWindow||this.$.defaultView);return(this.getWindow=function(){return h;})();},write:function(h){var i=this;i.$.open('text/html','replace');b.isCustomDomain()&&(i.$.domain=document.domain);i.$.write(h);i.$.close();}});d.node=function(h){if(h){var i=h.nodeType==9?'document':h.nodeType==1?'element':h.nodeType==3?'text':h.nodeType==8?'comment':'domObject';return new d[i](h);}return this;};d.node.prototype=new d.domObject();a.NODE_ELEMENT=1;
|
|
||||||
a.NODE_DOCUMENT=9;a.NODE_TEXT=3;a.NODE_COMMENT=8;a.NODE_DOCUMENT_FRAGMENT=11;a.POSITION_IDENTICAL=0;a.POSITION_DISCONNECTED=1;a.POSITION_FOLLOWING=2;a.POSITION_PRECEDING=4;a.POSITION_IS_CONTAINED=8;a.POSITION_CONTAINS=16;e.extend(d.node.prototype,{appendTo:function(h,i){h.append(this,i);return h;},clone:function(h,i){var j=this.$.cloneNode(h),k=function(l){if(l.nodeType!=1)return;if(!i)l.removeAttribute('id',false);l['data-cke-expando']=undefined;if(h){var m=l.childNodes;for(var n=0;n<m.length;n++)k(m[n]);}};k(j);return new d.node(j);},hasPrevious:function(){return!!this.$.previousSibling;},hasNext:function(){return!!this.$.nextSibling;},insertAfter:function(h){h.$.parentNode.insertBefore(this.$,h.$.nextSibling);return h;},insertBefore:function(h){h.$.parentNode.insertBefore(this.$,h.$);return h;},insertBeforeMe:function(h){this.$.parentNode.insertBefore(h.$,this.$);return h;},getAddress:function(h){var i=[],j=this.getDocument().$.documentElement,k=this.$;while(k&&k!=j){var l=k.parentNode;if(l)i.unshift(this.getIndex.call({$:k},h));k=l;}return i;},getDocument:function(){return new g(this.$.ownerDocument||this.$.parentNode.ownerDocument);},getIndex:function(h){var i=this.$,j=0;while(i=i.previousSibling){if(h&&i.nodeType==3&&(!i.nodeValue.length||i.previousSibling&&i.previousSibling.nodeType==3))continue;j++;}return j;},getNextSourceNode:function(h,i,j){if(j&&!j.call){var k=j;j=function(n){return!n.equals(k);};}var l=!h&&this.getFirst&&this.getFirst(),m;if(!l){if(this.type==1&&j&&j(this,true)===false)return null;l=this.getNext();}while(!l&&(m=(m||this).getParent())){if(j&&j(m,true)===false)return null;l=m.getNext();}if(!l)return null;if(j&&j(l)===false)return null;if(i&&i!=l.type)return l.getNextSourceNode(false,i,j);return l;},getPreviousSourceNode:function(h,i,j){if(j&&!j.call){var k=j;j=function(n){return!n.equals(k);};}var l=!h&&this.getLast&&this.getLast(),m;if(!l){if(this.type==1&&j&&j(this,true)===false)return null;l=this.getPrevious();}while(!l&&(m=(m||this).getParent())){if(j&&j(m,true)===false)return null;l=m.getPrevious();}if(!l)return null;if(j&&j(l)===false)return null;if(i&&l.type!=i)return l.getPreviousSourceNode(false,i,j);return l;},getPrevious:function(h){var i=this.$,j;do{i=i.previousSibling;j=i&&i.nodeType!=10&&new d.node(i);}while(j&&h&&!h(j));return j;},getNext:function(h){var i=this.$,j;do{i=i.nextSibling;j=i&&new d.node(i);}while(j&&h&&!h(j));return j;},getParent:function(){var h=this.$.parentNode;return h&&h.nodeType==1?new d.node(h):null;
|
|
||||||
},getParents:function(h){var i=this,j=[];do j[h?'push':'unshift'](i);while(i=i.getParent());return j;},getCommonAncestor:function(h){var j=this;if(h.equals(j))return j;if(h.contains&&h.contains(j))return h;var i=j.contains?j:j.getParent();do{if(i.contains(h))return i;}while(i=i.getParent());return null;},getPosition:function(h){var i=this.$,j=h.$;if(i.compareDocumentPosition)return i.compareDocumentPosition(j);if(i==j)return 0;if(this.type==1&&h.type==1){if(i.contains){if(i.contains(j))return 16+4;if(j.contains(i))return 8+2;}if('sourceIndex' in i)return i.sourceIndex<0||j.sourceIndex<0?1:i.sourceIndex<j.sourceIndex?4:2;}var k=this.getAddress(),l=h.getAddress(),m=Math.min(k.length,l.length);for(var n=0;n<=m-1;n++){if(k[n]!=l[n]){if(n<m)return k[n]<l[n]?4:2;break;}}return k.length<l.length?16+4:8+2;},getAscendant:function(h,i){var j=this.$,k;if(!i)j=j.parentNode;while(j){if(j.nodeName&&(k=j.nodeName.toLowerCase(),typeof h=='string'?k==h:k in h))return new d.node(j);j=j.parentNode;}return null;},hasAscendant:function(h,i){var j=this.$;if(!i)j=j.parentNode;while(j){if(j.nodeName&&j.nodeName.toLowerCase()==h)return true;j=j.parentNode;}return false;},move:function(h,i){h.append(this.remove(),i);},remove:function(h){var i=this.$,j=i.parentNode;if(j){if(h)for(var k;k=i.firstChild;)j.insertBefore(i.removeChild(k),i);j.removeChild(i);}return this;},replace:function(h){this.insertBefore(h);h.remove();},trim:function(){this.ltrim();this.rtrim();},ltrim:function(){var k=this;var h;while(k.getFirst&&(h=k.getFirst())){if(h.type==3){var i=e.ltrim(h.getText()),j=h.getLength();if(!i){h.remove();continue;}else if(i.length<j){h.split(j-i.length);k.$.removeChild(k.$.firstChild);}}break;}},rtrim:function(){var k=this;var h;while(k.getLast&&(h=k.getLast())){if(h.type==3){var i=e.rtrim(h.getText()),j=h.getLength();if(!i){h.remove();continue;}else if(i.length<j){h.split(i.length);k.$.lastChild.parentNode.removeChild(k.$.lastChild);}}break;}if(!c&&!b.opera){h=k.$.lastChild;if(h&&h.type==1&&h.nodeName.toLowerCase()=='br')h.parentNode.removeChild(h);}},isReadOnly:function(){var h=this;if(this.type!=1)h=this.getParent();if(h&&typeof h.$.isContentEditable!='undefined')return!(h.$.isContentEditable||h.data('cke-editable'));else{var i=h;while(i){if(i.is('body')||!!i.data('cke-editable'))break;if(i.getAttribute('contentEditable')=='false')return true;else if(i.getAttribute('contentEditable')=='true')break;i=i.getParent();}return false;}}});d.nodeList=function(h){this.$=h;};d.nodeList.prototype={count:function(){return this.$.length;
|
|
||||||
},getItem:function(h){var i=this.$[h];return i?new d.node(i):null;}};d.element=function(h,i){if(typeof h=='string')h=(i?i.$:document).createElement(h);d.domObject.call(this,h);};var h=d.element;h.get=function(i){return i&&(i.$?i:new h(i));};h.prototype=new d.node();h.createFromHtml=function(i,j){var k=new h('div',j);k.setHtml(i);return k.getFirst().remove();};h.setMarker=function(i,j,k,l){var m=j.getCustomData('list_marker_id')||j.setCustomData('list_marker_id',e.getNextNumber()).getCustomData('list_marker_id'),n=j.getCustomData('list_marker_names')||j.setCustomData('list_marker_names',{}).getCustomData('list_marker_names');i[m]=j;n[k]=1;return j.setCustomData(k,l);};h.clearAllMarkers=function(i){for(var j in i)h.clearMarkers(i,i[j],1);};h.clearMarkers=function(i,j,k){var l=j.getCustomData('list_marker_names'),m=j.getCustomData('list_marker_id');for(var n in l)j.removeCustomData(n);j.removeCustomData('list_marker_names');if(k){j.removeCustomData('list_marker_id');delete i[m];}};(function(){e.extend(h.prototype,{type:1,addClass:function(l){var m=this.$.className;if(m){var n=new RegExp('(?:^|\\s)'+l+'(?:\\s|$)','');if(!n.test(m))m+=' '+l;}this.$.className=m||l;},removeClass:function(l){var m=this.getAttribute('class');if(m){var n=new RegExp('(?:^|\\s+)'+l+'(?=\\s|$)','i');if(n.test(m)){m=m.replace(n,'').replace(/^\s+/,'');if(m)this.setAttribute('class',m);else this.removeAttribute('class');}}},hasClass:function(l){var m=new RegExp('(?:^|\\s+)'+l+'(?=\\s|$)','');return m.test(this.getAttribute('class'));},append:function(l,m){var n=this;if(typeof l=='string')l=n.getDocument().createElement(l);if(m)n.$.insertBefore(l.$,n.$.firstChild);else n.$.appendChild(l.$);return l;},appendHtml:function(l){var n=this;if(!n.$.childNodes.length)n.setHtml(l);else{var m=new h('div',n.getDocument());m.setHtml(l);m.moveChildren(n);}},appendText:function(l){if(this.$.text!=undefined)this.$.text+=l;else this.append(new d.text(l));},appendBogus:function(){var n=this;var l=n.getLast();while(l&&l.type==3&&!e.rtrim(l.getText()))l=l.getPrevious();if(!l||!l.is||!l.is('br')){var m=b.opera?n.getDocument().createText(''):n.getDocument().createElement('br');b.gecko&&m.setAttribute('type','_moz');n.append(m);}},breakParent:function(l){var o=this;var m=new d.range(o.getDocument());m.setStartAfter(o);m.setEndAfter(l);var n=m.extractContents();m.insertNode(o.remove());n.insertAfterNode(o);},contains:c||b.webkit?function(l){var m=this.$;return l.type!=1?m.contains(l.getParent().$):m!=l.$&&m.contains(l.$);
|
|
||||||
}:function(l){return!!(this.$.compareDocumentPosition(l.$)&16);},focus:(function(){function l(){try{this.$.focus();}catch(m){}};return function(m){if(m)e.setTimeout(l,100,this);else l.call(this);};})(),getHtml:function(){var l=this.$.innerHTML;return c?l.replace(/<\?[^>]*>/g,''):l;},getOuterHtml:function(){var m=this;if(m.$.outerHTML)return m.$.outerHTML.replace(/<\?[^>]*>/,'');var l=m.$.ownerDocument.createElement('div');l.appendChild(m.$.cloneNode(true));return l.innerHTML;},setHtml:function(l){return this.$.innerHTML=l;},setText:function(l){h.prototype.setText=this.$.innerText!=undefined?function(m){return this.$.innerText=m;}:function(m){return this.$.textContent=m;};return this.setText(l);},getAttribute:(function(){var l=function(m){return this.$.getAttribute(m,2);};if(c&&(b.ie7Compat||b.ie6Compat))return function(m){var q=this;switch(m){case 'class':m='className';break;case 'http-equiv':m='httpEquiv';break;case 'name':return q.$.name;case 'tabindex':var n=l.call(q,m);if(n!==0&&q.$.tabIndex===0)n=null;return n;break;case 'checked':var o=q.$.attributes.getNamedItem(m),p=o.specified?o.nodeValue:q.$.checked;return p?'checked':null;case 'hspace':case 'value':return q.$[m];case 'style':return q.$.style.cssText;case 'contenteditable':case 'contentEditable':return q.$.attributes.getNamedItem('contentEditable').specified?q.$.getAttribute('contentEditable'):null;}return l.call(q,m);};else return l;})(),getChildren:function(){return new d.nodeList(this.$.childNodes);},getComputedStyle:c?function(l){return this.$.currentStyle[e.cssStyleToDomStyle(l)];}:function(l){var m=this.getWindow().$.getComputedStyle(this.$,null);return m?m.getPropertyValue(l):'';},getDtd:function(){var l=f[this.getName()];this.getDtd=function(){return l;};return l;},getElementsByTag:g.prototype.getElementsByTag,getTabIndex:c?function(){var l=this.$.tabIndex;if(l===0&&!f.$tabIndex[this.getName()]&&parseInt(this.getAttribute('tabindex'),10)!==0)l=-1;return l;}:b.webkit?function(){var l=this.$.tabIndex;if(l==undefined){l=parseInt(this.getAttribute('tabindex'),10);if(isNaN(l))l=-1;}return l;}:function(){return this.$.tabIndex;},getText:function(){return this.$.textContent||this.$.innerText||'';},getWindow:function(){return this.getDocument().getWindow();},getId:function(){return this.$.id||null;},getNameAtt:function(){return this.$.name||null;},getName:function(){var l=this.$.nodeName.toLowerCase();if(c&&!(document.documentMode>8)){var m=this.$.scopeName;if(m!='HTML')l=m.toLowerCase()+':'+l;}return(this.getName=function(){return l;
|
|
||||||
})();},getValue:function(){return this.$.value;},getFirst:function(l){var m=this.$.firstChild,n=m&&new d.node(m);if(n&&l&&!l(n))n=n.getNext(l);return n;},getLast:function(l){var m=this.$.lastChild,n=m&&new d.node(m);if(n&&l&&!l(n))n=n.getPrevious(l);return n;},getStyle:function(l){return this.$.style[e.cssStyleToDomStyle(l)];},is:function(){var l=this.getName();for(var m=0;m<arguments.length;m++){if(arguments[m]==l)return true;}return false;},isEditable:function(l){var o=this;var m=o.getName();if(o.isReadOnly()||o.getComputedStyle('display')=='none'||o.getComputedStyle('visibility')=='hidden'||o.is('a')&&o.data('cke-saved-name')&&!o.getChildCount()||f.$nonEditable[m]||f.$empty[m])return false;if(l!==false){var n=f[m]||f.span;return n&&n['#'];}return true;},isIdentical:function(l){if(this.getName()!=l.getName())return false;var m=this.$.attributes,n=l.$.attributes,o=m.length,p=n.length;for(var q=0;q<o;q++){var r=m[q];if(r.nodeName=='_moz_dirty')continue;if((!c||r.specified&&r.nodeName!='data-cke-expando')&&r.nodeValue!=l.getAttribute(r.nodeName))return false;}if(c)for(q=0;q<p;q++){r=n[q];if(r.specified&&r.nodeName!='data-cke-expando'&&r.nodeValue!=this.getAttribute(r.nodeName))return false;}return true;},isVisible:function(){var o=this;var l=(o.$.offsetHeight||o.$.offsetWidth)&&o.getComputedStyle('visibility')!='hidden',m,n;if(l&&(b.webkit||b.opera)){m=o.getWindow();if(!m.equals(a.document.getWindow())&&(n=m.$.frameElement))l=new h(n).isVisible();}return!!l;},isEmptyInlineRemoveable:function(){if(!f.$removeEmpty[this.getName()])return false;var l=this.getChildren();for(var m=0,n=l.count();m<n;m++){var o=l.getItem(m);if(o.type==1&&o.data('cke-bookmark'))continue;if(o.type==1&&!o.isEmptyInlineRemoveable()||o.type==3&&e.trim(o.getText()))return false;}return true;},hasAttributes:c&&(b.ie7Compat||b.ie6Compat)?function(){var l=this.$.attributes;for(var m=0;m<l.length;m++){var n=l[m];switch(n.nodeName){case 'class':if(this.getAttribute('class'))return true;case 'data-cke-expando':continue;default:if(n.specified)return true;}}return false;}:function(){var l=this.$.attributes,m=l.length,n={'data-cke-expando':1,_moz_dirty:1};return m>0&&(m>2||!n[l[0].nodeName]||m==2&&!n[l[1].nodeName]);},hasAttribute:(function(){function l(m){var n=this.$.attributes.getNamedItem(m);return!!(n&&n.specified);};return c&&b.version<8?function(m){if(m=='name')return!!this.$.name;return l.call(this,m);}:l;})(),hide:function(){this.setStyle('display','none');},moveChildren:function(l,m){var n=this.$;
|
|
||||||
l=l.$;if(n==l)return;var o;if(m)while(o=n.lastChild)l.insertBefore(n.removeChild(o),l.firstChild);else while(o=n.firstChild)l.appendChild(n.removeChild(o));},mergeSiblings:(function(){function l(m,n,o){if(n&&n.type==1){var p=[];while(n.data('cke-bookmark')||n.isEmptyInlineRemoveable()){p.push(n);n=o?n.getNext():n.getPrevious();if(!n||n.type!=1)return;}if(m.isIdentical(n)){var q=o?m.getLast():m.getFirst();while(p.length)p.shift().move(m,!o);n.moveChildren(m,!o);n.remove();if(q&&q.type==1)q.mergeSiblings();}}};return function(m){var n=this;if(!(m===false||f.$removeEmpty[n.getName()]||n.is('a')))return;l(n,n.getNext(),true);l(n,n.getPrevious());};})(),show:function(){this.setStyles({display:'',visibility:''});},setAttribute:(function(){var l=function(m,n){this.$.setAttribute(m,n);return this;};if(c&&(b.ie7Compat||b.ie6Compat))return function(m,n){var o=this;if(m=='class')o.$.className=n;else if(m=='style')o.$.style.cssText=n;else if(m=='tabindex')o.$.tabIndex=n;else if(m=='checked')o.$.checked=n;else if(m=='contenteditable')l.call(o,'contentEditable',n);else l.apply(o,arguments);return o;};else if(b.ie8Compat&&b.secure)return function(m,n){if(m=='src'&&n.match(/^http:\/\//))try{l.apply(this,arguments);}catch(o){}else l.apply(this,arguments);return this;};else return l;})(),setAttributes:function(l){for(var m in l)this.setAttribute(m,l[m]);return this;},setValue:function(l){this.$.value=l;return this;},removeAttribute:(function(){var l=function(m){this.$.removeAttribute(m);};if(c&&(b.ie7Compat||b.ie6Compat))return function(m){if(m=='class')m='className';else if(m=='tabindex')m='tabIndex';else if(m=='contenteditable')m='contentEditable';l.call(this,m);};else return l;})(),removeAttributes:function(l){if(e.isArray(l))for(var m=0;m<l.length;m++)this.removeAttribute(l[m]);else for(var n in l)l.hasOwnProperty(n)&&this.removeAttribute(n);},removeStyle:function(l){var p=this;var m=p.$.style;if(!m.removeProperty&&(l=='border'||l=='margin'||l=='padding')){var n=j(l);for(var o=0;o<n.length;o++)p.removeStyle(n[o]);return;}m.removeProperty?m.removeProperty(l):m.removeAttribute(e.cssStyleToDomStyle(l));if(!p.$.style.cssText)p.removeAttribute('style');},setStyle:function(l,m){this.$.style[e.cssStyleToDomStyle(l)]=m;return this;},setStyles:function(l){for(var m in l)this.setStyle(m,l[m]);return this;},setOpacity:function(l){if(c&&b.version<9){l=Math.round(l*100);this.setStyle('filter',l>=100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+l+')');}else this.setStyle('opacity',l);
|
|
||||||
},unselectable:b.gecko?function(){this.$.style.MozUserSelect='none';this.on('dragstart',function(l){l.data.preventDefault();});}:b.webkit?function(){this.$.style.KhtmlUserSelect='none';this.on('dragstart',function(l){l.data.preventDefault();});}:function(){if(c||b.opera){var l=this.$,m=l.getElementsByTagName('*'),n,o=0;l.unselectable='on';while(n=m[o++])switch(n.tagName.toLowerCase()){case 'iframe':case 'textarea':case 'input':case 'select':break;default:n.unselectable='on';}}},getPositionedAncestor:function(){var l=this;while(l.getName()!='html'){if(l.getComputedStyle('position')!='static')return l;l=l.getParent();}return null;},getDocumentPosition:function(l){var G=this;var m=0,n=0,o=G.getDocument(),p=o.getBody(),q=o.$.compatMode=='BackCompat';if(document.documentElement.getBoundingClientRect){var r=G.$.getBoundingClientRect(),s=o.$,t=s.documentElement,u=t.clientTop||p.$.clientTop||0,v=t.clientLeft||p.$.clientLeft||0,w=true;if(c){var x=o.getDocumentElement().contains(G),y=o.getBody().contains(G);w=q&&y||!q&&x;}if(w){m=r.left+(!q&&t.scrollLeft||p.$.scrollLeft);m-=v;n=r.top+(!q&&t.scrollTop||p.$.scrollTop);n-=u;}}else{var z=G,A=null,B;while(z&&!(z.getName()=='body'||z.getName()=='html')){m+=z.$.offsetLeft-z.$.scrollLeft;n+=z.$.offsetTop-z.$.scrollTop;if(!z.equals(G)){m+=z.$.clientLeft||0;n+=z.$.clientTop||0;}var C=A;while(C&&!C.equals(z)){m-=C.$.scrollLeft;n-=C.$.scrollTop;C=C.getParent();}A=z;z=(B=z.$.offsetParent)?new h(B):null;}}if(l){var D=G.getWindow(),E=l.getWindow();if(!D.equals(E)&&D.$.frameElement){var F=new h(D.$.frameElement).getDocumentPosition(l);m+=F.x;n+=F.y;}}if(!document.documentElement.getBoundingClientRect)if(b.gecko&&!q){m+=G.$.clientLeft?1:0;n+=G.$.clientTop?1:0;}return{x:m,y:n};},scrollIntoView:function(l){var m=this.getParent();if(!m)return;do{var n=m.$.clientWidth&&m.$.clientWidth<m.$.scrollWidth||m.$.clientHeight&&m.$.clientHeight<m.$.scrollHeight;if(n)this.scrollIntoParent(m,l,1);if(m.is('html')){var o=m.getWindow();try{var p=o.$.frameElement;p&&(m=new h(p));}catch(q){}}}while(m=m.getParent());},scrollIntoParent:function(l,m,n){!l&&(l=this.getWindow());var o=l.getDocument(),p=o.$.compatMode=='BackCompat';if(l instanceof d.window)l=p?o.getBody():o.getDocumentElement();function q(C,D){if(/body|html/.test(l.getName()))l.getWindow().$.scrollBy(C,D);else{l.$.scrollLeft+=C;l.$.scrollTop+=D;}};function r(C,D){var E={x:0,y:0};if(!C.is(p?'body':'html')){var F=C.$.getBoundingClientRect();E.x=F.left,E.y=F.top;}var G=C.getWindow();if(!G.equals(D)){var H=r(h.get(G.$.frameElement),D);
|
|
||||||
E.x+=H.x,E.y+=H.y;}return E;};function s(C,D){return parseInt(C.getComputedStyle('margin-'+D)||0,10)||0;};var t=l.getWindow(),u=r(this,t),v=r(l,t),w=this.$.offsetHeight,x=this.$.offsetWidth,y=l.$.clientHeight,z=l.$.clientWidth,A,B;A={x:u.x-s(this,'left')-v.x||0,y:u.y-s(this,'top')-v.y||0};B={x:u.x+x+s(this,'right')-(v.x+z)||0,y:u.y+w+s(this,'bottom')-(v.y+y)||0};if(A.y<0||B.y>0)q(0,m===true?A.y:m===false?B.y:A.y<0?A.y:B.y);if(n&&(A.x<0||B.x>0))q(A.x<0?A.x:B.x,0);},setState:function(l){var m=this;switch(l){case 1:m.addClass('cke_on');m.removeClass('cke_off');m.removeClass('cke_disabled');break;case 0:m.addClass('cke_disabled');m.removeClass('cke_off');m.removeClass('cke_on');break;default:m.addClass('cke_off');m.removeClass('cke_on');m.removeClass('cke_disabled');break;}},getFrameDocument:function(){var l=this.$;try{l.contentWindow.document;}catch(m){l.src=l.src;if(c&&b.version<7)window.showModalDialog('javascript:document.write("<script>window.setTimeout(function(){window.close();},50);</script>")');}return l&&new g(l.contentWindow.document);},copyAttributes:function(l,m){var s=this;var n=s.$.attributes;m=m||{};for(var o=0;o<n.length;o++){var p=n[o],q=p.nodeName.toLowerCase(),r;if(q in m)continue;if(q=='checked'&&(r=s.getAttribute(q)))l.setAttribute(q,r);else if(p.specified||c&&p.nodeValue&&q=='value'){r=s.getAttribute(q);if(r===null)r=p.nodeValue;l.setAttribute(q,r);}}if(s.$.style.cssText!=='')l.$.style.cssText=s.$.style.cssText;},renameNode:function(l){var o=this;if(o.getName()==l)return;var m=o.getDocument(),n=new h(l,m);o.copyAttributes(n);o.moveChildren(n);o.getParent()&&o.$.parentNode.replaceChild(n.$,o.$);n.$['data-cke-expando']=o.$['data-cke-expando'];o.$=n.$;},getChild:function(l){var m=this.$;if(!l.slice)m=m.childNodes[l];else while(l.length>0&&m)m=m.childNodes[l.shift()];return m?new d.node(m):null;},getChildCount:function(){return this.$.childNodes.length;},disableContextMenu:function(){this.on('contextmenu',function(l){if(!l.data.getTarget().hasClass('cke_enable_context_menu'))l.data.preventDefault();});},getDirection:function(l){var m=this;return l?m.getComputedStyle('direction')||m.getDirection()||m.getDocument().$.dir||m.getDocument().getBody().getDirection(1):m.getStyle('direction')||m.getAttribute('dir');},data:function(l,m){l='data-'+l;if(m===undefined)return this.getAttribute(l);else if(m===false)this.removeAttribute(l);else this.setAttribute(l,m);return null;}});var i={width:['border-left-width','border-right-width','padding-left','padding-right'],height:['border-top-width','border-bottom-width','padding-top','padding-bottom']};
|
|
||||||
function j(l){var m=['top','left','right','bottom'],n;if(l=='border')n=['color','style','width'];var o=[];for(var p=0;p<m.length;p++){if(n)for(var q=0;q<n.length;q++)o.push([l,m[p],n[q]].join('-'));else o.push([l,m[p]].join('-'));}return o;};function k(l){var m=0;for(var n=0,o=i[l].length;n<o;n++)m+=parseInt(this.getComputedStyle(i[l][n])||0,10)||0;return m;};h.prototype.setSize=function(l,m,n){if(typeof m=='number'){if(n&&!(c&&b.quirks))m-=k.call(this,l);this.setStyle(l,m+'px');}};h.prototype.getSize=function(l,m){var n=Math.max(this.$['offset'+e.capitalize(l)],this.$['client'+e.capitalize(l)])||0;if(m)n-=k.call(this,l);return n;};})();a.command=function(i,j){this.uiItems=[];this.exec=function(k){var l=this;if(l.state==0)return false;if(l.editorFocus)i.focus();if(l.fire('exec')===true)return true;return j.exec.call(l,i,k)!==false;};this.refresh=function(){if(this.fire('refresh')===true)return true;return j.refresh&&j.refresh.apply(this,arguments)!==false;};e.extend(this,j,{modes:{wysiwyg:1},editorFocus:1,state:2});a.event.call(this);};a.command.prototype={enable:function(){var i=this;if(i.state==0)i.setState(!i.preserveState||typeof i.previousState=='undefined'?2:i.previousState);},disable:function(){this.setState(0);},setState:function(i){var j=this;if(j.state==i)return false;j.previousState=j.state;j.state=i;j.fire('state');return true;},toggleState:function(){var i=this;if(i.state==2)i.setState(1);else if(i.state==1)i.setState(2);}};a.event.implementOn(a.command.prototype,true);a.ENTER_P=1;a.ENTER_BR=2;a.ENTER_DIV=3;a.config={customConfig:'config.js',autoUpdateElement:true,baseHref:'',contentsCss:a.basePath+'contents.css',contentsLangDirection:'ui',contentsLanguage:'',language:'',defaultLanguage:'en',enterMode:1,forceEnterMode:false,shiftEnterMode:2,corePlugins:'',docType:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',bodyId:'',bodyClass:'',fullPage:false,height:200,plugins:'about,a11yhelp,basicstyles,bidi,blockquote,button,clipboard,colorbutton,colordialog,contextmenu,dialogadvtab,div,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,iframe,image,indent,justify,keystrokes,link,list,liststyle,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,showblocks,showborders,smiley,sourcearea,specialchar,stylescombo,tab,table,tabletools,templates,toolbar,undo,wsc,wysiwygarea',extraPlugins:'',removePlugins:'',protectedSource:[],tabIndex:0,theme:'default',skin:'kama',width:'',baseFloatZIndex:10000};
|
|
||||||
var i=a.config;a.focusManager=function(j){if(j.focusManager)return j.focusManager;this.hasFocus=false;this._={editor:j};return this;};a.focusManager.prototype={focus:function(){var k=this;if(k._.timer)clearTimeout(k._.timer);if(!k.hasFocus){if(a.currentInstance)a.currentInstance.focusManager.forceBlur();var j=k._.editor;j.container.getChild(1).addClass('cke_focus');k.hasFocus=true;j.fire('focus');}},blur:function(){var j=this;if(j._.timer)clearTimeout(j._.timer);j._.timer=setTimeout(function(){delete j._.timer;j.forceBlur();},100);},forceBlur:function(){if(this.hasFocus){var j=this._.editor;j.container.getChild(1).removeClass('cke_focus');this.hasFocus=false;j.fire('blur');}}};(function(){var j={};a.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,'en-au':1,'en-ca':1,'en-gb':1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,'fr-ca':1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,is:1,it:1,ja:1,ka:1,km:1,ko:1,ku:1,lt:1,lv:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,'pt-br':1,pt:1,ro:1,ru:1,sk:1,sl:1,'sr-latn':1,sr:1,sv:1,th:1,tr:1,ug:1,uk:1,vi:1,'zh-cn':1,zh:1},load:function(k,l,m){if(!k||!a.lang.languages[k])k=this.detect(l,k);if(!this[k])a.scriptLoader.load(a.getUrl('lang/'+k+'.js'),function(){m(k,this[k]);},this);else m(k,this[k]);},detect:function(k,l){var m=this.languages;l=l||navigator.userLanguage||navigator.language||k;var n=l.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),o=n[1],p=n[2];if(m[o+'-'+p])o=o+'-'+p;else if(!m[o])o=null;a.lang.detect=o?function(){return o;}:function(q){return q;};return o||k;}};})();a.scriptLoader=(function(){var j={},k={};return{load:function(l,m,n,o){var p=typeof l=='string';if(p)l=[l];if(!n)n=a;var q=l.length,r=[],s=[],t=function(y){if(m)if(p)m.call(n,y);else m.call(n,r,s);};if(q===0){t(true);return;}var u=function(y,z){(z?r:s).push(y);if(--q<=0){o&&a.document.getDocumentElement().removeStyle('cursor');t(z);}},v=function(y,z){j[y]=1;var A=k[y];delete k[y];for(var B=0;B<A.length;B++)A[B](y,z);},w=function(y){if(j[y]){u(y,true);return;}var z=k[y]||(k[y]=[]);z.push(u);if(z.length>1)return;var A=new h('script');A.setAttributes({type:'text/javascript',src:y});if(m)if(c)A.$.onreadystatechange=function(){if(A.$.readyState=='loaded'||A.$.readyState=='complete'){A.$.onreadystatechange=null;v(y,true);}};else{A.$.onload=function(){setTimeout(function(){v(y,true);},0);};A.$.onerror=function(){v(y,false);};}A.appendTo(a.document.getHead());};o&&a.document.getDocumentElement().setStyle('cursor','wait');for(var x=0;x<q;x++)w(l[x]);}};})();a.resourceManager=function(j,k){var l=this;
|
|
||||||
l.basePath=j;l.fileName=k;l.registered={};l.loaded={};l.externals={};l._={waitingList:{}};};a.resourceManager.prototype={add:function(j,k){if(this.registered[j])throw '[CKEDITOR.resourceManager.add] The resource name "'+j+'" is already registered.';a.fire(j+e.capitalize(this.fileName)+'Ready',this.registered[j]=k||{});},get:function(j){return this.registered[j]||null;},getPath:function(j){var k=this.externals[j];return a.getUrl(k&&k.dir||this.basePath+j+'/');},getFilePath:function(j){var k=this.externals[j];return a.getUrl(this.getPath(j)+(k&&typeof k.file=='string'?k.file:this.fileName+'.js'));},addExternal:function(j,k,l){j=j.split(',');for(var m=0;m<j.length;m++){var n=j[m];this.externals[n]={dir:k,file:l};}},load:function(j,k,l){if(!e.isArray(j))j=j?[j]:[];var m=this.loaded,n=this.registered,o=[],p={},q={};for(var r=0;r<j.length;r++){var s=j[r];if(!s)continue;if(!m[s]&&!n[s]){var t=this.getFilePath(s);o.push(t);if(!(t in p))p[t]=[];p[t].push(s);}else q[s]=this.get(s);}a.scriptLoader.load(o,function(u,v){if(v.length)throw '[CKEDITOR.resourceManager.load] Resource name "'+p[v[0]].join(',')+'" was not found at "'+v[0]+'".';for(var w=0;w<u.length;w++){var x=p[u[w]];for(var y=0;y<x.length;y++){var z=x[y];q[z]=this.get(z);m[z]=1;}}k.call(l,q);},this);}};a.plugins=new a.resourceManager('plugins/','plugin');var j=a.plugins;j.load=e.override(j.load,function(k){return function(l,m,n){var o={},p=function(q){k.call(this,q,function(r){e.extend(o,r);var s=[];for(var t in r){var u=r[t],v=u&&u.requires;if(v)for(var w=0;w<v.length;w++){if(!o[v[w]])s.push(v[w]);}}if(s.length)p.call(this,s);else{for(t in o){u=o[t];if(u.onLoad&&!u.onLoad._called){u.onLoad();u.onLoad._called=1;}}if(m)m.call(n||window,o);}},this);};p.call(this,l);};});j.setLang=function(k,l,m){var n=this.get(k),o=n.langEntries||(n.langEntries={}),p=n.lang||(n.lang=[]);if(e.indexOf(p,l)==-1)p.push(l);o[l]=m;};a.skins=(function(){var k={},l={},m=function(n,o,p,q){var r=k[o];if(!n.skin){n.skin=r;if(r.init)r.init(n);}var s=function(B){for(var C=0;C<B.length;C++)B[C]=a.getUrl(l[o]+B[C]);};function t(B,C){return B.replace(/url\s*\(([\s'"]*)(.*?)([\s"']*)\)/g,function(D,E,F,G){if(/^\/|^\w?:/.test(F))return D;else return 'url('+C+E+F+G+')';});};p=r[p];var u=!p||!!p._isLoaded;if(u)q&&q();else{var v=p._pending||(p._pending=[]);v.push(q);if(v.length>1)return;var w=!p.css||!p.css.length,x=!p.js||!p.js.length,y=function(){if(w&&x){p._isLoaded=1;for(var B=0;B<v.length;B++){if(v[B])v[B]();}}};if(!w){var z=p.css;if(e.isArray(z)){s(z);
|
|
||||||
for(var A=0;A<z.length;A++)a.document.appendStyleSheet(z[A]);}else{z=t(z,a.getUrl(l[o]));a.document.appendStyleText(z);}p.css=z;w=1;}if(!x){s(p.js);a.scriptLoader.load(p.js,function(){x=1;y();});}y();}};return{add:function(n,o){k[n]=o;o.skinPath=l[n]||(l[n]=a.getUrl('skins/'+n+'/'));},load:function(n,o,p){var q=n.skinName,r=n.skinPath;if(k[q])m(n,q,o,p);else{l[q]=r;a.scriptLoader.load(a.getUrl(r+'skin.js'),function(){m(n,q,o,p);});}}};})();a.themes=new a.resourceManager('themes/','theme');a.ui=function(k){if(k.ui)return k.ui;this._={handlers:{},items:{},editor:k};return this;};var k=a.ui;k.prototype={add:function(l,m,n){this._.items[l]={type:m,command:n.command||null,args:Array.prototype.slice.call(arguments,2)};},create:function(l){var q=this;var m=q._.items[l],n=m&&q._.handlers[m.type],o=m&&m.command&&q._.editor.getCommand(m.command),p=n&&n.create.apply(q,m.args);m&&(p=e.extend(p,q._.editor.skin[m.type],true));if(o)o.uiItems.push(p);return p;},addHandler:function(l,m){this._.handlers[l]=m;}};a.event.implementOn(k);(function(){var l=0,m=function(){var x='editor'+ ++l;return a.instances&&a.instances[x]?m():x;},n={},o=function(x){var y=x.config.customConfig;if(!y)return false;y=a.getUrl(y);var z=n[y]||(n[y]={});if(z.fn){z.fn.call(x,x.config);if(a.getUrl(x.config.customConfig)==y||!o(x))x.fireOnce('customConfigLoaded');}else a.scriptLoader.load(y,function(){if(a.editorConfig)z.fn=a.editorConfig;else z.fn=function(){};o(x);});return true;},p=function(x,y){x.on('customConfigLoaded',function(){if(y){if(y.on)for(var z in y.on)x.on(z,y.on[z]);e.extend(x.config,y,true);delete x.config.on;}q(x);});if(y&&y.customConfig!=undefined)x.config.customConfig=y.customConfig;if(!o(x))x.fireOnce('customConfigLoaded');},q=function(x){var y=x.config.skin.split(','),z=y[0],A=a.getUrl(y[1]||'skins/'+z+'/');x.skinName=z;x.skinPath=A;x.skinClass='cke_skin_'+z;x.tabIndex=x.config.tabIndex||x.element.getAttribute('tabindex')||0;x.readOnly=!!(x.config.readOnly||x.element.getAttribute('disabled'));x.fireOnce('configLoaded');t(x);},r=function(x){a.lang.load(x.config.language,x.config.defaultLanguage,function(y,z){x.langCode=y;x.lang=e.prototypedCopy(z);if(b.gecko&&b.version<10900&&x.lang.dir=='rtl')x.lang.dir='ltr';x.fire('langLoaded');var A=x.config;A.contentsLangDirection=='ui'&&(A.contentsLangDirection=x.lang.dir);s(x);});},s=function(x){var y=x.config,z=y.plugins,A=y.extraPlugins,B=y.removePlugins;if(A){var C=new RegExp('(?:^|,)(?:'+A.replace(/\s*,\s*/g,'|')+')(?=,|$)','g');z=z.replace(C,'');
|
|
||||||
z+=','+A;}if(B){C=new RegExp('(?:^|,)(?:'+B.replace(/\s*,\s*/g,'|')+')(?=,|$)','g');z=z.replace(C,'');}b.air&&(z+=',adobeair');j.load(z.split(','),function(D){var E=[],F=[],G=[];x.plugins=D;for(var H in D){var I=D[H],J=I.lang,K=j.getPath(H),L=null;I.path=K;if(J){L=e.indexOf(J,x.langCode)>=0?x.langCode:J[0];if(!I.langEntries||!I.langEntries[L])G.push(a.getUrl(K+'lang/'+L+'.js'));else{e.extend(x.lang,I.langEntries[L]);L=null;}}F.push(L);E.push(I);}a.scriptLoader.load(G,function(){var M=['beforeInit','init','afterInit'];for(var N=0;N<M.length;N++)for(var O=0;O<E.length;O++){var P=E[O];if(N===0&&F[O]&&P.lang)e.extend(x.lang,P.langEntries[F[O]]);if(P[M[N]])P[M[N]](x);}x.fire('pluginsLoaded');u(x);});});},t=function(x){a.skins.load(x,'editor',function(){r(x);});},u=function(x){var y=x.config.theme;a.themes.load(y,function(){var z=x.theme=a.themes.get(y);z.path=a.themes.getPath(y);z.build(x);if(x.config.autoUpdateElement)v(x);});},v=function(x){var y=x.element;if(x.elementMode==1&&y.is('textarea')){var z=y.$.form&&new h(y.$.form);if(z){function A(){x.updateElement();};z.on('submit',A);if(!z.$.submit.nodeName&&!z.$.submit.length)z.$.submit=e.override(z.$.submit,function(B){return function(){x.updateElement();if(B.apply)B.apply(this,arguments);else B();};});x.on('destroy',function(){z.removeListener('submit',A);});}}};function w(){var x,y=this._.commands,z=this.mode;if(!z)return;for(var A in y){x=y[A];x[x.startDisabled?'disable':this.readOnly&&!x.readOnly?'disable':x.modes[z]?'enable':'disable']();}};a.editor.prototype._init=function(){var z=this;var x=h.get(z._.element),y=z._.instanceConfig;delete z._.element;delete z._.instanceConfig;z._.commands={};z._.styles=[];z.element=x;z.name=x&&z.elementMode==1&&(x.getId()||x.getNameAtt())||m();if(z.name in a.instances)throw '[CKEDITOR.editor] The instance "'+z.name+'" already exists.';z.id=e.getNextId();z.config=e.prototypedCopy(i);z.ui=new k(z);z.focusManager=new a.focusManager(z);a.fire('instanceCreated',null,z);z.on('mode',w,null,null,1);z.on('readOnly',w,null,null,1);p(z,y);};})();e.extend(a.editor.prototype,{addCommand:function(l,m){return this._.commands[l]=new a.command(this,m);},addCss:function(l){this._.styles.push(l);},destroy:function(l){var m=this;if(!l)m.updateElement();m.fire('destroy');m.theme&&m.theme.destroy(m);a.remove(m);a.fire('instanceDestroyed',null,m);},execCommand:function(l,m){var n=this.getCommand(l),o={name:l,commandData:m,command:n};if(n&&n.state!=0)if(this.fire('beforeCommandExec',o)!==true){o.returnValue=n.exec(o.commandData);
|
|
||||||
if(!n.async&&this.fire('afterCommandExec',o)!==true)return o.returnValue;}return false;},getCommand:function(l){return this._.commands[l];},getData:function(){var n=this;n.fire('beforeGetData');var l=n._.data;if(typeof l!='string'){var m=n.element;if(m&&n.elementMode==1)l=m.is('textarea')?m.getValue():m.getHtml();else l='';}l={dataValue:l};n.fire('getData',l);return l.dataValue;},getSnapshot:function(){var l=this.fire('getSnapshot');if(typeof l!='string'){var m=this.element;if(m&&this.elementMode==1)l=m.is('textarea')?m.getValue():m.getHtml();}return l;},loadSnapshot:function(l){this.fire('loadSnapshot',l);},setData:function(l,m,n){if(m)this.on('dataReady',function(p){p.removeListener();m.call(p.editor);});var o={dataValue:l};!n&&this.fire('setData',o);this._.data=o.dataValue;!n&&this.fire('afterSetData',o);},setReadOnly:function(l){l=l==undefined||l;if(this.readOnly!=l){this.readOnly=l;this.fire('readOnly');}},insertHtml:function(l){this.fire('insertHtml',l);},insertText:function(l){this.fire('insertText',l);},insertElement:function(l){this.fire('insertElement',l);},checkDirty:function(){return this.mayBeDirty&&this._.previousValue!==this.getSnapshot();},resetDirty:function(){if(this.mayBeDirty)this._.previousValue=this.getSnapshot();},updateElement:function(){var n=this;var l=n.element;if(l&&n.elementMode==1){var m=n.getData();if(n.config.htmlEncodeOutput)m=e.htmlEncode(m);if(l.is('textarea'))l.setValue(m);else l.setHtml(m);}}});a.on('loaded',function(){var l=a.editor._pending;if(l){delete a.editor._pending;for(var m=0;m<l.length;m++)l[m]._init();}});a.htmlParser=function(){this._={htmlPartsRegex:new RegExp("<(?:(?:\\/([^>]+)>)|(?:!--([\\S|\\s]*?)-->)|(?:([^\\s>]+)\\s*((?:(?:\"[^\"]*\")|(?:'[^']*')|[^\"'>])*)\\/?>))",'g')};};(function(){var l=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,m={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};a.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(n){var A=this;var o,p,q=0,r;while(o=A._.htmlPartsRegex.exec(n)){var s=o.index;if(s>q){var t=n.substring(q,s);if(r)r.push(t);else A.onText(t);}q=A._.htmlPartsRegex.lastIndex;if(p=o[1]){p=p.toLowerCase();if(r&&f.$cdata[p]){A.onCDATA(r.join(''));r=null;}if(!r){A.onTagClose(p);continue;}}if(r){r.push(o[0]);continue;}if(p=o[3]){p=p.toLowerCase();if(/="/.test(p))continue;
|
|
||||||
var u={},v,w=o[4],x=!!(w&&w.charAt(w.length-1)=='/');if(w)while(v=l.exec(w)){var y=v[1].toLowerCase(),z=v[2]||v[3]||v[4]||'';if(!z&&m[y])u[y]=y;else u[y]=z;}A.onTagOpen(p,u,x);if(!r&&f.$cdata[p])r=[];continue;}if(p=o[2])A.onComment(p);}if(n.length>q)A.onText(n.substring(q,n.length));}};})();a.htmlParser.comment=function(l){this.value=l;this._={isBlockLike:false};};a.htmlParser.comment.prototype={type:8,writeHtml:function(l,m){var n=this.value;if(m){if(!(n=m.onComment(n,this)))return;if(typeof n!='string'){n.parent=this.parent;n.writeHtml(l,m);return;}}l.comment(n);}};(function(){a.htmlParser.text=function(l){this.value=l;this._={isBlockLike:false};};a.htmlParser.text.prototype={type:3,writeHtml:function(l,m){var n=this.value;if(m&&!(n=m.onText(n,this)))return;l.text(n);}};})();(function(){a.htmlParser.cdata=function(l){this.value=l;};a.htmlParser.cdata.prototype={type:3,writeHtml:function(l){l.write(this.value);}};})();a.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:true,hasInlineStarted:false};};(function(){var l=e.extend({table:1,ul:1,ol:1,dl:1},f.table,f.ul,f.ol,f.dl),m=c&&b.version<8?{dd:1,dt:1}:{},n={ol:1,ul:1},o=e.extend({},{html:1},f.html,f.body,f.head,{style:1,script:1});function p(q){return q.name=='a'&&q.attributes.href||f.$removeEmpty[q.name];};a.htmlParser.fragment.fromHtml=function(q,r,s){var t=new a.htmlParser(),u=s||new a.htmlParser.fragment(),v=[],w=[],x=u,y=false,z=false;function A(D){var E;if(v.length>0)for(var F=0;F<v.length;F++){var G=v[F],H=G.name,I=f[H],J=x.name&&f[x.name];if((!J||J[H])&&(!D||!I||I[D]||!f[D])){if(!E){B();E=1;}G=G.clone();G.parent=x;x=G;v.splice(F,1);F--;}else if(H==x.name)C(x,x.parent,1),F--;}};function B(){while(w.length)x.add(w.shift());};function C(D,E,F){if(D.previous!==undefined)return;E=E||x||u;var G=x;if(r&&(!E.type||E.name=='body')){var H,I;if(D.attributes&&(I=D.attributes['data-cke-real-element-type']))H=I;else H=D.name;if(H&&!(H in f.$body||H=='body'||D.isOrphan)){x=E;t.onTagOpen(r,{});D.returnPoint=E=x;}}if(D._.isBlockLike&&D.name!='pre'&&D.name!='textarea'){var J=D.children.length,K=D.children[J-1],L;if(K&&K.type==3)if(!(L=e.rtrim(K.value)))D.children.length=J-1;else K.value=L;}E.add(D);if(D.name=='pre')z=false;if(D.name=='textarea')y=false;if(D.returnPoint){x=D.returnPoint;delete D.returnPoint;}else x=F?E:G;};t.onTagOpen=function(D,E,F,G){var H=new a.htmlParser.element(D,E);if(H.isUnknown&&F)H.isEmpty=true;H.isOptionalClose=D in m||G;if(p(H)){v.push(H);return;}else if(D=='pre')z=true;
|
|
||||||
else if(D=='br'&&z){x.add(new a.htmlParser.text('\n'));return;}else if(D=='textarea')y=true;if(D=='br'){w.push(H);return;}while(1){var I=x.name,J=I?f[I]||(x._.isBlockLike?f.div:f.span):o;if(!H.isUnknown&&!x.isUnknown&&!J[D]){if(x.isOptionalClose)t.onTagClose(I);else if(D in n&&I in n){var K=x.children,L=K[K.length-1];if(!(L&&L.name=='li'))C(L=new a.htmlParser.element('li'),x);!H.returnPoint&&(H.returnPoint=x);x=L;}else if(D in f.$listItem&&I!=D)t.onTagOpen(D=='li'?'ul':'dl',{},0,1);else if(I in l&&I!=D){!H.returnPoint&&(H.returnPoint=x);x=x.parent;}else{if(I in f.$inline)v.unshift(x);if(x.parent)C(x,x.parent,1);else{H.isOrphan=1;break;}}}else break;}A(D);B();H.parent=x;if(H.isEmpty)C(H);else x=H;};t.onTagClose=function(D){for(var E=v.length-1;E>=0;E--){if(D==v[E].name){v.splice(E,1);return;}}var F=[],G=[],H=x;while(H!=u&&H.name!=D){if(!H._.isBlockLike)G.unshift(H);F.push(H);H=H.returnPoint||H.parent;}if(H!=u){for(E=0;E<F.length;E++){var I=F[E];C(I,I.parent);}x=H;if(H._.isBlockLike)B();C(H,H.parent);if(H==x)x=x.parent;v=v.concat(G);}if(D=='body')r=false;};t.onText=function(D){if((!x._.hasInlineStarted||w.length)&&!z&&!y){D=e.ltrim(D);if(D.length===0)return;}var E=x.name,F=E?f[E]||(x._.isBlockLike?f.div:f.span):o;if(!y&&!F['#']&&E in l){t.onTagOpen(E in n?'li':E=='dl'?'dd':E=='table'?'tr':E=='tr'?'td':'');t.onText(D);return;}B();A();if(r&&(!x.type||x.name=='body')&&e.trim(D))this.onTagOpen(r,{},0,1);if(!z&&!y)D=D.replace(/[\t\r\n ]{2,}|[\t\r\n]/g,' ');x.add(new a.htmlParser.text(D));};t.onCDATA=function(D){x.add(new a.htmlParser.cdata(D));};t.onComment=function(D){B();A();x.add(new a.htmlParser.comment(D));};t.parse(q);B(!c&&1);while(x!=u)C(x,x.parent,1);return u;};a.htmlParser.fragment.prototype={add:function(q,r){var t=this;isNaN(r)&&(r=t.children.length);var s=r>0?t.children[r-1]:null;if(s){if(q._.isBlockLike&&s.type==3){s.value=e.rtrim(s.value);if(s.value.length===0){t.children.pop();t.add(q);return;}}s.next=q;}q.previous=s;q.parent=t;t.children.splice(r,0,q);t._.hasInlineStarted=q.type==3||q.type==1&&!q._.isBlockLike;},writeHtml:function(q,r){var s;this.filterChildren=function(){var t=new a.htmlParser.basicWriter();this.writeChildrenHtml.call(this,t,r,true);var u=t.getHtml();this.children=new a.htmlParser.fragment.fromHtml(u).children;s=1;};!this.name&&r&&r.onFragment(this);this.writeChildrenHtml(q,s?null:r);},writeChildrenHtml:function(q,r){for(var s=0;s<this.children.length;s++)this.children[s].writeHtml(q,r);}};})();a.htmlParser.element=function(l,m){var q=this;
|
|
||||||
q.name=l;q.attributes=m||{};q.children=[];var n=l||'',o=n.match(/^cke:(.*)/);o&&(n=o[1]);var p=!!(f.$nonBodyContent[n]||f.$block[n]||f.$listItem[n]||f.$tableContent[n]||f.$nonEditable[n]||n=='br');q.isEmpty=!!f.$empty[l];q.isUnknown=!f[l];q._={isBlockLike:p,hasInlineStarted:q.isEmpty||!p};};a.htmlParser.cssStyle=function(){var l,m=arguments[0],n={};l=m instanceof a.htmlParser.element?m.attributes.style:m;(l||'').replace(/"/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(o,p,q){p=='font-family'&&(q=q.replace(/["']/g,''));n[p.toLowerCase()]=q;});return{rules:n,populate:function(o){var p=this.toString();if(p)o instanceof h?o.setAttribute('style',p):o instanceof a.htmlParser.element?o.attributes.style=p:o.style=p;},'toString':function(){var o=[];for(var p in n)n[p]&&o.push(p,':',n[p],';');return o.join('');}};};(function(){var l=function(m,n){m=m[0];n=n[0];return m<n?-1:m>n?1:0;};a.htmlParser.element.prototype={type:1,add:a.htmlParser.fragment.prototype.add,clone:function(){return new a.htmlParser.element(this.name,this.attributes);},writeHtml:function(m,n){var o=this.attributes,p=this,q=p.name,r,s,t,u;p.filterChildren=function(){if(!u){var B=new a.htmlParser.basicWriter();a.htmlParser.fragment.prototype.writeChildrenHtml.call(p,B,n);p.children=new a.htmlParser.fragment.fromHtml(B.getHtml(),0,p.clone()).children;u=1;}};if(n){for(;;){if(!(q=n.onElementName(q)))return;p.name=q;if(!(p=n.onElement(p)))return;p.parent=this.parent;if(p.name==q)break;if(p.type!=1){p.writeHtml(m,n);return;}q=p.name;if(!q){for(var v=0,w=this.children.length;v<w;v++)this.children[v].parent=p.parent;this.writeChildrenHtml.call(p,m,u?null:n);return;}}o=p.attributes;}m.openTag(q,o);var x=[];for(var y=0;y<2;y++)for(r in o){s=r;t=o[r];if(y==1)x.push([r,t]);else if(n){for(;;){if(!(s=n.onAttributeName(r))){delete o[r];break;}else if(s!=r){delete o[r];r=s;continue;}else break;}if(s)if((t=n.onAttribute(p,s,t))===false)delete o[s];else o[s]=t;}}if(m.sortAttributes)x.sort(l);var z=x.length;for(y=0;y<z;y++){var A=x[y];m.attribute(A[0],A[1]);}m.openTagClose(q,p.isEmpty);if(!p.isEmpty){this.writeChildrenHtml.call(p,m,u?null:n);m.closeTag(q);}},writeChildrenHtml:function(m,n){a.htmlParser.fragment.prototype.writeChildrenHtml.apply(this,arguments);}};})();(function(){a.htmlParser.filter=e.createClass({$:function(q){this._={elementNames:[],attributeNames:[],elements:{$length:0},attributes:{$length:0}};if(q)this.addRules(q,10);},proto:{addRules:function(q,r){var s=this;if(typeof r!='number')r=10;
|
|
||||||
m(s._.elementNames,q.elementNames,r);m(s._.attributeNames,q.attributeNames,r);n(s._.elements,q.elements,r);n(s._.attributes,q.attributes,r);s._.text=o(s._.text,q.text,r)||s._.text;s._.comment=o(s._.comment,q.comment,r)||s._.comment;s._.root=o(s._.root,q.root,r)||s._.root;},onElementName:function(q){return l(q,this._.elementNames);},onAttributeName:function(q){return l(q,this._.attributeNames);},onText:function(q){var r=this._.text;return r?r.filter(q):q;},onComment:function(q,r){var s=this._.comment;return s?s.filter(q,r):q;},onFragment:function(q){var r=this._.root;return r?r.filter(q):q;},onElement:function(q){var v=this;var r=[v._.elements['^'],v._.elements[q.name],v._.elements.$],s,t;for(var u=0;u<3;u++){s=r[u];if(s){t=s.filter(q,v);if(t===false)return null;if(t&&t!=q)return v.onNode(t);if(q.parent&&!q.name)break;}}return q;},onNode:function(q){var r=q.type;return r==1?this.onElement(q):r==3?new a.htmlParser.text(this.onText(q.value)):r==8?new a.htmlParser.comment(this.onComment(q.value)):null;},onAttribute:function(q,r,s){var t=this._.attributes[r];if(t){var u=t.filter(s,q,this);if(u===false)return false;if(typeof u!='undefined')return u;}return s;}}});function l(q,r){for(var s=0;q&&s<r.length;s++){var t=r[s];q=q.replace(t[0],t[1]);}return q;};function m(q,r,s){if(typeof r=='function')r=[r];var t,u,v=q.length,w=r&&r.length;if(w){for(t=0;t<v&&q[t].pri<s;t++){}for(u=w-1;u>=0;u--){var x=r[u];if(x){x.pri=s;q.splice(t,0,x);}}}};function n(q,r,s){if(r)for(var t in r){var u=q[t];q[t]=o(u,r[t],s);if(!u)q.$length++;}};function o(q,r,s){if(r){r.pri=s;if(q){if(!q.splice){if(q.pri>s)q=[r,q];else q=[q,r];q.filter=p;}else m(q,r,s);return q;}else{r.filter=r;return r;}}};function p(q){var r=q.type||q instanceof a.htmlParser.fragment;for(var s=0;s<this.length;s++){if(r)var t=q.type,u=q.name;var v=this[s],w=v.apply(window,arguments);if(w===false)return w;if(r){if(w&&(w.name!=u||w.type!=t))return w;}else if(typeof w!='string')return w;w!=undefined&&(q=w);}return q;};})();a.htmlParser.basicWriter=e.createClass({$:function(){this._={output:[]};},proto:{openTag:function(l,m){this._.output.push('<',l);},openTagClose:function(l,m){if(m)this._.output.push(' />');else this._.output.push('>');},attribute:function(l,m){if(typeof m=='string')m=e.htmlEncodeAttr(m);this._.output.push(' ',l,'="',m,'"');},closeTag:function(l){this._.output.push('</',l,'>');},text:function(l){this._.output.push(l);},comment:function(l){this._.output.push('<!--',l,'-->');},write:function(l){this._.output.push(l);
|
|
||||||
},reset:function(){this._.output=[];this._.indent=false;},getHtml:function(l){var m=this._.output.join('');if(l)this.reset();return m;}}});delete a.loadFullCore;a.instances={};a.document=new g(document);a.add=function(l){a.instances[l.name]=l;l.on('focus',function(){if(a.currentInstance!=l){a.currentInstance=l;a.fire('currentInstance');}});l.on('blur',function(){if(a.currentInstance==l){a.currentInstance=null;a.fire('currentInstance');}});};a.remove=function(l){delete a.instances[l.name];};a.on('instanceDestroyed',function(){if(e.isEmpty(this.instances))a.fire('reset');});a.TRISTATE_ON=1;a.TRISTATE_OFF=2;a.TRISTATE_DISABLED=0;d.comment=function(l,m){if(typeof l=='string')l=(m?m.$:document).createComment(l);d.domObject.call(this,l);};d.comment.prototype=new d.node();e.extend(d.comment.prototype,{type:8,getOuterHtml:function(){return '<!--'+this.$.nodeValue+'-->';}});(function(){var l={address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,dd:1,legend:1,caption:1},m={body:1,div:1,table:1,tbody:1,tr:1,td:1,th:1,form:1,fieldset:1},n=function(o){var p=o.getChildren();for(var q=0,r=p.count();q<r;q++){var s=p.getItem(q);if(s.type==1&&f.$block[s.getName()])return true;}return false;};d.elementPath=function(o){var u=this;var p=null,q=null,r=[],s=o;while(s){if(s.type==1){if(!u.lastElement)u.lastElement=s;var t=s.getName();if(!q){if(!p&&l[t])p=s;if(m[t])if(!p&&t=='div'&&!n(s))p=s;else q=s;}r.push(s);if(t=='body')break;}s=s.getParent();}u.block=p;u.blockLimit=q;u.elements=r;};})();d.elementPath.prototype={compare:function(l){var m=this.elements,n=l&&l.elements;if(!n||m.length!=n.length)return false;for(var o=0;o<m.length;o++){if(!m[o].equals(n[o]))return false;}return true;},contains:function(l){var m=this.elements;for(var n=0;n<m.length;n++){if(m[n].getName() in l)return m[n];}return null;}};d.text=function(l,m){if(typeof l=='string')l=(m?m.$:document).createTextNode(l);this.$=l;};d.text.prototype=new d.node();e.extend(d.text.prototype,{type:3,getLength:function(){return this.$.nodeValue.length;},getText:function(){return this.$.nodeValue;},setText:function(l){this.$.nodeValue=l;},split:function(l){var q=this;if(c&&l==q.getLength()){var m=q.getDocument().createText('');m.insertAfter(q);return m;}var n=q.getDocument(),o=new d.text(q.$.splitText(l),n);if(b.ie8){var p=new d.text('',n);p.insertAfter(o);p.remove();}return o;},substring:function(l,m){if(typeof m!='number')return this.$.nodeValue.substr(l);else return this.$.nodeValue.substring(l,m);}});
|
|
||||||
d.documentFragment=function(l){l=l||a.document;this.$=l.$.createDocumentFragment();};e.extend(d.documentFragment.prototype,h.prototype,{type:11,insertAfterNode:function(l){l=l.$;l.parentNode.insertBefore(this.$,l.nextSibling);}},true,{append:1,appendBogus:1,getFirst:1,getLast:1,appendTo:1,moveChildren:1,insertBefore:1,insertAfterNode:1,replace:1,trim:1,type:1,ltrim:1,rtrim:1,getDocument:1,getChildCount:1,getChild:1,getChildren:1});(function(){function l(s,t){var u=this.range;if(this._.end)return null;if(!this._.start){this._.start=1;if(u.collapsed){this.end();return null;}u.optimize();}var v,w=u.startContainer,x=u.endContainer,y=u.startOffset,z=u.endOffset,A,B=this.guard,C=this.type,D=s?'getPreviousSourceNode':'getNextSourceNode';if(!s&&!this._.guardLTR){var E=x.type==1?x:x.getParent(),F=x.type==1?x.getChild(z):x.getNext();this._.guardLTR=function(J,K){return(!K||!E.equals(J))&&(!F||!J.equals(F))&&(J.type!=1||!K||J.getName()!='body');};}if(s&&!this._.guardRTL){var G=w.type==1?w:w.getParent(),H=w.type==1?y?w.getChild(y-1):null:w.getPrevious();this._.guardRTL=function(J,K){return(!K||!G.equals(J))&&(!H||!J.equals(H))&&(J.type!=1||!K||J.getName()!='body');};}var I=s?this._.guardRTL:this._.guardLTR;if(B)A=function(J,K){if(I(J,K)===false)return false;return B(J,K);};else A=I;if(this.current)v=this.current[D](false,C,A);else{if(s){v=x;if(v.type==1)if(z>0)v=v.getChild(z-1);else v=A(v,true)===false?null:v.getPreviousSourceNode(true,C,A);}else{v=w;if(v.type==1)if(!(v=v.getChild(y)))v=A(w,true)===false?null:w.getNextSourceNode(true,C,A);}if(v&&A(v)===false)v=null;}while(v&&!this._.end){this.current=v;if(!this.evaluator||this.evaluator(v)!==false){if(!t)return v;}else if(t&&this.evaluator)return false;v=v[D](false,C,A);}this.end();return this.current=null;};function m(s){var t,u=null;while(t=l.call(this,s))u=t;return u;};d.walker=e.createClass({$:function(s){this.range=s;this._={};},proto:{end:function(){this._.end=1;},next:function(){return l.call(this);},previous:function(){return l.call(this,1);},checkForward:function(){return l.call(this,0,1)!==false;},checkBackward:function(){return l.call(this,1,1)!==false;},lastForward:function(){return m.call(this);},lastBackward:function(){return m.call(this,1);},reset:function(){delete this.current;this._={};}}});var n={block:1,'list-item':1,table:1,'table-row-group':1,'table-header-group':1,'table-footer-group':1,'table-row':1,'table-column-group':1,'table-column':1,'table-cell':1,'table-caption':1};h.prototype.isBlockBoundary=function(s){var t=s?e.extend({},f.$block,s||{}):f.$block;
|
|
||||||
return this.getComputedStyle('float')=='none'&&n[this.getComputedStyle('display')]||t[this.getName()];};d.walker.blockBoundary=function(s){return function(t,u){return!(t.type==1&&t.isBlockBoundary(s));};};d.walker.listItemBoundary=function(){return this.blockBoundary({br:1});};d.walker.bookmark=function(s,t){function u(v){return v&&v.getName&&v.getName()=='span'&&v.data('cke-bookmark');};return function(v){var w,x;w=v&&!v.getName&&(x=v.getParent())&&u(x);w=s?w:w||u(v);return!!(t^w);};};d.walker.whitespaces=function(s){return function(t){var u;if(t&&t.type==3)u=!e.trim(t.getText())||b.webkit&&t.getText()=='';return!!(s^u);};};d.walker.invisible=function(s){var t=d.walker.whitespaces();return function(u){var v;if(t(u))v=1;else{if(u.type==3)u=u.getParent();v=!u.$.offsetHeight;}return!!(s^v);};};d.walker.nodeType=function(s,t){return function(u){return!!(t^u.type==s);};};d.walker.bogus=function(s){function t(u){return!p(u)&&!q(u);};return function(u){var v=!c?u.is&&u.is('br'):u.getText&&o.test(u.getText());if(v){var w=u.getParent(),x=u.getNext(t);v=w.isBlockBoundary()&&(!x||x.type==1&&x.isBlockBoundary());}return!!(s^v);};};var o=/^[\t\r\n ]*(?: |\xa0)$/,p=d.walker.whitespaces(),q=d.walker.bookmark(),r=function(s){return q(s)||p(s)||s.type==1&&s.getName() in f.$inline&&!(s.getName() in f.$empty);};h.prototype.getBogus=function(){var s=this;do s=s.getPreviousSourceNode();while(r(s));if(s&&(!c?s.is&&s.is('br'):s.getText&&o.test(s.getText())))return s;return false;};})();d.range=function(l){var m=this;m.startContainer=null;m.startOffset=null;m.endContainer=null;m.endOffset=null;m.collapsed=true;m.document=l;};(function(){var l=function(v){v.collapsed=v.startContainer&&v.endContainer&&v.startContainer.equals(v.endContainer)&&v.startOffset==v.endOffset;},m=function(v,w,x,y){v.optimizeBookmark();var z=v.startContainer,A=v.endContainer,B=v.startOffset,C=v.endOffset,D,E;if(A.type==3)A=A.split(C);else if(A.getChildCount()>0)if(C>=A.getChildCount()){A=A.append(v.document.createText(''));E=true;}else A=A.getChild(C);if(z.type==3){z.split(B);if(z.equals(A))A=z.getNext();}else if(!B){z=z.getFirst().insertBeforeMe(v.document.createText(''));D=true;}else if(B>=z.getChildCount()){z=z.append(v.document.createText(''));D=true;}else z=z.getChild(B).getPrevious();var F=z.getParents(),G=A.getParents(),H,I,J;for(H=0;H<F.length;H++){I=F[H];J=G[H];if(!I.equals(J))break;}var K=x,L,M,N,O;for(var P=H;P<F.length;P++){L=F[P];if(K&&!L.equals(z))M=K.append(L.clone());N=L.getNext();while(N){if(N.equals(G[P])||N.equals(A))break;
|
|
||||||
O=N.getNext();if(w==2)K.append(N.clone(true));else{N.remove();if(w==1)K.append(N);}N=O;}if(K)K=M;}K=x;for(var Q=H;Q<G.length;Q++){L=G[Q];if(w>0&&!L.equals(A))M=K.append(L.clone());if(!F[Q]||L.$.parentNode!=F[Q].$.parentNode){N=L.getPrevious();while(N){if(N.equals(F[Q])||N.equals(z))break;O=N.getPrevious();if(w==2)K.$.insertBefore(N.$.cloneNode(true),K.$.firstChild);else{N.remove();if(w==1)K.$.insertBefore(N.$,K.$.firstChild);}N=O;}}if(K)K=M;}if(w==2){var R=v.startContainer;if(R.type==3){R.$.data+=R.$.nextSibling.data;R.$.parentNode.removeChild(R.$.nextSibling);}var S=v.endContainer;if(S.type==3&&S.$.nextSibling){S.$.data+=S.$.nextSibling.data;S.$.parentNode.removeChild(S.$.nextSibling);}}else{if(I&&J&&(z.$.parentNode!=I.$.parentNode||A.$.parentNode!=J.$.parentNode)){var T=J.getIndex();if(D&&J.$.parentNode==z.$.parentNode)T--;if(y&&I.type==1){var U=h.createFromHtml('<span data-cke-bookmark="1" style="display:none"> </span>',v.document);U.insertAfter(I);I.mergeSiblings(false);v.moveToBookmark({startNode:U});}else v.setStart(J.getParent(),T);}v.collapse(true);}if(D)z.remove();if(E&&A.$.parentNode)A.remove();},n={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1};function o(){var v=false,w=d.walker.whitespaces(),x=d.walker.bookmark(true),y=d.walker.bogus();return function(z){if(x(z)||w(z))return true;if(y(z)&&!v){v=true;return true;}if(z.type==3&&(z.hasAscendant('pre')||e.trim(z.getText()).length))return false;if(z.type==1&&!n[z.getName()])return false;return true;};};var p=d.walker.bogus();function q(v){var w=d.walker.whitespaces(),x=d.walker.bookmark(1);return function(y){if(x(y)||w(y))return true;return!v&&p(y)||y.type==1&&y.getName() in f.$removeEmpty;};};var r=new d.walker.whitespaces(),s=new d.walker.bookmark(),t=/^[\t\r\n ]*(?: |\xa0)$/;function u(v){return!r(v)&&!s(v);};d.range.prototype={clone:function(){var w=this;var v=new d.range(w.document);v.startContainer=w.startContainer;v.startOffset=w.startOffset;v.endContainer=w.endContainer;v.endOffset=w.endOffset;v.collapsed=w.collapsed;return v;},collapse:function(v){var w=this;if(v){w.endContainer=w.startContainer;w.endOffset=w.startOffset;}else{w.startContainer=w.endContainer;w.startOffset=w.endOffset;}w.collapsed=true;},cloneContents:function(){var v=new d.documentFragment(this.document);if(!this.collapsed)m(this,2,v);return v;},deleteContents:function(v){if(this.collapsed)return;
|
|
||||||
m(this,0,null,v);},extractContents:function(v){var w=new d.documentFragment(this.document);if(!this.collapsed)m(this,1,w,v);return w;},createBookmark:function(v){var B=this;var w,x,y,z,A=B.collapsed;w=B.document.createElement('span');w.data('cke-bookmark',1);w.setStyle('display','none');w.setHtml(' ');if(v){y='cke_bm_'+e.getNextNumber();w.setAttribute('id',y+(A?'C':'S'));}if(!A){x=w.clone();x.setHtml(' ');if(v)x.setAttribute('id',y+'E');z=B.clone();z.collapse();z.insertNode(x);}z=B.clone();z.collapse(true);z.insertNode(w);if(x){B.setStartAfter(w);B.setEndBefore(x);}else B.moveToPosition(w,4);return{startNode:v?y+(A?'C':'S'):w,endNode:v?y+'E':x,serializable:v,collapsed:A};},createBookmark2:function(v){var D=this;var w=D.startContainer,x=D.endContainer,y=D.startOffset,z=D.endOffset,A=D.collapsed,B,C;if(!w||!x)return{start:0,end:0};if(v){if(w.type==1){B=w.getChild(y);if(B&&B.type==3&&y>0&&B.getPrevious().type==3){w=B;y=0;}if(B&&B.type==1)y=B.getIndex(1);}while(w.type==3&&(C=w.getPrevious())&&C.type==3){w=C;y+=C.getLength();}if(!A){if(x.type==1){B=x.getChild(z);if(B&&B.type==3&&z>0&&B.getPrevious().type==3){x=B;z=0;}if(B&&B.type==1)z=B.getIndex(1);}while(x.type==3&&(C=x.getPrevious())&&C.type==3){x=C;z+=C.getLength();}}}return{start:w.getAddress(v),end:A?null:x.getAddress(v),startOffset:y,endOffset:z,normalized:v,collapsed:A,is2:true};},moveToBookmark:function(v){var D=this;if(v.is2){var w=D.document.getByAddress(v.start,v.normalized),x=v.startOffset,y=v.end&&D.document.getByAddress(v.end,v.normalized),z=v.endOffset;D.setStart(w,x);if(y)D.setEnd(y,z);else D.collapse(true);}else{var A=v.serializable,B=A?D.document.getById(v.startNode):v.startNode,C=A?D.document.getById(v.endNode):v.endNode;D.setStartBefore(B);B.remove();if(C){D.setEndBefore(C);C.remove();}else D.collapse(true);}},getBoundaryNodes:function(){var A=this;var v=A.startContainer,w=A.endContainer,x=A.startOffset,y=A.endOffset,z;if(v.type==1){z=v.getChildCount();if(z>x)v=v.getChild(x);else if(z<1)v=v.getPreviousSourceNode();else{v=v.$;while(v.lastChild)v=v.lastChild;v=new d.node(v);v=v.getNextSourceNode()||v;}}if(w.type==1){z=w.getChildCount();if(z>y)w=w.getChild(y).getPreviousSourceNode(true);else if(z<1)w=w.getPreviousSourceNode();else{w=w.$;while(w.lastChild)w=w.lastChild;w=new d.node(w);}}if(v.getPosition(w)&2)v=w;return{startNode:v,endNode:w};},getCommonAncestor:function(v,w){var A=this;var x=A.startContainer,y=A.endContainer,z;if(x.equals(y)){if(v&&x.type==1&&A.startOffset==A.endOffset-1)z=x.getChild(A.startOffset);
|
|
||||||
else z=x;}else z=x.getCommonAncestor(y);return w&&!z.is?z.getParent():z;},optimize:function(){var x=this;var v=x.startContainer,w=x.startOffset;if(v.type!=1)if(!w)x.setStartBefore(v);else if(w>=v.getLength())x.setStartAfter(v);v=x.endContainer;w=x.endOffset;if(v.type!=1)if(!w)x.setEndBefore(v);else if(w>=v.getLength())x.setEndAfter(v);},optimizeBookmark:function(){var x=this;var v=x.startContainer,w=x.endContainer;if(v.is&&v.is('span')&&v.data('cke-bookmark'))x.setStartAt(v,3);if(w&&w.is&&w.is('span')&&w.data('cke-bookmark'))x.setEndAt(w,4);},trim:function(v,w){var D=this;var x=D.startContainer,y=D.startOffset,z=D.collapsed;if((!v||z)&&x&&x.type==3){if(!y){y=x.getIndex();x=x.getParent();}else if(y>=x.getLength()){y=x.getIndex()+1;x=x.getParent();}else{var A=x.split(y);y=x.getIndex()+1;x=x.getParent();if(D.startContainer.equals(D.endContainer))D.setEnd(A,D.endOffset-D.startOffset);else if(x.equals(D.endContainer))D.endOffset+=1;}D.setStart(x,y);if(z){D.collapse(true);return;}}var B=D.endContainer,C=D.endOffset;if(!(w||z)&&B&&B.type==3){if(!C){C=B.getIndex();B=B.getParent();}else if(C>=B.getLength()){C=B.getIndex()+1;B=B.getParent();}else{B.split(C);C=B.getIndex()+1;B=B.getParent();}D.setEnd(B,C);}},enlarge:function(v,w){switch(v){case 1:if(this.collapsed)return;var x=this.getCommonAncestor(),y=this.document.getBody(),z,A,B,C,D,E=false,F,G,H=this.startContainer,I=this.startOffset;if(H.type==3){if(I){H=!e.trim(H.substring(0,I)).length&&H;E=!!H;}if(H)if(!(C=H.getPrevious()))B=H.getParent();}else{if(I)C=H.getChild(I-1)||H.getLast();if(!C)B=H;}while(B||C){if(B&&!C){if(!D&&B.equals(x))D=true;if(!y.contains(B))break;if(!E||B.getComputedStyle('display')!='inline'){E=false;if(D)z=B;else this.setStartBefore(B);}C=B.getPrevious();}while(C){F=false;if(C.type==8){C=C.getPrevious();continue;}else if(C.type==3){G=C.getText();if(/[^\s\ufeff]/.test(G))C=null;F=/[\s\ufeff]$/.test(G);}else if((C.$.offsetWidth>0||w&&C.is('br'))&&!C.data('cke-bookmark'))if(E&&f.$removeEmpty[C.getName()]){G=C.getText();if(/[^\s\ufeff]/.test(G))C=null;else{var J=C.$.getElementsByTagName('*');for(var K=0,L;L=J[K++];){if(!f.$removeEmpty[L.nodeName.toLowerCase()]){C=null;break;}}}if(C)F=!!G.length;}else C=null;if(F)if(E){if(D)z=B;else if(B)this.setStartBefore(B);}else E=true;if(C){var M=C.getPrevious();if(!B&&!M){B=C;C=null;break;}C=M;}else B=null;}if(B)B=B.getParent();}H=this.endContainer;I=this.endOffset;B=C=null;D=E=false;if(H.type==3){H=!e.trim(H.substring(I)).length&&H;E=!(H&&H.getLength());if(H)if(!(C=H.getNext()))B=H.getParent();
|
|
||||||
}else{C=H.getChild(I);if(!C)B=H;}while(B||C){if(B&&!C){if(!D&&B.equals(x))D=true;if(!y.contains(B))break;if(!E||B.getComputedStyle('display')!='inline'){E=false;if(D)A=B;else if(B)this.setEndAfter(B);}C=B.getNext();}while(C){F=false;if(C.type==3){G=C.getText();if(/[^\s\ufeff]/.test(G))C=null;F=/^[\s\ufeff]/.test(G);}else if(C.type==1){if((C.$.offsetWidth>0||w&&C.is('br'))&&!C.data('cke-bookmark'))if(E&&f.$removeEmpty[C.getName()]){G=C.getText();if(/[^\s\ufeff]/.test(G))C=null;else{J=C.$.getElementsByTagName('*');for(K=0;L=J[K++];){if(!f.$removeEmpty[L.nodeName.toLowerCase()]){C=null;break;}}}if(C)F=!!G.length;}else C=null;}else F=1;if(F)if(E)if(D)A=B;else this.setEndAfter(B);if(C){M=C.getNext();if(!B&&!M){B=C;C=null;break;}C=M;}else B=null;}if(B)B=B.getParent();}if(z&&A){x=z.contains(A)?A:z;this.setStartBefore(x);this.setEndAfter(x);}break;case 2:case 3:var N=new d.range(this.document);y=this.document.getBody();N.setStartAt(y,1);N.setEnd(this.startContainer,this.startOffset);var O=new d.walker(N),P,Q,R=d.walker.blockBoundary(v==3?{br:1}:null),S=function(Y){var Z=R(Y);if(!Z)P=Y;return Z;},T=function(Y){var Z=S(Y);if(!Z&&Y.is&&Y.is('br'))Q=Y;return Z;};O.guard=S;B=O.lastBackward();P=P||y;this.setStartAt(P,!P.is('br')&&(!B&&this.checkStartOfBlock()||B&&P.contains(B))?1:4);if(v==3){var U=this.clone();O=new d.walker(U);var V=d.walker.whitespaces(),W=d.walker.bookmark();O.evaluator=function(Y){return!V(Y)&&!W(Y);};var X=O.previous();if(X&&X.type==1&&X.is('br'))return;}N=this.clone();N.collapse();N.setEndAt(y,2);O=new d.walker(N);O.guard=v==3?T:S;P=null;B=O.lastForward();P=P||y;this.setEndAt(P,!B&&this.checkEndOfBlock()||B&&P.contains(B)?2:3);if(Q)this.setEndAfter(Q);}},shrink:function(v,w){if(!this.collapsed){v=v||2;var x=this.clone(),y=this.startContainer,z=this.endContainer,A=this.startOffset,B=this.endOffset,C=this.collapsed,D=1,E=1;if(y&&y.type==3)if(!A)x.setStartBefore(y);else if(A>=y.getLength())x.setStartAfter(y);else{x.setStartBefore(y);D=0;}if(z&&z.type==3)if(!B)x.setEndBefore(z);else if(B>=z.getLength())x.setEndAfter(z);else{x.setEndAfter(z);E=0;}var F=new d.walker(x),G=d.walker.bookmark();F.evaluator=function(K){return K.type==(v==1?1:3);};var H;F.guard=function(K,L){if(G(K))return true;if(v==1&&K.type==3)return false;if(L&&K.equals(H))return false;if(!L&&K.type==1)H=K;return true;};if(D){var I=F[v==1?'lastForward':'next']();I&&this.setStartAt(I,w?1:3);}if(E){F.reset();var J=F[v==1?'lastBackward':'previous']();J&&this.setEndAt(J,w?2:4);}return!!(D||E);
|
|
||||||
}},insertNode:function(v){var z=this;z.optimizeBookmark();z.trim(false,true);var w=z.startContainer,x=z.startOffset,y=w.getChild(x);if(y)v.insertBefore(y);else w.append(v);if(v.getParent().equals(z.endContainer))z.endOffset++;z.setStartBefore(v);},moveToPosition:function(v,w){this.setStartAt(v,w);this.collapse(true);},selectNodeContents:function(v){this.setStart(v,0);this.setEnd(v,v.type==3?v.getLength():v.getChildCount());},setStart:function(v,w){var x=this;if(v.type==1&&f.$empty[v.getName()])w=v.getIndex(),v=v.getParent();x.startContainer=v;x.startOffset=w;if(!x.endContainer){x.endContainer=v;x.endOffset=w;}l(x);},setEnd:function(v,w){var x=this;if(v.type==1&&f.$empty[v.getName()])w=v.getIndex()+1,v=v.getParent();x.endContainer=v;x.endOffset=w;if(!x.startContainer){x.startContainer=v;x.startOffset=w;}l(x);},setStartAfter:function(v){this.setStart(v.getParent(),v.getIndex()+1);},setStartBefore:function(v){this.setStart(v.getParent(),v.getIndex());},setEndAfter:function(v){this.setEnd(v.getParent(),v.getIndex()+1);},setEndBefore:function(v){this.setEnd(v.getParent(),v.getIndex());},setStartAt:function(v,w){var x=this;switch(w){case 1:x.setStart(v,0);break;case 2:if(v.type==3)x.setStart(v,v.getLength());else x.setStart(v,v.getChildCount());break;case 3:x.setStartBefore(v);break;case 4:x.setStartAfter(v);}l(x);},setEndAt:function(v,w){var x=this;switch(w){case 1:x.setEnd(v,0);break;case 2:if(v.type==3)x.setEnd(v,v.getLength());else x.setEnd(v,v.getChildCount());break;case 3:x.setEndBefore(v);break;case 4:x.setEndAfter(v);}l(x);},fixBlock:function(v,w){var z=this;var x=z.createBookmark(),y=z.document.createElement(w);z.collapse(v);z.enlarge(2);z.extractContents().appendTo(y);y.trim();if(!c)y.appendBogus();z.insertNode(y);z.moveToBookmark(x);return y;},splitBlock:function(v){var F=this;var w=new d.elementPath(F.startContainer),x=new d.elementPath(F.endContainer),y=w.blockLimit,z=x.blockLimit,A=w.block,B=x.block,C=null;if(!y.equals(z))return null;if(v!='br'){if(!A){A=F.fixBlock(true,v);B=new d.elementPath(F.endContainer).block;}if(!B)B=F.fixBlock(false,v);}var D=A&&F.checkStartOfBlock(),E=B&&F.checkEndOfBlock();F.deleteContents();if(A&&A.equals(B))if(E){C=new d.elementPath(F.startContainer);F.moveToPosition(B,4);B=null;}else if(D){C=new d.elementPath(F.startContainer);F.moveToPosition(A,3);A=null;}else{B=F.splitElement(A);if(!c&&!A.is('ul','ol'))A.appendBogus();}return{previousBlock:A,nextBlock:B,wasStartOfBlock:D,wasEndOfBlock:E,elementPath:C};},splitElement:function(v){var y=this;
|
|
||||||
if(!y.collapsed)return null;y.setEndAt(v,2);var w=y.extractContents(),x=v.clone(false);w.appendTo(x);x.insertAfter(v);y.moveToPosition(v,4);return x;},checkBoundaryOfElement:function(v,w){var x=w==1,y=this.clone();y.collapse(x);y[x?'setStartAt':'setEndAt'](v,x?1:2);var z=new d.walker(y);z.evaluator=q(x);return z[x?'checkBackward':'checkForward']();},checkStartOfBlock:function(){var B=this;var v=B.startContainer,w=B.startOffset;if(c&&w&&v.type==3){var x=e.ltrim(v.substring(0,w));if(t.test(x))B.trim(0,1);}var y=new d.elementPath(B.startContainer),z=B.clone();z.collapse(true);z.setStartAt(y.block||y.blockLimit,1);var A=new d.walker(z);A.evaluator=o();return A.checkBackward();},checkEndOfBlock:function(){var B=this;var v=B.endContainer,w=B.endOffset;if(c&&v.type==3){var x=e.rtrim(v.substring(w));if(t.test(x))B.trim(1,0);}var y=new d.elementPath(B.endContainer),z=B.clone();z.collapse(false);z.setEndAt(y.block||y.blockLimit,2);var A=new d.walker(z);A.evaluator=o();return A.checkForward();},getPreviousNode:function(v,w,x){var y=this.clone();y.collapse(1);y.setStartAt(x||this.document.getBody(),1);var z=new d.walker(y);z.evaluator=v;z.guard=w;return z.previous();},getNextNode:function(v,w,x){var y=this.clone();y.collapse();y.setEndAt(x||this.document.getBody(),2);var z=new d.walker(y);z.evaluator=v;z.guard=w;return z.next();},checkReadOnly:(function(){function v(w,x){while(w){if(w.type==1)if(w.getAttribute('contentEditable')=='false'&&!w.data('cke-editable'))return 0;else if(w.is('html')||w.getAttribute('contentEditable')=='true'&&(w.contains(x)||w.equals(x)))break;w=w.getParent();}return 1;};return function(){var w=this.startContainer,x=this.endContainer;return!(v(w,x)&&v(x,w));};})(),moveToElementEditablePosition:function(v,w){function x(z,A){var B;if(z.type==1&&z.isEditable(false))B=z[w?'getLast':'getFirst'](u);if(!A&&!B)B=z[w?'getPrevious':'getNext'](u);return B;};if(v.type==1&&!v.isEditable(false)){this.moveToPosition(v,w?4:3);return true;}var y=0;while(v){if(v.type==3){if(w&&this.checkEndOfBlock()&&t.test(v.getText()))this.moveToPosition(v,3);else this.moveToPosition(v,w?4:3);y=1;break;}if(v.type==1)if(v.isEditable()){this.moveToPosition(v,w?2:1);y=1;}else if(w&&v.is('br')&&this.checkEndOfBlock())this.moveToPosition(v,3);v=x(v,y);}return!!y;},moveToElementEditStart:function(v){return this.moveToElementEditablePosition(v);},moveToElementEditEnd:function(v){return this.moveToElementEditablePosition(v,true);},getEnclosedNode:function(){var v=this.clone();v.optimize();
|
|
||||||
if(v.startContainer.type!=1||v.endContainer.type!=1)return null;var w=new d.walker(v),x=d.walker.bookmark(true),y=d.walker.whitespaces(true),z=function(B){return y(B)&&x(B);};v.evaluator=z;var A=w.next();w.reset();return A&&A.equals(w.previous())?A:null;},getTouchedStartNode:function(){var v=this.startContainer;if(this.collapsed||v.type!=1)return v;return v.getChild(this.startOffset)||v;},getTouchedEndNode:function(){var v=this.endContainer;if(this.collapsed||v.type!=1)return v;return v.getChild(this.endOffset-1)||v;}};})();a.POSITION_AFTER_START=1;a.POSITION_BEFORE_END=2;a.POSITION_BEFORE_START=3;a.POSITION_AFTER_END=4;a.ENLARGE_ELEMENT=1;a.ENLARGE_BLOCK_CONTENTS=2;a.ENLARGE_LIST_ITEM_CONTENTS=3;a.START=1;a.END=2;a.STARTEND=3;a.SHRINK_ELEMENT=1;a.SHRINK_TEXT=2;(function(){d.rangeList=function(n){if(n instanceof d.rangeList)return n;if(!n)n=[];else if(n instanceof d.range)n=[n];return e.extend(n,l);};var l={createIterator:function(){var n=this,o=d.walker.bookmark(),p=function(s){return!(s.is&&s.is('tr'));},q=[],r;return{getNextRange:function(s){r=r==undefined?0:r+1;var t=n[r];if(t&&n.length>1){if(!r)for(var u=n.length-1;u>=0;u--)q.unshift(n[u].createBookmark(true));if(s){var v=0;while(n[r+v+1]){var w=t.document,x=0,y=w.getById(q[v].endNode),z=w.getById(q[v+1].startNode),A;while(1){A=y.getNextSourceNode(false);if(!z.equals(A)){if(o(A)||A.type==1&&A.isBlockBoundary()){y=A;continue;}}else x=1;break;}if(!x)break;v++;}}t.moveToBookmark(q.shift());while(v--){A=n[++r];A.moveToBookmark(q.shift());t.setEnd(A.endContainer,A.endOffset);}}return t;}};},createBookmarks:function(n){var s=this;var o=[],p;for(var q=0;q<s.length;q++){o.push(p=s[q].createBookmark(n,true));for(var r=q+1;r<s.length;r++){s[r]=m(p,s[r]);s[r]=m(p,s[r],true);}}return o;},createBookmarks2:function(n){var o=[];for(var p=0;p<this.length;p++)o.push(this[p].createBookmark2(n));return o;},moveToBookmarks:function(n){for(var o=0;o<this.length;o++)this[o].moveToBookmark(n[o]);}};function m(n,o,p){var q=n.serializable,r=o[p?'endContainer':'startContainer'],s=p?'endOffset':'startOffset',t=q?o.document.getById(n.startNode):n.startNode,u=q?o.document.getById(n.endNode):n.endNode;if(r.equals(t.getPrevious())){o.startOffset=o.startOffset-r.getLength()-u.getPrevious().getLength();r=u.getNext();}else if(r.equals(u.getPrevious())){o.startOffset=o.startOffset-r.getLength();r=u.getNext();}r.equals(t.getParent())&&o[s]++;r.equals(u.getParent())&&o[s]++;o[p?'endContainer':'startContainer']=r;return o;};})();(function(){if(b.webkit){b.hc=false;
|
|
||||||
return;}var l=h.createFromHtml('<div style="width:0px;height:0px;position:absolute;left:-10000px;border: 1px solid;border-color: red blue;"></div>',a.document);l.appendTo(a.document.getHead());try{b.hc=l.getComputedStyle('border-top-color')==l.getComputedStyle('border-right-color');}catch(m){b.hc=false;}if(b.hc)b.cssClass+=' cke_hc';l.remove();})();j.load(i.corePlugins.split(','),function(){a.status='loaded';a.fire('loaded');var l=a._.pending;if(l){delete a._.pending;for(var m=0;m<l.length;m++)a.add(l[m]);}});if(c)try{document.execCommand('BackgroundImageCache',false,true);}catch(l){}a.skins.add('kama',(function(){var m='cke_ui_color';return{editor:{css:['editor.css']},dialog:{css:['dialog.css']},richcombo:{canGroup:false},templates:{css:['templates.css']},margins:[0,0,0,0],init:function(n){if(n.config.width&&!isNaN(n.config.width))n.config.width-=12;var o=[],p=/\$color/g,q='/* UI Color Support */.cke_skin_kama .cke_menuitem .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:focus .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:active .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover .cke_label,.cke_skin_kama .cke_menuitem a:focus .cke_label,.cke_skin_kama .cke_menuitem a:active .cke_label{\tbackground-color: $color !important;}.cke_skin_kama .cke_menuitem a.cke_disabled:hover .cke_label,.cke_skin_kama .cke_menuitem a.cke_disabled:focus .cke_label,.cke_skin_kama .cke_menuitem a.cke_disabled:active .cke_label{\tbackground-color: transparent !important;}.cke_skin_kama .cke_menuitem a.cke_disabled:hover .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a.cke_disabled:focus .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a.cke_disabled:active .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a.cke_disabled .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuseparator{\tbackground-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover,.cke_skin_kama .cke_menuitem a:focus,.cke_skin_kama .cke_menuitem a:active{\tbackground-color: $color !important;}';if(b.webkit){q=q.split('}').slice(0,-1);for(var r=0;r<q.length;r++)q[r]=q[r].split('{');}function s(v){var w=v.getById(m);if(!w){w=v.getHead().append('style');w.setAttribute('id',m);
|
|
||||||
w.setAttribute('type','text/css');}return w;};function t(v,w,x){var y,z,A;for(var B=0;B<v.length;B++){if(b.webkit)for(z=0;z<w.length;z++){A=w[z][1];for(y=0;y<x.length;y++)A=A.replace(x[y][0],x[y][1]);v[B].$.sheet.addRule(w[z][0],A);}else{A=w;for(y=0;y<x.length;y++)A=A.replace(x[y][0],x[y][1]);if(c)v[B].$.styleSheet.cssText+=A;else v[B].$.innerHTML+=A;}}};var u=/\$color/g;e.extend(n,{uiColor:null,getUiColor:function(){return this.uiColor;},setUiColor:function(v){var w,x=s(a.document),y='.'+n.id,z=[y+' .cke_wrapper',y+'_dialog .cke_dialog_contents',y+'_dialog a.cke_dialog_tab',y+'_dialog .cke_dialog_footer'].join(','),A='background-color: $color !important;';if(b.webkit)w=[[z,A]];else w=z+'{'+A+'}';return(this.setUiColor=function(B){var C=[[u,B]];n.uiColor=B;t([x],w,C);t(o,q,C);})(v);}});n.on('menuShow',function(v){var w=v.data[0],x=w.element.getElementsByTag('iframe').getItem(0).getFrameDocument();if(!x.getById('cke_ui_color')){var y=s(x);o.push(y);var z=n.getUiColor();if(z)t([y],q,[[u,z]]);}});if(n.config.uiColor)n.setUiColor(n.config.uiColor);}};})());(function(){a.dialog?m():a.on('dialogPluginReady',m);function m(){a.dialog.on('resize',function(n){var o=n.data,p=o.width,q=o.height,r=o.dialog,s=r.parts.contents;if(o.skin!='kama')return;s.setStyles({width:p+'px',height:q+'px'});});};})();j.add('about',{requires:['dialog'],init:function(m){var n=m.addCommand('about',new a.dialogCommand('about'));n.modes={wysiwyg:1,source:1};n.canUndo=false;n.readOnly=1;m.ui.addButton('About',{label:m.lang.about.title,command:'about'});a.dialog.add('about',this.path+'dialogs/about.js');}});(function(){var m='a11yhelp',n='a11yHelp';j.add(m,{requires:['dialog'],availableLangs:{cs:1,cy:1,da:1,de:1,el:1,en:1,eo:1,fa:1,fi:1,fr:1,gu:1,he:1,it:1,ku:1,mk:1,nb:1,nl:1,no:1,'pt-br':1,ro:1,tr:1,ug:1,vi:1,'zh-cn':1},init:function(o){var p=this;o.addCommand(n,{exec:function(){var q=o.langCode;q=p.availableLangs[q]?q:'en';a.scriptLoader.load(a.getUrl(p.path+'lang/'+q+'.js'),function(){e.extend(o.lang,p.langEntries[q]);o.openDialog(n);});},modes:{wysiwyg:1,source:1},readOnly:1,canUndo:false});a.dialog.add(n,this.path+'dialogs/a11yhelp.js');}});})();j.add('basicstyles',{requires:['styles','button'],init:function(m){var n=function(q,r,s,t){var u=new a.style(t);m.attachStyleStateChange(u,function(v){!m.readOnly&&m.getCommand(s).setState(v);});m.addCommand(s,new a.styleCommand(u));m.ui.addButton(q,{label:r,command:s});},o=m.config,p=m.lang;n('Bold',p.bold,'bold',o.coreStyles_bold);n('Italic',p.italic,'italic',o.coreStyles_italic);
|
|
||||||
n('Underline',p.underline,'underline',o.coreStyles_underline);n('Strike',p.strike,'strike',o.coreStyles_strike);n('Subscript',p.subscript,'subscript',o.coreStyles_subscript);n('Superscript',p.superscript,'superscript',o.coreStyles_superscript);}});i.coreStyles_bold={element:'strong',overrides:'b'};i.coreStyles_italic={element:'em',overrides:'i'};i.coreStyles_underline={element:'u'};i.coreStyles_strike={element:'strike'};i.coreStyles_subscript={element:'sub'};i.coreStyles_superscript={element:'sup'};(function(){var m={table:1,ul:1,ol:1,blockquote:1,div:1},n={},o={};e.extend(n,m,{tr:1,p:1,div:1,li:1});e.extend(o,n,{td:1});function p(B){q(B);r(B);};function q(B){var C=B.editor,D=B.data.path;if(C.readOnly)return;var E=C.config.useComputedState,F;E=E===undefined||E;if(!E)F=s(D.lastElement);F=F||D.block||D.blockLimit;if(F.is('body')){var G=C.getSelection().getRanges()[0].getEnclosedNode();G&&G.type==1&&(F=G);}if(!F)return;var H=E?F.getComputedStyle('direction'):F.getStyle('direction')||F.getAttribute('dir');C.getCommand('bidirtl').setState(H=='rtl'?1:2);C.getCommand('bidiltr').setState(H=='ltr'?1:2);};function r(B){var C=B.editor,D=B.data.path.block||B.data.path.blockLimit;C.fire('contentDirChanged',D?D.getComputedStyle('direction'):C.lang.dir);};function s(B){while(B&&!(B.getName() in o||B.is('body'))){var C=B.getParent();if(!C)break;B=C;}return B;};function t(B,C,D,E){if(B.isReadOnly())return;h.setMarker(E,B,'bidi_processed',1);var F=B;while((F=F.getParent())&&!F.is('body')){if(F.getCustomData('bidi_processed')){B.removeStyle('direction');B.removeAttribute('dir');return;}}var G='useComputedState' in D.config?D.config.useComputedState:1,H=G?B.getComputedStyle('direction'):B.getStyle('direction')||B.hasAttribute('dir');if(H==C)return;B.removeStyle('direction');if(G){B.removeAttribute('dir');if(C!=B.getComputedStyle('direction'))B.setAttribute('dir',C);}else B.setAttribute('dir',C);D.forceNextSelectionCheck();};function u(B,C,D){var E=B.getCommonAncestor(false,true);B=B.clone();B.enlarge(D==2?3:2);if(B.checkBoundaryOfElement(E,1)&&B.checkBoundaryOfElement(E,2)){var F;while(E&&E.type==1&&(F=E.getParent())&&F.getChildCount()==1&&!(E.getName() in C))E=F;return E.type==1&&E.getName() in C&&E;}};function v(B){return function(C){var D=C.getSelection(),E=C.config.enterMode,F=D.getRanges();if(F&&F.length){var G={},H=D.createBookmarks(),I=F.createIterator(),J,K=0;while(J=I.getNextRange(1)){var L=J.getEnclosedNode();if(!L||L&&!(L.type==1&&L.getName() in n))L=u(J,m,E);L&&t(L,B,C,G);
|
|
||||||
var M,N,O=new d.walker(J),P=H[K].startNode,Q=H[K++].endNode;O.evaluator=function(R){return!!(R.type==1&&R.getName() in m&&!(R.getName()==(E==1?'p':'div')&&R.getParent().type==1&&R.getParent().getName()=='blockquote')&&R.getPosition(P)&2&&(R.getPosition(Q)&4+16)==4);};while(N=O.next())t(N,B,C,G);M=J.createIterator();M.enlargeBr=E!=2;while(N=M.getNextParagraph(E==1?'p':'div'))t(N,B,C,G);}h.clearAllMarkers(G);C.forceNextSelectionCheck();D.selectBookmarks(H);C.focus();}};};j.add('bidi',{requires:['styles','button'],init:function(B){var C=function(E,F,G,H){B.addCommand(G,new a.command(B,{exec:H}));B.ui.addButton(E,{label:F,command:G});},D=B.lang.bidi;C('BidiLtr',D.ltr,'bidiltr',v('ltr'));C('BidiRtl',D.rtl,'bidirtl',v('rtl'));B.on('selectionChange',p);B.on('contentDom',function(){B.document.on('dirChanged',function(E){B.fire('dirChanged',{node:E.data,dir:E.data.getDirection(1)});});});}});function w(B){var C=B.getDocument().getBody().getParent();while(B){if(B.equals(C))return false;B=B.getParent();}return true;};function x(B){var C=B==y.setAttribute,D=B==y.removeAttribute,E=/\bdirection\s*:\s*(.*?)\s*(:?$|;)/;return function(F,G){var J=this;if(!J.getDocument().equals(a.document)){var H;if((F==(C||D?'dir':'direction')||F=='style'&&(D||E.test(G)))&&!w(J)){H=J.getDirection(1);var I=B.apply(J,arguments);if(H!=J.getDirection(1)){J.getDocument().fire('dirChanged',J);return I;}}}return B.apply(J,arguments);};};var y=h.prototype,z=['setStyle','removeStyle','setAttribute','removeAttribute'];for(var A=0;A<z.length;A++)y[z[A]]=e.override(y[z[A]],x);})();(function(){function m(q,r){var s=r.block||r.blockLimit;if(!s||s.getName()=='body')return 2;if(s.getAscendant('blockquote',true))return 1;return 2;};function n(q){var r=q.editor;if(r.readOnly)return;var s=r.getCommand('blockquote');s.state=m(r,q.data.path);s.fire('state');};function o(q){for(var r=0,s=q.getChildCount(),t;r<s&&(t=q.getChild(r));r++){if(t.type==1&&t.isBlockBoundary())return false;}return true;};var p={exec:function(q){var r=q.getCommand('blockquote').state,s=q.getSelection(),t=s&&s.getRanges(true)[0];if(!t)return;var u=s.createBookmarks();if(c){var v=u[0].startNode,w=u[0].endNode,x;if(v&&v.getParent().getName()=='blockquote'){x=v;while(x=x.getNext()){if(x.type==1&&x.isBlockBoundary()){v.move(x,true);break;}}}if(w&&w.getParent().getName()=='blockquote'){x=w;while(x=x.getPrevious()){if(x.type==1&&x.isBlockBoundary()){w.move(x);break;}}}}var y=t.createIterator(),z;y.enlargeBr=q.config.enterMode!=2;if(r==2){var A=[];
|
|
||||||
while(z=y.getNextParagraph())A.push(z);if(A.length<1){var B=q.document.createElement(q.config.enterMode==1?'p':'div'),C=u.shift();t.insertNode(B);B.append(new d.text('\ufeff',q.document));t.moveToBookmark(C);t.selectNodeContents(B);t.collapse(true);C=t.createBookmark();A.push(B);u.unshift(C);}var D=A[0].getParent(),E=[];for(var F=0;F<A.length;F++){z=A[F];D=D.getCommonAncestor(z.getParent());}var G={table:1,tbody:1,tr:1,ol:1,ul:1};while(G[D.getName()])D=D.getParent();var H=null;while(A.length>0){z=A.shift();while(!z.getParent().equals(D))z=z.getParent();if(!z.equals(H))E.push(z);H=z;}while(E.length>0){z=E.shift();if(z.getName()=='blockquote'){var I=new d.documentFragment(q.document);while(z.getFirst()){I.append(z.getFirst().remove());A.push(I.getLast());}I.replace(z);}else A.push(z);}var J=q.document.createElement('blockquote');J.insertBefore(A[0]);while(A.length>0){z=A.shift();J.append(z);}}else if(r==1){var K=[],L={};while(z=y.getNextParagraph()){var M=null,N=null;while(z.getParent()){if(z.getParent().getName()=='blockquote'){M=z.getParent();N=z;break;}z=z.getParent();}if(M&&N&&!N.getCustomData('blockquote_moveout')){K.push(N);h.setMarker(L,N,'blockquote_moveout',true);}}h.clearAllMarkers(L);var O=[],P=[];L={};while(K.length>0){var Q=K.shift();J=Q.getParent();if(!Q.getPrevious())Q.remove().insertBefore(J);else if(!Q.getNext())Q.remove().insertAfter(J);else{Q.breakParent(Q.getParent());P.push(Q.getNext());}if(!J.getCustomData('blockquote_processed')){P.push(J);h.setMarker(L,J,'blockquote_processed',true);}O.push(Q);}h.clearAllMarkers(L);for(F=P.length-1;F>=0;F--){J=P[F];if(o(J))J.remove();}if(q.config.enterMode==2){var R=true;while(O.length){Q=O.shift();if(Q.getName()=='div'){I=new d.documentFragment(q.document);var S=R&&Q.getPrevious()&&!(Q.getPrevious().type==1&&Q.getPrevious().isBlockBoundary());if(S)I.append(q.document.createElement('br'));var T=Q.getNext()&&!(Q.getNext().type==1&&Q.getNext().isBlockBoundary());while(Q.getFirst())Q.getFirst().remove().appendTo(I);if(T)I.append(q.document.createElement('br'));I.replace(Q);R=false;}}}}s.selectBookmarks(u);q.focus();}};j.add('blockquote',{init:function(q){q.addCommand('blockquote',p);q.ui.addButton('Blockquote',{label:q.lang.blockquote,command:'blockquote'});q.on('selectionChange',n);},requires:['domiterator']});})();j.add('button',{beforeInit:function(m){m.ui.addHandler('button',k.button.handler);}});a.UI_BUTTON='button';k.button=function(m){e.extend(this,m,{title:m.label,className:m.className||m.command&&'cke_button_'+m.command||'',click:m.click||(function(n){n.execCommand(m.command);
|
|
||||||
})});this._={};};k.button.handler={create:function(m){return new k.button(m);}};(function(){k.button.prototype={render:function(m,n){var o=b,p=this._.id=e.getNextId(),q='',r=this.command,s;this._.editor=m;var t={id:p,button:this,editor:m,focus:function(){var z=a.document.getById(p);z.focus();},execute:function(){if(c&&b.version<7)e.setTimeout(function(){this.button.click(m);},0,this);else this.button.click(m);}},u=e.addFunction(function(z){if(t.onkey){z=new d.event(z);return t.onkey(t,z.getKeystroke())!==false;}}),v=e.addFunction(function(z){var A;if(t.onfocus)A=t.onfocus(t,new d.event(z))!==false;if(b.gecko&&b.version<10900)z.preventBubble();return A;});t.clickFn=s=e.addFunction(t.execute,t);if(this.modes){var w={};function x(){var z=m.mode;if(z){var A=this.modes[z]?w[z]!=undefined?w[z]:2:0;this.setState(m.readOnly&&!this.readOnly?0:A);}};m.on('beforeModeUnload',function(){if(m.mode&&this._.state!=0)w[m.mode]=this._.state;},this);m.on('mode',x,this);!this.readOnly&&m.on('readOnly',x,this);}else if(r){r=m.getCommand(r);if(r){r.on('state',function(){this.setState(r.state);},this);q+='cke_'+(r.state==1?'on':r.state==0?'disabled':'off');}}if(!r)q+='cke_off';if(this.className)q+=' '+this.className;n.push('<span class="cke_button'+(this.icon&&this.icon.indexOf('.png')==-1?' cke_noalphafix':'')+'">','<a id="',p,'" class="',q,'"',o.gecko&&o.version>=10900&&!o.hc?'':'" href="javascript:void(\''+(this.title||'').replace("'",'')+"')\"",' title="',this.title,'" tabindex="-1" hidefocus="true" role="button" aria-labelledby="'+p+'_label"'+(this.hasArrow?' aria-haspopup="true"':''));if(o.opera||o.gecko&&o.mac)n.push(' onkeypress="return false;"');if(o.gecko)n.push(' onblur="this.style.cssText = this.style.cssText;"');n.push(' onkeydown="return CKEDITOR.tools.callFunction(',u,', event);" onfocus="return CKEDITOR.tools.callFunction(',v,', event);" '+(c?'onclick="return false;" onmouseup':'onclick')+'="CKEDITOR.tools.callFunction(',s,', this); return false;"><span class="cke_icon"');if(this.icon){var y=(this.iconOffset||0)*-16;n.push(' style="background-image:url(',a.getUrl(this.icon),');background-position:0 '+y+'px;"');}n.push('> </span><span id="',p,'_label" class="cke_label">',this.label,'</span>');if(this.hasArrow)n.push('<span class="cke_buttonarrow">'+(b.hc?'▼':' ')+'</span>');n.push('</a>','</span>');if(this.onRender)this.onRender();return t;},setState:function(m){if(this._.state==m)return false;this._.state=m;var n=a.document.getById(this._.id);if(n){n.setState(m);
|
|
||||||
m==0?n.setAttribute('aria-disabled',true):n.removeAttribute('aria-disabled');m==1?n.setAttribute('aria-pressed',true):n.removeAttribute('aria-pressed');return true;}else return false;}};})();k.prototype.addButton=function(m,n){this.add(m,'button',n);};(function(){var m=function(y,z){var A=y.document,B=A.getBody(),C=false,D=function(){C=true;};B.on(z,D);(b.version>7?A.$:A.$.selection.createRange()).execCommand(z);B.removeListener(z,D);return C;},n=c?function(y,z){return m(y,z);}:function(y,z){try{return y.document.$.execCommand(z,false,null);}catch(A){return false;}},o=function(y){var z=this;z.type=y;z.canUndo=z.type=='cut';z.startDisabled=true;};o.prototype={exec:function(y,z){this.type=='cut'&&t(y);var A=n(y,this.type);if(!A)alert(y.lang.clipboard[this.type+'Error']);return A;}};var p={canUndo:false,exec:c?function(y){y.focus();if(!y.document.getBody().fire('beforepaste')&&!m(y,'paste')){y.fire('pasteDialog');return false;}}:function(y){try{if(!y.document.getBody().fire('beforepaste')&&!y.document.$.execCommand('Paste',false,null))throw 0;}catch(z){setTimeout(function(){y.fire('pasteDialog');},0);return false;}}},q=function(y){if(this.mode!='wysiwyg')return;switch(y.data.keyCode){case 1114112+86:case 2228224+45:var z=this.document.getBody();if(b.opera||b.gecko)z.fire('paste');return;case 1114112+88:case 2228224+46:var A=this;this.fire('saveSnapshot');setTimeout(function(){A.fire('saveSnapshot');},0);}};function r(y){y.cancel();};function s(y,z,A){var B=this.document;if(B.getById('cke_pastebin'))return;if(z=='text'&&y.data&&y.data.$.clipboardData){var C=y.data.$.clipboardData.getData('text/plain');if(C){y.data.preventDefault();A(C);return;}}var D=this.getSelection(),E=new d.range(B),F=new h(z=='text'?'textarea':b.webkit?'body':'div',B);F.setAttribute('id','cke_pastebin');b.webkit&&F.append(B.createText('\xa0'));B.getBody().append(F);F.setStyles({position:'absolute',top:D.getStartElement().getDocumentPosition().y+'px',width:'1px',height:'1px',overflow:'hidden'});F.setStyle(this.config.contentsLangDirection=='ltr'?'left':'right','-1000px');var G=D.createBookmarks();this.on('selectionChange',r,null,null,0);if(z=='text')F.$.focus();else{E.setStartAt(F,1);E.setEndAt(F,2);E.select(true);}var H=this;window.setTimeout(function(){H.document.getBody().focus();H.removeListener('selectionChange',r);if(b.ie7Compat){D.selectBookmarks(G);F.remove();}else{F.remove();D.selectBookmarks(G);}var I;F=b.webkit&&(I=F.getFirst())&&I.is&&I.hasClass('Apple-style-span')?I:F;A(F['get'+(z=='text'?'Value':'Html')]());
|
|
||||||
},0);};function t(y){if(!c||b.quirks)return;var z=y.getSelection(),A;if(z.getType()==3&&(A=z.getSelectedElement())){var B=z.getRanges()[0],C=y.document.createText('');C.insertBefore(A);B.setStartBefore(C);B.setEndAfter(A);z.selectRanges([B]);setTimeout(function(){if(A.getParent()){C.remove();z.selectElement(A);}},0);}};var u,v;function w(y,z){var A;if(v&&y in {Paste:1,Cut:1})return 0;if(y=='Paste'){c&&(u=1);try{A=z.document.$.queryCommandEnabled(y)||b.webkit;}catch(D){}u=0;}else{var B=z.getSelection(),C=B&&B.getRanges();A=B&&!(C.length==1&&C[0].collapsed);}return A?2:0;};function x(){var z=this;if(z.mode!='wysiwyg')return;var y=w('Paste',z);z.getCommand('cut').setState(w('Cut',z));z.getCommand('copy').setState(w('Copy',z));z.getCommand('paste').setState(y);z.fire('pasteState',y);};j.add('clipboard',{requires:['dialog','htmldataprocessor'],init:function(y){y.on('paste',function(A){var B=A.data;if(B.html)y.insertHtml(B.html);else if(B.text)y.insertText(B.text);setTimeout(function(){y.fire('afterPaste');},0);},null,null,1000);y.on('pasteDialog',function(A){setTimeout(function(){y.openDialog('paste');},0);});y.on('pasteState',function(A){y.getCommand('paste').setState(A.data);});function z(A,B,C,D){var E=y.lang[B];y.addCommand(B,C);y.ui.addButton(A,{label:E,command:B});if(y.addMenuItems)y.addMenuItem(B,{label:E,command:B,group:'clipboard',order:D});};z('Cut','cut',new o('cut'),1);z('Copy','copy',new o('copy'),4);z('Paste','paste',p,8);a.dialog.add('paste',a.getUrl(this.path+'dialogs/paste.js'));y.on('key',q,y);y.on('contentDom',function(){var A=y.document.getBody();A.on(!c?'paste':'beforepaste',function(B){if(u)return;var C=B.data&&B.data.$;if(c&&C&&!C.ctrlKey)return;var D={mode:'html'};y.fire('beforePaste',D);s.call(y,B,D.mode,function(E){if(!(E=e.trim(E.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,''))))return;var F={};F[D.mode]=E;y.fire('paste',F);});});if(c){A.on('contextmenu',function(){u=1;setTimeout(function(){u=0;},0);});A.on('paste',function(B){if(!y.document.getById('cke_pastebin')){B.data.preventDefault();u=0;p.exec(y);}});}A.on('beforecut',function(){!u&&t(y);});A.on('mouseup',function(){setTimeout(function(){x.call(y);},0);},y);A.on('keyup',x,y);});y.on('selectionChange',function(A){v=A.data.selection.getRanges()[0].checkReadOnly();x.call(y);});if(y.contextMenu)y.contextMenu.addListener(function(A,B){var C=B.getRanges()[0].checkReadOnly();return{cut:w('Cut',y),copy:w('Copy',y),paste:w('Paste',y)};});}});})();j.add('colorbutton',{requires:['panelbutton','floatpanel','styles'],init:function(m){var n=m.config,o=m.lang.colorButton,p;
|
|
||||||
if(!b.hc){q('TextColor','fore',o.textColorTitle);q('BGColor','back',o.bgColorTitle);}function q(t,u,v){var w=e.getNextId()+'_colorBox';m.ui.add(t,'panelbutton',{label:v,title:v,className:'cke_button_'+t.toLowerCase(),modes:{wysiwyg:1},panel:{css:m.skin.editor.css,attributes:{role:'listbox','aria-label':o.panelTitle}},onBlock:function(x,y){y.autoSize=true;y.element.addClass('cke_colorblock');y.element.setHtml(r(x,u,w));y.element.getDocument().getBody().setStyle('overflow','hidden');k.fire('ready',this);var z=y.keys,A=m.lang.dir=='rtl';z[A?37:39]='next';z[40]='next';z[9]='next';z[A?39:37]='prev';z[38]='prev';z[2228224+9]='prev';z[32]='click';},onOpen:function(){var x=m.getSelection(),y=x&&x.getStartElement(),z=new d.elementPath(y),A;y=z.block||z.blockLimit||m.document.getBody();do A=y&&y.getComputedStyle(u=='back'?'background-color':'color')||'transparent';while(u=='back'&&A=='transparent'&&y&&(y=y.getParent()));if(!A||A=='transparent')A='#ffffff';this._.panel._.iframe.getFrameDocument().getById(w).setStyle('background-color',A);}});};function r(t,u,v){var w=[],x=n.colorButton_colors.split(','),y=e.addFunction(function(E,F){if(E=='?'){var G=arguments.callee;function H(J){this.removeListener('ok',H);this.removeListener('cancel',H);J.name=='ok'&&G(this.getContentElement('picker','selectedColor').getValue(),F);};m.openDialog('colordialog',function(){this.on('ok',H);this.on('cancel',H);});return;}m.focus();t.hide(false);m.fire('saveSnapshot');new a.style(n['colorButton_'+F+'Style'],{color:'inherit'}).remove(m.document);if(E){var I=n['colorButton_'+F+'Style'];I.childRule=F=='back'?function(J){return s(J);}:function(J){return!(J.is('a')||J.getElementsByTag('a').count())||s(J);};new a.style(I,{color:E}).apply(m.document);}m.fire('saveSnapshot');});w.push('<a class="cke_colorauto" _cke_focus=1 hidefocus=true title="',o.auto,'" onclick="CKEDITOR.tools.callFunction(',y,",null,'",u,"');return false;\" href=\"javascript:void('",o.auto,'\')" role="option"><table role="presentation" cellspacing=0 cellpadding=0 width="100%"><tr><td><span class="cke_colorbox" id="',v,'"></span></td><td colspan=7 align=center>',o.auto,'</td></tr></table></a><table role="presentation" cellspacing=0 cellpadding=0 width="100%">');for(var z=0;z<x.length;z++){if(z%8===0)w.push('</tr><tr>');var A=x[z].split('/'),B=A[0],C=A[1]||B;if(!A[1])B='#'+B.replace(/^(.)(.)(.)$/,'$1$1$2$2$3$3');var D=m.lang.colors[C]||C;w.push('<td><a class="cke_colorbox" _cke_focus=1 hidefocus=true title="',D,'" onclick="CKEDITOR.tools.callFunction(',y,",'",B,"','",u,"'); return false;\" href=\"javascript:void('",D,'\')" role="option"><span class="cke_colorbox" style="background-color:#',C,'"></span></a></td>');
|
|
||||||
}if(n.colorButton_enableMore===undefined||n.colorButton_enableMore)w.push('</tr><tr><td colspan=8 align=center><a class="cke_colormore" _cke_focus=1 hidefocus=true title="',o.more,'" onclick="CKEDITOR.tools.callFunction(',y,",'?','",u,"');return false;\" href=\"javascript:void('",o.more,"')\"",' role="option">',o.more,'</a></td>');w.push('</tr></table>');return w.join('');};function s(t){return t.getAttribute('contentEditable')=='false'||t.getAttribute('data-nostyle');};}});i.colorButton_colors='000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF';i.colorButton_foreStyle={element:'span',styles:{color:'#(color)'},overrides:[{element:'font',attributes:{color:null}}]};i.colorButton_backStyle={element:'span',styles:{'background-color':'#(color)'}};j.colordialog={requires:['dialog'],init:function(m){m.addCommand('colordialog',new a.dialogCommand('colordialog'));a.dialog.add('colordialog',this.path+'dialogs/colordialog.js');}};j.add('colordialog',j.colordialog);j.add('contextmenu',{requires:['menu'],onLoad:function(){j.contextMenu=e.createClass({base:a.menu,$:function(m){this.base.call(this,m,{panel:{className:m.skinClass+' cke_contextmenu',attributes:{'aria-label':m.lang.contextmenu.options}}});},proto:{addTarget:function(m,n){if(b.opera&&!('oncontextmenu' in document.body)){var o;m.on('mousedown',function(s){s=s.data;if(s.$.button!=2){if(s.getKeystroke()==1114112+1)m.fire('contextmenu',s);return;}if(n&&(b.mac?s.$.metaKey:s.$.ctrlKey))return;var t=s.getTarget();if(!o){var u=t.getDocument();o=u.createElement('input');o.$.type='button';u.getBody().append(o);}o.setAttribute('style','position:absolute;top:'+(s.$.clientY-2)+'px;left:'+(s.$.clientX-2)+'px;width:5px;height:5px;opacity:0.01');});m.on('mouseup',function(s){if(o){o.remove();o=undefined;m.fire('contextmenu',s.data);}});}m.on('contextmenu',function(s){var t=s.data;if(n&&(b.webkit?p:b.mac?t.$.metaKey:t.$.ctrlKey))return;t.preventDefault();var u=t.getTarget().getDocument().getDocumentElement(),v=t.$.clientX,w=t.$.clientY;e.setTimeout(function(){this.open(u,null,v,w);},c?200:0,this);},this);if(b.opera)m.on('keypress',function(s){var t=s.data;if(t.$.keyCode===0)t.preventDefault();});if(b.webkit){var p,q=function(s){p=b.mac?s.data.$.metaKey:s.data.$.ctrlKey;},r=function(){p=0;};m.on('keydown',q);m.on('keyup',r);
|
|
||||||
m.on('contextmenu',r);}},open:function(m,n,o,p){this.editor.focus();m=m||a.document.getDocumentElement();this.show(m,n,o,p);}}});},beforeInit:function(m){m.contextMenu=new j.contextMenu(m);m.addCommand('contextMenu',{exec:function(){m.contextMenu.open(m.document.getBody());}});}});(function(){function m(o){var p=this.att,q=o&&o.hasAttribute(p)&&o.getAttribute(p)||'';if(q!==undefined)this.setValue(q);};function n(){var o;for(var p=0;p<arguments.length;p++){if(arguments[p] instanceof h){o=arguments[p];break;}}if(o){var q=this.att,r=this.getValue();if(r)o.setAttribute(q,r);else o.removeAttribute(q,r);}};j.add('dialogadvtab',{createAdvancedTab:function(o,p){if(!p)p={id:1,dir:1,classes:1,styles:1};var q=o.lang.common,r={id:'advanced',label:q.advancedTab,title:q.advancedTab,elements:[{type:'vbox',padding:1,children:[]}]},s=[];if(p.id||p.dir){if(p.id)s.push({id:'advId',att:'id',type:'text',label:q.id,setup:m,commit:n});if(p.dir)s.push({id:'advLangDir',att:'dir',type:'select',label:q.langDir,'default':'',style:'width:100%',items:[[q.notSet,''],[q.langDirLTR,'ltr'],[q.langDirRTL,'rtl']],setup:m,commit:n});r.elements[0].children.push({type:'hbox',widths:['50%','50%'],children:[].concat(s)});}if(p.styles||p.classes){s=[];if(p.styles)s.push({id:'advStyles',att:'style',type:'text',label:q.styles,'default':'',validate:a.dialog.validate.inlineStyle(q.invalidInlineStyle),onChange:function(){},getStyle:function(t,u){var v=this.getValue().match(new RegExp('(?:^|;)\\s*'+t+'\\s*:\\s*([^;]*)','i'));return v?v[1]:u;},updateStyle:function(t,u){var v=this.getValue(),w=o.document.createElement('span');w.setAttribute('style',v);w.setStyle(t,u);v=e.normalizeCssText(w.getAttribute('style'));this.setValue(v,1);},setup:m,commit:n});if(p.classes)s.push({type:'hbox',widths:['45%','55%'],children:[{id:'advCSSClasses',att:'class',type:'text',label:q.cssClasses,'default':'',setup:m,commit:n}]});r.elements[0].children.push({type:'hbox',widths:['50%','50%'],children:[].concat(s)});}return r;}});})();(function(){j.add('div',{requires:['editingblock','dialog','domiterator','styles'],init:function(m){var n=m.lang.div;m.addCommand('creatediv',new a.dialogCommand('creatediv'));m.addCommand('editdiv',new a.dialogCommand('editdiv'));m.addCommand('removediv',{exec:function(o){var p=o.getSelection(),q=p&&p.getRanges(),r,s=p.createBookmarks(),t,u=[];function v(x){var y=new d.elementPath(x),z=y.blockLimit,A=z.is('div')&&z;if(A&&!A.data('cke-div-added')){u.push(A);A.data('cke-div-added');}};for(var w=0;w<q.length;
|
|
||||||
w++){r=q[w];if(r.collapsed)v(p.getStartElement());else{t=new d.walker(r);t.evaluator=v;t.lastForward();}}for(w=0;w<u.length;w++)u[w].remove(true);p.selectBookmarks(s);}});m.ui.addButton('CreateDiv',{label:n.toolbar,command:'creatediv'});if(m.addMenuItems){m.addMenuItems({editdiv:{label:n.edit,command:'editdiv',group:'div',order:1},removediv:{label:n.remove,command:'removediv',group:'div',order:5}});if(m.contextMenu)m.contextMenu.addListener(function(o,p){if(!o||o.isReadOnly())return null;var q=new d.elementPath(o),r=q.blockLimit;if(r&&r.getAscendant('div',true))return{editdiv:2,removediv:2};return null;});}a.dialog.add('creatediv',this.path+'dialogs/div.js');a.dialog.add('editdiv',this.path+'dialogs/div.js');}});})();(function(){var m={toolbarFocus:{editorFocus:false,readOnly:1,exec:function(o){var p=o._.elementsPath.idBase,q=a.document.getById(p+'0');q&&q.focus(c||b.air);}}},n='<span class="cke_empty"> </span>';j.add('elementspath',{requires:['selection'],init:function(o){var p='cke_path_'+o.name,q,r=function(){if(!q)q=a.document.getById(p);return q;},s='cke_elementspath_'+e.getNextNumber()+'_';o._.elementsPath={idBase:s,filters:[]};o.on('themeSpace',function(x){if(x.data.space=='bottom')x.data.html+='<span id="'+p+'_label" class="cke_voice_label">'+o.lang.elementsPath.eleLabel+'</span>'+'<div id="'+p+'" class="cke_path" role="group" aria-labelledby="'+p+'_label">'+n+'</div>';});function t(x){o.focus();var y=o._.elementsPath.list[x];if(y.is('body')){var z=new d.range(o.document);z.selectNodeContents(y);z.select();}else o.getSelection().selectElement(y);};var u=e.addFunction(t),v=e.addFunction(function(x,y){var z=o._.elementsPath.idBase,A;y=new d.event(y);var B=o.lang.dir=='rtl';switch(y.getKeystroke()){case B?39:37:case 9:A=a.document.getById(z+(x+1));if(!A)A=a.document.getById(z+'0');A.focus();return false;case B?37:39:case 2228224+9:A=a.document.getById(z+(x-1));if(!A)A=a.document.getById(z+(o._.elementsPath.list.length-1));A.focus();return false;case 27:o.focus();return false;case 13:case 32:t(x);return false;}return true;});o.on('selectionChange',function(x){var y=b,z=x.data.selection,A=z.getStartElement(),B=[],C=x.editor,D=C._.elementsPath.list=[],E=C._.elementsPath.filters;while(A){var F=0,G;if(A.data('cke-display-name'))G=A.data('cke-display-name');else if(A.data('cke-real-element-type'))G=A.data('cke-real-element-type');else G=A.getName();for(var H=0;H<E.length;H++){var I=E[H](A,G);if(I===false){F=1;break;}G=I||G;}if(!F){var J=D.push(A)-1,K='';
|
|
||||||
if(y.opera||y.gecko&&y.mac)K+=' onkeypress="return false;"';if(y.gecko)K+=' onblur="this.style.cssText = this.style.cssText;"';var L=C.lang.elementsPath.eleTitle.replace(/%1/,G);B.unshift('<a id="',s,J,'" href="javascript:void(\'',G,'\')" tabindex="-1" title="',L,'"'+(b.gecko&&b.version<10900?' onfocus="event.preventBubble();"':'')+' hidefocus="true" '+' onkeydown="return CKEDITOR.tools.callFunction(',v,',',J,', event );"'+K,' onclick="CKEDITOR.tools.callFunction('+u,',',J,'); return false;"',' role="button" aria-labelledby="'+s+J+'_label">',G,'<span id="',s,J,'_label" class="cke_label">'+L+'</span>','</a>');}if(G=='body')break;A=A.getParent();}var M=r();M.setHtml(B.join('')+n);C.fire('elementsPathUpdate',{space:M});});function w(){q&&q.setHtml(n);delete o._.elementsPath.list;};o.on('readOnly',w);o.on('contentDomUnload',w);o.addCommand('elementsPathFocus',m.toolbarFocus);}});})();(function(){j.add('enterkey',{requires:['keystrokes','indent'],init:function(t){t.addCommand('enter',{modes:{wysiwyg:1},editorFocus:false,exec:function(v){r(v);}});t.addCommand('shiftEnter',{modes:{wysiwyg:1},editorFocus:false,exec:function(v){q(v);}});var u=t.keystrokeHandler.keystrokes;u[13]='enter';u[2228224+13]='shiftEnter';}});j.enterkey={enterBlock:function(t,u,v,w){v=v||s(t);if(!v)return;var x=v.document,y=v.checkStartOfBlock(),z=v.checkEndOfBlock(),A=new d.elementPath(v.startContainer),B=A.block;if(y&&z){if(B&&(B.is('li')||B.getParent().is('li'))){t.execCommand('outdent');return;}if(B&&B.getParent().is('blockquote')){B.breakParent(B.getParent());if(!B.getPrevious().getFirst(d.walker.invisible(1)))B.getPrevious().remove();if(!B.getNext().getFirst(d.walker.invisible(1)))B.getNext().remove();v.moveToElementEditStart(B);v.select();return;}}else if(B&&B.is('pre')){if(!z){n(t,u,v,w);return;}}else if(B&&f.$captionBlock[B.getName()]){n(t,u,v,w);return;}var C=u==3?'div':'p',D=v.splitBlock(C);if(!D)return;var E=D.previousBlock,F=D.nextBlock,G=D.wasStartOfBlock,H=D.wasEndOfBlock,I;if(F){I=F.getParent();if(I.is('li')){F.breakParent(I);F.move(F.getNext(),1);}}else if(E&&(I=E.getParent())&&I.is('li')){E.breakParent(I);I=E.getNext();v.moveToElementEditStart(I);E.move(E.getPrevious());}if(!G&&!H){if(F.is('li')&&(I=F.getFirst(d.walker.invisible(true)))&&I.is&&I.is('ul','ol'))(c?x.createText('\xa0'):x.createElement('br')).insertBefore(I);if(F)v.moveToElementEditStart(F);}else{var J,K;if(E){if(E.is('li')||!(p.test(E.getName())||E.is('pre')))J=E.clone();}else if(F)J=F.clone();if(!J){if(I&&I.is('li'))J=I;
|
|
||||||
else{J=x.createElement(C);if(E&&(K=E.getDirection()))J.setAttribute('dir',K);}}else if(w&&!J.is('li'))J.renameNode(C);var L=D.elementPath;if(L)for(var M=0,N=L.elements.length;M<N;M++){var O=L.elements[M];if(O.equals(L.block)||O.equals(L.blockLimit))break;if(f.$removeEmpty[O.getName()]){O=O.clone();J.moveChildren(O);J.append(O);}}if(!c)J.appendBogus();if(!J.getParent())v.insertNode(J);J.is('li')&&J.removeAttribute('value');if(c&&G&&(!H||!E.getChildCount())){v.moveToElementEditStart(H?E:J);v.select();}v.moveToElementEditStart(G&&!H?F:J);}if(!c)if(F){var P=x.createElement('span');P.setHtml(' ');v.insertNode(P);P.scrollIntoView();v.deleteContents();}else J.scrollIntoView();v.select();},enterBr:function(t,u,v,w){v=v||s(t);if(!v)return;var x=v.document,y=u==3?'div':'p',z=v.checkEndOfBlock(),A=new d.elementPath(t.getSelection().getStartElement()),B=A.block,C=B&&A.block.getName(),D=false;if(!w&&C=='li'){o(t,u,v,w);return;}if(!w&&z&&p.test(C)){var E,F;if(F=B.getDirection()){E=x.createElement('div');E.setAttribute('dir',F);E.insertAfter(B);v.setStart(E,0);}else{x.createElement('br').insertAfter(B);if(b.gecko)x.createText('').insertAfter(B);v.setStartAt(B.getNext(),c?3:1);}}else{var G;D=C=='pre';if(C=='pre'&&c&&b.version<8)G=x.createText('\r');else G=x.createElement('br');v.deleteContents();v.insertNode(G);if(c)v.setStartAt(G,4);else{x.createText('\ufeff').insertAfter(G);if(z)G.getParent().appendBogus();G.getNext().$.nodeValue='';v.setStartAt(G.getNext(),1);var H=null;if(!b.gecko){H=x.createElement('span');H.setHtml(' ');}else H=x.createElement('br');H.insertBefore(G.getNext());H.scrollIntoView();H.remove();}}v.collapse(true);v.select(D);}};var m=j.enterkey,n=m.enterBr,o=m.enterBlock,p=/^h[1-6]$/;function q(t){if(t.mode!='wysiwyg')return false;return r(t,t.config.shiftEnterMode,1);};function r(t,u,v){v=t.config.forceEnterMode||v;if(t.mode!='wysiwyg')return false;if(!u)u=t.config.enterMode;setTimeout(function(){t.fire('saveSnapshot');if(u==2)n(t,u,null,v);else o(t,u,null,v);t.fire('saveSnapshot');},0);return true;};function s(t){var u=t.getSelection().getRanges(true);for(var v=u.length-1;v>0;v--)u[v].deleteContents();return u[0];};})();(function(){var m='nbsp,gt,lt,amp',n='quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro',o='Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml',p='Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv';
|
|
||||||
function q(r,s){var t={},u=[],v={nbsp:'\xa0',shy:'',gt:'>',lt:'<',amp:'&',apos:"'",quot:'"'};r=r.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(A,B){var C=s?'&'+B+';':v[B],D=s?v[B]:'&'+B+';';t[C]=D;u.push(C);return '';});if(!s&&r){r=r.split(',');var w=document.createElement('div'),x;w.innerHTML='&'+r.join(';&')+';';x=w.innerHTML;w=null;for(var y=0;y<x.length;y++){var z=x.charAt(y);t[z]='&'+r[y]+';';u.push(z);}}t.regex=u.join(s?'|':'');return t;};j.add('entities',{afterInit:function(r){var s=r.config,t=r.dataProcessor,u=t&&t.htmlFilter;if(u){var v=[];if(s.basicEntities!==false)v.push(m);if(s.entities){if(v.length)v.push(n);if(s.entities_latin)v.push(o);if(s.entities_greek)v.push(p);if(s.entities_additional)v.push(s.entities_additional);}var w=q(v.join(',')),x=w.regex?'['+w.regex+']':'a^';delete w.regex;if(s.entities&&s.entities_processNumerical)x='[^ -~]|'+x;x=new RegExp(x,'g');function y(C){return s.entities_processNumerical=='force'||!w[C]?'&#'+C.charCodeAt(0)+';':w[C];};var z=q([m,'shy'].join(','),true),A=new RegExp(z.regex,'g');function B(C){return z[C];};u.addRules({text:function(C){return C.replace(A,B).replace(x,y);}});}}});})();i.basicEntities=true;i.entities=true;i.entities_latin=true;i.entities_greek=true;i.entities_additional='#39';(function(){function m(v,w){var x=[];if(!w)return v;else for(var y in w)x.push(y+'='+encodeURIComponent(w[y]));return v+(v.indexOf('?')!=-1?'&':'?')+x.join('&');};function n(v){v+='';var w=v.charAt(0).toUpperCase();return w+v.substr(1);};function o(v){var C=this;var w=C.getDialog(),x=w.getParentEditor();x._.filebrowserSe=C;var y=x.config['filebrowser'+n(w.getName())+'WindowWidth']||x.config.filebrowserWindowWidth||'80%',z=x.config['filebrowser'+n(w.getName())+'WindowHeight']||x.config.filebrowserWindowHeight||'70%',A=C.filebrowser.params||{};A.CKEditor=x.name;A.CKEditorFuncNum=x._.filebrowserFn;if(!A.langCode)A.langCode=x.langCode;var B=m(C.filebrowser.url,A);x.popup(B,y,z,x.config.filebrowserWindowFeatures||x.config.fileBrowserWindowFeatures);};function p(v){var y=this;var w=y.getDialog(),x=w.getParentEditor();x._.filebrowserSe=y;if(!w.getContentElement(y['for'][0],y['for'][1]).getInputElement().$.value)return false;if(!w.getContentElement(y['for'][0],y['for'][1]).getAction())return false;return true;};function q(v,w,x){var y=x.params||{};y.CKEditor=v.name;y.CKEditorFuncNum=v._.filebrowserFn;if(!y.langCode)y.langCode=v.langCode;w.action=m(x.url,y);w.filebrowser=x;};function r(v,w,x,y){var z,A;for(var B in y){z=y[B];
|
|
||||||
if(z.type=='hbox'||z.type=='vbox'||z.type=='fieldset')r(v,w,x,z.children);if(!z.filebrowser)continue;if(typeof z.filebrowser=='string'){var C={action:z.type=='fileButton'?'QuickUpload':'Browse',target:z.filebrowser};z.filebrowser=C;}if(z.filebrowser.action=='Browse'){var D=z.filebrowser.url;if(D===undefined){D=v.config['filebrowser'+n(w)+'BrowseUrl'];if(D===undefined)D=v.config.filebrowserBrowseUrl;}if(D){z.onClick=o;z.filebrowser.url=D;z.hidden=false;}}else if(z.filebrowser.action=='QuickUpload'&&z['for']){D=z.filebrowser.url;if(D===undefined){D=v.config['filebrowser'+n(w)+'UploadUrl'];if(D===undefined)D=v.config.filebrowserUploadUrl;}if(D){var E=z.onClick;z.onClick=function(F){var G=F.sender;if(E&&E.call(G,F)===false)return false;return p.call(G,F);};z.filebrowser.url=D;z.hidden=false;q(v,x.getContents(z['for'][0]).get(z['for'][1]),z.filebrowser);}}}};function s(v,w){var x=w.getDialog(),y=w.filebrowser.target||null;if(y){var z=y.split(':'),A=x.getContentElement(z[0],z[1]);if(A){A.setValue(v);x.selectPage(z[0]);}}};function t(v,w,x){if(x.indexOf(';')!==-1){var y=x.split(';');for(var z=0;z<y.length;z++){if(t(v,w,y[z]))return true;}return false;}var A=v.getContents(w).get(x).filebrowser;return A&&A.url;};function u(v,w){var A=this;var x=A._.filebrowserSe.getDialog(),y=A._.filebrowserSe['for'],z=A._.filebrowserSe.filebrowser.onSelect;if(y)x.getContentElement(y[0],y[1]).reset();if(typeof w=='function'&&w.call(A._.filebrowserSe)===false)return;if(z&&z.call(A._.filebrowserSe,v,w)===false)return;if(typeof w=='string'&&w)alert(w);if(v)s(v,A._.filebrowserSe);};j.add('filebrowser',{init:function(v,w){v._.filebrowserFn=e.addFunction(u,v);v.on('destroy',function(){e.removeFunction(this._.filebrowserFn);});}});a.on('dialogDefinition',function(v){var w=v.data.definition,x;for(var y in w.contents){if(x=w.contents[y]){r(v.editor,v.data.name,w,x.elements);if(x.hidden&&x.filebrowser)x.hidden=!t(w,x.id,x.filebrowser);}}});})();j.add('find',{requires:['dialog'],init:function(m){var n=j.find;m.ui.addButton('Find',{label:m.lang.findAndReplace.find,command:'find'});var o=m.addCommand('find',new a.dialogCommand('find'));o.canUndo=false;o.readOnly=1;m.ui.addButton('Replace',{label:m.lang.findAndReplace.replace,command:'replace'});var p=m.addCommand('replace',new a.dialogCommand('replace'));p.canUndo=false;a.dialog.add('find',this.path+'dialogs/find.js');a.dialog.add('replace',this.path+'dialogs/find.js');},requires:['styles']});i.find_highlight={element:'span',styles:{'background-color':'#004',color:'#fff'}};
|
|
||||||
(function(){var m=/\.swf(?:$|\?)/i;function n(p){var q=p.attributes;return q.type=='application/x-shockwave-flash'||m.test(q.src||'');};function o(p,q){return p.createFakeParserElement(q,'cke_flash','flash',true);};j.add('flash',{init:function(p){p.addCommand('flash',new a.dialogCommand('flash'));p.ui.addButton('Flash',{label:p.lang.common.flash,command:'flash'});a.dialog.add('flash',this.path+'dialogs/flash.js');p.addCss('img.cke_flash{background-image: url('+a.getUrl(this.path+'images/placeholder.png')+');'+'background-position: center center;'+'background-repeat: no-repeat;'+'border: 1px solid #a9a9a9;'+'width: 80px;'+'height: 80px;'+'}');if(p.addMenuItems)p.addMenuItems({flash:{label:p.lang.flash.properties,command:'flash',group:'flash'}});p.on('doubleclick',function(q){var r=q.data.element;if(r.is('img')&&r.data('cke-real-element-type')=='flash')q.data.dialog='flash';});if(p.contextMenu)p.contextMenu.addListener(function(q,r){if(q&&q.is('img')&&!q.isReadOnly()&&q.data('cke-real-element-type')=='flash')return{flash:2};});},afterInit:function(p){var q=p.dataProcessor,r=q&&q.dataFilter;if(r)r.addRules({elements:{'cke:object':function(s){var t=s.attributes,u=t.classid&&String(t.classid).toLowerCase();if(!u&&!n(s)){for(var v=0;v<s.children.length;v++){if(s.children[v].name=='cke:embed'){if(!n(s.children[v]))return null;return o(p,s);}}return null;}return o(p,s);},'cke:embed':function(s){if(!n(s))return null;return o(p,s);}}},5);},requires:['fakeobjects']});})();e.extend(i,{flashEmbedTagOnly:false,flashAddEmbedTag:true,flashConvertOnEdit:false});(function(){function m(n,o,p,q,r,s,t){var u=n.config,v=r.split(';'),w=[],x={};for(var y=0;y<v.length;y++){var z=v[y];if(z){z=z.split('/');var A={},B=v[y]=z[0];A[p]=w[y]=z[1]||B;x[B]=new a.style(t,A);x[B]._.definition.name=B;}else v.splice(y--,1);}n.ui.addRichCombo(o,{label:q.label,title:q.panelTitle,className:'cke_'+(p=='size'?'fontSize':'font'),panel:{css:n.skin.editor.css.concat(u.contentsCss),multiSelect:false,attributes:{'aria-label':q.panelTitle}},init:function(){this.startGroup(q.panelTitle);for(var C=0;C<v.length;C++){var D=v[C];this.add(D,x[D].buildPreview(),D);}},onClick:function(C){n.focus();n.fire('saveSnapshot');var D=x[C];if(this.getValue()==C)D.remove(n.document);else D.apply(n.document);n.fire('saveSnapshot');},onRender:function(){n.on('selectionChange',function(C){var D=this.getValue(),E=C.data.path,F=E.elements;for(var G=0,H;G<F.length;G++){H=F[G];for(var I in x){if(x[I].checkElementMatch(H,true)){if(I!=D)this.setValue(I);
|
|
||||||
return;}}}this.setValue('',s);},this);}});};j.add('font',{requires:['richcombo','styles'],init:function(n){var o=n.config;m(n,'Font','family',n.lang.font,o.font_names,o.font_defaultLabel,o.font_style);m(n,'FontSize','size',n.lang.fontSize,o.fontSize_sizes,o.fontSize_defaultLabel,o.fontSize_style);}});})();i.font_names='Arial/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif';i.font_defaultLabel='';i.font_style={element:'span',styles:{'font-family':'#(family)'},overrides:[{element:'font',attributes:{face:null}}]};i.fontSize_sizes='8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px';i.fontSize_defaultLabel='';i.fontSize_style={element:'span',styles:{'font-size':'#(size)'},overrides:[{element:'font',attributes:{size:null}}]};j.add('format',{requires:['richcombo','styles'],init:function(m){var n=m.config,o=m.lang.format,p=n.format_tags.split(';'),q={};for(var r=0;r<p.length;r++){var s=p[r];q[s]=new a.style(n['format_'+s]);q[s]._.enterMode=m.config.enterMode;}m.ui.addRichCombo('Format',{label:o.label,title:o.panelTitle,className:'cke_format',panel:{css:m.skin.editor.css.concat(n.contentsCss),multiSelect:false,attributes:{'aria-label':o.panelTitle}},init:function(){this.startGroup(o.panelTitle);for(var t in q){var u=o['tag_'+t];this.add(t,q[t].buildPreview(u),u);}},onClick:function(t){m.focus();m.fire('saveSnapshot');var u=q[t],v=new d.elementPath(m.getSelection().getStartElement());u[u.checkActive(v)?'remove':'apply'](m.document);setTimeout(function(){m.fire('saveSnapshot');},0);},onRender:function(){m.on('selectionChange',function(t){var u=this.getValue(),v=t.data.path;for(var w in q){if(q[w].checkActive(v)){if(w!=u)this.setValue(w,m.lang.format['tag_'+w]);return;}}this.setValue('');},this);}});}});i.format_tags='p;h1;h2;h3;h4;h5;h6;pre;address;div';i.format_p={element:'p'};i.format_div={element:'div'};i.format_pre={element:'pre'};i.format_address={element:'address'};i.format_h1={element:'h1'};i.format_h2={element:'h2'};i.format_h3={element:'h3'};i.format_h4={element:'h4'};i.format_h5={element:'h5'};i.format_h6={element:'h6'};j.add('forms',{requires:['dialog'],init:function(m){var n=m.lang;
|
|
||||||
m.addCss('form{border: 1px dotted #FF0000;padding: 2px;}\n');m.addCss('img.cke_hidden{background-image: url('+a.getUrl(this.path+'images/hiddenfield.gif')+');'+'background-position: center center;'+'background-repeat: no-repeat;'+'border: 1px solid #a9a9a9;'+'width: 16px !important;'+'height: 16px !important;'+'}');var o=function(q,r,s){m.addCommand(r,new a.dialogCommand(r));m.ui.addButton(q,{label:n.common[q.charAt(0).toLowerCase()+q.slice(1)],command:r});a.dialog.add(r,s);},p=this.path+'dialogs/';o('Form','form',p+'form.js');o('Checkbox','checkbox',p+'checkbox.js');o('Radio','radio',p+'radio.js');o('TextField','textfield',p+'textfield.js');o('Textarea','textarea',p+'textarea.js');o('Select','select',p+'select.js');o('Button','button',p+'button.js');o('ImageButton','imagebutton',j.getPath('image')+'dialogs/image.js');o('HiddenField','hiddenfield',p+'hiddenfield.js');if(m.addMenuItems)m.addMenuItems({form:{label:n.form.menu,command:'form',group:'form'},checkbox:{label:n.checkboxAndRadio.checkboxTitle,command:'checkbox',group:'checkbox'},radio:{label:n.checkboxAndRadio.radioTitle,command:'radio',group:'radio'},textfield:{label:n.textfield.title,command:'textfield',group:'textfield'},hiddenfield:{label:n.hidden.title,command:'hiddenfield',group:'hiddenfield'},imagebutton:{label:n.image.titleButton,command:'imagebutton',group:'imagebutton'},button:{label:n.button.title,command:'button',group:'button'},select:{label:n.select.title,command:'select',group:'select'},textarea:{label:n.textarea.title,command:'textarea',group:'textarea'}});if(m.contextMenu){m.contextMenu.addListener(function(q){if(q&&q.hasAscendant('form',true)&&!q.isReadOnly())return{form:2};});m.contextMenu.addListener(function(q){if(q&&!q.isReadOnly()){var r=q.getName();if(r=='select')return{select:2};if(r=='textarea')return{textarea:2};if(r=='input')switch(q.getAttribute('type')){case 'button':case 'submit':case 'reset':return{button:2};case 'checkbox':return{checkbox:2};case 'radio':return{radio:2};case 'image':return{imagebutton:2};default:return{textfield:2};}if(r=='img'&&q.data('cke-real-element-type')=='hiddenfield')return{hiddenfield:2};}});}m.on('doubleclick',function(q){var r=q.data.element;if(r.is('form'))q.data.dialog='form';else if(r.is('select'))q.data.dialog='select';else if(r.is('textarea'))q.data.dialog='textarea';else if(r.is('img')&&r.data('cke-real-element-type')=='hiddenfield')q.data.dialog='hiddenfield';else if(r.is('input'))switch(r.getAttribute('type')){case 'button':case 'submit':case 'reset':q.data.dialog='button';
|
|
||||||
break;case 'checkbox':q.data.dialog='checkbox';break;case 'radio':q.data.dialog='radio';break;case 'image':q.data.dialog='imagebutton';break;default:q.data.dialog='textfield';break;}});},afterInit:function(m){var n=m.dataProcessor,o=n&&n.htmlFilter,p=n&&n.dataFilter;if(c)o&&o.addRules({elements:{input:function(q){var r=q.attributes,s=r.type;if(!s)r.type='text';if(s=='checkbox'||s=='radio')r.value=='on'&&delete r.value;}}});if(p)p.addRules({elements:{input:function(q){if(q.attributes.type=='hidden')return m.createFakeParserElement(q,'cke_hidden','hiddenfield');}}});},requires:['image','fakeobjects']});if(c)h.prototype.hasAttribute=e.override(h.prototype.hasAttribute,function(m){return function(n){var q=this;var o=q.$.attributes.getNamedItem(n);if(q.getName()=='input')switch(n){case 'class':return q.$.className.length>0;case 'checked':return!!q.$.checked;case 'value':var p=q.getAttribute('type');return p=='checkbox'||p=='radio'?q.$.value!='on':q.$.value;}return m.apply(q,arguments);};});(function(){var m={canUndo:false,exec:function(o){var p=o.document.createElement('hr');o.insertElement(p);}},n='horizontalrule';j.add(n,{init:function(o){o.addCommand(n,m);o.ui.addButton('HorizontalRule',{label:o.lang.horizontalrule,command:n});}});})();(function(){var m=/^[\t\r\n ]*(?: |\xa0)$/,n='{cke_protected}';function o(U){var V=U.children.length,W=U.children[V-1];while(W&&W.type==3&&!e.trim(W.value))W=U.children[--V];return W;};function p(U){var V=U.parent;return V?e.indexOf(V.children,U):-1;};function q(U,V){var W=U.children,X=o(U);if(X){if((V||!c)&&X.type==1&&X.name=='br')W.pop();if(X.type==3&&m.test(X.value))W.pop();}};function r(U,V,W){if(!V&&(!W||typeof W=='function'&&W(U)===false))return false;if(V&&c&&(document.documentMode>7||U.name in f.tr||U.name in f.$listItem))return false;var X=o(U);return!X||X&&(X.type==1&&X.name=='br'||U.name=='form'&&X.name=='input');};function s(U,V){return function(W){q(W,!U);if(r(W,!U,V))if(U||c)W.add(new a.htmlParser.text('\xa0'));else W.add(new a.htmlParser.element('br',{}));};};var t=f,u=['caption','colgroup','col','thead','tfoot','tbody'],v=e.extend({},t.$block,t.$listItem,t.$tableContent);for(var w in v){if(!('br' in t[w]))delete v[w];}delete v.pre;var x={elements:{},attributeNames:[[/^on/,'data-cke-pa-on']]},y={elements:{}};for(w in v)y.elements[w]=s();var z={elementNames:[[/^cke:/,''],[/^\?xml:namespace$/,'']],attributeNames:[[/^data-cke-(saved|pa)-/,''],[/^data-cke-.*/,''],['hidefocus','']],elements:{$:function(U){var V=U.attributes;
|
|
||||||
if(V){if(V['data-cke-temp'])return false;var W=['name','href','src'],X;for(var Y=0;Y<W.length;Y++){X='data-cke-saved-'+W[Y];X in V&&delete V[W[Y]];}}return U;},table:function(U){var V=U.children.slice(0);V.sort(function(W,X){var Y,Z;if(W.type==1&&X.type==W.type){Y=e.indexOf(u,W.name);Z=e.indexOf(u,X.name);}if(!(Y>-1&&Z>-1&&Y!=Z)){Y=p(W);Z=p(X);}return Y>Z?1:-1;});},embed:function(U){var V=U.parent;if(V&&V.name=='object'){var W=V.attributes.width,X=V.attributes.height;W&&(U.attributes.width=W);X&&(U.attributes.height=X);}},param:function(U){U.children=[];U.isEmpty=true;return U;},a:function(U){if(!(U.children.length||U.attributes.name||U.attributes['data-cke-saved-name']))return false;},span:function(U){if(U.attributes['class']=='Apple-style-span')delete U.name;},pre:function(U){c&&q(U);},html:function(U){delete U.attributes.contenteditable;delete U.attributes['class'];},body:function(U){delete U.attributes.spellcheck;delete U.attributes.contenteditable;},style:function(U){var V=U.children[0];V&&V.value&&(V.value=e.trim(V.value));if(!U.attributes.type)U.attributes.type='text/css';},title:function(U){var V=U.children[0];V&&(V.value=U.attributes['data-cke-title']||'');}},attributes:{'class':function(U,V){return e.ltrim(U.replace(/(?:^|\s+)cke_[^\s]*/g,''))||false;}}};if(c)z.attributes.style=function(U,V){return U.replace(/(^|;)([^\:]+)/g,function(W){return W.toLowerCase();});};function A(U){var V=U.attributes;if(V.contenteditable!='false')V['data-cke-editable']=V.contenteditable?'true':1;V.contenteditable='false';};function B(U){var V=U.attributes;switch(V['data-cke-editable']){case 'true':V.contenteditable='true';break;case '1':delete V.contenteditable;break;}};for(w in {input:1,textarea:1}){x.elements[w]=A;z.elements[w]=B;}var C=/<(a|area|img|input|source)\b([^>]*)>/gi,D=/\b(on\w+|href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,E=/(?:<style(?=[ >])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,F=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,G=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,H=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,I=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi;function J(U){return U.replace(C,function(V,W,X){return '<'+W+X.replace(D,function(Y,Z){if(!/^on/.test(Z)&&X.indexOf('data-cke-saved-'+Z)==-1)return ' data-cke-saved-'+Y+' data-cke-'+a.rnd+'-'+Y;return Y;})+'>';});};function K(U){return U.replace(E,function(V){return '<cke:encoded>'+encodeURIComponent(V)+'</cke:encoded>';});};function L(U){return U.replace(F,function(V,W){return decodeURIComponent(W);
|
|
||||||
});};function M(U){return U.replace(G,'$1cke:$2');};function N(U){return U.replace(H,'$1$2');};function O(U){return U.replace(I,'<cke:$1$2></cke:$1>');};function P(U){return U.replace(/(<pre\b[^>]*>)(\r\n|\n)/g,'$1$2$2');};function Q(U){return U.replace(/<!--(?!{cke_protected})[\s\S]+?-->/g,function(V){return '<!--'+n+'{C}'+encodeURIComponent(V).replace(/--/g,'%2D%2D')+'-->';});};function R(U){return U.replace(/<!--\{cke_protected\}\{C\}([\s\S]+?)-->/g,function(V,W){return decodeURIComponent(W);});};function S(U,V){var W=V._.dataStore;return U.replace(/<!--\{cke_protected\}([\s\S]+?)-->/g,function(X,Y){return decodeURIComponent(Y);}).replace(/\{cke_protected_(\d+)\}/g,function(X,Y){return W&&W[Y]||'';});};function T(U,V){var W=[],X=V.config.protectedSource,Y=V._.dataStore||(V._.dataStore={id:1}),Z=/<\!--\{cke_temp(comment)?\}(\d*?)-->/g,aa=[/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi].concat(X);U=U.replace(/<!--[\s\S]*?-->/g,function(ac){return '<!--{cke_tempcomment}'+(W.push(ac)-1)+'-->';});for(var ab=0;ab<aa.length;ab++)U=U.replace(aa[ab],function(ac){ac=ac.replace(Z,function(ad,ae,af){return W[af];});return/cke_temp(comment)?/.test(ac)?ac:'<!--{cke_temp}'+(W.push(ac)-1)+'-->';});U=U.replace(Z,function(ac,ad,ae){return '<!--'+n+(ad?'{C}':'')+encodeURIComponent(W[ae]).replace(/--/g,'%2D%2D')+'-->';});return U.replace(/(['"]).*?\1/g,function(ac){return ac.replace(/<!--\{cke_protected\}([\s\S]+?)-->/g,function(ad,ae){Y[Y.id]=decodeURIComponent(ae);return '{cke_protected_'+Y.id++ +'}';});});};j.add('htmldataprocessor',{requires:['htmlwriter'],init:function(U){var V=U.dataProcessor=new a.htmlDataProcessor(U);V.writer.forceSimpleAmpersand=U.config.forceSimpleAmpersand;V.dataFilter.addRules(x);V.dataFilter.addRules(y);V.htmlFilter.addRules(z);var W={elements:{}};for(w in v)W.elements[w]=s(true,U.config.fillEmptyBlocks);V.htmlFilter.addRules(W);},onLoad:function(){!('fillEmptyBlocks' in i)&&(i.fillEmptyBlocks=1);}});a.htmlDataProcessor=function(U){var V=this;V.editor=U;V.writer=new a.htmlWriter();V.dataFilter=new a.htmlParser.filter();V.htmlFilter=new a.htmlParser.filter();};a.htmlDataProcessor.prototype={toHtml:function(U,V){U=T(U,this.editor);U=J(U);U=K(U);U=M(U);U=O(U);U=P(U);var W=new h('div');W.setHtml('a'+U);U=W.getHtml().substr(1);U=U.replace(new RegExp(' data-cke-'+a.rnd+'-','ig'),' ');U=N(U);U=L(U);U=R(U);var X=a.htmlParser.fragment.fromHtml(U,V),Y=new a.htmlParser.basicWriter();X.writeHtml(Y,this.dataFilter);U=Y.getHtml(true);U=Q(U);
|
|
||||||
return U;},toDataFormat:function(U,V){var W=this.writer,X=a.htmlParser.fragment.fromHtml(U,V);W.reset();X.writeHtml(W,this.htmlFilter);var Y=W.getHtml(true);Y=R(Y);Y=S(Y,this.editor);return Y;}};})();(function(){j.add('iframe',{requires:['dialog','fakeobjects'],init:function(m){var n='iframe',o=m.lang.iframe;a.dialog.add(n,this.path+'dialogs/iframe.js');m.addCommand(n,new a.dialogCommand(n));m.addCss('img.cke_iframe{background-image: url('+a.getUrl(this.path+'images/placeholder.png')+');'+'background-position: center center;'+'background-repeat: no-repeat;'+'border: 1px solid #a9a9a9;'+'width: 80px;'+'height: 80px;'+'}');m.ui.addButton('Iframe',{label:o.toolbar,command:n});m.on('doubleclick',function(p){var q=p.data.element;if(q.is('img')&&q.data('cke-real-element-type')=='iframe')p.data.dialog='iframe';});if(m.addMenuItems)m.addMenuItems({iframe:{label:o.title,command:'iframe',group:'image'}});if(m.contextMenu)m.contextMenu.addListener(function(p,q){if(p&&p.is('img')&&p.data('cke-real-element-type')=='iframe')return{iframe:2};});},afterInit:function(m){var n=m.dataProcessor,o=n&&n.dataFilter;if(o)o.addRules({elements:{iframe:function(p){return m.createFakeParserElement(p,'cke_iframe','iframe',true);}}});}});})();(function(){j.add('image',{requires:['dialog'],init:function(o){var p='image';a.dialog.add(p,this.path+'dialogs/image.js');o.addCommand(p,new a.dialogCommand(p));o.ui.addButton('Image',{label:o.lang.common.image,command:p});o.on('doubleclick',function(q){var r=q.data.element;if(r.is('img')&&!r.data('cke-realelement')&&!r.isReadOnly())q.data.dialog='image';});if(o.addMenuItems)o.addMenuItems({image:{label:o.lang.image.menu,command:'image',group:'image'}});if(o.contextMenu)o.contextMenu.addListener(function(q,r){if(m(o,q))return{image:2};});},afterInit:function(o){p('left');p('right');p('center');p('block');function p(q){var r=o.getCommand('justify'+q);if(r){if(q=='left'||q=='right')r.on('exec',function(s){var t=m(o),u;if(t){u=n(t);if(u==q){t.removeStyle('float');if(q==n(t))t.removeAttribute('align');}else t.setStyle('float',q);s.cancel();}});r.on('refresh',function(s){var t=m(o),u;if(t){u=n(t);this.setState(u==q?1:q=='right'||q=='left'?2:0);s.cancel();}});}};}});function m(o,p){if(!p){var q=o.getSelection();p=q.getType()==3&&q.getSelectedElement();}if(p&&p.is('img')&&!p.data('cke-realelement')&&!p.isReadOnly())return p;};function n(o){var p=o.getStyle('float');if(p=='inherit'||p=='none')p=0;if(!p)p=o.getAttribute('align');return p;};})();i.image_removeLinkByEmptyURL=true;
|
|
||||||
(function(){var m={ol:1,ul:1},n=d.walker.whitespaces(true),o=d.walker.bookmark(false,true);function p(t){var B=this;if(t.editor.readOnly)return null;var u=t.editor,v=t.data.path,w=v&&v.contains(m),x=v.block||v.blockLimit;if(w)return B.setState(2);if(!B.useIndentClasses&&B.name=='indent')return B.setState(2);if(!x)return B.setState(0);if(B.useIndentClasses){var y=x.$.className.match(B.classNameRegex),z=0;if(y){y=y[1];z=B.indentClassMap[y];}if(B.name=='outdent'&&!z||B.name=='indent'&&z==u.config.indentClasses.length)return B.setState(0);return B.setState(2);}else{var A=parseInt(x.getStyle(r(x)),10);if(isNaN(A))A=0;if(A<=0)return B.setState(0);return B.setState(2);}};function q(t,u){var w=this;w.name=u;w.useIndentClasses=t.config.indentClasses&&t.config.indentClasses.length>0;if(w.useIndentClasses){w.classNameRegex=new RegExp('(?:^|\\s+)('+t.config.indentClasses.join('|')+')(?=$|\\s)');w.indentClassMap={};for(var v=0;v<t.config.indentClasses.length;v++)w.indentClassMap[t.config.indentClasses[v]]=v+1;}w.startDisabled=u=='outdent';};function r(t,u){return(u||t.getComputedStyle('direction'))=='ltr'?'margin-left':'margin-right';};function s(t){return t.type==1&&t.is('li');};q.prototype={exec:function(t){var u=this,v={};function w(M){var N=C.startContainer,O=C.endContainer;while(N&&!N.getParent().equals(M))N=N.getParent();while(O&&!O.getParent().equals(M))O=O.getParent();if(!N||!O)return;var P=N,Q=[],R=false;while(!R){if(P.equals(O))R=true;Q.push(P);P=P.getNext();}if(Q.length<1)return;var S=M.getParents(true);for(var T=0;T<S.length;T++){if(S[T].getName&&m[S[T].getName()]){M=S[T];break;}}var U=u.name=='indent'?1:-1,V=Q[0],W=Q[Q.length-1],X=j.list.listToArray(M,v),Y=X[W.getCustomData('listarray_index')].indent;for(T=V.getCustomData('listarray_index');T<=W.getCustomData('listarray_index');T++){X[T].indent+=U;if(U>0){var Z=X[T].parent;X[T].parent=new h(Z.getName(),Z.getDocument());}}for(T=W.getCustomData('listarray_index')+1;T<X.length&&X[T].indent>Y;T++)X[T].indent+=U;var aa=j.list.arrayToList(X,v,null,t.config.enterMode,M.getDirection());if(u.name=='outdent'){var ab;if((ab=M.getParent())&&ab.is('li')){var ac=aa.listNode.getChildren(),ad=[],ae=ac.count(),af;for(T=ae-1;T>=0;T--){if((af=ac.getItem(T))&&af.is&&af.is('li'))ad.push(af);}}}if(aa)aa.listNode.replace(M);if(ad&&ad.length)for(T=0;T<ad.length;T++){var ag=ad[T],ah=ag;while((ah=ah.getNext())&&ah.is&&ah.getName() in m){if(c&&!ag.getFirst(function(ai){return n(ai)&&o(ai);}))ag.append(C.document.createText('\xa0'));ag.append(ah);
|
|
||||||
}ag.insertAfter(ab);}};function x(){var M=C.createIterator(),N=t.config.enterMode;M.enforceRealBlocks=true;M.enlargeBr=N!=2;var O;while(O=M.getNextParagraph(N==1?'p':'div'))y(O);};function y(M,N){if(M.getCustomData('indent_processed'))return false;if(u.useIndentClasses){var O=M.$.className.match(u.classNameRegex),P=0;if(O){O=O[1];P=u.indentClassMap[O];}if(u.name=='outdent')P--;else P++;if(P<0)return false;P=Math.min(P,t.config.indentClasses.length);P=Math.max(P,0);M.$.className=e.ltrim(M.$.className.replace(u.classNameRegex,''));if(P>0)M.addClass(t.config.indentClasses[P-1]);}else{var Q=r(M,N),R=parseInt(M.getStyle(Q),10);if(isNaN(R))R=0;var S=t.config.indentOffset||40;R+=(u.name=='indent'?1:-1)*S;if(R<0)return false;R=Math.max(R,0);R=Math.ceil(R/S)*S;M.setStyle(Q,R?R+(t.config.indentUnit||'px'):'');if(M.getAttribute('style')==='')M.removeAttribute('style');}h.setMarker(v,M,'indent_processed',1);return true;};var z=t.getSelection(),A=z.createBookmarks(1),B=z&&z.getRanges(1),C,D=B.createIterator();while(C=D.getNextRange()){var E=C.getCommonAncestor(),F=E;while(F&&!(F.type==1&&m[F.getName()]))F=F.getParent();if(!F){var G=C.getEnclosedNode();if(G&&G.type==1&&G.getName() in m){C.setStartAt(G,1);C.setEndAt(G,2);F=G;}}if(F&&C.startContainer.type==1&&C.startContainer.getName() in m){var H=new d.walker(C);H.evaluator=s;C.startContainer=H.next();}if(F&&C.endContainer.type==1&&C.endContainer.getName() in m){H=new d.walker(C);H.evaluator=s;C.endContainer=H.previous();}if(F){var I=F.getFirst(s),J=!!I.getNext(s),K=C.startContainer,L=I.equals(K)||I.contains(K);if(!(L&&(u.name=='indent'||u.useIndentClasses||parseInt(F.getStyle(r(F)),10))&&y(F,!J&&I.getDirection())))w(F);}else x();}h.clearAllMarkers(v);t.forceNextSelectionCheck();z.selectBookmarks(A);}};j.add('indent',{init:function(t){var u=t.addCommand('indent',new q(t,'indent')),v=t.addCommand('outdent',new q(t,'outdent'));t.ui.addButton('Indent',{label:t.lang.indent,command:'indent'});t.ui.addButton('Outdent',{label:t.lang.outdent,command:'outdent'});t.on('selectionChange',e.bind(p,u));t.on('selectionChange',e.bind(p,v));if(b.ie6Compat||b.ie7Compat)t.addCss('ul,ol{\tmargin-left: 0px;\tpadding-left: 40px;}');t.on('dirChanged',function(w){var x=new d.range(t.document);x.setStartBefore(w.data.node);x.setEndAfter(w.data.node);var y=new d.walker(x),z;while(z=y.next()){if(z.type==1){if(!z.equals(w.data.node)&&z.getDirection()){x.setStartAfter(z);y=new d.walker(x);continue;}var A=t.config.indentClasses;if(A){var B=w.data.dir=='ltr'?['_rtl','']:['','_rtl'];
|
|
||||||
for(var C=0;C<A.length;C++){if(z.hasClass(A[C]+B[0])){z.removeClass(A[C]+B[0]);z.addClass(A[C]+B[1]);}}}var D=z.getStyle('margin-right'),E=z.getStyle('margin-left');D?z.setStyle('margin-left',D):z.removeStyle('margin-left');E?z.setStyle('margin-right',E):z.removeStyle('margin-right');}}});},requires:['domiterator','list']});})();(function(){function m(q,r){r=r===undefined||r;var s;if(r)s=q.getComputedStyle('text-align');else{while(!q.hasAttribute||!(q.hasAttribute('align')||q.getStyle('text-align'))){var t=q.getParent();if(!t)break;q=t;}s=q.getStyle('text-align')||q.getAttribute('align')||'';}s&&(s=s.replace(/(?:-(?:moz|webkit)-)?(?:start|auto)/i,''));!s&&r&&(s=q.getComputedStyle('direction')=='rtl'?'right':'left');return s;};function n(q){if(q.editor.readOnly)return;q.editor.getCommand(this.name).refresh(q.data.path);};function o(q,r,s){var u=this;u.editor=q;u.name=r;u.value=s;var t=q.config.justifyClasses;if(t){switch(s){case 'left':u.cssClassName=t[0];break;case 'center':u.cssClassName=t[1];break;case 'right':u.cssClassName=t[2];break;case 'justify':u.cssClassName=t[3];break;}u.cssClassRegex=new RegExp('(?:^|\\s+)(?:'+t.join('|')+')(?=$|\\s)');}};function p(q){var r=q.editor,s=new d.range(r.document);s.setStartBefore(q.data.node);s.setEndAfter(q.data.node);var t=new d.walker(s),u;while(u=t.next()){if(u.type==1){if(!u.equals(q.data.node)&&u.getDirection()){s.setStartAfter(u);t=new d.walker(s);continue;}var v=r.config.justifyClasses;if(v)if(u.hasClass(v[0])){u.removeClass(v[0]);u.addClass(v[2]);}else if(u.hasClass(v[2])){u.removeClass(v[2]);u.addClass(v[0]);}var w='text-align',x=u.getStyle(w);if(x=='left')u.setStyle(w,'right');else if(x=='right')u.setStyle(w,'left');}}};o.prototype={exec:function(q){var C=this;var r=q.getSelection(),s=q.config.enterMode;if(!r)return;var t=r.createBookmarks(),u=r.getRanges(true),v=C.cssClassName,w,x,y=q.config.useComputedState;y=y===undefined||y;for(var z=u.length-1;z>=0;z--){w=u[z].createIterator();w.enlargeBr=s!=2;while(x=w.getNextParagraph(s==1?'p':'div')){x.removeAttribute('align');x.removeStyle('text-align');var A=v&&(x.$.className=e.ltrim(x.$.className.replace(C.cssClassRegex,''))),B=C.state==2&&(!y||m(x,true)!=C.value);if(v){if(B)x.addClass(v);else if(!A)x.removeAttribute('class');}else if(B)x.setStyle('text-align',C.value);}}q.focus();q.forceNextSelectionCheck();r.selectBookmarks(t);},refresh:function(q){var r=q.block||q.blockLimit;this.setState(r.getName()!='body'&&m(r,this.editor.config.useComputedState)==this.value?1:2);
|
|
||||||
}};j.add('justify',{init:function(q){var r=new o(q,'justifyleft','left'),s=new o(q,'justifycenter','center'),t=new o(q,'justifyright','right'),u=new o(q,'justifyblock','justify');q.addCommand('justifyleft',r);q.addCommand('justifycenter',s);q.addCommand('justifyright',t);q.addCommand('justifyblock',u);q.ui.addButton('JustifyLeft',{label:q.lang.justify.left,command:'justifyleft'});q.ui.addButton('JustifyCenter',{label:q.lang.justify.center,command:'justifycenter'});q.ui.addButton('JustifyRight',{label:q.lang.justify.right,command:'justifyright'});q.ui.addButton('JustifyBlock',{label:q.lang.justify.block,command:'justifyblock'});q.on('selectionChange',e.bind(n,r));q.on('selectionChange',e.bind(n,t));q.on('selectionChange',e.bind(n,s));q.on('selectionChange',e.bind(n,u));q.on('dirChanged',p);},requires:['domiterator']});})();j.add('keystrokes',{beforeInit:function(m){m.keystrokeHandler=new a.keystrokeHandler(m);m.specialKeys={};},init:function(m){var n=m.config.keystrokes,o=m.config.blockedKeystrokes,p=m.keystrokeHandler.keystrokes,q=m.keystrokeHandler.blockedKeystrokes;for(var r=0;r<n.length;r++)p[n[r][0]]=n[r][1];for(r=0;r<o.length;r++)q[o[r]]=1;}});a.keystrokeHandler=function(m){var n=this;if(m.keystrokeHandler)return m.keystrokeHandler;n.keystrokes={};n.blockedKeystrokes={};n._={editor:m};return n;};(function(){var m,n=function(p){p=p.data;var q=p.getKeystroke(),r=this.keystrokes[q],s=this._.editor;m=s.fire('key',{keyCode:q})===true;if(!m){if(r){var t={from:'keystrokeHandler'};m=s.execCommand(r,t)!==false;}if(!m){var u=s.specialKeys[q];m=u&&u(s)===true;if(!m)m=!!this.blockedKeystrokes[q];}}if(m)p.preventDefault(true);return!m;},o=function(p){if(m){m=false;p.data.preventDefault(true);}};a.keystrokeHandler.prototype={attach:function(p){p.on('keydown',n,this);if(b.opera||b.gecko&&b.mac)p.on('keypress',o,this);}};})();i.blockedKeystrokes=[1114112+66,1114112+73,1114112+85];i.keystrokes=[[4456448+121,'toolbarFocus'],[4456448+122,'elementsPathFocus'],[2228224+121,'contextMenu'],[1114112+2228224+121,'contextMenu'],[1114112+90,'undo'],[1114112+89,'redo'],[1114112+2228224+90,'redo'],[1114112+76,'link'],[1114112+66,'bold'],[1114112+73,'italic'],[1114112+85,'underline'],[4456448+(c||b.webkit?189:109),'toolbarCollapse'],[4456448+48,'a11yHelp']];j.add('link',{requires:['fakeobjects','dialog'],init:function(m){m.addCommand('link',new a.dialogCommand('link'));m.addCommand('anchor',new a.dialogCommand('anchor'));m.addCommand('unlink',new a.unlinkCommand());m.addCommand('removeAnchor',new a.removeAnchorCommand());
|
|
||||||
m.ui.addButton('Link',{label:m.lang.link.toolbar,command:'link'});m.ui.addButton('Unlink',{label:m.lang.unlink,command:'unlink'});m.ui.addButton('Anchor',{label:m.lang.anchor.toolbar,command:'anchor'});a.dialog.add('link',this.path+'dialogs/link.js');a.dialog.add('anchor',this.path+'dialogs/anchor.js');var n=m.lang.dir=='rtl'?'right':'left',o='background:url('+a.getUrl(this.path+'images/anchor.gif')+') no-repeat '+n+' center;'+'border:1px dotted #00f;';m.addCss('a.cke_anchor,a.cke_anchor_empty'+(c&&b.version<7?'':',a[name],a[data-cke-saved-name]')+'{'+o+'padding-'+n+':18px;'+'cursor:auto;'+'}'+(c?'a.cke_anchor_empty{display:inline-block;}':'')+'img.cke_anchor'+'{'+o+'width:16px;'+'min-height:15px;'+'height:1.15em;'+'vertical-align:'+(b.opera?'middle':'text-bottom')+';'+'}');m.on('selectionChange',function(p){if(m.readOnly)return;var q=m.getCommand('unlink'),r=p.data.path.lastElement&&p.data.path.lastElement.getAscendant('a',true);if(r&&r.getName()=='a'&&r.getAttribute('href')&&r.getChildCount())q.setState(2);else q.setState(0);});m.on('doubleclick',function(p){var q=j.link.getSelectedLink(m)||p.data.element;if(!q.isReadOnly())if(q.is('a')){p.data.dialog=q.getAttribute('name')&&(!q.getAttribute('href')||!q.getChildCount())?'anchor':'link';m.getSelection().selectElement(q);}else if(j.link.tryRestoreFakeAnchor(m,q))p.data.dialog='anchor';});if(m.addMenuItems)m.addMenuItems({anchor:{label:m.lang.anchor.menu,command:'anchor',group:'anchor',order:1},removeAnchor:{label:m.lang.anchor.remove,command:'removeAnchor',group:'anchor',order:5},link:{label:m.lang.link.menu,command:'link',group:'link',order:1},unlink:{label:m.lang.unlink,command:'unlink',group:'link',order:5}});if(m.contextMenu)m.contextMenu.addListener(function(p,q){if(!p||p.isReadOnly())return null;var r=j.link.tryRestoreFakeAnchor(m,p);if(!r&&!(r=j.link.getSelectedLink(m)))return null;var s={};if(r.getAttribute('href')&&r.getChildCount())s={link:2,unlink:2};if(r&&r.hasAttribute('name'))s.anchor=s.removeAnchor=2;return s;});},afterInit:function(m){var n=m.dataProcessor,o=n&&n.dataFilter,p=n&&n.htmlFilter,q=m._.elementsPath&&m._.elementsPath.filters;if(o)o.addRules({elements:{a:function(r){var s=r.attributes;if(!s.name)return null;var t=!r.children.length;if(j.link.synAnchorSelector){var u=t?'cke_anchor_empty':'cke_anchor',v=s['class'];if(s.name&&(!v||v.indexOf(u)<0))s['class']=(v||'')+' '+u;if(t&&j.link.emptyAnchorFix){s.contenteditable='false';s['data-cke-editable']=1;}}else if(j.link.fakeAnchor&&t)return m.createFakeParserElement(r,'cke_anchor','anchor');
|
|
||||||
return null;}}});if(j.link.emptyAnchorFix&&p)p.addRules({elements:{a:function(r){delete r.attributes.contenteditable;}}});if(q)q.push(function(r,s){if(s=='a')if(j.link.tryRestoreFakeAnchor(m,r)||r.getAttribute('name')&&(!r.getAttribute('href')||!r.getChildCount()))return 'anchor';});}});j.link={getSelectedLink:function(m){try{var n=m.getSelection();if(n.getType()==3){var o=n.getSelectedElement();if(o.is('a'))return o;}var p=n.getRanges(true)[0];p.shrink(2);var q=p.getCommonAncestor();return q.getAscendant('a',true);}catch(r){return null;}},fakeAnchor:b.opera||b.webkit,synAnchorSelector:c,emptyAnchorFix:c&&b.version<8,tryRestoreFakeAnchor:function(m,n){if(n&&n.data('cke-real-element-type')&&n.data('cke-real-element-type')=='anchor'){var o=m.restoreRealElement(n);if(o.data('cke-saved-name'))return o;}}};a.unlinkCommand=function(){};a.unlinkCommand.prototype={exec:function(m){var n=m.getSelection(),o=n.createBookmarks(),p=n.getRanges(),q,r;for(var s=0;s<p.length;s++){q=p[s].getCommonAncestor(true);r=q.getAscendant('a',true);if(!r)continue;p[s].selectNodeContents(r);}n.selectRanges(p);m.document.$.execCommand('unlink',false,null);n.selectBookmarks(o);},startDisabled:true};a.removeAnchorCommand=function(){};a.removeAnchorCommand.prototype={exec:function(m){var n=m.getSelection(),o=n.createBookmarks(),p;if(n&&(p=n.getSelectedElement())&&(j.link.fakeAnchor&&!p.getChildCount()?j.link.tryRestoreFakeAnchor(m,p):p.is('a')))p.remove(1);else if(p=j.link.getSelectedLink(m))if(p.hasAttribute('href')){p.removeAttributes({name:1,'data-cke-saved-name':1});p.removeClass('cke_anchor');}else p.remove(1);n.selectBookmarks(o);}};e.extend(i,{linkShowAdvancedTab:true,linkShowTargetTab:true});(function(){var m={ol:1,ul:1},n=/^[\n\r\t ]*$/,o=d.walker.whitespaces(),p=d.walker.bookmark(),q=function(N){return!(o(N)||p(N));},r=d.walker.bogus();function s(N){var O,P,Q;if(O=N.getDirection()){P=N.getParent();while(P&&!(Q=P.getDirection()))P=P.getParent();if(O==Q)N.removeAttribute('dir');}};function t(N,O){var P=N.getAttribute('style');P&&O.setAttribute('style',P.replace(/([^;])$/,'$1;')+(O.getAttribute('style')||''));};j.list={listToArray:function(N,O,P,Q,R){if(!m[N.getName()])return[];if(!Q)Q=0;if(!P)P=[];for(var S=0,T=N.getChildCount();S<T;S++){var U=N.getChild(S);if(U.type==1&&U.getName() in f.$list)j.list.listToArray(U,O,P,Q+1);if(U.$.nodeName.toLowerCase()!='li')continue;var V={parent:N,indent:Q,element:U,contents:[]};if(!R){V.grandparent=N.getParent();if(V.grandparent&&V.grandparent.$.nodeName.toLowerCase()=='li')V.grandparent=V.grandparent.getParent();
|
|
||||||
}else V.grandparent=R;if(O)h.setMarker(O,U,'listarray_index',P.length);P.push(V);for(var W=0,X=U.getChildCount(),Y;W<X;W++){Y=U.getChild(W);if(Y.type==1&&m[Y.getName()])j.list.listToArray(Y,O,P,Q+1,V.grandparent);else V.contents.push(Y);}}return P;},arrayToList:function(N,O,P,Q,R){if(!P)P=0;if(!N||N.length<P+1)return null;var S,T=N[P].parent.getDocument(),U=new d.documentFragment(T),V=null,W=P,X=Math.max(N[P].indent,0),Y=null,Z,aa,ab=Q==1?'p':'div';while(1){var ac=N[W],ad=ac.grandparent;Z=ac.element.getDirection(1);if(ac.indent==X){if(!V||N[W].parent.getName()!=V.getName()){V=N[W].parent.clone(false,1);R&&V.setAttribute('dir',R);U.append(V);}Y=V.append(ac.element.clone(0,1));if(Z!=V.getDirection(1))Y.setAttribute('dir',Z);for(S=0;S<ac.contents.length;S++)Y.append(ac.contents[S].clone(1,1));W++;}else if(ac.indent==Math.max(X,0)+1){var ae=N[W-1].element.getDirection(1),af=j.list.arrayToList(N,null,W,Q,ae!=Z?Z:null);if(!Y.getChildCount()&&c&&!(T.$.documentMode>7))Y.append(T.createText('\xa0'));Y.append(af.listNode);W=af.nextIndex;}else if(ac.indent==-1&&!P&&ad){if(m[ad.getName()]){Y=ac.element.clone(false,true);if(Z!=ad.getDirection(1))Y.setAttribute('dir',Z);}else Y=new d.documentFragment(T);var ag=ad.getDirection(1)!=Z,ah=ac.element,ai=ah.getAttribute('class'),aj=ah.getAttribute('style'),ak=Y.type==11&&(Q!=2||ag||aj||ai),al,am=ac.contents.length;for(S=0;S<am;S++){al=ac.contents[S];if(al.type==1&&al.isBlockBoundary()){if(ag&&!al.getDirection())al.setAttribute('dir',Z);t(ah,al);ai&&al.addClass(ai);}else if(ak){if(!aa){aa=T.createElement(ab);ag&&aa.setAttribute('dir',Z);}aj&&aa.setAttribute('style',aj);ai&&aa.setAttribute('class',ai);aa.append(al.clone(1,1));}Y.append(aa||al.clone(1,1));}if(Y.type==11&&W!=N.length-1){var an=Y.getLast();if(an&&an.type==1&&an.getAttribute('type')=='_moz')an.remove();if(!(an=Y.getLast(q)&&an.type==1&&an.getName() in f.$block))Y.append(T.createElement('br'));}var ao=Y.$.nodeName.toLowerCase();if(!c&&(ao=='div'||ao=='p'))Y.appendBogus();U.append(Y);V=null;W++;}else return null;aa=null;if(N.length<=W||Math.max(N[W].indent,0)<X)break;}if(O){var ap=U.getFirst(),aq=N[0].parent;while(ap){if(ap.type==1){h.clearMarkers(O,ap);if(ap.getName() in f.$listItem)s(ap);}ap=ap.getNextSourceNode();}}return{listNode:U,nextIndex:W};}};function u(N){if(N.editor.readOnly)return null;var O=N.data.path,P=O.blockLimit,Q=O.elements,R,S;for(S=0;S<Q.length&&(R=Q[S])&&!R.equals(P);S++){if(m[Q[S].getName()])return this.setState(this.type==Q[S].getName()?1:2);}return this.setState(2);
|
|
||||||
};function v(N,O,P,Q){var R=j.list.listToArray(O.root,P),S=[];for(var T=0;T<O.contents.length;T++){var U=O.contents[T];U=U.getAscendant('li',true);if(!U||U.getCustomData('list_item_processed'))continue;S.push(U);h.setMarker(P,U,'list_item_processed',true);}var V=O.root,W=V.getDocument(),X,Y;for(T=0;T<S.length;T++){var Z=S[T].getCustomData('listarray_index');X=R[Z].parent;if(!X.is(this.type)){Y=W.createElement(this.type);X.copyAttributes(Y,{start:1,type:1});Y.removeStyle('list-style-type');R[Z].parent=Y;}}var aa=j.list.arrayToList(R,P,null,N.config.enterMode),ab,ac=aa.listNode.getChildCount();for(T=0;T<ac&&(ab=aa.listNode.getChild(T));T++){if(ab.getName()==this.type)Q.push(ab);}aa.listNode.replace(O.root);};var w=/^h[1-6]$/;function x(N,O,P){var Q=O.contents,R=O.root.getDocument(),S=[];if(Q.length==1&&Q[0].equals(O.root)){var T=R.createElement('div');Q[0].moveChildren&&Q[0].moveChildren(T);Q[0].append(T);Q[0]=T;}var U=O.contents[0].getParent();for(var V=0;V<Q.length;V++)U=U.getCommonAncestor(Q[V].getParent());var W=N.config.useComputedState,X,Y;W=W===undefined||W;for(V=0;V<Q.length;V++){var Z=Q[V],aa;while(aa=Z.getParent()){if(aa.equals(U)){S.push(Z);if(!Y&&Z.getDirection())Y=1;var ab=Z.getDirection(W);if(X!==null)if(X&&X!=ab)X=null;else X=ab;break;}Z=aa;}}if(S.length<1)return;var ac=S[S.length-1].getNext(),ad=R.createElement(this.type);P.push(ad);var ae,af;while(S.length){ae=S.shift();af=R.createElement('li');if(ae.is('pre')||w.test(ae.getName()))ae.appendTo(af);else{ae.copyAttributes(af);if(X&&ae.getDirection()){af.removeStyle('direction');af.removeAttribute('dir');}ae.moveChildren(af);ae.remove();}af.appendTo(ad);}if(X&&Y)ad.setAttribute('dir',X);if(ac)ad.insertBefore(ac);else ad.appendTo(U);};function y(N,O,P){var Q=j.list.listToArray(O.root,P),R=[];for(var S=0;S<O.contents.length;S++){var T=O.contents[S];T=T.getAscendant('li',true);if(!T||T.getCustomData('list_item_processed'))continue;R.push(T);h.setMarker(P,T,'list_item_processed',true);}var U=null;for(S=0;S<R.length;S++){var V=R[S].getCustomData('listarray_index');Q[V].indent=-1;U=V;}for(S=U+1;S<Q.length;S++){if(Q[S].indent>Q[S-1].indent+1){var W=Q[S-1].indent+1-Q[S].indent,X=Q[S].indent;while(Q[S]&&Q[S].indent>=X){Q[S].indent+=W;S++;}S--;}}var Y=j.list.arrayToList(Q,P,null,N.config.enterMode,O.root.getAttribute('dir')),Z=Y.listNode,aa,ab;function ac(ad){if((aa=Z[ad?'getFirst':'getLast']())&&!(aa.is&&aa.isBlockBoundary())&&(ab=O.root[ad?'getPrevious':'getNext'](d.walker.whitespaces(true)))&&!(ab.is&&ab.isBlockBoundary({br:1})))N.document.createElement('br')[ad?'insertBefore':'insertAfter'](aa);
|
|
||||||
};ac(true);ac();Z.replace(O.root);};function z(N,O){this.name=N;this.type=O;};var A=d.walker.nodeType(1);function B(N,O,P,Q){var R,S;while(R=N[Q?'getLast':'getFirst'](A)){if((S=R.getDirection(1))!==O.getDirection(1))R.setAttribute('dir',S);R.remove();P?R[Q?'insertBefore':'insertAfter'](P):O.append(R,Q);}};z.prototype={exec:function(N){var aq=this;var O=N.document,P=N.config,Q=N.getSelection(),R=Q&&Q.getRanges(true);if(!R||R.length<1)return;if(aq.state==2){var S=O.getBody();if(!S.getFirst(q)){P.enterMode==2?S.appendBogus():R[0].fixBlock(1,P.enterMode==1?'p':'div');Q.selectRanges(R);}else{var T=R.length==1&&R[0],U=T&&T.getEnclosedNode();if(U&&U.is&&aq.type==U.getName())aq.setState(1);}}var V=Q.createBookmarks(true),W=[],X={},Y=R.createIterator(),Z=0;while((T=Y.getNextRange())&&++Z){var aa=T.getBoundaryNodes(),ab=aa.startNode,ac=aa.endNode;if(ab.type==1&&ab.getName()=='td')T.setStartAt(aa.startNode,1);if(ac.type==1&&ac.getName()=='td')T.setEndAt(aa.endNode,2);var ad=T.createIterator(),ae;ad.forceBrBreak=aq.state==2;while(ae=ad.getNextParagraph()){if(ae.getCustomData('list_block'))continue;else h.setMarker(X,ae,'list_block',1);var af=new d.elementPath(ae),ag=af.elements,ah=ag.length,ai=null,aj=0,ak=af.blockLimit,al;for(var am=ah-1;am>=0&&(al=ag[am]);am--){if(m[al.getName()]&&ak.contains(al)){ak.removeCustomData('list_group_object_'+Z);var an=al.getCustomData('list_group_object');if(an)an.contents.push(ae);else{an={root:al,contents:[ae]};W.push(an);h.setMarker(X,al,'list_group_object',an);}aj=1;break;}}if(aj)continue;var ao=ak;if(ao.getCustomData('list_group_object_'+Z))ao.getCustomData('list_group_object_'+Z).contents.push(ae);else{an={root:ao,contents:[ae]};h.setMarker(X,ao,'list_group_object_'+Z,an);W.push(an);}}}var ap=[];while(W.length>0){an=W.shift();if(aq.state==2){if(m[an.root.getName()])v.call(aq,N,an,X,ap);else x.call(aq,N,an,ap);}else if(aq.state==1&&m[an.root.getName()])y.call(aq,N,an,X);}for(am=0;am<ap.length;am++)C(ap[am]);h.clearAllMarkers(X);Q.selectBookmarks(V);N.focus();}};function C(N){var O;(O=function(P){var Q=N[P?'getPrevious':'getNext'](q);if(Q&&Q.type==1&&Q.is(N.getName())){B(N,Q,null,!P);N.remove();N=Q;}})();O(1);};var D=f,E=/[\t\r\n ]*(?: |\xa0)$/;function F(N,O){var P,Q=N.children,R=Q.length;for(var S=0;S<R;S++){P=Q[S];if(P.name&&P.name in O)return S;}return R;};function G(N){return function(O){var P=O.children,Q=F(O,D.$list),R=P[Q],S=R&&R.previous,T;if(S&&(S.name&&S.name=='br'||S.value&&(T=S.value.match(E)))){var U=S;if(!(T&&T.index)&&U==P[0])P[0]=N||c?new a.htmlParser.text('\xa0'):new a.htmlParser.element('br',{});
|
|
||||||
else if(U.name=='br')P.splice(Q-1,1);else U.value=U.value.replace(E,'');}};};var H={elements:{}};for(var I in D.$listItem)H.elements[I]=G();var J={elements:{}};for(I in D.$listItem)J.elements[I]=G(true);function K(N){return N.type==1&&(N.getName() in f.$block||N.getName() in f.$listItem)&&f[N.getName()]['#'];};function L(N,O,P){N.fire('saveSnapshot');P.enlarge(3);var Q=P.extractContents();O.trim(false,true);var R=O.createBookmark(),S=new d.elementPath(O.startContainer),T=S.block,U=S.lastElement.getAscendant('li',1)||T,V=new d.elementPath(P.startContainer),W=V.contains(f.$listItem),X=V.contains(f.$list),Y;if(T){var Z=T.getBogus();Z&&Z.remove();}else if(X){Y=X.getPrevious(q);if(Y&&r(Y))Y.remove();}Y=Q.getLast();if(Y&&Y.type==1&&Y.is('br'))Y.remove();var aa=O.startContainer.getChild(O.startOffset);if(aa)Q.insertBefore(aa);else O.startContainer.append(Q);if(W){var ab=M(W);if(ab)if(U.contains(W)){B(ab,W.getParent(),W);ab.remove();}else U.append(ab);}while(P.checkStartOfBlock()&&P.checkEndOfBlock()){V=new d.elementPath(P.startContainer);var ac=V.block,ad;if(ac.is('li')){ad=ac.getParent();if(ac.equals(ad.getLast(q))&&ac.equals(ad.getFirst(q)))ac=ad;}P.moveToPosition(ac,3);ac.remove();}var ae=P.clone(),af=N.document.getBody();ae.setEndAt(af,2);var ag=new d.walker(ae);ag.evaluator=function(ai){return q(ai)&&!r(ai);};var ah=ag.next();if(ah&&ah.type==1&&ah.getName() in f.$list)C(ah);O.moveToBookmark(R);O.select();N.selectionChange(1);N.fire('saveSnapshot');};function M(N){var O=N.getLast(q);return O&&O.type==1&&O.getName() in m?O:null;};j.add('list',{init:function(N){var O=N.addCommand('numberedlist',new z('numberedlist','ol')),P=N.addCommand('bulletedlist',new z('bulletedlist','ul'));N.ui.addButton('NumberedList',{label:N.lang.numberedlist,command:'numberedlist'});N.ui.addButton('BulletedList',{label:N.lang.bulletedlist,command:'bulletedlist'});N.on('selectionChange',e.bind(u,O));N.on('selectionChange',e.bind(u,P));N.on('key',function(Q){var R=Q.data.keyCode;if(N.mode=='wysiwyg'&&R in {8:1,46:1}){var S=N.getSelection(),T=S.getRanges()[0];if(!T.collapsed)return;var U=new d.elementPath(T.startContainer),V=R==8,W=N.document.getBody(),X=new d.walker(T.clone());X.evaluator=function(ai){return q(ai)&&!r(ai);};X.guard=function(ai,aj){return!(aj&&ai.type==1&&ai.is('table'));};var Y=T.clone();if(V){var Z,aa;if((Z=U.contains(m))&&T.checkBoundaryOfElement(Z,1)&&(Z=Z.getParent())&&Z.is('li')&&(Z=M(Z))){aa=Z;Z=Z.getPrevious(q);Y.moveToPosition(Z&&r(Z)?Z:aa,3);}else{X.range.setStartAt(W,1);
|
|
||||||
X.range.setEnd(T.startContainer,T.startOffset);Z=X.previous();if(Z&&Z.type==1&&(Z.getName() in m||Z.is('li'))){if(!Z.is('li')){X.range.selectNodeContents(Z);X.reset();X.evaluator=K;Z=X.previous();}aa=Z;Y.moveToElementEditEnd(aa);}}if(aa){L(N,Y,T);Q.cancel();}else{var ab=U.contains(m),ac;if(ab&&T.checkBoundaryOfElement(ab,1)){ac=ab.getFirst(q);if(T.checkBoundaryOfElement(ac,1)){Z=ab.getPrevious(q);if(M(ac)){if(Z){T.moveToElementEditEnd(Z);T.select();}Q.cancel();}else{N.execCommand('outdent');Q.cancel();}}}}}else{var ad,ae;ac=T.startContainer.getAscendant('li',1);if(ac){X.range.setEndAt(W,2);var af=ac.getLast(q),ag=af&&K(af)?af:ac,ah=0;ad=X.next();if(ad&&ad.type==1&&ad.getName() in m&&ad.equals(af)){ah=1;ad=X.next();}else if(T.checkBoundaryOfElement(ag,2))ah=1;if(ah&&ad){ae=T.clone();ae.moveToElementEditStart(ad);L(N,Y,ae);Q.cancel();}}else{X.range.setEndAt(W,2);ad=X.next();if(ad&&ad.type==1&&ad.getName() in m){ad=ad.getFirst(q);if(U.block&&T.checkStartOfBlock()&&T.checkEndOfBlock()){U.block.remove();T.moveToElementEditStart(ad);T.select();Q.cancel();}else if(M(ad)){T.moveToElementEditStart(ad);T.select();Q.cancel();}else{ae=T.clone();ae.moveToElementEditStart(ad);L(N,Y,ae);Q.cancel();}}}}setTimeout(function(){N.selectionChange(1);});}});},afterInit:function(N){var O=N.dataProcessor;if(O){O.dataFilter.addRules(H);O.htmlFilter.addRules(J);}},requires:['domiterator']});})();(function(){j.liststyle={requires:['dialog'],init:function(m){m.addCommand('numberedListStyle',new a.dialogCommand('numberedListStyle'));a.dialog.add('numberedListStyle',this.path+'dialogs/liststyle.js');m.addCommand('bulletedListStyle',new a.dialogCommand('bulletedListStyle'));a.dialog.add('bulletedListStyle',this.path+'dialogs/liststyle.js');if(m.addMenuItems){m.addMenuGroup('list',108);m.addMenuItems({numberedlist:{label:m.lang.list.numberedTitle,group:'list',command:'numberedListStyle'},bulletedlist:{label:m.lang.list.bulletedTitle,group:'list',command:'bulletedListStyle'}});}if(m.contextMenu)m.contextMenu.addListener(function(n,o){if(!n||n.isReadOnly())return null;while(n){var p=n.getName();if(p=='ol')return{numberedlist:2};else if(p=='ul')return{bulletedlist:2};n=n.getParent();}return null;});}};j.add('liststyle',j.liststyle);})();(function(){function m(s){if(!s||s.type!=1||s.getName()!='form')return[];var t=[],u=['style','className'];for(var v=0;v<u.length;v++){var w=u[v],x=s.$.elements.namedItem(w);if(x){var y=new h(x);t.push([y,y.nextSibling]);y.remove();}}return t;};function n(s,t){if(!s||s.type!=1||s.getName()!='form')return;
|
|
||||||
if(t.length>0)for(var u=t.length-1;u>=0;u--){var v=t[u][0],w=t[u][1];if(w)v.insertBefore(w);else v.appendTo(s);}};function o(s,t){var u=m(s),v={},w=s.$;if(!t){v['class']=w.className||'';w.className='';}v.inline=w.style.cssText||'';if(!t)w.style.cssText='position: static; overflow: visible';n(u);return v;};function p(s,t){var u=m(s),v=s.$;if('class' in t)v.className=t['class'];if('inline' in t)v.style.cssText=t.inline;n(u);};function q(s){var t=a.instances;for(var u in t){var v=t[u];if(v.mode=='wysiwyg'&&!v.readOnly){var w=v.document.getBody();w.setAttribute('contentEditable',false);w.setAttribute('contentEditable',true);}}if(s.focusManager.hasFocus){s.toolbox.focus();s.focus();}};function r(s){if(!c||b.version>6)return null;var t=h.createFromHtml('<iframe frameborder="0" tabindex="-1" src="javascript:void((function(){document.open();'+(b.isCustomDomain()?"document.domain='"+this.getDocument().$.domain+"';":'')+'document.close();'+'})())"'+' style="display:block;position:absolute;z-index:-1;'+'progid:DXImageTransform.Microsoft.Alpha(opacity=0);'+'"></iframe>');return s.append(t,true);};j.add('maximize',{init:function(s){var t=s.lang,u=a.document,v=u.getWindow(),w,x,y,z;function A(){var C=v.getViewPaneSize();z&&z.setStyles({width:C.width+'px',height:C.height+'px'});s.resize(C.width,C.height,null,true);};var B=2;s.addCommand('maximize',{modes:{wysiwyg:!b.iOS,source:!b.iOS},readOnly:1,editorFocus:false,exec:function(){var C=s.container.getChild(1),D=s.getThemeSpace('contents');if(s.mode=='wysiwyg'){var E=s.getSelection();w=E&&E.getRanges();x=v.getScrollPosition();}else{var F=s.textarea.$;w=!c&&[F.selectionStart,F.selectionEnd];x=[F.scrollLeft,F.scrollTop];}if(this.state==2){v.on('resize',A);y=v.getScrollPosition();var G=s.container;while(G=G.getParent()){G.setCustomData('maximize_saved_styles',o(G));G.setStyle('z-index',s.config.baseFloatZIndex-1);}D.setCustomData('maximize_saved_styles',o(D,true));C.setCustomData('maximize_saved_styles',o(C,true));var H={overflow:b.webkit?'':'hidden',width:0,height:0};u.getDocumentElement().setStyles(H);!b.gecko&&u.getDocumentElement().setStyle('position','fixed');!(b.gecko&&b.quirks)&&u.getBody().setStyles(H);c?setTimeout(function(){v.$.scrollTo(0,0);},0):v.$.scrollTo(0,0);C.setStyle('position',b.gecko&&b.quirks?'fixed':'absolute');C.$.offsetLeft;C.setStyles({'z-index':s.config.baseFloatZIndex-1,left:'0px',top:'0px'});z=r(C);C.addClass('cke_maximized');A();var I=C.getDocumentPosition();C.setStyles({left:-1*I.x+'px',top:-1*I.y+'px'});
|
|
||||||
b.gecko&&q(s);}else if(this.state==1){v.removeListener('resize',A);var J=[D,C];for(var K=0;K<J.length;K++){p(J[K],J[K].getCustomData('maximize_saved_styles'));J[K].removeCustomData('maximize_saved_styles');}G=s.container;while(G=G.getParent()){p(G,G.getCustomData('maximize_saved_styles'));G.removeCustomData('maximize_saved_styles');}c?setTimeout(function(){v.$.scrollTo(y.x,y.y);},0):v.$.scrollTo(y.x,y.y);C.removeClass('cke_maximized');if(b.webkit){C.setStyle('display','inline');setTimeout(function(){C.setStyle('display','block');},0);}if(z){z.remove();z=null;}s.fire('resize');}this.toggleState();var L=this.uiItems[0];if(L){var M=this.state==2?t.maximize:t.minimize,N=s.element.getDocument().getById(L._.id);N.getChild(1).setHtml(M);N.setAttribute('title',M);N.setAttribute('href','javascript:void("'+M+'");');}if(s.mode=='wysiwyg'){if(w){b.gecko&&q(s);s.getSelection().selectRanges(w);var O=s.getSelection().getStartElement();O&&O.scrollIntoView(true);}else v.$.scrollTo(x.x,x.y);}else{if(w){F.selectionStart=w[0];F.selectionEnd=w[1];}F.scrollLeft=x[0];F.scrollTop=x[1];}w=x=null;B=this.state;},canUndo:false});s.ui.addButton('Maximize',{label:t.maximize,command:'maximize'});s.on('mode',function(){var C=s.getCommand('maximize');C.setState(C.state==0?0:B);},null,null,100);}});})();j.add('newpage',{init:function(m){m.addCommand('newpage',{modes:{wysiwyg:1,source:1},exec:function(n){var o=this;n.setData(n.config.newpage_html||'',function(){setTimeout(function(){n.fire('afterCommandExec',{name:'newpage',command:o});n.selectionChange();},200);});n.focus();},async:true});m.ui.addButton('NewPage',{label:m.lang.newPage,command:'newpage'});}});j.add('pagebreak',{init:function(m){m.addCommand('pagebreak',j.pagebreakCmd);m.ui.addButton('PageBreak',{label:m.lang.pagebreak,command:'pagebreak'});var n=['{','background: url('+a.getUrl(this.path+'images/pagebreak.gif')+') no-repeat center center;','clear: both;','width:100%; _width:99.9%;','border-top: #999999 1px dotted;','border-bottom: #999999 1px dotted;','padding:0;','height: 5px;','cursor: default;','}'].join('').replace(/;/g,' !important;');m.addCss('div.cke_pagebreak'+n);b.opera&&m.on('contentDom',function(){m.document.on('click',function(o){var p=o.data.getTarget();if(p.is('div')&&p.hasClass('cke_pagebreak'))m.getSelection().selectElement(p);});});},afterInit:function(m){var n=m.lang.pagebreakAlt,o=m.dataProcessor,p=o&&o.dataFilter,q=o&&o.htmlFilter;if(q)q.addRules({attributes:{'class':function(r,s){var t=r.replace('cke_pagebreak','');
|
|
||||||
if(t!=r){var u=a.htmlParser.fragment.fromHtml('<span style="display: none;"> </span>');s.children.length=0;s.add(u);var v=s.attributes;delete v['aria-label'];delete v.contenteditable;delete v.title;}return t;}}},5);if(p)p.addRules({elements:{div:function(r){var s=r.attributes,t=s&&s.style,u=t&&r.children.length==1&&r.children[0],v=u&&u.name=='span'&&u.attributes.style;if(v&&/page-break-after\s*:\s*always/i.test(t)&&/display\s*:\s*none/i.test(v)){s.contenteditable='false';s['class']='cke_pagebreak';s['data-cke-display-name']='pagebreak';s['aria-label']=n;s.title=n;r.children.length=0;}}}});},requires:['fakeobjects']});j.pagebreakCmd={exec:function(m){var n=m.lang.pagebreakAlt,o=h.createFromHtml('<div style="page-break-after: always;"contenteditable="false" title="'+n+'" '+'aria-label="'+n+'" '+'data-cke-display-name="pagebreak" '+'class="cke_pagebreak">'+'</div>',m.document),p=m.getSelection().getRanges(true);m.fire('saveSnapshot');for(var q,r=p.length-1;r>=0;r--){q=p[r];if(r<p.length-1)o=o.clone(true);q.splitBlock('p');q.insertNode(o);if(r==p.length-1){var s=o.getNext();q.moveToPosition(o,4);if(!s||s.type==1&&!s.isEditable())q.fixBlock(true,m.config.enterMode==3?'div':'p');q.select();}}m.fire('saveSnapshot');}};(function(){function m(n){n.data.mode='html';};j.add('pastefromword',{init:function(n){var o=0,p=function(q){q&&q.removeListener();n.removeListener('beforePaste',m);o&&setTimeout(function(){o=0;},0);};n.addCommand('pastefromword',{canUndo:false,exec:function(){o=1;n.on('beforePaste',m);if(n.execCommand('paste','html')===false){n.on('dialogShow',function(q){q.removeListener();q.data.on('cancel',p);});n.on('dialogHide',function(q){q.data.removeListener('cancel',p);});}n.on('afterPaste',p);}});n.ui.addButton('PasteFromWord',{label:n.lang.pastefromword.toolbar,command:'pastefromword'});n.on('pasteState',function(q){n.getCommand('pastefromword').setState(q.data);});n.on('paste',function(q){var r=q.data,s;if((s=r.html)&&(o||/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(s))){var t=this.loadFilterRules(function(){if(t)n.fire('paste',r);else if(!n.config.pasteFromWordPromptCleanup||o||confirm(n.lang.pastefromword.confirmCleanup))r.html=a.cleanWord(s,n);});t&&q.cancel();}},this);},loadFilterRules:function(n){var o=a.cleanWord;if(o)n();else{var p=a.getUrl(i.pasteFromWordCleanupFile||this.path+'filter/default.js');a.scriptLoader.load(p,n,null,true);}return!o;},requires:['clipboard']});})();(function(){var m={exec:function(n){var o=e.tryThese(function(){var p=window.clipboardData.getData('Text');
|
|
||||||
if(!p)throw 0;return p;});if(!o){n.openDialog('pastetext');return false;}else n.fire('paste',{text:o});return true;}};j.add('pastetext',{init:function(n){var o='pastetext',p=n.addCommand(o,m);n.ui.addButton('PasteText',{label:n.lang.pasteText.button,command:o});a.dialog.add(o,a.getUrl(this.path+'dialogs/pastetext.js'));if(n.config.forcePasteAsPlainText){n.on('beforeCommandExec',function(q){var r=q.data.commandData;if(q.data.name=='paste'&&r!='html'){n.execCommand('pastetext');q.cancel();}},null,null,0);n.on('beforePaste',function(q){q.data.mode='text';});}n.on('pasteState',function(q){n.getCommand('pastetext').setState(q.data);});},requires:['clipboard']});})();j.add('popup');e.extend(a.editor.prototype,{popup:function(m,n,o,p){n=n||'80%';o=o||'70%';if(typeof n=='string'&&n.length>1&&n.substr(n.length-1,1)=='%')n=parseInt(window.screen.width*parseInt(n,10)/100,10);if(typeof o=='string'&&o.length>1&&o.substr(o.length-1,1)=='%')o=parseInt(window.screen.height*parseInt(o,10)/100,10);if(n<640)n=640;if(o<420)o=420;var q=parseInt((window.screen.height-o)/2,10),r=parseInt((window.screen.width-n)/2,10);p=(p||'location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes')+',width='+n+',height='+o+',top='+q+',left='+r;var s=window.open('',null,p,true);if(!s)return false;try{var t=navigator.userAgent.toLowerCase();if(t.indexOf(' chrome/')==-1){s.moveTo(r,q);s.resizeTo(n,o);}s.focus();s.location.href=m;}catch(u){s=window.open(m,null,p,true);}return true;}});(function(){var m,n={modes:{wysiwyg:1,source:1},canUndo:false,readOnly:1,exec:function(p){var q,r=p.config,s=r.baseHref?'<base href="'+r.baseHref+'"/>':'',t=b.isCustomDomain();if(r.fullPage)q=p.getData().replace(/<head>/,'$&'+s).replace(/[^>]*(?=<\/title>)/,'$& — '+p.lang.preview);else{var u='<body ',v=p.document&&p.document.getBody();if(v){if(v.getAttribute('id'))u+='id="'+v.getAttribute('id')+'" ';if(v.getAttribute('class'))u+='class="'+v.getAttribute('class')+'" ';}u+='>';q=p.config.docType+'<html dir="'+p.config.contentsLangDirection+'">'+'<head>'+s+'<title>'+p.lang.preview+'</title>'+e.buildStyleHtml(p.config.contentsCss)+'</head>'+u+p.getData()+'</body></html>';}var w=640,x=420,y=80;try{var z=window.screen;w=Math.round(z.width*0.8);x=Math.round(z.height*0.7);y=Math.round(z.width*0.1);}catch(D){}var A='';if(t){window._cke_htmlToLoad=q;A='javascript:void( (function(){document.open();document.domain="'+document.domain+'";'+'document.write( window.opener._cke_htmlToLoad );'+'document.close();'+'window.opener._cke_htmlToLoad = null;'+'})() )';
|
|
||||||
}if(b.gecko){window._cke_htmlToLoad=q;A=m+'preview.html';}var B=window.open(A,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+w+',height='+x+',left='+y);if(!t&&!b.gecko){var C=B.document;C.open();C.write(q);C.close();b.webkit&&setTimeout(function(){C.body.innerHTML+='';},0);}}},o='preview';j.add(o,{init:function(p){m=this.path;p.addCommand(o,n);p.ui.addButton('Preview',{label:p.lang.preview,command:o});}});})();j.add('print',{init:function(m){var n='print',o=m.addCommand(n,j.print);m.ui.addButton('Print',{label:m.lang.print,command:n});}});j.print={exec:function(m){if(b.opera)return;else if(b.gecko)m.window.$.print();else m.document.$.execCommand('Print');},canUndo:false,readOnly:1,modes:{wysiwyg:!b.opera}};j.add('removeformat',{requires:['selection'],init:function(m){m.addCommand('removeFormat',j.removeformat.commands.removeformat);m.ui.addButton('RemoveFormat',{label:m.lang.removeFormat,command:'removeFormat'});m._.removeFormat={filters:[]};}});j.removeformat={commands:{removeformat:{exec:function(m){var n=m._.removeFormatRegex||(m._.removeFormatRegex=new RegExp('^(?:'+m.config.removeFormatTags.replace(/,/g,'|')+')$','i')),o=m._.removeAttributes||(m._.removeAttributes=m.config.removeFormatAttributes.split(',')),p=j.removeformat.filter,q=m.getSelection().getRanges(1),r=q.createIterator(),s;while(s=r.getNextRange()){if(!s.collapsed)s.enlarge(1);var t=s.createBookmark(),u=t.startNode,v=t.endNode,w,x=function(z){var A=new d.elementPath(z),B=A.elements;for(var C=1,D;D=B[C];C++){if(D.equals(A.block)||D.equals(A.blockLimit))break;if(n.test(D.getName())&&p(m,D))z.breakParent(D);}};x(u);if(v){x(v);w=u.getNextSourceNode(true,1);while(w){if(w.equals(v))break;var y=w.getNextSourceNode(false,1);if(!(w.getName()=='img'&&w.data('cke-realelement'))&&p(m,w))if(n.test(w.getName()))w.remove(1);else{w.removeAttributes(o);m.fire('removeFormatCleanup',w);}w=y;}}s.moveToBookmark(t);}m.getSelection().selectRanges(q);}}},filter:function(m,n){var o=m._.removeFormat.filters;for(var p=0;p<o.length;p++){if(o[p](n)===false)return false;}return true;}};a.editor.prototype.addRemoveFormatFilter=function(m){this._.removeFormat.filters.push(m);};i.removeFormatTags='b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var';i.removeFormatAttributes='class,style,lang,width,height,align,hspace,valign';j.add('resize',{init:function(m){var n=m.config,o=m.element.getDirection(1);!n.resize_dir&&(n.resize_dir='both');n.resize_maxWidth==undefined&&(n.resize_maxWidth=3000);
|
|
||||||
n.resize_maxHeight==undefined&&(n.resize_maxHeight=3000);n.resize_minWidth==undefined&&(n.resize_minWidth=750);n.resize_minHeight==undefined&&(n.resize_minHeight=250);if(n.resize_enabled!==false){var p=null,q,r,s=(n.resize_dir=='both'||n.resize_dir=='horizontal')&&n.resize_minWidth!=n.resize_maxWidth,t=(n.resize_dir=='both'||n.resize_dir=='vertical')&&n.resize_minHeight!=n.resize_maxHeight;function u(x){var y=x.data.$.screenX-q.x,z=x.data.$.screenY-q.y,A=r.width,B=r.height,C=A+y*(o=='rtl'?-1:1),D=B+z;if(s)A=Math.max(n.resize_minWidth,Math.min(C,n.resize_maxWidth));if(t)B=Math.max(n.resize_minHeight,Math.min(D,n.resize_maxHeight));m.resize(s?A:null,B);};function v(x){a.document.removeListener('mousemove',u);a.document.removeListener('mouseup',v);if(m.document){m.document.removeListener('mousemove',u);m.document.removeListener('mouseup',v);}};var w=e.addFunction(function(x){if(!p)p=m.getResizable();r={width:p.$.offsetWidth||0,height:p.$.offsetHeight||0};q={x:x.screenX,y:x.screenY};n.resize_minWidth>r.width&&(n.resize_minWidth=r.width);n.resize_minHeight>r.height&&(n.resize_minHeight=r.height);a.document.on('mousemove',u);a.document.on('mouseup',v);if(m.document){m.document.on('mousemove',u);m.document.on('mouseup',v);}});m.on('destroy',function(){e.removeFunction(w);});m.on('themeSpace',function(x){if(x.data.space=='bottom'){var y='';if(s&&!t)y=' cke_resizer_horizontal';if(!s&&t)y=' cke_resizer_vertical';var z='<div class="cke_resizer'+y+' cke_resizer_'+o+'"'+' title="'+e.htmlEncode(m.lang.resize)+'"'+' onmousedown="CKEDITOR.tools.callFunction('+w+', event)"'+'></div>';o=='ltr'&&y=='ltr'?x.data.html+=z:x.data.html=z+x.data.html;}},m,null,100);}}});(function(){var m={modes:{wysiwyg:1,source:1},readOnly:1,exec:function(o){var p=o.element.$.form;if(p)try{p.submit();}catch(q){if(p.submit.click)p.submit.click();}}},n='save';j.add(n,{init:function(o){var p=o.addCommand(n,m);p.modes={wysiwyg:!!o.element.$.form};o.ui.addButton('Save',{label:o.lang.save,command:n});}});})();(function(){var m='scaytcheck',n='';function o(t,u){var v=0,w;for(w in u){if(u[w]==t){v=1;break;}}return v;};var p=function(){var t=this,u=function(){if(q.instances[t.name])q.instances[t.name].destroy();var y=t.config,z={};z.srcNodeRef=t.document.getWindow().$.frameElement;z.assocApp='CKEDITOR.'+a.version+'@'+a.revision;z.customerid=y.scayt_customerid||'1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2';z.customDictionaryIds=y.scayt_customDictionaryIds||'';z.userDictionaryName=y.scayt_userDictionaryName||'';
|
|
||||||
z.sLang=y.scayt_sLang||'en_US';z.onLoad=function(){if(!(c&&b.version<8))this.addStyle(this.selectorCss(),'padding-bottom: 2px !important;');if(t.focusManager.hasFocus&&!q.isControlRestored(t))this.focus();};z.onBeforeChange=function(){if(q.getScayt(t)&&!t.checkDirty())setTimeout(function(){t.resetDirty();},0);};var A=window.scayt_custom_params;if(typeof A=='object')for(var B in A)z[B]=A[B];if(q.getControlId(t))z.id=q.getControlId(t);var C=new window.scayt(z);C.afterMarkupRemove.push(function(E){new h(E,C.document).mergeSiblings();});var D=q.instances[t.name];if(D){C.sLang=D.sLang;C.option(D.option());C.paused=D.paused;}q.instances[t.name]=C;try{C.setDisabled(q.isPaused(t)===false);}catch(E){}t.fire('showScaytState');};t.on('contentDom',function(y){u();});t.on('contentDomUnload',function(){var y=a.document.getElementsByTag('script'),z=/^dojoIoScript(\d+)$/i,A=/^https?:\/\/svc\.webspellchecker\.net\/spellcheck\/script\/ssrv\.cgi/i;for(var B=0;B<y.count();B++){var C=y.getItem(B),D=C.getId(),E=C.getAttribute('src');if(D&&E&&D.match(z)&&E.match(A))C.remove();}});t.on('beforeCommandExec',function(y){if(y.data.name=='source'&&t.mode=='source')q.markControlRestore(t);});t.on('afterCommandExec',function(y){if(!q.isScaytEnabled(t))return;if(t.mode=='wysiwyg'&&(y.data.name=='undo'||y.data.name=='redo'))window.setTimeout(function(){q.getScayt(t).refresh();},10);});t.on('destroy',function(y){var z=y.editor,A=q.getScayt(z);if(!A)return;delete q.instances[z.name];q.setControlId(z,A.id);A.destroy(true);});t.on('setData',function(y){var z=q.getScayt(t);if(z){q.setPaused(t,!z.disabled);q.setControlId(t,z.id);z.destroy(true);delete q.instances[t.name];}});t.on('insertElement',function(){var y=q.getScayt(t);if(q.isScaytEnabled(t)){if(c)t.getSelection().unlock(true);window.setTimeout(function(){y.focus();y.refresh();},10);}},this,null,50);t.on('insertHtml',function(){var y=q.getScayt(t);if(q.isScaytEnabled(t)){if(c)t.getSelection().unlock(true);window.setTimeout(function(){y.focus();y.refresh();},10);}},this,null,50);t.on('scaytDialog',function(y){y.data.djConfig=window.djConfig;y.data.scayt_control=q.getScayt(t);y.data.tab=n;y.data.scayt=window.scayt;});var v=t.dataProcessor,w=v&&v.htmlFilter;if(w)w.addRules({elements:{span:function(y){if(y.attributes['data-scayt_word']&&y.attributes['data-scaytid']){delete y.name;return y;}}}});var x=j.undo.Image.prototype;x.equals=e.override(x.equals,function(y){return function(z){var E=this;var A=E.contents,B=z.contents,C=q.getScayt(E.editor);
|
|
||||||
if(C&&q.isScaytReady(E.editor)){E.contents=C.reset(A)||'';z.contents=C.reset(B)||'';}var D=y.apply(E,arguments);E.contents=A;z.contents=B;return D;};});if(t.document)u();};j.scayt={engineLoaded:false,instances:{},controlInfo:{},setControlInfo:function(t,u){if(t&&t.name&&typeof this.controlInfo[t.name]!='object')this.controlInfo[t.name]={};for(var v in u)this.controlInfo[t.name][v]=u[v];},isControlRestored:function(t){if(t&&t.name&&this.controlInfo[t.name])return this.controlInfo[t.name].restored;return false;},markControlRestore:function(t){this.setControlInfo(t,{restored:true});},setControlId:function(t,u){this.setControlInfo(t,{id:u});},getControlId:function(t){if(t&&t.name&&this.controlInfo[t.name]&&this.controlInfo[t.name].id)return this.controlInfo[t.name].id;return null;},setPaused:function(t,u){this.setControlInfo(t,{paused:u});},isPaused:function(t){if(t&&t.name&&this.controlInfo[t.name])return this.controlInfo[t.name].paused;return undefined;},getScayt:function(t){return this.instances[t.name];},isScaytReady:function(t){return this.engineLoaded===true&&'undefined'!==typeof window.scayt&&this.getScayt(t);},isScaytEnabled:function(t){var u=this.getScayt(t);return u?u.disabled===false:false;},getUiTabs:function(t){var u=[],v=t.config.scayt_uiTabs||'1,1,1';v=v.split(',');v[3]='1';for(var w=0;w<4;w++)u[w]=typeof window.scayt!='undefined'&&typeof window.scayt.uiTags!='undefined'?parseInt(v[w],10)&&window.scayt.uiTags[w]:parseInt(v[w],10);return u;},loadEngine:function(t){if(b.gecko&&b.version<10900||b.opera||b.air)return t.fire('showScaytState');if(this.engineLoaded===true)return p.apply(t);else if(this.engineLoaded==-1)return a.on('scaytReady',function(){p.apply(t);});a.on('scaytReady',p,t);a.on('scaytReady',function(){this.engineLoaded=true;},this,null,0);this.engineLoaded=-1;var u=document.location.protocol;u=u.search(/https?:/)!=-1?u:'http:';var v='svc.webspellchecker.net/scayt26/loader__base.js',w=t.config.scayt_srcUrl||u+'//'+v,x=q.parseUrl(w).path+'/';if(window.scayt==undefined){a._djScaytConfig={baseUrl:x,addOnLoad:[function(){a.fireOnce('scaytReady');}],isDebug:false};a.document.getHead().append(a.document.createElement('script',{attributes:{type:'text/javascript',async:'true',src:w}}));}else a.fireOnce('scaytReady');return null;},parseUrl:function(t){var u;if(t.match&&(u=t.match(/(.*)[\/\\](.*?\.\w+)$/)))return{path:u[1],file:u[2]};else return t;}};var q=j.scayt,r=function(t,u,v,w,x,y,z){t.addCommand(w,x);t.addMenuItem(w,{label:v,command:w,group:y,order:z});
|
|
||||||
},s={preserveState:true,editorFocus:false,canUndo:false,exec:function(t){if(q.isScaytReady(t)){var u=q.isScaytEnabled(t);this.setState(u?2:1);var v=q.getScayt(t);v.focus();v.setDisabled(u);}else if(!t.config.scayt_autoStartup&&q.engineLoaded>=0){this.setState(0);q.loadEngine(t);}}};j.add('scayt',{requires:['menubutton'],beforeInit:function(t){var u=t.config.scayt_contextMenuItemsOrder||'suggest|moresuggest|control',v='';u=u.split('|');if(u&&u.length)for(var w=0;w<u.length;w++)v+='scayt_'+u[w]+(u.length!=parseInt(w,10)+1?',':'');t.config.menu_groups=v+','+t.config.menu_groups;},init:function(t){var u=t.dataProcessor&&t.dataProcessor.dataFilter,v={elements:{span:function(E){var F=E.attributes;if(F&&F['data-scaytid'])delete E.name;}}};u&&u.addRules(v);var w={},x={},y=t.addCommand(m,s);a.dialog.add(m,a.getUrl(this.path+'dialogs/options.js'));var z=q.getUiTabs(t),A='scaytButton';t.addMenuGroup(A);var B={},C=t.lang.scayt;B.scaytToggle={label:C.enable,command:m,group:A};if(z[0]==1)B.scaytOptions={label:C.options,group:A,onClick:function(){n='options';t.openDialog(m);}};if(z[1]==1)B.scaytLangs={label:C.langs,group:A,onClick:function(){n='langs';t.openDialog(m);}};if(z[2]==1)B.scaytDict={label:C.dictionariesTab,group:A,onClick:function(){n='dictionaries';t.openDialog(m);}};B.scaytAbout={label:t.lang.scayt.about,group:A,onClick:function(){n='about';t.openDialog(m);}};t.addMenuItems(B);t.ui.add('Scayt','menubutton',{label:C.title,title:b.opera?C.opera_title:C.title,className:'cke_button_scayt',modes:{wysiwyg:1},onRender:function(){y.on('state',function(){this.setState(y.state);},this);},onMenu:function(){var E=q.isScaytEnabled(t);t.getMenuItem('scaytToggle').label=C[E?'disable':'enable'];var F=q.getUiTabs(t);return{scaytToggle:2,scaytOptions:E&&F[0]?2:0,scaytLangs:E&&F[1]?2:0,scaytDict:E&&F[2]?2:0,scaytAbout:E&&F[3]?2:0};}});if(t.contextMenu&&t.addMenuItems)t.contextMenu.addListener(function(E,F){if(!q.isScaytEnabled(t)||F.getRanges()[0].checkReadOnly())return null;var G=q.getScayt(t),H=G.getScaytNode();if(!H)return null;var I=G.getWord(H);if(!I)return null;var J=G.getLang(),K=window.scayt.getSuggestion(I,J);for(var L in w){delete t._.menuItems[L];delete t._.commands[L];}for(L in x){delete t._.menuItems[L];delete t._.commands[L];}w={};x={};var M=t.config.scayt_moreSuggestions||'on',N=false,O=t.config.scayt_maxSuggestions;typeof O!='number'&&(O=5);!O&&(O=K.length);var P=t.config.scayt_contextCommands||'all';P=P.split('|');if(K&&K.length){for(var Q=0,R=K.length;Q<R;Q+=1){var S='scayt_suggestion_'+K[Q].replace(' ','_'),T=(function(X,Y){return{exec:function(){G.replace(X,Y);
|
|
||||||
}};})(H,K[Q]);if(Q<O){r(t,'button_'+S,K[Q],S,T,'scayt_suggest',Q+1);x[S]=2;}else if(M=='on'){r(t,'button_'+S,K[Q],S,T,'scayt_moresuggest',Q+1);w[S]=2;N=true;}}if(N){t.addMenuItem('scayt_moresuggest',{label:t.lang.scayt.moreSuggestions,group:'scayt_moresuggest',order:10,getItems:function(){return w;}});x.scayt_moresuggest=2;}}else{t.addMenuItem('scayt_nosuggest',{label:t.lang.scayt.noSuggestions?t.lang.scayt.noSuggestions:t.lang.spellCheck.noSuggestions?t.lang.spellCheck.noSuggestions:'No suggestions',group:'scayt_suggest',order:1});x.scayt_nosuggest=2;}if(o('all',P)||o('ignore',P)){var U={exec:function(){G.ignore(H);}};r(t,'ignore',C.ignore,'scayt_ignore',U,'scayt_control',1);x.scayt_ignore=2;}if(o('all',P)||o('ignoreall',P)){var V={exec:function(){G.ignoreAll(H);}};r(t,'ignore_all',C.ignoreAll,'scayt_ignore_all',V,'scayt_control',2);x.scayt_ignore_all=2;}if(o('all',P)||o('add',P)){var W={exec:function(){window.scayt.addWordToUserDictionary(H);}};r(t,'add_word',C.addWord,'scayt_add_word',W,'scayt_control',3);x.scayt_add_word=2;}if(G.fireOnContextMenu)G.fireOnContextMenu(t);return x;});var D=function(){t.removeListener('showScaytState',D);if(!b.opera&&!b.air)y.setState(q.isScaytEnabled(t)?1:2);else y.setState(0);};t.on('showScaytState',D);if(b.opera||b.air)t.on('instanceReady',function(){D();});if(t.config.scayt_autoStartup)t.on('instanceReady',function(){q.loadEngine(t);});},afterInit:function(t){var u,v=function(w){if(w.hasAttribute('data-scaytid'))return false;};if(t._.elementsPath&&(u=t._.elementsPath.filters))u.push(v);t.addRemoveFormatFilter&&t.addRemoveFormatFilter(v);}});})();j.add('smiley',{requires:['dialog'],init:function(m){m.config.smiley_path=m.config.smiley_path||this.path+'images/';m.addCommand('smiley',new a.dialogCommand('smiley'));m.ui.addButton('Smiley',{label:m.lang.smiley.toolbar,command:'smiley'});a.dialog.add('smiley',this.path+'dialogs/smiley.js');}});i.smiley_images=['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'];i.smiley_descriptions=['smiley','sad','wink','laugh','frown','cheeky','blush','surprise','indecision','angry','angel','cool','devil','crying','enlightened','no','yes','heart','broken heart','kiss','mail'];
|
|
||||||
(function(){var m='.%2 p,.%2 div,.%2 pre,.%2 address,.%2 blockquote,.%2 h1,.%2 h2,.%2 h3,.%2 h4,.%2 h5,.%2 h6{background-repeat: no-repeat;background-position: top %3;border: 1px dotted gray;padding-top: 8px;padding-%3: 8px;}.%2 p{%1p.png);}.%2 div{%1div.png);}.%2 pre{%1pre.png);}.%2 address{%1address.png);}.%2 blockquote{%1blockquote.png);}.%2 h1{%1h1.png);}.%2 h2{%1h2.png);}.%2 h3{%1h3.png);}.%2 h4{%1h4.png);}.%2 h5{%1h5.png);}.%2 h6{%1h6.png);}',n=/%1/g,o=/%2/g,p=/%3/g,q={readOnly:1,preserveState:true,editorFocus:false,exec:function(r){this.toggleState();this.refresh(r);},refresh:function(r){if(r.document){var s=this.state==1?'addClass':'removeClass';r.document.getBody()[s]('cke_show_blocks');}}};j.add('showblocks',{requires:['wysiwygarea'],init:function(r){var s=r.addCommand('showblocks',q);s.canUndo=false;if(r.config.startupOutlineBlocks)s.setState(1);r.addCss(m.replace(n,'background-image: url('+a.getUrl(this.path)+'images/block_').replace(o,'cke_show_blocks ').replace(p,r.lang.dir=='rtl'?'right':'left'));r.ui.addButton('ShowBlocks',{label:r.lang.showBlocks,command:'showblocks'});r.on('mode',function(){if(s.state!=0)s.refresh(r);});r.on('contentDom',function(){if(s.state!=0)s.refresh(r);});}});})();(function(){var m='cke_show_border',n,o=(b.ie6Compat?['.%1 table.%2,','.%1 table.%2 td, .%1 table.%2 th','{','border : #d3d3d3 1px dotted','}']:['.%1 table.%2,','.%1 table.%2 > tr > td, .%1 table.%2 > tr > th,','.%1 table.%2 > tbody > tr > td, .%1 table.%2 > tbody > tr > th,','.%1 table.%2 > thead > tr > td, .%1 table.%2 > thead > tr > th,','.%1 table.%2 > tfoot > tr > td, .%1 table.%2 > tfoot > tr > th','{','border : #d3d3d3 1px dotted','}']).join('');n=o.replace(/%2/g,m).replace(/%1/g,'cke_show_borders ');var p={preserveState:true,editorFocus:false,readOnly:1,exec:function(q){this.toggleState();this.refresh(q);},refresh:function(q){if(q.document){var r=this.state==1?'addClass':'removeClass';q.document.getBody()[r]('cke_show_borders');}}};j.add('showborders',{requires:['wysiwygarea'],modes:{wysiwyg:1},init:function(q){var r=q.addCommand('showborders',p);r.canUndo=false;if(q.config.startupShowBorders!==false)r.setState(1);q.addCss(n);q.on('mode',function(){if(r.state!=0)r.refresh(q);},null,null,100);q.on('contentDom',function(){if(r.state!=0)r.refresh(q);});q.on('removeFormatCleanup',function(s){var t=s.data;if(q.getCommand('showborders').state==1&&t.is('table')&&(!t.hasAttribute('border')||parseInt(t.getAttribute('border'),10)<=0))t.addClass(m);});},afterInit:function(q){var r=q.dataProcessor,s=r&&r.dataFilter,t=r&&r.htmlFilter;
|
|
||||||
if(s)s.addRules({elements:{table:function(u){var v=u.attributes,w=v['class'],x=parseInt(v.border,10);if((!x||x<=0)&&(!w||w.indexOf(m)==-1))v['class']=(w||'')+' '+m;}}});if(t)t.addRules({elements:{table:function(u){var v=u.attributes,w=v['class'];w&&(v['class']=w.replace(m,'').replace(/\s{2}/,' ').replace(/^\s+|\s+$/,''));}}});}});a.on('dialogDefinition',function(q){var r=q.data.name;if(r=='table'||r=='tableProperties'){var s=q.data.definition,t=s.getContents('info'),u=t.get('txtBorder'),v=u.commit;u.commit=e.override(v,function(y){return function(z,A){y.apply(this,arguments);var B=parseInt(this.getValue(),10);A[!B||B<=0?'addClass':'removeClass'](m);};});var w=s.getContents('advanced'),x=w&&w.get('advCSSClasses');if(x){x.setup=e.override(x.setup,function(y){return function(){y.apply(this,arguments);this.setValue(this.getValue().replace(/cke_show_border/,''));};});x.commit=e.override(x.commit,function(y){return function(z,A){y.apply(this,arguments);if(!parseInt(A.getAttribute('border'),10))A.addClass('cke_show_border');};});}}});})();j.add('sourcearea',{requires:['editingblock'],init:function(m){var n=j.sourcearea,o=a.document.getWindow();m.on('editingBlockReady',function(){var p,q;m.addMode('source',{load:function(r,s){if(c&&b.version<8)r.setStyle('position','relative');m.textarea=p=new h('textarea');p.setAttributes({dir:'ltr',tabIndex:b.webkit?-1:m.tabIndex,role:'textbox','aria-label':m.lang.editorTitle.replace('%1',m.name)});p.addClass('cke_source');p.addClass('cke_enable_context_menu');m.readOnly&&p.setAttribute('readOnly','readonly');var t={width:b.ie7Compat?'99%':'100%',height:'100%',resize:'none',outline:'none','text-align':'left'};if(c){q=function(){p.hide();p.setStyle('height',r.$.clientHeight+'px');p.setStyle('width',r.$.clientWidth+'px');p.show();};m.on('resize',q);o.on('resize',q);setTimeout(q,0);}r.setHtml('');r.append(p);p.setStyles(t);m.fire('ariaWidget',p);p.on('blur',function(){m.focusManager.blur();});p.on('focus',function(){m.focusManager.focus();});m.mayBeDirty=true;this.loadData(s);var u=m.keystrokeHandler;if(u)u.attach(p);setTimeout(function(){m.mode='source';m.fire('mode',{previousMode:m._.previousMode});},b.gecko||b.webkit?100:0);},loadData:function(r){p.setValue(r);m.fire('dataReady');},getData:function(){return p.getValue();},getSnapshotData:function(){return p.getValue();},unload:function(r){p.clearCustomData();m.textarea=p=null;if(q){m.removeListener('resize',q);o.removeListener('resize',q);}if(c&&b.version<8)r.removeStyle('position');
|
|
||||||
},focus:function(){p.focus();}});});m.on('readOnly',function(){if(m.mode=='source')if(m.readOnly)m.textarea.setAttribute('readOnly','readonly');else m.textarea.removeAttribute('readOnly');});m.addCommand('source',n.commands.source);if(m.ui.addButton)m.ui.addButton('Source',{label:m.lang.source,command:'source'});m.on('mode',function(){m.getCommand('source').setState(m.mode=='source'?1:2);});}});j.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:false,readOnly:1,exec:function(m){if(m.mode=='wysiwyg')m.fire('saveSnapshot');m.getCommand('source').setState(0);m.setMode(m.mode=='source'?'wysiwyg':'source');},canUndo:false}}};(function(){j.add('stylescombo',{requires:['richcombo','styles'],init:function(n){var o=n.config,p=n.lang.stylesCombo,q={},r=[],s;function t(u){n.getStylesSet(function(v){if(!r.length){var w,x;for(var y=0,z=v.length;y<z;y++){var A=v[y];x=A.name;w=q[x]=new a.style(A);w._name=x;w._.enterMode=o.enterMode;r.push(w);}r.sort(m);}u&&u();});};n.ui.addRichCombo('Styles',{label:p.label,title:p.panelTitle,className:'cke_styles',panel:{css:n.skin.editor.css.concat(o.contentsCss),multiSelect:true,attributes:{'aria-label':p.panelTitle}},init:function(){s=this;t(function(){var u,v,w,x,y,z;for(y=0,z=r.length;y<z;y++){u=r[y];v=u._name;x=u.type;if(x!=w){s.startGroup(p['panelTitle'+String(x)]);w=x;}s.add(v,u.type==3?v:u.buildPreview(),v);}s.commit();});},onClick:function(u){n.focus();n.fire('saveSnapshot');var v=q[u],w=n.getSelection(),x=new d.elementPath(w.getStartElement());v[v.checkActive(x)?'remove':'apply'](n.document);n.fire('saveSnapshot');},onRender:function(){n.on('selectionChange',function(u){var v=this.getValue(),w=u.data.path,x=w.elements;for(var y=0,z=x.length,A;y<z;y++){A=x[y];for(var B in q){if(q[B].checkElementRemovable(A,true)){if(B!=v)this.setValue(B);return;}}}this.setValue('');},this);},onOpen:function(){var B=this;if(c||b.webkit)n.focus();var u=n.getSelection(),v=u.getSelectedElement(),w=new d.elementPath(v||u.getStartElement()),x=[0,0,0,0];B.showAll();B.unmarkAll();for(var y in q){var z=q[y],A=z.type;if(z.checkActive(w))B.mark(y);else if(A==3&&!z.checkApplicable(w)){B.hideItem(y);x[A]--;}x[A]++;}if(!x[1])B.hideGroup(p['panelTitle'+String(1)]);if(!x[2])B.hideGroup(p['panelTitle'+String(2)]);if(!x[3])B.hideGroup(p['panelTitle'+String(3)]);},reset:function(){if(s){delete s._.panel;delete s._.list;s._.committed=0;s._.items={};s._.state=2;}q={};r=[];t();}});n.on('instanceReady',function(){t();});}});function m(n,o){var p=n.type,q=o.type;
|
|
||||||
return p==q?0:p==3?-1:q==3?1:q==1?1:-1;};})();j.add('table',{requires:['dialog'],init:function(m){var n=j.table,o=m.lang.table;m.addCommand('table',new a.dialogCommand('table'));m.addCommand('tableProperties',new a.dialogCommand('tableProperties'));m.ui.addButton('Table',{label:o.toolbar,command:'table'});a.dialog.add('table',this.path+'dialogs/table.js');a.dialog.add('tableProperties',this.path+'dialogs/table.js');if(m.addMenuItems)m.addMenuItems({table:{label:o.menu,command:'tableProperties',group:'table',order:5},tabledelete:{label:o.deleteTable,command:'tableDelete',group:'table',order:1}});m.on('doubleclick',function(p){var q=p.data.element;if(q.is('table'))p.data.dialog='tableProperties';});if(m.contextMenu)m.contextMenu.addListener(function(p,q){if(!p||p.isReadOnly())return null;var r=p.hasAscendant('table',1);if(r)return{tabledelete:2,table:2};return null;});}});(function(){var m=/^(?:td|th)$/;function n(G){var H=G.getRanges(),I=[],J={};function K(S){if(I.length>0)return;if(S.type==1&&m.test(S.getName())&&!S.getCustomData('selected_cell')){h.setMarker(J,S,'selected_cell',true);I.push(S);}};for(var L=0;L<H.length;L++){var M=H[L];if(M.collapsed){var N=M.getCommonAncestor(),O=N.getAscendant('td',true)||N.getAscendant('th',true);if(O)I.push(O);}else{var P=new d.walker(M),Q;P.guard=K;while(Q=P.next()){var R=Q.getAscendant('td')||Q.getAscendant('th');if(R&&!R.getCustomData('selected_cell')){h.setMarker(J,R,'selected_cell',true);I.push(R);}}}}h.clearAllMarkers(J);return I;};function o(G){var H=0,I=G.length-1,J={},K,L,M;while(K=G[H++])h.setMarker(J,K,'delete_cell',true);H=0;while(K=G[H++]){if((L=K.getPrevious())&&!L.getCustomData('delete_cell')||(L=K.getNext())&&!L.getCustomData('delete_cell')){h.clearAllMarkers(J);return L;}}h.clearAllMarkers(J);M=G[0].getParent();if(M=M.getPrevious())return M.getLast();M=G[I].getParent();if(M=M.getNext())return M.getChild(0);return null;};function p(G,H){var I=n(G),J=I[0],K=J.getAscendant('table'),L=J.getDocument(),M=I[0].getParent(),N=M.$.rowIndex,O=I[I.length-1],P=O.getParent().$.rowIndex+O.$.rowSpan-1,Q=new h(K.$.rows[P]),R=H?N:P,S=H?M:Q,T=e.buildTableMap(K),U=T[R],V=H?T[R-1]:T[R+1],W=T[0].length,X=L.createElement('tr');for(var Y=0;U[Y]&&Y<W;Y++){var Z;if(U[Y].rowSpan>1&&V&&U[Y]==V[Y]){Z=U[Y];Z.rowSpan+=1;}else{Z=new h(U[Y]).clone();Z.removeAttribute('rowSpan');!c&&Z.appendBogus();X.append(Z);Z=Z.$;}Y+=Z.colSpan-1;}H?X.insertBefore(S):X.insertAfter(S);};function q(G){if(G instanceof d.selection){var H=n(G),I=H[0],J=I.getAscendant('table'),K=e.buildTableMap(J),L=H[0].getParent(),M=L.$.rowIndex,N=H[H.length-1],O=N.getParent().$.rowIndex+N.$.rowSpan-1,P=[];
|
|
||||||
for(var Q=M;Q<=O;Q++){var R=K[Q],S=new h(J.$.rows[Q]);for(var T=0;T<R.length;T++){var U=new h(R[T]),V=U.getParent().$.rowIndex;if(U.$.rowSpan==1)U.remove();else{U.$.rowSpan-=1;if(V==Q){var W=K[Q+1];W[T-1]?U.insertAfter(new h(W[T-1])):new h(J.$.rows[Q+1]).append(U,1);}}T+=U.$.colSpan-1;}P.push(S);}var X=J.$.rows,Y=new h(X[O+1]||(M>0?X[M-1]:null)||J.$.parentNode);for(Q=P.length;Q>=0;Q--)q(P[Q]);return Y;}else if(G instanceof h){J=G.getAscendant('table');if(J.$.rows.length==1)J.remove();else G.remove();}return null;};function r(G,H){var I=G.getParent(),J=I.$.cells,K=0;for(var L=0;L<J.length;L++){var M=J[L];K+=H?1:M.colSpan;if(M==G.$)break;}return K-1;};function s(G,H){var I=H?Infinity:0;for(var J=0;J<G.length;J++){var K=r(G[J],H);if(H?K<I:K>I)I=K;}return I;};function t(G,H){var I=n(G),J=I[0],K=J.getAscendant('table'),L=s(I,1),M=s(I),N=H?L:M,O=e.buildTableMap(K),P=[],Q=[],R=O.length;for(var S=0;S<R;S++){P.push(O[S][N]);var T=H?O[S][N-1]:O[S][N+1];Q.push(T);}for(S=0;S<R;S++){var U;if(!P[S])continue;if(P[S].colSpan>1&&Q[S]==P[S]){U=P[S];U.colSpan+=1;}else{U=new h(P[S]).clone();U.removeAttribute('colSpan');!c&&U.appendBogus();U[H?'insertBefore':'insertAfter'].call(U,new h(P[S]));U=U.$;}S+=U.rowSpan-1;}};function u(G){var H=n(G),I=H[0],J=H[H.length-1],K=I.getAscendant('table'),L=e.buildTableMap(K),M,N,O=[];for(var P=0,Q=L.length;P<Q;P++)for(var R=0,S=L[P].length;R<S;R++){if(L[P][R]==I.$)M=R;if(L[P][R]==J.$)N=R;}for(P=M;P<=N;P++)for(R=0;R<L.length;R++){var T=L[R],U=new h(K.$.rows[R]),V=new h(T[P]);if(V.$){if(V.$.colSpan==1)V.remove();else V.$.colSpan-=1;R+=V.$.rowSpan-1;if(!U.$.cells.length)O.push(U);}}var W=K.$.rows[0]&&K.$.rows[0].cells,X=new h(W[M]||(M?W[M-1]:K.$.parentNode));if(O.length==Q)K.remove();return X;};function v(G){var H=[],I=G[0]&&G[0].getAscendant('table'),J,K,L,M;for(J=0,K=G.length;J<K;J++)H.push(G[J].$.cellIndex);H.sort();for(J=1,K=H.length;J<K;J++){if(H[J]-H[J-1]>1){L=H[J-1]+1;break;}}if(!L)L=H[0]>0?H[0]-1:H[H.length-1]+1;var N=I.$.rows;for(J=0,K=N.length;J<K;J++){M=N[J].cells[L];if(M)break;}return M?new h(M):I.getPrevious();};function w(G,H){var I=G.getStartElement(),J=I.getAscendant('td',1)||I.getAscendant('th',1);if(!J)return;var K=J.clone();if(!c)K.appendBogus();if(H)K.insertBefore(J);else K.insertAfter(J);};function x(G){if(G instanceof d.selection){var H=n(G),I=H[0]&&H[0].getAscendant('table'),J=o(H);for(var K=H.length-1;K>=0;K--)x(H[K]);if(J)z(J,true);else if(I)I.remove();}else if(G instanceof h){var L=G.getParent();if(L.getChildCount()==1)L.remove();
|
|
||||||
else G.remove();}};function y(G){var H=G.getBogus();H&&H.remove();G.trim();};function z(G,H){var I=new d.range(G.getDocument());if(!I['moveToElementEdit'+(H?'End':'Start')](G)){I.selectNodeContents(G);I.collapse(H?false:true);}I.select(true);};function A(G,H,I){var J=G[H];if(typeof I=='undefined')return J;for(var K=0;J&&K<J.length;K++){if(I.is&&J[K]==I.$)return K;else if(K==I)return new h(J[K]);}return I.is?-1:null;};function B(G,H){var I=[];for(var J=0;J<G.length;J++){var K=G[J];I.push(K[H]);if(K[H].rowSpan>1)J+=K[H].rowSpan-1;}return I;};function C(G,H,I){var J=n(G),K;if((H?J.length!=1:J.length<2)||(K=G.getCommonAncestor())&&K.type==1&&K.is('table'))return false;var L,M=J[0],N=M.getAscendant('table'),O=e.buildTableMap(N),P=O.length,Q=O[0].length,R=M.getParent().$.rowIndex,S=A(O,R,M);if(H){var T;try{var U=parseInt(M.getAttribute('rowspan'),10)||1,V=parseInt(M.getAttribute('colspan'),10)||1;T=O[H=='up'?R-U:H=='down'?R+U:R][H=='left'?S-V:H=='right'?S+V:S];}catch(an){return false;}if(!T||M.$==T)return false;J[H=='up'||H=='left'?'unshift':'push'](new h(T));}var W=M.getDocument(),X=R,Y=0,Z=0,aa=!I&&new d.documentFragment(W),ab=0;for(var ac=0;ac<J.length;ac++){L=J[ac];var ad=L.getParent(),ae=L.getFirst(),af=L.$.colSpan,ag=L.$.rowSpan,ah=ad.$.rowIndex,ai=A(O,ah,L);ab+=af*ag;Z=Math.max(Z,ai-S+af);Y=Math.max(Y,ah-R+ag);if(!I){if(y(L),L.getChildren().count()){if(ah!=X&&ae&&!(ae.isBlockBoundary&&ae.isBlockBoundary({br:1}))){var aj=aa.getLast(d.walker.whitespaces(true));if(aj&&!(aj.is&&aj.is('br')))aa.append('br');}L.moveChildren(aa);}ac?L.remove():L.setHtml('');}X=ah;}if(!I){aa.moveChildren(M);if(!c)M.appendBogus();if(Z>=Q)M.removeAttribute('rowSpan');else M.$.rowSpan=Y;if(Y>=P)M.removeAttribute('colSpan');else M.$.colSpan=Z;var ak=new d.nodeList(N.$.rows),al=ak.count();for(ac=al-1;ac>=0;ac--){var am=ak.getItem(ac);if(!am.$.cells.length){am.remove();al++;continue;}}return M;}else return Y*Z==ab;};function D(G,H){var I=n(G);if(I.length>1)return false;else if(H)return true;var J=I[0],K=J.getParent(),L=K.getAscendant('table'),M=e.buildTableMap(L),N=K.$.rowIndex,O=A(M,N,J),P=J.$.rowSpan,Q,R,S,T;if(P>1){R=Math.ceil(P/2);S=Math.floor(P/2);T=N+R;var U=new h(L.$.rows[T]),V=A(M,T),W;Q=J.clone();for(var X=0;X<V.length;X++){W=V[X];if(W.parentNode==U.$&&X>O){Q.insertBefore(new h(W));break;}else W=null;}if(!W)U.append(Q,true);}else{S=R=1;U=K.clone();U.insertAfter(K);U.append(Q=J.clone());var Y=A(M,N);for(var Z=0;Z<Y.length;Z++)Y[Z].rowSpan++;}if(!c)Q.appendBogus();J.$.rowSpan=R;Q.$.rowSpan=S;
|
|
||||||
if(R==1)J.removeAttribute('rowSpan');if(S==1)Q.removeAttribute('rowSpan');return Q;};function E(G,H){var I=n(G);if(I.length>1)return false;else if(H)return true;var J=I[0],K=J.getParent(),L=K.getAscendant('table'),M=e.buildTableMap(L),N=K.$.rowIndex,O=A(M,N,J),P=J.$.colSpan,Q,R,S;if(P>1){R=Math.ceil(P/2);S=Math.floor(P/2);}else{S=R=1;var T=B(M,O);for(var U=0;U<T.length;U++)T[U].colSpan++;}Q=J.clone();Q.insertAfter(J);if(!c)Q.appendBogus();J.$.colSpan=R;Q.$.colSpan=S;if(R==1)J.removeAttribute('colSpan');if(S==1)Q.removeAttribute('colSpan');return Q;};var F={thead:1,tbody:1,tfoot:1,td:1,tr:1,th:1};j.tabletools={requires:['table','dialog'],init:function(G){var H=G.lang.table;G.addCommand('cellProperties',new a.dialogCommand('cellProperties'));a.dialog.add('cellProperties',this.path+'dialogs/tableCell.js');G.addCommand('tableDelete',{exec:function(I){var J=I.getSelection(),K=J&&J.getStartElement(),L=K&&K.getAscendant('table',1);if(!L)return;var M=L.getParent();if(M.getChildCount()==1&&!M.is('body','td','th'))L=M;var N=new d.range(I.document);N.moveToPosition(L,3);L.remove();N.select();}});G.addCommand('rowDelete',{exec:function(I){var J=I.getSelection();z(q(J));}});G.addCommand('rowInsertBefore',{exec:function(I){var J=I.getSelection();p(J,true);}});G.addCommand('rowInsertAfter',{exec:function(I){var J=I.getSelection();p(J);}});G.addCommand('columnDelete',{exec:function(I){var J=I.getSelection(),K=u(J);K&&z(K,true);}});G.addCommand('columnInsertBefore',{exec:function(I){var J=I.getSelection();t(J,true);}});G.addCommand('columnInsertAfter',{exec:function(I){var J=I.getSelection();t(J);}});G.addCommand('cellDelete',{exec:function(I){var J=I.getSelection();x(J);}});G.addCommand('cellMerge',{exec:function(I){z(C(I.getSelection()),true);}});G.addCommand('cellMergeRight',{exec:function(I){z(C(I.getSelection(),'right'),true);}});G.addCommand('cellMergeDown',{exec:function(I){z(C(I.getSelection(),'down'),true);}});G.addCommand('cellVerticalSplit',{exec:function(I){z(D(I.getSelection()));}});G.addCommand('cellHorizontalSplit',{exec:function(I){z(E(I.getSelection()));}});G.addCommand('cellInsertBefore',{exec:function(I){var J=I.getSelection();w(J,true);}});G.addCommand('cellInsertAfter',{exec:function(I){var J=I.getSelection();w(J);}});if(G.addMenuItems)G.addMenuItems({tablecell:{label:H.cell.menu,group:'tablecell',order:1,getItems:function(){var I=G.getSelection(),J=n(I);return{tablecell_insertBefore:2,tablecell_insertAfter:2,tablecell_delete:2,tablecell_merge:C(I,null,true)?2:0,tablecell_merge_right:C(I,'right',true)?2:0,tablecell_merge_down:C(I,'down',true)?2:0,tablecell_split_vertical:D(I,true)?2:0,tablecell_split_horizontal:E(I,true)?2:0,tablecell_properties:J.length>0?2:0};
|
|
||||||
}},tablecell_insertBefore:{label:H.cell.insertBefore,group:'tablecell',command:'cellInsertBefore',order:5},tablecell_insertAfter:{label:H.cell.insertAfter,group:'tablecell',command:'cellInsertAfter',order:10},tablecell_delete:{label:H.cell.deleteCell,group:'tablecell',command:'cellDelete',order:15},tablecell_merge:{label:H.cell.merge,group:'tablecell',command:'cellMerge',order:16},tablecell_merge_right:{label:H.cell.mergeRight,group:'tablecell',command:'cellMergeRight',order:17},tablecell_merge_down:{label:H.cell.mergeDown,group:'tablecell',command:'cellMergeDown',order:18},tablecell_split_horizontal:{label:H.cell.splitHorizontal,group:'tablecell',command:'cellHorizontalSplit',order:19},tablecell_split_vertical:{label:H.cell.splitVertical,group:'tablecell',command:'cellVerticalSplit',order:20},tablecell_properties:{label:H.cell.title,group:'tablecellproperties',command:'cellProperties',order:21},tablerow:{label:H.row.menu,group:'tablerow',order:1,getItems:function(){return{tablerow_insertBefore:2,tablerow_insertAfter:2,tablerow_delete:2};}},tablerow_insertBefore:{label:H.row.insertBefore,group:'tablerow',command:'rowInsertBefore',order:5},tablerow_insertAfter:{label:H.row.insertAfter,group:'tablerow',command:'rowInsertAfter',order:10},tablerow_delete:{label:H.row.deleteRow,group:'tablerow',command:'rowDelete',order:15},tablecolumn:{label:H.column.menu,group:'tablecolumn',order:1,getItems:function(){return{tablecolumn_insertBefore:2,tablecolumn_insertAfter:2,tablecolumn_delete:2};}},tablecolumn_insertBefore:{label:H.column.insertBefore,group:'tablecolumn',command:'columnInsertBefore',order:5},tablecolumn_insertAfter:{label:H.column.insertAfter,group:'tablecolumn',command:'columnInsertAfter',order:10},tablecolumn_delete:{label:H.column.deleteColumn,group:'tablecolumn',command:'columnDelete',order:15}});if(G.contextMenu)G.contextMenu.addListener(function(I,J){if(!I||I.isReadOnly())return null;while(I){if(I.getName() in F)return{tablecell:2,tablerow:2,tablecolumn:2};I=I.getParent();}return null;});},getSelectedCells:n};j.add('tabletools',j.tabletools);})();e.buildTableMap=function(m){var n=m.$.rows,o=-1,p=[];for(var q=0;q<n.length;q++){o++;!p[o]&&(p[o]=[]);var r=-1;for(var s=0;s<n[q].cells.length;s++){var t=n[q].cells[s];r++;while(p[o][r])r++;var u=isNaN(t.colSpan)?1:t.colSpan,v=isNaN(t.rowSpan)?1:t.rowSpan;for(var w=0;w<v;w++){if(!p[o+w])p[o+w]=[];for(var x=0;x<u;x++)p[o+w][r+x]=n[q].cells[s];}r+=u-1;}}return p;};j.add('specialchar',{requires:['dialog'],availableLangs:{cs:1,cy:1,de:1,el:1,en:1,eo:1,et:1,fa:1,fi:1,fr:1,he:1,hr:1,it:1,nb:1,nl:1,no:1,'pt-br':1,tr:1,ug:1,'zh-cn':1},init:function(m){var n='specialchar',o=this;
|
|
||||||
a.dialog.add(n,this.path+'dialogs/specialchar.js');m.addCommand(n,{exec:function(){var p=m.langCode;p=o.availableLangs[p]?p:'en';a.scriptLoader.load(a.getUrl(o.path+'lang/'+p+'.js'),function(){e.extend(m.lang.specialChar,o.langEntries[p]);m.openDialog(n);});},modes:{wysiwyg:1},canUndo:false});m.ui.addButton('SpecialChar',{label:m.lang.specialChar.toolbar,command:n});}});i.specialChars=['!','"','#','$','%','&',"'",'(',')','*','+','-','.','/','0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?','@','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','[',']','^','_','`','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','{','|','}','~','€','‘','’','“','”','–','—','¡','¢','£','¤','¥','¦','§','¨','©','ª','«','¬','®','¯','°','²','³','´','µ','¶','·','¸','¹','º','»','¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü','ý','þ','ÿ','Œ','œ','Ŵ','Ŷ','ŵ','ŷ','‚','‛','„','…','™','►','•','→','⇒','⇔','♦','≈'];(function(){var m={editorFocus:false,modes:{wysiwyg:1,source:1}},n={readOnly:1,exec:function(q){q.container.focusNext(true,q.tabIndex);}},o={readOnly:1,exec:function(q){q.container.focusPrevious(true,q.tabIndex);}};function p(q){return{editorFocus:false,canUndo:false,modes:{wysiwyg:1},exec:function(r){if(r.focusManager.hasFocus){var s=r.getSelection(),t=s.getCommonAncestor(),u;if(u=t.getAscendant('td',true)||t.getAscendant('th',true)){var v=new d.range(r.document),w=e.tryThese(function(){var D=u.getParent(),E=D.$.cells[u.$.cellIndex+(q?-1:1)];E.parentNode.parentNode;
|
|
||||||
return E;},function(){var D=u.getParent(),E=D.getAscendant('table'),F=E.$.rows[D.$.rowIndex+(q?-1:1)];return F.cells[q?F.cells.length-1:0];});if(!(w||q)){var x=u.getAscendant('table').$,y=u.getParent().$.cells,z=new h(x.insertRow(-1),r.document);for(var A=0,B=y.length;A<B;A++){var C=z.append(new h(y[A],r.document).clone(false,false));!c&&C.appendBogus();}v.moveToElementEditStart(z);}else if(w){w=new h(w);v.moveToElementEditStart(w);if(!(v.checkStartOfBlock()&&v.checkEndOfBlock()))v.selectNodeContents(w);}else return true;v.select(true);return true;}}return false;}};};j.add('tab',{requires:['keystrokes'],init:function(q){var r=q.config.enableTabKeyTools!==false,s=q.config.tabSpaces||0,t='';while(s--)t+='\xa0';if(t)q.on('key',function(u){if(u.data.keyCode==9){q.insertHtml(t);u.cancel();}});if(r)q.on('key',function(u){if(u.data.keyCode==9&&q.execCommand('selectNextCell')||u.data.keyCode==2228224+9&&q.execCommand('selectPreviousCell'))u.cancel();});if(b.webkit||b.gecko)q.on('key',function(u){var v=u.data.keyCode;if(v==9&&!t){u.cancel();q.execCommand('blur');}if(v==2228224+9){q.execCommand('blurBack');u.cancel();}});q.addCommand('blur',e.extend(n,m));q.addCommand('blurBack',e.extend(o,m));q.addCommand('selectNextCell',p());q.addCommand('selectPreviousCell',p(true));}});})();h.prototype.focusNext=function(m,n){var w=this;var o=w.$,p=n===undefined?w.getTabIndex():n,q,r,s,t,u,v;if(p<=0){u=w.getNextSourceNode(m,1);while(u){if(u.isVisible()&&u.getTabIndex()===0){s=u;break;}u=u.getNextSourceNode(false,1);}}else{u=w.getDocument().getBody().getFirst();while(u=u.getNextSourceNode(false,1)){if(!q)if(!r&&u.equals(w)){r=true;if(m){if(!(u=u.getNextSourceNode(true,1)))break;q=1;}}else if(r&&!w.contains(u))q=1;if(!u.isVisible()||(v=u.getTabIndex())<0)continue;if(q&&v==p){s=u;break;}if(v>p&&(!s||!t||v<t)){s=u;t=v;}else if(!s&&v===0){s=u;t=v;}}}if(s)s.focus();};h.prototype.focusPrevious=function(m,n){var w=this;var o=w.$,p=n===undefined?w.getTabIndex():n,q,r,s,t=0,u,v=w.getDocument().getBody().getLast();while(v=v.getPreviousSourceNode(false,1)){if(!q)if(!r&&v.equals(w)){r=true;if(m){if(!(v=v.getPreviousSourceNode(true,1)))break;q=1;}}else if(r&&!w.contains(v))q=1;if(!v.isVisible()||(u=v.getTabIndex())<0)continue;if(p<=0){if(q&&u===0){s=v;break;}if(u>t){s=v;t=u;}}else{if(q&&u==p){s=v;break;}if(u<p&&(!s||u>t)){s=v;t=u;}}}if(s)s.focus();};(function(){j.add('templates',{requires:['dialog'],init:function(o){a.dialog.add('templates',a.getUrl(this.path+'dialogs/templates.js'));o.addCommand('templates',new a.dialogCommand('templates'));
|
|
||||||
o.ui.addButton('Templates',{label:o.lang.templates.button,command:'templates'});}});var m={},n={};a.addTemplates=function(o,p){m[o]=p;};a.getTemplates=function(o){return m[o];};a.loadTemplates=function(o,p){var q=[];for(var r=0,s=o.length;r<s;r++){if(!n[o[r]]){q.push(o[r]);n[o[r]]=1;}}if(q.length)a.scriptLoader.load(q,p);else setTimeout(p,0);};})();i.templates_files=[a.getUrl('plugins/templates/templates/default.js')];i.templates_replaceContent=true;(function(){var m=function(){this.toolbars=[];this.focusCommandExecuted=false;};m.prototype.focus=function(){for(var o=0,p;p=this.toolbars[o++];)for(var q=0,r;r=p.items[q++];){if(r.focus){r.focus();return;}}};var n={toolbarFocus:{modes:{wysiwyg:1,source:1},readOnly:1,exec:function(o){if(o.toolbox){o.toolbox.focusCommandExecuted=true;if(c||b.air)setTimeout(function(){o.toolbox.focus();},100);else o.toolbox.focus();}}}};j.add('toolbar',{requires:['button'],init:function(o){var p,q=function(r,s){var t,u,v=o.lang.dir=='rtl',w=o.config.toolbarGroupCycling;w=w===undefined||w;switch(s){case 9:case 2228224+9:while(!u||!u.items.length){u=s==9?(u?u.next:r.toolbar.next)||o.toolbox.toolbars[0]:(u?u.previous:r.toolbar.previous)||o.toolbox.toolbars[o.toolbox.toolbars.length-1];if(u.items.length){r=u.items[p?u.items.length-1:0];while(r&&!r.focus){r=p?r.previous:r.next;if(!r)u=0;}}}if(r)r.focus();return false;case v?37:39:case 40:t=r;do{t=t.next;if(!t&&w)t=r.toolbar.items[0];}while(t&&!t.focus);if(t)t.focus();else q(r,9);return false;case v?39:37:case 38:t=r;do{t=t.previous;if(!t&&w)t=r.toolbar.items[r.toolbar.items.length-1];}while(t&&!t.focus);if(t)t.focus();else{p=1;q(r,2228224+9);p=0;}return false;case 27:o.focus();return false;case 13:case 32:r.execute();return false;}return true;};o.on('themeSpace',function(r){if(r.data.space==o.config.toolbarLocation){o.toolbox=new m();var s=e.getNextId(),t=['<div class="cke_toolbox" role="group" aria-labelledby="',s,'" onmousedown="return false;"'],u=o.config.toolbarStartupExpanded!==false,v;t.push(u?'>':' style="display:none">');t.push('<span id="',s,'" class="cke_voice_label">',o.lang.toolbars,'</span>');var w=o.toolbox.toolbars,x=o.config.toolbar instanceof Array?o.config.toolbar:o.config['toolbar_'+o.config.toolbar];for(var y=0;y<x.length;y++){var z,A=0,B,C=x[y],D;if(!C)continue;if(v){t.push('</div>');v=0;}if(C==='/'){t.push('<div class="cke_break"></div>');continue;}D=C.items||C;for(var E=0;E<D.length;E++){var F,G=D[E],H;F=o.ui.create(G);if(F){H=F.canGroup!==false;if(!A){z=e.getNextId();
|
|
||||||
A={id:z,items:[]};B=C.name&&(o.lang.toolbarGroups[C.name]||C.name);t.push('<span id="',z,'" class="cke_toolbar"',B?' aria-labelledby="'+z+'_label"':'',' role="toolbar">');B&&t.push('<span id="',z,'_label" class="cke_voice_label">',B,'</span>');t.push('<span class="cke_toolbar_start"></span>');var I=w.push(A)-1;if(I>0){A.previous=w[I-1];A.previous.next=A;}}if(H){if(!v){t.push('<span class="cke_toolgroup" role="presentation">');v=1;}}else if(v){t.push('</span>');v=0;}var J=F.render(o,t);I=A.items.push(J)-1;if(I>0){J.previous=A.items[I-1];J.previous.next=J;}J.toolbar=A;J.onkey=q;J.onfocus=function(){if(!o.toolbox.focusCommandExecuted)o.focus();};}}if(v){t.push('</span>');v=0;}if(A)t.push('<span class="cke_toolbar_end"></span></span>');}t.push('</div>');if(o.config.toolbarCanCollapse){var K=e.addFunction(function(){o.execCommand('toolbarCollapse');});o.on('destroy',function(){e.removeFunction(K);});var L=e.getNextId();o.addCommand('toolbarCollapse',{readOnly:1,exec:function(M){var N=a.document.getById(L),O=N.getPrevious(),P=M.getThemeSpace('contents'),Q=O.getParent(),R=parseInt(P.$.style.height,10),S=Q.$.offsetHeight,T=!O.isVisible();if(!T){O.hide();N.addClass('cke_toolbox_collapser_min');N.setAttribute('title',M.lang.toolbarExpand);}else{O.show();N.removeClass('cke_toolbox_collapser_min');N.setAttribute('title',M.lang.toolbarCollapse);}N.getFirst().setText(T?'▲':'◀');var U=Q.$.offsetHeight-S;P.setStyle('height',R-U+'px');M.fire('resize');},modes:{wysiwyg:1,source:1}});t.push('<a title="'+(u?o.lang.toolbarCollapse:o.lang.toolbarExpand)+'" id="'+L+'" tabIndex="-1" class="cke_toolbox_collapser');if(!u)t.push(' cke_toolbox_collapser_min');t.push('" onclick="CKEDITOR.tools.callFunction('+K+')">','<span>▲</span>','</a>');}r.data.html+=t.join('');}});o.on('destroy',function(){var r,s=0,t,u,v;r=this.toolbox.toolbars;for(;s<r.length;s++){u=r[s].items;for(t=0;t<u.length;t++){v=u[t];if(v.clickFn)e.removeFunction(v.clickFn);if(v.keyDownFn)e.removeFunction(v.keyDownFn);}}});o.addCommand('toolbarFocus',n.toolbarFocus);o.ui.add('-',a.UI_SEPARATOR,{});o.ui.addHandler(a.UI_SEPARATOR,{create:function(){return{render:function(r,s){s.push('<span class="cke_separator" role="separator"></span>');return{};}};}});}});})();a.UI_SEPARATOR='separator';i.toolbarLocation='top';i.toolbar_Basic=[['Bold','Italic','-','NumberedList','BulletedList','-','Link','Unlink','-','About']];i.toolbar_Full=[{name:'document',items:['Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates']},{name:'clipboard',items:['Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo']},{name:'editing',items:['Find','Replace','-','SelectAll','-','SpellChecker','Scayt']},{name:'forms',items:['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField']},'/',{name:'basicstyles',items:['Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat']},{name:'paragraph',items:['NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl']},{name:'links',items:['Link','Unlink','Anchor']},{name:'insert',items:['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe']},'/',{name:'styles',items:['Styles','Format','Font','FontSize']},{name:'colors',items:['TextColor','BGColor']},{name:'tools',items:['Maximize','ShowBlocks','-','About']}];
|
|
||||||
i.toolbar='Full';i.toolbarCanCollapse=true;(function(){j.add('undo',{requires:['selection','wysiwygarea'],init:function(s){var t=new o(s),u=s.addCommand('undo',{exec:function(){if(t.undo()){s.selectionChange();this.fire('afterUndo');}},state:0,canUndo:false}),v=s.addCommand('redo',{exec:function(){if(t.redo()){s.selectionChange();this.fire('afterRedo');}},state:0,canUndo:false});t.onChange=function(){u.setState(t.undoable()?2:0);v.setState(t.redoable()?2:0);};function w(x){if(t.enabled&&x.data.command.canUndo!==false)t.save();};s.on('beforeCommandExec',w);s.on('afterCommandExec',w);s.on('saveSnapshot',function(x){t.save(x.data&&x.data.contentOnly);});s.on('contentDom',function(){s.document.on('keydown',function(x){if(!x.data.$.ctrlKey&&!x.data.$.metaKey)t.type(x);});});s.on('beforeModeUnload',function(){s.mode=='wysiwyg'&&t.save(true);});s.on('mode',function(){t.enabled=s.readOnly?false:s.mode=='wysiwyg';t.onChange();});s.ui.addButton('Undo',{label:s.lang.undo,command:'undo'});s.ui.addButton('Redo',{label:s.lang.redo,command:'redo'});s.resetUndo=function(){t.reset();s.fire('saveSnapshot');};s.on('updateSnapshot',function(){if(t.currentImage)t.update();});}});j.undo={};var m=j.undo.Image=function(s){this.editor=s;s.fire('beforeUndoImage');var t=s.getSnapshot(),u=t&&s.getSelection();c&&t&&(t=t.replace(/\s+data-cke-expando=".*?"/g,''));this.contents=t;this.bookmarks=u&&u.createBookmarks2(true);s.fire('afterUndoImage');},n=/\b(?:href|src|name)="[^"]*?"/gi;m.prototype={equals:function(s,t){var u=this.contents,v=s.contents;if(c&&(b.ie7Compat||b.ie6Compat)){u=u.replace(n,'');v=v.replace(n,'');}if(u!=v)return false;if(t)return true;var w=this.bookmarks,x=s.bookmarks;if(w||x){if(!w||!x||w.length!=x.length)return false;for(var y=0;y<w.length;y++){var z=w[y],A=x[y];if(z.startOffset!=A.startOffset||z.endOffset!=A.endOffset||!e.arrayCompare(z.start,A.start)||!e.arrayCompare(z.end,A.end))return false;}}return true;}};function o(s){this.editor=s;this.reset();};var p={8:1,46:1},q={16:1,17:1,18:1},r={37:1,38:1,39:1,40:1};o.prototype={type:function(s){var t=s&&s.data.getKey(),u=t in q,v=t in p,w=this.lastKeystroke in p,x=v&&t==this.lastKeystroke,y=t in r,z=this.lastKeystroke in r,A=!v&&!y,B=v&&!x,C=!(u||this.typing)||A&&(w||z);if(C||B){var D=new m(this.editor),E=this.snapshots.length;e.setTimeout(function(){var G=this;var F=G.editor.getSnapshot();if(c)F=F.replace(/\s+data-cke-expando=".*?"/g,'');if(D.contents!=F&&E==G.snapshots.length){G.typing=true;if(!G.save(false,D,false))G.snapshots.splice(G.index+1,G.snapshots.length-G.index-1);
|
|
||||||
G.hasUndo=true;G.hasRedo=false;G.typesCount=1;G.modifiersCount=1;G.onChange();}},0,this);}this.lastKeystroke=t;if(v){this.typesCount=0;this.modifiersCount++;if(this.modifiersCount>25){this.save(false,null,false);this.modifiersCount=1;}}else if(!y){this.modifiersCount=0;this.typesCount++;if(this.typesCount>25){this.save(false,null,false);this.typesCount=1;}}},reset:function(){var s=this;s.lastKeystroke=0;s.snapshots=[];s.index=-1;s.limit=s.editor.config.undoStackSize||20;s.currentImage=null;s.hasUndo=false;s.hasRedo=false;s.resetType();},resetType:function(){var s=this;s.typing=false;delete s.lastKeystroke;s.typesCount=0;s.modifiersCount=0;},fireChange:function(){var s=this;s.hasUndo=!!s.getNextImage(true);s.hasRedo=!!s.getNextImage(false);s.resetType();s.onChange();},save:function(s,t,u){var w=this;var v=w.snapshots;if(!t)t=new m(w.editor);if(t.contents===false)return false;if(w.currentImage&&t.equals(w.currentImage,s))return false;v.splice(w.index+1,v.length-w.index-1);if(v.length==w.limit)v.shift();w.index=v.push(t)-1;w.currentImage=t;if(u!==false)w.fireChange();return true;},restoreImage:function(s){var w=this;var t=w.editor,u;if(s.bookmarks){t.focus();u=t.getSelection();}w.editor.loadSnapshot(s.contents);if(s.bookmarks)u.selectBookmarks(s.bookmarks);else if(c){var v=w.editor.document.getBody().$.createTextRange();v.collapse(true);v.select();}w.index=s.index;w.update();w.fireChange();},getNextImage:function(s){var x=this;var t=x.snapshots,u=x.currentImage,v,w;if(u)if(s)for(w=x.index-1;w>=0;w--){v=t[w];if(!u.equals(v,true)){v.index=w;return v;}}else for(w=x.index+1;w<t.length;w++){v=t[w];if(!u.equals(v,true)){v.index=w;return v;}}return null;},redoable:function(){return this.enabled&&this.hasRedo;},undoable:function(){return this.enabled&&this.hasUndo;},undo:function(){var t=this;if(t.undoable()){t.save(true);var s=t.getNextImage(true);if(s)return t.restoreImage(s),true;}return false;},redo:function(){var t=this;if(t.redoable()){t.save(true);if(t.redoable()){var s=t.getNextImage(false);if(s)return t.restoreImage(s),true;}}return false;},update:function(){var s=this;s.snapshots.splice(s.index,1,s.currentImage=new m(s.editor));}};})();(function(){var m=/(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,n=d.walker.whitespaces(true),o=d.walker.bogus(true),p=function(E){return n(E)&&o(E);};function q(E){return E.isBlockBoundary()&&f.$empty[E.getName()];};function r(E){return function(F){if(this.mode=='wysiwyg'){this.focus();
|
|
||||||
var G=this.getSelection(),H=G.isLocked;H&&G.unlock();this.fire('saveSnapshot');E.call(this,F.data);H&&this.getSelection().lock();var I=this;setTimeout(function(){try{I.fire('saveSnapshot');}catch(J){setTimeout(function(){I.fire('saveSnapshot');},200);}},0);}};};function s(E){var N=this;if(N.dataProcessor)E=N.dataProcessor.toHtml(E);if(!E)return;var F=N.getSelection(),G=F.getRanges()[0];if(G.checkReadOnly())return;if(b.opera){var H=new d.elementPath(G.startContainer);if(H.block){var I=a.htmlParser.fragment.fromHtml(E,false).children;for(var J=0,K=I.length;J<K;J++){if(I[J]._.isBlockLike){G.splitBlock(N.enterMode==3?'div':'p');G.insertNode(G.document.createText(''));G.select();break;}}}}if(c){var L=F.getNative();if(L.type=='Control')L.clear();else if(F.getType()==2){G=F.getRanges()[0];var M=G&&G.endContainer;if(M&&M.type==1&&M.getAttribute('contenteditable')=='false'&&G.checkBoundaryOfElement(M,2)){G.setEndAfter(G.endContainer);G.deleteContents();}}L.createRange().pasteHTML(E);}else N.document.$.execCommand('inserthtml',false,E);if(b.webkit){F=N.getSelection();F.scrollIntoView();}};function t(E){var F=this.getSelection(),G=F.getStartElement().hasAscendant('pre',true)?2:this.config.enterMode,H=G==2,I=e.htmlEncode(E.replace(/\r\n|\r/g,'\n'));I=I.replace(/^[ \t]+|[ \t]+$/g,function(O,P,Q){if(O.length==1)return ' ';else if(!P)return e.repeat(' ',O.length-1)+' ';else return ' '+e.repeat(' ',O.length-1);});I=I.replace(/[ \t]{2,}/g,function(O){return e.repeat(' ',O.length-1)+' ';});var J=G==1?'p':'div';if(!H)I=I.replace(/(\n{2})([\s\S]*?)(?:$|\1)/g,function(O,P,Q){return '<'+J+'>'+Q+'</'+J+'>';});I=I.replace(/\n/g,'<br>');if(!(H||c))I=I.replace(new RegExp('<br>(?=</'+J+'>)'),function(O){return e.repeat(O,2);});if(b.gecko||b.webkit){var K=new d.elementPath(F.getStartElement()),L=[];for(var M=0;M<K.elements.length;M++){var N=K.elements[M].getName();if(N in f.$inline)L.unshift(K.elements[M].getOuterHtml().match(/^<.*?>/));else if(N in f.$block)break;}I=L.join('')+I;}s.call(this,I);};function u(E){var F=this.getSelection(),G=F.getRanges(),H=E.getName(),I=f.$block[H],J=F.isLocked;if(J)F.unlock();var K,L,M,N;for(var O=G.length-1;O>=0;O--){K=G[O];if(!K.checkReadOnly()){K.deleteContents(1);L=!O&&E||E.clone(1);var P,Q;if(I)while((P=K.getCommonAncestor(0,1))&&(Q=f[P.getName()])&&!(Q&&Q[H])){if(P.getName() in f.span)K.splitElement(P);else if(K.checkStartOfBlock()&&K.checkEndOfBlock()){K.setStartBefore(P);K.collapse(true);P.remove();}else K.splitBlock();}K.insertNode(L);
|
|
||||||
if(!M)M=L;}}if(M){K.moveToPosition(M,4);if(I){var R=M.getNext(p),S=R&&R.type==1&&R.getName();if(S&&f.$block[S]){if(f[S]['#'])K.moveToElementEditStart(R);else K.moveToElementEditEnd(M);}else if(!R){R=K.fixBlock(true,this.config.enterMode==3?'div':'p');K.moveToElementEditStart(R);}}}F.selectRanges([K]);if(J)this.getSelection().lock();};function v(E){if(!E.checkDirty())setTimeout(function(){E.resetDirty();},0);};var w=d.walker.whitespaces(true),x=d.walker.bookmark(false,true);function y(E){return w(E)&&x(E);};function z(E){return E.type==3&&e.trim(E.getText()).match(/^(?: |\xa0)$/);};function A(E){if(E.isLocked){E.unlock();setTimeout(function(){E.lock();},0);}};function B(E){return E.getOuterHtml().match(m);};w=d.walker.whitespaces(true);function C(E){var F=E.window,G=E.document,H=E.document.getBody(),I=H.getFirst(),J=H.getChildren().count();if(!J||J==1&&I.type==1&&I.hasAttribute('_moz_editor_bogus_node')){v(E);var K=E.element.getDocument(),L=K.getDocumentElement(),M=L.$.scrollTop,N=L.$.scrollLeft,O=G.$.createEvent('KeyEvents');O.initKeyEvent('keypress',true,true,F.$,false,false,false,false,0,32);G.$.dispatchEvent(O);if(M!=L.$.scrollTop||N!=L.$.scrollLeft)K.getWindow().$.scrollTo(N,M);J&&H.getFirst().remove();G.getBody().appendBogus();var P=new d.range(G);P.setStartAt(H,1);P.select();}};function D(E){var F=E.editor,G=E.data.path,H=G.blockLimit,I=E.data.selection,J=I.getRanges()[0],K=F.document.getBody(),L=F.config.enterMode;if(b.gecko){var M=G.block||G.blockLimit,N=M&&M.getLast(y);if(M&&M.isBlockBoundary()&&!(N&&N.type==1&&N.isBlockBoundary())&&!M.is('pre')&&!M.getBogus())M.appendBogus();}if(F.config.autoParagraph!==false&&L!=2&&J.collapsed&&H.getName()=='body'&&!G.block){var O=J.fixBlock(true,F.config.enterMode==3?'div':'p');if(c){var P=O.getFirst(y);P&&z(P)&&P.remove();}if(B(O)){var Q=O.getNext(w);if(Q&&Q.type==1&&!q(Q)){J.moveToElementEditStart(Q);O.remove();}else{Q=O.getPrevious(w);if(Q&&Q.type==1&&!q(Q)){J.moveToElementEditEnd(Q);O.remove();}}}J.select();E.cancel();}var R=new d.range(F.document);R.moveToElementEditEnd(F.document.getBody());var S=new d.elementPath(R.startContainer);if(!S.blockLimit.is('body')){var T;if(L!=2)T=K.append(F.document.createElement(L==1?'p':'div'));else T=K;if(!c)T.appendBogus();}};j.add('wysiwygarea',{requires:['editingblock'],init:function(E){var F=E.config.enterMode!=2&&E.config.autoParagraph!==false?E.config.enterMode==3?'div':'p':false,G=E.lang.editorTitle.replace('%1',E.name),H=E.lang.editorHelp;if(c)G+=', '+H;var I=a.document.getWindow(),J;
|
|
||||||
E.on('editingBlockReady',function(){var M,N,O,P,Q,R,S,T=b.isCustomDomain(),U=function(X){if(N)N.remove();var Y='document.open();'+(T?'document.domain="'+document.domain+'";':'')+'document.close();';Y=b.air?'javascript:void(0)':c?'javascript:void(function(){'+encodeURIComponent(Y)+'}())':'';var Z=e.getNextId();N=h.createFromHtml('<iframe style="width:100%;height:100%" frameBorder="0" aria-describedby="'+Z+'"'+' title="'+G+'"'+' src="'+Y+'"'+' tabIndex="'+(b.webkit?-1:E.tabIndex)+'"'+' allowTransparency="true"'+'></iframe>');if(document.location.protocol=='chrome:')a.event.useCapture=true;N.on('load',function(aa){Q=1;aa.removeListener();var ab=N.getFrameDocument();ab.write(X);b.air&&W(ab.getWindow().$);});if(document.location.protocol=='chrome:')a.event.useCapture=false;M.append(h.createFromHtml('<span id="'+Z+'" class="cke_voice_label">'+H+'</span>'));M.append(N);if(b.webkit){S=function(){M.setStyle('width','100%');N.hide();N.setSize('width',M.getSize('width'));M.removeStyle('width');N.show();};I.on('resize',S);}};J=e.addFunction(W);var V='<script id="cke_actscrpt" type="text/javascript" data-cke-temp="1">'+(T?'document.domain="'+document.domain+'";':'')+'window.parent.CKEDITOR.tools.callFunction( '+J+', window );'+'</script>';function W(X){if(!Q)return;Q=0;E.fire('ariaWidget',N);var Y=X.document,Z=Y.body,aa=Y.getElementById('cke_actscrpt');aa&&aa.parentNode.removeChild(aa);Z.spellcheck=!E.config.disableNativeSpellChecker;var ab=!E.readOnly;if(c){Z.hideFocus=true;Z.disabled=true;Z.contentEditable=ab;Z.removeAttribute('disabled');}else setTimeout(function(){if(b.gecko&&b.version>=10900||b.opera)Y.$.body.contentEditable=ab;else if(b.webkit)Y.$.body.parentNode.contentEditable=ab;else Y.$.designMode=ab?'off':'on';},0);ab&&b.gecko&&e.setTimeout(C,0,null,E);X=E.window=new d.window(X);Y=E.document=new g(Y);ab&&Y.on('dblclick',function(ag){var ah=ag.data.getTarget(),ai={element:ah,dialog:''};E.fire('doubleclick',ai);ai.dialog&&E.openDialog(ai.dialog);});c&&Y.on('click',function(ag){var ah=ag.data.getTarget();if(ah.is('input')){var ai=ah.getAttribute('type');if(ai=='submit'||ai=='reset')ag.data.preventDefault();}});if(!(c||b.opera))Y.on('mousedown',function(ag){var ah=ag.data.getTarget();if(ah.is('img','hr','input','textarea','select'))E.getSelection().selectElement(ah);});if(b.gecko)Y.on('mouseup',function(ag){if(ag.data.$.button==2){var ah=ag.data.getTarget();if(!ah.getOuterHtml().replace(m,'')){var ai=new d.range(Y);ai.moveToElementEditStart(ah);ai.select(true);}}});
|
|
||||||
Y.on('click',function(ag){ag=ag.data;if(ag.getTarget().is('a')&&ag.$.button!=2)ag.preventDefault();});if(b.webkit){Y.on('mousedown',function(){ad=1;});Y.on('click',function(ag){if(ag.data.getTarget().is('input','select'))ag.data.preventDefault();});Y.on('mouseup',function(ag){if(ag.data.getTarget().is('input','textarea'))ag.data.preventDefault();});}var ac=c?N:X;ac.on('blur',function(){E.focusManager.blur();});var ad;ac.on('focus',function(){var ag=E.document;if(b.gecko||b.opera)ag.getBody().focus();else if(b.webkit)if(!ad){E.document.getDocumentElement().focus();ad=1;}E.focusManager.focus();});var ae=E.keystrokeHandler;ae.blockedKeystrokes[8]=!ab;ae.attach(Y);Y.getDocumentElement().addClass(Y.$.compatMode);E.on('key',function(ag){if(E.mode!='wysiwyg')return;var ah=ag.data.keyCode;if(ah in {8:1,46:1}){var ai=E.getSelection(),aj=ai.getSelectedElement(),ak=ai.getRanges()[0],al=new d.elementPath(ak.startContainer),am,an,ao,ap=ah==8;if(aj){E.fire('saveSnapshot');ak.moveToPosition(aj,3);aj.remove();ak.select();E.fire('saveSnapshot');ag.cancel();}else if(ak.collapsed)if((am=al.block)&&ak[ap?'checkStartOfBlock':'checkEndOfBlock']()&&(ao=am[ap?'getPrevious':'getNext'](n))&&ao.is('table')){E.fire('saveSnapshot');if(ak[ap?'checkEndOfBlock':'checkStartOfBlock']())am.remove();ak['moveToElementEdit'+(ap?'End':'Start')](ao);ak.select();E.fire('saveSnapshot');ag.cancel();}else if(al.blockLimit.is('td')&&(an=al.blockLimit.getAscendant('table'))&&ak.checkBoundaryOfElement(an,ap?1:2)&&(ao=an[ap?'getPrevious':'getNext'](n))){E.fire('saveSnapshot');ak['moveToElementEdit'+(ap?'End':'Start')](ao);if(ak.checkStartOfBlock()&&ak.checkEndOfBlock())ao.remove();else ak.select();E.fire('saveSnapshot');ag.cancel();}}if(ah==33||ah==34)if(b.gecko){var aq=Y.getBody();if(X.$.innerHeight>aq.$.offsetHeight){ak=new d.range(Y);ak[ah==33?'moveToElementEditStart':'moveToElementEditEnd'](aq);ak.select();ag.cancel();}}});if(c&&Y.$.compatMode=='CSS1Compat'){var af={33:1,34:1};Y.on('keydown',function(ag){if(ag.data.getKeystroke() in af)setTimeout(function(){E.getSelection().scrollIntoView();},0);});}if(c&&E.config.enterMode!=1)Y.on('selectionchange',function(){var ag=Y.getBody(),ah=E.getSelection(),ai=ah&&ah.getRanges()[0];if(ai&&ag.getHtml().match(/^<p> <\/p>$/i)&&ai.startContainer.equals(ag))setTimeout(function(){ai=E.getSelection().getRanges()[0];if(!ai.startContainer.equals('body')){ag.getFirst().remove(1);ai.moveToElementEditEnd(ag);ai.select(1);}},0);});if(E.contextMenu)E.contextMenu.addTarget(Y,E.config.browserContextMenuOnCtrl!==false);
|
|
||||||
setTimeout(function(){E.fire('contentDom');if(R){E.mode='wysiwyg';E.fire('mode',{previousMode:E._.previousMode});R=false;}O=false;if(P){E.focus();P=false;}setTimeout(function(){E.fire('dataReady');},0);try{E.document.$.execCommand('2D-position',false,true);}catch(ag){}try{E.document.$.execCommand('enableInlineTableEditing',false,!E.config.disableNativeTableHandles);}catch(ah){}if(E.config.disableObjectResizing)try{E.document.$.execCommand('enableObjectResizing',false,false);}catch(ai){E.document.getBody().on(c?'resizestart':'resize',function(aj){aj.data.preventDefault();});}if(c)setTimeout(function(){if(E.document){var aj=E.document.$.body;aj.runtimeStyle.marginBottom='0px';aj.runtimeStyle.marginBottom='';}},1000);},0);};E.addMode('wysiwyg',{load:function(X,Y,Z){M=X;if(c&&b.quirks)X.setStyle('position','relative');E.mayBeDirty=true;R=true;if(Z)this.loadSnapshotData(Y);else this.loadData(Y);},loadData:function(X){O=true;E._.dataStore={id:1};var Y=E.config,Z=Y.fullPage,aa=Y.docType,ab='<style type="text/css" data-cke-temp="1">'+E._.styles.join('\n')+'</style>';!Z&&(ab=e.buildStyleHtml(E.config.contentsCss)+ab);var ac=Y.baseHref?'<base href="'+Y.baseHref+'" data-cke-temp="1" />':'';if(Z)X=X.replace(/<!DOCTYPE[^>]*>/i,function(ad){E.docType=aa=ad;return '';}).replace(/<\?xml\s[^\?]*\?>/i,function(ad){E.xmlDeclaration=ad;return '';});if(E.dataProcessor)X=E.dataProcessor.toHtml(X,F);if(Z){if(!/<body[\s|>]/.test(X))X='<body>'+X;if(!/<html[\s|>]/.test(X))X='<html>'+X+'</html>';if(!/<head[\s|>]/.test(X))X=X.replace(/<html[^>]*>/,'$&<head><title></title></head>');else if(!/<title[\s|>]/.test(X))X=X.replace(/<head[^>]*>/,'$&<title></title>');ac&&(X=X.replace(/<head>/,'$&'+ac));X=X.replace(/<\/head\s*>/,ab+'$&');X=aa+X;}else X=Y.docType+'<html dir="'+Y.contentsLangDirection+'"'+' lang="'+(Y.contentsLanguage||E.langCode)+'">'+'<head>'+'<title>'+G+'</title>'+ac+ab+'</head>'+'<body'+(Y.bodyId?' id="'+Y.bodyId+'"':'')+(Y.bodyClass?' class="'+Y.bodyClass+'"':'')+'>'+X+'</html>';if(b.gecko)X=X.replace(/<br \/>(?=\s*<\/(:?html|body)>)/,'$&<br type="_moz" />');X+=V;this.onDispose();U(X);},getData:function(){var X=E.config,Y=X.fullPage,Z=Y&&E.docType,aa=Y&&E.xmlDeclaration,ab=N.getFrameDocument(),ac=Y?ab.getDocumentElement().getOuterHtml():ab.getBody().getHtml();if(b.gecko)ac=ac.replace(/<br>(?=\s*(:?$|<\/body>))/,'');if(E.dataProcessor)ac=E.dataProcessor.toDataFormat(ac,F);if(X.ignoreEmptyParagraph)ac=ac.replace(m,function(ad,ae){return ae;});if(aa)ac=aa+'\n'+ac;if(Z)ac=Z+'\n'+ac;
|
|
||||||
return ac;},getSnapshotData:function(){return N.getFrameDocument().getBody().getHtml();},loadSnapshotData:function(X){N.getFrameDocument().getBody().setHtml(X);},onDispose:function(){if(!E.document)return;E.document.getDocumentElement().clearCustomData();E.document.getBody().clearCustomData();E.window.clearCustomData();E.document.clearCustomData();N.clearCustomData();N.remove();},unload:function(X){this.onDispose();if(S)I.removeListener('resize',S);E.window=E.document=N=M=P=null;E.fire('contentDomUnload');},focus:function(){var X=E.window;if(O)P=true;else if(X){var Y=E.getSelection(),Z=Y&&Y.getNative();if(Z&&Z.type=='Control')return;b.air?setTimeout(function(){X.focus();},0):X.focus();E.selectionChange();}}});E.on('insertHtml',r(s),null,null,20);E.on('insertElement',r(u),null,null,20);E.on('insertText',r(t),null,null,20);E.on('selectionChange',function(X){if(E.readOnly)return;var Y=E.getSelection();if(Y&&!Y.isLocked){var Z=E.checkDirty();E.fire('saveSnapshot',{contentOnly:1});D.call(this,X);E.fire('updateSnapshot');!Z&&E.resetDirty();}},null,null,1);});E.on('contentDom',function(){var M=E.document.getElementsByTag('title').getItem(0);M.data('cke-title',E.document.$.title);c&&(E.document.$.title=G);});E.on('readOnly',function(){if(E.mode=='wysiwyg'){var M=E.getMode();M.loadData(M.getData());}});if(a.document.$.documentMode>=8){E.addCss('html.CSS1Compat [contenteditable=false]{ min-height:0 !important;}');var K=[];for(var L in f.$removeEmpty)K.push('html.CSS1Compat '+L+'[contenteditable=false]');E.addCss(K.join(',')+'{ display:inline-block;}');}else if(b.gecko){E.addCss('html { height: 100% !important; }');E.addCss('img:-moz-broken { -moz-force-broken-image-icon : 1;\tmin-width : 24px; min-height : 24px; }');}E.addCss('html {\t_overflow-y: scroll; cursor: text;\t*cursor:auto;}');E.addCss('img, input, textarea { cursor: default;}');E.on('insertElement',function(M){var N=M.data;if(N.type==1&&(N.is('input')||N.is('textarea'))){var O=N.getAttribute('contenteditable')=='false';if(!O){N.data('cke-editable',N.hasAttribute('contenteditable')?'true':'1');N.setAttribute('contenteditable',false);}}});}});if(b.gecko)(function(){var E=document.body;if(!E)window.addEventListener('load',arguments.callee,false);else{var F=E.getAttribute('onpageshow');E.setAttribute('onpageshow',(F?F+';':'')+'event.persisted && (function(){'+'var allInstances = CKEDITOR.instances, editor, doc;'+'for ( var i in allInstances )'+'{'+'\teditor = allInstances[ i ];'+'\tdoc = editor.document;'+'\tif ( doc )'+'\t{'+'\t\tdoc.$.designMode = "off";'+'\t\tdoc.$.designMode = "on";'+'\t}'+'}'+'})();');
|
|
||||||
}})();})();i.disableObjectResizing=false;i.disableNativeTableHandles=true;i.disableNativeSpellChecker=true;i.ignoreEmptyParagraph=true;j.add('wsc',{requires:['dialog'],init:function(m){var n='checkspell',o=m.addCommand(n,new a.dialogCommand(n));o.modes={wysiwyg:!b.opera&&!b.air&&document.domain==window.location.hostname};m.ui.addButton('SpellChecker',{label:m.lang.spellCheck.toolbar,command:n});a.dialog.add(n,this.path+'dialogs/wsc.js');}});i.wsc_customerId=i.wsc_customerId||'1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk';i.wsc_customLoaderScript=i.wsc_customLoaderScript||null;a.DIALOG_RESIZE_NONE=0;a.DIALOG_RESIZE_WIDTH=1;a.DIALOG_RESIZE_HEIGHT=2;a.DIALOG_RESIZE_BOTH=3;(function(){var m=e.cssLength;function n(R){return!!this._.tabs[R][0].$.offsetHeight;};function o(){var V=this;var R=V._.currentTabId,S=V._.tabIdList.length,T=e.indexOf(V._.tabIdList,R)+S;for(var U=T-1;U>T-S;U--){if(n.call(V,V._.tabIdList[U%S]))return V._.tabIdList[U%S];}return null;};function p(){var V=this;var R=V._.currentTabId,S=V._.tabIdList.length,T=e.indexOf(V._.tabIdList,R);for(var U=T+1;U<T+S;U++){if(n.call(V,V._.tabIdList[U%S]))return V._.tabIdList[U%S];}return null;};function q(R,S){var T=R.$.getElementsByTagName('input');for(var U=0,V=T.length;U<V;U++){var W=new h(T[U]);if(W.getAttribute('type').toLowerCase()=='text')if(S){W.setAttribute('value',W.getCustomData('fake_value')||'');W.removeCustomData('fake_value');}else{W.setCustomData('fake_value',W.getAttribute('value'));W.setAttribute('value','');}}};function r(R,S){var U=this;var T=U.getInputElement();if(T)R?T.removeAttribute('aria-invalid'):T.setAttribute('aria-invalid',true);if(!R)if(U.select)U.select();else U.focus();S&&alert(S);U.fire('validated',{valid:R,msg:S});};function s(){var R=this.getInputElement();R&&R.removeAttribute('aria-invalid');};a.dialog=function(R,S){var T=a.dialog._.dialogDefinitions[S],U=e.clone(v),V=R.config.dialog_buttonsOrder||'OS',W=R.lang.dir,X={},Y,Z,aa;if(V=='OS'&&b.mac||V=='rtl'&&W=='ltr'||V=='ltr'&&W=='rtl')U.buttons.reverse();T=e.extend(T(R),U);T=e.clone(T);T=new z(this,T);var ab=a.document,ac=R.theme.buildDialog(R);this._={editor:R,element:ac.element,name:S,contentSize:{width:0,height:0},size:{width:0,height:0},contents:{},buttons:{},accessKeyMap:{},tabs:{},tabIdList:[],currentTabId:null,currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:false,focusList:[],currentFocusIndex:0,hasFocus:false};this.parts=ac.parts;e.setTimeout(function(){R.fire('ariaWidget',this.parts.contents);
|
|
||||||
},0,this);var ad={position:b.ie6Compat?'absolute':'fixed',top:0,visibility:'hidden'};ad[W=='rtl'?'right':'left']=0;this.parts.dialog.setStyles(ad);a.event.call(this);this.definition=T=a.fire('dialogDefinition',{name:S,definition:T},R).definition;if(!('removeDialogTabs' in R._)&&R.config.removeDialogTabs){var ae=R.config.removeDialogTabs.split(';');for(Y=0;Y<ae.length;Y++){var af=ae[Y].split(':');if(af.length==2){var ag=af[0];if(!X[ag])X[ag]=[];X[ag].push(af[1]);}}R._.removeDialogTabs=X;}if(R._.removeDialogTabs&&(X=R._.removeDialogTabs[S]))for(Y=0;Y<X.length;Y++)T.removeContents(X[Y]);if(T.onLoad)this.on('load',T.onLoad);if(T.onShow)this.on('show',T.onShow);if(T.onHide)this.on('hide',T.onHide);if(T.onOk)this.on('ok',function(ar){R.fire('saveSnapshot');setTimeout(function(){R.fire('saveSnapshot');},0);if(T.onOk.call(this,ar)===false)ar.data.hide=false;});if(T.onCancel)this.on('cancel',function(ar){if(T.onCancel.call(this,ar)===false)ar.data.hide=false;});var ah=this,ai=function(ar){var as=ah._.contents,at=false;for(var au in as)for(var av in as[au]){at=ar.call(this,as[au][av]);if(at)return;}};this.on('ok',function(ar){ai(function(as){if(as.validate){var at=as.validate(this),au=typeof at=='string'||at===false;if(au){ar.data.hide=false;ar.stop();}r.call(as,!au,typeof at=='string'?at:undefined);return au;}});},this,null,0);this.on('cancel',function(ar){ai(function(as){if(as.isChanged()){if(!confirm(R.lang.common.confirmCancel))ar.data.hide=false;return true;}});},this,null,0);this.parts.close.on('click',function(ar){if(this.fire('cancel',{hide:true}).hide!==false)this.hide();ar.data.preventDefault();},this);function aj(){var ar=ah._.focusList;ar.sort(function(au,av){if(au.tabIndex!=av.tabIndex)return av.tabIndex-au.tabIndex;else return au.focusIndex-av.focusIndex;});var as=ar.length;for(var at=0;at<as;at++)ar[at].focusIndex=at;};function ak(ar){var as=ah._.focusList;ar=ar||0;if(as.length<1)return;var at=ah._.currentFocusIndex;try{as[at].getInputElement().$.blur();}catch(aw){}var au=(at+ar+as.length)%as.length,av=au;while(ar&&!as[av].isFocusable()){av=(av+ar+as.length)%as.length;if(av==au)break;}as[av].focus();if(as[av].type=='text')as[av].select();};this.changeFocus=ak;function al(ar){var ay=this;if(ah!=a.dialog._.currentTop)return;var as=ar.data.getKeystroke(),at=R.lang.dir=='rtl',au;Z=aa=0;if(as==9||as==2228224+9){var av=as==2228224+9;if(ah._.tabBarMode){var aw=av?o.call(ah):p.call(ah);ah.selectPage(aw);ah._.tabs[aw][0].focus();}else ak(av?-1:1);Z=1;}else if(as==4456448+121&&!ah._.tabBarMode&&ah.getPageCount()>1){ah._.tabBarMode=true;
|
|
||||||
ah._.tabs[ah._.currentTabId][0].focus();Z=1;}else if((as==37||as==39)&&ah._.tabBarMode){aw=as==(at?39:37)?o.call(ah):p.call(ah);ah.selectPage(aw);ah._.tabs[aw][0].focus();Z=1;}else if((as==13||as==32)&&ah._.tabBarMode){ay.selectPage(ay._.currentTabId);ay._.tabBarMode=false;ay._.currentFocusIndex=-1;ak(1);Z=1;}else if(as==13){var ax=ar.data.getTarget();if(!ax.is('a','button','select','textarea')&&(!ax.is('input')||ax.$.type!='button')){au=ay.getButton('ok');au&&e.setTimeout(au.click,0,au);Z=1;}aa=1;}else if(as==27){au=ay.getButton('cancel');if(au)e.setTimeout(au.click,0,au);else if(ay.fire('cancel',{hide:true}).hide!==false)ay.hide();aa=1;}else return;am(ar);};function am(ar){if(Z)ar.data.preventDefault(1);else if(aa)ar.data.stopPropagation();};var an=this._.element;this.on('show',function(){an.on('keydown',al,this);if(b.opera||b.gecko)an.on('keypress',am,this);});this.on('hide',function(){an.removeListener('keydown',al);if(b.opera||b.gecko)an.removeListener('keypress',am);ai(function(ar){s.apply(ar);});});this.on('iframeAdded',function(ar){var as=new g(ar.data.iframe.$.contentWindow.document);as.on('keydown',al,this,null,0);});this.on('show',function(){var av=this;aj();if(R.config.dialog_startupFocusTab&&ah._.pageCount>1){ah._.tabBarMode=true;ah._.tabs[ah._.currentTabId][0].focus();}else if(!av._.hasFocus){av._.currentFocusIndex=-1;if(T.onFocus){var ar=T.onFocus.call(av);ar&&ar.focus();}else ak(1);if(av._.editor.mode=='wysiwyg'&&c){var as=R.document.$.selection,at=as.createRange();if(at)if(at.parentElement&&at.parentElement().ownerDocument==R.document.$||at.item&&at.item(0).ownerDocument==R.document.$){var au=document.body.createTextRange();au.moveToElementText(av.getElement().getFirst().$);au.collapse(true);au.select();}}}},this,null,4294967295);if(b.ie6Compat)this.on('load',function(ar){var as=this.getElement(),at=as.getFirst();at.remove();at.appendTo(as);},this);B(this);C(this);new d.text(T.title,a.document).appendTo(this.parts.title);for(Y=0;Y<T.contents.length;Y++){var ao=T.contents[Y];ao&&this.addPage(ao);}this.parts.tabs.on('click',function(ar){var au=this;var as=ar.data.getTarget();if(as.hasClass('cke_dialog_tab')){var at=as.$.id;au.selectPage(at.substring(4,at.lastIndexOf('_')));if(au._.tabBarMode){au._.tabBarMode=false;au._.currentFocusIndex=-1;ak(1);}ar.data.preventDefault();}},this);var ap=[],aq=a.dialog._.uiElementBuilders.hbox.build(this,{type:'hbox',className:'cke_dialog_footer_buttons',widths:[],children:T.buttons},ap).getChild();this.parts.footer.setHtml(ap.join(''));
|
|
||||||
for(Y=0;Y<aq.length;Y++)this._.buttons[aq[Y].id]=aq[Y];};function t(R,S,T){this.element=S;this.focusIndex=T;this.tabIndex=0;this.isFocusable=function(){return!S.getAttribute('disabled')&&S.isVisible();};this.focus=function(){R._.currentFocusIndex=this.focusIndex;this.element.focus();};S.on('keydown',function(U){if(U.data.getKeystroke() in {32:1,13:1})this.fire('click');});S.on('focus',function(){this.fire('mouseover');});S.on('blur',function(){this.fire('mouseout');});};function u(R){var S=a.document.getWindow();function T(){R.layout();};S.on('resize',T);R.on('hide',function(){S.removeListener('resize',T);});};a.dialog.prototype={destroy:function(){this.hide();this._.element.remove();},resize:(function(){return function(R,S){var T=this;if(T._.contentSize&&T._.contentSize.width==R&&T._.contentSize.height==S)return;a.dialog.fire('resize',{dialog:T,skin:T._.editor.skinName,width:R,height:S},T._.editor);T.fire('resize',{skin:T._.editor.skinName,width:R,height:S},T._.editor);if(T._.editor.lang.dir=='rtl'&&T._.position)T._.position.x=a.document.getWindow().getViewPaneSize().width-T._.contentSize.width-parseInt(T._.element.getFirst().getStyle('right'),10);T._.contentSize={width:R,height:S};};})(),getSize:function(){var R=this._.element.getFirst();return{width:R.$.offsetWidth||0,height:R.$.offsetHeight||0};},move:function(R,S,T){var ab=this;var U=ab._.element.getFirst(),V=ab._.editor.lang.dir=='rtl',W=U.getComputedStyle('position')=='fixed';U.setStyle('zoom','100%');if(W&&ab._.position&&ab._.position.x==R&&ab._.position.y==S)return;ab._.position={x:R,y:S};if(!W){var X=a.document.getWindow().getScrollPosition();R+=X.x;S+=X.y;}if(V){var Y=ab.getSize(),Z=a.document.getWindow().getViewPaneSize();R=Z.width-Y.width-R;}var aa={top:(S>0?S:0)+'px'};aa[V?'right':'left']=(R>0?R:0)+'px';U.setStyles(aa);T&&(ab._.moved=1);},getPosition:function(){return e.extend({},this._.position);},show:function(){var R=this._.element,S=this.definition;if(!(R.getParent()&&R.getParent().equals(a.document.getBody())))R.appendTo(a.document.getBody());else R.setStyle('display','block');if(b.gecko&&b.version<10900){var T=this.parts.dialog;T.setStyle('position','absolute');setTimeout(function(){T.setStyle('position','fixed');},0);}this.resize(this._.contentSize&&this._.contentSize.width||S.width||S.minWidth,this._.contentSize&&this._.contentSize.height||S.height||S.minHeight);this.reset();this.selectPage(this.definition.contents[0].id);if(a.dialog._.currentZIndex===null)a.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex;
|
|
||||||
this._.element.getFirst().setStyle('z-index',a.dialog._.currentZIndex+=10);if(a.dialog._.currentTop===null){a.dialog._.currentTop=this;this._.parentDialog=null;H(this._.editor);}else{this._.parentDialog=a.dialog._.currentTop;var U=this._.parentDialog.getElement().getFirst();U.$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2);a.dialog._.currentTop=this;}R.on('keydown',L);R.on(b.opera?'keypress':'keyup',M);this._.hasFocus=false;e.setTimeout(function(){this.layout();u(this);this.parts.dialog.setStyle('visibility','');this.fireOnce('load',{});k.fire('ready',this);this.fire('show',{});this._.editor.fire('dialogShow',this);this.foreach(function(V){V.setInitValue&&V.setInitValue();});},100,this);},layout:function(){var X=this;var R=X.parts.dialog,S=X.getSize(),T=a.document.getWindow(),U=T.getViewPaneSize(),V=(U.width-S.width)/2,W=(U.height-S.height)/2;if(!b.ie6Compat)if(S.height+(W>0?W:0)>U.height||S.width+(V>0?V:0)>U.width)R.setStyle('position','absolute');else R.setStyle('position','fixed');X.move(X._.moved?X._.position.x:V,X._.moved?X._.position.y:W);},foreach:function(R){var U=this;for(var S in U._.contents)for(var T in U._.contents[S])R.call(U,U._.contents[S][T]);return U;},reset:(function(){var R=function(S){if(S.reset)S.reset(1);};return function(){this.foreach(R);return this;};})(),setupContent:function(){var R=arguments;this.foreach(function(S){if(S.setup)S.setup.apply(S,R);});},commitContent:function(){var R=arguments;this.foreach(function(S){if(c&&this._.currentFocusIndex==S.focusIndex)S.getInputElement().$.blur();if(S.commit)S.commit.apply(S,R);});},hide:function(){if(!this.parts.dialog.isVisible())return;this.fire('hide',{});this._.editor.fire('dialogHide',this);this.selectPage(this._.tabIdList[0]);var R=this._.element;R.setStyle('display','none');this.parts.dialog.setStyle('visibility','hidden');O(this);while(a.dialog._.currentTop!=this)a.dialog._.currentTop.hide();if(!this._.parentDialog)I();else{var S=this._.parentDialog.getElement().getFirst();S.setStyle('z-index',parseInt(S.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2));}a.dialog._.currentTop=this._.parentDialog;if(!this._.parentDialog){a.dialog._.currentZIndex=null;R.removeListener('keydown',L);R.removeListener(b.opera?'keypress':'keyup',M);var T=this._.editor;T.focus();if(T.mode=='wysiwyg'&&c){var U=T.getSelection();U&&U.unlock(true);}}else a.dialog._.currentZIndex-=10;delete this._.parentDialog;this.foreach(function(V){V.resetInitValue&&V.resetInitValue();
|
|
||||||
});},addPage:function(R){var ad=this;var S=[],T=R.label?' title="'+e.htmlEncode(R.label)+'"':'',U=R.elements,V=a.dialog._.uiElementBuilders.vbox.build(ad,{type:'vbox',className:'cke_dialog_page_contents',children:R.elements,expand:!!R.expand,padding:R.padding,style:R.style||'width: 100%;height:100%'},S),W=h.createFromHtml(S.join(''));W.setAttribute('role','tabpanel');var X=b,Y='cke_'+R.id+'_'+e.getNextNumber(),Z=h.createFromHtml(['<a class="cke_dialog_tab"',ad._.pageCount>0?' cke_last':'cke_first',T,!!R.hidden?' style="display:none"':'',' id="',Y,'"',X.gecko&&X.version>=10900&&!X.hc?'':' href="javascript:void(0)"',' tabIndex="-1"',' hidefocus="true"',' role="tab">',R.label,'</a>'].join(''));W.setAttribute('aria-labelledby',Y);ad._.tabs[R.id]=[Z,W];ad._.tabIdList.push(R.id);!R.hidden&&ad._.pageCount++;ad._.lastTab=Z;ad.updateStyle();var aa=ad._.contents[R.id]={},ab,ac=V.getChild();while(ab=ac.shift()){aa[ab.id]=ab;if(typeof ab.getChild=='function')ac.push.apply(ac,ab.getChild());}W.setAttribute('name',R.id);W.appendTo(ad.parts.contents);Z.unselectable();ad.parts.tabs.append(Z);if(R.accessKey){N(ad,ad,'CTRL+'+R.accessKey,Q,P);ad._.accessKeyMap['CTRL+'+R.accessKey]=R.id;}},selectPage:function(R){if(this._.currentTabId==R)return;if(this.fire('selectPage',{page:R,currentPage:this._.currentTabId})===true)return;for(var S in this._.tabs){var T=this._.tabs[S][0],U=this._.tabs[S][1];if(S!=R){T.removeClass('cke_dialog_tab_selected');U.hide();}U.setAttribute('aria-hidden',S!=R);}var V=this._.tabs[R];V[0].addClass('cke_dialog_tab_selected');if(b.ie6Compat||b.ie7Compat){q(V[1]);V[1].show();setTimeout(function(){q(V[1],1);},0);}else V[1].show();this._.currentTabId=R;this._.currentTabIndex=e.indexOf(this._.tabIdList,R);},updateStyle:function(){this.parts.dialog[(this._.pageCount===1?'add':'remove')+'Class']('cke_single_page');},hidePage:function(R){var T=this;var S=T._.tabs[R]&&T._.tabs[R][0];if(!S||T._.pageCount==1||!S.isVisible())return;else if(R==T._.currentTabId)T.selectPage(o.call(T));S.hide();T._.pageCount--;T.updateStyle();},showPage:function(R){var T=this;var S=T._.tabs[R]&&T._.tabs[R][0];if(!S)return;S.show();T._.pageCount++;T.updateStyle();},getElement:function(){return this._.element;},getName:function(){return this._.name;},getContentElement:function(R,S){var T=this._.contents[R];return T&&T[S];},getValueOf:function(R,S){return this.getContentElement(R,S).getValue();},setValueOf:function(R,S,T){return this.getContentElement(R,S).setValue(T);},getButton:function(R){return this._.buttons[R];
|
|
||||||
},click:function(R){return this._.buttons[R].click();},disableButton:function(R){return this._.buttons[R].disable();},enableButton:function(R){return this._.buttons[R].enable();},getPageCount:function(){return this._.pageCount;},getParentEditor:function(){return this._.editor;},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement();},addFocusable:function(R,S){var U=this;if(typeof S=='undefined'){S=U._.focusList.length;U._.focusList.push(new t(U,R,S));}else{U._.focusList.splice(S,0,new t(U,R,S));for(var T=S+1;T<U._.focusList.length;T++)U._.focusList[T].focusIndex++;}}};e.extend(a.dialog,{add:function(R,S){if(!this._.dialogDefinitions[R]||typeof S=='function')this._.dialogDefinitions[R]=S;},exists:function(R){return!!this._.dialogDefinitions[R];},getCurrent:function(){return a.dialog._.currentTop;},okButton:(function(){var R=function(S,T){T=T||{};return e.extend({id:'ok',type:'button',label:S.lang.common.ok,'class':'cke_dialog_ui_button_ok',onClick:function(U){var V=U.data.dialog;if(V.fire('ok',{hide:true}).hide!==false)V.hide();}},T,true);};R.type='button';R.override=function(S){return e.extend(function(T){return R(T,S);},{type:'button'},true);};return R;})(),cancelButton:(function(){var R=function(S,T){T=T||{};return e.extend({id:'cancel',type:'button',label:S.lang.common.cancel,'class':'cke_dialog_ui_button_cancel',onClick:function(U){var V=U.data.dialog;if(V.fire('cancel',{hide:true}).hide!==false)V.hide();}},T,true);};R.type='button';R.override=function(S){return e.extend(function(T){return R(T,S);},{type:'button'},true);};return R;})(),addUIElement:function(R,S){this._.uiElementBuilders[R]=S;}});a.dialog._={uiElementBuilders:{},dialogDefinitions:{},currentTop:null,currentZIndex:null};a.event.implementOn(a.dialog);a.event.implementOn(a.dialog.prototype,true);var v={resizable:3,minWidth:600,minHeight:400,buttons:[a.dialog.okButton,a.dialog.cancelButton]},w=function(R,S,T){for(var U=0,V;V=R[U];U++){if(V.id==S)return V;if(T&&V[T]){var W=w(V[T],S,T);if(W)return W;}}return null;},x=function(R,S,T,U,V){if(T){for(var W=0,X;X=R[W];W++){if(X.id==T){R.splice(W,0,S);return S;}if(U&&X[U]){var Y=x(X[U],S,T,U,true);if(Y)return Y;}}if(V)return null;}R.push(S);return S;},y=function(R,S,T){for(var U=0,V;V=R[U];U++){if(V.id==S)return R.splice(U,1);if(T&&V[T]){var W=y(V[T],S,T);if(W)return W;}}return null;},z=function(R,S){this.dialog=R;var T=S.contents;for(var U=0,V;V=T[U];U++)T[U]=V&&new A(R,V);e.extend(this,S);};z.prototype={getContents:function(R){return w(this.contents,R);
|
|
||||||
},getButton:function(R){return w(this.buttons,R);},addContents:function(R,S){return x(this.contents,R,S);},addButton:function(R,S){return x(this.buttons,R,S);},removeContents:function(R){y(this.contents,R);},removeButton:function(R){y(this.buttons,R);}};function A(R,S){this._={dialog:R};e.extend(this,S);};A.prototype={get:function(R){return w(this.elements,R,'children');},add:function(R,S){return x(this.elements,R,S,'children');},remove:function(R){y(this.elements,R,'children');}};function B(R){var S=null,T=null,U=R.getElement().getFirst(),V=R.getParentEditor(),W=V.config.dialog_magnetDistance,X=V.skin.margins||[0,0,0,0];if(typeof W=='undefined')W=20;function Y(aa){var ab=R.getSize(),ac=a.document.getWindow().getViewPaneSize(),ad=aa.data.$.screenX,ae=aa.data.$.screenY,af=ad-S.x,ag=ae-S.y,ah,ai;S={x:ad,y:ae};T.x+=af;T.y+=ag;if(T.x+X[3]<W)ah=-X[3];else if(T.x-X[1]>ac.width-ab.width-W)ah=ac.width-ab.width+(V.lang.dir=='rtl'?0:X[1]);else ah=T.x;if(T.y+X[0]<W)ai=-X[0];else if(T.y-X[2]>ac.height-ab.height-W)ai=ac.height-ab.height+X[2];else ai=T.y;R.move(ah,ai,1);aa.data.preventDefault();};function Z(aa){a.document.removeListener('mousemove',Y);a.document.removeListener('mouseup',Z);if(b.ie6Compat){var ab=F.getChild(0).getFrameDocument();ab.removeListener('mousemove',Y);ab.removeListener('mouseup',Z);}};R.parts.title.on('mousedown',function(aa){S={x:aa.data.$.screenX,y:aa.data.$.screenY};a.document.on('mousemove',Y);a.document.on('mouseup',Z);T=R.getPosition();if(b.ie6Compat){var ab=F.getChild(0).getFrameDocument();ab.on('mousemove',Y);ab.on('mouseup',Z);}aa.data.preventDefault();},R);};function C(R){var S=R.definition,T=S.resizable;if(T==0)return;var U=R.getParentEditor(),V,W,X,Y,Z,aa,ab=e.addFunction(function(ae){Z=R.getSize();var af=R.parts.contents,ag=af.$.getElementsByTagName('iframe').length;if(ag){aa=h.createFromHtml('<div class="cke_dialog_resize_cover" style="height: 100%; position: absolute; width: 100%;"></div>');af.append(aa);}W=Z.height-R.parts.contents.getSize('height',!(b.gecko||b.opera||c&&b.quirks));V=Z.width-R.parts.contents.getSize('width',1);Y={x:ae.screenX,y:ae.screenY};X=a.document.getWindow().getViewPaneSize();a.document.on('mousemove',ac);a.document.on('mouseup',ad);if(b.ie6Compat){var ah=F.getChild(0).getFrameDocument();ah.on('mousemove',ac);ah.on('mouseup',ad);}ae.preventDefault&&ae.preventDefault();});R.on('load',function(){var ae='';if(T==1)ae=' cke_resizer_horizontal';else if(T==2)ae=' cke_resizer_vertical';var af=h.createFromHtml('<div class="cke_resizer'+ae+' cke_resizer_'+U.lang.dir+'"'+' title="'+e.htmlEncode(U.lang.resize)+'"'+' onmousedown="CKEDITOR.tools.callFunction('+ab+', event )"></div>');
|
|
||||||
R.parts.footer.append(af,1);});U.on('destroy',function(){e.removeFunction(ab);});function ac(ae){var af=U.lang.dir=='rtl',ag=(ae.data.$.screenX-Y.x)*(af?-1:1),ah=ae.data.$.screenY-Y.y,ai=Z.width,aj=Z.height,ak=ai+ag*(R._.moved?1:2),al=aj+ah*(R._.moved?1:2),am=R._.element.getFirst(),an=af&&am.getComputedStyle('right'),ao=R.getPosition();if(ao.y+al>X.height)al=X.height-ao.y;if((af?an:ao.x)+ak>X.width)ak=X.width-(af?an:ao.x);if(T==1||T==3)ai=Math.max(S.minWidth||0,ak-V);if(T==2||T==3)aj=Math.max(S.minHeight||0,al-W);R.resize(ai,aj);if(!R._.moved)R.layout();ae.data.preventDefault();};function ad(){a.document.removeListener('mouseup',ad);a.document.removeListener('mousemove',ac);if(aa){aa.remove();aa=null;}if(b.ie6Compat){var ae=F.getChild(0).getFrameDocument();ae.removeListener('mouseup',ad);ae.removeListener('mousemove',ac);}};};var D,E={},F;function G(R){R.data.preventDefault(1);};function H(R){var S=a.document.getWindow(),T=R.config,U=T.dialog_backgroundCoverColor||'white',V=T.dialog_backgroundCoverOpacity,W=T.baseFloatZIndex,X=e.genKey(U,V,W),Y=E[X];if(!Y){var Z=['<div tabIndex="-1" style="position: ',b.ie6Compat?'absolute':'fixed','; z-index: ',W,'; top: 0px; left: 0px; ',!b.ie6Compat?'background-color: '+U:'','" class="cke_dialog_background_cover">'];if(b.ie6Compat){var aa=b.isCustomDomain(),ab="<html><body style=\\'background-color:"+U+";\\'></body></html>";Z.push('<iframe hidefocus="true" frameborder="0" id="cke_dialog_background_iframe" src="javascript:');Z.push('void((function(){document.open();'+(aa?"document.domain='"+document.domain+"';":'')+"document.write( '"+ab+"' );"+'document.close();'+'})())');Z.push('" style="position:absolute;left:0;top:0;width:100%;height: 100%;progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe>');}Z.push('</div>');Y=h.createFromHtml(Z.join(''));Y.setOpacity(V!=undefined?V:0.5);Y.on('keydown',G);Y.on('keypress',G);Y.on('keyup',G);Y.appendTo(a.document.getBody());E[X]=Y;}else Y.show();F=Y;var ac=function(){var af=S.getViewPaneSize();Y.setStyles({width:af.width+'px',height:af.height+'px'});},ad=function(){var af=S.getScrollPosition(),ag=a.dialog._.currentTop;Y.setStyles({left:af.x+'px',top:af.y+'px'});if(ag)do{var ah=ag.getPosition();ag.move(ah.x,ah.y);}while(ag=ag._.parentDialog)};D=ac;S.on('resize',ac);ac();if(!(b.mac&&b.webkit))Y.focus();if(b.ie6Compat){var ae=function(){ad();arguments.callee.prevScrollHandler.apply(this,arguments);};S.$.setTimeout(function(){ae.prevScrollHandler=window.onscroll||(function(){});
|
|
||||||
window.onscroll=ae;},0);ad();}};function I(){if(!F)return;var R=a.document.getWindow();F.hide();R.removeListener('resize',D);if(b.ie6Compat)R.$.setTimeout(function(){var S=window.onscroll&&window.onscroll.prevScrollHandler;window.onscroll=S||null;},0);D=null;};function J(){for(var R in E)E[R].remove();E={};};var K={},L=function(R){var S=R.data.$.ctrlKey||R.data.$.metaKey,T=R.data.$.altKey,U=R.data.$.shiftKey,V=String.fromCharCode(R.data.$.keyCode),W=K[(S?'CTRL+':'')+(T?'ALT+':'')+(U?'SHIFT+':'')+V];if(!W||!W.length)return;W=W[W.length-1];W.keydown&&W.keydown.call(W.uiElement,W.dialog,W.key);R.data.preventDefault();},M=function(R){var S=R.data.$.ctrlKey||R.data.$.metaKey,T=R.data.$.altKey,U=R.data.$.shiftKey,V=String.fromCharCode(R.data.$.keyCode),W=K[(S?'CTRL+':'')+(T?'ALT+':'')+(U?'SHIFT+':'')+V];if(!W||!W.length)return;W=W[W.length-1];if(W.keyup){W.keyup.call(W.uiElement,W.dialog,W.key);R.data.preventDefault();}},N=function(R,S,T,U,V){var W=K[T]||(K[T]=[]);W.push({uiElement:R,dialog:S,key:T,keyup:V||R.accessKeyUp,keydown:U||R.accessKeyDown});},O=function(R){for(var S in K){var T=K[S];for(var U=T.length-1;U>=0;U--){if(T[U].dialog==R||T[U].uiElement==R)T.splice(U,1);}if(T.length===0)delete K[S];}},P=function(R,S){if(R._.accessKeyMap[S])R.selectPage(R._.accessKeyMap[S]);},Q=function(R,S){};(function(){k.dialog={uiElement:function(R,S,T,U,V,W,X){if(arguments.length<4)return;var Y=(U.call?U(S):U)||'div',Z=['<',Y,' '],aa=(V&&V.call?V(S):V)||{},ab=(W&&W.call?W(S):W)||{},ac=(X&&X.call?X.call(this,R,S):X)||'',ad=this.domId=ab.id||e.getNextId()+'_uiElement',ae=this.id=S.id,af;ab.id=ad;var ag={};if(S.type)ag['cke_dialog_ui_'+S.type]=1;if(S.className)ag[S.className]=1;if(S.disabled)ag.cke_disabled=1;var ah=ab['class']&&ab['class'].split?ab['class'].split(' '):[];for(af=0;af<ah.length;af++){if(ah[af])ag[ah[af]]=1;}var ai=[];for(af in ag)ai.push(af);ab['class']=ai.join(' ');if(S.title)ab.title=S.title;var aj=(S.style||'').split(';');if(S.align){var ak=S.align;aa['margin-left']=ak=='left'?0:'auto';aa['margin-right']=ak=='right'?0:'auto';}for(af in aa)aj.push(af+':'+aa[af]);if(S.hidden)aj.push('display:none');for(af=aj.length-1;af>=0;af--){if(aj[af]==='')aj.splice(af,1);}if(aj.length>0)ab.style=(ab.style?ab.style+'; ':'')+aj.join('; ');for(af in ab)Z.push(af+'="'+e.htmlEncode(ab[af])+'" ');Z.push('>',ac,'</',Y,'>');T.push(Z.join(''));(this._||(this._={})).dialog=R;if(typeof S.isChanged=='boolean')this.isChanged=function(){return S.isChanged;};if(typeof S.isChanged=='function')this.isChanged=S.isChanged;
|
|
||||||
if(typeof S.setValue=='function')this.setValue=e.override(this.setValue,function(am){return function(an){am.call(this,S.setValue.call(this,an));};});if(typeof S.getValue=='function')this.getValue=e.override(this.getValue,function(am){return function(){return S.getValue.call(this,am.call(this));};});a.event.implementOn(this);this.registerEvents(S);if(this.accessKeyUp&&this.accessKeyDown&&S.accessKey)N(this,R,'CTRL+'+S.accessKey);var al=this;R.on('load',function(){var am=al.getInputElement();if(am){var an=al.type in {checkbox:1,ratio:1}&&c&&b.version<8?'cke_dialog_ui_focused':'';am.on('focus',function(){R._.tabBarMode=false;R._.hasFocus=true;al.fire('focus');an&&this.addClass(an);});am.on('blur',function(){al.fire('blur');an&&this.removeClass(an);});}});if(this.keyboardFocusable){this.tabIndex=S.tabIndex||0;this.focusIndex=R._.focusList.push(this)-1;this.on('focus',function(){R._.currentFocusIndex=al.focusIndex;});}e.extend(this,S);},hbox:function(R,S,T,U,V){if(arguments.length<4)return;this._||(this._={});var W=this._.children=S,X=V&&V.widths||null,Y=V&&V.height||null,Z={},aa,ab=function(){var ad=['<tbody><tr class="cke_dialog_ui_hbox">'];for(aa=0;aa<T.length;aa++){var ae='cke_dialog_ui_hbox_child',af=[];if(aa===0)ae='cke_dialog_ui_hbox_first';if(aa==T.length-1)ae='cke_dialog_ui_hbox_last';ad.push('<td class="',ae,'" role="presentation" ');if(X){if(X[aa])af.push('width:'+m(X[aa]));}else af.push('width:'+Math.floor(100/T.length)+'%');if(Y)af.push('height:'+m(Y));if(V&&V.padding!=undefined)af.push('padding:'+m(V.padding));if(c&&b.quirks&&W[aa].align)af.push('text-align:'+W[aa].align);if(af.length>0)ad.push('style="'+af.join('; ')+'" ');ad.push('>',T[aa],'</td>');}ad.push('</tr></tbody>');return ad.join('');},ac={role:'presentation'};V&&V.align&&(ac.align=V.align);k.dialog.uiElement.call(this,R,V||{type:'hbox'},U,'table',Z,ac,ab);},vbox:function(R,S,T,U,V){if(arguments.length<3)return;this._||(this._={});var W=this._.children=S,X=V&&V.width||null,Y=V&&V.heights||null,Z=function(){var aa=['<table role="presentation" cellspacing="0" border="0" '];aa.push('style="');if(V&&V.expand)aa.push('height:100%;');aa.push('width:'+m(X||'100%'),';');aa.push('"');aa.push('align="',e.htmlEncode(V&&V.align||(R.getParentEditor().lang.dir=='ltr'?'left':'right')),'" ');aa.push('><tbody>');for(var ab=0;ab<T.length;ab++){var ac=[];aa.push('<tr><td role="presentation" ');if(X)ac.push('width:'+m(X||'100%'));if(Y)ac.push('height:'+m(Y[ab]));else if(V&&V.expand)ac.push('height:'+Math.floor(100/T.length)+'%');
|
|
||||||
if(V&&V.padding!=undefined)ac.push('padding:'+m(V.padding));if(c&&b.quirks&&W[ab].align)ac.push('text-align:'+W[ab].align);if(ac.length>0)aa.push('style="',ac.join('; '),'" ');aa.push(' class="cke_dialog_ui_vbox_child">',T[ab],'</td></tr>');}aa.push('</tbody></table>');return aa.join('');};k.dialog.uiElement.call(this,R,V||{type:'vbox'},U,'div',null,{role:'presentation'},Z);}};})();k.dialog.uiElement.prototype={getElement:function(){return a.document.getById(this.domId);},getInputElement:function(){return this.getElement();},getDialog:function(){return this._.dialog;},setValue:function(R,S){this.getInputElement().setValue(R);!S&&this.fire('change',{value:R});return this;},getValue:function(){return this.getInputElement().getValue();},isChanged:function(){return false;},selectParentTab:function(){var U=this;var R=U.getInputElement(),S=R,T;while((S=S.getParent())&&S.$.className.search('cke_dialog_page_contents')==-1){}if(!S)return U;T=S.getAttribute('name');if(U._.dialog._.currentTabId!=T)U._.dialog.selectPage(T);return U;},focus:function(){this.selectParentTab().getInputElement().focus();return this;},registerEvents:function(R){var S=/^on([A-Z]\w+)/,T,U=function(W,X,Y,Z){X.on('load',function(){W.getInputElement().on(Y,Z,W);});};for(var V in R){if(!(T=V.match(S)))continue;if(this.eventProcessors[V])this.eventProcessors[V].call(this,this._.dialog,R[V]);else U(this,this._.dialog,T[1].toLowerCase(),R[V]);}return this;},eventProcessors:{onLoad:function(R,S){R.on('load',S,this);},onShow:function(R,S){R.on('show',S,this);},onHide:function(R,S){R.on('hide',S,this);}},accessKeyDown:function(R,S){this.focus();},accessKeyUp:function(R,S){},disable:function(){var R=this.getElement(),S=this.getInputElement();S.setAttribute('disabled','true');R.addClass('cke_disabled');},enable:function(){var R=this.getElement(),S=this.getInputElement();S.removeAttribute('disabled');R.removeClass('cke_disabled');},isEnabled:function(){return!this.getElement().hasClass('cke_disabled');},isVisible:function(){return this.getInputElement().isVisible();},isFocusable:function(){if(!this.isEnabled()||!this.isVisible())return false;return true;}};k.dialog.hbox.prototype=e.extend(new k.dialog.uiElement(),{getChild:function(R){var S=this;if(arguments.length<1)return S._.children.concat();if(!R.splice)R=[R];if(R.length<2)return S._.children[R[0]];else return S._.children[R[0]]&&S._.children[R[0]].getChild?S._.children[R[0]].getChild(R.slice(1,R.length)):null;}},true);k.dialog.vbox.prototype=new k.dialog.hbox();
|
|
||||||
(function(){var R={build:function(S,T,U){var V=T.children,W,X=[],Y=[];for(var Z=0;Z<V.length&&(W=V[Z]);Z++){var aa=[];X.push(aa);Y.push(a.dialog._.uiElementBuilders[W.type].build(S,W,aa));}return new k.dialog[T.type](S,Y,X,U,T);}};a.dialog.addUIElement('hbox',R);a.dialog.addUIElement('vbox',R);})();a.dialogCommand=function(R){this.dialogName=R;};a.dialogCommand.prototype={exec:function(R){b.opera?e.setTimeout(function(){R.openDialog(this.dialogName);},0,this):R.openDialog(this.dialogName);},canUndo:false,editorFocus:c||b.webkit};(function(){var R=/^([a]|[^a])+$/,S=/^\d*$/,T=/^\d*(?:\.\d+)?$/,U=/^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,V=/^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,W=/^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;a.VALIDATE_OR=1;a.VALIDATE_AND=2;a.dialog.validate={functions:function(){var X=arguments;return function(){var Y=this&&this.getValue?this.getValue():X[0],Z=undefined,aa=2,ab=[],ac;for(ac=0;ac<X.length;ac++){if(typeof X[ac]=='function')ab.push(X[ac]);else break;}if(ac<X.length&&typeof X[ac]=='string'){Z=X[ac];ac++;}if(ac<X.length&&typeof X[ac]=='number')aa=X[ac];var ad=aa==2?true:false;for(ac=0;ac<ab.length;ac++){if(aa==2)ad=ad&&ab[ac](Y);else ad=ad||ab[ac](Y);}return!ad?Z:true;};},regex:function(X,Y){return function(){var Z=this&&this.getValue?this.getValue():arguments[0];return!X.test(Z)?Y:true;};},notEmpty:function(X){return this.regex(R,X);},integer:function(X){return this.regex(S,X);},number:function(X){return this.regex(T,X);},cssLength:function(X){return this.functions(function(Y){return V.test(e.trim(Y));},X);},htmlLength:function(X){return this.functions(function(Y){return U.test(e.trim(Y));},X);},inlineStyle:function(X){return this.functions(function(Y){return W.test(e.trim(Y));},X);},equals:function(X,Y){return this.functions(function(Z){return Z==X;},Y);},notEqual:function(X,Y){return this.functions(function(Z){return Z!=X;},Y);}};a.on('instanceDestroyed',function(X){if(e.isEmpty(a.instances)){var Y;while(Y=a.dialog._.currentTop)Y.hide();J();}var Z=X.editor._.storedDialogs;for(var aa in Z)Z[aa].destroy();});})();e.extend(a.editor.prototype,{openDialog:function(R,S){if(this.mode=='wysiwyg'&&c){var T=this.getSelection();T&&T.lock();}var U=a.dialog._.dialogDefinitions[R],V=this.skin.dialog;if(a.dialog._.currentTop===null)H(this);if(typeof U=='function'&&V._isLoaded){var W=this._.storedDialogs||(this._.storedDialogs={}),X=W[R]||(W[R]=new a.dialog(this,R));S&&S.call(X,X);X.show();return X;}else if(U=='failed'){I();throw new Error('[CKEDITOR.dialog.openDialog] Dialog "'+R+'" failed when loading definition.');
|
|
||||||
}var Y=this;function Z(ab){var ac=a.dialog._.dialogDefinitions[R],ad=Y.skin.dialog;if(!ad._isLoaded||aa&&typeof ab=='undefined')return;if(typeof ac!='function')a.dialog._.dialogDefinitions[R]='failed';Y.openDialog(R,S);};if(typeof U=='string'){var aa=1;a.scriptLoader.load(a.getUrl(U),Z,null,0,1);}a.skins.load(this,'dialog',Z);return null;}});})();j.add('dialog',{requires:['dialogui']});j.add('styles',{requires:['selection'],init:function(m){m.on('contentDom',function(){m.document.setCustomData('cke_includeReadonly',!m.config.disableReadonlyStyling);});}});a.editor.prototype.attachStyleStateChange=function(m,n){var o=this._.styleStateChangeCallbacks;if(!o){o=this._.styleStateChangeCallbacks=[];this.on('selectionChange',function(p){for(var q=0;q<o.length;q++){var r=o[q],s=r.style.checkActive(p.data.path)?1:2;r.fn.call(this,s);}});}o.push({style:m,fn:n});};a.STYLE_BLOCK=1;a.STYLE_INLINE=2;a.STYLE_OBJECT=3;(function(){var m={address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,details:1,datagrid:1,datalist:1},n={a:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1,audio:1,video:1},o=/\s*(?:;\s*|$)/,p=/#\((.+?)\)/g,q=d.walker.bookmark(0,1),r=d.walker.whitespaces(1);a.style=function(T,U){var X=this;var V=T.attributes;if(V&&V.style){T.styles=e.extend({},T.styles,Q(V.style));delete V.style;}if(U){T=e.clone(T);L(T.attributes,U);L(T.styles,U);}var W=X.element=T.element?typeof T.element=='string'?T.element.toLowerCase():T.element:'*';X.type=m[W]?1:n[W]?3:2;if(typeof X.element=='object')X.type=3;X._={definition:T};};a.style.prototype={apply:function(T){S.call(this,T,false);},remove:function(T){S.call(this,T,true);},applyToRange:function(T){var U=this;return(U.applyToRange=U.type==2?t:U.type==1?x:U.type==3?v:null).call(U,T);},removeFromRange:function(T){var U=this;return(U.removeFromRange=U.type==2?u:U.type==1?y:U.type==3?w:null).call(U,T);},applyToObject:function(T){K(T,this);},checkActive:function(T){var Y=this;switch(Y.type){case 1:return Y.checkElementRemovable(T.block||T.blockLimit,true);case 3:case 2:var U=T.elements;for(var V=0,W;V<U.length;V++){W=U[V];if(Y.type==2&&(W==T.block||W==T.blockLimit))continue;if(Y.type==3){var X=W.getName();if(!(typeof Y.element=='string'?X==Y.element:X in Y.element))continue;}if(Y.checkElementRemovable(W,true))return true;}}return false;},checkApplicable:function(T){switch(this.type){case 2:case 1:break;
|
|
||||||
case 3:return T.lastElement.getAscendant(this.element,true);}return true;},checkElementMatch:function(T,U){var aa=this;var V=aa._.definition;if(!T||!V.ignoreReadonly&&T.isReadOnly())return false;var W,X=T.getName();if(typeof aa.element=='string'?X==aa.element:X in aa.element){if(!U&&!T.hasAttributes())return true;W=M(V);if(W._length){for(var Y in W){if(Y=='_length')continue;var Z=T.getAttribute(Y)||'';if(Y=='style'?R(W[Y],P(Z,false)):W[Y]==Z){if(!U)return true;}else if(U)return false;}if(U)return true;}else return true;}return false;},checkElementRemovable:function(T,U){if(this.checkElementMatch(T,U))return true;var V=N(this)[T.getName()];if(V){var W,X;if(!(W=V.attributes))return true;for(var Y=0;Y<W.length;Y++){X=W[Y][0];var Z=T.getAttribute(X);if(Z){var aa=W[Y][1];if(aa===null||typeof aa=='string'&&Z==aa||aa.test(Z))return true;}}}return false;},buildPreview:function(T){var U=this._.definition,V=[],W=U.element;if(W=='bdo')W='span';V=['<',W];var X=U.attributes;if(X)for(var Y in X)V.push(' ',Y,'="',X[Y],'"');var Z=a.style.getStyleText(U);if(Z)V.push(' style="',Z,'"');V.push('>',T||U.name,'</',W,'>');return V.join('');}};a.style.getStyleText=function(T){var U=T._ST;if(U)return U;U=T.styles;var V=T.attributes&&T.attributes.style||'',W='';if(V.length)V=V.replace(o,';');for(var X in U){var Y=U[X],Z=(X+':'+Y).replace(o,';');if(Y=='inherit')W+=Z;else V+=Z;}if(V.length)V=P(V);V+=W;return T._ST=V;};function s(T){var U,V;while(T=T.getParent()){if(T.getName()=='body')break;if(T.getAttribute('data-nostyle'))U=T;else if(!V){var W=T.getAttribute('contentEditable');if(W=='false')U=T;else if(W=='true')V=1;}}return U;};function t(T){var ay=this;var U=T.document;if(T.collapsed){var V=J(ay,U);T.insertNode(V);T.moveToPosition(V,2);return;}var W=ay.element,X=ay._.definition,Y,Z=X.ignoreReadonly,aa=Z||X.includeReadonly;if(aa==undefined)aa=U.getCustomData('cke_includeReadonly');var ab=f[W]||(Y=true,f.span);T.enlarge(1,1);T.trim();var ac=T.createBookmark(),ad=ac.startNode,ae=ac.endNode,af=ad,ag;if(!Z){var ah=s(ad),ai=s(ae);if(ah)af=ah.getNextSourceNode(true);if(ai)ae=ai;}if(af.getPosition(ae)==2)af=0;while(af){var aj=false;if(af.equals(ae)){af=null;aj=true;}else{var ak=af.type,al=ak==1?af.getName():null,am=al&&af.getAttribute('contentEditable')=='false',an=al&&af.getAttribute('data-nostyle');if(al&&af.data('cke-bookmark')){af=af.getNextSourceNode(true);continue;}if(!al||ab[al]&&!an&&(!am||aa)&&(af.getPosition(ae)|4|0|8)==4+0+8&&(!X.childRule||X.childRule(af))){var ao=af.getParent();
|
|
||||||
if(ao&&((ao.getDtd()||f.span)[W]||Y)&&(!X.parentRule||X.parentRule(ao))){if(!ag&&(!al||!f.$removeEmpty[al]||(af.getPosition(ae)|4|0|8)==4+0+8)){ag=new d.range(U);ag.setStartBefore(af);}if(ak==3||am||ak==1&&!af.getChildCount()){var ap=af,aq;while((aj=!ap.getNext(q))&&(aq=ap.getParent(),ab[aq.getName()])&&(aq.getPosition(ad)|2|0|8)==2+0+8&&(!X.childRule||X.childRule(aq)))ap=aq;ag.setEndAfter(ap);}}else aj=true;}else aj=true;af=af.getNextSourceNode(an||am);}if(aj&&ag&&!ag.collapsed){var ar=J(ay,U),as=ar.hasAttributes(),at=ag.getCommonAncestor(),au={styles:{},attrs:{},blockedStyles:{},blockedAttrs:{}},av,aw,ax;while(ar&&at){if(at.getName()==W){for(av in X.attributes){if(au.blockedAttrs[av]||!(ax=at.getAttribute(aw)))continue;if(ar.getAttribute(av)==ax)au.attrs[av]=1;else au.blockedAttrs[av]=1;}for(aw in X.styles){if(au.blockedStyles[aw]||!(ax=at.getStyle(aw)))continue;if(ar.getStyle(aw)==ax)au.styles[aw]=1;else au.blockedStyles[aw]=1;}}at=at.getParent();}for(av in au.attrs)ar.removeAttribute(av);for(aw in au.styles)ar.removeStyle(aw);if(as&&!ar.hasAttributes())ar=null;if(ar){ag.extractContents().appendTo(ar);G(ay,ar);ag.insertNode(ar);ar.mergeSiblings();if(!c)ar.$.normalize();}else{ar=new h('span');ag.extractContents().appendTo(ar);ag.insertNode(ar);G(ay,ar);ar.remove(true);}ag=null;}}T.moveToBookmark(ac);T.shrink(2);};function u(T){T.enlarge(1,1);var U=T.createBookmark(),V=U.startNode;if(T.collapsed){var W=new d.elementPath(V.getParent()),X;for(var Y=0,Z;Y<W.elements.length&&(Z=W.elements[Y]);Y++){if(Z==W.block||Z==W.blockLimit)break;if(this.checkElementRemovable(Z)){var aa;if(T.collapsed&&(T.checkBoundaryOfElement(Z,2)||(aa=T.checkBoundaryOfElement(Z,1)))){X=Z;X.match=aa?'start':'end';}else{Z.mergeSiblings();if(Z.getName()==this.element)F(this,Z);else H(Z,N(this)[Z.getName()]);}}}if(X){var ab=V;for(Y=0;true;Y++){var ac=W.elements[Y];if(ac.equals(X))break;else if(ac.match)continue;else ac=ac.clone();ac.append(ab);ab=ac;}ab[X.match=='start'?'insertBefore':'insertAfter'](X);}}else{var ad=U.endNode,ae=this;function af(){var ai=new d.elementPath(V.getParent()),aj=new d.elementPath(ad.getParent()),ak=null,al=null;for(var am=0;am<ai.elements.length;am++){var an=ai.elements[am];if(an==ai.block||an==ai.blockLimit)break;if(ae.checkElementRemovable(an))ak=an;}for(am=0;am<aj.elements.length;am++){an=aj.elements[am];if(an==aj.block||an==aj.blockLimit)break;if(ae.checkElementRemovable(an))al=an;}if(al)ad.breakParent(al);if(ak)V.breakParent(ak);};af();var ag=V;while(!ag.equals(ad)){var ah=ag.getNextSourceNode();
|
|
||||||
if(ag.type==1&&this.checkElementRemovable(ag)){if(ag.getName()==this.element)F(this,ag);else H(ag,N(this)[ag.getName()]);if(ah.type==1&&ah.contains(V)){af();ah=V.getNext();}}ag=ah;}}T.moveToBookmark(U);};function v(T){var U=T.getCommonAncestor(true,true),V=U.getAscendant(this.element,true);V&&!V.isReadOnly()&&K(V,this);};function w(T){var U=T.getCommonAncestor(true,true),V=U.getAscendant(this.element,true);if(!V)return;var W=this,X=W._.definition,Y=X.attributes;if(Y)for(var Z in Y)V.removeAttribute(Z,Y[Z]);if(X.styles)for(var aa in X.styles){if(!X.styles.hasOwnProperty(aa))continue;V.removeStyle(aa);}};function x(T){var U=T.createBookmark(true),V=T.createIterator();V.enforceRealBlocks=true;if(this._.enterMode)V.enlargeBr=this._.enterMode!=2;var W,X=T.document,Y;while(W=V.getNextParagraph()){if(!W.isReadOnly()){var Z=J(this,X,W);z(W,Z);}}T.moveToBookmark(U);};function y(T){var Y=this;var U=T.createBookmark(1),V=T.createIterator();V.enforceRealBlocks=true;V.enlargeBr=Y._.enterMode!=2;var W;while(W=V.getNextParagraph()){if(Y.checkElementRemovable(W))if(W.is('pre')){var X=Y._.enterMode==2?null:T.document.createElement(Y._.enterMode==1?'p':'div');X&&W.copyAttributes(X);z(W,X);}else F(Y,W,1);}T.moveToBookmark(U);};function z(T,U){var V=!U;if(V){U=T.getDocument().createElement('div');T.copyAttributes(U);}var W=U&&U.is('pre'),X=T.is('pre'),Y=W&&!X,Z=!W&&X;if(Y)U=E(T,U);else if(Z)U=D(V?[T.getHtml()]:B(T),U);else T.moveChildren(U);U.replace(T);if(W)A(U);else if(V)I(U);};function A(T){var U;if(!((U=T.getPrevious(r))&&U.is&&U.is('pre')))return;var V=C(U.getHtml(),/\n$/,'')+'\n\n'+C(T.getHtml(),/^\n/,'');if(c)T.$.outerHTML='<pre>'+V+'</pre>';else T.setHtml(V);U.remove();};function B(T){var U=/(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,V=T.getName(),W=C(T.getOuterHtml(),U,function(Y,Z,aa){return Z+'</pre>'+aa+'<pre>';}),X=[];W.replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi,function(Y,Z){X.push(Z);});return X;};function C(T,U,V){var W='',X='';T=T.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi,function(Y,Z,aa){Z&&(W=Z);aa&&(X=aa);return '';});return W+T.replace(U,V)+X;};function D(T,U){var V;if(T.length>1)V=new d.documentFragment(U.getDocument());for(var W=0;W<T.length;W++){var X=T[W];X=X.replace(/(\r\n|\r)/g,'\n');X=C(X,/^[ \t]*\n/,'');X=C(X,/\n$/,'');X=C(X,/^[ \t]+|[ \t]+$/g,function(Z,aa,ab){if(Z.length==1)return ' ';else if(!aa)return e.repeat(' ',Z.length-1)+' ';else return ' '+e.repeat(' ',Z.length-1);
|
|
||||||
});X=X.replace(/\n/g,'<br>');X=X.replace(/[ \t]{2,}/g,function(Z){return e.repeat(' ',Z.length-1)+' ';});if(V){var Y=U.clone();Y.setHtml(X);V.append(Y);}else U.setHtml(X);}return V||U;};function E(T,U){var V=T.getBogus();V&&V.remove();var W=T.getHtml();W=C(W,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,'');W=W.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,'$1');W=W.replace(/([ \t\n\r]+| )/g,' ');W=W.replace(/<br\b[^>]*>/gi,'\n');if(c){var X=T.getDocument().createElement('div');X.append(U);U.$.outerHTML='<pre>'+W+'</pre>';U.copyAttributes(X.getFirst());U=X.getFirst().remove();}else U.setHtml(W);return U;};function F(T,U){var V=T._.definition,W=V.attributes,X=V.styles,Y=N(T)[U.getName()],Z=e.isEmpty(W)&&e.isEmpty(X);for(var aa in W){if((aa=='class'||T._.definition.fullMatch)&&U.getAttribute(aa)!=O(aa,W[aa]))continue;Z=U.hasAttribute(aa);U.removeAttribute(aa);}for(var ab in X){if(T._.definition.fullMatch&&U.getStyle(ab)!=O(ab,X[ab],true))continue;Z=Z||!!U.getStyle(ab);U.removeStyle(ab);}H(U,Y,m[U.getName()]);if(Z)!f.$block[U.getName()]||T._.enterMode==2&&!U.hasAttributes()?I(U):U.renameNode(T._.enterMode==1?'p':'div');};function G(T,U){var V=T._.definition,W=V.attributes,X=V.styles,Y=N(T),Z=U.getElementsByTag(T.element);for(var aa=Z.count();--aa>=0;)F(T,Z.getItem(aa));for(var ab in Y){if(ab!=T.element){Z=U.getElementsByTag(ab);for(aa=Z.count()-1;aa>=0;aa--){var ac=Z.getItem(aa);H(ac,Y[ab]);}}}};function H(T,U,V){var W=U&&U.attributes;if(W)for(var X=0;X<W.length;X++){var Y=W[X][0],Z;if(Z=T.getAttribute(Y)){var aa=W[X][1];if(aa===null||aa.test&&aa.test(Z)||typeof aa=='string'&&Z==aa)T.removeAttribute(Y);}}if(!V)I(T);};function I(T){if(!T.hasAttributes())if(f.$block[T.getName()]){var U=T.getPrevious(r),V=T.getNext(r);if(U&&(U.type==3||!U.isBlockBoundary({br:1})))T.append('br',1);if(V&&(V.type==3||!V.isBlockBoundary({br:1})))T.append('br');T.remove(true);}else{var W=T.getFirst(),X=T.getLast();T.remove(true);if(W){W.type==1&&W.mergeSiblings();if(X&&!W.equals(X)&&X.type==1)X.mergeSiblings();}}};function J(T,U,V){var W,X=T._.definition,Y=T.element;if(Y=='*')Y='span';W=new h(Y,U);if(V)V.copyAttributes(W);W=K(W,T);if(U.getCustomData('doc_processing_style')&&W.hasAttribute('id'))W.removeAttribute('id');else U.setCustomData('doc_processing_style',1);return W;};function K(T,U){var V=U._.definition,W=V.attributes,X=a.style.getStyleText(V);if(W)for(var Y in W)T.setAttribute(Y,W[Y]);if(X)T.setAttribute('style',X);return T;};function L(T,U){for(var V in T)T[V]=T[V].replace(p,function(W,X){return U[X];
|
|
||||||
});};function M(T){var U=T._AC;if(U)return U;U={};var V=0,W=T.attributes;if(W)for(var X in W){V++;U[X]=W[X];}var Y=a.style.getStyleText(T);if(Y){if(!U.style)V++;U.style=Y;}U._length=V;return T._AC=U;};function N(T){if(T._.overrides)return T._.overrides;var U=T._.overrides={},V=T._.definition.overrides;if(V){if(!e.isArray(V))V=[V];for(var W=0;W<V.length;W++){var X=V[W],Y,Z,aa;if(typeof X=='string')Y=X.toLowerCase();else{Y=X.element?X.element.toLowerCase():T.element;aa=X.attributes;}Z=U[Y]||(U[Y]={});if(aa){var ab=Z.attributes=Z.attributes||[];for(var ac in aa)ab.push([ac.toLowerCase(),aa[ac]]);}}}return U;};function O(T,U,V){var W=new h('span');W[V?'setStyle':'setAttribute'](T,U);return W[V?'getStyle':'getAttribute'](T);};function P(T,U){var V;if(U!==false){var W=new h('span');W.setAttribute('style',T);V=W.getAttribute('style')||'';}else V=T;V=V.replace(/(font-family:)(.*?)(?=;|$)/,function(X,Y,Z){var aa=Z.split(',');for(var ab=0;ab<aa.length;ab++)aa[ab]=e.trim(aa[ab].replace(/["']/g,''));return Y+aa.join(',');});return V.replace(/\s*([;:])\s*/,'$1').replace(/([^\s;])$/,'$1;').replace(/,\s+/g,',').replace(/\"/g,'').toLowerCase();};function Q(T){var U={};T.replace(/"/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(V,W,X){U[W]=X;});return U;};function R(T,U){typeof T=='string'&&(T=Q(T));typeof U=='string'&&(U=Q(U));for(var V in T){if(!(V in U&&(U[V]==T[V]||T[V]=='inherit'||U[V]=='inherit')))return false;}return true;};function S(T,U){var V=T.getSelection(),W=V.createBookmarks(1),X=V.getRanges(),Y=U?this.removeFromRange:this.applyToRange,Z,aa=X.createIterator();while(Z=aa.getNextRange())Y.call(this,Z);if(W.length==1&&W[0].collapsed){V.selectRanges(X);T.getById(W[0].startNode).remove();}else V.selectBookmarks(W);T.removeCustomData('doc_processing_style');};})();a.styleCommand=function(m){this.style=m;};a.styleCommand.prototype.exec=function(m){var o=this;m.focus();var n=m.document;if(n)if(o.state==2)o.style.apply(n);else if(o.state==1)o.style.remove(n);return!!n;};a.stylesSet=new a.resourceManager('','stylesSet');a.addStylesSet=e.bind(a.stylesSet.add,a.stylesSet);a.loadStylesSet=function(m,n,o){a.stylesSet.addExternal(m,n,'');a.stylesSet.load(m,o);};a.editor.prototype.getStylesSet=function(m){if(!this._.stylesDefinitions){var n=this,o=n.config.stylesCombo_stylesSet||n.config.stylesSet||'default';if(o instanceof Array){n._.stylesDefinitions=o;m(o);return;}var p=o.split(':'),q=p[0],r=p[1],s=j.registered.styles.path;a.stylesSet.addExternal(q,r?p.slice(1).join(':'):s+'styles/'+q+'.js','');
|
|
||||||
a.stylesSet.load(q,function(t){n._.stylesDefinitions=t[q];m(n._.stylesDefinitions);});}else m(this._.stylesDefinitions);};j.add('domiterator');(function(){function m(s){var t=this;if(arguments.length<1)return;t.range=s;t.forceBrBreak=0;t.enlargeBr=1;t.enforceRealBlocks=0;t._||(t._={});};var n=/^[\r\n\t ]+$/,o=d.walker.bookmark(false,true),p=d.walker.whitespaces(true),q=function(s){return o(s)&&p(s);};function r(s,t,u){var v=s.getNextSourceNode(t,null,u);while(!o(v))v=v.getNextSourceNode(t,null,u);return v;};m.prototype={getNextParagraph:function(s){var S=this;var t,u,v,w,x,y;if(!S._.started){u=S.range.clone();u.shrink(1,true);w=u.endContainer.hasAscendant('pre',true)||u.startContainer.hasAscendant('pre',true);u.enlarge(S.forceBrBreak&&!w||!S.enlargeBr?3:2);if(!u.collapsed){var z=new d.walker(u.clone()),A=d.walker.bookmark(true,true);z.evaluator=A;S._.nextNode=z.next();z=new d.walker(u.clone());z.evaluator=A;var B=z.previous();S._.lastNode=B.getNextSourceNode(true);if(S._.lastNode&&S._.lastNode.type==3&&!e.trim(S._.lastNode.getText())&&S._.lastNode.getParent().isBlockBoundary()){var C=new d.range(u.document);C.moveToPosition(S._.lastNode,4);if(C.checkEndOfBlock()){var D=new d.elementPath(C.endContainer),E=D.block||D.blockLimit;S._.lastNode=E.getNextSourceNode(true);}}if(!S._.lastNode){S._.lastNode=S._.docEndMarker=u.document.createText('');S._.lastNode.insertAfter(B);}u=null;}S._.started=1;}var F=S._.nextNode;B=S._.lastNode;S._.nextNode=null;while(F){var G=0,H=F.hasAscendant('pre'),I=F.type!=1,J=0;if(!I){var K=F.getName();if(F.isBlockBoundary(S.forceBrBreak&&!H&&{br:1})){if(K=='br')I=1;else if(!u&&!F.getChildCount()&&K!='hr'){t=F;v=F.equals(B);break;}if(u){u.setEndAt(F,3);if(K!='br')S._.nextNode=F;}G=1;}else{if(F.getFirst()){if(!u){u=new d.range(S.range.document);u.setStartAt(F,3);}F=F.getFirst();continue;}I=1;}}else if(F.type==3)if(n.test(F.getText()))I=0;if(I&&!u){u=new d.range(S.range.document);u.setStartAt(F,3);}v=(!G||I)&&F.equals(B);if(u&&!G)while(!F.getNext(q)&&!v){var L=F.getParent();if(L.isBlockBoundary(S.forceBrBreak&&!H&&{br:1})){G=1;I=0;v=v||L.equals(B);u.setEndAt(L,2);break;}F=L;I=1;v=F.equals(B);J=1;}if(I)u.setEndAt(F,4);F=r(F,J,B);v=!F;if(v||G&&u)break;}if(!t){if(!u){S._.docEndMarker&&S._.docEndMarker.remove();S._.nextNode=null;return null;}var M=new d.elementPath(u.startContainer),N=M.blockLimit,O={div:1,th:1,td:1};t=M.block;if(!t&&!S.enforceRealBlocks&&O[N.getName()]&&u.checkStartOfBlock()&&u.checkEndOfBlock())t=N;else if(!t||S.enforceRealBlocks&&t.getName()=='li'){t=S.range.document.createElement(s||'p');
|
|
||||||
u.extractContents().appendTo(t);t.trim();u.insertNode(t);x=y=true;}else if(t.getName()!='li'){if(!u.checkStartOfBlock()||!u.checkEndOfBlock()){t=t.clone(false);u.extractContents().appendTo(t);t.trim();var P=u.splitBlock();x=!P.wasStartOfBlock;y=!P.wasEndOfBlock;u.insertNode(t);}}else if(!v)S._.nextNode=t.equals(B)?null:r(u.getBoundaryNodes().endNode,1,B);}if(x){var Q=t.getPrevious();if(Q&&Q.type==1)if(Q.getName()=='br')Q.remove();else if(Q.getLast()&&Q.getLast().$.nodeName.toLowerCase()=='br')Q.getLast().remove();}if(y){var R=t.getLast();if(R&&R.type==1&&R.getName()=='br')if(c||R.getPrevious(o)||R.getNext(o))R.remove();}if(!S._.nextNode)S._.nextNode=v||t.equals(B)||!B?null:r(t,1,B);return t;}};d.range.prototype.createIterator=function(){return new m(this);};})();j.add('panelbutton',{requires:['button'],onLoad:function(){function m(n){var p=this;var o=p._;if(o.state==0)return;p.createPanel(n);if(o.on){o.panel.hide();return;}o.panel.showBlock(p._.id,p.document.getById(p._.id),4);};k.panelButton=e.createClass({base:k.button,$:function(n){var p=this;var o=n.panel;delete n.panel;p.base(n);p.document=o&&o.parent&&o.parent.getDocument()||a.document;o.block={attributes:o.attributes};p.hasArrow=true;p.click=m;p._={panelDefinition:o};},statics:{handler:{create:function(n){return new k.panelButton(n);}}},proto:{createPanel:function(n){var o=this._;if(o.panel)return;var p=this._.panelDefinition||{},q=this._.panelDefinition.block,r=p.parent||a.document.getBody(),s=this._.panel=new k.floatPanel(n,r,p),t=s.addBlock(o.id,q),u=this;s.onShow=function(){if(u.className)this.element.getFirst().addClass(u.className+'_panel');u.setState(1);o.on=1;if(u.onOpen)u.onOpen();};s.onHide=function(v){if(u.className)this.element.getFirst().removeClass(u.className+'_panel');u.setState(u.modes&&u.modes[n.mode]?2:0);o.on=0;if(!v&&u.onClose)u.onClose();};s.onEscape=function(){s.hide();u.document.getById(o.id).focus();};if(this.onBlock)this.onBlock(s,t);t.onHide=function(){o.on=0;u.setState(2);};}}});},beforeInit:function(m){m.ui.addHandler('panelbutton',k.panelButton.handler);}});a.UI_PANELBUTTON='panelbutton';j.add('floatpanel',{requires:['panel']});(function(){var m={},n=false;function o(p,q,r,s,t){var u=e.genKey(q.getUniqueId(),r.getUniqueId(),p.skinName,p.lang.dir,p.uiColor||'',s.css||'',t||''),v=m[u];if(!v){v=m[u]=new k.panel(q,s);v.element=r.append(h.createFromHtml(v.renderHtml(p),q));v.element.setStyles({display:'none',position:'absolute'});}return v;};k.floatPanel=e.createClass({$:function(p,q,r,s){r.forceIFrame=1;
|
|
||||||
var t=q.getDocument(),u=o(p,t,q,r,s||0),v=u.element,w=v.getFirst().getFirst();v.disableContextMenu();this.element=v;this._={editor:p,panel:u,parentElement:q,definition:r,document:t,iframe:w,children:[],dir:p.lang.dir};p.on('mode',function(){this.hide();},this);},proto:{addBlock:function(p,q){return this._.panel.addBlock(p,q);},addListBlock:function(p,q){return this._.panel.addListBlock(p,q);},getBlock:function(p){return this._.panel.getBlock(p);},showBlock:function(p,q,r,s,t){var u=this._.panel,v=u.showBlock(p);this.allowBlur(false);n=1;this._.returnFocus=this._.editor.focusManager.hasFocus?this._.editor:new h(a.document.$.activeElement);var w=this.element,x=this._.iframe,y=this._.definition,z=q.getDocumentPosition(w.getDocument()),A=this._.dir=='rtl',B=z.x+(s||0),C=z.y+(t||0);if(A&&(r==1||r==4))B+=q.$.offsetWidth;else if(!A&&(r==2||r==3))B+=q.$.offsetWidth-1;if(r==3||r==4)C+=q.$.offsetHeight-1;this._.panel._.offsetParentId=q.getId();w.setStyles({top:C+'px',left:0,display:''});w.setOpacity(0);w.getFirst().removeStyle('width');if(!this._.blurSet){var D=c?x:new d.window(x.$.contentWindow);a.event.useCapture=true;D.on('blur',function(E){var G=this;if(!G.allowBlur())return;var F=E.data.getTarget();if(F.getName&&F.getName()!='iframe')return;if(G.visible&&!G._.activeChild&&!n){delete G._.returnFocus;G.hide();}},this);D.on('focus',function(){this._.focused=true;this.hideChild();this.allowBlur(true);},this);a.event.useCapture=false;this._.blurSet=1;}u.onEscape=e.bind(function(E){if(this.onEscape&&this.onEscape(E)===false)return false;},this);e.setTimeout(function(){var E=e.bind(function(){var F=w.getFirst();if(v.autoSize){var G=v.element.getDocument(),H=(b.webkit?v.element:G.getBody()).$.scrollWidth;if(c&&b.quirks&&H>0)H+=(F.$.offsetWidth||0)-(F.$.clientWidth||0)+3;H+=4;F.setStyle('width',H+'px');v.element.addClass('cke_frameLoaded');var I=v.element.$.scrollHeight;if(c&&b.quirks&&I>0)I+=(F.$.offsetHeight||0)-(F.$.clientHeight||0)+3;F.setStyle('height',I+'px');u._.currentBlock.element.setStyle('display','none').removeStyle('display');}else F.removeStyle('height');if(A)B-=w.$.offsetWidth;w.setStyle('left',B+'px');var J=u.element,K=J.getWindow(),L=w.$.getBoundingClientRect(),M=K.getViewPaneSize(),N=L.width||L.right-L.left,O=L.height||L.bottom-L.top,P=A?L.right:M.width-L.left,Q=A?M.width-L.right:L.left;if(A){if(P<N)if(Q>N)B+=N;else if(M.width>N)B-=L.left;else B=B-L.right+M.width;}else if(P<N)if(Q>N)B-=N;else if(M.width>N)B=B-L.right+M.width;else B-=L.left;var R=M.height-L.top,S=L.top;
|
|
||||||
if(R<O)if(S>O)C-=O;else if(M.height>O)C=C-L.bottom+M.height;else C-=L.top;if(c){var T=new h(w.$.offsetParent),U=T;if(U.getName()=='html')U=U.getDocument().getBody();if(U.getComputedStyle('direction')=='rtl')if(b.ie8Compat)B-=w.getDocument().getDocumentElement().$.scrollLeft*2;else B-=T.$.scrollWidth-T.$.clientWidth;}var V=w.getFirst(),W;if(W=V.getCustomData('activePanel'))W.onHide&&W.onHide.call(this,1);V.setCustomData('activePanel',this);w.setStyles({top:C+'px',left:B+'px'});w.setOpacity(1);},this);u.isLoaded?E():u.onLoad=E;e.setTimeout(function(){x.$.contentWindow.focus();this.allowBlur(true);},0,this);},b.air?200:0,this);this.visible=1;if(this.onShow)this.onShow.call(this);n=0;},hide:function(p){var r=this;if(r.visible&&(!r.onHide||r.onHide.call(r)!==true)){r.hideChild();b.gecko&&r._.iframe.getFrameDocument().$.activeElement.blur();r.element.setStyle('display','none');r.visible=0;r.element.getFirst().removeCustomData('activePanel');var q=p!==false&&r._.returnFocus;if(q){if(b.webkit&&q.type)q.getWindow().$.focus();q.focus();}}},allowBlur:function(p){var q=this._.panel;if(p!=undefined)q.allowBlur=p;return q.allowBlur;},showAsChild:function(p,q,r,s,t,u){if(this._.activeChild==p&&p._.panel._.offsetParentId==r.getId())return;this.hideChild();p.onHide=e.bind(function(){e.setTimeout(function(){if(!this._.focused)this.hide();},0,this);},this);this._.activeChild=p;this._.focused=false;p.showBlock(q,r,s,t,u);if(b.ie7Compat||b.ie8&&b.ie6Compat)setTimeout(function(){p.element.getChild(0).$.style.cssText+='';},100);},hideChild:function(){var p=this._.activeChild;if(p){delete p.onHide;delete p._.returnFocus;delete this._.activeChild;p.hide();}}}});a.on('instanceDestroyed',function(){var p=e.isEmpty(a.instances);for(var q in m){var r=m[q];if(p)r.destroy();else r.element.hide();}p&&(m={});});})();j.add('menu',{beforeInit:function(m){var n=m.config.menu_groups.split(','),o=m._.menuGroups={},p=m._.menuItems={};for(var q=0;q<n.length;q++)o[n[q]]=q+1;m.addMenuGroup=function(r,s){o[r]=s||100;};m.addMenuItem=function(r,s){if(o[s.group])p[r]=new a.menuItem(this,r,s);};m.addMenuItems=function(r){for(var s in r)this.addMenuItem(s,r[s]);};m.getMenuItem=function(r){return p[r];};m.removeMenuItem=function(r){delete p[r];};},requires:['floatpanel']});(function(){a.menu=e.createClass({$:function(n,o){var r=this;o=r._.definition=o||{};r.id=e.getNextId();r.editor=n;r.items=[];r._.listeners=[];r._.level=o.level||1;var p=e.extend({},o.panel,{css:n.skin.editor.css,level:r._.level-1,block:{}}),q=p.block.attributes=p.attributes||{};
|
|
||||||
!q.role&&(q.role='menu');r._.panelDefinition=p;},_:{onShow:function(){var v=this;var n=v.editor.getSelection();if(c)n&&n.lock();var o=n&&n.getStartElement(),p=v._.listeners,q=[];v.removeAll();for(var r=0;r<p.length;r++){var s=p[r](o,n);if(s)for(var t in s){var u=v.editor.getMenuItem(t);if(u&&(!u.command||v.editor.getCommand(u.command).state)){u.state=s[t];v.add(u);}}}},onClick:function(n){this.hide(false);if(n.onClick)n.onClick();else if(n.command)this.editor.execCommand(n.command);},onEscape:function(n){var o=this.parent;if(o){o._.panel.hideChild();var p=o._.panel._.panel._.currentBlock,q=p._.focusIndex;p._.markItem(q);}else if(n==27)this.hide();return false;},onHide:function(){this._.unlockSelection();this.onHide&&this.onHide();},unlockSelection:function(){if(c&&!this.parent){var n=this.editor.getSelection();n&&n.unlock(true);}},showSubMenu:function(n){var v=this;var o=v._.subMenu,p=v.items[n],q=p.getItems&&p.getItems();if(!q){v._.panel.hideChild();return;}var r=v._.panel.getBlock(v.id);r._.focusIndex=n;if(o)o.removeAll();else{o=v._.subMenu=new a.menu(v.editor,e.extend({},v._.definition,{level:v._.level+1},true));o.parent=v;o._.onClick=e.bind(v._.onClick,v);}for(var s in q){var t=v.editor.getMenuItem(s);if(t){t.state=q[s];o.add(t);}}var u=v._.panel.getBlock(v.id).element.getDocument().getById(v.id+String(n));o.show(u,2);}},proto:{add:function(n){if(!n.order)n.order=this.items.length;this.items.push(n);},removeAll:function(){this.items=[];},show:function(n,o,p,q){if(!this.parent){this._.onShow();if(!this.items.length){this._.unlockSelection();return;}}o=o||(this.editor.lang.dir=='rtl'?2:1);var r=this.items,s=this.editor,t=this._.panel,u=this._.element;if(!t){t=this._.panel=new k.floatPanel(this.editor,a.document.getBody(),this._.panelDefinition,this._.level);t.onEscape=e.bind(function(F){if(this._.onEscape(F)===false)return false;},this);t.onHide=e.bind(function(){this._.onHide&&this._.onHide();},this);var v=t.addBlock(this.id,this._.panelDefinition.block);v.autoSize=true;var w=v.keys;w[40]='next';w[9]='next';w[38]='prev';w[2228224+9]='prev';w[s.lang.dir=='rtl'?37:39]=c?'mouseup':'click';w[32]=c?'mouseup':'click';c&&(w[13]='mouseup');u=this._.element=v.element;u.addClass(s.skinClass);var x=u.getDocument();x.getBody().setStyle('overflow','hidden');x.getElementsByTag('html').getItem(0).setStyle('overflow','hidden');this._.itemOverFn=e.addFunction(function(F){var G=this;clearTimeout(G._.showSubTimeout);G._.showSubTimeout=e.setTimeout(G._.showSubMenu,s.config.menu_subMenuDelay||400,G,[F]);
|
|
||||||
},this);this._.itemOutFn=e.addFunction(function(F){clearTimeout(this._.showSubTimeout);},this);this._.itemClickFn=e.addFunction(function(F){var H=this;var G=H.items[F];if(G.state==0){H.hide();return;}if(G.getItems)H._.showSubMenu(F);else H._.onClick(G);},this);}m(r);var y=s.container.getChild(1),z=y.hasClass('cke_mixed_dir_content')?' cke_mixed_dir_content':'',A=['<div class="cke_menu'+z+'" role="presentation">'],B=r.length,C=B&&r[0].group;for(var D=0;D<B;D++){var E=r[D];if(C!=E.group){A.push('<div class="cke_menuseparator" role="separator"></div>');C=E.group;}E.render(this,D,A);}A.push('</div>');u.setHtml(A.join(''));k.fire('ready',this);if(this.parent)this.parent._.panel.showAsChild(t,this.id,n,o,p,q);else t.showBlock(this.id,n,o,p,q);s.fire('menuShow',[t]);},addListener:function(n){this._.listeners.push(n);},hide:function(n){var o=this;o._.onHide&&o._.onHide();o._.panel&&o._.panel.hide(n);}}});function m(n){n.sort(function(o,p){if(o.group<p.group)return-1;else if(o.group>p.group)return 1;return o.order<p.order?-1:o.order>p.order?1:0;});};a.menuItem=e.createClass({$:function(n,o,p){var q=this;e.extend(q,p,{order:0,className:'cke_button_'+o});q.group=n._.menuGroups[q.group];q.editor=n;q.name=o;},proto:{render:function(n,o,p){var w=this;var q=n.id+String(o),r=typeof w.state=='undefined'?2:w.state,s=' cke_'+(r==1?'on':r==0?'disabled':'off'),t=w.label;if(w.className)s+=' '+w.className;var u=w.getItems;p.push('<span class="cke_menuitem'+(w.icon&&w.icon.indexOf('.png')==-1?' cke_noalphafix':'')+'">'+'<a id="',q,'" class="',s,'" href="javascript:void(\'',(w.label||'').replace("'",''),'\')" title="',w.label,'" tabindex="-1"_cke_focus=1 hidefocus="true" role="menuitem"'+(u?'aria-haspopup="true"':'')+(r==0?'aria-disabled="true"':'')+(r==1?'aria-pressed="true"':''));if(b.opera||b.gecko&&b.mac)p.push(' onkeypress="return false;"');if(b.gecko)p.push(' onblur="this.style.cssText = this.style.cssText;"');var v=(w.iconOffset||0)*-16;p.push(' onmouseover="CKEDITOR.tools.callFunction(',n._.itemOverFn,',',o,');" onmouseout="CKEDITOR.tools.callFunction(',n._.itemOutFn,',',o,');" '+(c?'onclick="return false;" onmouseup':'onclick')+'="CKEDITOR.tools.callFunction(',n._.itemClickFn,',',o,'); return false;"><span class="cke_icon_wrapper"><span class="cke_icon"'+(w.icon?' style="background-image:url('+a.getUrl(w.icon)+');background-position:0 '+v+'px;"':'')+'></span></span>'+'<span class="cke_label">');if(u)p.push('<span class="cke_menuarrow">','<span>&#',w.editor.lang.dir=='rtl'?'9668':'9658',';</span>','</span>');
|
|
||||||
p.push(t,'</span></a></span>');}}});})();i.menu_groups='clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div';(function(){var m;j.add('editingblock',{init:function(n){if(!n.config.editingBlock)return;n.on('themeSpace',function(o){if(o.data.space=='contents')o.data.html+='<br>';});n.on('themeLoaded',function(){n.fireOnce('editingBlockReady');});n.on('uiReady',function(){n.setMode(n.config.startupMode);});n.on('afterSetData',function(){if(!m){function o(){m=true;n.getMode().loadData(n.getData());m=false;};if(n.mode)o();else n.on('mode',function(){if(n.mode){o();n.removeListener('mode',arguments.callee);}});}});n.on('beforeGetData',function(){if(!m&&n.mode){m=true;n.setData(n.getMode().getData(),null,1);m=false;}});n.on('getSnapshot',function(o){if(n.mode)o.data=n.getMode().getSnapshotData();});n.on('loadSnapshot',function(o){if(n.mode)n.getMode().loadSnapshotData(o.data);});n.on('mode',function(o){o.removeListener();b.webkit&&n.container.on('focus',function(){n.focus();});if(n.config.startupFocus)n.focus();setTimeout(function(){n.fireOnce('instanceReady');a.fire('instanceReady',null,n);},0);});n.on('destroy',function(){var o=this;if(o.mode)o._.modes[o.mode].unload(o.getThemeSpace('contents'));});}});a.editor.prototype.mode='';a.editor.prototype.addMode=function(n,o){o.name=n;(this._.modes||(this._.modes={}))[n]=o;};a.editor.prototype.setMode=function(n){this.fire('beforeSetMode',{newMode:n});var o,p=this.getThemeSpace('contents'),q=this.checkDirty();if(this.mode){if(n==this.mode)return;this._.previousMode=this.mode;this.fire('beforeModeUnload');var r=this.getMode();o=r.getData();r.unload(p);this.mode='';}p.setHtml('');var s=this.getMode(n);if(!s)throw '[CKEDITOR.editor.setMode] Unknown mode "'+n+'".';if(!q)this.on('mode',function(){this.resetDirty();this.removeListener('mode',arguments.callee);});s.load(p,typeof o!='string'?this.getData():o);};a.editor.prototype.getMode=function(n){return this._.modes&&this._.modes[n||this.mode];};a.editor.prototype.focus=function(){this.forceNextSelectionCheck();var n=this.getMode();if(n)n.focus();};})();i.startupMode='wysiwyg';i.editingBlock=true;(function(){function m(){var G=this;try{var D=G.getSelection();if(!D||!D.document.getWindow().$)return;var E=D.getStartElement(),F=new d.elementPath(E);if(!F.compare(G._.selectionPreviousPath)){G._.selectionPreviousPath=F;G.fire('selectionChange',{selection:D,path:F,element:E});
|
|
||||||
}}catch(H){}};var n,o;function p(){o=true;if(n)return;q.call(this);n=e.setTimeout(q,200,this);};function q(){n=null;if(o){e.setTimeout(m,0,this);o=false;}};function r(D){function E(I,J){if(!I||I.type==3)return false;var K=D.clone();return K['moveToElementEdit'+(J?'End':'Start')](I);};var F=D.startContainer,G=D.getPreviousNode(A,null,F),H=D.getNextNode(A,null,F);if(E(G)||E(H,1))return true;if(!(G||H)&&!(F.type==1&&F.isBlockBoundary()&&F.getBogus()))return true;return false;};var s={modes:{wysiwyg:1,source:1},readOnly:c||b.webkit,exec:function(D){switch(D.mode){case 'wysiwyg':D.document.$.execCommand('SelectAll',false,null);D.forceNextSelectionCheck();D.selectionChange();break;case 'source':var E=D.textarea.$;if(c)E.createTextRange().execCommand('SelectAll');else{E.selectionStart=0;E.selectionEnd=E.value.length;}E.focus();}},canUndo:false};function t(D){w(D);var E=D.createText('');D.setCustomData('cke-fillingChar',E);return E;};function u(D){return D&&D.getCustomData('cke-fillingChar');};function v(D){var E=D&&u(D);if(E)if(E.getCustomData('ready'))w(D);else E.setCustomData('ready',1);};function w(D){var E=D&&D.removeCustomData('cke-fillingChar');if(E){var F,G=D.getSelection().getNative(),H=G&&G.type!='None'&&G.getRangeAt(0);if(E.getLength()>1&&H&&H.intersectsNode(E.$)){F=[G.anchorOffset,G.focusOffset];var I=G.anchorNode==E.$&&G.anchorOffset>0,J=G.focusNode==E.$&&G.focusOffset>0;I&&F[0]--;J&&F[1]--;x(G)&&F.unshift(F.pop());}E.setText(E.getText().replace(/\u200B/g,''));if(F){var K=G.getRangeAt(0);K.setStart(K.startContainer,F[0]);K.setEnd(K.startContainer,F[1]);G.removeAllRanges();G.addRange(K);}}};function x(D){if(!D.isCollapsed){var E=D.getRangeAt(0);E.setStart(D.anchorNode,D.anchorOffset);E.setEnd(D.focusNode,D.focusOffset);return E.collapsed;}};j.add('selection',{init:function(D){if(b.webkit){D.on('selectionChange',function(){v(D.document);});D.on('beforeSetMode',function(){w(D.document);});var E,F;function G(){var I=D.document,J=u(I);if(J){var K=I.$.defaultView.getSelection();if(K.type=='Caret'&&K.anchorNode==J.$)F=1;E=J.getText();J.setText(E.replace(/\u200B/g,''));}};function H(){var I=D.document,J=u(I);if(J){J.setText(E);if(F){I.$.defaultView.getSelection().setPosition(J.$,J.getLength());F=0;}}};D.on('beforeUndoImage',G);D.on('afterUndoImage',H);D.on('beforeGetData',G,null,null,0);D.on('getData',H);}D.on('contentDom',function(){var I=D.document,J=a.document,K=I.getBody(),L=I.getDocumentElement();if(c){var M,N,O=1;K.on('focusin',function(V){if(V.data.$.srcElement.nodeName!='BODY')return;
|
|
||||||
var W=I.getCustomData('cke_locked_selection');if(W){W.unlock(1);W.lock();}else if(M&&O){try{M.select();}catch(X){}M=null;}});K.on('focus',function(){N=1;U();});K.on('beforedeactivate',function(V){if(V.data.$.toElement)return;N=0;O=1;});c&&D.on('blur',function(){try{I.$.selection.empty();}catch(V){}});L.on('mousedown',function(){O=0;});L.on('mouseup',function(){O=1;});var P;K.on('mousedown',function(V){if(V.data.$.button==2){var W=D.document.$.selection;if(W.type=='None')P=D.window.getScrollPosition();}T();});K.on('mouseup',function(V){if(V.data.$.button==2&&P){D.document.$.documentElement.scrollLeft=P.x;D.document.$.documentElement.scrollTop=P.y;}P=null;N=1;setTimeout(function(){U(true);},0);});K.on('keydown',T);K.on('keyup',function(){N=1;U();});if(I.$.compatMode!='BackCompat'){if(b.ie7Compat||b.ie6Compat){function Q(V,W,X){try{V.moveToPoint(W,X);}catch(Y){}};L.on('mousedown',function(V){function W(ab){ab=ab.data.$;if(Z){var ac=K.$.createTextRange();Q(ac,ab.x,ab.y);Z.setEndPoint(aa.compareEndPoints('StartToStart',ac)<0?'EndToEnd':'StartToStart',ac);Z.select();}};function X(){J.removeListener('mouseup',Y);L.removeListener('mouseup',Y);};function Y(){L.removeListener('mousemove',W);X();Z.select();};V=V.data;if(V.getTarget().is('html')&&V.$.x<L.$.clientWidth&&V.$.y<L.$.clientHeight){var Z=K.$.createTextRange();Q(Z,V.$.x,V.$.y);var aa=Z.duplicate();L.on('mousemove',W);J.on('mouseup',Y);L.on('mouseup',Y);}});}if(b.ie8){L.on('mousedown',function(V){if(V.data.getTarget().is('html')){J.on('mouseup',S);L.on('mouseup',S);}});function R(){J.removeListener('mouseup',S);L.removeListener('mouseup',S);};function S(){R();var V=a.document.$.selection,W=V.createRange();if(V.type!='None'&&W.parentElement().ownerDocument==I.$)W.select();};}}I.on('selectionchange',U);function T(){N=0;};function U(V){if(N){var W=D.document,X=D.getSelection(),Y=X&&X.getNative();if(V&&Y&&Y.type=='None')if(!W.$.queryCommandEnabled('InsertImage')){e.setTimeout(U,50,this,true);return;}var Z;if(Y&&Y.type&&Y.type!='Control'&&(Z=Y.createRange())&&(Z=Z.parentElement())&&(Z=Z.nodeName)&&Z.toLowerCase() in {input:1,textarea:1})return;try{M=Y&&X.getRanges()[0];}catch(aa){}p.call(D);}};}else{I.on('mouseup',p,D);I.on('keyup',p,D);I.on('selectionchange',p,D);}if(b.webkit)I.on('keydown',function(V){var W=V.data.getKey();switch(W){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:w(D.document);}},null,null,-1);});D.on('contentDomUnload',D.forceNextSelectionCheck,D);D.addCommand('selectAll',s);
|
|
||||||
D.ui.addButton('SelectAll',{label:D.lang.selectAll,command:'selectAll'});D.selectionChange=function(I){(I?m:p).call(this);};b.ie9Compat&&D.on('destroy',function(){var I=D.getSelection();I&&I.getNative().clear();},null,null,9);}});a.editor.prototype.getSelection=function(){return this.document&&this.document.getSelection();};a.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath;};g.prototype.getSelection=function(){var D=new d.selection(this);return!D||D.isInvalid?null:D;};a.SELECTION_NONE=1;a.SELECTION_TEXT=2;a.SELECTION_ELEMENT=3;d.selection=function(D){var G=this;var E=D.getCustomData('cke_locked_selection');if(E)return E;G.document=D;G.isLocked=0;G._={cache:{}};if(c)try{var F=G.getNative().createRange();if(!F||F.item&&F.item(0).ownerDocument!=G.document.$||F.parentElement&&F.parentElement().ownerDocument!=G.document.$)throw 0;}catch(H){G.isInvalid=true;}return G;};var y={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};d.selection.prototype={getNative:c?function(){return this._.cache.nativeSel||(this._.cache.nativeSel=this.document.$.selection);}:function(){return this._.cache.nativeSel||(this._.cache.nativeSel=this.document.getWindow().$.getSelection());},getType:c?function(){var D=this._.cache;if(D.type)return D.type;var E=1;try{var F=this.getNative(),G=F.type;if(G=='Text')E=2;if(G=='Control')E=3;if(F.createRange().parentElement)E=2;}catch(H){}return D.type=E;}:function(){var D=this._.cache;if(D.type)return D.type;var E=2,F=this.getNative();if(!F)E=1;else if(F.rangeCount==1){var G=F.getRangeAt(0),H=G.startContainer;if(H==G.endContainer&&H.nodeType==1&&G.endOffset-G.startOffset==1&&y[H.childNodes[G.startOffset].nodeName.toLowerCase()])E=3;}return D.type=E;},getRanges:(function(){var D=c?(function(){function E(G){return new d.node(G).getIndex();};var F=function(G,H){G=G.duplicate();G.collapse(H);var I=G.parentElement(),J=I.ownerDocument;if(!I.hasChildNodes())return{container:I,offset:0};var K=I.children,L,M,N=G.duplicate(),O=0,P=K.length-1,Q=-1,R,S,T;while(O<=P){Q=Math.floor((O+P)/2);L=K[Q];N.moveToElementText(L);R=N.compareEndPoints('StartToStart',G);if(R>0)P=Q-1;else if(R<0)O=Q+1;else if(b.ie9Compat&&L.tagName=='BR'){var U=J.defaultView.getSelection();return{container:U[H?'anchorNode':'focusNode'],offset:U[H?'anchorOffset':'focusOffset']};}else return{container:I,offset:E(L)};}if(Q==-1||Q==K.length-1&&R<0){N.moveToElementText(I);
|
|
||||||
N.setEndPoint('StartToStart',G);S=N.text.replace(/(\r\n|\r)/g,'\n').length;K=I.childNodes;if(!S){L=K[K.length-1];if(L.nodeType!=3)return{container:I,offset:K.length};else return{container:L,offset:L.nodeValue.length};}var V=K.length;while(S>0&&V>0){M=K[--V];if(M.nodeType==3){T=M;S-=M.nodeValue.length;}}return{container:T,offset:-S};}else{N.collapse(R>0?true:false);N.setEndPoint(R>0?'StartToStart':'EndToStart',G);S=N.text.replace(/(\r\n|\r)/g,'\n').length;if(!S)return{container:I,offset:E(L)+(R>0?0:1)};while(S>0)try{M=L[R>0?'previousSibling':'nextSibling'];if(M.nodeType==3){S-=M.nodeValue.length;T=M;}L=M;}catch(W){return{container:I,offset:E(L)};}return{container:T,offset:R>0?-S:T.nodeValue.length+S};}};return function(){var Q=this;var G=Q.getNative(),H=G&&G.createRange(),I=Q.getType(),J;if(!G)return[];if(I==2){J=new d.range(Q.document);var K=F(H,true);J.setStart(new d.node(K.container),K.offset);K=F(H);J.setEnd(new d.node(K.container),K.offset);if(J.endContainer.getPosition(J.startContainer)&4&&J.endOffset<=J.startContainer.getIndex())J.collapse();return[J];}else if(I==3){var L=[];for(var M=0;M<H.length;M++){var N=H.item(M),O=N.parentNode,P=0;J=new d.range(Q.document);for(;P<O.childNodes.length&&O.childNodes[P]!=N;P++){}J.setStart(new d.node(O),P);J.setEnd(new d.node(O),P+1);L.push(J);}return L;}return[];};})():function(){var E=[],F,G=this.document,H=this.getNative();if(!H)return E;if(!H.rangeCount){F=new d.range(G);F.moveToElementEditStart(G.getBody());E.push(F);}for(var I=0;I<H.rangeCount;I++){var J=H.getRangeAt(I);F=new d.range(G);F.setStart(new d.node(J.startContainer),J.startOffset);F.setEnd(new d.node(J.endContainer),J.endOffset);E.push(F);}return E;};return function(E){var F=this._.cache;if(F.ranges&&!E)return F.ranges;else if(!F.ranges)F.ranges=new d.rangeList(D.call(this));if(E){var G=F.ranges;for(var H=0;H<G.length;H++){var I=G[H],J=I.getCommonAncestor();if(J.isReadOnly())G.splice(H,1);if(I.collapsed)continue;if(I.startContainer.isReadOnly()){var K=I.startContainer;while(K){if(K.is('body')||!K.isReadOnly())break;if(K.type==1&&K.getAttribute('contentEditable')=='false')I.setStartAfter(K);K=K.getParent();}}var L=I.startContainer,M=I.endContainer,N=I.startOffset,O=I.endOffset,P=I.clone();if(L&&L.type==3)if(N>=L.getLength())P.setStartAfter(L);else P.setStartBefore(L);if(M&&M.type==3)if(!O)P.setEndBefore(M);else P.setEndAfter(M);var Q=new d.walker(P);Q.evaluator=function(R){if(R.type==1&&R.isReadOnly()){var S=I.clone();I.setEndBefore(R);if(I.collapsed)G.splice(H--,1);
|
|
||||||
if(!(R.getPosition(P.endContainer)&16)){S.setStartAfter(R);if(!S.collapsed)G.splice(H+1,0,S);}return true;}return false;};Q.next();}}return F.ranges;};})(),getStartElement:function(){var K=this;var D=K._.cache;if(D.startElement!==undefined)return D.startElement;var E,F=K.getNative();switch(K.getType()){case 3:return K.getSelectedElement();case 2:var G=K.getRanges()[0];if(G){if(!G.collapsed){G.optimize();while(1){var H=G.startContainer,I=G.startOffset;if(I==(H.getChildCount?H.getChildCount():H.getLength())&&!H.isBlockBoundary())G.setStartAfter(H);else break;}E=G.startContainer;if(E.type!=1)return E.getParent();E=E.getChild(G.startOffset);if(!E||E.type!=1)E=G.startContainer;else{var J=E.getFirst();while(J&&J.type==1){E=J;J=J.getFirst();}}}else{E=G.startContainer;if(E.type!=1)E=E.getParent();}E=E.$;}}return D.startElement=E?new h(E):null;},getSelectedElement:function(){var D=this._.cache;if(D.selectedElement!==undefined)return D.selectedElement;var E=this,F=e.tryThese(function(){return E.getNative().createRange().item(0);},function(){var G,H,I=E.getRanges()[0],J=I.getCommonAncestor(1,1),K={table:1,ul:1,ol:1,dl:1};for(var L in K){if(G=J.getAscendant(L,1))break;}if(G){var M=new d.range(this.document);M.setStartAt(G,1);M.setEnd(I.startContainer,I.startOffset);var N=e.extend(K,f.$listItem,f.$tableContent),O=new d.walker(M),P=function(Q,R){return function(S,T){if(S.type==3&&(!e.trim(S.getText())||S.getParent().data('cke-bookmark')))return true;var U;if(S.type==1){U=S.getName();if(U=='br'&&R&&S.equals(S.getParent().getBogus()))return true;if(T&&U in N||U in f.$removeEmpty)return true;}Q.halted=1;return false;};};O.guard=P(O);if(O.checkBackward()&&!O.halted){O=new d.walker(M);M.setStart(I.endContainer,I.endOffset);M.setEndAt(G,2);O.guard=P(O,1);if(O.checkForward()&&!O.halted)H=G.$;}}if(!H)throw 0;return H;},function(){var G=E.getRanges()[0],H,I;for(var J=2;J&&!((H=G.getEnclosedNode())&&H.type==1&&y[H.getName()]&&(I=H));J--)G.shrink(1);return I.$;});return D.selectedElement=F?new h(F):null;},getSelectedText:function(){var D=this._.cache;if(D.selectedText!==undefined)return D.selectedText;var E='',F=this.getNative();if(this.getType()==2)E=c?F.createRange().text:F.toString();return D.selectedText=E;},lock:function(){var D=this;D.getRanges();D.getStartElement();D.getSelectedElement();D.getSelectedText();D._.cache.nativeSel={};D.isLocked=1;D.document.setCustomData('cke_locked_selection',D);},unlock:function(D){var I=this;var E=I.document,F=E.getCustomData('cke_locked_selection');
|
|
||||||
if(F){E.setCustomData('cke_locked_selection',null);if(D){var G=F.getSelectedElement(),H=!G&&F.getRanges();I.isLocked=0;I.reset();if(G)I.selectElement(G);else I.selectRanges(H);}}if(!F||!D){I.isLocked=0;I.reset();}},reset:function(){this._.cache={};},selectElement:function(D){var F=this;if(F.isLocked){var E=new d.range(F.document);E.setStartBefore(D);E.setEndAfter(D);F._.cache.selectedElement=D;F._.cache.startElement=D;F._.cache.ranges=new d.rangeList(E);F._.cache.type=3;return;}E=new d.range(D.getDocument());E.setStartBefore(D);E.setEndAfter(D);E.select();F.document.fire('selectionchange');F.reset();},selectRanges:function(D){var R=this;if(R.isLocked){R._.cache.selectedElement=null;R._.cache.startElement=D[0]&&D[0].getTouchedStartNode();R._.cache.ranges=new d.rangeList(D);R._.cache.type=2;return;}if(c){if(D.length>1){var E=D[D.length-1];D[0].setEnd(E.endContainer,E.endOffset);D.length=1;}if(D[0])D[0].select();R.reset();}else{var F=R.getNative();if(!F)return;if(D.length){F.removeAllRanges();b.webkit&&w(R.document);}for(var G=0;G<D.length;G++){if(G<D.length-1){var H=D[G],I=D[G+1],J=H.clone();J.setStart(H.endContainer,H.endOffset);J.setEnd(I.startContainer,I.startOffset);if(!J.collapsed){J.shrink(1,true);var K=J.getCommonAncestor(),L=J.getEnclosedNode();if(K.isReadOnly()||L&&L.isReadOnly()){I.setStart(H.startContainer,H.startOffset);D.splice(G--,1);continue;}}}var M=D[G],N=R.document.$.createRange(),O=M.startContainer;if(M.collapsed&&(b.opera||b.gecko&&b.version<10900)&&O.type==1&&!O.getChildCount())O.appendText('');if(M.collapsed&&b.webkit&&r(M)){var P=t(R.document);M.insertNode(P);var Q=P.getNext();if(Q&&!P.getPrevious()&&Q.type==1&&Q.getName()=='br'){w(R.document);M.moveToPosition(Q,3);}else M.moveToPosition(P,4);}N.setStart(M.startContainer.$,M.startOffset);try{N.setEnd(M.endContainer.$,M.endOffset);}catch(S){if(S.toString().indexOf('NS_ERROR_ILLEGAL_VALUE')>=0){M.collapse(1);N.setEnd(M.endContainer.$,M.endOffset);}else throw S;}F.addRange(N);}R.document.fire('selectionchange');R.reset();}},createBookmarks:function(D){return this.getRanges().createBookmarks(D);},createBookmarks2:function(D){return this.getRanges().createBookmarks2(D);},selectBookmarks:function(D){var E=[];for(var F=0;F<D.length;F++){var G=new d.range(this.document);G.moveToBookmark(D[F]);E.push(G);}this.selectRanges(E);return this;},getCommonAncestor:function(){var D=this.getRanges(),E=D[0].startContainer,F=D[D.length-1].endContainer;return E.getCommonAncestor(F);},scrollIntoView:function(){var D=this.getStartElement();
|
|
||||||
D.scrollIntoView();}};var z=d.walker.whitespaces(true),A=d.walker.invisible(1),B=/\ufeff|\u00a0/,C={table:1,tbody:1,tr:1};d.range.prototype.select=c?function(D){var O=this;var E=O.collapsed,F,G,H,I=O.getEnclosedNode();if(I)try{H=O.document.$.body.createControlRange();H.addElement(I.$);H.select();return;}catch(P){}if(O.startContainer.type==1&&O.startContainer.getName() in C||O.endContainer.type==1&&O.endContainer.getName() in C)O.shrink(1,true);var J=O.createBookmark(),K=J.startNode,L;if(!E)L=J.endNode;H=O.document.$.body.createTextRange();H.moveToElementText(K.$);H.moveStart('character',1);if(L){var M=O.document.$.body.createTextRange();M.moveToElementText(L.$);H.setEndPoint('EndToEnd',M);H.moveEnd('character',-1);}else{var N=K.getNext(z);F=!(N&&N.getText&&N.getText().match(B))&&(D||!K.hasPrevious()||K.getPrevious().is&&K.getPrevious().is('br'));G=O.document.createElement('span');G.setHtml('');G.insertBefore(K);if(F)O.document.createText('\ufeff').insertBefore(K);}O.setStartBefore(K);K.remove();if(E){if(F){H.moveStart('character',-1);H.select();O.document.$.selection.clear();}else H.select();O.moveToPosition(G,3);G.remove();}else{O.setEndBefore(L);L.remove();H.select();}O.document.fire('selectionchange');}:function(){this.document.getSelection().selectRanges([this]);};})();(function(){var m=a.htmlParser.cssStyle,n=e.cssLength,o=/^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i;function p(r,s){var t=o.exec(r),u=o.exec(s);if(t){if(!t[2]&&u[2]=='px')return u[1];if(t[2]=='px'&&!u[2])return u[1]+'px';}return s;};var q={elements:{$:function(r){var s=r.attributes,t=s&&s['data-cke-realelement'],u=t&&new a.htmlParser.fragment.fromHtml(decodeURIComponent(t)),v=u&&u.children[0];if(v&&r.attributes['data-cke-resizable']){var w=new m(r).rules,x=v.attributes,y=w.width,z=w.height;y&&(x.width=p(x.width,y));z&&(x.height=p(x.height,z));}return v;}}};j.add('fakeobjects',{requires:['htmlwriter'],afterInit:function(r){var s=r.dataProcessor,t=s&&s.htmlFilter;if(t)t.addRules(q);}});a.editor.prototype.createFakeElement=function(r,s,t,u){var v=this.lang.fakeobjects,w=v[t]||v.unknown,x={'class':s,'data-cke-realelement':encodeURIComponent(r.getOuterHtml()),'data-cke-real-node-type':r.type,alt:w,title:w,align:r.getAttribute('align')||''};if(!b.hc)x.src=a.getUrl('images/spacer.gif');if(t)x['data-cke-real-element-type']=t;if(u){x['data-cke-resizable']=u;var y=new m(),z=r.getAttribute('width'),A=r.getAttribute('height');z&&(y.rules.width=n(z));A&&(y.rules.height=n(A));y.populate(x);}return this.document.createElement('img',{attributes:x});
|
|
||||||
};a.editor.prototype.createFakeParserElement=function(r,s,t,u){var v=this.lang.fakeobjects,w=v[t]||v.unknown,x,y=new a.htmlParser.basicWriter();r.writeHtml(y);x=y.getHtml();var z={'class':s,'data-cke-realelement':encodeURIComponent(x),'data-cke-real-node-type':r.type,alt:w,title:w,align:r.attributes.align||''};if(!b.hc)z.src=a.getUrl('images/spacer.gif');if(t)z['data-cke-real-element-type']=t;if(u){z['data-cke-resizable']=u;var A=r.attributes,B=new m(),C=A.width,D=A.height;C!=undefined&&(B.rules.width=n(C));D!=undefined&&(B.rules.height=n(D));B.populate(z);}return new a.htmlParser.element('img',z);};a.editor.prototype.restoreRealElement=function(r){if(r.data('cke-real-node-type')!=1)return null;var s=h.createFromHtml(decodeURIComponent(r.data('cke-realelement')),this.document);if(r.data('cke-resizable')){var t=r.getStyle('width'),u=r.getStyle('height');t&&s.setAttribute('width',p(s.getAttribute('width'),t));u&&s.setAttribute('height',p(s.getAttribute('height'),u));}return s;};})();j.add('richcombo',{requires:['floatpanel','listblock','button'],beforeInit:function(m){m.ui.addHandler('richcombo',k.richCombo.handler);}});a.UI_RICHCOMBO='richcombo';k.richCombo=e.createClass({$:function(m){var o=this;e.extend(o,m,{title:m.label,modes:{wysiwyg:1}});var n=o.panel||{};delete o.panel;o.id=e.getNextNumber();o.document=n&&n.parent&&n.parent.getDocument()||a.document;n.className=(n.className||'')+' cke_rcombopanel';n.block={multiSelect:n.multiSelect,attributes:n.attributes};o._={panelDefinition:n,items:{},state:2};},statics:{handler:{create:function(m){return new k.richCombo(m);}}},proto:{renderHtml:function(m){var n=[];this.render(m,n);return n.join('');},render:function(m,n){var o=b,p='cke_'+this.id,q=e.addFunction(function(v){var y=this;var w=y._;if(w.state==0)return;y.createPanel(m);if(w.on){w.panel.hide();return;}y.commit();var x=y.getValue();if(x)w.list.mark(x);else w.list.unmarkAll();w.panel.showBlock(y.id,new h(v),4);},this),r={id:p,combo:this,focus:function(){var v=a.document.getById(p).getChild(1);v.focus();},clickFn:q};function s(){var w=this;var v=w.modes[m.mode]?2:0;w.setState(m.readOnly&&!w.readOnly?0:v);w.setValue('');};m.on('mode',s,this);!this.readOnly&&m.on('readOnly',s,this);var t=e.addFunction(function(v,w){v=new d.event(v);var x=v.getKeystroke();switch(x){case 13:case 32:case 40:e.callFunction(q,w);break;default:r.onkey(r,x);}v.preventDefault();}),u=e.addFunction(function(){r.onfocus&&r.onfocus();});r.keyDownFn=t;n.push('<span class="cke_rcombo" role="presentation">','<span id=',p);
|
|
||||||
if(this.className)n.push(' class="',this.className,' cke_off"');n.push(' role="presentation">','<span id="'+p+'_label" class=cke_label>',this.label,'</span>','<a hidefocus=true title="',this.title,'" tabindex="-1"',o.gecko&&o.version>=10900&&!o.hc?'':" href=\"javascript:void('"+this.label+"')\"",' role="button" aria-labelledby="',p,'_label" aria-describedby="',p,'_text" aria-haspopup="true"');if(b.opera||b.gecko&&b.mac)n.push(' onkeypress="return false;"');if(b.gecko)n.push(' onblur="this.style.cssText = this.style.cssText;"');n.push(' onkeydown="CKEDITOR.tools.callFunction( ',t,', event, this );" onfocus="return CKEDITOR.tools.callFunction(',u,', event);" '+(c?'onclick="return false;" onmouseup':'onclick')+'="CKEDITOR.tools.callFunction(',q,', this); return false;"><span><span id="'+p+'_text" class="cke_text cke_inline_label">'+this.label+'</span>'+'</span>'+'<span class=cke_openbutton><span class=cke_icon>'+(b.hc?'▼':b.air?' ':'')+'</span></span>'+'</a>'+'</span>'+'</span>');if(this.onRender)this.onRender();return r;},createPanel:function(m){if(this._.panel)return;var n=this._.panelDefinition,o=this._.panelDefinition.block,p=n.parent||a.document.getBody(),q=new k.floatPanel(m,p,n),r=q.addListBlock(this.id,o),s=this;q.onShow=function(){if(s.className)this.element.getFirst().addClass(s.className+'_panel');s.setState(1);r.focus(!s.multiSelect&&s.getValue());s._.on=1;if(s.onOpen)s.onOpen();};q.onHide=function(t){if(s.className)this.element.getFirst().removeClass(s.className+'_panel');s.setState(s.modes&&s.modes[m.mode]?2:0);s._.on=0;if(!t&&s.onClose)s.onClose();};q.onEscape=function(){q.hide();};r.onClick=function(t,u){s.document.getWindow().focus();if(s.onClick)s.onClick.call(s,t,u);if(u)s.setValue(t,s._.items[t]);else s.setValue('');q.hide(false);};this._.panel=q;this._.list=r;q.getBlock(this.id).onHide=function(){s._.on=0;s.setState(2);};if(this.init)this.init();},setValue:function(m,n){var p=this;p._.value=m;var o=p.document.getById('cke_'+p.id+'_text');if(o){if(!(m||n)){n=p.label;o.addClass('cke_inline_label');}else o.removeClass('cke_inline_label');o.setHtml(typeof n!='undefined'?n:m);}},getValue:function(){return this._.value||'';},unmarkAll:function(){this._.list.unmarkAll();},mark:function(m){this._.list.mark(m);},hideItem:function(m){this._.list.hideItem(m);},hideGroup:function(m){this._.list.hideGroup(m);},showAll:function(){this._.list.showAll();},add:function(m,n,o){this._.items[m]=o||m;this._.list.add(m,n,o);},startGroup:function(m){this._.list.startGroup(m);
|
|
||||||
},commit:function(){var m=this;if(!m._.committed){m._.list.commit();m._.committed=1;k.fire('ready',m);}m._.committed=1;},setState:function(m){var n=this;if(n._.state==m)return;n.document.getById('cke_'+n.id).setState(m);n._.state=m;}}});k.prototype.addRichCombo=function(m,n){this.add(m,'richcombo',n);};j.add('htmlwriter');a.htmlWriter=e.createClass({base:a.htmlParser.basicWriter,$:function(){var o=this;o.base();o.indentationChars='\t';o.selfClosingEnd=' />';o.lineBreakChars='\n';o.forceSimpleAmpersand=0;o.sortAttributes=1;o._.indent=0;o._.indentation='';o._.inPre=0;o._.rules={};var m=f;for(var n in e.extend({},m.$nonBodyContent,m.$block,m.$listItem,m.$tableContent))o.setRules(n,{indent:1,breakBeforeOpen:1,breakAfterOpen:1,breakBeforeClose:!m[n]['#'],breakAfterClose:1});o.setRules('br',{breakAfterOpen:1});o.setRules('title',{indent:0,breakAfterOpen:0});o.setRules('style',{indent:0,breakBeforeClose:1});o.setRules('pre',{indent:0});},proto:{openTag:function(m,n){var p=this;var o=p._.rules[m];if(p._.indent)p.indentation();else if(o&&o.breakBeforeOpen){p.lineBreak();p.indentation();}p._.output.push('<',m);},openTagClose:function(m,n){var p=this;var o=p._.rules[m];if(n)p._.output.push(p.selfClosingEnd);else{p._.output.push('>');if(o&&o.indent)p._.indentation+=p.indentationChars;}if(o&&o.breakAfterOpen)p.lineBreak();m=='pre'&&(p._.inPre=1);},attribute:function(m,n){if(typeof n=='string'){this.forceSimpleAmpersand&&(n=n.replace(/&/g,'&'));n=e.htmlEncodeAttr(n);}this._.output.push(' ',m,'="',n,'"');},closeTag:function(m){var o=this;var n=o._.rules[m];if(n&&n.indent)o._.indentation=o._.indentation.substr(o.indentationChars.length);if(o._.indent)o.indentation();else if(n&&n.breakBeforeClose){o.lineBreak();o.indentation();}o._.output.push('</',m,'>');m=='pre'&&(o._.inPre=0);if(n&&n.breakAfterClose)o.lineBreak();},text:function(m){var n=this;if(n._.indent){n.indentation();!n._.inPre&&(m=e.ltrim(m));}n._.output.push(m);},comment:function(m){if(this._.indent)this.indentation();this._.output.push('<!--',m,'-->');},lineBreak:function(){var m=this;if(!m._.inPre&&m._.output.length>0)m._.output.push(m.lineBreakChars);m._.indent=1;},indentation:function(){var m=this;if(!m._.inPre)m._.output.push(m._.indentation);m._.indent=0;},setRules:function(m,n){var o=this._.rules[m];if(o)e.extend(o,n,true);else this._.rules[m]=n;}}});j.add('menubutton',{requires:['button','menu'],beforeInit:function(m){m.ui.addHandler('menubutton',k.menuButton.handler);}});a.UI_MENUBUTTON='menubutton';
|
|
||||||
(function(){var m=function(n){var o=this._;if(o.state===0)return;o.previousState=o.state;var p=o.menu;if(!p){p=o.menu=new a.menu(n,{panel:{className:n.skinClass+' cke_contextmenu',attributes:{'aria-label':n.lang.common.options}}});p.onHide=e.bind(function(){this.setState(this.modes&&this.modes[n.mode]?o.previousState:0);},this);if(this.onMenu)p.addListener(this.onMenu);}if(o.on){p.hide();return;}this.setState(1);p.show(a.document.getById(this._.id),4);};k.menuButton=e.createClass({base:k.button,$:function(n){var o=n.panel;delete n.panel;this.base(n);this.hasArrow=true;this.click=m;},statics:{handler:{create:function(n){return new k.menuButton(n);}}}});})();j.add('dialogui');(function(){var m=function(u){var x=this;x._||(x._={});x._['default']=x._.initValue=u['default']||'';x._.required=u.required||false;var v=[x._];for(var w=1;w<arguments.length;w++)v.push(arguments[w]);v.push(true);e.extend.apply(e,v);return x._;},n={build:function(u,v,w){return new k.dialog.textInput(u,v,w);}},o={build:function(u,v,w){return new k.dialog[v.type](u,v,w);}},p={build:function(u,v,w){var x=v.children,y,z=[],A=[];for(var B=0;B<x.length&&(y=x[B]);B++){var C=[];z.push(C);A.push(a.dialog._.uiElementBuilders[y.type].build(u,y,C));}return new k.dialog[v.type](u,A,z,w,v);}},q={isChanged:function(){return this.getValue()!=this.getInitValue();},reset:function(u){this.setValue(this.getInitValue(),u);},setInitValue:function(){this._.initValue=this.getValue();},resetInitValue:function(){this._.initValue=this._['default'];},getInitValue:function(){return this._.initValue;}},r=e.extend({},k.dialog.uiElement.prototype.eventProcessors,{onChange:function(u,v){if(!this._.domOnChangeRegistered){u.on('load',function(){this.getInputElement().on('change',function(){if(!u.parts.dialog.isVisible())return;this.fire('change',{value:this.getValue()});},this);},this);this._.domOnChangeRegistered=true;}this.on('change',v);}},true),s=/^on([A-Z]\w+)/,t=function(u){for(var v in u){if(s.test(v)||v=='title'||v=='type')delete u[v];}return u;};e.extend(k.dialog,{labeledElement:function(u,v,w,x){if(arguments.length<4)return;var y=m.call(this,v);y.labelId=e.getNextId()+'_label';var z=this._.children=[],A=function(){var B=[],C=v.required?' cke_required':'';if(v.labelLayout!='horizontal')B.push('<label class="cke_dialog_ui_labeled_label'+C+'" ',' id="'+y.labelId+'"',y.inputId?' for="'+y.inputId+'"':'',(v.labelStyle?' style="'+v.labelStyle+'"':'')+'>',v.label,'</label>','<div class="cke_dialog_ui_labeled_content"'+(v.controlStyle?' style="'+v.controlStyle+'"':'')+' role="presentation">',x.call(this,u,v),'</div>');
|
|
||||||
else{var D={type:'hbox',widths:v.widths,padding:0,children:[{type:'html',html:'<label class="cke_dialog_ui_labeled_label'+C+'"'+' id="'+y.labelId+'"'+' for="'+y.inputId+'"'+(v.labelStyle?' style="'+v.labelStyle+'"':'')+'>'+e.htmlEncode(v.label)+'</span>'},{type:'html',html:'<span class="cke_dialog_ui_labeled_content"'+(v.controlStyle?' style="'+v.controlStyle+'"':'')+'>'+x.call(this,u,v)+'</span>'}]};a.dialog._.uiElementBuilders.hbox.build(u,D,B);}return B.join('');};k.dialog.uiElement.call(this,u,v,w,'div',null,{role:'presentation'},A);},textInput:function(u,v,w){if(arguments.length<3)return;m.call(this,v);var x=this._.inputId=e.getNextId()+'_textInput',y={'class':'cke_dialog_ui_input_'+v.type,id:x,type:v.type},z;if(v.validate)this.validate=v.validate;if(v.maxLength)y.maxlength=v.maxLength;if(v.size)y.size=v.size;if(v.inputStyle)y.style=v.inputStyle;var A=function(){var B=['<div class="cke_dialog_ui_input_',v.type,'" role="presentation"'];if(v.width)B.push('style="width:'+v.width+'" ');B.push('><input ');y['aria-labelledby']=this._.labelId;this._.required&&(y['aria-required']=this._.required);for(var C in y)B.push(C+'="'+y[C]+'" ');B.push(' /></div>');return B.join('');};k.dialog.labeledElement.call(this,u,v,w,A);},textarea:function(u,v,w){if(arguments.length<3)return;m.call(this,v);var x=this,y=this._.inputId=e.getNextId()+'_textarea',z={};if(v.validate)this.validate=v.validate;z.rows=v.rows||5;z.cols=v.cols||20;if(typeof v.inputStyle!='undefined')z.style=v.inputStyle;var A=function(){z['aria-labelledby']=this._.labelId;this._.required&&(z['aria-required']=this._.required);var B=['<div class="cke_dialog_ui_input_textarea" role="presentation"><textarea class="cke_dialog_ui_input_textarea" id="',y,'" '];for(var C in z)B.push(C+'="'+e.htmlEncode(z[C])+'" ');B.push('>',e.htmlEncode(x._['default']),'</textarea></div>');return B.join('');};k.dialog.labeledElement.call(this,u,v,w,A);},checkbox:function(u,v,w){if(arguments.length<3)return;var x=m.call(this,v,{'default':!!v['default']});if(v.validate)this.validate=v.validate;var y=function(){var z=e.extend({},v,{id:v.id?v.id+'_checkbox':e.getNextId()+'_checkbox'},true),A=[],B=e.getNextId()+'_label',C={'class':'cke_dialog_ui_checkbox_input',type:'checkbox','aria-labelledby':B};t(z);if(v['default'])C.checked='checked';if(typeof z.inputStyle!='undefined')z.style=z.inputStyle;x.checkbox=new k.dialog.uiElement(u,z,A,'input',null,C);A.push(' <label id="',B,'" for="',C.id,'"'+(v.labelStyle?' style="'+v.labelStyle+'"':'')+'>',e.htmlEncode(v.label),'</label>');
|
|
||||||
return A.join('');};k.dialog.uiElement.call(this,u,v,w,'span',null,null,y);},radio:function(u,v,w){if(arguments.length<3)return;m.call(this,v);if(!this._['default'])this._['default']=this._.initValue=v.items[0][1];if(v.validate)this.validate=v.valdiate;var x=[],y=this,z=function(){var A=[],B=[],C={'class':'cke_dialog_ui_radio_item','aria-labelledby':this._.labelId},D=v.id?v.id+'_radio':e.getNextId()+'_radio';for(var E=0;E<v.items.length;E++){var F=v.items[E],G=F[2]!==undefined?F[2]:F[0],H=F[1]!==undefined?F[1]:F[0],I=e.getNextId()+'_radio_input',J=I+'_label',K=e.extend({},v,{id:I,title:null,type:null},true),L=e.extend({},K,{title:G},true),M={type:'radio','class':'cke_dialog_ui_radio_input',name:D,value:H,'aria-labelledby':J},N=[];if(y._['default']==H)M.checked='checked';t(K);t(L);if(typeof K.inputStyle!='undefined')K.style=K.inputStyle;x.push(new k.dialog.uiElement(u,K,N,'input',null,M));N.push(' ');new k.dialog.uiElement(u,L,N,'label',null,{id:J,'for':M.id},F[0]);A.push(N.join(''));}new k.dialog.hbox(u,x,A,B);return B.join('');};k.dialog.labeledElement.call(this,u,v,w,z);this._.children=x;},button:function(u,v,w){if(!arguments.length)return;if(typeof v=='function')v=v(u.getParentEditor());m.call(this,v,{disabled:v.disabled||false});a.event.implementOn(this);var x=this;u.on('load',function(A){var B=this.getElement();(function(){B.on('click',function(C){x.fire('click',{dialog:x.getDialog()});C.data.preventDefault();});B.on('keydown',function(C){if(C.data.getKeystroke() in {32:1}){x.click();C.data.preventDefault();}});})();B.unselectable();},this);var y=e.extend({},v);delete y.style;var z=e.getNextId()+'_label';k.dialog.uiElement.call(this,u,y,w,'a',null,{style:v.style,href:'javascript:void(0)',title:v.label,hidefocus:'true','class':v['class'],role:'button','aria-labelledby':z},'<span id="'+z+'" class="cke_dialog_ui_button">'+e.htmlEncode(v.label)+'</span>');},select:function(u,v,w){if(arguments.length<3)return;var x=m.call(this,v);if(v.validate)this.validate=v.validate;x.inputId=e.getNextId()+'_select';var y=function(){var z=e.extend({},v,{id:v.id?v.id+'_select':e.getNextId()+'_select'},true),A=[],B=[],C={id:x.inputId,'class':'cke_dialog_ui_input_select','aria-labelledby':this._.labelId};if(v.size!=undefined)C.size=v.size;if(v.multiple!=undefined)C.multiple=v.multiple;t(z);for(var D=0,E;D<v.items.length&&(E=v.items[D]);D++)B.push('<option value="',e.htmlEncode(E[1]!==undefined?E[1]:E[0]).replace(/"/g,'"'),'" /> ',e.htmlEncode(E[0]));if(typeof z.inputStyle!='undefined')z.style=z.inputStyle;
|
|
||||||
x.select=new k.dialog.uiElement(u,z,A,'select',null,C,B.join(''));return A.join('');};k.dialog.labeledElement.call(this,u,v,w,y);},file:function(u,v,w){if(arguments.length<3)return;if(v['default']===undefined)v['default']='';var x=e.extend(m.call(this,v),{definition:v,buttons:[]});if(v.validate)this.validate=v.validate;var y=function(){x.frameId=e.getNextId()+'_fileInput';var z=b.isCustomDomain(),A=['<iframe frameborder="0" allowtransparency="0" class="cke_dialog_ui_input_file" role="presentation" id="',x.frameId,'" title="',v.label,'" src="javascript:void('];A.push(z?"(function(){document.open();document.domain='"+document.domain+"';"+'document.close();'+'})()':'0');A.push(')"></iframe>');return A.join('');};u.on('load',function(){var z=a.document.getById(x.frameId),A=z.getParent();A.addClass('cke_dialog_ui_input_file');});k.dialog.labeledElement.call(this,u,v,w,y);},fileButton:function(u,v,w){if(arguments.length<3)return;var x=m.call(this,v),y=this;if(v.validate)this.validate=v.validate;var z=e.extend({},v),A=z.onClick;z.className=(z.className?z.className+' ':'')+'cke_dialog_ui_button';z.onClick=function(B){var C=v['for'];if(!A||A.call(this,B)!==false){u.getContentElement(C[0],C[1]).submit();this.disable();}};u.on('load',function(){u.getContentElement(v['for'][0],v['for'][1])._.buttons.push(y);});k.dialog.button.call(this,u,z,w);},html:(function(){var u=/^\s*<[\w:]+\s+([^>]*)?>/,v=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,w=/\/$/;return function(x,y,z){if(arguments.length<3)return;var A=[],B,C=y.html,D,E;if(C.charAt(0)!='<')C='<span>'+C+'</span>';var F=y.focus;if(F){var G=this.focus;this.focus=function(){G.call(this);typeof F=='function'&&F.call(this);this.fire('focus');};if(y.isFocusable){var H=this.isFocusable;this.isFocusable=H;}this.keyboardFocusable=true;}k.dialog.uiElement.call(this,x,y,A,'span',null,null,'');B=A.join('');D=B.match(u);E=C.match(v)||['','',''];if(w.test(E[1])){E[1]=E[1].slice(0,-1);E[2]='/'+E[2];}z.push([E[1],' ',D[1]||'',E[2]].join(''));};})(),fieldset:function(u,v,w,x,y){var z=y.label,A=function(){var B=[];z&&B.push('<legend'+(y.labelStyle?' style="'+y.labelStyle+'"':'')+'>'+z+'</legend>');for(var C=0;C<w.length;C++)B.push(w[C]);return B.join('');};this._={children:v};k.dialog.uiElement.call(this,u,y,x,'fieldset',null,null,A);}},true);k.dialog.html.prototype=new k.dialog.uiElement();k.dialog.labeledElement.prototype=e.extend(new k.dialog.uiElement(),{setLabel:function(u){var v=a.document.getById(this._.labelId);if(v.getChildCount()<1)new d.text(u,a.document).appendTo(v);
|
|
||||||
else v.getChild(0).$.nodeValue=u;return this;},getLabel:function(){var u=a.document.getById(this._.labelId);if(!u||u.getChildCount()<1)return '';else return u.getChild(0).getText();},eventProcessors:r},true);k.dialog.button.prototype=e.extend(new k.dialog.uiElement(),{click:function(){var u=this;if(!u._.disabled)return u.fire('click',{dialog:u._.dialog});u.getElement().$.blur();return false;},enable:function(){this._.disabled=false;var u=this.getElement();u&&u.removeClass('cke_disabled');},disable:function(){this._.disabled=true;this.getElement().addClass('cke_disabled');},isVisible:function(){return this.getElement().getFirst().isVisible();},isEnabled:function(){return!this._.disabled;},eventProcessors:e.extend({},k.dialog.uiElement.prototype.eventProcessors,{onClick:function(u,v){this.on('click',function(){this.getElement().focus();v.apply(this,arguments);});}},true),accessKeyUp:function(){this.click();},accessKeyDown:function(){this.focus();},keyboardFocusable:true},true);k.dialog.textInput.prototype=e.extend(new k.dialog.labeledElement(),{getInputElement:function(){return a.document.getById(this._.inputId);},focus:function(){var u=this.selectParentTab();setTimeout(function(){var v=u.getInputElement();v&&v.$.focus();},0);},select:function(){var u=this.selectParentTab();setTimeout(function(){var v=u.getInputElement();if(v){v.$.focus();v.$.select();}},0);},accessKeyUp:function(){this.select();},setValue:function(u){!u&&(u='');return k.dialog.uiElement.prototype.setValue.apply(this,arguments);},keyboardFocusable:true},q,true);k.dialog.textarea.prototype=new k.dialog.textInput();k.dialog.select.prototype=e.extend(new k.dialog.labeledElement(),{getInputElement:function(){return this._.select.getElement();},add:function(u,v,w){var x=new h('option',this.getDialog().getParentEditor().document),y=this.getInputElement().$;x.$.text=u;x.$.value=v===undefined||v===null?u:v;if(w===undefined||w===null){if(c)y.add(x.$);else y.add(x.$,null);}else y.add(x.$,w);return this;},remove:function(u){var v=this.getInputElement().$;v.remove(u);return this;},clear:function(){var u=this.getInputElement().$;while(u.length>0)u.remove(0);return this;},keyboardFocusable:true},q,true);k.dialog.checkbox.prototype=e.extend(new k.dialog.uiElement(),{getInputElement:function(){return this._.checkbox.getElement();},setValue:function(u,v){this.getInputElement().$.checked=u;!v&&this.fire('change',{value:u});},getValue:function(){return this.getInputElement().$.checked;},accessKeyUp:function(){this.setValue(!this.getValue());
|
|
||||||
},eventProcessors:{onChange:function(u,v){if(!c||b.version>8)return r.onChange.apply(this,arguments);else{u.on('load',function(){var w=this._.checkbox.getElement();w.on('propertychange',function(x){x=x.data.$;if(x.propertyName=='checked')this.fire('change',{value:w.$.checked});},this);},this);this.on('change',v);}return null;}},keyboardFocusable:true},q,true);k.dialog.radio.prototype=e.extend(new k.dialog.uiElement(),{setValue:function(u,v){var w=this._.children,x;for(var y=0;y<w.length&&(x=w[y]);y++)x.getElement().$.checked=x.getValue()==u;!v&&this.fire('change',{value:u});},getValue:function(){var u=this._.children;for(var v=0;v<u.length;v++){if(u[v].getElement().$.checked)return u[v].getValue();}return null;},accessKeyUp:function(){var u=this._.children,v;for(v=0;v<u.length;v++){if(u[v].getElement().$.checked){u[v].getElement().focus();return;}}u[0].getElement().focus();},eventProcessors:{onChange:function(u,v){if(!c)return r.onChange.apply(this,arguments);else{u.on('load',function(){var w=this._.children,x=this;for(var y=0;y<w.length;y++){var z=w[y].getElement();z.on('propertychange',function(A){A=A.data.$;if(A.propertyName=='checked'&&this.$.checked)x.fire('change',{value:this.getAttribute('value')});});}},this);this.on('change',v);}return null;}},keyboardFocusable:true},q,true);k.dialog.file.prototype=e.extend(new k.dialog.labeledElement(),q,{getInputElement:function(){var u=a.document.getById(this._.frameId).getFrameDocument();return u.$.forms.length>0?new h(u.$.forms[0].elements[0]):this.getElement();},submit:function(){this.getInputElement().getParent().$.submit();return this;},getAction:function(){return this.getInputElement().getParent().$.action;},registerEvents:function(u){var v=/^on([A-Z]\w+)/,w,x=function(z,A,B,C){z.on('formLoaded',function(){z.getInputElement().on(B,C,z);});};for(var y in u){if(!(w=y.match(v)))continue;if(this.eventProcessors[y])this.eventProcessors[y].call(this,this._.dialog,u[y]);else x(this,this._.dialog,w[1].toLowerCase(),u[y]);}return this;},reset:function(){var u=this._,v=a.document.getById(u.frameId),w=v.getFrameDocument(),x=u.definition,y=u.buttons,z=this.formLoadedNumber,A=this.formUnloadNumber,B=u.dialog._.editor.lang.dir,C=u.dialog._.editor.langCode;if(!z){z=this.formLoadedNumber=e.addFunction(function(){this.fire('formLoaded');},this);A=this.formUnloadNumber=e.addFunction(function(){this.getInputElement().clearCustomData();},this);this.getDialog()._.editor.on('destroy',function(){e.removeFunction(z);e.removeFunction(A);
|
|
||||||
});}function D(){w.$.open();if(b.isCustomDomain())w.$.domain=document.domain;var E='';if(x.size)E=x.size-(c?7:0);var F=u.frameId+'_input';w.$.write(['<html dir="'+B+'" lang="'+C+'"><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">','<form enctype="multipart/form-data" method="POST" dir="'+B+'" lang="'+C+'" action="',e.htmlEncode(x.action),'">','<label id="',u.labelId,'" for="',F,'" style="display:none">',e.htmlEncode(x.label),'</label>','<input id="',F,'" aria-labelledby="',u.labelId,'" type="file" name="',e.htmlEncode(x.id||'cke_upload'),'" size="',e.htmlEncode(E>0?E:''),'" />','</form>','</body></html>','<script>window.parent.CKEDITOR.tools.callFunction('+z+');','window.onbeforeunload = function() {window.parent.CKEDITOR.tools.callFunction('+A+')}</script>'].join(''));w.$.close();for(var G=0;G<y.length;G++)y[G].enable();};if(b.gecko)setTimeout(D,500);else D();},getValue:function(){return this.getInputElement().$.value||'';},setInitValue:function(){this._.initValue='';},eventProcessors:{onChange:function(u,v){if(!this._.domOnChangeRegistered){this.on('formLoaded',function(){this.getInputElement().on('change',function(){this.fire('change',{value:this.getValue()});},this);},this);this._.domOnChangeRegistered=true;}this.on('change',v);}},keyboardFocusable:true},true);k.dialog.fileButton.prototype=new k.dialog.button();k.dialog.fieldset.prototype=e.clone(k.dialog.hbox.prototype);a.dialog.addUIElement('text',n);a.dialog.addUIElement('password',n);a.dialog.addUIElement('textarea',o);a.dialog.addUIElement('checkbox',o);a.dialog.addUIElement('radio',o);a.dialog.addUIElement('button',o);a.dialog.addUIElement('select',o);a.dialog.addUIElement('file',o);a.dialog.addUIElement('fileButton',o);a.dialog.addUIElement('html',o);a.dialog.addUIElement('fieldset',p);})();j.add('panel',{beforeInit:function(m){m.ui.addHandler('panel',k.panel.handler);}});a.UI_PANEL='panel';k.panel=function(m,n){var o=this;if(n)e.extend(o,n);e.extend(o,{className:'',css:[]});o.id=e.getNextId();o.document=m;o._={blocks:{}};};k.panel.handler={create:function(m){return new k.panel(m);}};k.panel.prototype={renderHtml:function(m){var n=[];this.render(m,n);return n.join('');},render:function(m,n){var p=this;var o=p.id;n.push('<div class="',m.skinClass,'" lang="',m.langCode,'" role="presentation" style="display:none;z-index:'+(m.config.baseFloatZIndex+1)+'">'+'<div'+' id=',o,' dir=',m.lang.dir,' role="presentation" class="cke_panel cke_',m.lang.dir);if(p.className)n.push(' ',p.className);
|
|
||||||
n.push('">');if(p.forceIFrame||p.css.length){n.push('<iframe id="',o,'_frame" frameborder="0" role="application" src="javascript:void(');n.push(b.isCustomDomain()?"(function(){document.open();document.domain='"+document.domain+"';"+'document.close();'+'})()':'0');n.push(')"></iframe>');}n.push('</div></div>');return o;},getHolderElement:function(){var m=this._.holder;if(!m){if(this.forceIFrame||this.css.length){var n=this.document.getById(this.id+'_frame'),o=n.getParent(),p=o.getAttribute('dir'),q=o.getParent().getAttribute('class'),r=o.getParent().getAttribute('lang'),s=n.getFrameDocument();b.iOS&&o.setStyles({overflow:'scroll','-webkit-overflow-scrolling':'touch'});var t=e.addFunction(e.bind(function(w){this.isLoaded=true;if(this.onLoad)this.onLoad();},this)),u='<!DOCTYPE html><html dir="'+p+'" class="'+q+'_container" lang="'+r+'">'+'<head>'+'<style>.'+q+'_container{visibility:hidden}</style>'+e.buildStyleHtml(this.css)+'</head>'+'<body class="cke_'+p+' cke_panel_frame '+b.cssClass+'" style="margin:0;padding:0"'+' onload="( window.CKEDITOR || window.parent.CKEDITOR ).tools.callFunction('+t+');"></body>'+'</html>';s.write(u);var v=s.getWindow();v.$.CKEDITOR=a;s.on('key'+(b.opera?'press':'down'),function(w){var z=this;var x=w.data.getKeystroke(),y=z.document.getById(z.id).getAttribute('dir');if(z._.onKeyDown&&z._.onKeyDown(x)===false){w.data.preventDefault();return;}if(x==27||x==(y=='rtl'?39:37))if(z.onEscape&&z.onEscape(x)===false)w.data.preventDefault();},this);m=s.getBody();m.unselectable();b.air&&e.callFunction(t);}else m=this.document.getById(this.id);this._.holder=m;}return m;},addBlock:function(m,n){var o=this;n=o._.blocks[m]=n instanceof k.panel.block?n:new k.panel.block(o.getHolderElement(),n);if(!o._.currentBlock)o.showBlock(m);return n;},getBlock:function(m){return this._.blocks[m];},showBlock:function(m){var r=this;var n=r._.blocks,o=n[m],p=r._.currentBlock,q=!r.forceIFrame||c?r._.holder:r.document.getById(r.id+'_frame');if(p){q.removeAttributes(p.attributes);p.hide();}r._.currentBlock=o;q.setAttributes(o.attributes);a.fire('ariaWidget',q);o._.focusIndex=-1;r._.onKeyDown=o.onKeyDown&&e.bind(o.onKeyDown,o);o.show();return o;},destroy:function(){this.element&&this.element.remove();}};k.panel.block=e.createClass({$:function(m,n){var o=this;o.element=m.append(m.getDocument().createElement('div',{attributes:{tabIndex:-1,'class':'cke_panel_block',role:'presentation'},styles:{display:'none'}}));if(n)e.extend(o,n);if(!o.attributes.title)o.attributes.title=o.attributes['aria-label'];
|
|
||||||
o.keys={};o._.focusIndex=-1;o.element.disableContextMenu();},_:{markItem:function(m){var p=this;if(m==-1)return;var n=p.element.getElementsByTag('a'),o=n.getItem(p._.focusIndex=m);if(b.webkit||b.opera)o.getDocument().getWindow().focus();o.focus();p.onMark&&p.onMark(o);}},proto:{show:function(){this.element.setStyle('display','');},hide:function(){var m=this;if(!m.onHide||m.onHide.call(m)!==true)m.element.setStyle('display','none');},onKeyDown:function(m){var r=this;var n=r.keys[m];switch(n){case 'next':var o=r._.focusIndex,p=r.element.getElementsByTag('a'),q;while(q=p.getItem(++o)){if(q.getAttribute('_cke_focus')&&q.$.offsetWidth){r._.focusIndex=o;q.focus();break;}}return false;case 'prev':o=r._.focusIndex;p=r.element.getElementsByTag('a');while(o>0&&(q=p.getItem(--o))){if(q.getAttribute('_cke_focus')&&q.$.offsetWidth){r._.focusIndex=o;q.focus();break;}}return false;case 'click':case 'mouseup':o=r._.focusIndex;q=o>=0&&r.element.getElementsByTag('a').getItem(o);if(q)q.$[n]?q.$[n]():q.$['on'+n]();return false;}return true;}}});j.add('listblock',{requires:['panel'],onLoad:function(){k.panel.prototype.addListBlock=function(m,n){return this.addBlock(m,new k.listBlock(this.getHolderElement(),n));};k.listBlock=e.createClass({base:k.panel.block,$:function(m,n){var q=this;n=n||{};var o=n.attributes||(n.attributes={});(q.multiSelect=!!n.multiSelect)&&(o['aria-multiselectable']=true);!o.role&&(o.role='listbox');q.base.apply(q,arguments);var p=q.keys;p[40]='next';p[9]='next';p[38]='prev';p[2228224+9]='prev';p[32]=c?'mouseup':'click';c&&(p[13]='mouseup');q._.pendingHtml=[];q._.items={};q._.groups={};},_:{close:function(){if(this._.started){this._.pendingHtml.push('</ul>');delete this._.started;}},getClick:function(){if(!this._.click)this._.click=e.addFunction(function(m){var o=this;var n=true;if(o.multiSelect)n=o.toggle(m);else o.mark(m);if(o.onClick)o.onClick(m,n);},this);return this._.click;}},proto:{add:function(m,n,o){var r=this;var p=r._.pendingHtml,q=e.getNextId();if(!r._.started){p.push('<ul role="presentation" class=cke_panel_list>');r._.started=1;r._.size=r._.size||0;}r._.items[m]=q;p.push('<li id=',q,' class=cke_panel_listItem role=presentation><a id="',q,'_option" _cke_focus=1 hidefocus=true title="',o||m,'" href="javascript:void(\'',m,"')\" "+(c?'onclick="return false;" onmouseup':'onclick')+'="CKEDITOR.tools.callFunction(',r._.getClick(),",'",m,"'); return false;\"",' role="option">',n||m,'</a></li>');},startGroup:function(m){this._.close();var n=e.getNextId();
|
|
||||||
this._.groups[m]=n;this._.pendingHtml.push('<h1 role="presentation" id=',n,' class=cke_panel_grouptitle>',m,'</h1>');},commit:function(){var m=this;m._.close();m.element.appendHtml(m._.pendingHtml.join(''));delete m._.size;m._.pendingHtml=[];},toggle:function(m){var n=this.isMarked(m);if(n)this.unmark(m);else this.mark(m);return!n;},hideGroup:function(m){var n=this.element.getDocument().getById(this._.groups[m]),o=n&&n.getNext();if(n){n.setStyle('display','none');if(o&&o.getName()=='ul')o.setStyle('display','none');}},hideItem:function(m){this.element.getDocument().getById(this._.items[m]).setStyle('display','none');},showAll:function(){var m=this._.items,n=this._.groups,o=this.element.getDocument();for(var p in m)o.getById(m[p]).setStyle('display','');for(var q in n){var r=o.getById(n[q]),s=r.getNext();r.setStyle('display','');if(s&&s.getName()=='ul')s.setStyle('display','');}},mark:function(m){var p=this;if(!p.multiSelect)p.unmarkAll();var n=p._.items[m],o=p.element.getDocument().getById(n);o.addClass('cke_selected');p.element.getDocument().getById(n+'_option').setAttribute('aria-selected',true);p.onMark&&p.onMark(o);},unmark:function(m){var q=this;var n=q.element.getDocument(),o=q._.items[m],p=n.getById(o);p.removeClass('cke_selected');n.getById(o+'_option').removeAttribute('aria-selected');q.onUnmark&&q.onUnmark(p);},unmarkAll:function(){var q=this;var m=q._.items,n=q.element.getDocument();for(var o in m){var p=m[o];n.getById(p).removeClass('cke_selected');n.getById(p+'_option').removeAttribute('aria-selected');}q.onUnmark&&q.onUnmark();},isMarked:function(m){return this.element.getDocument().getById(this._.items[m]).hasClass('cke_selected');},focus:function(m){this._.focusIndex=-1;if(m){var n=this.element.getDocument().getById(this._.items[m]).getFirst(),o=this.element.getElementsByTag('a'),p,q=-1;while(p=o.getItem(++q)){if(p.equals(n)){this._.focusIndex=q;break;}}setTimeout(function(){n.focus();},0);}}}});}});a.themes.add('default',(function(){var m={};function n(o,p){var q,r;r=o.config.sharedSpaces;r=r&&r[p];r=r&&a.document.getById(r);if(r){var s='<span class="cke_shared " dir="'+o.lang.dir+'"'+'>'+'<span class="'+o.skinClass+' '+o.id+' cke_editor_'+o.name+'">'+'<span class="'+b.cssClass+'">'+'<span class="cke_wrapper cke_'+o.lang.dir+'">'+'<span class="cke_editor">'+'<div class="cke_'+p+'">'+'</div></span></span></span></span></span>',t=r.append(h.createFromHtml(s,r.getDocument()));if(r.getCustomData('cke_hasshared'))t.hide();else r.setCustomData('cke_hasshared',1);
|
|
||||||
q=t.getChild([0,0,0,0]);!o.sharedSpaces&&(o.sharedSpaces={});o.sharedSpaces[p]=q;o.on('focus',function(){for(var u=0,v,w=r.getChildren();v=w.getItem(u);u++){if(v.type==1&&!v.equals(t)&&v.hasClass('cke_shared'))v.hide();}t.show();});o.on('destroy',function(){t.remove();});}return q;};return{build:function(o,p){var q=o.name,r=o.element,s=o.elementMode;if(!r||s==0)return;if(s==1)r.hide();var t=o.fire('themeSpace',{space:'top',html:''}).html,u=o.fire('themeSpace',{space:'contents',html:''}).html,v=o.fireOnce('themeSpace',{space:'bottom',html:''}).html,w=u&&o.config.height,x=o.config.tabIndex||o.element.getAttribute('tabindex')||0;if(!u)w='auto';else if(!isNaN(w))w+='px';var y='',z=o.config.width;if(z){if(!isNaN(z))z+='px';y+='width: '+z+';';}var A=t&&n(o,'top'),B=n(o,'bottom');A&&(A.setHtml(t),t='');B&&(B.setHtml(v),v='');var C='<style>.'+o.skinClass+'{visibility:hidden;}</style>';if(m[o.skinClass])C='';else m[o.skinClass]=1;var D=h.createFromHtml(['<span id="cke_',q,'" class="',o.skinClass,' ',o.id,' cke_editor_',q,'" dir="',o.lang.dir,'" title="',b.gecko?' ':'','" lang="',o.langCode,'"'+(b.webkit?' tabindex="'+x+'"':'')+' role="application"'+' aria-labelledby="cke_',q,'_arialbl"'+(y?' style="'+y+'"':'')+'>'+'<span id="cke_',q,'_arialbl" class="cke_voice_label">'+o.lang.editor+'</span>'+'<span class="',b.cssClass,'" role="presentation"><span class="cke_wrapper cke_',o.lang.dir,'" role="presentation"><table class="cke_editor" border="0" cellspacing="0" cellpadding="0" role="presentation"><tbody><tr',t?'':' style="display:none"',' role="presentation"><td id="cke_top_',q,'" class="cke_top" role="presentation">',t,'</td></tr><tr',u?'':' style="display:none"',' role="presentation"><td id="cke_contents_',q,'" class="cke_contents" style="height:',w,'" role="presentation">',u,'</td></tr><tr',v?'':' style="display:none"',' role="presentation"><td id="cke_bottom_',q,'" class="cke_bottom" role="presentation">',v,'</td></tr></tbody></table>'+C+'</span>'+'</span>'+'</span>'].join(''));D.getChild([1,0,0,0,0]).unselectable();D.getChild([1,0,0,0,2]).unselectable();if(s==1)D.insertAfter(r);else r.append(D);o.container=D;D.disableContextMenu();o.on('contentDirChanged',function(E){var F=(o.lang.dir!=E.data?'add':'remove')+'Class';D.getChild(1)[F]('cke_mixed_dir_content');var G=this.sharedSpaces&&this.sharedSpaces[this.config.toolbarLocation];G&&G.getParent().getParent()[F]('cke_mixed_dir_content');});o.fireOnce('themeLoaded');o.fireOnce('uiReady');},buildDialog:function(o){var p=e.getNextNumber(),q=h.createFromHtml(['<div class="',o.id,'_dialog cke_editor_',o.name.replace('.','\\.'),'_dialog cke_skin_',o.skinName,'" dir="',o.lang.dir,'" lang="',o.langCode,'" role="dialog" aria-labelledby="%title#"><table class="cke_dialog',' '+b.cssClass,' cke_',o.lang.dir,'" style="position:absolute" role="presentation"><tr><td role="presentation"><div class="%body" role="presentation"><div id="%title#" class="%title" role="presentation"></div><a id="%close_button#" class="%close_button" href="javascript:void(0)" title="'+o.lang.common.close+'" role="button"><span class="cke_label">X</span></a>'+'<div id="%tabs#" class="%tabs" role="tablist"></div>'+'<table class="%contents" role="presentation">'+'<tr>'+'<td id="%contents#" class="%contents" role="presentation"></td>'+'</tr>'+'<tr>'+'<td id="%footer#" class="%footer" role="presentation"></td>'+'</tr>'+'</table>'+'</div>'+'<div id="%tl#" class="%tl"></div>'+'<div id="%tc#" class="%tc"></div>'+'<div id="%tr#" class="%tr"></div>'+'<div id="%ml#" class="%ml"></div>'+'<div id="%mr#" class="%mr"></div>'+'<div id="%bl#" class="%bl"></div>'+'<div id="%bc#" class="%bc"></div>'+'<div id="%br#" class="%br"></div>'+'</td></tr>'+'</table>',c?'':'<style>.cke_dialog{visibility:hidden;}</style>','</div>'].join('').replace(/#/g,'_'+p).replace(/%/g,'cke_dialog_')),r=q.getChild([0,0,0,0,0]),s=r.getChild(0),t=r.getChild(1);
|
|
||||||
if(c&&!b.ie6Compat){var u=b.isCustomDomain(),v='javascript:void(function(){'+encodeURIComponent('document.open();'+(u?'document.domain="'+document.domain+'";':'')+'document.close();')+'}())',w=h.createFromHtml('<iframe frameBorder="0" class="cke_iframe_shim" src="'+v+'"'+' tabIndex="-1"'+'></iframe>');w.appendTo(r.getParent());}s.unselectable();t.unselectable();return{element:q,parts:{dialog:q.getChild(0),title:s,close:t,tabs:r.getChild(2),contents:r.getChild([3,0,0,0]),footer:r.getChild([3,0,1,0])}};},destroy:function(o){var p=o.container,q=o.element;if(p){p.clearCustomData();p.remove();}if(q){q.clearCustomData();o.elementMode==1&&q.show();delete o.element;}}};})());a.editor.prototype.getThemeSpace=function(m){var n='cke_'+m,o=this._[n]||(this._[n]=a.document.getById(n+'_'+this.name));return o;};a.editor.prototype.resize=function(m,n,o,p){var v=this;var q=v.container,r=a.document.getById('cke_contents_'+v.name),s=b.webkit&&v.document&&v.document.getWindow().$.frameElement,t=p?q.getChild(1):q;t.setSize('width',m,true);s&&(s.style.width='1%');var u=o?0:(t.$.offsetHeight||0)-(r.$.clientHeight||0);r.setStyle('height',Math.max(n-u,0)+'px');s&&(s.style.width='100%');v.fire('resize');};a.editor.prototype.getResizable=function(m){return m?a.document.getById('cke_contents_'+this.name):this.container;};})();
|
|
@ -1,209 +0,0 @@
|
|||||||
|
|
||||||
// GetSimpleCMS config file for CKeditor 3.6.2
|
|
||||||
|
|
||||||
// default editor config
|
|
||||||
CKEDITOR.editorConfig = function( config )
|
|
||||||
{
|
|
||||||
// Define changes to default configuration here.
|
|
||||||
config.resize_dir = 'vertical' // vertical resize
|
|
||||||
config.toolbarCanCollapse = false; // hide toolbar collapse button
|
|
||||||
config.dialog_backgroundCoverColor = '#000000';
|
|
||||||
|
|
||||||
config.toolbar_advanced =
|
|
||||||
[['Bold', 'Italic', 'Underline', 'NumberedList', 'BulletedList', 'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock', 'Table', 'TextColor', 'BGColor', 'Link', 'Unlink', 'Image', 'RemoveFormat', 'Source'],
|
|
||||||
'/',
|
|
||||||
['Styles','Format','Font','FontSize']];
|
|
||||||
|
|
||||||
config.toolbar_basic =
|
|
||||||
[['Bold', 'Italic', 'Underline', 'NumberedList', 'BulletedList', 'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock', 'Link', 'Unlink', 'Image', 'RemoveFormat', 'Source']];
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/** ------------------------------------------------------------------------
|
|
||||||
* GS Default overrides and extras
|
|
||||||
* DO NOT EDIT BELOW THIS LINE
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Override default block element source formatting
|
|
||||||
CKEDITOR.on( 'instanceReady', function( ev ) {
|
|
||||||
var blockTags = ['div','h1','h2','h3','h4','h5','h6','p','pre','li','blockquote','ul','ol','table','thead','tbody','tfoot','td','th',];
|
|
||||||
var rules = {
|
|
||||||
indent : true,
|
|
||||||
breakBeforeOpen : true,
|
|
||||||
breakAfterOpen : false,
|
|
||||||
breakBeforeClose : false,
|
|
||||||
breakAfterClose : true
|
|
||||||
};
|
|
||||||
|
|
||||||
for (var i=0; i<blockTags.length; i++) {
|
|
||||||
ev.editor.dataProcessor.writer.setRules( blockTags[i], rules );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Disable some dialog fields we do not need
|
|
||||||
CKEDITOR.on( 'dialogDefinition', function( ev ) {
|
|
||||||
var dialogName = ev.data.name;
|
|
||||||
var dialogDefinition = ev.data.definition;
|
|
||||||
ev.data.definition.resizable = CKEDITOR.DIALOG_RESIZE_NONE;
|
|
||||||
|
|
||||||
if ( dialogName == 'link' ) {
|
|
||||||
var infoTab = dialogDefinition.getContents( 'info' );
|
|
||||||
//dialogDefinition.removeContents( 'target' );
|
|
||||||
var advTab = dialogDefinition.getContents( 'advanced' );
|
|
||||||
advTab.remove( 'advLangDir' );
|
|
||||||
advTab.remove( 'advLangCode' );
|
|
||||||
advTab.remove( 'advContentType' );
|
|
||||||
advTab.remove( 'advTitle' );
|
|
||||||
advTab.remove( 'advCharset' );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( dialogName == 'image' ) {
|
|
||||||
var infoTab = dialogDefinition.getContents( 'info' );
|
|
||||||
infoTab.remove( 'txtBorder' );
|
|
||||||
infoTab.remove( 'txtHSpace' );
|
|
||||||
infoTab.remove( 'txtVSpace' );
|
|
||||||
infoTab.remove( 'btnResetSize' );
|
|
||||||
dialogDefinition.removeContents( 'Link' );
|
|
||||||
var advTab = dialogDefinition.getContents( 'advanced' );
|
|
||||||
advTab.remove( 'cmbLangDir' );
|
|
||||||
advTab.remove( 'txtLangCode' );
|
|
||||||
advTab.remove( 'txtGenLongDescr' );
|
|
||||||
advTab.remove( 'txtGenTitle' );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// linkdefault = "url";
|
|
||||||
|
|
||||||
var menuItems;
|
|
||||||
|
|
||||||
$.getJSON("inc/ajax.php?list_pages_json=1", function (data){
|
|
||||||
menuItems = data;
|
|
||||||
if (typeof editor !== "undefined") CKEsetupLinks(editor);
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* CKEditor Add Local Page Link
|
|
||||||
* This is used by the CKEditor to link to internal pages
|
|
||||||
* @param editorObj an editor instance
|
|
||||||
**/
|
|
||||||
CKEsetupLinks = function(editorObj){
|
|
||||||
|
|
||||||
if (typeof editorObj === "undefined") return;
|
|
||||||
|
|
||||||
CKEDITOR.on( 'dialogDefinition', function( ev ) {
|
|
||||||
|
|
||||||
if ((ev.editor != editorObj) || (ev.data.name != 'link') || !menuItems) return;
|
|
||||||
|
|
||||||
// modify dialog definition for "link" dialog else return
|
|
||||||
|
|
||||||
var definition = ev.data.definition;
|
|
||||||
|
|
||||||
// override onfocus handler
|
|
||||||
// Supposed to select the select box, not working
|
|
||||||
definition.onFocus = CKEDITOR.tools.override(definition.onFocus, function(original) {
|
|
||||||
return function() {
|
|
||||||
original.call(this);
|
|
||||||
if (this.getValueOf('info', 'linkType') == 'localPage') {
|
|
||||||
// this.getContentElement('info', 'localPage_path').select(); // disabled, object has no method select
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
// Add localpage to linktypes
|
|
||||||
var infoTab = definition.getContents('info');
|
|
||||||
var content = CKEgetById(infoTab.elements, 'linkType');
|
|
||||||
|
|
||||||
content.items.unshift(['Link to local page', 'localPage']);
|
|
||||||
content['default'] = 'localPage';
|
|
||||||
infoTab.elements.push({
|
|
||||||
type: 'vbox',
|
|
||||||
id: 'localPageOptions',
|
|
||||||
children: [{
|
|
||||||
type: 'select',
|
|
||||||
id: 'localPage_path',
|
|
||||||
label: 'Select page:',
|
|
||||||
required: true,
|
|
||||||
items: menuItems,
|
|
||||||
setup: function(data) {
|
|
||||||
if ( data.localPage )
|
|
||||||
this.setValue( data.localPage );
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
});
|
|
||||||
|
|
||||||
// hide and show tabs and stuff as typ eis changed
|
|
||||||
content.onChange = CKEDITOR.tools.override(content.onChange, function(original) {
|
|
||||||
return function() {
|
|
||||||
original.call(this);
|
|
||||||
var dialog = this.getDialog();
|
|
||||||
var element = dialog.getContentElement('info', 'localPageOptions').getElement().getParent().getParent();
|
|
||||||
if (this.getValue() == 'localPage') {
|
|
||||||
element.show();
|
|
||||||
if (editorObj.config.linkShowTargetTab) {
|
|
||||||
dialog.showPage('target');
|
|
||||||
}
|
|
||||||
var uploadTab = dialog.definition.getContents('upload');
|
|
||||||
if (uploadTab && !uploadTab.hidden) {
|
|
||||||
dialog.hidePage('upload');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
element.hide();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
content.setup = function(data) {
|
|
||||||
// if no url set selection to localpage
|
|
||||||
if (!data.type || (data.type == 'url') && !data.url) {
|
|
||||||
data.type = 'localPage'; // default to localPage
|
|
||||||
if(typeof(linkdefault) !== 'undefined') data.type = linkdefault;
|
|
||||||
}
|
|
||||||
else if (data.url && !data.url.protocol && data.url.url) {
|
|
||||||
// already a link
|
|
||||||
if (path) {
|
|
||||||
// what is path, this seems to do nothing
|
|
||||||
data.type = 'localPage';
|
|
||||||
data.localPage_path = path;
|
|
||||||
delete data.url;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.setValue(data.type);
|
|
||||||
};
|
|
||||||
|
|
||||||
content.commit = function(data) {
|
|
||||||
data.type = this.getValue();
|
|
||||||
if (data.type == 'localPage') {
|
|
||||||
data.type = 'url';
|
|
||||||
var dialog = this.getDialog();
|
|
||||||
dialog.setValueOf('info', 'protocol', '');
|
|
||||||
dialog.setValueOf('info', 'url', dialog.getValueOf('info', 'localPage_path'));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},null,null,1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Helper function to get a CKEDITOR.dialog.contentDefinition object by its ID.
|
|
||||||
CKEgetById = function(array, id, recurse) {
|
|
||||||
for (var i = 0, item; (item = array[i]); i++) {
|
|
||||||
if (item.id == id) return item;
|
|
||||||
if (recurse && item[recurse]) {
|
|
||||||
var retval = CKEgetById(item[recurse], id, recurse);
|
|
||||||
if (retval) return retval;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
var getById = CKEgetById; // alias for legacy
|
|
||||||
|
|
||||||
// Fix for IE onbeforeunload bubbling up from dialogs
|
|
||||||
CKEDITOR.on('instanceReady', function(event) {
|
|
||||||
event.editor.on('dialogShow', function(dialogShowEvent) {
|
|
||||||
if(CKEDITOR.env.ie) {
|
|
||||||
$(dialogShowEvent.data._.element.$).find('a[href*="void(0)"]').removeAttr('href');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,25 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
|
||||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
||||||
*/
|
|
||||||
|
|
||||||
body
|
|
||||||
{
|
|
||||||
/* Font */
|
|
||||||
font-family: Arial, Verdana, sans-serif;
|
|
||||||
font-size: 12px;
|
|
||||||
|
|
||||||
/* Text color */
|
|
||||||
color: #222;
|
|
||||||
|
|
||||||
/* Remove the background color to make it transparent */
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol,ul,dl
|
|
||||||
{
|
|
||||||
/* IE7: reset rtl list margin. (#7334) */
|
|
||||||
*margin-right:0px;
|
|
||||||
/* preserved spaces for list items with text direction other than the list. (#6249,#8049)*/
|
|
||||||
padding:0 40px;
|
|
||||||
}
|
|
Before Width: | Height: | Size: 43 B |
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
|
||||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
||||||
*/
|
|
||||||
|
|
||||||
CKEDITOR.dialog.add('a11yHelp',function(a){var b=a.lang.accessibilityHelp,c=CKEDITOR.tools.getNextId(),d={8:'BACKSPACE',9:'TAB',13:'ENTER',16:'SHIFT',17:'CTRL',18:'ALT',19:'PAUSE',20:'CAPSLOCK',27:'ESCAPE',33:'PAGE UP',34:'PAGE DOWN',35:'END',36:'HOME',37:'LEFT ARROW',38:'UP ARROW',39:'RIGHT ARROW',40:'DOWN ARROW',45:'INSERT',46:'DELETE',91:'LEFT WINDOW KEY',92:'RIGHT WINDOW KEY',93:'SELECT KEY',96:'NUMPAD 0',97:'NUMPAD 1',98:'NUMPAD 2',99:'NUMPAD 3',100:'NUMPAD 4',101:'NUMPAD 5',102:'NUMPAD 6',103:'NUMPAD 7',104:'NUMPAD 8',105:'NUMPAD 9',106:'MULTIPLY',107:'ADD',109:'SUBTRACT',110:'DECIMAL POINT',111:'DIVIDE',112:'F1',113:'F2',114:'F3',115:'F4',116:'F5',117:'F6',118:'F7',119:'F8',120:'F9',121:'F10',122:'F11',123:'F12',144:'NUM LOCK',145:'SCROLL LOCK',186:'SEMI-COLON',187:'EQUAL SIGN',188:'COMMA',189:'DASH',190:'PERIOD',191:'FORWARD SLASH',192:'GRAVE ACCENT',219:'OPEN BRACKET',220:'BACK SLASH',221:'CLOSE BRAKET',222:'SINGLE QUOTE'};d[CKEDITOR.ALT]='ALT';d[CKEDITOR.SHIFT]='SHIFT';d[CKEDITOR.CTRL]='CTRL';var e=[CKEDITOR.ALT,CKEDITOR.SHIFT,CKEDITOR.CTRL];function f(j){var k,l,m=[];for(var n=0;n<e.length;n++){l=e[n];k=j/e[n];if(k>1&&k<=2){j-=l;m.push(d[l]);}}m.push(d[j]||String.fromCharCode(j));return m.join('+');};var g=/\$\{(.*?)\}/g;function h(j,k){var l=a.config.keystrokes,m,n=l.length;for(var o=0;o<n;o++){m=l[o];if(m[1]==k)break;}return f(m[0]);};function i(){var j='<div class="cke_accessibility_legend" role="document" aria-labelledby="'+c+'_arialbl" tabIndex="-1">%1</div>'+'<span id="'+c+'_arialbl" class="cke_voice_label">'+b.contents+' </span>',k='<h1>%1</h1><dl>%2</dl>',l='<dt>%1</dt><dd>%2</dd>',m=[],n=b.legend,o=n.length;for(var p=0;p<o;p++){var q=n[p],r=[],s=q.items,t=s.length;for(var u=0;u<t;u++){var v=s[u],w;w=l.replace('%1',v.name).replace('%2',v.legend.replace(g,h));r.push(w);}m.push(k.replace('%1',q.name).replace('%2',r.join('')));}return j.replace('%1',m.join(''));};return{title:b.title,minWidth:600,minHeight:400,contents:[{id:'info',label:a.lang.common.generalTab,expand:true,elements:[{type:'html',id:'legends',style:'white-space:normal;',focus:function(){},html:i()+'<style type="text/css">'+'.cke_accessibility_legend'+'{'+'width:600px;'+'height:400px;'+'padding-right:5px;'+'overflow-y:auto;'+'overflow-x:hidden;'+'}'+'.cke_browser_quirks .cke_accessibility_legend,'+'.cke_browser_ie6 .cke_accessibility_legend'+'{'+'height:390px'+'}'+'.cke_accessibility_legend *'+'{'+'white-space:normal;'+'}'+'.cke_accessibility_legend h1'+'{'+'font-size: 20px;'+'border-bottom: 1px solid #AAA;'+'margin: 5px 0px 15px;'+'}'+'.cke_accessibility_legend dl'+'{'+'margin-left: 5px;'+'}'+'.cke_accessibility_legend dt'+'{'+'font-size: 13px;'+'font-weight: bold;'+'}'+'.cke_accessibility_legend dd'+'{'+'margin:10px'+'}'+'</style>'}]}],buttons:[CKEDITOR.dialog.cancelButton]};
|
|
||||||
});
|
|
@ -1,6 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
|
||||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
||||||
*/
|
|
||||||
|
|
||||||
CKEDITOR.plugins.setLang('a11yhelp','en',{accessibilityHelp:{title:'Accessibility Instructions',contents:'Help Contents. To close this dialog press ESC.',legend:[{name:'General',items:[{name:'Editor Toolbar',legend:'Press ${toolbarFocus} to navigate to the toolbar. Move to the next and previous toolbar group with TAB and SHIFT-TAB. Move to the next and previous toolbar button with RIGHT ARROW or LEFT ARROW. Press SPACE or ENTER to activate the toolbar button.'},{name:'Editor Dialog',legend:'Inside a dialog, press TAB to navigate to next dialog field, press SHIFT + TAB to move to previous field, press ENTER to submit dialog, press ESC to cancel dialog. For dialogs that have multiple tab pages, press ALT + F10 to navigate to tab-list. Then move to next tab with TAB OR RIGTH ARROW. Move to previous tab with SHIFT + TAB or LEFT ARROW. Press SPACE or ENTER to select the tab page.'},{name:'Editor Context Menu',legend:'Press ${contextMenu} or APPLICATION KEY to open context-menu. Then move to next menu option with TAB or DOWN ARROW. Move to previous option with SHIFT+TAB or UP ARROW. Press SPACE or ENTER to select the menu option. Open sub-menu of current option with SPACE or ENTER or RIGHT ARROW. Go back to parent menu item with ESC or LEFT ARROW. Close context menu with ESC.'},{name:'Editor List Box',legend:'Inside a list-box, move to next list item with TAB OR DOWN ARROW. Move to previous list item with SHIFT + TAB or UP ARROW. Press SPACE or ENTER to select the list option. Press ESC to close the list-box.'},{name:'Editor Element Path Bar',legend:'Press ${elementsPathFocus} to navigate to the elements path bar. Move to next element button with TAB or RIGHT ARROW. Move to previous button with SHIFT+TAB or LEFT ARROW. Press SPACE or ENTER to select the element in editor.'}]},{name:'Commands',items:[{name:' Undo command',legend:'Press ${undo}'},{name:' Redo command',legend:'Press ${redo}'},{name:' Bold command',legend:'Press ${bold}'},{name:' Italic command',legend:'Press ${italic}'},{name:' Underline command',legend:'Press ${underline}'},{name:' Link command',legend:'Press ${link}'},{name:' Toolbar Collapse command',legend:'Press ${toolbarCollapse}'},{name:' Accessibility Help',legend:'Press ${a11yHelp}'}]}]}});
|
|
@ -1,6 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
|
||||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
||||||
*/
|
|
||||||
|
|
||||||
CKEDITOR.dialog.add('about',function(a){var b=a.lang.about;return{title:CKEDITOR.env.ie?b.dlgTitle:b.title,minWidth:390,minHeight:230,contents:[{id:'tab1',label:'',title:'',expand:true,padding:0,elements:[{type:'html',html:'<style type="text/css">.cke_about_container{color:#000 !important;padding:10px 10px 0;margin-top:5px}.cke_about_container p{margin: 0 0 10px;}.cke_about_container .cke_about_logo{height:81px;background-color:#fff;background-image:url('+CKEDITOR.plugins.get('about').path+'dialogs/logo_ckeditor.png);'+'background-position:center; '+'background-repeat:no-repeat;'+'margin-bottom:10px;'+'}'+'.cke_about_container a'+'{'+'cursor:pointer !important;'+'color:blue !important;'+'text-decoration:underline !important;'+'}'+'</style>'+'<div class="cke_about_container">'+'<div class="cke_about_logo"></div>'+'<p>'+'CKEditor '+CKEDITOR.version+' (revision '+CKEDITOR.revision+')<br>'+'<a href="http://ckeditor.com/">http://ckeditor.com</a>'+'</p>'+'<p>'+b.help.replace('$1','<a href="http://docs.cksource.com/CKEditor_3.x/Users_Guide/Quick_Reference">'+b.userGuide+'</a>')+'</p>'+'<p>'+b.moreInfo+'<br>'+'<a href="http://ckeditor.com/license">http://ckeditor.com/license</a>'+'</p>'+'<p>'+b.copy.replace('$1','<a href="http://cksource.com/">CKSource</a> - Frederico Knabben')+'</p>'+'</div>'}]}],buttons:[CKEDITOR.dialog.cancelButton]};});
|
|