<?php\r
/*\r
* Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
- * Copyright (C) 2002-2009 The Nucleus Group\r
+ * Copyright (C) 2002-2010 The Nucleus Group\r
*\r
* This program is free software; you can redistribute it and/or\r
* modify it under the terms of the GNU General Public License\r
*/\r
/**\r
* @license http://nucleuscms.org/license.txt GNU General Public License\r
- * @copyright Copyright (C) 2002-2009 The Nucleus Group\r
+ * @copyright Copyright (C) 2002-2010 The Nucleus Group\r
* @version $Id$\r
* $NucleusJP: PAGEFACTORY.php,v 1.8.2.2 2007/10/30 16:12:27 shizuki Exp $\r
*/\r
}\r
\r
function parse_contents($which) {\r
+ if (!isset($this->variables[$which])) $this->variables[$which] = '';\r
echo htmlspecialchars($this->variables[$which],ENT_QUOTES);\r
}\r
\r
function parse_checkedonval($value, $name) {\r
+ if (!isset($this->variables[$name])) $this->variables[$name] = '';\r
if ($this->variables[$name] == $value)\r
echo 'checked="checked"';\r
}\r
\r
// extra javascript for input and textarea fields\r
function parse_jsinput($which) {\r
- global $CONF;\r
- $out = 'name="' . $which . '" id="input' . $which . '"';\r
+ global $CONF, $member;\r
+ \r
+ $attributes = " name=\"{$which}\"";\r
+ $attributes .= " id=\"input{$which}\"";\r
+ \r
if ($CONF['DisableJsTools'] != 1) {\r
- $out .= 'onkeyup="storeCaret(this); updPreview(' . $which . '); doMonitor();"'\r
- . 'onclick="storeCaret(this);"'\r
- . 'onselect="storeCaret(this);"';\r
- } elseif ($CONF['DisableJsTools'] == 0) {\r
- $out .= ' onkeyup="doMonitor();" onkeypress="shortCuts();"';\r
- } else {\r
- $out .= ' onkeyup="doMonitor();"';\r
+ $attributes .= ' onclick="storeCaret(this);"';\r
+ $attributes .= ' onselect="storeCaret(this);"';\r
+ if ($member->getAutosave()) {\r
+ $attributes .= " onkeyup=\"storeCaret(this); updPreview('{$which}'); doMonitor();\"";\r
+ } else {\r
+ $attributes .= " onkeyup=\"storeCaret(this); updPreview('{$which}');\"";\r
+ }\r
+ }\r
+ else {\r
+ if ($CONF['DisableJsTools'] == 0) {\r
+ $attributes .= ' onkeypress="shortCuts();"';\r
+ }\r
+ if ($member->getAutosave()) {\r
+ $attributes .= ' onkeyup="doMonitor();"';\r
+ }\r
}\r
- echo $out;\r
+ echo $attributes;\r
}\r
\r
// shows the javascript button bar\r
* convenience method\r
*/\r
function _jsbutton($type, $code ,$tooltip) {\r
- echo <<<__JSBUTTON__\r
- <span class="jsbutton" onmouseover="BtnHighlight(this);" onmouseout="BtnNormal(this);" onclick="{$code}">\r
- <img src="images/button-{$type}.gif" alt="{$tooltip}" width="16" height="16" />\r
+ ?>\r
+ <span class="jsbutton"\r
+ onmouseover="BtnHighlight(this);"\r
+ onmouseout="BtnNormal(this);"\r
+ onclick="<?php echo $code?>" >\r
+ <img src="images/button-<?php echo $type?>.gif" alt="<?php echo $tooltip?>" title="<?php echo $tooltip?>" width="16" height="16"/>\r
</span>\r
-\r
-__JSBUTTON__;\r
- }\r
-\r
+ <?php }\r
+ \r
function _jsbuttonspacer() {\r
echo '<span class="jsbuttonspacer"> </span>';\r
}\r