本文整理汇总了PHP中param_integer函数的典型用法代码示例。如果您正苦于以下问题:PHP param_integer函数的具体用法?PHP param_integer怎么用?PHP param_integer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了param_integer函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_instance
public static function render_instance(BlockInstance $instance, $editing = false)
{
global $exporter;
require_once get_config('docroot') . 'artefact/lib.php';
safe_require('artefact', 'plans');
$configdata = $instance->get('configdata');
$smarty = smarty_core();
$blockid = param_integer('block', '');
$this_instance_id = $instance->get('id');
if (!$blockid or $blockid and $blockid == $this_instance_id) {
$offset = param_integer('offset', 0);
$limit = param_integer('limit', 3);
} else {
$offset = 0;
$limit = 3;
$blockid = $this_instance_id;
}
$tasks = ArtefactTypeTask::get_alltasks($blockid, $offset, $limit);
$template = 'artefact:plans:alltaskrows.tpl';
if ($exporter) {
$pagination = false;
} else {
$baseurl = $instance->get_view()->get_url();
$baseurl .= (false === strpos($baseurl, '?') ? '?' : '&') . 'block=' . $blockid;
$pagination = array('baseurl' => $baseurl, 'id' => 'block' . $blockid . '_pagination', 'datatable' => 'tasktable_' . $blockid, 'jsonscript' => 'artefact/plans/viewtasks.json.php');
}
ArtefactTypeTask::render_tasks($tasks, $template, $configdata, $pagination);
if ($exporter && $tasks['count'] > $tasks['limit']) {
$artefacturl = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $configdata['artefactid'] . '&view=' . $instance->get('view');
$tasks['pagination'] = '<a href="' . $artefacturl . '">' . get_string('alltasks', 'artefact.plans') . '</a>';
}
$smarty->assign('tasks', $tasks);
$smarty->assign('blockid', $instance->get('id'));
return $smarty->fetch('blocktype:alltasks:content.tpl');
}
示例2: render_instance
public static function render_instance(BlockInstance $instance, $editing = false)
{
require_once get_config('docroot') . 'artefact/lib.php';
$smarty = smarty_core();
$filter = param_alpha('filter', 'all');
$offset = param_integer('offset', 0);
$limit = 1000;
//get list online friend
$result_friend_online_id = get_onlinefriends($limit, $offset);
$str_eselma_online = implode(',', $result_friend_online_id['data']);
if ($str_eselma_online) {
$query_result_friend_online = "\n SELECT *\n FROM {usr}\n WHERE id in ({$str_eselma_online})\n ";
$result_friend_online = get_records_sql_array($query_result_friend_online);
}
//get list offline friend
$result_friend_offline_id = get_offlinefriends($limit, $offset);
$str_eselma_offline = implode(',', $result_friend_offline_id['data']);
if ($str_eselma_offline) {
$query_result_friend_offline = "\n SELECT *\n FROM {usr}\n WHERE id in ({$str_eselma_offline})\n ";
$result_friend_offline = get_records_sql_array($query_result_friend_offline);
}
$smarty->assign('eselma_get_online', $result_friend_online);
$smarty->assign('eselma_get_offline', $result_friend_offline);
$smarty->assign('lastminutes', floor(get_config('accessidletimeout') / 60));
$smarty->assign('eselma_count_online', $result_friend_online_id['count']);
$smarty->assign('eselma_count_offline', $result_friend_offline_id['count']);
return $smarty->fetch('blocktype:eselmaonoff:content.tpl');
}
示例3: deletetopic_submit
function deletetopic_submit(Pieform $form, $values)
{
global $SESSION;
$topicid = param_integer('id');
update_record('interaction_forum_topic', array('deleted' => 1), array('id' => $topicid));
$SESSION->add_ok_msg(get_string('deletetopicsuccess', 'interaction.forum'));
redirect('/interaction/forum/view.php?id=' . $values['forum']);
}
示例4: sendmessage_submit
function sendmessage_submit(Pieform $form, $values)
{
global $USER, $SESSION, $id;
$user = get_record('usr', 'id', $id);
send_user_message($user, $values['message'], param_integer('replyto', null));
$SESSION->add_ok_msg(get_string('messagesent', 'group'));
redirect(get_config('wwwroot') . $values['goto']);
}
示例5: instance_config_form
public static function instance_config_form($instance)
{
$configdata = $instance->get('configdata');
if (!($height = get_config('blockeditorheight'))) {
$cfheight = param_integer('cfheight', 0);
$height = $cfheight ? $cfheight * 0.7 : 150;
}
return array('text' => array('type' => 'wysiwyg', 'title' => get_string('blockcontent', 'blocktype.textbox'), 'width' => '100%', 'height' => $height . 'px', 'defaultvalue' => isset($configdata['text']) ? $configdata['text'] : ''));
}
示例6: editblog_cancel_submit
/**
* This function is called to cancel the form submission. It redirects the user
* back to the blog.
*/
function editblog_cancel_submit(Pieform $form)
{
$id = param_integer('id');
if ($data = $form->get_element('institution')) {
redirect('/artefact/blog/view/index.php?id=' . $id . '&institution=' . $data['value']);
} else {
redirect('/artefact/blog/view/index.php?id=' . $id);
}
}
示例7: render_instance
public static function render_instance(BlockInstance $instance, $editing = false)
{
global $CFG;
$configdata = $instance->get('configdata');
$result = '';
$width = !empty($configdata['width']) ? hsc($configdata['width']) : self::$default_width;
$height = !empty($configdata['height']) ? hsc($configdata['height']) : self::$default_height;
if (isset($configdata['videoid'])) {
$block = $instance->get('id');
$configuring = $block == param_integer('blockconfig', 0);
$result = GcrFileLib::getVideoEmbedHtml($configdata['videoid'], $width, $height);
}
return $result;
}
示例8: render_instance
public static function render_instance(BlockInstance $instance, $editing = false)
{
global $USER;
if ($editing) {
$smarty = smarty_core();
$smarty->assign('editing', get_string('ineditordescription1', 'blocktype.comment/comment'));
$html = $smarty->fetch('blocktype:comment:comment.tpl');
return $html;
}
// Feedback list pagination requires limit/offset params
$limit = param_integer('limit', 10);
$offset = param_integer('offset', 0);
$showcomment = param_integer('showcomment', null);
// Create the "make feedback private form" now if it's been submitted
if (param_variable('make_public_submit', null)) {
pieform(ArtefactTypeComment::make_public_form(param_integer('comment')));
} else {
if (param_variable('delete_comment_submit_x', null)) {
pieform(ArtefactTypeComment::delete_comment_form(param_integer('comment')));
}
}
$view = new View($instance->get('view'));
$submittedgroup = (int) $view->get('submittedgroup');
if ($USER->is_logged_in() && $submittedgroup && group_user_can_assess_submitted_views($submittedgroup, $USER->get('id'))) {
$releaseform = true;
} else {
$releaseform = false;
}
// If the view has comments turned off, tutors can still leave
// comments if the view is submitted to their group.
if (!empty($releaseform) || $view->user_comments_allowed($USER)) {
$addfeedbackpopup = true;
}
safe_require('artefact', 'comment');
$commentoptions = ArtefactTypeComment::get_comment_options();
$commentoptions->limit = $limit;
$commentoptions->offset = $offset;
$commentoptions->showcomment = $showcomment;
$commentoptions->view = $instance->get_view();
$feedback = ArtefactTypeComment::get_comments($commentoptions);
$smarty = smarty_core();
$smarty->assign('feedback', $feedback);
if (isset($addfeedbackpopup)) {
$smarty->assign('enablecomments', 1);
$smarty->assign('addfeedbackpopup', $addfeedbackpopup);
}
$html = $smarty->fetch('blocktype:comment:comment.tpl');
return $html;
}
示例9: instance_config_form
public static function instance_config_form(BlockInstance $instance)
{
require_once 'license.php';
$configdata = $instance->get('configdata');
if (!($height = get_config('blockeditorheight'))) {
$cfheight = param_integer('cfheight', 0);
$height = $cfheight ? $cfheight * 0.7 : 150;
}
$view = $instance->get_view();
$text = '';
if (array_key_exists('text', $configdata)) {
$text = $configdata['text'];
}
$elements = array('text' => array('type' => 'wysiwyg', 'title' => get_string('blockcontent', 'blocktype.text'), 'width' => '100%', 'height' => $height . 'px', 'defaultvalue' => $text, 'rules' => array('maxlength' => 65536)));
return $elements;
}
示例10: do_masquerade
/**
* Notify user (if configured), do the masquerading and emit event. Called when
* no (further) interaction with the admin is needed before the loginas.
*
* @param string $why The masquerading reason (if given) or null.
*/
function do_masquerade($why = null)
{
global $USER, $SESSION;
$id = param_integer('id');
$who = display_name($USER, $id);
$when = format_date(time());
if (get_config('masqueradingnotified')) {
$msg = (object) array('subject' => get_string('masqueradenotificationsubject', 'admin'), 'message' => $why === null ? get_string('masqueradenotificationnoreason', 'admin', $who, $when) : get_string('masqueradenotificationreason', 'admin', $who, $when, $why), 'users' => array($id), 'url' => profile_url($USER, false), 'urltext' => $who);
activity_occurred('maharamessage', $msg);
$SESSION->add_info_msg(get_string('masqueradenotificationdone', 'admin'));
}
$USER->change_identity_to($id);
// Permissions checking is done in here
handle_event('loginas', array('who' => $who, 'when' => $when, 'reason' => $why));
redirect(get_config('wwwroot'));
}
示例11: denyrequest_submit
function denyrequest_submit(Pieform $form, $values)
{
global $USER, $SESSION, $id;
$loggedinid = $USER->get('id');
$user = get_record('usr', 'id', $id);
// friend db record
$f = new StdClass();
$f->ctime = db_format_timestamp(time());
// notification info
$n = new StdClass();
$n->url = profile_url($USER, false);
$n->users = array($user->id);
$n->fromuser = $USER->get('id');
$lang = get_user_language($user->id);
$displayname = display_name($USER, $user);
$n->urltext = $displayname;
delete_records('usr_friend_request', 'owner', $loggedinid, 'requester', $id);
$n->subject = get_string_from_language($lang, 'friendrequestrejectedsubject', 'group');
if (isset($values['reason']) && !empty($values['reason'])) {
$n->message = get_string_from_language($lang, 'friendrequestrejectedmessagereason', 'group', $displayname) . $values['reason'];
} else {
$n->message = get_string_from_language($lang, 'friendrequestrejectedmessage', 'group', $displayname);
}
require_once 'activity.php';
activity_occurred('maharamessage', $n);
handle_event('removefriendrequest', array('owner' => $loggedinid, 'requester' => $id));
$SESSION->add_ok_msg(get_string('friendformrejectsuccess', 'group'));
$offset = param_integer('offset', 0);
switch (param_alpha('returnto', 'myfriends')) {
case 'find':
$goto = 'user/find.php';
break;
case 'view':
$goto = profile_url($user, false);
break;
default:
$goto = 'user/myfriends.php';
break;
}
$goto .= strpos($goto, '?') ? '&offset=' . $offset : '?offset=' . $offset;
$goto = get_config('wwwroot') . $goto;
redirect($goto);
}
示例12: sendmessage_submit
function sendmessage_submit(Pieform $form, $values)
{
global $USER, $SESSION, $id;
$user = get_record('usr', 'id', $id);
send_user_message($user, $values['message'], param_integer('replyto', null));
$SESSION->add_ok_msg(get_string('messagesent', 'group'));
switch (param_alpha('returnto', 'myfriends')) {
case 'find':
redirect('/user/find.php');
break;
case 'view':
redirect('/user/view.php?id=' . $id);
break;
case 'inbox':
redirect('/account/activity');
break;
default:
redirect('/user/myfriends.php');
break;
}
}
示例13: pieform_element_artefactchooser
/**
* Provides a mechanism for choosing one or more artefacts from a list of them.
*
* @param Pieform $form The form to render the element for
* @param array $element The element to render
* @return string The HTML for the element
*/
function pieform_element_artefactchooser(Pieform $form, $element)
{
global $USER, $pagination_js;
$value = $form->get_value($element);
$element['offset'] = param_integer('offset', 0);
list($html, $pagination, $count) = View::build_artefactchooser_data($element, $form->get_property('viewgroup'), $form->get_property('viewinstitution'));
$smarty = smarty_core();
$smarty->assign('datatable', $element['name'] . '_data');
$smarty->assign('artefacts', $html);
$smarty->assign('pagination', $pagination['html']);
$formname = $form->get_name();
$smarty->assign('blockinstance', substr($formname, strpos($formname, '_') + 1));
// Save the pagination javascript for later, when it is asked for. This is
// messy, but can't be helped until Pieforms goes to a more OO way of
// managing stuff.
$pagination_js = $pagination['javascript'];
$baseurl = View::make_base_url();
$smarty->assign('browseurl', $baseurl);
$smarty->assign('searchurl', $baseurl . '&s=1');
$smarty->assign('searchable', !empty($element['search']));
return $smarty->fetch('form/artefactchooser.tpl');
}
示例14: render_instance
public static function render_instance(BlockInstance $instance, $editing = false)
{
$configdata = $instance->get('configdata');
$result = '';
$width = !empty($configdata['width']) ? hsc($configdata['width']) : self::$default_width;
$height = !empty($configdata['height']) ? hsc($configdata['height']) : self::$default_height;
if (isset($configdata['videoid'])) {
// IE seems to wait for all elements on the page to load
// fully before the onload event goes off. This means the
// view editor isn't initialised until all videos have
// finished loading, and an invalid video URL can stop the
// editor from loading and result in an uneditable view.
// Therefore, when this block appears on first load of the
// view editing page, keep the embed code out of the page
// initially and add it in after the page has loaded.
$url = hsc(self::make_video_url($configdata['videoid']));
$embed = '<object width="' . $width . '" height="' . $height . '">';
$embed .= '<param name="movie" value="' . $url . '"></param>';
$embed .= '<param name="wmode" value="transparent"></param>';
$embed .= '<param name="allowscriptaccess" value="never"></param>';
$embed .= '<embed src="' . $url . '" ';
$embed .= 'type="application/x-shockwave-flash" wmode="transparent" width="' . $width . '" ';
$embed .= 'height="' . $height . '" allowscriptaccess="never"></embed></object>';
$block = $instance->get('id');
$configuring = $block == param_integer('blockconfig', 0);
$result .= '<div class="mediaplayer-container center">';
$result .= '<div id="vid_' . $block . '" class="mediaplayer" style="width: {$width}px; height: {$height}px; margin: 0 auto;">';
if (!$editing || $configuring) {
$result .= $embed;
}
$result .= '</div></div>';
if ($editing && !$configuring) {
$result .= '<script>';
$result .= 'addLoadEvent(function() {$(\'vid_' . $block . "').innerHTML = " . json_encode($embed) . ';});';
$result .= '</script>';
}
}
return $result;
}
示例15: define
/**
*
* @package mahara
* @subpackage core
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*
*/
define('INTERNAL', 1);
define('MENUITEM', 'groups');
require dirname(dirname(__FILE__)) . '/init.php';
require_once 'pieforms/pieform.php';
require_once 'group.php';
$groupid = param_integer('id');
$userid = param_integer('user');
define('GROUP', $groupid);
$group = group_current_group();
$user = get_record('usr', 'id', $userid, 'deleted', 0);
if (!$user) {
throw new UserNotFoundException(get_string('usernotfound', 'group', $userid));
}
$role = group_user_access($groupid);
if ($role != 'admin' && !group_user_can_assess_submitted_views($group->id, $USER->get('id'))) {
if (!$group->invitefriends || !is_friend($user->id, $USER->get('id'))) {
throw new AccessDeniedException(get_string('cannotinvitetogroup', 'group'));
}
}
if (record_exists('group_member', 'group', $groupid, 'member', $userid) || record_exists('group_member_invite', 'group', $groupid, 'member', $userid)) {
throw new UserException(get_string('useralreadyinvitedtogroup', 'group'));
}