}
}
- function getEventList()
- {
- return array('AdminPrePageFoot','AdminPrePageHead');
- }
-
- function event_AdminPrePageHead($data)
- {
- if ($data['action'] != 'templateedit' && $data['action'] != 'templateupdate') return;
-// if ($data['action'] == 'templateedit') {
- $templateId = intRequestVar('templateid');
- $tempalteName = TEMPLATE::getNameFromId($templateId);
- $tempalteDesc = TEMPLATE::getDesc($templateId);
- if (strpos(strtolower($tempalteName), 'ezcommentform') === false &&
- strpos(strtolower($tempalteDesc), 'ezcommentform') === false) {
- return;
- }
-// }
- $data['extrahead'] .= '<script type="text/javascript" src="' . $this->getAdminURL() . 'jquery-1.2.1.pack.js">'
- . '</script>'
- . '<script type="text/javascript" src="' . $this->getAdminURL() . 'jquery.cookie.js">'
- . '</script>';
- }
-
- function event_AdminPrePageFoot($data)
- {
- if ($data['action'] != 'templateedit' && $data['action'] != 'templateupdate') return;
-// if ($data['action'] == 'templateedit') {
- $templateId = intRequestVar('templateid');
- $tempalteName = TEMPLATE::getNameFromId($templateId);
- $tempalteDesc = TEMPLATE::getDesc($templateId);
- if (strpos(strtolower($tempalteName), 'ezcommentform') === false &&
- strpos(strtolower($tempalteDesc), 'ezcommentform') === false) {
- return;
- }
-// }
- $title = _NP_EZCOMMENT2_FORM_TEMPLATES;
- $loggedin = _NP_EZCOMMENT2_FORM_LOGGEDIN;
- $notLoggedin = _NP_EZCOMMENT2_FORM_NOTLOGGEDIN;
- echo <<<___SCRIPT___
-
-<script type="text/javascript">
-$('table').ready(function(){
- var row = $('tr').get();
- var title = $(row[5]).children();
- title.text('{$title}');
- for (var i=6;i<row.length-2;i++) {
- var tcol = $(row[i]).children();
- var txta = $(tcol[1]).children();
- if ($(txta[0]).attr('name') == 'ITEM') {
- $(tcol[0]).text('{$loggedin}');
- $(txta[0]).attr('rows', '15')
- } else if ($(txta[0]).attr('name') == 'COMMENTS_BODY') {
- $(tcol[0]).text('{$notLoggedin}');
- $(txta[0]).attr('rows', '15')
- } else {
- $(row[i]).remove();
- }
- }
-});
-</script>
-
-___SCRIPT___;
- }
function doTemplateVar(&$item,
$showType = '',
'rememberchecked' => $checked
);
if ($member && $member->isLoggedIn()) {
- $formType = 'ITEM';
+ $formType = 'COMMENT_FORM_LOGGEDIN';
$loginMember = $member->createFromID($member->getID());
$formdata['membername'] = $this->_hsc($loginMember->getDisplayName());
} else {
- $formType = 'COMMENTS_BODY';
+ $formType = 'COMMENT_FORM_NOTLOGGEDIN';
}
$contents = $template[$formType];
$formAction =& new EzCommentFormActions($commentItem, $formdata, $loginMember);
}
// LIST END -----------------------------------------
+ function getTemplateParts()
+ {
+ $this->languageInclude();
+ return array(
+ 'COMMENT_FORM_LOGGEDIN' => _NP_EZCOMMENT2_FORM_LOGGEDIN,
+ 'COMMENT_FORM_NOTLOGGEDIN' => _NP_EZCOMMENT2_FORM_NOTLOGGEDIN,
+ );
+ }
+
function _hsc($str)
{
return htmlspecialchars($str, ENT_QUOTES, _CHARSET);
<nucleusskin>
<meta>
- <template name="EzCommentListDefault" />
- <template name="EzCommentFormDefault" />
+ <template name="EzCommentTemplateDefault" />
<info><![CDATA[Comment form template for NP_EzComment2]]></info>
</meta>
- <template name="EzCommentListDefault">
- <description>EzCommentList_Default</description>
+ <template name="EzCommentTemplateDefault">
+ <description>EzCommentTemplateDefault</description>
<part name="COMMENTS_BODY"><![CDATA[<li><a href="<%itemlink%>#c<%commentid%>"><%user(realname)%> : <%excerpt%></a></li>
]]></part>
<part name="COMMENTS_ONE"><![CDATA[Comment]]></part>
- </template>
-
-
- <template name="EzCommentFormDefault">
- <description>EzCommentForm_Default</description>
- <part name="TEXT"><![CDATA[<a id="nucleus_cf"></a>
+ <part name="COMMENT_FORM_LOGGEDIN"><![CDATA[<a id="nucleus_cf"></a>
<form method="post" action="#nucleus_cf">
<div class="commentform">
<input type="hidden" name="action" value="addcomment" />
-<input type="hidden" name="url" value="<%formdata(destinationurl)%>" />
-<input type="hidden" name="itemid" value="<%itemid%>" />
- <%errordiv%>
+<input type="hidden" name="url" value="<formdata(destinationurl)%>" />
+<input type="hidden" name="itemid" value="<itemid()%>" />
+ <%errordiv()%>
<label for="nucleus_cf_body"><%text(_COMMENTFORM_COMMENT)%></label>
<textarea name="body" class="formfield" cols="40" rows="10" id="nucleus_cf_body"><%formdata(body)%></textarea>
-
<%text(_COMMENTFORM_YOUARE)%> <%formdata(membername)%>
- <small>(<a href="<%self%>?action=logout" title="<%text(_LOGOUT)%>"><%text(_LOGOUT)%></a>)</small>
-
+ <small>(<a href="<%self()%>?action=logout" title="<%text(_LOGOUT)%>"><%text(_LOGOUT)%></a>)</small>
<input type="submit" alt="<%text(_COMMENTFORM_SUBMIT)%>" value="<%text(_COMMENTFORM_SUBMIT)%>" class="formbutton" />
-
<%callback(FormExtra,commentform-loggedin)%>
</div>
-</form>
-]]></part>
+</form>]]></part>
+
- <part name="COMMENTS_BODY"><![CDATA[<a id="nucleus_cf"></a>
+ <part name="COMMENT_FORM_NOTLOGGEDIN"><![CDATA[<a id="nucleus_cf"></a>
<form method="post" action="#nucleus_cf">
<div class="commentform">
<input type="hidden" name="action" value="addcomment" />
<input type="hidden" name="url" value="<%formdata(destinationurl)%>" />
-<input type="hidden" name="itemid" value="<%itemid%>" />
- <%errordiv%>
-
+<input type="hidden" name="itemid" value="<%itemid()%>" /> <%errordiv()%>
<label for="nucleus_cf_body"><%text(_COMMENTFORM_COMMENT)%></label>
<textarea name="body" class="formfield" cols="40" rows="10" id="nucleus_cf_body"><%formdata(body)%></textarea>
-
<label for="nucleus_cf_name"><%text(_COMMENTFORM_NAME)%></label>
<input name="user" size="40" maxlength="40" value="<%formdata(user)%>" class="formfield" id="nucleus_cf_name" />
-
<label for="nucleus_cf_mail"><%text(_COMMENTFORM_MAIL)%></label>
<input name="userid" size="40" maxlength="60" value="<%formdata(userid)%>" class="formfield" id="nucleus_cf_mail" />
-
<label for="nucleus_cf_email"><%text(_COMMENTFORM_EMAIL)%></label>
<input name="email" size="40" maxlength="100" value="<%formdata(email)%>" class="formfield" id="nucleus_cf_email" />
-
<%callback(FormExtra,commentform-notloggedin)%>
-
<input type="checkbox" value="1" name="remember" id="nucleus_cf_remember" <%formdata(rememberchecked)%> />
<label for="nucleus_cf_remember"><%text(_COMMENTFORM_REMEMBER)%></label>
-
<input type="submit" alt="<%text(_COMMENTFORM_SUBMIT)%>" value="<%text(_COMMENTFORM_SUBMIT)%>" class="formbutton" />
</div>
-</form>
-]]></part>
+</form>]]></part>
+
+ <part name="STP_PLUGINNAME"><![CDATA[NP_EzComment2]]></part>
</template>