本文整理汇总了PHP中note_get_state_names函数的典型用法代码示例。如果您正苦于以下问题:PHP note_get_state_names函数的具体用法?PHP note_get_state_names怎么用?PHP note_get_state_names使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了note_get_state_names函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: definition
/**
* Define the form for editing notes
*/
public function definition()
{
$mform =& $this->_form;
$mform->addElement('header', 'general', get_string('note', 'notes'));
$mform->addElement('textarea', 'content', get_string('content', 'notes'), array('rows' => 15, 'cols' => 40));
$mform->setType('content', PARAM_RAW);
$mform->addRule('content', get_string('nocontent', 'notes'), 'required', null, 'client');
$mform->addElement('select', 'publishstate', get_string('publishstate', 'notes'), note_get_state_names());
$mform->setDefault('publishstate', NOTES_STATE_PUBLIC);
$mform->setType('publishstate', PARAM_ALPHA);
$mform->addHelpButton('publishstate', 'publishstate', 'notes');
$this->add_action_buttons();
$mform->addElement('hidden', 'courseid');
$mform->setType('courseid', PARAM_INT);
$mform->addElement('hidden', 'userid');
$mform->setType('userid', PARAM_INT);
$mform->addElement('hidden', 'id');
$mform->setType('id', PARAM_INT);
}
示例2: redirect
}
redirect("{$CFG->wwwroot}/user/index.php?id={$id}");
}
/// Print headers
$straddnote = get_string('groupaddnewnote', 'notes');
$navlinks = array();
$navlinks[] = array('name' => $straddnote, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("{$course->shortname}: " . get_string('extendenrol'), $course->fullname, $navigation, "", "", true, " ", navmenu($course));
// this will contain all available the based On select options, but we'll disable some on them on a per user basis
print_heading($straddnote);
echo '<form method="post" action="groupaddnote.php" >';
echo '<div style="width:100%;text-align:center;">';
echo '<input type="hidden" name="id" value="' . $course->id . '" />';
echo '<input type="hidden" name="sesskey" value="' . $USER->sesskey . '" />';
$state_names = note_get_state_names();
// the first time list hack
if (empty($users)) {
foreach ($_POST as $k => $v) {
if (preg_match('/^user(\\d+)$/', $k, $m)) {
$users[] = $m[1];
}
}
}
$strpublishstate = get_string('publishstate', 'notes');
$userlist = array();
foreach ($users as $k => $v) {
if (!($user = get_record('user', 'id', $v))) {
continue;
}
echo '<input type="hidden" name="userid[' . $k . ']" value="' . $v . '" />';
示例3: note_get_state_name
/**
* Converts a state value to its corespondent name
*
* @param string $state state value to convert
* @return string corespondent state name
*/
function note_get_state_name($state)
{
// cache state names
static $states;
if (empty($states)) {
$states = note_get_state_names();
}
if (isset($states[$state])) {
return $states[$state];
} else {
return null;
}
}
示例4: note_get_state_name
/**
* Converts a state value to its corespondent name
*
* @param string $state state value to convert
* @return string corespondent state name
*/
function note_get_state_name($state)
{
// cache state names
static $states;
if (empty($states)) {
$states = note_get_state_names();
}
return @$states[$state];
}