Example #1
0
    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();
    }
Example #2
0
/**
 * 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();
}
Example #3
0
/**
 * 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>&nbsp;<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();
}
Example #5
0
/**
 * 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>&nbsp;<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();
}
Example #6
0
    /**
     * 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();
    }
Example #7
0
 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();
 }
Example #8
0
/**
 * 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();
}
Example #10
0
/**
 * 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();
}
Example #12
0
/**
 * 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();
}
printf(__('%sTypes fields API%s (for developers) - Learn how to insert Types fields to PHP templates', 'wpcf'), '<a target="_blank" href="http://wp-types.com/documentation/functions/?utm_source=typesplugin&utm_medium=intro&utm_campaign=types"><strong>', ' &raquo;</strong></a>');
?>
</li>
    <li><?php 
printf(__('%sSupport forum%s - register in our forum to receive support', 'wpcf'), '<a target="_blank" href="http://wp-types.com/support/register/?utm_source=typesplugin&utm_medium=intro&utm_campaign=types"><strong>', ' &raquo;</strong></a>');
?>
</li>
</ul>

<h3 style="margin-top:3em;"><?php 
_e('Want to help Types?', 'wpcf');
?>
</h3>
<ul>
    <li><?php 
printf(__('%sRate Types on WordPress.org%s', 'wpcf'), '<a target="_blank" href="http://wordpress.org/extend/plugins/types/"><strong>', ' &raquo;</strong></a>');
?>
</li>
    <li><?php 
printf(__('%sTypes press resources%s  - write about Types', 'wpcf'), '<a target="_blank" href="http://wp-types.com/home/press-resources/?utm_source=typesplugin&utm_medium=intro&utm_campaign=types"><strong>', ' &raquo;</strong></a>');
?>
</li>
	<li><?php 
printf(__('%sViews%s - the commercial complement of Types, which makes content display a breeze.', 'wpcf'), '<a target="_blank" href="http://wp-types.com/home/views-create-elegant-displays-for-your-content/?utm_source=typesplugin&utm_medium=intro&utm_campaign=types"><strong>', ' &raquo;</strong></a>');
?>
</li>
</ul>

<?php 
echo wpcf_add_admin_footer();
Example #14
0
/**
 * 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();
}
Example #15
0
/**
 * 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();
}