Xoops Project

<br style="clear:both;" /><script language="javascript" type="text/javascript">
function doJSON_LoadPageForm() {
var params = new Array();
$.getJSON("http://localhost/2.4.3/modules/content/dojson_loadform.php?passkey=0cf859d2ddc5c3f7e7cc61eb3582ea2d&form=content&storyid=2", params, refreshformdesc);
}
function doJSON_LoadPageTemplate() {
var params = new Array();
$.getJSON("http://localhost/2.4.3/modules/content/dojson_loadtemplate.php?passkey=0cf859d2ddc5c3f7e7cc61eb3582ea2d&form=content&storyid=2&template=" + $('#template :selected').text() + "&language=" + $('#language').val() + "&catid=" + $('#catid :selected').val() + "&parent_id=" + $('#parent_id :selected').val() + "&title=" + escape($('#title').val()) + "&ptitle=" + escape($('#ptitle').val()) + "&keywords=" + escape($('#keywords').val()) + "&page_description=" + escape($('#page_description').val()) + "&address=" + escape($('#address').val()), params, refreshformdesc);
}
</script><body onLoad="javascript:doJSON_LoadPageForm();" />
<h1>Content Page - 2.7</h1>
<p align="center" id='forms'></p><p>refreshformdesc
dojson_loadform.php
<?php
include ('header.php');
include ($GLOBALS['xoops']->path(_BRC_PATH_PHP_JSON));
$json = new services_JSON();
$values = array();
$submit = true;
if ($passkey!=content_passkey())
{
ob_start();
xoops_error(_BRC_MSG_SECURITYTOKEN);
$msg = ob_get_contents();
ob_end_clean();
}
switch($form){
case _BRC_URL_FORM_CONTENT:
if (!$msg)
$values['innerhtml']['forms'] = content_addcontent($storyid, $_GET['language']);
else
$values['innerhtml']['forms'] = $msg;
break;
case _BRC_URL_FORM_CATEGORY:
if (!$msg)
$values['innerhtml']['forms'] = content_addcategory($catid, $_GET['language']);
else
$values['innerhtml']['forms'] = $msg;
break;
case _BRC_URL_FORM_BLOCK:
if (!$msg)
$values['innerhtml']['forms'] = content_addblock($blockid, $_GET['language']);
else
$values['innerhtml']['forms'] = $msg;
break;
}
print $json->encode($values);
?>
dojson_loadform.phpformsinnerhtml refreshformdesc
// JavaScript Document
function refreshformdesc(data){
$.each(data, function(i, n){
switch(i){
case 'innerhtml':
$.each(n, function(y, k){
var tmp = document.getElementById(y);
if (tmp)
tmp.innerHTML = k
var tmp = false;
});
break;
case 'disable':
$.each(n, function(y, k){
switch(k){
case '':
case 'false':
var tmp = document.getElementById(y);
if (tmp)
tmp.disabled = false;
var tmp = '';
break;
default:
var tmp = document.getElementById(y);
if (tmp)
tmp.disabled = true;
var tmp = '';
break;
}
});
break;
case 'checked':
$.each(n, function(y, k){
switch(k){
case 'false':
var tmp = document.getElementById(y);
if (tmp)
tmp.checked = false;
var tmp ='';
break;
default:
var tmp = document.getElementById(y);
if (tmp)
tmp.checked = true;
var tmp ='';
break;
}
});
break;
case 'index':
$.each(n, function(y, k){
var tmp = document.getElementById(y)
if (tmp)
tmp.selectedIndex = false;
var tmp ='';
});
break;
}
});
}


