Ejemplo n.º 1
0
 /**
  * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
  * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
  * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
  *
  * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
  */
 function tpl_preview__comments()
 {
     require_lang('comcode');
     require_javascript('javascript_swfupload');
     require_javascript('javascript_posting');
     $content = do_lorem_template('ATTACHMENT', array('I' => placeholder_number(), 'POSTING_FIELD_NAME' => ''));
     $attachments = do_lorem_template('ATTACHMENTS', array('ATTACHMENT_TEMPLATE' => $content, 'IMAGE_TYPES' => placeholder_types(), 'POSTING_FIELD_NAME' => '', 'ATTACHMENTS' => $content, 'MAX_ATTACHMENTS' => placeholder_number(), 'NUM_ATTACHMENTS' => placeholder_number()));
     $ret = do_lorem_template('COMMENTS_POSTING_FORM', array('JOIN_BITS' => lorem_phrase_html(), 'ATTACHMENTS' => $attachments, 'ATTACH_SIZE_FIELD' => '', 'POST_WARNING' => lorem_phrase(), 'COMMENT_TEXT' => lorem_sentence_html(), 'GET_EMAIL' => lorem_word_html(), 'EMAIL_OPTIONAL' => lorem_word_html(), 'GET_TITLE' => true, 'EM' => placeholder_emoticon_chooser(), 'DISPLAY' => lorem_phrase(), 'COMMENT_URL' => placeholder_url(), 'SUBMIT_NAME' => lorem_word(), 'TITLE' => lorem_word(), 'MAKE_POST' => true, 'CREATE_TICKET_MAKE_POST' => true, 'FIRST_POST' => lorem_paragraph_html(), 'FIRST_POST_URL' => placeholder_url()));
     $ret->attach(do_lorem_template('COMMENT_AJAX_HANDLER', array('OPTIONS' => '', 'HASH' => '')));
     return array(lorem_globalise($ret, NULL, '', true));
 }
Ejemplo n.º 2
0
 /**
  * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
  * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
  * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
  *
  * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
  */
 function tpl_preview__attachments()
 {
     require_javascript('javascript_validation');
     require_javascript('javascript_swfupload');
     require_javascript('javascript_posting');
     require_javascript('javascript_editing');
     $content = do_lorem_template('ATTACHMENT', array('I' => placeholder_number(), 'POSTING_FIELD_NAME' => ''));
     $attachments = do_lorem_template('ATTACHMENTS', array('ATTACHMENT_TEMPLATE' => $content, 'IMAGE_TYPES' => placeholder_types(), 'ATTACHMENTS' => $content, 'POSTING_FIELD_NAME' => '', 'MAX_ATTACHMENTS' => placeholder_number(), 'NUM_ATTACHMENTS' => placeholder_number()));
     return array(lorem_globalise(do_lorem_template('POSTING_FORM', array('TABINDEX_PF' => placeholder_number(), 'JAVASCRIPT' => '', 'PREVIEW' => lorem_phrase(), 'COMCODE_EDITOR' => lorem_phrase(), 'COMCODE_EDITOR_SMALL' => lorem_phrase(), 'CLASS' => lorem_phrase(), 'COMCODE_URL' => placeholder_url(), 'EXTRA' => lorem_phrase(), 'POST_COMMENT' => lorem_phrase(), 'EMOTICON_CHOOSER' => lorem_phrase(), 'SUBMIT_NAME' => lorem_word(), 'HIDDEN_FIELDS' => '', 'COMCODE_HELP' => lorem_phrase(), 'URL' => placeholder_url(), 'POST' => lorem_phrase(), 'DEFAULT_PARSED' => lorem_phrase(), 'CONTINUE_URL' => placeholder_url(), 'ATTACHMENTS' => $attachments, 'SPECIALISATION' => placeholder_fields(), 'SPECIALISATION2' => placeholder_fields())), NULL, '', true));
 }