本文整理汇总了PHP中feedback_get_last_break_position函数的典型用法代码示例。如果您正苦于以下问题:PHP feedback_get_last_break_position函数的具体用法?PHP feedback_get_last_break_position怎么用?PHP feedback_get_last_break_position使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了feedback_get_last_break_position函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: feedback_create_pagebreak
/**
* this creates a pagebreak.
* a pagebreak is a special kind of item
*
* @global object
* @param int $feedbackid
* @return mixed false if there already is a pagebreak on last position or the id of the pagebreak-item
*/
function feedback_create_pagebreak($feedbackid) {
global $DB;
//check if there already is a pagebreak on the last position
$lastposition = $DB->count_records('feedback_item', array('feedback'=>$feedbackid));
if ($lastposition == feedback_get_last_break_position($feedbackid)) {
return false;
}
$item = new stdClass();
$item->feedback = $feedbackid;
$item->template=0;
$item->name = '';
$item->presentation = '';
$item->hasvalue = 0;
$item->typ = 'pagebreak';
$item->position = $lastposition + 1;
$item->required=0;
return $DB->insert_record('feedback_item', $item);
}
示例2: feedback_create_pagebreak
/**
* this creates a pagebreak.
* a pagebreak is a special kind of item
* @param int $feedbackid
* @return mixed false if there already is a pagebreak on last position or the id of the pagebreak-item
*/
function feedback_create_pagebreak($feedbackid)
{
//check if there already is a pagebreak on the last position
$lastposition = count_records('feedback_item', 'feedback', $feedbackid);
if ($lastposition == feedback_get_last_break_position($feedbackid)) {
return false;
}
$item = new object();
$item->id = '';
$item->feedback = $feedbackid;
$item->template = 0;
$item->name = '';
$item->presentation = '';
$item->hasvalue = 0;
$item->typ = 'pagebreak';
$item->position = $lastposition + 1;
$item->required = 0;
return insert_record('feedback_item', $item);
}