本文整理汇总了PHP中wiki_get_user_info函数的典型用法代码示例。如果您正苦于以下问题:PHP wiki_get_user_info函数的具体用法?PHP wiki_get_user_info怎么用?PHP wiki_get_user_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wiki_get_user_info函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_content
function get_content()
{
global $CFG, $WS;
if ($this->content !== NULL) {
return $this->content;
}
//If we are out of a dfwiki activity or in a different
//dfwiki format course and we want to create a block:
if (empty($WS->dfwiki)) {
$this->content->text = get_string('block_warning', 'wiki');
return $this->content;
}
$this->content = new stdClass();
$this->content->items = array();
$this->content->icons = array();
//$this->content->footer = '<br />'.helpbutton ('updated', get_string('block_updated', 'wiki'), 'wiki', true, false, '', true).get_string('block_updated', 'wiki');
$ead = wiki_manager_get_instance();
$pages = $ead->get_wiki_most_uptodate_pages(10);
// dfwiki-block || course-block
$dir = "";
if ($this->instance->pagetype == "mod-wiki-view") {
$dir = $CFG->wwwroot . '/mod/wiki/view.php?id=' . $WS->cm->id;
} else {
$dir = $CFG->wwwroot . '/course/view.php?id=' . $WS->cm->course;
}
// rtl / ltr CSS alignment support (nadavkav)
if (right_to_left()) {
$nwikialignment = 'nwikirightnow';
} else {
$nwikialignment = 'nwikileftnow';
}
if (count($pages) != 0) {
$text = '<table border="0" cellpadding="0" cellspacing="0">';
$i = 1;
foreach ($pages as $page) {
$pageinfo = wiki_page_last_version($page);
$brs = strlen($page) > 12 ? '<br /> ' : '';
$text .= '<tr>
<td class="' . $nwikialignment . '">
' . $i . '- <a href="' . $dir . '&page=' . urlencode($page) . '" title="' . $page . '">' . $this->trim_string($page, 40) . '</a>' . $brs . '
- <small>(' . strftime('%d %b %y', $pageinfo->lastmodified) . ')</small>
' . wiki_get_user_info($pageinfo->author, 40, false) . '
</td>
</tr>';
$i++;
}
$text .= '</table>';
} else {
$text = get_string('nopages', 'wiki');
}
$this->content->text = $text;
return $this->content;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:53,代码来源:block_wiki_updated.php
示例2: get_content
function get_content()
{
global $CFG, $WS, $USER;
if ($this->content !== NULL) {
return $this->content;
}
$this->content = new stdClass();
$this->content->items = array();
$this->content->icons = array();
//$this->content->footer = '<br />'.helpbutton ('contributions', get_string('block_contributions', 'wiki'), 'wiki', true, false, '', true).get_string('block_contributions', 'wiki');
//$this->content->footer = '<hr />'.get_string('block_helpaboutblock', 'wiki').helpbutton ('contributions', get_string('block_contributions', 'wiki'), 'wiki', true, false, '', true);
//If we are out of a dfwiki activity or in a different
//dfwiki format course and we want to create a block:
if (empty($WS->dfwiki)) {
$this->content->text = get_string('block_warning', 'wiki');
return $this->content;
}
$ead = wiki_manager_get_instance();
$pages = $ead->user_activity($USER->username);
$dir = "";
if ($this->instance->pagetype == "mod-wiki-view") {
$dir = $CFG->wwwroot . '/mod/wiki/view.php?id=' . $WS->cm->id;
} else {
$dir = $CFG->wwwroot . '/course/view.php?id=' . $WS->cm->course;
}
if (count($pages) != 0) {
$text = '<table border="0" cellpadding="0" cellspacing="0">';
foreach ($pages as $page) {
$pageinfo = wiki_page_last_version($page);
$modif = $pageinfo->author == $USER->username ? '' : ' ' . wiki_get_user_info($pageinfo->author, 20, false);
$text .= '<tr>
<td class="nwikileftnow">
<a href="' . $dir . '&page=' . urlencode($page) . '&gid=' . $WS->groupmember->groupid . '&uid=' . $WS->member->id . '" title="' . urlencode($page) . '">' . format_text($this->trim_string($page, 30), FORMAT_PLAIN) . '</a>' . $modif . '
</td>
</tr>';
}
$text .= '</table>';
} else {
$text = get_string('nopages', 'wiki');
}
$this->content->text = $text;
return $this->content;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:43,代码来源:block_wiki_contributions.php
示例3: print_delete_version
/**
* Prints lists of versions which can be deleted
*
* @global core_renderer $OUTPUT
* @global moodle_page $PAGE
*/
private function print_delete_version() {
global $OUTPUT, $PAGE;
$pageid = $this->page->id;
// versioncount is the latest version
$versioncount = wiki_count_wiki_page_versions($pageid) - 1;
$versions = wiki_get_wiki_page_versions($pageid, 0, $versioncount);
// We don't want version 0 to be displayed
// version 0 is blank page
if (end($versions)->version == 0) {
array_pop($versions);
}
$contents = array();
$version0page = wiki_get_wiki_page_version($this->page->id, 0);
$creator = wiki_get_user_info($version0page->userid);
$a = new stdClass();
$a->date = userdate($this->page->timecreated, get_string('strftimedaydatetime', 'langconfig'));
$a->username = fullname($creator);
echo $OUTPUT->heading(get_string('createddate', 'wiki', $a), 4, 'wiki_headingtime');
if ($versioncount > 0) {
/// If there is only one version, we don't need radios nor forms
if (count($versions) == 1) {
$row = array_shift($versions);
$username = wiki_get_user_info($row->userid);
$picture = $OUTPUT->user_picture($username);
$date = userdate($row->timecreated, get_string('strftimedate', 'langconfig'));
$time = userdate($row->timecreated, get_string('strftimetime', 'langconfig'));
$versionid = wiki_get_version($row->id);
$versionlink = new moodle_url('/mod/wiki/viewversion.php', array('pageid' => $pageid, 'versionid' => $versionid->id));
$userlink = new moodle_url('/user/view.php', array('id' => $username->id, 'course' => $PAGE->cm->course));
$picturelink = $picture . html_writer::link($userlink->out(false), fullname($username));
$historydate = $OUTPUT->container($date, 'wiki_histdate');
$contents[] = array('', html_writer::link($versionlink->out(false), $row->version), $picturelink, $time, $historydate);
//Show current version
$table = new html_table();
$table->head = array('', get_string('version'), get_string('user'), get_string('modified'), '');
$table->data = $contents;
$table->attributes['class'] = 'mdl-align';
echo html_writer::table($table);
} else {
$lastdate = '';
$rowclass = array();
foreach ($versions as $version) {
$user = wiki_get_user_info($version->userid);
$picture = $OUTPUT->user_picture($user, array('popup' => true));
$date = userdate($version->timecreated, get_string('strftimedate'));
if ($date == $lastdate) {
$date = '';
$rowclass[] = '';
} else {
$lastdate = $date;
$rowclass[] = 'wiki_histnewdate';
}
$time = userdate($version->timecreated, get_string('strftimetime', 'langconfig'));
$versionid = wiki_get_version($version->id);
if ($versionid) {
$url = new moodle_url('/mod/wiki/viewversion.php', array('pageid' => $pageid, 'versionid' => $versionid->id));
$viewlink = html_writer::link($url->out(false), $version->version);
} else {
$viewlink = $version->version;
}
$userlink = new moodle_url('/user/view.php', array('id' => $version->userid, 'course' => $PAGE->cm->course));
$picturelink = $picture . html_writer::link($userlink->out(false), fullname($user));
$historydate = $OUTPUT->container($date, 'wiki_histdate');
$radiofromelement = $this->choose_from_radio(array($version->version => null), 'fromversion', 'M.mod_wiki.deleteversion()', $versioncount, true);
$radiotoelement = $this->choose_from_radio(array($version->version => null), 'toversion', 'M.mod_wiki.deleteversion()', $versioncount, true);
$contents[] = array( $radiofromelement . $radiotoelement, $viewlink, $picturelink, $time, $historydate);
}
$table = new html_table();
$table->head = array(get_string('deleteversions', 'wiki'), get_string('version'), get_string('user'), get_string('modified'), '');
$table->data = $contents;
$table->attributes['class'] = 'generaltable mdl-align';
$table->rowclasses = $rowclass;
///Print the form
echo html_writer::start_tag('form', array('action'=>new moodle_url('/mod/wiki/admin.php'), 'method' => 'post'));
echo html_writer::tag('div', html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'pageid', 'value' => $pageid)));
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'option', 'value' => $this->view));
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));
echo html_writer::table($table);
echo html_writer::start_tag('div', array('class' => 'mdl-align'));
echo html_writer::empty_tag('input', array('type' => 'submit', 'class' => 'wiki_form-button', 'value' => get_string('deleteversions', 'wiki')));
echo html_writer::end_tag('div');
echo html_writer::end_tag('form');
}
} else {
//.........这里部分代码省略.........
开发者ID:Burick,项目名称:moodle,代码行数:101,代码来源:pagelib.php
示例4: print_version_view
/**
* Given an old page version, output the version content
*
* @global object $CFG
* @global object $OUTPUT
* @global object $PAGE
*/
private function print_version_view()
{
global $CFG, $OUTPUT, $PAGE;
$pageversion = wiki_get_version($this->version->id);
if ($pageversion) {
$restorelink = new moodle_url('/mod/wiki/restoreversion.php', array('pageid' => $this->page->id, 'versionid' => $this->version->id));
echo $OUTPUT->heading(get_string('viewversion', 'wiki', $pageversion->version) . '<br />' . html_writer::link($restorelink->out(false), '(' . get_string('restorethis', 'wiki') . ')', array('class' => 'wiki_restore')) . ' ', 4);
$userinfo = wiki_get_user_info($pageversion->userid);
$heading = '<p><strong>' . get_string('modified', 'wiki') . ':</strong> ' . userdate($pageversion->timecreated, get_string('strftimedatetime', 'langconfig'));
$viewlink = new moodle_url('/user/view.php', array('id' => $userinfo->id));
$heading .= ' <strong>' . get_string('user') . ':</strong> ' . html_writer::link($viewlink->out(false), fullname($userinfo));
$heading .= ' → ' . $OUTPUT->user_picture(wiki_get_user_info($pageversion->userid), array('popup' => true)) . '</p>';
print_container($heading, false, 'mdl-align wiki_modifieduser wiki_headingtime');
$options = array('swid' => $this->subwiki->id, 'pretty_print' => true, 'pageid' => $this->page->id);
$pageversion->content = file_rewrite_pluginfile_urls($pageversion->content, 'pluginfile.php', $this->modcontext->id, 'mod_wiki', 'attachments', $this->subwiki->id);
$parseroutput = wiki_parse_content($pageversion->contentformat, $pageversion->content, $options);
$content = print_container(format_text($parseroutput['parsed_text'], FORMAT_HTML, array('overflowdiv' => true)), false, '', '', true);
echo $OUTPUT->box($content, 'generalbox wiki_contentbox');
} else {
print_error('versionerror', 'wiki');
}
}
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:29,代码来源:pagelib.php
示例5: wiki_ead_activestusers
function wiki_ead_activestusers()
{
global $WS;
//load ead tools
$ead = wiki_manager_get_instance();
$users = $ead->activestusers();
echo '<h1>' . get_string('activestusers', 'wiki') . '</h1>';
echo '<div class="box generalbox generalboxcontent boxaligncenter">';
//mount table
$table->head = array(get_string('rank', 'wiki'), get_string('user'), get_string('participations', 'wiki'), get_string('participationin', 'wiki'));
$table->wrap = array('nowrap', '', '', '');
$table->width = '100%';
$table->align = array('center', 'center', 'center', 'center');
$num = 1;
foreach ($users as $user) {
$pages = $ead->user_activity($user);
foreach ($pages as $key => $page) {
$pages[$key] = '<a href="view.php?id=' . $WS->linkid . '&page=' . urlencode($page) . '">' . $page . '</a>';
}
$row = array($num, wiki_get_user_info($user), $ead->user_num_activity($user), implode(',', $pages));
$table->data[] = $row;
$num++;
}
print_table($table);
echo '</div>';
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:26,代码来源:lib.php
示例6: wiki_info_content
//.........这里部分代码省略.........
$prop->header = "true";
$prop->valign = "top";
$prop->class = "nwikileftnow header c2";
wiki_change_column($prop);
echo get_string('lastmodified');
if (wiki_grade_got_permission($WS)) {
$prop = null;
$prop->header = "true";
$prop->valign = "top";
$prop->class = "nwikileftnow header c3";
wiki_change_column($prop);
echo get_string('eval_editions_quality', 'wiki');
}
$prop = null;
$prop->header = "true";
//print content
$i = 0;
foreach ($vers as $ver) {
if ($ver->highlight) {
$class = "textcenter nwikihighlight";
} else {
$class = "textcenter nwikibargroundblanco";
}
if (isset($prop->header)) {
$prop->class = $class;
wiki_change_row($prop);
} else {
$prop = null;
$prop->class = $class;
wiki_change_row($prop);
}
// input types for history diff
if ($countver > 1) {
$style = 'style="visibility:hidden" ';
$checked = 'checked="checked"';
if ($i == 0) {
echo '<input type="radio" value="' . $ver->version . '" name="oldid" ' . $style . ' />';
echo '<input type="radio" value="' . $ver->version . '" name="diff" ' . $checked . ' />';
} elseif ($i == 1) {
echo '<input type="radio" value="' . $ver->version . '" name="oldid" ' . $checked . ' />';
echo '<input type="radio" value="' . $ver->version . '" name="diff" ' . $style . ' />';
} else {
echo '<input type="radio" value="' . $ver->version . '" name="oldid" />';
echo '<input type="radio" value="' . $ver->version . '" name="diff" ' . $style . ' />';
}
$prop = null;
$prop->class = $class;
wiki_change_column($prop);
}
if ($ver->version == $WS->pagedata->version) {
echo $ver->version;
} else {
$prop = null;
$prop->href = "javascript:document.forms['formu" . $i . "'].submit()";
$out = wiki_a($ver->version, $prop, true);
$prop = null;
$prop->name = "dfcontent";
$prop->value = "11";
$out .= wiki_input_hidden($prop, true);
$out2 = wiki_div($out, '', true);
$prop = null;
$prop->id = "formu{$i}";
$prop->action = "view.php?id={$WS->linkid}&page=" . urlencode("oldversion/{$ver->pagename}") . "&ver={$ver->version}&gid={$WS->groupmember->groupid}&uid={$WS->member->id}";
$prop->method = "post";
wiki_form($out2, $prop);
}
$prop = null;
$prop->class = $class;
wiki_change_column($prop);
$author = wiki_get_user_info($ver->author);
echo $author;
$prop = null;
$prop->class = $class;
wiki_change_column($prop);
$modified = strftime('%A, %d %B %Y %H:%M', $ver->lastmodified);
echo $modified;
if (wiki_grade_got_permission($WS)) {
$prop = null;
$prop->class = $class;
wiki_change_column($prop);
$scale = array(1 => "+", 2 => "=", 3 => "-");
$gradevalue = get_field_select('wiki_evaluation_edition', 'valoration', 'wiki_pageid=' . $ver->id);
if ($gradevalue) {
echo wiki_grade_translate($gradevalue, $scale);
} else {
echo get_string('eval_notset', 'wiki');
}
}
$i++;
}
wiki_table_end();
if ($countver > 1) {
echo '<br/>';
echo '<input type="submit" name="' . get_string('compareversions', 'wiki') . '" value="' . get_string('compareversions', 'wiki') . '"/>';
}
echo '</form>';
} else {
print_string('noversion', 'wiki');
}
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:101,代码来源:locallib.php
示例7: wiki_sintax_create_internal_link
function wiki_sintax_create_internal_link(&$linktext)
{
global $WS, $itinerary, $CFG, $COURSE;
$res = '';
//separate type link from link text
$parts = explode(":", $linktext);
if (count($parts) == 1) {
$linktype = 'internal';
$linkname = $parts[0];
} else {
$linktype = $parts[0];
$linkname = $parts[1];
}
switch ($linktype) {
case 'internal':
//normal internal links
//separate linktext into pagename and text
$parts = explode("|", $linkname);
if (count($parts) == 1) {
$linkpage = trim($parts[0]);
$linktext = $parts[0];
} else {
$linkpage = trim($parts[0]);
$linktext = $parts[1];
}
if (isset($itinerary)) {
if (!wiki_page_exists($WS, $linkpage)) {
$res = '<b><u>' . $linktext . '</u></b><a target="popup" href="' . $CFG->wwwroot . '/mod/wiki/view.php?a=' . $itinerary['dfwiki'] . '&page=' . urlencode($linkpage) . '&gid=' . $WS->groupmember->groupid . '&uid=' . $WS->member->id . '">?</a>';
} else {
$res = '<a href="view.php?id=' . $WS->cm->id . '&page=' . urlencode($linkpage) . '&gid=' . $WS->groupmember->groupid . '&uid=' . $WS->member->id . '&name=dfwikipage">' . $linkpage . '</a>';
}
} else {
if (wiki_page_exists($WS, $linkpage)) {
//if the page already exists
if (isset($WS->dfcourse)) {
//course internal link:
$res = '<a href="view.php?id=' . $COURSE->id . '&page=' . urlencode($linkpage) . '&gid=' . $WS->groupmember->groupid . '&uid=' . $WS->member->id . '">' . $linktext . '</a>';
} else {
//module internal link:
$res = '<a href="view.php?id=' . $WS->cm->id . '&page=' . urlencode($linkpage) . '&gid=' . $WS->groupmember->groupid . '&uid=' . $WS->member->id . '">' . $linktext . '</a>';
}
} else {
//to create the page
$res = '<b><u>' . $linktext . '</u></b><a href="view.php?id=' . $WS->linkid . '&page=' . urlencode($linkpage) . '&gid=' . $WS->groupmember->groupid . '&uid=' . $WS->member->id . '">?</a>';
}
}
//save link into log
if (!isset($WS->parser_logs['internal'])) {
$WS->parser_logs['internal'] = array();
}
if (!in_array($linkpage, $WS->parser_logs['internal'])) {
$WS->parser_logs['internal'][] = $linkpage;
}
break;
case 'user':
$res = wiki_get_user_info($linkname, 25);
break;
case 'attach':
$res = '[' . wiki_upload_url($linkname, $WS) . ' ' . $linkname . ']';
break;
default:
//error
}
return $res;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:65,代码来源:sintax.php
示例8: wiki_print_recent_activity
/**
* Given a course and a time, this module should find recent activity
* that has occurred in newmodule activities and print it out.
* Return true if there was output, or false is there was none.
*
* @param object $course
* @param bool $isteacher
* @param int $timestart
* @return boolean true on success, false on failure.
**/
function wiki_print_recent_activity($course, $isteacher, $timestart)
{
/// Given a course and a time, this module should find recent activity
/// that has occurred in dfwiki activities and print it out.
/// Return true if there was output, or false is there was none.
global $CFG, $WS;
// get all wiki instances used in the course
if (!($dfwikis = get_all_instances_in_course('wiki', $course))) {
return false;
}
$ead = wiki_manager_get_instance();
$allpages = array();
// get all new pages (10 pages , no date search) for those wikis
foreach ($dfwikis as $dfwiki) {
$allpages[$dfwiki->id] = array($dfwiki, $ead->get_wiki_most_uptodate_pages(10, $dfwiki));
}
foreach ($allpages as $instance) {
$dfwiki = $instance[0];
$pages = $instance[1];
$dir = $CFG->wwwroot . '/mod/wiki/view.php?id=' . $dfwiki->coursemodule;
$text = "<h3>{$dfwiki->name}</h3>";
if (count($pages) != 0) {
$text .= '<table border="0" cellpadding="0" cellspacing="0">';
$i = 1;
foreach ($pages as $page) {
//$pageinfo = wiki_page_last_version ($page);
$pageinfo = $ead->get_wiki_page_by_pagename($dfwiki, $page);
$brs = '';
//(strlen($page)>12)? '<br /> ' : '';
$text .= '<tr>
<td class="nwikipagesupdates">
' . $i . '- <a href="' . $dir . '&page=' . urlencode($page) . '" title="' . $page . '">' . ltrim($page, 20) . '</a>' . $brs . '
- <small>(' . strftime('%d %b %y', $pageinfo->lastmodified) . ')</small><br/>
' . wiki_get_user_info($pageinfo->author) . '
</td>
</tr>';
$i++;
}
$text .= '</table>';
} else {
$text = get_string('nopages', 'wiki');
}
echo $text;
}
return true;
// True if anything was printed, otherwise false
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:57,代码来源:lib.php
示例9: wiki_sintax_create_internal_link_bis
function wiki_sintax_create_internal_link_bis(&$linktext)
{
global $WS, $USER, $itinerary;
$WS->member->id = $USER->id;
if ($WS->dfwiki->studentmode == '0') {
$WS->member->id = '0';
}
$res = '';
//separate type link from link text
$parts = explode(":", $linktext);
if (count($parts) == 1) {
$linktype = 'internal';
$linkname = $parts[0];
} else {
$linktype = $parts[0];
$linkname = $parts[1];
}
switch ($linktype) {
case 'internal':
//normal internal links
//separate linktext into pagename and text
$parts = explode("|", $linkname);
if (count($parts) == 1) {
$linkpage = $parts[0];
$linktext = $parts[0];
} else {
$linkpage = $parts[0];
$linktext = $parts[1];
}
$cleanpagename = clean_filename($linkpage);
if (isset($itinerary)) {
if (!wiki_page_exists($WS, $linkpage)) {
$res = '<b><u>' . $linktext . '</u></b><a target="popup" href="' . $linkpage . '.html">?</a>';
} else {
$res = '<a href="' . $cleanpagename . '.html">' . $linkpage . '</a>';
}
} else {
if (wiki_page_exists($WS, $linkpage)) {
//if the page already exists
$res = '<a href="' . $cleanpagename . '.html">' . $linktext . '</a>';
} else {
//to create the page
$res = '<b><u>' . $linktext . '</u></b><a href="' . $linkpage . '.html">?</a>';
}
}
//save link into log
if (!isset($WS->parser_logs['internal'])) {
$WS->parser_logs['internal'] = array();
}
if (!in_array($linkpage, $WS->parser_logs['internal'])) {
$WS->parser_logs['internal'][] = $linkpage;
}
break;
case 'user':
$res = wiki_get_user_info($linkname, 25);
break;
case 'attach':
wiki_upload_config($WS);
$res = '[' . wiki_upload_url($linkname, $WS) . ' ' . $linkname . ']';
break;
default:
//error
}
return $res;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:65,代码来源:sintax.php
注:本文中的wiki_get_user_info函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论