示例#1
0
 /**
  * Gets the comment count on the specified id
  *
  * @version 1.0.0
  * @since   1.0.0
  * @author  Richard Clifford, Dan Aldridge
  *
  * @return  bool
  */
 function makeSubmitForm()
 {
     $rand = rand(1, 99);
     $objTPL = coreObj::getTPL();
     $objPage = coreObj::getPage();
     $objSession = coreObj::getSession();
     $objForm = coreObj::getForm();
     $objTPL->set_filenames(array('submitCommentsForm_' . $rand => 'modules/core/template/comments/submitComment.tpl'));
     $objPage->addJSFile('/' . root() . 'scripts/comments.js');
     $sess_id = $_SESSION[$this->module]['comment_' . $this->module_id] = md5(time() . $rand);
     $objTPL->assign_vars(array('FORM_START' => $objForm->start('comments', array('method' => 'POST', 'action' => $this->aURL[0] . '?mode=postComment')), 'FORM_END' => $objForm->finish(), 'SUBMIT' => $objForm->button('submit', 'Submit'), 'L_SUBMIT_COMMENT' => 'Submit a comment:', 'TEXTAREA' => $objForm->textarea('comment', ''), 'HIDDEN' => $objForm->inputbox('sessid', 'hidden', $sess_id) . $objForm->inputbox('module', 'hidden', $this->module)));
     //and then output the comments to the parent template
     $objTPL->assign_var_from_handle('_NEW_COMMENT', 'submitCommentsForm_' . $rand);
     return true;
 }