function skip_test() { echo '<div class="wrap">'; echo '<h2>Check</h2>'; echo '<p>Wir testen die Formularfunktionen.</p>'; skip\form_start('testform'); skip\textfield('name', 'Name'); skip\textarea('description', 'Describe you a bit'); skip\color('color', 'Choose your favourite color'); skip\checkbox('checkthis', 'yes', 'Check This!'); skip\radio('radioval', '1', 'Eins'); skip\radio('radioval', '2', 'Zwei'); skip\radio('radioval', '3', 'Drei'); skip\select('selectval', 'Eins,Zwei,Drei', 'Wähl mal'); skip\autocomplete('completeit', 'Car,House,Fish,Meal', 'Autocomplete'); skip\editor('mylonghtmltext', 'Ein Langer Text'); skip\file('uploadme', 'Datei'); skip\wp_file('uploadmetoo', 'WP Dateiupload'); skip\hidden('hiddenvalue'); skip\button('Save'); skip\form_end(); echo skip\value('testform', 'radioval'); echo '</div>'; }
/** * Content of the admin page. * @since 1.0.0 */ public function admin_page() { echo '<div class="wrap">'; echo '<div id="icon-options-general" class="icon32 icon32-posts-post"></div>'; echo '<h2>' . __('Facebook Fanpage Import', 'fbfpi') . '</h2>'; echo '<p>' . __('Just put in your Fanpage ID and start importing.', 'fbfpi') . '</p>'; skip\form_start('fbfpi_settings'); /** * Fanpage ID */ skip\textfield('page_id', __('Page ID', 'fbfpi')); /** * Select stream languages */ $available_languages = get_available_languages(); if (!in_array('en_US', $available_languages)) { $available_languages[] = 'en_US'; } foreach ($available_languages as $language) { $select_languages[] = array('value' => $language); } skip\select('stream_language', $select_languages, __('Facebook Language', 'fbfpi')); /** * Import WP Cron settings */ $schedules = wp_get_schedules(); // Getting WordPress schedules foreach ($schedules as $key => $schedule) { $select_schedules[] = array('label' => $schedule['display'], 'value' => $key); } skip\select('update_interval', $select_schedules, __('Import Interval', 'fbfpi')); /** * Num of entries to import */ skip\select('update_num', '5,10,25,50,100,200', __('Entries to import', 'fbfpi')); /** * Select where to import, as posts or as own post type */ $args = array(array('value' => 'posts', 'label' => __('Posts')), array('value' => 'status', 'label' => __('Status message (own post type)', 'fbfpi'))); skip\select('insert_post_type', $args, __('Insert Messages as', 'fbfpi')); /** * Select importing User */ $users = get_users(array('fields' => array('ID', 'display_name'))); $user_list = array(); foreach ($users as $user) { $user_list[] = array('value' => $user->ID, 'label' => $user->display_name); } skip\select('insert_user_id', $user_list, __('Inserting User', 'fbfpi')); /** * Post status */ $post_status_values = array(array('value' => 'publish', 'label' => __('Published')), array('value' => 'draft', 'label' => __('Draft'))); skip\select('insert_post_status', $post_status_values, __('Post status', 'fbfpi')); /** * Link target for imported links */ $link_select_values = array(array('value' => '_self', 'label' => __('same window', 'fbfpi')), array('value' => '_blank', 'label' => __('new window', 'fbfpi'))); skip\select('link_target', $link_select_values, __('Open Links in', 'fbfpi')); /** * Selecting post formats if existing */ if (current_theme_supports('post-formats')) { $post_formats = get_theme_support('post-formats'); if (FALSE != $post_formats) { $post_formats = $post_formats[0]; $post_format_list = array(); $post_format_list[] = array('value' => 'none', 'label' => __('-- None --', 'fbfpi')); foreach ($post_formats as $post_format) { $post_format_list[] = array('value' => $post_format, 'label' => $post_format); } skip\select('insert_post_format', $post_format_list, __('Post format', 'fbfpi')); } } skip\checkbox('own_css', 'yes', __('Deactivate Plugin CSS', 'fbfpi')); do_action('fbfpi_settings_form'); /** * Save Button */ skip\button(__('Save', 'fbfpi')); /** * Import button */ if ('' != skip\value('fbfpi_settings', 'page_id')) { echo ' <input type="submit" name="bfpi-now" value="' . __('Import Now', 'fbfpi') . '" class="button" style="margin-left:10px;" /> '; } skip\form_end(); echo '</div>'; }