/** * 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_screen_products() { require_lang('catalogues'); require_css('catalogues'); $all_rating_criteria = array(); $all_rating_criteria[] = array('TITLE' => lorem_word(), 'RATING' => make_string_tempcode("6"), 'TYPE' => lorem_word()); $line = new ocp_tempcode(); foreach (placeholder_array(1) as $v) { $line->attach(do_lorem_template('CATALOGUE_products_LINE', array('FIELD_0' => lorem_phrase(), 'FIELD_7_THUMB' => lorem_phrase(), 'RATING' => new ocp_tempcode(), 'FIELD_2' => placeholder_number(), 'ADD_TO_CART' => placeholder_url(), 'VIEW_URL' => placeholder_url(), 'GO_FOR_IT' => lorem_phrase()))); } $entry = do_lorem_template('CATALOGUE_products_LINE_WRAP', array('CONTENT' => $line)); return array(lorem_globalise(do_lorem_template('CATALOGUE_DEFAULT_CATEGORY_SCREEN', array('ID' => placeholder_random_id(), 'ADD_DATE_RAW' => placeholder_time(), 'TITLE' => lorem_title(), '_TITLE' => lorem_phrase(), 'TAGS' => '', 'CATALOGUE' => lorem_word_2(), 'BROWSER' => '', 'SORTING' => '', 'ADD_LINK' => placeholder_url(), 'ADD_CAT_URL' => placeholder_url(), 'EDIT_CAT_URL' => placeholder_url(), 'EDIT_CATALOGUE_URL' => placeholder_url(), 'ENTRIES' => $entry, 'SUBCATEGORIES' => '', 'DESCRIPTION' => lorem_sentence(), 'CART_LINK' => placeholder_url(), 'TREE' => lorem_phrase())), 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__administrative__form_screen_input_permission() { require_lang('permissions'); $permission_rows = new ocp_tempcode(); foreach (placeholder_array() as $k => $v) { $overrides = new ocp_tempcode(); $all_global = true; foreach (placeholder_array() as $k => $v) { $overrides->attach(do_lorem_template('FORM_SCREEN_INPUT_PERMISSION_OVERRIDE', array('FORCE_PRESETS' => false, 'GROUP_NAME' => lorem_phrase(), 'VIEW_ACCESS' => '', 'TABINDEX' => placeholder_number(), 'GROUP_ID' => placeholder_random_id(), 'SP' => strval($k), 'ALL_GLOBAL' => true, 'TITLE' => lorem_phrase(), 'DEFAULT_ACCESS' => '', 'CODE' => '-1'))); } $permission_rows->attach(do_lorem_template('FORM_SCREEN_INPUT_PERMISSION', array('FORCE_PRESETS' => false, 'GROUP_NAME' => lorem_phrase(), 'OVERRIDES' => $overrides->evaluate(), 'ALL_GLOBAL' => true, 'VIEW_ACCESS' => '', 'TABINDEX' => placeholder_number(), 'GROUP_ID' => placeholder_random_id(), 'PINTERFACE_VIEW' => ''))); } $permission_rows->attach(do_lorem_template('FORM_SCREEN_INPUT_PERMISSION_MATRIX_OUTER', array('INNER' => lorem_word()))); $permission_rows->attach(do_lorem_template('FORM_SCREEN_INPUT_PERMISSION_ADMIN', array('PINTERFACE_VIEW' => lorem_word(), 'GROUP_ID' => placeholder_random_id(), 'GROUP_NAME' => lorem_phrase(), 'FORCE_PRESETS' => false, 'OVERRIDES' => placeholder_array()))); $field = do_lorem_template('FORM_SCREEN_INPUT_PERMISSION_MATRIX', array('TITLE' => lorem_phrase(), 'SERVER_ID' => placeholder_id(), 'COLOR' => lorem_word(), 'OVERRIDES' => placeholder_array(), 'PERMISSION_ROWS' => $permission_rows)); return array(lorem_globalise(do_lorem_template('FORM_GROUPED', array('URL' => '#', 'FIELD_GROUPS' => $field, 'TEXT' => '', 'SUBMIT_NAME' => lorem_word_2())), 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__table_category_screen__links() { $subcategory = new ocp_tempcode(); foreach (placeholder_array(3) as $k => $v) { $subcategory->attach(do_lorem_template('CATALOGUE_DEFAULT_SUBCATEGORY', array('ID' => placeholder_id(), 'CATALOGUE' => lorem_word_2(), 'URL' => placeholder_url(), 'NUM_CHILDREN' => '3', 'NUM_ENTRIES' => '2', 'NUM_CHILDREN_RECURSIVE' => '3', 'NUM_ENTRIES_DIRECT' => '2', 'NAME' => lorem_word()))); } $subcategories = do_lorem_template('CATALOGUE_DEFAULT_SUBCATEGORY_WRAP', array('CATALOGUE' => lorem_word(), 'CONTENT' => $subcategory)); $tags = do_lorem_template('TAGS', array('TAGS' => placeholder_array(), 'TYPE' => NULL, 'LINK_FULLSCOPE' => placeholder_url(), 'TAG' => lorem_word())); $row = new ocp_tempcode(); $entries = new ocp_tempcode(); $head = new ocp_tempcode(); foreach (placeholder_array() as $v) { $head->attach(do_lorem_template('CATALOGUE_links_TAB_FIELD_HEAD', array('SORT_ASC_SELECTED' => TRUE, 'SORT_DESC_SELECTED' => FALSE, 'SORT_URL_ASC' => placeholder_url(), 'SORT_URL_DESC' => placeholder_url(), 'CATALOGUE' => lorem_word(), 'FIELDID' => placeholder_random_id(), '_FIELDID' => placeholder_random_id(), 'FIELD' => $v, 'FIELDTYPE' => 'text'))); $entries->attach(do_lorem_template('CATALOGUE_links_TAB_FIELD', array('FIELDID' => placeholder_random_id(), 'ENTRYID' => placeholder_random_id(), 'VALUE' => lorem_phrase()))); } $row->attach(do_lorem_template('CATALOGUE_links_TAB_ENTRY', array('FIELDS_TABLE' => $head, 'VIEW_URL' => placeholder_url(), 'EDIT_URL' => placeholder_url(), 'FIELD_1_PLAIN' => lorem_phrase()))); $row->attach(do_lorem_template('CATALOGUE_links_TAB_ENTRY', array('FIELDS_TABLE' => $entries, 'VIEW_URL' => placeholder_url(), 'EDIT_URL' => placeholder_url(), 'FIELD_1_PLAIN' => lorem_phrase()))); $content = do_lorem_template('CATALOGUE_links_TAB_WRAP', array('CATALOGUE' => lorem_word(), 'CONTENT' => $row, 'FIELD_COUNT' => "3")); return array(lorem_globalise(do_lorem_template('CATALOGUE_links_CATEGORY_SCREEN', array('ID' => placeholder_id(), 'ADD_DATE_RAW' => placeholder_time(), 'TITLE' => lorem_title(), '_TITLE' => lorem_phrase(), 'TAGS' => $tags, 'CATALOGUE' => lorem_word_2(), 'BROWSER' => '', 'SORTING' => '', 'ADD_LINK' => placeholder_url(), 'ADD_CAT_URL' => placeholder_url(), 'EDIT_CAT_URL' => placeholder_url(), 'EDIT_CATALOGUE_URL' => placeholder_url(), 'ENTRIES' => $content, 'SUBCATEGORIES' => $subcategories, 'DESCRIPTION' => lorem_sentence(), 'CART_LINK' => placeholder_url(), 'TREE' => lorem_phrase())), 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__ocf_member_profile_screen() { require_lang('news'); $sections = array('contact' => lorem_word(), 'profile' => lorem_word_2(), 'views' => lorem_word(), 'usage' => lorem_word_2(), 'content' => lorem_word()); $actions = array(); $i = 0; $links = new ocp_tempcode(); foreach ($sections as $section_code => $section_title) { $links->attach(do_lorem_template('OCF_MEMBER_ACTION', array('ID' => strval($i), 'URL' => placeholder_url(), 'LANG' => lorem_word(), 'REL' => ''))); $actions[$section_code] = do_lorem_template('OCF_MEMBER_ACTION', array('ID' => strval($i), 'URL' => placeholder_url(), 'LANG' => lorem_word(), 'REL' => '', 'NAME' => $section_title, 'VALUE' => $links)); $i++; } require_lang('menus'); $tabs = array(); $tab_content = do_lorem_template('OCF_MEMBER_PROFILE_ABOUT', array('RIGHT_MARGIN' => lorem_phrase(), 'AVATAR_WIDTH' => placeholder_id(), 'PHOTO_WIDTH' => placeholder_id(), 'MOST_ACTIVE_FORUM' => lorem_phrase(), 'TIME_FOR_THEM' => placeholder_time(), 'TIME_FOR_THEM_RAW' => placeholder_date_raw(), 'SUBMIT_DAYS_AGO' => lorem_phrase(), 'SUBMIT_TIME_RAW' => placeholder_time(), 'LAST_VISIT_TIME_RAW' => placeholder_date_raw(), 'ONLINE_NOW' => lorem_phrase(), '_ONLINE_NOW' => false, 'BANNED' => lorem_phrase(), 'USER_AGENT' => lorem_phrase(), 'OPERATING_SYSTEM' => lorem_phrase(), 'DOB' => lorem_phrase(), 'IP_ADDRESS' => lorem_phrase(), 'COUNT_POSTS' => placeholder_number(), 'COUNT_POINTS' => placeholder_number(), 'PRIMARY_GROUP' => lorem_phrase(), 'PRIMARY_GROUP_ID' => placeholder_id(), 'PHOTO_URL' => placeholder_image_url(), 'PHOTO_THUMB_URL' => placeholder_image_url(), 'EMAIL_ADDRESS' => lorem_word(), 'AVATAR_URL' => placeholder_avatar(), 'SIGNATURE' => lorem_phrase(), 'JOIN_DATE' => placeholder_time(), 'JOIN_DATE_RAW' => placeholder_date_raw(), 'CUSTOM_FIELDS' => array(array('NAME' => lorem_phrase(), 'VALUE' => lorem_phrase(), 'ENCRYPTED_VALUE' => '')), 'ACTIONS_contact' => $actions['contact'], 'ACTIONS_profile' => $actions['profile'], 'ACTIONS_views' => $actions['views'], 'ACTIONS_usage' => $actions['usage'], 'ACTIONS_content' => $actions['content'], 'USERNAME' => lorem_word(), 'MEMBER_ID' => placeholder_id(), 'SECONDARY_GROUPS' => placeholder_array(), 'VIEW_PROFILES' => true, 'ON_PROBATION' => lorem_phrase(), 'USERGROUP' => lorem_word(), 'CLUBS' => lorem_phrase())); $tabs[] = array('TAB_CODE' => placeholder_id() . '0', 'TAB_TITLE' => lorem_title(), 'TAB_CONTENT' => $tab_content, 'TAB_FIRST' => true, 'TAB_LAST' => false); $tabs2 = array(); $fields = new ocp_tempcode(); $name = placeholder_random_id(); $input = do_lorem_template('FORM_SCREEN_INPUT_INTEGER', array('TABINDEX' => placeholder_number(), 'REQUIRED' => '', 'NAME' => $name, 'DEFAULT' => '')); $fields->attach(do_lorem_template('FORM_SCREEN_FIELD', array('REQUIRED' => true, 'SKIP_LABEL' => false, 'BORING_NAME' => $name, 'NAME' => lorem_word(), 'DESCRIPTION' => lorem_sentence_html(), 'DESCRIPTION_SIDE' => '', 'INPUT' => $input, 'COMCODE' => ''))); $tabs2[] = array('TAB_TITLE' => lorem_title(), 'TAB_FIELDS' => $fields, 'TAB_TEXT' => lorem_paragraph(), 'TAB_FIRST' => true, 'TAB_LAST' => true); $tab_content = do_lorem_template('OCF_MEMBER_PROFILE_EDIT', array('URL' => placeholder_url(), 'SUBMIT_NAME' => lorem_phrase(), 'AUTOCOMPLETE' => false, 'SKIP_VALIDATION' => true, 'TABS' => $tabs2, 'HIDDEN' => '')); $tabs[] = array('TAB_CODE' => placeholder_id() . '1', 'TAB_TITLE' => lorem_title(), 'TAB_CONTENT' => $tab_content, 'TAB_FIRST' => false, 'TAB_LAST' => true); return array(lorem_globalise(do_lorem_template('OCF_MEMBER_PROFILE_SCREEN', array('TITLE' => lorem_title(), 'MEMBER_ID' => placeholder_id(), 'TABS' => $tabs)), 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__full_table_screen() { $table_rows = new ocp_tempcode(); foreach (placeholder_array() as $row) { $actions = do_lorem_template('TABLE_TABLE_ACTION_DELETE_ENTRY', array('GET' => true, 'HIDDEN' => '', 'NAME' => lorem_phrase(), 'URL' => placeholder_url())); $actions->attach(do_lorem_template('TABLE_TABLE_ACTION_INSTALL_ENTRY', array('GET' => true, 'HIDDEN' => '', 'NAME' => lorem_phrase(), 'URL' => placeholder_url()))); $actions->attach(do_lorem_template('TABLE_TABLE_ACTION_UPGRADE_ENTRY', array('GET' => true, 'HIDDEN' => '', 'NAME' => lorem_phrase(), 'URL' => placeholder_url()))); $actions->attach(do_lorem_template('TABLE_TABLE_ACTION_REINSTALL_ENTRY', array('GET' => true, 'HIDDEN' => '', 'NAME' => lorem_phrase(), 'URL' => placeholder_url()))); $select = do_lorem_template('TABLE_TABLE_ROW_CELL_SELECT', array('LABEL' => lorem_phrase(), 'NAME' => placeholder_random_id(), 'LIST' => placeholder_options())); $values = array(lorem_word(), lorem_word(), lorem_word(), placeholder_time(), $select, $actions); $cells = new ocp_tempcode(); foreach ($values as $value) { $cells->attach(do_lorem_template('TABLE_TABLE_ROW_CELL', array('VALUE' => $value))); } $tpl = do_lorem_template('TABLE_TABLE_ROW', array('CELLS' => $cells)); $table_rows->attach($tpl); } $values = array(lorem_word(), lorem_word_2(), lorem_word(), lorem_word_2(), lorem_word(), lorem_word()); $cells = new ocp_tempcode(); foreach ($values as $value) { $cells->attach(do_lorem_template('TABLE_TABLE_HEADER_ROW_CELL', array('VALUE' => $value))); } $header_row = do_lorem_template('TABLE_TABLE_HEADER_ROW', array('CELLS' => $cells)); $field_rows = do_lorem_template('TABLE_TABLE', array('HEADER_ROW' => $header_row, 'ROWS' => $table_rows)); $return = do_lorem_template('FORM_GROUPED', array('TEXT' => "", 'URL' => "#", 'FIELD_GROUPS' => $field_rows, 'SUBMIT_NAME' => lorem_word_2())); return array(lorem_globalise($return, 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__attachment_left() { $temp_tpl = do_lorem_template('ATTACHMENT_IMG', array('A_DESCRIPTION' => lorem_phrase(), 'SCRIPT' => find_script('attachment'), 'ID' => placeholder_id(), 'SUP_PARAMS' => placeholder_id(), 'A_THUMB' => placeholder_image_url(), 'FORUM_DB_BIN' => lorem_word(), 'CLEAN_SIZE' => placeholder_filesize(), 'A_WIDTH' => placeholder_number(), 'A_HEIGHT' => placeholder_number(), 'A_ORIGINAL_FILENAME' => lorem_word())); $temp_tpl->attach(do_lorem_template('ATTACHMENT_IMG_MINI', array('A_DESCRIPTION' => lorem_phrase(), 'SCRIPT' => placeholder_url(), 'PASS_ID' => placeholder_id(), 'RAND' => placeholder_random_id(), 'ID' => placeholder_id(), 'A_THUMB' => placeholder_image_url(), 'A_URL' => placeholder_url(), 'A_THUMB_URL' => placeholder_image_url(), 'A_WIDTH' => placeholder_number(), 'A_HEIGHT' => placeholder_number(), 'A_ORIGINAL_FILENAME' => lorem_word()))); return array(lorem_globalise(do_lorem_template('ATTACHMENT_LEFT', array('CONTENT' => $temp_tpl)), 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__administrative__template_edit_link_screen() { $parameters = array('FILE' => lorem_phrase(), 'EDIT_URL' => placeholder_url(), 'CODENAME' => lorem_word(), 'GUID' => placeholder_id(), 'ID' => placeholder_random_id()); $param_info = do_lorem_template('PARAM_INFO', array('MAP' => $parameters)); return array(lorem_globalise(do_lorem_template('TEMPLATE_EDIT_LINK', array('PARAM_INFO' => $param_info, 'CONTENTS' => lorem_paragraph_html(), 'CODENAME' => lorem_word(), 'EDIT_URL' => placeholder_url())), NULL, '', true)); }