private function error($error_id, $message = false) { $content = wpcf_add_admin_header(__('Tutorial error', 'wpcf')); $content .= '<div class="error settings-error"><p><strong>'; switch ($error_id) { case 'no id': case 'wrong id': $content .= __('Wrong tutorial id.', 'wpcf'); break; case 'empty url': case 'wrong response status': case 'http request failed': $content .= __('There is a problem with tutorial url.', 'wpcf'); break; case 'empty body': $content .= __('Selected tutorial is empty.', 'wpcf'); if (current_user_can('manage_options')) { } break; default: if ($message) { $content .= $message; } else { $content .= __('Some error occured.', 'wpcf'); } } $content .= '</strong></p></div>'; return $content; }
public function page_handler() { do_action('wpcf_admin_page_init'); wpcf_admin_page_add_options('uf', __('User Fields', 'wpcf')); //$this->add_screen_options(); // Without this, the Activate/Deactivate link doesn't work properly (why?) wpcf_admin_load_collapsible(); wpcf_admin_page_add_options('tf', __('Term Fields', 'wpcf')); wpcf_add_admin_header(__('Term Field Groups', 'wpcf'), array('page' => WPCF_Page_Edit_Termmeta::PAGE_NAME)); require_once WPCF_INC_ABSPATH . '/fields.php'; // require_once WPCF_INC_ABSPATH . '/fields-list.php'; $list_table = new WPCF_Page_Listing_Termmeta_Table(); $list_table->prepare_items(); if (!$list_table->has_items()) { add_action('wpcf_groups_list_table_after', 'wpcf_admin_promotional_text'); } ?> <form id="cf-filter" method="post"> <!-- For plugins, we also need to ensure that the form posts back to our current page --> <input type="hidden" name="page" value="<?php echo self::PAGE_NAME; ?> "/> <?php $list_table->search_box(__('Search Term Field Groups', 'wpcf'), 'search_id'); $list_table->display(); wp_nonce_field(self::BULK_ACTION_NONCE); ?> </form> <?php do_action('wpcf_groups_list_table_after'); $this->show_term_field_control_box(); wpcf_add_admin_footer(); }
/** * Menu page render hook. */ function wpcf_access_admin_menu_page() { echo wpcf_add_admin_header(__('Access', 'wpcf'), 'icon-wpcf-access'); require_once WPCF_ACCESS_INC . '/admin-edit-access.php'; wpcf_access_admin_edit_access(); echo wpcf_add_admin_footer(); }
/** * Teaser admin screen. */ function wpcf_access_teaser_admin_menu_page() { echo wpcf_add_admin_header(__('Access', 'wpcf'), 'icon-wpcf-access'); echo '<p>' . __('To enjoy access management for your site, you need to have the Access plugin.', 'wpcf') . '<br /><br /><a href="http://wp-types.com/home/types-access/?utm_source=typesplugin&utm_medium=accessadmin&utm_term=Meet&utm_campaign=typesplugin" class="button-primary" target="_blank">' . __('Meet Access') . '</a> <a href="http://wp-types.com/buy/?utm_source=typesplugin&utm_medium=accessadmin&utm_term=Pricing&utm_campaign=typesplugin" class="button-primary" target="_blank">' . __('Pricing') . '</a>' . '<br /><br /></p>'; require_once WPCF_ACCESS_INC . '/admin-edit-access.php'; wpcf_access_admin_edit_access(false); echo wpcf_add_admin_footer(); }
/** * Teaser admin screen. */ function wpcf_access_teaser_admin_menu_page() { echo wpcf_add_admin_header(__('Access', 'wpcf'), 'icon-wpcf-access'); echo '<p>' . __('Access management is part of the <strong>Types Plus</strong> package.', 'wpcf') . '<br />' . __('It lets you quickly set access rules for different user types and grant access to specific users.', 'wpcf') . '<br /><br /><a href="http://www.wp-types.com" class="button-primary" target="_blank">' . __('Buy Types Plus') . '</a>' . '<br /><br /></p>'; require_once WPCF_ACCESS_INC . '/admin-edit-access.php'; wpcf_access_admin_edit_access(false); echo wpcf_add_admin_footer(); }
/** * Teaser admin screen. */ function wpcf_access_teaser_admin_menu_page() { echo wpcf_add_admin_header(__('Access', 'wpcf'), 'icon-wpcf-access'); echo '<div class="types-help"><div class="types-help-content"'; echo '<p>' . sprintf(__('This screen shows a preview of %sAccess%s - the access control and roles management addon for Types.', 'wpcf'), '<strong><a href="http://wp-types.com/home/types-access/?utm_source=typesplugin&utm_medium=accessadmin&utm_term=Access&utm_campaign=typesplugin" target="_blank">', '</a></strong>') . '</p>' . '<p>' . __('Access lets you control what content types different users can read, edit and publish on your site and create custom roles.', 'wpcf') . '</p>' . '<p>' . sprintf(__('%sBuy Access%s to unlock this screen and add access control management to your site.', 'wpcf'), '<strong><a href="http://wp-types.com/buy/?add-to-cart=38997&buy_now=1&utm_source=typesplugin&utm_medium=accessadmin&utm_term=Buy&utm_campaign=typesplugin" target="_blank">', '</a></strong>') . '</p>' . '<p><a href="http://wp-types.com/home/types-access/?utm_source=typesplugin&utm_medium=accessadmin&utm_term=AccessFeatures&utm_campaign=typesplugin" class="button-primary" target="_blank">' . __('Access Features') . '</a> <a href="http://wp-types.com/buy/?add-to-cart=38997&buy_now=1&utm_source=typesplugin&utm_medium=accessadmin&utm_term=Buy&utm_campaign=typesplugin" class="button-primary" target="_blank">' . __('Buy Access - $39 (USD)') . '</a>' . '</p>'; echo '</div></div>'; require_once WPCF_ACCESS_INC . '/admin-edit-access.php'; wpcf_access_admin_edit_access(false); echo wpcf_add_admin_footer(); }
/** * Render the page. * * @return void */ public function page_handler() { do_action('wpcf_admin_page_init'); wpcf_admin_load_collapsible(); //$this->add_screen_options(); wpcf_add_admin_header($this->get_title(), array('page' => self::PAGE_NAME)); $list_table = new WPCF_Page_Control_Termmeta_Table(); $list_table->prepare_items(); if (!$list_table->has_items()) { add_action('wpcf_groups_list_table_after', 'wpcf_admin_promotional_text'); } ?> <!-- form id used in custom-fields-control-form.js --> <form id="wpcf-custom-fields-control-form" method="post"> <!-- For plugins, we also need to ensure that the form posts back to our current page --> <input type="hidden" name="page" value="<?php echo self::PAGE_NAME; ?> "/> <!-- Pass the information about the kind of fields and groups to JS --> <input type="hidden" id="wpcf_admin_field_type" value="wpcf-termmeta" /> <!-- This will be used by some of the bulk action dialogs to pass back some information --> <input type="hidden" name='wpcf-id' id='wpcf_admin_custom_fields_control_type' value='' /> <?php $list_table->search_box(__('Search term fields', 'wpcf'), 'search_id'); $list_table->display(); wp_nonce_field(self::BULK_ACTION_NONCE); ?> </form> <?php wpcf_add_admin_footer(); }
public function page_handler() { // Following code taken from the legacy parts. Needs refactoring. // By now we expect that prepare_form_maybe_redirect() was already called. If not, something went terribly wrong. if (null == $this->wpcf_admin) { return; } // Well this doesn't look right. $post_type = current_filter(); // Start rendering the page. // Header and title $page_purpose = $this->wpcf_admin->get_page_purpose(); $add_new_button = 'edit' == $page_purpose ? array('page' => self::PAGE_NAME) : false; wpcf_add_admin_header($this->get_page_title($page_purpose), $add_new_button); // Display WPML admin notices if there are any. wpcf_wpml_warning(); // Transform the form data into an Enlimbo form $form = wpcf_form(self::FORM_NAME, $this->form); // Dark magic happens here. echo '<form method="post" action="" class="wpcf-fields-form wpcf-form-validate js-types-show-modal">'; wpcf_admin_screen($post_type, $form->renderForm()); echo '</form>'; wpcf_add_admin_footer(); }
/** * Menu page display. */ function wpcf_admin_menu_settings() { echo wpcf_add_admin_header(__('Settings', 'wpcf')); echo '<br /><form method="post" action="" id="wpcf-settings-form" class="wpcf-settings-form ' . 'wpcf-form-validate">'; $form = wpcf_form('wpcf_form_settings'); echo $form->renderForm(); echo '</form>'; echo wpcf_add_admin_footer(); }
/** * Usermeta groups listing * * @author Gen gen.i@icanlocalize.com * @since Types 1.3 */ function wpcf_usermeta_summary() { wpcf_add_admin_header(__('User Field Groups', 'wpcf'), array('page' => 'wpcf-edit-usermeta'), __('Add New', 'wpcf')); require_once WPCF_INC_ABSPATH . '/fields.php'; require_once WPCF_INC_ABSPATH . '/usermeta.php'; require_once WPCF_INC_ABSPATH . '/usermeta-list.php'; $to_display = wpcf_admin_fields_get_fields(); if (!empty($to_display)) { add_action('wpcf_groups_list_table_after', 'wpcf_admin_promotional_text'); } wpcf_admin_usermeta_list(); wpcf_add_admin_footer(); }
/** * Menu page display. */ function wpcf_admin_menu_migration() { echo wpcf_add_admin_header(__('Migration', 'wpcf')); echo '<br /><form method="post" action="" id="wpcf-migration-form" class="wpcf-migration-form ' . 'wpcf-form-validate" enctype="multipart/form-data">'; $form = wpcf_form('wpcf_form_migration'); echo $form->renderForm(); echo '</form>'; echo wpcf_add_admin_footer(); }
/** * Menu page display. */ function wpcf_admin_menu_user_fields_control() { global $wpcf_control_table; wpcf_add_admin_header(__('User Field Control', 'wpcf')); echo '<form method="post" action="" id="wpcf-custom-fields-control-form" class="wpcf-custom-fields-control-form ' . 'wpcf-form-validate" enctype="multipart/form-data">'; echo wpcf_admin_custom_fields_control_form($wpcf_control_table); wp_nonce_field('user_fields_control_bulk'); echo '</form>'; wpcf_add_admin_footer(); }
/** * Menu page display. */ function wpcf_admin_menu_settings() { ob_start(); echo wpcf_add_admin_header(__('Settings', 'wpcf')); ?> <p style="font-weight: bold;"><?php _e('This screen contains the Types settings for your site.', 'wpcf'); ?> </p> <ul class="horlist"> <li><a href="#types-image-settings"><?php _e('Image Settings', 'wpcf'); ?> </a></li> <li><a href="#types-general-settings"><?php _e('General Setings', 'wpcf'); ?> </a></li> </ul> <br style='clear:both'/><br /><br /> <a id="types-image-settings"></a> <table class="widefat" id="types_image_settings_table"> <thead> <tr> <th><?php _e('Image Settings', 'wpcf'); ?> </th> </tr> </thead> <tbody> <tr> <td> <?php echo '<br /><form method="post" action="" id="wpcf-image-settings-form" class="wpcf-settings-form ' . 'wpcf-form-validate">'; $form = wpcf_form('wpcf_form_image_settings'); echo $form->renderForm(); echo '</form>'; ?> </td> </tr> </tbody> </table> <br /><br /> <a id="types-general-settings"></a> <table class="widefat" id="types_general_settings_table"> <thead> <tr> <th><?php _e('General Settings', 'wpcf'); ?> </th> </tr> </thead> <tbody> <tr> <td> <?php echo '<br /><form method="post" action="" id="wpcf-general-settings-form" class="wpcf-settings-form ' . 'wpcf-form-validate">'; $form = wpcf_form('wpcf_form_general_settings'); echo $form->renderForm(); echo '</form>'; ?> </td> </tr> </tbody> </table> <?php echo wpcf_add_admin_footer(); echo ob_get_clean(); }
<?php /* * Introduction page. */ echo wpcf_add_admin_header(__('Help', 'wpcf')); ?> <h3><?php _e('Start using Types', 'wpcf'); ?> </h3> <p><a class="button-primary" href="<?php echo admin_url('admin.php?page=wpcf-edit-type'); ?> "><?php _e('New custom post types and taxonomy', 'wpcf'); ?> </a> <a class="button-primary" href="<?php echo admin_url('admin.php?page=wpcf-edit'); ?> "><?php _e('New custom fields', 'wpcf'); ?> </a></p> <h3 style="margin-top:3em;"><?php _e('Documentation and Support', 'wpcf'); ?> </h3> <ul> <li><?php
/** * Menu page display. */ function wpcf_admin_menu_settings() { $show_toolset_messages = !WPCF_Types_Marketing_Messages::check_register(); ob_start(); wpcf_add_admin_header(__('Settings', 'wpcf')); ?> <p style="font-weight: bold;"><?php _e('This screen contains the Types settings for your site.', 'wpcf'); ?> </p> <ul class="horlist"> <li><a href="#types-image-settings"><?php _e('Image Settings', 'wpcf'); ?> </a></li> <li><a href="#types-general-settings"><?php _e('General Setings', 'wpcf'); ?> </a></li> <?php if ($show_toolset_messages) { ?> <li><a href="#toolset-messages"><?php _e('Toolset Messages', 'wpcf'); ?> </a></li><?php } ?> <li><a href="#debug"><?php _e('Debug Information', 'wpcf'); ?> </a></li> </ul> <br style='clear:both'/><br /><br /> <a id="types-image-settings"></a> <table class="widefat" id="types_image_settings_table"> <thead> <tr> <th><?php _e('Image Settings', 'wpcf'); ?> </th> </tr> </thead> <tbody> <tr> <td> <?php echo '<br /><form method="post" action="" id="wpcf-image-settings-form" class="wpcf-settings-form ' . 'wpcf-form-validate">'; $form = wpcf_form('wpcf_form_image_settings'); echo $form->renderForm(); echo '</form>'; ?> </td> </tr> </tbody> </table> <br /><br /> <a id="types-general-settings"></a> <table class="widefat" id="types_general_settings_table"> <thead> <tr> <th><?php _e('General Settings', 'wpcf'); ?> </th> </tr> </thead> <tbody> <tr> <td> <?php echo '<br /><form method="post" action="" id="wpcf-general-settings-form" class="wpcf-settings-form ' . 'wpcf-form-validate">'; $form = wpcf_form('wpcf_form_general_settings'); echo $form->renderForm(); echo '</form>'; ?> </td> </tr> </tbody> </table> <br /><br /> <?php /** * Toolset Messages */ if ($show_toolset_messages) { ?> <a id="toolset-messages"></a> <table class="widefat" id="toolset_messages"> <thead> <tr> <th><?php _e('Toolset Messages', 'wpcf'); ?> </th> </tr> </thead> <tbody> <tr> <td> <?php echo '<br /><form method="post" action="" id="wpcf-toolset-messages-form" class="wpcf-settings-form ' . 'wpcf-form-validate">'; $form = wpcf_form('wpcf_form_toolset_messages'); echo $form->renderForm(); echo '</form>'; ?> </td> </tr> </tbody> </table> <br /><br /> <?php } /** * Debug Information */ ?> <a id="debug"></a> <table class="widefat" id="debug_table"> <thead> <tr> <th><?php _e('Debug Information', 'wpcf'); ?> </th> </tr> </thead> <tbody> <tr> <td> <?php printf(__('For retrieving debug information if asked by a support person, use the <a href="%s">debug information</a> page.', 'wpcf'), admin_url('admin.php?page=wpcf-debug-information')); ?> </td> </tr> </tbody> </table> <?php wpcf_add_admin_footer(); echo ob_get_clean(); }
/** * Menu page display. */ function wpcf_admin_menu_settings() { ob_start(); wpcf_add_admin_header(__('Settings', 'wpcf')); ?> <form method="post" action="" id="wpcf-general-settings-form" class="wpcf-settings-form wpcf-form-validate"> <?php $form = wpcf_form('wpcf_form_general_settings'); echo $form->renderForm(); ?> </form> <table class="widefat" id="types-tools"> <thead> <tr> <th><?php _e('Types tools', 'wpcf'); ?> </th> </tr> </thead> <tbody> <tr> <td> <?php $pages = array('wpcf-custom-fields-control' => array('page' => 'wpcf-custom-fields-control', 'name' => __('Custom Fields Control', 'wpcf'), 'description' => __('Allow to control custom fields.', 'wpcf')), 'wpcf-user-fields-control' => array('page' => 'wpcf-user-fields-control', 'name' => __('User Fields Control', 'wpcf'), 'description' => __('Allow to control user meta fields.', 'wpcf')), 'wpcf-import-export' => array('page' => 'wpcf-import-export', 'name' => __('Import/Export', 'wpcf'), 'description' => __('For import or export data from Types.', 'wpcf')), 'wpcf-access' => array('page' => 'wpcf-access', 'name' => __('Access', 'wpcf'), 'description' => __('Access lets you control what content types different users can read, edit and publish on your site and create custom roles.', 'wpcf')), 'installer' => array('page' => 'installer', 'name' => __('Installer', 'wpcf'), 'description' => __('This page lets you install plugins and update existing plugins.', 'wpcf')), 'wpcf-debug-information' => array('page' => 'wpcf-debug-information', 'name' => __('Debug Information', 'wpcf'), 'description' => __('For retrieving debug information if asked by a support person.', 'wpcf'))); /** * remove Access page if is a full version of Access * installer and running */ if (defined('WPCF_ACCESS_VERSION')) { unset($pages['wpcf-access']); } echo '<ul>'; foreach ($pages as $data) { echo '<li>'; printf('<strong><a href="%s">%s</a></strong>', esc_url(admin_url(sprintf('admin.php?page=%s', $data['page']))), $data['name']); if (isset($data['description']) && !empty($data['description'])) { echo ' - '; echo $data['description']; } echo '<li>'; } echo '</ul>'; ?> </td> </tr> </tbody> </table> <?php wpcf_add_admin_footer(); echo ob_get_clean(); }