当前位置: 首页>>代码示例>>PHP>>正文


PHP RGFormsModel::get_form_count方法代码示例

本文整理汇总了PHP中RGFormsModel::get_form_count方法的典型用法代码示例。如果您正苦于以下问题:PHP RGFormsModel::get_form_count方法的具体用法?PHP RGFormsModel::get_form_count怎么用?PHP RGFormsModel::get_form_count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RGFormsModel的用法示例。


在下文中一共展示了RGFormsModel::get_form_count方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: form_list_page


//.........这里部分代码省略.........
                case 'delete_entries':
                    if (GFCommon::current_user_can_any("gravityforms_delete_entries")) {
                        foreach ($form_ids as $form_id) {
                            GFFormsModel::delete_leads_by_form($form_id);
                        }
                        $message = _n('Entries for %s form have been deleted.', 'Entries for %s forms have been deleted.', $form_count, 'gravityforms');
                    } else {
                        $message = __("You don't have adequate permissions to delete entries.", "gravityforms");
                    }
                    break;
                case 'activate':
                    foreach ($form_ids as $form_id) {
                        GFFormsModel::update_form_active($form_id, 1);
                    }
                    $message = _n('%s form has been marked as active.', '%s forms have been marked as active.', $form_count, 'gravityforms');
                    break;
                case 'deactivate':
                    foreach ($form_ids as $form_id) {
                        GFFormsModel::update_form_active($form_id, 0);
                    }
                    $message = _n('%s form has been marked as inactive.', '%s forms have been marked as inactive.', $form_count, 'gravityforms');
                    break;
            }
            if (isset($message)) {
                $message = sprintf($message, $form_count);
            }
        }
        $sort_column = empty($_GET["sort"]) ? "title" : $_GET["sort"];
        $sort_direction = empty($_GET["dir"]) ? "ASC" : $_GET["dir"];
        $active = RGForms::get("active") == "" ? null : RGForms::get("active");
        $trash = RGForms::get("trash") == "" ? false : RGForms::get("trash");
        $trash = esc_attr($trash);
        $forms = RGFormsModel::get_forms($active, $sort_column, $sort_direction, $trash);
        $form_count = RGFormsModel::get_form_count();
        // - new form modal - //
        wp_print_styles(array('thickbox'));
        /*wp_enqueue_script( 'form_admin' );
          wp_print_scripts( array( 'form_admin' ) );*/
        ?>

        <script type="text/javascript">

            jQuery(document).ready(function($) {

                <?php 
        if (rgget('page') == 'gf_new_form') {
            ?>
                loadNewFormModal();
                <?php 
        }
        ?>

                $('.gf_form_action_has_submenu').hover(function(){
                    var l = jQuery(this).offset().left;
                    jQuery(this).find('.gf_submenu')
                        .toggle()
                        .offset({ left: l });
                }, function(){
                    jQuery(this).find('.gf_submenu').hide();
                });


            });

            function loadNewFormModal() {
                resetNewFormModal();
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:67,代码来源:form_list.php

示例2: form_list_page

    public static function form_list_page()
    {
        global $wpdb;
        if (!GFCommon::ensure_wp_version()) {
            return;
        }
        echo GFCommon::get_remote_message();
        $action = RGForms::post("action");
        $bulk_action = RGForms::post("bulk_action");
        $bulk_action = !empty($bulk_action) ? $bulk_action : RGForms::post("bulk_action2");
        if ($action == "delete") {
            check_admin_referer('gforms_update_forms', 'gforms_update_forms');
            $form_id = RGForms::post("action_argument");
            RGFormsModel::delete_form($form_id);
        } else {
            if ($action == "duplicate") {
                check_admin_referer('gforms_update_forms', 'gforms_update_forms');
                $form_id = RGForms::post("action_argument");
                RGFormsModel::duplicate_form($form_id);
            } else {
                if ($bulk_action == "delete") {
                    check_admin_referer('gforms_update_forms', 'gforms_update_forms');
                    $form_ids = RGForms::post("form");
                    RGFormsModel::delete_forms($form_ids);
                } else {
                    if ($bulk_action == "reset_views") {
                        check_admin_referer('gforms_update_forms', 'gforms_update_forms');
                        $form_ids = RGForms::post("form");
                        foreach ($form_ids as $form_id) {
                            RGFormsModel::delete_views($form_id);
                        }
                    } else {
                        if ($bulk_action == "delete_entries") {
                            check_admin_referer('gforms_update_forms', 'gforms_update_forms');
                            $form_ids = RGForms::post("form");
                            foreach ($form_ids as $form_id) {
                                RGFormsModel::delete_leads_by_form($form_id);
                            }
                        }
                    }
                }
            }
        }
        $active = RGForms::get("active") == "" ? null : RGForms::get("active");
        $forms = RGFormsModel::get_forms($active, "title");
        $form_count = RGFormsModel::get_form_count();
        ?>
        <script>
            function DeleteForm(form_id){
                jQuery("#action_argument").val(form_id);
                jQuery("#action").val("delete");
                jQuery("#forms_form")[0].submit();
            }

            function DuplicateForm(form_id){
                jQuery("#action_argument").val(form_id);
                jQuery("#action").val("duplicate");
                jQuery("#forms_form")[0].submit();
            }

            function ToggleActive(img, form_id){
                var is_active = img.src.indexOf("active1.png") >=0
                if(is_active){
                    img.src = img.src.replace("active1.png", "active0.png");
                    jQuery(img).attr('title','<?php 
        _e("Inactive", "gravityforms");
        ?>
').attr('alt', '<?php 
        _e("Inactive", "gravityforms");
        ?>
');
                }
                else{
                    img.src = img.src.replace("active0.png", "active1.png");
                    jQuery(img).attr('title','<?php 
        _e("Active", "gravityforms");
        ?>
').attr('alt', '<?php 
        _e("Active", "gravityforms");
        ?>
');
                }

                UpdateCount("active_count", is_active ? -1 : 1);
                UpdateCount("inactive_count", is_active ? 1 : -1);

                var mysack = new sack("<?php 
        echo admin_url("admin-ajax.php");
        ?>
" );
                mysack.execute = 1;
                mysack.method = 'POST';
                mysack.setVar( "action", "rg_update_form_active" );
                mysack.setVar( "rg_update_form_active", "<?php 
        echo wp_create_nonce("rg_update_form_active");
        ?>
" );
                mysack.setVar( "form_id", form_id);
                mysack.setVar( "is_active", is_active ? 0 : 1);
                mysack.encVar( "cookie", document.cookie, false );
//.........这里部分代码省略.........
开发者ID:hypenotic,项目名称:slowfood,代码行数:101,代码来源:form_list.php

示例3: form_list_page


//.........这里部分代码省略.........
                            GFFormsModel::delete_leads_by_form($form_id);
                        }
                        $message = _n('Entries for %s form have been deleted.', 'Entries for %s forms have been deleted.', $form_count, 'gravityforms');
                    } else {
                        $message = __("You don't have adequate permission to delete entries.", 'gravityforms');
                    }
                    break;
                case 'activate':
                    foreach ($form_ids as $form_id) {
                        GFFormsModel::update_form_active($form_id, 1);
                    }
                    $message = _n('%s form has been marked as active.', '%s forms have been marked as active.', $form_count, 'gravityforms');
                    break;
                case 'deactivate':
                    foreach ($form_ids as $form_id) {
                        GFFormsModel::update_form_active($form_id, 0);
                    }
                    $message = _n('%s form has been marked as inactive.', '%s forms have been marked as inactive.', $form_count, 'gravityforms');
                    break;
            }
            if (isset($message)) {
                $message = sprintf($message, $form_count);
            }
        }
        $sort_column = empty($_GET['sort']) ? 'title' : $_GET['sort'];
        $db_columns = GFFormsModel::get_form_db_columns();
        if (!in_array(strtolower($sort_column), $db_columns)) {
            $sort_column = 'title';
        }
        $sort_direction = empty($_GET['dir']) ? 'ASC' : $_GET['dir'];
        $active = RGForms::get('active') == '' ? null : (bool) RGForms::get('active');
        $trash = RGForms::get('trash') == '' ? false : (bool) RGForms::get('trash');
        $forms = RGFormsModel::get_forms($active, $sort_column, $sort_direction, $trash);
        $form_count = RGFormsModel::get_form_count();
        wp_print_styles(array('thickbox'));
        add_action('admin_print_footer_scripts', array(__CLASS__, 'output_form_list_script_block'), 20);
        $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || isset($_GET['gform_debug']) ? '' : '.min';
        ?>

		<script type="text/javascript">
			// checked by the ToggleActive method to prevent errors when form status icon is clicked before page has fully loaded
			var gfPageLoaded = false;
		</script>

		<style type="text/css">
			body div#TB_window[style] {
				width: 405px !important;
				height: 340px !important;
				margin-left: -202px !important;
			}

			body #TB_ajaxContent {
				height: 290px !important;
				overflow: hidden;
			}

			.gf_new_form_modal_container {
				padding: 30px;
			}

			.gf_new_form_modal_container .setting-row {
				margin: 0 0 10px;
			}

			.gf_new_form_modal_container .setting-row label {
				line-height: 24px;
开发者ID:nhainam,项目名称:wordpress4,代码行数:67,代码来源:form_list.php

示例4: get_views

 function get_views()
 {
     $form_count = RGFormsModel::get_form_count();
     $all_class = $this->filter == '' ? 'current' : '';
     $active_class = $this->filter == 'active' ? 'current' : '';
     $inactive_class = $this->filter == 'inactive' ? 'current' : '';
     $trash_class = $this->filter == 'trash' ? 'current' : '';
     $views = array('all' => '<a class="' . $all_class . '" href="?page=gf_edit_forms">' . esc_html(_x('All', 'Form List', 'gravityforms')) . ' <span class="count">(<span id="all_count">' . $form_count['total'] . '</span>)</span></a>', 'active' => '<a class="' . $active_class . '" href="?page=gf_edit_forms&filter=active">' . esc_html(_x('Active', 'Form List', 'gravityforms')) . ' <span class="count">(<span id="all_count">' . $form_count['active'] . '</span>)</span></a>', 'inactive' => '<a class="' . $inactive_class . '" href="?page=gf_edit_forms&filter=inactive">' . esc_html(_x('Inactive', 'Form List', 'gravityforms')) . ' <span class="count">(<span id="all_count">' . $form_count['inactive'] . '</span>)</span></a>', 'trash' => '<a class="' . $trash_class . '" href="?page=gf_edit_forms&filter=trash">' . esc_html(_x('Trash', 'Form List', 'gravityforms')) . ' <span class="count">(<span id="all_count">' . $form_count['trash'] . '</span>)</span></a>');
     return $views;
 }
开发者ID:fjbeteiligung,项目名称:development,代码行数:10,代码来源:form_list.php


注:本文中的RGFormsModel::get_form_count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。