Re: CKEditor 3 & JSON Form Loading - Editor Crashing
Re: CKEditor 3 & JSON Form Loading - Editor Crashing
http://wishcraft.thruhere.net/2.3.4
http://www.smarty.net
Re: CKEditor 3 & JSON Form Loading - Editor Crashing
<?php /* You may not change or alter any portion of this comment or credits of supporting developers from this source code or any supporting source code which is considered copyrighted (c) material of the original comment or credit authors. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /** * FCKeditor adapter for XOOPS * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license http://www.fsf.org/copyleft/gpl.html GNU public license * @package class * @subpackage editor * @since 2.3.0 * @author Taiwen Jiang <phppp@users.sourceforge.net> * @version $Id: formckeditor.php 2154 2008-09-22 02:38:32Z phppp $ */ xoops_load('XoopsEditor'); class XoopsFormCkeditor extends XoopsEditor { /** * Constructor * * @param array $configs Editor Options */ function __construct($configs) { $this->rootPath = "/class/xoopseditor/ckeditor"; parent::__construct($configs); } function XoopsFormCkeditor($configs) { $this->__construct($configs); } /** * prepare HTML for output * * @param bool decode content? * @return sting HTML */ function render($decode = true) { static $ckeditor_added; if ( is_object($GLOBALS['xoopsModule']) ) $dirname = $GLOBALS['xoopsModule']->getVar('dirname'); else $dirname = 'system'; if ( is_object($GLOBALS['xoTheme']) ) { if ( $ckeditor_added==false ) { $GLOBALS['xoTheme']->addScript( XOOPS_URL . $this->rootPath . '/ckeditor/ckeditor.js' ); if ( file_exists( XOOPS_URL . $this->rootPath . '/ckeditor/modules/config.'.$dirname.'.js' ) ) $GLOBALS['xoTheme']->addScript( XOOPS_URL . $this->rootPath . '/ckeditor/modules/config.'.$dirname.'.js' ); else $GLOBALS['xoTheme']->addScript( XOOPS_URL . $this->rootPath . '/ckeditor/config.js' ); $ckeditor_added = true; } $retb .= '<script type="text/javascript">//<![CDATA[ CKEDITOR.replace( \'' . $this->getName() . '\' ); //]]> </script>'; } else { if ( $ckeditor_added==false ) { $ret .= '<script src="' . XOOPS_URL . $this->rootPath . '/ckeditor/ckeditor.js' . '" type="text/javascript"></script>'; if ( file_exists( XOOPS_URL . $this->rootPath . '/ckeditor/modules/config.'.$dirname.'.js' ) ) $ret .= '<script src="' . XOOPS_URL . $this->rootPath . '/ckeditor/modules/config.'.$dirname.'.js' . '" type="text/javascript"></script>'; else $ret .= '<script src="' . XOOPS_URL . $this->rootPath . '/ckeditor/config.js' . '" type="text/javascript"></script>'; $ckeditor_added=true; } $retb .= '<script type="text/javascript">//<![CDATA[ CKEDITOR.replace( \'' . $this->getName() . '\' ); //]]> </script>'; } if ($decode) { $ts =& MyTextSanitizer::getInstance(); $value = $ts->undoHtmlSpecialChars( $this->getValue() ); } else { $value = $this->getValue(); } return $ret."<textarea name='" . $this->getName() . "' id='" . $this->getName() . "' title='" . $this->getTitle() . "' rows='" . $this->getRows() . "' cols='" . $this->getCols() . "'" . $this->getExtra() . ">" . $value . "</textarea>".$retb; } } ?>render
Re: CKEditor 3 & JSON Form Loading - Editor Crashing
Re: CKEditor 3 & JSON Form Loading - Editor Crashing
Re: CKEditor 3 & JSON Form Loading - Editor Crashing
/ckeditor
/js/core.js
/dojson_loadform.php
/index.php
/JSON.php
Re: CKEditor 3 & JSON Form Loading - Editor Crashing
and
parts. Is that intended?
Also, trying to use replacebyclass if you inject new content after the page has been loaded won't work.
Re: CKEditor 3 & JSON Form Loading - Editor Crashing
The text area is just to display what JSON passed to the browser, via the ajax loader with php. But FCKEditor works no worries with being loaded with JSON..