|
From: <rgr...@us...> - 2013-10-06 23:36:47
|
Revision: 12154
http://sourceforge.net/p/xoops/svn/12154
Author: rgriffith
Date: 2013-10-06 23:36:44 +0000 (Sun, 06 Oct 2013)
Log Message:
-----------
Backing out r12096, r12101, r12102, r12112 for now
Revision Links:
--------------
http://sourceforge.net/p/xoops/svn/12096
http://sourceforge.net/p/xoops/svn/12101
http://sourceforge.net/p/xoops/svn/12102
http://sourceforge.net/p/xoops/svn/12112
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/theme.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/sampleform.inc.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/tinymce/formtinymce.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/tinymce/language/english.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/tinymce/tinymce.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/xoopseditor.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/form.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formcheckbox.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formcolorpicker.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formdatetime.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formdhtmltextarea.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formeditor.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formelement.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formfile.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formradio.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formselect.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formselecteditor.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/include/functions.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/include/site-closed.php
Removed Paths:
-------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/include/json2.js
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/theme.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/theme.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/theme.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -304,7 +304,6 @@
}
// Load global javascript
$this->addScript('include/xoops.js');
- $this->addScript('include/json2.js');
$this->loadLocalization();
if ($this->bufferOutput) {
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/sampleform.inc.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/sampleform.inc.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/sampleform.inc.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -34,11 +34,8 @@
$editor = @ $xoopsUser->getVar('editor'); // Need set through user profile
}
// Add the editor selection box
- // If dohtml is disabled, set $noHtml = true; $mode not considered if $noHtml is false
- xoops_load('XoopsCache');
- XoopsCache::delete('editorlist');
- $mode = 'html'; // extension or mimetype
- $sample_form->addElement(new XoopsFormSelectEditor($sample_form, 'editor', $editor, $noHtml = false, $mode));
+ // If dohtml is disabled, set $noHtml = true
+ $sample_form->addElement(new XoopsFormSelectEditor($sample_form, 'editor', $editor, $noHtml = false));
// options for the editor
// required configs
$options['editor'] = $editor;
@@ -49,8 +46,8 @@
$options['cols'] = 60; // default value = 50
$options['width'] = '100%'; // default value = 100%
$options['height'] = '400px'; // default value = 400px
- $options['mode'] = $mode; // for editors that support mode option
+
// "textarea": if the selected editor with name of $editor can not be created, the editor "textarea" will be used
// if no $onFailure is set, then the first available editor will be used
// If dohtml is disabled, set $noHtml to true
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/tinymce/formtinymce.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/tinymce/formtinymce.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/tinymce/formtinymce.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -35,7 +35,7 @@
*
* @param array $configs Editor Options
*/
- function __construct($configs, $mode)
+ function __construct($configs)
{
$current_path = __FILE__;
if (DIRECTORY_SEPARATOR != "/") {
@@ -86,23 +86,6 @@
}
/**
- * Renders the Javascript function needed for client-side for get content
- *
- * I'VE USED THIS EXAMPLE TO WRITE VALIDATION CODE
- * http://tinymce.moxiecode.com/punbb/viewtopic.php?id=12616
- *
- * @return string
- */
- function renderGetContentJS()
- {
- if ($eltname = $this->getName()) {
- $ret = "tinyMCE.get('{$eltname}').getContent()";
- return $ret;
- }
- return '';
- }
-
- /**
* get language
*
* @return string
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/tinymce/language/english.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/tinymce/language/english.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/tinymce/language/english.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -14,7 +14,7 @@
* Assocated with editor_registry.php
*/
// Name of the editor
-define('_XOOPS_EDITOR_TINYMCE',"TinyMCE v3.5.8");
+define('_XOOPS_EDITOR_TINYMCE',"TinyMCE");
// The value must be the same as /tinymce/jscripts/langs/your_language_code, for example, "en" for English, "fr" for French
// For details, check http://tinymce.moxiecode.com/download_i18n.php
define('_XOOPS_EDITOR_TINYMCE_LANGUAGE',"en");
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/tinymce/tinymce.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/tinymce/tinymce.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/tinymce/tinymce.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -269,10 +269,11 @@
$this->init();
if (self::$LastOfElementsTinymce!=$this->setting["elements"]) {
$ret = "\n<!-- 'tiny_mce.js' SCRIPT NOT YET ".$this->setting["elements"]." -->\n"; //debug
+
return $ret;
- } else {
+ } else {
$this->setting["elements"]=implode(",",self::$ListOfElementsTinymce);
- }
+ }
if ( !empty($this->setting["callback"]) ) {
$callback = $this->setting["callback"];
unset($this->setting["callback"]);
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/xoopseditor.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/xoopseditor.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/xoopseditor.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -90,7 +90,6 @@
var $root_path = "";
var $nohtml = false;
var $allowed_editors = array();
- var $mode = null;
/**
* Enter description here...
*
@@ -126,16 +125,15 @@
*
* @param string $name Editor name which is actually the folder name
* @param array $options editor options: $key => $val
+ * @param string $OnFailure a pre-validated editor that will be used if the required editor is failed to create
* @param bool $noHtml dohtml disabled
- * @param string $OnFailure a pre-validated editor that will be used if the required editor is failed to create
- * @param string Requested mode (or array of them)
*/
- function get($name = '', $options = null, $noHtml = false, $OnFailure = '', $mode = null)
+ function get($name = '', $options = null, $noHtml = false, $OnFailure = '')
{
- if (array_key_exists($name, $this->getList($noHtml, $mode)) && $editor = $this->_loadEditor($name, $options, $mode)) {
+ if (array_key_exists($name, $this->getList($noHtml)) && $editor = $this->_loadEditor($name, $options)) {
return $editor;
}
- $list = array_keys($this->getList($noHtml, $mode));
+ $list = array_keys($this->getList($noHtml));
if (empty($OnFailure) || !in_array($OnFailure, $list)) {
$OnFailure = $list[0];
}
@@ -147,10 +145,9 @@
* XoopsEditorHandler::getList()
*
* @param mixed $noHtml
- * @param string $mode Requested mode (or array of them)
* @return
*/
- function getList($noHtml = false, $mode = null)
+ function getList($noHtml = false)
{
/*
Do NOT use this method statically, please use
@@ -180,17 +177,7 @@
if (empty($config['order']))
continue;
$order[] = $config['order'];
- if (!isset($config['modes'])) {
- $config['modes'] = null;
- }
- if ($config['nohtml'] == false) {
- $config['modes'] = array('htm', 'html', 'htmlmixed', 'text/html');
- }
- $list[$item] = array(
- 'title' => $config['title'] ,
- 'nohtml' => $config['nohtml'],
- 'modes' => $config['modes']
- );
+ $list[$item] = array('title' => $config['title'] , 'nohtml' => $config['nohtml']);
}
}
array_multisort($order, $list);
@@ -205,10 +192,6 @@
foreach ($editors as $name) {
if (!empty($noHtml) && empty($list[$name]['nohtml']))
continue;
- if (!empty($mode) && is_string($mode) && !empty($list[$name]['modes']) && !in_array(strtolower($mode), $list[$name]['modes']))
- continue;
- if (!empty($mode) && is_array($mode) && !empty($list[$name]['modes']) && (count(array_intersect($mode, $list[$name]['modes'])) == 0))
- continue;
$_list[$name] = $list[$name]['title'];
}
return $_list;
@@ -251,7 +234,7 @@
* @param mixed $options
* @return
*/
- function _loadEditor($name, $options = null, $mode = null)
+ function _loadEditor($name, $options = null)
{
$editor = null;
if (empty($name) || !array_key_exists($name, $this->getList())) {
@@ -272,7 +255,7 @@
return $editor;
}
include_once $config['file'];
- $editor = new $config['class']($options, $mode);
+ $editor = new $config['class']($options);
return $editor;
}
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/form.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/form.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/form.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -526,10 +526,10 @@
* A basic element validation method may contain something like this:
* <code>
* function renderValidationJS() {
- * $name = $this->getName();
- * return "if (myform.{$name}.value != 'valid') { " .
- * "myform.{$name}.focus(); window.alert( '$name is invalid' ); return false;" .
- * " }";
+ * $name = $this->getName();
+ * return "if (myform.{$name}.value != 'valid') { " .
+ * "myform.{$name}.focus(); window.alert( '$name is invalid' ); return false;" .
+ * " }";
* }
* </code>
*
@@ -558,66 +558,6 @@
}
/**
- * Renders the Javascript function needed for client-side for get content
- *
- * Additionally, each element class may provide its own "renderGetContentJS" method
- * that is supposed to return custom get content code for the element.
- *
- * The element get content code can assume that the JS "myform" variable points to the form.
- * Exemple:
- * <script type='text/javascript'>
- * var content[];
- * content = " . $form->renderGetContentJS(false) . "
- * </script>
- *
- * A basic element get content method may contain something like this:
- * <code>
- * function renderGetContentJS() {
- * $name = $this->getName();
- * return "document.getElementById('{$name}');";
- * }
- * </code>
- *
- * @param boolean $withtags Include the < javascript > tags in the returned string
- * @return string
- */
- function renderGetContentJS($withTags = false)
- {
- $formname = $this->getName();
- $js = '';
- if ($withTags) {
- $js .= "\n<!-- Start Form GetContent JavaScript //-->\n<script type='text/javascript'>\n<!--//\n";
- $js .= "function xoopsFormGetContent_{$formname}() {\n";
- } else {
- $js .= "(function() {\n";
- }
- //$js .= " var myform = window.document.{$formname};\n";
- $js .= " var content = new Object();\n";
- $elements = $this->getElements(true);
- foreach($elements as $elt) {
- if (method_exists($elt, 'renderGetContentJS') && ($elt->getName() != '')) {
- $js .= " content['" . $elt->getName() . "'] = " . $elt->renderGetContentJS() . ";\n";
- }
- }
- $js .= " Object.size = function(obj) {\n";
- $js .= " var size = 0, key;\n";
- $js .= " for (key in obj)\n";
- $js .= " {if (obj.hasOwnProperty(key)) size++;}\n";
- $js .= " return size;\n";
- $js .= " };\n";
- $js .= " return (Object.size(content) > 0) ? content : null;\n";
-
- if ($withTags) {
- $js .= "}\n";
- $js .= "//--></script>\n<!-- End Form GetContent JavaScript //-->\n";
- } else {
- $js .= "})()\n";
- }
-
- return $js;
- }
-
- /**
* assign to smarty form template instead of displaying directly
*
* @param object $ &$tpl reference to a {@link Smarty} object
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formcheckbox.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formcheckbox.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formcheckbox.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -242,32 +242,4 @@
}
return '';
}
-
- /**
- * Render custom javascript get content code
- *
- * @seealso XoopsForm::renderGetContentJS
- */
- function renderGetContentJS()
- {
- // render custom validation code if any
- if (! empty($this->customGetContentCode)) {
- return implode(NWLINE, $this->customGetContentCode);
- // generate get content code if required
- } else {
- $eltname = $this->getName();
- return "(function(){
- var checkboxesChecked = [];
- var checkboxes = document.getElementsByName('{$eltname}[]');
- if (checkboxes.length) {
- for (var i = 0; i < checkboxes.length; i++) {
- if (checkboxes[i].checked == true) {
- checkboxesChecked.push(checkboxes[i].value);
- }
- }
- }
- return (checkboxesChecked.length > 0) ? checkboxesChecked : null;
- })()";
- }
- }
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formcolorpicker.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formcolorpicker.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formcolorpicker.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -72,17 +72,4 @@
return "if ( !(new RegExp(\"^#[0-9a-fA-F]{6}\",\"i\").test(myform.{$eltname}.value)) ) { window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }";
}
-
- /**
- * Returns custom get content Javascript
- *
- * @return string Element get content Javascript
- */
- function renderGetContentJS()
- {
- $eltname = $this->getName();
- return "(function(){
- return ((new RegExp('^#[0-9a-fA-F]{6}','i').test(document.getElementById('{$eltname}').value))) ? document.getElementById('{$eltname}').value : null;
- })()";
- }
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formdatetime.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formdatetime.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formdatetime.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -38,15 +38,13 @@
* @param integer $value
* @param mixed $showtime
*/
- function __construct($caption, $name, $size = 15, $value = 0, $showtime = true)
+ function XoopsFormDateTime($caption, $name, $size = 15, $value = 0, $showtime = true)
{
- $this->XoopsFormElementTray($caption, ' ', $name);
+ $this->XoopsFormElementTray($caption, ' ');
$value = intval($value);
$value = ($value > 0) ? $value : time();
$datetime = getDate($value);
- $dateselect = new XoopsFormTextDateSelect('', $name . '[date]', $size, $value, $showtime);
- $this->addElement($dateselect);
-
+ $this->addElement(new XoopsFormTextDateSelect('', $name . '[date]', $size, $value, $showtime));
$timearray = array();
for ($i = 0; $i < 24; $i ++) {
for ($j = 0; $j < 60; $j = $j + 10) {
@@ -55,30 +53,9 @@
}
}
ksort($timearray);
+
$timeselect = new XoopsFormSelect('', $name . '[time]', $datetime['hours'] * 3600 + 600 * ceil($datetime['minutes'] / 10));
$timeselect->addOptionArray($timearray);
$this->addElement($timeselect);
}
-
- /**
- * Render custom javascript get content code
- *
- * @seealso XoopsForm::renderGetContentJS
- */
- function renderGetContentJS()
- {
- $eltname = $this->getName();
- // render custom validation code if any
- if (! empty($this->customGetContentCode)) {
- return implode(NWLINE, $this->customGetContentCode);
- // generate get content code if required
- } else {
- return "(function(){
- var dateTime = []
- dateTime.push(document.getElementById('{$eltname}[date]').value);
- dateTime.push(document.getElementById('{$eltname}[time]').value);
- return (dateTime.length > 0) ? dateTime : null;
- })()";
- }
- }
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formdhtmltextarea.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formdhtmltextarea.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formdhtmltextarea.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -265,19 +265,4 @@
}
return parent::renderValidationJS();
}
-
- /**
- * XoopsFormDhtmlTextArea::renderGetContentJS()
- *
- * @return
- */
- function renderGetContentJS()
- {
- if ($this->htmlEditor && is_object($this->htmlEditor) && method_exists($this->htmlEditor, 'renderGetContentJS')) {
- if (! isset($this->htmlEditor->isEnabled) || $this->htmlEditor->isEnabled) {
- return $this->htmlEditor->renderGetContentJS();
- }
- }
- return parent::renderGetContentJS();
- }
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formeditor.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formeditor.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formeditor.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -38,9 +38,8 @@
* @param array $configs configures: editor - editor identifier; name - textarea field name; width, height - dimensions for textarea; value - text content
* @param bool $noHtml use non-WYSIWYG eitor onfailure
* @param string $OnFailure editor to be used if current one failed
- * @param string Requested mode, useful for syntax highlighting editors*
*/
- function XoopsFormEditor($caption, $name, $configs = null, $nohtml = false, $OnFailure = '', $mode = null)
+ function XoopsFormEditor($caption, $name, $configs = null, $nohtml = false, $OnFailure = '')
{
// Backward compatibility: $name -> editor name; $configs['name'] -> textarea field name
if (! isset($configs['editor'])) {
@@ -50,19 +49,15 @@
} else {
$configs['name'] = $name;
}
- if (empty($mode) && !empty($configs['mode'])) {
- $mode = $configs['mode'];
- $configs['mode'] = null;
- }
$this->XoopsFormTextArea($caption, $name);
xoops_load('XoopsEditorHandler');
$editor_handler = XoopsEditorHandler::getInstance();
- $this->editor = $editor_handler->get($configs['editor'], $configs, $nohtml, $OnFailure, $mode);
+ $this->editor = $editor_handler->get($configs['editor'], $configs, $nohtml, $OnFailure);
}
/**
* renderValidationJS
- * override original renderValidationJS method
+ * TEMPORARY SOLUTION to 'override' original renderValidationJS method
* with custom XoopsEditor's renderValidationJS method
*/
function renderValidationJS()
@@ -82,27 +77,6 @@
}
/**
- * renderGetContentJS
- * 'override' original renderGetContentJS method
- * with custom XoopsEditor's renderGetContentJS method
- */
- function renderGetContentJS()
- {
- if (is_object($this->editor)) {
- if (method_exists($this->editor, 'renderGetContentJS')) {
- $this->editor->setName($this->getName());
- $this->editor->setCaption($this->getCaption());
- $this->editor->_required = $this->isRequired();
- $ret = $this->editor->renderGetContentJS();
- return $ret;
- } else {
- parent::renderGetContentJS();
- }
- }
- return false;
- }
-
- /**
* XoopsFormEditor::render()
*
* @return
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formelement.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formelement.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formelement.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -434,37 +434,6 @@
}
/**
- * Render custom javascript get content code
- *
- * @seealso XoopsForm::renderGetContentJS
- */
- function renderGetContentJS()
- {
- // render custom get content code if any
- if (!empty($this->customGetContentCode)) {
- return implode(NWLINE, $this->customGetContentCode);
- // generate get content code if required
- } else if ($eltname = $this->getName()) {
- // $eltname = $this->getName();
- $eltcaption = $this->getCaption();
- $eltmsg = empty($eltcaption) ? sprintf(_FORM_ENTER, $eltname) : sprintf(_FORM_ENTER, $eltcaption);
- $eltmsg = str_replace(array(':' , '?' , '%'), '', $eltmsg);
- $eltmsg = str_replace('"', '\"', stripslashes($eltmsg));
- $eltmsg = strip_tags($eltmsg);
- echo $this->getFormType();
- switch ($this->getFormType()) {
- case 'checkbox':
- return "document.getElementById('{$eltname}').value";
- break;
- default:
- return "document.getElementById('{$eltname}').value";
- break;
- } // switch
- }
- return false;
- }
-
- /**
* Generates output for the element.
*
* This method is abstract and must be overwritten by the child classes.
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formfile.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formfile.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formfile.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -40,7 +40,7 @@
* @param string $name "name" attribute
* @param int $maxfilesize Maximum size for an uploaded file
*/
- function __construct($caption, $name, $maxfilesize)
+ function XoopsFormFile($caption, $name, $maxfilesize)
{
$this->setCaption($caption);
$this->setName($name);
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formradio.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formradio.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formradio.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -197,30 +197,4 @@
}
return $ret;
}
-
- /**
- * Render custom javascript get content code
- *
- * @seealso XoopsForm::renderGetContentJS
- */
- function renderGetContentJS()
- {
- // render custom validation code if any
- if (! empty($this->customGetContentCode)) {
- return implode("\n", $this->customGetContentCode);
- // generate validation code if required
- } else {
- $eltname = $this->getName();
- return "(function(){
- var radios = document.getElementsByName('{$eltname}');
- for(var i = 0; i < radios.length; i++){
- if(radios[i].checked){
- return radios[i].value;
- }
- }
- return null; // or undefined, or your preferred default for none checked
- })()";
- }
- return '';
- }
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formselect.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formselect.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formselect.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -238,33 +238,4 @@
}
return '';
}
-
- /**
- * Render custom javascript get content code
- *
- * @seealso XoopsForm::renderGetContentJS
- */
- function renderGetContentJS()
- {
- // render custom validation code if any
- if (! empty($this->customGetContentCode)) {
- return implode("\n", $this->customGetContentCode);
- // generate validation code if required
- } else {
- $eltname = $this->getName();
- return "(function(){
- var selectSelected = [];
- var options = document.getElementById('{$eltname}') && document.getElementById('{$eltname}').options;
- var opt;
- for (var i=0, iLen=options.length; i<iLen; i++) {
- opt = options[i];
- if (opt.selected) {
- selectSelected.push(opt.value || opt.text);
- }
- }
- return (selectSelected.length > 0) ? selectSelected : null;
- })()";
- }
- return '';
- }
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formselecteditor.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formselecteditor.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formselecteditor.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -27,7 +27,6 @@
*/
class XoopsFormSelectEditor extends XoopsFormElementTray
{
- var $modes = null;
var $allowed_editors = array();
var $form;
var $value;
@@ -41,13 +40,10 @@
* @param string $name editor name
* @param string $value Pre-selected text value
* @param bool $noHtml dohtml disabled
- * @param array $allowed_editors
- * @param mixed $modes Requested mode (or array of them)
*/
- function XoopsFormSelectEditor(&$form, $name = 'editor', $value = null, $nohtml = false, $allowed_editors = array(), $modes = null)
+ function XoopsFormSelectEditor(&$form, $name = 'editor', $value = null, $nohtml = false, $allowed_editors = array())
{
$this->XoopsFormElementTray(_SELECT);
- $this->modes = $modes;
$this->allowed_editors = $allowed_editors;
$this->form = &$form;
$this->name = $name;
@@ -65,13 +61,12 @@
xoops_load('XoopsEditorHandler');
$editor_handler = XoopsEditorHandler::getInstance();
$editor_handler->allowed_editors = $this->allowed_editors;
- $editor_handler->modes = $this->modes;
$option_select = new XoopsFormSelect("", $this->name, $this->value);
$extra = 'onchange="if(this.options[this.selectedIndex].value.length > 0 ){
window.document.forms.' . $this->form->getName() . '.submit();
}"';
$option_select->setExtra($extra);
- $option_select->addOptionArray($editor_handler->getList($this->nohtml, $this->modes));
+ $option_select->addOptionArray($editor_handler->getList($this->nohtml));
$this->addElement($option_select);
return parent::render();
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/include/functions.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/include/functions.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/include/functions.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -245,8 +245,7 @@
<meta name="copyright" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_copyright']) . '" />
<meta name="generator" content="XOOPS" />
<title>' . htmlspecialchars($xoopsConfig['sitename']) . '</title>
- <script type="text/javascript" src="' . XOOPS_URL . '/include/xoops.js"></script>
- <script type="text/javascript" src="' . XOOPS_URL . '/include/json2.js"></script>';
+ <script type="text/javascript" src="' . XOOPS_URL . '/include/xoops.js"></script>';
$themecss = xoops_getcss($xoopsConfig['theme_set']);
echo '<link rel="stylesheet" type="text/css" media="all" href="' . XOOPS_URL . '/xoops.css" />';
$language = xoops_getConfigOption('language');
Deleted: XoopsCore/branches/2.5.x/2.5.7/htdocs/include/json2.js
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/include/json2.js 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/include/json2.js 2013-10-06 23:36:44 UTC (rev 12154)
@@ -1,486 +0,0 @@
-/*
- json2.js
- 2013-05-26
-
- Public Domain.
-
- NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
-
- See http://www.JSON.org/js.html
-
-
- This code should be minified before deployment.
- See http://javascript.crockford.com/jsmin.html
-
- USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
- NOT CONTROL.
-
-
- This file creates a global JSON object containing two methods: stringify
- and parse.
-
- JSON.stringify(value, replacer, space)
- value any JavaScript value, usually an object or array.
-
- replacer an optional parameter that determines how object
- values are stringified for objects. It can be a
- function or an array of strings.
-
- space an optional parameter that specifies the indentation
- of nested structures. If it is omitted, the text will
- be packed without extra whitespace. If it is a number,
- it will specify the number of spaces to indent at each
- level. If it is a string (such as '\t' or ' '),
- it contains the characters used to indent at each level.
-
- This method produces a JSON text from a JavaScript value.
-
- When an object value is found, if the object contains a toJSON
- method, its toJSON method will be called and the result will be
- stringified. A toJSON method does not serialize: it returns the
- value represented by the name/value pair that should be serialized,
- or undefined if nothing should be serialized. The toJSON method
- will be passed the key associated with the value, and this will be
- bound to the value
-
- For example, this would serialize Dates as ISO strings.
-
- Date.prototype.toJSON = function (key) {
- function f(n) {
- // Format integers to have at least two digits.
- return n < 10 ? '0' + n : n;
- }
-
- return this.getUTCFullYear() + '-' +
- f(this.getUTCMonth() + 1) + '-' +
- f(this.getUTCDate()) + 'T' +
- f(this.getUTCHours()) + ':' +
- f(this.getUTCMinutes()) + ':' +
- f(this.getUTCSeconds()) + 'Z';
- };
-
- You can provide an optional replacer method. It will be passed the
- key and value of each member, with this bound to the containing
- object. The value that is returned from your method will be
- serialized. If your method returns undefined, then the member will
- be excluded from the serialization.
-
- If the replacer parameter is an array of strings, then it will be
- used to select the members to be serialized. It filters the results
- such that only members with keys listed in the replacer array are
- stringified.
-
- Values that do not have JSON representations, such as undefined or
- functions, will not be serialized. Such values in objects will be
- dropped; in arrays they will be replaced with null. You can use
- a replacer function to replace those with JSON values.
- JSON.stringify(undefined) returns undefined.
-
- The optional space parameter produces a stringification of the
- value that is filled with line breaks and indentation to make it
- easier to read.
-
- If the space parameter is a non-empty string, then that string will
- be used for indentation. If the space parameter is a number, then
- the indentation will be that many spaces.
-
- Example:
-
- text = JSON.stringify(['e', {pluribus: 'unum'}]);
- // text is '["e",{"pluribus":"unum"}]'
-
-
- text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
- // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
-
- text = JSON.stringify([new Date()], function (key, value) {
- return this[key] instanceof Date ?
- 'Date(' + this[key] + ')' : value;
- });
- // text is '["Date(---current time---)"]'
-
-
- JSON.parse(text, reviver)
- This method parses a JSON text to produce an object or array.
- It can throw a SyntaxError exception.
-
- The optional reviver parameter is a function that can filter and
- transform the results. It receives each of the keys and values,
- and its return value is used instead of the original value.
- If it returns what it received, then the structure is not modified.
- If it returns undefined then the member is deleted.
-
- Example:
-
- // Parse the text. Values that look like ISO date strings will
- // be converted to Date objects.
-
- myData = JSON.parse(text, function (key, value) {
- var a;
- if (typeof value === 'string') {
- a =
-/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
- if (a) {
- return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
- +a[5], +a[6]));
- }
- }
- return value;
- });
-
- myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
- var d;
- if (typeof value === 'string' &&
- value.slice(0, 5) === 'Date(' &&
- value.slice(-1) === ')') {
- d = new Date(value.slice(5, -1));
- if (d) {
- return d;
- }
- }
- return value;
- });
-
-
- This is a reference implementation. You are free to copy, modify, or
- redistribute.
-*/
-
-/*jslint evil: true, regexp: true */
-
-/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
- call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
- getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
- lastIndex, length, parse, prototype, push, replace, slice, stringify,
- test, toJSON, toString, valueOf
-*/
-
-
-// Create a JSON object only if one does not already exist. We create the
-// methods in a closure to avoid creating global variables.
-
-if (typeof JSON !== 'object') {
- JSON = {};
-}
-
-(function () {
- 'use strict';
-
- function f(n) {
- // Format integers to have at least two digits.
- return n < 10 ? '0' + n : n;
- }
-
- if (typeof Date.prototype.toJSON !== 'function') {
-
- Date.prototype.toJSON = function () {
-
- return isFinite(this.valueOf())
- ? this.getUTCFullYear() + '-' +
- f(this.getUTCMonth() + 1) + '-' +
- f(this.getUTCDate()) + 'T' +
- f(this.getUTCHours()) + ':' +
- f(this.getUTCMinutes()) + ':' +
- f(this.getUTCSeconds()) + 'Z'
- : null;
- };
-
- String.prototype.toJSON =
- Number.prototype.toJSON =
- Boolean.prototype.toJSON = function () {
- return this.valueOf();
- };
- }
-
- var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- gap,
- indent,
- meta = { // table of character substitutions
- '\b': '\\b',
- '\t': '\\t',
- '\n': '\\n',
- '\f': '\\f',
- '\r': '\\r',
- '"' : '\\"',
- '\\': '\\\\'
- },
- rep;
-
-
- function quote(string) {
-
-// If the string contains no control characters, no quote characters, and no
-// backslash characters, then we can safely slap some quotes around it.
-// Otherwise we must also replace the offending characters with safe escape
-// sequences.
-
- escapable.lastIndex = 0;
- return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
- var c = meta[a];
- return typeof c === 'string'
- ? c
- : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- }) + '"' : '"' + string + '"';
- }
-
-
- function str(key, holder) {
-
-// Produce a string from holder[key].
-
- var i, // The loop counter.
- k, // The member key.
- v, // The member value.
- length,
- mind = gap,
- partial,
- value = holder[key];
-
-// If the value has a toJSON method, call it to obtain a replacement value.
-
- if (value && typeof value === 'object' &&
- typeof value.toJSON === 'function') {
- value = value.toJSON(key);
- }
-
-// If we were called with a replacer function, then call the replacer to
-// obtain a replacement value.
-
- if (typeof rep === 'function') {
- value = rep.call(holder, key, value);
- }
-
-// What happens next depends on the value's type.
-
- switch (typeof value) {
- case 'string':
- return quote(value);
-
- case 'number':
-
-// JSON numbers must be finite. Encode non-finite numbers as null.
-
- return isFinite(value) ? String(value) : 'null';
-
- case 'boolean':
- case 'null':
-
-// If the value is a boolean or null, convert it to a string. Note:
-// typeof null does not produce 'null'. The case is included here in
-// the remote chance that this gets fixed someday.
-
- return String(value);
-
-// If the type is 'object', we might be dealing with an object or an array or
-// null.
-
- case 'object':
-
-// Due to a specification blunder in ECMAScript, typeof null is 'object',
-// so watch out for that case.
-
- if (!value) {
- return 'null';
- }
-
-// Make an array to hold the partial results of stringifying this object value.
-
- gap += indent;
- partial = [];
-
-// Is the value an array?
-
- if (Object.prototype.toString.apply(value) === '[object Array]') {
-
-// The value is an array. Stringify every element. Use null as a placeholder
-// for non-JSON values.
-
- length = value.length;
- for (i = 0; i < length; i += 1) {
- partial[i] = str(i, value) || 'null';
- }
-
-// Join all of the elements together, separated with commas, and wrap them in
-// brackets.
-
- v = partial.length === 0
- ? '[]'
- : gap
- ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
- : '[' + partial.join(',') + ']';
- gap = mind;
- return v;
- }
-
-// If the replacer is an array, use it to select the members to be stringified.
-
- if (rep && typeof rep === 'object') {
- length = rep.length;
- for (i = 0; i < length; i += 1) {
- if (typeof rep[i] === 'string') {
- k = rep[i];
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- } else {
-
-// Otherwise, iterate through all of the keys in the object.
-
- for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- }
-
-// Join all of the member texts together, separated with commas,
-// and wrap them in braces.
-
- v = partial.length === 0
- ? '{}'
- : gap
- ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
- : '{' + partial.join(',') + '}';
- gap = mind;
- return v;
- }
- }
-
-// If the JSON object does not yet have a stringify method, give it one.
-
- if (typeof JSON.stringify !== 'function') {
- JSON.stringify = function (value, replacer, space) {
-
-// The stringify method takes a value and an optional replacer, and an optional
-// space parameter, and returns a JSON text. The replacer can be a function
-// that can replace values, or an array of strings that will select the keys.
-// A default replacer method can be provided. Use of the space parameter can
-// produce text that is more easily readable.
-
- var i;
- gap = '';
- indent = '';
-
-// If the space parameter is a number, make an indent string containing that
-// many spaces.
-
- if (typeof space === 'number') {
- for (i = 0; i < space; i += 1) {
- indent += ' ';
- }
-
-// If the space parameter is a string, it will be used as the indent string.
-
- } else if (typeof space === 'string') {
- indent = space;
- }
-
-// If there is a replacer, it must be a function or an array.
-// Otherwise, throw an error.
-
- rep = replacer;
- if (replacer && typeof replacer !== 'function' &&
- (typeof replacer !== 'object' ||
- typeof replacer.length !== 'number')) {
- throw new Error('JSON.stringify');
- }
-
-// Make a fake root object containing our value under the key of ''.
-// Return the result of stringifying the value.
-
- return str('', {'': value});
- };
- }
-
-
-// If the JSON object does not yet have a parse method, give it one.
-
- if (typeof JSON.parse !== 'function') {
- JSON.parse = function (text, reviver) {
-
-// The parse method takes a text and an optional reviver function, and returns
-// a JavaScript value if the text is a valid JSON text.
-
- var j;
-
- function walk(holder, key) {
-
-// The walk method is used to recursively walk the resulting structure so
-// that modifications can be made.
-
- var k, v, value = holder[key];
- if (value && typeof value === 'object') {
- for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
- v = walk(value, k);
- if (v !== undefined) {
- value[k] = v;
- } else {
- delete value[k];
- }
- }
- }
- }
- return reviver.call(holder, key, value);
- }
-
-
-// Parsing happens in four stages. In the first stage, we replace certain
-// Unicode characters with escape sequences. JavaScript handles many characters
-// incorrectly, either silently deleting them, or treating them as line endings.
-
- text = String(text);
- cx.lastIndex = 0;
- if (cx.test(text)) {
- text = text.replace(cx, function (a) {
- return '\\u' +
- ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- });
- }
-
-// In the second stage, we run the text against regular expressions that look
-// for non-JSON patterns. We are especially concerned with '()' and 'new'
-// because they can cause invocation, and '=' because it can cause mutation.
-// But just to be safe, we want to reject all unexpected forms.
-
-// We split the second stage into 4 regexp operations in order to work around
-// crippling inefficiencies in IE's and Safari's regexp engines. First we
-// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
-// replace all simple value tokens with ']' characters. Third, we delete all
-// open brackets that follow a colon or comma or that begin the text. Finally,
-// we look to see that the remaining characters are only whitespace or ']' or
-// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
-
- if (/^[\],:{}\s]*$/
- .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
- .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
- .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
-
-// In the third stage we use the eval function to compile the text into a
-// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
-// in JavaScript: it can begin a block or an object literal. We wrap the text
-// in parens to eliminate the ambiguity.
-
- j = eval('(' + text + ')');
-
-// In the optional fourth stage, we recursively walk the new structure, passing
-// each name/value pair to a reviver function for possible transformation.
-
- return typeof reviver === 'function'
- ? walk({'': j}, '')
- : j;
- }
-
-// If the text is not JSON parseable, then a SyntaxError is thrown.
-
- throw new SyntaxError('JSON.parse');
- };
- }
-}());
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/include/site-closed.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/include/site-closed.php 2013-10-06 19:11:55 UTC (rev 12153)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/include/site-closed.php 2013-10-06 23:36:44 UTC (rev 12154)
@@ -46,8 +46,6 @@
'plugins' => array()));
$xoTheme->addScript('/include/xoops.js', array(
'type' => 'text/javascript'));
- $xoTheme->addScript('/include/json2.js', array(
- 'type' => 'text/javascript'));
$xoopsTpl =& $xoTheme->template;
$xoopsTpl->assign(array(
'xoops_theme' => $xoopsConfig['theme_set'] ,
|