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


PHP comment::get_pagination方法代码示例

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


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

示例1: array

                    }
                }
            }
        }
        break;
    case 'delete':
        $result = $comment->delete($commentid);
        if ($result === true) {
            echo json_encode(array('client_id' => $client_id, 'commentid' => $commentid));
        } else {
            if ($result == COMMENT_ERROR_INSUFFICIENT_CAPS) {
                $err->error = get_string('nopermissiontoeditcomment');
                echo json_encode($err);
            } else {
                if ($result == COMMENT_ERROR_DB) {
                    $err->error = get_string('dbupdatefailed');
                    echo json_encode($err);
                }
            }
        }
        break;
    case 'get':
    default:
        $ret = array();
        $comments = $comment->get_comments($page);
        $ret['list'] = $comments;
        $ret['pagination'] = $comment->get_pagination($page);
        $ret['client_id'] = $client_id;
        echo json_encode($ret);
        exit;
}
开发者ID:ajv,项目名称:Offline-Caching,代码行数:31,代码来源:comment_ajax.php

示例2: array

                echo json_encode($result);
                die;
            }
        }
        break;
    case 'delete':
        $comment_record = $DB->get_record('comments', array('id' => $commentid));
        if ($manager->can_delete($commentid) || $comment_record->userid == $USER->id) {
            if ($manager->delete($commentid)) {
                $result = array('client_id' => $client_id, 'commentid' => $commentid);
                echo json_encode($result);
                die;
            }
        }
        break;
    case 'get':
    default:
        if ($manager->can_view()) {
            $comments = $manager->get_comments($page);
            $result = array('list' => $comments, 'count' => $manager->count(), 'pagination' => $manager->get_pagination($page), 'client_id' => $client_id);
            echo json_encode($result);
            die;
        }
        break;
}
if (!isloggedin()) {
    // tell user to log in to view comments
    echo json_encode(array('error' => 'require_login'));
}
// ignore request
die;
开发者ID:evltuma,项目名称:moodle,代码行数:31,代码来源:comment_ajax.php

示例3: comment

    $args->ignore_permission = $ignore_permission;
    $manager = new comment($args);
} else {
    die;
}
// process ajax request
switch ($action) {
    case 'add':
        $result = $manager->add($content);
        if (!empty($result) && is_object($result)) {
            $result->count = $manager->count();
            $result->client_id = $client_id;
            echo json_encode($result);
        }
        break;
    case 'delete':
        $result = $manager->delete($commentid);
        if ($result === true) {
            echo json_encode(array('client_id' => $client_id, 'commentid' => $commentid));
        }
        break;
    case 'get':
    default:
        $result = array();
        $comments = $manager->get_comments($page);
        $result['list'] = $comments;
        $result['count'] = $manager->count();
        $result['pagination'] = $manager->get_pagination($page);
        $result['client_id'] = $client_id;
        echo json_encode($result);
}
开发者ID:vuchannguyen,项目名称:web,代码行数:31,代码来源:comment_ajax.php


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