/** * 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__category_list() { $cat_entry = new ocp_tempcode(); foreach (placeholder_array() as $key => $values) { $cat_entry->attach(do_lorem_template('CATEGORY_ENTRY', array('ID' => placeholder_id(), 'NAME_FIELD' => $values, 'AJAX_EDIT_URL' => placeholder_url(), 'URL' => placeholder_url(), 'REP_IMAGE' => placeholder_image(), 'CHILDREN' => lorem_phrase(), 'NAME' => lorem_word(), 'NAME_PLAIN' => lorem_word_html(), 'NUM_CHILDREN' => '3', 'NUM_ENTRIES' => '2', 'NUM_CHILDREN_RECURSIVE' => '3', 'NUM_ENTRIES_DIRECT' => '2'))); } return array(lorem_globalise(do_lorem_template('CATEGORY_LIST', array('CONTENT' => $cat_entry)), NULL, '', true)); }
/** * 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__iotd_view_screen_iotd() { //Wrap 'IOTD_VIEW_SCREEN_IOTD' with 'NEXT_BROWSER_SCREEN' $content = new ocp_tempcode(); $content->attach(do_lorem_template('IOTD_VIEW_SCREEN_IOTD', array('SUBMITTER' => lorem_word(), 'ID' => placeholder_id(), 'VIEWS' => placeholder_number(), 'THUMB' => placeholder_image(), 'DATE' => placeholder_time(), 'DATE_RAW' => placeholder_date_raw(), 'URL' => placeholder_url(), 'CAPTION' => lorem_phrase()))); $browse = do_lorem_template('NEXT_BROWSER_BROWSE_NEXT', array('NEXT_LINK' => placeholder_url(), 'PREVIOUS_LINK' => placeholder_url(), 'PAGE_NUM' => placeholder_number(), 'NUM_PAGES' => placeholder_number())); return array(lorem_globalise(do_lorem_template('NEXT_BROWSER_SCREEN', array('TITLE' => lorem_title(), 'CONTENT' => $content, 'BROWSE' => $browse)), NULL, '', true)); }
/** * 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__list_catalogue_products() { require_lang('shopping'); require_lang('catalogues'); require_lang('ecommerce'); require_css('catalogues'); require_lang('catalogues'); $fields = new ocp_tempcode(); $fields_table = new ocp_tempcode(); foreach (placeholder_array() as $v) { $_field = do_lorem_template('CATALOGUE_products_ENTRY_FIELD', array('ENTRYID' => placeholder_random_id(), 'CATALOGUE' => lorem_phrase(), 'TYPE' => lorem_word(), 'FIELD' => lorem_word(), 'FIELDID' => placeholder_random_id(), '_FIELDID' => placeholder_random_id(), 'FIELDTYPE' => lorem_word(), 'VALUE_PLAIN' => lorem_phrase(), 'VALUE' => lorem_phrase()), NULL, false, 'CATALOGUE_DEFAULT_ENTRY_FIELD'); $fields->attach($_field); } $cart_link = do_lorem_template('CATALOGUE_ENTRY_ADD_TO_CART', array('OUT_OF_STOCK' => lorem_phrase(), 'ACTION_URL' => placeholder_url(), 'PRODUCT_ID' => placeholder_id(), 'ALLOW_OPTOUT_TAX' => lorem_phrase(), 'PURCHASE_ACTION_URL' => placeholder_url(), 'CART_URL' => placeholder_url())); $cart_logo = do_lorem_template('CART_LOGO', array('URL' => placeholder_url(), 'TITLE' => lorem_phrase()), NULL, false); $rating_inside = new ocp_tempcode(); $entry = do_lorem_template('CATALOGUE_products_ENTRY_EMBED', array('FIELD_0' => lorem_phrase(), 'FIELD_1' => lorem_phrase(), 'PRODUCT_CODE' => placeholder_id(), 'FIELD_9' => lorem_phrase(), 'FIELD_2' => placeholder_number(), 'PRICE' => placeholder_number(), 'RATING' => $rating_inside, 'FIELD_7_THUMB' => placeholder_image(), 'FIELD_7_PLAIN' => placeholder_url(), 'MAP_TABLE' => placeholder_table(), 'CART_BUTTONS' => $cart_link, 'CART_LINK' => $cart_logo, 'FIELDS' => $fields, 'URL' => placeholder_url(), 'VIEW_URL' => placeholder_url())); return array(lorem_globalise($entry, NULL, '', true)); }
/** * 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__purchase_wizard_stage_pay() { return array(lorem_globalise(do_lorem_template('PURCHASE_WIZARD_STAGE_PAY', array('LOGOS' => placeholder_image(), 'TRANSACTION_BUTTON' => placeholder_button(), 'CURRENCY' => placeholder_number(), 'ITEM_NAME' => lorem_word(), 'TITLE' => lorem_phrase(), 'LENGTH' => "3", 'LENGTH_UNITS' => "\$", 'PURCHASE_ID' => placeholder_id(), 'PRICE' => "123.45")), NULL, '', true)); }
/** * 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__news_full_screen() { require_lang('news'); $tags = array(); foreach (placeholder_array() as $k => $v) { $tags[] = array('TAG' => lorem_word(), 'LINK_LIMITEDSCOPE' => placeholder_url(), 'LINK_FULLSCOPE' => placeholder_url()); } $comment_details = do_lorem_template('COMMENTS_POSTING_FORM', array('JOIN_BITS' => lorem_phrase_html(), 'USE_CAPTCHA' => false, 'EMAIL_OPTIONAL' => lorem_word(), 'POST_WARNING' => '', 'COMMENT_TEXT' => '', 'GET_EMAIL' => true, 'GET_TITLE' => true, 'EM' => placeholder_emoticon_chooser(), 'DISPLAY' => 'block', 'COMMENT_URL' => placeholder_url(), 'TITLE' => lorem_phrase(), 'MAKE_POST' => true, 'CREATE_TICKET_MAKE_POST' => true, 'FIRST_POST_URL' => '', 'FIRST_POST' => '')); return array(lorem_globalise(do_lorem_template('NEWS_FULL_SCREEN', array('ID' => placeholder_id(), 'CATEGORY_ID' => placeholder_id(), 'BLOG' => TRUE, '_TITLE' => lorem_phrase(), 'TAGS' => do_lorem_template('TAGS', array('TAGS' => $tags, 'TYPE' => '')), 'CATEGORIES' => placeholder_array(), 'NEWSLETTER_URL' => addon_installed('newsletter') ? placeholder_url() : '', 'ADD_DATE_RAW' => placeholder_date_raw(), 'EDIT_DATE_RAW' => '', 'SUBMITTER' => placeholder_id(), 'CATEGORY' => lorem_word(), 'IMG' => placeholder_image(), 'TITLE' => lorem_title(), 'VIEWS' => "3", 'COMMENT_DETAILS' => $comment_details, 'RATING_DETAILS' => lorem_sentence(), 'TRACKBACK_DETAILS' => lorem_sentence(), 'DATE' => placeholder_time(), 'AUTHOR' => lorem_word(), 'AUTHOR_URL' => placeholder_url(), 'NEWS_FULL' => lorem_paragraph(), 'NEWS_FULL_PLAIN' => lorem_sentence(), 'EDIT_URL' => placeholder_url(), 'ARCHIVE_URL' => placeholder_url(), 'SUBMIT_URL' => placeholder_url(), 'WARNING_DETAILS' => '')), NULL, '', true)); }
/** * 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__download_screen() { require_lang('galleries'); $images_details = new ocp_tempcode(); foreach (placeholder_array() as $row) { $image = do_lorem_template('DOWNLOAD_SCREEN_IMAGE', array('ID' => placeholder_id(), 'VIEW_URL' => placeholder_url(), 'EDIT_URL' => placeholder_url(), 'THUMB' => placeholder_image(), 'COMMENT' => lorem_phrase())); $cell = do_lorem_template('DOWNLOAD_GALLERY_IMAGE_CELL', array('CONTENT' => $image)); $images_details->attach(do_lorem_template('DOWNLOAD_GALLERY_ROW', array('CELLS' => $cell))); } return array(lorem_globalise(do_lorem_template('DOWNLOAD_SCREEN', array('ORIGINAL_FILENAME' => lorem_phrase(), 'TAGS' => lorem_word_html(), 'LICENCE' => lorem_phrase(), 'LICENCE_TITLE' => lorem_phrase(), 'LICENCE_HYPERLINK' => placeholder_link(), 'SUBMITTER' => placeholder_id(), 'EDIT_DATE' => placeholder_time(), 'EDIT_DATE_RAW' => placeholder_date_raw(), 'VIEWS' => lorem_phrase(), 'DATE' => placeholder_time(), 'DATE_RAW' => placeholder_date_raw(), 'NUM_DOWNLOADS' => placeholder_number(), 'TITLE' => lorem_title(), 'NAME' => lorem_phrase(), 'OUTMODE_URL' => placeholder_url(), 'WARNING_DETAILS' => '', 'EDIT_URL' => placeholder_url(), 'ADD_IMG_URL' => placeholder_url(), 'DESCRIPTION' => lorem_paragraph_html(), 'ADDITIONAL_DETAILS' => lorem_sentence_html(), 'IMAGES_DETAILS' => $images_details, 'ID' => placeholder_id(), 'FILE_SIZE' => placeholder_filesize(), 'AUTHOR_URL' => placeholder_url(), 'AUTHOR' => lorem_phrase(), 'TRACKBACK_DETAILS' => lorem_sentence_html(), 'RATING_DETAILS' => lorem_sentence_html(), 'COMMENTS_DETAILS' => lorem_sentence_html(), 'NUM_IMAGES' => '3')), NULL, '', true)); }
/** * 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__comcode_carousel() { $content = new ocp_tempcode(); foreach (placeholder_array(10) as $v) { $content->attach(placeholder_image()); } return array(lorem_globalise(do_lorem_template('COMCODE_CAROUSEL', array('CONTENT' => $content, 'SCROLL_AMOUNT' => placeholder_number())), NULL, '', true)); }
/** * 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__gallery_regular_mode_screen() { $tags = do_lorem_template('TAGS', array('LINK_FULLSCOPE' => lorem_word(), 'TAG' => lorem_word(), 'TAGS' => placeholder_array(), 'TYPE' => NULL)); $results_browser = placeholder_result_browser(); $entry = new ocp_tempcode(); $map = array('TITLE' => lorem_phrase(), 'DESCRIPTION' => lorem_paragraph(), 'TYPE' => 'image', 'ID' => placeholder_id(), 'FILE_SIZE' => lorem_word(), 'SUBMITTER' => lorem_word(), 'FULL_URL' => placeholder_url(), 'THUMB_URL' => placeholder_url(), 'CAT' => lorem_word(), 'THUMB' => placeholder_image(), 'VIEW_URL' => placeholder_url(), 'EDIT_DATE_RAW' => placeholder_time(), 'ADD_DATE_RAW' => placeholder_time(), 'VIEWS' => placeholder_number()); $entry = do_lorem_template('GALLERY_IMAGE', $map); $entries = new ocp_tempcode(); $entries->attach(do_lorem_template('GALLERY_ENTRY_WRAP', array('ENTRY' => $entry) + $map)); $video_details = do_lorem_template('GALLERY_VIDEO_INFO', array('HEIGHT' => placeholder_number(), 'WIDTH' => placeholder_number(), 'LENGTH' => placeholder_number())); $map = array('VIDEO_DETAILS' => $video_details, 'TITLE' => lorem_phrase(), 'DESCRIPTION' => lorem_phrase(), 'ADD_DATE_RAW' => placeholder_time(), 'EDIT_DATE_RAW' => placeholder_time(), 'VIEWS' => placeholder_number(), 'VIEW_URL' => placeholder_url(), 'SUBMITTER' => placeholder_id(), 'ID' => placeholder_id(), 'THUMB' => placeholder_image()); $entry = do_lorem_template('GALLERY_VIDEO', $map); $entries->attach(do_lorem_template('GALLERY_ENTRY_WRAP', array('ENTRY' => $entry) + $map)); $children = do_lorem_template('GALLERY_SUBGALLERY_WRAP', array('CONTENT' => do_lorem_template('GALLERY_SUBGALLERY', array('THUMB' => '', 'NUM_VIDEOS' => lorem_word(), 'NUM_IMAGES' => lorem_word(), 'NUM_CHILDREN' => lorem_word(), 'ID' => lorem_word(), 'LANG' => lorem_word(), 'ADD_DATE_RAW' => placeholder_date_raw(), 'ADD_DATE' => lorem_word(), 'MEMBER_INFO' => lorem_paragraph(), 'URL' => placeholder_url(), 'PIC' => placeholder_image_url(), 'TITLE' => lorem_phrase(), 'COMMENTS' => lorem_paragraph())))); $comment_details = do_lorem_template('COMMENTS_POSTING_FORM', array('JOIN_BITS' => lorem_phrase_html(), 'USE_CAPTCHA' => false, 'EMAIL_OPTIONAL' => lorem_word(), 'POST_WARNING' => '', 'COMMENT_TEXT' => '', 'GET_EMAIL' => true, 'GET_TITLE' => true, 'EM' => placeholder_emoticon_chooser(), 'DISPLAY' => 'block', 'COMMENT_URL' => placeholder_url(), 'TITLE' => lorem_phrase(), 'MAKE_POST' => true, 'CREATE_TICKET_MAKE_POST' => true, 'FIRST_POST_URL' => '', 'FIRST_POST' => '')); return array(lorem_globalise(do_lorem_template('GALLERY_REGULAR_MODE_SCREEN', array('_TITLE' => lorem_phrase(), 'RESULTS_BROWSER' => $results_browser, 'TAGS' => $tags, 'CAT' => lorem_word(), 'MEMBER_DETAILS' => lorem_sentence_html(), 'RATING_DETAILS' => lorem_sentence_html(), 'COMMENT_DETAILS' => $comment_details, 'ADD_GALLERY_URL' => placeholder_url(), 'EDIT_URL' => placeholder_url(), 'CHILDREN' => $children, 'TITLE' => lorem_title(), 'DESCRIPTION' => lorem_paragraph_html(), 'IMAGE_URL' => placeholder_url(), 'VIDEO_URL' => placeholder_url(), 'MAY_DOWNLOAD' => lorem_phrase(), 'ENTRIES' => $entries, 'SORTING' => lorem_phrase())), NULL, '', true)); }